This commit is contained in:
parent
3fd680fc28
commit
9c0fa26b9d
|
@ -367,6 +367,7 @@ void SystemBackup::initThirdWidget()
|
|||
nextStep->setAutoRepeat(true);
|
||||
connect(nextStep, &MyPushButton::clicked, this, [=](bool checked) {
|
||||
this->on_next_clicked(checked);
|
||||
emit this->clearBackupName();
|
||||
});
|
||||
hlayoutCenterFont5->addWidget(nextStep);
|
||||
// 重新检测按钮
|
||||
|
@ -625,7 +626,7 @@ void SystemBackup::initForthWidget()
|
|||
labelError->setFontColor(Qt::red);
|
||||
labelError->setVisible(false);
|
||||
connect(editBackupName, &MyLineEdit::textChanged, this, [=](const QString &text) {
|
||||
if (this->isExistsBackupName(text)) {
|
||||
if (!text.isEmpty() && this->isExistsBackupName(text)) {
|
||||
labelError->setDeplayText(tr("Name already exists"));
|
||||
labelError->setVisible(true);
|
||||
} else {
|
||||
|
@ -633,6 +634,14 @@ void SystemBackup::initForthWidget()
|
|||
labelError->setVisible(false);
|
||||
}
|
||||
});
|
||||
connect(this, &SystemBackup::clearBackupName, this, [=]() {
|
||||
this->m_backupName = "";
|
||||
editBackupName->setText("");
|
||||
editBackupName->setPlaceholderText(QDateTime::currentDateTime().toString("yy-MM-dd hh:mm:ss"));
|
||||
editBackupName->setFocus();
|
||||
labelError->setDeplayText("");
|
||||
labelError->setVisible(false);
|
||||
});
|
||||
|
||||
// 上一步按钮
|
||||
MyPushButton *preStep = new MyPushButton(forth);
|
||||
|
@ -657,8 +666,16 @@ void SystemBackup::initForthWidget()
|
|||
if (this->m_backupName.isEmpty()) {
|
||||
this->m_backupName = editBackupName->placeholderText();
|
||||
}
|
||||
this->on_next_clicked(checked);
|
||||
emit this->startBackup();
|
||||
|
||||
if (this->isExistsBackupName(this->m_backupName)) {
|
||||
labelError->setDeplayText(tr("Name already exists"));
|
||||
labelError->setVisible(true);
|
||||
this->m_backupName = "";
|
||||
editBackupName->setFocus();
|
||||
} else {
|
||||
this->on_next_clicked(checked);
|
||||
emit this->startBackup();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
@ -48,6 +48,7 @@ signals:
|
|||
void checkBackupResult(bool result, const QString &errMsg = "", const QString &errTip = "");
|
||||
void startBackup();
|
||||
void progress(int state, int rate);
|
||||
void clearBackupName();
|
||||
|
||||
public slots:
|
||||
void on_pre_clicked(bool checked = false);
|
||||
|
|
Loading…
Reference in New Issue