-
Notifications
You must be signed in to change notification settings - Fork 2
/
preferences.cpp
42 lines (35 loc) · 965 Bytes
/
preferences.cpp
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
#include "preferences.h"
#include "tools/OriSettings.h"
Preferences Preferences::preferences;
Preferences::Preferences()
{
}
Preferences& Preferences::instance()
{
return preferences;
}
Preferences* Preferences::instancePtr()
{
return &preferences;
}
void Preferences::load(Ori::Settings &s)
{
s.resetGroup();
bugEditorEnableDates = s.value("bugEditorEnableDates", false).toBool();
bugSolverEnableDates = s.value("bugSolverEnableDates", false).toBool();
confirmCancel = s.value("confirmCancel", true).toBool();
openNewBugOnPage = s.value("openNewBugOnPage", true).toBool();
}
void Preferences::save(Ori::Settings &s)
{
s.resetGroup();
s.setValue("bugEditorEnableDates", bugEditorEnableDates);
s.setValue("bugSolverEnableDates", bugSolverEnableDates);
s.setValue("confirmCancel", confirmCancel);
s.setValue("openNewBugOnPage", openNewBugOnPage);
}
void Preferences::save()
{
Ori::Settings s;
save(s);
}