Settings dialog categories.
authorMax Lapan <max.lapan@gmail.com>
Thu, 11 Mar 2010 17:34:45 +0000 (20:34 +0300)
committerMax Lapan <max.lapan@gmail.com>
Thu, 11 Mar 2010 17:35:10 +0000 (20:35 +0300)
There are three categories:
1. display -- what will widget display,
2. update -- how it will update information,
3. alerts -- let user specify conditions to be alerted.

mainwidget.cpp
settingsDialog.cpp
settingsDialog.hpp
tests/settings/main.cpp [new file with mode: 0644]
tests/settings/settings.pro [new file with mode: 0644]
tests/tests.pro
yandex-traffic-gui.pri

index 20e5d58..6b7f6be 100644 (file)
@@ -90,7 +90,7 @@ void MainWidget::updateData ()
 
 void MainWidget::settingsDialog ()
 {
-    SettingsDialog dlg (this, _settings);
+    SettingsDialog dlg (_settings);
 
     dlg.exec ();
 }
index a64dd59..dabe604 100644 (file)
@@ -1,12 +1,22 @@
 #include <QtGui>
+#include <QtMaemo5>
 #include "settingsDialog.hpp"
 
 
 // --------------------------------------------------
 // SettingsDialog
 // --------------------------------------------------
-SettingsDialog::SettingsDialog (QWidget *parent, Settings *settings)
-    : QDialog (parent)
+SettingsDialog::SettingsDialog (Settings *settings)
+    : QDialog ()
 {
     setWindowTitle (tr ("Settings"));
+
+    QVBoxLayout *layout = new QVBoxLayout (this);
+
+    displayButton = new QMaemo5ValueButton (tr ("Display"), this);
+    layout->addWidget (displayButton);
+    updateButton = new QMaemo5ValueButton (tr ("Update"), this);
+    layout->addWidget (updateButton);
+    alertsButton = new QMaemo5ValueButton (tr ("Alerts"), this);
+    layout->addWidget (alertsButton);
 }
index 8bee870..7aab74e 100644 (file)
@@ -2,6 +2,7 @@
 #define __SETTINGSDIALOG_H__
 
 #include <QtGui>
+#include <QtMaemo5>
 
 #include "settings.hpp"
 
@@ -9,8 +10,14 @@
 class SettingsDialog : public QDialog
 {
     Q_OBJECT
+
+private:
+    QMaemo5ValueButton *displayButton;
+    QMaemo5ValueButton *updateButton;
+    QMaemo5ValueButton *alertsButton;
+
 public:
-    SettingsDialog (QWidget *parent, Settings *settings);
+    SettingsDialog (Settings *settings);
 };
 
 
diff --git a/tests/settings/main.cpp b/tests/settings/main.cpp
new file mode 100644 (file)
index 0000000..9f5c68f
--- /dev/null
@@ -0,0 +1,15 @@
+#include <QtGui>
+
+#include "settings.hpp"
+#include "settingsDialog.hpp"
+
+int main(int argc, char *argv[])
+{
+    QApplication app (argc, argv);
+    Settings settings;
+    SettingsDialog dlg (&settings);
+
+    dlg.show ();
+
+    return app.exec ();
+}
diff --git a/tests/settings/settings.pro b/tests/settings/settings.pro
new file mode 100644 (file)
index 0000000..6c9a0eb
--- /dev/null
@@ -0,0 +1,6 @@
+TEMPLATE = app
+
+SOURCES += main.cpp
+
+include (../../yandex-traffic-core.pri)
+include (../../yandex-traffic-gui.pri)
index d4bc1c0..8f7eefd 100644 (file)
@@ -1,2 +1,2 @@
 TEMPLATE = subdirs
-SUBDIRS = regions traffic widget conn state
+SUBDIRS = regions traffic widget conn state settings
index 7973229..5aed1d4 100644 (file)
@@ -1,6 +1,6 @@
 HEADERS += $$PWD/mainwidget.hpp $$PWD/light.hpp $$PWD/settingsDialog.hpp
 SOURCES += $$PWD/mainwidget.cpp $$PWD/light.cpp $$PWD/settingsDialog.cpp
 
-QT += network xml
+QT += network xml maemo5
 
 INCLUDEPATH += $$PWD