From 188021aca5821b74cc990bbd1f9b8c4ff75cb29e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Janne=20=C3=84n=C3=A4kk=C3=A4l=C3=A4?= Date: Wed, 21 Apr 2010 10:11:22 +0300 Subject: [PATCH] Login bug fixed. Now result can't send to server without login. --- Client/mainwindow.cpp | 2 +- Client/resultdialog.cpp | 7 ++++--- Client/settingsdialog.cpp | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 7706106..7b04b08 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -150,7 +150,7 @@ void MainWindow::on_pushButtonAccelerate_clicked() if(!accstart) accstart = new accelerationstart(this); connect(accstart, SIGNAL(sendresult(QString, double)), this, SLOT(clientSendResult(QString, double))); - connect(topResultDialog, SIGNAL(rejected()), this, SLOT(killDialog())); + connect(accstart, SIGNAL(rejected()), this, SLOT(killDialog())); accstart->show(); } diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index e53db80..0662fe2 100644 --- a/Client/resultdialog.cpp +++ b/Client/resultdialog.cpp @@ -69,6 +69,9 @@ ResultDialog::ResultDialog(QWidget *parent) : timeArray[i] = 0; } + //Clear info label + ui->labelInfoToUser->setText(""); + if (loginSaved()) { ui->pushButtonSend->setEnabled(true); @@ -76,10 +79,8 @@ ResultDialog::ResultDialog(QWidget *parent) : else { ui->pushButtonSend->setEnabled(false); + ui->labelInfoToUser->setText("You're not logged! Please register or log in and accelerate again."); } - - //Clear info label - ui->labelInfoToUser->setText(""); } /** diff --git a/Client/settingsdialog.cpp b/Client/settingsdialog.cpp index ab584e9..fb5d7c0 100644 --- a/Client/settingsdialog.cpp +++ b/Client/settingsdialog.cpp @@ -199,5 +199,8 @@ void SettingsDialog::usernameOk(bool isOk) ui->setUserPushButton->setText("Log in"); ui->setUserUsernameLineEdit->clear(); ui->setUserPasswordLineEdit->clear(); + this->username = ui->setUserUsernameLineEdit->text(); + this->password = ui->setUserPasswordLineEdit->text(); + saveLogin( this->username, this->password); } } -- 1.7.9.5