diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index f589e8703c1ce60d04977ca174973304fb1014d2..718a9a348dec37a20f965de26d331f24de646f14 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -84,6 +84,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) if (success) { EditorManager *editorManager = m_mainWindow->editorManager(); m_editMode = new EditMode(editorManager); + m_mainWindow->modeManager()->activateMode(m_editMode->id()); addObject(m_editMode); m_designMode = new DesignMode(editorManager); @@ -95,6 +96,7 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage) void CorePlugin::extensionsInitialized() { m_mainWindow->extensionsInitialized(); + m_mainWindow->modeManager()->switchToDefaultMode(); } void CorePlugin::remoteCommand(const QStringList & /* options */, const QStringList &args) diff --git a/src/plugins/coreplugin/modemanager.cpp b/src/plugins/coreplugin/modemanager.cpp index 091bcff4f4fcad49c306dc6997c97719fdc5758d..5f5e182be167baebb1c4b6fddabbf990d99611f2 100644 --- a/src/plugins/coreplugin/modemanager.cpp +++ b/src/plugins/coreplugin/modemanager.cpp @@ -309,6 +309,11 @@ void ModeManager::setFocusToCurrentMode() } } +void ModeManager::switchToDefaultMode() +{ + d->m_modeStack->setCurrentIndex(0); +} + ModeManager *ModeManager::instance() { return ModeManagerPrivate::m_instance; diff --git a/src/plugins/coreplugin/modemanager.h b/src/plugins/coreplugin/modemanager.h index ea0fb71618805b9a80413db4f47ddc9053453a55..e92c927282804f215cad083aee599696df4788a1 100644 --- a/src/plugins/coreplugin/modemanager.h +++ b/src/plugins/coreplugin/modemanager.h @@ -66,6 +66,8 @@ public: void addProjectSelector(QAction *action); void addWidget(QWidget *widget); + void switchToDefaultMode(); + signals: void currentModeAboutToChange(Core::IMode *mode); diff --git a/src/plugins/welcome/welcomeplugin.cpp b/src/plugins/welcome/welcomeplugin.cpp index 4ef9768394aa8092487f280877191d793800f9a1..46c59e871445fd2034522b081601b89ea32fe83e 100644 --- a/src/plugins/welcome/welcomeplugin.cpp +++ b/src/plugins/welcome/welcomeplugin.cpp @@ -76,7 +76,6 @@ bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString * /* void WelcomePlugin::extensionsInitialized() { m_welcomeMode->initPlugins(); - Core::ModeManager::instance()->activateMode(m_welcomeMode->id()); } Q_EXPORT_PLUGIN(WelcomePlugin)