Git/Hg SubmitEditor: Fix buttons in confirmation dialog for close

Don't show the "cancel" button.

Task-number: QTCREATORBUG-10451
Change-Id: I904794460ef15562eb8db630d33b8a2443b036eb
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Daniel Teske
2014-08-07 16:45:41 +02:00
parent 19e0215494
commit d8fad00ff9

View File

@@ -579,8 +579,13 @@ VcsBaseSubmitEditor::PromptSubmitResult
} }
} else { } else {
// Check failed. // Check failed.
QMessageBox::StandardButtons buttons;
if (canCommitOnFailure)
buttons = QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel;
else
buttons = QMessageBox::Yes|QMessageBox::No;
QMessageBox msgBox(QMessageBox::Question, title, checkFailureQuestion, QMessageBox msgBox(QMessageBox::Question, title, checkFailureQuestion,
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel, parent); buttons, parent);
msgBox.setDefaultButton(QMessageBox::Cancel); msgBox.setDefaultButton(QMessageBox::Cancel);
msgBox.setInformativeText(errorMessage); msgBox.setInformativeText(errorMessage);
msgBox.setMinimumWidth(checkDialogMinimumWidth); msgBox.setMinimumWidth(checkDialogMinimumWidth);