Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
daeb83cd
Commit
daeb83cd
authored
Dec 04, 2008
by
Oswald Buddenhagen
Browse files
use radio buttons instead of checkboxes to mark entries in sessions menu
just put the actions into an action group
parent
e8419795
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/projectexplorer/projectexplorer.cpp
View file @
daeb83cd
...
...
@@ -1783,22 +1783,25 @@ void ProjectExplorerPlugin::openWithMenuTriggered(QAction *action)
void
ProjectExplorerPlugin
::
updateSessionMenu
()
{
m_sessionMenu
->
clear
();
QActionGroup
*
ag
=
new
QActionGroup
(
m_sessionMenu
);
connect
(
ag
,
SIGNAL
(
triggered
(
QAction
*
)),
this
,
SLOT
(
setSession
(
QAction
*
)));
const
QString
&
activeSession
=
m_session
->
activeSession
();
foreach
(
const
QString
&
session
,
m_session
->
sessions
())
{
QAction
*
act
=
m_sessionMenu
->
addAction
(
session
,
this
,
SLOT
(
setSession
())
);
QAction
*
act
=
ag
->
addAction
(
session
);
act
->
setCheckable
(
true
);
if
(
session
==
activeSession
)
act
->
setChecked
(
true
);
}
m_sessionMenu
->
addActions
(
ag
->
actions
());
m_sessionMenu
->
addSeparator
();
m_sessionMenu
->
addAction
(
m_sessionManagerAction
);
m_sessionMenu
->
setEnabled
(
true
);
}
void
ProjectExplorerPlugin
::
setSession
()
void
ProjectExplorerPlugin
::
setSession
(
QAction
*
action
)
{
QString
session
=
static_cast
<
QAction
*>
(
sender
())
->
text
();
QString
session
=
action
->
text
();
if
(
session
!=
m_session
->
activeSession
())
m_session
->
loadSession
(
session
);
}
...
...
src/plugins/projectexplorer/projectexplorer.h
View file @
daeb83cd
...
...
@@ -151,7 +151,7 @@ private slots:
void
populateOpenWithMenu
();
void
openWithMenuTriggered
(
QAction
*
action
);
void
updateSessionMenu
();
void
setSession
();
void
setSession
(
QAction
*
action
);
void
restoreSession
();
void
loadSession
(
const
QString
&
session
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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