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
cb784459
Commit
cb784459
authored
Jun 12, 2009
by
Daniel Molkentin
Browse files
Do not temporary show the welcome mode when passing a session as argument
Reviewed-by: con
parent
992a178b
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/icore.h
View file @
cb784459
...
...
@@ -109,6 +109,7 @@ public:
virtual
void
openFiles
(
const
QStringList
&
fileNames
)
=
0
;
signals:
void
coreAboutToOpen
();
void
coreOpened
();
void
saveSettingsRequested
();
void
optionsDialogRequested
();
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
cb784459
...
...
@@ -348,8 +348,9 @@ void MainWindow::extensionsInitialized()
m_actionManager
->
initialize
();
readSettings
();
updateContext
();
show
();
emit
m_coreImpl
->
coreAboutToOpen
();
show
();
emit
m_coreImpl
->
coreOpened
();
}
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
cb784459
...
...
@@ -703,6 +703,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
updateActions
();
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreAboutToOpen
()),
this
,
SLOT
(
determineSessionToRestoreAtStartup
()));
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreOpened
()),
this
,
SLOT
(
restoreSession
()));
return
true
;
...
...
@@ -1041,6 +1043,24 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
updateWelcomePage
(
welcomeMode
);
}
void
ProjectExplorerPlugin
::
determineSessionToRestoreAtStartup
()
{
QStringList
sessions
=
m_session
->
sessions
();
// We have command line arguments, try to find a session in them
QStringList
arguments
=
ExtensionSystem
::
PluginManager
::
instance
()
->
arguments
();
// Default to no session loading
m_sessionToRestoreAtStartup
=
QString
::
null
;
foreach
(
const
QString
&
arg
,
arguments
)
{
if
(
sessions
.
contains
(
arg
))
{
// Session argument
m_sessionToRestoreAtStartup
=
arg
;
break
;
}
}
if
(
!
m_sessionToRestoreAtStartup
.
isNull
())
Core
::
ICore
::
instance
()
->
modeManager
()
->
activateMode
(
Core
::
Constants
::
MODE_EDIT
);
}
/*!
\fn void ProjectExplorerPlugin::restoreSession()
...
...
@@ -1049,37 +1069,20 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
default session and puts the list of recent projects and sessions
onto the welcome page.
*/
void
ProjectExplorerPlugin
::
restoreSession
()
{
if
(
debug
)
qDebug
()
<<
"ProjectExplorerPlugin::restoreSession"
;
QStringList
sessions
=
m_session
->
sessions
();
// We have command line arguments, try to find a session in them
QStringList
arguments
=
ExtensionSystem
::
PluginManager
::
instance
()
->
arguments
();
// Default to no session loading
QString
sessionToLoad
=
QString
::
null
;
if
(
!
arguments
.
isEmpty
())
{
foreach
(
const
QString
&
arg
,
arguments
)
{
if
(
sessions
.
contains
(
arg
))
{
// Session argument
sessionToLoad
=
arg
;
arguments
.
removeOne
(
arg
);
if
(
debug
)
qDebug
()
<<
"Found session argument, restoring session"
<<
sessionToLoad
;
break
;
}
}
}
arguments
.
removeOne
(
m_sessionToRestoreAtStartup
);
// Restore latest session or what was passed on the command line
if
(
sessionTo
Load
==
QString
::
null
)
{
if
(
m_
sessionTo
RestoreAtStartup
==
QString
::
null
)
{
m_session
->
createAndLoadNewDefaultSession
();
}
else
{
m_session
->
loadSession
(
sessionTo
Load
);
m_session
->
loadSession
(
m_
sessionTo
RestoreAtStartup
);
}
// update welcome page
...
...
src/plugins/projectexplorer/projectexplorer.h
View file @
cb784459
...
...
@@ -161,6 +161,7 @@ private slots:
void
updateSessionMenu
();
void
setSession
(
QAction
*
action
);
void
determineSessionToRestoreAtStartup
();
void
restoreSession
();
void
loadSession
(
const
QString
&
session
);
void
runProject
();
...
...
@@ -260,6 +261,7 @@ private:
Internal
::
ProjectWindow
*
m_proWindow
;
SessionManager
*
m_session
;
QString
m_sessionToRestoreAtStartup
;
Project
*
m_currentProject
;
Node
*
m_currentNode
;
...
...
Write
Preview
Supports
Markdown
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