Use Core::Id in ModeManager interface

Makes it more uniform to use and allows placeholder widget
creation to be independent of mode creations.

Change-Id: I4021bc9db7f8c78f0374c0cc3b3331506959afe4
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
hjk
2016-03-25 20:00:19 +01:00
parent ed7d5e0d62
commit 5e47d35fcd
29 changed files with 87 additions and 109 deletions

View File

@@ -25,7 +25,7 @@
#pragma once
#include <coreplugin/core_global.h>
#include <coreplugin/id.h>
#include <QObject>
QT_BEGIN_NAMESPACE
@@ -34,9 +34,6 @@ QT_END_NAMESPACE
namespace Core {
class Id;
class IMode;
namespace Internal {
class MainWindow;
class FancyTabWidget;
@@ -49,8 +46,7 @@ class CORE_EXPORT ModeManager : public QObject
public:
static ModeManager *instance();
static IMode *currentMode();
static IMode *mode(Id id);
static Id currentMode();
static void addAction(QAction *action, int priority);
static void addProjectSelector(QAction *action);
@@ -63,10 +59,10 @@ public slots:
static void setModeSelectorVisible(bool visible);
signals:
void currentModeAboutToChange(Core::IMode *mode);
void currentModeAboutToChange(Core::Id mode);
// the default argument '=0' is important for connects without the oldMode argument.
void currentModeChanged(Core::IMode *mode, Core::IMode *oldMode = 0);
void currentModeChanged(Core::Id mode, Core::Id oldMode = Core::Id());
private:
explicit ModeManager(Internal::MainWindow *mainWindow, Internal::FancyTabWidget *modeStack);