diff --git a/component/agentlistitem.cpp b/component/agentlistitem.cpp index def171f..467c6bc 100644 --- a/component/agentlistitem.cpp +++ b/component/agentlistitem.cpp @@ -25,7 +25,7 @@ AgentListItem::AgentListItem(QWidget *parent) : QWidget(parent) { this->setWindowFlags(Qt::FramelessWindowHint); - mouse_press = false; + m_mousePressed = false; label = new QLabel(); delede_button = new QPushButton(); delede_button->setFocusPolicy(Qt::NoFocus); @@ -81,15 +81,15 @@ void AgentListItem::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; + m_mousePressed = true; } } void AgentListItem::mouseReleaseEvent(QMouseEvent *event) { - if(mouse_press) + if(m_mousePressed) { emit showItemName(label->text()); - mouse_press = false; + m_mousePressed = false; } } diff --git a/component/agentlistitem.h b/component/agentlistitem.h index c427259..b0bd75d 100644 --- a/component/agentlistitem.h +++ b/component/agentlistitem.h @@ -48,7 +48,7 @@ public slots: void onDeleteButtonClicked(); private: - bool mouse_press; + bool m_mousePressed; QLabel *label; QPushButton *delede_button; diff --git a/component/kylinbutton.cpp b/component/kylinbutton.cpp index 3b2fd09..087d6e6 100644 --- a/component/kylinbutton.cpp +++ b/component/kylinbutton.cpp @@ -23,7 +23,7 @@ KylinButton::KylinButton(QWidget *parent) :QPushButton(parent) { status = NORMAL; - mouse_press = false; + m_mousePressed = false; } KylinButton::~KylinButton() @@ -47,7 +47,7 @@ void KylinButton::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; + m_mousePressed = true; status = PRESS; update(); } @@ -55,9 +55,9 @@ void KylinButton::mousePressEvent(QMouseEvent *event) void KylinButton::mouseReleaseEvent(QMouseEvent *event) { - if(mouse_press && this->rect().contains(event->pos())) + if(m_mousePressed && this->rect().contains(event->pos())) { - mouse_press = false; + m_mousePressed = false; status = ENTER; update(); emit clicked(); diff --git a/component/kylinbutton.h b/component/kylinbutton.h index 960865e..3421629 100644 --- a/component/kylinbutton.h +++ b/component/kylinbutton.h @@ -48,7 +48,7 @@ private: int btn_width; //按钮宽度 int btn_height; //按钮高度 - bool mouse_press; //按钮左键是否按下 + bool m_mousePressed; //按钮左键是否按下 }; #endif //KYLINBUTTON_H diff --git a/component/kylinswitcher.cpp b/component/kylinswitcher.cpp index 837b87a..d56d87f 100644 --- a/component/kylinswitcher.cpp +++ b/component/kylinswitcher.cpp @@ -25,7 +25,7 @@ KylinSwitcher::KylinSwitcher(QWidget *parent) : { setWindowFlags(Qt::FramelessWindowHint); switchedOn = false; - mouse_press = false; + m_mousePressed = false; pixmap_on.load("://res/switch-on.png"); pixmap_off.load("://res/switch-off.png"); this->setFixedSize(pixmap_on.width(), pixmap_on.height()); @@ -36,14 +36,14 @@ void KylinSwitcher::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; + m_mousePressed = true; } } void KylinSwitcher::mouseReleaseEvent(QMouseEvent *event) { - if (mouse_press && this->rect().contains(event->pos())) { - mouse_press = false; + if (m_mousePressed && this->rect().contains(event->pos())) { + m_mousePressed = false; switchedOn = !switchedOn; emit clicked(); } diff --git a/component/kylinswitcher.h b/component/kylinswitcher.h index e261cd3..7c1dd93 100644 --- a/component/kylinswitcher.h +++ b/component/kylinswitcher.h @@ -46,7 +46,7 @@ public slots: private: QPixmap pixmap_on; QPixmap pixmap_off; - bool mouse_press; + bool m_mousePressed; }; #endif // KYLINSWITCHER_H diff --git a/component/kylintoolbutton.cpp b/component/kylintoolbutton.cpp index 1603324..49e3ce5 100644 --- a/component/kylintoolbutton.cpp +++ b/component/kylintoolbutton.cpp @@ -50,7 +50,7 @@ KylinToolButton::KylinToolButton(const QString &pic_name, const QString &text, Q setAutoRaise(true); this->setObjectName("transparentToolButton"); mouse_over = false; - mouse_press = false; + m_mousePressed = false; pressed = false; } @@ -103,9 +103,9 @@ void KylinToolButton::setMouseHover() void KylinToolButton::setMousePress(bool is_press) { - this->mouse_press = is_press; + this->m_mousePressed = is_press; - if(this->mouse_press) + if(this->m_mousePressed) { this->setIcon(QIcon(press_icon)); pressed = true; @@ -122,7 +122,7 @@ void KylinToolButton::setMousePress(bool is_press) // } // else // { -// if(this->mouse_press) +// if(this->m_mousePressed) // { // this->setIcon(QIcon(press_icon)); // } diff --git a/component/kylintoolbutton.h b/component/kylintoolbutton.h index bd9cafb..2ba5f7c 100644 --- a/component/kylintoolbutton.h +++ b/component/kylintoolbutton.h @@ -41,7 +41,7 @@ protected: public: bool mouse_over; //鼠标是否移过 - bool mouse_press; //鼠标是否按下 + bool m_mousePressed; //鼠标是否按下 QIcon normal_icon; QIcon hover_icon; QIcon press_icon; diff --git a/component/systembutton.cpp b/component/systembutton.cpp index 1dddce1..139001e 100644 --- a/component/systembutton.cpp +++ b/component/systembutton.cpp @@ -24,7 +24,7 @@ SystemButton::SystemButton(QWidget *parent) : QPushButton(parent) { status = NORMAL; - mouse_press = false; + m_mousePressed = false; } @@ -46,7 +46,7 @@ void SystemButton::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; + m_mousePressed = true; status = PRESS; update(); } @@ -54,9 +54,9 @@ void SystemButton::mousePressEvent(QMouseEvent *event) void SystemButton::mouseReleaseEvent(QMouseEvent *event) { - if(mouse_press && this->rect().contains(event->pos())) + if(m_mousePressed && this->rect().contains(event->pos())) { - mouse_press = false; + m_mousePressed = false; status = ENTER; update(); emit clicked(); diff --git a/component/systembutton.h b/component/systembutton.h index 86074c3..424ce3e 100644 --- a/component/systembutton.h +++ b/component/systembutton.h @@ -48,7 +48,7 @@ private: QPixmap pixmap; enum ButtonStatus{NORMAL, ENTER, PRESS}; ButtonStatus status; - bool mouse_press; //按钮左键是否按下 + bool m_mousePressed; //按钮左键是否按下 int btn_width; int btn_height; }; diff --git a/component/utils.h b/component/utils.h index e35b966..66507d3 100644 --- a/component/utils.h +++ b/component/utils.h @@ -27,12 +27,19 @@ #define ITEMVSPACE 5 #define PAGESPACE 20 #define ITEMWIDTH 650 +#define SHADOW_LEFT_TOP_PADDING 1 +#define SHADOW_RIGHT_BOTTOM_PADDING 2 +#define MAIN_WINDOW_WIDTH 900 +#define MAIN_WINDOW_HEIGHT 600 +//const int windowShadowPadding = 10; //#define VERSION "2.4.1" const QString KYLIN_COMPANY_SETTING = "kylin/kylin-assistant"; const QString KYLIN_SETTING_FILE_NAME_SETTING = "kylin-assistant"; + + typedef enum{ YOUKER_EN, YOUKER_ZH_CN, diff --git a/dbusproxy/youkersessiondbus.cpp b/dbusproxy/youkersessiondbus.cpp index dd0c878..98498db 100644 --- a/dbusproxy/youkersessiondbus.cpp +++ b/dbusproxy/youkersessiondbus.cpp @@ -27,11 +27,8 @@ SessionDispatcher::SessionDispatcher(QObject *parent) "/com/kylin/assistant/sessiondaemon", "com.kylin.assistant.sessiondaemon", QDBusConnection::sessionBus()); - // QObject::connect(sessioniface, SIGNAL(autostartmanage_data_signal(QVariantMap)), this, SLOT(handlerAutoManageData(QVariantMap))); - - QObject::connect(sessioniface, SIGNAL(autostartmanage_data_signal(QStringList)), this, SLOT(handlerAutoManageData(QStringList))); QObject::connect(sessioniface, SIGNAL(autostartmanage_status_signal(QString)), this, SLOT(handlerAutoManageStatus(QString))); QObject::connect(sessioniface, SIGNAL(autostartmanage_error_signal(QString)), this, SLOT(handlerAutoManageError(QString))); diff --git a/debian/changelog b/debian/changelog index 7f4d531..ac77150 100644 --- a/debian/changelog +++ b/debian/changelog @@ -18,5 +18,6 @@ kylin-assistant (1.0.0-0ubuntu1) bionic; urgency=low * Add monitor for file system. * Add QDbus module(system dbus and session dbus). * Make all dbus modules quit when the app quit. + * Rewrite mainwindow. -- lixiang Mon, 29 Jan 2018 17:54:44 +0800 diff --git a/plugins/systemmonitor/monitortitlewidget.cpp b/plugins/systemmonitor/monitortitlewidget.cpp index b5a5534..aa77744 100644 --- a/plugins/systemmonitor/monitortitlewidget.cpp +++ b/plugins/systemmonitor/monitortitlewidget.cpp @@ -293,7 +293,7 @@ void MonitorTitleWidget::initToolbarLeftContent() w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); m_toolLeftLayout = new QHBoxLayout(w); m_toolLeftLayout->setContentsMargins(0, 0, 0, 0); - m_toolLeftLayout->setSpacing(0); + m_toolLeftLayout->setSpacing(10); MyUnderLineButton *processButton = new MyUnderLineButton(); processButton->setName(tr("Processes")); @@ -336,8 +336,6 @@ void MonitorTitleWidget::initToolbarLeftContent() emit canelSearchEditFocus(); }); - m_toolLeftLayout->setContentsMargins(0, 0, 0, 0); - m_toolLeftLayout->setSpacing(10); m_toolLeftLayout->addStretch(); m_toolLeftLayout->addWidget(processButton); m_toolLeftLayout->addWidget(resourcesButton); diff --git a/src/aboutdialog.cpp b/src/aboutdialog.cpp index aab04f2..b1b45e2 100644 --- a/src/aboutdialog.cpp +++ b/src/aboutdialog.cpp @@ -236,23 +236,23 @@ void AboutDialog::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; - drag_pos = event->globalPos() - this->frameGeometry().topLeft(); + m_mousePressed = true; + m_dragPosition = event->globalPos() - this->frameGeometry().topLeft(); event->accept(); } } void AboutDialog::mouseReleaseEvent(QMouseEvent *) { - mouse_press = false; + m_mousePressed = false; } void AboutDialog::mouseMoveEvent(QMouseEvent *event) { - if(mouse_press) + if(m_mousePressed) { QPoint move_pos = event->globalPos(); - move(move_pos - drag_pos); + move(move_pos - m_dragPosition); event->accept(); } } diff --git a/src/aboutdialog.h b/src/aboutdialog.h index 993c065..3837f14 100644 --- a/src/aboutdialog.h +++ b/src/aboutdialog.h @@ -52,8 +52,8 @@ protected: private: // KylinTitleBar *title_bar; - QPoint drag_pos; //移动的距离 - bool mouse_press; //按下鼠标左键 + QPoint m_dragPosition; //移动的距离 + bool m_mousePressed; //按下鼠标左键 QWidget *baseWidget; SystemButton *close_btn; QPushButton *aboutBtn; diff --git a/src/cleaneractionwidget.cpp b/src/cleaneractionwidget.cpp index 54f6cd9..9f41125 100644 --- a/src/cleaneractionwidget.cpp +++ b/src/cleaneractionwidget.cpp @@ -28,7 +28,7 @@ CleanerActionWidget::CleanerActionWidget(QWidget *parent) this->setFixedSize(900, 150); this->setAutoFillBackground(true); - this->setObjectName("transparentWidget"); +// this->setObjectName("transparentWidget"); // cache_page = new CacheActionWidget(this); // statked_widget = new QStackedWidget(this); //// QPalette palette; diff --git a/src/dataworker.cpp b/src/dataworker.cpp index 00cba0c..88488aa 100644 --- a/src/dataworker.cpp +++ b/src/dataworker.cpp @@ -140,6 +140,20 @@ bool DataWorker::copyAppointedFile(QString filename) return result; } + +//---------------scan on homepage +void DataWorker::onStartOneKeyScan(const QStringList &categorys) +{ + m_sessionInterface->onekey_scan_function_qt(categorys); +} + +//---------------clean on homepage +void DataWorker::onStartOneKeyClean() +{ + m_systemInterface->set_user_homedir_qt(); + m_systemInterface->clean_by_main_one_key_qt(); +} + //---------------scan void DataWorker::onStartScanSystem(QMap itemsMap) { diff --git a/src/dataworker.h b/src/dataworker.h index 3f0a177..7ad2cf8 100644 --- a/src/dataworker.h +++ b/src/dataworker.h @@ -51,6 +51,11 @@ public slots: void doWork(); void updateSensorValue(); + //scan on homepage + void onStartOneKeyScan(const QStringList &categorys); + //clean on homepage + void onStartOneKeyClean(); + //scan void onStartScanSystem(QMap itemsMap); //clean diff --git a/src/homepage.cpp b/src/homepage.cpp index b636379..6c35202 100644 --- a/src/homepage.cpp +++ b/src/homepage.cpp @@ -319,15 +319,15 @@ void HomePage::switchPageIndex(QString index) if(index == "0") emit this->sendSubIndex(0); - else if(index == "-1") - if(this->osarch == "aarch64" || this->osname == "Kylin" || this->osname == "YHKylin") - sessionProxy->runApp("cheese"); - else - emit this->sendSubIndex(1); - else if(index == "1") { -// p_mainwindow->showBoxWidget(); - emit this->moreSignal(); - } +// else if(index == "-1") +// if(this->osarch == "aarch64" || this->osname == "Kylin" || this->osname == "YHKylin") +// sessionProxy->runApp("cheese"); +// else +// emit this->sendSubIndex(1); +// else if(index == "1") { +//// p_mainwindow->showBoxWidget(); +// emit this->moreSignal(); +// } // if(index == "0") // { diff --git a/src/infowidget.cpp b/src/infowidget.cpp index b4e95ed..4000e35 100644 --- a/src/infowidget.cpp +++ b/src/infowidget.cpp @@ -68,7 +68,7 @@ InfoWidget::~InfoWidget() } } -void InfoWidget::initUI(bool has_battery, bool has_sensor) +void InfoWidget::initInfoUI(bool has_battery, bool has_sensor) { type_list.clear(); icon_list.clear(); diff --git a/src/infowidget.h b/src/infowidget.h index 20ce053..5406cb9 100644 --- a/src/infowidget.h +++ b/src/infowidget.h @@ -46,7 +46,7 @@ public: explicit InfoWidget(QString machine = "", QWidget *parent = 0); ~InfoWidget(); - void initUI(bool has_battery, bool has_sensor); + void initInfoUI(bool has_battery, bool has_sensor); public slots: void changeInfoPage(QListWidgetItem* item); diff --git a/src/main.cpp b/src/main.cpp index 4c45ae4..ef3b56a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -135,6 +135,9 @@ bool registerSingleInstance(const QString &path) int main(int argc, char *argv[]) { + //find . | xargs -x touch + //linguist: sudo apt-get install qt4-dev-tools + // QApplication app(argc, argv); Kpplication app("kylin-assistant", argc, argv); app.setQuitOnLastWindowClosed(false); @@ -242,6 +245,7 @@ int main(int argc, char *argv[]) #endif*/ w.setTranslator(&translator); +// w.show(); // if (sCount > 1) { // w.setGeometry(desktop->screenGeometry(1)); diff --git a/src/mainbottomwidget.cpp b/src/mainbottomwidget.cpp new file mode 100644 index 0000000..1b2e80c --- /dev/null +++ b/src/mainbottomwidget.cpp @@ -0,0 +1,410 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#include "mainbottomwidget.h" +#include +#include +#include "mainwindow.h" +#include "../component/toolbutton.h" +#include "../component/utils.h" + +MainBottomWidget::MainBottomWidget(QWidget *parent, QString arch, QString os/*, const QString &version*/) : + QWidget(parent), osarch(arch), osname(os) +{ + this->setFixedSize(900, 326); + + //set white background color + this->setAutoFillBackground(true); + QPalette palette; + palette.setBrush(QPalette::Window, QBrush(Qt::white)); + this->setPalette(palette); + +//// QPixmap label_pixmap(""); +//// movie_label->setPixmap(label_pixmap); +//// movie_label->setFixedSize(label_pixmap.size()); + +// scan_button->setFocusPolicy(Qt::NoFocus); +// QPixmap pixmap("://res/scan.png"); +// scan_button->setIcon(pixmap); +// scan_button->setIconSize(pixmap.size()); + current_version = qApp->applicationVersion(); + version_logo = new QLabel(); + version_title = new QLabel(); + version_tip = new QLabel(); + check_btn = new QPushButton(); + check_btn->hide(); +// version_label = new QLabel(); + box_logo = new QLabel(); + box_title = new QPushButton(); + box_title->setFixedWidth(240); + box_title->setCursor(Qt::PointingHandCursor); + box_title->setFocusPolicy(Qt::NoFocus); + box_title->setStyleSheet("QPushButton{background:#ffffff;border:none;text-align:left;font-family: 方正黑体_GBK;font-size:24px;color:#000000;}QPushButton:hover{color:#3f96e4;}");//background:transparent; +// box_title->installEventFilter(this); + box_tip = new QLabel(); +// more_text_btn = new QPushButton(); +// more_btn = new QPushButton(); + +// auto_start = NULL; +// camera_manager = NULL; + +// more_text_btn->setObjectName("checkButton"); +// more_text_btn->setCursor(Qt::PointingHandCursor); +// more_text_btn->setCursor(Qt::OpenHandCursor); +// more_text_btn->setFocusPolicy(Qt::NoFocus); +// QFont font = more_text_btn->font(); +// font.setUnderline(true); +// more_text_btn->setFont(font); + + check_btn->setObjectName("checkButton"); + check_btn->setCursor(Qt::PointingHandCursor); + check_btn->setFocusPolicy(Qt::NoFocus); +// version_label->setObjectName("smallgrayLabel"); + version_title->setObjectName("bigblackLabel"); +// box_title->setObjectName("bigblackLabel"); + version_tip->setAlignment(Qt::AlignLeft); + version_tip->setObjectName("smallgrayLabel"); + version_tip->setFixedWidth(380); + box_tip->setAlignment(Qt::AlignLeft); + box_tip->setObjectName("smallgrayLabel"); + version_tip->setWordWrap(true);//QLabel自动换行 + box_tip->setWordWrap(true);//QLabel自动换行 + box_tip->setFixedWidth(380); +// more_btn->setObjectName("transparentButton"); +// more_btn->setCursor(Qt::PointingHandCursor); + + version_logo->setFixedSize(65, 65); + version_logo->setPixmap(QPixmap("://res/version.png")); + box_logo->setFixedSize(65, 65); + box_logo->setPixmap(QPixmap("://res/box.png")); + + this->initUI(); + + this->setLanguage(); + +} + +MainBottomWidget::~MainBottomWidget() +{ + if(version_logo != NULL) { + delete version_logo; + version_logo = NULL; + } + if(version_title != NULL) { + delete version_title; + version_title = NULL; + } + if(version_tip != NULL) { + delete version_tip; + version_tip = NULL; + } + if(check_btn != NULL) { + delete check_btn; + check_btn = NULL; + } + if(box_logo != NULL) { + delete box_logo; + box_logo = NULL; + } + if(box_title != NULL) { + delete box_title; + box_title = NULL; + } + if(box_tip != NULL) { + delete box_tip; + box_tip = NULL; + } +// for(int i=0; iaddWidget(version_title); + layout1->addWidget(check_btn); +// layout1->addWidget(version_label); + layout1->addStretch(); + layout1->setMargin(0); + layout1->setSpacing(5); + layout1->setContentsMargins(0,0,0,0); + QVBoxLayout *layout2 = new QVBoxLayout(); + layout2->addStretch(); + layout2->addLayout(layout1); + layout2->addWidget(version_tip); + layout2->addStretch(); + layout2->setMargin(0); + layout2->setSpacing(5); + layout2->setContentsMargins(0,0,0,0); + QHBoxLayout *layout3 = new QHBoxLayout(); + layout3->addWidget(version_logo/* ,0, Qt::AlignVCenter*/); + layout3->addLayout(layout2); + layout3->addStretch(); + layout3->setMargin(0); + layout3->setSpacing(5); + layout3->setContentsMargins(0,0,0,0); + + QVBoxLayout *layout4 = new QVBoxLayout(); + layout4->addStretch(); + layout4->addWidget(box_title); + layout4->addWidget(box_tip); + layout4->addStretch(); + layout4->setMargin(0); + layout4->setSpacing(5); + layout4->setContentsMargins(0,0,0,0); + + + + + /*QStringList icon_list; +// icon_list<<"://res/ubuntukylin-software-center"<<"://res/boot"<<"://res/camera"; + icon_list<<"://res/boot" << "://res/more.png"; + QStringList text_list; +// text_list<< tr("Youker Softeware Center") << tr("Boot Manager") << tr("Camera"); + text_list << tr("Boot Manager") << tr("More"); + QHBoxLayout *button_layout = new QHBoxLayout(); + QSignalMapper *signal_mapper = new QSignalMapper(this); + for(int i=0; isetFocusPolicy(Qt::NoFocus); + tool_button->setIcon(icon_list.at(i)); + tool_button->setText(text_list.at(i)); + connect(tool_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); + signal_mapper->setMapping(tool_button, QString::number(i, 10)); + button_layout->addWidget(tool_button); + item_list.append(tool_button); + } + connect(signal_mapper, SIGNAL(mapped(QString)), this, SLOT(switchPageIndex(QString))); +*/ + +// more_btn->setFocusPolicy(Qt::NoFocus); +// QPixmap pixmap("://res/more.png"); +// more_btn->setIcon(pixmap); +// more_btn->setIconSize(pixmap.size()); + +// QVBoxLayout *more_layout = new QVBoxLayout(); +//// more_layout->addStretch(); +// more_layout->addWidget(more_btn); +// more_layout->addWidget(more_text_btn); +//// more_layout->addStretch(); +// more_layout->setSpacing(0); +// more_layout->setMargin(0); +// more_layout->setContentsMargins(0, 8, 0, 0); + +// button_layout->addStretch(); +// button_layout->addLayout(more_layout); +//// button_layout->addWidget(more_btn, 0, Qt::AlignTop); +// button_layout->setSpacing(20); +// button_layout->setMargin(0); +// button_layout->setContentsMargins(0, 0, 0, 0); + + QHBoxLayout *layout5 = new QHBoxLayout(); + layout5->addWidget(box_logo); + layout5->addLayout(layout4); + layout5->addStretch(); +// layout5->addLayout(button_layout); + layout5->setMargin(0); + layout5->setSpacing(5); + layout5->setContentsMargins(0,0,0,0); + + + + QVBoxLayout *main_layout = new QVBoxLayout(); + main_layout->addLayout(layout3); + main_layout->addLayout(layout5); + main_layout->setMargin(0); + main_layout->setSpacing(50); + main_layout->setContentsMargins(60,50,60,80); + + this->setLayout(main_layout); +} + +void MainBottomWidget::initConnect() +{ + connect(this, SIGNAL(moreSignal()), p_mainwindow, SIGNAL(chanegBoxToolStatus())); +// connect(more_btn, SIGNAL(clicked()), p_mainwindow, SLOT(showBoxWidget())); +// connect(more_btn, SIGNAL(clicked()), p_mainwindow, SIGNAL(chanegBoxToolStatus())); +// connect(more_text_btn, SIGNAL(clicked()), p_mainwindow, SLOT(showBoxWidget())); +// connect(more_text_btn, SIGNAL(clicked()), p_mainwindow, SIGNAL(chanegBoxToolStatus())); +// connect(check_btn, SIGNAL(clicked()), this, SLOT(checkLastestVersion())); + connect(check_btn, SIGNAL(clicked()), this, SLOT(onCheckBtnClicked())); + connect(this, SIGNAL(sendSignal()), p_mainwindow, SIGNAL(chanegBoxToolStatus())); + connect(box_title, SIGNAL(clicked()), this, SIGNAL(sendSignal())); +} + +void MainBottomWidget::setLanguage() +{ + version_title->setText(tr("Current Version Number") + " " + current_version); + version_tip->setText(tr("Update to the lastest version, make it work better")); + check_btn->setText(tr("updating on the backend")); + box_title->setText(tr("Common toolbox")); + box_tip->setText(tr("Fast and practical, making the system more personalized")); +// more_text_btn->setText(tr("More")); +// more_btn->setToolTip(tr("More")); +} + +void MainBottomWidget::initBoxTool() +{ + +} + +void MainBottomWidget::onCheckBtnClicked() +{ + emit this->sendOpenUpgrade(); + check_btn->hide(); +} + +void MainBottomWidget::displayBackedBtn(bool flag) +{ + if(flag) + check_btn->setText(tr("Upgrade is complete")); + else + check_btn->setText(tr("Updating on the backend")); + check_btn->show(); +} + +void MainBottomWidget::hideBackedBtn() +{ + check_btn->hide(); +} + +//void HomePage::checkLastestVersion() +//{ +// QStringList version_list = sessionProxy->checkNewVersion(); +// if(version_list.length() == 1) { +// version_label->setText(version_list.at(0)); +// } +// if(version_list.length() == 4) { +// version_label->setText(version_list.at(2)); +// if(version_list.at(3) == "1") { +// qDebug() << "Neet to UPdate......"; +// p_mainwindow->openUpgradePage(version_list); +//// systemProxy->update_myself(); +// } +// else { +// qDebug() << "Unneccesary to UPdate......"; +// p_mainwindow->openUpgradePage(version_list); +// } +// } +// else { +// version_label->setText(""); +// } +//} + +void MainBottomWidget::switchPageIndex(QString index) +{ +// bool ok; +// int current_index = index.toInt(&ok, 10); + +// if(index == "0") +// emit this->sendSubIndex(0); +// else if(index == "-1") +// if(this->osarch == "aarch64" || this->osname == "Kylin" || this->osname == "YHKylin") +// sessionProxy->runApp("cheese"); +// else +// emit this->sendSubIndex(1); +// else if(index == "1") { +//// p_mainwindow->showBoxWidget(); +// emit this->moreSignal(); +// } + +// if(index == "0") +// { +// if(auto_start == NULL) { +// auto_start = new AutoStartWidget(0, sessionProxy); +// connect(sessionProxy, SIGNAL(tellAutoModel(QStringList)), auto_start, SLOT(readyReciveData(QStringList))); +// connect(sessionProxy, SIGNAL(showAutoModel()), auto_start, SLOT(readyShowUI())); +// auto_start->initData(); +// int w_x = p_mainwindow->frameGeometry().topLeft().x() + (900 / 2) - (560 / 2); +// int w_y = p_mainwindow->frameGeometry().topLeft().y() + (600 /2) - (398 / 2); +// auto_start->move(w_x, w_y); +// auto_start->show(); +// auto_start->raise(); +// } +// else { +// int w_x = p_mainwindow->frameGeometry().topLeft().x() + (900 / 2) - (560 / 2); +// int w_y = p_mainwindow->frameGeometry().topLeft().y() + (600 /2) - (398 / 2); +// auto_start->move(w_x, w_y); +// auto_start->show(); +// auto_start->raise(); +// } +// } + +// else if(index == "1") +// { +// if(camera_manager == NULL) { +// camera_manager = new CameraManager(0, sessionProxy); +// if(sessionProxy->judge_camera_qt()) +// { +// camera_manager->setOKButtonEnable(true); +// } +// else{ +// camera_manager->setOKButtonEnable(false); +// } +// int w_x = p_mainwindow->frameGeometry().topLeft().x() + (900 / 2) - (524 / 2); +// int w_y = p_mainwindow->frameGeometry().topLeft().y() + (600 /2) - (277 / 2); +// camera_manager->move(w_x, w_y); +// camera_manager->exec(); +//// camera_manager->show(); +//// camera_manager->raise(); +// } +// else { +// int w_x = p_mainwindow->frameGeometry().topLeft().x() + (900 / 2) - (524 / 2); +// int w_y = p_mainwindow->frameGeometry().topLeft().y() + (600 /2) - (277 / 2); +// camera_manager->move(w_x, w_y); +// camera_manager->show(); +// camera_manager->raise(); +// } +// } +} + +//bool HomePage::eventFilter(QObject *obj, QEvent *event) +//{ +// if(obj == box_title){ +// if(event->type() == QEvent::MouseButtonRelease){ +// emit this->sendSignal(); +//// p_mainwindow->showBoxWidget(); +// } +//// if(event->type() == QEvent::Enter){ +//// ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn_hover.png")); +//// }else if(event->type() == QEvent::Leave){ +//// ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn.png")); +//// }else if(event->type() == QEvent::MouseButtonPress){ +//// ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn_hover.png")); +//// }else if(event->type() == QEvent::MouseButtonRelease){ +//// QMouseEvent *me = (QMouseEvent *)event; +//// QLabel *lb = (QLabel *)obj; +//// if(me->x() > 0 && me->x() < lb->width() && me->y() > 0 && me->y() < lb->height()){ +//// this->close(); +//// this->destroy(); +//// }else{ +//// ui->btn_close->setPixmap(QPixmap(":/pixmap/image/closeBtn.png")); +//// } +//// } else { +//// return QObject::eventFilter(obj, event); +//// } +// } +// return QObject::eventFilter(obj, event); +//} diff --git a/src/mainbottomwidget.h b/src/mainbottomwidget.h new file mode 100644 index 0000000..5fe2703 --- /dev/null +++ b/src/mainbottomwidget.h @@ -0,0 +1,78 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#ifndef MAINBOTTOMWIDGET_H +#define MAINBOTTOMWIDGET_H + +#include +#include +#include +#include +#include + +class MainWindow; +class ToolButton; + +class MainBottomWidget : public QWidget +{ + Q_OBJECT +public: + explicit MainBottomWidget(QWidget *parent = 0, QString arch = "", QString os = ""/*, const QString &version = ""*/); + ~MainBottomWidget(); + void setLanguage(); + void initBoxTool(); + void initConnect(); + void setParentWindow(MainWindow* window) { p_mainwindow = window;} + void initUI(); + +//protected: +// bool eventFilter(QObject *obj, QEvent *event); + +public slots: + void switchPageIndex(QString index); +// void checkLastestVersion(); + void displayBackedBtn(bool flag); + void onCheckBtnClicked(); + void hideBackedBtn(); + +signals: + void sendSubIndex(int index); + void sendSignal(); + void moreSignal(); + void sendOpenUpgrade(); + +private: + QLabel *version_logo; + QLabel *version_title; + QLabel *version_tip; + QPushButton *check_btn; +// QLabel *version_label; + QLabel *box_logo; + QPushButton *box_title; + QLabel *box_tip; + MainWindow *p_mainwindow; +// AutoStartWidget *auto_start; +// CameraManager *camera_manager; + QString current_version; + QString osname; + QString osarch; +// QList item_list; +}; + +#endif // MAINBOTTOMWIDGET_H diff --git a/src/maintopwidget.cpp b/src/maintopwidget.cpp new file mode 100644 index 0000000..8c69567 --- /dev/null +++ b/src/maintopwidget.cpp @@ -0,0 +1,883 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#include "maintopwidget.h" +#include "mainwindow.h" +#include +#include + + +#include "../plugins/widgets/mytristatebutton.h" + + +#include +#include +#include +#include +#include +#include +#include +#include + + +MainTopWidget::MainTopWidget(bool isMain, QSettings *mSettings, QWidget *parent) + : QWidget(parent) + , pSettings(mSettings) + , m_isMain(isMain) +{ + if (m_isMain) + this->setFixedSize(900, 227); + else + this->setFixedSize(900, 150); + + this->setAutoFillBackground(true); +// this->setObjectName("transparentWidget"); + scanFinishTime = ""; + + this->initWidgets(); + + + this->initConnect(); + this->setLanguage(); + + + if (m_isMain) { + workFlag = this->getOneKeyFlag(); + if(workFlag.length() > 0) + { + if(workFlag == "1") + { + //clean + dateStr = this->getFixCleanDate(); + result_label->setText(tr("The lastest cleanup time is ") + dateStr); + } + else if(workFlag == "0") + { + //scan + dateStr = this->getSafeScanDate(); + result_label->setText(tr("The lastest scan time is ") + dateStr); + } + } + else { + result_label->setText(tr("You have not implemented the one key scan and clean-up operation.")); + } + } +} + +MainTopWidget::~MainTopWidget() +{ + if(loading_label) { + delete loading_label; + loading_label = nullptr; + } + if(suggest_label) { + delete suggest_label; + suggest_label = nullptr; + } + if(scan_result_label) { + delete scan_result_label; + scan_result_label = nullptr; + } + if(result_label) { + delete result_label; + result_label = nullptr; + } + if(doing_label) { + delete doing_label; + doing_label = nullptr; + } + + delete scan_button; + delete clean_button; + delete back_button; + + //Segmentation fault + QLayoutItem *child; + while ((child = m_titleLeftLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_titleRightLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_toolLeftLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_toolRightLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_topLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_bottomLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + delete m_layout; +} + +void MainTopWidget::initTitlebarLeftContent() +{ + QWidget *w = new QWidget; + m_titleLeftLayout = new QHBoxLayout(w); + m_titleLeftLayout->setContentsMargins(6, 0, 0, 0); + m_titleLeftLayout->setSpacing(0); + + QLabel *appLabel = new QLabel; + appLabel->setStyleSheet("QLabel{background-color:transparent;color:#ffffff; font-size:12px;}"); + appLabel->setText(tr("Kylin Assistant")); + m_titleLeftLayout->addWidget(appLabel); + + m_topLayout->addWidget(w, 1, Qt::AlignLeft); +} + +void MainTopWidget::initTitlebarRightContent() +{ + QWidget *w = new QWidget; + m_titleRightLayout = new QHBoxLayout(w); + m_titleRightLayout->setContentsMargins(0, 0, 1, 0); + m_titleRightLayout->setSpacing(0); + + m_topLayout->addWidget(w, 1, Qt::AlignRight); + + SystemButton *min_button = new SystemButton(); + SystemButton *close_button = new SystemButton(); +// SystemButton *skin_button = new SystemButton(); + SystemButton *main_menu_button = new SystemButton(); + min_button->loadPixmap(":/sys/res/sysBtn/min_button.png"); + close_button->loadPixmap(":/sys/res/sysBtn/close_button.png"); +// skin_button->loadPixmap(":/sys/res/sysBtn/skin_button.png"); + main_menu_button->loadPixmap(":/sys/res/sysBtn/main_menu.png"); + min_button->setFocusPolicy(Qt::NoFocus); + close_button->setFocusPolicy(Qt::NoFocus); +// skin_button->setFocusPolicy(Qt::NoFocus); + main_menu_button->setFocusPolicy(Qt::NoFocus); + + m_titleRightLayout->addWidget(main_menu_button); +// m_titleRightLayout->addWidget(skin_button); + m_titleRightLayout->addWidget(min_button); + m_titleRightLayout->addWidget(close_button); + + connect(main_menu_button, &SystemButton::clicked, this, [=] { + emit this->showMenu(); + /*if (parentWidget()) { + parentWidget()->showMainMenu(); + }*/ + }); +// connect(skin_button, &SystemButton::clicked, this, [=] { +// if (parentWidget() && parentWidget()->parentWidget()) { +// //openSkinCenter() +// } +// }); + connect(min_button, &SystemButton::clicked, this, [=] { + emit this->showMin(); +// if (parentWidget()) { +// parentWidget()->showMinimized(); +// } + }); + connect(close_button, &SystemButton::clicked, this, [=] { + emit this->closeApp(); +// window()->close(); + }); + + +// connect(min_button, SIGNAL(clicked()), p_mainwindow, SLOT(showMinimized())); +// connect(close_button, SIGNAL(clicked()), this, SIGNAL(closeApp())); +// connect(skin_button, SIGNAL(clicked()), p_mainwindow, SLOT(openSkinCenter())); +// connect(main_menu_button, SIGNAL(clicked()), p_mainwindow, SLOT(showMainMenu())); +} + +void MainTopWidget::initContentLeftContent() +{ + QWidget *w = new QWidget; + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + m_toolLeftLayout = new QHBoxLayout(w); + m_toolLeftLayout->setContentsMargins(0, 0, 0, 0); + m_toolLeftLayout->setSpacing(10); + + suggest_label = new QLabel(); + doing_label = new QLabel(); + if (m_isMain) { + scan_result_label = new QLabel(); + result_label = new QLabel(); + loading_label = new LoadingLabel(this, "firstkey"); + scan_result_label->setObjectName("whiteLabel"); + scan_result_label->setWordWrap(true);//QLabel自动换行 + scan_result_label->setFixedWidth(460); + scan_result_label->hide(); + result_label->setWordWrap(true);//QLabel自动换行 + result_label->setObjectName("smallWhiteLabel"); + result_label->setFixedWidth(460); + suggest_label->setFixedWidth(460); + doing_label->setFixedWidth(460); + } + else { + loading_label = new LoadingLabel(this, "clean"); + suggest_label->setFixedWidth(550); + doing_label->setFixedWidth(550); + } + loading_label->show(); + + suggest_label->setObjectName("whiteLabel"); + suggest_label->setWordWrap(true);//QLabel自动换行 + doing_label->setWordWrap(true);//QLabel自动换行 + doing_label->setObjectName("whiteLabel"); + doing_label->hide(); + + QVBoxLayout *layout1 = new QVBoxLayout(); + layout1->addStretch(); + layout1->addWidget(suggest_label); + if (scan_result_label) + layout1->addWidget(scan_result_label); + layout1->addWidget(doing_label); + if (result_label) + layout1->addWidget(result_label); + layout1->addStretch(); + layout1->setSpacing(15); + layout1->setContentsMargins(0, 20, 0, 0); + + m_toolLeftLayout->addStretch(); + m_toolLeftLayout->addWidget(loading_label, 0, Qt::AlignHCenter); + m_toolLeftLayout->addLayout(layout1); + m_toolLeftLayout->addStretch(); + +// m_bottomLayout->addWidget(w); + m_bottomLayout->addWidget(w, 1, Qt::AlignLeft); +} + +void MainTopWidget::initActionRightContent() +{ + QWidget *w = new QWidget; + m_toolRightLayout = new QHBoxLayout(w); + m_toolRightLayout->setContentsMargins(0, 3, 6, 10); + m_toolRightLayout->setSpacing(5); + + scan_button = new QPushButton(this); + clean_button = new QPushButton(this); + back_button = new QPushButton(this); + + scan_button->setObjectName("greenButton"); + scan_button->setFocusPolicy(Qt::NoFocus); + if (m_isMain) { + scan_button->setFixedSize(204, 65); + clean_button->setFixedSize(204, 65); + QPixmap pixmap("://res/scan.png"); + scan_button->setIcon(pixmap); + scan_button->setIconSize(pixmap.size()); + } + else { + scan_button->setFixedSize(182, 58); + clean_button->setFixedSize(182, 58); + } + scan_button->show(); + clean_button->setFocusPolicy(Qt::NoFocus); + clean_button->setObjectName("greenButton"); + clean_button->hide(); + + back_button->setFocusPolicy(Qt::NoFocus); + back_button->setFixedSize(50, 30); +// back_button->setObjectName("backButton"); + back_button->setObjectName("underlineButton"); + back_button->hide();//setVisible(false) + + m_toolRightLayout->addWidget(scan_button); + m_toolRightLayout->addWidget(clean_button); + m_toolRightLayout->addWidget(back_button); + m_bottomLayout->addWidget(w, 1, Qt::AlignRight); +} + +void MainTopWidget::initWidgets() +{ + m_layout = new QVBoxLayout(this); + m_layout->setContentsMargins(0, 0, 0, 0); + m_layout->setSpacing(0); + + QWidget *topWidget = new QWidget; + m_topLayout = new QHBoxLayout(topWidget); + m_topLayout->setContentsMargins(0, 0, 0, 0); + m_topLayout->setSpacing(0); + m_layout->addWidget(topWidget, 0, Qt::AlignTop); + + QWidget *bottomWidget = new QWidget; + m_bottomLayout = new QHBoxLayout(bottomWidget); + m_bottomLayout->setContentsMargins(13, 0, 0, 20); + m_bottomLayout->setSpacing(0); + m_layout->addWidget(bottomWidget, 0, Qt::AlignBottom); + + this->setLayout(m_layout); + + initTitlebarLeftContent(); + initTitlebarRightContent(); + initContentLeftContent(); + initActionRightContent(); +} + +void MainTopWidget::initConnect() +{ + connect(scan_button, SIGNAL(clicked()), this, SLOT(onStartButtonClicked())); + connect(clean_button, SIGNAL(clicked()), this, SLOT(onCleanButtonClicked())); + connect(back_button, SIGNAL(clicked()), this, SLOT(onEndButtonClicked())); +} + +void MainTopWidget::setLanguage() +{ + scan_button->setText(tr("Start Scan"));//开始扫描 + clean_button->setText(tr("Start Cleanup"));//开始清理 + back_button->setText(tr("Back")); + doing_label->setText(tr("Scanning......"));//正在扫描...... + + if (m_isMain) { + suggest_label->setText(tr("Quick clean up system trash, saving disk space and improving the system efficiency!"));//一键清理系统垃圾,帮您节省磁盘空间,让系统运行更加有效率! + scan_result_label->setText(tr("Scan Over")); + } + else { + suggest_label->setText(tr("Regular cleaning, let your computer remains the relaxed state"));//经常清理,让电脑保持最轻松的状态 + } +} + +//void MainTopWidget::enableSanButton() +//{ +// scan_button->setEnabled(true); +//} + +void MainTopWidget::showCleanOverStatus() +{ + loading_label->stopLoading(); + scan_button->show(); + scan_button->setEnabled(true); + clean_button->hide(); + clean_button->setEnabled(true); + back_button->hide(); + doing_label->setText(tr("Clean OK")); +} + +void MainTopWidget::showCleanerData(const QStringList &data) +{ + if(data.length() == 2) + { + doing_label->setText(tr("Cleaning: ") + data.at(0).split(":").at(1)); + } + else if(data.length() == 3) + { + doing_label->setText(data.at(0).split(":").at(1) + tr(", Percent is: ") + data.at(1).split(":").at(1) + tr("%, Status is: ") + data.at(2).split(":").at(1)); + } +} + +void MainTopWidget::showCleanerStatus(const QString &status, const QString &domain) +{ + if(status == "Complete:History.firefox" && domain == "history") + { + doing_label->setText(tr("Clean Firefox history......")); + } + else if(status == "Complete:History.chromium" && domain == "history") + { + doing_label->setText(tr("Clean Chromium history......")); + } + else if(status == "Complete:History.system" && domain == "history") + { + doing_label->setText(tr("Clean system history......")); + } + + else if(status == "Complete:" && domain == "apt") + { + doing_label->setText(tr("Clean apt......")); + } + else if(status == "Start:" && domain == "apt") + { + doing_label->setText(tr("Start clean apt......")); + } + + else if(status == "Complete:Cookies.firefox") + { + doing_label->setText(tr("Clean Firefox Cookie:") + domain); + } + else if(status == "Complete:Cookies.chromium") + { + doing_label->setText(tr("Clean Chromium Cookie:") + domain); + } +} + +void MainTopWidget::showCleanerError(const QString &status) +{ + if(status.contains("Non-existent:")) + { + if(status.split(":").at(1).length() > 0) + doing_label->setText(status.split(":").at(1) + tr(" does not exist")); + } + else if(status.contains("Working:Chromium")) + { + doing_label->setText(tr("Chromium Browser is running......")); + } +} + +void MainTopWidget::showCleanReciveStatus(const QString &status) +{ + if(status == "Complete:Cache") + { + doing_label->setText(tr("Cache Scan OK")); + } + else if(status == "Complete:Cookies") + { + doing_label->setText(tr("Cookies Scan OK")); + } + else if(status == "Complete:") + { + doing_label->setText(tr("History Scan OK")); + } + else if(status == "Complete:Packages") + { + doing_label->setText(tr("Packages Scan OK")); + } + else if(status == "Complete:All") + { +// doing_label->setText(tr("Scaning......")); +// doing_label->hide(); +// loading_label->stopLoading(); +// scan_button->hide(); +// scan_button->setEnabled(true); +// clean_button->show(); +// clean_button->setEnabled(true); +// suggest_label->show(); +// back_button->show(); + } +} + +void MainTopWidget::accordScanOverStatusToChange(bool status) +{ + if (status) { + doing_label->setText(tr("Scaning......")); + doing_label->hide(); + loading_label->stopLoading(); + scan_button->hide(); + scan_button->setEnabled(true); + clean_button->show(); + clean_button->setEnabled(true); + suggest_label->show(); + back_button->show(); + } + else { + doing_label->setText(tr("Scaning......")); + doing_label->hide(); + loading_label->stopLoading(); + scan_button->hide(); + scan_button->setEnabled(true); + clean_button->hide(); + clean_button->setEnabled(true); + suggest_label->show(); + back_button->show(); + } +} + +void MainTopWidget::showCleanReciveError(const QString &status) +{ + doing_label->setText(tr("Error: ") + status); + if(status == "Uninstalled:Firefox") + { + doing_label->setText(tr("Firefox Browser does not be installed")); + } + else if(status == "Uninstalled:Chromium") + { + doing_label->setText(tr("Chromium Browser does not be installed")); + } + else if(status == "Working:Chromium") + { + doing_label->setText(tr("Chromium Browser is running")); + } + else + { + if(status.contains("Non-existent:")) + doing_label->setText(status.split(":").at(1) + tr(" does not exist")); + } +} + +void MainTopWidget::displayAnimation() +{ + scan_button->setEnabled(false); + loading_label->startLoading(); + suggest_label->hide(); + doing_label->show(); + emit this->showDetailData(); +} + +void MainTopWidget::getScanResult(QString msg) +{ + doing_label->setText(tr("Scanning:") + msg);//正在扫描: +} + +void MainTopWidget::finishScanResult(QString msg) +{ + if(msg == "onekey") { +// doing_label->setText(tr("Scan Over"));//扫描完成 + doing_label->hide(); + scan_result_label->show(); + result_label->show(); + QString msg; + if (trace.toInt() > 0) + { + if (cookies.toInt() > 0) { + if (garbage == "0.00 B") + { + msg = trace + tr(" history trace; ") + cookies + tr(" browser cookies.") ; + } + else + { + msg = trace + tr(" history trace; ") + cookies + tr(" browser cookies; ") + garbage + tr(" garbage.") ; + } + } + else + { + if (garbage == "0.00 B") + { + msg = trace + tr(" history trace.") ; + } + else + { + msg = trace + tr(" history trace; ") + garbage + tr(" garbage.") ; + } + } + } + else + { + if (cookies.toInt() > 0) + { + if (garbage == "0.00 B") + { + msg = cookies + tr(" browser cookies.") ; + } + else + { + msg = cookies + tr(" browser cookies; ") + garbage + tr(" garbage.") ; + } + } + else + { + if (garbage == "0.00 B") + { + msg = ""; + } + else + { + msg = garbage + tr(" garbage.") ; + } + } + } + if (msg.isEmpty()) { + result_label->setText(tr("No garbage.")); + scan_button->setEnabled(true); + clean_button->hide(); + } + else + { + result_label->setText(msg); + clean_button->show(); + clean_button->setEnabled(true); + } + scanFinishTime = this->getCurrentDateTime(); +// result_label->setText(tr("The lastest scan time is ") + this->getCurrentDateTime()); + this->writeSafeScanDate(); + scan_button->hide(); + back_button->show(); + loading_label->stopLoading(); + } +} + +void MainTopWidget::getScanAllResult(QString flag, QString msg){ + if(flag == "h") { + trace = msg; + } + else if(flag == "k") { + cookies = msg; + } + else if(flag == "c") { + garbage = msg; + } +} + +void MainTopWidget::getCleanResult(QString msg/*, QString flag*/) +{ +// if(flag == "onekey") { + if (msg == "yes") {//在弹出输入密码验证时,点击了取消按钮 + loading_label->stopLoading(); + clean_button->show(); + clean_button->setEnabled(true); + back_button->show(); + } + else if (msg == "no") {//在弹出输入密码验证时,输入密码,验证通过,此时让动态图片开始显示 + //show dynamic image + clean_button->show(); + clean_button->setEnabled(false); + back_button->hide(); + doing_label->setText(tr("Cleaning......"));//正在清理...... + loading_label->startLoading(); + } + else if (msg == "c") { + doing_label->setText(tr("Garbage Cleanup OK......")); + } + else if (msg == "h") { + doing_label->setText(tr("History Cleanup OK......")); + } + else if (msg == "k") { + doing_label->setText(tr("Cookies Cleanup OK......")); + } + else if (msg == "o") { + this->writeFixCleanDate(); + //清理完毕后显示清理总数 + result_label->setText(tr("The lastest cleanup time is ") + this->getCurrentDateTime()); + doing_label->setText(tr("Cleanup Cookies:") +cookies + tr("; Garbage:") + garbage + tr("; Historical records:") +trace ); + trace.clear(); + cookies.clear(); + garbage.clear(); + loading_label->stopLoading(); + scan_button->show(); + scan_button->setEnabled(true); + clean_button->hide(); + clean_button->setEnabled(true); + back_button->hide(); + } +// } +} + +void MainTopWidget::finishCleanError(QString msg) +{ + if (msg == "ce") { + qDebug() << "GarbageException---------"; + } + else if (msg == "he") { + qDebug() << "HistoryException---------"; + } + else if (msg == "ke") { + qDebug() << "CookiesException---------"; + } +} + +void MainTopWidget::getCleaningMessage(QString type, QString status) +{ + if(type == "firefoxhistory") { + if(status == "start") { + doing_label->setText(tr("Cleaning up history trace of Firefox..."));//正在清理Firefox的历史痕迹... + } + else if(status == "end") { + doing_label->setText(tr("Firefox history trace had been cleared!"));//Firefox的历史痕迹已清理完毕! + } + } + else if(type == "chromiumhistory") { + if(status == "start") { + doing_label->setText(tr("Cleaning up history trace of Chromium..."));//正在清理Chromium的历史痕迹... + } + else if(status == "end") { + doing_label->setText(tr("Chromium history trace had been cleared!"));//Chromium的历史痕迹已清理完毕! + } + } + else if(type == "firefoxcookies") { + if(status == "start") { + doing_label->setText(tr("Cleaning up Cookies of Firefox..."));//正在清理Firefox的Cookies... + } + else if(status == "end") { + doing_label->setText(tr("Firefox Cookies had been cleared!"));//Firefox的Cookies已清理完毕! + } + } + else if(type == "chromiumcookies") { + if(status == "start") { + doing_label->setText(tr("Cleaning up Cookies of Chromium..."));//正在清理Chromium的Cookies... + } + else if(status == "end") { + doing_label->setText(tr("Chromium Cookies had been cleared!"));//Chromium的Cookies已清理完毕! + } + } + else if(type == "apt") { + if(status == "end") { + doing_label->setText(tr("Apt cache had been cleared!"));//Apt缓存已清理完毕! + } + else { + doing_label->setText(tr("Cleaning up Apt cache: ") + status);//正在清理Apt缓存: + } + } + else if(type == "software_center") { + if(status == "end") { + doing_label->setText(tr("Software Center cache had been cleared!"));//软件中心缓存已清理完毕! + } + else { + doing_label->setText(tr("Cleaning up Software Center cache: ") + status);//正在清理软件中心缓存: + } + } +} + +void MainTopWidget::displayOrgPage() +{ + doing_label->hide(); + back_button->hide(); +// loading_label->stopLoading(); + scan_button->show(); + scan_button->setEnabled(true); + clean_button->hide(); + suggest_label->show(); +} + +void MainTopWidget::onStartButtonClicked() +{ + doing_label->setText(tr("Scanning......"));//正在扫描...... + if (m_isMain) { + scan_button->setEnabled(false); + loading_label->startLoading(); + suggest_label->hide(); + scan_result_label->hide(); + result_label->hide(); + doing_label->show(); + QStringList args; + args << "cache" << "history" << "cookies"; + + emit this->startOneKeyScan(args); + } + else { + emit this->sendScanSignal(); + } +} + +void MainTopWidget::onCleanButtonClicked() +{ + if (m_isMain) { + clean_button->hide(); + back_button->hide(); + loading_label->startLoading(); + suggest_label->hide(); + scan_result_label->hide(); + result_label->hide(); + doing_label->setText(tr("Ready to Cleanup......"));//准备清理...... + doing_label->show(); + + emit this->startOneKeyClean(); + } + else { + clean_button->hide(); + back_button->hide(); + emit this->sendCleanSignal(); + } +} + +void MainTopWidget::onEndButtonClicked() +{ + if (m_isMain) { + result_label->setText(tr("The lastest scan time is ") + scanFinishTime); + loading_label->stopLoading(); + scan_button->show(); + scan_button->setEnabled(true); + clean_button->hide(); + back_button->hide(); + suggest_label->show(); + scan_result_label->hide(); + result_label->show(); + doing_label->hide(); + } + else { + doing_label->hide(); + back_button->hide(); + loading_label->stopLoading(); + scan_button->show(); + scan_button->setEnabled(true); + clean_button->hide(); + // back_button->hide(); + suggest_label->show(); + // result_label->show(); + emit this->showMainData(); + } +} + +void MainTopWidget::receivePolicyKitSignal(bool status) +{ + /*display Clean Animation + status = true:ok + status = false:cacel + */ + if(status)//ok + { + clean_button->show(); + clean_button->setEnabled(false); + back_button->hide();//0713 + scan_button->hide(); + loading_label->startLoading(); + suggest_label->hide(); + doing_label->setText(tr("Ready to Cleanup......"));//准备清理...... + doing_label->show(); + } + else { + clean_button->show(); + back_button->show(); + } +} + + +void MainTopWidget::writeFixCleanDate() { + QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss dddd"); //设置显示格式 + pSettings->beginGroup("OneKeyClean"); + pSettings->setValue("CleanDate", str); + pSettings->setValue("Flag", "1"); + pSettings->endGroup(); + pSettings->sync(); +} + +QString MainTopWidget::getFixCleanDate() { + pSettings->beginGroup("OneKeyClean"); + QString value = pSettings->value("CleanDate").toString(); + pSettings->endGroup(); + pSettings->sync(); + return value; +} + +QString MainTopWidget::getCurrentDateTime() { + QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss dddd"); //设置显示格式 + return str; +} + +void MainTopWidget::writeSafeScanDate() { + QDateTime time = QDateTime::currentDateTime();//获取系统现在的时间 + QString str = time.toString("yyyy-MM-dd hh:mm:ss dddd"); //设置显示格式 + pSettings->beginGroup("OneKeyClean"); + pSettings->setValue("ScanDate", str); + pSettings->setValue("Flag", "0"); + pSettings->endGroup(); + pSettings->sync(); +} + +QString MainTopWidget::getSafeScanDate() { + pSettings->beginGroup("OneKeyClean"); + QString value = pSettings->value("ScanDate").toString(); + pSettings->endGroup(); + pSettings->sync(); + return value; +} + +QString MainTopWidget::getOneKeyFlag() { + pSettings->beginGroup("OneKeyClean"); + QString value = pSettings->value("Flag").toString(); + pSettings->endGroup(); + pSettings->sync(); + return value; +} diff --git a/src/maintopwidget.h b/src/maintopwidget.h new file mode 100644 index 0000000..04df9ff --- /dev/null +++ b/src/maintopwidget.h @@ -0,0 +1,138 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#ifndef MAINTOPWIDGET_H +#define MAINTOPWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include "../component/kylinbutton.h" +#include "../component/systembutton.h" +#include "../component/loadinglabel.h" + +class MainWindow; +//class SessionDispatcher; +//class SystemDispatcher; + +class MainTopWidget : public QWidget +{ + Q_OBJECT +public: + explicit MainTopWidget(bool isMain = false, QSettings *mSettings = 0, QWidget *parent = 0); + ~MainTopWidget(); + void setParentWindow(MainWindow* window) { p_mainwindow = window;} +// void setSessionDbusProxy(SessionDispatcher* dispatcher) { sessionProxy = dispatcher;} +// void setSystemDbusProxy(SystemDispatcher* dispatcher) { systemProxy = dispatcher;} + void initConnect(); + void setLanguage(); + void writeFixCleanDate(); + QString getFixCleanDate(); + QString getCurrentDateTime(); + void writeSafeScanDate(); + QString getSafeScanDate(); + QString getOneKeyFlag(); + +// void enableSanButton(); + + + void initTitlebarLeftContent(); + void initTitlebarRightContent(); + void initContentLeftContent(); + void initActionRightContent(); + void initWidgets(); + +public slots: + void onStartButtonClicked(); + void onCleanButtonClicked(); + void onEndButtonClicked(); + void getScanResult(QString msg); + void finishScanResult(QString msg); + void getScanAllResult(QString flag, QString msg); + void getCleanResult(QString msg/*, QString flag*/); + void finishCleanError(QString msg); + void getCleaningMessage(QString type, QString status); + + + //clean page + void showCleanReciveStatus(const QString &status); + void showCleanReciveError(const QString &status); + void showCleanOverStatus(); + void showCleanerData(const QStringList &data); + void showCleanerStatus(const QString &status, const QString &domain); + void showCleanerError(const QString &status); + void displayOrgPage(); + void displayAnimation(); + void receivePolicyKitSignal(bool status); + void accordScanOverStatusToChange(bool status); + +signals: + void startOneKeyScan(const QStringList &categorys); + void startOneKeyClean(); + + //clean page + void showDetailData(); + void showMainData(); + void sendCleanSignal(); + void sendScanSignal(); + + void showMenu(); + void showSkinCenter(); + void showMin(); + void closeApp(); + +private: + LoadingLabel *loading_label = nullptr; + QLabel *suggest_label = nullptr; + QLabel *scan_result_label = nullptr; + QLabel *result_label = nullptr; + QLabel *doing_label = nullptr; + QPushButton *scan_button = nullptr; + QPushButton *clean_button = nullptr; + QPushButton *back_button = nullptr; + + MainWindow *p_mainwindow; +// SystemDispatcher *systemProxy; +// SessionDispatcher *sessionProxy; + QString trace; + QString cookies; + QString garbage; + QSettings *pSettings; + QString dateStr; + QString workFlag; + QString scanFinishTime; + + + QVBoxLayout *m_layout = nullptr; + QHBoxLayout *m_topLayout = nullptr; + QHBoxLayout *m_titleRightLayout = nullptr; + QHBoxLayout *m_bottomLayout = nullptr; + QHBoxLayout *m_titleLeftLayout = nullptr; + QHBoxLayout *m_toolLeftLayout = nullptr; + QHBoxLayout *m_toolRightLayout = nullptr; + + bool m_isMain; +}; + +#endif // MAINTOPWIDGET_H diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 437523b..8d03239 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -19,25 +19,48 @@ #include "mainwindow.h" #include +#include #include #include #include #include +#include #include "shadowwidget.h" #include "../component/utils.h" //#include "cameramanager.h" #include "../component/threadpool.h" #include "dataworker.h" +#include "../component/utils.h" +#include "maintopwidget.h" +#include "middlewidget.h" +#include "mainbottomwidget.h" +#include "topbasewidget.h" +#include QString GlobalData::globalarch = ""; // add by hebing, just for transmit var +inline bool isRunningInstalled() { + static bool installed = (QCoreApplication::applicationDirPath() == + QDir(("/usr/bin")).canonicalPath()); + return installed; +} + +inline QString getPluginsDirectory() { + if (isRunningInstalled()) { + return QString("/usr/lib/kylin-assistant/plugins/"); + } else { + return QString(QCoreApplication::applicationDirPath() + "/plugins/"); + } +} + //MainWindow::MainWindow(QString cur_arch, int d_count, QWidget *parent) : // QDialog(parent), arch(cur_arch), display_count(d_count)/*skin_center(parent),*/ -MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::WindowFlags flags) - : QMainWindow( parent, flags ) - ,arch(cur_arch) - ,display_count(d_count) +MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent/*, Qt::WindowFlags flags*/) + : QMainWindow(parent/*, flags*/) + , m_mousePressed(false) + , arch(cur_arch) + , display_count(d_count) { GlobalData::globalarch = this->arch; @@ -83,8 +106,10 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo // this->setAttribute(Qt::WA_TranslucentBackground);//背景透明 // this->setMinimumSize(900, 600); // this->resize(900, 600); - this->setFixedSize(900, 600); + + this->setFixedSize(MAIN_WINDOW_WIDTH+SHADOW_LEFT_TOP_PADDING+SHADOW_RIGHT_BOTTOM_PADDING, MAIN_WINDOW_HEIGHT+SHADOW_LEFT_TOP_PADDING+SHADOW_RIGHT_BOTTOM_PADDING); +// this->setFixedSize(MAIN_WINDOW_WIDTH, MAIN_WINDOW_HEIGHT); // this->setWindowFlags(Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowSystemMenuHint); //// this->setAttribute(Qt::WA_TranslucentBackground, true); @@ -98,11 +123,6 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo status = HOMEPAGE; statusFlag = false; - /*QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this); - shadow_effect->setBlurRadius(15.0); - shadow_effect->setColor(QColor(0, 0, 0, 100));//shadow_effect->setColor(Qt::gray); - shadow_effect->setOffset(1.0);//shadow_effect->setOffset(-5, 5); - this->setGraphicsEffect(shadow_effect);*/ // sessioninterface = NULL; // systeminterface = NULL; @@ -110,7 +130,8 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo mSettings = new QSettings(KYLIN_COMPANY_SETTING, KYLIN_SETTING_FILE_NAME_SETTING); mSettings->setIniCodec("UTF-8"); - + last_skin_path = ":/background/res/skin/1.png"; + /* //judge has skin or not in /var/lib/kylin-assistant-daemon/default/ mSettings->beginGroup("Background"); last_skin_path = mSettings->value("Path").toString(); @@ -136,12 +157,12 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo } mSettings->endGroup(); - mSettings->sync(); + mSettings->sync();*/ main_skin_pixmap.load(last_skin_path); - skin_center = NULL; +// skin_center = NULL; - home_page = NULL; +// home_page = NULL; info_widget = NULL; cleaner_widget = NULL; setting_widget = NULL; @@ -149,57 +170,62 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo aboutDlg = NULL; // auto_start = NULL; - upgrade_dialog = NULL; +// upgrade_dialog = NULL; // camera_manager = NULL; spreadGroup = NULL; gatherGroup = NULL; - home_action_widget = NULL; - info_action_widget = NULL; +// home_action_widget = NULL; +// info_action_widget = NULL; cleaner_action_widget = NULL; setting_action_widget = NULL; box_action_widget = NULL; +// toolKits = new Toolkits(0, this->width(), this->height()); toolKits = new Toolkits(0, this->width(), this->height()); - shadow_widget = new ShadowWidget(this); + /*shadow_widget = new ShadowWidget(this); shadow_widget->setGeometry(rect()); // shadow_widget->setColor(QColor(Qt::gray)); - shadow_widget->setColor(QColor("#e9eef0")); + shadow_widget->setColor(QColor("#e9eef0"));*/ - default_action_widget = new ActionWidget(this); - default_action_widget->setGeometry(QRect(0, 0, 900, 227)); + /*default_action_widget = new ActionWidget(this); +// default_action_widget->setGeometry(QRect(0, 0, 900, 227)); + default_action_widget->setGeometry(QRect(SHADOW_PADDING, SHADOW_PADDING, 900, 227)); default_action_widget->setFixedHeight(227); other_action_widget = new ActionWidget(this); - other_action_widget->setGeometry(QRect(0, -150, 900, 150)); +// other_action_widget->setGeometry(QRect(0, -150, 900, 150)); + other_action_widget->setGeometry(QRect(SHADOW_PADDING, -150, 900, 150)); other_action_widget->setFixedHeight(150); - topStack = new QStackedWidget(other_action_widget); - topStack->setGeometry(other_action_widget->rect()); +// m_topStack = new QStackedWidget(other_action_widget); +// m_topStack->setGeometry(other_action_widget->rect()); //设置在最底层,方便title_widget的显示 // default_action_widget->lower(); QPalette palette_back; palette_back.setBrush(QPalette::Background, QBrush(QPixmap(last_skin_path))); default_action_widget->setPalette(palette_back); - other_action_widget->setPalette(palette_back); + other_action_widget->setPalette(palette_back);*/ - tool_widget = new ToolWidget(this, this->arch, this->osName); - tool_widget->setGeometry(QRect(0, 227, 900, 47)); + /*tool_widget = new ToolWidget(this, this->arch, this->osName); +// tool_widget->setGeometry(QRect(0, 227, 900, 47)); + tool_widget->setGeometry(QRect(SHADOW_PADDING, 227+SHADOW_PADDING, 900, 47)); tool_widget->setParentWindow(this); connect(this, SIGNAL(chanegBoxToolStatus()), tool_widget, SLOT(showBoxTool())); tool_widget->initConnect(); title_widget = new TitleWidget(this, this->arch, this->osName); // if (this->arch == "aarch64" || this->osName == "Kylin" || this->osName == "YHKylin") - title_widget->move(756, 0); +// title_widget->move(756, 0); + title_widget->move(756, SHADOW_PADDING); // else { // title_widget->move(0, 0); // } connect(title_widget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); title_widget->setParentWindow(this); - title_widget->initConnect(); + title_widget->initConnect();*/ // login_widget = new LoginWidget(this); // if (this->arch == "aarch64" || this->osName == "Kylin" || this->osName == "YHKylin") @@ -208,33 +234,47 @@ MainWindow::MainWindow(QString cur_arch, int d_count, QWidget* parent, Qt::Windo // login_widget->move(585, 0);//900 - login_widget(220) - right_align(15) = 665 // } - default_content_widget = new BottomContentWidget(this); - default_content_widget->setGeometry(QRect(0, 274, 900, 326)); + /*default_content_widget = new BottomContentWidget(this); +// default_content_widget->setGeometry(QRect(0, 274, 900, 326)); + default_content_widget->setGeometry(QRect(SHADOW_PADDING, 274+SHADOW_PADDING, 900, 326)); default_content_widget->setFixedHeight(326); other_content_widget = new BottomContentWidget(this); - other_content_widget->setGeometry(QRect(0, 600, 900, 403)); +// other_content_widget->setGeometry(QRect(0, 600, 900, 403)); + other_content_widget->setGeometry(QRect(SHADOW_PADDING, 600+SHADOW_PADDING, 900, 403)); other_content_widget->setFixedHeight(403); - bottomStack = new QStackedWidget(other_content_widget); - bottomStack->setGeometry(other_content_widget->rect()); +// m_bottomStack = new QStackedWidget(other_content_widget); +// m_bottomStack->setGeometry(other_content_widget->rect()); // top_grid_layout = NULL; -// bottom_grid_layout = NULL; +// bottom_grid_layout = NULL;*/ main_menu = new KylinMenu(this); main_menu->setParentWindow(this); main_menu->initConnect(); - this->initHomePage(); - this->initAnimation(); + + this->initWidgets(); + +// this->initHomePage(); +// this->initAnimation(); this->hide(); this->startDbusDaemon(); // 添加阴影 - /*auto effect = new QGraphicsDropShadowEffect(bottomStack); + /*auto effect = new QGraphicsDropShadowEffect(m_bottomStack); effect->setOffset(0, 3); effect->setColor(QColor(178, 34, 34, 127)); effect->setBlurRadius(10);//阴影的大小 - bottomStack->setGraphicsEffect(effect);*/ + m_bottomStack->setGraphicsEffect(effect);*/ + + + + +// QGraphicsDropShadowEffect *shadow_effect = new QGraphicsDropShadowEffect(this); +// shadow_effect->setBlurRadius(15.0); +// shadow_effect->setColor(QColor(255, 0, 0));//shadow_effect->setColor(QColor("#fca71d"));// +// shadow_effect->setOffset(-10, 10); +// this->setGraphicsEffect(shadow_effect); } MainWindow::~MainWindow() @@ -247,11 +287,11 @@ MainWindow::~MainWindow() ThreadPool::Instance()->deleteLater(); - if (home_page != NULL) - { - delete home_page; - home_page = NULL; - } +// if (home_page != NULL) +// { +// delete home_page; +// home_page = NULL; +// } if (info_widget != NULL) { delete info_widget; @@ -272,11 +312,11 @@ MainWindow::~MainWindow() delete box_widget; box_widget = NULL; } - if (setting_action_widget != NULL) - { - delete setting_action_widget; - setting_action_widget = NULL; - } +// if (setting_action_widget != NULL) +// { +// delete setting_action_widget; +// setting_action_widget = NULL; +// } // if (sessioninterface != NULL) // { // delete sessioninterface; @@ -321,18 +361,121 @@ MainWindow::~MainWindow() // delete camera_manager; // camera_manager = NULL; // } - if(skin_center != NULL) - { - delete skin_center; - skin_center = NULL; - } - if(upgrade_dialog != NULL) - { - delete upgrade_dialog; - upgrade_dialog = NULL; +// if(skin_center != NULL) +// { +// delete skin_center; +// skin_center = NULL; +// } +// if(upgrade_dialog != NULL) +// { +// delete upgrade_dialog; +// upgrade_dialog = NULL; +// } + + + if (centralWidget != NULL) { + delete centralWidget; + centralWidget = nullptr; } } +void MainWindow::initWidgets() +{ + QPalette palette_back; + palette_back.setBrush(QPalette::Background, QBrush(QPixmap(last_skin_path))); + + m_topStack = new QStackedWidget(this); + m_bottomStack = new QStackedWidget(this); + + //top + m_mainTopWidget = new MainTopWidget(true, mSettings, this); + connect(m_mainTopWidget, SIGNAL(showMenu()), this, SLOT(showMainMenu())); + connect(m_mainTopWidget, SIGNAL(showMin()), this, SLOT(showMinimized())); + connect(m_mainTopWidget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); + m_mainTopWidget->setPalette(palette_back); + m_topStack->addWidget(m_mainTopWidget); + + cleaner_action_widget = new MainTopWidget(false, mSettings, this); + connect(cleaner_action_widget, SIGNAL(showMenu()), this, SLOT(showMainMenu())); + connect(cleaner_action_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); + connect(cleaner_action_widget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); + cleaner_action_widget->setPalette(palette_back); + m_topStack->addWidget(cleaner_action_widget); + + info_action_widget = new TopBaseWidget(this); + connect(info_action_widget, SIGNAL(showMenu()), this, SLOT(showMainMenu())); + connect(info_action_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); + connect(info_action_widget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); + info_action_widget->setPalette(palette_back); + info_action_widget->setImage("://res/systeminfo.png"); + info_action_widget->setTipMessage(tr("Understand hardware information, provide more convenient channel to obtain hardware information")); + m_topStack->addWidget(info_action_widget); + + setting_action_widget = new TopBaseWidget(this); + connect(setting_action_widget, SIGNAL(showMenu()), this, SLOT(showMainMenu())); + connect(setting_action_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); + connect(setting_action_widget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); + setting_action_widget->setPalette(palette_back); + setting_action_widget->setImage("://res/systemset.png"); + setting_action_widget->setTipMessage(tr("You can perform a full range of customized systems based on personal preferences")); + m_topStack->addWidget(setting_action_widget); + + box_action_widget = new TopBaseWidget(this); + connect(box_action_widget, SIGNAL(showMenu()), this, SLOT(showMainMenu())); + connect(box_action_widget, SIGNAL(showMin()), this, SLOT(showMinimized())); + connect(box_action_widget, SIGNAL(closeApp()), this, SLOT(closeYoukerAssistant())); + box_action_widget->setPalette(palette_back); + box_action_widget->setImage("://res/toolkits.png"); + box_action_widget->setTipMessage(tr("Provide a practical and lightweight tool, create fast and convenient experience for you")); + m_topStack->addWidget(box_action_widget); + + //middle + m_middleWidget = new MiddleWidget(this, this->arch, this->osName); + m_middleWidget->setFixedSize(MAIN_WINDOW_WIDTH, 47); + m_middleWidget->setParentWindow(this); + connect(m_middleWidget, SIGNAL(turnCurrentPage(int)), this, SLOT(setCurrentPageIndex(int))); + m_middleWidget->initConnect(); + + //bottom + m_mainBottomWidget = new MainBottomWidget(this, this->arch, this->osName); + m_bottomStack->addWidget(m_mainBottomWidget); + + cleaner_widget = new CleanerWidget(); + m_bottomStack->addWidget(cleaner_widget); + cleaner_widget->setToolKits(toolKits); + cleaner_widget->setParentWindow(this); + cleaner_widget->initUI(last_skin_path); + connect(cleaner_action_widget, SIGNAL(showDetailData()),cleaner_widget, SLOT(displayDetailPage())); + connect(cleaner_action_widget, SIGNAL(showMainData()),cleaner_widget, SLOT(displayMainPage())); + connect(cleaner_action_widget, SIGNAL(sendCleanSignal()),cleaner_widget, SIGNAL(transCleanSignal())); + + info_widget = new InfoWidget(this->arch); + m_bottomStack->addWidget(info_widget); + + setting_widget = new SettingWidget(this->desktop); + setting_widget->setParentWindow(this); + connect(setting_widget, SIGNAL(changeActionPage(QString)), setting_action_widget, SLOT(displayActionSubPage(QString))); + connect(setting_action_widget, SIGNAL(notifyContentPageToMain()), setting_widget, SLOT(displaySettingHomePage())); + m_bottomStack->addWidget(setting_widget); + + box_widget = new BoxWidget(this, this->arch, this->osName, getPluginsDirectory()); + m_bottomStack->addWidget(box_widget); + + centralWidget = new QWidget; + QVBoxLayout *contentLayout = new QVBoxLayout(centralWidget); + this->setCentralWidget(centralWidget); + this->setContentsMargins(SHADOW_LEFT_TOP_PADDING,SHADOW_LEFT_TOP_PADDING,SHADOW_RIGHT_BOTTOM_PADDING,SHADOW_RIGHT_BOTTOM_PADDING); + contentLayout->setContentsMargins(0, 0, 0, 0); + contentLayout->setMargin(0); + contentLayout->setSpacing(0); + + contentLayout->addWidget(m_topStack); + contentLayout->addWidget(m_middleWidget); + contentLayout->addWidget(m_bottomStack); + m_topStack->setCurrentWidget(m_mainTopWidget); + m_bottomStack->setCurrentWidget(m_mainBottomWidget); +} + void MainWindow::onInitDataFinished() { this->battery = m_dataWorker->isBatteryExist(); @@ -340,7 +483,88 @@ void MainWindow::onInitDataFinished() this->m_cpulist = m_dataWorker->cpuModeList(); this->m_currentCpuMode = m_dataWorker->cpuCurrentMode(); - this->displayMainWindow(); + connect(m_mainTopWidget, SIGNAL(startOneKeyScan(QStringList)), m_dataWorker, SLOT(onStartOneKeyScan(QStringList)));//Qt::QueuedConnection + connect(m_mainTopWidget, SIGNAL(startOneKeyClean()), m_dataWorker, SLOT(onStartOneKeyClean())); + connect(m_dataWorker, SIGNAL(isScanning(QString)), m_mainTopWidget, SLOT(getScanResult(QString))/*, Qt::BlockingQueuedConnection*/); + connect(m_dataWorker, SIGNAL(finishScanWork(QString)), m_mainTopWidget, SLOT(finishScanResult(QString))/*, Qt::BlockingQueuedConnection*/); + connect(m_dataWorker, SIGNAL(tellScanResult(QString,QString)) ,m_mainTopWidget, SLOT(getScanAllResult(QString,QString))/*, Qt::BlockingQueuedConnection*/); + connect(m_dataWorker, SIGNAL(finishCleanWorkMain(QString)), m_mainTopWidget, SLOT(getCleanResult(QString))/*, Qt::BlockingQueuedConnection*/); + connect(m_dataWorker, SIGNAL(finishCleanWorkMainError(QString)), m_mainTopWidget, SLOT(finishCleanError(QString))/*, Qt::BlockingQueuedConnection*/); + connect(m_dataWorker, SIGNAL(quickCleanProcess(QString,QString)), m_mainTopWidget, SLOT(getCleaningMessage(QString,QString))/*, Qt::QueuedConnection*/); + + connect(cleaner_action_widget, SIGNAL(showDetailData()),cleaner_widget, SLOT(displayDetailPage())); + connect(cleaner_action_widget, SIGNAL(showMainData()),cleaner_widget, SLOT(displayMainPage())); + connect(cleaner_action_widget, SIGNAL(sendCleanSignal()),cleaner_widget, SIGNAL(transCleanSignal())); + + connect(m_dataWorker, SIGNAL(tellCleanerDetailData(QStringList)), cleaner_widget, SIGNAL(tellCleanerDetailData(QStringList))); + connect(m_dataWorker, SIGNAL(tellCleanerDetailStatus(QString)), cleaner_widget, SIGNAL(tellCleanerDetailStatus(QString))); + + connect(m_dataWorker, SIGNAL(tellCleanerDetailStatus(QString)), cleaner_action_widget, SLOT(showCleanReciveStatus(QString))); + connect(m_dataWorker, SIGNAL(tellCleanerDetailError(QString)), cleaner_action_widget, SLOT(showCleanReciveError(QString))); + + connect(m_dataWorker, SIGNAL(sendCleanOverSignal()), cleaner_widget, SLOT(displayMainPage())); + connect(m_dataWorker, SIGNAL(sendCleanOverSignal()), cleaner_action_widget, SLOT(displayOrgPage())); + connect(m_dataWorker, SIGNAL(sendCleanOverSignal()), cleaner_action_widget, SLOT(showCleanOverStatus())); + connect(m_dataWorker, SIGNAL(policykitCleanSignal(bool)), cleaner_action_widget, SLOT(receivePolicyKitSignal(bool))); + connect(m_dataWorker, SIGNAL(tellCleanerMainData(QStringList)), cleaner_action_widget, SLOT(showCleanerData(QStringList))); + connect(m_dataWorker, SIGNAL(tellCleanerMainStatus(QString, QString)), cleaner_action_widget, SLOT(showCleanerStatus(QString, QString))); + connect(m_dataWorker, SIGNAL(sendCleanErrorSignal(QString)), cleaner_action_widget, SLOT(showCleanerError(QString))); + + connect(cleaner_widget, SIGNAL(startScanSystem(QMap)), m_dataWorker, SLOT(onStartScanSystem(QMap))); + connect(cleaner_widget, SIGNAL(startCleanSystem(QMap)), m_dataWorker, SLOT(onStartCleanSystem(QMap))); + + connect(cleaner_action_widget, SIGNAL(sendScanSignal()),cleaner_widget, SIGNAL(transScanSignal())); + connect(cleaner_widget, SIGNAL(tranActionAnimaitonSignal()),cleaner_action_widget, SLOT(displayAnimation())); + connect(cleaner_widget, SIGNAL(tranScanOverSignal(bool)),cleaner_action_widget, SLOT(accordScanOverStatusToChange(bool))); + + connect(info_widget, SIGNAL(requestupdateSystemRunnedTime()), m_dataWorker, SLOT(onUpdateSystemRunnedTime())); + connect(info_widget, SIGNAL(requestRefreshSystemInfo()), m_dataWorker, SLOT(onRequestRefreshSystemInfo())); + connect(m_dataWorker, SIGNAL(sendSystemInfo(QMap)), info_widget, SLOT(onSendSystemInfo(QMap))); + + //desktop info + connect(info_widget, SIGNAL(requestDesktopInfo()), m_dataWorker, SLOT(onRequestDesktopInfo())); + connect(m_dataWorker, SIGNAL(sendDesktopInfo(QMap)), info_widget, SLOT(onSendDesktopInfo(QMap))); + + //cpu info + connect(info_widget, SIGNAL(requestCpuInfo()), m_dataWorker, SLOT(onRequestCpuInfo())); + connect(m_dataWorker, SIGNAL(sendCpuInfo(QMap)), info_widget, SLOT(onSendCpuInfo(QMap))); + + //memory info + connect(info_widget, SIGNAL(requestMemoryInfo()), m_dataWorker, SLOT(onRequestMemoryInfo())); + connect(m_dataWorker, SIGNAL(sendMemoryInfo(QMap)), info_widget, SLOT(onSendMemoryInfo(QMap))); + + //board info + connect(info_widget, SIGNAL(requestBoardInfo()), m_dataWorker, SLOT(onRequestBoardInfo())); + connect(m_dataWorker, SIGNAL(sendBoardInfo(QMap)), info_widget, SLOT(onSendBoardInfo(QMap))); + + //hd info + connect(info_widget, SIGNAL(requestHDInfo()), m_dataWorker, SLOT(onRequestHDInfo())); + connect(m_dataWorker, SIGNAL(sendHDInfo(QMap)), info_widget, SLOT(onSendHDInfo(QMap))); + + //nic info + connect(info_widget, SIGNAL(requestNicInfo()), m_dataWorker, SLOT(onRequestNicInfo())); + connect(m_dataWorker, SIGNAL(sendNicInfo(QMap)), info_widget, SLOT(onSendNicInfo(QMap))); + + //monitor info + connect(info_widget, SIGNAL(requestMonitorInfo()), m_dataWorker, SLOT(onRequestMonitorInfo())); + connect(m_dataWorker, SIGNAL(sendMonitorInfo(QMap)), info_widget, SLOT(onSendMonitorInfo(QMap))); + + //audio info + connect(info_widget, SIGNAL(requestAudioInfo()), m_dataWorker, SLOT(onRequestAudioInfo())); + connect(m_dataWorker, SIGNAL(sendAudioInfo(QMap)), info_widget, SLOT(onSendAudioInfo(QMap))); + + //battery info + connect(info_widget, SIGNAL(requestBatteryInfo()), m_dataWorker, SLOT(onRequestBatteryInfo())); + connect(m_dataWorker, SIGNAL(sendBatteryInfo(QMap)), info_widget, SLOT(onSendBatteryInfo(QMap))); + + //sensor info + connect(info_widget, SIGNAL(requestSensorInfo()), m_dataWorker, SLOT(onRequestSensorInfo())); + connect(m_dataWorker, SIGNAL(sendSensorInfo(QMap)), info_widget, SLOT(onSendSensorInfo(QMap))); + + +// connect(setting_widget, SIGNAL(changeActionPage(QString)), setting_action_widget, SLOT(displayActionSubPage(QString))); +// connect(setting_action_widget, SIGNAL(notifyContentPageToMain()), setting_widget, SLOT(displaySettingHomePage())); + //bind setting notify signal // connect(m_dataWorker, SIGNAL(string_value_notify(QString,QString)), setting_widget, SIGNAL(string_value_notify(QString,QString))); @@ -355,12 +579,12 @@ void MainWindow::onInitDataFinished() connect(m_dataWorker, SIGNAL(double_value_notify(QString,double)), setting_widget, SLOT(on_double_value_notify(QString,double))); */ - connect(m_dataWorker, SIGNAL(isScanning(QString)), home_action_widget, SLOT(getScanResult(QString))); - connect(m_dataWorker, SIGNAL(finishScanWork(QString)), home_action_widget, SLOT(finishScanResult(QString))); - connect(m_dataWorker, SIGNAL(tellScanResult(QString,QString)) ,home_action_widget, SLOT(getScanAllResult(QString,QString))); - connect(m_dataWorker, SIGNAL(finishCleanWorkMain(QString)), home_action_widget, SLOT(getCleanResult(QString))); - connect(m_dataWorker, SIGNAL(finishCleanWorkMainError(QString)), home_action_widget, SLOT(finishCleanError(QString))); - connect(m_dataWorker, SIGNAL(quickCleanProcess(QString,QString)), home_action_widget, SLOT(getCleaningMessage(QString,QString))); +// connect(m_dataWorker, SIGNAL(isScanning(QString)), home_action_widget, SLOT(getScanResult(QString))); +// connect(m_dataWorker, SIGNAL(finishScanWork(QString)), home_action_widget, SLOT(finishScanResult(QString))); +// connect(m_dataWorker, SIGNAL(tellScanResult(QString,QString)) ,home_action_widget, SLOT(getScanAllResult(QString,QString))); +// connect(m_dataWorker, SIGNAL(finishCleanWorkMain(QString)), home_action_widget, SLOT(getCleanResult(QString))); +// connect(m_dataWorker, SIGNAL(finishCleanWorkMainError(QString)), home_action_widget, SLOT(finishCleanError(QString))); +// connect(m_dataWorker, SIGNAL(quickCleanProcess(QString,QString)), home_action_widget, SLOT(getCleaningMessage(QString,QString))); //theme connect(setting_widget, SIGNAL(changeSystemTheme(QString)), m_dataWorker, SLOT(onChangeSystemTheme(QString))); @@ -508,8 +732,35 @@ void MainWindow::onInitDataFinished() connect(setting_widget, SIGNAL(resetThumbnailIconSize(int)), m_dataWorker, SLOT(onResetThumbnailIconSize(int))); connect(setting_widget, SIGNAL(resetThumbnailCacheTime(int)), m_dataWorker, SLOT(onResetThumbnailCacheTime(int))); connect(setting_widget, SIGNAL(resetThumbnailCacheSize(int)), m_dataWorker, SLOT(onResetThumbnailCacheSize(int))); + + + info_widget->initInfoUI(this->battery, this->sensor); + setting_widget->initSettingsUI(this->m_cpulist, this->m_currentCpuMode, this->battery/*, last_skin_path*/); + this->moveCenter(); +// this->displayMainWindow(); } +void MainWindow::moveCenter() +{ + QPoint pos = QCursor::pos(); + QRect primaryGeometry; + for (QScreen *screen : qApp->screens()) { + if (screen->geometry().contains(pos)) { + primaryGeometry = screen->geometry(); + } + } + + if (primaryGeometry.isEmpty()) { + primaryGeometry = qApp->primaryScreen()->geometry(); + } + + this->move(primaryGeometry.x() + (primaryGeometry.width() - this->width())/2, + primaryGeometry.y() + (primaryGeometry.height() - this->height())/2); + this->show(); + this->raise(); +} + + QString MainWindow::accessOSName() { @@ -664,7 +915,7 @@ QStringList MainWindow::filterSkin() void MainWindow::initAnimation() { - QPoint origPoint(0, 227); + /*QPoint origPoint(0, 227); QPoint needPoint(0, 150); QPoint origPoint1(0, 0); QPoint needPoint1(0, -227); @@ -701,10 +952,10 @@ void MainWindow::initAnimation() mainContentAnimation2->setStartValue(origPoint4); mainContentAnimation2->setEndValue(needPoint4); - QPropertyAnimation *m_toTrans = new QPropertyAnimation(shadow_widget, "opacity"); - m_toTrans->setDuration(200); - m_toTrans->setStartValue(1); - m_toTrans->setEndValue(0); +// QPropertyAnimation *m_toTrans = new QPropertyAnimation(shadow_widget, "opacity"); +// m_toTrans->setDuration(200); +// m_toTrans->setStartValue(1); +// m_toTrans->setEndValue(0); spreadGroup = new QParallelAnimationGroup(this); spreadGroup->addAnimation(mainActionAnimation); @@ -712,7 +963,7 @@ void MainWindow::initAnimation() spreadGroup->addAnimation(mainToolAnimation); spreadGroup->addAnimation(mainContentAnimation); spreadGroup->addAnimation(mainContentAnimation2); - spreadGroup->addAnimation(m_toTrans); +// spreadGroup->addAnimation(m_toTrans); QPropertyAnimation *mainActionBackAnimation2 = new QPropertyAnimation(other_action_widget, "pos"); mainActionBackAnimation2->setDuration(500); @@ -740,10 +991,10 @@ void MainWindow::initAnimation() mainContentBackAnimation2->setStartValue(needPoint4); mainContentBackAnimation2->setEndValue(origPoint4); - QPropertyAnimation *m_toGray = new QPropertyAnimation(shadow_widget, "opacity"); - m_toGray->setDuration(200); - m_toGray->setStartValue(0); - m_toGray->setEndValue(1); +// QPropertyAnimation *m_toGray = new QPropertyAnimation(shadow_widget, "opacity"); +// m_toGray->setDuration(200); +// m_toGray->setStartValue(0); +// m_toGray->setEndValue(1); gatherGroup = new QParallelAnimationGroup(this); gatherGroup->addAnimation(mainActionBackAnimation); @@ -751,18 +1002,18 @@ void MainWindow::initAnimation() gatherGroup->addAnimation(mainToolBackAnimation); gatherGroup->addAnimation(mainContentBackAnimation); gatherGroup->addAnimation(mainContentBackAnimation2); - gatherGroup->addAnimation(m_toGray); +// gatherGroup->addAnimation(m_toGray); connect(spreadGroup, SIGNAL(finished()), this, SLOT(upAnimFinished())); - connect(gatherGroup, SIGNAL(finished()), this, SLOT(closeAnimFinished())); + connect(gatherGroup, SIGNAL(finished()), this, SLOT(closeAnimFinished()));*/ } void MainWindow::upAnimFinished() { - tool_widget->show(); - shadow_widget->hide(); - if(title_widget->isHidden()) - title_widget->show(); + m_middleWidget->show(); +// shadow_widget->hide(); +// if(title_widget->isHidden()) +// title_widget->show(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin") // { // if(status == BOXPAGE && login_widget->isHidden()) { @@ -776,19 +1027,19 @@ void MainWindow::upAnimFinished() void MainWindow::closeAnimFinished() { - tool_widget->show(); - if(title_widget->isHidden()) - title_widget->show(); + m_middleWidget->show(); +// if(title_widget->isHidden()) +// title_widget->show(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isHidden()) // { // login_widget->show(); // } - shadow_widget->hide(); +// shadow_widget->hide(); } void MainWindow::setTranslator(QTranslator* translator) { - this->translator = translator; +// this->translator = translator; } void MainWindow::changeLanguage(LANGUAGE language) @@ -830,83 +1081,71 @@ void MainWindow::changeLanguage(LANGUAGE language) // system_tray->translateLanguage(); } -void MainWindow::displayMainWindow(/*int count*/) -{ - //20180101 - /* - this->battery = sessioninterface->judge_power_is_exists_qt(); - this->sensor = systeminterface->judge_sensors_exists_qt(); +//void MainWindow::displayMainWindow(/*int count*/) +//{ +// //20180101 +// /* +// this->battery = sessioninterface->judge_power_is_exists_qt(); +// this->sensor = systeminterface->judge_sensors_exists_qt(); -// login_widget->setSessionDbusProxy(sessioninterface); -// if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin") -// sessioninterface->check_user_qt(); -// connect(sessioninterface, SIGNAL(ssoSuccessSignal(QString, QString)), login_widget, SLOT(showLoginInfo(QString,QString))); -// connect(sessioninterface, SIGNAL(ssoLoginLogoutSignal(bool)), login_widget, SLOT(showLoginAndLogoutStatus(bool)));*/ -// home_action_widget->setSessionDbusProxy(sessioninterface); -// home_action_widget->setSystemDbusProxy(systeminterface); - home_action_widget->enableSanButton(); +//// login_widget->setSessionDbusProxy(sessioninterface); +//// if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin") +//// sessioninterface->check_user_qt(); +//// connect(sessioninterface, SIGNAL(ssoSuccessSignal(QString, QString)), login_widget, SLOT(showLoginInfo(QString,QString))); +//// connect(sessioninterface, SIGNAL(ssoLoginLogoutSignal(bool)), login_widget, SLOT(showLoginAndLogoutStatus(bool)));*/ +//// home_action_widget->setSessionDbusProxy(sessioninterface); +//// home_action_widget->setSystemDbusProxy(systeminterface); +//// home_action_widget->enableSanButton(); - //20180101 - /*connect(sessioninterface, SIGNAL(isScanning(QString)), home_action_widget, SLOT(getScanResult(QString))); - connect(sessioninterface, SIGNAL(finishScanWork(QString)), home_action_widget, SLOT(finishScanResult(QString))); - connect(sessioninterface, SIGNAL(tellScanResult(QString,QString)) ,home_action_widget, SLOT(getScanAllResult(QString,QString))); - connect(systeminterface, SIGNAL(finishCleanWorkMain(QString)), home_action_widget, SLOT(getCleanResult(QString))); - connect(systeminterface, SIGNAL(finishCleanWorkMainError(QString)), home_action_widget, SLOT(finishCleanError(QString))); - connect(systeminterface, SIGNAL(quickCleanProcess(QString,QString)), home_action_widget, SLOT(getCleaningMessage(QString,QString))); - home_page->setSessionDbusProxy(sessioninterface); - home_page->setSystemDbusProxy(systeminterface);*/ +// //20180101 +// /*connect(sessioninterface, SIGNAL(isScanning(QString)), home_action_widget, SLOT(getScanResult(QString))); +// connect(sessioninterface, SIGNAL(finishScanWork(QString)), home_action_widget, SLOT(finishScanResult(QString))); +// connect(sessioninterface, SIGNAL(tellScanResult(QString,QString)) ,home_action_widget, SLOT(getScanAllResult(QString,QString))); +// connect(systeminterface, SIGNAL(finishCleanWorkMain(QString)), home_action_widget, SLOT(getCleanResult(QString))); +// connect(systeminterface, SIGNAL(finishCleanWorkMainError(QString)), home_action_widget, SLOT(finishCleanError(QString))); +// connect(systeminterface, SIGNAL(quickCleanProcess(QString,QString)), home_action_widget, SLOT(getCleaningMessage(QString,QString))); +// home_page->setSessionDbusProxy(sessioninterface); +// home_page->setSystemDbusProxy(systeminterface);*/ - this->initOtherPages(); +//// this->initOtherPages(); +// info_widget->initInfoUI(this->battery, this->sensor); +// setting_widget->initSettingsUI(this->m_cpulist, this->m_currentCpuMode, this->battery/*, last_skin_path*/); -// if (this->isHidden()) { - int windowWidth, windowHeight = 0; - if (this->display_count < 2) { - windowWidth = QApplication::desktop()->width(); - windowHeight = QApplication::desktop()->height(); - this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); - } - else { - /*this->setGeometry(QApplication::desktop()->screenGeometry(1)); - int a_width = 0; - for (int i=0;iscreenGeometry(i).width();//QRect QApplication::desktop->screenGeometry(1);根据当前的屏幕序号获取屏幕宽高等属性 - } - windowWidth = QApplication::desktop()->width() - a_width;//QApplication::desktop()->width();获取虚拟屏幕全宽,注意这个比较猛,是获取的总宽度,对于横向扩展屏来说,也就是 屏幕1+ 屏幕2 + ... 的宽度 - windowHeight = QApplication::desktop()->screenGeometry(1).height(); - qDebug() << windowWidth;//3286 1024 1920 1366 - qDebug() << windowHeight;//1080 768 1080 768 - qDebug() << this->width();//900 - qDebug() << this->height();//600 - this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2);*/ - windowWidth = QApplication::desktop()->screenGeometry(0).width(); - windowHeight = QApplication::desktop()->screenGeometry(0).height(); - this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); - } - - this->show(); - this->raise(); -// QTimer::singleShot(100, this, SLOT(startDbusDaemon())); +//// if (this->isHidden()) { +// int windowWidth, windowHeight = 0; +// if (this->display_count < 2) { +// windowWidth = QApplication::desktop()->width(); +// windowHeight = QApplication::desktop()->height(); +// this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); // } // else { -// this->hide(); +// /*this->setGeometry(QApplication::desktop()->screenGeometry(1)); +// int a_width = 0; +// for (int i=0;iscreenGeometry(i).width();//QRect QApplication::desktop->screenGeometry(1);根据当前的屏幕序号获取屏幕宽高等属性 +// } +// windowWidth = QApplication::desktop()->width() - a_width;//QApplication::desktop()->width();获取虚拟屏幕全宽,注意这个比较猛,是获取的总宽度,对于横向扩展屏来说,也就是 屏幕1+ 屏幕2 + ... 的宽度 +// windowHeight = QApplication::desktop()->screenGeometry(1).height(); +// qDebug() << windowWidth;//3286 1024 1920 1366 +// qDebug() << windowHeight;//1080 768 1080 768 +// qDebug() << this->width();//900 +// qDebug() << this->height();//600 +// this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2);*/ +// windowWidth = QApplication::desktop()->screenGeometry(0).width(); +// windowHeight = QApplication::desktop()->screenGeometry(0).height(); +// this->move((windowWidth - this->width()) / 2,(windowHeight - this->height()) / 2); // } -} -inline bool isRunningInstalled() { - static bool installed = (QCoreApplication::applicationDirPath() == - QDir(("/usr/bin")).canonicalPath()); - return installed; -} - -inline QString getPluginsDirectory() { - if (isRunningInstalled()) { - return QString("/usr/lib/kylin-assistant/plugins/"); - } else { - return QString(QCoreApplication::applicationDirPath() + "/plugins/"); - } -} +// this->show(); +// this->raise(); +//// QTimer::singleShot(100, this, SLOT(startDbusDaemon())); +//// } +//// else { +//// this->hide(); +//// } +//} void MainWindow::startDbusDaemon() { @@ -924,14 +1163,24 @@ void MainWindow::startDbusDaemon() // systeminterface = new SystemDispatcher; +// qDebug() << "mainwindow thread id=" << QThread::currentThreadId(); + m_dataWorker = new DataWorker(this->desktop); QThread *w_thread = ThreadPool::Instance()->createNewThread(); m_dataWorker->moveToThread(w_thread); - connect(w_thread, SIGNAL(started()), m_dataWorker, SLOT(doWork())); - connect(m_dataWorker, SIGNAL(dataLoadFinished()), this, SLOT(onInitDataFinished())); +// connect(w_thread, SIGNAL(started()), m_dataWorker, SLOT(doWork())); +// connect(m_dataWorker, SIGNAL(dataLoadFinished()), this, SLOT(onInitDataFinished())); +// connect(w_thread, &QThread::finished, w_thread, &QThread::deleteLater, Qt::QueuedConnection); + connect(w_thread, &QThread::started, m_dataWorker, &DataWorker::doWork); + connect(m_dataWorker, &DataWorker::dataLoadFinished, this, &MainWindow::onInitDataFinished); + connect(w_thread, &QThread::finished, this, [=] { + w_thread->deleteLater(); + qDebug() << "DataWorker thread finished......"; + }); w_thread->start(); + /*sessioninterface = new SessionDispatcher(this); systeminterface = new SystemDispatcher(this); // this->desktop = sessioninterface->access_current_desktop_qt(); @@ -960,18 +1209,18 @@ void MainWindow::startDbusDaemon() void MainWindow::initOtherPages() { - if(cleaner_action_widget == NULL) + /*if(cleaner_action_widget == NULL) cleaner_action_widget = new CleanerActionWidget(this); - topStack->addWidget(cleaner_action_widget); + m_topStack->addWidget(cleaner_action_widget); if(info_action_widget == NULL) info_action_widget = new InfoActionWidget(this); - topStack->addWidget(info_action_widget); + m_topStack->addWidget(info_action_widget); if(setting_action_widget == NULL) setting_action_widget = new SettingActionWidget(); - topStack->addWidget(setting_action_widget); + m_topStack->addWidget(setting_action_widget); if(box_action_widget == NULL) box_action_widget = new BoxActionWidget(this); - topStack->addWidget(box_action_widget); + m_topStack->addWidget(box_action_widget); if(cleaner_widget == NULL) cleaner_widget = new CleanerWidget(); @@ -999,7 +1248,7 @@ void MainWindow::initOtherPages() connect(m_dataWorker, SIGNAL(sendCleanErrorSignal(QString)), cleaner_action_widget, SLOT(showCleanerError(QString))); connect(cleaner_widget, SIGNAL(startScanSystem(QMap)), m_dataWorker, SLOT(onStartScanSystem(QMap))); - connect(cleaner_widget, SIGNAL(startCleanSystem(QMap)), m_dataWorker, SLOT(onStartCleanSystem(QMap))); + connect(cleaner_widget, SIGNAL(startCleanSystem(QMap)), m_dataWorker, SLOT(onStartCleanSystem(QMap)));*/ @@ -1016,10 +1265,10 @@ void MainWindow::initOtherPages() // connect(sessioninterface, SIGNAL(tellCleanerDetailStatus(QString)), cleaner_action_widget, SLOT(showCleanReciveStatus(QString))); // connect(sessioninterface, SIGNAL(tellCleanerDetailError(QString)), cleaner_action_widget, SLOT(showCleanReciveError(QString))); - connect(cleaner_action_widget, SIGNAL(sendScanSignal()),cleaner_widget, SIGNAL(transScanSignal())); + /*connect(cleaner_action_widget, SIGNAL(sendScanSignal()),cleaner_widget, SIGNAL(transScanSignal())); connect(cleaner_widget, SIGNAL(tranActionAnimaitonSignal()),cleaner_action_widget, SLOT(displayAnimation())); connect(cleaner_widget, SIGNAL(tranScanOverSignal(bool)),cleaner_action_widget, SLOT(accordScanOverStatusToChange(bool))); - bottomStack->addWidget(cleaner_widget); + m_bottomStack->addWidget(cleaner_widget); if(info_widget == NULL) info_widget = new InfoWidget(this->arch); @@ -1034,7 +1283,7 @@ void MainWindow::initOtherPages() // connect(m_dataWorker, SIGNAL(sendSystemRunnedTime(int)), info_widget, SLOT(onSendSystemRunnedTime(int))); info_widget->initUI(this->battery, this->sensor);//20180101 - bottomStack->addWidget(info_widget); + m_bottomStack->addWidget(info_widget); //desktop info connect(info_widget, SIGNAL(requestDesktopInfo()), m_dataWorker, SLOT(onRequestDesktopInfo())); @@ -1089,8 +1338,6 @@ void MainWindow::initOtherPages() //driver info - - if(setting_widget == NULL) setting_widget = new SettingWidget(this->m_cpulist, this->m_currentCpuMode, this->desktop, this->battery);//20180101 setting_widget->setParentWindow(this); @@ -1099,13 +1346,18 @@ void MainWindow::initOtherPages() // setting_widget->initUI(last_skin_path); connect(setting_widget, SIGNAL(changeActionPage(QString)), setting_action_widget, SLOT(displayActionSubPage(QString))); connect(setting_action_widget, SIGNAL(notifyContentPageToMain()), setting_widget, SLOT(displaySettingHomePage())); - bottomStack->addWidget(setting_widget); + m_bottomStack->addWidget(setting_widget); if(box_widget == NULL) box_widget = new BoxWidget(this, this->arch, this->osName, getPluginsDirectory()); // box_widget->setSessionDbusProxy(sessioninterface); // connect(box_widget, SIGNAL(sendSubIndex(int)), this, SLOT(displaySubPage(int))); - bottomStack->addWidget(box_widget); + m_bottomStack->addWidget(box_widget); + + + + +*/ } int MainWindow::getCurrentBackgroundIndex() @@ -1157,8 +1409,8 @@ void MainWindow::restoreSkin() main_skin_pixmap.load(last_skin_path); QPalette palette_back; palette_back.setBrush(QPalette::Background, main_skin_pixmap); - default_action_widget->setPalette(palette_back); - other_action_widget->setPalette(palette_back); +// default_action_widget->setPalette(palette_back); +// other_action_widget->setPalette(palette_back); } @@ -1172,8 +1424,8 @@ void MainWindow::changeSkin(QString pciture) main_skin_pixmap.load(pciture); QPalette palette; palette.setBrush(QPalette::Background, main_skin_pixmap); - default_action_widget->setPalette(palette); - other_action_widget->setPalette(palette); +// default_action_widget->setPalette(palette); +// other_action_widget->setPalette(palette); mSettings->beginGroup("Background"); mSettings->setValue("Path", pciture); @@ -1195,9 +1447,9 @@ void MainWindow::changeSkin(QString pciture) if(aboutDlg != NULL) { aboutDlg->resetTitleSkin(last_skin_path); } - if(upgrade_dialog != NULL) { - upgrade_dialog->resetTitleSkin(last_skin_path); - } +// if(upgrade_dialog != NULL) { +// upgrade_dialog->resetTitleSkin(last_skin_path); +// } } void MainWindow::reViewThePointSkin(QString pciture) @@ -1209,8 +1461,8 @@ void MainWindow::reViewThePointSkin(QString pciture) review_skin_pixmap.load(pciture); QPalette palette_back; palette_back.setBrush(QPalette::Background, review_skin_pixmap); - default_action_widget->setPalette(palette_back); - other_action_widget->setPalette(palette_back); +// default_action_widget->setPalette(palette_back); +// other_action_widget->setPalette(palette_back); } void MainWindow::reViewTheOrgSkin() @@ -1222,8 +1474,8 @@ void MainWindow::reViewTheOrgSkin() review_skin_pixmap.load(last_skin_path); QPalette palette_back; palette_back.setBrush(QPalette::Background, review_skin_pixmap); - default_action_widget->setPalette(palette_back); - other_action_widget->setPalette(palette_back); +// default_action_widget->setPalette(palette_back); +// other_action_widget->setPalette(palette_back); } void MainWindow::showMainMenu() { @@ -1267,16 +1519,53 @@ void MainWindow::closeEvent(QCloseEvent *) void MainWindow::setCurrentPageIndex(int index) { + if (index == 0 && status != HOMEPAGE) { + m_topStack->setCurrentWidget(m_mainTopWidget); + m_bottomStack->setCurrentWidget(m_mainBottomWidget); + m_topStack->setFixedSize(m_mainTopWidget->size()); + m_bottomStack->setFixedSize(m_mainBottomWidget->size()); + status = HOMEPAGE; + } + else if (index == 1 && status != CLEANPAGE) { + m_topStack->setCurrentWidget(cleaner_action_widget); + m_bottomStack->setCurrentWidget(cleaner_widget); + m_topStack->setFixedSize(cleaner_action_widget->size()); + m_bottomStack->setFixedSize(cleaner_widget->size()); + status = CLEANPAGE; + } + else if (index == 2 && status != INFOPAGE) { + m_topStack->setCurrentWidget(info_action_widget); + m_bottomStack->setCurrentWidget(info_widget); + m_topStack->setFixedSize(info_action_widget->size()); + m_bottomStack->setFixedSize(info_widget->size()); + status = INFOPAGE; + } + else if (index == 3 && status != SETTINGPAGE) { + m_topStack->setCurrentWidget(setting_action_widget); + m_bottomStack->setCurrentWidget(setting_widget); + m_topStack->setFixedSize(setting_action_widget->size()); + m_bottomStack->setFixedSize(setting_widget->size()); + status = SETTINGPAGE; + } + else if (index == 4 && status != BOXPAGE) { + m_topStack->setCurrentWidget(box_action_widget); + m_bottomStack->setCurrentWidget(box_widget); + m_topStack->setFixedSize(box_action_widget->size()); + m_bottomStack->setFixedSize(box_widget->size()); + status = BOXPAGE; + } + +/* if(index == 0) { // if (this->arch == "aarch64" || this->osName == "Kylin" || this->osName == "YHKylin") // login_widget->hide(); if (status != HOMEPAGE) { statusFlag = true; - shadow_widget->show(); - tool_widget->hide(); - if(title_widget->isVisible()) - title_widget->hide(); +// shadow_widget->show(); + m_middleWidget->hide(); +// if(title_widget->isVisible()) +// title_widget->hide(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) // { // login_widget->hide(); @@ -1298,17 +1587,17 @@ void MainWindow::setCurrentPageIndex(int index) statusFlag = false; } if (status != CLEANPAGE && statusFlag) { - shadow_widget->show(); - tool_widget->hide(); - if(title_widget->isVisible()) - title_widget->hide(); +// shadow_widget->show(); + m_middleWidget->hide(); +// if(title_widget->isVisible()) +// title_widget->hide(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } -// topStack->setCurrentIndex(0); -// bottomStack->setCurrentIndex(0); - topStack->setCurrentWidget(cleaner_action_widget); - bottomStack->setCurrentWidget(cleaner_widget); +// m_topStack->setCurrentIndex(0); +// m_bottomStack->setCurrentIndex(0); + m_topStack->setCurrentWidget(cleaner_action_widget); + m_bottomStack->setCurrentWidget(cleaner_widget); spreadGroup->start(); status = CLEANPAGE; } @@ -1316,10 +1605,10 @@ void MainWindow::setCurrentPageIndex(int index) // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } -// topStack->setCurrentIndex(0); -// bottomStack->setCurrentIndex(0); - topStack->setCurrentWidget(cleaner_action_widget); - bottomStack->setCurrentWidget(cleaner_widget); +// m_topStack->setCurrentIndex(0); +// m_bottomStack->setCurrentIndex(0); + m_topStack->setCurrentWidget(cleaner_action_widget); + m_bottomStack->setCurrentWidget(cleaner_widget); } } else if(index == 2) @@ -1333,17 +1622,17 @@ void MainWindow::setCurrentPageIndex(int index) statusFlag = false; } if (status != INFOPAGE && statusFlag) { - shadow_widget->show(); - tool_widget->hide(); - if(title_widget->isVisible()) - title_widget->hide(); +// shadow_widget->show(); + m_middleWidget->hide(); +// if(title_widget->isVisible()) +// title_widget->hide(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } -// topStack->setCurrentIndex(1); -// bottomStack->setCurrentIndex(1); - topStack->setCurrentWidget(info_action_widget); - bottomStack->setCurrentWidget(info_widget); +// m_topStack->setCurrentIndex(1); +// m_bottomStack->setCurrentIndex(1); + m_topStack->setCurrentWidget(info_action_widget); + m_bottomStack->setCurrentWidget(info_widget); spreadGroup->start(); status = INFOPAGE; } @@ -1351,10 +1640,10 @@ void MainWindow::setCurrentPageIndex(int index) // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } -// topStack->setCurrentIndex(1); -// bottomStack->setCurrentIndex(1); - topStack->setCurrentWidget(info_action_widget); - bottomStack->setCurrentWidget(info_widget); +// m_topStack->setCurrentIndex(1); +// m_bottomStack->setCurrentIndex(1); + m_topStack->setCurrentWidget(info_action_widget); + m_bottomStack->setCurrentWidget(info_widget); } } else if(index == 3) @@ -1371,34 +1660,34 @@ void MainWindow::setCurrentPageIndex(int index) // tool_widget->hide(); // if(title_widget->isVisible()) // title_widget->hide(); -// // topStack->setCurrentIndex(3); -// // bottomStack->setCurrentIndex(3); -// topStack->setCurrentWidget(box_action_widget); -// bottomStack->setCurrentWidget(box_widget); +// // m_topStack->setCurrentIndex(3); +// // m_bottomStack->setCurrentIndex(3); +// m_topStack->setCurrentWidget(box_action_widget); +// m_bottomStack->setCurrentWidget(box_widget); // spreadGroup->start(); // status = BOXPAGE; // } // else { -// // topStack->setCurrentIndex(3); -// // bottomStack->setCurrentIndex(3); -// topStack->setCurrentWidget(box_action_widget); -// bottomStack->setCurrentWidget(box_widget); +// // m_topStack->setCurrentIndex(3); +// // m_bottomStack->setCurrentIndex(3); +// m_topStack->setCurrentWidget(box_action_widget); +// m_bottomStack->setCurrentWidget(box_widget); // } // } // else // { if (status != SETTINGPAGE && statusFlag) { - shadow_widget->show(); - tool_widget->hide(); - if(title_widget->isVisible()) - title_widget->hide(); +// shadow_widget->show(); + m_middleWidget->hide(); +// if(title_widget->isVisible()) +// title_widget->hide(); // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } - // topStack->setCurrentIndex(2); - // bottomStack->setCurrentIndex(2); - topStack->setCurrentWidget(setting_action_widget); - bottomStack->setCurrentWidget(setting_widget); + // m_topStack->setCurrentIndex(2); + // m_bottomStack->setCurrentIndex(2); + m_topStack->setCurrentWidget(setting_action_widget); + m_bottomStack->setCurrentWidget(setting_widget); spreadGroup->start(); status = SETTINGPAGE; } @@ -1406,10 +1695,10 @@ void MainWindow::setCurrentPageIndex(int index) // if (this->arch != "aarch64" && this->osName != "Kylin" && this->osName != "YHKylin" && login_widget->isVisible()) { // login_widget->hide(); // } - // topStack->setCurrentIndex(2); - // bottomStack->setCurrentIndex(2); - topStack->setCurrentWidget(setting_action_widget); - bottomStack->setCurrentWidget(setting_widget); + // m_topStack->setCurrentIndex(2); + // m_bottomStack->setCurrentIndex(2); + m_topStack->setCurrentWidget(setting_action_widget); + m_bottomStack->setCurrentWidget(setting_widget); } // } } @@ -1422,17 +1711,17 @@ void MainWindow::setCurrentPageIndex(int index) else statusFlag = false; if (status != BOXPAGE && statusFlag) { - shadow_widget->show(); - tool_widget->hide(); - if(title_widget->isVisible()) - title_widget->hide(); +// shadow_widget->show(); + m_middleWidget->hide(); +// if(title_widget->isVisible()) +// title_widget->hide(); // if (login_widget->isVisible()) { // login_widget->hide(); // } - // topStack->setCurrentIndex(3); - // bottomStack->setCurrentIndex(3); - topStack->setCurrentWidget(box_action_widget); - bottomStack->setCurrentWidget(box_widget); + // m_topStack->setCurrentIndex(3); + // m_bottomStack->setCurrentIndex(3); + m_topStack->setCurrentWidget(box_action_widget); + m_bottomStack->setCurrentWidget(box_widget); spreadGroup->start(); status = BOXPAGE; } @@ -1440,49 +1729,49 @@ void MainWindow::setCurrentPageIndex(int index) // if (login_widget->isHidden()) { // login_widget->show(); // } - // topStack->setCurrentIndex(3); - // bottomStack->setCurrentIndex(3); - topStack->setCurrentWidget(box_action_widget); - bottomStack->setCurrentWidget(box_widget); + // m_topStack->setCurrentIndex(3); + // m_bottomStack->setCurrentIndex(3); + m_topStack->setCurrentWidget(box_action_widget); + m_bottomStack->setCurrentWidget(box_widget); } // } - } + }*/ } void MainWindow::initHomePage() { - if(home_action_widget == NULL) - { -// if(top_grid_layout == NULL ) - QGridLayout *home_top_grid_layout = new QGridLayout(); -// home_action_widget = new HomeActionWidget(this, mSettings); - home_action_widget = new HomeActionWidget(0, mSettings); - home_top_grid_layout->addWidget(home_action_widget,0,0); - default_action_widget->setLayout(home_top_grid_layout); - home_top_grid_layout->setSpacing(0); - home_top_grid_layout->setContentsMargins(0, 0, 0, 0); - } +// if(home_action_widget == NULL) +// { +//// if(top_grid_layout == NULL ) +// QGridLayout *home_top_grid_layout = new QGridLayout(); +//// home_action_widget = new HomeActionWidget(this, mSettings); +// home_action_widget = new HomeActionWidget(0, mSettings); +// home_top_grid_layout->addWidget(home_action_widget,0,0); +// default_action_widget->setLayout(home_top_grid_layout); +// home_top_grid_layout->setSpacing(0); +// home_top_grid_layout->setContentsMargins(0, 0, 0, 0); +// } - if(home_page == NULL) - { -// if( bottom_grid_layout == NULL ) - QGridLayout *home_bottom_grid_layout = new QGridLayout(); -// home_page = new HomePage(0/*, version*/); - home_page = new HomePage(this, this->arch, this->osName/*, version*/); - connect(home_page, SIGNAL(sendSubIndex(int)), this, SLOT(displaySubPage(int))); - home_page->setParentWindow(this); - home_page->initUI(); - home_page->initConnect(); +// if(home_page == NULL) +// { +//// if( bottom_grid_layout == NULL ) +// QGridLayout *home_bottom_grid_layout = new QGridLayout(); +//// home_page = new HomePage(0/*, version*/); +// home_page = new HomePage(this, this->arch, this->osName/*, version*/); +// connect(home_page, SIGNAL(sendSubIndex(int)), this, SLOT(displaySubPage(int))); +// home_page->setParentWindow(this); +// home_page->initUI(); +// home_page->initConnect(); - home_bottom_grid_layout->addWidget(home_page,0,0); - default_content_widget->setLayout(home_bottom_grid_layout); - home_bottom_grid_layout->setSpacing(0); - home_bottom_grid_layout->setContentsMargins(0, 0, 0, 0); - } +// home_bottom_grid_layout->addWidget(home_page,0,0); +// default_content_widget->setLayout(home_bottom_grid_layout); +// home_bottom_grid_layout->setSpacing(0); +// home_bottom_grid_layout->setContentsMargins(0, 0, 0, 0); +// } } void MainWindow::openSkinCenter() { - if(skin_center == NULL) { + /*if(skin_center == NULL) { skin_center = new SkinCenter(0, last_skin_path, this->arch, this->osName);//20161228 skin_center->setParentWindow(this); skin_center->initSysBackgroundList(); @@ -1498,7 +1787,7 @@ void MainWindow::openSkinCenter() { skin_center->move(w_x, w_y); skin_center->show(); skin_center->raise(); - } + }*/ } void MainWindow::openUpgradePage(/*QStringList version_list*/) @@ -1532,14 +1821,14 @@ void MainWindow::openUpgradePage(/*QStringList version_list*/) }*/ } -void MainWindow::openUpgradePageAgain() -{ - int w_x = this->frameGeometry().topLeft().x() + (900 / 2) - (334 / 2); - int w_y = this->frameGeometry().topLeft().y() + (600 /2) - (470 / 2); - upgrade_dialog->move(w_x, w_y); - upgrade_dialog->show(); - upgrade_dialog->raise(); -} +//void MainWindow::openUpgradePageAgain() +//{ +// int w_x = this->frameGeometry().topLeft().x() + (900 / 2) - (334 / 2); +// int w_y = this->frameGeometry().topLeft().y() + (600 /2) - (470 / 2); +// upgrade_dialog->move(w_x, w_y); +// upgrade_dialog->show(); +// upgrade_dialog->raise(); +//} void MainWindow::displaySubPage(int index) { @@ -1631,71 +1920,61 @@ void MainWindow::aboutUs() aboutDlg->show(); } - void MainWindow::mousePressEvent(QMouseEvent *event) { -// if(event->button() == Qt::LeftButton) -// { -// mouse_press = true; -// drag_pos = event->globalPos() - this->frameGeometry().topLeft(); -// event->accept(); -// } - if(event->button() == Qt::LeftButton) + /*if(event->button() == Qt::LeftButton) { - mouse_press = true; - drag_pos = event->globalPos() - pos(); + m_mousePressed = true; + m_dragPosition = event->globalPos() - pos(); + }*/ + if (event->button() == Qt::LeftButton) { + this->m_dragPosition = event->globalPos() - frameGeometry().topLeft(); + this->m_mousePressed = true; } + + QMainWindow::mousePressEvent(event); } -void MainWindow::mouseReleaseEvent(QMouseEvent *) +void MainWindow::mouseReleaseEvent(QMouseEvent *event) { - mouse_press = false; + /*m_mousePressed = false; + setWindowOpacity(1);*/ + this->m_mousePressed = false; setWindowOpacity(1); + + QMainWindow::mouseReleaseEvent(event); } void MainWindow::mouseMoveEvent(QMouseEvent *event) { - if(mouse_press) + /*if(m_mousePressed) { QPoint move_pos = event->globalPos(); - move(move_pos - drag_pos); + move(move_pos - m_dragPosition); setWindowOpacity(0.9); // event->accept(); + }*/ + if (this->m_mousePressed) { + move(event->globalPos() - this->m_dragPosition); + setWindowOpacity(0.9); } + + QMainWindow::mouseMoveEvent(event); } -/*void MainWindow::paintEvent(QPaintEvent *event) +void MainWindow::paintEvent(QPaintEvent *event) { QPainter painter(this); - painter.setRenderHint(QPainter::Antialiasing, true); painter.setOpacity(0.05); int penWidth = 1; QPainterPath framePath; - framePath.addRoundedRect(QRect(rect().x() + penWidth, rect().y() + penWidth, rect().width() - penWidth * 2, rect().height() - penWidth * 2), 4, 4);//背景弧度 + framePath.addRoundedRect(QRect(rect().x() + penWidth, rect().y() + penWidth, rect().width() - penWidth * 2, rect().height() - penWidth * 2), 3, 3);//背景弧度 painter.setClipPath(framePath); QPen framePen; - framePen.setColor(QColor("#F5F5F5")); + framePen.setColor(QColor("#fca71d")); painter.setOpacity(0.2); painter.drawPath(framePath); -// QPainterPath path; -// path.setFillRule(Qt::WindingFill); -// path.addRect(10, 10, this->width()-20, this->height()-20); - -// QPainter painter(this); -// painter.setRenderHint(QPainter::Antialiasing, true); -// painter.fillPath(path, QBrush(Qt::white)); - -// QColor color(0, 0, 0, 50); -// for(int i=0; i<10; i++) -// { -// QPainterPath path; -// path.setFillRule(Qt::WindingFill); -// path.addRect(10-i, 10-i, this->width()-(10-i)*2, this->height()-(10-i)*2); -// color.setAlpha(150 - qSqrt(i)*50); -// painter.setPen(color); -// painter.drawPath(path); -// } -}*/ +} diff --git a/src/mainwindow.h b/src/mainwindow.h index e74026a..1000cce 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -31,27 +31,27 @@ #include "toolwidget.h" //#include "loginwidget.h" #include "bottomcontentwidget.h" -#include "homepage.h" +//#include "homepage.h" #include "infowidget.h" #include "settingwidget.h" #include "cleanerwidget.h" #include "boxwidget.h" -#include "skincenter.h" +//#include "skincenter.h" #include "../component/kylinmenu.h" #include "../component/utils.h" #include "../component/toolkits.h" -#include "homeactionwidget.h" -#include "infoactionwidget.h" -#include "cleaneractionwidget.h" -#include "settingactionwidget.h" -#include "boxactionwidget.h" +//#include "homeactionwidget.h" +//#include "infoactionwidget.h" +//#include "cleaneractionwidget.h" +//#include "settingactionwidget.h" +//#include "boxactionwidget.h" #include "aboutdialog.h" -#include "upgradedialog.h" - +//#include "upgradedialog.h" +//#include "shadowwidget.h" class QParallelAnimationGroup; class SessionDispatcher; class SystemDispatcher; -class ShadowWidget; +//class ShadowWidget; #include "autostartwidget.h" //#include "cameramanager.h" @@ -59,6 +59,11 @@ class DataWorker; class SystemDbusProxy; class SessionDbusProxy; +class MainTopWidget; +class MiddleWidget; +class MainBottomWidget; +class TopBaseWidget; + //class MainWindow : public QDialog class MainWindow : public QMainWindow { @@ -66,7 +71,7 @@ class MainWindow : public QMainWindow public: // explicit MainWindow(QString cur_arch = "", int d_count = 0, QWidget *parent = 0); - explicit MainWindow(QString cur_arch = "", int d_count = 0, QWidget* parent = 0, Qt::WindowFlags flags = 0); + explicit MainWindow(QString cur_arch = "", int d_count = 0, QWidget* parent = 0/*, Qt::WindowFlags flags = 0*/); ~MainWindow(); void setTranslator(QTranslator* translator); void initConnect(); @@ -84,20 +89,22 @@ public: bool deleteFile(QString filename); bool CopyFile(QString filename); QString accessOSName(); - void createAboutDialog(); + void initWidgets(); + void moveCenter(); + protected: void mousePressEvent(QMouseEvent *event); void mouseReleaseEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event); void closeEvent(QCloseEvent *); -// virtual void paintEvent(QPaintEvent *event); + virtual void paintEvent(QPaintEvent *event); public slots: void openSkinCenter(); void openUpgradePage(/*QStringList version_list*/); - void openUpgradePageAgain(); +// void openUpgradePageAgain(); void showMainMenu(); void closeYoukerAssistant(); void setCurrentPageIndex(int index); @@ -110,7 +117,7 @@ public slots: void upAnimFinished(); void closeAnimFinished(); - void displayMainWindow(/*int display*/); +// void displayMainWindow(/*int display*/); void onInitDataFinished(); @@ -119,32 +126,42 @@ signals: void chanegBoxToolStatus(); private: - QStackedWidget *topStack; - QStackedWidget *bottomStack; + QStackedWidget *m_topStack = nullptr; + QStackedWidget *m_bottomStack = nullptr; + + MainTopWidget *m_mainTopWidget = nullptr; + MiddleWidget *m_middleWidget = nullptr; + MainBottomWidget *m_mainBottomWidget = nullptr; + MainTopWidget *cleaner_action_widget; + TopBaseWidget *info_action_widget = nullptr; + TopBaseWidget *setting_action_widget = nullptr; + TopBaseWidget *box_action_widget = nullptr; + + // QGridLayout *top_grid_layout; // QGridLayout *bottom_grid_layout; - TitleWidget *title_widget; - ActionWidget *default_action_widget; - ActionWidget *other_action_widget; - ToolWidget *tool_widget; +// TitleWidget *title_widget = nullptr; +// ActionWidget *default_action_widget; +// ActionWidget *other_action_widget; +// ToolWidget *tool_widget = nullptr; // LoginWidget *login_widget; - BottomContentWidget *default_content_widget; - BottomContentWidget *other_content_widget; - HomePage *home_page; +// BottomContentWidget *default_content_widget = nullptr; +// BottomContentWidget *other_content_widget = nullptr; +// HomePage *home_page; InfoWidget *info_widget; CleanerWidget *cleaner_widget; SettingWidget *setting_widget; BoxWidget *box_widget; - HomeActionWidget *home_action_widget; - InfoActionWidget *info_action_widget; - CleanerActionWidget *cleaner_action_widget; - SettingActionWidget *setting_action_widget; - BoxActionWidget *box_action_widget; - SkinCenter *skin_center; +// HomeActionWidget *home_action_widget; +// InfoActionWidget *info_action_widget; +// CleanerActionWidget *cleaner_action_widget; +// SettingActionWidget *setting_action_widget; +// BoxActionWidget *box_action_widget; +// SkinCenter *skin_center; KylinMenu *main_menu; // QString version; - QPoint drag_pos; //移动的距离 - bool mouse_press; //按下鼠标左键 + QPoint m_dragPosition; //移动的距离 + bool m_mousePressed; //按下鼠标左键 QTranslator* translator; //翻译器 LANGUAGE current_language; //当前语言 QPixmap main_skin_pixmap; @@ -161,6 +178,7 @@ private: QString arch; bool battery; bool sensor; + int display_count; QStringList m_cpulist; QString m_currentCpuMode; QParallelAnimationGroup *spreadGroup; @@ -169,11 +187,12 @@ private: bool statusFlag; // AutoStartWidget *auto_start; // CameraManager *camera_manager; - UpgradeDialog *upgrade_dialog; +// UpgradeDialog *upgrade_dialog; // QStringList skinlist; - ShadowWidget *shadow_widget; - int display_count; +// ShadowWidget *shadow_widget; + DataWorker *m_dataWorker = nullptr; + QWidget *centralWidget = nullptr; }; class GlobalData // define by hebing,just for transmit var diff --git a/src/middlewidget.cpp b/src/middlewidget.cpp new file mode 100644 index 0000000..fc70b59 --- /dev/null +++ b/src/middlewidget.cpp @@ -0,0 +1,114 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#include "middlewidget.h" +#include "../component/kylintoolbutton.h" +#include "mainwindow.h" +#include + +MiddleWidget::MiddleWidget(QWidget *parent, QString arch, QString os) + : QWidget(parent), cur_arch(arch), osname(os) +{ + this->setFixedSize(900, 47); + this->setAutoFillBackground(true); + QPalette palette; + palette.setColor(QPalette::Background, QColor(233,238,241));//#e9eef1 + this->setPalette(palette); + + QStringList icon_list; + QStringList text_list; +// if(this->cur_arch == "aarch64" || this->osname == "Kylin" || this->osname == "YHKylin") +// { +// icon_list<<":/tool/res/menu/home"<<":/tool/res/menu/cleanup"<<":/tool/res/menu/sysinfo"<<":/tool/res/menu/toolkits"; +// text_list<< tr("KylinHome") << tr("Cleanup") << tr("Sysinfo") << tr("Toolkits"); +// } +// else { + icon_list<<":/tool/res/menu/home"<<":/tool/res/menu/cleanup"<<":/tool/res/menu/sysinfo"<<":/tool/res/menu/feature"<<":/tool/res/menu/toolkits"; + text_list<< tr("Home") << tr("Cleanup") << tr("Sysinfo") << tr("Feature") << tr("Toolkits"); +// } + + QHBoxLayout *button_layout = new QHBoxLayout(); + + QSignalMapper *signal_mapper = new QSignalMapper(this); + for(int i=0; isetFixedSize(180, 47); + button_list.append(tool_button); + connect(tool_button, SIGNAL(clicked()), signal_mapper, SLOT(map())); + signal_mapper->setMapping(tool_button, QString::number(i, 10)); + button_layout->addWidget(tool_button, 0, Qt::AlignBottom); + } + this->switchSelectedPageIndex(0); + connect(signal_mapper, SIGNAL(mapped(QString)), this, SLOT(switchSelectedPageIndex(QString))); + + button_layout->addStretch(); + button_layout->setSpacing(8); + button_layout->setMargin(0); + button_layout->setContentsMargins(15, 0, 15, 0); + + setLayout(button_layout); + is_move = false; +} + +MiddleWidget::~MiddleWidget() +{ + for(int i=0; isetMousePress(true); + } + else + { + tool_button->setMousePress(false); + } + } + emit turnCurrentPage(current_index); +} + +void MiddleWidget::showBoxTool() +{ +// if(this->cur_arch == "aarch64" || this->osname == "Kylin" || this->osname == "YHKylin") { +// this->switchSelectedPageIndex("3"); +// } +// else { +// this->switchSelectedPageIndex("4"); +// } +} diff --git a/src/middlewidget.h b/src/middlewidget.h new file mode 100644 index 0000000..7ecdca1 --- /dev/null +++ b/src/middlewidget.h @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#ifndef MIDDLEWIDGET_H +#define MIDDLEWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include "../component/kylinbutton.h" +#include "../component/kylintoolbutton.h" + +class MainWindow; + +class MiddleWidget : public QWidget +{ + Q_OBJECT +public: + explicit MiddleWidget(QWidget *parent = 0, QString arch = "", QString os = ""); + ~MiddleWidget(); + void setParentWindow(MainWindow* window) { p_mainwindow = window;} + void initConnect(); + +signals: + void turnCurrentPage(int index); + +public slots: + void switchSelectedPageIndex(QString index); + void showBoxTool(); + +private: + QPoint press_point;//鼠标按下去的点 + bool is_move; + QList button_list; + MainWindow *p_mainwindow; + QString cur_arch; + QString osname; +}; + +#endif // MIDDLEWIDGET_H diff --git a/src/res/qss/kylin-assistant.qss b/src/res/qss/kylin-assistant.qss index 5289b33..9ba06c0 100644 --- a/src/res/qss/kylin-assistant.qss +++ b/src/res/qss/kylin-assistant.qss @@ -160,7 +160,8 @@ QPushButton#blackButton:pressed{ } QPushButton#underlineButton{ - background:transparent; + /*background:transparent;*/ + background-color: rgba(0, 0, 0, 0); text-decoration:underline; color:#cfd8dc; font-family: "方正黑体_GBK"; diff --git a/src/settingwidget.cpp b/src/settingwidget.cpp index a1f32a5..0ebad34 100644 --- a/src/settingwidget.cpp +++ b/src/settingwidget.cpp @@ -25,12 +25,12 @@ #include "../setting/settingmodel.h" #include "../setting/settingdelegate.h" -SettingWidget::SettingWidget(QStringList cpulist, QString cpu, QString cur_desktop, bool has_battery, QWidget *parent) : +SettingWidget::SettingWidget(/*QStringList cpulist, QString cpu, */QString cur_desktop, /*bool has_battery, */QWidget *parent) : QWidget(parent) - ,m_cpuList(cpulist) - ,m_currentCpu(cpu) +// ,m_cpuList(cpulist) +// ,m_currentCpu(cpu) ,desktop(cur_desktop) - ,battery(has_battery) +// ,battery(has_battery) { this->setFixedSize(900, 403); // setStyleSheet("background-color: rgba(155, 255, 255, .238);"); @@ -76,8 +76,6 @@ SettingWidget::SettingWidget(QStringList cpulist, QString cpu, QString cur_deskt // stacked_widget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding); stacked_widget->setVisible(false); - this->initUI(); - //this->qtui = NULL; } @@ -130,8 +128,12 @@ void SettingWidget::onSettingItemEntered(const QModelIndex &index) qDebug() << "onSettingItemEntered:" << index.data().toString();*/ } -void SettingWidget::initUI(/*QString skin*/) +void SettingWidget::initSettingsUI(QStringList cpulist, QString cpu, bool has_battery/*, QString skin*/) { + m_cpuList = cpulist; + m_currentCpu = cpu; + battery = has_battery; + theme_widget = new ThemeWidget(this); icon_widget = new IconWidget(this, desktop); mouse_widget = new MouseWidget(this, desktop); diff --git a/src/settingwidget.h b/src/settingwidget.h index 81fbbba..ce035e3 100644 --- a/src/settingwidget.h +++ b/src/settingwidget.h @@ -45,7 +45,7 @@ #include "../setting/filemanagerwidget.h" #include "../component/quibo.h" -#include "../component/settingaction.h" +//#include "../component/settingaction.h" class MainWindow; class SettingListView; @@ -55,10 +55,10 @@ class SettingWidget : public QWidget { Q_OBJECT public: - explicit SettingWidget(QStringList cpulist, QString cpu, QString cur_desktop, bool has_battery = false, QWidget *parent = 0); + explicit SettingWidget(/*QStringList cpulist, QString cpu, */QString cur_desktop, /*bool has_battery = false, */QWidget *parent = 0); ~SettingWidget(); void setParentWindow(MainWindow* window) { p_mainwindow = window;} - void initUI(/*QString skin*/); + void initSettingsUI(QStringList cpulist, QString cpu, bool has_battery = false /*QString skin*/); void resetSkin(QString skin); signals: diff --git a/src/shadowwidget.cpp b/src/shadowwidget.cpp index 7c256a6..4fd4532 100644 --- a/src/shadowwidget.cpp +++ b/src/shadowwidget.cpp @@ -19,9 +19,12 @@ #include "shadowwidget.h" #include +#include +#include ShadowWidget::ShadowWidget(QWidget *parent) : QWidget(parent) + ,widget_color(QColor("#fca71d")) { widget_opacity = 1; } @@ -32,11 +35,61 @@ void ShadowWidget::setOpacity(qreal opacity) update(); } +void ShadowWidget::mousePressEvent(QMouseEvent *event) +{ +// if(event->button() == Qt::LeftButton) +// { +// m_mousePressed = true; +// m_dragPosition = event->globalPos() - this->frameGeometry().topLeft(); +// event->accept(); +// } + if(event->button() == Qt::LeftButton) + { + m_mousePressed = true; + m_dragPosition = event->globalPos() - pos(); + } +} + +void ShadowWidget::mouseReleaseEvent(QMouseEvent *) +{ + m_mousePressed = false; + setWindowOpacity(1); +} + +void ShadowWidget::mouseMoveEvent(QMouseEvent *event) +{ + if(m_mousePressed) + { + QPoint move_pos = event->globalPos(); + move(move_pos - m_dragPosition); + setWindowOpacity(0.9); +// event->accept(); + } +} + void ShadowWidget::paintEvent(QPaintEvent *) { +// QPainter painter(this); +// painter.setOpacity(widget_opacity); +// painter.setBrush(widget_color); +// painter.setPen(Qt::NoPen); +// painter.drawRect(rect()); + + QPainterPath path; + path.setFillRule(Qt::WindingFill); + path.addRect(10,10,this->width()-20,this->height()-20); QPainter painter(this); - painter.setOpacity(widget_opacity); - painter.setBrush(widget_color); - painter.setPen(Qt::NoPen); - painter.drawRect(rect()); + painter.setRenderHint(QPainter::Antialiasing,true); + painter.fillPath(path,QBrush(Qt::white)); +// QColor color(0,0,0,50); + QColor color(widget_color); + for(int i = 0 ; i < 10 ; ++i) + { + QPainterPath path; + path.setFillRule(Qt::WindingFill); + path.addRect(10-i,10-i,this->width()-(10-i)*2,this->height()-(10-i)*2); + color.setAlpha(150 - qSqrt(i)*50); + painter.setPen(color); + painter.drawPath(path); + } } diff --git a/src/shadowwidget.h b/src/shadowwidget.h index 98ed172..38bf9cc 100644 --- a/src/shadowwidget.h +++ b/src/shadowwidget.h @@ -21,6 +21,7 @@ #define SHADOWWIDGET_H #include +#include class ShadowWidget : public QWidget { @@ -39,9 +40,14 @@ public: } protected: + void mousePressEvent(QMouseEvent *event); + void mouseReleaseEvent(QMouseEvent *event); + void mouseMoveEvent(QMouseEvent *event); void paintEvent(QPaintEvent *); private: + QPoint m_dragPosition; //移动的距离 + bool m_mousePressed; //按下鼠标左键 qreal widget_opacity; QColor widget_color; }; diff --git a/src/skincenter.cpp b/src/skincenter.cpp index 0a37b2f..2274e53 100644 --- a/src/skincenter.cpp +++ b/src/skincenter.cpp @@ -678,23 +678,23 @@ void SkinCenter::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; - drag_pos = event->globalPos() - this->frameGeometry().topLeft(); + m_mousePressed = true; + m_dragPosition = event->globalPos() - this->frameGeometry().topLeft(); event->accept(); } } void SkinCenter::mouseReleaseEvent(QMouseEvent *) { - mouse_press = false; + m_mousePressed = false; } void SkinCenter::mouseMoveEvent(QMouseEvent *event) { - if(mouse_press) + if(m_mousePressed) { QPoint move_pos = event->globalPos(); - move(move_pos - drag_pos); + move(move_pos - m_dragPosition); event->accept(); } } diff --git a/src/skincenter.h b/src/skincenter.h index a4c7721..8c1692e 100644 --- a/src/skincenter.h +++ b/src/skincenter.h @@ -78,9 +78,9 @@ protected: private: MainWindow *mainwindow; - QPoint drag_pos; //移动的距离 + QPoint m_dragPosition; //移动的距离 // bool mouse_enter; - bool mouse_press; //按下鼠标左键 + bool m_mousePressed; //按下鼠标左键 QWidget *baseWidget; SystemButton *close_btn; QLabel *indicator; diff --git a/src/src.pro b/src/src.pro index 842295e..4ac16af 100644 --- a/src/src.pro +++ b/src/src.pro @@ -49,13 +49,17 @@ unix { SOURCES += main.cpp\ mainwindow.cpp \ + maintopwidget.cpp \ + middlewidget.cpp \ + mainbottomwidget.cpp \ + topbasewidget.cpp \ titlewidget.cpp \ - loginwidget.cpp \ +# loginwidget.cpp \ actionwidget.cpp \ - homeactionwidget.cpp \ +# homeactionwidget.cpp \ infoactionwidget.cpp \ cleaneractionwidget.cpp \ - settingactionwidget.cpp \ +# settingactionwidget.cpp \ boxactionwidget.cpp \ toolwidget.cpp \ bottomcontentwidget.cpp \ @@ -72,7 +76,7 @@ SOURCES += main.cpp\ ../component/systembutton.cpp \ ../component/kylintitlebar.cpp \ ../component/threadpool.cpp \ - homepage.cpp \ +# homepage.cpp \ ../info/infounitwidget.cpp \ ../info/infogui.cpp \ ../info/infoitemline.cpp \ @@ -96,7 +100,7 @@ SOURCES += main.cpp\ ../component/agentlistitem.cpp \ ../component/quibo.cpp \ ../component/kylinfontdialog.cpp \ - skincenter.cpp \ +# skincenter.cpp \ ../component/kylinlistwidgetitem.cpp \ ../component/kylinlistwidget.cpp \ ../component/loadinglabel.cpp \ @@ -109,7 +113,7 @@ SOURCES += main.cpp\ ../dbusproxy/youkersystemdbus.cpp \ ../dbusproxy/youkersessiondbus.cpp \ ../info/devicemanager.cpp \ - ../component/settingaction.cpp \ +# ../component/settingaction.cpp \ kthread.cpp \ aboutdialog.cpp \ ../cleaner/cleanlistwidget.cpp \ @@ -121,7 +125,7 @@ SOURCES += main.cpp\ ../component/cleansubbutton.cpp \ ../component/cardwidget.cpp \ ../component/itemcard.cpp \ - upgradedialog.cpp \ +# upgradedialog.cpp \ ../component/normalwidget.cpp \ ../component/normalcard.cpp \ shadowwidget.cpp \ @@ -134,15 +138,19 @@ SOURCES += main.cpp\ HEADERS += mainwindow.h \ kpplication.h \ + maintopwidget.h \ + middlewidget.h \ + mainbottomwidget.h \ + topbasewidget.h \ titlewidget.h \ actionwidget.h \ - homeactionwidget.h \ +# homeactionwidget.h \ infoactionwidget.h \ cleaneractionwidget.h \ - settingactionwidget.h \ +# settingactionwidget.h \ boxactionwidget.h \ toolwidget.h \ - loginwidget.h \ +# loginwidget.h \ bottomcontentwidget.h \ infowidget.h \ cleanerwidget.h \ @@ -160,7 +168,7 @@ HEADERS += mainwindow.h \ ../component/systembutton.h \ ../component/kylintitlebar.h \ ../component/threadpool.h \ - homepage.h \ +# homepage.h \ ../info/infounitwidget.h \ ../info/infogui.h \ ../info/infoitemline.h \ @@ -185,7 +193,7 @@ HEADERS += mainwindow.h \ ../component/agentlistitem.h \ ../component/quibo.h \ ../component/kylinfontdialog.h \ - skincenter.h \ +# skincenter.h \ ../component/kylinlistwidgetitem.h \ ../component/kylinlistwidget.h \ ../component/loadinglabel.h \ @@ -198,7 +206,7 @@ HEADERS += mainwindow.h \ ../dbusproxy/youkersystemdbus.h \ ../dbusproxy/youkersessiondbus.h \ ../info/devicemanager.h \ - ../component/settingaction.h \ +# ../component/settingaction.h \ kthread.h \ aboutdialog.h \ ../cleaner/cleanlistwidget.h \ @@ -210,7 +218,7 @@ HEADERS += mainwindow.h \ ../component/cleansubbutton.h \ ../component/cardwidget.h \ ../component/itemcard.h \ - upgradedialog.h \ +# upgradedialog.h \ ../component/normalwidget.h \ ../component/normalcard.h \ shadowwidget.h \ diff --git a/src/topbasewidget.cpp b/src/topbasewidget.cpp new file mode 100644 index 0000000..5cc3d61 --- /dev/null +++ b/src/topbasewidget.cpp @@ -0,0 +1,328 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#include "topbasewidget.h" +#include "mainwindow.h" + +#include +#include +#include +#include +#include +#include +#include + + +// enum SettingModuleID{ +// ThemePage = 0, +// IconPage, +// MousePage, +// SoundPage, +// PanelPage, +// MenuPage, +// WindowPage, +// FontPage, +// TouchPadPage, +// EnergyPage, +// FMPage +// }; + +namespace { +//const QMap titleMap() +//{ +// QMap m; +// m.insert(SettingAction::ThemePage, "a"); +// m.insert(SettingAction::IconPage, "b"); +// m.insert(SettingAction::MousePage, "c"); +// m.insert(SettingAction::SoundPage, "d"); +// return m; +//} + +//int filterTitleAccordModuleName(SettingAction::SettingModuleID id) +//{ +// return titleMap().value(id); +//} + +const QMap titleMap() +{ + QMap tMap; + tMap.insert("ThemePage", QObject::tr("Choose the theme what you want")); + tMap.insert("IconPage", QObject::tr("Set the desktop icon theme and the visibility of desktop icons")); + tMap.insert("MousePage", QObject::tr("Replace the theme and size of the mouse pointer, and theme change need to restart system")); + tMap.insert("SoundPage", QObject::tr("Set the sound theme you want")); + tMap.insert("PanelPage", QObject::tr("Setting the panel mode of auto hide and icon size")); + tMap.insert("MenuPage", QObject::tr("Manage display of the start menu")); + tMap.insert("WindowPage", QObject::tr("Window Manager settings")); + tMap.insert("FontPage", QObject::tr("According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings")); + tMap.insert("TouchPadPage", QObject::tr("Setting the relevant properties of your touchpad,make the operation more convenient")); + tMap.insert("EnergyPage", QObject::tr("Save energy to let the computer longer standby time")); + tMap.insert("FMPage", QObject::tr("Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked")); + + return tMap; +} + +QString filterTitleAccordModuleName(QString moduleName) +{ + return titleMap().value(moduleName); +} + +} + +TopBaseWidget::TopBaseWidget(QWidget *parent) + : QWidget(parent) +{ + m_titileMessage = ""; + + this->setFixedSize(900, 150); + this->setAutoFillBackground(true); +// this->setObjectName("transparentWidget"); + + this->initWidgets(); +} + +TopBaseWidget::~TopBaseWidget() +{ + if(img_label != NULL) { + delete img_label; + img_label = NULL; + } + if(suggest_label != NULL) { + delete suggest_label; + suggest_label = NULL; + } + + delete back_button; + + //Segmentation fault + QLayoutItem *child; + while ((child = m_titleLeftLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_titleRightLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_toolLeftLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_toolRightLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_topLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + while ((child = m_bottomLayout->takeAt(0)) != 0) { + if (child->widget()) + child->widget()->deleteLater(); + delete child; + } + delete m_layout; +} + +void TopBaseWidget::setTipMessage(const QString &message) +{ + this->m_titileMessage = message; + + suggest_label->setText(message); +} + +void TopBaseWidget::setImage(const QString &pic) +{ + QPixmap label_pixmap(pic); + img_label->setPixmap(label_pixmap); + img_label->setFixedSize(label_pixmap.size()); +} + +//QString TopBaseWidget::getModuleName() /*const*/ +//{ +// return this->m_moduleName; +//} + +//void SettingAction::setModuleName(const QString &name) +//void TopBaseWidget::setModuleName(QString name) +//{ +//// this->m_moduleName = name; +//// back_button->setVisible(true); +//// const QString title = filterTitleAccordModuleName(name); +//// if (title.isEmpty() || title.isNull()) { +//// suggest_label->setText(tr("There may be a mistake.")); +//// } +//// else { +//// suggest_label->setText(title); +//// } +//} + +//void SettingActionWidget::displayActionSubPage(SettingAction::SettingModuleID moduleId) +void TopBaseWidget::displayActionSubPage(QString moduleName) +{ +// this->m_moduleName = moduleName; + back_button->setVisible(true); + + const QString title = filterTitleAccordModuleName(moduleName); + if (title.isEmpty() || title.isNull()) { + suggest_label->setText(tr("There may be a mistake.")); + } + else { + suggest_label->setText(title); + } +} + +void TopBaseWidget::initTitlebarLeftContent() +{ + QWidget *w = new QWidget; + m_titleLeftLayout = new QHBoxLayout(w); + m_titleLeftLayout->setContentsMargins(6, 0, 0, 0); + m_titleLeftLayout->setSpacing(0); + + QLabel *appLabel = new QLabel; + appLabel->setStyleSheet("QLabel{background-color:transparent;color:#ffffff; font-size:12px;}"); + appLabel->setText(tr("Kylin Assistant")); + m_titleLeftLayout->addWidget(appLabel); + + m_topLayout->addWidget(w, 1, Qt::AlignLeft); +} + +void TopBaseWidget::initTitlebarRightContent() +{ + QWidget *w = new QWidget; + m_titleRightLayout = new QHBoxLayout(w); + m_titleRightLayout->setContentsMargins(0, 0, 1, 0); + m_titleRightLayout->setSpacing(0); + + m_topLayout->addWidget(w, 1, Qt::AlignRight); + + SystemButton *min_button = new SystemButton(); + SystemButton *close_button = new SystemButton(); +// SystemButton *skin_button = new SystemButton(); + SystemButton *main_menu_button = new SystemButton(); + min_button->loadPixmap(":/sys/res/sysBtn/min_button.png"); + close_button->loadPixmap(":/sys/res/sysBtn/close_button.png"); +// skin_button->loadPixmap(":/sys/res/sysBtn/skin_button.png"); + main_menu_button->loadPixmap(":/sys/res/sysBtn/main_menu.png"); + min_button->setFocusPolicy(Qt::NoFocus); + close_button->setFocusPolicy(Qt::NoFocus); +// skin_button->setFocusPolicy(Qt::NoFocus); + main_menu_button->setFocusPolicy(Qt::NoFocus); + + m_titleRightLayout->addWidget(main_menu_button); +// m_titleRightLayout->addWidget(skin_button); + m_titleRightLayout->addWidget(min_button); + m_titleRightLayout->addWidget(close_button); + + connect(main_menu_button, &SystemButton::clicked, this, [=] { + emit this->showMenu(); + }); +// connect(skin_button, &SystemButton::clicked, this, [=] { +// emit this->showSkinCenter(); +// }); + connect(min_button, &SystemButton::clicked, this, [=] { + emit this->showMin(); + }); + connect(close_button, &SystemButton::clicked, this, [=] { + emit this->closeApp();//window()->close(); + }); +} + +void TopBaseWidget::initContentLeftContent() +{ + QWidget *w = new QWidget; + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); + m_toolLeftLayout = new QHBoxLayout(w); + m_toolLeftLayout->setContentsMargins(0, 0, 0, 0); + + img_label = new QLabel(); + suggest_label = new QLabel(); + + img_label->setScaledContents(true);//自动缩放,显示图像大小自动调整为Qlabel大小 + + suggest_label->setObjectName("whiteLabel"); + suggest_label->setWordWrap(true);//QLabel自动换行 + suggest_label->setFixedWidth(550); + + m_toolLeftLayout->setSpacing(10); + m_toolLeftLayout->addStretch(); + m_toolLeftLayout->addWidget(img_label, 0, Qt::AlignHCenter); + m_toolLeftLayout->addWidget(suggest_label, 0, Qt::AlignHCenter); + m_toolLeftLayout->addStretch(); + +// m_bottomLayout->addWidget(w); + m_bottomLayout->addWidget(w, 1, Qt::AlignLeft); +} + +void TopBaseWidget::initActionRightContent() +{ + QWidget *w = new QWidget; + m_toolRightLayout = new QHBoxLayout(w); + m_toolRightLayout->setContentsMargins(0, 3, 0, 10); + m_toolRightLayout->setSpacing(0); + + back_button = new QPushButton(); + back_button->setCursor(Qt::PointingHandCursor); + back_button->setFixedSize(91,39); + back_button->setFocusPolicy(Qt::NoFocus); + QPixmap pixmap("://res/back-arrow.png"); + back_button->setIcon(pixmap); + back_button->setIconSize(pixmap.size()); + back_button->setObjectName("backgroundButton"); + back_button->setText(tr("Back")); + back_button->setVisible(false); + connect(back_button, &QPushButton::clicked, this, [=] { + suggest_label->setText(this->m_titileMessage); + back_button->setVisible(false); + emit this->notifyContentPageToMain(); + }); + + m_toolRightLayout->addWidget(back_button); + m_bottomLayout->addWidget(w, 1, Qt::AlignRight); +} + +void TopBaseWidget::initWidgets() +{ + m_layout = new QVBoxLayout(this); + m_layout->setContentsMargins(0, 0, 0, 0); + m_layout->setSpacing(0); + + QWidget *topWidget = new QWidget; + m_topLayout = new QHBoxLayout(topWidget); + m_topLayout->setContentsMargins(0, 0, 0, 0); + m_topLayout->setSpacing(0); + m_layout->addWidget(topWidget, 0, Qt::AlignTop); + + QWidget *bottomWidget = new QWidget; + m_bottomLayout = new QHBoxLayout(bottomWidget); + m_bottomLayout->setContentsMargins(19, 0, 0, 26); + m_bottomLayout->setSpacing(0); + m_layout->addWidget(bottomWidget, 0, Qt::AlignBottom); + + this->setLayout(m_layout); + + initTitlebarLeftContent(); + initTitlebarRightContent(); + initContentLeftContent(); + initActionRightContent(); +} diff --git a/src/topbasewidget.h b/src/topbasewidget.h new file mode 100644 index 0000000..ca3cff4 --- /dev/null +++ b/src/topbasewidget.h @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2013 ~ 2015 National University of Defense Technology(NUDT) & Kylin Ltd. + * + * Authors: + * Kobe Lee xiangli@ubuntukylin.com/kobe24_lixiang@126.com + * + * 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; version 3. + * + * 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, see . + */ + +#ifndef TOPBASEWIDGET_H +#define TOPBASEWIDGET_H + +#include +#include +#include +#include +#include +#include +#include +#include "../component/kylinbutton.h" +#include "../component/systembutton.h" + +class TopBaseWidget : public QWidget +{ + Q_OBJECT +public: + explicit TopBaseWidget(QWidget *parent = 0); + ~TopBaseWidget(); + + void setTipMessage(const QString &message); + void setImage(const QString &pic); + + void initTitlebarLeftContent(); + void initTitlebarRightContent(); + void initContentLeftContent(); + void initActionRightContent(); + void initWidgets(); + + +// QString getModuleName() const; +// void setModuleName(const QString &name); + QString getModuleName(); +// void setModuleName(QString name); + +// SettingModuleID getModuleNameID() const; +// void setModuleNameID(const SettingModuleID &id); + +public slots: + void displayActionSubPage(QString moduleName); + +signals: + void notifyContentPageToMain(); + void showMenu(); + void showSkinCenter(); + void showMin(); + void closeApp(); + +private: + QLabel *img_label = nullptr; + QLabel *suggest_label = nullptr; + QPushButton *back_button = nullptr; + + QString desktop; +// QString m_moduleName; +// SettingModuleID m_id; + QString m_titileMessage; + + QVBoxLayout *m_layout = nullptr; + QHBoxLayout *m_topLayout = nullptr; + QHBoxLayout *m_titleRightLayout = nullptr; + QHBoxLayout *m_bottomLayout = nullptr; + QHBoxLayout *m_titleLeftLayout = nullptr; + QHBoxLayout *m_toolLeftLayout = nullptr; + QHBoxLayout *m_toolRightLayout = nullptr; +}; + +#endif // TOPBASEWIDGET_H diff --git a/src/translation/kylin-assistant_de.ts b/src/translation/kylin-assistant_de.ts index e28bb6c..f12edc7 100644 --- a/src/translation/kylin-assistant_de.ts +++ b/src/translation/kylin-assistant_de.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -58,45 +58,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - AutoStartWidget - - - AutoStart Items: - - - - - App - - - - - Status - - - - - ON Items: - - - - - OFF Items: - - - - - - Boot Manager - - - - - Dialog - - - BoxActionWidget @@ -794,7 +755,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> FileSystemDialog - + Refresh @@ -906,237 +867,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - HomeActionWidget - - - - The lastest cleanup time is - - - - - - The lastest scan time is - - - - - You have not implemented the one key scan and clean-up operation. - - - - - Quick clean up system trash, saving disk space and improving the system efficiency! - - - - - Start Scan - - - - - Start Cleanup - - - - - Back - - - - - - Scanning...... - - - - - Scanning: - - - - - Scan Over - - - - - - - history trace; - - - - - - browser cookies. - - - - - - browser cookies; - - - - - - - - garbage. - - - - - history trace. - - - - - No garbage. - - - - - Cleaning...... - - - - - Garbage Cleanup OK...... - - - - - History Cleanup OK...... - - - - - Cookies Cleanup OK...... - - - - - Cleanup Cookies: - - - - - ; Garbage: - - - - - ; Historical records: - - - - - Cleaning up history trace of Firefox... - - - - - Firefox history trace had been cleared! - - - - - Cleaning up history trace of Chromium... - - - - - Chromium history trace had been cleared! - - - - - Cleaning up Cookies of Firefox... - - - - - Firefox Cookies had been cleared! - - - - - Cleaning up Cookies of Chromium... - - - - - Chromium Cookies had been cleared! - - - - - Apt cache had been cleared! - - - - - Cleaning up Apt cache: - - - - - Software Center cache had been cleared! - - - - - Cleaning up Software Center cache: - - - - - Ready to Cleanup...... - - - - - HomePage - - - Current Version Number - - - - - Update to the lastest version, make it work better - - - - - updating on the backend - - - - - Common toolbox - - - - - Fast and practical, making the system more personalized - - - - - Upgrade is complete - - - - - Updating on the backend - - - IconWidget @@ -1419,25 +1149,381 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - LoginWidget + MainBottomWidget - - Login Kylin Account + + Current Version Number - - Logout + + Update to the lastest version, make it work better + + + + + updating on the backend + + + + + Common toolbox + + + + + Fast and practical, making the system more personalized + + + + + Upgrade is complete + + + + + Updating on the backend + + + + + MainTopWidget + + + + The lastest cleanup time is + + + + + + The lastest scan time is + + + + + You have not implemented the one key scan and clean-up operation. + + + + + Kylin Assistant + + + + + Start Scan + + + + + Start Cleanup + + + + + Back + + + + + + Scanning...... + + + + + Quick clean up system trash, saving disk space and improving the system efficiency! + + + + + Scan Over + + + + + Regular cleaning, let your computer remains the relaxed state + + + + + Clean OK + + + + + Cleaning: + + + + + , Percent is: + + + + + %, Status is: + + + + + Clean Firefox history...... + + + + + Clean Chromium history...... + + + + + Clean system history...... + + + + + Clean apt...... + + + + + Start clean apt...... + + + + + Clean Firefox Cookie: + + + + + Clean Chromium Cookie: + + + + + + does not exist + + + + + Chromium Browser is running...... + + + + + Cache Scan OK + + + + + Cookies Scan OK + + + + + History Scan OK + + + + + Packages Scan OK + + + + + + Scaning...... + + + + + Error: + + + + + Firefox Browser does not be installed + + + + + Chromium Browser does not be installed + + + + + Chromium Browser is running + + + + + Scanning: + + + + + + + history trace; + + + + + + browser cookies. + + + + + + browser cookies; + + + + + + + + garbage. + + + + + history trace. + + + + + No garbage. + + + + + Cleaning...... + + + + + Garbage Cleanup OK...... + + + + + History Cleanup OK...... + + + + + Cookies Cleanup OK...... + + + + + Cleanup Cookies: + + + + + ; Garbage: + + + + + ; Historical records: + + + + + Cleaning up history trace of Firefox... + + + + + Firefox history trace had been cleared! + + + + + Cleaning up history trace of Chromium... + + + + + Chromium history trace had been cleared! + + + + + Cleaning up Cookies of Firefox... + + + + + Firefox Cookies had been cleared! + + + + + Cleaning up Cookies of Chromium... + + + + + Chromium Cookies had been cleared! + + + + + Apt cache had been cleared! + + + + + Cleaning up Apt cache: + + + + + Software Center cache had been cleared! + + + + + Cleaning up Software Center cache: + + + + + + Ready to Cleanup...... MainWindow - + Kylin Assistant + + + Understand hardware information, provide more convenient channel to obtain hardware information + + + + + You can perform a full range of customized systems based on personal preferences + + + + + Provide a practical and lightweight tool, create fast and convenient experience for you + + MemoryCircle @@ -1531,6 +1617,34 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> + + MiddleWidget + + + Home + + + + + Cleanup + + + + + Sysinfo + + + + + Feature + + + + + Toolkits + + + MonitorTitleWidget @@ -1554,12 +1668,12 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - + Cancel - + Enter the relevant info of process @@ -1891,107 +2005,107 @@ Are you sure to continue? QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low - + Choose the theme what you want - + Set the desktop icon theme and the visibility of desktop icons - + Replace the theme and size of the mouse pointer, and theme change need to restart system - + Set the sound theme you want - + Setting the panel mode of auto hide and icon size - + Manage display of the start menu - + Window Manager settings - + According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings - + Setting the relevant properties of your touchpad,make the operation more convenient - + Save energy to let the computer longer standby time - + Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked @@ -2787,27 +2901,6 @@ Are you sure to continue? - - SettingAction - - - Back - - - - - There may be a mistake. - - - - - SettingActionWidget - - - You can perform a full range of customized systems based on personal preferences - - - ShredDialog @@ -2862,35 +2955,6 @@ Are you sure to continue? - - SkinCenter - - - - Skin Setting - - - - - Default - - - - - Custom - - - - - Open File - - - - - Files(*.png *.jpg) - - - SoundWidget @@ -2938,13 +3002,13 @@ Are you sure to continue? StartupWorker - + No name - - + + No description @@ -3006,6 +3070,24 @@ Are you sure to continue? + + TopBaseWidget + + + There may be a mistake. + + + + + Kylin Assistant + + + + + Back + + + TouchpadWidget @@ -3054,123 +3136,6 @@ Are you sure to continue? - - UpgradeDialog - - - check and update - - - - - - Current verison: - - - - - Official version - - - - - An error occurred! - - - - - Network or local sources anomaly - - - - - you can visit the<a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK official website</a> to download the lastest deb package - - - - - Retry - - - - - Finish - - - - - Upgrade - - - - - - Start to update the local sources - - - - - Start to download - - - - - Updating local sources... - - - - - Start to install - - - - - Download completely - - - - - Local sources updated - - - - - Found a new version - - - - - New version: - - - - - - Not found - - - - - - Testing network and local sources... - - - - - Kylin Assistant is the latest version - - - - - Upgrading the main program... - - - - - Start to upgrade the main program - - - WindowWidget diff --git a/src/translation/kylin-assistant_es.ts b/src/translation/kylin-assistant_es.ts index 316a26b..d9ea395 100644 --- a/src/translation/kylin-assistant_es.ts +++ b/src/translation/kylin-assistant_es.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -58,45 +58,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - AutoStartWidget - - - AutoStart Items: - - - - - App - - - - - Status - - - - - ON Items: - - - - - OFF Items: - - - - - - Boot Manager - - - - - Dialog - - - BoxActionWidget @@ -794,7 +755,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> FileSystemDialog - + Refresh @@ -906,237 +867,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - HomeActionWidget - - - - The lastest cleanup time is - - - - - - The lastest scan time is - - - - - You have not implemented the one key scan and clean-up operation. - - - - - Quick clean up system trash, saving disk space and improving the system efficiency! - - - - - Start Scan - - - - - Start Cleanup - - - - - Back - - - - - - Scanning...... - - - - - Scanning: - - - - - Scan Over - - - - - - - history trace; - - - - - - browser cookies. - - - - - - browser cookies; - - - - - - - - garbage. - - - - - history trace. - - - - - No garbage. - - - - - Cleaning...... - - - - - Garbage Cleanup OK...... - - - - - History Cleanup OK...... - - - - - Cookies Cleanup OK...... - - - - - Cleanup Cookies: - - - - - ; Garbage: - - - - - ; Historical records: - - - - - Cleaning up history trace of Firefox... - - - - - Firefox history trace had been cleared! - - - - - Cleaning up history trace of Chromium... - - - - - Chromium history trace had been cleared! - - - - - Cleaning up Cookies of Firefox... - - - - - Firefox Cookies had been cleared! - - - - - Cleaning up Cookies of Chromium... - - - - - Chromium Cookies had been cleared! - - - - - Apt cache had been cleared! - - - - - Cleaning up Apt cache: - - - - - Software Center cache had been cleared! - - - - - Cleaning up Software Center cache: - - - - - Ready to Cleanup...... - - - - - HomePage - - - Current Version Number - - - - - Update to the lastest version, make it work better - - - - - updating on the backend - - - - - Common toolbox - - - - - Fast and practical, making the system more personalized - - - - - Upgrade is complete - - - - - Updating on the backend - - - IconWidget @@ -1419,25 +1149,381 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - LoginWidget + MainBottomWidget - - Login Kylin Account + + Current Version Number - - Logout + + Update to the lastest version, make it work better + + + + + updating on the backend + + + + + Common toolbox + + + + + Fast and practical, making the system more personalized + + + + + Upgrade is complete + + + + + Updating on the backend + + + + + MainTopWidget + + + + The lastest cleanup time is + + + + + + The lastest scan time is + + + + + You have not implemented the one key scan and clean-up operation. + + + + + Kylin Assistant + + + + + Start Scan + + + + + Start Cleanup + + + + + Back + + + + + + Scanning...... + + + + + Quick clean up system trash, saving disk space and improving the system efficiency! + + + + + Scan Over + + + + + Regular cleaning, let your computer remains the relaxed state + + + + + Clean OK + + + + + Cleaning: + + + + + , Percent is: + + + + + %, Status is: + + + + + Clean Firefox history...... + + + + + Clean Chromium history...... + + + + + Clean system history...... + + + + + Clean apt...... + + + + + Start clean apt...... + + + + + Clean Firefox Cookie: + + + + + Clean Chromium Cookie: + + + + + + does not exist + + + + + Chromium Browser is running...... + + + + + Cache Scan OK + + + + + Cookies Scan OK + + + + + History Scan OK + + + + + Packages Scan OK + + + + + + Scaning...... + + + + + Error: + + + + + Firefox Browser does not be installed + + + + + Chromium Browser does not be installed + + + + + Chromium Browser is running + + + + + Scanning: + + + + + + + history trace; + + + + + + browser cookies. + + + + + + browser cookies; + + + + + + + + garbage. + + + + + history trace. + + + + + No garbage. + + + + + Cleaning...... + + + + + Garbage Cleanup OK...... + + + + + History Cleanup OK...... + + + + + Cookies Cleanup OK...... + + + + + Cleanup Cookies: + + + + + ; Garbage: + + + + + ; Historical records: + + + + + Cleaning up history trace of Firefox... + + + + + Firefox history trace had been cleared! + + + + + Cleaning up history trace of Chromium... + + + + + Chromium history trace had been cleared! + + + + + Cleaning up Cookies of Firefox... + + + + + Firefox Cookies had been cleared! + + + + + Cleaning up Cookies of Chromium... + + + + + Chromium Cookies had been cleared! + + + + + Apt cache had been cleared! + + + + + Cleaning up Apt cache: + + + + + Software Center cache had been cleared! + + + + + Cleaning up Software Center cache: + + + + + + Ready to Cleanup...... MainWindow - + Kylin Assistant + + + Understand hardware information, provide more convenient channel to obtain hardware information + + + + + You can perform a full range of customized systems based on personal preferences + + + + + Provide a practical and lightweight tool, create fast and convenient experience for you + + MemoryCircle @@ -1531,6 +1617,34 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> + + MiddleWidget + + + Home + + + + + Cleanup + + + + + Sysinfo + + + + + Feature + + + + + Toolkits + + + MonitorTitleWidget @@ -1554,12 +1668,12 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - + Cancel - + Enter the relevant info of process @@ -1891,107 +2005,107 @@ Are you sure to continue? QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low - + Choose the theme what you want - + Set the desktop icon theme and the visibility of desktop icons - + Replace the theme and size of the mouse pointer, and theme change need to restart system - + Set the sound theme you want - + Setting the panel mode of auto hide and icon size - + Manage display of the start menu - + Window Manager settings - + According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings - + Setting the relevant properties of your touchpad,make the operation more convenient - + Save energy to let the computer longer standby time - + Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked @@ -2787,27 +2901,6 @@ Are you sure to continue? - - SettingAction - - - Back - - - - - There may be a mistake. - - - - - SettingActionWidget - - - You can perform a full range of customized systems based on personal preferences - - - ShredDialog @@ -2862,35 +2955,6 @@ Are you sure to continue? - - SkinCenter - - - - Skin Setting - - - - - Default - - - - - Custom - - - - - Open File - - - - - Files(*.png *.jpg) - - - SoundWidget @@ -2938,13 +3002,13 @@ Are you sure to continue? StartupWorker - + No name - - + + No description @@ -3006,6 +3070,24 @@ Are you sure to continue? + + TopBaseWidget + + + There may be a mistake. + + + + + Kylin Assistant + + + + + Back + + + TouchpadWidget @@ -3054,123 +3136,6 @@ Are you sure to continue? - - UpgradeDialog - - - check and update - - - - - - Current verison: - - - - - Official version - - - - - An error occurred! - - - - - Network or local sources anomaly - - - - - you can visit the<a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK official website</a> to download the lastest deb package - - - - - Retry - - - - - Finish - - - - - Upgrade - - - - - - Start to update the local sources - - - - - Start to download - - - - - Updating local sources... - - - - - Start to install - - - - - Download completely - - - - - Local sources updated - - - - - Found a new version - - - - - New version: - - - - - - Not found - - - - - - Testing network and local sources... - - - - - Kylin Assistant is the latest version - - - - - Upgrading the main program... - - - - - Start to upgrade the main program - - - WindowWidget diff --git a/src/translation/kylin-assistant_fr.ts b/src/translation/kylin-assistant_fr.ts index 2cdab40..2779ac4 100644 --- a/src/translation/kylin-assistant_fr.ts +++ b/src/translation/kylin-assistant_fr.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -58,45 +58,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - AutoStartWidget - - - AutoStart Items: - - - - - App - - - - - Status - - - - - ON Items: - - - - - OFF Items: - - - - - - Boot Manager - - - - - Dialog - - - BoxActionWidget @@ -794,7 +755,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> FileSystemDialog - + Refresh @@ -906,237 +867,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - HomeActionWidget - - - - The lastest cleanup time is - - - - - - The lastest scan time is - - - - - You have not implemented the one key scan and clean-up operation. - - - - - Quick clean up system trash, saving disk space and improving the system efficiency! - - - - - Start Scan - - - - - Start Cleanup - - - - - Back - - - - - - Scanning...... - - - - - Scanning: - - - - - Scan Over - - - - - - - history trace; - - - - - - browser cookies. - - - - - - browser cookies; - - - - - - - - garbage. - - - - - history trace. - - - - - No garbage. - - - - - Cleaning...... - - - - - Garbage Cleanup OK...... - - - - - History Cleanup OK...... - - - - - Cookies Cleanup OK...... - - - - - Cleanup Cookies: - - - - - ; Garbage: - - - - - ; Historical records: - - - - - Cleaning up history trace of Firefox... - - - - - Firefox history trace had been cleared! - - - - - Cleaning up history trace of Chromium... - - - - - Chromium history trace had been cleared! - - - - - Cleaning up Cookies of Firefox... - - - - - Firefox Cookies had been cleared! - - - - - Cleaning up Cookies of Chromium... - - - - - Chromium Cookies had been cleared! - - - - - Apt cache had been cleared! - - - - - Cleaning up Apt cache: - - - - - Software Center cache had been cleared! - - - - - Cleaning up Software Center cache: - - - - - Ready to Cleanup...... - - - - - HomePage - - - Current Version Number - - - - - Update to the lastest version, make it work better - - - - - updating on the backend - - - - - Common toolbox - - - - - Fast and practical, making the system more personalized - - - - - Upgrade is complete - - - - - Updating on the backend - - - IconWidget @@ -1419,25 +1149,381 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - LoginWidget + MainBottomWidget - - Login Kylin Account + + Current Version Number - - Logout + + Update to the lastest version, make it work better + + + + + updating on the backend + + + + + Common toolbox + + + + + Fast and practical, making the system more personalized + + + + + Upgrade is complete + + + + + Updating on the backend + + + + + MainTopWidget + + + + The lastest cleanup time is + + + + + + The lastest scan time is + + + + + You have not implemented the one key scan and clean-up operation. + + + + + Kylin Assistant + + + + + Start Scan + + + + + Start Cleanup + + + + + Back + + + + + + Scanning...... + + + + + Quick clean up system trash, saving disk space and improving the system efficiency! + + + + + Scan Over + + + + + Regular cleaning, let your computer remains the relaxed state + + + + + Clean OK + + + + + Cleaning: + + + + + , Percent is: + + + + + %, Status is: + + + + + Clean Firefox history...... + + + + + Clean Chromium history...... + + + + + Clean system history...... + + + + + Clean apt...... + + + + + Start clean apt...... + + + + + Clean Firefox Cookie: + + + + + Clean Chromium Cookie: + + + + + + does not exist + + + + + Chromium Browser is running...... + + + + + Cache Scan OK + + + + + Cookies Scan OK + + + + + History Scan OK + + + + + Packages Scan OK + + + + + + Scaning...... + + + + + Error: + + + + + Firefox Browser does not be installed + + + + + Chromium Browser does not be installed + + + + + Chromium Browser is running + + + + + Scanning: + + + + + + + history trace; + + + + + + browser cookies. + + + + + + browser cookies; + + + + + + + + garbage. + + + + + history trace. + + + + + No garbage. + + + + + Cleaning...... + + + + + Garbage Cleanup OK...... + + + + + History Cleanup OK...... + + + + + Cookies Cleanup OK...... + + + + + Cleanup Cookies: + + + + + ; Garbage: + + + + + ; Historical records: + + + + + Cleaning up history trace of Firefox... + + + + + Firefox history trace had been cleared! + + + + + Cleaning up history trace of Chromium... + + + + + Chromium history trace had been cleared! + + + + + Cleaning up Cookies of Firefox... + + + + + Firefox Cookies had been cleared! + + + + + Cleaning up Cookies of Chromium... + + + + + Chromium Cookies had been cleared! + + + + + Apt cache had been cleared! + + + + + Cleaning up Apt cache: + + + + + Software Center cache had been cleared! + + + + + Cleaning up Software Center cache: + + + + + + Ready to Cleanup...... MainWindow - + Kylin Assistant + + + Understand hardware information, provide more convenient channel to obtain hardware information + + + + + You can perform a full range of customized systems based on personal preferences + + + + + Provide a practical and lightweight tool, create fast and convenient experience for you + + MemoryCircle @@ -1531,6 +1617,34 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> + + MiddleWidget + + + Home + + + + + Cleanup + + + + + Sysinfo + + + + + Feature + + + + + Toolkits + + + MonitorTitleWidget @@ -1554,12 +1668,12 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - + Cancel - + Enter the relevant info of process @@ -1891,107 +2005,107 @@ Are you sure to continue? QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low - + Choose the theme what you want - + Set the desktop icon theme and the visibility of desktop icons - + Replace the theme and size of the mouse pointer, and theme change need to restart system - + Set the sound theme you want - + Setting the panel mode of auto hide and icon size - + Manage display of the start menu - + Window Manager settings - + According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings - + Setting the relevant properties of your touchpad,make the operation more convenient - + Save energy to let the computer longer standby time - + Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked @@ -2787,27 +2901,6 @@ Are you sure to continue? - - SettingAction - - - Back - - - - - There may be a mistake. - - - - - SettingActionWidget - - - You can perform a full range of customized systems based on personal preferences - - - ShredDialog @@ -2862,35 +2955,6 @@ Are you sure to continue? - - SkinCenter - - - - Skin Setting - - - - - Default - - - - - Custom - - - - - Open File - - - - - Files(*.png *.jpg) - - - SoundWidget @@ -2938,13 +3002,13 @@ Are you sure to continue? StartupWorker - + No name - - + + No description @@ -3006,6 +3070,24 @@ Are you sure to continue? + + TopBaseWidget + + + There may be a mistake. + + + + + Kylin Assistant + + + + + Back + + + TouchpadWidget @@ -3054,123 +3136,6 @@ Are you sure to continue? - - UpgradeDialog - - - check and update - - - - - - Current verison: - - - - - Official version - - - - - An error occurred! - - - - - Network or local sources anomaly - - - - - you can visit the<a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK official website</a> to download the lastest deb package - - - - - Retry - - - - - Finish - - - - - Upgrade - - - - - - Start to update the local sources - - - - - Start to download - - - - - Updating local sources... - - - - - Start to install - - - - - Download completely - - - - - Local sources updated - - - - - Found a new version - - - - - New version: - - - - - - Not found - - - - - - Testing network and local sources... - - - - - Kylin Assistant is the latest version - - - - - Upgrading the main program... - - - - - Start to upgrade the main program - - - WindowWidget diff --git a/src/translation/kylin-assistant_ru.ts b/src/translation/kylin-assistant_ru.ts index e2ff42d..3ec7a83 100644 --- a/src/translation/kylin-assistant_ru.ts +++ b/src/translation/kylin-assistant_ru.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -58,45 +58,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - AutoStartWidget - - - AutoStart Items: - - - - - App - - - - - Status - - - - - ON Items: - - - - - OFF Items: - - - - - - Boot Manager - - - - - Dialog - - - BoxActionWidget @@ -794,7 +755,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> FileSystemDialog - + Refresh @@ -906,237 +867,6 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - - HomeActionWidget - - - - The lastest cleanup time is - - - - - - The lastest scan time is - - - - - You have not implemented the one key scan and clean-up operation. - - - - - Quick clean up system trash, saving disk space and improving the system efficiency! - - - - - Start Scan - - - - - Start Cleanup - - - - - Back - - - - - - Scanning...... - - - - - Scanning: - - - - - Scan Over - - - - - - - history trace; - - - - - - browser cookies. - - - - - - browser cookies; - - - - - - - - garbage. - - - - - history trace. - - - - - No garbage. - - - - - Cleaning...... - - - - - Garbage Cleanup OK...... - - - - - History Cleanup OK...... - - - - - Cookies Cleanup OK...... - - - - - Cleanup Cookies: - - - - - ; Garbage: - - - - - ; Historical records: - - - - - Cleaning up history trace of Firefox... - - - - - Firefox history trace had been cleared! - - - - - Cleaning up history trace of Chromium... - - - - - Chromium history trace had been cleared! - - - - - Cleaning up Cookies of Firefox... - - - - - Firefox Cookies had been cleared! - - - - - Cleaning up Cookies of Chromium... - - - - - Chromium Cookies had been cleared! - - - - - Apt cache had been cleared! - - - - - Cleaning up Apt cache: - - - - - Software Center cache had been cleared! - - - - - Cleaning up Software Center cache: - - - - - Ready to Cleanup...... - - - - - HomePage - - - Current Version Number - - - - - Update to the lastest version, make it work better - - - - - updating on the backend - - - - - Common toolbox - - - - - Fast and practical, making the system more personalized - - - - - Upgrade is complete - - - - - Updating on the backend - - - IconWidget @@ -1419,25 +1149,381 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - LoginWidget + MainBottomWidget - - Login Kylin Account + + Current Version Number - - Logout + + Update to the lastest version, make it work better + + + + + updating on the backend + + + + + Common toolbox + + + + + Fast and practical, making the system more personalized + + + + + Upgrade is complete + + + + + Updating on the backend + + + + + MainTopWidget + + + + The lastest cleanup time is + + + + + + The lastest scan time is + + + + + You have not implemented the one key scan and clean-up operation. + + + + + Kylin Assistant + + + + + Start Scan + + + + + Start Cleanup + + + + + Back + + + + + + Scanning...... + + + + + Quick clean up system trash, saving disk space and improving the system efficiency! + + + + + Scan Over + + + + + Regular cleaning, let your computer remains the relaxed state + + + + + Clean OK + + + + + Cleaning: + + + + + , Percent is: + + + + + %, Status is: + + + + + Clean Firefox history...... + + + + + Clean Chromium history...... + + + + + Clean system history...... + + + + + Clean apt...... + + + + + Start clean apt...... + + + + + Clean Firefox Cookie: + + + + + Clean Chromium Cookie: + + + + + + does not exist + + + + + Chromium Browser is running...... + + + + + Cache Scan OK + + + + + Cookies Scan OK + + + + + History Scan OK + + + + + Packages Scan OK + + + + + + Scaning...... + + + + + Error: + + + + + Firefox Browser does not be installed + + + + + Chromium Browser does not be installed + + + + + Chromium Browser is running + + + + + Scanning: + + + + + + + history trace; + + + + + + browser cookies. + + + + + + browser cookies; + + + + + + + + garbage. + + + + + history trace. + + + + + No garbage. + + + + + Cleaning...... + + + + + Garbage Cleanup OK...... + + + + + History Cleanup OK...... + + + + + Cookies Cleanup OK...... + + + + + Cleanup Cookies: + + + + + ; Garbage: + + + + + ; Historical records: + + + + + Cleaning up history trace of Firefox... + + + + + Firefox history trace had been cleared! + + + + + Cleaning up history trace of Chromium... + + + + + Chromium history trace had been cleared! + + + + + Cleaning up Cookies of Firefox... + + + + + Firefox Cookies had been cleared! + + + + + Cleaning up Cookies of Chromium... + + + + + Chromium Cookies had been cleared! + + + + + Apt cache had been cleared! + + + + + Cleaning up Apt cache: + + + + + Software Center cache had been cleared! + + + + + Cleaning up Software Center cache: + + + + + + Ready to Cleanup...... MainWindow - + Kylin Assistant + + + Understand hardware information, provide more convenient channel to obtain hardware information + + + + + You can perform a full range of customized systems based on personal preferences + + + + + Provide a practical and lightweight tool, create fast and convenient experience for you + + MemoryCircle @@ -1531,6 +1617,34 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> + + MiddleWidget + + + Home + + + + + Cleanup + + + + + Sysinfo + + + + + Feature + + + + + Toolkits + + + MonitorTitleWidget @@ -1554,12 +1668,12 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> - + Cancel - + Enter the relevant info of process @@ -1891,107 +2005,107 @@ Are you sure to continue? QObject - + Running - + Stopped - + Zombie - + Uninterruptible - + Sleeping - + Very High - + High - + Normal - + Low - + Very Low - + Choose the theme what you want - + Set the desktop icon theme and the visibility of desktop icons - + Replace the theme and size of the mouse pointer, and theme change need to restart system - + Set the sound theme you want - + Setting the panel mode of auto hide and icon size - + Manage display of the start menu - + Window Manager settings - + According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings - + Setting the relevant properties of your touchpad,make the operation more convenient - + Save energy to let the computer longer standby time - + Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked @@ -2787,27 +2901,6 @@ Are you sure to continue? - - SettingAction - - - Back - - - - - There may be a mistake. - - - - - SettingActionWidget - - - You can perform a full range of customized systems based on personal preferences - - - ShredDialog @@ -2862,35 +2955,6 @@ Are you sure to continue? - - SkinCenter - - - - Skin Setting - - - - - Default - - - - - Custom - - - - - Open File - - - - - Files(*.png *.jpg) - - - SoundWidget @@ -2938,13 +3002,13 @@ Are you sure to continue? StartupWorker - + No name - - + + No description @@ -3006,6 +3070,24 @@ Are you sure to continue? + + TopBaseWidget + + + There may be a mistake. + + + + + Kylin Assistant + + + + + Back + + + TouchpadWidget @@ -3054,123 +3136,6 @@ Are you sure to continue? - - UpgradeDialog - - - check and update - - - - - - Current verison: - - - - - Official version - - - - - An error occurred! - - - - - Network or local sources anomaly - - - - - you can visit the<a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK official website</a> to download the lastest deb package - - - - - Retry - - - - - Finish - - - - - Upgrade - - - - - - Start to update the local sources - - - - - Start to download - - - - - Updating local sources... - - - - - Start to install - - - - - Download completely - - - - - Local sources updated - - - - - Found a new version - - - - - New version: - - - - - - Not found - - - - - - Testing network and local sources... - - - - - Kylin Assistant is the latest version - - - - - Upgrading the main program... - - - - - Start to upgrade the main program - - - WindowWidget diff --git a/src/translation/kylin-assistant_zh_CN.qm b/src/translation/kylin-assistant_zh_CN.qm index 38c1ff7..7c1f8be 100644 Binary files a/src/translation/kylin-assistant_zh_CN.qm and b/src/translation/kylin-assistant_zh_CN.qm differ diff --git a/src/translation/kylin-assistant_zh_CN.ts b/src/translation/kylin-assistant_zh_CN.ts index 719b784..c08fe35 100644 --- a/src/translation/kylin-assistant_zh_CN.ts +++ b/src/translation/kylin-assistant_zh_CN.ts @@ -1,6 +1,6 @@ - + AboutDialog @@ -65,64 +65,52 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> AudioWidget Audio Info - 声卡信息 + 声卡信息 Audio Info %1 - 声卡信息%1 + 声卡信息%1 AutoStartWidget - AutoStart Items: - 自启动选项: + 自启动选项: - App - 应用程序 + 应用程序 - Status - 状态 + 状态 - ON Items: - 已开启数目: + 已开启数目: - OFF Items: - 已关闭数目: + 已关闭数目: - - Boot Manager - 启动项管理 - - - - Dialog - + 启动项管理 BatteryWidget Battery Info - 电池信息 + 电池信息 BoardWidget Board Info - 主板信息 + 主板信息 @@ -148,7 +136,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> Boot Manager - 启动项管理 + 启动项管理 Camera @@ -159,11 +147,11 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> CDRowWidget CDROM Info - 光驱信息 + 光驱信息 CDROM Info %1 - 光驱信息 %1 + 光驱信息 %1 @@ -598,11 +586,11 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> ComputerPage Minutes - 分钟 + 分钟 Hours - 小时 + 小时 %1 cores @@ -610,589 +598,589 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> Audio Model - 声卡型号 + 声卡型号 Vendor - 制造商 + 制造商 Bus Address - 总线地址 + 总线地址 Audio Driver - 声卡驱动 + 声卡驱动 Device Name - 设备名 + 设备名 Manufacturer - 发行商 + 发行商 Model - 型号 + 型号 Technology - 技术 + 技术 Voltage - 电压 + 电压 Energy Designed - 能量(设计) + 能量(设计) Energy Full - 满时能量 + 满时能量 Energy Now - 能量 + 能量 Serial Number - 序列号 + 序列号 Motherboard Model - 主板型号 + 主板型号 Motherboard Vendor - 主板产商 + 主板产商 BIOS Vendor - BIOS产商 + BIOS产商 BIOS Version - BIOS版本 + BIOS版本 Release Date - 发布日期 + 发布日期 CD-ROM Model - 光驱型号 + 光驱型号 Firmware Version - 固件版本 + 固件版本 CPU - 处理器 + 处理器 Socket/Slot - 插座/插槽 + 插座/插槽 Maximum Frequency - 最大主频 + 最大主频 Current Frequency - 当前主频 + 当前主频 FSB - 前端总线 + 前端总线 Core Number - 核心数目 + 核心数目 Thread - 线程 + 线程 L1 Cache - 1级缓存 + 1级缓存 L2 Cache - 2级缓存 + 2级缓存 phytium - 飞腾 + 飞腾 4 cores - 4核 + 4核 4 thread/core - 4线程/核 + 4线程/核 Desktop Environment - 桌面环境 + 桌面环境 Host Name - 主机名 + 主机名 Memery Capacity - 内存容量 + 内存容量 Terminal - 用户命令解释器 + 用户命令解释器 32bit - 32位 + 32位 64bit - 64位 + 64位 YHKylin community - 银河麒麟社区版 + 银河麒麟社区版 Memory reference voltage - 内存参考电压 + 内存参考电压 SATA controller voltage - SATA控制器电压 + SATA控制器电压 Memory voltage - 内存电压 + 内存电压 CPU pin voltage - CPU管脚电压 + CPU管脚电压 Bridge voltage - 桥片电压 + 桥片电压 CPU core voltage - CPU核电压 + CPU核电压 CPU temperature - CPU温度 + CPU温度 Motherboard temperature - 主板温度 + 主板温度 CPU fan speed - CPU风扇转速 + CPU风扇转速 %1 64bit - %1 64位 + %1 64位 %1 - %1 + %1 Ondemand - 自动调频 + 自动调频 Powersave - 省电模式 + 省电模式 Performance - 性能模式 + 性能模式 CPU FM mode - CPU调频模式 + CPU调频模式 Distribution - 发行版 + 发行版 Language - 语言 + 语言 User - 用户 + 用户 Home Folder - 用户主目录 + 用户主目录 Host bridge - 主桥 + 主桥 VGA Model - VGA兼容控制器 + VGA兼容控制器 USB Model - USB控制器 + USB控制器 Communication Model - 通信控制器 + 通信控制器 Ethernet Model - 以太网控制器 + 以太网控制器 PCI bridge - PCI桥 + PCI桥 ISA bridge - ISA桥 + ISA桥 SATA Model - SATA控制器 + SATA控制器 SMBus - 系统管理总线 + 系统管理总线 System peripheral - 系统外围 + 系统外围 Driver in use - 使用的驱动 + 使用的驱动 existing drivers - 可选的驱动 + 可选的驱动 IDE interface - IDE接口 + IDE接口 SP controller - 信号处理控制器 + 信号处理控制器 Network controller - 网络控制器 + 网络控制器 Multimedia audio controller - 多媒体音频控制器 + 多媒体音频控制器 HDD Model - 硬盘型号 + 硬盘型号 HDD Vendor - 硬盘厂商 + 硬盘厂商 HDD Capacity - 硬盘容量 + 硬盘容量 Slot Number - 插槽号 + 插槽号 Memory Model - 内存型号 + 内存型号 Memory Size - 内存大小 + 内存大小 Data Width - 数据宽度 + 数据宽度 Memory Info - 内存条信息 + 内存条信息 Graphics Card Model - 显卡型号 + 显卡型号 Current Graphics Card - 当前显卡 + 当前显卡 Graphics Card Vendor - 显卡制造商 + 显卡制造商 Graphics Driver - 显卡驱动 + 显卡驱动 Gamma - 伽马值 + 伽马值 Screen Size(inch) - 屏幕尺寸(英寸) + 屏幕尺寸(英寸) Max Resolution - 最大分辨率 + 最大分辨率 Current Interface - 当前接口 + 当前接口 Monitor Model - 显示器型号 + 显示器型号 Visual Area - 可视面积 + 可视面积 Support Interface - 支持接口 + 支持接口 Monitor Manufacturers - 显示器制造商 + 显示器制造商 Date of production/Week - 生产日期/周 + 生产日期/周 Date of production/Year - 生产日期/年 + 生产日期/年 NIC Model - 网卡型号 + 网卡型号 NIC Driver - 网卡驱动 + 网卡驱动 IP Address - IP地址 + IP地址 Mac Address - MAC地址 + MAC地址 Connection Status - 连接状态 + 连接状态 Max Bandwidth - 最大带宽 + 最大带宽 WLan NIC Driver - 无线网卡驱动 + 无线网卡驱动 WLan NIC Model - 网卡型号 + 网卡型号 Device Name: - 设备名称: + 设备名称: VNIC - 虚拟网卡 + 虚拟网卡 NetType - 网卡类型 + 网卡类型 Ethernet interface - 以太网接口 + 以太网接口 Wireless interface - 无线网接口 + 无线网接口 Version - 电脑版本 + 电脑版本 Hostname - 主机名 + 主机名 Running Time - 持续运行时间 + 持续运行时间 OS Types - 操作系统类型 + 操作系统类型 OS Version - 操作系统版本 + 操作系统版本 Kernel Bit - 系统位数 + 系统位数 Kernel Version - 内核版本 + 内核版本 Kernel Arch - 内核架构 + 内核架构 ConserveWidget Adjust gamma - 调整伽马值 + 调整伽马值 Adjust brightness - 调整屏幕亮度 + 调整屏幕亮度 Time before session is considered idle - 在此时间范围内无操作则关闭屏幕 + 在此时间范围内无操作则关闭屏幕 Lock screen - 锁定屏幕 + 锁定屏幕 Lock delay - 锁定延时 + 锁定延时 Battery critical low action - 电池严重不足时 + 电池严重不足时 Laptop lid close action on battery - 使用电池合上盖子时 + 使用电池合上盖子时 Laptop lid close action on AC - 使用电源合上盖子时 + 使用电源合上盖子时 Sleep timeout PC when on battery - 使用电池,空闲此时间后电脑转入睡眠 + 使用电池,空闲此时间后电脑转入睡眠 Sleep timeout PC when on AC - 使用电源,空闲此时间后电脑转入睡眠 + 使用电源,空闲此时间后电脑转入睡眠 Sleep timeout display when on battery - 使用电池,空闲此时间后屏幕转入睡眠 + 使用电池,空闲此时间后屏幕转入睡眠 Sleep timeout display when on AC - 使用电源,空闲此时间后屏幕转入睡眠 + 使用电源,空闲此时间后屏幕转入睡眠 suspend - 挂起 + 挂起 shutdown - 电源关闭 + 电源关闭 nothing - 不处理 + 不处理 1 minute - 1 分钟 + 1 分钟 2 minutes - 2 分钟 + 2 分钟 3 minutes - 3 分钟 + 3 分钟 5 minutes - 5 分钟 + 5 分钟 10 minutes - 10 分钟 + 10 分钟 Half an hour - 半小时 + 半小时 1 hour - 1 小时 + 1 小时 never - 从不 + 从不 30 seconds - 30 秒 + 30 秒 Turn off the screen - 关闭屏幕 + 关闭屏幕 20 minutes - 20 分钟 + 20 分钟 2 hours - 2 小时 + 2 小时 CpuOccupancyRate CPU - 处理器 + 处理器 @@ -1227,21 +1215,21 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> CpuWidget CPU Info - 处理器信息 + 处理器信息 DesktopWidget Desktop Info - 桌面环境信息 + 桌面环境信息 DriverWidget Driver Info - 驱动信息 + 驱动信息 @@ -1479,7 +1467,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> FileSystemDialog - + Refresh 刷新 @@ -1595,254 +1583,201 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> HDWidget HardWare Info - 硬盘信息 + 硬盘信息 HardWare Info %1 - 硬盘信息 %1 + 硬盘信息 %1 HomeActionWidget - - The lastest cleanup time is - 上一次清理时间是 + 上一次清理时间是 - - The lastest scan time is - 上一次扫描时间是 + 上一次扫描时间是 - You have not implemented the one key scan and clean-up operation. - 您还没有执行过一键扫描和一键清理操作。 + 您还没有执行过一键扫描和一键清理操作。 - Quick clean up system trash, saving disk space and improving the system efficiency! - 一键清理系统垃圾,帮您节省磁盘空间,让系统运行更加有效率! + 一键清理系统垃圾,帮您节省磁盘空间,让系统运行更加有效率! - Start Scan - 开始扫描 + 开始扫描 - Start Cleanup - 开始清理 + 开始清理 - Back - 返回 + 返回 - - Scanning...... - 正在扫描..... + 正在扫描..... - Scanning: - 正在扫描: + 正在扫描: - Scan Over - 扫描完成 + 扫描完成 - - - history trace; - 条历史痕迹; + 条历史痕迹; - - browser cookies. - 条浏览器Cookies。 + 条浏览器Cookies。 - - browser cookies; - 条浏览器Cookies; + 条浏览器Cookies; - - - - garbage. - 垃圾。 + 垃圾。 - history trace. - 条历史痕迹。 + 条历史痕迹。 - No garbage. - 没有扫描到垃圾。 + 没有扫描到垃圾。 - Cleaning...... - 正在清理....... + 正在清理....... - Garbage Cleanup OK...... - 垃圾清理完成...... + 垃圾清理完成...... - History Cleanup OK...... - 历史记录清理完成...... + 历史记录清理完成...... - Cookies Cleanup OK...... - Cookies清理完成...... + Cookies清理完成...... - Cleanup Cookies: - 清理了Cookies: + 清理了Cookies: - ; Garbage: - ;垃圾: + ;垃圾: - ; Historical records: - ;历史记录: + ;历史记录: - Cleaning up history trace of Firefox... - 正在清理Firefox浏览器的历史痕迹...... + 正在清理Firefox浏览器的历史痕迹...... - Firefox history trace had been cleared! - Firefox浏览器历史痕迹清理完成! + Firefox浏览器历史痕迹清理完成! - Cleaning up history trace of Chromium... - 正在清理Chromium浏览器的历史痕迹...... + 正在清理Chromium浏览器的历史痕迹...... - Chromium history trace had been cleared! - Chromium浏览器的历史痕迹清理完成! + Chromium浏览器的历史痕迹清理完成! - Cleaning up Cookies of Firefox... - 正在清理Firefox浏览器的Cookies...... + 正在清理Firefox浏览器的Cookies...... - Firefox Cookies had been cleared! - Firefox浏览器的Cookies清理完成! + Firefox浏览器的Cookies清理完成! - Cleaning up Cookies of Chromium... - 正在清理Chromium浏览器的Cookies...... + 正在清理Chromium浏览器的Cookies...... - Chromium Cookies had been cleared! - Chromium浏览器的Cookies清理完成! + Chromium浏览器的Cookies清理完成! - Apt cache had been cleared! - Apt缓存清理完成! + Apt缓存清理完成! - Cleaning up Apt cache: - 正在清理Apt缓存: + 正在清理Apt缓存: - Software Center cache had been cleared! - 软件中心缓存清理完成! + 软件中心缓存清理完成! - Cleaning up Software Center cache: - 正在清理软件中心缓存: + 正在清理软件中心缓存: - Ready to Cleanup...... - 准备清理...... + 准备清理...... HomePage Boot Manager - 启动项管理 + 启动项管理 Camera 摄像头 - Current Version Number - 当前版本号 + 当前版本号 - Update to the lastest version, make it work better - 更新至最新版本,使软件更好用 + 更新至最新版本,使软件更好用 - updating on the backend - 正在后台升级 + 正在后台升级 - Upgrade is complete - 升级完成 + 升级完成 - Updating on the backend - 正在后台升级 + 正在后台升级 - Common toolbox - 工具箱 + 工具箱 - Fast and practical, making the system more personalized - 更快更好,让系统更具个性化 + 更快更好,让系统更具个性化 More - 更多 + 更多 @@ -2015,7 +1950,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> CD-ROM - 光驱 + 光驱 @@ -2135,68 +2070,435 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> LauncherWidget Launcher icon size - 启动器图标尺寸 + 启动器图标尺寸 Launcher hide mode - 启动器自动隐藏 + 启动器自动隐藏 Display desktop icon - 显示桌面图标 + 显示桌面图标 Launcher Transparency - 启动器透明度 + 启动器透明度 Icon Background - 图标背景 + 图标背景 Top panel icon size - 顶部面板图标大小 + 顶部面板图标大小 Top panel auto hide - 顶部面板自动隐藏 + 顶部面板自动隐藏 Bottom panel icon size - 底部面板图标大小 + 底部面板图标大小 Bottom panel auto hide - 底部面板自动隐藏 + 底部面板自动隐藏 Launcher position - 启动器位置 + 启动器位置 LoginWidget - Login Kylin Account - 登录麒麟帐号 + 登录麒麟帐号 - Logout - 注销 + 注销 + + + + MainBottomWidget + + + Current Version Number + 当前版本号 + + + + Update to the lastest version, make it work better + 更新至最新版本,使软件更好用 + + + + updating on the backend + 正在后台升级 + + + + Common toolbox + 工具箱 + + + + Fast and practical, making the system more personalized + 更快更好,让系统更具个性化 + + + + Upgrade is complete + 升级完成 + + + + Updating on the backend + 正在后台升级 + + + + MainTopWidget + + + + The lastest cleanup time is + 上一次清理时间是 + + + + + The lastest scan time is + 上一次扫描时间是 + + + + You have not implemented the one key scan and clean-up operation. + 您还没有执行过一键扫描和一键清理操作。 + + + + Kylin Assistant + 麒麟助手 + + + + Start Scan + 开始扫描 + + + + Start Cleanup + 开始清理 + + + + Back + 返回 + + + + + Scanning...... + 正在扫描..... + + + + Quick clean up system trash, saving disk space and improving the system efficiency! + 一键清理系统垃圾,帮您节省磁盘空间,让系统运行更加有效率! + + + + Scan Over + 扫描完成 + + + + Regular cleaning, let your computer remains the relaxed state + 经常清理,让电脑保持最轻松的状态 + + + + Clean OK + 清理完毕 + + + + Cleaning: + 正在清理: + + + + , Percent is: + ,进度为: + + + + %, Status is: + %,状态为: + + + + Clean Firefox history...... + 清理Firefox浏览器历史记录...... + + + + Clean Chromium history...... + 清理Chromium浏览器历史记录...... + + + + Clean system history...... + 清理系统历史痕迹...... + + + + Clean apt...... + 清理Apt...... + + + + Start clean apt...... + 开始清理Apt...... + + + + Clean Firefox Cookie: + 清理Firefox浏览器Cookie: + + + + Clean Chromium Cookie: + 清理Chromium浏览器Cookie: + + + + + does not exist + 不存在 + + + + Chromium Browser is running...... + Chromium浏览器正在运行中...... + + + + Cache Scan OK + 缓存扫描完成 + + + + Cookies Scan OK + Cookies扫描完成 + + + + History Scan OK + 历史记录扫描完成 + + + + Packages Scan OK + 包扫描完成 + + + + + Scaning...... + 正在扫描..... + + + + Error: + 错误: + + + + Firefox Browser does not be installed + 没有安装Firefox浏览器 + + + + Chromium Browser does not be installed + 没有安装Chromium浏览器 + + + + Chromium Browser is running + Chromium浏览器正在运行中 + + + + Scanning: + 正在扫描: + + + + + + history trace; + 条历史痕迹; + + + + + browser cookies. + 条浏览器Cookies。 + + + + + browser cookies; + 条浏览器Cookies; + + + + + + + garbage. + 垃圾。 + + + + history trace. + 条历史痕迹。 + + + + No garbage. + 没有扫描到垃圾。 + + + + Cleaning...... + 正在清理....... + + + + Garbage Cleanup OK...... + 垃圾清理完成...... + + + + History Cleanup OK...... + 历史记录清理完成...... + + + + Cookies Cleanup OK...... + Cookies清理完成...... + + + + Cleanup Cookies: + 清理了Cookies: + + + + ; Garbage: + ;垃圾: + + + + ; Historical records: + ;历史记录: + + + + Cleaning up history trace of Firefox... + 正在清理Firefox浏览器的历史痕迹...... + + + + Firefox history trace had been cleared! + Firefox浏览器历史痕迹清理完成! + + + + Cleaning up history trace of Chromium... + 正在清理Chromium浏览器的历史痕迹...... + + + + Chromium history trace had been cleared! + Chromium浏览器的历史痕迹清理完成! + + + + Cleaning up Cookies of Firefox... + 正在清理Firefox浏览器的Cookies...... + + + + Firefox Cookies had been cleared! + Firefox浏览器的Cookies清理完成! + + + + Cleaning up Cookies of Chromium... + 正在清理Chromium浏览器的Cookies...... + + + + Chromium Cookies had been cleared! + Chromium浏览器的Cookies清理完成! + + + + Apt cache had been cleared! + Apt缓存清理完成! + + + + Cleaning up Apt cache: + 正在清理Apt缓存: + + + + Software Center cache had been cleared! + 软件中心缓存清理完成! + + + + Cleaning up Software Center cache: + 正在清理软件中心缓存: + + + + + Ready to Cleanup...... + 准备清理...... MainWindow - + Kylin Assistant 麒麟助手 + + + Understand hardware information, provide more convenient channel to obtain hardware information + 了解电脑硬件详细信息,为用户提供更加方便的获取硬件信息渠道 + + + + You can perform a full range of customized systems based on personal preferences + 您可以根据个人喜好对系统进行全方位的定制 + + + + Provide a practical and lightweight tool, create fast and convenient experience for you + 提供轻巧使用工具,为您打造快捷方便的体验 + Youker Assistant - 优客助手 + 优客助手 @@ -2235,11 +2537,11 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> MemoryWidget Memory Info - 内存条信息 + 内存条信息 Memory Info %1 - 内存信息 %1 + 内存信息 %1 @@ -2248,7 +2550,7 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> Used %1(%2), Total %3 - 已使用 %1(%2), 共 %3 + 已使用 %1(%2), 共 %3 @@ -2304,6 +2606,34 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> 启动器位置 + + MiddleWidget + + + Home + 麒麟首页 + + + + Cleanup + 系统清理 + + + + Sysinfo + 系统信息 + + + + Feature + 系统美化 + + + + Toolkits + 功能大全 + + MonitorTitleWidget @@ -2327,12 +2657,12 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> 文件系统 - + Cancel 取消 - + Enter the relevant info of process 输入进程相关信息 @@ -2341,11 +2671,11 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> MonitorWidget Monitor Info - 显示器和显卡信息 + 显示器和显卡信息 Monitor Info %1 - 显示器和显卡信息 %1 + 显示器和显卡信息 %1 @@ -2375,38 +2705,38 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> NautilusWidget Display entry location - 路径输入框取代路径栏 + 路径输入框取代路径栏 Automatically mount media - 自动挂载媒体 + 自动挂载媒体 Automatically open a folder - 自动打开文件夹 + 自动打开文件夹 Prompt autorun programs - 提示自动运行的程序 + 提示自动运行的程序 Thumbnail icon size (pixels) - 缩略图图标尺寸(像素) + 缩略图图标尺寸(像素) Thumbnail cache time (days) - 缩略图缓存时间(天数) + 缩略图缓存时间(天数) Maximum thumbnail cache size (MB) - 最大缩略图缓存尺寸(MB) + 最大缩略图缓存尺寸(MB) NetworkFlow Network - 网络 + 网络 @@ -2451,11 +2781,11 @@ Kylin Team <ubuntukylin-members@list.launchpad.net> NicWidget NIC Info - 网卡信息 + 网卡信息 NIC Info %1 - 网卡信息 %1 + 网卡信息 %1 @@ -2615,31 +2945,31 @@ Are you sure to continue? Very High - 非常高 + 非常高 High - + Normal - 普通 + 普通 Low - + Very Low - 非常低 + 非常低 Custom - 自定义 + 自定义 Change Priority - 改变优先级 + 改变优先级 @@ -2744,23 +3074,23 @@ Are you sure to continue? PropertiesDialog User name - 用户 + 用户 Process name - 进程名 + 进程名 Command line - 命令行 + 命令行 CPU Time - CPU 时间 + CPU 时间 Started Time - 开始于 + 开始于 @@ -2772,110 +3102,110 @@ Are you sure to continue? QObject kylin-assistant had already running! - 麒麟助手运行中 + 麒麟助手运行中 - + Running 运行中 - + Stopped 已停止 - + Zombie 僵死 - + Uninterruptible 不可中断 - + Sleeping 睡眠中 - + Very High 非常高 - + High - + Normal 普通 - + Low - + Very Low 非常低 - + Choose the theme what you want 选择您需要的主题 - + Set the desktop icon theme and the visibility of desktop icons 设置桌面图标主题和桌面图标的可见性 - + Replace the theme and size of the mouse pointer, and theme change need to restart system 更换鼠标指针主题和大小,主题更改需要重启系统才能生效 - + Set the sound theme you want 设置您需要的声音主题 - + Setting the panel mode of auto hide and icon size 设置面板自动隐藏模式和面板图标大小 - + Manage display of the start menu 管理启动菜单的显示 - + Window Manager settings 窗口管理器设置 - + According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings 根据个人喜好设置系统默认字体,单击"恢复默认"按钮,可以将对应的字体恢复到设置前状态 - + Setting the relevant properties of your touchpad,make the operation more convenient 通过调整您触摸板的相关设置,使操作更加便捷 - + Save energy to let the computer longer standby time 节省电量,让电脑待机时间更长 - + Manage the file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked 管理文件管理器。注意:如果缩略图缓存时间或尺寸被设置为-1,缩略图将不会被清理 @@ -3515,19 +3845,19 @@ Are you sure to continue? bits - + bits/s - 位/秒 + 位/秒 bit - + bit/s - 位/秒 + 位/秒 @@ -3691,167 +4021,164 @@ Are you sure to continue? SensorWieget Hardware sensor information - 硬件传感检测信息 + 硬件传感检测信息 SettingAction - Back - 返回 + 返回 - There may be a mistake. - 可能发生了错误。 + 可能发生了错误。 Choose the theme what you want - 选择您需要的主题 + 选择您需要的主题 Set the desktop icon theme and the visibility of desktop icons - 设置桌面图标主题和桌面图标的可见性 + 设置桌面图标主题和桌面图标的可见性 Set the sound theme you want - 设置您需要的声音主题 + 设置您需要的声音主题 Replace the theme and size of the mouse pointer, and theme change need to restart system - 更换鼠标指针主题和大小,主题更改需要重启系统才能生效 + 更换鼠标指针主题和大小,主题更改需要重启系统才能生效 Setting the panel mode of auto hide and icon size - 设置面板自动隐藏模式和面板图标大小 + 设置面板自动隐藏模式和面板图标大小 Setting the Launcher display mode, Icon size - 设置启动器的显示模式、图标尺寸 + 设置启动器的显示模式、图标尺寸 Manage display of the start menu - 管理启动菜单的显示 + 管理启动菜单的显示 Manage Dash and Panel menu settings - 管理Dash搜索和面板菜单的设置 + 管理Dash搜索和面板菜单的设置 Window Manager settings - 窗口管理器设置 + 窗口管理器设置 According to personal preferences to set the system default font, click the 'Restore' button, can be restored to the state before the font settings - 根据个人喜好设置系统默认字体,单击"恢复默认"按钮,可以将对应的字体恢复到设置前状态 + 根据个人喜好设置系统默认字体,单击"恢复默认"按钮,可以将对应的字体恢复到设置前状态 Setting the relevant properties of your touchpad,make the operation more convenient - 通过调整您触摸板的相关设置,使操作更加便捷 + 通过调整您触摸板的相关设置,使操作更加便捷 Monitor Check - 坏点检测 + 坏点检测 Save energy to let the computer longer standby time - 节省电量,让电脑待机时间更长 + 节省电量,让电脑待机时间更长 Manage the Caja file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked - 管理Caja文件管理器。注意:如果缩略图缓存时间或尺寸被设置为-1,缩略图将不会被清理 + 管理Caja文件管理器。注意:如果缩略图缓存时间或尺寸被设置为-1,缩略图将不会被清理 Manage the Nautilus file manager. Tips: if the thumbnail's cache time or size is set to -1, it will not be checked - 管理Nautilus文件管理器。注意:如果缩略图缓存时间或尺寸被设置为-1,缩略图将不会被清理 + 管理Nautilus文件管理器。注意:如果缩略图缓存时间或尺寸被设置为-1,缩略图将不会被清理 SettingActionWidget - You can perform a full range of customized systems based on personal preferences - 您可以根据个人喜好对系统进行全方位的定制 + 您可以根据个人喜好对系统进行全方位的定制 SettingWidget Personalize - 个性化 + 个性化 ThemeSetting - 主题设置 + 主题设置 IconSetting - 图标设置 + 图标设置 MousePointer - 鼠标设置 + 鼠标设置 SoundEffect - 声音效果 + 声音效果 Desktop - 桌面 + 桌面 Panel - 面板 + 面板 StartMenu - 启动菜单 + 启动菜单 Custom Launcher - 自定义启动器 + 自定义启动器 Dash & Panel - 搜索和面板 + 搜索和面板 Window - 窗口 + 窗口 Font - 字体 + 字体 FontSetting - 字体设置 + 字体设置 Sys options - 系统选项 + 系统选项 Touchpad - 触摸板 + 触摸板 Dead pixel check - 坏点检测 + 坏点检测 Energy saving - 省电设置 + 省电设置 Others - 其他 + 其他 File manager - 文件管理器 + 文件管理器 @@ -3881,7 +4208,7 @@ Are you sure to continue? Allfile(*) - 所有文件(*) + 所有文件(*) @@ -3915,30 +4242,24 @@ Are you sure to continue? SkinCenter - - Skin Setting - 皮肤设置 + 皮肤设置 - Default - 默认皮肤 + 默认皮肤 - Custom - 自定义 + 自定义 - Open File - 打开文件 + 打开文件 - Files(*.png *.jpg) - 文件(*.png *.jpg) + 文件(*.png *.jpg) @@ -3968,7 +4289,7 @@ Are you sure to continue? StartupManager Kylin Startup Manager - 麒麟启动项管理器 + 麒麟启动项管理器 @@ -3992,13 +4313,13 @@ Are you sure to continue? StartupWorker - + No name 无名称 - - + + No description 无描述 @@ -4007,15 +4328,15 @@ Are you sure to continue? SystemWidget Computer Base Info - 电脑概述 + 电脑概述 Minutes - 分钟 + 分钟 Hours - 小时 + 小时 @@ -4043,26 +4364,26 @@ Are you sure to continue? TitleWidget Kylin System Monitor - 麒麟系统监视器 + 麒麟系统监视器 ToolBar Processes - 进程 + 进程 Resources - 资源 + 资源 File Systems - 文件系统 + 文件系统 Cancel - 取消 + 取消 @@ -4101,6 +4422,24 @@ Are you sure to continue? 功能大全 + + TopBaseWidget + + + There may be a mistake. + 可能发生了错误。 + + + + Kylin Assistant + 麒麟助手 + + + + Back + 返回 + + TouchpadWidget @@ -4152,137 +4491,111 @@ Are you sure to continue? UpgradeDialog - check and update - 检查更新 + 检查更新 - - Current verison: - 当前版本: + 当前版本: - Official version - 正式版 + 正式版 - An error occurred! - 出错了!无法升级 + 出错了!无法升级 - Network or local sources anomaly - 网络或源地址连接失败,升级未成功 + 网络或源地址连接失败,升级未成功 - - Testing network and local sources... - 正在检查网络和本地源... + 正在检查网络和本地源... - Retry - 重试 + 重试 - Finish - 完成 + 完成 - Upgrade - 升级 + 升级 - - Start to update the local sources - 开始更新本地源 + 开始更新本地源 - Start to download - 开始下载 + 开始下载 - Updating local sources... - 正在更新本地源... + 正在更新本地源... - Kylin Assistant is the latest version - 麒麟助手已经是最新的版本 + 麒麟助手已经是最新的版本 - Start to install - 开始安装 + 开始安装 - Download completely - 下载完成 + 下载完成 - Local sources updated - 源更新完毕 + 源更新完毕 - Found a new version - 发现新版本 + 发现新版本 - New version: - 新版本号: + 新版本号: - you can visit the<a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK official website</a> to download the lastest deb package - 您可以访问 <a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK 官网</a> 下载最新的deb包 + 您可以访问 <a style='color: #3f96e4;' href = http://www.ubuntukylin.com> UK 官网</a> 下载最新的deb包 - - Not found - 没有发现新版本 + 没有发现新版本 - Upgrading the main program... - 正在升级主程序... + 正在升级主程序... - Start to upgrade the main program - 开始升级主程序 + 开始升级主程序 VoiceWidget Sound theme - 声音主题 + 声音主题 Login tone - 登录提示音 + 登录提示音 Event sounds - 事件声音 + 事件声音 Input feedback sounds - 输入反馈声音 + 输入反馈声音 diff --git a/src/upgradedialog.cpp b/src/upgradedialog.cpp index 408d258..9338e6b 100644 --- a/src/upgradedialog.cpp +++ b/src/upgradedialog.cpp @@ -483,23 +483,23 @@ void UpgradeDialog::mousePressEvent(QMouseEvent *event) { if(event->button() == Qt::LeftButton) { - mouse_press = true; - drag_pos = event->globalPos() - this->frameGeometry().topLeft(); + m_mousePressed = true; + m_dragPosition = event->globalPos() - this->frameGeometry().topLeft(); event->accept(); } } void UpgradeDialog::mouseReleaseEvent(QMouseEvent *) { - mouse_press = false; + m_mousePressed = false; } void UpgradeDialog::mouseMoveEvent(QMouseEvent *event) { - if(mouse_press) + if(m_mousePressed) { QPoint move_pos = event->globalPos(); - move(move_pos - drag_pos); + move(move_pos - m_dragPosition); event->accept(); } } diff --git a/src/upgradedialog.h b/src/upgradedialog.h index c30793c..14fc9bf 100644 --- a/src/upgradedialog.h +++ b/src/upgradedialog.h @@ -69,8 +69,8 @@ protected: void mouseMoveEvent(QMouseEvent *event); private: - QPoint drag_pos; //移动的距离 - bool mouse_press; //按下鼠标左键 + QPoint m_dragPosition; //移动的距离 + bool m_mousePressed; //按下鼠标左键 QWidget *baseWidget; SystemButton *close_btn; QProgressBar *progressbar;