Commit c2338d20 authored by dt's avatar dt
Browse files

Modes: Do the mode switching again like it used to be

It's more complicated then expected, to be detangled another day
parent 12e974db
......@@ -96,7 +96,6 @@ 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)
......
......@@ -73,7 +73,6 @@ struct ModeManagerPrivate
QSignalMapper *m_signalMapper;
Context m_addedContexts;
int m_oldCurrent;
bool m_switchedToMode;
};
ModeManager *ModeManagerPrivate::m_instance = 0;
......@@ -84,8 +83,7 @@ ModeManagerPrivate::ModeManagerPrivate(Internal::MainWindow *mainWindow,
m_mainWindow(mainWindow),
m_modeStack(modeStack),
m_signalMapper(new QSignalMapper(q)),
m_oldCurrent(-1),
m_switchedToMode(false)
m_oldCurrent(-1)
{
}
......@@ -153,7 +151,6 @@ IMode *ModeManager::mode(const QString &id) const
void ModeManager::activateMode(const QString &id)
{
d->m_switchedToMode = true;
const int index = indexOf(id);
if (index >= 0)
d->m_modeStack->setCurrentIndex(index);
......@@ -312,12 +309,6 @@ void ModeManager::setFocusToCurrentMode()
}
}
void ModeManager::switchToDefaultMode()
{
if (!d->m_switchedToMode)
d->m_modeStack->setCurrentIndex(0);
}
ModeManager *ModeManager::instance()
{
return ModeManagerPrivate::m_instance;
......
......@@ -66,8 +66,6 @@ public:
void addProjectSelector(QAction *action);
void addWidget(QWidget *widget);
void switchToDefaultMode();
signals:
void currentModeAboutToChange(Core::IMode *mode);
......
......@@ -76,6 +76,7 @@ bool WelcomePlugin::initialize(const QStringList & /* arguments */, QString * /*
void WelcomePlugin::extensionsInitialized()
{
m_welcomeMode->initPlugins();
Core::ModeManager::instance()->activateMode(m_welcomeMode->id());
}
Q_EXPORT_PLUGIN(WelcomePlugin)
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