]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: ssh-askpass: add a checkbox to show the input text
authorDavid Aguilar <davvid@gmail.com>
Sat, 7 Nov 2020 22:20:39 +0000 (14:20 -0800)
committerPratyush Yadav <me@yadavpratyush.com>
Tue, 1 Dec 2020 19:28:13 +0000 (00:58 +0530)
Hide the input text by default since the field is
commonly used for sensative informations such as passwords.

Add a "Show input" checkbox to conditionally show the input.

Helped-by: Miguel Boekhold <miguel.boekhold@osudio.com>
Signed-off-by: Efimov Vasily <laer.18@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
git-gui--askpass

index 1c99ee8ca20d43f45bb733ca1f9516aa6c9c9e97..71a536d232d32253639b163f0122d52f944e55e0 100755 (executable)
@@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1
 entry .e -textvariable answer -width 50
 pack .e -side top -fill x -padx 10 -pady 10
 
+proc on_show_input_changed {args} {
+       global show_input
+       if {$show_input} {
+               .e configure -show ""
+       } else {
+               .e configure -show "*"
+       }
+}
+trace add variable show_input write "on_show_input_changed"
+
+set show_input 0
+
 if {!$yesno} {
-       .e configure -show "*"
+       checkbutton .cb_show -text "Show input" -variable show_input
+       pack .cb_show -side top -anchor nw
 }
 
 frame .b