From bde4ab57354b81c5344e94df64ab6ab1cdbcc73f Mon Sep 17 00:00:00 2001 From: zhaominyong Date: Sat, 20 Nov 2021 18:47:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kybackup/module/systembackup.cpp | 17 ++++++++++++++++- kybackup/module/systembackup.h | 1 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/kybackup/module/systembackup.cpp b/kybackup/module/systembackup.cpp index 91e5107..b54af4d 100644 --- a/kybackup/module/systembackup.cpp +++ b/kybackup/module/systembackup.cpp @@ -424,6 +424,7 @@ void SystemBackup::on_checkEnv_start() } BackupWrapper backupWrapper; + backupWrapper.m_backupName = m_backupName; backupWrapper.m_type = BackupType::BACKUP_SYSTEM; backupWrapper.m_iPosition = m_isLocal ? BackupPosition::LOCAL : BackupPosition::UDISK; QString backupPath = Utils::getSysRootPath(); @@ -686,6 +687,9 @@ void SystemBackup::initFifthWidget() labelTip->setGeometry(101, 261, 520, 30); labelTip->setAlignment(Qt::AlignCenter); labelTip->setDeplayText(tr("Do not use computers in case of data loss")); + connect(this, &SystemBackup::backupWarnning, labelTip, [=](const QString& msg) { + labelTip->setDeplayText(msg); + }); // 取消按钮 MyPushButton *cancel = new MyPushButton(fifth); @@ -739,6 +743,7 @@ void SystemBackup::on_backup_start() } BackupWrapper backupWrapper; + backupWrapper.m_backupName = m_backupName; backupWrapper.m_type = BackupType::BACKUP_SYSTEM; backupWrapper.m_iPosition = m_isLocal ? BackupPosition::LOCAL : BackupPosition::UDISK; QString backupPath = Utils::getSysRootPath(); @@ -799,6 +804,16 @@ void SystemBackup::on_checkBackup_end(int result) // 请检查备份目录是否有写权限 errTip = tr("Please check backup partition permissions"); break; + case int(BackupResult::MKSQUASHFS_START_SUCCESS): + // 正压缩系统到本地磁盘,请耐心等待。。。 + errTip = tr("The system is being compressed to the local disk, Please wait patiently..."); + emit this->backupWarnning(errTip); + return; + case int(BackupResult::BACKUP_START_SUCCESS): + // 正在传输备份文件到移动设备,即将完成。。。 + errTip = tr("Transferring backup files to mobile device, about to be completed..."); + emit this->backupWarnning(errTip); + return; default: bRst = true; break; @@ -808,7 +823,7 @@ void SystemBackup::on_checkBackup_end(int result) GlobelBackupInfo::inst().setIsBusy(false); m_systemBackupState = SystemBackupState::IDEL; this->on_next_clicked(true); - emit checkBackupResult(bRst, errMsg, errTip); + emit this->checkBackupResult(bRst, errMsg, errTip); disconnect(m_pInterface, &ComKylinBackupManagerInterface::sendEnvCheckResult, this, &SystemBackup::on_checkEnv_end); disconnect(m_pInterface, &ComKylinBackupManagerInterface::progress, this, &SystemBackup::progress); disconnect(m_pInterface, &ComKylinBackupManagerInterface::backupFinished, this, &SystemBackup::on_backup_end); diff --git a/kybackup/module/systembackup.h b/kybackup/module/systembackup.h index d34feac..27a29ae 100644 --- a/kybackup/module/systembackup.h +++ b/kybackup/module/systembackup.h @@ -44,6 +44,7 @@ private: signals: void startCheckEnv(); void checkEnvResult(bool result, const QString &errMsg = "", const QString &errTip = ""); + void backupWarnning(const QString &warnning); void checkBackupResult(bool result, const QString &errMsg = "", const QString &errTip = ""); void startBackup(); void progress(int state, int rate);