From 7c8db79817ed436176f6055b5c6f8ccf6df16c4c Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Fri, 31 May 2013 12:52:53 +0200 Subject: 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 --- src/plugins/qmljseditor/qmljsfindreferences.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/plugins/qmljseditor/qmljsfindreferences.cpp') diff --git a/src/plugins/qmljseditor/qmljsfindreferences.cpp b/src/plugins/qmljseditor/qmljsfindreferences.cpp index e5aa05c2e7..af0d7b461b 100644 --- a/src/plugins/qmljseditor/qmljsfindreferences.cpp +++ b/src/plugins/qmljseditor/qmljsfindreferences.cpp @@ -985,11 +985,9 @@ void FindReferences::openEditor(const Find::SearchResultItem &item) { if (item.path.size() > 0) { Core::EditorManager::openEditorAt(QDir::fromNativeSeparators(item.path.first()), - item.lineNumber, item.textMarkPos, Core::Id(), - Core::EditorManager::ModeSwitch); + item.lineNumber, item.textMarkPos); } else { - Core::EditorManager::openEditor(QDir::fromNativeSeparators(item.text), - Core::Id(), Core::EditorManager::ModeSwitch); + Core::EditorManager::openEditor(QDir::fromNativeSeparators(item.text)); } } -- cgit v1.2.1