From: Jukka Kurttila Date: Thu, 22 Apr 2010 17:48:17 +0000 (+0300) Subject: Custom button added to main window class. X-Git-Tag: help X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=3c962ddb12c601dedb626af17bd631dbb0557f49 Custom button added to main window class. --- diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 9d9984d..04cb3f2 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -58,6 +58,20 @@ MainWindow::MainWindow(QWidget *parent) : 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)"); + /* + QIcon* icon = new QIcon(); + icon->addFile(QString(":/new/prefix1/Graphics/Speedometer.png"), QSize(125,125), QIcon::Normal, QIcon::Off); + icon->addFile(QString(":/new/prefix1/Graphics/Speedometer2.png"), QSize(125,125), QIcon::Normal, QIcon::On); + + customButtonAccelerate = new CustomButton(this,icon); + delete icon; + + int buttons_x = 50,buttons_y = 165; + customButtonAccelerate->setGeometry(buttons_x,buttons_y,130,130); + connect(customButtonAccelerate, SIGNAL(OpenDialog()), this, SLOT(OpenAccStartDialog())); + + customButtonAccelerate->show(); + */ } MainWindow::~MainWindow() @@ -84,6 +98,10 @@ MainWindow::~MainWindow() if(helpDialog) delete helpDialog; +/* + if(customButtonAccelerate) + delete customButtonAccelerate; +*/ } void MainWindow::changeEvent(QEvent *e) @@ -322,3 +340,14 @@ void MainWindow::setUsernameToMainPanel() this->setWindowTitle("SpeedFreak - Not logged"); } } +/** + * This slot function opens acceleration start dialog. + */ +void MainWindow::OpenAccStartDialog() +{ + if(!accstart) + accstart = new accelerationstart(this); + connect(accstart, SIGNAL(sendresult(QString, double)), this, SLOT(clientSendResult(QString, double))); + connect(accstart, SIGNAL(rejected()), this, SLOT(killDialog())); + accstart->show(); +} diff --git a/Client/mainwindow.h b/Client/mainwindow.h index 4a99582..3c1ae06 100644 --- a/Client/mainwindow.h +++ b/Client/mainwindow.h @@ -26,6 +26,7 @@ #include "routedialog.h" #include "resultdialog.h" #include "helpdialog.h" +#include "custombutton.h" namespace Ui { @@ -55,6 +56,8 @@ private: Ui::MainWindow *ui; void setListViewTopList(QString category, int size); + CustomButton* customButtonAccelerate; + private slots: void on_pushButtonResults_clicked(); void on_pushButtonAccelerate_clicked(); @@ -72,6 +75,7 @@ private slots: void showTop10(); void killDialog(); void setUsernameToMainPanel(); + void OpenAccStartDialog(); };