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
ddaa9dca
Commit
ddaa9dca
authored
Feb 25, 2010
by
mae
Browse files
Save project settings when leaving the "projects" mode
parent
ac7b18e8
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/modemanager.cpp
View file @
ddaa9dca
...
...
@@ -63,7 +63,9 @@ ModeManager *ModeManager::m_instance = 0;
ModeManager
::
ModeManager
(
Internal
::
MainWindow
*
mainWindow
,
FancyTabWidget
*
modeStack
)
:
m_mainWindow
(
mainWindow
),
m_modeStack
(
modeStack
),
m_signalMapper
(
new
QSignalMapper
(
this
))
m_signalMapper
(
new
QSignalMapper
(
this
)),
m_oldCurrent
(
-
1
)
{
m_instance
=
this
;
...
...
@@ -247,7 +249,11 @@ void ModeManager::currentTabChanged(int index)
m_addedContexts
=
mode
->
context
();
foreach
(
const
int
context
,
m_addedContexts
)
core
->
addAdditionalContext
(
context
);
emit
currentModeChanged
(
mode
);
IMode
*
oldMode
=
0
;
if
(
m_oldCurrent
>=
0
)
oldMode
=
m_modes
.
at
(
m_oldCurrent
);
m_oldCurrent
=
index
;
emit
currentModeChanged
(
mode
,
oldMode
);
core
->
updateContext
();
}
}
...
...
src/plugins/coreplugin/modemanager.h
View file @
ddaa9dca
...
...
@@ -74,7 +74,9 @@ public:
signals:
void
currentModeAboutToChange
(
Core
::
IMode
*
mode
);
void
currentModeChanged
(
Core
::
IMode
*
mode
);
// the default argument '=0' is important for connects without the oldMode argument.
void
currentModeChanged
(
Core
::
IMode
*
mode
,
Core
::
IMode
*
oldMode
=
0
);
public
slots
:
void
activateMode
(
const
QString
&
id
);
...
...
@@ -100,6 +102,7 @@ private:
QVector
<
Command
*>
m_modeShortcuts
;
QSignalMapper
*
m_signalMapper
;
QList
<
int
>
m_addedContexts
;
int
m_oldCurrent
;
};
}
// namespace Core
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
ddaa9dca
...
...
@@ -1140,9 +1140,13 @@ void ProjectExplorerPlugin::updateWelcomePage()
d
->
m_welcomePage
->
updateWelcomePage
(
welcomePageData
);
}
void
ProjectExplorerPlugin
::
currentModeChanged
(
Core
::
IMode
*
)
void
ProjectExplorerPlugin
::
currentModeChanged
(
Core
::
IMode
*
mode
,
Core
::
IMode
*
oldMode
)
{
if
(
mode
&&
mode
->
id
()
==
QLatin1String
(
Core
::
Constants
::
MODE_WELCOME
))
updateWelcomePage
();
if
(
oldMode
==
d
->
m_projectsMode
)
{
savePersistentSettings
();
}
}
void
ProjectExplorerPlugin
::
determineSessionToRestoreAtStartup
()
...
...
@@ -1189,7 +1193,8 @@ void ProjectExplorerPlugin::restoreSession()
// update welcome page
Core
::
ModeManager
*
modeManager
=
Core
::
ModeManager
::
instance
();
connect
(
modeManager
,
SIGNAL
(
currentModeChanged
(
Core
::
IMode
*
)),
this
,
SLOT
(
currentModeChanged
(
Core
::
IMode
*
)));
connect
(
modeManager
,
SIGNAL
(
currentModeChanged
(
Core
::
IMode
*
,
Core
::
IMode
*
)),
this
,
SLOT
(
currentModeChanged
(
Core
::
IMode
*
,
Core
::
IMode
*
)));
connect
(
d
->
m_welcomePage
,
SIGNAL
(
requestSession
(
QString
)),
this
,
SLOT
(
loadSession
(
QString
)));
connect
(
d
->
m_welcomePage
,
SIGNAL
(
requestProject
(
QString
)),
this
,
SLOT
(
loadProject
(
QString
)));
...
...
src/plugins/projectexplorer/projectexplorer.h
View file @
ddaa9dca
...
...
@@ -217,7 +217,7 @@ private slots:
void
addErrorToApplicationOutputWindow
(
RunControl
*
,
const
QString
&
error
);
void
loadProject
(
const
QString
&
project
)
{
openProject
(
project
);
}
void
currentModeChanged
(
Core
::
IMode
*
mode
);
void
currentModeChanged
(
Core
::
IMode
*
mode
,
Core
::
IMode
*
oldMode
);
void
updateActions
();
private:
...
...
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