-
Notifications
You must be signed in to change notification settings - Fork 0
/
settings_window.h
91 lines (75 loc) · 1.48 KB
/
settings_window.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
#ifndef _SETTINGS_WINDOW_H_
#define _SETTINGS_WINDOW_H_
/*
** -- Qt Includes --
*/
#include <qlayout.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qtabdialog.h>
#include <qmainwindow.h>
#include <qmessagebox.h>
/*
** -- Local Includes --
*/
#include <options_reader.h>
extern options_reader *optread;
class settings_window: public QTabDialog
{
Q_OBJECT
public:
settings_window(void);
settings_window(QMainWindow *);
~settings_window();
bool isDeleteDisabled(void);
void update(const bool);
/*
** -- readAttribute() --
*/
template<class T>
void readAttribute(options_reader::keynames attr, T &value)
{
QString str = "";
if(!optread->getContents()[options_reader::keys[attr]])
switch(attr)
{
case options_reader::DELETE_PROMPT_DISABLED:
{
value = false;
return;
}
default:
return;
}
str = *(optread->getContents()[options_reader::keys[attr]]);
switch(attr)
{
case options_reader::DELETE_PROMPT_DISABLED:
{
if(str == "true")
value = true;
else
value = false;
break;
}
default:
break;
}
}
private:
bool delete_prompt_disabled;
QCheckBox *auto_save;
QCheckBox *save_geometry;
QCheckBox *disable_delete_prompt;
QComboBox *time_options;
QLineEdit *nqc_location;
void setTab1(void);
void setTab2(void);
void setTab3(void);
private slots:
void saveOptions(void);
void auto_save_cb(void);
void selectNQCBin(void);
void cancelOptions(void);
};
#endif