Route save dialog development. Added: gps,icon...
[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
15 MainWindow::MainWindow(QWidget *parent) :
16     QMainWindow(parent),
17     ui(new Ui::MainWindow)
18 {
19     ui->setupUi(this);
20
21     creditsDialog = new CreditsDialog;
22     routeSaveDialog = new RouteSaveDialog;
23
24     //Button settings
25     ui->pushButtonAccelerate->setAutoFillBackground(true);
26     ui->pushButtonAccelerate->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
27     ui->pushButtonRoute->setAutoFillBackground(true);
28     ui->pushButtonRoute->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
29     ui->pushButtonResults->setAutoFillBackground(true);
30     ui->pushButtonResults->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
31     ui->pushButtonSettings->setAutoFillBackground(true);
32     ui->pushButtonSettings->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
33     ui->pushButtonWWW->setAutoFillBackground(true);
34     ui->pushButtonWWW->setStyleSheet("background-color: rgb(0, 0, 0); color: rgb(255, 255, 255)");
35 }
36
37 MainWindow::~MainWindow()
38 {
39     delete ui;
40     delete routeSaveDialog;
41 }
42
43 void MainWindow::changeEvent(QEvent *e)
44 {
45     QMainWindow::changeEvent(e);
46     switch (e->type()) {
47     case QEvent::LanguageChange:
48         ui->retranslateUi(this);
49         break;
50     default:
51         break;
52     }
53 }
54
55 void MainWindow::on_pushButtonWWW_clicked()
56 {
57     QDesktopServices::openUrl(QUrl("http://garage.maemo.org/projects/speedfreak/"));
58 }
59
60 void MainWindow::on_pushButtonCredits_clicked()
61 {
62     creditsDialog->show();
63 }
64
65 void MainWindow::on_pushButtonRoute_clicked()
66 {
67     routeSaveDialog->show();
68 }