ref-filter: implement %(if), %(then), and %(else) atoms
[gitweb.git] / git-gui / lib / shortcut.tcl
index 79c1888e11d210eed962eebdf67793a7367dff5a..97d1d7aa02686606912dd5ff7b512343083a17c0 100644 (file)
@@ -5,18 +5,21 @@ proc do_windows_shortcut {} {
        global _gitworktree
        set fn [tk_getSaveFile \
                -parent . \
-               -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+               -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
                -initialfile "Git [reponame].lnk"]
        if {$fn != {}} {
                if {[file extension $fn] ne {.lnk}} {
                        set fn ${fn}.lnk
                }
+               # Use git-gui.exe if available (ie: git-for-windows)
+               set cmdLine [auto_execok git-gui.exe]
+               if {$cmdLine eq {}} {
+                       set cmdLine [list [info nameofexecutable] \
+                                                        [file normalize $::argv0]]
+               }
                if {[catch {
-                               win32_create_lnk $fn [list \
-                                       [info nameofexecutable] \
-                                       [file normalize $::argv0] \
-                                       ] \
-                                       [file normalize [$_gitworktree]]
+                               win32_create_lnk $fn $cmdLine \
+                                       [file normalize $_gitworktree]
                        } err]} {
                        error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
                }
@@ -37,7 +40,7 @@ proc do_cygwin_shortcut {} {
        }
        set fn [tk_getSaveFile \
                -parent . \
-               -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+               -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
                -initialdir $desktop \
                -initialfile "Git [reponame].lnk"]
        if {$fn != {}} {
@@ -57,7 +60,7 @@ proc do_cygwin_shortcut {} {
                                        $sh -c \
                                        "CHERE_INVOKING=1 source /etc/profile;[sq $me] &" \
                                        ] \
-                                       [file normalize [$_gitworktree]]
+                                       [file normalize $_gitworktree]
                        } err]} {
                        error_popup [strcat [mc "Cannot write shortcut:"] "\n\n$err"]
                }
@@ -69,7 +72,7 @@ proc do_macosx_app {} {
 
        set fn [tk_getSaveFile \
                -parent . \
-               -title [append "[appname] ([reponame]): " [mc "Create Desktop Icon"]] \
+               -title [mc "%s (%s): Create Desktop Icon" [appname] [reponame]] \
                -initialdir [file join $env(HOME) Desktop] \
                -initialfile "Git [reponame].app"]
        if {$fn != {}} {