X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=Client%2Fmainwindow.cpp;h=04aeb97c14c03b815e11139237c5b0893f28afd4;hb=5786051c926ebc119ffe39c3e55f9a5652db68c1;hp=56c7238e28e23fc53d3e2c450a65af521ccf8345;hpb=3fa5091583bdd9421a4ecd5851d954e9bed58731;p=speedfreak diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 56c7238..04aeb97 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -49,14 +49,6 @@ MainWindow::MainWindow(QWidget *parent) : this->setUsernameToMainPanel(); - //Button settings - ui->pushButtonSettings->setAutoFillBackground(true); - 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)"); - //Create icon for acceleration start button QIcon* icon = new QIcon(); icon->addFile(QString(":/new/prefix1/Graphics/Speedometer.png"), QSize(125,125), QIcon::Normal, QIcon::Off); @@ -101,6 +93,49 @@ MainWindow::MainWindow(QWidget *parent) : customButtonResults->setGeometry(buttons_x,buttons_y,130,130); connect(customButtonResults, SIGNAL(OpenDialog()), this, SLOT(OpenResultDialog())); customButtonResults->show(); + //Create icon for settings dialog button + icon = new QIcon(); + icon->addFile(QString(":/new/prefix1/Graphics/settings.png"), QSize(125,125), QIcon::Normal, QIcon::Off); + icon->addFile(QString(":/new/prefix1/Graphics/settings_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On); + + //Settings dialog button + + customButtonSettings = new CustomButton(this,icon); + delete icon; + + buttons_x += 140; + customButtonSettings->setGeometry(buttons_x,buttons_y,130,130); + connect(customButtonSettings, SIGNAL(OpenDialog()), this, SLOT(OpenSettingsDialog())); + customButtonSettings->show(); + + //Create icon for www page button + icon = new QIcon(); + icon->addFile(QString(":/new/prefix1/Graphics/applications_internet.png"), QSize(125,125), QIcon::Normal, QIcon::Off); + icon->addFile(QString(":/new/prefix1/Graphics/applications_internet_selected.png"), QSize(125,125), QIcon::Normal, QIcon::On); + + //WWW page button + + customButtonWWW = new CustomButton(this,icon); + delete icon; + + buttons_x += 140; + customButtonWWW->setGeometry(buttons_x,buttons_y,130,130); + connect(customButtonWWW, SIGNAL(OpenDialog()), this, SLOT(OpenWWWPage())); + customButtonWWW->show(); + + //Create icon for help dialog button + icon = new QIcon(); + icon->addFile(QString(":/new/prefix1/Graphics/info.png"), QSize(105,105), QIcon::Normal, QIcon::Off); + icon->addFile(QString(":/new/prefix1/Graphics/info_selected.png"), QSize(105,105), QIcon::Normal, QIcon::On); + + //Help dialog button + + customButtonHelp = new CustomButton(this,icon); + delete icon; + + customButtonHelp->setGeometry(670,10,105,105); + connect(customButtonHelp, SIGNAL(OpenDialog()), this, SLOT(OpenHelpDialog())); + customButtonHelp->show(); } /** @@ -137,7 +172,12 @@ MainWindow::~MainWindow() delete customButtonRoute; if(customButtonResults) delete customButtonResults; - + if(customButtonSettings) + delete customButtonSettings; + if(customButtonWWW) + delete customButtonWWW; + if(customButtonHelp) + delete customButtonHelp; } /** @@ -156,34 +196,6 @@ void MainWindow::changeEvent(QEvent *e) } /** - * 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() -{ - if(!helpDialog) - helpDialog = new HelpDialog; - - connect(helpDialog, SIGNAL(rejected()), this, SLOT(killDialog())); - helpDialog->show(); -} - -/** - * This slot function opens the settings dialog - */ -void MainWindow::on_pushButtonSettings_clicked() -{ - settingsDialog->show(); -} - -/** *This slot function is called when ever mytTopResultDialog emits signal refreshCategoryList button clicked. */ void MainWindow::clientRequestCategoryList() @@ -207,7 +219,7 @@ void MainWindow::clientRequestTopList(int index) } /** - *This function is used to set items to category combobox. Top-tab view. + *This function is used to set items to category combobox. *@param */ void MainWindow::setCategoryCompoBox() @@ -271,11 +283,14 @@ void MainWindow::clientUserLogin() /** * This function send route data to server. + * @param QString oldName, old file name + * @param QString newName, new file name + * @param int i */ -void MainWindow::clientSendRoute() +void MainWindow::clientSendRoute(QString oldName, QString newName, int i) { if(httpClient) - httpClient->sendRouteXml(); + httpClient->sendRouteXml(oldName, newName, i); } /** @@ -304,7 +319,7 @@ void MainWindow::killDialog() } if(routeSaveDialog) { - qDebug() << "__MW kill: routeSaveDialog"; + //qDebug() << "__MW kill: routeSaveDialog"; //delete routeSaveDialog; //routeSaveDialog = NULL; } @@ -362,7 +377,7 @@ void MainWindow::OpenRouteDialog() if(!routeSaveDialog) routeSaveDialog = new RouteSaveDialog; - connect(routeSaveDialog, SIGNAL(sendroute()), this, SLOT(clientSendRoute())); + connect(routeSaveDialog, SIGNAL(sendroute(QString,QString,int)), this, SLOT(clientSendRoute(QString,QString,int))); connect(routeSaveDialog, SIGNAL(rejected()), this, SLOT(killDialog())); routeSaveDialog->show(); } @@ -380,6 +395,31 @@ void MainWindow::OpenResultDialog() connect(topResultDialog, SIGNAL(rejected()), this, SLOT(killDialog())); topResultDialog->show(); } +/** + * This slot function opens the settings dialog + */ +void MainWindow::OpenSettingsDialog() +{ + settingsDialog->show(); +} +/** + * This slot function opens browser to project www page. + */ +void MainWindow::OpenWWWPage() +{ + QDesktopServices::openUrl(QUrl("http://garage.maemo.org/projects/speedfreak/")); +} +/** + * This slot function opens the main help dialog + */ +void MainWindow::OpenHelpDialog() +{ + if(!helpDialog) + helpDialog = new HelpDialog; + + connect(helpDialog, SIGNAL(rejected()), this, SLOT(killDialog())); + helpDialog->show(); +} /** * This slot function save user profile data to server