Make the "prompt to submit" setting a per-plugin one.

Provide a checkable message box to be able to turn
prompting off when asked.
This commit is contained in:
Friedemann Kleint
2009-06-19 16:34:38 +02:00
parent e05505613a
commit 2508fa03a0
25 changed files with 554 additions and 69 deletions

View File

@@ -690,12 +690,14 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
return true;
// Prompt user. Force a prompt unless submit was actually invoked (that
// is, the editor was closed or shutdown).
GitSettings settings = m_gitClient->settings();
const bool wantedPrompt = settings.promptToSubmit;
const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer =
editor->promptSubmit(tr("Closing git editor"),
tr("Do you want to commit the change?"),
tr("The commit message check failed. Do you want to commit the change?"),
!m_submitActionTriggered);
m_submitActionTriggered = false;
&settings.promptToSubmit, !m_submitActionTriggered);
m_submitActionTriggered = false;
switch (answer) {
case VCSBase::VCSBaseSubmitEditor::SubmitCanceled:
return false; // Keep editing and change file
@@ -705,6 +707,8 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
default:
break;
}
if (wantedPrompt != settings.promptToSubmit)
m_gitClient->setSettings(settings);
// Go ahead!
const QStringList fileList = editor->checkedFiles();
if (Git::Constants::debug)