#include <QUrl>
#include <QSettings>
#include <QDebug>
+#include "usersettings.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
settingsDialog = new SettingsDialog;
connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(clientUserLogin()));
+ connect(settingsDialog, SIGNAL(logout()), this, SLOT(setUsernameToMainPanel()));
httpClient = new HttpClient(this);
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
welcomeDialog = new WelcomeDialog;
welcomeDialog->show();
+ this->setUsernameToMainPanel();
+
//Button settings
ui->pushButtonAccelerate->setAutoFillBackground(true);
ui->pushButtonAccelerate->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
*/
void MainWindow::clientUserLogin()
{
+ connect(httpClient, SIGNAL(loginOK()), this, SLOT(setUsernameToMainPanel()));
httpClient->checkLogin();
}
accstart = NULL;
}
}
+
+void MainWindow::setUsernameToMainPanel()
+{
+ if (loginSaved())
+ {
+ this->setWindowTitle("SpeedFreak - " + settingsDialog->getUserName());
+ }
+ else
+ {
+ this->setWindowTitle("SpeedFreak - Not logged");
+ }
+}