跟随主题

This commit is contained in:
zhaominyong 2022-02-15 16:51:03 +08:00
parent 2aa53930f2
commit 64f453d612
28 changed files with 471 additions and 244 deletions

View File

@ -52,7 +52,6 @@
#define COLOR_YELLOW "#F8A34C"
#define COLOR_LIGHT_BLUE "#DDEBFF"
/**
* @brief
*/

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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);

View File

@ -0,0 +1,27 @@
#include "mywidget.h"
#include <QStyleOption>
#include <QPainter>
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);
}

View File

@ -0,0 +1,17 @@
#ifndef MYWIDGET_H
#define MYWIDGET_H
#include <QWidget>
#include <QObject>
class MyWidget : public QWidget
{
Q_OBJECT
public:
explicit MyWidget(QWidget *parent = nullptr);
~MyWidget();
void paintEvent(QPaintEvent *event);
};
#endif // MYWIDGET_H

View File

@ -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;

View File

@ -8,18 +8,32 @@
class GlobelBackupInfo : public Singleton<GlobelBackupInfo> {
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;

View File

@ -5,23 +5,33 @@
#include "gsettingswrapper.h"
#include <QIcon>
#include <QLabel>
#include <QGSettings/qgsettings.h>
#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<QLabel *>(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);
}
});
}
}

View File

@ -3,19 +3,62 @@
#include <QHash>
#include <QSize>
#include <QColor>
#include <QGSettings/qgsettings.h>
#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<GSettingsWrapper>
{
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

View File

@ -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 \

View File

@ -1,11 +1,15 @@
#include "leftsiderbarwidget.h"
#include <QDebug>
#include <QGSettings>
#include <QStyleOption>
#include <QPainter>
#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,7 +122,7 @@ 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));
this->setPalette(pal);

View File

@ -7,6 +7,7 @@
#include <QLabel>
#include <QPushButton>
#include <QButtonGroup>
#include <QGSettings>
#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;

View File

@ -8,13 +8,13 @@
#include <QtDBus>
#include <QMessageBox>
#include <QDesktopWidget>
#include <KWindowEffects>
#include <unistd.h>
#include "qtsingleapplication/qtsingleapplication.h"
#include "../common/utils.h"
#include "xatom-helper.h"
#include "globalbackupinfo.h"
#include "messageboxutils.h"
// 声明
void initApp(QApplication& a);
@ -38,12 +38,9 @@ int main(int argc, char *argv[])
// 当前只支持管理员用户使用备份还原工具
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);

View File

@ -5,8 +5,9 @@
#include <QProcess>
#include <QMessageBox>
#include <KWindowSystem>
#include <KWindowEffects>
#include <unistd.h>
#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"));

View File

@ -1,8 +1,24 @@
#include "messageboxutils.h"
#include "gsettingswrapper.h"
#include "../common/mydefine.h"
#include <QMessageBox>
#include <QIcon>
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();
}

View File

@ -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,

View File

@ -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);

View File

@ -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 ;
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;
}

View File

@ -75,7 +75,7 @@
<translation></translation>
</message>
<message>
<location filename="backuppointlistdialog.cpp" line="91"/>
<location filename="backuppointlistdialog.cpp" line="92"/>
<source>No Backup</source>
<translation></translation>
</message>
@ -140,286 +140,286 @@
</message>
<message>
<location filename="module/databackup.cpp" line="274"/>
<location filename="module/databackup.cpp" line="493"/>
<location filename="module/databackup.cpp" line="494"/>
<source>local default path : </source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="277"/>
<location filename="module/databackup.cpp" line="496"/>
<location filename="module/databackup.cpp" line="497"/>
<source>removable devices path : </source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="294"/>
<location filename="module/databackup.cpp" line="510"/>
<location filename="module/databackup.cpp" line="511"/>
<source>Select backup data</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="322"/>
<location filename="module/databackup.cpp" line="538"/>
<location filename="module/databackup.cpp" line="323"/>
<location filename="module/databackup.cpp" line="540"/>
<source>Add</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="326"/>
<location filename="module/databackup.cpp" line="542"/>
<location filename="module/databackup.cpp" line="327"/>
<location filename="module/databackup.cpp" line="544"/>
<source>Select</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="363"/>
<location filename="module/databackup.cpp" line="578"/>
<location filename="module/databackup.cpp" line="364"/>
<location filename="module/databackup.cpp" line="580"/>
<source>Please select file to backup</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="384"/>
<location filename="module/databackup.cpp" line="605"/>
<location filename="module/databackup.cpp" line="769"/>
<location filename="module/databackup.cpp" line="1072"/>
<location filename="module/databackup.cpp" line="385"/>
<location filename="module/databackup.cpp" line="607"/>
<location filename="module/databackup.cpp" line="771"/>
<location filename="module/databackup.cpp" line="1074"/>
<source>Back</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="394"/>
<location filename="module/databackup.cpp" line="615"/>
<location filename="module/databackup.cpp" line="783"/>
<location filename="module/databackup.cpp" line="1080"/>
<location filename="module/databackup.cpp" line="395"/>
<location filename="module/databackup.cpp" line="617"/>
<location filename="module/databackup.cpp" line="785"/>
<location filename="module/databackup.cpp" line="1082"/>
<source>Next</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="472"/>
<location filename="module/databackup.cpp" line="473"/>
<source>Default backup location</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="684"/>
<location filename="module/databackup.cpp" line="1014"/>
<location filename="module/databackup.cpp" line="1196"/>
<location filename="module/databackup.cpp" line="1464"/>
<location filename="module/databackup.cpp" line="686"/>
<location filename="module/databackup.cpp" line="1016"/>
<location filename="module/databackup.cpp" line="1198"/>
<location filename="module/databackup.cpp" line="1466"/>
<source>checking</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="687"/>
<location filename="module/databackup.cpp" line="1017"/>
<location filename="module/databackup.cpp" line="1199"/>
<location filename="module/databackup.cpp" line="1467"/>
<location filename="module/databackup.cpp" line="689"/>
<location filename="module/databackup.cpp" line="1019"/>
<location filename="module/databackup.cpp" line="1201"/>
<location filename="module/databackup.cpp" line="1469"/>
<source>preparing</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="689"/>
<location filename="module/databackup.cpp" line="1020"/>
<location filename="module/databackup.cpp" line="1202"/>
<location filename="module/databackup.cpp" line="1470"/>
<location filename="module/databackup.cpp" line="691"/>
<location filename="module/databackup.cpp" line="1022"/>
<location filename="module/databackup.cpp" line="1204"/>
<location filename="module/databackup.cpp" line="1472"/>
<source>backuping</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="691"/>
<location filename="module/databackup.cpp" line="1022"/>
<location filename="module/databackup.cpp" line="1205"/>
<location filename="module/databackup.cpp" line="1473"/>
<location filename="module/databackup.cpp" line="693"/>
<location filename="module/databackup.cpp" line="1024"/>
<location filename="module/databackup.cpp" line="1207"/>
<location filename="module/databackup.cpp" line="1475"/>
<source>finished</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="794"/>
<location filename="module/databackup.cpp" line="796"/>
<source>Recheck</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="821"/>
<location filename="module/databackup.cpp" line="823"/>
<source>Checking, wait a moment ...</source>
<translation>...</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="827"/>
<location filename="module/databackup.cpp" line="829"/>
<source>Do not perform other operations during backup to avoid data loss</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="830"/>
<location filename="module/databackup.cpp" line="832"/>
<source>Check whether the remaining capacity of the backup partition is sufficient</source>
<translation>···</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="833"/>
<location filename="module/databackup.cpp" line="835"/>
<source>Check whether the remaining capacity of the removable device is sufficient</source>
<translation>···</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="852"/>
<location filename="module/databackup.cpp" line="854"/>
<source>Check success</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="854"/>
<location filename="module/databackup.cpp" line="856"/>
<source>The storage for backup is enough</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="859"/>
<location filename="module/databackup.cpp" line="861"/>
<source>Make sure the computer is plugged in or the battery level is above 60%</source>
<translation>60%</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="871"/>
<location filename="module/databackup.cpp" line="873"/>
<source>Check failure</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="939"/>
<location filename="module/databackup.cpp" line="1355"/>
<location filename="module/databackup.cpp" line="941"/>
<location filename="module/databackup.cpp" line="1357"/>
<source>Program lock failed, please retry</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="941"/>
<location filename="module/databackup.cpp" line="1357"/>
<location filename="module/databackup.cpp" line="943"/>
<location filename="module/databackup.cpp" line="1359"/>
<source>There may be other backups or restores being performed</source>
<translation>/</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="945"/>
<location filename="module/databackup.cpp" line="1361"/>
<location filename="module/databackup.cpp" line="947"/>
<location filename="module/databackup.cpp" line="1363"/>
<source>Unsupported task type</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="947"/>
<location filename="module/databackup.cpp" line="1363"/>
<location filename="module/databackup.cpp" line="949"/>
<location filename="module/databackup.cpp" line="1365"/>
<source>No processing logic was found in the service</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="951"/>
<location filename="module/databackup.cpp" line="1367"/>
<location filename="module/databackup.cpp" line="953"/>
<location filename="module/databackup.cpp" line="1369"/>
<source>Failed to mount the backup partition</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="953"/>
<location filename="module/databackup.cpp" line="1369"/>
<location filename="module/databackup.cpp" line="955"/>
<location filename="module/databackup.cpp" line="1371"/>
<source>Check whether there is a backup partition</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="957"/>
<location filename="module/databackup.cpp" line="959"/>
<source>The filesystem of device is vfat format</source>
<translation>vfat格式</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="959"/>
<location filename="module/databackup.cpp" line="961"/>
<source>Please change filesystem format to ext3ext4 or ntfs</source>
<translation>ext3ext4ntfs等文件系统格式</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="963"/>
<location filename="module/databackup.cpp" line="965"/>
<source>The device is read only</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="965"/>
<location filename="module/databackup.cpp" line="967"/>
<source>Please chmod to rw</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="969"/>
<location filename="module/databackup.cpp" line="1373"/>
<location filename="module/databackup.cpp" line="971"/>
<location filename="module/databackup.cpp" line="1375"/>
<source>The storage for backup is not enough</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="971"/>
<location filename="module/databackup.cpp" line="1375"/>
<location filename="module/databackup.cpp" line="973"/>
<location filename="module/databackup.cpp" line="1377"/>
<source>Retry after release space</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="975"/>
<location filename="module/databackup.cpp" line="1379"/>
<location filename="module/databackup.cpp" line="977"/>
<location filename="module/databackup.cpp" line="1381"/>
<source>Other backup or restore task is being performed</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="977"/>
<location filename="module/databackup.cpp" line="1381"/>
<location filename="module/databackup.cpp" line="979"/>
<location filename="module/databackup.cpp" line="1383"/>
<source>Please try again later</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1029"/>
<location filename="module/databackup.cpp" line="1031"/>
<source>Backup Name</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1051"/>
<location filename="module/databackup.cpp" line="1094"/>
<location filename="module/databackup.cpp" line="1053"/>
<location filename="module/databackup.cpp" line="1096"/>
<source>Name already exists</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1251"/>
<location filename="module/databackup.cpp" line="1253"/>
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1282"/>
<location filename="module/databackup.cpp" line="1284"/>
<source>Do not use computer in case of data loss</source>
<translation>使</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1387"/>
<location filename="module/databackup.cpp" line="1389"/>
<source>Failed to create the backup point directory</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1389"/>
<location filename="module/databackup.cpp" line="1391"/>
<source>Please check backup partition permissions</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1393"/>
<location filename="module/databackup.cpp" line="1395"/>
<source>The backup had been canceled</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1395"/>
<location filename="module/databackup.cpp" line="1397"/>
<source>Re-initiate the backup if necessary</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1428"/>
<location filename="module/databackup.cpp" line="1430"/>
<source>An error occurred during backup</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1430"/>
<location filename="module/databackup.cpp" line="1432"/>
<source>Error messages refer to log file : /var/log/backup.log</source>
<translation>/var/log/backup.log</translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1545"/>
<location filename="module/databackup.cpp" line="1547"/>
<source>Home Page</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1553"/>
<location filename="module/databackup.cpp" line="1555"/>
<source>Retry</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1576"/>
<location filename="module/databackup.cpp" line="1578"/>
<source>The backup is successful</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1590"/>
<location filename="module/databackup.cpp" line="1592"/>
<source>The backup is failed</source>
<translation></translation>
</message>
@ -1026,8 +1026,8 @@
<context>
<name>LeftsiderbarWidget</name>
<message>
<location filename="leftsiderbarwidget.cpp" line="25"/>
<location filename="leftsiderbarwidget.cpp" line="26"/>
<location filename="leftsiderbarwidget.cpp" line="29"/>
<location filename="leftsiderbarwidget.cpp" line="30"/>
<source>Backup &amp; Restore</source>
<translation></translation>
</message>
@ -1035,57 +1035,57 @@
<context>
<name>MainDialog</name>
<message>
<location filename="maindialog.cpp" line="98"/>
<location filename="maindialog.cpp" line="120"/>
<source>Main menu</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="99"/>
<location filename="maindialog.cpp" line="121"/>
<source>Minimize</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="100"/>
<location filename="maindialog.cpp" line="122"/>
<source>Close</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="128"/>
<location filename="maindialog.cpp" line="150"/>
<source>Theme</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="133"/>
<location filename="maindialog.cpp" line="155"/>
<source>Auto</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="135"/>
<location filename="maindialog.cpp" line="157"/>
<source>Light</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="137"/>
<location filename="maindialog.cpp" line="159"/>
<source>Dark</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="140"/>
<location filename="maindialog.cpp" line="162"/>
<source>Help</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="142"/>
<location filename="maindialog.cpp" line="164"/>
<source>About</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="144"/>
<location filename="maindialog.cpp" line="166"/>
<source>Exit</source>
<translation>退</translation>
</message>
<message>
<location filename="maindialog.cpp" line="159"/>
<location filename="maindialog.cpp" line="31"/>
<source>Backup &amp; Restore</source>
<translation></translation>
</message>
@ -1151,47 +1151,47 @@
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="144"/>
<location filename="module/operationlog.cpp" line="145"/>
<source>new system backup</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="148"/>
<location filename="module/operationlog.cpp" line="149"/>
<source>udpate system backup</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="152"/>
<location filename="module/operationlog.cpp" line="153"/>
<source>new data backup</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="156"/>
<location filename="module/operationlog.cpp" line="157"/>
<source>update data backup</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="160"/>
<location filename="module/operationlog.cpp" line="161"/>
<source>restore system</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="164"/>
<location filename="module/operationlog.cpp" line="165"/>
<source>restore retaining user data</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="168"/>
<location filename="module/operationlog.cpp" line="169"/>
<source>restore data</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="172"/>
<location filename="module/operationlog.cpp" line="173"/>
<source>delete backup</source>
<translation></translation>
</message>
<message>
<location filename="module/operationlog.cpp" line="176"/>
<location filename="module/operationlog.cpp" line="177"/>
<source>make ghost image</source>
<translation>ghost镜像</translation>
</message>
@ -1222,22 +1222,14 @@
<location filename="component/backuplistwidget.cpp" line="128"/>
<location filename="component/backuplistwidget.cpp" line="137"/>
<location filename="component/backuplistwidget.cpp" line="160"/>
<location filename="main.cpp" line="41"/>
<location filename="maindialog.cpp" line="269"/>
<location filename="maindialog.cpp" line="276"/>
<location filename="maindialog.cpp" line="284"/>
<location filename="maindialog.cpp" line="303"/>
<location filename="module/databackup.cpp" line="352"/>
<location filename="module/databackup.cpp" line="567"/>
<location filename="module/databackup.cpp" line="1300"/>
<location filename="module/datarestore.cpp" line="174"/>
<location filename="maindialog.cpp" line="300"/>
<location filename="maindialog.cpp" line="315"/>
<location filename="maindialog.cpp" line="334"/>
<location filename="module/databackup.cpp" line="353"/>
<location filename="module/databackup.cpp" line="569"/>
<location filename="module/datarestore.cpp" line="990"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/managebackuppointlist.cpp" line="44"/>
<location filename="module/managebackuppointlist.cpp" line="49"/>
<location filename="module/selectrestorepoint.cpp" line="43"/>
<location filename="module/selectrestorepoint.cpp" line="49"/>
<location filename="module/systembackup.cpp" line="909"/>
<location filename="module/systemrestore.cpp" line="201"/>
<source>Warning</source>
<translation></translation>
@ -1252,14 +1244,14 @@
<location filename="component/backuplistwidget.cpp" line="139"/>
<location filename="component/backuplistwidget.cpp" line="162"/>
<location filename="main.cpp" line="43"/>
<location filename="main.cpp" line="57"/>
<location filename="maindialog.cpp" line="271"/>
<location filename="maindialog.cpp" line="278"/>
<location filename="maindialog.cpp" line="286"/>
<location filename="maindialog.cpp" line="305"/>
<location filename="module/databackup.cpp" line="354"/>
<location filename="module/databackup.cpp" line="569"/>
<location filename="module/databackup.cpp" line="1300"/>
<location filename="main.cpp" line="54"/>
<location filename="maindialog.cpp" line="302"/>
<location filename="maindialog.cpp" line="309"/>
<location filename="maindialog.cpp" line="317"/>
<location filename="maindialog.cpp" line="336"/>
<location filename="module/databackup.cpp" line="355"/>
<location filename="module/databackup.cpp" line="571"/>
<location filename="module/databackup.cpp" line="1302"/>
<location filename="module/datarestore.cpp" line="992"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/managebackuppointlist.cpp" line="44"/>
@ -1281,60 +1273,68 @@
</message>
<message>
<location filename="main.cpp" line="41"/>
<source>This tool can only be used by administrator.</source>
<translation>使</translation>
<location filename="main.cpp" line="52"/>
<location filename="maindialog.cpp" line="307"/>
<location filename="module/databackup.cpp" line="1302"/>
<location filename="module/datarestore.cpp" line="174"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/managebackuppointlist.cpp" line="49"/>
<location filename="module/selectrestorepoint.cpp" line="49"/>
<location filename="module/systembackup.cpp" line="909"/>
<source>Information</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="55"/>
<source>Error</source>
<translation></translation>
<location filename="main.cpp" line="42"/>
<source>This function can only be used by administrator.</source>
<translation>使</translation>
</message>
<message>
<location filename="main.cpp" line="55"/>
<location filename="main.cpp" line="53"/>
<source>Another user had opened kybackup, you can not start it again.</source>
<translation></translation>
</message>
<message>
<location filename="main.cpp" line="127"/>
<location filename="main.cpp" line="107"/>
<source>kybackup</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="270"/>
<location filename="maindialog.cpp" line="301"/>
<source>An exception occurred when mounting backup partition.</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="277"/>
<source>There&apos;s no backup partition, can only backup to removable device.</source>
<translation></translation>
<location filename="maindialog.cpp" line="308"/>
<source>Please check if the backup partition exists which can be created when you install the Operating System.</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="285"/>
<location filename="maindialog.cpp" line="316"/>
<source>Failed to mount backup partition.</source>
<translation></translation>
</message>
<message>
<location filename="maindialog.cpp" line="304"/>
<location filename="maindialog.cpp" line="335"/>
<location filename="module/datarestore.cpp" line="991"/>
<source>It&apos;s busy, please wait</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="353"/>
<location filename="module/databackup.cpp" line="568"/>
<location filename="module/databackup.cpp" line="354"/>
<location filename="module/databackup.cpp" line="570"/>
<source>Please select a backup file or directory</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1300"/>
<location filename="module/databackup.cpp" line="1302"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/systembackup.cpp" line="909"/>
<source>Are you sure to cancel the operation</source>
<translation></translation>
</message>
<message>
<location filename="module/databackup.cpp" line="1300"/>
<location filename="module/databackup.cpp" line="1302"/>
<location filename="module/datarestore.cpp" line="174"/>
<location filename="module/ghostimage.cpp" line="778"/>
<location filename="module/managebackuppointlist.cpp" line="49"/>
@ -1344,11 +1344,6 @@
<source>Cancel</source>
<translation></translation>
</message>
<message>
<location filename="module/datarestore.cpp" line="174"/>
<source>Contains the user&apos;s home directory, which need to reboot after restoration</source>
<translation></translation>
</message>
<message>
<location filename="module/datarestore.cpp" line="174"/>
<location filename="module/selectrestorepoint.cpp" line="49"/>
@ -1356,6 +1351,11 @@
<source>Continue</source>
<translation></translation>
</message>
<message>
<location filename="module/datarestore.cpp" line="174"/>
<source>Contains the user&apos;s home directory, which need to reboot after restoration. Are you sure to continue?</source>
<translation></translation>
</message>
<message>
<location filename="module/managebackuppointlist.cpp" line="44"/>
<location filename="module/selectrestorepoint.cpp" line="43"/>
@ -1391,8 +1391,8 @@
</message>
<message>
<location filename="module/systemrestore.cpp" line="202"/>
<source>Restore factory settings, your system user data will not be retained</source>
<translation></translation>
<source>Restore factory settings, your system user data will not be retained. Are you sure to continue?</source>
<translation></translation>
</message>
</context>
<context>
@ -1976,7 +1976,7 @@
<context>
<name>restore</name>
<message>
<location filename="main.cpp" line="135"/>
<location filename="main.cpp" line="115"/>
<source>system restore</source>
<translation type="unfinished"></translation>
</message>