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

@@ -188,7 +188,8 @@ SubversionPlugin::SubversionPlugin() :
m_submitCurrentLogAction(0),
m_submitDiffAction(0),
m_submitUndoAction(0),
m_submitRedoAction(0)
m_submitRedoAction(0),
m_submitActionTriggered(false)
{
}
@@ -463,11 +464,14 @@ bool SubversionPlugin::editorAboutToClose(Core::IEditor *iEditor)
if (editorFile.absoluteFilePath() != changeFile.absoluteFilePath())
return true; // Oops?!
// 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 Subversion 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
@@ -922,6 +926,7 @@ void SubversionPlugin::slotDescribe()
void SubversionPlugin::submitCurrentLog()
{
m_submitActionTriggered = true;
Core::EditorManager::instance()->closeEditors(QList<Core::IEditor*>()
<< Core::EditorManager::instance()->currentEditor());
}