This commit is contained in:
zhaominyong 2022-01-20 13:42:08 +08:00
parent fb0489e359
commit 2c9bceab41
5 changed files with 44 additions and 27 deletions

View File

@ -1534,6 +1534,14 @@ void DataBackup::initLastWidget()
// 第五行
QHBoxLayout *hlayoutCenterFont5 = new QHBoxLayout;
hlayoutCenterFont5->addStretch();
// 返回首页
MyPushButton *homePage = new MyPushButton(centerFont);
homePage->setFixedSize(97, 36);
homePage->setText(tr("home page"));
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addSpacing(20);
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
@ -1542,13 +1550,6 @@ void DataBackup::initLastWidget()
retry->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(retry);
hlayoutCenterFont5->addSpacing(20);
// 返回首页
MyPushButton *homePage = new MyPushButton(centerFont);
homePage->setFixedSize(97, 36);
homePage->setText(tr("home page"));
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addStretch();
vlayoutCenterFont->addLayout(hlayoutCenterFont5);
@ -1588,7 +1589,7 @@ void DataBackup::initLastWidget()
labelError2->setDeplayText(errTip);
retry->setVisible(true);
homePage->setVisible(false);
homePage->setVisible(true);
}
});

View File

@ -874,7 +874,7 @@ void DataRestore::initLastWidget()
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addSpacing(20);
hlayoutCenterFont5->addSpacing(20);
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);

View File

@ -1039,14 +1039,6 @@ void GhostImage::initLastWidget()
// 第五行
QHBoxLayout *hlayoutCenterFont5 = new QHBoxLayout;
hlayoutCenterFont5->addStretch();
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
retry->setText(tr("retry"));
retry->setEnabled(true);
retry->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(retry);
hlayoutCenterFont5->addSpacing(20);
// 返回首页
MyPushButton *homePage = new MyPushButton(centerFont);
homePage->setFixedSize(97, 36);
@ -1054,6 +1046,14 @@ void GhostImage::initLastWidget()
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addSpacing(20);
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
retry->setText(tr("retry"));
retry->setEnabled(true);
retry->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(retry);
hlayoutCenterFont5->addStretch();
vlayoutCenterFont->addLayout(hlayoutCenterFont5);
@ -1106,7 +1106,7 @@ void GhostImage::initLastWidget()
labelError2->setDeplayText(errTip);
retry->setVisible(true);
homePage->setVisible(false);
homePage->setVisible(true);
}
});

View File

@ -1151,14 +1151,6 @@ void SystemBackup::initLastWidget()
// 第五行
QHBoxLayout *hlayoutCenterFont5 = new QHBoxLayout;
hlayoutCenterFont5->addStretch();
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
retry->setText(tr("retry"));
retry->setEnabled(true);
retry->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(retry);
hlayoutCenterFont5->addSpacing(20);
// 返回首页
MyPushButton *homePage = new MyPushButton(centerFont);
homePage->setFixedSize(97, 36);
@ -1166,6 +1158,14 @@ void SystemBackup::initLastWidget()
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addSpacing(20);
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
retry->setText(tr("retry"));
retry->setEnabled(true);
retry->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(retry);
hlayoutCenterFont5->addStretch();
vlayoutCenterFont->addLayout(hlayoutCenterFont5);
@ -1205,7 +1205,7 @@ void SystemBackup::initLastWidget()
labelError2->setDeplayText(errTip);
retry->setVisible(true);
homePage->setVisible(false);
homePage->setVisible(true);
}
});

View File

@ -894,6 +894,14 @@ void SystemRestore::initLastWidget()
// 第五行
QHBoxLayout *hlayoutCenterFont5 = new QHBoxLayout;
hlayoutCenterFont5->addSpacing(100);
// 返回首页
MyPushButton *homePage = new MyPushButton(centerFont);
homePage->setFixedSize(97, 36);
homePage->setText(tr("home page"));
homePage->setEnabled(true);
homePage->setAutoRepeat(true);
hlayoutCenterFont5->addWidget(homePage);
hlayoutCenterFont5->addSpacing(20);
// 再试一次
MyPushButton *retry = new MyPushButton(centerFont);
retry->setFixedSize(97, 36);
@ -938,6 +946,7 @@ void SystemRestore::initLastWidget()
labelError1->setDeplayText(tr("The system will automatically reboot"));
labelError2->setVisible(false);
retry->setVisible(false);
homePage->setVisible(true);
} else {
QIcon icon = QIcon::fromTheme("dialog-error.png", QIcon(":/symbos/dialog-error.png"));
resultLogo->setPixmap(icon.pixmap(QSize(20,20)));
@ -949,6 +958,7 @@ void SystemRestore::initLastWidget()
labelError1->setDeplayText(errMsg);
labelError2->setDeplayText(errTip);
retry->setVisible(true);
homePage->setVisible(true);
}
});
@ -959,6 +969,12 @@ void SystemRestore::initLastWidget()
emit this->startRestore();
});
// 返回首页
connect(homePage, &MyPushButton::clicked, this, [=](bool checked) {
Q_UNUSED(checked)
this->setCurrentIndex(SystemRestorePage::HOME_PAGE);
});
addWidget(last);
}