Replace MessageBox with MessageWidget in remaining classes.

Chnage to one method to set MessageWidget text passing type as
parameter.
Only messages with questions requiring user input reamin using
MessageBox dialog.
Use signal/slots to set message in MessageWidget and hide message,
signal/slots only used when required.Maybe need to change all calls to
signals/slots in the future.
This commit is contained in:
Pedro Alves 2015-01-21 16:19:05 +00:00 committed by Janek Bevendorff
parent c2826bb1af
commit 13c85cdfcb
No known key found for this signature in database
GPG key ID: CFEC2F6850BFFA53
20 changed files with 169 additions and 77 deletions

View file

@ -108,8 +108,8 @@ void DatabaseOpenWidget::openDatabase()
QFile file(m_filename);
if (!file.open(QIODevice::ReadOnly)) {
m_ui->messageWidget->showMessageError(
tr("Unable to open the database.").append("\n").append(file.errorString()));
m_ui->messageWidget->showMessage(
tr("Unable to open the database.").append("\n").append(file.errorString()), MessageWidget::Error);
return;
}
if (m_db) {
@ -126,8 +126,8 @@ void DatabaseOpenWidget::openDatabase()
Q_EMIT editFinished(true);
}
else {
m_ui->messageWidget->showMessageError(tr("Unable to open the database.")
.append("\n").append(reader.errorString()));
m_ui->messageWidget->showMessage(tr("Unable to open the database.")
.append("\n").append(reader.errorString()), MessageWidget::Error);
m_ui->editPassword->clear();
}
}
@ -147,7 +147,8 @@ CompositeKey DatabaseOpenWidget::databaseKey()
QString keyFilename = m_ui->comboKeyFile->currentText();
QString errorMsg;
if (!key.load(keyFilename, &errorMsg)) {
m_ui->messageWidget->showMessageError(tr("Can't open key file").append(":\n").append(errorMsg));
m_ui->messageWidget->showMessage(tr("Can't open key file").append(":\n")
.append(errorMsg), MessageWidget::Error);
return CompositeKey();
}
masterKey.addKey(key);