From: Toni Jussila Date: Mon, 26 Apr 2010 10:35:19 +0000 (+0300) Subject: Bugfix: Help dialog should kill sub help dialogs (e.g. acceleration help dialog)... X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=432769267c7bf1b5718f11535adbbf53969d55a5 Bugfix: Help dialog should kill sub help dialogs (e.g. acceleration help dialog) when them are closed by user. --- diff --git a/Client/helpdialog.cpp b/Client/helpdialog.cpp index e63eb35..cfb1b5a 100644 --- a/Client/helpdialog.cpp +++ b/Client/helpdialog.cpp @@ -1,6 +1,19 @@ +/* + * Help dialog + * + * @author Janne Änäkkälä + * @author Toni Jussila + * @copyright (c) 2010 Speed Freak team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ + #include "helpdialog.h" #include "ui_helpdialog.h" +#include +/** + * Constructor + */ HelpDialog::HelpDialog(QWidget *parent) : QDialog(parent), ui(new Ui::HelpDialog) @@ -13,11 +26,17 @@ HelpDialog::HelpDialog(QWidget *parent) : helpSettingsDialog = NULL; } +/** + * Destructor + */ HelpDialog::~HelpDialog() { delete ui; } +/** + * + */ void HelpDialog::changeEvent(QEvent *e) { QDialog::changeEvent(e); @@ -30,48 +49,105 @@ void HelpDialog::changeEvent(QEvent *e) } } - +/** + * + */ void HelpDialog::on_pushButtonHelpResults_clicked() { if(!helpResultsDialog) { helpResultsDialog = new HelpResultsDialog; } + connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs())); helpResultsDialog->show(); } +/** + * + */ void HelpDialog::on_pushButtonHelpAccelerate_clicked() { if(!helpAccelerationDialog) { helpAccelerationDialog = new HelpAccelerationDialog; } + connect(helpAccelerationDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs())); helpAccelerationDialog->show(); } +/** + * + */ void HelpDialog::on_pushButtonHelpRoute_clicked() { if(!helpRoutingDialog) { helpRoutingDialog = new HelpRoutingDialog; } + connect(helpRoutingDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs())); helpRoutingDialog->show(); } +/** + * + */ void HelpDialog::on_pushButtonCredits_clicked() { if(!creditsDialog) { creditsDialog = new CreditsDialog; } + connect(creditsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs())); creditsDialog->show(); } +/** + * + */ void HelpDialog::on_pushButtonHelpSettings_clicked() { if(!helpSettingsDialog) { helpSettingsDialog = new HelpSettingsDialog; } + connect(helpSettingsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs())); helpSettingsDialog->show(); } + +/** + * This slot function called when ever dialog rejected. + */ +void HelpDialog::killHelpDialogs() +{ + if(helpResultsDialog) + { + qDebug() << "__Help kill: helpResultsDialog"; + delete helpResultsDialog; + helpResultsDialog = NULL; + } + if(helpAccelerationDialog) + { + qDebug() << "__Help kill: helpAccelerationDialog"; + delete helpAccelerationDialog; + helpAccelerationDialog = NULL; + } + if(helpRoutingDialog) + { + qDebug() << "__Help kill: helpRoutingDialog"; + delete helpRoutingDialog; + helpRoutingDialog = NULL; + } + if(creditsDialog) + { + qDebug() << "__Help kill: creditsDialog"; + delete creditsDialog; + creditsDialog = NULL; + } + + if(helpSettingsDialog) + { + qDebug() << "__Help kill: helpSettingsDialog"; + delete helpSettingsDialog; + helpSettingsDialog = NULL; + } +} diff --git a/Client/helpdialog.h b/Client/helpdialog.h index 9ca31aa..ed68882 100644 --- a/Client/helpdialog.h +++ b/Client/helpdialog.h @@ -1,3 +1,12 @@ +/* + * Help dialog + * + * @author Janne Änäkkälä + * @author Toni Jussila + * @copyright (c) 2010 Speed Freak team + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + */ + #ifndef HELPDIALOG_H #define HELPDIALOG_H @@ -37,6 +46,7 @@ private slots: void on_pushButtonHelpRoute_clicked(); void on_pushButtonHelpAccelerate_clicked(); void on_pushButtonHelpResults_clicked(); + void killHelpDialogs(); }; #endif // HELPDIALOG_H diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index c01329c..b2342f6 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -293,7 +293,7 @@ void MainWindow::clientSendResult(QString category, double result) } } /** - * This slot function called when ever dialog finished. + * This slot function called when ever dialog rejected. */ void MainWindow::killDialog() { diff --git a/Client/resultdialog.cpp b/Client/resultdialog.cpp index 37cf348..774390b 100644 --- a/Client/resultdialog.cpp +++ b/Client/resultdialog.cpp @@ -1,8 +1,8 @@ /* - * CarMainWindow main class + * Result dialog * * @author Janne Änäkkälä - * @author Toni Jussila + * @author Toni Jussila * @copyright (c) 2010 Speed Freak team * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ diff --git a/Client/resultdialog.h b/Client/resultdialog.h index 252e7ff..2fac623 100644 --- a/Client/resultdialog.h +++ b/Client/resultdialog.h @@ -1,5 +1,5 @@ /* - * CarMainWindow main class + * Result dialog * * @author Janne Änäkkälä * @author Toni Jussila