VCS: Add mnemonic for Close when closing submit editor on Windows

The default style on Windows doesn't have mnemonics.

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

View File

@@ -589,6 +589,8 @@ VcsBaseSubmitEditor::PromptSubmitResult
buttons |= QDialogButtonBox::Ok; buttons |= QDialogButtonBox::Ok;
mb.setStandardButtons(buttons); mb.setStandardButtons(buttons);
QPushButton *cancelButton = mb.button(QDialogButtonBox::Cancel); QPushButton *cancelButton = mb.button(QDialogButtonBox::Cancel);
// On Windows there is no mnemonic for Close. Set it explicitly.
mb.button(QDialogButtonBox::Close)->setText(tr("&Close"));
cancelButton->setText(tr("&Keep Editing")); cancelButton->setText(tr("&Keep Editing"));
cancelButton->setDefault(true); cancelButton->setDefault(true);
if (QPushButton *commitButton = mb.button(QDialogButtonBox::Ok)) { if (QPushButton *commitButton = mb.button(QDialogButtonBox::Ok)) {