[Gpa-commits] r869 - in trunk: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Apr 3 06:44:53 CEST 2008


Author: marcus
Date: 2008-04-03 06:44:51 +0200 (Thu, 03 Apr 2008)
New Revision: 869

Modified:
   trunk/TODO
   trunk/src/ChangeLog
   trunk/src/confdialog.c
   trunk/src/encryptdlg.c
   trunk/src/expirydlg.c
   trunk/src/gpa.c
   trunk/src/gpagenkeysimpleop.c
   trunk/src/gpapastrings.c
   trunk/src/gpawidgets.c
   trunk/src/gpawizard.c
   trunk/src/gtktools.c
   trunk/src/gtktools.h
   trunk/src/icons.c
   trunk/src/icons.h
   trunk/src/keyeditdlg.c
   trunk/src/keygendlg.c
   trunk/src/keygenwizard.c
   trunk/src/keyimpseldlg.c
   trunk/src/keyring.c
   trunk/src/recipientdlg.c
   trunk/src/siglist.c
Log:
2008-04-03  Marcus Brinkmann  <marcus at g10code.de>

	* confdialog.c (update_option): Use gtk_editable_set_editable
	instead of gtk_entry_set_editable.
	* gpawizard.c: Use g_object_set_data and g_object_get_data instead
	of gtk_object_set_data and gtk_object_get_data.
	(gpa_wizard_new): Use gtk_box_set_spacing instead of
	gtk_button_box_set_spacing.
	* keygenwizard.c: Use GtkImage instead of GtkPixmap.
	* keyring.c: Use combo box instead of option menu for signature
	user names.
	(keyring_details_page_fill_num_keys): Use
	gtk_notebook_set_current_page instead of gtk_notebook_set_page.
	(keyring_update_details_notebook): Use g_idle_add instead of
	gtk_idle_add.
	(keyring_editor_new): Use g_object_set_data_full instead of
	gtk_object_set_data_full.
	* gpawidgets.c (gpa_expiry_frame_new): Likewise.
	(gpa_expiry_frame_get_expiration, gpa_expiry_frame_validate): Use
	g_object_get_data instead of gtk_object_get_data.
	* icons.c (gpa_create_icon_widget): Remove obsolete function.
	(xpms): Change name of "keyring" icon to "gpa-keyring".
	* icons.h (gpa_create_icon_widget): Remove prototype.
	(GPA_STOCK_KEYRING_EDITOR): New macro.
	* keyring.c (keyring_editor_new): Use custom stock icon instead of
	gpa_create_icon_widget.
	* gtktools.c (gpa_window_show_centered): Remove obsolete function.
	* gtktools.h (gpa_window_show_centered): Remove prototype.
	* expirydlg.c (gpa_expiry_dialog_run): Change type of EXPIRY_DATE
	to time_t.  Use g_date_set_time_t instead of g_date_set_time.
	* gpapastrings.c (gpa_expiry_date_string): Use g_date_set_time_t
	instead of g_date_set_time.
	(gpa_creation_date_string): Likewise.
	* keygenwizard.c (free_keygen_wizard): Use g_object_unref instead
	of gdk_pixmap_unref.
	(gpa_keygen_wizard_new): Use gtk_window_set_transient_for and
	gtk_window_set_position instead of gpa_window_show_centered.
	(gpa_keygen_wizard_password_page): Use g_object_set_data instead
	of gtk_object_set_data.
	* keyimpseldlg.c (gpa_key_import_selection_dialog_run): Likewise.
	* gpagenkeysimpleop.c (gpa_gen_key_simple_operation_constructor):
	Show keygen wizard.
	* gpa.c, gpawidgets.c, encryptdlg.c, gpawizard.c, keyeditdlg.c,
	keyring.c, keyimpseldlg.c, keygenwizard.c, keygendlg.c: Use
	g_signal_connect instead of gtk_signal_connect.
	* gtktools.c (gpa_window_show_centered): Use gdk_drawable_get_size
	instead of gdk_window_get_size.


Modified: trunk/TODO
===================================================================
--- trunk/TODO	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/TODO	2008-04-03 04:44:51 UTC (rev 869)
@@ -60,7 +60,7 @@
 ** The sign, encrypt dialog and progress bar is not centered over the
    parent.  Maybe it is realized too early due to init vs constructor?
    It does get the right parent window parameter (checked that).
-** Use GtkAction instead of manual GLists for update sensitivity and stuff.
+** Use GtkActionGroups instead of manual GLists for update sensitivity and stuff.
 ** Not all users know about ctrl+click to select multiple items from a list.
    Use check boxes, or add instructions, or otherwise make this
    easier.
@@ -80,3 +80,15 @@
 ** When a file in the file manager is deleted, and one tries to encrypt it,
    GPA gives an untranslated error (mingw C lib syserr) and then shows
    an empty window with just a close button (Urgs!).
+** A right mouse click on the keylist in the keyring editor while
+   the pop up menu is shown makes the popup menu vanish, but does not
+   pop up the new menu for the key that should now be current but is not.
+** The config file parser truly sucks.  It has buffer overflows and corrupts
+   broken config files even more (for example, a single line
+   "keyserver" will cause the next word to move to the keyserver
+   line).
+** Make the build clean with the flags:
+   -DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
+   -DGDK_DISABLE_DEPRECATED -DPANGO_DISABLE_DEPRECATED
+   -DGDK_MULTIHEAD_SAFE -DGTK_MULTIHEAD_SAFE
+   This is mostly done, except for multi-head safeness and gtk marshalling.

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/ChangeLog	2008-04-03 04:44:51 UTC (rev 869)
@@ -1,5 +1,51 @@
 2008-04-03  Marcus Brinkmann  <marcus at g10code.de>
 
+	* confdialog.c (update_option): Use gtk_editable_set_editable
+	instead of gtk_entry_set_editable.
+	* gpawizard.c: Use g_object_set_data and g_object_get_data instead
+	of gtk_object_set_data and gtk_object_get_data.
+	(gpa_wizard_new): Use gtk_box_set_spacing instead of
+	gtk_button_box_set_spacing.
+	* keygenwizard.c: Use GtkImage instead of GtkPixmap.
+	* keyring.c: Use combo box instead of option menu for signature
+	user names.
+	(keyring_details_page_fill_num_keys): Use
+	gtk_notebook_set_current_page instead of gtk_notebook_set_page.
+	(keyring_update_details_notebook): Use g_idle_add instead of
+	gtk_idle_add.
+	(keyring_editor_new): Use g_object_set_data_full instead of
+	gtk_object_set_data_full.
+	* gpawidgets.c (gpa_expiry_frame_new): Likewise.
+	(gpa_expiry_frame_get_expiration, gpa_expiry_frame_validate): Use
+	g_object_get_data instead of gtk_object_get_data.
+	* icons.c (gpa_create_icon_widget): Remove obsolete function.
+	(xpms): Change name of "keyring" icon to "gpa-keyring".
+	* icons.h (gpa_create_icon_widget): Remove prototype.
+	(GPA_STOCK_KEYRING_EDITOR): New macro.
+	* keyring.c (keyring_editor_new): Use custom stock icon instead of
+	gpa_create_icon_widget.
+	* gtktools.c (gpa_window_show_centered): Remove obsolete function.
+	* gtktools.h (gpa_window_show_centered): Remove prototype.
+	* expirydlg.c (gpa_expiry_dialog_run): Change type of EXPIRY_DATE
+	to time_t.  Use g_date_set_time_t instead of g_date_set_time.
+	* gpapastrings.c (gpa_expiry_date_string): Use g_date_set_time_t
+	instead of g_date_set_time.
+	(gpa_creation_date_string): Likewise.
+	* keygenwizard.c (free_keygen_wizard): Use g_object_unref instead
+	of gdk_pixmap_unref.
+	(gpa_keygen_wizard_new): Use gtk_window_set_transient_for and
+	gtk_window_set_position instead of gpa_window_show_centered.
+	(gpa_keygen_wizard_password_page): Use g_object_set_data instead
+	of gtk_object_set_data.
+	* keyimpseldlg.c (gpa_key_import_selection_dialog_run): Likewise.
+	* gpagenkeysimpleop.c (gpa_gen_key_simple_operation_constructor):
+	Show keygen wizard.
+	* gpa.c, gpawidgets.c, encryptdlg.c, gpawizard.c, keyeditdlg.c,
+	keyring.c, keyimpseldlg.c, keygenwizard.c, keygendlg.c: Use
+	g_signal_connect instead of gtk_signal_connect.
+	* gtktools.c (gpa_window_show_centered): Use gdk_drawable_get_size
+	instead of gdk_window_get_size.
+
 	* gtktools.h (gpa_connect_by_accelerator): Remove prototype.
 	* gtktools.c (gpa_connect_by_accelerator): Remove obsolete interface.
 	* selectkeydlg.c (select_key_dlg_constructor): Remove accel_group.

Modified: trunk/src/confdialog.c
===================================================================
--- trunk/src/confdialog.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/confdialog.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -1,24 +1,25 @@
 /* confdialog.c - GPGME based configuration dialog for GPA.
- * Copyright (C) 2007, 2008 g10 Code GmbH
- *
- * This file is part of GPA.
- *
- * GPA is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * GPA is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
- * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
- * License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
- */
+   Copyright (C) 2007, 2008 g10 Code GmbH
 
-#include <config.h>
+   This file is part of GPA.
+  
+   GPA is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+  
+   GPA is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <assert.h>
@@ -568,7 +569,7 @@
 	  else
 	    gtk_entry_set_text (GTK_ENTRY (entry), "");
 
-	  gtk_entry_set_editable (GTK_ENTRY (entry), FALSE);
+	  gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
 	  gtk_widget_set_sensitive (entry, FALSE);
 	}
       else if (combo == COMBO_NO_ARG)
@@ -583,7 +584,7 @@
 	  else
 	    gtk_entry_set_text (GTK_ENTRY (entry), "");
 
-	  gtk_entry_set_editable (GTK_ENTRY (entry), FALSE);
+	  gtk_editable_set_editable (GTK_EDITABLE (entry), FALSE);
 	  gtk_widget_set_sensitive (entry, FALSE);
 	  /* FIXME: Change focus.  */
 	}
@@ -607,7 +608,7 @@
 	  else
 	    gtk_entry_set_text (GTK_ENTRY (entry), "");
 
-	  gtk_entry_set_editable (GTK_ENTRY (entry), TRUE);
+	  gtk_editable_set_editable (GTK_EDITABLE (entry), TRUE);
 	  gtk_widget_set_sensitive (entry, TRUE);
 	  /* FIXME: Change focus.  */
 	}

Modified: trunk/src/encryptdlg.c
===================================================================
--- trunk/src/encryptdlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/encryptdlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -174,8 +174,8 @@
   checkerSign = gtk_check_button_new_with_mnemonic (_("_Sign"));
   gtk_box_pack_start (GTK_BOX (vboxEncrypt), checkerSign, FALSE, FALSE, 0);
   dialog->check_sign = checkerSign;
-  gtk_signal_connect (GTK_OBJECT (checkerSign), "toggled",
-		      GTK_SIGNAL_FUNC (toggle_sign_cb), dialog);
+  g_signal_connect (G_OBJECT (checkerSign), "toggled",
+		    G_CALLBACK (toggle_sign_cb), dialog);
 
   labelWho = gtk_label_new_with_mnemonic (_("Sign _as "));
   gtk_box_pack_start (GTK_BOX (vboxEncrypt), labelWho, FALSE, TRUE, 0);

Modified: trunk/src/expirydlg.c
===================================================================
--- trunk/src/expirydlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/expirydlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -101,7 +101,7 @@
   GtkWidget * vbox;
   GtkWidget * radio;
   GtkWidget * calendar;
-  unsigned long expiry_date;
+  time_t expiry_date;
 
   GPAExpiryDialog dialog;
 
@@ -137,14 +137,14 @@
   gtk_box_pack_start (GTK_BOX (vbox), calendar, FALSE, FALSE, 0);
 
   g_signal_connect (G_OBJECT (dialog.radio_date), "toggled",
-                    (GCallback) expire_date_toggled_cb, calendar);
+                    G_CALLBACK (expire_date_toggled_cb), calendar);
 
-  expiry_date = key->subkeys->expires;
+  expiry_date = (time_t) key->subkeys->expires;
   
   if (expiry_date > 0)
     {
       GDate tmp;
-      g_date_set_time (&tmp, expiry_date);
+      g_date_set_time_t (&tmp, expiry_date);
       gtk_calendar_select_month (GTK_CALENDAR (calendar),
                                  g_date_get_month (&tmp)-1,
                                  g_date_get_year (&tmp));

Modified: trunk/src/gpa.c
===================================================================
--- trunk/src/gpa.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gpa.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -183,8 +183,8 @@
   if (! keyringeditor)
     {
       keyringeditor = keyring_editor_new ();
-      gtk_signal_connect (GTK_OBJECT (keyringeditor), "destroy",
-			  GTK_SIGNAL_FUNC (close_main_window), &keyringeditor);
+      g_signal_connect (G_OBJECT (keyringeditor), "destroy",
+			G_CALLBACK (close_main_window), &keyringeditor);
       gtk_widget_show_all (keyringeditor);
     }
 
@@ -198,8 +198,8 @@
 {
   /* FIXME: Shouldn't this connect only happen if the instance is
      created the first time?  Looks like a memory leak to me.  */
-  gtk_signal_connect (GTK_OBJECT (gpa_clipboard_get_instance ()), "destroy",
-		      GTK_SIGNAL_FUNC (quit_if_no_window), NULL);
+  g_signal_connect (G_OBJECT (gpa_clipboard_get_instance ()), "destroy",
+		    G_CALLBACK (quit_if_no_window), NULL);
   gtk_widget_show_all (gpa_clipboard_get_instance ());
 
   gtk_window_present (GTK_WINDOW (gpa_clipboard_get_instance ()));
@@ -212,8 +212,8 @@
 {
   /* FIXME: Shouldn't this connect only happen if the instance is
      created the first time?  Looks like a memory leak to me.  */
-  gtk_signal_connect (GTK_OBJECT (gpa_file_manager_get_instance ()), "destroy",
-		      GTK_SIGNAL_FUNC (quit_if_no_window), NULL);
+  g_signal_connect (G_OBJECT (gpa_file_manager_get_instance ()), "destroy",
+		    G_CALLBACK (quit_if_no_window), NULL);
   gtk_widget_show_all (gpa_file_manager_get_instance ());
 
   gtk_window_present (GTK_WINDOW (gpa_file_manager_get_instance ()));
@@ -227,9 +227,8 @@
   if (! settings_dialog)
     {
       settings_dialog = gpa_settings_dialog_new ();
-      gtk_signal_connect (GTK_OBJECT (settings_dialog), "destroy",
-			  GTK_SIGNAL_FUNC (close_main_window),
-                          &settings_dialog);
+      g_signal_connect (G_OBJECT (settings_dialog), "destroy",
+			G_CALLBACK (close_main_window), &settings_dialog);
       gtk_widget_show_all (settings_dialog);
     }
   gtk_window_present (GTK_WINDOW (settings_dialog));
@@ -243,9 +242,8 @@
   if (!backend_config_dialog)
     {
       backend_config_dialog = gpa_backend_config_dialog_new ();
-      gtk_signal_connect (GTK_OBJECT (backend_config_dialog), "destroy",
-			  GTK_SIGNAL_FUNC (close_main_window),
-                          &backend_config_dialog);
+      g_signal_connect (G_OBJECT (backend_config_dialog), "destroy",
+			G_CALLBACK (close_main_window), &backend_config_dialog);
       gtk_widget_show_all (backend_config_dialog);
     }
 

Modified: trunk/src/gpagenkeysimpleop.c
===================================================================
--- trunk/src/gpagenkeysimpleop.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gpagenkeysimpleop.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -79,6 +79,7 @@
   op->wizard = gpa_keygen_wizard_new (GPA_OPERATION (op)->window,
 				      gpa_gen_key_simple_operation_generate,
 				      op);
+  gtk_widget_show_all (op->wizard);
 
   /* Connect to the "done" signal */
   g_signal_connect (G_OBJECT (GPA_OPERATION (op)->context), "done",

Modified: trunk/src/gpapastrings.c
===================================================================
--- trunk/src/gpapastrings.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gpapastrings.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -68,7 +68,7 @@
 
   if( expiry_time > 0 )
     {
-      g_date_set_time (&expiry_date, expiry_time);
+      g_date_set_time_t (&expiry_date, (time_t) expiry_time);
       g_date_strftime (date_buffer, 256, "%x", &expiry_date);
       result = g_strdup (date_buffer);
     }
@@ -86,7 +86,7 @@
 
   if( creation_time > 0 )
     {
-      g_date_set_time (&creation_date, creation_time);
+      g_date_set_time_t (&creation_date, (time_t) creation_time);
       g_date_strftime (date_buffer, 256, "%x", &creation_date);
       result = g_strdup (date_buffer);
     }

Modified: trunk/src/gpawidgets.c
===================================================================
--- trunk/src/gpawidgets.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gpawidgets.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -220,7 +220,7 @@
   gtk_widget_set_sensitive (calendar, FALSE);
   gtk_box_pack_start (GTK_BOX (vboxExpire), calendar, FALSE, FALSE, 0);
   g_signal_connect (G_OBJECT (frame->radioAt), "toggled",
-                    (GCallback) expire_date_toggled_cb, calendar);
+                    G_CALLBACK (expire_date_toggled_cb), calendar);
   if (expiryDate)
     {
       gtk_calendar_select_month (GTK_CALENDAR (calendar),
@@ -239,17 +239,15 @@
     }
   else
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radioDont), TRUE);
-  gtk_signal_connect (GTK_OBJECT (radioDont), "toggled",
-		      GTK_SIGNAL_FUNC (gpa_expiry_frame_dont),
-		      (gpointer) frame);
-  gtk_signal_connect (GTK_OBJECT (radioAfter), "toggled",
-		      GTK_SIGNAL_FUNC (gpa_expiry_frame_after),
-		      (gpointer) frame);
-  gtk_signal_connect (GTK_OBJECT (radioAt), "toggled",
-		      GTK_SIGNAL_FUNC (gpa_expiry_frame_at), (gpointer) frame);
+  g_signal_connect (G_OBJECT (radioDont), "toggled",
+		    G_CALLBACK (gpa_expiry_frame_dont), frame);
+  g_signal_connect (G_OBJECT (radioAfter), "toggled",
+		    G_CALLBACK (gpa_expiry_frame_after), frame);
+  g_signal_connect (G_OBJECT (radioAt), "toggled",
+		    G_CALLBACK (gpa_expiry_frame_at), frame);
 
-  gtk_object_set_data_full (GTK_OBJECT (expiry_frame), "user_data",
-			    (gpointer) frame, gpa_expiry_frame_free);
+  g_object_set_data_full (G_OBJECT (expiry_frame), "user_data",
+			  frame, gpa_expiry_frame_free);
   return expiry_frame;
 }
 
@@ -258,8 +256,8 @@
 gpa_expiry_frame_get_expiration(GtkWidget * expiry_frame, GDate ** date,
 				int * interval, gchar * unit)
 {
-  GPAExpiryFrame * frame = gtk_object_get_data (GTK_OBJECT (expiry_frame),
-						"user_data");
+  GPAExpiryFrame * frame = g_object_get_data (G_OBJECT (expiry_frame),
+					      "user_data");
   gchar *temp;
   gboolean result = FALSE;
 
@@ -306,8 +304,8 @@
 gchar *
 gpa_expiry_frame_validate(GtkWidget * expiry_frame)
 {
-  GPAExpiryFrame * frame = gtk_object_get_data (GTK_OBJECT (expiry_frame),
-						"user_data");
+  GPAExpiryFrame * frame = g_object_get_data (G_OBJECT (expiry_frame),
+					      "user_data");
   gchar * result = NULL;
 
   if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (frame->radioDont)))

Modified: trunk/src/gpawizard.c
===================================================================
--- trunk/src/gpawizard.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gpawizard.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -65,14 +65,14 @@
       page_number = 0;
   page_widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK(wizard->notebook),
 					   page_number);
-  return gtk_object_get_data (GTK_OBJECT (page_widget), "gpa_wizard_page");
+  return g_object_get_data (G_OBJECT (page_widget), "gpa_wizard_page");
 }
 
 /* Update the buttons of the wizard depending on the current page */
 void
 gpa_wizard_update_buttons (GtkWidget * widget)
 {
-  GPAWizard * wizard = gtk_object_get_data (GTK_OBJECT (widget), "user_data");
+  GPAWizard * wizard = g_object_get_data (G_OBJECT (widget), "user_data");
   GPAWizardPage * page;
   int page_number;
 
@@ -167,22 +167,20 @@
   int page_number;
   GtkWidget * focus;
   GtkWidget * main_widget = user_data;
-  GPAWizard * wizard = gtk_object_get_data (GTK_OBJECT (main_widget),
-					    "user_data");
+  GPAWizard * wizard = g_object_get_data (G_OBJECT (main_widget), "user_data");
 
-  /* switch-page is emitted also when pages are added to the notebook,
-   * even when it's not even displayed yet. In that case the page number
-   * is < 0, so we simply ignore that case and only try to set the focus
-   * if the page number is >= 0.
-   */
-  page_number = gtk_notebook_get_current_page (GTK_NOTEBOOK(notebook));
+  /* Switch-page is emitted also when pages are added to the notebook,
+     even when it's not even displayed yet.  In that case the page
+     number is < 0, so we simply ignore that case and only try to set
+     the focus if the page number is >= 0.  */
+  page_number = gtk_notebook_get_current_page (GTK_NOTEBOOK (notebook));
   if (page_number >= 0)
     {
       gpa_wizard_update_buttons ((GtkWidget *)user_data);
       page_widget = gtk_notebook_get_nth_page (GTK_NOTEBOOK(notebook),
 					       page_number);
-      focus = gtk_object_get_data (GTK_OBJECT (page_widget),
-				   "gpa_wizard_focus_child");
+      focus = g_object_get_data (G_OBJECT (page_widget),
+				 "gpa_wizard_focus_child");
       if (focus)
 	{
 	  gtk_widget_grab_focus (focus);
@@ -214,23 +212,22 @@
 
 /* Create a new GPA Wizard.  */
 GtkWidget *
-gpa_wizard_new (GtkAccelGroup * accel_group,
+gpa_wizard_new (GtkAccelGroup *accel_group,
 		GtkSignalFunc close_func, gpointer close_data)
 {
-  GtkWidget * vbox;
-  GtkWidget * notebook;
-  GtkWidget * hbox;
-  GtkWidget * button_box;
-  GtkWidget * button;
+  GtkWidget *vbox;
+  GtkWidget *notebook;
+  GtkWidget *hbox;
+  GtkWidget *button_box;
+  GtkWidget *button;
 
-  GPAWizard * wizard = g_malloc (sizeof (*wizard));
+  GPAWizard *wizard = g_malloc (sizeof (*wizard));
   wizard->accel_group = accel_group;
   wizard->page_switched = NULL;
   wizard->page_switched_data = NULL;
 
   vbox = gtk_vbox_new (FALSE, 3);
-  gtk_object_set_data_full (GTK_OBJECT (vbox), "user_data", (gpointer)wizard,
-			    g_free);
+  g_object_set_data_full (G_OBJECT (vbox), "user_data", wizard, g_free);
 
   notebook = gtk_notebook_new ();
   wizard->notebook = notebook;
@@ -239,14 +236,12 @@
   gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
   gtk_container_set_border_width (GTK_CONTAINER (notebook), 5);
   /* use *_connect_after so that the callback is called after the
-   * current page number has been updated so that
-   * gpa_wizard_update_buttons uses the new page */
-  gtk_signal_connect_after (GTK_OBJECT (notebook), "switch-page",
-			    GTK_SIGNAL_FUNC (gpa_wizard_page_switched),
-			    (gpointer)vbox);
-  gtk_signal_connect (GTK_OBJECT (notebook), "destroy",
-		      GTK_SIGNAL_FUNC (gpa_wizard_notebook_destroy),
-		      wizard);
+     current page number has been updated so that
+     gpa_wizard_update_buttons uses the new page.  */
+  g_signal_connect_after (G_OBJECT (notebook), "switch-page",
+			  G_CALLBACK (gpa_wizard_page_switched), vbox);
+  g_signal_connect (G_OBJECT (notebook), "destroy",
+		    G_CALLBACK (gpa_wizard_notebook_destroy), wizard);
 
   hbox = gtk_hbox_new (FALSE, 3);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5);
@@ -255,37 +250,39 @@
   button_box = gtk_hbutton_box_new ();
   gtk_box_pack_start (GTK_BOX (hbox), button_box, TRUE, TRUE, 5);
   gtk_button_box_set_layout (GTK_BUTTON_BOX (button_box), GTK_BUTTONBOX_END);
-  gtk_button_box_set_spacing (GTK_BUTTON_BOX (button_box), 10);
+  gtk_box_set_spacing (GTK_BOX (button_box), 10);
 
   button = gtk_button_new_from_stock (GTK_STOCK_GO_BACK);
   wizard->prev_button = button;
   gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-		      GTK_SIGNAL_FUNC (gpa_wizard_prev), (gpointer) wizard);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (gpa_wizard_prev), wizard);
   
   button = gtk_button_new_from_stock (GTK_STOCK_GO_FORWARD);
   wizard->next_button = button;
   gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-		      GTK_SIGNAL_FUNC (gpa_wizard_next), (gpointer) vbox);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (gpa_wizard_next), vbox);
 
   button = gtk_button_new_from_stock (GTK_STOCK_APPLY);
   wizard->finish_button = button;
   gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-		      GTK_SIGNAL_FUNC (gpa_wizard_next), (gpointer) vbox);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (gpa_wizard_next), vbox);
 
   button = gtk_button_new_from_stock (GTK_STOCK_CLOSE);
   wizard->close_button = button;
   gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 5);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", close_func, close_data);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (close_func), close_data);
   gtk_widget_add_accelerator (button, "clicked", accel_group, GDK_Escape,
 			      0, 0);
 
   button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
   wizard->cancel_button = button;
   gtk_box_pack_start (GTK_BOX (button_box), button, FALSE, FALSE, 5);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", close_func, close_data);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (close_func), close_data);
   gtk_widget_add_accelerator (button, "clicked", accel_group, GDK_Escape,
 			      0, 0);
 
@@ -306,15 +303,15 @@
 			gboolean is_last,
 			GPAWizardAction action, gpointer user_data)
 {
-  GPAWizard * wizard = gtk_object_get_data (GTK_OBJECT (widget), "user_data");
+  GPAWizard * wizard = g_object_get_data (G_OBJECT (widget), "user_data");
   GPAWizardPage * page = g_malloc (sizeof (*page));
 
   page->is_last = is_last;
   page->action = action;
   page->user_data = user_data;
   
-  gtk_object_set_data_full (GTK_OBJECT (page_widget), "gpa_wizard_page",
-			    (gpointer)page, g_free);
+  g_object_set_data_full (G_OBJECT (page_widget), "gpa_wizard_page",
+			  page, g_free);
   gtk_notebook_append_page (GTK_NOTEBOOK (wizard->notebook), page_widget,
 			    NULL);
 }
@@ -325,8 +322,8 @@
 void
 gpa_wizard_next_page (GtkWidget * widget)
 {
-  GPAWizard * wizard =  gtk_object_get_data (GTK_OBJECT (widget), "user_data");
-  GPAWizardPage * page;
+  GPAWizard *wizard = g_object_get_data (G_OBJECT (widget), "user_data");
+  GPAWizardPage *page;
   
   page = gpa_wizard_get_current_page (wizard);
   if (page->action)
@@ -339,22 +336,21 @@
 
 
 /* Turn to the next page of the wizard and don't run the page action.
- * This is used e.g. in keygenwizard.c by the action callback that is
- * invoked by the finish button to display a "wait" message.
- */
+   This is used e.g. in keygenwizard.c by the action callback that is
+   invoked by the finish button to display a "wait" message.  */
 void
-gpa_wizard_next_page_no_action (GtkWidget * widget)
+gpa_wizard_next_page_no_action (GtkWidget *widget)
 {
-  GPAWizard * wizard = gtk_object_get_data (GTK_OBJECT (widget), "user_data");
+  GPAWizard *wizard = g_object_get_data (G_OBJECT (widget), "user_data");
   gtk_notebook_next_page (GTK_NOTEBOOK (wizard->notebook));
 }
 
 /***/
-void gpa_wizard_set_page_switched (GtkWidget * widget,
+void gpa_wizard_set_page_switched (GtkWidget *widget,
 				   GPAWizardPageSwitchedFunc page_switched,
 				   gpointer param)
 {
-  GPAWizard * wizard = gtk_object_get_data (GTK_OBJECT (widget), "user_data");
+  GPAWizard *wizard = g_object_get_data (G_OBJECT (widget), "user_data");
   wizard->page_switched = page_switched;
   wizard->page_switched_data = param;
 }

Modified: trunk/src/gtktools.c
===================================================================
--- trunk/src/gtktools.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gtktools.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -37,36 +37,7 @@
 
 /* BEGIN of old unchecked code (wk 2008-03-07) */
 
-
-/* Show all children of the GtkWindow widget, realize it, set its
-   position so that it's in the center of the parent and show the
-   window itself.  */
 void
-gpa_window_show_centered (GtkWidget * widget, GtkWidget * parent)
-{
-  int parent_x, parent_y, parent_width, parent_height;
-  int center_x, center_y;
-  int width, height;
-  GtkWidget * child = GTK_BIN (widget)->child;
-
-  gtk_widget_show_all (child);
-  gtk_widget_realize (child);
-
-  gdk_window_get_size (widget->window, &width, &height);
-  gdk_window_get_origin (parent->window, &parent_x, &parent_y);
-  gdk_window_get_size (parent->window, &parent_width, &parent_height);
-
-  center_x = parent_x + (parent_width - width) / 2;
-  center_y = parent_y + (parent_height - height) / 2;
-
-  gtk_window_set_position (GTK_WINDOW(widget), GTK_WIN_POS_NONE);
-  gtk_widget_set_uposition (widget, center_x, center_y);
-  gtk_window_set_transient_for(GTK_WINDOW(widget), GTK_WINDOW(parent));
-  gtk_widget_show_all (widget);
-}
-
-
-void
 gpa_window_error (const gchar *message, GtkWidget *messenger)
 {
   GtkWidget *windowError;

Modified: trunk/src/gtktools.h
===================================================================
--- trunk/src/gtktools.h	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/gtktools.h	2008-04-03 04:44:51 UTC (rev 869)
@@ -23,7 +23,6 @@
 
 #include <gtk/gtk.h>
 
-extern void gpa_window_show_centered (GtkWidget * widget, GtkWidget * parent);
 extern void gpa_window_error (const gchar * message, GtkWidget * messenger);
 extern void gpa_window_message (gchar * message, GtkWidget * messenger);
 

Modified: trunk/src/icons.c
===================================================================
--- trunk/src/icons.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/icons.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -67,7 +67,7 @@
   { "gpa-brief", brief_xpm },
   { "gpa-detailed", detailed_xpm },
   { "gpa-edit", edit_xpm },
-  { "keyring", keyring_xpm },
+  { "gpa-keyring", keyring_xpm },
   { "gpa_blue_key", gpa_blue_key_xpm },
   { "gpa_yellow_key", gpa_yellow_key_xpm },
   { "blue_key",	blue_key_xpm },
@@ -109,20 +109,6 @@
 }
 
 
-GtkWidget *
-gpa_create_icon_widget (GtkWidget *window, const char *name)
-{
-    GdkBitmap *mask;
-    GtkWidget *icon = NULL;
-    GdkPixmap *pix;
-
-    pix = pixmap_for_icon (window, name, &mask);
-    if (pix)
-      icon = gtk_pixmap_new (pix, mask);
-    return icon;
-}
-
-
 GdkPixmap *
 gpa_create_icon_pixmap (GtkWidget *window, const char *name, GdkBitmap **mask)
 {

Modified: trunk/src/icons.h
===================================================================
--- trunk/src/icons.h	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/icons.h	2008-04-03 04:44:51 UTC (rev 869)
@@ -21,8 +21,6 @@
 #ifndef ICONS_H
 #define ICONS_H
 
-GtkWidget *gpa_create_icon_widget (GtkWidget *window, const char *name);
-
 GdkPixmap *gpa_create_icon_pixmap (GtkWidget *window, const char *name,
                                    GdkBitmap **mask);
 
@@ -35,6 +33,7 @@
 #define GPA_STOCK_ENCRYPT "gpa-encrypt"
 #define GPA_STOCK_DECRYPT "gpa-decrypt"
 #define GPA_STOCK_KEYRING "gpa-keyringeditor"
+#define GPA_STOCK_KEYRING_EDITOR "gpa-keyring"
 /* FIXME: Add GPA_STOCK_FILEMAN and GPA_STOCK_CLIPBOARD stock items.
    Need to figure out how to clone a stock icon though.  */
 #define GPA_STOCK_FILEMAN GTK_STOCK_DIRECTORY

Modified: trunk/src/keyeditdlg.c
===================================================================
--- trunk/src/keyeditdlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/keyeditdlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -184,8 +184,8 @@
   gtk_widget_set_sensitive (button,(gpa_keytable_lookup_key 
 			     (gpa_keytable_get_secret_instance(), 
 			      dialog->key->subkeys->fpr) != NULL));
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-		      (GtkSignalFunc)gpa_key_edit_change_expiry, dialog);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (gpa_key_edit_change_expiry), dialog);
 
   /* Close the dialog in response */
   g_signal_connect (G_OBJECT (dialog), "response", 

Modified: trunk/src/keygendlg.c
===================================================================
--- trunk/src/keygendlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/keygendlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -158,7 +158,7 @@
                                    GTK_RESPONSE_OK);
   dialog.window = windowGenerate;
 
-  /* Use gtk_signal_connect_object here to make the dialog pointer the
+  /* Use g_signal_connect_object here to make the dialog pointer the
      first parameter of the handler.  */
   //  g_signal_connect (G_OBJECT (windowGenerate), "delete-event",
   //  		    G_CALLBACK (gtk_widget_destroy), dialog.window);

Modified: trunk/src/keygenwizard.c
===================================================================
--- trunk/src/keygenwizard.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/keygenwizard.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -65,19 +65,19 @@
 
 
 typedef struct {
-  GtkWidget * window;
-  GtkWidget * wizard;
-  GtkWidget * name_page;
-  GtkWidget * email_page;
-  GtkWidget * passwd_page;
-  GtkWidget * wait_page;
-  GtkWidget * final_page;
-  GtkWidget * backup_page;
-  GtkWidget * backup_dir_page;
-  GtkWidget * pixmap_widget;
-  GtkAccelGroup * accel_group;
-  GdkPixmap * genkey_pixmap;
-  GdkPixmap * backup_pixmap;
+  GtkWidget *window;
+  GtkWidget *wizard;
+  GtkWidget *name_page;
+  GtkWidget *email_page;
+  GtkWidget *passwd_page;
+  GtkWidget *wait_page;
+  GtkWidget *final_page;
+  GtkWidget *backup_page;
+  GtkWidget *backup_dir_page;
+  GtkWidget *image_widget;
+  GtkAccelGroup *accel_group;
+  GdkPixmap *genkey_pixmap;
+  GdkPixmap *backup_pixmap;
 
   GpaKeyGenWizardGenerateCb generate;
   gpointer generate_data;
@@ -127,11 +127,11 @@
 
   entry = gtk_entry_new ();
   gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 5);
-  gtk_signal_connect (GTK_OBJECT (entry), "activate",
-		      GTK_SIGNAL_FUNC (switch_to_next_page), keygen_wizard);
+  g_signal_connect (G_OBJECT (entry), "activate",
+		    G_CALLBACK (switch_to_next_page), keygen_wizard);
 
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_keygen_entry", entry);
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_wizard_focus_child", entry);
+  g_object_set_data (G_OBJECT (vbox), "gpa_keygen_entry", entry);
+  g_object_set_data (G_OBJECT (vbox), "gpa_wizard_focus_child", entry);
   return vbox;
 }
 
@@ -140,7 +140,7 @@
 {
   GtkWidget * entry;
 
-  entry = gtk_object_get_data (GTK_OBJECT (vbox), "gpa_keygen_entry");
+  entry = g_object_get_data (G_OBJECT (vbox), "gpa_keygen_entry");
   return string_strip_dup ((gchar *) gtk_entry_get_text (GTK_ENTRY (entry)));
 }
 
@@ -254,10 +254,8 @@
   gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 0, 1,
 		    GTK_FILL|GTK_EXPAND, 0, 0, 0);
   gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_keygen_passwd",
-		       (gpointer)entry);
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_wizard_focus_child",
-		       (gpointer)entry);
+  g_object_set_data (G_OBJECT (vbox), "gpa_keygen_passwd", entry);
+  g_object_set_data (G_OBJECT (vbox), "gpa_wizard_focus_child", entry);
 
   label = gtk_label_new (_("Repeat Passphrase: "));
   gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, GTK_FILL, 0, 0, 0);
@@ -267,12 +265,11 @@
   gtk_table_attach (GTK_TABLE (table), entry, 1, 2, 1, 2,
 		    GTK_FILL|GTK_EXPAND, 0, 0, 0);
   gtk_entry_set_visibility (GTK_ENTRY (entry), FALSE);
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_keygen_passwd_repeat",
-		       (gpointer)entry);
-  gtk_signal_connect (GTK_OBJECT (entry), "activate",
-		      GTK_SIGNAL_FUNC (switch_to_next_page), keygen_wizard);
-  gtk_signal_connect (GTK_OBJECT (passwd_entry), "activate",
-		      GTK_SIGNAL_FUNC (focus_repeat_passphrase), entry);
+  g_object_set_data (G_OBJECT (vbox), "gpa_keygen_passwd_repeat", entry);
+  g_signal_connect (G_OBJECT (entry), "activate",
+		    G_CALLBACK (switch_to_next_page), keygen_wizard);
+  g_signal_connect (G_OBJECT (passwd_entry), "activate",
+		    G_CALLBACK (focus_repeat_passphrase), entry);
 
   return vbox;
 }
@@ -280,8 +277,7 @@
 static gchar *
 gpa_keygen_wizard_password_get_password (GtkWidget * vbox)
 {
-  GtkWidget * entry = gtk_object_get_data (GTK_OBJECT (vbox),
-					   "gpa_keygen_passwd");
+  GtkWidget *entry = g_object_get_data (G_OBJECT (vbox), "gpa_keygen_passwd");
   return (gchar *) gtk_entry_get_text (GTK_ENTRY (entry));
 }
 
@@ -294,13 +290,13 @@
 static gboolean
 gpa_keygen_wizard_password_validate (gpointer data)
 {
-  GPAKeyGenWizard * keygen_wizard = data;
+  GPAKeyGenWizard *keygen_wizard = data;
   gboolean result = TRUE;
-  GtkWidget * vbox = keygen_wizard->passwd_page;
-  GtkWidget * entry_passwd = gtk_object_get_data (GTK_OBJECT (vbox),
-						  "gpa_keygen_passwd");
-  GtkWidget * entry_repeat = gtk_object_get_data (GTK_OBJECT (vbox),
-						  "gpa_keygen_passwd_repeat");
+  GtkWidget *vbox = keygen_wizard->passwd_page;
+  GtkWidget *entry_passwd = g_object_get_data (G_OBJECT (vbox),
+					       "gpa_keygen_passwd");
+  GtkWidget *entry_repeat = g_object_get_data (G_OBJECT (vbox),
+					       "gpa_keygen_passwd_repeat");
 
   if (strcmp (gtk_entry_get_text (GTK_ENTRY (entry_passwd)),
 	      gtk_entry_get_text (GTK_ENTRY (entry_repeat))) != 0)
@@ -366,8 +362,7 @@
 
   radio = gtk_radio_button_new_with_mnemonic (NULL, _("Create _backup copy"));
   gtk_box_pack_start (GTK_BOX (vbox), radio, FALSE, TRUE, 5);
-  gtk_object_set_data (GTK_OBJECT (vbox), "gpa_keygen_backup",
-		       (gpointer)radio);
+  g_object_set_data (G_OBJECT (vbox), "gpa_keygen_backup", radio);
   
   radio = gtk_radio_button_new_with_mnemonic_from_widget
     (GTK_RADIO_BUTTON (radio), _("Do it _later"));
@@ -427,8 +422,8 @@
   memset (&params, 0, sizeof params);
 
   /* Shall we make backups? */
-  radio = gtk_object_get_data (GTK_OBJECT (keygen_wizard->backup_page),
-			       "gpa_keygen_backup");
+  radio = g_object_get_data (G_OBJECT (keygen_wizard->backup_page),
+			     "gpa_keygen_backup");
   do_backup = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (radio));
 
   /* The User ID */
@@ -482,8 +477,8 @@
 {
   GPAKeyGenWizard * keygen_wizard = data;
 
-  gdk_pixmap_unref (keygen_wizard->genkey_pixmap);
-  gdk_pixmap_unref (keygen_wizard->backup_pixmap);
+  g_object_unref (keygen_wizard->genkey_pixmap);
+  g_object_unref (keygen_wizard->backup_pixmap);
   g_free (keygen_wizard);
 }
 
@@ -504,22 +499,23 @@
       pixmap = keygen_wizard->genkey_pixmap;
     }
 
-  gtk_pixmap_set (GTK_PIXMAP (keygen_wizard->pixmap_widget), pixmap, NULL);
+  gtk_image_set_from_pixmap (GTK_IMAGE (keygen_wizard->image_widget),
+			     pixmap, NULL);
 }
 
-GtkWidget *gpa_keygen_wizard_new (GtkWidget * parent, 
-				  GpaKeyGenWizardGenerateCb generate_action,
-				  gpointer data)
+
+GtkWidget *
+gpa_keygen_wizard_new (GtkWidget *parent, 
+		       GpaKeyGenWizardGenerateCb generate_action,
+		       gpointer data)
 {
-  GtkWidget * window;
-  GtkWidget * wizard;
-  GtkWidget * hbox;
-  GtkWidget * pixmap_widget;
-  GtkAccelGroup * accel_group;
-  GPAKeyGenWizard * keygen_wizard;
+  GtkWidget *window;
+  GtkWidget *wizard;
+  GtkWidget *hbox;
+  GtkWidget *image_widget;
+  GtkAccelGroup *accel_group;
+  GPAKeyGenWizard *keygen_wizard;
 
-
-
   keygen_wizard = g_malloc (sizeof (*keygen_wizard));
   keygen_wizard->genkey_pixmap = gpa_create_icon_pixmap (parent,
 							 "wizard_genkey",
@@ -539,18 +535,19 @@
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
   gtk_window_set_title (GTK_WINDOW (window), _("Generate key"));
   gtk_container_set_border_width (GTK_CONTAINER (window), 5);
-  gtk_object_set_data_full (GTK_OBJECT (window), "user_data",
-			    (gpointer) keygen_wizard, free_keygen_wizard);
-  gtk_signal_connect_object (GTK_OBJECT (window), "destroy",
-			     GTK_SIGNAL_FUNC (gpa_keygen_wizard_destroy),
-			     (gpointer)keygen_wizard);
+  g_object_set_data_full (G_OBJECT (window), "user_data",
+			  keygen_wizard, free_keygen_wizard);
+  g_signal_connect_swapped (G_OBJECT (window), "destroy",
+			    G_CALLBACK (gpa_keygen_wizard_destroy),
+			    keygen_wizard);
 
   hbox = gtk_hbox_new (FALSE, 5);
   gtk_container_add (GTK_CONTAINER (window), hbox);
 
-  pixmap_widget = gtk_pixmap_new (keygen_wizard->genkey_pixmap, NULL);
-  keygen_wizard->pixmap_widget = pixmap_widget;
-  gtk_box_pack_start (GTK_BOX (hbox), pixmap_widget, FALSE, TRUE, 0);
+  image_widget = gtk_image_new_from_pixmap
+    (keygen_wizard->genkey_pixmap, NULL);
+  keygen_wizard->image_widget = image_widget;
+  gtk_box_pack_start (GTK_BOX (hbox), image_widget, FALSE, TRUE, 0);
   
   wizard = gpa_wizard_new (accel_group,
                            (GtkSignalFunc) gpa_keygen_wizard_close,
@@ -591,7 +588,9 @@
 			  TRUE, NULL, NULL);
 
   gtk_window_set_modal (GTK_WINDOW (window), TRUE);
-  gpa_window_show_centered (window, parent);
+  gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));
+  gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER_ON_PARENT);
+
   /* FIXME: This is a kludge to make sure that the proper buttons are shown
    * (must be done after the show_all). All this should be fixed properly
    * some day */

Modified: trunk/src/keyimpseldlg.c
===================================================================
--- trunk/src/keyimpseldlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/keyimpseldlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -116,8 +116,8 @@
   windowSelect = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (windowSelect), _("Select keys to import"));
   dialog.window = windowSelect;
-  gtk_signal_connect (GTK_OBJECT (windowSelect), "destroy",
-		      GTK_SIGNAL_FUNC (key_import_selection_destroy), NULL);
+  g_signal_connect (G_OBJECT (windowSelect), "destroy",
+		    G_CALLBACK (key_import_selection_destroy), NULL);
 
   vboxSelect = gtk_vbox_new (FALSE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (vboxSelect), 5);
@@ -147,20 +147,22 @@
   gtk_container_set_border_width (GTK_CONTAINER (hButtonBoxSelect), 5);
 
   buttonSelect = gtk_button_new_from_stock (GTK_STOCK_OK);
-  gtk_signal_connect_object (GTK_OBJECT (buttonSelect), "clicked",
-			     GTK_SIGNAL_FUNC (key_import_selection_ok),
-			     (gpointer) &dialog);
+  g_signal_connect_swapped (G_OBJECT (buttonSelect), "clicked",
+			    G_CALLBACK (key_import_selection_ok), &dialog);
   gtk_container_add (GTK_CONTAINER (hButtonBoxSelect), buttonSelect);
 
 
   buttonCancel = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-		      key_import_selection_cancel, &dialog);
+  g_signal_connect (G_OBJECT (button), "clicked",
+		    G_CALLBACK (key_import_selection_cancel), &dialog);
   gtk_container_add (GTK_CONTAINER (hButtonBoxSelect), buttonCancel);
 
   gtk_container_add (GTK_CONTAINER (windowSelect), vboxSelect);
-  gpa_window_show_centered (windowSelect, parent);
+
   gtk_window_set_modal (GTK_WINDOW (windowSelect), TRUE);
+  gtk_window_set_transient_for (GTK_WINDOW (window), GTK_WINDOW (parent));
+  gtk_window_set_position (GTK_WINDOW (window), GTK_WIN_POS_CENTER_ON_PARENT);
+  gtk_widget_show_all (window);
 
   gtk_main ();
 }

Modified: trunk/src/keyring.c
===================================================================
--- trunk/src/keyring.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/keyring.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -120,6 +120,7 @@
   /* The signatures list in the notebook.  */
   GtkWidget *signatures_list;
   GtkWidget *signatures_uids;
+  gint signatures_count;
   GtkWidget *signatures_hbox;
 
   /* The subkeys list in the notebook.  */
@@ -178,7 +179,7 @@
 /* Prototype of a sensitivity callback.  Return TRUE if the widget
    should be senstitive, FALSE otherwise.  The parameter is a pointer
    to the GPAKeyringEditor struct.  */
-typedef gboolean (*SensitivityFunc)(gpointer);
+typedef gboolean (*SensitivityFunc) (gpointer);
 
 
 /* Add widget to the list of sensitive widgets of editor.  */
@@ -213,8 +214,7 @@
 update_selection_sensitive_actions (GPAKeyringEditor *editor)
 {
   g_list_foreach (editor->selection_sensitive_actions,
-                  update_selection_sensitive_action,
-                  (gpointer) editor);
+                  update_selection_sensitive_action, editor);
 }
 
 /* Disable all the widgets in the list of sensitive widgets.  To be used while
@@ -1036,7 +1036,7 @@
 				      G_N_ELEMENTS (radio_entries),
 				      detailed ? 1 : 0,
 				      G_CALLBACK (keyring_set_listing_cb),
-				      (gpointer) editor);
+				      editor);
   gtk_action_group_add_actions (action_group, gpa_help_menu_action_entries,
 				G_N_ELEMENTS (gpa_help_menu_action_entries),
 				editor->window);
@@ -1134,18 +1134,22 @@
   return widget;
 }
 
+
 /* Callback for the popdown menu on the signatures page.  */
 static void
-signatures_uid_selected (GtkOptionMenu *optionmenu, gpointer user_data)
+signatures_uid_selected (GtkComboBox *combo, gpointer user_data)
 {
   GPAKeyringEditor *editor = user_data;
   gpgme_key_t key = keyring_editor_current_key (editor);
 
-  gpa_siglist_set_signatures (editor->signatures_list, key, 
-                              gtk_option_menu_get_history 
-                              (GTK_OPTION_MENU (editor->signatures_uids)) - 1);
+  /* We subtract one, as the first entry with index 0 means "all user
+     names".  */
+  gpa_siglist_set_signatures
+    (editor->signatures_list, key,
+     gtk_combo_box_get_active (GTK_COMBO_BOX (combo)) - 1);
 }
 
+
 /* Add the subkeys page from the notebook.  */
 static void
 keyring_editor_add_subkeys_page (GPAKeyringEditor *editor)
@@ -1204,7 +1208,7 @@
   GtkWidget *scrolled;
   GtkWidget *viewport;
   GtkWidget *siglist;
-  GtkWidget *options;
+  GtkWidget *combo;
   GtkWidget *hbox;
   gint table_row;
 
@@ -1268,12 +1272,13 @@
   hbox = gtk_hbox_new (FALSE, 5);
   label = gtk_label_new (_("Show signatures on user name:"));
   gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
-  options = gtk_option_menu_new ();
-  gtk_box_pack_start (GTK_BOX (hbox), options, TRUE, TRUE, 0);
-  gtk_widget_set_sensitive (options, FALSE);
-  editor->signatures_uids = options;
+  combo = gtk_combo_box_new_text ();
+  gtk_box_pack_start (GTK_BOX (hbox), combo, TRUE, TRUE, 0);
+  gtk_widget_set_sensitive (combo, FALSE);
+  editor->signatures_uids = combo;
+  editor->signatures_count = 0;
   editor->signatures_hbox = hbox;
-  g_signal_connect (G_OBJECT (options), "changed",
+  g_signal_connect (G_OBJECT (combo), "changed",
                     G_CALLBACK (signatures_uid_selected), editor);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
 
@@ -1393,7 +1398,7 @@
 
   /* FIXME: Assumes that the 0th page is the details page.  This
      should be done better.  */
-  gtk_notebook_set_page (GTK_NOTEBOOK (editor->notebook_details), 0);
+  gtk_notebook_set_current_page (GTK_NOTEBOOK (editor->notebook_details), 0);
 }
 
 
@@ -1402,33 +1407,34 @@
 static void
 keyring_signatures_page_fill_key (GPAKeyringEditor *editor, gpgme_key_t key)
 {
-  GtkWidget *menu;
-  GtkWidget *label;
+  GtkComboBox *combo;
+  gint i;
 
-  /* Create the menu for the popdown UID list, if there is more than
-     one UID.  */
+  combo = GTK_COMBO_BOX (editor->signatures_uids);
+  for (i = editor->signatures_count - 1; i >= 0; i--)
+    gtk_combo_box_remove_text (combo, i);
+  editor->signatures_count = 0;
+
+  /* Create the popdown UID list if there is more than one UID.  */
   if (key->uids && key->uids->next)
     {
       gpgme_user_id_t uid;
 
-      menu = gtk_menu_new ();
-      label = gtk_menu_item_new_with_label (_("All signatures"));
-      gtk_menu_shell_append (GTK_MENU_SHELL (menu), label);
+      gtk_combo_box_append_text (combo, _("All signatures"));
+      gtk_combo_box_set_active (combo, 0);
+      i = 1;
 
       uid = key->uids;
       while (uid)
 	{
 	  gchar *uid_string = gpa_gpgme_key_get_userid (uid);
-	  label = gtk_menu_item_new_with_label (uid_string);
-	  gtk_menu_shell_append (GTK_MENU_SHELL (menu), label);
+	  gtk_combo_box_append_text (combo, uid_string);
 	  g_free (uid_string);
-
 	  uid = uid->next;
+	  i++;
 	}
+      editor->signatures_count = i;
 
-      gtk_option_menu_set_menu (GTK_OPTION_MENU (editor->signatures_uids), 
-				menu);
-      gtk_widget_show_all (menu);
       gtk_widget_show (editor->signatures_hbox);
       gtk_widget_set_sensitive (editor->signatures_uids, TRUE);
       /* Add the signatures.  */
@@ -1448,9 +1454,16 @@
 static void
 keyring_signatures_page_empty (GPAKeyringEditor *editor)
 {
-  gtk_widget_set_sensitive (editor->signatures_uids, FALSE);
-  gtk_option_menu_remove_menu (GTK_OPTION_MENU (editor->signatures_uids));
+  GtkComboBox *combo;
+  gint i;
+
   gpa_siglist_set_signatures (editor->signatures_list, NULL, 0);
+
+  combo = GTK_COMBO_BOX (editor->signatures_uids);
+  gtk_widget_set_sensitive (GTK_WIDGET (combo), FALSE);
+  for (i = editor->signatures_count - 1; i >= 0; i--)
+    gtk_combo_box_remove_text (combo, i);
+  editor->signatures_count = 0;
 }
 
 
@@ -1521,7 +1534,7 @@
 keyring_update_details_notebook (GPAKeyringEditor *editor)
 {
   if (! editor->details_idle_id)
-    editor->details_idle_id = gtk_idle_add (idle_update_details, editor);
+    editor->details_idle_id = g_idle_add (idle_update_details, editor);
 }
 
 
@@ -1674,8 +1687,10 @@
   GtkWidget *icon;
   GtkWidget *paned;
   GtkWidget *statusbar;
-
+  GtkWidget *main_box;
+  GtkWidget *align;
   gchar *markup;
+  guint pt, pb, pl, pr;
 
   editor = g_malloc (sizeof (GPAKeyringEditor));
   editor->selection_sensitive_actions = NULL;
@@ -1684,12 +1699,12 @@
   window = editor->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   gtk_window_set_title (GTK_WINDOW (window),
                         _("GNU Privacy Assistant - Keyring Editor"));
-  gtk_object_set_data_full (GTK_OBJECT (window), "user_data", editor,
-                            keyring_editor_destroy);
+  /* We use this for the destructor.  */
+  g_object_set_data_full (G_OBJECT (window), "user_data", editor,
+			  keyring_editor_destroy);
   gtk_window_set_default_size (GTK_WINDOW (window), 680, 600);
-  gtk_signal_connect_object (GTK_OBJECT (window), "map",
-                             GTK_SIGNAL_FUNC (keyring_editor_mapped),
-                             (gpointer) editor);
+  g_signal_connect_swapped (G_OBJECT (window), "map",
+			    G_CALLBACK (keyring_editor_mapped), editor);
   /* Realize the window so that we can create pixmaps without warnings.  */
   gtk_widget_realize (window);
 
@@ -1703,9 +1718,9 @@
 
   /* Add a fancy label that tells us: This is the keyring editor.  */
   hbox = gtk_hbox_new (FALSE, 0);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5);
   
-  icon = gpa_create_icon_widget (window, "keyring");
+  icon = gtk_image_new_from_stock (GPA_STOCK_KEYRING_EDITOR, GTK_ICON_SIZE_DND);
   gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, TRUE, 0);
 
   label = gtk_label_new (NULL);
@@ -1716,11 +1731,18 @@
   gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 10);
   gtk_misc_set_alignment (GTK_MISC (label), 0, 0.5);
 
-
   paned = gtk_vpaned_new ();
-  gtk_box_pack_start (GTK_BOX (vbox), paned, TRUE, TRUE, 0);
-  gtk_container_set_border_width (GTK_CONTAINER (paned), 5);
 
+  main_box = gtk_hbox_new (TRUE, 0);
+  align = gtk_alignment_new (0.5, 0.5, 1, 1);
+  gtk_alignment_get_padding (GTK_ALIGNMENT (align),
+                             &pt, &pb, &pl, &pr);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (align), pt, pb + 5,
+                             pl + 5, pr + 5);
+  gtk_box_pack_start (GTK_BOX (vbox), align, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (main_box), paned, TRUE, TRUE, 0);
+  gtk_container_add (GTK_CONTAINER (align), main_box);
+
   scrolled = gtk_scrolled_window_new (NULL, NULL);
   gtk_paned_pack1 (GTK_PANED (paned), scrolled, TRUE, TRUE);
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
@@ -1741,9 +1763,9 @@
   g_signal_connect (G_OBJECT (gtk_tree_view_get_selection 
 			      (GTK_TREE_VIEW (keylist))),
 		    "changed", G_CALLBACK (keyring_editor_selection_changed),
-		    (gpointer) editor);
+		    editor);
 
-  g_signal_connect_swapped (GTK_OBJECT (keylist), "button_press_event",
+  g_signal_connect_swapped (G_OBJECT (keylist), "button_press_event",
                             G_CALLBACK (display_popup_menu), editor);
 
   notebook = keyring_details_notebook (editor);
@@ -1754,10 +1776,10 @@
   gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, TRUE, 0);
   g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
 		    "changed_default_key",
-                    (GCallback) keyring_default_key_changed, editor);
+                    G_CALLBACK (keyring_default_key_changed), editor);
   g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
 		    "changed_ui_mode",
-                    (GCallback) keyring_ui_mode_changed, editor);
+                    G_CALLBACK (keyring_ui_mode_changed), editor);
 
   keyring_update_status_bar (editor);
   update_selection_sensitive_actions (editor);

Modified: trunk/src/recipientdlg.c
===================================================================
--- trunk/src/recipientdlg.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/recipientdlg.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -714,19 +714,19 @@
 }
 
 static void
-recplist_popup_pgp (RecipientDlg *dialog)
+recplist_popup_pgp (GtkAction *action, RecipientDlg *dialog)
 {
   do_select_key (dialog, GPGME_PROTOCOL_OpenPGP);
 }
 
 static void
-recplist_popup_x509 (RecipientDlg *dialog)
+recplist_popup_x509 (GtkAction *action, RecipientDlg *dialog)
 {
   do_select_key (dialog, GPGME_PROTOCOL_CMS);
 }
 
 static void
-recplist_popup_ignore (RecipientDlg *dialog)
+recplist_popup_ignore (GtkAction *action, RecipientDlg *dialog)
 {
   GtkTreeModel *model;
   GtkTreeIter iter;
@@ -808,28 +808,47 @@
 static GtkWidget *
 recplist_popup_menu_new (GtkWidget *window, RecipientDlg *dialog)
 {
-  GtkItemFactory *factory;
-  GtkItemFactoryEntry popup_menu[] =
+  static const GtkActionEntry entries[] =
     {
-      {_("/Select _PGP key..."), NULL, recplist_popup_pgp, 0, NULL},
-      {_("/Select _S\\/MIME key..."), NULL, recplist_popup_x509, 0, NULL},
-      {_("/Toggle _Ignore flag"), NULL, recplist_popup_ignore, 0, NULL},
+      /* Toplevel.  */
+      { "SelectPGPKey", NULL, N_("Select _PGP key..."), NULL,
+	NULL, G_CALLBACK (recplist_popup_pgp) },
+      { "SelectCMSKey", NULL, N_("Select _S\\/MIME key..."), NULL,
+	NULL, G_CALLBACK (recplist_popup_x509) },
+      { "ToggleIgnoreFlag", NULL, N_("Toggle _Ignore flag"), NULL,
+	NULL, G_CALLBACK (recplist_popup_ignore) }
     };
-  //  GtkWidget *item;
 
-  factory = gtk_item_factory_new (GTK_TYPE_MENU, "<main>", NULL);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (popup_menu) / sizeof (popup_menu[0]),
-                                 popup_menu, dialog);
+  static const char *ui_description =
+    "<ui>"
+    "  <popup name='PopupMenu'>"
+    "    <menuitem action='SelectPGPKey'/>"
+    "    <menuitem action='SelectCMSKey'/>"
+    "    <menuitem action='ToggleIgnoreFlag'/>"
+    "  </popup>"
+    "</ui>";
 
-  /* Only if there is only ONE key selected.  */
-/*   item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory), */
-/*                                       _("/Set Owner Trust...")); */
-/*   if (item) */
-/*     add_selection_sensitive_widget (editor, item, */
-/* 				    keyring_editor_has_single_selection); */
+  GtkAccelGroup *accel_group;
+  GtkActionGroup *action_group;
+  GtkUIManager *ui_manager;
+  GError *error;
 
-  return gtk_item_factory_get_widget (factory, "<main>");
+  action_group = gtk_action_group_new ("MenuActions");
+  gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries),
+				dialog);
+  ui_manager = gtk_ui_manager_new ();
+  gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
+  accel_group = gtk_ui_manager_get_accel_group (ui_manager);
+  gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+  if (! gtk_ui_manager_add_ui_from_string (ui_manager, ui_description,
+					   -1, &error))
+    {
+      g_message ("building clipboard menus failed: %s", error->message);
+      g_error_free (error);
+      exit (EXIT_FAILURE);
+    }
+
+  return gtk_ui_manager_get_widget (ui_manager, "/PopupMenu");
 }
 
 

Modified: trunk/src/siglist.c
===================================================================
--- trunk/src/siglist.c	2008-04-03 01:43:04 UTC (rev 868)
+++ trunk/src/siglist.c	2008-04-03 04:44:51 UTC (rev 869)
@@ -64,7 +64,7 @@
 
   g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
 		    "changed_ui_mode",
-                    (GCallback)gpa_siglist_ui_mode_changed_cb, list);
+                    G_CALLBACK (gpa_siglist_ui_mode_changed_cb), list);
 
   return list;
 }



More information about the Gpa-commits mailing list