QCoreApplication::setOrganizationDomain("fudeco.com");
QCoreApplication::setApplicationName("Speed Freak");
+ routeDialog = new RouteDialog;
+ accstart = NULL;
+
creditsDialog = new CreditsDialog;
routeSaveDialog = new RouteSaveDialog;
+ routeDialog = new RouteDialog;
+ connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
settingsDialog = new SettingsDialog;
- connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(regUserToServer()));
- connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(userLogin()));
+ connect(settingsDialog,SIGNAL(sendregistration()),this,SLOT(clientRegUserToServer()));
+ connect(settingsDialog,SIGNAL(userNameChanged()),this,SLOT(clientUserLogin()));
topResultDialog = new TopResultDialog;
connect(topResultDialog, SIGNAL(refreshCategoryList()), this, SLOT(clientRequestCategoryList()));
connect(topResultDialog, SIGNAL(refreshTopList(int)), this, SLOT(clientRequestTopList(int)));
httpClient->requestRegistration();
}
+/**
+ * This function performs login to server
+ */
- void MainWindow::userLogin()
+ void MainWindow::clientUserLogin()
{
httpClient->checkLogin();
}
#include "accelerationstart.h"
#include "topresultdialog.h"
#include "httpclient.h"
+#include "routedialog.h"
+ #include "resultdialog.h"
+
+
namespace Ui {
class MainWindow;
}
accelerationstart* accstart;
TopResultDialog *topResultDialog;
HttpClient *httpClient;
+ RouteDialog *routeDialog;
+ ResultDialog *resultDialog;
protected:
void changeEvent(QEvent *e);
{
ui->setupUi(this);
this->setWindowTitle("Settings");
- this->ui->regEMailLineEdit->setText("@meili.fi");
+ this->ui->regEMailLineEdit->setText("@");
instructionsDialog = new InstructionsDialog;
+
+ if (loginSaved())
+ {
+ QString uName, pWord;
+
+ getLoginInfo( &uName, &pWord);
+ this->username = uName;
+ this->password = pWord;
+
+ ui->setUserPasswordLineEdit->setText(this->password);
+ ui->setUserUsernameLineEdit->setText(this->username);
+
+ // Already someone as user - change button text to "Change"
+ ui->setUserPushButton->setText("Change user");
+ }
}
SettingsDialog::~SettingsDialog()
this->username = ui->setUserUsernameLineEdit->text();
this->password = ui->setUserPasswordLineEdit->text();
+ // Save these also to usersettings
+ saveLogin( this->username, this->password);
+
+ // Set "Set/Change User" button text
+ if (this->username.length() > 0)
+ {
+ ui->setUserPushButton->setText("Change user");
+ }
+ else
+ { // Username "cleared"
+ ui->setUserPushButton->setText("Set user");
+ }
+
emit userNameChanged();
- close();
+
+ //close(); //using close() hides popup-window which reports error from server
}
// Next 4 functions can be removed if Settingsdialog is implemented without