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

@ -54,7 +54,7 @@ void ChangeMasterKeyWidget::createKeyFile()
QString errorMsg;
bool created = FileKey::create(fileName, &errorMsg);
if (!created) {
m_ui->messageWidget->showMessageError(tr("Unable to create Key File : ").append(errorMsg));
m_ui->messageWidget->showMessage(tr("Unable to create Key File : ").append(errorMsg), MessageWidget::Error);
}
else {
m_ui->keyFileCombo->setEditText(fileName);
@ -112,7 +112,7 @@ void ChangeMasterKeyWidget::generateKey()
m_key.addKey(PasswordKey(m_ui->enterPasswordEdit->text()));
}
else {
m_ui->messageWidget->showMessageError(tr("Different passwords supplied."));
m_ui->messageWidget->showMessage(tr("Different passwords supplied."), MessageWidget::Error);
m_ui->enterPasswordEdit->setText("");
m_ui->repeatPasswordEdit->setText("");
return;
@ -123,13 +123,14 @@ void ChangeMasterKeyWidget::generateKey()
QString errorMsg;
QString fileKeyName = m_ui->keyFileCombo->currentText();
if (!fileKey.load(fileKeyName, &errorMsg)) {
m_ui->messageWidget->showMessageError(
tr("Failed to set %1 as the Key file:\n%2: ").arg(fileKeyName, errorMsg));
m_ui->messageWidget->showMessage(
tr("Failed to set %1 as the Key file:\n%2").arg(fileKeyName, errorMsg), MessageWidget::Error);
return;
}
m_key.addKey(fileKey);
}
m_ui->messageWidget->hideMessage();
Q_EMIT editFinished(true);
}