diff options
author | Eike Ziller <[email protected]> | 2013-05-31 12:52:53 +0200 |
---|---|---|
committer | Eike Ziller <[email protected]> | 2013-06-05 09:43:14 +0200 |
commit | 7c8db79817ed436176f6055b5c6f8ccf6df16c4c (patch) | |
tree | 28c65055a97c872468055db6e96fb51f70e83f1d /src/plugins/cvs/cvsplugin.cpp | |
parent | f99ce422b475c000e1bbdadf13da232dd54d9cca (diff) |
Switch less often to edit mode
This change
* Removes IMode::type, ModeManager::activateModeType, and
IEditor::preferredModeType, and adds IEditor::isDesignModePreferred
instead
* Adapts the mode switching code in EditorManager to handle multiple
windows, for example switching to edit mode should only happen if
the editor/view is in the main window. Otherwise the editor window
should be raised and focused
* Renames EditorManager::NoActivate --> DoNotChangeCurrentEditor
* Reverts the EditorManager::ModeSwitch logic to switch mode or
make the current editor visible by default, introducing
DoNotMakeVisible flag instead
* Fixes a few instances where EditorManager::ModeSwitch should have been
used
One non-trivial problem left: If you open a .ui file and switch to an
external editor window, edit mode is activated, because the current
editor no longer is a .ui file, which means that the design mode gets
deactivated.
Change-Id: I76c5c2391eb4090143b778fb103acff3a5a1ff41
Reviewed-by: David Schulz <[email protected]>
Diffstat (limited to 'src/plugins/cvs/cvsplugin.cpp')
-rw-r--r-- | src/plugins/cvs/cvsplugin.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/cvs/cvsplugin.cpp b/src/plugins/cvs/cvsplugin.cpp index b3cadb5e173..85ffd0a65c7 100644 --- a/src/plugins/cvs/cvsplugin.cpp +++ b/src/plugins/cvs/cvsplugin.cpp @@ -592,7 +592,7 @@ void CvsPlugin::cvsDiff(const CvsDiffParameters &p) const QString tag = VcsBaseEditorWidget::editorTag(DiffOutput, p.workingDir, p.files); if (IEditor *existingEditor = VcsBaseEditorWidget::locateEditorByTag(tag)) { existingEditor->createNew(output); - EditorManager::activateEditor(existingEditor, EditorManager::ModeSwitch); + EditorManager::activateEditor(existingEditor); setDiffBaseDirectory(existingEditor, p.workingDir); return; } @@ -615,8 +615,7 @@ void CvsPlugin::cvsDiff(const CvsDiffParameters &p) CvsSubmitEditor *CvsPlugin::openCVSSubmitEditor(const QString &fileName) { - IEditor *editor = EditorManager::openEditor(fileName, Constants::CVSCOMMITEDITOR_ID, - EditorManager::ModeSwitch); + IEditor *editor = EditorManager::openEditor(fileName, Constants::CVSCOMMITEDITOR_ID); CvsSubmitEditor *submitEditor = qobject_cast<CvsSubmitEditor*>(editor); QTC_CHECK(submitEditor); submitEditor->registerActions(m_submitUndoAction, m_submitRedoAction, m_submitCurrentLogAction, m_submitDiffAction); @@ -861,7 +860,7 @@ void CvsPlugin::filelog(const QString &workingDir, const QString tag = VcsBaseEditorWidget::editorTag(LogOutput, workingDir, files); if (Core::IEditor *editor = VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); - Core::EditorManager::activateEditor(editor, Core::EditorManager::ModeSwitch); + Core::EditorManager::activateEditor(editor); } else { const QString title = QString::fromLatin1("cvs log %1").arg(id); Core::IEditor *newEditor = showOutputInEditor(title, response.stdOut, LogOutput, source, codec); @@ -1004,7 +1003,7 @@ void CvsPlugin::annotate(const QString &workingDir, const QString &file, if (IEditor *editor = VcsBaseEditorWidget::locateEditorByTag(tag)) { editor->createNew(response.stdOut); VcsBaseEditorWidget::gotoLineOfEditor(editor, lineNumber); - EditorManager::activateEditor(editor, EditorManager::ModeSwitch); + EditorManager::activateEditor(editor); } else { const QString title = QString::fromLatin1("cvs annotate %1").arg(id); IEditor *newEditor = showOutputInEditor(title, response.stdOut, AnnotateOutput, source, codec); @@ -1199,7 +1198,7 @@ bool CvsPlugin::describe(const QString &repositoryPath, const QString commitId = entries.front().revisions.front().commitId; if (IEditor *editor = VcsBaseEditorWidget::locateEditorByTag(commitId)) { editor->createNew(output); - EditorManager::activateEditor(editor, EditorManager::ModeSwitch); + EditorManager::activateEditor(editor); setDiffBaseDirectory(editor, repositoryPath); } else { const QString title = QString::fromLatin1("cvs describe %1").arg(commitId); @@ -1285,7 +1284,7 @@ IEditor *CvsPlugin::showOutputInEditor(const QString& title, const QString &outp if (codec) e->setCodec(codec); IEditor *ie = e->editor(); - EditorManager::activateEditor(ie, EditorManager::ModeSwitch); + EditorManager::activateEditor(ie); return ie; } |