Use KMessageWidget also for new error messages

This commit is contained in:
Janek Bevendorff 2017-01-15 01:44:48 +01:00
parent b6ea06ba24
commit 41d5111684
No known key found for this signature in database
GPG key ID: CFEC2F6850BFFA53
5 changed files with 23 additions and 23 deletions

View file

@ -761,7 +761,7 @@ void MainWindow::repairDatabase()
if (fileName.isEmpty()) {
return;
}
QScopedPointer<QDialog> dialog(new QDialog(this));
DatabaseRepairWidget* dbRepairWidget = new DatabaseRepairWidget(dialog.data());
connect(dbRepairWidget, SIGNAL(success()), dialog.data(), SLOT(accept()));
@ -776,8 +776,9 @@ void MainWindow::repairDatabase()
KeePass2Writer writer;
writer.writeDatabase(saveFileName, dbRepairWidget->database());
if (writer.hasError()) {
QMessageBox::critical(this, tr("Error"),
tr("Writing the database failed.").append("\n\n").append(writer.errorString()));
displayGlobalMessage(
tr("Writing the database failed.").append("\n").append(writer.errorString()),
MessageWidget::Error);
}
}
}