VCS: Make "Keep Editing" the default only when closing the editor

If the prompt is displayed on button press, the default is Commit.

Task-number: QTCREATORBUG-18799
Change-Id: I706a2700e08bb45f44019a0fe8d44365438ee9f3
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
Orgad Shaneh
2019-01-21 15:30:03 +02:00
committed by Orgad Shaneh
parent 06da56335a
commit 620086109a

View File

@@ -592,7 +592,9 @@ VcsBaseSubmitEditor::PromptSubmitResult
// On Windows there is no mnemonic for Close. Set it explicitly.
mb.button(QDialogButtonBox::Close)->setText(tr("&Close"));
cancelButton->setText(tr("&Keep Editing"));
cancelButton->setDefault(true);
// forcePrompt is true when the editor is closed, and false when triggered by the submit action
if (forcePrompt)
cancelButton->setDefault(true);
if (QPushButton *commitButton = mb.button(QDialogButtonBox::Ok)) {
commitButton->setText(withUnusedMnemonic(commitName,
{cancelButton, mb.button(QDialogButtonBox::Close)}));