Commit 71affce4 authored by hjk's avatar hjk
Browse files

ModeManager: Force use of static interface



Change-Id: I314ca347fd0fad30bf5ac6a6d4c67db8e5687065
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent fc16156f
......@@ -1139,7 +1139,7 @@ void MainWindow::readSettings()
restoreState(m_settings->value(QLatin1String(windowStateKey)).toByteArray());
bool modeSelectorVisible = m_settings->value(QLatin1String(modeSelectorVisibleKey), true).toBool();
ModeManager::instance()->setModeSelectorVisible(modeSelectorVisible);
ModeManager::setModeSelectorVisible(modeSelectorVisible);
m_toggleModeSelectorAction->setChecked(modeSelectorVisible);
m_settings->endGroup();
......
......@@ -188,7 +188,7 @@ void ModeManager::objectAdded(QObject *obj)
Command *cmd = ActionManager::registerShortcut(shortcut, shortcutId, Context(Constants::C_GLOBAL));
d->m_modeShortcuts.insert(index, cmd);
connect(cmd, SIGNAL(keySequenceChanged()), this, SLOT(updateModeToolTip()));
connect(cmd, SIGNAL(keySequenceChanged()), m_instance, SLOT(updateModeToolTip()));
for (int i = 0; i < d->m_modeShortcuts.size(); ++i) {
Command *currentCmd = d->m_modeShortcuts.at(i);
// we need this hack with currentlyHasDefaultSequence
......@@ -205,7 +205,7 @@ void ModeManager::objectAdded(QObject *obj)
d->m_signalMapper->setMapping(shortcut, mode->id().uniqueIdentifier());
connect(shortcut, SIGNAL(activated()), d->m_signalMapper, SLOT(map()));
connect(mode, SIGNAL(enabledStateChanged(bool)),
this, SLOT(enabledStateChanged()));
m_instance, SLOT(enabledStateChanged()));
}
void ModeManager::updateModeToolTip()
......@@ -336,7 +336,7 @@ bool ModeManager::isModeSelectorVisible()
return d->m_modeSelectorVisible;
}
ModeManager *ModeManager::instance()
QObject *ModeManager::instance()
{
return m_instance;
}
......
......@@ -52,7 +52,7 @@ class CORE_EXPORT ModeManager : public QObject
Q_OBJECT
public:
static ModeManager *instance();
static QObject *instance();
static IMode *currentMode();
static IMode *mode(Id id);
......@@ -66,7 +66,7 @@ public:
static bool isModeSelectorVisible();
public slots:
void setModeSelectorVisible(bool visible);
static void setModeSelectorVisible(bool visible);
signals:
void currentModeAboutToChange(Core::IMode *mode);
......@@ -87,7 +87,7 @@ private slots:
private:
explicit ModeManager(Internal::MainWindow *mainWindow, Internal::FancyTabWidget *modeStack);
virtual ~ModeManager();
~ModeManager();
static void init();
......
......@@ -1495,6 +1495,6 @@ void MiniProjectTargetSelector::paintEvent(QPaintEvent *)
void MiniProjectTargetSelector::switchToProjectsMode()
{
Core::ModeManager::instance()->activateMode(Constants::MODE_SESSION);
Core::ModeManager::activateMode(Constants::MODE_SESSION);
hide();
}
......@@ -196,14 +196,14 @@ void TargetSetupPageWrapper::cancel()
{
ProjectExplorer::ProjectExplorerPlugin::instance()->unloadProject(m_project);
if (ProjectExplorer::ProjectExplorerPlugin::instance()->session()->projects().isEmpty())
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_WELCOME);
Core::ModeManager::activateMode(Core::Constants::MODE_WELCOME);
}
void TargetSetupPageWrapper::done()
{
m_targetSetupPage->setupProject(m_project);
ProjectExplorer::ProjectExplorerPlugin::instance()->requestProjectModeUpdate(m_project);
Core::ModeManager::instance()->activateMode(Core::Constants::MODE_EDIT);
Core::ModeManager::activateMode(Core::Constants::MODE_EDIT);
}
void TargetSetupPageWrapper::completeChanged()
......
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