git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] git-gui: fetch/prune all entry appears last

From
Pat Thoyts <patthoyts@users.sourceforge.net>
Date
Feb 24, 2011, 00:09 UTC
Message-ID
<87bp22fg3r.fsf@fox.patthoyts.tk>
In-Reply-To
<20110222193021.GB28519@book.hvoigt.net>
Heiko Voigt <hvoigt@hvoigt.net> writes:
Show 62 quoted lines
>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>
>---
>
>On Tue, Feb 22, 2011 at 07:36:23PM +0100, Jens Lehmann wrote:
>> 2) I would rather like to see it at the *end* of the submenu, not at the
>>    beginning. Being used to always click on the first menu entry only
>>    to learn that the remote that used to be there got with something
>>    else is kind of surprising ;-)
>
>And this? Disclaimer: Also only superficially tested on OSX.
>
> lib/remote.tcl |   22 ++++++++++------------
> 1 files changed, 10 insertions(+), 12 deletions(-)
>
>diff --git a/lib/remote.tcl b/lib/remote.tcl
>index 18d3d06..5e4e7f4 100644
>--- a/lib/remote.tcl
>+++ b/lib/remote.tcl
>@@ -245,29 +245,27 @@ proc update_all_remotes_menu_entry {} {
> 	set prune_m $remote_m.prune
> 	if {$have_remote > 1} {
> 		make_sure_remote_submenues_exist $remote_m
>-		set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
>-		if {[$fetch_m entrycget $index -label] ne "All"} {
>+		if {[$fetch_m entrycget end -label] ne "All"} {
> 
>-			$fetch_m insert $index separator
>-			$fetch_m insert $index command \
>+			$fetch_m insert end separator
>+			$fetch_m insert end command \
> 				-label "All" \
> 				-command fetch_from_all
> 
>-			$prune_m insert $index separator
>-			$prune_m insert $index command \
>+			$prune_m insert end separator
>+			$prune_m insert end command \
> 				-label "All" \
> 				-command prune_from_all
> 		}
> 	} else {
> 		if {[winfo exists $fetch_m]} {
>-			set index [expr {[$fetch_m type 0] eq "tearoff" ? 1 : 0}]
>-			if {[$fetch_m type end] eq "separator"} {
>+			if {[$fetch_m entrycget end -label] eq "All"} {
> 
>-				delete_from_menu $fetch_m $index
>-				delete_from_menu $fetch_m $index
>+				delete_from_menu $fetch_m end
>+				delete_from_menu $fetch_m end
> 
>-				delete_from_menu $prune_m $index
>-				delete_from_menu $prune_m $index
>+				delete_from_menu $prune_m end
>+				delete_from_menu $prune_m end
> 			}
> 		}
> 	}
This is fine as well. Tested it on windows. Applied to master.
-- 
Pat Thoyts                            http://www.patthoyts.tk/
PGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD
Previous: Jens LehmannNext: Heiko Voigt
Message 15 of 17 in “git-gui: fix deleting item from all_remotes variable”
  1. 1/2 git-gui: fix deleting item from all_remotes variableHeiko Voigt, Feb 12, 2011
  2. Pat ThoytsFeb 13, 2011
  3. Heiko VoigtFeb 13, 2011
  4. 1/2 git-gui: refactor remote submenu creation into subroutineHeiko Voigt, Feb 13, 2011
  5. 2/2 git-gui: teach fetch/prune menu to do it for all remotesHeiko Voigt, Feb 13, 2011
  6. git-gui: Include version check and test for tearoff menu entryPat Thoyts, Feb 14, 2011
  7. Heiko VoigtFeb 14, 2011
  8. Pat ThoytsFeb 15, 2011
  9. Heiko VoigtFeb 17, 2011
  10. Jens LehmannFeb 22, 2011
  11. 1/2 git-gui: fetch/prune all entry only for more than one entryHeiko Voigt, Feb 22, 2011
  12. Pat ThoytsFeb 24, 2011
  13. 2/2 git-gui: fetch/prune all entry appears lastHeiko Voigt, Feb 22, 2011
  14. Jens LehmannFeb 23, 2011
  15. Pat ThoytsFeb 24, 2011
  16. Heiko VoigtFeb 13, 2011
  17. Heiko VoigtFeb 13, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.