X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fmainwindow.cpp;h=a3044630f72dfd0fa0dab8475b22b6f18d056b44;hp=8a462492295f16657e52c467634143d714373397;hb=efc4980fa8468a91aceaa1738dcb365bf59770ad;hpb=75e2328492951629d43639bbc6dd63ed76185218 diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 8a46249..a304463 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -12,6 +12,7 @@ #include #include #include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -26,6 +27,12 @@ MainWindow::MainWindow(QWidget *parent) : creditsDialog = new CreditsDialog; routeSaveDialog = new RouteSaveDialog; settingsDialog = new SettingsDialog; + 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); welcomeDialog = new WelcomeDialog; welcomeDialog->show(); @@ -36,6 +43,9 @@ MainWindow::~MainWindow() delete ui; delete routeSaveDialog; + + if(!accstart) + delete accstart; } void MainWindow::changeEvent(QEvent *e) @@ -69,3 +79,33 @@ void MainWindow::on_pushButtonSettings_clicked() { settingsDialog->show(); } + +void MainWindow::on_pushButtonAccelerate_clicked() +{ + if(!accstart) + accstart = new accelerationstart(this); + accstart->show(); +} + +void MainWindow::on_pushButtonResults_clicked() +{ + topResultDialog->show(); +} + +/** + *This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked. + */ +void MainWindow::clientRequestCategoryList() +{ + httpClient->requestCategories(); +} + +/** + *This slot function is called when ever mytTopResultDialog emits signal refreshTopList button clicked. + */ +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); +}