From 2c9bceab416ec5aeb4d9c33d31b29e67c9d97417 Mon Sep 17 00:00:00 2001 From: zhaominyong Date: Thu, 20 Jan 2022 13:42:08 +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/databackup.cpp | 17 +++++++++-------- kybackup/module/datarestore.cpp | 2 +- kybackup/module/ghostimage.cpp | 18 +++++++++--------- kybackup/module/systembackup.cpp | 18 +++++++++--------- kybackup/module/systemrestore.cpp | 16 ++++++++++++++++ 5 files changed, 44 insertions(+), 27 deletions(-) diff --git a/kybackup/module/databackup.cpp b/kybackup/module/databackup.cpp index 8abe81c..8448740 100755 --- a/kybackup/module/databackup.cpp +++ b/kybackup/module/databackup.cpp @@ -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); } }); diff --git a/kybackup/module/datarestore.cpp b/kybackup/module/datarestore.cpp index 27eca03..5fc9294 100755 --- a/kybackup/module/datarestore.cpp +++ b/kybackup/module/datarestore.cpp @@ -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); diff --git a/kybackup/module/ghostimage.cpp b/kybackup/module/ghostimage.cpp index ed1fd01..0bd484d 100755 --- a/kybackup/module/ghostimage.cpp +++ b/kybackup/module/ghostimage.cpp @@ -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); } }); diff --git a/kybackup/module/systembackup.cpp b/kybackup/module/systembackup.cpp index f381228..fb95901 100755 --- a/kybackup/module/systembackup.cpp +++ b/kybackup/module/systembackup.cpp @@ -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); } }); diff --git a/kybackup/module/systemrestore.cpp b/kybackup/module/systemrestore.cpp index e0cb19f..3ee64fd 100755 --- a/kybackup/module/systemrestore.cpp +++ b/kybackup/module/systemrestore.cpp @@ -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); }