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

@ -696,7 +696,7 @@ void DatabaseWidget::updateMasterKey(bool accepted)
QApplication::restoreOverrideCursor();
if (!result) {
MessageBox::critical(this, tr("Error"), tr("Unable to calculate master key"));
m_messageWidget->showMessage(tr("Unable to calculate master key"), MessageWidget::Error);
return;
}
}
@ -736,14 +736,14 @@ void DatabaseWidget::mergeDatabase(bool accepted)
{
if (accepted) {
if (!m_db) {
MessageBox::critical(this, tr("Error"), tr("No current database."));
m_messageWidget->showMessage(tr("No current database."), MessageWidget::Error);
return;
}
Database* srcDb = static_cast<DatabaseOpenWidget*>(sender())->database();
if (!srcDb) {
MessageBox::critical(this, tr("Error"), tr("No source database, nothing to do."));
m_messageWidget->showMessage(tr("No source database, nothing to do."), MessageWidget::Error);
return;
}
@ -1093,15 +1093,15 @@ void DatabaseWidget::reloadDatabaseFile()
}
else {
MessageBox::critical(this, tr("Autoreload Failed"),
tr("Could not parse or unlock the new database file while attempting"
" to autoreload this database."));
m_messageWidget->showMessage(
tr("Could not parse or unlock the new database file while attempting"
" to autoreload this database."), MessageWidget::Error);
}
}
else {
MessageBox::critical(this, tr("Autoreload Failed"),
tr("Could not open the new database file while attempting to autoreload"
" this database."));
m_messageWidget->showMessage(
tr("Could not open the new database file while attempting to autoreload this database."),
MessageWidget::Error);
}
// Rewatch the database file