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>
27
#include <QDesktopWidget>
29
#include "bottomcontentwidget.h"
30
#include "infowidget.h"
31
#include "settingwidget.h"
32
#include "cleanerwidget.h"
33
#include "boxwidget.h"
34
#include "../component/kylinmenu.h"
35
#include "../component/utils.h"
36
#include "../component/toolkits.h"
37
#include "aboutdialog.h"
40
class SystemDbusProxy;
41
class SessionDbusProxy;
45
class MainBottomWidget;
48
class MainWindow : public QMainWindow
53
explicit MainWindow(QString cur_arch = "", int d_count = 0, QWidget* parent = 0/*, Qt::WindowFlags flags = 0*/);
55
void setTranslator(QTranslator* translator);
57
void reViewThePointSkin(QString pciture);
58
void reViewTheOrgSkin();
59
void changeSkin(QString pciture);
61
int getCurrentBackgroundIndex();
62
QString getCurrentBackgroundName();
63
QString getCurrentBackgroundAbsName();
64
QStringList filterSkin();
65
bool deleteFile(QString filename);
66
bool CopyFile(QString filename);
67
QString accessOSName();
68
void createAboutDialog();
74
void mousePressEvent(QMouseEvent *event);
75
void mouseReleaseEvent(QMouseEvent *event);
76
void mouseMoveEvent(QMouseEvent *event);
77
void closeEvent(QCloseEvent *);
78
// virtual void paintEvent(QPaintEvent *event);
81
void openSkinCenter();
82
void openUpgradePage(/*QStringList version_list*/);
83
// void openUpgradePageAgain();
85
void closeYoukerAssistant();
86
void setCurrentPageIndex(int index);
87
void changeLanguage(LANGUAGE language);
89
void setupConfigure();
91
void startDbusDaemon();
92
void onInitDataFinished();
93
void onPluginModuleError(const QString &info);
96
QStackedWidget *m_topStack = nullptr;
97
QStackedWidget *m_bottomStack = nullptr;
99
MainTopWidget *m_mainTopWidget = nullptr;
100
MiddleWidget *m_middleWidget = nullptr;
101
MainBottomWidget *m_mainBottomWidget = nullptr;
102
MainTopWidget *cleaner_action_widget;
103
TopBaseWidget *info_action_widget = nullptr;
104
TopBaseWidget *setting_action_widget = nullptr;
105
TopBaseWidget *box_action_widget = nullptr;
107
InfoWidget *info_widget = nullptr;
108
CleanerWidget *cleaner_widget = nullptr;
109
SettingWidget *setting_widget = nullptr;
110
BoxWidget *box_widget = nullptr;
111
KylinMenu *main_menu = nullptr;
112
QPoint m_dragPosition; //移动的距离
113
bool m_mousePressed; //按下鼠标左键
114
QTranslator* translator = nullptr; //翻译器
115
LANGUAGE current_language; //当前语言
116
QPixmap main_skin_pixmap;
117
QString last_skin_path;
118
QPixmap review_skin_pixmap;
119
Toolkits *toolKits = nullptr;
120
AboutDialog *aboutDlg;
121
QSettings *mSettings;
128
QStringList m_cpulist;
129
QString m_currentCpuMode;
131
DataWorker *m_dataWorker = nullptr;
132
QWidget *centralWidget = nullptr;
135
class GlobalData // define by hebing,just for transmit var
139
static QString globalarch;
142
#endif // MAINWINDOW_H