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"
15 * Default constructor of this class.
17 HelpDialog::HelpDialog(QWidget *parent) :
19 ui(new Ui::HelpDialog)
22 helpResultsDialog = NULL;
23 helpAccelerationDialog = NULL;
24 helpRoutingDialog = NULL;
26 helpSettingsDialog = NULL;
27 helpUsersDialog = NULL;
31 * Default destructor of this class.
33 HelpDialog::~HelpDialog()
41 void HelpDialog::changeEvent(QEvent *e)
43 QDialog::changeEvent(e);
45 case QEvent::LanguageChange:
46 ui->retranslateUi(this);
54 * This slot function called when ever help results button clicked.
56 void HelpDialog::on_pushButtonHelpResults_clicked()
58 if(!helpResultsDialog)
60 helpResultsDialog = new HelpResultsDialog;
62 connect(helpResultsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
63 helpResultsDialog->show();
67 * This slot function called when ever help accelerate button clicked.
69 void HelpDialog::on_pushButtonHelpAccelerate_clicked()
71 if(!helpAccelerationDialog)
73 helpAccelerationDialog = new HelpAccelerationDialog;
75 connect(helpAccelerationDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
76 helpAccelerationDialog->show();
80 * This slot function called when ever help route button clicked.
82 void HelpDialog::on_pushButtonHelpRoute_clicked()
84 if(!helpRoutingDialog)
86 helpRoutingDialog = new HelpRoutingDialog;
88 connect(helpRoutingDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
89 helpRoutingDialog->show();
93 * This slot function called when ever credits button clicked.
95 void HelpDialog::on_pushButtonCredits_clicked()
99 creditsDialog = new CreditsDialog;
101 connect(creditsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
102 creditsDialog->show();
106 * This slot function called when ever help settings button clicked.
108 void HelpDialog::on_pushButtonHelpSettings_clicked()
110 if(!helpSettingsDialog)
112 helpSettingsDialog = new HelpSettingsDialog;
114 connect(helpSettingsDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
115 helpSettingsDialog->show();
119 * This slot function called when ever dialog rejected.
121 void HelpDialog::killHelpDialogs()
123 if(helpResultsDialog)
125 qDebug() << "__Help kill: helpResultsDialog";
126 delete helpResultsDialog;
127 helpResultsDialog = NULL;
129 if(helpAccelerationDialog)
131 qDebug() << "__Help kill: helpAccelerationDialog";
132 delete helpAccelerationDialog;
133 helpAccelerationDialog = NULL;
135 if(helpRoutingDialog)
137 qDebug() << "__Help kill: helpRoutingDialog";
138 delete helpRoutingDialog;
139 helpRoutingDialog = NULL;
143 qDebug() << "__Help kill: creditsDialog";
144 delete creditsDialog;
145 creditsDialog = NULL;
148 if(helpSettingsDialog)
150 qDebug() << "__Help kill: helpSettingsDialog";
151 delete helpSettingsDialog;
152 helpSettingsDialog = NULL;
157 qDebug() << "__Help kill: helpUsersDialog";
158 delete helpUsersDialog;
159 helpUsersDialog = NULL;
164 * This slot function called when ever help users button clicked.
166 void HelpDialog::on_pushButtonHelpUsers_clicked()
170 helpUsersDialog = new HelpUsersDialog;
172 connect(helpUsersDialog, SIGNAL(rejected()), this, SLOT(killHelpDialogs()));
173 helpUsersDialog->show();