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
b3231751
Commit
b3231751
authored
5 years ago
by
Virgile Prevosto
Browse files
Options
Downloads
Patches
Plain Diff
[gui] Do not multiply phantom projects in the menu when duplicating
parent
a5920b78
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/gui/project_manager.ml
+7
-18
7 additions, 18 deletions
src/plugins/gui/project_manager.ml
with
7 additions
and
18 deletions
src/plugins/gui/project_manager.ml
+
7
−
18
View file @
b3231751
...
...
@@ -173,6 +173,10 @@ let reset ?filter (menu: GMenu.menu) =
true
end
let
duplicate_project
project
=
ignore
(
Project
.
create_by_copy
~
last
:
false
~
src
:
project
(
Project
.
get_name
project
))
let
rec
rename_project
(
main_ui
:
Design
.
main_window_extension_points
)
menu
project
=
...
...
@@ -193,21 +197,6 @@ let rec rename_project
Project
.
set_name
project
s
);
recompute
main_ui
menu
and
duplicate_project
window
menu
project
=
let
new_p
=
Project
.
create_by_copy
~
last
:
false
~
src
:
project
(
Project
.
get_name
project
)
in
try
(* update the menu *)
let
group
=
let
_
,
i
=
PrjRadiosSet
.
choose
!
project_radios
in
i
#
group
in
ignore
(
mk_project_entry
window
menu
~
group
new_p
)
with
Not_found
->
(* menu not built (action called from the toolbar) *)
()
and
mk_project_entry
window
menu
?
group
p
=
let
pname
=
Project
.
get_unique_name
p
in
let
p_item
=
GMenu
.
radio_menu_item
...
...
@@ -230,7 +219,7 @@ and mk_project_entry window menu ?group p =
ignore
(
item
#
connect
#
activate
~
callback
)
in
add_action
`COPY
"Duplicate project"
(
fun
()
->
duplicate_project
window
menu
p
);
(
fun
()
->
duplicate_project
p
);
add_action
`DELETE
"Delete project"
(
fun
()
->
delete_project
p
);
add_action
`SAVE
"Save project"
(
fun
()
->
save_project
window
p
);
add_action
`SAVE_AS
"Save project as"
(
fun
()
->
save_project_as
window
p
);
...
...
@@ -269,7 +258,7 @@ let () =
(
Unit_callback
(
fun
()
->
load_project
window
));
menubar
~
icon
:
`COPY
"Duplicate current project"
(
Unit_callback
(
fun
()
->
duplicate_project
window
menu
(
Project
.
current
()
)));
(
fun
()
->
duplicate_project
(
Project
.
current
()
)));
menubar
~
icon
:
`DELETE
"Delete current project"
(
Unit_callback
(
fun
()
->
delete_project
(
Project
.
current
()
)));
menubar
~
icon
:
`SELECT_FONT
"Rename current project"
...
...
@@ -287,7 +276,7 @@ let () =
recompute
~
filter
window
menu
in
Project
.
register_create_hook
callback_prj
;
Project
.
register_after_set_current_hook
~
user_only
:
fals
e
callback_prj
;
Project
.
register_after_set_current_hook
~
user_only
:
tru
e
callback_prj
;
Project
.
register_before_remove_hook
callback_rm_prj
;
recompute
window
menu
)
...
...
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