2
* Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd.
5
* Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com
7
* This program is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; version 3.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program. If not, see <http://www.gnu.org/licenses/>.
23
#include <QMainWindow>
25
#include <QTranslator>
28
#include "titlewidget.h"
29
#include "actionwidget.h"
30
#include "toolwidget.h"
31
#include "loginwidget.h"
32
#include "contentwidget.h"
34
#include "infowidget.h"
35
#include "settingwidget.h"
36
#include "cleanerwidget.h"
37
#include "boxwidget.h"
38
#include "skincenter.h"
39
#include "../component/kylinmenu.h"
40
#include "../component/utils.h"
41
#include "../component/systemtray.h"
43
#include "homeactionwidget.h"
44
#include "infoactionwidget.h"
45
#include "cleaneractionwidget.h"
46
#include "settingactionwidget.h"
47
#include "boxactionwidget.h"
48
#include "aboutdialog.h"
50
//#include "../dbusproxy/youkersystemdbus.h"
52
class SessionDispatcher;
53
class SystemDispatcher;
59
class MainWindow : public QMainWindow
64
explicit MainWindow(QWidget *parent = 0);
66
void setTranslator(QTranslator* translator);
67
void setMainWindowLayout();
70
void initSkinCenter();
72
void showInfoWidget();
73
void showClearWidget();
74
void showSettingWidget();
76
// QPixmap* NinePatch(QString picName,int titleHeight,int BorderLineWidth ,QWidget* Wnd);
78
void reViewThePointSkin(QString pciture);
79
void changeSkin(QString pciture);
83
// void paintEvent(QPaintEvent *event);
84
// QPixmap background;
85
void mousePressEvent(QMouseEvent *event);
86
void mouseReleaseEvent(QMouseEvent *event);
87
void mouseMoveEvent(QMouseEvent *event);
91
void openSkinCenter();
93
void closeYoukerAssistant();
94
void setCurrentPageIndex(int index);
95
void changeLanguage(LANGUAGE language);
97
void setupConfigure();
100
void showMainWindow();
101
void iconIsActived(QSystemTrayIcon::ActivationReason reason);
103
void startDbusDaemon();
106
void chanegBoxToolStatus();
111
// QVBoxLayout *main_layout;
112
QBoxLayout *main_layout;
113
QGridLayout *top_grid_layout;
114
QGridLayout *bottom_grid_layout;
115
// QSplitter *splitter;
116
TitleWidget *title_widget;
117
ActionWidget *action_widget;
118
ToolWidget *tool_widget;
119
LoginWidget *login_widget;
120
ContentWidget *content_widget;
122
InfoWidget *info_widget;
123
CleanerWidget *cleaner_widget;
124
SettingWidget *setting_widget;
125
BoxWidget *box_widget;
127
HomeActionWidget *home_action_widget;
128
InfoActionWidget *info_action_widget;
129
CleanerActionWidget *cleaner_action_widget;
130
SettingActionWidget *setting_action_widget;
131
BoxActionWidget *box_action_widget;
133
SkinCenter skin_center;
134
KylinMenu *main_menu;
136
QPoint drag_pos; //移动的距离
137
bool mouse_press; //按下鼠标左键
139
QTranslator* translator; //翻译器
140
LANGUAGE current_language; //当前语言
142
QPixmap main_skin_pixmap;
143
QString last_skin_path;
144
QPixmap review_skin_pixmap;
146
SystemTray *system_tray;
147
SystemDispatcher *systeminterface;
148
SessionDispatcher *sessioninterface;
149
AboutDialog *aboutDlg;
150
QSettings * mSettings;
153
#endif // MAINWINDOW_H