This commit is contained in:
parent
44aa5419b3
commit
2ada4e6e8d
|
@ -424,7 +424,7 @@ bool SystemBackupProxy::backupSystem()
|
|||
connect(m_p, &RsyncPathToDirProcess::finished, this, [&](bool result) {
|
||||
if (result) {
|
||||
m_backupPoint.m_state = BACKUP_PARSE_STATE_SUCCESS_STRTING;
|
||||
m_backupPoint.m_size = Utils::StringBySize(Utils::getDirOrFileSize(m_destPath));
|
||||
// m_backupPoint.m_size = Utils::StringBySize(Utils::getDirOrFileSize(m_destPath));
|
||||
QString xmlPath = Utils::getSysRootPath() + BACKUP_XML_PATH;
|
||||
xmlPath.replace("//", "/");
|
||||
ParseBackupList parse(xmlPath);
|
||||
|
|
|
@ -765,34 +765,76 @@ void SystemBackup::initFifthWidget()
|
|||
MyLabel *label4 = new MyLabel(tr("finished"), fifth);
|
||||
label4->setGeometry(551, 72, 164, 30);
|
||||
|
||||
// ------------ 中部布局begin-------------
|
||||
QVBoxLayout *vlayout = new QVBoxLayout;
|
||||
vlayout->addSpacing(180);
|
||||
QHBoxLayout *hlayout = new QHBoxLayout;
|
||||
hlayout->addStretch();
|
||||
|
||||
QWidget *centerFont = new QWidget(fifth);
|
||||
QVBoxLayout *vlayoutCenterFont = new QVBoxLayout;
|
||||
|
||||
// 中部第一行
|
||||
QHBoxLayout *hlayoutCenterFont1 = new QHBoxLayout;
|
||||
// 检测等待图标
|
||||
QLabel *loadingGif = new QLabel(fifth);
|
||||
QLabel *loadingGif = new QLabel(centerFont);
|
||||
// 环境检测等待动画
|
||||
QMovie *movie = new QMovie(":/images/loading.gif", QByteArray(), fifth);
|
||||
QMovie *movie = new QMovie(":/images/loading.gif", QByteArray(), centerFont);
|
||||
loadingGif->setMovie(movie);
|
||||
loadingGif->setGeometry(260, 190, 20, 20);
|
||||
|
||||
loadingGif->setFixedSize(20,20);
|
||||
// 进度条
|
||||
RingsProgressbar *progressBar = new RingsProgressbar(fifth);
|
||||
progressBar->setGeometry(301, 151, 100, 100);
|
||||
RingsProgressbar *progressBar = new RingsProgressbar(centerFont);
|
||||
progressBar->setFixedSize(100, 100);
|
||||
hlayoutCenterFont1->addStretch();
|
||||
hlayoutCenterFont1->addWidget(loadingGif);
|
||||
hlayoutCenterFont1->addWidget(progressBar);
|
||||
hlayoutCenterFont1->addStretch();
|
||||
|
||||
// 第二行
|
||||
QHBoxLayout *hlayoutCenterFont2 = new QHBoxLayout;
|
||||
// 提醒
|
||||
MyLabel *labelTip = new MyLabel(fifth);
|
||||
labelTip->setGeometry(101, 261, 520, 30);
|
||||
MyLabel *labelTip = new MyLabel(centerFont);
|
||||
labelTip->setAlignment(Qt::AlignCenter);
|
||||
labelTip->setIsOriginal(true);
|
||||
labelTip->setFontWordWrap(true);
|
||||
labelTip->setMinimumWidth(700);
|
||||
// 不要使用电脑,以防数据丢失
|
||||
labelTip->setDeplayText(tr("Do not use computers in case of data loss"));
|
||||
connect(this, &SystemBackup::backupWarnning, labelTip, [=](const QString& msg) {
|
||||
labelTip->setDeplayText(msg);
|
||||
});
|
||||
hlayoutCenterFont2->addStretch();
|
||||
hlayoutCenterFont2->addWidget(labelTip);
|
||||
hlayoutCenterFont2->addStretch();
|
||||
|
||||
// 第三行
|
||||
QHBoxLayout *hlayoutCenterFont3 = new QHBoxLayout;
|
||||
// 取消按钮
|
||||
MyPushButton *cancel = new MyPushButton(fifth);
|
||||
cancel->setGeometry(310, 330, 97, 36);
|
||||
cancel->setFixedSize(97, 36);
|
||||
cancel->setText(tr("cancel"));
|
||||
cancel->setEnabled(true);
|
||||
cancel->setAutoRepeat(true);
|
||||
hlayoutCenterFont3->addStretch();
|
||||
hlayoutCenterFont3->addWidget(cancel);
|
||||
hlayoutCenterFont3->addStretch();
|
||||
|
||||
vlayoutCenterFont->addLayout(hlayoutCenterFont1);
|
||||
vlayoutCenterFont->addLayout(hlayoutCenterFont2);
|
||||
vlayoutCenterFont->addSpacing(60);
|
||||
vlayoutCenterFont->addLayout(hlayoutCenterFont3);
|
||||
vlayoutCenterFont->addStretch();
|
||||
centerFont->setLayout(vlayoutCenterFont);
|
||||
|
||||
centerFont->setLayout(vlayoutCenterFont);
|
||||
hlayout->addWidget(centerFont);
|
||||
hlayout->addStretch();
|
||||
vlayout->addLayout(hlayout);
|
||||
vlayout->addStretch();
|
||||
fifth->setLayout(vlayout);
|
||||
|
||||
// ------------ 中部布局end-------------
|
||||
|
||||
connect(this, &SystemBackup::backupWarnning, labelTip, [=](const QString& msg) {
|
||||
labelTip->setDeplayText(msg);
|
||||
});
|
||||
|
||||
// 开始备份
|
||||
connect(this, &SystemBackup::startBackup, this, [=] {
|
||||
|
@ -1071,7 +1113,6 @@ void SystemBackup::initLastWidget()
|
|||
hlayoutCenterFont5->addStretch();
|
||||
vlayoutCenterFont->addLayout(hlayoutCenterFont5);
|
||||
|
||||
|
||||
centerFont->setLayout(vlayoutCenterFont);
|
||||
hlayout->addWidget(centerFont);
|
||||
hlayout->addStretch();
|
||||
|
|
Loading…
Reference in New Issue