From: Rikhard Kuutti Date: Tue, 30 Mar 2010 10:19:25 +0000 (+0300) Subject: Added settings dialog X-Git-Tag: v0.2-RC1~34^2~4 X-Git-Url: http://git.maemo.org/git/?p=speedfreak;a=commitdiff_plain;h=75e2328492951629d43639bbc6dd63ed76185218 Added settings dialog --- diff --git a/Client/mainwindow.cpp b/Client/mainwindow.cpp index 0419a60..8a46249 100644 --- a/Client/mainwindow.cpp +++ b/Client/mainwindow.cpp @@ -25,6 +25,7 @@ MainWindow::MainWindow(QWidget *parent) : creditsDialog = new CreditsDialog; routeSaveDialog = new RouteSaveDialog; + settingsDialog = new SettingsDialog; welcomeDialog = new WelcomeDialog; welcomeDialog->show(); @@ -63,3 +64,8 @@ void MainWindow::on_pushButtonRoute_clicked() { routeSaveDialog->show(); } + +void MainWindow::on_pushButtonSettings_clicked() +{ + settingsDialog->show(); +} diff --git a/Client/mainwindow.h b/Client/mainwindow.h index ae7c0d0..f822184 100644 --- a/Client/mainwindow.h +++ b/Client/mainwindow.h @@ -13,6 +13,7 @@ #include "creditsdialog.h" #include "routesavedialog.h" #include "welcomedialog.h" +#include "settingsdialog.h" namespace Ui { class MainWindow; @@ -27,6 +28,7 @@ public: CreditsDialog *creditsDialog; RouteSaveDialog *routeSaveDialog; WelcomeDialog *welcomeDialog; + SettingsDialog *settingsDialog; protected: void changeEvent(QEvent *e); @@ -35,6 +37,7 @@ private: Ui::MainWindow *ui; private slots: + void on_pushButtonSettings_clicked(); void on_pushButtonRoute_clicked(); void on_pushButtonCredits_clicked(); void on_pushButtonWWW_clicked(); diff --git a/Client/settingsdialog.cpp b/Client/settingsdialog.cpp new file mode 100644 index 0000000..84bb5fc --- /dev/null +++ b/Client/settingsdialog.cpp @@ -0,0 +1,33 @@ +#include "settingsdialog.h" +#include "ui_settingsdialog.h" + +SettingsDialog::SettingsDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::SettingsDialog) +{ + ui->setupUi(this); + this->setWindowTitle("Settings"); + instructionsDialog = new InstructionsDialog; +} + +SettingsDialog::~SettingsDialog() +{ + delete ui; +} + +void SettingsDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +void SettingsDialog::on_pushButtonHelp_clicked() +{ + instructionsDialog->show(); +} diff --git a/Client/settingsdialog.h b/Client/settingsdialog.h new file mode 100644 index 0000000..fff70c6 --- /dev/null +++ b/Client/settingsdialog.h @@ -0,0 +1,29 @@ +#ifndef SETTINGSDIALOG_H +#define SETTINGSDIALOG_H + +#include + +#include "instructionsdialog.h" + +namespace Ui { + class SettingsDialog; +} + +class SettingsDialog : public QDialog { + Q_OBJECT +public: + SettingsDialog(QWidget *parent = 0); + ~SettingsDialog(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::SettingsDialog *ui; + InstructionsDialog *instructionsDialog; + +private slots: + void on_pushButtonHelp_clicked(); +}; + +#endif // SETTINGSDIALOG_H diff --git a/Client/settingsdialog.ui b/Client/settingsdialog.ui new file mode 100644 index 0000000..b3fae31 --- /dev/null +++ b/Client/settingsdialog.ui @@ -0,0 +1,32 @@ + + + SettingsDialog + + + + 0 + 0 + 800 + 480 + + + + Dialog + + + + + 70 + 170 + 131 + 61 + + + + Help + + + + + + diff --git a/Client/speedfreak.pro b/Client/speedfreak.pro index 7cc914c..cb18f04 100644 --- a/Client/speedfreak.pro +++ b/Client/speedfreak.pro @@ -11,7 +11,8 @@ SOURCES += main.cpp \ welcomedialog.cpp \ usersettings.cpp \ resultdialog.cpp \ - instructionsdialog.cpp + instructionsdialog.cpp \ + settingsdialog.cpp HEADERS += mainwindow.h \ creditsdialog.h \ routedialog.h \ @@ -19,12 +20,14 @@ HEADERS += mainwindow.h \ welcomedialog.h \ usersettings.h \ resultdialog.h \ - instructionsdialog.h + instructionsdialog.h \ + settingsdialog.h FORMS += mainwindow.ui \ creditsdialog.ui \ routedialog.ui \ routesavedialog.ui \ welcomedialog.ui \ resultdialog.ui \ - instructionsdialog.ui + instructionsdialog.ui \ + settingsdialog.ui RESOURCES += graphics.qrc