Show inline message when unable to load the Key File.

This commit is contained in:
Pedro Alves authored and Janek Bevendorff committed 2017-02-10 02:25:55 +01:00
1 parent 3c4af1a194
commit 8fa070f01c
1 file changed
+4 -4
+4 -4
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);