X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=blobdiff_plain;f=Client%2Faccelerationstart.cpp;h=7a305342cf1e2d310f8c08e42d50f8a64da8faa0;hp=ab9198f205a65ba5c7586c21e6c0edab3bc67565;hb=HEAD;hpb=20d58825bd115adb8e56401a1055ff6d2a3c7850 diff --git a/Client/accelerationstart.cpp b/Client/accelerationstart.cpp index ab9198f..7a30534 100644 --- a/Client/accelerationstart.cpp +++ b/Client/accelerationstart.cpp @@ -1,14 +1,20 @@ /* * 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 */ + #include "accelerationstart.h" #include "ui_accelerationstartdialog.h" #include +#include +/** + * Constructor of this class. + */ accelerationstart::accelerationstart(QWidget *parent) : QDialog(parent), ui(new Ui::accelerationstart) @@ -17,11 +23,11 @@ accelerationstart::accelerationstart(QWidget *parent) : ui->buttonStart->setDisabled(true); accRealTimeDialog = NULL; + helpAccelerationDialog = NULL; stopMeasureSpeed = 0; ui->categorComboBox->addItem("Select category"); - //ui->categorComboBox->addItem("-"); ui->categorComboBox->addItem("0 - 20 km/h",20); ui->categorComboBox->addItem("0 - 40 km/h"); ui->categorComboBox->addItem("0 - 100 km/h"); @@ -31,8 +37,14 @@ 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)"); } +/** + * Destructor of this class. + * Deletes all dynamic objects and sets them to NULL. + */ accelerationstart::~accelerationstart() { delete ui; @@ -40,6 +52,9 @@ accelerationstart::~accelerationstart() delete accRealTimeDialog; } +/** + * + */ void accelerationstart::changeEvent(QEvent *e) { QDialog::changeEvent(e); @@ -52,6 +67,9 @@ void accelerationstart::changeEvent(QEvent *e) } } +/** + * This slot function called when ever calibration button clicked + */ void accelerationstart::on_buttonCalib_clicked() { if(accRealTimeDialog == NULL) @@ -64,6 +82,9 @@ void accelerationstart::on_buttonCalib_clicked() ui->buttonStart->setEnabled(true); } +/** + * This slot function called when ever start button clicked + */ void accelerationstart::on_buttonStart_clicked() { if( stopMeasureSpeed == 0 ) @@ -80,6 +101,11 @@ void accelerationstart::on_buttonStart_clicked() accRealTimeDialog->show(); } +/** + * This slot function called when ever category combobox index changed. + * + * @param int index + */ void accelerationstart::on_categorComboBox_currentIndexChanged( int index ) { stopMeasureSpeed = 0; @@ -97,7 +123,11 @@ void accelerationstart::on_categorComboBox_currentIndexChanged( int index ) } } - +/** + * Get measure categoty function. + * + * @return QString measure category + */ QString accelerationstart::getMeasureCategory() { return measureCategory; @@ -106,8 +136,35 @@ QString accelerationstart::getMeasureCategory() /** *This slot function emit mainwindow sendresult. * - **/ + * @param double result + */ 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; + } +}