Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
a161253b
Commit
a161253b
authored
5 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[gui] don't auto-select current project when unfolding submenu
parent
b3231751
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/gui/project_manager.ml
+10
-11
10 additions, 11 deletions
src/plugins/gui/project_manager.ml
with
10 additions
and
11 deletions
src/plugins/gui/project_manager.ml
+
10
−
11
View file @
a161253b
...
...
@@ -38,8 +38,8 @@ let projects_list ?(filter=fun _ -> true) () =
module
PrjRadiosSet
=
FCSet
.
Make
(
struct
type
t
=
(
Project
.
t
*
string
)
*
GMenu
.
radio_menu_item
let
compare
(
p1
,
_
)
(
p2
,
_
)
=
compare_prj
p1
p2
type
t
=
(
Project
.
t
*
string
)
*
GMenu
.
radio_menu_item
*
GMenu
.
menu_item
let
compare
(
p1
,
_
,
_
)
(
p2
,
_
,
_
)
=
compare_prj
p1
p2
end
)
let
project_radios
:
PrjRadiosSet
.
t
ref
=
ref
PrjRadiosSet
.
empty
...
...
@@ -147,7 +147,7 @@ let reset ?filter (menu: GMenu.menu) =
try
let
rest
=
PrjRadiosSet
.
fold
(
fun
(
p1
,
_
)
acc
->
(
fun
(
p1
,
_
,
_
)
acc
->
match
acc
with
|
[]
->
raise
Exit
|
p2
::
acc
->
...
...
@@ -162,13 +162,11 @@ let reset ?filter (menu: GMenu.menu) =
if
same_projects
then
begin
(* update the item status according to the current project anyway *)
PrjRadiosSet
.
iter
(
fun
((
p
,
_
)
,
r
)
->
r
#
set_active
(
Project
.
is_current
p
))
(
fun
((
p
,
_
)
,
r
,
_
)
->
r
#
set_active
(
Project
.
is_current
p
))
!
project_radios
;
false
end
else
begin
PrjRadiosSet
.
iter
(
fun
(
_
,
r
)
->
menu
#
remove
(
r
:>
GMenu
.
menu_item
))
!
project_radios
;
PrjRadiosSet
.
iter
(
fun
(
_
,
_
,
i
)
->
menu
#
remove
i
)
!
project_radios
;
project_radios
:=
PrjRadiosSet
.
empty
;
true
end
...
...
@@ -199,17 +197,18 @@ let rec rename_project
and
mk_project_entry
window
menu
?
group
p
=
let
pname
=
Project
.
get_unique_name
p
in
let
item
=
GMenu
.
menu_item
~
label
:
pname
~
packing
:
menu
#
append
()
in
let
submenu
=
GMenu
.
menu
~
packing
:
item
#
set_submenu
()
in
let
p_item
=
GMenu
.
radio_menu_item
?
group
~
active
:
(
Project
.
is_current
p
)
~
packing
:
menu
#
append
~
label
:
pname
~
packing
:
sub
menu
#
append
~
label
:
"current"
()
in
let
callback
()
=
if
p_item
#
active
then
Project
.
set_current
p
in
ignore
(
p_item
#
connect
#
toggled
~
callback
);
project_radios
:=
PrjRadiosSet
.
add
((
p
,
pname
)
,
p_item
)
!
project_radios
;
let
submenu
=
GMenu
.
menu
~
packing
:
p_item
#
set_submenu
()
in
project_radios
:=
PrjRadiosSet
.
add
((
p
,
pname
)
,
p_item
,
item
)
!
project_radios
;
let
add_action
stock
text
callback
=
let
image
=
GMisc
.
image
~
stock
()
in
let
image
=
image
#
coerce
in
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment