Changed the old code to work as a daemon
[googlelatitude] / src / settings / settings.h
1 #ifndef SETTINGS_H
2 #define SETTINGS_H
3
4 #include <QWidget>
5 #include <QStandardItemModel>
6 #include <QSettings>
7 #include <QPushButton>
8 #include <QCloseEvent>
9 #include <QLineEdit>
10 #include <QFormLayout>
11 #ifdef Q_WS_MAEMO_5
12 #include <QMaemo5ValueButton>
13 #include <QMaemo5ListPickSelector>
14 #include <QStandardItemModel>
15 extern "C" {
16 #include <location/location-gps-device.h>
17 #include <location/location-gpsd-control.h>
18 }
19 #endif
20 namespace Ui {
21     class Settings;
22 }
23
24 class Settings : public QWidget
25 {
26     Q_OBJECT
27
28 public:
29     explicit Settings(QWidget *parent = 0);
30     ~Settings();
31
32 protected:
33     void changeEvent(QEvent *e);
34     void closeEvent(QCloseEvent *e);
35
36 private:
37 #ifdef Q_WS_MAEMO_5
38     void updateDaemon();
39 #endif
40     void addUIElements();
41     void loadSettings();
42     void storeSettings();
43     void populateListModel(QStandardItemModel *model);
44     enum statuses { STATUS_ON, STATUS_OFF, STATUS_HIDE };
45     Ui::Settings *ui;
46     QStringList intervals;
47     QSettings *settings;
48 #ifdef Q_WS_MAEMO_5
49     QMaemo5ValueButton *interval_button;
50     QMaemo5ListPickSelector *interval_selector;
51     QStandardItemModel* interval_model;
52 #endif
53 };
54
55 #endif // SETTINGS_H