Fix typo
[yandex-traffic] / settingsDialog.hpp
1 #ifndef __SETTINGSDIALOG_H__
2 #define __SETTINGSDIALOG_H__
3
4 #include <QtGui>
5
6 #ifdef Q_WS_MAEMO_5
7 #include <QtMaemo5>
8 #else
9 #include "QtMaemo5Adapters.hpp"
10 #endif
11
12 #include "settings.hpp"
13
14
15 class SettingsDialog : public QDialog
16 {
17     Q_OBJECT
18
19 private:
20     QMaemo5ValueButton *_displayButton;
21     QMaemo5ValueButton *_updateButton;
22     QMaemo5ValueButton *_languageButton;
23
24     Settings *_settings;
25
26     void updateDisplayButtonValue ();
27     void updateUpdateButtonValue ();
28     void createLanguageButton (QBoxLayout *layout);
29
30 protected slots:
31     void displayClicked ();
32     void updateClicked ();
33     void languageChanged (const QString&);
34
35 public:
36     SettingsDialog (Settings *settings);
37 };
38
39
40 class BaseSettingsDialog : public QDialog
41 {
42     Q_OBJECT
43 private:
44     Settings *_settings;
45     QVBoxLayout *_layout;
46     QPushButton *_saveButton;
47
48 protected slots:
49     void saveClicked ();
50
51 protected:
52     Settings* settings () const
53     { return _settings; };
54
55     QVBoxLayout* layout () const
56     { return _layout; };
57
58     virtual void saveSettings () = 0;
59
60 public:
61     BaseSettingsDialog (Settings *settings);
62 };
63
64
65 class DisplaySettingsDialog : public BaseSettingsDialog
66 {
67     Q_OBJECT
68
69 private:
70     QListWidget *_cities;
71     QCheckBox *_showLight, *_showRank, *_showTime, *_showHint;
72
73     void initCities (QBoxLayout *layout);
74     void initChecks (QBoxLayout *layout);
75
76 protected:
77     virtual void saveSettings ();
78
79 public:
80     DisplaySettingsDialog (Settings *settings);
81 };
82
83
84 class UpdateSettingsDialog : public BaseSettingsDialog
85 {
86     Q_OBJECT
87
88 private:
89     QMaemo5ValueButton *_intervalButton;
90     QCheckBox *_wifiUpdate, *_gsmUpdate, *_lockedUpdate;
91
92     void initUpdateInterval (QBoxLayout *layout);
93
94 protected:
95     virtual void saveSettings ();
96
97 public:
98     UpdateSettingsDialog (Settings *settings);
99 };
100
101
102 #endif // __SETTINGSDIALOG_H__