X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Fmainwindow.cpp;h=a3044630f72dfd0fa0dab8475b22b6f18d056b44;hp=91ca8a4cad51ea63f8f260b2c94e13dc8a0ce501;hb=efc4980fa8468a91aceaa1738dcb365bf59770ad;hpb=5eaf25a74891b70869413649f48fc2b169e2c8d4 diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 91ca8a4..a304463 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -11,6 +11,8 @@ #include #include +#include +#include MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), @@ -18,8 +20,22 @@ MainWindow::MainWindow(QWidget *parent) : { ui->setupUi(this); + QCoreApplication::setOrganizationName("Fudeco Oy"); + QCoreApplication::setOrganizationDomain("fudeco.com"); + QCoreApplication::setApplicationName("Speed Freak"); + 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(); } MainWindow::~MainWindow() @@ -27,6 +43,9 @@ MainWindow::~MainWindow() delete ui; delete routeSaveDialog; + + if(!accstart) + delete accstart; } void MainWindow::changeEvent(QEvent *e) @@ -55,3 +74,38 @@ void MainWindow::on_pushButtonRoute_clicked() { routeSaveDialog->show(); } + +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); +}