[git] Pinentry - branch, master, updated. pinentry-0.9.7-11-g71b51e0

by Andre Heinecke cvs at cvs.gnupg.org
Thu Apr 14 16:01:46 CEST 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The standard pinentry collection".

The branch, master has been updated
       via  71b51e02cf20174ba7144765e985f7e889eaa429 (commit)
      from  287d40e879f767dbcb3d19b3629b872c08d39cf4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 71b51e02cf20174ba7144765e985f7e889eaa429
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Thu Apr 14 15:56:09 2016 +0200

    GTK: Add visibility toggle button
    
    * gtk+-2/pinentry-gtk-2.c (create_window): Create checkbox.
     (show_passphrase_toggled): New. Do the toggling.
    
    --
    GnuPG-Bug-ID: 2139

diff --git a/gtk+-2/pinentry-gtk-2.c b/gtk+-2/pinentry-gtk-2.c
index 5ebdd64..ed6c677 100644
--- a/gtk+-2/pinentry-gtk-2.c
+++ b/gtk+-2/pinentry-gtk-2.c
@@ -356,6 +356,20 @@ may_save_passphrase_toggled (GtkWidget *widget, gpointer data)
 #endif
 
 
+static void
+show_passphrase_toggled (GtkWidget *widget, gpointer data)
+{
+  GtkToggleButton *button = GTK_TOGGLE_BUTTON (widget);
+  gtk_entry_set_visibility (GTK_ENTRY (entry),
+                            gtk_toggle_button_get_active (button));
+  if (repeat_entry)
+    {
+      gtk_entry_set_visibility (GTK_ENTRY (repeat_entry),
+                                gtk_toggle_button_get_active (button));
+    }
+}
+
+
 static gboolean
 timeout_cb (gpointer data)
 {
@@ -606,6 +620,25 @@ create_window (pinentry_t ctx)
 			(gpointer) ctx);
     }
 #endif
+  /* Add the show visibile toggle button */
+  if (pinentry->default_tt_visi)
+    {
+      msg = pinentry_utf8_validate (pinentry->default_tt_visi);
+      w = gtk_check_button_new_with_mnemonic (msg);
+      g_free (msg);
+    }
+  else
+    w = gtk_check_button_new_with_label ("Show passphrase");
+
+  /* Make sure it is off by default.  */
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (w), FALSE);
+
+  gtk_box_pack_start (GTK_BOX (box), w, TRUE, FALSE, 0);
+  gtk_widget_show (w);
+
+  g_signal_connect (G_OBJECT (w), "toggled",
+                    G_CALLBACK (show_passphrase_toggled),
+                    NULL);
 
   if (!pinentry->one_button)
     {

-----------------------------------------------------------------------

Summary of changes:
 gtk+-2/pinentry-gtk-2.c | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)


hooks/post-receive
-- 
The standard pinentry collection
http://git.gnupg.org




More information about the Gnupg-commits mailing list