[Gpa-commits] r866 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Mar 28 07:02:39 CET 2008


Author: marcus
Date: 2008-03-28 07:02:31 +0100 (Fri, 28 Mar 2008)
New Revision: 866

Modified:
   trunk/src/ChangeLog
   trunk/src/clipboard.c
   trunk/src/fileman.c
   trunk/src/gpa.c
   trunk/src/gpa.h
   trunk/src/gtktools.c
   trunk/src/gtktools.h
   trunk/src/helpmenu.c
   trunk/src/helpmenu.h
   trunk/src/icons.c
   trunk/src/icons.h
   trunk/src/keyring.c
   trunk/src/server.c
Log:
2008-03-28  Marcus Brinkmann  <marcus at g10code.de>

	* keyring.c, fileman.c, clipboard.c: Many, many changes to use the
	current Gtk interfaces for menubar and toolbar construction,
	namely GtkUIManager and GtkAction, instead of the deprecated
	GtkItemFactory.  Also use the new GPA stock items consistently.
	Change the sensitive widget code to use GtkAction instead of GtkWidget.
	* gpa.h: Include "icons.h".
	(gpa_open_keyring_editor, gpa_open_clipboard)
	(gpa_open_filemanager, gpa_open_settings_dialog)
	(gpa_open_backend_config_dialog): Add callback arguments to
	prototypes.
	(gpa_windows_menu_action_entries)
	(gpa_preferences_menu_action_entries): New data.
	* gpa.c: Include "icons.h".
	(gpa_open_keyring_editor, gpa_open_clipboard)
	(gpa_open_filemanager, gpa_open_settings_dialog)
	(gpa_open_backend_config_dialog): Add callback arguments.  Also to
	caller.
	(main): Invoke gpa_register_stock_items.
	* icons.h (gpa_register_stock_items): New prototype.
	(GPA_STOCK_SIGN, GPA_STOCK_VERIFY, GPA_STOCK_ENCRYPT)
	(GPA_STOCK_DECRYPT, GPA_STOCK_KEYRING, GPA_STOCK_FILEMAN)
	(GPA_STOCK_CLIPBOARD, GPA_STOCK_BRIEF, GPA_STOCK_DETAILED)
	(GPA_STOCK_EDIT, GPA_STOCK_IMPORT, GPA_STOCK_EXPORT)
	(GPA_STOCK_BACKUP): New macros.
	* icons.c (gpa_register_stock_items): New function.
	(xpms): Remove some obsolete entries (and don't include those xpm
	files).
	* helpmenu.h: Include <gtk/gtk.h>.
	(gpa_help_about): New prototype.
	(gpa_help_menu_add_to_factory): Removed prototype.
	(gpa_help_menu_action_entries): New data.
	* helpmenu.c (help_about): Rename to ...
	(gpa_help_about): ... this.  Make non-static.
	(gpa_help_menu_add_to_factory): Removed function.
	(help_help): Likewise.
	* gtktools.h (gpa_toolbar_set_homogeneous): New prototype.
	* gtktools.c (set_homogeneous, gpa_toolbar_set_homogeneous): New
	functions.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/ChangeLog	2008-03-28 06:02:31 UTC (rev 866)
@@ -1,3 +1,44 @@
+2008-03-28  Marcus Brinkmann  <marcus at g10code.de>
+
+	* keyring.c, fileman.c, clipboard.c: Many, many changes to use the
+	current Gtk interfaces for menubar and toolbar construction,
+	namely GtkUIManager and GtkAction, instead of the deprecated
+	GtkItemFactory.  Also use the new GPA stock items consistently.
+	Change the sensitive widget code to use GtkAction instead of GtkWidget.
+	* gpa.h: Include "icons.h".
+	(gpa_open_keyring_editor, gpa_open_clipboard)
+	(gpa_open_filemanager, gpa_open_settings_dialog)
+	(gpa_open_backend_config_dialog): Add callback arguments to
+	prototypes.
+	(gpa_windows_menu_action_entries)
+	(gpa_preferences_menu_action_entries): New data.
+	* gpa.c: Include "icons.h".
+	(gpa_open_keyring_editor, gpa_open_clipboard)
+	(gpa_open_filemanager, gpa_open_settings_dialog)
+	(gpa_open_backend_config_dialog): Add callback arguments.  Also to
+	caller.
+	(main): Invoke gpa_register_stock_items.
+	* icons.h (gpa_register_stock_items): New prototype.
+	(GPA_STOCK_SIGN, GPA_STOCK_VERIFY, GPA_STOCK_ENCRYPT)
+	(GPA_STOCK_DECRYPT, GPA_STOCK_KEYRING, GPA_STOCK_FILEMAN)
+	(GPA_STOCK_CLIPBOARD, GPA_STOCK_BRIEF, GPA_STOCK_DETAILED)
+	(GPA_STOCK_EDIT, GPA_STOCK_IMPORT, GPA_STOCK_EXPORT)
+	(GPA_STOCK_BACKUP): New macros.
+	* icons.c (gpa_register_stock_items): New function.
+	(xpms): Remove some obsolete entries (and don't include those xpm
+	files).
+	* helpmenu.h: Include <gtk/gtk.h>.
+	(gpa_help_about): New prototype.
+	(gpa_help_menu_add_to_factory): Removed prototype.
+	(gpa_help_menu_action_entries): New data.
+	* helpmenu.c (help_about): Rename to ...
+	(gpa_help_about): ... this.  Make non-static.
+	(gpa_help_menu_add_to_factory): Removed function.
+	(help_help): Likewise.
+	* gtktools.h (gpa_toolbar_set_homogeneous): New prototype.
+	* gtktools.c (set_homogeneous, gpa_toolbar_set_homogeneous): New
+	functions.
+
 2008-03-27  Marcus Brinkmann  <marcus at g10code.de>
 
 	* gtktools.h (gpa_window_destroy, gpa_buttonCancel_new)

Modified: trunk/src/clipboard.c
===================================================================
--- trunk/src/clipboard.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/clipboard.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -2,7 +2,7 @@
    Copyright (C) 2000, 2001 G-N-U GmbH.
    Copyright (C) 2007, 2008 g10 Code GmbH
 
-   This file is part of GPA
+   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
@@ -77,8 +77,8 @@
   GtkTextBuffer *text_buffer;
 
   /* List of sensitive widgets. See below */
-  GList *selection_sensitive_widgets;
-  GList *paste_sensitive_widgets;
+  GList *selection_sensitive_actions;
+  GList *paste_sensitive_actions;
   gboolean paste_p;
 };
 
@@ -115,8 +115,8 @@
 static void
 gpa_clipboard_init (GpaClipboard *clipboard)
 {
-  clipboard->selection_sensitive_widgets = NULL;
-  clipboard->paste_sensitive_widgets = NULL;
+  clipboard->selection_sensitive_actions = NULL;
+  clipboard->paste_sensitive_actions = NULL;
 }
 
 static void
@@ -166,13 +166,11 @@
 
 /* Add widget to the list of sensitive widgets of editor.  */
 static void
-add_selection_sensitive_widget (GpaClipboard *clipboard,
-                                GtkWidget *widget,
-                                sensitivity_func_t callback)
+add_selection_sensitive_action (GpaClipboard *clipboard,
+                                GtkAction *action)
 {
-  gtk_object_set_data (GTK_OBJECT (widget), "gpa_sensitivity", callback);
-  clipboard->selection_sensitive_widgets
-    = g_list_append (clipboard->selection_sensitive_widgets, widget);
+  clipboard->selection_sensitive_actions
+    = g_list_append (clipboard->selection_sensitive_actions, action);
 }
 
 
@@ -190,12 +188,9 @@
    the sensitivity callback. Usable as an iterator function in
    g_list_foreach. */
 static void
-update_selection_sensitive_widget (gpointer data, gpointer param)
+update_selection_sensitive_action (gpointer data, gpointer param)
 {
-  sensitivity_func_t func;
-
-  func = gtk_object_get_data (GTK_OBJECT (data), "gpa_sensitivity");
-  gtk_widget_set_sensitive (GTK_WIDGET (data), func (param));
+  gtk_action_set_sensitive (GTK_ACTION (data), has_selection (param));
 }
 
 
@@ -203,41 +198,41 @@
    of sensitive widgets and pass CLIPBOARD through as the user data
    parameter.  */
 static void
-update_selection_sensitive_widgets (GpaClipboard *clipboard)
+update_selection_sensitive_actions (GpaClipboard *clipboard)
 {
-  g_list_foreach (clipboard->selection_sensitive_widgets,
-                  update_selection_sensitive_widget,
+  g_list_foreach (clipboard->selection_sensitive_actions,
+                  update_selection_sensitive_action,
                   (gpointer) clipboard);
 }
 
 
-/* Add widget to the list of sensitive widgets of editor.  */
+/* Add ACTION to the list of sensitive actions of CLIPBOARD.  */
 static void
-add_paste_sensitive_widget (GpaClipboard *clipboard, GtkWidget *widget)
+add_paste_sensitive_action (GpaClipboard *clipboard, GtkAction *action)
 {
-  clipboard->paste_sensitive_widgets
-    = g_list_append (clipboard->paste_sensitive_widgets, widget);
+  clipboard->paste_sensitive_actions
+    = g_list_append (clipboard->paste_sensitive_actions, action);
 }
 
 
 static void
-update_paste_sensitive_widget (gpointer data, gpointer param)
+update_paste_sensitive_action (gpointer data, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
-  gtk_widget_set_sensitive (GTK_WIDGET (data), clipboard->paste_p);
+  gtk_action_set_sensitive (GTK_ACTION (data), clipboard->paste_p);
 }
 
 
 static void
-update_paste_sensitive_widgets (GtkClipboard *clip,
+update_paste_sensitive_actions (GtkClipboard *clip,
 				GtkSelectionData *selection_data,
 				GpaClipboard *clipboard)
 {
   clipboard->paste_p = gtk_selection_data_targets_include_text (selection_data);
 
-  g_list_foreach (clipboard->paste_sensitive_widgets,
-                  update_paste_sensitive_widget, (gpointer) clipboard);
+  g_list_foreach (clipboard->paste_sensitive_actions,
+                  update_paste_sensitive_action, (gpointer) clipboard);
 }
 
 
@@ -251,7 +246,7 @@
   if (gdk_display_supports_selection_notification (display))
     gtk_clipboard_request_contents
       (clip, gdk_atom_intern_static_string ("TARGETS"),
-       (GtkClipboardReceivedFunc) update_paste_sensitive_widgets,
+       (GtkClipboardReceivedFunc) update_paste_sensitive_actions,
        clipboard);
 }
 
@@ -310,7 +305,7 @@
 
 /* Handle menu item "File/Clear".  */
 static void
-file_clear (gpointer param)
+file_clear (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -366,7 +361,7 @@
 
 /* Handle menu item "File/Open".  */
 static void
-file_open (gpointer param)
+file_open (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
   gchar *filename;
@@ -533,7 +528,7 @@
 
 /* Handle menu item "File/Save As...".  */
 static void
-file_save_as (gpointer param)
+file_save_as (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
   gchar *filename;
@@ -573,7 +568,7 @@
 
 /* Handle menu item "File/Verify".  */
 static void
-file_verify (gpointer param)
+file_verify (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = (GpaClipboard *) param;
   GpaFileVerifyOperation *op;
@@ -603,7 +598,7 @@
 
 /* Handle menu item "File/Sign".  */
 static void
-file_sign (gpointer param)
+file_sign (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = (GpaClipboard *) param;
   GpaFileSignOperation *op;
@@ -633,7 +628,7 @@
 
 /* Handle menu item "File/Encrypt".  */
 static void
-file_encrypt (gpointer param)
+file_encrypt (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = (GpaClipboard *) param;
   GpaFileEncryptOperation *op;
@@ -663,7 +658,7 @@
 
 /* Handle menu item "File/Decrypt".  */
 static void
-file_decrypt (gpointer param)
+file_decrypt (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = (GpaClipboard *) param;
   GpaFileDecryptOperation *op;
@@ -693,7 +688,7 @@
 
 /* Handle menu item "File/Close".  */
 static void
-file_close (gpointer param)
+file_close (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
   gtk_widget_destroy (GTK_WIDGET (clipboard));
@@ -701,7 +696,7 @@
 
 
 static void
-edit_cut (gpointer param)
+edit_cut (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -711,7 +706,7 @@
 
 
 static void
-edit_copy (gpointer param)
+edit_copy (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -721,7 +716,7 @@
 
 
 static void
-edit_paste (gpointer param)
+edit_paste (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -731,7 +726,7 @@
 
 
 static void
-edit_delete (gpointer param)
+edit_delete (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -741,7 +736,7 @@
 
 /* Handle menu item "Edit/Select All".  */
 static void
-edit_select_all (gpointer param)
+edit_select_all (GtkAction *action, gpointer param)
 {
   GpaClipboard *clipboard = param;
 
@@ -750,320 +745,179 @@
 
 
 /* Construct the file manager menu window and return that object. */
-static GtkWidget *
-clipboard_menu_new (GpaClipboard *clipboard)
+static void
+clipboard_action_new (GpaClipboard *clipboard,
+		      GtkWidget **menu, GtkWidget **toolbar)
 {
-  GtkItemFactory *factory;
-  GtkItemFactoryEntry file_menu[] = {
-    {_("/_File"), NULL, NULL, 0, "<Branch>"},
-    {_("/File/C_lear"), NULL, file_clear, 0, "<StockItem>", GTK_STOCK_CLEAR},
-    {_("/File/_Open"), NULL, file_open, 0, "<StockItem>", GTK_STOCK_OPEN},
-    {_("/File/Save _As"), NULL, file_save_as, 0, "<StockItem>",
-     GTK_STOCK_SAVE_AS},
-    {_("/File/sep1"), NULL, NULL, 0, "<Separator>"},
-    {_("/File/_Sign"), NULL, file_sign, 0, NULL},
-    {_("/File/_Verify"), "<control>P", file_verify, 0, NULL},
-    {_("/File/_Encrypt"), NULL, file_encrypt, 0, NULL},
-    {_("/File/_Decrypt"), NULL, file_decrypt, 0, NULL},
-    {_("/File/sep2"), NULL, NULL, 0, "<Separator>"},
-    {_("/File/_Close"), NULL, file_close, 0, "<StockItem>", GTK_STOCK_CLOSE},
-    {_("/File/_Quit"), NULL, gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT},
-  };
-  GtkItemFactoryEntry edit_menu[] = {
-    {_("/_Edit"), NULL, NULL, 0, "<Branch>"},
-#if 0
-    /* Not implemented yet.  */
-    {_("/Edit/_Undo"), NULL, edit_undo, 0, "<StockItem>", GTK_STOCK_UNDO },
-    {_("/Edit/_Redo"), NULL, edit_redo, 0, "<StockItem>", GTK_STOCK_REDO },
-    {_("/Edit/sep0"), NULL, NULL, 0, "<Separator>"},
-#endif
-    {_("/Edit/Cut"), NULL, edit_cut, 0, "<StockItem>", GTK_STOCK_CUT },
-    {_("/Edit/_Copy"), NULL, edit_copy, 0, "<StockItem>", GTK_STOCK_COPY},
-    {_("/Edit/_Paste"), NULL, edit_paste, 0, "<StockItem>", GTK_STOCK_PASTE},
-    {_("/Edit/_Delete"), NULL, edit_delete, 0, "<StockItem>", GTK_STOCK_DELETE},
-    {_("/Edit/sep1"), NULL, NULL, 0, "<Separator>"},
-    {_("/Edit/Select _All"), "<control>A", edit_select_all, 0,
-     "<StockItem>", GTK_STOCK_SELECT_ALL },
-    {_("/Edit/sep2"), NULL, NULL, 0, "<Separator>"},
-    {_("/Edit/Pr_eferences..."), NULL, gpa_open_settings_dialog, 0,
-     "<StockItem>", GTK_STOCK_PREFERENCES},
-    {_("/Edit/_Backend Preferences..."), NULL,
-     gpa_open_backend_config_dialog, 0, "<StockItem>", GTK_STOCK_PREFERENCES},
-  };
-  GtkItemFactoryEntry windows_menu[] = {
-    {_("/_Windows"), NULL, NULL, 0, "<Branch>"},
-    {_("/Windows/_Keyring Editor"), NULL, gpa_open_keyring_editor, 0, NULL},
-    {_("/Windows/_Filemanager"), NULL, gpa_open_filemanager, 0, NULL},
-    {_("/Windows/_Clipboard"), NULL, gpa_open_clipboard, 0, NULL},
-  };
-  GtkAccelGroup *accel_group;
-  GtkWidget *item;
-
-  accel_group = gtk_accel_group_new ();
-  factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
-  gtk_item_factory_create_items (factory,
-				 sizeof (file_menu) / sizeof (file_menu[0]),
-				 file_menu, clipboard);
-  gtk_item_factory_create_items (factory,
-				 sizeof (edit_menu) / sizeof (edit_menu[0]),
-				 edit_menu, clipboard);
-  gtk_item_factory_create_items (factory,
-				 sizeof(windows_menu) /sizeof(windows_menu[0]),
-				 windows_menu, clipboard);
-
-  /* Disable buttons when no file is selected.   */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Edit/Cut"));
-  if (item)
+  static const GtkActionEntry entries[] =
     {
-      gtk_widget_set_sensitive (item, has_selection (clipboard));
-      add_selection_sensitive_widget (clipboard, item, has_selection);
-    }
+      /* Toplevel.  */
+      { "File", NULL, N_("_File"), NULL },
+      { "Edit", NULL, N_("_Edit"), NULL },
 
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Edit/Copy"));
-  if (item)
-    {
-      gtk_widget_set_sensitive (item, has_selection (clipboard));
-      add_selection_sensitive_widget (clipboard, item, has_selection);
-    }
-  
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Edit/Delete"));
-  if (item)
-    {
-      gtk_widget_set_sensitive (item, has_selection (clipboard));
-      add_selection_sensitive_widget (clipboard, item, has_selection);
-    }
+      /* File menu.  */
+      { "FileClear", GTK_STOCK_CLEAR, NULL, NULL,
+	N_("Clear buffer"), G_CALLBACK (file_clear) },
+      { "FileOpen", GTK_STOCK_OPEN, NULL, NULL,
+	N_("Open a file"), G_CALLBACK (file_open) },
+      { "FileSaveAs", GTK_STOCK_SAVE_AS, NULL, NULL,
+	N_("Save to a file"), G_CALLBACK (file_save_as) },
+      { "FileSign", GPA_STOCK_SIGN, NULL, NULL,
+	N_("Sign buffer text"), G_CALLBACK (file_sign) },
+      { "FileVerify", GPA_STOCK_VERIFY, NULL, NULL,
+	N_("Check signatures of buffer text"), G_CALLBACK (file_verify) },
+      { "FileEncrypt", GPA_STOCK_ENCRYPT, NULL, NULL,
+	N_("Encrypt the buffer text"), G_CALLBACK (file_encrypt) },
+      { "FileDecrypt", GPA_STOCK_DECRYPT, NULL, NULL,
+	N_("Decrypt the buffer text"), G_CALLBACK (file_decrypt) },
+      { "FileClose", GTK_STOCK_CLOSE, NULL, NULL,
+	N_("Close the buffer"), G_CALLBACK (file_close) },
+      { "FileQuit", GTK_STOCK_QUIT, NULL, NULL,
+	N_("Quit the program"), G_CALLBACK (gtk_main_quit) },
 
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY (factory),
-                                      _("/Edit/Paste"));
-  if (item)
-    /* Initialized later.  */
-    add_paste_sensitive_widget (clipboard, item);
-
-  gpa_help_menu_add_to_factory (factory, GTK_WIDGET (clipboard));
-  gtk_window_add_accel_group (GTK_WINDOW (clipboard), accel_group);
-
-  return gtk_item_factory_get_widget (factory, "<main>");
-}
-
-
-
-/* Toolbar actions.  */
-
-static void
-toolbar_file_clear (GtkWidget *widget, gpointer param)
-{
-  file_clear (param);
-}
-
-
-#if 0 /* Disabled, see caller for details.  */
-static void
-toolbar_file_open (GtkWidget *widget, gpointer param)
-{
-  file_open (param);
-}
-#endif /*0*/
-
-
-#if 0 /* Disabled, see caller for details.  */
-static void
-toolbar_file_save_as (GtkWidget *widget, gpointer param)
-{
-  file_save_as (param);
-}
-#endif /*0*/
-
-static void
-toolbar_file_sign (GtkWidget *widget, gpointer param)
-{
-  file_sign (param);
-}
-
-
-static void
-toolbar_file_verify (GtkWidget *widget, gpointer param)
-{
-  file_verify (param);
-}
-
-
-static void
-toolbar_file_encrypt (GtkWidget *widget, gpointer param)
-{
-  file_encrypt (param);
-}
-
-
-static void
-toolbar_file_decrypt (GtkWidget *widget, gpointer param)
-{
-  file_decrypt (param);
-}
-
-
-static void
-toolbar_edit_cut (GtkWidget *widget, gpointer param)
-{
-  edit_cut (param);
-}
-
-
-static void
-toolbar_edit_copy (GtkWidget *widget, gpointer param)
-{
-  edit_copy (param);
-}
-
-
-static void
-toolbar_edit_paste (GtkWidget *widget, gpointer param)
-{
-  edit_paste (param);
-}
-
-
-static void
-toolbar_edit_preferences (GtkWidget *widget, gpointer param)
-{
-  gpa_open_settings_dialog ();
-}
-
-
-/* Construct the new toolbar object and return it.  Takes the file
-   manage object.  */
-static GtkWidget *
-clipboard_toolbar_new (GpaClipboard *clipboard)
-{
-  GtkWidget *toolbar, *icon, *item;
-
-  toolbar = gtk_toolbar_new ();
-
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_CLEAR,
-                            _("Clear buffer"), _("clear buffer"),
-                            GTK_SIGNAL_FUNC (toolbar_file_clear),
-                            clipboard, -1);
-
-  /* Disabled because the toolbar arrow mode doesn't work, and the
-     toolbar takes up too much space otherwise.  */
+      /* Edit menu.  */
 #if 0
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_OPEN,
-                            _("Open a file"), _("open file"),
-                            GTK_SIGNAL_FUNC (toolbar_file_open),
-                            clipboard, -1);
+      /* FIXME: Not implemented yet.  */
+      { "EditUndo", GTK_STOCK_UNDO, NULL, NULL,
+	N_("Undo the last action"), G_CALLBACK (edit_undo) },
+      { "EditRedo", GTK_STOCK_REDO, NULL, NULL,
+	N_("Redo the last undone action"), G_CALLBACK (edit_redo) },
+#endif
+      { "EditCut", GTK_STOCK_CUT, NULL, NULL,
+	N_("Cut the selection"), G_CALLBACK (edit_cut) },
+      { "EditCopy", GTK_STOCK_COPY, NULL, NULL,
+	N_("Copy the selection"), G_CALLBACK (edit_copy) },
+      { "EditPaste", GTK_STOCK_PASTE, NULL, NULL,
+	N_("Paste the clipboard"), G_CALLBACK (edit_paste) },
+      { "EditDelete", GTK_STOCK_DELETE, NULL, NULL,
+	N_("Delete the selected text"), G_CALLBACK (edit_delete) },
+      { "EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<control>A",
+	N_("Select the entire document"), G_CALLBACK (edit_select_all) }
+    };
 
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_SAVE_AS,
-                            _("Save to a file"), _("save file as"),
-                            GTK_SIGNAL_FUNC (toolbar_file_save_as),
-                            clipboard, -1);
-
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+  static const char *ui_description =
+    "<ui>"
+    "  <menubar name='MainMenu'>"
+    "    <menu action='File'>"
+    "      <menuitem action='FileClear'/>"
+    "      <menuitem action='FileOpen'/>"
+    "      <separator/>"
+    "      <menuitem action='FileSign'/>"
+    "      <menuitem action='FileVerify'/>"
+    "      <menuitem action='FileEncrypt'/>"
+    "      <menuitem action='FileDecrypt'/>"
+    "      <separator/>"
+    "      <menuitem action='FileClose'/>"
+    "      <menuitem action='FileQuit'/>"
+    "    </menu>"
+    "    <menu action='Edit'>"
+#if 0
+    /* Not implemented yet.  */
+    "      <menuitem action='EditUndo'/>"
+    "      <menuitem action='EditRedo'/>"
+    "      <separator/>"
 #endif
+    "      <menuitem action='EditCut'/>"
+    "      <menuitem action='EditCopy'/>"
+    "      <menuitem action='EditPaste'/>"
+    "      <menuitem action='EditDelete'/>"
+    "      <separator/>"
+    "      <menuitem action='EditSelectAll'/>"
+    "      <separator/>"
+    "      <menuitem action='EditPreferences'/>"
+    "      <menuitem action='EditBackendPreferences'/>"
+    "    </menu>"
+    "    <menu action='Windows'>"
+    "      <menuitem action='WindowsKeyringEditor'/>"
+    "      <menuitem action='WindowsFileManager'/>"
+    "      <menuitem action='WindowsClipboard'/>"
+    "    </menu>"
+    "    <menu action='Help'>"
+#if 0
+    "      <menuitem action='HelpContents'/>"
+#endif
+    "      <menuitem action='HelpAbout'/>"
+    "    </menu>"
+    "  </menubar>"
+    "  <toolbar name='ToolBar'>"
+    "    <toolitem action='FileClear'/>"
+#if 0
+    /* Disabled because the toolbar arrow mode doesn't work, and the
+       toolbar takes up too much space otherwise.  */
+    "    <toolitem action='FileOpen'/>"
+    "    <toolitem action='FileSaveAs'/>"
+#endif
+    "    <separator/>"
+    "    <toolitem action='EditCut'/>"
+    "    <toolitem action='EditCopy'/>"
+    "    <toolitem action='EditPaste'/>"
+    "    <separator/>"
+    "    <toolitem action='FileSign'/>"
+    "    <toolitem action='FileVerify'/>"
+    "    <toolitem action='FileEncrypt'/>"
+    "    <toolitem action='FileDecrypt'/>"
+    "    <separator/>"
+    "    <toolitem action='EditPreferences'/>"
+    "    <separator/>"
+    "    <toolitem action='WindowsKeyringEditor'/>"
+    "    <toolitem action='WindowsFileManager'/>"
+#if 0
+    "    <toolitem action='HelpContents'/>"
+#endif
+    "  </toolbar>"
+    "</ui>";
 
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_CUT,
-				   _("Cut the selection"),
-				   _("cut the selection"),
-				   GTK_SIGNAL_FUNC (toolbar_edit_cut),
-				   clipboard, -1);
-  add_selection_sensitive_widget (clipboard, item, has_selection);
+  GtkAccelGroup *accel_group;
+  GtkActionGroup *action_group;
+  GtkAction *action;
+  GtkUIManager *ui_manager;
+  GError *error;
 
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_COPY,
-				   _("Copy the selection"),
-				   _("copy the selection"),
-				   GTK_SIGNAL_FUNC (toolbar_edit_copy),
-				   clipboard, -1);
-  add_selection_sensitive_widget (clipboard, item, has_selection);
-
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_PASTE,
-				   _("Paste the clipboard"),
-				   _("paste the clipboard"),
-				   GTK_SIGNAL_FUNC (toolbar_edit_paste),
-				   clipboard, -1);
-  add_paste_sensitive_widget (clipboard, item);
-
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
-  /* Build the "Sign" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "sign")))
+  action_group = gtk_action_group_new ("MenuActions");
+  gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries),
+				clipboard);
+  gtk_action_group_add_actions (action_group, gpa_help_menu_action_entries,
+				G_N_ELEMENTS (gpa_help_menu_action_entries),
+				clipboard);
+  gtk_action_group_add_actions (action_group, gpa_windows_menu_action_entries,
+				G_N_ELEMENTS (gpa_windows_menu_action_entries),
+				clipboard);
+  gtk_action_group_add_actions
+    (action_group, gpa_preferences_menu_action_entries,
+     G_N_ELEMENTS (gpa_preferences_menu_action_entries), clipboard);
+  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 (clipboard), accel_group);
+  if (! gtk_ui_manager_add_ui_from_string (ui_manager, ui_description,
+					   -1, &error))
     {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Sign"),
-				      _("Sign the selected text"),
-                                      _("sign text"),
-				      icon,
-				      GTK_SIGNAL_FUNC (toolbar_file_sign),
-				      clipboard);
+      g_message ("building clipboard menus failed: %s", error->message);
+      g_error_free (error);
+      exit (EXIT_FAILURE);
     }
-  /* Build the "Verify" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "verify")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Verify"),
-				      _("Check signatures of selected text"), 
-				      _("verify text"),
-                                      icon,
-				      GTK_SIGNAL_FUNC (toolbar_file_verify), 
-				      clipboard);
-    }
-  /* Build the "Encrypt" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "encrypt")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Encrypt"),
-				      _("Encrypt the selected text"),
-				      _("encrypt text"),
-				      icon,
-                                      GTK_SIGNAL_FUNC (toolbar_file_encrypt),
-				      clipboard);
-    }
-  /* Build the "Decrypt" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "decrypt")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Decrypt"),
-				      _("Decrypt the selected text"),
-				      _("decrypt text"),
-				      icon, 
-                                      GTK_SIGNAL_FUNC (toolbar_file_decrypt),
-				      clipboard);
-    }
 
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-  
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), 
-                            GTK_STOCK_PREFERENCES,
-                            _("Open the preferences dialog"),
-                            _("preferences"),
-                            GTK_SIGNAL_FUNC (toolbar_edit_preferences),
-                            clipboard, -1);
+  /* Fixup the icon theme labels which are too long for the toolbar.  */
+  action = gtk_action_group_get_action (action_group, "WindowsKeyringEditor");
+  g_object_set (action, "short_label", _("Keyring"), NULL);
+  action = gtk_action_group_get_action (action_group, "WindowsFileManager");
+  g_object_set (action, "short_label", _("Files"), NULL);
 
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+  /* Take care of sensitiveness of widgets.  */
+  action = gtk_action_group_get_action (action_group, "EditCut");
+  add_selection_sensitive_action (clipboard, action);
+  action = gtk_action_group_get_action (action_group, "EditCopy");
+  add_selection_sensitive_action (clipboard, action);
+  action = gtk_action_group_get_action (action_group, "EditDelete");
+  add_selection_sensitive_action (clipboard, action);
 
-  icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "keyringeditor");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Keyring"),
-                                  _("Open the keyring editor"),
-                                  _("keyring editor"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_keyring_editor),
-                                  NULL);
+  action = gtk_action_group_get_action (action_group, "EditPaste");
+  /* Initialized later.  */
+  add_paste_sensitive_action (clipboard, action);
 
-  icon = gtk_image_new_from_stock ("gtk-directory",
-				   GTK_ICON_SIZE_SMALL_TOOLBAR);
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Files"),
-				  _("Open the file manager"),
-				  _("file manager"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_filemanager),
-				  NULL);
-
-#if 0  /* FIXME: Help is not available yet. :-( */
-  /* Help */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (clipboard), "help")))
-    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Help"),
-			     _("Understanding the GNU Privacy Assistant"),
-			     _("help"), icon,
-			     GTK_SIGNAL_FUNC (help_help), NULL);
-#endif
-
-  gtk_toolbar_set_show_arrow (GTK_TOOLBAR (toolbar), TRUE);
-
-  return toolbar;
+  *menu = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
+  *toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
+  gpa_toolbar_set_homogeneous (GTK_TOOLBAR (*toolbar), FALSE);
 }
 
 
@@ -1094,16 +948,16 @@
   /* A change in selection status causes a property change, which we
      can listen in on.  */
   g_signal_connect_swapped (clipboard->text_buffer, "notify::has-selection",
-			    G_CALLBACK (update_selection_sensitive_widgets),
+			    G_CALLBACK (update_selection_sensitive_actions),
 			    clipboard);
 #else
   /* Runs very often.  The changed signal is necessary for backspace
      actions.  */
   g_signal_connect_swapped (clipboard->text_buffer, "mark-set",
-			    G_CALLBACK (update_selection_sensitive_widgets),
+			    G_CALLBACK (update_selection_sensitive_actions),
 			    clipboard);
   g_signal_connect_after (clipboard->text_buffer, "backspace",
-			    G_CALLBACK (update_selection_sensitive_widgets),
+			    G_CALLBACK (update_selection_sensitive_actions),
 			    clipboard);
 #endif
 
@@ -1120,7 +974,7 @@
 
 
 /* Construct a new class object of GpaClipboard.  */
-static GObject*
+static GObject *
 gpa_clipboard_constructor (GType type,
 			   guint n_construct_properties,
 			   GObjectConstructParam *construct_properties)
@@ -1162,21 +1016,17 @@
      on the selection status of the text_buffer.  */
   text_frame = clipboard_text_new (clipboard);
 
-  /* First comes the menu.  */
-  menubar = clipboard_menu_new (clipboard);
+  /* Get the menu and the toolbar.  */
+  clipboard_action_new (clipboard, &menubar, &toolbar);
   gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, TRUE, 0);
-
-  /* Second the toolbar.  */
-  toolbar = clipboard_toolbar_new (clipboard);
   gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
 
-
   /* Add a fancy label that tells us: This is the clipboard.  */
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 5);
   
   /* FIXME: Need better icon.  */
-  icon = gtk_image_new_from_stock ("gtk-paste", GTK_ICON_SIZE_DND);
+  icon = gtk_image_new_from_stock (GTK_STOCK_PASTE, GTK_ICON_SIZE_DND);
   gtk_box_pack_start (GTK_BOX (hbox), icon, FALSE, TRUE, 0);
 
   label = gtk_label_new (NULL);
@@ -1219,7 +1069,7 @@
   }
 
   /* Update the sensitivity of selection items.  */
-  update_selection_sensitive_widgets (clipboard);
+  update_selection_sensitive_actions (clipboard);
 
   return object;
 }

Modified: trunk/src/fileman.c
===================================================================
--- trunk/src/fileman.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/fileman.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -64,7 +64,7 @@
 
   GtkWidget *window;
   GtkWidget *list_files;
-  GList *selection_sensitive_widgets;
+  GList *selection_sensitive_actions;
 };
 
 struct _GpaFileManagerClass 
@@ -125,7 +125,7 @@
 static void
 gpa_file_manager_init (GpaFileManager *fileman)
 {
-  fileman->selection_sensitive_widgets = NULL;
+  fileman->selection_sensitive_actions = NULL;
 }
 
 static void
@@ -283,9 +283,7 @@
 
 
 
-/*
- * Management of the selection sensitive widgets;
- */
+/* Management of the selection sensitive actions.  */
 
 /* Return true if a selection is active.  */
 static gboolean
@@ -299,38 +297,38 @@
   return (gtk_tree_selection_count_selected_rows (select) > 0);
 }
 
-/* Add WIDGET to the list of sensitive widgets of FILEMAN.  */
+/* Add WIDGET to the list of sensitive actions of FILEMAN.  */
 static void
-add_selection_sensitive_widget (GpaFileManager *fileman,
-                                GtkWidget *widget,
-                                sensitivity_func_t callback)
+add_selection_sensitive_action (GpaFileManager *fileman,
+				 GtkAction *action,
+				 sensitivity_func_t callback)
 {
-  gtk_object_set_data (GTK_OBJECT (widget), "gpa_sensitivity", callback);
-  fileman->selection_sensitive_widgets \
-    = g_list_append(fileman->selection_sensitive_widgets, widget);
+  g_object_set_data (G_OBJECT (action), "gpa_sensitivity", callback);
+  fileman->selection_sensitive_actions
+    = g_list_append (fileman->selection_sensitive_actions, action);
 }
 
 /* Update the sensitivity of the widget DATA and pass PARAM through to
-   the sensitivity callback. Usable as an iterator function in
-   g_list_foreach. */
+   the sensitivity callback.  Usable as an iterator function in
+   g_list_foreach.  */
 static void
-update_selection_sensitive_widget (gpointer data, gpointer param)
+update_selection_sensitive_action (gpointer data, gpointer param)
 {
   sensitivity_func_t func;
 
-  func = gtk_object_get_data (GTK_OBJECT (data), "gpa_sensitivity");
-  gtk_widget_set_sensitive (GTK_WIDGET (data), func (param));
+  func = g_object_get_data (G_OBJECT (data), "gpa_sensitivity");
+  gtk_action_set_sensitive (GTK_ACTION (data), func (param));
 }
 
 
-/* Call update_selection_sensitive_widget for all widgets in the list
-   of sensitive widgets and pass FILEMAN through as the user data
+/* Call update_selection_sensitive_action for all widgets in the list
+   of sensitive actions and pass FILEMAN through as the user data
    parameter.  */
 static void
-update_selection_sensitive_widgets (GpaFileManager *fileman)
+update_selection_sensitive_actions (GpaFileManager *fileman)
 {
-  g_list_foreach (fileman->selection_sensitive_widgets,
-                  update_selection_sensitive_widget,
+  g_list_foreach (fileman->selection_sensitive_actions,
+                  update_selection_sensitive_action,
                   (gpointer) fileman);
 }
 
@@ -384,8 +382,9 @@
   g_free (filename);
 }
 
+
 static void
-open_file (gpointer param)
+file_open (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
   GSList *filenames;
@@ -401,7 +400,7 @@
 
 /* Handle menu item "File/Clear".  */
 static void
-close_all_files (gpointer param)
+file_clear (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
   GtkListStore *store = GTK_LIST_STORE (gtk_tree_view_get_model
@@ -413,10 +412,10 @@
 
 /* Handle menu item "File/Verify".  */
 static void
-verify_files (gpointer param)
+file_verify (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
-  GList * files;
+  GList *files;
   GpaFileVerifyOperation *op;
 
   files = get_selected_files (fileman->list_files);
@@ -431,7 +430,7 @@
 
 /* Handle menu item "File/Sign".  */
 static void
-sign_files (gpointer param)
+file_sign (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
   GList * files;
@@ -449,10 +448,10 @@
 
 /* Handle menu item "File/Encrypt".  */
 static void
-encrypt_files (gpointer param)
+file_encrypt (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
-  GList * files;
+  GList *files;
   GpaFileEncryptOperation *op;
 
   files = get_selected_files (fileman->list_files);
@@ -467,10 +466,10 @@
 
 /* Handle menu item "File/Decrypt".  */
 static void
-decrypt_files (gpointer param)
+file_decrypt (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
-  GList * files;
+  GList *files;
   GpaFileDecryptOperation *op;
 
   files = get_selected_files (fileman->list_files);
@@ -485,7 +484,7 @@
 
 /* Handle menu item "File/Close".  */
 static void
-close_window (gpointer param)
+file_close (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
   gtk_widget_destroy (GTK_WIDGET (fileman));
@@ -494,7 +493,7 @@
 
 /* Handle menu item "Edit/Select All".  */
 static void
-fileman_select_all (gpointer param)
+edit_select_all (GtkAction *action, gpointer param)
 {
   GpaFileManager *fileman = param;
   
@@ -504,238 +503,144 @@
 
 
 
-/* Construct the file manager menu window and return that object. */
-static GtkWidget *
-fileman_menu_new (GpaFileManager *fileman)
-{
-  GtkItemFactory *factory;
-  GtkItemFactoryEntry file_menu[] = {
-    {_("/_File"), NULL, NULL, 0, "<Branch>"},
-    {_("/File/_Open"), NULL, open_file, 0, "<StockItem>", GTK_STOCK_OPEN},
-    {_("/File/C_lear"), NULL, close_all_files, 0, "<StockItem>", GTK_STOCK_CLEAR},
-    {_("/File/sep1"), NULL, NULL, 0, "<Separator>"},
-    {_("/File/_Sign"), NULL, sign_files, 0, NULL},
-    {_("/File/_Verify"), "<control>P", verify_files, 0, NULL},
-    {_("/File/_Encrypt"), NULL, encrypt_files, 0, NULL},
-    {_("/File/_Decrypt"), NULL, decrypt_files, 0, NULL},
-    {_("/File/sep2"), NULL, NULL, 0, "<Separator>"},
-    {_("/File/_Close"), NULL, close_window, 0, "<StockItem>", GTK_STOCK_CLOSE},
-    {_("/File/_Quit"), NULL, gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT},
-  };
-  GtkItemFactoryEntry edit_menu[] = {
-    {_("/_Edit"), NULL, NULL, 0, "<Branch>"},
-    {_("/Edit/Select _All"), "<control>A", fileman_select_all, 0, NULL},
-    {_("/Edit/sep2"), NULL, NULL, 0, "<Separator>"},
-    {_("/Edit/Pr_eferences..."), NULL, gpa_open_settings_dialog, 0,
-     "<StockItem>", GTK_STOCK_PREFERENCES},
-    {_("/Edit/_Backend Preferences..."), NULL,
-     gpa_open_backend_config_dialog, 0, "<StockItem>", GTK_STOCK_PREFERENCES},
-  };
-  GtkItemFactoryEntry windows_menu[] = {
-    {_("/_Windows"), NULL, NULL, 0, "<Branch>"},
-    {_("/Windows/_Keyring Editor"), NULL, gpa_open_keyring_editor, 0, NULL},
-    {_("/Windows/_Filemanager"), NULL, gpa_open_filemanager, 0, NULL},
-    {_("/Windows/_Clipboard"), NULL, gpa_open_clipboard, 0, NULL},
-  };
-  GtkAccelGroup *accel_group;
-  GtkWidget *item;
-
-  accel_group = gtk_accel_group_new ();
-  factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
-  gtk_item_factory_create_items (factory,
-				 sizeof (file_menu) / sizeof (file_menu[0]),
-				 file_menu, fileman);
-  gtk_item_factory_create_items (factory,
-				 sizeof (edit_menu) / sizeof (edit_menu[0]),
-				 edit_menu, fileman);
-  gtk_item_factory_create_items (factory,
-				 sizeof(windows_menu) /sizeof(windows_menu[0]),
-				 windows_menu, fileman);
-
-  /* Disable buttons when no file is selected.   */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/File/Sign"));
-  if (item)
-    add_selection_sensitive_widget (fileman, item, has_selection);
-
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/File/Verify"));
-  if (item)
-    add_selection_sensitive_widget (fileman, item, has_selection);
-
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/File/Encrypt"));
-  if (item)
-    add_selection_sensitive_widget (fileman, item, has_selection);
-
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/File/Decrypt"));
-  if (item)
-    add_selection_sensitive_widget (fileman, item, has_selection);
-
-  gpa_help_menu_add_to_factory (factory, GTK_WIDGET (fileman));
-  gtk_window_add_accel_group (GTK_WINDOW (fileman), accel_group);
-
-  return gtk_item_factory_get_widget (factory, "<main>");
-}
-
-
-
-/*
- * Toolbar actions.
- */
-
+/* Construct the file manager menu and toolbar widgets and return
+   them. */
 static void
-toolbar_file_open (GtkWidget *widget, gpointer param)
+fileman_action_new (GpaFileManager *fileman, GtkWidget **menubar,
+		    GtkWidget **toolbar)
 {
-  open_file (param);
-}
+  static const GtkActionEntry entries[] =
+    {
+      /* Toplevel.  */
+      { "File", NULL, N_("_File"), NULL },
+      { "Edit", NULL, N_("_Edit"), NULL },
 
-static void
-toolbar_close_all (GtkWidget *widget, gpointer param)
-{
-  close_all_files (param);
-}
+      /* File menu.  */
+      { "FileOpen", GTK_STOCK_OPEN, NULL, NULL,
+	N_("Open a file"), G_CALLBACK (file_open) },
+      { "FileClear", GTK_STOCK_CLEAR, NULL, NULL,
+	N_("Close all files"), G_CALLBACK (file_clear) },
+      { "FileSign", GPA_STOCK_SIGN, NULL, NULL,
+	N_("Sign the selected file"), G_CALLBACK (file_sign) },
+      { "FileVerify", GPA_STOCK_VERIFY, NULL, NULL,
+	N_("Check signatures of selected file"), G_CALLBACK (file_verify) },
+      { "FileEncrypt", GPA_STOCK_ENCRYPT, NULL, NULL,
+	N_("Encrypt the selected file"), G_CALLBACK (file_encrypt) },
+      { "FileDecrypt", GPA_STOCK_DECRYPT, NULL, NULL,
+	N_("Decrypt the selected file"), G_CALLBACK (file_decrypt) },
+      { "FileClose", GTK_STOCK_CLOSE, NULL, NULL,
+	N_("Close the window"), G_CALLBACK (file_close) },
+      { "FileQuit", GTK_STOCK_QUIT, NULL, NULL,
+	N_("Quit the program"), G_CALLBACK (gtk_main_quit) },
 
-static void
-toolbar_file_sign (GtkWidget *widget, gpointer param)
-{
-  sign_files (param);
-}
+      /* Edit menu.  */
+      { "EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<control>A",
+	N_("Select all files"), G_CALLBACK (edit_select_all) }
+    };
 
-static void
-toolbar_file_verify (GtkWidget *widget, gpointer param)
-{
-  verify_files (param);
-}
+  static const char *ui_description =
+    "<ui>"
+    "  <menubar name='MainMenu'>"
+    "    <menu action='File'>"
+    "      <menuitem action='FileOpen'/>"
+    "      <menuitem action='FileClear'/>"
+    "      <separator/>"
+    "      <menuitem action='FileSign'/>"
+    "      <menuitem action='FileVerify'/>"
+    "      <menuitem action='FileEncrypt'/>"
+    "      <menuitem action='FileDecrypt'/>"
+    "      <separator/>"
+    "      <menuitem action='FileClose'/>"
+    "      <menuitem action='FileQuit'/>"
+    "    </menu>"
+    "    <menu action='Edit'>"
+    "      <menuitem action='EditSelectAll'/>"
+    "      <separator/>"
+    "      <menuitem action='EditPreferences'/>"
+    "      <menuitem action='EditBackendPreferences'/>"
+    "    </menu>"
+    "    <menu action='Windows'>"
+    "      <menuitem action='WindowsKeyringEditor'/>"
+    "      <menuitem action='WindowsFileManager'/>"
+    "      <menuitem action='WindowsClipboard'/>"
+    "    </menu>"
+    "    <menu action='Help'>"
+#if 0
+    "      <menuitem action='HelpContents'/>"
+#endif
+    "      <menuitem action='HelpAbout'/>"
+    "    </menu>"
+    "  </menubar>"
+    "  <toolbar name='ToolBar'>"
+    "    <toolitem action='FileOpen'/>"
+    "    <toolitem action='FileClear'/>"
+    "    <separator/>"
+    "    <toolitem action='FileSign'/>"
+    "    <toolitem action='FileVerify'/>"
+    "    <toolitem action='FileEncrypt'/>"
+    "    <toolitem action='FileDecrypt'/>"
+    "    <separator/>"
+    "    <toolitem action='EditPreferences'/>"
+    "    <separator/>"
+    "    <toolitem action='WindowsKeyringEditor'/>"
+    "    <toolitem action='WindowsClipboard'/>"
+#if 0
+    "    <toolitem action='HelpContents'/>"
+#endif
+    "  </toolbar>"
+    "</ui>";
 
-static void
-toolbar_file_encrypt (GtkWidget *widget, gpointer param)
-{
-  encrypt_files (param);
-}
+  GtkAccelGroup *accel_group;
+  GtkActionGroup *action_group;
+  GtkAction *action;
+  GtkUIManager *ui_manager;
+  GError *error;
 
-static void
-toolbar_file_decrypt (GtkWidget *widget, gpointer param)
-{
-  decrypt_files (param);
-}
-
-
-static void
-toolbar_preferences (GtkWidget *widget, gpointer param)
-{
-  gpa_open_settings_dialog ();
-}
-
-
-/* Construct the new toolbar object and return it.  Takes the file
-   manage object.  */
-static GtkWidget *
-fileman_toolbar_new (GpaFileManager *fileman)
-{
-  GtkWidget *toolbar, *icon, *item;
-
-  toolbar = gtk_toolbar_new ();
-  
-  /* Build the "Open" button.  */
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_OPEN,
-                            _("Open a file"), _("open file"),
-                            GTK_SIGNAL_FUNC (toolbar_file_open),
-                            fileman, -1);
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_CLEAR,
-                            _("Close all files"), _("close files"),
-                            GTK_SIGNAL_FUNC (toolbar_close_all),
-                            fileman, -1);
-  /* Build the "Sign" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "sign")))
+  action_group = gtk_action_group_new ("MenuActions");
+  gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries),
+				fileman);
+  gtk_action_group_add_actions (action_group, gpa_help_menu_action_entries,
+				G_N_ELEMENTS (gpa_help_menu_action_entries),
+				fileman);
+  gtk_action_group_add_actions (action_group, gpa_windows_menu_action_entries,
+				G_N_ELEMENTS (gpa_windows_menu_action_entries),
+				fileman);
+  gtk_action_group_add_actions
+    (action_group, gpa_preferences_menu_action_entries,
+     G_N_ELEMENTS (gpa_preferences_menu_action_entries), fileman);
+  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 (fileman), accel_group);
+  if (! gtk_ui_manager_add_ui_from_string (ui_manager, ui_description,
+					   -1, &error))
     {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Sign"),
-				      _("Sign the selected file"),
-                                      _("sign file"),
-				      icon,
-				      GTK_SIGNAL_FUNC (toolbar_file_sign),
-				      fileman);
-      add_selection_sensitive_widget (fileman, item, has_selection);
+      g_message ("building fileman menus failed: %s", error->message);
+      g_error_free (error);
+      exit (EXIT_FAILURE);
     }
-  /* Build the "Verify" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "verify")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Verify"),
-				      _("Check signatures of selected file"), 
-				      _("verify file"),
-                                      icon,
-				      GTK_SIGNAL_FUNC (toolbar_file_verify), 
-				      fileman);
-      add_selection_sensitive_widget (fileman, item, has_selection);
-    }
-  /* Build the "Encrypt" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "encrypt")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Encrypt"),
-				      _("Encrypt the selected file"),
-				      _("encrypt file"),
-				      icon,
-                                      GTK_SIGNAL_FUNC (toolbar_file_encrypt),
-				      fileman);
-      add_selection_sensitive_widget (fileman, item, has_selection);
-    }
-  /* Build the "Decrypt" button.  */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "decrypt")))
-    {
-      item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Decrypt"),
-				      _("Decrypt the selected file"),
-				      _("decrypt file"),
-				      icon, 
-                                      GTK_SIGNAL_FUNC (toolbar_file_decrypt),
-				      fileman);
-      add_selection_sensitive_widget (fileman, item, has_selection);
-    }
 
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-  
-  gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), 
-                            GTK_STOCK_PREFERENCES,
-                            _("Open the preferences dialog"),
-                            _("preferences"),
-                            GTK_SIGNAL_FUNC (toolbar_preferences),
-                            fileman, -1);
+  /* Fixup the icon theme labels which are too long for the toolbar.  */
+  action = gtk_action_group_get_action (action_group, "WindowsKeyringEditor");
+  g_object_set (action, "short_label", _("Keyring"), NULL);
 
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+  /* Take care of sensitiveness of widgets.  */
+  action = gtk_action_group_get_action (action_group, "FileSign");
+  add_selection_sensitive_action (fileman, action, has_selection);
+  action = gtk_action_group_get_action (action_group, "FileVerify");
+  add_selection_sensitive_action (fileman, action, has_selection);
+  action = gtk_action_group_get_action (action_group, "FileEncrypt");
+  add_selection_sensitive_action (fileman, action, has_selection);
+  action = gtk_action_group_get_action (action_group, "FileDecrypt");
+  add_selection_sensitive_action (fileman, action, has_selection);
 
-  icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "keyringeditor");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Keyring"),
-                                  _("Open the keyring editor"),
-                                  _("keyring editor"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_keyring_editor),
-                                  NULL);
-
-  /* FIXME: Should be just the clipboard.  */
-  icon = gtk_image_new_from_stock ("gtk-paste",
-				   GTK_ICON_SIZE_SMALL_TOOLBAR);
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Clipboard"),
-				  _("Open the clipboard"),
-				  _("clipboard"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_clipboard),
-				  NULL);
-
-#if 0  /* FIXME: Help is not available yet. :-( */
-  /* Help */
-  if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "help")))
-    gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Help"),
-			     _("Understanding the GNU Privacy Assistant"),
-			     _("help"), icon,
-			     GTK_SIGNAL_FUNC (help_help), NULL);
-#endif
-
-  return toolbar;
+  *menubar = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
+  *toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
+  gpa_toolbar_set_homogeneous (GTK_TOOLBAR (*toolbar), FALSE);
 }
 
-
 
-/* 
-     Drag and Drop handler
- */
+/* Drag and Drop handler.  */
 
 
 /* Handler for "drag-drop".  This signal is emitted when the user
@@ -832,7 +737,7 @@
   select = gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
   gtk_tree_selection_set_mode (select, GTK_SELECTION_MULTIPLE);
   g_signal_connect_swapped (select, "changed",
-			    G_CALLBACK (update_selection_sensitive_widgets),
+			    G_CALLBACK (update_selection_sensitive_actions),
 			    fileman);
 
   gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (list), TRUE);
@@ -896,12 +801,9 @@
   /* Use a vbox to show the menu, toolbar and the file container.  */
   vbox = gtk_vbox_new (FALSE, 0);
 
-  /* First comes the menu.  */
-  menubar = fileman_menu_new (fileman);
+  /* Get the menu and the toolbar.  */
+  fileman_action_new (fileman, &menubar, &toolbar);
   gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, TRUE, 0);
-
-  /* Second the toolbar.  */
-  toolbar = fileman_toolbar_new(fileman);
   gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
 
 
@@ -963,7 +865,7 @@
   GpaFileManager *fileman;
 
   fileman = g_object_new (GPA_FILE_MANAGER_TYPE, NULL);  
-  update_selection_sensitive_widgets (fileman);
+  update_selection_sensitive_actions (fileman);
 
   return fileman;
 }

Modified: trunk/src/gpa.c
===================================================================
--- trunk/src/gpa.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/gpa.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -39,6 +39,7 @@
 #include "keyserver.h"
 #include "settingsdlg.h"
 #include "confdialog.h"
+#include "icons.h"
 
 #ifdef __MINGW32__
 #include "hidewnd.h"
@@ -177,7 +178,7 @@
 
 /* Show the keyring editor dialog.  */
 void
-gpa_open_keyring_editor (void)
+gpa_open_keyring_editor (GtkAction *action, void *data)
 {
   if (! keyringeditor)
     {
@@ -193,7 +194,7 @@
 
 /* Show the clipboard dialog.  */
 void
-gpa_open_clipboard (void)
+gpa_open_clipboard (GtkAction *action, void *data)
 {
   /* FIXME: Shouldn't this connect only happen if the instance is
      created the first time?  Looks like a memory leak to me.  */
@@ -207,7 +208,7 @@
 
 /* Show the filemanager dialog.  */
 void
-gpa_open_filemanager (void)
+gpa_open_filemanager (GtkAction *action, void *data)
 {
   /* FIXME: Shouldn't this connect only happen if the instance is
      created the first time?  Looks like a memory leak to me.  */
@@ -221,7 +222,7 @@
 
 /* Show the settings dialog.  */
 void
-gpa_open_settings_dialog (void)
+gpa_open_settings_dialog (GtkAction *action, void *data)
 {
   if (! settings_dialog)
     {
@@ -237,7 +238,7 @@
 
 /* Show the backend configuration dialog.  */
 void
-gpa_open_backend_config_dialog (void)
+gpa_open_backend_config_dialog (GtkAction *action, void *data)
 {
   if (!backend_config_dialog)
     {
@@ -329,11 +330,13 @@
 
   gtk_init (&argc, &argv);
 
-  /* Default icon for all windows */
+  /* Default icon for all windows.  */
   gtk_window_set_default_icon_from_file (GPA_DATADIR "/gpa.png", &err);
   if (err)
     g_error_free (err);
 
+  gpa_register_stock_items ();
+
 #ifdef IS_DEVELOPMENT_VERSION
   fprintf (stderr, "NOTE: This is a development version!\n");
 #endif
@@ -418,13 +421,13 @@
       /* Don't open the keyring editor if any files are given on the
          command line.  Dito for the clipboard.   */
       if (args.start_keyring_editor && (optind >= argc))
-	gpa_open_keyring_editor ();
+	gpa_open_keyring_editor (NULL, NULL);
 
       if (args.start_clipboard && (optind >= argc))
-	gpa_open_clipboard ();
+	gpa_open_clipboard (NULL, NULL);
   
       if (args.start_file_manager || (optind < argc))
-	gpa_open_filemanager ();
+	gpa_open_filemanager (NULL, NULL);
 
       /* If there are any command line arguments that are not options,
 	 try to open them as files in the filemanager */

Modified: trunk/src/gpa.h
===================================================================
--- trunk/src/gpa.h	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/gpa.h	2008-03-28 06:02:31 UTC (rev 866)
@@ -1,24 +1,22 @@
 /* gpa.h  -  main header
- * Copyright (C) 2000, 2001 G-N-U GmbH.
- * Copyright (C) 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 2 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, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+   Copyright (C) 2000, 2001 G-N-U GmbH.
+   Copyright (C) 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/>.  */
+
 #ifndef GPA_H
 #define GPA_H
 
@@ -33,6 +31,7 @@
 #include "gpadefs.h"
 #include "gpgmetools.h"
 #include "options.h"
+#include "icons.h"
 
 /* For mkdir() */
 #ifdef G_OS_WIN32
@@ -56,21 +55,48 @@
 
 
 /* Show the keyring editor dialog.  */
-void gpa_open_keyring_editor (void);
+void gpa_open_keyring_editor (GtkAction *action, void *data);
 
 /* Show the filemanager dialog.  */
-void gpa_open_filemanager (void);
+void gpa_open_filemanager (GtkAction *action, void *data);
 
 /* Show the filemanager dialog.  */
-void gpa_open_clipboard (void);
+void gpa_open_clipboard (GtkAction *action, void *data);
 
+
+static const GtkActionEntry gpa_windows_menu_action_entries[] =
+  {
+      { "Windows", NULL, N_("_Windows"), NULL },
+
+      { "WindowsKeyringEditor", GPA_STOCK_KEYRING, NULL, NULL,
+	N_("Open the keyring editor"), G_CALLBACK (gpa_open_keyring_editor) },
+      { "WindowsFileManager", GPA_STOCK_FILEMAN,
+	N_("_File Manager") /* FIXME: Use stock item.  */, NULL,
+	N_("Open the file manager"), G_CALLBACK (gpa_open_filemanager) },
+      { "WindowsClipboard", GPA_STOCK_CLIPBOARD,
+	N_("_Clipboard") /* FIXME: Use stock item.  */, NULL,
+	N_("Open the clipboard"), G_CALLBACK (gpa_open_clipboard) }
+  };
+
+
 /* Show the settings dialog.  */
-void gpa_open_settings_dialog (void);
+void gpa_open_settings_dialog (GtkAction *action, void *data);
 
 /* Show the backend configuration dialog.  */
-void gpa_open_backend_config_dialog (void);
+void gpa_open_backend_config_dialog (GtkAction *action, void *data);
 
+static const GtkActionEntry gpa_preferences_menu_action_entries[] =
+  {
+      { "EditPreferences", GTK_STOCK_PREFERENCES, NULL, NULL,
+	N_("Configure the application"),
+	G_CALLBACK (gpa_open_settings_dialog) },
+      { "EditBackendPreferences", GTK_STOCK_PREFERENCES,
+	N_("_Backend Preferences"), NULL,
+	N_("Configure the backend programs"),
+	G_CALLBACK (gpa_open_backend_config_dialog) }
+  };
 
+
 typedef void (*GPADefaultKeyChanged) (gpointer user_data);
 
 void gpa_run_server_continuation (assuan_context_t ctx, gpg_error_t err);

Modified: trunk/src/gtktools.c
===================================================================
--- trunk/src/gtktools.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/gtktools.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -177,3 +177,21 @@
     gpa_add_tooltip (gtk_tree_view_column_get_widget (column), tooltip);
 }
 
+
+static void
+set_homogeneous (GtkWidget *widget, gpointer data)
+{
+  gboolean *is_hom_p = data;
+
+  gtk_tool_item_set_homogeneous (GTK_TOOL_ITEM (widget), *is_hom_p);
+}
+
+
+/* Set the homogeneous property for all children of TOOLBAR to IS_HOM.  */
+void
+gpa_toolbar_set_homogeneous (GtkToolbar *toolbar, gboolean is_hom)
+{
+  gtk_container_foreach (GTK_CONTAINER (toolbar),
+			 (GtkCallback) set_homogeneous, &is_hom);
+}
+

Modified: trunk/src/gtktools.h
===================================================================
--- trunk/src/gtktools.h	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/gtktools.h	2008-03-28 06:02:31 UTC (rev 866)
@@ -2,9 +2,8 @@
    Copyright (C) 2000, 2001 G-N-U GmbH.
    Copyright (C) 2008 g10 Code GmbH.
 
+   This file is part of GPA.
 
-   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
@@ -41,5 +40,9 @@
 void gpa_set_column_title (GtkTreeViewColumn *column,
                            const char *title, const char *tooltip);
 
+/* Set the homogeneous property for all children of TOOLBAR to IS_HOM.  */
+void gpa_toolbar_set_homogeneous (GtkToolbar *toolbar, gboolean is_hom);
 
+
+
 #endif /* GTK_TOOLS_H_ */

Modified: trunk/src/helpmenu.c
===================================================================
--- trunk/src/helpmenu.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/helpmenu.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -31,8 +31,8 @@
 
 
 /* Display the about dialog.  */
-static void
-help_about (GtkWindow *window)
+void
+gpa_help_about (GtkAction *action, GtkWindow *window)
 {
   static const gchar *authors[] =
     {
@@ -94,27 +94,3 @@
   if (logo)
     g_object_unref (logo);
 }
-
-void
-help_help (GtkWindow *window)
-{
-  g_print (_("Show Help Text\n"));
-}
-
-
-void
-gpa_help_menu_add_to_factory (GtkItemFactory *factory, GtkWidget * window)
-{
-  GtkItemFactoryEntry menu[] = {
-    { _("/_Help"), NULL, NULL, 0, "<Branch>" },
-#if 0
-    /* FIXME: Help is not available yet.  */
-    { _("/Help/_Contents"), NULL, (GtkItemFactoryCallback) help_help, 0,
-      "<StockItem>", GTK_STOCK_HELP },
-#endif
-    { _("/Help/_About"), NULL, (GtkItemFactoryCallback) help_about, 0,
-      "<StockItem>", GTK_STOCK_ABOUT }
-  };
-  gtk_item_factory_create_items (factory, sizeof (menu) / sizeof (menu[0]),
-				 menu, window);
-}

Modified: trunk/src/helpmenu.h
===================================================================
--- trunk/src/helpmenu.h	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/helpmenu.h	2008-03-28 06:02:31 UTC (rev 866)
@@ -19,6 +19,20 @@
 #ifndef HELPMENU_H__
 #define HELPMENU_H__
 
-void gpa_help_menu_add_to_factory (GtkItemFactory *factory, GtkWidget *window);
+#include <gtk/gtk.h>
 
+/* Display the about dialog.  */
+void gpa_help_about (GtkAction *action, GtkWindow *window);
+
+static const GtkActionEntry gpa_help_menu_action_entries[] =
+  {
+    { "Help", NULL, N_("_Help"), NULL },
+#if 0
+    { "HelpContents", GTK_STOCK_HELP, NULL, NULL,
+      N_("Open the GPA manual"), G_CALLBACK (gpa_help_contents) },
+#endif
+    { "HelpAbout", GTK_STOCK_ABOUT, NULL, NULL,
+      N_("About this application"), G_CALLBACK (gpa_help_about) }
+  };
+
 #endif /* HELPMENU_H__ */

Modified: trunk/src/icons.c
===================================================================
--- trunk/src/icons.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/icons.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -28,13 +28,15 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "i18n.h"
+
 #include "icons.h"
+
 #include "verify.xpm"
 #include "blue_key.xpm"
 #include "blue_yellow_key.xpm"
 #include "brief.xpm"
 #include "decrypt.xpm"
-#include "delete.xpm"
 #include "detailed.xpm"
 #include "edit.xpm"
 #include "encrypt.xpm"
@@ -42,11 +44,9 @@
 #include "gpa_blue_key.xpm"
 #include "gpa_logo.xpm"
 #include "gpa_yellow_key.xpm"
-#include "help.xpm"
 #include "import.xpm"
 #include "keyring.xpm"
 #include "keyringeditor.xpm"
-#include "openfile.xpm"
 #include "sign.xpm"
 #include "wizard_backup.xpm"
 #include "wizard_genkey.xpm"
@@ -56,27 +56,24 @@
   const char *name;
   char **xpm;
 } xpms[] = {
-  {"openfile",	openfile_xpm  },
-  {"help",	help_xpm  },
-  {"encrypt",	encrypt_xpm  },
-  {"decrypt",	decrypt_xpm  },
-  {"sign",	sign_xpm  },
-  {"verify",    verify_xpm },
-  {"keyring",	keyring_xpm  },
-  {"keyringeditor",	keyringeditor_xpm  },
-  {"gpa_blue_key",	gpa_blue_key_xpm},
-  {"gpa_yellow_key",	gpa_yellow_key_xpm},
-  {"blue_key",	blue_key_xpm},
-  {"blue_yellow_key",	blue_yellow_key_xpm},
-  {"export",	export_xpm},
-  {"import",	import_xpm},
-  {"brief",	brief_xpm},
-  {"detailed",	detailed_xpm},
-  {"edit",	edit_xpm},
-  {"delete",	delete_xpm},
-  {"wizard_genkey", wizard_genkey_xpm},
-  {"wizard_backup", wizard_backup_xpm},
-  {"gpa_logo",	gpa_logo_xpm},
+  { "gpa_logo",	gpa_logo_xpm},
+  { "gpa-encrypt", encrypt_xpm },
+  { "gpa-decrypt", decrypt_xpm },
+  { "gpa-sign", sign_xpm },
+  { "gpa-verify", verify_xpm },
+  { "gpa-keyringeditor", keyringeditor_xpm },
+  { "gpa-export", export_xpm },
+  { "gpa-import", import_xpm },
+  { "gpa-brief", brief_xpm },
+  { "gpa-detailed", detailed_xpm },
+  { "gpa-edit", edit_xpm },
+  { "keyring", keyring_xpm },
+  { "gpa_blue_key", gpa_blue_key_xpm },
+  { "gpa_yellow_key", gpa_yellow_key_xpm },
+  { "blue_key",	blue_key_xpm },
+  { "blue_yellow_key", blue_yellow_key_xpm },
+  { "wizard_genkey", wizard_genkey_xpm},
+  { "wizard_backup", wizard_backup_xpm},
   { NULL, NULL }
 };
 
@@ -90,7 +87,6 @@
     char **xpm = NULL;
     int i;
     
-
     for (i = 0; xpms[i].name; i++)
       if (! strcmp (xpms[i].name, name))
         {
@@ -105,7 +101,6 @@
         return NULL;
       }
     
-    
     style = gtk_widget_get_style (window);
     pix = gdk_pixmap_create_from_xpm_d (window->window, r_mask,
                                         &style->bg[GTK_STATE_NORMAL],
@@ -157,3 +152,54 @@
 
   return gdk_pixbuf_new_from_xpm_data ((const char**) xpm);
 }
+
+
+static void
+register_stock_icons (void)
+{
+  GdkPixbuf *pixbuf;
+  GtkIconFactory *icon_factory;
+  GtkIconSet *icon_set; 
+  GtkIconSource *icon_source;
+  gint i;
+
+  icon_factory = gtk_icon_factory_new ();
+
+  for (i = 0; xpms[i].name; i++)
+    {
+      icon_set = gtk_icon_set_new ();
+      icon_source = gtk_icon_source_new ();
+
+      pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) xpms[i].xpm);
+      gtk_icon_source_set_pixbuf (icon_source, pixbuf);
+	
+      gtk_icon_set_add_source (icon_set, icon_source);
+      gtk_icon_source_free (icon_source);
+      gtk_icon_factory_add (icon_factory, xpms[i].name, icon_set);
+      gtk_icon_set_unref (icon_set);
+    }
+
+  gtk_icon_factory_add_default (icon_factory); 
+
+  g_object_unref (icon_factory);
+}
+
+
+void
+gpa_register_stock_items (void)
+{
+  static const GtkStockItem items[] =
+    {
+      { GPA_STOCK_SIGN, N_("_Sign"), 0, 0, PACKAGE },
+      { GPA_STOCK_VERIFY, N_("_Verify"), 0, 0, PACKAGE },
+      { GPA_STOCK_ENCRYPT, N_("_Encrypt"), 0, 0, PACKAGE },
+      { GPA_STOCK_DECRYPT, N_("_Decrypt"), 0, 0, PACKAGE },
+      { GPA_STOCK_KEYRING, N_("_Keyring Editor"), 0, 0, PACKAGE },
+      { GPA_STOCK_BRIEF, N_("_Brief"), 0, 0, PACKAGE },
+      { GPA_STOCK_DETAILED, N_("_Detailed"), 0, 0, PACKAGE }
+    };
+
+  register_stock_icons ();
+
+  gtk_stock_add_static (items, G_N_ELEMENTS (items));
+}

Modified: trunk/src/icons.h
===================================================================
--- trunk/src/icons.h	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/icons.h	2008-03-28 06:02:31 UTC (rev 866)
@@ -27,5 +27,23 @@
                                    GdkBitmap **mask);
 
 GdkPixbuf *gpa_create_icon_pixbuf (const char *name);
+
+void gpa_register_stock_items (void);
+
+#define GPA_STOCK_SIGN "gpa-sign"
+#define GPA_STOCK_VERIFY "gpa-verify"
+#define GPA_STOCK_ENCRYPT "gpa-encrypt"
+#define GPA_STOCK_DECRYPT "gpa-decrypt"
+#define GPA_STOCK_KEYRING "gpa-keyringeditor"
+/* 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
+#define GPA_STOCK_CLIPBOARD GTK_STOCK_PASTE
+#define GPA_STOCK_BRIEF "gpa-brief"
+#define GPA_STOCK_DETAILED "gpa-detailed"
+#define GPA_STOCK_EDIT "gpa-edit"
+#define GPA_STOCK_IMPORT "gpa-import"
+#define GPA_STOCK_EXPORT "gpa-export"
+#define GPA_STOCK_BACKUP "gpa-backup"
      
 #endif /*ICONS_H*/

Modified: trunk/src/keyring.c
===================================================================
--- trunk/src/keyring.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/keyring.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -135,7 +135,7 @@
   GtkWidget *popup_menu;
 
   /* List of sensitive widgets.  See below.  */
-  GList * selection_sensitive_widgets;
+  GList *selection_sensitive_actions;
 
   /* The currently selected key.  */
   gpgme_key_t current_key;
@@ -171,7 +171,7 @@
    sensitive and FALSE otherwise.
   
    Whenever the selection in the key list widget changes we call
-   update_selection_sensitive_widgets which iterates through the
+   update_selection_sensitive_actions which iterates through the
    widgets in the list, calls the sensitivity callback and changes the
    widget's sensitivity accordingly.  */
 
@@ -183,13 +183,13 @@
 
 /* Add widget to the list of sensitive widgets of editor.  */
 static void
-add_selection_sensitive_widget (GPAKeyringEditor *editor,
-                                GtkWidget *widget,
+add_selection_sensitive_action (GPAKeyringEditor *editor,
+                                GtkAction *action,
                                 SensitivityFunc callback)
 {
-  gtk_object_set_data (GTK_OBJECT (widget), "gpa_sensitivity", callback);
-  editor->selection_sensitive_widgets
-    = g_list_append (editor->selection_sensitive_widgets, widget);
+  g_object_set_data (G_OBJECT (action), "gpa_sensitivity", callback);
+  editor->selection_sensitive_actions
+    = g_list_append (editor->selection_sensitive_actions, action);
 }
 
 
@@ -197,12 +197,12 @@
    the sensitivity callback.  Usable as iterator function in
    g_list_foreach.  */
 static void
-update_selection_sensitive_widget (gpointer data, gpointer param)
+update_selection_sensitive_action (gpointer data, gpointer param)
 {
   SensitivityFunc func;
 
-  func = gtk_object_get_data (GTK_OBJECT (data), "gpa_sensitivity");
-  gtk_widget_set_sensitive (GTK_WIDGET (data), func (param));
+  func = g_object_get_data (G_OBJECT (data), "gpa_sensitivity");
+  gtk_action_set_sensitive (GTK_ACTION (data), func (param));
 }
 
 
@@ -210,24 +210,24 @@
    of sensitive widgets and pass editor through as the user data
    parameter.  */
 static void
-update_selection_sensitive_widgets (GPAKeyringEditor * editor)
+update_selection_sensitive_actions (GPAKeyringEditor *editor)
 {
-  g_list_foreach (editor->selection_sensitive_widgets,
-                  update_selection_sensitive_widget,
+  g_list_foreach (editor->selection_sensitive_actions,
+                  update_selection_sensitive_action,
                   (gpointer) editor);
 }
 
-/* Disable all the widgets in the list of sensitive widgets. To be used while
+/* Disable all the widgets in the list of sensitive widgets.  To be used while
    the selection changes.  */
 static void
-disable_selection_sensitive_widgets (GPAKeyringEditor * editor)
+disable_selection_sensitive_actions (GPAKeyringEditor *editor)
 {
   GList *cur;
   
-  cur = editor->selection_sensitive_widgets;
+  cur = editor->selection_sensitive_actions;
   while (cur)
     {
-      gtk_widget_set_sensitive (GTK_WIDGET (cur->data), FALSE);
+      gtk_action_set_sensitive (GTK_ACTION (cur->data), FALSE);
       cur = g_list_next (cur);
     }
 }
@@ -381,7 +381,7 @@
 
 /* delete the selected keys */
 static void
-keyring_editor_delete (GPAKeyringEditor *editor)
+keyring_editor_delete (GtkAction *action, GPAKeyringEditor *editor)
 {
   GList *selection = gpa_keylist_get_selected_keys (editor->keylist);
   GpaKeyDeleteOperation *op = gpa_key_delete_operation_new (editor->window,
@@ -444,7 +444,7 @@
 
 /* sign the selected keys */
 static void
-keyring_editor_sign (gpointer param)
+keyring_editor_sign (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GList *selection;
@@ -465,7 +465,7 @@
 
 /* Invoke the "edit key" dialog.  */
 static void
-keyring_editor_edit (gpointer param)
+keyring_editor_edit (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   gpgme_key_t key;
@@ -487,7 +487,7 @@
 
 
 static void
-keyring_editor_trust (gpointer param)
+keyring_editor_trust (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GList *selection;
@@ -506,7 +506,7 @@
 
 /* Import keys.  */
 static void
-keyring_editor_import (gpointer param)
+keyring_editor_import (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GpaImportFileOperation *op;
@@ -518,7 +518,7 @@
 
 /* Export the selected keys to a file.  */
 static void
-keyring_editor_export (gpointer param)
+keyring_editor_export (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GList *selection;
@@ -535,7 +535,7 @@
 
 /* Import a key from the keyserver.  */
 static void
-keyring_editor_retrieve (gpointer param)
+keyring_editor_retrieve (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GpaImportServerOperation *op;
@@ -547,7 +547,7 @@
 
 /* Send a key to the keyserver.  */
 static void
-keyring_editor_send (gpointer param)
+keyring_editor_send (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GList *selection;
@@ -566,7 +566,7 @@
 
 /* Backup the default keys.  */
 static void
-keyring_editor_backup (gpointer param)
+keyring_editor_backup (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   gpgme_key_t key;
@@ -610,7 +610,7 @@
 
 /* Generate a key.  */
 static void
-keyring_editor_generate_key (gpointer param)
+keyring_editor_generate_key (GtkAction *action, gpointer param)
 {
   if (gpa_options_get_simplified_ui (gpa_options_get_instance ()))
     keyring_editor_generate_key_simple (param);
@@ -622,9 +622,9 @@
 /* Update everything that has to be updated when the selection in the
    key list changes.  */
 static void
-keyring_selection_update_widgets (GPAKeyringEditor *editor)
+keyring_selection_update_actions (GPAKeyringEditor *editor)
 {
-  update_selection_sensitive_widgets (editor);
+  update_selection_sensitive_actions (editor);
   keyring_update_details_notebook (editor);
 }  
 
@@ -640,7 +640,7 @@
     gpgme_key_unref (editor->current_key);
   editor->current_key = key;
 
-  keyring_selection_update_widgets (editor);
+  keyring_selection_update_actions (editor);
 }
 
 
@@ -696,12 +696,10 @@
 
       /* Make sure the actions that depend on a current key are
 	 disabled.  */
-      disable_selection_sensitive_widgets (editor);
+      disable_selection_sensitive_actions (editor);
     }
   else
-    {
-      keyring_selection_update_widgets (editor);
-    }
+    keyring_selection_update_actions (editor);
 }
 
 /* Signal handler for the map signal.  If the simplified_ui flag is
@@ -741,9 +739,7 @@
 	  response = gtk_dialog_run (GTK_DIALOG (dialog));
 	  gtk_widget_destroy (dialog);
           if (response == GTK_RESPONSE_OK)
-	    {
-	      keyring_editor_generate_key (param);
-	    }
+	    keyring_editor_generate_key (NULL, param);
 	  asked_about_key_generation = TRUE;
         }
       else if (!asked_about_key_backup
@@ -783,7 +779,7 @@
 
 /* Close the keyring editor.  */
 static void
-keyring_editor_close (gpointer param)
+keyring_editor_close (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
 
@@ -797,14 +793,14 @@
 {
   GPAKeyringEditor *editor = param;
 
-  g_list_free (editor->selection_sensitive_widgets);
+  g_list_free (editor->selection_sensitive_actions);
   g_free (editor);
 }
 
 
 /* select all keys in the keyring */
 static void
-keyring_editor_select_all (gpointer param)
+keyring_editor_select_all (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GtkTreeSelection *selection;
@@ -816,7 +812,7 @@
 
 /* Paste the clipboard into the keyring.  */
 static void
-keyring_editor_paste (gpointer param)
+keyring_editor_paste (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GpaImportClipboardOperation *op;
@@ -828,7 +824,7 @@
 
 /* Copy the keys into the clipboard.  */
 static void
-keyring_editor_copy (gpointer param)
+keyring_editor_copy (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   GList *selection;
@@ -845,7 +841,7 @@
 
 /* Reload the key list.  */
 static void
-keyring_editor_refresh (gpointer param)
+keyring_editor_refresh (GtkAction *action, gpointer param)
 {
   GPAKeyringEditor *editor = param;
   
@@ -853,192 +849,264 @@
 }
 
 
-/* Create and return the menu bar for the key ring editor.  */
-static GtkWidget *
-keyring_editor_menubar_new (GtkWidget *window, GPAKeyringEditor *editor)
+static void
+keyring_set_listing_cb (GtkAction *action,
+			GtkRadioAction *current_action, gpointer param)
 {
-  GtkAccelGroup *accel_group;
-  GtkItemFactory *factory;
-  GtkItemFactoryEntry file_menu[] = {
-    {_("/_File"), NULL, NULL, 0, "<Branch>"},
-    {_("/File/_Close"), NULL, keyring_editor_close, 0, "<StockItem>",
-     GTK_STOCK_CLOSE},
-    {_("/File/_Quit"), NULL, gtk_main_quit, 0, "<StockItem>", GTK_STOCK_QUIT},
-  };
-  GtkItemFactoryEntry edit_menu[] = {
-    {_("/_Edit"), NULL, NULL, 0, "<Branch>"},
-    {_("/Edit/_Copy"), NULL, keyring_editor_copy, 0, "<StockItem>",
-     GTK_STOCK_COPY},
-    {_("/Edit/_Paste"), NULL, keyring_editor_paste, 0, "<StockItem>",
-     GTK_STOCK_PASTE},
-    {_("/Edit/sep1"), NULL, NULL, 0, "<Separator>"},
-    {_("/Edit/Select _All"), "<control>A", keyring_editor_select_all, 0, NULL},
-    {_("/Edit/sep2"), NULL, NULL, 0, "<Separator>"},
-    {_("/Edit/Pr_eferences..."), NULL, gpa_open_settings_dialog, 0,
-     "<StockItem>", GTK_STOCK_PREFERENCES},
-    {_("/Edit/_Backend Preferences..."), NULL,
-     gpa_open_backend_config_dialog, 0, "<StockItem>", GTK_STOCK_PREFERENCES},
-  };
-  GtkItemFactoryEntry keys_menu[] = {
-    {_("/_Keys"), NULL, NULL, 0, "<Branch>"},
-    {_("/Keys/_Refresh"), NULL, keyring_editor_refresh, 0,
-     "<StockItem>", GTK_STOCK_REFRESH},
-    {_("/Keys/sep0"), NULL, NULL, 0, "<Separator>"},
-    {_("/Keys/_New Key..."), NULL, keyring_editor_generate_key, 0,
-     "<StockItem>", GTK_STOCK_NEW},
-    {_("/Keys/_Delete Keys..."), NULL, keyring_editor_delete, 0,
-     "<StockItem>", GTK_STOCK_DELETE},
-    {_("/Keys/sep1"), NULL, NULL, 0, "<Separator>"},
-    {_("/Keys/_Sign Keys..."), NULL, keyring_editor_sign, 0, NULL},
-    {_("/Keys/Set _Owner Trust..."), NULL, keyring_editor_trust, 0, NULL},
-    {_("/Keys/_Edit Private Key..."), NULL, keyring_editor_edit, 0, NULL},
-    {_("/Keys/sep2"), NULL, NULL, 0, "<Separator>"},    
-    {_("/Keys/_Import Keys..."), NULL, keyring_editor_import, 0, NULL},
-    {_("/Keys/E_xport Keys..."), NULL, keyring_editor_export, 0, NULL},
-    {_("/Keys/_Backup..."), NULL, keyring_editor_backup, 0, NULL},
-  };
-  GtkItemFactoryEntry keyserver_menu[] = {
-    {_("/_Server"), NULL, NULL, 0, "<Branch>"},
-    {_("/Server/_Retrieve Keys..."), NULL, keyring_editor_retrieve, 0, NULL},
-    {_("/Server/_Send Keys..."), NULL, keyring_editor_send, 0, NULL},      
-  };
-  GtkItemFactoryEntry win_menu[] = {
-    {_("/_Windows"), NULL, NULL, 0, "<Branch>"},
-    {_("/Windows/_Keyring Editor"), NULL, gpa_open_keyring_editor, 0, NULL},
-    {_("/Windows/_File Manager"), NULL, gpa_open_filemanager, 0, NULL},
-    {_("/Windows/_Clipboard"), NULL, gpa_open_clipboard, 0, NULL},
-  };
-  GtkWidget *item;
+  GPAKeyringEditor *editor = param;
+  gint detailed;
 
-  accel_group = gtk_accel_group_new ();
-  factory = gtk_item_factory_new (GTK_TYPE_MENU_BAR, "<main>", accel_group);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (file_menu) / sizeof (file_menu[0]),
-                                 file_menu, editor);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (edit_menu) / sizeof (edit_menu[0]),
-                                 edit_menu, editor);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (keys_menu) / sizeof (keys_menu[0]),
-                                 keys_menu, editor);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (keyserver_menu) / 
-				 sizeof (keyserver_menu[0]),
-                                 keyserver_menu, editor);
-  gtk_item_factory_create_items (factory,
-                                 sizeof (win_menu) / sizeof (win_menu[0]),
-                                 win_menu, editor);
-  gpa_help_menu_add_to_factory (factory, window);
-  gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
+  detailed = gtk_radio_action_get_current_value
+    (GTK_RADIO_ACTION (current_action));
 
-  /* The menu paths given here MUST NOT contain underscores.  Tough
-     luck for translators :-(  */
+  if (detailed)
+    {
+      gpa_keylist_set_detailed (editor->keylist);
+      gpa_options_set_detailed_view (gpa_options_get_instance (), TRUE);
+    }
+  else
+    {
+      gpa_keylist_set_brief (editor->keylist);
+      gpa_options_set_detailed_view (gpa_options_get_instance (), FALSE);
+    }
+}
 
-  /* Items that must only be available if a key is selected.  */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Export Keys..."));
-  if (item)
-      add_selection_sensitive_widget (editor, item,
-				      keyring_editor_has_selection);
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Delete Keys..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item, keyring_editor_has_selection);
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Edit/Copy"));
-  if (item)
-    add_selection_sensitive_widget (editor, item, keyring_editor_has_selection);
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Server/Send Keys..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item,
-				    keyring_editor_has_single_selection);
 
-  /* Only if there is only ONE key selected. */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Set Owner Trust..."));
-  if (item)
-    add_selection_sensitive_widget 
-      (editor, item, keyring_editor_has_single_selection_OpenPGP);
+/* Create and return the menu bar for the key ring editor.  */
+static void
+keyring_editor_action_new (GPAKeyringEditor *editor,
+			   GtkWidget **menu, GtkWidget **toolbar,
+			   GtkWidget **popup)
+{
+  static const GtkActionEntry entries[] =
+    {
+      /* Toplevel.  */
+      { "File", NULL, N_("_File"), NULL },
+      { "Edit", NULL, N_("_Edit"), NULL },
+      { "Keys", NULL, N_("_Keys"), NULL },
+      { "Server", NULL, N_("_Server"), NULL },
 
-  /* If the keys can be signed.  */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Sign Keys..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item, keyring_editor_can_sign);
+      /* File menu.  */
+      { "FileClose", GTK_STOCK_CLOSE, NULL, NULL,
+	N_("FIXME"), G_CALLBACK (keyring_editor_close) },
+      { "FileQuit", GTK_STOCK_QUIT, NULL, NULL,
+	N_("Quit the program"), G_CALLBACK (gtk_main_quit) },
 
-  /* If the selected key has a private key.  */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Edit Private Key..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item,
-				    keyring_editor_has_private_selected);
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Keys/Backup..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item,
-				    keyring_editor_has_private_selected);
+      /* Edit menu.  */
+      { "EditCopy", GTK_STOCK_COPY, NULL, NULL,
+	N_("Copy the selection"), G_CALLBACK (keyring_editor_copy) },
+      { "EditPaste", GTK_STOCK_PASTE, NULL, NULL,
+	N_("Paste the clipboard"), G_CALLBACK (keyring_editor_paste) },
+      { "EditSelectAll", GTK_STOCK_SELECT_ALL, NULL, "<control>A",
+	N_("Select all certificates"),
+	G_CALLBACK (keyring_editor_select_all) },
 
-  return gtk_item_factory_get_widget (factory, "<main>");
-}
+      /* Keys menu.  */
+      { "KeysRefresh", GTK_STOCK_REFRESH, NULL, NULL,
+	N_("Refresh the keyring"), G_CALLBACK (keyring_editor_refresh) },
+      { "KeysNew", GTK_STOCK_NEW, N_("_New key..."), NULL,
+	N_("Generate a new key"), G_CALLBACK (keyring_editor_generate_key) },
+      { "KeysDelete", GTK_STOCK_DELETE, N_("_Delete keys"), NULL,
+	N_("Remove the selected key"), G_CALLBACK (keyring_editor_delete) },
+      { "KeysSign", GPA_STOCK_SIGN, N_("_Sign Keys..."), NULL,
+	N_("Sign the selected key"), G_CALLBACK (keyring_editor_sign) },
+      { "KeysSetOwnerTrust", NULL, N_("Set _Owner Trust..."), NULL,
+	N_("Set owner trust of the selected key"),
+	G_CALLBACK (keyring_editor_trust) },
+      { "KeysEditPrivateKey", GPA_STOCK_EDIT, N_("_Edit Private Key..."), NULL,
+	N_("Edit the selected private key"),
+	G_CALLBACK (keyring_editor_edit) },
+      { "KeysImport", GPA_STOCK_IMPORT, N_("_Import Keys..."), NULL,
+	N_("Import Keys"), G_CALLBACK (keyring_editor_import) },
+      { "KeysExport", GPA_STOCK_EXPORT, N_("E_xport Keys..."), NULL,
+	N_("Export Keys"), G_CALLBACK (keyring_editor_export) },
+      { "KeysBackup", NULL, N_("_Backup..."), NULL,
+	N_("Backup key"), G_CALLBACK (keyring_editor_backup) },
 
+      /* Server menu.  */
+      { "ServerRetrieve", NULL, N_("_Retrieve Keys..."), NULL,
+	N_("Retrieve keys from server"),
+	G_CALLBACK (keyring_editor_retrieve) },
+      { "ServerSend", NULL, N_("_Send Keys..."), NULL,
+	N_("Send keys to server"), G_CALLBACK (keyring_editor_send) }
+    };
 
-/* Create the popup menu for the key list.  */
-static GtkWidget *
-keyring_editor_popup_menu_new (GtkWidget *window,
-                               GPAKeyringEditor *editor)
-{
-  GtkItemFactory *factory;
-  GtkItemFactoryEntry popup_menu[] =
+  static const GtkRadioActionEntry radio_entries[] =
     {
-      {_("/_Copy"), NULL, keyring_editor_copy, 0, "<StockItem>",
-       GTK_STOCK_COPY},
-      {_("/_Paste"), NULL, keyring_editor_paste, 0, "<StockItem>",
-       GTK_STOCK_PASTE},
-      {_("/_Delete Keys..."), NULL, keyring_editor_delete, 0,
-       "<StockItem>", GTK_STOCK_DELETE},
-      {"/sep1", NULL, NULL, 0, "<Separator>"},
-      {_("/_Sign Keys..."), NULL, keyring_editor_sign, 0, NULL},
-      {_("/Set _Owner Trust..."), NULL, keyring_editor_trust, 0, NULL},
-      {_("/_Edit Private Key..."), NULL, keyring_editor_edit, 0, NULL},
-      {"/sep2", NULL, NULL, 0, "<Separator>"},
-      {_("/E_xport Keys..."), NULL, keyring_editor_export, 0, NULL},
-      {_("/Se_nd Keys to Server..."), NULL, keyring_editor_send, 0, NULL},
-      {_("/_Backup..."), NULL, keyring_editor_backup, 0, NULL},
+      { "DetailsBrief", GPA_STOCK_BRIEF, NULL, NULL,
+	N_("Show Brief Keylist"), 0 },
+      { "DetailsDetailed", GPA_STOCK_DETAILED, NULL, NULL,
+	N_("Show Key Details"), 1 }
     };
-  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, editor);
+  static const char *ui_description =
+    "<ui>"
+    "  <menubar name='MainMenu'>"
+    "    <menu action='File'>"
+    "      <menuitem action='FileClose'/>"
+    "      <menuitem action='FileQuit'/>"
+    "    </menu>"
+    "    <menu action='Edit'>"
+    "      <menuitem action='EditCopy'/>"
+    "      <menuitem action='EditPaste'/>"
+    "      <separator/>"
+    "      <menuitem action='EditSelectAll'/>"
+    "      <separator/>"
+    "      <menuitem action='EditPreferences'/>"
+    "      <menuitem action='EditBackendPreferences'/>"
+    "    </menu>"
+    "    <menu action='Keys'>"
+    "      <menuitem action='KeysRefresh'/>"
+    "      <separator/>"
+    "      <menuitem action='KeysNew'/>"
+    "      <menuitem action='KeysDelete'/>"
+    "      <separator/>"
+    "      <menuitem action='KeysSign'/>"
+    "      <menuitem action='KeysSetOwnerTrust'/>"
+    "      <menuitem action='KeysEditPrivateKey'/>"
+    "      <separator/>"
+    "      <menuitem action='KeysImport'/>"
+    "      <menuitem action='KeysExport'/>"
+    "      <menuitem action='KeysBackup'/>"
+    "    </menu>"
+    "    <menu action='Windows'>"
+    "      <menuitem action='WindowsKeyringEditor'/>"
+    "      <menuitem action='WindowsFileManager'/>"
+    "      <menuitem action='WindowsClipboard'/>"
+    "    </menu>"
+    "    <menu action='Server'>"
+    "      <menuitem action='ServerRetrieve'/>"
+    "      <menuitem action='ServerSend'/>"
+    "    </menu>"
+    "    <menu action='Help'>"
+#if 0
+    "      <menuitem action='HelpContents'/>"
+#endif
+    "      <menuitem action='HelpAbout'/>"
+    "    </menu>"
+    "  </menubar>"
+    "  <toolbar name='ToolBar'>"
+    "    <toolitem action='KeysEditPrivateKey'/>"
+    "    <toolitem action='KeysDelete'/>"
+    "    <toolitem action='KeysSign'/>"
+    "    <toolitem action='KeysImport'/>"
+    "    <toolitem action='KeysExport'/>"
+    "    <separator/>"
+    "    <toolitem action='DetailsBrief'/>"
+    "    <toolitem action='DetailsDetailed'/>"
+    "    <separator/>"
+    "    <toolitem action='EditPreferences'/>"
+    "    <separator/>"
+    "    <toolitem action='KeysRefresh'/>"
+    "    <separator/>"
+    "    <toolitem action='WindowsFileManager'/>"
+    "    <toolitem action='WindowsClipboard'/>"
+#if 0
+    "    <toolitem action='HelpContents'/>"
+#endif
+    "  </toolbar>"
+    "  <popup name='PopupMenu'>"
+    "    <menuitem action='EditCopy'/>"
+    "    <menuitem action='EditPaste'/>"
+    "    <menuitem action='KeysDelete'/>"
+    "    <separator/>"
+    "    <menuitem action='KeysSign'/>"
+    "    <menuitem action='KeysSetOwnerTrust'/>"
+    "    <menuitem action='KeysEditPrivateKey'/>"
+    "    <separator/>"
+    "    <menuitem action='KeysExport'/>"
+    "    <menuitem action='ServerSend'/>"
+    "    <menuitem action='KeysBackup'/>"
+    "  </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_OpenPGP);
+  GtkAccelGroup *accel_group;
+  GtkActionGroup *action_group;
+  GtkAction *action;
+  GtkUIManager *ui_manager;
+  GError *error;
+  int detailed;
 
-  /* If the keys can be signed.  */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Sign Keys..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item, keyring_editor_can_sign);
+  detailed = gpa_options_get_detailed_view (gpa_options_get_instance());
 
-  /* If the selected key has a private key.  */
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Edit Private Key..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item,
-				    keyring_editor_has_private_selected);
-  item = gtk_item_factory_get_widget (GTK_ITEM_FACTORY(factory),
-                                      _("/Backup..."));
-  if (item)
-    add_selection_sensitive_widget (editor, item,
-				    keyring_editor_has_private_selected);
+  action_group = gtk_action_group_new ("MenuActions");
+  gtk_action_group_add_actions (action_group, entries, G_N_ELEMENTS (entries),
+				editor);
+  gtk_action_group_add_radio_actions (action_group, radio_entries,
+				      G_N_ELEMENTS (radio_entries),
+				      detailed ? 1 : 0,
+				      G_CALLBACK (keyring_set_listing_cb),
+				      (gpointer) editor);
+  gtk_action_group_add_actions (action_group, gpa_help_menu_action_entries,
+				G_N_ELEMENTS (gpa_help_menu_action_entries),
+				editor->window);
+  gtk_action_group_add_actions (action_group, gpa_windows_menu_action_entries,
+				G_N_ELEMENTS (gpa_windows_menu_action_entries),
+				editor->window);
+  gtk_action_group_add_actions
+    (action_group, gpa_preferences_menu_action_entries,
+     G_N_ELEMENTS (gpa_preferences_menu_action_entries), editor->window);
+  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 (editor->window), accel_group);
+  if (! gtk_ui_manager_add_ui_from_string (ui_manager, ui_description,
+					   -1, &error))
+    {
+      g_message ("building keyring menus failed: %s", error->message);
+      g_error_free (error);
+      exit (EXIT_FAILURE);
+    }
 
-  return gtk_item_factory_get_widget (factory, "<main>");
+  /* Fixup the icon theme labels which are too long for the toolbar.  */
+  action = gtk_action_group_get_action (action_group, "KeysEditPrivateKey");
+  g_object_set (action, "short_label", _("Edit"), NULL);
+  action = gtk_action_group_get_action (action_group, "KeysDelete");
+  g_object_set (action, "short_label", _("Delete"), NULL);
+  action = gtk_action_group_get_action (action_group, "KeysSign");
+  g_object_set (action, "short_label", _("Sign"), NULL);
+  action = gtk_action_group_get_action (action_group, "KeysExport");
+  g_object_set (action, "short_label", _("Export"), NULL);
+  action = gtk_action_group_get_action (action_group, "KeysImport");
+  g_object_set (action, "short_label", _("Import"), NULL);
+  action = gtk_action_group_get_action (action_group, "WindowsFileManager");
+  g_object_set (action, "short_label", _("Files"), NULL);
+
+  /* Take care of sensitiveness of widgets.  */
+  action = gtk_action_group_get_action (action_group, "EditCopy");
+  add_selection_sensitive_action (editor, action,
+                                  keyring_editor_has_selection);
+  action = gtk_action_group_get_action (action_group, "KeysDelete");
+  add_selection_sensitive_action (editor, action,
+                                  keyring_editor_has_selection);
+  action = gtk_action_group_get_action (action_group, "KeysExport");
+  add_selection_sensitive_action (editor, action,
+                                  keyring_editor_has_selection);
+
+  action = gtk_action_group_get_action (action_group, "ServerSend");
+  add_selection_sensitive_action (editor, action,
+				  keyring_editor_has_single_selection);
+
+  action = gtk_action_group_get_action (action_group, "KeysSetOwnerTrust");
+  add_selection_sensitive_action (editor, action,
+				  keyring_editor_has_single_selection_OpenPGP);
+
+  action = gtk_action_group_get_action (action_group, "KeysSign");
+  add_selection_sensitive_action (editor, action,
+				  keyring_editor_can_sign);
+
+  action = gtk_action_group_get_action (action_group, "KeysEditPrivateKey");
+  add_selection_sensitive_action (editor, action,
+                                  keyring_editor_has_private_selected);
+  action = gtk_action_group_get_action (action_group, "KeysBackup");
+  add_selection_sensitive_action (editor, action,
+                                  keyring_editor_has_private_selected);
+
+  *menu = gtk_ui_manager_get_widget (ui_manager, "/MainMenu");
+  *toolbar = gtk_ui_manager_get_widget (ui_manager, "/ToolBar");
+  gpa_toolbar_set_homogeneous (GTK_TOOLBAR (*toolbar), FALSE);
+
+  *popup = gtk_ui_manager_get_widget (ui_manager, "/PopupMenu");
 }
 
 
@@ -1457,220 +1525,6 @@
 }
 
 
-/* Change the keylist to brief listing.  */
-static void
-keyring_set_brief_listing (GtkWidget *widget, gpointer param)
-{
-  GPAKeyringEditor *editor = param;
-
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
-    {
-      gpa_keylist_set_brief (editor->keylist);
-      gpa_options_set_detailed_view (gpa_options_get_instance (), FALSE);
-    }
-}
-
-
-/* Change the keylist to detailed listing.  */
-static void
-keyring_set_detailed_listing (GtkWidget *widget, gpointer param)
-{
-  GPAKeyringEditor *editor = param;
-
-  if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
-    {
-      gpa_keylist_set_detailed (editor->keylist);
-      gpa_options_set_detailed_view (gpa_options_get_instance (), TRUE);
-    }
-}
-
-
-static void
-toolbar_edit_key (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_edit (param);
-}
-
-
-static void
-toolbar_remove_key (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_delete (param);
-}
-
-
-static void
-toolbar_sign_key (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_sign (param);
-}
-
-
-static void
-toolbar_export_keys (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_export (param);
-}
-
-
-static void
-toolbar_import_keys (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_import (param);
-}
-
-
-static void
-toolbar_preferences (GtkWidget *widget, gpointer param)
-{
-  gpa_open_settings_dialog ();
-}
-
-
-static void
-toolbar_refresh (GtkWidget *widget, gpointer param)
-{
-  keyring_editor_refresh (param);
-}
-
-
-static GtkWidget *
-keyring_toolbar_new (GtkWidget *window, GPAKeyringEditor *editor)
-{
-  GtkWidget *toolbar;
-  GtkWidget *icon;
-  GtkWidget *item;
-  GtkWidget *button;
-  GtkWidget *view_b;
-  GtkWidget *view_d;
-
-  toolbar = gtk_toolbar_new ();
-  gtk_toolbar_set_icon_size (GTK_TOOLBAR (toolbar),
-                             GTK_ICON_SIZE_LARGE_TOOLBAR);
-  
-  icon = gpa_create_icon_widget (window, "edit");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Edit"),
-                                  _("Edit the selected private key"),
-                                  _("edit key"), icon,
-                                  GTK_SIGNAL_FUNC (toolbar_edit_key),
-                                  editor);
-  add_selection_sensitive_widget (editor, item,
-                                  keyring_editor_has_private_selected);
-
-  
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_DELETE,
-                                   _("Remove the selected key"),
-                                   _("remove key"),
-                                   GTK_SIGNAL_FUNC (toolbar_remove_key),
-                                   editor, -1);
-  add_selection_sensitive_widget (editor, item,
-                                  keyring_editor_has_selection);
-
-  icon = gpa_create_icon_widget (window, "sign");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Sign"),
-                                  _("Sign the selected key"), _("sign key"),
-                                  icon, GTK_SIGNAL_FUNC (toolbar_sign_key),
-                                  editor);
-  add_selection_sensitive_widget (editor, item,
-                                  keyring_editor_can_sign);
-  
-  icon = gpa_create_icon_widget (window, "import");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Import"),
-                                  _("Import Keys"), _("import keys"),
-                                  icon, GTK_SIGNAL_FUNC (toolbar_import_keys),
-                                  editor);
-
-  icon = gpa_create_icon_widget (window, "export");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Export"),
-                                  _("Export Keys"), _("export keys"),
-                                  icon, GTK_SIGNAL_FUNC (toolbar_export_keys),
-                                  editor);
-  add_selection_sensitive_widget (editor, item,
-                                  keyring_editor_has_selection);
-
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
-
-  button = gtk_radio_button_new (NULL);
-  icon = gpa_create_icon_widget (window, "brief");
-  view_b = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
-                                       GTK_TOOLBAR_CHILD_RADIOBUTTON, button,
-                                       _("Brief"), _("Show Brief Keylist"),
-                                       _("brief"), icon,
-                                       GTK_SIGNAL_FUNC (keyring_set_brief_listing),
-                                       editor);
-  /*gtk_signal_handler_block_by_data (GTK_OBJECT (item), editor);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
-  gtk_signal_handler_unblock_by_data (GTK_OBJECT (item), editor);*/
-
-  button = gtk_radio_button_new_from_widget (GTK_RADIO_BUTTON (button));
-  icon = gpa_create_icon_widget (window, "detailed");
-  view_d = gtk_toolbar_append_element (GTK_TOOLBAR (toolbar),
-                                       GTK_TOOLBAR_CHILD_RADIOBUTTON, button,
-                                       _("Detailed"), _("Show Key Details"),
-                                       _("detailed"), icon,
-                                       GTK_SIGNAL_FUNC (keyring_set_detailed_listing),
-                                       editor);
-   /* Set brief or detailed button active according to option */
-   if (gpa_options_get_detailed_view (gpa_options_get_instance()) )
-     {
-       item = view_d;
-     }
-   else
-     {
-       item = view_b;
-     }
-   gtk_signal_handler_block_by_data (GTK_OBJECT (item), editor);
-   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
-   gtk_signal_handler_unblock_by_data (GTK_OBJECT (item), editor);
- 
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), 
-                                   GTK_STOCK_PREFERENCES,
-                                   _("Open the preferences dialog"),
-                                   _("preferences"),
-                                   GTK_SIGNAL_FUNC (toolbar_preferences),
-                                   editor, -1);
-
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
-  item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), GTK_STOCK_REFRESH,
-                                   _("Refresh the keyring"),
-                                   _("refresh keyring"),
-                                   GTK_SIGNAL_FUNC (toolbar_refresh),
-                                   editor, -1);
-
-  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
-
-  icon = gtk_image_new_from_stock ("gtk-directory",
-				   GTK_ICON_SIZE_SMALL_TOOLBAR);
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Files"),
-				  _("Open the file manager"),
-				  _("file manager"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_filemanager),
-				  NULL);
-
-  /* FIXME: Should be just the clipboard icon.  */
-  icon = gtk_image_new_from_stock ("gtk-paste",
-				   GTK_ICON_SIZE_SMALL_TOOLBAR);
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Clipboard"),
-				  _("Open the clipboard"),
-				  _("clipboard"), icon,
-				  GTK_SIGNAL_FUNC (gpa_open_clipboard),
-				  NULL);
-
-#if 0  /* Help is not available yet. :-( */
-  icon = gpa_create_icon_widget (window, "help");
-  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Help"),
-                                  _("Understanding the GNU Privacy Assistant"),
-                                  _("help"), icon, GTK_SIGNAL_FUNC (help_help),
-                                  NULL);
-#endif
-
-  return toolbar;
-}
-
 
 /* Status bar handling.  */
 static GtkWidget *
@@ -1784,7 +1638,7 @@
   /* Update the status bar and the selection sensitive widgets because
      some depend on the default key.  */
   keyring_update_status_bar (editor);
-  update_selection_sensitive_widgets (editor);
+  update_selection_sensitive_actions (editor);
 }
 
 
@@ -1816,6 +1670,7 @@
   GtkWidget *scrolled;
   GtkWidget *keylist;
   GtkWidget *notebook;
+  GtkWidget *menubar;
   GtkWidget *toolbar;
   GtkWidget *hbox;
   GtkWidget *icon;
@@ -1825,7 +1680,7 @@
   gchar *markup;
 
   editor = g_malloc (sizeof (GPAKeyringEditor));
-  editor->selection_sensitive_widgets = NULL;
+  editor->selection_sensitive_actions = NULL;
   editor->details_idle_id = 0;
 
   window = editor->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@@ -1833,7 +1688,7 @@
                         _("GNU Privacy Assistant - Keyring Editor"));
   gtk_object_set_data_full (GTK_OBJECT (window), "user_data", editor,
                             keyring_editor_destroy);
-  gtk_window_set_default_size (GTK_WINDOW (window), 600, 600);
+  gtk_window_set_default_size (GTK_WINDOW (window), 680, 600);
   accel_group = gtk_accel_group_new ();
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
   gtk_signal_connect_object (GTK_OBJECT (window), "map",
@@ -1845,14 +1700,11 @@
   vbox = gtk_vbox_new (FALSE, 0);
   gtk_container_add (GTK_CONTAINER (window), vbox);
 
-  gtk_box_pack_start (GTK_BOX (vbox),
-                      keyring_editor_menubar_new (window, editor),
-                      FALSE, TRUE, 0);
-
-  toolbar = keyring_toolbar_new (window, editor);
+  keyring_editor_action_new (editor, &menubar, &toolbar,
+			     &editor->popup_menu);
+  gtk_box_pack_start (GTK_BOX (vbox), menubar, FALSE, TRUE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
 
-
   /* 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);
@@ -1895,7 +1747,6 @@
 		    "changed", G_CALLBACK (keyring_editor_selection_changed),
 		    (gpointer) editor);
 
-  editor->popup_menu = keyring_editor_popup_menu_new (window, editor);
   g_signal_connect_swapped (GTK_OBJECT (keylist), "button_press_event",
                             G_CALLBACK (display_popup_menu), editor);
 
@@ -1913,7 +1764,7 @@
                     (GCallback) keyring_ui_mode_changed, editor);
 
   keyring_update_status_bar (editor);
-  update_selection_sensitive_widgets (editor);
+  update_selection_sensitive_actions (editor);
   keyring_update_details_notebook (editor);
 
   editor->current_key = NULL;

Modified: trunk/src/server.c
===================================================================
--- trunk/src/server.c	2008-03-27 22:08:35 UTC (rev 865)
+++ trunk/src/server.c	2008-03-28 06:02:31 UTC (rev 866)
@@ -707,7 +707,7 @@
 static int
 cmd_start_keymanager (assuan_context_t ctx, char *line)
 {
-  gpa_open_keyring_editor ();
+  gpa_open_keyring_editor (NULL, NULL);
 
   return assuan_process_done (ctx, 0);
 }



More information about the Gpa-commits mailing list