-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmainwidget.h
137 lines (133 loc) · 4.68 KB
/
mainwidget.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* Copyright (C) 2019 Tianjin KYLIN Information Technology Co., Ltd.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*
*/
#ifndef CONFIG_LIST_WIDGET_H
#define CONFIG_LIST_WIDGET_H
#include <QObject>
#include <QWidget>
#include <QPushButton>
#include <QStackedWidget>
#include "itemlist.h"
#include "frameitem.h"
#include <QGraphicsDropShadowEffect>
#include <QColor>
#include "editpushbutton.h"
#include "maindialog.h"
#include <QMessageBox>
#include "editpassdialog.h"
#include "configfile.h"
#include <QGraphicsSvgItem>
#include <QSvgWidget>
#include "dbushandleclient.h"
#include <QtDBus/QtDBus>
#include "tooltips.h"
#include <QDir>
#include "svghandler.h"
#include "blueeffect.h"
class MainWidget : public QWidget
{
Q_OBJECT
public:
explicit MainWidget(QWidget *parent = nullptr);
~MainWidget();
QLabel* get_title();
QLabel* get_info();
QWidget* get_login_dialog();
void setshow(QWidget *w);
void init_gui();
void handle_conf();
bool judge_item(QString enable,int cur);
void handle_write(int on,int id);
protected:
bool eventFilter(QObject *watched, QEvent *event);
private:
ItemList *m_itemList;
FrameItem *m_autoSyn;
QLabel *m_title;
QLabel *m_infoTab;
Blueeffect *m_blueEffect_sync;
QPushButton *m_exitCloud_btn;
QWidget *m_widgetContainer;
QWidget *m_infoTabWidget;
QVBoxLayout *m_vboxLayout;
QPushButton *m_openEditDialog_btn;
EditPassDialog *m_editDialog;
QStackedWidget *m_mainWidget;
QWidget *m_nullWidget;
DbusHandleClient *m_dbusClient;
QPushButton *m_login_btn;
QLabel *m_welcomeMsg;
QSvgWidget *m_welcomeImage;
QVBoxLayout *m_welcomeLayout;
QVBoxLayout *m_workLayout;
QStackedWidget *m_stackedWidget;
QWidget *m_nullwidgetContainer;
QString m_szCode = tr("Disconnected");
QString m_szConfPath;
QStringList m_szItemlist = {"wallpaper","ukui-screensaver","ukui-menu","ukui-panel","ukui-panel2","indicator-china-weather","kylin-video"};
MainDialog* m_mainDialog;
QWidget *m_infoWidget;
QHBoxLayout *m_infoLayout;
QThread *thread;
bool m_bAutoSyn = true;
bool m_bTokenValid = false;
QTimer *m_cLoginTimer;
QTimer *m_cSyncDelay;
QString m_szUuid;
QTimer *m_cRetry;
QFileSystemWatcher m_fsWatcher;
SVGHandler *m_svgHandler;
Tooltips *m_syncTooltips;
QLabel *m_syncTipsText;
QHBoxLayout *m_animateLayout;
QHBoxLayout *m_tipsLayout;
QMap<QString,QString> m_itemMap;
QStringList m_keyInfoList;
QLabel *m_infoText;
bool __once__ = false;
bool __run__ = false;
public slots:
void neweditdialog();
void on_login_out();
void on_login();
void open_cloud();
void finished_load(int ret,QString m_szUuid);
void on_switch_button(int on,int id);
void on_auto_syn(int on,int id);
void download_files();
void push_files();
void download_over();
void push_over();
void setret_oss(int ret);
void setret_conf(int ret);
void setret_change(int ret);
void setret_logout(int ret);
void setret_man(int ret);
void setname(QString n);
void setret_check(QString ret);
void get_key_info(QString info);
signals:
void dooss(QString m_szUuid);
void doman();
void dologout();
void doconf();
void dochange(QString name,int flag);
void docheck();
};
#endif // CONFIG_LIST_WIDGET_H