From 351a0f90c2b210e80a9ed9055714fd48d406e1f7 Mon Sep 17 00:00:00 2001 From: Jukka Kurttila Date: Tue, 27 Apr 2010 13:12:12 +0300 Subject: [PATCH] Start acceleration measurement button changed to custom button. --- Client/mainwindow.cpp | 26 +++++++------------------- Client/mainwindow.h | 1 - Client/mainwindow.ui | 27 --------------------------- Client/speedfreak.pro | 8 +++++--- 4 files changed, 12 insertions(+), 50 deletions(-) diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index b2342f6..741b179 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -46,8 +46,8 @@ MainWindow::MainWindow(QWidget *parent) : this->setUsernameToMainPanel(); //Button settings - ui->pushButtonAccelerate->setAutoFillBackground(true); - ui->pushButtonAccelerate->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + //ui->pushButtonAccelerate->setAutoFillBackground(true); + //ui->pushButtonAccelerate->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); ui->pushButtonRoute->setAutoFillBackground(true); ui->pushButtonRoute->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); ui->pushButtonResults->setAutoFillBackground(true); @@ -58,7 +58,7 @@ 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); @@ -71,7 +71,7 @@ MainWindow::MainWindow(QWidget *parent) : connect(customButtonAccelerate, SIGNAL(OpenDialog()), this, SLOT(OpenAccStartDialog())); customButtonAccelerate->show(); - */ + } MainWindow::~MainWindow() @@ -98,10 +98,10 @@ MainWindow::~MainWindow() if(helpDialog) delete helpDialog; -/* + if(customButtonAccelerate) delete customButtonAccelerate; -*/ + } void MainWindow::changeEvent(QEvent *e) @@ -158,19 +158,6 @@ void MainWindow::on_pushButtonSettings_clicked() } /** - * This slot function opens the acceleration dialog - */ -void MainWindow::on_pushButtonAccelerate_clicked() -{ - 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(); -} - -/** * This slot function opens the top results dialog */ void MainWindow::on_pushButtonResults_clicked() @@ -349,6 +336,7 @@ 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 3c1ae06..9fe56f7 100644 --- a/Client/mainwindow.h +++ b/Client/mainwindow.h @@ -60,7 +60,6 @@ private: private slots: void on_pushButtonResults_clicked(); - void on_pushButtonAccelerate_clicked(); void on_pushButtonSettings_clicked(); void on_pushButtonRoute_clicked(); void on_pushButtonCredits_clicked(); diff --git a/Client/mainwindow.ui b/Client/mainwindow.ui index 0bec122..0580f42 100644 --- a/Client/mainwindow.ui +++ b/Client/mainwindow.ui @@ -14,33 +14,6 @@ SpeedFreak - - - - 50 - 150 - 130 - 130 - - - - - - - - :/new/prefix1/Graphics/Speedometer.png - :/new/prefix1/Graphics/Speedometer2.png - :/new/prefix1/Graphics/Speedometer2.png - :/new/prefix1/Graphics/Speedometer2.png - :/new/prefix1/Graphics/Speedometer2.png:/new/prefix1/Graphics/Speedometer.png - - - - 125 - 125 - - - diff --git a/Client/speedfreak.pro b/Client/speedfreak.pro index dd99248..74cc7e2 100644 --- a/Client/speedfreak.pro +++ b/Client/speedfreak.pro @@ -37,7 +37,8 @@ SOURCES += main.cpp \ helpresultsdialog.cpp \ helpaccelerationdialog.cpp \ helproutingdialog.cpp \ - helpsettingsdialog.cpp + helpsettingsdialog.cpp \ + custombutton.cpp HEADERS += mainwindow.h \ creditsdialog.h \ routedialog.h \ @@ -65,7 +66,8 @@ HEADERS += mainwindow.h \ helpresultsdialog.h \ helpaccelerationdialog.h \ helproutingdialog.h \ - helpsettingsdialog.h + helpsettingsdialog.h \ + custombutton.h FORMS += mainwindow.ui \ creditsdialog.ui \ routedialog.ui \ @@ -88,7 +90,7 @@ contains(QT_CONFIG, hildon):CONFIG += hildon CONFIG += link_pkgconfig # Enable this to disable debugging -#DEFINES += QT_NO_DEBUG_OUTPUT +# DEFINES += QT_NO_DEBUG_OUTPUT target.path += /usr/lib devincludes.files = $$HEADERS devincludes.path += /usr/include/$$TEMPLATE$$TARGET -- 1.7.9.5