Merge remote-tracking branch 'upstream/master' into cmake_qt5

This commit is contained in:
Fabio Bas 2014-07-03 16:40:04 +02:00
commit e9895d643f
9 changed files with 30 additions and 6 deletions

View file

@ -15,7 +15,7 @@ RemoteClient::RemoteClient(QObject *parent)
: AbstractClient(parent), timeRunning(0), lastDataReceived(0), messageInProgress(false), handshakeStarted(false), messageLength(0)
{
timer = new QTimer(this);
timer->setInterval(1000);
timer->setInterval(9000);
connect(timer, SIGNAL(timeout()), this, SLOT(ping()));
socket = new QTcpSocket(this);
@ -23,7 +23,7 @@ RemoteClient::RemoteClient(QObject *parent)
connect(socket, SIGNAL(connected()), this, SLOT(slotConnected()));
connect(socket, SIGNAL(readyRead()), this, SLOT(readData()));
connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slotSocketError(QAbstractSocket::SocketError)));
connect(this, SIGNAL(serverIdentificationEventReceived(const Event_ServerIdentification &)), this, SLOT(processServerIdentificationEvent(const Event_ServerIdentification &)));
connect(this, SIGNAL(connectionClosedEventReceived(Event_ConnectionClosed)), this, SLOT(processConnectionClosedEvent(Event_ConnectionClosed)));
connect(this, SIGNAL(sigConnectToServer(QString, unsigned int, QString, QString)), this, SLOT(doConnectToServer(QString, unsigned int, QString, QString)));
@ -47,12 +47,12 @@ void RemoteClient::slotConnected()
{
timeRunning = lastDataReceived = 0;
timer->start();
// dirty hack to be compatible with v14 server
sendCommandContainer(CommandContainer());
getNewCmdId();
// end of hack
setStatus(StatusAwaitingWelcome);
}
@ -208,7 +208,7 @@ void RemoteClient::ping()
pend->deleteLater();
}
}
int maxTime = timeRunning - lastDataReceived;
emit maxPingTime(maxTime, maxTimeout);
if (maxTime >= maxTimeout) {

View file

@ -34,6 +34,10 @@ TabMessage::TabMessage(TabSupervisor *_tabSupervisor, AbstractClient *_client, c
retranslateUi();
setLayout(vbox);
setFocusProxy(sayEdit);
chatView->setFocusProxy(sayEdit);
sayEdit->setFocus();
}
TabMessage::~TabMessage()

View file

@ -9,6 +9,7 @@
#include <QLabel>
#include <QToolButton>
#include <QSplitter>
#include <QTimer>
#include "tab_supervisor.h"
#include "tab_room.h"
#include "tab_userlists.h"
@ -97,6 +98,10 @@ TabRoom::TabRoom(TabSupervisor *_tabSupervisor, AbstractClient *_client, ServerI
const int gameListSize = info.game_list_size();
for (int i = 0; i < gameListSize; ++i)
gameSelector->processGameInfo(info.game_list(i));
setFocusProxy(sayEdit);
chatView->setFocusProxy(sayEdit);
QTimer::singleShot(0, sayEdit, SLOT(setFocus()));
}
TabRoom::~TabRoom()

View file

@ -241,7 +241,7 @@ void MainWindow::loginError(Response::ResponseCode r, QString reasonStr, quint32
{
switch (r) {
case Response::RespWrongPassword:
QMessageBox::critical(this, tr("Error"), tr("Invalid login data."));
QMessageBox::critical(this, tr("Error"), tr("Incorrect username or password. Please check your authentication information and try again."));
break;
case Response::RespWouldOverwriteOldSession:
QMessageBox::critical(this, tr("Error"), tr("There is already an active session using this user name.\nPlease close that session first and re-login."));