Display update-wneh-locked option.
[yandex-traffic] / settings.hpp
index fdeb6f8..cc896e6 100644 (file)
@@ -9,22 +9,29 @@ class Settings : public QObject
     Q_OBJECT
 public:
     enum check_t {
-        C_Light = 0,
-        C_Rank,
-        C_Time,
-        C_Hint,
+        C_ShowLight = 0,
+        C_ShowRank,
+        C_ShowTime,
+        C_ShowHint,
+        C_UpdateOnWiFi,
+        C_UpdateOnGSM,
+        C_UpdateWhenLocked,
     };
 
 private:
     QString _regionID;          // region ID which will be displayed
     QMap<QString, QString> _cities;
     QMap<check_t, bool> _checks;
+    int _updateIntervalIndex;
 
     void makeDefault ();
 
     void loadCities (QSettings *settings);
     void saveCities (QSettings *settings);
 
+    int intervalIndex2Minutes (int index) const;
+    int minutes2IntervalIndex (int minutes) const;
+
 public:
     Settings ();
 
@@ -44,7 +51,18 @@ public:
     { return _checks[entry]; };
 
     void setCheck (check_t entry, bool val)
-    { _checks[entry] = val; }
+    { _checks[entry] = val; };
+
+    QStringList updateIntervals () const;
+
+    int getUpdateIntervalIndex () const
+    { return _updateIntervalIndex; };
+
+    void setUpdateIntervalIndex (int index)
+    { _updateIntervalIndex = index; };
+
+    int updateInterval () const
+    { return intervalIndex2Minutes (_updateIntervalIndex); };
 };