Merge pull request #7948 from spycrab/open_failed_warn

Qt/GameConfigEdit: Show warning if opening in an external editor fails
This commit is contained in:
spycrab 2019-03-31 03:37:54 +02:00 committed by GitHub
commit 0866ec3fb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -260,7 +260,12 @@ void GameConfigEdit::OpenExternalEditor()
file.close();
}
QDesktopServices::openUrl(QUrl::fromLocalFile(m_path));
if (!QDesktopServices::openUrl(QUrl::fromLocalFile(m_path)))
{
ModalMessageBox::warning(this, tr("Error"),
tr("Failed to open file in external editor.\nMake sure there's an "
"application assigned to open INI files."));
}
}
void GameConfigEdit::keyPressEvent(QKeyEvent* e)