Code

git-gui: include the file path in guitools confirmation dialog
authorBert Wesarg <bert.wesarg@googlemail.com>
Thu, 20 Oct 2011 19:32:30 +0000 (21:32 +0200)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 21 Oct 2011 22:15:10 +0000 (23:15 +0100)
For those guitools that require a filename, display this filename when
asking the user to confirm the tool launch.

[PT: modified to use positional parameters for i18n]

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
lib/tools.tcl

index 95e6e5553ea86482d0fe9be77b07e805e01e3393..6ec94113db7d8c75d78e5300469bb8154e37c940 100644 (file)
@@ -87,8 +87,14 @@ proc tools_exec {fullname} {
                        return
                }
        } elseif {[is_config_true "guitool.$fullname.confirm"]} {
-               if {[ask_popup [mc "Are you sure you want to run %s?" $fullname]] ne {yes}} {
-                       return
+               if {[is_config_true "guitool.$fullname.needsfile"]} {
+                       if {[ask_popup [mc "Are you sure you want to run %1\$s on file \"%2\$s\"?" $fullname $current_diff_path]] ne {yes}} {
+                               return
+                       }
+               } else {
+                       if {[ask_popup [mc "Are you sure you want to run %s?" $fullname]] ne {yes}} {
+                               return
+                       }
                }
        }