Commit 109d8eaa authored by dt's avatar dt
Browse files

Session Manager: Default Mode for new Sessions is Edit

parent af4ebe49
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
#include <coreplugin/filemanager.h> #include <coreplugin/filemanager.h>
#include <coreplugin/editormanager/editormanager.h> #include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/editormanager/ieditor.h> #include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/progressmanager/progressmanager.h> #include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/modemanager.h> #include <coreplugin/modemanager.h>
...@@ -590,6 +591,9 @@ bool SessionManager::createImpl(const QString &fileName) ...@@ -590,6 +591,9 @@ bool SessionManager::createImpl(const QString &fileName)
m_file = new SessionFile; m_file = new SessionFile;
m_file->setFileName(fileName); m_file->setFileName(fileName);
setStartupProject(0); setStartupProject(0);
m_core->modeManager()->activateMode(Core::Constants::MODE_EDIT);
m_core->modeManager()->setFocusToCurrentMode();
} }
m_virginSession = true; m_virginSession = true;
...@@ -657,11 +661,12 @@ bool SessionManager::loadImpl(const QString &fileName) ...@@ -657,11 +661,12 @@ bool SessionManager::loadImpl(const QString &fileName)
if (success) { if (success) {
// restore the active mode // restore the active mode
const QString &modeIdentifier = value(QLatin1String("ActiveMode")).toString(); QString modeIdentifier = value(QLatin1String("ActiveMode")).toString();
if (!modeIdentifier.isEmpty()) { if (modeIdentifier.isEmpty())
m_core->modeManager()->activateMode(modeIdentifier); modeIdentifier = Core::Constants::MODE_EDIT;
m_core->modeManager()->setFocusToCurrentMode();
} m_core->modeManager()->activateMode(modeIdentifier);
m_core->modeManager()->setFocusToCurrentMode();
} }
if (debug) if (debug)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment