Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
cb784459
Commit
cb784459
authored
Jun 12, 2009
by
Daniel Molkentin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
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
Showing
4 changed files
with
28 additions
and
21 deletions
+28
-21
src/plugins/coreplugin/icore.h
src/plugins/coreplugin/icore.h
+1
-0
src/plugins/coreplugin/mainwindow.cpp
src/plugins/coreplugin/mainwindow.cpp
+2
-1
src/plugins/projectexplorer/projectexplorer.cpp
src/plugins/projectexplorer/projectexplorer.cpp
+23
-20
src/plugins/projectexplorer/projectexplorer.h
src/plugins/projectexplorer/projectexplorer.h
+2
-0
No files found.
src/plugins/coreplugin/icore.h
View file @
cb784459
...
@@ -109,6 +109,7 @@ public:
...
@@ -109,6 +109,7 @@ public:
virtual
void
openFiles
(
const
QStringList
&
fileNames
)
=
0
;
virtual
void
openFiles
(
const
QStringList
&
fileNames
)
=
0
;
signals:
signals:
void
coreAboutToOpen
();
void
coreOpened
();
void
coreOpened
();
void
saveSettingsRequested
();
void
saveSettingsRequested
();
void
optionsDialogRequested
();
void
optionsDialogRequested
();
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
cb784459
...
@@ -348,8 +348,9 @@ void MainWindow::extensionsInitialized()
...
@@ -348,8 +348,9 @@ void MainWindow::extensionsInitialized()
m_actionManager
->
initialize
();
m_actionManager
->
initialize
();
readSettings
();
readSettings
();
updateContext
();
updateContext
();
show
();
emit
m_coreImpl
->
coreAboutToOpen
();
show
();
emit
m_coreImpl
->
coreOpened
();
emit
m_coreImpl
->
coreOpened
();
}
}
...
...
src/plugins/projectexplorer/projectexplorer.cpp
View file @
cb784459
...
@@ -703,6 +703,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
...
@@ -703,6 +703,8 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
updateActions
();
updateActions
();
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreAboutToOpen
()),
this
,
SLOT
(
determineSessionToRestoreAtStartup
()));
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreOpened
()),
this
,
SLOT
(
restoreSession
()));
connect
(
Core
::
ICore
::
instance
(),
SIGNAL
(
coreOpened
()),
this
,
SLOT
(
restoreSession
()));
return
true
;
return
true
;
...
@@ -1041,6 +1043,24 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
...
@@ -1041,6 +1043,24 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
updateWelcomePage
(
welcomeMode
);
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()
\fn void ProjectExplorerPlugin::restoreSession()
...
@@ -1049,37 +1069,20 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
...
@@ -1049,37 +1069,20 @@ void ProjectExplorerPlugin::currentModeChanged(Core::IMode *mode)
default session and puts the list of recent projects and sessions
default session and puts the list of recent projects and sessions
onto the welcome page.
onto the welcome page.
*/
*/
void
ProjectExplorerPlugin
::
restoreSession
()
void
ProjectExplorerPlugin
::
restoreSession
()
{
{
if
(
debug
)
if
(
debug
)
qDebug
()
<<
"ProjectExplorerPlugin::restoreSession"
;
qDebug
()
<<
"ProjectExplorerPlugin::restoreSession"
;
QStringList
sessions
=
m_session
->
sessions
();
// We have command line arguments, try to find a session in them
// We have command line arguments, try to find a session in them
QStringList
arguments
=
ExtensionSystem
::
PluginManager
::
instance
()
->
arguments
();
QStringList
arguments
=
ExtensionSystem
::
PluginManager
::
instance
()
->
arguments
();
arguments
.
removeOne
(
m_sessionToRestoreAtStartup
);
// 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
;
}
}
}
// Restore latest session or what was passed on the command line
// Restore latest session or what was passed on the command line
if
(
sessionToLoad
==
QString
::
null
)
{
if
(
m_sessionToRestoreAtStartup
==
QString
::
null
)
{
m_session
->
createAndLoadNewDefaultSession
();
m_session
->
createAndLoadNewDefaultSession
();
}
else
{
}
else
{
m_session
->
loadSession
(
sessionToLoad
);
m_session
->
loadSession
(
m_sessionToRestoreAtStartup
);
}
}
// update welcome page
// update welcome page
...
...
src/plugins/projectexplorer/projectexplorer.h
View file @
cb784459
...
@@ -161,6 +161,7 @@ private slots:
...
@@ -161,6 +161,7 @@ private slots:
void
updateSessionMenu
();
void
updateSessionMenu
();
void
setSession
(
QAction
*
action
);
void
setSession
(
QAction
*
action
);
void
determineSessionToRestoreAtStartup
();
void
restoreSession
();
void
restoreSession
();
void
loadSession
(
const
QString
&
session
);
void
loadSession
(
const
QString
&
session
);
void
runProject
();
void
runProject
();
...
@@ -260,6 +261,7 @@ private:
...
@@ -260,6 +261,7 @@ private:
Internal
::
ProjectWindow
*
m_proWindow
;
Internal
::
ProjectWindow
*
m_proWindow
;
SessionManager
*
m_session
;
SessionManager
*
m_session
;
QString
m_sessionToRestoreAtStartup
;
Project
*
m_currentProject
;
Project
*
m_currentProject
;
Node
*
m_currentNode
;
Node
*
m_currentNode
;
...
...
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