Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
c2338d20
Commit
c2338d20
authored
Sep 07, 2010
by
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
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/coreplugin.cpp
View file @
c2338d20
...
...
@@ -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
)
...
...
src/plugins/coreplugin/modemanager.cpp
View file @
c2338d20
...
...
@@ -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
;
...
...
src/plugins/coreplugin/modemanager.h
View file @
c2338d20
...
...
@@ -66,8 +66,6 @@ public:
void
addProjectSelector
(
QAction
*
action
);
void
addWidget
(
QWidget
*
widget
);
void
switchToDefaultMode
();
signals:
void
currentModeAboutToChange
(
Core
::
IMode
*
mode
);
...
...
src/plugins/welcome/welcomeplugin.cpp
View file @
c2338d20
...
...
@@ -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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment