Fixes: Polish submit message checking.

Details: Use a global model for nicknames that is shared by all dialogs to solve the updating  problems. Make p4 plugin submit work again. Force a submit prompt in case of shutdown or editor close (as opposed to user clickling on "Submit").
This commit is contained in:
Friedemann Kleint
2009-03-20 10:16:18 +01:00
parent 79d6c96d4e
commit 927578ed55
12 changed files with 160 additions and 82 deletions

View File

@@ -142,7 +142,8 @@ GitPlugin::GitPlugin() :
m_coreListener(0),
m_submitEditorFactory(0),
m_versionControl(0),
m_changeTmpFile(0)
m_changeTmpFile(0),
m_submitActionTriggered(false)
{
m_instance = this;
}
@@ -651,6 +652,7 @@ Core::IEditor *GitPlugin::openSubmitEditor(const QString &fileName, const Commit
void GitPlugin::submitCurrentLog()
{
// Close the submit editor
m_submitActionTriggered = true;
QList<Core::IEditor*> editors;
editors.push_back(m_core->editorManager()->currentEditor());
m_core->editorManager()->closeEditors(editors);
@@ -672,11 +674,14 @@ bool GitPlugin::editorAboutToClose(Core::IEditor *iEditor)
// Paranoia!
if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath())
return true;
// Prompt user.
// Prompt user. Force a prompt unless submit was actually invoked (that
// is, the editor was closed or shutdown).
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?"));
tr("The commit message check failed. Do you want to commit the change?"),
!m_submitActionTriggered);
m_submitActionTriggered = false;
switch (answer) {
case VCSBase::VCSBaseSubmitEditor::SubmitCanceled:
return false; // Keep editing and change file