@matheusbsbs / matheus-bagliano / commits / 4c2519e5a2
Fork 0

git-gui: fetch/prune all entry appears last

The user might have got used to the order the remotes appeared previously. Lets add the all entry last so the all entry does not confuse previous users. Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net> Tested-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Heiko Voigt committed Feb 22, 2011 at 20:30 UTC 4c2519e5a287709e3306449fc05bcdd2aefe8c7b
1 file changed +10 -12
lib/remote.tcl
+10 -12
@@ -245,29 +245,27 @@ proc update_all_remotes_menu_entry {} {
245 set prune_m $remote_m.prune
246 if {$have_remote > 1} {
247 make_sure_remote_submenues_exist $remote_m
248 - set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
249 - if {[$fetch_m entrycget $index -label] ne "All"} {
248 + if {[$fetch_m entrycget end -label] ne "All"} {
249
251 - $fetch_m insert $index separator
252 - $fetch_m insert $index command \
250 + $fetch_m insert end separator
251 + $fetch_m insert end command \
252 -label "All" \
253 -command fetch_from_all
254
256 - $prune_m insert $index separator
257 - $prune_m insert $index command \
255 + $prune_m insert end separator
256 + $prune_m insert end command \
257 -label "All" \
258 -command prune_from_all
259 }
260 } else {
261 if {[winfo exists $fetch_m]} {
263 - set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
264 - if {[$fetch_m type end] eq "separator"} {
262 + if {[$fetch_m entrycget end -label] eq "All"} {
263
266 - delete_from_menu $fetch_m $index
267 - delete_from_menu $fetch_m $index
264 + delete_from_menu $fetch_m end
265 + delete_from_menu $fetch_m end
266
269 - delete_from_menu $prune_m $index
270 - delete_from_menu $prune_m $index
267 + delete_from_menu $prune_m end
268 + delete_from_menu $prune_m end
269 }
270 }
271 }