- setCheck (C_Light, true);
- setCheck (C_Rank, true);
- setCheck (C_Hint, true);
+ setCheck (C_ShowLight, true);
+ setCheck (C_ShowRank, true);
+ setCheck (C_ShowHint, true);
+
+ setCheck (C_UpdateOnWiFi, true);
+
+ _updateIntervalIndex = 3;
+}
+
+
+QStringList Settings::updateIntervals () const
+{
+ QStringList res;
+
+ res.append (tr ("Never"));
+ res.append (tr ("1 min"));
+ res.append (tr ("2 min"));
+ res.append (tr ("5 min"));
+ res.append (tr ("15 min"));
+ res.append (tr ("30 min"));
+
+ return res;
+}
+
+
+int Settings::intervalIndex2Minutes (int index) const
+{
+ int int2min[] = { -1, 1, 2, 5, 15, 30 };
+
+ if (index < 0 || sizeof (int2min) / sizeof (int2min[0]))
+ return -1;
+
+ return int2min[index];
+}
+
+
+int Settings::minutes2IntervalIndex (int minutes) const
+{
+ switch (minutes) {
+ case -1:
+ return 0;
+ case 1:
+ return 1;
+ case 2:
+ return 2;
+ case 5:
+ return 3;
+ case 15:
+ return 4;
+ case 30:
+ return 5;
+ default:
+ return 0;
+ }