X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fmainwindow.cpp;h=bb1e6719431fb7c444d08ffc5f601a09cbba3d70;hp=cbe784689aad76789ef2ce4eaa36c2cefa39e201;hb=e1fb08eb319b50ddae0c5ce9a23a1ddfc6cc15d3;hpb=aac224124a13e699b1880e3df8b2f1e116a662ee diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index cbe7846..bb1e671 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -26,19 +26,23 @@ MainWindow::MainWindow(QWidget *parent) : 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(); @@ -143,7 +147,6 @@ void MainWindow::clientRequestCategoryList() */ 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); } @@ -154,7 +157,6 @@ void MainWindow::clientRequestTopList(int index) */ void MainWindow::setCategoryCompoBox() { - qDebug() << "_setCategoryCompoBox"; topResultDialog->setCompoBoxCategories(httpClient->myXmlreader->myCategoryList->getCategoryList()); } @@ -164,7 +166,6 @@ void MainWindow::setCategoryCompoBox() */ void MainWindow::showTop10() { - qDebug() << "_showTop10"; int ind = topResultDialog->getRecentCategoryIndex(); setListViewTopList(httpClient->myXmlreader->myCategoryList->getRecentCategory(ind), topResultDialog->getLimitNr()); } @@ -176,16 +177,12 @@ void MainWindow::showTop10() */ 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(); } @@ -193,7 +190,19 @@ void MainWindow::regUserToServer() /** * This function performs login to server */ -void MainWindow::userLogin() +void MainWindow::clientUserLogin() { httpClient->checkLogin(); } + +void MainWindow::clientSendRoute() +{ + httpClient->sendRouteXml(); +} + +void MainWindow::clientSendResult(double result) +{ + if(accstart) { + httpClient->sendResultXml(accstart->getMeasureCategory(), result); + } +}