4 * @author Janne Änäkkälä <janne.anakkala@fudeco.com>
5 * @author Toni Jussila <toni.jussila@fudeco.com>
6 * @copyright (c) 2010 Speed Freak team
7 * @license http://opensource.org/licenses/gpl-license.php GNU Public License
10 #include "helpdialog.h"
11 #include "ui_helpdialog.h"
17 HelpDialog::HelpDialog(QWidget *parent) :
19 ui(new Ui::HelpDialog)
22 helpResultsDialog = NULL;
23 helpAccelerationDialog = NULL;
24 helpRoutingDialog = NULL;
26 helpSettingsDialog = NULL;
32 HelpDialog::~HelpDialog()
40 void HelpDialog::changeEvent(QEvent *e)
42 QDialog::changeEvent(e);
44 case QEvent::LanguageChange:
45 ui->retranslateUi(this);
55 void HelpDialog::on_pushButtonHelpResults_clicked()
57 if(!helpResultsDialog)
59 helpResultsDialog = new HelpResultsDialog;
61 connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
62 helpResultsDialog->show();
68 void HelpDialog::on_pushButtonHelpAccelerate_clicked()
70 if(!helpAccelerationDialog)
72 helpAccelerationDialog = new HelpAccelerationDialog;
74 connect(helpAccelerationDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
75 helpAccelerationDialog->show();
81 void HelpDialog::on_pushButtonHelpRoute_clicked()
83 if(!helpRoutingDialog)
85 helpRoutingDialog = new HelpRoutingDialog;
87 connect(helpRoutingDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
88 helpRoutingDialog->show();
94 void HelpDialog::on_pushButtonCredits_clicked()
98 creditsDialog = new CreditsDialog;
100 connect(creditsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
101 creditsDialog->show();
107 void HelpDialog::on_pushButtonHelpSettings_clicked()
109 if(!helpSettingsDialog)
111 helpSettingsDialog = new HelpSettingsDialog;
113 connect(helpSettingsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
114 helpSettingsDialog->show();
118 * This slot function called when ever dialog rejected.
120 void HelpDialog::killHelpDialogs()
122 if(helpResultsDialog)
124 qDebug() << "__Help kill: helpResultsDialog";
125 delete helpResultsDialog;
126 helpResultsDialog = NULL;
128 if(helpAccelerationDialog)
130 qDebug() << "__Help kill: helpAccelerationDialog";
131 delete helpAccelerationDialog;
132 helpAccelerationDialog = NULL;
134 if(helpRoutingDialog)
136 qDebug() << "__Help kill: helpRoutingDialog";
137 delete helpRoutingDialog;
138 helpRoutingDialog = NULL;
142 qDebug() << "__Help kill: creditsDialog";
143 delete creditsDialog;
144 creditsDialog = NULL;
147 if(helpSettingsDialog)
149 qDebug() << "__Help kill: helpSettingsDialog";
150 delete helpSettingsDialog;
151 helpSettingsDialog = NULL;