forked from qt-creator/qt-creator
Git: Close submit editor if all changes were committed externally
Change-Id: Iae4e9d52aed333def0e5f0c56bca9c68a38430a4 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
e4e43352a8
commit
e427eab068
@@ -916,11 +916,15 @@ bool GitPlugin::submitEditorAboutToClose(VcsBase::VcsBaseSubmitEditor *submitEdi
|
||||
// Prompt user. Force a prompt unless submit was actually invoked (that
|
||||
// is, the editor was closed or shutdown).
|
||||
bool *promptData = m_settings.boolPointer(GitSettings::promptOnSubmitKey);
|
||||
const VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer =
|
||||
editor->promptSubmit(tr("Closing Git Editor"),
|
||||
tr("Do you want to commit the change?"),
|
||||
tr("Git will not accept this commit. Do you want to continue to edit it?"),
|
||||
promptData, !m_submitActionTriggered, false);
|
||||
VcsBase::VcsBaseSubmitEditor::PromptSubmitResult answer;
|
||||
if (editor->forceClose()) {
|
||||
answer = VcsBase::VcsBaseSubmitEditor::SubmitDiscarded;
|
||||
} else {
|
||||
answer = editor->promptSubmit(tr("Closing Git Editor"),
|
||||
tr("Do you want to commit the change?"),
|
||||
tr("Git will not accept this commit. Do you want to continue to edit it?"),
|
||||
promptData, !m_submitActionTriggered, false);
|
||||
}
|
||||
m_submitActionTriggered = false;
|
||||
switch (answer) {
|
||||
case VcsBase::VcsBaseSubmitEditor::SubmitCanceled:
|
||||
|
Reference in New Issue
Block a user