[svn] pinentry - r237 - in trunk: . gtk+-2
svn author wk
cvs at cvs.gnupg.org
Wed Sep 22 13:30:07 CEST 2010
Author: wk
Date: 2010-09-22 13:30:06 +0200 (Wed, 22 Sep 2010)
New Revision: 237
Modified:
trunk/ChangeLog
trunk/NEWS
trunk/gtk+-2/pinentry-gtk-2.c
Log:
Make default-cacnel and default-ok work for GTK2
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2010-08-19 14:44:31 UTC (rev 236)
+++ trunk/ChangeLog 2010-09-22 11:30:06 UTC (rev 237)
@@ -1,3 +1,8 @@
+2010-09-22 Werner Koch <wk at g10code.com>
+
+ * gtk+-2/pinentry-gtk-2.c (create_window): Make use of
+ default_cancel and default_ok.
+
2010-08-19 Werner Koch <wk at g10code.com>
* gtk+-2/Makefile.am (pinentry_gtk_2_SOURCES): Add gseal-gtk-compat.h.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2010-08-19 14:44:31 UTC (rev 236)
+++ trunk/NEWS 2010-09-22 11:30:06 UTC (rev 237)
@@ -6,6 +6,8 @@
* The GTK pinentry now always sticks to the top and properly grabs
the keyboard.
+ * The protocol options default-cancel and default-ok now work for the
+ pinnetry-gtk2.
Noteworthy changes in version 0.8.0 (2010-03-03)
------------------------------------------------
Modified: trunk/gtk+-2/pinentry-gtk-2.c
===================================================================
--- trunk/gtk+-2/pinentry-gtk-2.c 2010-08-19 14:44:31 UTC (rev 236)
+++ trunk/gtk+-2/pinentry-gtk-2.c 2010-09-22 11:30:06 UTC (rev 237)
@@ -1,7 +1,7 @@
/* pinentry-gtk-2.c
Copyright (C) 1999 Robert Bihlmeyer <robbe at orcus.priv.at>
Copyright (C) 2001, 2002, 2007 g10 Code GmbH
- Copyright (C) 2004 by Albrecht Dreß <albrecht.dress at arcor.de>
+ Copyright (C) 2004 by Albrecht Dreà <albrecht.dress at arcor.de>
pinentry-gtk-2 is a pinentry application for the Gtk+-2 widget set.
It tries to follow the Gnome Human Interface Guide as close as
@@ -222,6 +222,8 @@
if (g_utf8_validate (text, -1, NULL))
return g_strdup (text);
+ /* Failure: Assume that it was encoded in the current locale and
+ convert it to utf-8. */
result = g_locale_to_utf8 (text, -1, NULL, NULL, NULL);
if (!result)
{
@@ -459,8 +461,20 @@
w = gtk_button_new_with_mnemonic (msg);
g_free (msg);
}
+ else if (pinentry->default_cancel)
+ {
+ GtkWidget *image;
+
+ msg = pinentry_utf8_validate (pinentry->default_cancel);
+ w = gtk_button_new_with_mnemonic (msg);
+ g_free (msg);
+ image = gtk_image_new_from_stock (GTK_STOCK_CANCEL,
+ GTK_ICON_SIZE_BUTTON);
+ if (image)
+ gtk_button_set_image (GTK_BUTTON (w), image);
+ }
else
- w = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
+ w = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
gtk_container_add (GTK_CONTAINER (bbox), w);
g_signal_connect (G_OBJECT (w), "clicked",
G_CALLBACK (confirm_mode ? confirm_button_clicked
@@ -488,6 +502,18 @@
w = gtk_button_new_with_mnemonic (msg);
g_free (msg);
}
+ else if (pinentry->default_ok)
+ {
+ GtkWidget *image;
+
+ msg = pinentry_utf8_validate (pinentry->default_ok);
+ w = gtk_button_new_with_mnemonic (msg);
+ g_free (msg);
+ image = gtk_image_new_from_stock (GTK_STOCK_OK,
+ GTK_ICON_SIZE_BUTTON);
+ if (image)
+ gtk_button_set_image (GTK_BUTTON (w), image);
+ }
else
w = gtk_button_new_from_stock (GTK_STOCK_OK);
gtk_container_add (GTK_CONTAINER(bbox), w);
More information about the Gnupg-commits
mailing list