yhkylin-backup-tools/kybackup/aboutdialog.cpp

48 lines
2.1 KiB
C++
Raw Normal View History

2022-01-28 12:06:03 +08:00
#include "aboutdialog.h"
#include <QRegularExpression>
#include "globalbackupinfo.h"
2022-01-28 12:06:03 +08:00
#include "../common/utils.h"
2022-02-24 15:35:36 +08:00
// #define SUPPORT "<a href=\"mailto://support@kylinos.cn\">support@kylinos.cn</a>"
#define SUPPORT "<u>support@kylinos.cn</u>"
2022-02-10 10:12:29 +08:00
2022-01-28 12:06:03 +08:00
AboutDialog::AboutDialog(QWidget *parent) :
kdk::KAboutDialog(parent)
2022-01-28 12:06:03 +08:00
{
//setWindowIcon(QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS, QIcon(":/images/yhkylin-backup-tools.png")));
setAppIcon(QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS, QIcon(":/images/yhkylin-backup-tools.png")));
//setWindowTitle(tr("Backup & Restore"));
setAppName(tr("Backup & Restore"));
setAppVersion(tr("version:") + getBackupVersion());
2022-02-10 10:12:29 +08:00
// 麒麟备份还原工具是一款支持系统备份还原和数据备份还原的工具,当用户数据损坏或系统遭受攻击时能够通过该工具灵活的还原到备份节点的状态。针对国产软硬件平台开展了大量的优化和创新。
setBodyText(tr("The backup tool is a tool that supports system backup and data backup. "
"When the user data is damaged or the system is attacked, the tool can flexibly restore "
"the status of the backup node. A lot of optimization and innovation have been "
"carried out for domestic hardware and software platforms."));
// setBodyTextVisiable(true);
2022-07-20 13:52:07 +08:00
// setAppSupport(tr("Service & Support: %1").arg(SUPPORT));
connect(GlobelBackupInfo::inst().getGlobalSignals(), &GlobalSignals::themeIconChanged, this, [=](){
this->setAppIcon(QIcon::fromTheme(THEME_YHKYLIN_BACKUP_TOOLS, QIcon(":/images/yhkylin-backup-tools.png")));
2022-02-10 10:12:29 +08:00
});
2022-01-28 12:06:03 +08:00
}
QString AboutDialog::getBackupVersion()
{
QString version;
Utils::executeCMD("dpkg -l yhkylin-backup-tools | grep yhkylin-backup-tools", version);
// "ii yhkylin-backup-tools 4.0.13-kylin72 amd64 YHkylin backup tools\n"
QStringList fields = version.split(QRegularExpression("[ \t]+"));
if (fields.size() >= 3)
version = fields.at(2);
else
version = "none";
return version;
}
AboutDialog::~AboutDialog()
{
}
2022-02-22 15:25:28 +08:00