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)));
- accstart = NULL;
-
httpClient = new HttpClient(this);
connect(httpClient->myXmlreader, SIGNAL(receivedCategoryList()), this, SLOT(setCategoryCompoBox()));
connect(httpClient->myXmlreader, SIGNAL(receivedTop10List()), this, SLOT(showTop10()));
+ resultDialog = new ResultDialog;
+ connect(resultDialog, SIGNAL(sendResult(double)), this, SLOT(clientSendResult(double)));
welcomeDialog = new WelcomeDialog;
welcomeDialog->show();
ui->pushButtonSettings->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
ui->pushButtonWWW->setAutoFillBackground(true);
ui->pushButtonWWW->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
+ ui->pushButtonCredits->setAutoFillBackground(true);
+ ui->pushButtonCredits->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
}
MainWindow::~MainWindow()
{
delete ui;
delete routeSaveDialog;
+ delete routeDialog;
if(accstart)
delete accstart;
}
}
+/**
+ * This slot function opens browser to project www page.
+ */
void MainWindow::on_pushButtonWWW_clicked()
{
QDesktopServices::openUrl(QUrl("http://garage.maemo.org/projects/speedfreak/"));
}
+/**
+ * This slot function opens the credits dialog
+ */
void MainWindow::on_pushButtonCredits_clicked()
{
creditsDialog->show();
}
+/**
+ * This slot function opens the route save dialog
+ */
void MainWindow::on_pushButtonRoute_clicked()
{
routeSaveDialog->show();
}
+/**
+ * This slot function opens the settings dialog
+ */
void MainWindow::on_pushButtonSettings_clicked()
{
settingsDialog->show();
}
+/**
+ * This slot function opens the acceleration dialog
+ */
void MainWindow::on_pushButtonAccelerate_clicked()
{
if(!accstart)
accstart->show();
}
+/**
+ * This slot function opens the top results dialog
+ */
void MainWindow::on_pushButtonResults_clicked()
{
topResultDialog->show();
*/
void MainWindow::clientRequestTopList(int index)
{
- qDebug() << "index" << index << httpClient->myXmlreader->myCategoryList->getRecentCategory(index);
QString limit = QString::number(topResultDialog->getLimitNr());
httpClient->requestTopList(httpClient->myXmlreader->myCategoryList->getRecentCategory(index), limit);
}
*/
void MainWindow::setCategoryCompoBox()
{
- qDebug() << "_setCategoryCompoBox";
topResultDialog->setCompoBoxCategories(httpClient->myXmlreader->myCategoryList->getCategoryList());
}
*/
void MainWindow::showTop10()
{
- qDebug() << "_showTop10";
int ind = topResultDialog->getRecentCategoryIndex();
setListViewTopList(httpClient->myXmlreader->myCategoryList->getRecentCategory(ind), topResultDialog->getLimitNr());
}
*/
void MainWindow::setListViewTopList(QString category, int size)
{
- qDebug() << "_setListViewTopList" << category;
QString topList;
topList.append(httpClient->myXmlreader->myCategoryList->getTopList(category, size));
topResultDialog->showTopList(topList);
}
-void MainWindow::regUserToServer()
+void MainWindow::clientRegUserToServer()
{
httpClient->requestRegistration();
}
-void MainWindow::userLogin()
+/**
+ * This function performs login to server
+ */
+void MainWindow::clientUserLogin()
{
httpClient->checkLogin();
}
+
+void MainWindow::clientSendRoute()
+{
+ httpClient->sendRouteXml();
+}
+
+void MainWindow::clientSendResult(double result)
+{
+ if(accstart) {
+ httpClient->sendResultXml(accstart->getMeasureCategory(), result);
+ }
+}