git-gui: ssh-askpass: add a checkbox to show the input text
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>
David Aguilar committed
Nov 7, 2020 at 14:20 UTC
a4e1bc99713355b8b11cdd8ae691aa05f063b351
1 file changed
+14
-1
git-gui--askpass
+14
-1
@@ -26,8 +26,21 @@ pack .m -side top -fill x -padx 20 -pady 20 -expand 1
26
entry .e -textvariable answer -width 50
27
pack .e -side top -fill x -padx 10 -pady 10
28
29
+proc on_show_input_changed {args} {
30
+ global show_input
31
+ if {$show_input} {
32
+ .e configure -show ""
33
+ } else {
34
+ .e configure -show "*"
35
+ }
36
+}
37
+trace add variable show_input write "on_show_input_changed"
38
+
39
+set show_input 0
40
+
41
if {!$yesno} {
30
- .e configure -show "*"
42
+ checkbutton .cb_show -text "Show input" -variable show_input
43
+ pack .cb_show -side top -anchor nw
44
}
45
46
frame .b