From e1433788e9e93b87272527aae8670d38c1b18149 Mon Sep 17 00:00:00 2001 From: Toni Jussila Date: Mon, 26 Apr 2010 15:09:10 +0300 Subject: [PATCH] Added Info button for all dialog. --- Client/accelerationstart.cpp | 32 +++++++++++- Client/accelerationstart.h | 4 ++ Client/accelerationstartdialog.ui | 103 +++++++++++++++++++++++-------------- Client/resultdialog.cpp | 31 +++++++++++ Client/resultdialog.h | 4 ++ Client/resultdialog.ui | 27 +++++++++- Client/routedialog.cpp | 29 +++++++++++ Client/routedialog.h | 4 ++ Client/routedialog.ui | 29 +++++++++-- Client/routesavedialog.cpp | 29 +++++++++++ Client/routesavedialog.h | 4 ++ Client/routesavedialog.ui | 23 +++++++++ Client/settingsdialog.cpp | 44 ++++++++++++++-- Client/settingsdialog.h | 5 +- Client/settingsdialog.ui | 31 ++++++++--- Client/topresultdialog.cpp | 34 +++++++++++- Client/topresultdialog.h | 5 +- Client/topresultdialog.ui | 26 +++++++++- 18 files changed, 401 insertions(+), 63 deletions(-) diff --git a/Client/accelerationstart.cpp b/Client/accelerationstart.cpp index 6214897..00c3160 100644 --- a/Client/accelerationstart.cpp +++ b/Client/accelerationstart.cpp @@ -1,7 +1,7 @@ /* * Acceleration start dialog * - * @author Jukka Kurttila + * @author Jukka Kurttila * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License @@ -9,6 +9,7 @@ #include "accelerationstart.h" #include "ui_accelerationstartdialog.h" #include +#include accelerationstart::accelerationstart(QWidget *parent) : QDialog(parent), @@ -18,6 +19,7 @@ accelerationstart::accelerationstart(QWidget *parent) : ui->buttonStart->setDisabled(true); accRealTimeDialog = NULL; + helpAccelerationDialog = NULL; stopMeasureSpeed = 0; @@ -32,6 +34,8 @@ accelerationstart::accelerationstart(QWidget *parent) : ui->buttonCalib->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); ui->buttonStart->setAutoFillBackground(true); ui->buttonStart->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + ui->pushButtonInfo->setAutoFillBackground(true); + ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); } accelerationstart::~accelerationstart() @@ -112,3 +116,29 @@ void accelerationstart::sendResult(double result) { emit sendresult(measureCategory, result); } + +/** + * This slot function called when ever info button clicked. + */ +void accelerationstart::on_pushButtonInfo_clicked() +{ + if(!helpAccelerationDialog) + { + helpAccelerationDialog = new HelpAccelerationDialog; + } + connect(helpAccelerationDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpAccelerationDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void accelerationstart::killHelpDialog() +{ + if(helpAccelerationDialog) + { + qDebug() << "__Acc kill: helpAccelerationDialog"; + delete helpAccelerationDialog; + helpAccelerationDialog = NULL; + } +} diff --git a/Client/accelerationstart.h b/Client/accelerationstart.h index 1a0aec6..1f0dd47 100644 --- a/Client/accelerationstart.h +++ b/Client/accelerationstart.h @@ -11,6 +11,7 @@ #include #include "accrealtimedialog.h" +#include namespace Ui { class accelerationstart; @@ -23,6 +24,7 @@ public: ~accelerationstart(); AccRealTimeDialog* accRealTimeDialog; QString getMeasureCategory(); + HelpAccelerationDialog *helpAccelerationDialog; protected: void changeEvent(QEvent *e); @@ -34,10 +36,12 @@ private: QString measureCategory; private slots: + void on_pushButtonInfo_clicked(); void on_categorComboBox_currentIndexChanged(int index); void on_buttonStart_clicked(); void on_buttonCalib_clicked(); void sendResult(double); + void killHelpDialog(); signals: void sendresult(QString, double); diff --git a/Client/accelerationstartdialog.ui b/Client/accelerationstartdialog.ui index 80ea11a..4a47833 100644 --- a/Client/accelerationstartdialog.ui +++ b/Client/accelerationstartdialog.ui @@ -39,51 +39,74 @@ :/new/prefix1/Graphics/sf_2.png - + - 590 + 750 0 - 201 - 381 + 50 + 50 - - - - - - - - - :/new/prefix1/Graphics/Speedometer_calibrate.png:/new/prefix1/Graphics/Speedometer_calibrate.png - - - - 125 - 125 - - - - - - - - - - - - :/new/prefix1/Graphics/Speedometer_start.png:/new/prefix1/Graphics/Speedometer_start.png - - - - 125 - 125 - - - - - + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + + + + + 591 + 210 + 147 + 135 + + + + + + + + :/new/prefix1/Graphics/Speedometer_start.png:/new/prefix1/Graphics/Speedometer_start.png + + + + 125 + 125 + + + + + + + 591 + 35 + 147 + 135 + + + + + + + + :/new/prefix1/Graphics/Speedometer_calibrate.png:/new/prefix1/Graphics/Speedometer_calibrate.png + + + + 125 + 125 + + diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index 774390b..a5f5d32 100644 --- a/Client/resultdialog.cpp +++ b/Client/resultdialog.cpp @@ -13,6 +13,7 @@ #include "math.h" #include #include +#include const int DIAGRAM_WIDTH = 400; const int DIAGRAM_HEIGHT = 300; @@ -57,6 +58,9 @@ ResultDialog::ResultDialog(QWidget *parent) : ui(new Ui::ResultDialog) { ui->setupUi(this); + + helpAccelerationDialog = NULL; + timeAxelLength = 10; resultString = ""; speedList << "0" << "10" << "20" << "30" << "40" << "50" << "60" << "70" << "80" << "90" << "100" ; @@ -768,3 +772,30 @@ void ResultDialog::setSendServerButtonEnabled() { ui->pushButtonSend->setEnabled(true); } + +/** + * This slot function called when ever info button clicked. + */ +void ResultDialog::on_pushButtonInfo_clicked() +{ + if(!helpAccelerationDialog) + { + helpAccelerationDialog = new HelpAccelerationDialog; + } + connect(helpAccelerationDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpAccelerationDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void ResultDialog::killHelpDialog() +{ + if(helpAccelerationDialog) + { + qDebug() << "__Result kill: helpAccelerationDialog"; + delete helpAccelerationDialog; + helpAccelerationDialog = NULL; + } +} + diff --git a/Client/resultdialog.h b/Client/resultdialog.h index 2fac623..752b790 100644 --- a/Client/resultdialog.h +++ b/Client/resultdialog.h @@ -11,6 +11,7 @@ #define RESULTDIALOG_H #include +#include namespace Ui { @@ -22,6 +23,7 @@ class ResultDialog : public QDialog { public: ResultDialog(QWidget *parent = 0); ~ResultDialog(); + HelpAccelerationDialog *helpAccelerationDialog; void setEnd(int pValue); void setValue(int pSpeed, double pTime); @@ -55,8 +57,10 @@ private: QString resultString; private slots: + void on_pushButtonInfo_clicked(); void on_pushButtonNew_clicked(); void on_pushButtonSend_clicked(); + void killHelpDialog(); }; #endif // RESULTDIALOG_H diff --git a/Client/resultdialog.ui b/Client/resultdialog.ui index 8846941..974628a 100644 --- a/Client/resultdialog.ui +++ b/Client/resultdialog.ui @@ -188,7 +188,32 @@ User info label + + + + 750 + 0 + 50 + 50 + + + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + - + + + diff --git a/Client/routedialog.cpp b/Client/routedialog.cpp index e51d8d0..f0806c8 100644 --- a/Client/routedialog.cpp +++ b/Client/routedialog.cpp @@ -174,6 +174,9 @@ RouteDialog::RouteDialog(QWidget *parent) : { qDebug() << "__RouteDialog"; ui->setupUi(this); + + helpRoutingDialog = NULL; + this->setWindowTitle("Route"); left = 5; top = 5; right = 495; bottom = 295; // Limits in screen coordinates @@ -840,3 +843,29 @@ void RouteDialog::checkLogin() ui->labelInfoToUser->setText("You're not logged! Please register or log in."); } } + +/** + * This slot function called when ever info button clicked. + */ +void RouteDialog::on_pushButtonInfo_clicked() +{ + if(!helpRoutingDialog) + { + helpRoutingDialog = new HelpRoutingDialog; + } + connect(helpRoutingDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpRoutingDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void RouteDialog::killHelpDialog() +{ + if(helpRoutingDialog) + { + qDebug() << "__Route kill: helpRoutingDialog"; + delete helpRoutingDialog; + helpRoutingDialog = NULL; + } +} diff --git a/Client/routedialog.h b/Client/routedialog.h index 85d4aad..dd453dd 100644 --- a/Client/routedialog.h +++ b/Client/routedialog.h @@ -11,6 +11,7 @@ #define ROUTEDIALOG_H #include +#include namespace Ui { class RouteDialog; @@ -29,6 +30,7 @@ public: int getBottom(); void setLabelInfoToUser(QString infoText); void setSendServerButtonEnabled(); + HelpRoutingDialog *helpRoutingDialog; signals: void sendroute(); @@ -43,8 +45,10 @@ private: void checkLogin(); private slots: + void on_pushButtonInfo_clicked(); void on_sendPushButton_clicked(); void on_newPushButton_clicked(); + void killHelpDialog(); }; #endif // ROUTEDIALOG_H diff --git a/Client/routedialog.ui b/Client/routedialog.ui index 8063b03..e0d9c77 100644 --- a/Client/routedialog.ui +++ b/Client/routedialog.ui @@ -17,7 +17,7 @@ 670 - 110 + 150 90 90 @@ -40,7 +40,7 @@ 670 - 10 + 50 90 90 @@ -63,7 +63,7 @@ 650 - 210 + 250 141 81 @@ -104,6 +104,29 @@ User info + + + + 750 + 0 + 50 + 50 + + + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + diff --git a/Client/routesavedialog.cpp b/Client/routesavedialog.cpp index c67c99c..ba7100a 100644 --- a/Client/routesavedialog.cpp +++ b/Client/routesavedialog.cpp @@ -24,6 +24,7 @@ RouteSaveDialog::RouteSaveDialog(QWidget *parent) : routeDialog = NULL; location = NULL; gpsData = NULL; + helpRoutingDialog = NULL; //Button settings buttonStatus = true; @@ -36,6 +37,8 @@ RouteSaveDialog::RouteSaveDialog(QWidget *parent) : ui->buttonRouteStartStop->setIcon(*iconRouteStart); ui->buttonRouteStartStop->setAutoFillBackground(true); ui->buttonRouteStartStop->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + ui->pushButtonInfo->setAutoFillBackground(true); + ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); //Satellite picture and label ui->labelRouteSatelliteStatus->setVisible(0); @@ -266,3 +269,29 @@ void RouteSaveDialog::sendRoute() { emit sendroute(); //Emit mainwindow clientSendRoute } + +/** + * This slot function called when ever info button clicked. + */ +void RouteSaveDialog::on_pushButtonInfo_clicked() +{ + if(!helpRoutingDialog) + { + helpRoutingDialog = new HelpRoutingDialog; + } + connect(helpRoutingDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpRoutingDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void RouteSaveDialog::killHelpDialog() +{ + if(helpRoutingDialog) + { + qDebug() << "__Route save kill: helpRoutingDialog"; + delete helpRoutingDialog; + helpRoutingDialog = NULL; + } +} diff --git a/Client/routesavedialog.h b/Client/routesavedialog.h index 64d1da5..186cbf8 100644 --- a/Client/routesavedialog.h +++ b/Client/routesavedialog.h @@ -17,6 +17,7 @@ #include #include "gpsdata.h" #include "routedialog.h" +#include namespace Ui { class RouteSaveDialog; @@ -28,6 +29,7 @@ public: RouteSaveDialog(QWidget *parent = 0); ~RouteSaveDialog(); RouteDialog *routeDialog; + HelpRoutingDialog *helpRoutingDialog; protected: void changeEvent(QEvent *e); @@ -46,11 +48,13 @@ private: bool buttonStatus; private slots: + void on_pushButtonInfo_clicked(); void on_buttonRouteStartStop_clicked(); void timerSatellitePictureTimeout(); void timerRoutePictureTimeout(); void gpsStatus(); void sendRoute(); + void killHelpDialog(); signals: void sendroute(); diff --git a/Client/routesavedialog.ui b/Client/routesavedialog.ui index b78556d..4638a5f 100644 --- a/Client/routesavedialog.ui +++ b/Client/routesavedialog.ui @@ -208,6 +208,29 @@ labelSignalStrength + + + + 750 + 0 + 50 + 50 + + + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + diff --git a/Client/settingsdialog.cpp b/Client/settingsdialog.cpp index 684ccf5..a50a681 100644 --- a/Client/settingsdialog.cpp +++ b/Client/settingsdialog.cpp @@ -1,21 +1,25 @@ /* * SettingsDialog class * - * @author Olavi Pulkkinen - * @copyright (c) 2010 Speed Freak team - * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @author Olavi Pulkkinen + * @author Toni Jussila + * @copyright (c) 2010 Speed Freak team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ #include "settingsdialog.h" #include "ui_settingsdialog.h" #include "usersettings.h" #include +#include SettingsDialog::SettingsDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::SettingsDialog) + QDialog(parent), ui(new Ui::SettingsDialog) { ui->setupUi(this); + + helpSettingsDialog = NULL; + this->setWindowTitle("Settings"); this->ui->regEMailLineEdit->setText("@"); @@ -35,6 +39,10 @@ SettingsDialog::SettingsDialog(QWidget *parent) : // Already someone as user - change button text to "Change" ui->setUserPushButton->setText("Log out"); + + // Button settings + ui->pushButtonInfo->setAutoFillBackground(true); + ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); } } @@ -222,3 +230,29 @@ void SettingsDialog::clearRegisterLineEdits() ui->regPasswordLineEdit->setText(""); ui->regUserNameLineEdit->setText(""); } + +/** + * This slot function called when ever info button clicked. + */ +void SettingsDialog::on_pushButtonInfo_clicked() +{ + if(!helpSettingsDialog) + { + helpSettingsDialog = new HelpSettingsDialog; + } + connect(helpSettingsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpSettingsDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void SettingsDialog::killHelpDialog() +{ + if(helpSettingsDialog) + { + qDebug() << "__Settings kill: helpSettingsDialog"; + delete helpSettingsDialog; + helpSettingsDialog = NULL; + } +} diff --git a/Client/settingsdialog.h b/Client/settingsdialog.h index 1f7a9fe..4f5858b 100644 --- a/Client/settingsdialog.h +++ b/Client/settingsdialog.h @@ -10,8 +10,8 @@ #define SETTINGSDIALOG_H #include - #include "instructionsdialog.h" +#include namespace Ui { class SettingsDialog; @@ -22,6 +22,7 @@ class SettingsDialog : public QDialog { public: SettingsDialog(QWidget *parent = 0); ~SettingsDialog(); + HelpSettingsDialog *helpSettingsDialog; void setRegUserName(QString username); void setRegPassword(QString password); void setRegEmail(QString email); @@ -53,8 +54,10 @@ private: QString password; private slots: + void on_pushButtonInfo_clicked(); void on_setUserPushButton_clicked(); void on_registratePushButton_clicked(); + void killHelpDialog(); }; #endif // SETTINGSDIALOG_H diff --git a/Client/settingsdialog.ui b/Client/settingsdialog.ui index 255eea9..bf6e945 100644 --- a/Client/settingsdialog.ui +++ b/Client/settingsdialog.ui @@ -234,14 +234,29 @@ :/new/prefix1/Graphics/sf_2.png - label - setUserLabel - setUserPushButton - registrateLabel - registratePushButton - layoutWidget - labelInfoToUser - layoutWidget + + + + 750 + 0 + 50 + 50 + + + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + regUserNameLineEdit diff --git a/Client/topresultdialog.cpp b/Client/topresultdialog.cpp index fafff58..3eeb3b4 100644 --- a/Client/topresultdialog.cpp +++ b/Client/topresultdialog.cpp @@ -12,10 +12,12 @@ #include "ui_topresultdialog.h" TopResultDialog::TopResultDialog(QWidget *parent) : - QDialog(parent), - ui(new Ui::TopResultDialog) + QDialog(parent), ui(new Ui::TopResultDialog) { ui->setupUi(this); + + helpResultsDialog = NULL; + this->setWindowTitle("Top Results"); //Set the amount of requested top results here, untill there is user input @@ -24,6 +26,8 @@ TopResultDialog::TopResultDialog(QWidget *parent) : //Button settings ui->buttonTopRefresh->setAutoFillBackground(true); ui->buttonTopRefresh->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); + ui->pushButtonInfo->setAutoFillBackground(true); + ui->pushButtonInfo->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)"); //Clear labels ui->labelInfoToUser->setText(""); @@ -91,3 +95,29 @@ void TopResultDialog::setLabelInfoToUser(QString infoText) { this->ui->labelInfoToUser->setText(infoText); } + +/** + * This slot function called when ever info button clicked. + */ +void TopResultDialog::on_pushButtonInfo_clicked() +{ + if(!helpResultsDialog) + { + helpResultsDialog = new HelpResultsDialog; + } + connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialog())); + helpResultsDialog->show(); +} + +/** + * This slot function called when ever dialog rejected. + */ +void TopResultDialog::killHelpDialog() +{ + if(helpResultsDialog) + { + qDebug() << "__Top result kill: helpResultsDialog"; + delete helpResultsDialog; + helpResultsDialog = NULL; + } +} diff --git a/Client/topresultdialog.h b/Client/topresultdialog.h index dc49076..3059094 100644 --- a/Client/topresultdialog.h +++ b/Client/topresultdialog.h @@ -11,6 +11,7 @@ #define TOPRESULTDIALOG_H #include +#include namespace Ui { class TopResultDialog; @@ -21,6 +22,7 @@ class TopResultDialog : public QDialog { public: TopResultDialog(QWidget *parent = 0); ~TopResultDialog(); + HelpResultsDialog *helpResultsDialog; void setCompoBoxCategories(QStringList list); void showTopList(QString str); int getRecentCategoryIndex(); @@ -41,9 +43,10 @@ private: int limitNr; private slots: + void on_pushButtonInfo_clicked(); void on_comboBoxTopCategory_currentIndexChanged(int index); void on_buttonTopRefresh_clicked(); - + void killHelpDialog(); }; #endif // TOPRESULTDIALOG_H diff --git a/Client/topresultdialog.ui b/Client/topresultdialog.ui index 9089f32..b79ce0d 100644 --- a/Client/topresultdialog.ui +++ b/Client/topresultdialog.ui @@ -17,7 +17,7 @@ 650 - 20 + 70 130 130 @@ -123,11 +123,35 @@ :/new/prefix1/Graphics/sf_2.png + + + + 750 + 0 + 50 + 50 + + + + + + + + :/new/prefix1/Graphics/info.png:/new/prefix1/Graphics/info.png + + + + 45 + 45 + + + label buttonTopRefresh labelTopList labelCategory comboBoxTopCategory + pushButtonInfo labelInfoToUser -- 1.7.9.5