8 enum WeightIntervalMode {
9 AutomaticWithGoalWeight,
10 AutomaticWithoutGoalWeight,
13 bool goalWeightEnabled;
14 WeightIntervalMode weightIntervalMode;
15 double weightIntervalMin;
16 double weightIntervalMax;
17 int defaultTimeInterval;
20 class Settings : public QObject
24 static Settings *self() { return singleton; }
25 static QString weightUnit();
26 static double goalWeightMin();
27 static double goalWeightMax();
28 static bool grabZoomKeys();
29 static GraphSettings graphSettings(const QString &graphId);
30 static QStringList graphIds();
32 static QString datadir();
33 static QString datafile();
34 static QString settingsfile();
36 static void setWeightUnit(QString wu);
37 static void setWeightUnitAndSync(QString wu);
38 static void setGoalWeightMin(double min);
39 static void setGoalWeightMinAndSync(double min);
40 static void setGoalWeightMax(double max);
41 static void setGoalWeightMaxAndSync(double max);
42 static void setGrabZoomKeys(bool grab);
43 static void setGrabZoomKeysAndSync(bool grab);
44 static void setGraphSettings(const QString &graphId, GraphSettings &gs);
45 static void setGraphSettingsAndSync(const QString &graphId,
49 //settingChanged is emitted when sync() is called.
50 void settingChanged();
52 Settings() : QObject(0) {}
53 static Settings *singleton;
55 static const QString weightUnitKey;
56 static const QString goalWeightMinKey;
57 static const QString goalWeightMaxKey;
58 static const QString grabZoomKeysKey;
59 static const QString graphSettingsGroupSuffix;
60 static const QString goalWeightEnabledKey;
61 static const QString weightIntervalModeKey;
62 static const QString weightIntervalMinKey;
63 static const QString weightIntervalMaxKey;
64 static const QString defaultTimeIntervalKey;