EditorManager: Introduce flag to not switch to design mode

Change-Id: I004c00e9f9dd61cc5495790b8e83dd857b404193
Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com>
This commit is contained in:
Eike Ziller
2014-11-18 08:52:44 +01:00
parent 7e1b512f31
commit 8b57492f35
2 changed files with 3 additions and 2 deletions

View File

@@ -1006,7 +1006,7 @@ IEditor *EditorManagerPrivate::activateEditor(EditorView *view, IEditor *editor,
setCurrentEditor(editor, (flags & EditorManager::IgnoreNavigationHistory)); setCurrentEditor(editor, (flags & EditorManager::IgnoreNavigationHistory));
if (!(flags & EditorManager::DoNotMakeVisible)) { if (!(flags & EditorManager::DoNotMakeVisible)) {
// switch to design mode? // switch to design mode?
if (editor->isDesignModePreferred()) { if (!(flags & EditorManager::DoNotSwitchToDesignMode) && editor->isDesignModePreferred()) {
ModeManager::activateMode(Core::Constants::MODE_DESIGN); ModeManager::activateMode(Core::Constants::MODE_DESIGN);
ModeManager::setFocusToCurrentMode(); ModeManager::setFocusToCurrentMode();
} else { } else {

View File

@@ -106,7 +106,8 @@ public:
IgnoreNavigationHistory = 2, IgnoreNavigationHistory = 2,
DoNotMakeVisible = 4, DoNotMakeVisible = 4,
CanContainLineNumber = 8, CanContainLineNumber = 8,
OpenInOtherSplit = 16 OpenInOtherSplit = 16,
DoNotSwitchToDesignMode = 32
}; };
Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag) Q_DECLARE_FLAGS(OpenEditorFlags, OpenEditorFlag)