The remote client now runs in an extra thread, fixing issue #29

This commit is contained in:
Max-Wilhelm Bruker 2012-03-25 13:19:40 +02:00
parent 542fd2c5c8
commit 4e4a7563db
26 changed files with 130 additions and 79 deletions

View file

@ -15,6 +15,7 @@
#include "pending_command.h"
#include "pb/room_commands.pb.h"
#include "pb/serverinfo_game.pb.h"
#include "pb/response.pb.h"
void DlgCreateGame::sharedCtor()
{
@ -177,19 +178,19 @@ void DlgCreateGame::actOK()
}
PendingCommand *pend = room->prepareRoomCommand(cmd);
connect(pend, SIGNAL(finished(Response::ResponseCode)), this, SLOT(checkResponse(Response::ResponseCode)));
connect(pend, SIGNAL(finished(Response, CommandContainer, QVariant)), this, SLOT(checkResponse(Response)));
room->sendRoomCommand(pend);
okButton->setEnabled(false);
cancelButton->setEnabled(false);
}
void DlgCreateGame::checkResponse(Response::ResponseCode response)
void DlgCreateGame::checkResponse(const Response &response)
{
okButton->setEnabled(true);
cancelButton->setEnabled(true);
if (response == Response::RespOk)
if (response.response_code() == Response::RespOk)
accept();
else {
QMessageBox::critical(this, tr("Error"), tr("Server error."));