8a462492295f16657e52c467634143d714373397
[speedfreak] / Client / mainwindow.cpp
1 /*
2  * Mainwindow for speedFreak project
3  *
4  * @author      Rikhard Kuutti <rikhard.kuutti@fudeco.com>
5  * @copyright   (c) 2010 Speed Freak team
6  * @license     http://opensource.org/licenses/gpl-license.php GNU Public License
7  */
8
9 #include "mainwindow.h"
10 #include "ui_mainwindow.h"
11
12 #include <QDesktopServices>
13 #include <QUrl>
14 #include <QSettings>
15
16 MainWindow::MainWindow(QWidget *parent) :
17     QMainWindow(parent),
18     ui(new Ui::MainWindow)
19 {
20     ui->setupUi(this);
21
22     QCoreApplication::setOrganizationName("Fudeco Oy");
23     QCoreApplication::setOrganizationDomain("fudeco.com");
24     QCoreApplication::setApplicationName("Speed Freak");
25
26     creditsDialog = new CreditsDialog;
27     routeSaveDialog = new RouteSaveDialog;
28     settingsDialog = new SettingsDialog;
29
30     welcomeDialog = new WelcomeDialog;
31     welcomeDialog->show();
32 }
33
34 MainWindow::~MainWindow()
35 {
36     delete ui;
37
38     delete routeSaveDialog;
39 }
40
41 void MainWindow::changeEvent(QEvent *e)
42 {
43     QMainWindow::changeEvent(e);
44     switch (e->type()) {
45     case QEvent::LanguageChange:
46         ui->retranslateUi(this);
47         break;
48     default:
49         break;
50     }
51 }
52
53 void MainWindow::on_pushButtonWWW_clicked()
54 {
55     QDesktopServices::openUrl(QUrl("http://garage.maemo.org/projects/speedfreak/"));
56 }
57
58 void MainWindow::on_pushButtonCredits_clicked()
59 {
60     creditsDialog->show();
61 }
62
63 void MainWindow::on_pushButtonRoute_clicked()
64 {
65     routeSaveDialog->show();
66 }
67
68 void MainWindow::on_pushButtonSettings_clicked()
69 {
70     settingsDialog->show();
71 }