From 64f453d612c72df19a40a0864c09afabdd4384a9 Mon Sep 17 00:00:00 2001 From: zhaominyong Date: Tue, 15 Feb 2022 16:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=9F=E9=9A=8F=E4=B8=BB=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/mydefine.h | 1 - kybackup/aboutdialog.cpp | 4 +- kybackup/backuppointlistdialog.cpp | 3 +- kybackup/component/myiconbutton.cpp | 9 +- kybackup/component/mylabel.h | 2 +- kybackup/component/mywidget.cpp | 27 ++ kybackup/component/mywidget.h | 17 ++ kybackup/deletebackupdialog.cpp | 4 +- kybackup/globalbackupinfo.h | 34 ++- kybackup/gsettingswrapper.cpp | 75 +++++- kybackup/gsettingswrapper.h | 47 +++- kybackup/kybackup.pro | 2 + kybackup/leftsiderbarwidget.cpp | 28 +- kybackup/leftsiderbarwidget.h | 4 +- kybackup/main.cpp | 38 +-- kybackup/maindialog.cpp | 57 +++- kybackup/messageboxutils.cpp | 27 +- kybackup/messageboxutils.h | 1 + kybackup/module/databackup.cpp | 12 +- kybackup/module/datarestore.cpp | 2 +- kybackup/module/ghostimage.cpp | 2 +- kybackup/module/managebackuppointlist.cpp | 2 +- kybackup/module/operationlog.cpp | 1 + kybackup/module/selectrestorepoint.cpp | 2 +- kybackup/module/systembackup.cpp | 2 +- kybackup/module/systemrestore.cpp | 10 +- kybackup/qt_zh_CN.ts | 302 +++++++++++----------- kybackup/resource/language/qt_zh_CN.qm | Bin 29417 -> 29593 bytes 28 files changed, 471 insertions(+), 244 deletions(-) create mode 100644 kybackup/component/mywidget.cpp create mode 100644 kybackup/component/mywidget.h diff --git a/common/mydefine.h b/common/mydefine.h index fdec964..b05f074 100755 --- a/common/mydefine.h +++ b/common/mydefine.h @@ -52,7 +52,6 @@ #define COLOR_YELLOW "#F8A34C" #define COLOR_LIGHT_BLUE "#DDEBFF" - /** * @brief 备份还原操作类型 */ diff --git a/kybackup/aboutdialog.cpp b/kybackup/aboutdialog.cpp index 5a33b4d..0a0b21c 100755 --- a/kybackup/aboutdialog.cpp +++ b/kybackup/aboutdialog.cpp @@ -30,7 +30,7 @@ AboutDialog::AboutDialog(QWidget *parent) : // 设置背景色 this->setAutoFillBackground(true); QPalette palette = this->palette(); - palette.setColor(QPalette::Background, palette.color(QPalette::Base)); + palette.setColor(QPalette::Window, palette.color(QPalette::Base)); this->setPalette(palette); this->setFixedWidth(420); @@ -55,7 +55,7 @@ AboutDialog::AboutDialog(QWidget *parent) : QLabel *backupIconLabel = new QLabel; QIcon titleIcon = QIcon::fromTheme("yhkylin-backup-tools"); backupIconLabel->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(96, 96)))); - GSettingsWrapper::connectUkuiStyleSchema(backupIconLabel, QSize(96, 96)); + g_GSettingWrapper.connectUkuiIconSchema(backupIconLabel, QSize(96, 96)); QHBoxLayout *hlayoutLine2 = new QHBoxLayout; hlayoutLine2->addStretch(); hlayoutLine2->addWidget(backupIconLabel); diff --git a/kybackup/backuppointlistdialog.cpp b/kybackup/backuppointlistdialog.cpp index b5890a8..7532803 100755 --- a/kybackup/backuppointlistdialog.cpp +++ b/kybackup/backuppointlistdialog.cpp @@ -25,7 +25,7 @@ BackupPointListDialog::BackupPointListDialog(QWidget *parent, bool isOnlyShowLoc // 设置背景色 this->setAutoFillBackground(true); QPalette palette = this->palette(); - palette.setColor(QPalette::Background, palette.color(QPalette::Base)); + palette.setColor(QPalette::Window, palette.color(QPalette::Base)); this->setPalette(palette); // 纵向布局 @@ -57,6 +57,7 @@ BackupPointListDialog::BackupPointListDialog(QWidget *parent, bool isOnlyShowLoc m_tableWidget->setSortingEnabled(false); // 等录入完数据后再排序 m_tableWidget->setAlternatingRowColors(true); m_tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_tableWidget->setShowGrid(false); vlayout->addWidget(m_tableWidget); m_bottomLayout = new QHBoxLayout; diff --git a/kybackup/component/myiconbutton.cpp b/kybackup/component/myiconbutton.cpp index da9c5c2..f2fbfd0 100755 --- a/kybackup/component/myiconbutton.cpp +++ b/kybackup/component/myiconbutton.cpp @@ -9,8 +9,10 @@ MyIconButton::MyIconButton(QWidget *parent) : QPushButton(parent) { + this->setCheckable(true); + m_iconButton = new QPushButton(this); - m_iconButton->setCheckable(false); + m_iconButton->setCheckable(true); m_iconButton->setFixedSize(QSize(24, 24)); m_iconButton->setFocusPolicy(Qt::NoFocus); m_iconButton->setFlat(true); @@ -22,7 +24,7 @@ MyIconButton::MyIconButton(QWidget *parent) : textLabelPolicy.setHorizontalPolicy(QSizePolicy::Fixed); textLabelPolicy.setVerticalPolicy(QSizePolicy::Fixed); m_textLabel->setSizePolicy(textLabelPolicy); - //m_textLabel->setScaledContents(true); + m_textLabel->setScaledContents(true); QHBoxLayout *hLayout = new QHBoxLayout(); hLayout->setContentsMargins(8, 0, 0, 0); @@ -31,7 +33,7 @@ MyIconButton::MyIconButton(QWidget *parent) : hLayout->addStretch(); setLayout(hLayout); - connect(m_iconButton, &QPushButton::clicked, this, &MyIconButton::clicked); + connect(m_iconButton, &QPushButton::clicked, this, &MyIconButton::click); // connect(this, &QPushButton::toggled, this, [=] (bool checked) { // if (checked) // m_textLabel->setStyleSheet("color:white"); @@ -61,6 +63,7 @@ void MyIconButton::setDesplayText(const QString &text) void MyIconButton::changePalette(bool checked) { + m_iconButton->setChecked(checked); QPalette pal(m_textLabel->palette()); QIcon icon = QIcon::fromTheme(m_themeIconName, QIcon(m_defaultIconName)); QPixmap pix; diff --git a/kybackup/component/mylabel.h b/kybackup/component/mylabel.h index 89c6749..3ccae98 100755 --- a/kybackup/component/mylabel.h +++ b/kybackup/component/mylabel.h @@ -12,7 +12,7 @@ public: MyLabel(const QString& text, QWidget* parent = nullptr, QColor color = QColor(0xCC, 0xCC, 0xCC)); virtual ~MyLabel(); - void setDeplayText(const QString& text) { m_text = text; QLabel::setText(text);} + void setDeplayText(const QString& text) { m_text = text; this->setText(text);} void setFontColor(QColor color); void setFontSize(int size); void setFontWordWrap(bool on); diff --git a/kybackup/component/mywidget.cpp b/kybackup/component/mywidget.cpp new file mode 100644 index 0000000..7c26caa --- /dev/null +++ b/kybackup/component/mywidget.cpp @@ -0,0 +1,27 @@ +#include "mywidget.h" +#include +#include + +MyWidget::MyWidget(QWidget *parent) : + QWidget(parent) +{} + +MyWidget::~MyWidget() +{} + +void MyWidget::paintEvent(QPaintEvent *event) +{ + Q_UNUSED(event); + QStyleOption opt; + opt.init(this); + QPainter p(this); + p.setPen(Qt::NoPen); + QColor color = palette().color(QPalette::Base); + QPalette pal(this->palette()); + pal.setColor(QPalette::Window, QColor(color)); + this->setPalette(pal); + QBrush brush = QBrush(color); + p.setBrush(brush); + p.drawRoundedRect(opt.rect,0,0); + style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); +} diff --git a/kybackup/component/mywidget.h b/kybackup/component/mywidget.h new file mode 100644 index 0000000..8fb7351 --- /dev/null +++ b/kybackup/component/mywidget.h @@ -0,0 +1,17 @@ +#ifndef MYWIDGET_H +#define MYWIDGET_H + +#include +#include + +class MyWidget : public QWidget +{ + Q_OBJECT +public: + explicit MyWidget(QWidget *parent = nullptr); + ~MyWidget(); + + void paintEvent(QPaintEvent *event); +}; + +#endif // MYWIDGET_H diff --git a/kybackup/deletebackupdialog.cpp b/kybackup/deletebackupdialog.cpp index 0e9d1a0..5889ad6 100755 --- a/kybackup/deletebackupdialog.cpp +++ b/kybackup/deletebackupdialog.cpp @@ -32,7 +32,7 @@ DeleteBackupDialog::DeleteBackupDialog(ParseBackupList::BackupPoint backupPonit, // 设置背景色 this->setAutoFillBackground(true); QPalette palette = this->palette(); - palette.setColor(QPalette::Background, palette.color(QPalette::Base)); + palette.setColor(QPalette::Window, palette.color(QPalette::Base)); this->setPalette(palette); // 设置标题栏 @@ -43,7 +43,7 @@ DeleteBackupDialog::DeleteBackupDialog(ParseBackupList::BackupPoint backupPonit, m_mTitleIcon->setFixedSize(24, 24); QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); m_mTitleIcon->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(24, 24)))); - GSettingsWrapper::connectUkuiStyleSchema(m_mTitleIcon); + g_GSettingWrapper.connectUkuiIconSchema(m_mTitleIcon); // 标题 m_titleLabel = new MyLabel; diff --git a/kybackup/globalbackupinfo.h b/kybackup/globalbackupinfo.h index 7099a5c..8811124 100755 --- a/kybackup/globalbackupinfo.h +++ b/kybackup/globalbackupinfo.h @@ -8,18 +8,32 @@ class GlobelBackupInfo : public Singleton { public: + enum BlackgroundMode { + Auto, + Light, + Dark + }; + GlobelBackupInfo(token) {} ~GlobelBackupInfo() {} // 设置是否管理员用户登录 - void setIsManager(bool isManager) { m_isManager = isManager; } + void setIsManager(bool isManager) { + m_isManager = isManager; + } // 是否管理员用户登录 - bool isManager() { return m_isManager; } + bool isManager() { + return m_isManager; + } // 设置是否以--restore参数启动的备份还原工具 - void setHasArgRestore(bool hasArg_restore) { m_hasArg_restore = hasArg_restore; } + void setHasArgRestore(bool hasArg_restore) { + m_hasArg_restore = hasArg_restore; + } // 是否以--restore参数启动的备份还原工具 - bool hasArgRestore() { return m_hasArg_restore; } + bool hasArgRestore() { + return m_hasArg_restore; + } // 设置是否正在进行备份、还原等操作 void setIsBusy(bool isBusy) { @@ -54,6 +68,16 @@ public: return m_funcType; } + // 设置主题背景模式 + void setBlackgroundMode(BlackgroundMode blackgroundMode) { + m_BlackgroundMode = blackgroundMode; + } + + // 主题背景模式 + BlackgroundMode getBlackgroundMode() { + return m_BlackgroundMode; + } + GlobalSignals * getGlobalSignals() { return &m_globalSignals; } @@ -81,6 +105,8 @@ private: FuncTypeConverter::FunType m_funcType = FuncTypeConverter::FunType::TOTALMODULES; // 是否以--restore参数启动的备份还原工具 bool m_hasArg_restore = false; + // 是否跟随主题 + BlackgroundMode m_BlackgroundMode = BlackgroundMode::Auto; // 全局信号对象 GlobalSignals m_globalSignals; diff --git a/kybackup/gsettingswrapper.cpp b/kybackup/gsettingswrapper.cpp index b760c9f..f13e564 100755 --- a/kybackup/gsettingswrapper.cpp +++ b/kybackup/gsettingswrapper.cpp @@ -5,23 +5,33 @@ #include "gsettingswrapper.h" #include #include -#include +#include "globalsignals.h" +#include "globalbackupinfo.h" +#include "../common/mydefine.h" -#define FITTHEMEWINDOW "org.ukui.style" +GSettingsWrapper::GSettingsWrapper(token) +{ + if (QGSettings::isSchemaInstalled(ORG_UKUI_STYLE)) { + m_pGsettingThemeData = new QGSettings(ORG_UKUI_STYLE); + } + m_transparency = 0.8; +} + +GSettingsWrapper::~GSettingsWrapper() +{ + delete m_pGsettingThemeData; +} /** * @brief 绑定连接UKui风格的主题 * @param QWidget *, 跟随风格变化的窗体对象指针 */ -void GSettingsWrapper::connectUkuiStyleSchema(QWidget * widgetPtr, QSize size) +void GSettingsWrapper::connectUkuiIconSchema(QWidget * widgetPtr, QSize size) { - if (widgetPtr != nullptr && QGSettings::isSchemaInstalled(FITTHEMEWINDOW)) { - // c++11后能确保多线程并发场景的局部静态对象的唯一性 - static QGSettings *pGsettingThemeData = new QGSettings(FITTHEMEWINDOW); - - QObject::connect(pGsettingThemeData, &QGSettings::changed, [=](const QString &key) { - if (key == "iconThemeName") { - QIcon titleIcon = QIcon::fromTheme("yhkylin-backup-tools"); + if (widgetPtr != nullptr && QGSettings::isSchemaInstalled(ORG_UKUI_STYLE)) { + QObject::connect(m_pGsettingThemeData, &QGSettings::changed, [=](const QString &key) { + if (key == ICON_THEME_NAME) { + QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); if (widgetPtr->inherits("QLabel")) { QLabel *labelPtr = qobject_cast(widgetPtr); const QPixmap * pixmapPtr = labelPtr->pixmap(); @@ -38,4 +48,49 @@ void GSettingsWrapper::connectUkuiStyleSchema(QWidget * widgetPtr, QSize size) } } +/** + * @brief 绑定连接UKui风格的背景颜色 + * @param widgetPtr, 跟随风格变化的窗体对象指针 + * @param light 浅色 + * @param dark 深色 + */ +void GSettingsWrapper::connectUkuiBackground(QWidget * widgetPtr, QColor light, QColor dark) +{ + if (widgetPtr != nullptr && QGSettings::isSchemaInstalled(ORG_UKUI_STYLE)) { + QObject::connect(m_pGsettingThemeData, &QGSettings::changed, [=](const QString &key) { + // 主题变更 + if (key == STYLE_NAME) { + widgetPtr->setAutoFillBackground(true); + QPalette palette = widgetPtr->palette(); + // 只有跟随主题时,才会变化 + if (GlobelBackupInfo::BlackgroundMode::Auto == GlobelBackupInfo::inst().getBlackgroundMode()) { + QString themeStyle = this->m_pGsettingThemeData->get(STYLE_NAME).toString(); + if (STYLE_NAME_VALUE_DARK == themeStyle || STYLE_NAME_VALUE_BLACK == themeStyle) { + // 深色主题 + palette.setColor(QPalette::Window, dark); + palette.setColor(QPalette::WindowText, Qt::white); + palette.setColor(QPalette::ButtonText, Qt::white); + } else if (STYLE_NAME_VALUE_DEFAULT == themeStyle || STYLE_NAME_VALUE_LIGHT == themeStyle || STYLE_NAME_VALUE_WHITE == themeStyle) { + // 浅色主题 + palette.setColor(QPalette::Window, light); + palette.setColor(QPalette::WindowText, Qt::black); + palette.setColor(QPalette::ButtonText, Qt::black); + } + } else if (GlobelBackupInfo::BlackgroundMode::Dark == GlobelBackupInfo::inst().getBlackgroundMode()) { + // 深色主题 + palette.setColor(QPalette::Window, dark); + palette.setColor(QPalette::WindowText, Qt::white); + palette.setColor(QPalette::ButtonText, Qt::white); + } else if (GlobelBackupInfo::BlackgroundMode::Light == GlobelBackupInfo::inst().getBlackgroundMode()) { + // 浅色主题 + palette.setColor(QPalette::Window, light); + palette.setColor(QPalette::WindowText, Qt::black); + palette.setColor(QPalette::ButtonText, Qt::black); + } + widgetPtr->setPalette(palette); + } + }); + } +} + diff --git a/kybackup/gsettingswrapper.h b/kybackup/gsettingswrapper.h index 1584027..4b77676 100755 --- a/kybackup/gsettingswrapper.h +++ b/kybackup/gsettingswrapper.h @@ -3,19 +3,62 @@ #include #include +#include +#include +#include "../common/singleton.h" + class QWidget; +// 主题key +#define ORG_UKUI_STYLE "org.ukui.style" +#define STYLE_NAME "styleName" +#define STYLE_NAME_VALUE_DEFAULT "ukui-default" +#define STYLE_NAME_VALUE_DARK "ukui-dark" +#define STYLE_NAME_VALUE_BLACK "ukui-black" +#define STYLE_NAME_VALUE_LIGHT "ukui-light" +#define STYLE_NAME_VALUE_WHITE "ukui-white" +#define ICON_THEME_NAME "iconThemeName" +#define TRANSPARENCY_NAME "transparency" + +// 颜色 +// 浅灰 +#define COLOR_WINDOW_LIGHT_LEFT "#FAFAFA" +// 深灰 +#define COLOR_WINDOW_DARK_LEFT "#232426" +// #define COLOR_WINDOW_DARK_LEFT "#242424" +// 白色 +#define COLOR_WINDOW_LIGHT_RIGHT "#FFFFFF" +// 黑色 +#define COLOR_WINDOW_DARK_RIGHT "#121212" + /** * @brief 由于当前仅用于主题变化时,备份还原工具的一些图标跟随变化,此处暂时先简单封装。后续根据使用情况另行优化。 */ -class GSettingsWrapper +class GSettingsWrapper : public Singleton { public: + GSettingsWrapper(token); + virtual ~GSettingsWrapper(); /** * @brief 绑定连接UKui风格的主题 * @param QWidget *, 跟随风格变化的窗体对象指针 */ - static void connectUkuiStyleSchema(QWidget * labelPtr, QSize size = QSize(24, 24)); + void connectUkuiIconSchema(QWidget * labelPtr, QSize size = QSize(24, 24)); + + /** + * @brief 绑定连接UKui风格的背景颜色 + * @param widgetPtr, 跟随风格变化的窗体对象指针 + * @param light 浅色 + * @param dark 深色 + */ + void connectUkuiBackground(QWidget * widgetPtr, QColor light, QColor dark); + +public: + float m_transparency; + + QGSettings *m_pGsettingThemeData; }; +#define g_GSettingWrapper GSettingsWrapper::inst() + #endif // GSETTINGSWRAPPER_H diff --git a/kybackup/kybackup.pro b/kybackup/kybackup.pro index 9d17a16..ea81d26 100755 --- a/kybackup/kybackup.pro +++ b/kybackup/kybackup.pro @@ -51,6 +51,7 @@ HEADERS += \ component/mylabel.h \ component/mylineedit.h \ component/mypushbutton.h \ + component/mywidget.h \ component/ringsprogressbar.h \ deletebackupdialog.h \ functypeconverter.h \ @@ -95,6 +96,7 @@ SOURCES += \ component/mylabel.cpp \ component/mylineedit.cpp \ component/mypushbutton.cpp \ + component/mywidget.cpp \ component/ringsprogressbar.cpp \ deletebackupdialog.cpp \ functypeconverter.cpp \ diff --git a/kybackup/leftsiderbarwidget.cpp b/kybackup/leftsiderbarwidget.cpp index 95e502b..61b6cc8 100755 --- a/kybackup/leftsiderbarwidget.cpp +++ b/kybackup/leftsiderbarwidget.cpp @@ -1,11 +1,15 @@ #include "leftsiderbarwidget.h" #include -#include #include #include #include "../common/mydefine.h" #include "component/myiconbutton.h" #include "globalbackupinfo.h" +#include "gsettingswrapper.h" + +#define PERSONALSIE_SCHEMA "org.ukui.control-center.personalise" +#define PERSONALSIE_TRAN_KEY "transparency" +#define CONTAIN_PERSONALSIE_TRAN_KEY "transparency" LeftsiderbarWidget::LeftsiderbarWidget(QWidget *parent, StartMode mode) : QWidget(parent) @@ -31,6 +35,7 @@ LeftsiderbarWidget::LeftsiderbarWidget(QWidget *parent, StartMode mode) m_mTitleIcon->setFixedSize(24, 24); QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); m_mTitleIcon->setPixmap(titleIcon.pixmap(titleIcon.actualSize(QSize(24, 24)))); + g_GSettingWrapper.connectUkuiIconSchema(m_mTitleIcon); m_titleLabel->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); m_leftSideBarVLayout->addSpacing(10); @@ -77,8 +82,6 @@ LeftsiderbarWidget::LeftsiderbarWidget(QWidget *parent, StartMode mode) // "QPushButton:checked{background-color: palette(highlight);border-radius: 4px;}" // "QPushButton:!checked{border: none;}"); m_funcGroup->addButton(funcButton, type); - - m_leftSideBarVLayout->addWidget(funcButton); } @@ -91,8 +94,19 @@ LeftsiderbarWidget::LeftsiderbarWidget(QWidget *parent, StartMode mode) }); m_leftSideBarVLayout->addSpacing(8); - m_leftSideBarVLayout->addStretch(); + + m_personalQgsettings = nullptr; + if (QGSettings::isSchemaInstalled(PERSONALSIE_SCHEMA)) { + m_personalQgsettings = new QGSettings(PERSONALSIE_SCHEMA, QByteArray(), this); + m_transparency = m_personalQgsettings->get(PERSONALSIE_TRAN_KEY).toDouble(); + connect(m_personalQgsettings,&QGSettings::changed,this,[=](QString changedKey) { //监听透明度变化 + if (changedKey == CONTAIN_PERSONALSIE_TRAN_KEY) { + m_transparency = m_personalQgsettings->get(PERSONALSIE_TRAN_KEY).toDouble(); + this->repaint(); + } + }); + } } LeftsiderbarWidget::~LeftsiderbarWidget() @@ -108,11 +122,11 @@ void LeftsiderbarWidget::paintEvent(QPaintEvent *event) QPainter p(this); p.setPen(Qt::NoPen); QColor color = palette().color(QPalette::Window); - color.setAlpha(transparency); + color.setAlphaF(m_transparency); QPalette pal(this->palette()); - pal.setColor(QPalette::Window,QColor(color)); + pal.setColor(QPalette::Window, QColor(color)); this->setPalette(pal); - QBrush brush =QBrush(color); + QBrush brush = QBrush(color); p.setBrush(brush); p.drawRoundedRect(opt.rect,0,0); style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this); diff --git a/kybackup/leftsiderbarwidget.h b/kybackup/leftsiderbarwidget.h index 8cdb14d..111149b 100755 --- a/kybackup/leftsiderbarwidget.h +++ b/kybackup/leftsiderbarwidget.h @@ -7,6 +7,7 @@ #include #include #include +#include #include "functypeconverter.h" #include "component/mylabel.h" @@ -27,7 +28,8 @@ public: signals: void selected(int func_type); private: - int transparency = 0; + QGSettings *m_personalQgsettings; + qreal m_transparency = 0.8; QVBoxLayout *m_leftSideBarVLayout = nullptr; QLabel *m_mTitleIcon = nullptr; diff --git a/kybackup/main.cpp b/kybackup/main.cpp index 5bfd4bc..540ac79 100755 --- a/kybackup/main.cpp +++ b/kybackup/main.cpp @@ -8,13 +8,13 @@ #include #include #include -#include #include #include "qtsingleapplication/qtsingleapplication.h" #include "../common/utils.h" #include "xatom-helper.h" #include "globalbackupinfo.h" +#include "messageboxutils.h" // 声明 void initApp(QApplication& a); @@ -32,18 +32,15 @@ int main(int argc, char *argv[]) QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough); #endif - QtSingleApplication a ("kybackup",argc, argv); + QtSingleApplication a ("kybackup", argc, argv); initApp(a); // 当前只支持管理员用户使用备份还原工具 GlobelBackupInfo::inst().setIsManager(isManager()); if (!GlobelBackupInfo::inst().isManager() && GlobelBackupInfo::inst().hasArgRestore()) { - QMessageBox box(QMessageBox::Warning, QObject::tr("Warning"), QObject::tr("This tool can only be used by administrator.")); - box.setStandardButtons(QMessageBox::Ok); - box.setButtonText(QMessageBox::Ok, QObject::tr("Ok")); - QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); - box.setWindowIcon(titleIcon); - box.exec(); + MessageBoxUtils::QMESSAGE_BOX_WARNING(nullptr, QObject::tr("Information"), + QObject::tr("This function can only be used by administrator."), + QObject::tr("Ok")); return EXIT_FAILURE; } @@ -52,12 +49,9 @@ int main(int argc, char *argv[]) QString ack = a.sendMessage(strUid, 3000); if (strUid != ack) { - QMessageBox box(QMessageBox::Critical, QObject::tr("Error"), QObject::tr("Another user had opened kybackup, you can not start it again.")); - box.setStandardButtons(QMessageBox::Ok); - box.setButtonText(QMessageBox::Ok, QObject::tr("Ok")); - QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); - box.setWindowIcon(titleIcon); - box.exec(); + MessageBoxUtils::QMESSAGE_BOX_WARNING(nullptr, QObject::tr("Information"), + QObject::tr("Another user had opened kybackup, you can not start it again."), + QObject::tr("Ok")); } return EXIT_SUCCESS; @@ -66,22 +60,6 @@ int main(int argc, char *argv[]) MainDialog w; // 居中窗口 centerToScreen(&w); - // 窗口背景透明化;setWindowOpacity可使得窗口及其上控件都透明或半透明-w.setWindowOpacity(0.7); - w.setAttribute(Qt::WA_TranslucentBackground); - // 使得窗口无边框 - // w.setWindowFlag(Qt::FramelessWindowHint); - // 指示窗口管理器模糊给定窗口后面指定区域的背景(毛玻璃化背景),在SP1上有效,SP2上无效 - // KWindowEffects::enableBlurBehind(w.winId(), true); - // SP2上毛玻璃 - w.setProperty("useSystemStyleBlur", true); - - // 添加窗管协议 - MotifWmHints hints; - hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; - hints.functions = MWM_FUNC_ALL; - hints.decorations = MWM_DECOR_BORDER; - XAtomHelper::getInstance()->setWindowMotifHint(w.winId(), hints); - a.setWindowIcon(QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS)); a.setActivationWindow(&w, true); diff --git a/kybackup/maindialog.cpp b/kybackup/maindialog.cpp index b7e15b1..46d0d06 100755 --- a/kybackup/maindialog.cpp +++ b/kybackup/maindialog.cpp @@ -5,8 +5,9 @@ #include #include #include +#include #include - +#include "xatom-helper.h" #include "../common/mydefine.h" #include "module/systembackup.h" #include "module/systemrestore.h" @@ -18,12 +19,33 @@ #include "globalbackupinfo.h" #include "messageboxutils.h" #include "aboutdialog.h" +#include "gsettingswrapper.h" +#include "component/mywidget.h" MainDialog::MainDialog(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainDialog) { ui->setupUi(this); + // 主窗口 + this->setWindowTitle(tr("Backup & Restore")); + // 窗口背景透明化;setWindowOpacity可使得窗口及其上控件都透明或半透明-w.setWindowOpacity(0.7); + this->setAttribute(Qt::WA_TranslucentBackground); + // 使得窗口无边框 + // w.setWindowFlag(Qt::FramelessWindowHint); + // 指示窗口管理器模糊给定窗口后面指定区域的背景(毛玻璃化背景) + KWindowEffects::enableBlurBehind(this->winId(), true); + // 或使用设置毛玻璃属性的方式实现毛玻璃背景(两者都行,可使用其一) + // this->setProperty("useSystemStyleBlur", true); + // this->setAutoFillBackground(true); + + // 添加窗管协议 + MotifWmHints hints; + hints.flags = MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS; + hints.functions = MWM_FUNC_ALL; + hints.decorations = MWM_DECOR_BORDER; + XAtomHelper::getInstance()->setWindowMotifHint(this->winId(), hints); + initUI(); initConnect(); @@ -56,7 +78,7 @@ void MainDialog::initUI() m_totalHLayout->addWidget(m_leftSiderBarWidget); - m_rightWidget = new QWidget; + m_rightWidget = new MyWidget; m_rightWidget->setFixedSize(760, 640); m_rightVLayout = new QVBoxLayout; @@ -155,14 +177,23 @@ void MainDialog::initTileBar() void MainDialog::initStyleSheet() { - // 主窗口 - this->setWindowTitle(tr("Backup & Restore")); +// // 左侧菜单背景色设置 +// m_leftSiderBarWidget->setAutoFillBackground(true); +// QPalette paletteLeft = m_leftSiderBarWidget->palette(); +// QColor colorLeftSider(COLOR_WINDOW_LIGHT_LEFT); +// colorLeftSider.setAlphaF(g_GSettingWrapper.m_transparency); +// paletteLeft.setColor(QPalette::Window, colorLeftSider); +// m_leftSiderBarWidget->setPalette(paletteLeft); +// g_GSettingWrapper.connectUkuiBackground(m_leftSiderBarWidget, colorLeftSider, QColor(COLOR_WINDOW_DARK_LEFT)); - // 右侧窗口背景色设置 - m_rightWidget->setAutoFillBackground(true); - QPalette palette = m_rightWidget->palette(); - palette.setColor(QPalette::Background, palette.color(QPalette::Base)); - m_rightWidget->setPalette(palette); +// // 右侧窗口背景色设置 +// m_rightWidget->setAutoFillBackground(true); +// QPalette palette = m_rightWidget->palette(); +// QColor colorRight(palette.color(QPalette::Base)); +// colorRight.setAlphaF(g_GSettingWrapper.m_transparency); +// palette.setColor(QPalette::Window, colorRight); +// m_rightWidget->setPalette(palette); +// g_GSettingWrapper.connectUkuiBackground(m_rightWidget, colorRight, QColor(COLOR_WINDOW_DARK_RIGHT)); } void MainDialog::initConnect() @@ -266,22 +297,22 @@ void MainDialog::mountBackupPartition() reply.waitForFinished(); if (reply.isError()) { // 挂载分区时出现异常 - MessageBoxUtils::QMESSAGE_BOX_WARNING(this, QObject::tr("Warning"), + MessageBoxUtils::QMESSAGE_BOX_CRITICAL(this, QObject::tr("Warning"), QObject::tr("An exception occurred when mounting backup partition."), QObject::tr("Ok")); closeBtn(); } else if (int(MountResult::CANNOT_GET_BACKUPUUID) == reply.value()) { // 没有找到备份分区,只能备份到移动设备中 - MessageBoxUtils::QMESSAGE_BOX_WARNING(this, QObject::tr("Warning"), - QObject::tr("There's no backup partition, can only backup to removable device."), + MessageBoxUtils::QMESSAGE_BOX_WARNING(this, QObject::tr("Information"), + QObject::tr("Please check if the backup partition exists which can be created when you install the Operating System."), QObject::tr("Ok")); // GlobelBackupInfo::inst().setHasBackupPartition(false); closeBtn(); } else if (int(MountResult::MOUNTED) != reply.value()) { // 挂载备份分区失败 - MessageBoxUtils::QMESSAGE_BOX_WARNING(this, QObject::tr("Warning"), + MessageBoxUtils::QMESSAGE_BOX_CRITICAL(this, QObject::tr("Warning"), QObject::tr("Failed to mount backup partition."), QObject::tr("Ok")); diff --git a/kybackup/messageboxutils.cpp b/kybackup/messageboxutils.cpp index df1f12d..8136e41 100755 --- a/kybackup/messageboxutils.cpp +++ b/kybackup/messageboxutils.cpp @@ -1,8 +1,24 @@ #include "messageboxutils.h" #include "gsettingswrapper.h" +#include "../common/mydefine.h" #include #include +void MessageBoxUtils::QMESSAGE_BOX_INFORMATION(QWidget* q_parent, const QString& typelabel, const QString& message, const QString& label) +{ + QMessageBox box(q_parent); + + box.setIcon(QMessageBox::Information); + box.setWindowTitle(typelabel); + box.setText(message); + box.setStandardButtons(QMessageBox::Ok); + box.setButtonText(QMessageBox::Ok, label); + QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); + box.setWindowIcon(titleIcon); + g_GSettingWrapper.connectUkuiIconSchema(&box); + box.exec(); +} + void MessageBoxUtils::QMESSAGE_BOX_WARNING(QWidget* q_parent, const QString& typelabel, const QString& message, const QString& label) { QMessageBox box(q_parent); @@ -12,6 +28,9 @@ void MessageBoxUtils::QMESSAGE_BOX_WARNING(QWidget* q_parent, const QString& typ box.setText(message); box.setStandardButtons(QMessageBox::Ok); box.setButtonText(QMessageBox::Ok, label); + QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); + box.setWindowIcon(titleIcon); + g_GSettingWrapper.connectUkuiIconSchema(&box); box.exec(); } @@ -19,12 +38,15 @@ bool MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(QWidget *q_parent, const QStri { QMessageBox box(q_parent); - box.setIcon(QMessageBox::Warning); + box.setIcon(QMessageBox::Question); box.setWindowTitle(typelabel); box.setText(message); box.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel); box.setButtonText(QMessageBox::Ok, label_yes); box.setButtonText(QMessageBox::Cancel, label_no); + QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); + box.setWindowIcon(titleIcon); + g_GSettingWrapper.connectUkuiIconSchema(&box); if (box.exec() != QMessageBox::Ok) return false; return true; @@ -38,5 +60,8 @@ void MessageBoxUtils::QMESSAGE_BOX_CRITICAL(QWidget* q_parent, const QString& ty box.setText(message); box.setStandardButtons(QMessageBox::Ok); box.setButtonText(QMessageBox::Ok, label); + QIcon titleIcon = QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS); + box.setWindowIcon(titleIcon); + g_GSettingWrapper.connectUkuiIconSchema(&box); box.exec(); } diff --git a/kybackup/messageboxutils.h b/kybackup/messageboxutils.h index 50f197a..423ca53 100755 --- a/kybackup/messageboxutils.h +++ b/kybackup/messageboxutils.h @@ -7,6 +7,7 @@ class MessageBoxUtils { public: + static void QMESSAGE_BOX_INFORMATION(QWidget* q_parent, const QString& typelabel, const QString& message, const QString& label); static void QMESSAGE_BOX_WARNING(QWidget* q_parent, const QString& typelabel, const QString& message, const QString& label); static void QMESSAGE_BOX_CRITICAL(QWidget* q_parent, const QString& typelabel, const QString& message, const QString& label); static bool QMESSAGE_BOX_WARNING_CANCEL(QWidget* q_parent, const QString& typelabel, const QString& message, diff --git a/kybackup/module/databackup.cpp b/kybackup/module/databackup.cpp index 3d29478..7e65e45 100755 --- a/kybackup/module/databackup.cpp +++ b/kybackup/module/databackup.cpp @@ -97,28 +97,28 @@ void DataBackup::initFirstWidget() // 多点还原 MyIconLabel *iconMultiBackup_firstPage = new MyIconLabel(first); - iconMultiBackup_firstPage->setGeometry(41, 244, 180, 36); + iconMultiBackup_firstPage->setGeometry(41, 244, 210, 36); iconMultiBackup_firstPage->setThemeIcon("ukui-bf-many-spot-symbolic", ":/symbos/ukui-bf-many-spot-symbolic.png"); iconMultiBackup_firstPage->setDesplayText(tr("Multi-Spot")); iconMultiBackup_firstPage->setEnabled(false); // 安全 MyIconLabel *iconSecurity_firstPage = new MyIconLabel(first); - iconSecurity_firstPage->setGeometry(206, 244, 180, 36); + iconSecurity_firstPage->setGeometry(231, 244, 180, 36); iconSecurity_firstPage->setThemeIcon("ukui-bf-security-symbolic", ":/symbos/ukui-bf-security-symbolic.png"); iconSecurity_firstPage->setDesplayText(tr("Security")); iconSecurity_firstPage->setEnabled(false); // 防止数据丢失 MyIconLabel *iconDataLoss_firstPage = new MyIconLabel(first); - iconDataLoss_firstPage->setGeometry(41, 296, 180, 36); + iconDataLoss_firstPage->setGeometry(41, 296, 210, 36); iconDataLoss_firstPage->setThemeIcon("ukui-bf-dataloss-symbolic", ":/symbos/ukui-bf-dataloss-symbolic.png"); iconDataLoss_firstPage->setDesplayText(tr("Protect Data")); iconDataLoss_firstPage->setEnabled(false); // 方便快捷 MyIconLabel *iconSimple_firstPage = new MyIconLabel(first); - iconSimple_firstPage->setGeometry(206, 296, 180, 36); + iconSimple_firstPage->setGeometry(231, 296, 180, 36); iconSimple_firstPage->setThemeIcon("ukui-bf-fast-symbolic", ":/symbos/ukui-bf-fast-symbolic.png"); iconSimple_firstPage->setDesplayText(tr("Convenient")); iconSimple_firstPage->setEnabled(false); @@ -309,6 +309,7 @@ void DataBackup::initSecondWidget() editSelect->setMaxLength(255); // 删除按钮 QPushButton *buttonDelete = new QPushButton; + buttonDelete->setFixedSize(36, 36); buttonDelete->setProperty("isWindowButton", 0x2); buttonDelete->setProperty("useIconHighlightEffect", 0x8); buttonDelete->setFlat(true); @@ -525,6 +526,7 @@ void DataBackup::initSecondWidget_inc() editSelect->setMaxLength(255); // 删除按钮 QPushButton *buttonDelete = new QPushButton; + buttonDelete->setFixedSize(36, 36); buttonDelete->setProperty("isWindowButton", 0x2); buttonDelete->setProperty("useIconHighlightEffect", 0x8); buttonDelete->setFlat(true); @@ -1297,7 +1299,7 @@ void DataBackup::initFifthWidget() connect(cancel, &MyPushButton::clicked, this, [=](bool checked) { Q_UNUSED(checked) // 确定取消当前操作? - if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { + if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { return ; } cancel->setEnabled(false); diff --git a/kybackup/module/datarestore.cpp b/kybackup/module/datarestore.cpp index 01484f0..a70cd94 100755 --- a/kybackup/module/datarestore.cpp +++ b/kybackup/module/datarestore.cpp @@ -171,7 +171,7 @@ void DataRestore::on_button_beginRestore_clicked(bool checked) return ; } else if (checkIsNeedReboot()){ // 包含用户家目录,还原完成后需要重启 - if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Contains the user's home directory, which need to reboot after restoration"), QObject::tr("Continue"), QObject::tr("Cancel"))) { + if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Contains the user's home directory, which need to reboot after restoration. Are you sure to continue?"), QObject::tr("Continue"), QObject::tr("Cancel"))) { selectRestoreDialog->deleteLater(); return ; } diff --git a/kybackup/module/ghostimage.cpp b/kybackup/module/ghostimage.cpp index 6d9ec73..772204d 100755 --- a/kybackup/module/ghostimage.cpp +++ b/kybackup/module/ghostimage.cpp @@ -775,7 +775,7 @@ void GhostImage::initForthWidget() connect(cancel, &MyPushButton::clicked, this, [=](bool checked) { Q_UNUSED(checked) // 确定取消当前操作? - if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { + if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { return ; } cancel->setEnabled(false); diff --git a/kybackup/module/managebackuppointlist.cpp b/kybackup/module/managebackuppointlist.cpp index 2b69112..c218068 100755 --- a/kybackup/module/managebackuppointlist.cpp +++ b/kybackup/module/managebackuppointlist.cpp @@ -46,7 +46,7 @@ ManageBackupPointList::ManageBackupPointList(QWidget *parent, BackupPointType ba } // 是否确认删除此备份 - if (MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Are you sure to delete the backup ?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { + if (MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Are you sure to delete the backup ?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { int curRow = this->m_tableWidget->currentRow(); ParseBackupList::BackupPoint backupPoint; backupPoint.m_backupName = this->text(curRow, Column_Index::Backup_Name); diff --git a/kybackup/module/operationlog.cpp b/kybackup/module/operationlog.cpp index 4161409..04d5cd2 100755 --- a/kybackup/module/operationlog.cpp +++ b/kybackup/module/operationlog.cpp @@ -69,6 +69,7 @@ void OperationLog::initFirstWidget() m_tableWidget->setSortingEnabled(false); // 等录入完数据后再排序 m_tableWidget->setAlternatingRowColors(true); m_tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers); + m_tableWidget->setShowGrid(false); // m_tableWidget->hideColumn(1); // 隐藏uuid hlayoutLine3->addStretch(); hlayoutLine3->addWidget(m_tableWidget); diff --git a/kybackup/module/selectrestorepoint.cpp b/kybackup/module/selectrestorepoint.cpp index cdd6585..a72edea 100755 --- a/kybackup/module/selectrestorepoint.cpp +++ b/kybackup/module/selectrestorepoint.cpp @@ -46,7 +46,7 @@ SelectRestorePoint::SelectRestorePoint(QWidget *parent, BackupPointType backupTy } // 还原相应备份点 - if (MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Do you want to continue?"), QObject::tr("Continue"), QObject::tr("Cancel"))) { + if (MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Do you want to continue?"), QObject::tr("Continue"), QObject::tr("Cancel"))) { int curRow = this->m_tableWidget->currentRow(); ParseBackupList::BackupPoint backupPoint; backupPoint.m_backupName = this->text(curRow, Column_Index::Backup_Name); diff --git a/kybackup/module/systembackup.cpp b/kybackup/module/systembackup.cpp index 0e86b30..b6f8a80 100755 --- a/kybackup/module/systembackup.cpp +++ b/kybackup/module/systembackup.cpp @@ -906,7 +906,7 @@ void SystemBackup::initFifthWidget() connect(cancel, &MyPushButton::clicked, this, [=](bool checked) { Q_UNUSED(checked) // 确定取消当前操作? - if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { + if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Information"), QObject::tr("Are you sure to cancel the operation?"), QObject::tr("Ok"), QObject::tr("Cancel"))) { return ; } cancel->setEnabled(false); diff --git a/kybackup/module/systemrestore.cpp b/kybackup/module/systemrestore.cpp index f044437..01cb6b9 100755 --- a/kybackup/module/systemrestore.cpp +++ b/kybackup/module/systemrestore.cpp @@ -84,28 +84,28 @@ void SystemRestore::initFirstWidget() // 操作简单 MyIconLabel *iconSimple_firstPage = new MyIconLabel(first); - iconSimple_firstPage->setGeometry(41, 244, 180, 36); + iconSimple_firstPage->setGeometry(41, 244, 210, 36); iconSimple_firstPage->setThemeIcon("ukui-bf-simple-symbolic", ":/symbos/ukui-bf-simple-symbolic.png"); iconSimple_firstPage->setDesplayText(tr("Simple")); iconSimple_firstPage->setEnabled(false); // 安全可靠 MyIconLabel *iconSecurity_firstPage = new MyIconLabel(first); - iconSecurity_firstPage->setGeometry(201, 244, 180, 36); + iconSecurity_firstPage->setGeometry(231, 244, 180, 36); iconSecurity_firstPage->setThemeIcon("ukui-bf-security-symbolic", ":/symbos/ukui-bf-security-symbolic.png"); iconSecurity_firstPage->setDesplayText(tr("Security")); iconSecurity_firstPage->setEnabled(false); // 修复系统损坏 MyIconLabel *iconMultiBackup_firstPage = new MyIconLabel(first); - iconMultiBackup_firstPage->setGeometry(41, 296, 180, 36); + iconMultiBackup_firstPage->setGeometry(41, 296, 210, 36); iconMultiBackup_firstPage->setThemeIcon("ukui-bf-damage-symbolic", ":/symbos/ukui-bf-damage-symbolic.png"); iconMultiBackup_firstPage->setDesplayText(tr("Repair")); iconMultiBackup_firstPage->setEnabled(false); // 自主操作 MyIconLabel *iconSmallSize_firstPage = new MyIconLabel(first); - iconSmallSize_firstPage->setGeometry(201, 296, 180, 36); + iconSmallSize_firstPage->setGeometry(231, 296, 180, 36); iconSmallSize_firstPage->setThemeIcon("document-properties-symbolic", ":/symbos/document-properties-symbolic.png"); iconSmallSize_firstPage->setDesplayText(tr("Independent")); iconSmallSize_firstPage->setEnabled(false); @@ -199,7 +199,7 @@ void SystemRestore::on_button_beginRestore_clicked(bool checked) if (m_isFactoryRestore) { // 出厂还原后,用户数据将会丢失 if (!MessageBoxUtils::QMESSAGE_BOX_WARNING_CANCEL(this, QObject::tr("Warning"), - QObject::tr("Restore factory settings, your system user data will not be retained"), + QObject::tr("Restore factory settings, your system user data will not be retained. Are you sure to continue?"), QObject::tr("Continue"), QObject::tr("Cancel"))) { return; } diff --git a/kybackup/qt_zh_CN.ts b/kybackup/qt_zh_CN.ts index d0795d4..b9fdc99 100755 --- a/kybackup/qt_zh_CN.ts +++ b/kybackup/qt_zh_CN.ts @@ -75,7 +75,7 @@ 备份位置 - + No Backup 无备份 @@ -140,286 +140,286 @@ - + local default path : 本地默认路径: - + removable devices path : 移动设备: - + Select backup data 选择备份数据 - - + + Add 添加 - - + + Select 选择 - - + + Please select file to backup 请选择备份文件 - - - - + + + + Back 上一步 - - - - + + + + Next 下一步 - + Default backup location 默认备份位置 - - - - + + + + checking 环境检测 - - - - + + + + preparing 备份准备 - - - - + + + + backuping 备份中 - - - - + + + + finished 备份完成 - + Recheck 重新检测 - + Checking, wait a moment ... 正在检测,请稍等... - + Do not perform other operations during backup to avoid data loss 备份过程中不要做其它操作,以防数据丢失 - + Check whether the remaining capacity of the backup partition is sufficient 检测备份分区空间是否充足··· - + Check whether the remaining capacity of the removable device is sufficient 检测移动设备空间是否充足··· - + Check success 检测成功 - + The storage for backup is enough 备份空间充足 - + Make sure the computer is plugged in or the battery level is above 60% 请确保电脑已连接电源或电量超过60% - + Check failure 检测失败 - - + + Program lock failed, please retry 程序锁定失败,请重试 - - + + There may be other backups or restores being performed 可能有其它备份/还原等任务在执行 - - + + Unsupported task type 不支持的任务类型 - - + + No processing logic was found in the service 没有找到相应的处理逻辑 - - + + Failed to mount the backup partition 备份分区挂载失败 - - + + Check whether there is a backup partition 检查是否有备份分区 - + The filesystem of device is vfat format 移动设备的文件系统是vfat格式 - + Please change filesystem format to ext3、ext4 or ntfs 请换成ext3、ext4、ntfs等文件系统格式 - + The device is read only 移动设备是只读挂载的 - + Please chmod to rw 请修改为读写模式 - - + + The storage for backup is not enough 备份空间不足 - - + + Retry after release space 建议释放空间后重试 - - + + Other backup or restore task is being performed 其它备份还原等操作正在执行 - - + + Please try again later 请稍后重试 - + Backup Name 备份名称 - - + + Name already exists 名称已存在 - + Cancel 取消 - + Do not use computer in case of data loss 请勿使用电脑,以防数据丢失 - + Failed to create the backup point directory 创建备份目录失败 - + Please check backup partition permissions 请检查备份分区权限 - + The backup had been canceled 备份已取消 - + Re-initiate the backup if necessary 如需要可重新进行备份 - + An error occurred during backup 备份期间发生错误 - + Error messages refer to log file : /var/log/backup.log 错误信息请参考日志文件:/var/log/backup.log - + Home Page 返回首页 - + Retry 再试一次 - + The backup is successful 备份成功 - + The backup is failed 备份失败 @@ -1026,8 +1026,8 @@ LeftsiderbarWidget - - + + Backup & Restore 备份还原 @@ -1035,57 +1035,57 @@ MainDialog - + Main menu 主菜单 - + Minimize 最小化 - + Close 关闭 - + Theme 主题 - + Auto 跟随主题 - + Light 浅色主题 - + Dark 深色主题 - + Help 帮助 - + About 关于 - + Exit 退出 - + Backup & Restore 备份还原 @@ -1151,47 +1151,47 @@ 操作时间 - + new system backup 新建系统备份 - + udpate system backup 增量系统备份 - + new data backup 新建数据备份 - + update data backup 更新数据备份 - + restore system 系统还原 - + restore retaining user data 保留用户数据还原 - + restore data 数据还原 - + delete backup 删除备份 - + make ghost image 制作ghost镜像 @@ -1222,22 +1222,14 @@ - - - - - - - - - + + + + + - - - - Warning 警告 @@ -1252,14 +1244,14 @@ - - - - - - - - + + + + + + + + @@ -1281,60 +1273,68 @@ - This tool can only be used by administrator. - 系统备份还原只能由系统管理员使用。 + + + + + + + + + Information + 提示 - - Error - 错误 + + This function can only be used by administrator. + 此功能只能由系统管理员使用。 - + Another user had opened kybackup, you can not start it again. 其他用户已开启备份还原工具,不能再开启 - + kybackup 备份还原工具 - + An exception occurred when mounting backup partition. 挂载备份分区时发生错误。 - - There's no backup partition, can only backup to removable device. - 无备份分区。 + + Please check if the backup partition exists which can be created when you install the Operating System. + 请检查备份还原分区是否存在,在安装操作系统时必须创建备份还原分区。 - + Failed to mount backup partition. 挂载备份分区失败。 - + It's busy, please wait 系统正忙,请稍等 - - + + Please select a backup file or directory 请选择一个备份文件或目录 - + Are you sure to cancel the operation? 确定取消当前操作? - + @@ -1344,11 +1344,6 @@ Cancel 取消 - - - Contains the user's home directory, which need to reboot after restoration - 包含用户家目录,还原完成后需要重启 - @@ -1356,6 +1351,11 @@ Continue 继续 + + + Contains the user's home directory, which need to reboot after restoration. Are you sure to continue? + 包含用户家目录,还原完成后需要重启系统。是否继续? + @@ -1391,8 +1391,8 @@ - Restore factory settings, your system user data will not be retained - 恢复出厂设置,您的系统用户数据都将会消失。 + Restore factory settings, your system user data will not be retained. Are you sure to continue? + 恢复出厂设置,您的系统用户数据都将会消失。是否继续? @@ -1976,7 +1976,7 @@ restore - + system restore diff --git a/kybackup/resource/language/qt_zh_CN.qm b/kybackup/resource/language/qt_zh_CN.qm index dcb6cc72474665705209f742798d36ae75a8d08e..575dc0defe36a60ae5e3d0b00f81d9b81eaf8b9b 100755 GIT binary patch delta 1987 zcmaKsdr(w$6vxlKyLWf*-Cb8vB$0M65(pv)ilSSh@(`EDvMeBv1!38}u&68zyQC%x zG2?(KCi4?SO_9p-IaWxGHkFoyk8IR1vwS9nMQBrw6{dCc*EIdn^v9jgy?1`U-#O=d zzQ6PRx6GCSW@C_$r~%+?048}$M2L{WgS>GYfNfh#Q8IrHxU{)~X562PdDi4r!gHc?P0A~Nr_(Zq?gf}QBS5sz~nbDUo;d#d>i!U(&nbRQw%3on7|DF#J zQprSU-vn5YM_CZYM1=1I@Oh3hM`F@T#{o>VF||(2F!>>+X%*qviSsTno!ff=O4^v+ zW3m9AxJOy|faz6E15o!}5;mt^qLgQ#!}7OQZX6^%mBXa||GEkga`T7eH|``@ty`+3y6Ut(X162cygj zXRjyX{+t+gpkon0&=7m8Uk{Kwz}{;}1c=F$Md+~R_#v55Un$%4$NpvD!%4^XCr&%-q%3HWH3eXmie;3k-DH(a&t^SM zw#y9suxz(62w+h<>5+x_=bGfDD|4~&e=|x>zpeWTC!fKl>PeD3mcJQ(9FEfQJqhLv{2$!$t_$d7GfC(4Lf&$2a2Pc& zyGd#|vyfS=uraLdy?w#;AyOmR}DtrL`M&(hC*?>?-D-p_#t#rJYV$r9CSq=@46X>E^?DIiWx$F z1ONI)th(Grv`W8OC;1~rluCJxa@=CdN$V-ogD8tUeBTbtY3wyhTPi71PT@}ov3md@ zF_N?@4a^51AxGG;hooTNSPL= zzPsTtKy;9Xc@C8=eW)3=<1SXVhcf4^CdqXchtbCxd*~20&O)@jU*H8zWgJ>WHkXn+ zMET4|lqt(d5+A}!2S_D9(e$&XfA}h1t=ZbJPn!Ys7H##>uTa_DT95lE^0IcV#Sh0- zwD#aREWT`%_FXTA)Fx|(VJ?n_rb?Tf%$|)2qAS@ zwYphGtk(XvZoUCsI>SYocSpB)?`E{!FFMaQHBP*CUE?nF(SjFs&88Ck7AbSK>e}it zl>84$(|fvoo!G}|V|3j?IP+9}l<76P_fDgojqg(~IHEg$KM=@yVJz!9NW{eOE?@P5 zdCXMuaoPm`+WV`oMX_a5vO`u6tRDK)fcFB0$44S}(o)7piu0-^aYa>)=&8XMZHPRe1D}5PhvyLXW(%t@Y$JrIefA*?P?y{=tO1rnB%H5S@-ozBfulvQIdp?_*}Lv3rDdYor63Lj-7-7D^CUuhk`X!zf&qu75=FSjg} z>>f#UxFp9Cv7(H8=y3@vKyh8M@2GtQ8)wR2fN5WE^K=NV8?qnE%kDm>jbt{;wWfrc)WP#A)rQe?YEf W8b(BAyDB_lS&iHASO=B$hWHoM_fMPv delta 1924 zcmYM!X;4#F6ae7!Uh=ZMBt#HFkbwYY6Hq83NQ;83i4a*uK!hZOtt^%Rt`*z{tzxBD z1gdN^+EI{di?r2_j!PL-tXt8lb;F`m8KtA>v>>&|-l_eO`6e$f_ujMI(>TODe#q=_ z=EHsk;L-u2lWM(Pd37oXt9JvW4cBHwNgaWU83o8Ht?l#`$295z=AW*;MQD!Sf*F(2Ot}yF8qz@pFM&BZe;#= zz7xPh&DwR}1qibt8LV}sHJg#@2%xfIGe+?Y@^)4qvI)RpkZQyYU+SsvmHh$T25WSks^UTo3NGC2ppsu!Tum;fQ%;6EpWA6)F{-iP61G=sXjt# z{A==3Fq_vD3)>ew!%+H(w=h8JChRT4MCt2Ek#I((?o%#n^*Mk^L)1hkPWJ?BHSZa> zC2t0RPXxCukHyz*xwABnpT`YEm-QFo*lG z>l)Ta{jX#?XW<(|A7wRj!(&(i%WtSo4pjfs)ReQ-96wUTY5BNAqI6~o_QMj=!#Py? zidsAHyuuvO9o~q+t`&_w!2H>*qGo2Q9M&Rl@B<8afVHhCb0uE zj~o}fR>pSn1%bKP^$c&C^tM{hsL8qfuEALV>T$j)@C1Nk1OM%x)fi`l}_JvA*w*0M_uVC*J!5(nLTvV(OVm}9Z*tA|+3$knnd>u=-s9@ON$vIha# z*rb0`7i^b}Za)g(>nvv~j$jjO<>t+!814aTvPvG2cNrk~j9lmb6xVGf3aPcDi@azq zHkKfS${nG8c$%v2B@t3rHhY2;N!`@*<%45)ah^meJTBA#*vBbKPu{{2x?Eu@K8bcH zw!~TE%v+~8bOkeF)G59z!z~q2iZKYm`Ln{zHV$WESUb5Rb(2P$9kcxf$94fx@D7X> z@#bAC6D}y{1Yy)VRvGDlQP0k!E}o|>Xs-tdc%d}ymf@IfP*(55R*br(tWjs-cNI11 ziE>vJZY6w8Rm+qeZCG4COJ%n+4p>P)HKs@TLm#$u&~a)sue>_$2;?en#pb>ts&LP) zDYDK`#)+JXapLhVV50G(A#Y+dq(W;>%42gZg>^PtN8bI$MU1!!|KG#OsrYcBO31F18}FxzwG#=V#2_E`-4dZmdB#$sn@Lq%qSEUOAC)gt zEz^~j<(K7`6nm)*x?)vHapB7Uekv