-
Notifications
You must be signed in to change notification settings - Fork 1
/
fm_setting.h
75 lines (60 loc) · 1.82 KB
/
fm_setting.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
#ifndef FM_SETTING_H
#define FM_SETTING_H
#include <QTime>
#include <QString>
#include <QVector>
#include <QJsonObject>
#include <QObject>
using namespace std;
struct FM_ColumnSetting {
FM_ColumnSetting (QString c, bool i) : column_name(c), is_enabled(i) {}
FM_ColumnSetting () {}
QString column_name;
bool is_enabled;
};
struct FM_WebSetting{
FM_WebSetting (QString w, QVector<FM_ColumnSetting *> wc) : web_name(w), web_columns(wc) {}
~FM_WebSetting ();
QString web_name;
QVector<FM_ColumnSetting *> web_columns;
};
class FM_Setting : public QObject
{
Q_OBJECT
public:
explicit FM_Setting();
~FM_Setting();
void read_setting_from_json();
void update_setting_to_json();
bool get_global_notice();
void set_global_notice(bool b);
bool get_auto_start();
void set_auto_start(bool b);
QTime get_refresh_time();
void set_refresh_time(QTime q);
int get_max_display_news();
void set_max_display_news(int i);
bool is_minimize_notice_first_time();
void set_minimize_notice_first_time();
bool is_picture_background();
void set_picture_background(bool);
QString get_picture_address();
void set_picture_address(QString address);
void get_web_list(QVector<QString> &ret);
void get_web_columns(QString web, QVector<QString> &, QVector<bool> &bret);
bool get_column_state(QString web, QString column);
void set_column_state(QString web, QString column, bool state);
void get_valid_web(QVector<QString> &ret);
public slots:
void onRefreshAutoStart();
private:
bool global_notice;
bool auto_start;
bool minimize_notice_first_time;
bool picture_background;
QString picture_address;
QTime refresh_time;
int max_display_news;
QVector<FM_WebSetting *> web_settings;
};
#endif // FM_SETTING_H