This commit is contained in:
zhaominyong 2021-11-20 18:47:42 +08:00
parent 984157a251
commit bde4ab5735
2 changed files with 17 additions and 1 deletions

View File

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

View File

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