summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Rettberg2018-08-01 15:04:44 +0200
committerSimon Rettberg2018-08-01 15:04:44 +0200
commitf400c9647bfad8f91edb16bc3c4f7e12a8a21246 (patch)
tree32f688a003317886268d2685e4d9bff089682b4c /src
parent[server] Deduplicate code for student -> tutor streaming (diff)
downloadpvs2-f400c9647bfad8f91edb16bc3c4f7e12a8a21246.tar.gz
pvs2-f400c9647bfad8f91edb16bc3c4f7e12a8a21246.tar.xz
pvs2-f400c9647bfad8f91edb16bc3c4f7e12a8a21246.zip
[client] ConnectWindow: Restore green checkmark, fix messages
The green checkmark signalling a successful connection was broken in commit:e19dcdfe so we restore that. When connecting to a manager directly (room dropdown), a message displaying the last entered session id was shown instead. This closes #3393
Diffstat (limited to 'src')
-rw-r--r--src/client/connectwindow/connectwindow.cpp20
-rw-r--r--src/client/connectwindow/connectwindow.h2
2 files changed, 3 insertions, 19 deletions
diff --git a/src/client/connectwindow/connectwindow.cpp b/src/client/connectwindow/connectwindow.cpp
index c77a5e6..1f6d549 100644
--- a/src/client/connectwindow/connectwindow.cpp
+++ b/src/client/connectwindow/connectwindow.cpp
@@ -75,7 +75,7 @@ void ConnectWindow::updateUserInterface()
if (_state == Connected) {
_ui->btn_connection->setEnabled(true);
_ui->btn_connection->setText(tr("&Disconnect"));
- _ui->lblStatus->setText(tr("Connected to %1").arg(clientApp->connection()->getPeerAdress()));
+ _ui->lblStatus->setText(tr("Connected to %1").arg(_currentSession.isEmpty() ? _currentIp : _currentSession));
_ui->lineEditName->setEnabled(false);
_ui->stackedWidget->setCurrentIndex(1);
return;
@@ -91,7 +91,7 @@ void ConnectWindow::updateUserInterface()
_ui->lblStatus->setText(tr("Ready to connect."));
break;
case Scanning:
- _ui->lblStatus->setText(tr("Scanning for session %1.").arg(_ui->lineEditName->text()));
+ _ui->lblStatus->setText(tr("Scanning for session %1.").arg(_currentSession.isEmpty() ? _currentIp : _currentSession));
break;
case Connecting:
_ui->lblStatus->setText(tr("Found session, connecting..."));
@@ -106,7 +106,6 @@ void ConnectWindow::updateUserInterface()
_ui->lblStatus->setText(tr("Logging in..."));
break;
case Connected:
- _ui->lblStatus->setText(tr("Connection established!"));
break;
case InvalidCert:
_ui->lblStatus->setText(tr("Invalid certificate."));
@@ -312,6 +311,7 @@ void ConnectWindow::onConnectionStateChange(ConnectWindow::ConnectionState state
++_hashSslErrorCount;
_state = state;
+ this->updateUserInterface();
if (reset) {
_state = Scanning;
@@ -321,21 +321,7 @@ void ConnectWindow::onConnectionStateChange(ConnectWindow::ConnectionState state
QObject::disconnect(_pendingConnection, SIGNAL(destroyed(QObject*)), this, SLOT(onConnectionClosed(QObject*)));
emit connected(_pendingConnection);
_pendingConnection = nullptr;
-
- this->updateUserInterface();
-
_timerHide = startTimer(2000);
- } else {
- this->updateUserInterface();
- }
-
-}
-
-void ConnectWindow::onComboBox_keyPressed(QKeyEvent* e)
-{
- qDebug() << "key released";
- if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return ) {
- qDebug() << "enter pressed";
}
}
diff --git a/src/client/connectwindow/connectwindow.h b/src/client/connectwindow/connectwindow.h
index af45db6..a6c7942 100644
--- a/src/client/connectwindow/connectwindow.h
+++ b/src/client/connectwindow/connectwindow.h
@@ -93,8 +93,6 @@ protected slots:
// void onUdpReadyRead();
void onServerDetected(const QString& host, const quint16 port, const QByteArray& sessionName, const QByteArray& certHash, bool autoConnect);
- void onComboBox_keyPressed(QKeyEvent* e);
-
public slots:
/** actually connects the connection **/
void DoConnect();