diff options
Diffstat (limited to 'src/client/connectwindow/connectwindow.cpp')
-rw-r--r-- | src/client/connectwindow/connectwindow.cpp | 20 |
1 files changed, 3 insertions, 17 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"; } } |