diff options
author | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-03-20 10:16:18 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@nokia.com> | 2009-03-20 10:16:18 +0100 |
commit | 927578ed55b7390deb6488212de2b6384cf15adb (patch) | |
tree | e5dfbf44dfa77d830c4a957d804598c1c9afd6f2 /src/plugins/perforce | |
parent | 79d6c96d4e54954fee7e561104b6b8dbe6a2a85c (diff) |
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").
Diffstat (limited to 'src/plugins/perforce')
-rw-r--r-- | src/plugins/perforce/perforceplugin.cpp | 22 | ||||
-rw-r--r-- | src/plugins/perforce/perforceplugin.h | 3 |
2 files changed, 18 insertions, 7 deletions
diff --git a/src/plugins/perforce/perforceplugin.cpp b/src/plugins/perforce/perforceplugin.cpp index 2b068e2982..25ea4524a6 100644 --- a/src/plugins/perforce/perforceplugin.cpp +++ b/src/plugins/perforce/perforceplugin.cpp @@ -175,13 +175,18 @@ PerforcePlugin::PerforcePlugin() : m_diffProjectAction(0), m_diffAllAction(0), m_resolveAction(0), - m_submitAction(0), + m_submitAction(0), m_pendingAction(0), m_describeAction(0), m_annotateCurrentAction(0), m_annotateAction(0), m_filelogCurrentAction(0), m_filelogAction(0), + m_submitCurrentLogAction(0), + m_submitActionTriggered(false), + m_diffSelectedFiles(0), + m_undoAction(0), + m_redoAction(0), m_changeTmpFile(0), #ifdef USE_P4_API m_workbenchClientUser(0), @@ -949,6 +954,7 @@ void PerforcePlugin::describe(const QString & source, const QString &n) void PerforcePlugin::submitCurrentLog() { + m_submitActionTriggered = true; Core::EditorManager *em = Core::EditorManager::instance(); em->closeEditors(QList<Core::IEditor*>() << em->currentEditor()); } @@ -966,11 +972,15 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) return true; QFileInfo editorFile(fileIFace->fileName()); QFileInfo changeFile(m_changeTmpFile->fileName()); - if (editorFile.absoluteFilePath() == changeFile.absoluteFilePath()) { + if (editorFile.absoluteFilePath() == changeFile.absoluteFilePath()) { + // Prompt the user. Force a prompt unless submit was actually invoked (that + // is, the editor was closed or shutdown). const VCSBase::VCSBaseSubmitEditor::PromptSubmitResult answer = perforceEditor->promptSubmit(tr("Closing p4 Editor"), tr("Do you want to submit this change list?"), - tr("The commit message check failed. Do you want to submit this change list")); + tr("The commit message check failed. Do you want to submit this change list"), + !m_submitActionTriggered); + m_submitActionTriggered = false; if (answer == VCSBase::VCSBaseSubmitEditor::SubmitCanceled) return false; @@ -1010,10 +1020,10 @@ bool PerforcePlugin::editorAboutToClose(Core::IEditor *editor) m_changeTmpFile = 0; return false; } - QString output = QString::fromUtf8(proc.readAll()); + const QString output = QString::fromUtf8(proc.readAll()); showOutput(output); - if (output.contains("Out of date files must be resolved or reverted"), true) { - QMessageBox::warning(editor->widget(), "Pending change", "Could not submit the change, because your workspace was out of date. Created a pending submit instead."); + if (output.contains(QLatin1String("Out of date files must be resolved or reverted)"))) { + QMessageBox::warning(editor->widget(), tr("Pending change"), tr("Could not submit the change, because your workspace was out of date. Created a pending submit instead.")); } QApplication::restoreOverrideCursor(); } diff --git a/src/plugins/perforce/perforceplugin.h b/src/plugins/perforce/perforceplugin.h index 919ab0c6d0..8ac7188994 100644 --- a/src/plugins/perforce/perforceplugin.h +++ b/src/plugins/perforce/perforceplugin.h @@ -190,6 +190,7 @@ private: QAction *m_filelogCurrentAction; QAction *m_filelogAction; QAction *m_submitCurrentLogAction; + bool m_submitActionTriggered; QAction *m_diffSelectedFiles; QAction *m_undoAction; @@ -232,7 +233,7 @@ private: PerforceVersionControl *m_versionControl; PerforceSettings m_settings; - friend class PerforceOutputWindow; + friend class PerforceOutputWindow; // needs openFiles() }; } // namespace Perforce |