diff options
author | Eike Ziller <eike.ziller@digia.com> | 2013-05-31 12:52:53 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2013-06-05 09:43:14 +0200 |
commit | 7c8db79817ed436176f6055b5c6f8ccf6df16c4c (patch) | |
tree | 28c65055a97c872468055db6e96fb51f70e83f1d /src/plugins/qmldesigner/designersettings.cpp | |
parent | f99ce422b475c000e1bbdadf13da232dd54d9cca (diff) | |
download | qt-creator-7c8db79817ed436176f6055b5c6f8ccf6df16c4c.tar.gz |
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 <david.schulz@digia.com>
Diffstat (limited to 'src/plugins/qmldesigner/designersettings.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designersettings.cpp | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/plugins/qmldesigner/designersettings.cpp b/src/plugins/qmldesigner/designersettings.cpp index 029e5e082a..874587a64c 100644 --- a/src/plugins/qmldesigner/designersettings.cpp +++ b/src/plugins/qmldesigner/designersettings.cpp @@ -35,8 +35,7 @@ using namespace QmlDesigner; DesignerSettings::DesignerSettings() - : openDesignMode(QmlDesigner::Constants::QML_OPENDESIGNMODE_DEFAULT), - itemSpacing(0), + : itemSpacing(0), containerPadding(0), canvasWidth(10000), canvasHeight(10000), @@ -50,9 +49,6 @@ void DesignerSettings::fromSettings(QSettings *settings) { settings->beginGroup(QLatin1String(QmlDesigner::Constants::QML_SETTINGS_GROUP)); settings->beginGroup(QLatin1String(QmlDesigner::Constants::QML_DESIGNER_SETTINGS_GROUP)); - openDesignMode = settings->value( - QLatin1String(QmlDesigner::Constants::QML_OPENDESIGNMODE_SETTINGS_KEY), - bool(QmlDesigner::Constants::QML_OPENDESIGNMODE_DEFAULT)).toBool(); itemSpacing = settings->value( QLatin1String(QmlDesigner::Constants::QML_ITEMSPACING_KEY), QVariant(6)).toInt(); containerPadding = settings->value( @@ -76,7 +72,6 @@ void DesignerSettings::toSettings(QSettings *settings) const { settings->beginGroup(QLatin1String(QmlDesigner::Constants::QML_SETTINGS_GROUP)); settings->beginGroup(QLatin1String(QmlDesigner::Constants::QML_DESIGNER_SETTINGS_GROUP)); - settings->setValue(QLatin1String(QmlDesigner::Constants::QML_OPENDESIGNMODE_SETTINGS_KEY), openDesignMode); settings->setValue(QLatin1String(QmlDesigner::Constants::QML_ITEMSPACING_KEY), itemSpacing); settings->setValue(QLatin1String(QmlDesigner::Constants::QML_CONTAINERPADDING_KEY), containerPadding); settings->setValue(QLatin1String(QmlDesigner::Constants::QML_CANVASWIDTH_KEY), canvasWidth); @@ -92,8 +87,7 @@ void DesignerSettings::toSettings(QSettings *settings) const bool DesignerSettings::equals(const DesignerSettings &other) const { - return openDesignMode == other.openDesignMode - && containerPadding == other.containerPadding + return containerPadding == other.containerPadding && canvasWidth == other.canvasWidth && canvasHeight == other.canvasHeight && warningsInDesigner == other.warningsInDesigner |