-
Notifications
You must be signed in to change notification settings - Fork 1
/
HwaSettings.h
92 lines (74 loc) · 2.64 KB
/
HwaSettings.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#ifndef SETTINGS_H
#define SETTINGS_H
//-----------------------------------------------------------------
// Settings File
// C++ Header - Settings.h - version 0.1 (2013/06/13)
//-----------------------------------------------------------------
//-----------------------------------------------------------------
// Include Files
//-----------------------------------------------------------------
#include "Defines.h"
#include <QSettings>
#include "Logitech.h"
//-----------------------------------------------------------------
// Settings Class
//-----------------------------------------------------------------
class HwaSettings
{
public:
static HwaSettings* getInstance();
static void releaseResources();
//---------------------------
// Destructor
//---------------------------
virtual ~HwaSettings();
//---------------------------
// General Methods
//---------------------------
void setLogitech(Logitech * logitech);
void loadSettings();
void saveSettings();
void setTemperature(TemperatureType);
TemperatureType getTemperature();
void setAutoStart(bool);
bool getAutoStart();
void setLanguage(QString);
QString getLanguage();
void setInfluxSettings(InfluxDbSettings);
InfluxDbSettings getInfluxSettings();
protected:
//---------------------------
// Constructor(s)
//---------------------------
HwaSettings();
private:
void saveNormalScreenSettings(NormalScreen *);
void saveGraphScreenSettings(GraphScreen *);
void saveScreenOrder();
void saveMainScreenOrder();
void saveSubScreenOrder();
void saveCustomSettings(NormalScreen *);
void saveGeneralSettings();
void loadGeneralSettings();
QList<CustomSettings> loadCustomSettings();
void loadNormalScreenSettings(QString, QString, ScreenType);
void loadGraphScreenSettings(QString, QString, ScreenType);
void loadScreenOrder();
QList<QString> loadMainScreenOrder();
QMap<QString, QList<QString>> loadSubScreenOrder();
// -------------------------
// Datamembers
// -------------------------
QSettings * settings_;
Logitech * logitech_;
static HwaSettings* singleton_;
GeneralSettings generalSettings_;
// -------------------------
// Disabling default copy constructor and default assignment operator.
// If you get a linker error from one of these functions, your class is internally trying to use them. This is
// an error in your class, these declarations are deliberately made without implementation because they should never be used.
// -------------------------
HwaSettings(const HwaSettings& t);
HwaSettings& operator=(const HwaSettings& t);
};
#endif