From: Artem Daniliants Date: Tue, 9 Mar 2010 11:41:12 +0000 (+0200) Subject: Merge branch 'master' of https://vcs.maemo.org/git/speedfreak X-Git-Tag: v0.1~68 X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=588f121bdf0616c349a12001b8695196d56d7e21;hp=0c4cd6615af98749df86575e5731b725f14a6b29 Merge branch 'master' of https://vcs.maemo.org/git/speedfreak --- diff --git a/Client/carmainwindow.cpp b/Client/carmainwindow.cpp index ee146ff..5ec9688 100644 --- a/Client/carmainwindow.cpp +++ b/Client/carmainwindow.cpp @@ -47,9 +47,12 @@ CarMainWindow::CarMainWindow(QWidget *parent):QMainWindow(parent), ui(new Ui::Ca timer->setInterval(300); connect(this->timer, SIGNAL(timeout()), this, SLOT(after_timeout())); + connect(myLogin, SIGNAL( userNameChanged()), this, SLOT(updateUserName())); ui->labelMeasureTabResult->hide(); + this->setWindowTitle("Speed bfreak"); + } /** @@ -233,10 +236,7 @@ void CarMainWindow::on_pushButton_clicked() */ void CarMainWindow::on_loginLogoutButton_clicked() { - //LoginWindow myLogin; - myLogin->show(); - //ui->loginLogoutButton->setText("logout"); } /** @@ -589,3 +589,22 @@ void CarMainWindow::on_pushButtonSendResult_clicked() { emit sendresult(); } + +void CarMainWindow::updateUserName() +{ + QString newUserName; + + newUserName = myLogin->getUserName(); + ui->userNameLabel->setText( "User: " + newUserName); + + if (newUserName.length()) + { + ui->setUserPushButton->setText( "Change User"); + this->setWindowTitle("Speed freak - " + newUserName); + } + else + { + ui->setUserPushButton->setText( "Set User"); + this->setWindowTitle("Speed freak"); + } +} diff --git a/Client/carmainwindow.h b/Client/carmainwindow.h index dcf047e..95b95a5 100644 --- a/Client/carmainwindow.h +++ b/Client/carmainwindow.h @@ -83,6 +83,7 @@ private: signals: void speedAchieved(); void sendresult(); +void userNameChanged(); private slots: void on_pushButtonSendResult_clicked(); @@ -108,6 +109,7 @@ private slots: void errorFromServer(QNetworkReply* reply); void after_timeout(); + void updateUserName(); }; #endif // CARMAINWINDOW_H diff --git a/Client/loginwindow.cpp b/Client/loginwindow.cpp index faa535d..330b782 100644 --- a/Client/loginwindow.cpp +++ b/Client/loginwindow.cpp @@ -9,7 +9,6 @@ #include "loginwindow.h" #include "ui_loginwindow.h" -#include LoginWindow::LoginWindow(QWidget *parent) : QDialog(parent), @@ -47,6 +46,8 @@ void LoginWindow::on_loginPushButton_clicked() { this->username = ui->userNameLineEdit->text(); this->password = ui->passwordLineEdit->text(); + + emit userNameChanged(); close(); } diff --git a/Client/loginwindow.h b/Client/loginwindow.h index 1ffb7ff..08fb43a 100644 --- a/Client/loginwindow.h +++ b/Client/loginwindow.h @@ -36,6 +36,8 @@ private: private slots: void on_loginPushButton_clicked(); void on_cancelPushButton_clicked(); +signals: + void userNameChanged(); }; #endif // LOGINWINDOW_H