diff options
Diffstat (limited to 'lib/remote.tcl')
-rw-r--r-- | lib/remote.tcl | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/lib/remote.tcl b/lib/remote.tcl index cf2fc9501d..817ca1b6a3 100644 --- a/lib/remote.tcl +++ b/lib/remote.tcl @@ -230,6 +230,45 @@ proc make_sure_remote_submenues_exist {remote_m} { } } +proc update_all_remotes_menu_entry {} { + global all_remotes + + set have_remote 0 + foreach r $all_remotes { + set have_remote 1 + } + + set remote_m .mbar.remote + set fetch_m $remote_m.fetch + set prune_m $remote_m.prune + if {$have_remote} { + make_sure_remote_submenues_exist $remote_m + if {[$fetch_m entrycget 0 -label] ne "All"} { + + $fetch_m insert 0 separator + $fetch_m insert 0 command \ + -label "All" \ + -command fetch_from_all + + $prune_m insert 0 separator + $prune_m insert 0 command \ + -label "All" \ + -command prune_from_all + } + } else { + if {[winfo exists $fetch_m]} { + if {[$fetch_m type end] eq "separator"} { + + delete_from_menu $fetch_m 0 + delete_from_menu $fetch_m 0 + + delete_from_menu $prune_m 0 + delete_from_menu $prune_m 0 + } + } + } +} + proc populate_remotes_menu {} { global all_remotes @@ -237,6 +276,8 @@ proc populate_remotes_menu {} { add_fetch_entry $r add_push_entry $r } + + update_all_remotes_menu_entry } proc add_single_remote {name location} { @@ -252,6 +293,8 @@ proc add_single_remote {name location} { add_fetch_entry $name add_push_entry $name + + update_all_remotes_menu_entry } proc delete_from_menu {menu name} { @@ -281,4 +324,6 @@ proc remove_remote {name} { delete_from_menu $remote_m.remove $name # Not all remotes are in the push menu catch { delete_from_menu $remote_m.push $name } + + update_all_remotes_menu_entry } |