QCoreApplication::setApplicationName("Speed Freak");
routeDialog = new RouteDialog;
- creditsDialog = new CreditsDialog;
+ connect(routeDialog,SIGNAL(sendroute()),this,SLOT(clientSendRoute()));
+
routeSaveDialog = new RouteSaveDialog;
+
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()), this, SLOT(clientSendResult()));
+
+ accstart = NULL;
+
+ creditsDialog = new CreditsDialog;
+
welcomeDialog = new WelcomeDialog;
welcomeDialog->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);
}
-/**
- * This function performs registration to server
- */
-void MainWindow::regUserToServer()
+void MainWindow::clientRegUserToServer()
{
httpClient->requestRegistration();
}
/**
* This function performs login to server
*/
-void MainWindow::userLogin()
+void MainWindow::clientUserLogin()
{
httpClient->checkLogin();
}
+
+/**
+ * This function send route to server
+ */
+void MainWindow::clientSendRoute()
+{
+ httpClient->sendRouteXml();
+}
+
+/**
+ * This function send acceleration data to server
+ */
+void MainWindow::clientSendResult()
+{
+ qDebug() << "_clientSendResult";
+ if(accstart) {
+ qDebug() << "_clientSendResult, calling server";
+ httpClient->sendResultXml(accstart->getMeasureCategory(), resultDialog->getResult());
+ }
+}