Show inline message when unable to load the Key File.

This commit is contained in:
Pedro Alves 2015-01-19 23:47:57 +00:00 committed by Janek Bevendorff
parent 3c4af1a194
commit 8fa070f01c
No known key found for this signature in database
GPG Key ID: CFEC2F6850BFFA53

View File

@ -121,10 +121,10 @@ void ChangeMasterKeyWidget::generateKey()
if (m_ui->keyFileGroup->isChecked()) {
FileKey fileKey;
QString errorMsg;
if (!fileKey.load(m_ui->keyFileCombo->currentText(), &errorMsg)) {
MessageBox::critical(this, tr("Failed to set key file"),
tr("Failed to set %1 as the Key file:\n%2")
.arg(m_ui->keyFileCombo->currentText(), 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));
return;
}
m_key.addKey(fileKey);