=== added directory 'b/data'
=== added file 'b/data/Makefile.am'
--- /dev/null	
+++ b/data/Makefile.am	
@@ -0,0 +1,9 @@
+
+uidir = $(uidatadir)
+ui_DATA = 			\
+	display-ui.xml	\
+	toolbox-ui.xml	\
+	popup-ui.xml
+
+EXTRA_DIST = \
+	$(ui_DATA)

=== added file 'b/data/display-ui.xml'
--- /dev/null	
+++ b/data/display-ui.xml	
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ui>
+	<menubar name="DisplayMenu">
+		<menu name="File" action="File">
+			<menuitem name="FileNew" action="FileNew" />
+			<menuitem name="FileOpen" action="FileOpen" />
+			<separator name="FileSep1" />
+			<menuitem name="FileSave" action="FileSave" />
+			<menuitem name="FileSaveas" action="FileSaveas" />
+			<menuitem name="FileExport" action="FileExport" />
+			<separator name="FileSep2 "/>
+			<menuitem name="FilePagesetup" action="FilePagesetup" />
+			<menuitem name="FilePrint" action="FilePrint" />
+			<separator name="FileSep3" />
+			<menuitem name="FileClose" action="FileClose" />
+			<menuitem name="FileQuit" action="FileQuit" />
+		</menu>
+		<menu name="Edit" action="Edit">
+			<menuitem name="EditUndo" action="EditUndo" />
+			<menuitem name="EditRedo" action="EditRedo" />
+			<separator name="EditSep1" />
+			<menuitem name="EditCopy" action="EditCopy" />
+			<menuitem name="EditCut" action="EditCut" />
+			<menuitem name="EditPaste" action="EditPaste" />
+			<menuitem name="EditDuplicate" action="EditDuplicate" />
+			<menuitem name="EditDelete" action="EditDelete" />
+			<separator name="EditSep2" />
+			<menuitem name="EditCopytext" action="EditCopytext" />
+			<menuitem name="EditCuttext" action="EditCuttext" />
+			<menuitem name="EditPastetext" action="EditPastetext" />
+		</menu>
+		<menu name="Diagram" action="Diagram">
+			<menuitem name="DiagramProperties" action="DiagramProperties" />
+			<menuitem name="DiagramLayers" action="DiagramLayers" />
+		</menu>
+		<menu name="View" action="View">
+			<menuitem name="ViewZoomin" action="ViewZoomin" />
+			<menuitem name="ViewZoomout" action="ViewZoomout" />
+			<menu name="ViewZoom" action="ViewZoom">
+				<menuitem name="ViewZoom16000" action="ViewZoom16000" />
+				<menuitem name="ViewZoom8000" action="ViewZoom8000" />
+				<menuitem name="ViewZoom4000" action="ViewZoom4000" />
+				<menuitem name="ViewZoom2830" action="ViewZoom2830" />
+				<menuitem name="ViewZoom2000" action="ViewZoom2000" />
+				<menuitem name="ViewZoom1410" action="ViewZoom1410" />
+				<menuitem name="ViewZoom1000" action="ViewZoom1000" />
+				<menuitem name="ViewZoom850" action="ViewZoom850" />
+				<menuitem name="ViewZoom707" action="ViewZoom707" />
+				<menuitem name="ViewZoom500" action="ViewZoom500" />
+				<menuitem name="ViewZoom354" action="ViewZoom354" />
+				<menuitem name="ViewZoom250" action="ViewZoom250" />
+			</menu>
+			<separator name="ViewSep1" />
+			<menuitem name="ViewFullscreen" action="ViewFullscreen" />
+			<menuitem name="ViewAntialiased" action="ViewAntialiased" />
+			<menuitem name="ViewShowgrid" action="ViewShowgrid" />
+			<menuitem name="ViewSnaptogrid" action="ViewSnaptogrid" />
+			<menuitem name="ViewSnaptoobjects" action="ViewSnaptoobjects" />
+			<menuitem name="ViewShowrulers" action="ViewShowrulers" />
+			<menuitem name="ViewShowconnectionpoints" action="ViewShowconnectionpoints" />
+			<separator name="ViewSep2" />
+			<menuitem name="ViewNewview" action="ViewNewview" />
+			<menuitem name="ViewCloneview" action="ViewCloneview" />
+			<menuitem name="ViewShowall" action="ViewShowall" />
+			<menuitem name="ViewRedraw" action="ViewRedraw" />
+		</menu>
+		<menu name="Objects" action="Objects">
+			<menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
+			<menuitem name="ObjectsBringtofront" action="ObjectsBringtofront" />
+			<menuitem name="ObjectsSendbackwards" action="ObjectsSendbackwards" />
+			<menuitem name="ObjectsBringforwards" action="ObjectsBringforwards" />
+			<separator name="ObjectsSep1" />
+			<menuitem name="ObjectsGroup" action="ObjectsGroup" />
+			<menuitem name="ObjectsUngroup" action="ObjectsUngroup" />
+			<separator name="ObjectsSep2" />
+			<menuitem name="ObjectsParent" action="ObjectsParent" />
+			<menuitem name="ObjectsUnparent" action="ObjectsUnparent" />
+			<menuitem name="ObjectsUnparentchildren" action="ObjectsUnparentchildren" />
+			<separator name="ObjectsSep3" />
+			<menu name="ObjectsAlign" action="ObjectsAlign">
+				<menuitem name="ObjectsAlignLeft" action="ObjectsAlignLeft" />
+				<menuitem name="ObjectsAlignCenter" action="ObjectsAlignCenter" />
+				<menuitem name="ObjectsAlignRight" action="ObjectsAlignRight" />
+				<separator name="ObjectsAlignSep1" />
+				<menuitem name="ObjectsAlignTop" action="ObjectsAlignTop" />
+				<menuitem name="ObjectsAlignMiddle" action="ObjectsAlignMiddle" />
+				<menuitem name="ObjectsAlignBottom" action="ObjectsAlignBottom" />
+				<separator name="ObjectsAlignSep2" />
+				<menuitem name="ObjectsAlignSpreadouthorizontally" action="ObjectsAlignSpreadouthorizontally" />
+				<menuitem name="ObjectsAlignSpreadoutvertically" action="ObjectsAlignSpreadoutvertically" />
+				<menuitem name="ObjectsAlignAdjacent" action="ObjectsAlignAdjacent" />
+				<menuitem name="ObjectsAlignStacked" action="ObjectsAlignStacked" />
+			</menu>
+			<separator name="ObjectsSep4" />
+			<menuitem name="ObjectsProperties" action="ObjectsProperties" />
+		</menu>
+		<menu name="Select" action="Select">
+			<menuitem name="SelectAll" action="SelectAll" />
+			<menuitem name="SelectNone" action="SelectNone" />
+			<menuitem name="SelectInvert" action="SelectInvert" />
+			<separator name="SelectSep1" />
+			<menuitem name="SelectTransitive" action="SelectTransitive" />
+			<menuitem name="SelectConnected" action="SelectConnected" />
+			<menuitem name="SelectSametype" action="SelectSametype" />
+			<separator name="SelectSep2" />
+			<menuitem name="SelectReplace" action="SelectReplace" />
+			<menuitem name="SelectUnion" action="SelectUnion" />
+			<menuitem name="SelectIntersection" action="SelectIntersection" />
+			<menuitem name="SelectRemove" action="SelectRemove" />
+			<menuitem name="SelectInverse" action="SelectInverse" />
+			<separator name="SelectSep3" />
+		</menu>
+		<menu name="Tools" action="Tools">
+			<menuitem name="ToolsModify" action="ToolsModify" />
+			<menuitem name="ToolsMagnify" action="ToolsMagnify" />
+			<menuitem name="ToolsScroll" action="ToolsScroll" />
+			<menuitem name="ToolsText" action="ToolsText" />
+			<menuitem name="ToolsBox" action="ToolsBox" />
+			<menuitem name="ToolsEllipse" action="ToolsEllipse" />
+			<menuitem name="ToolsPolygon" action="ToolsPolygon" />
+			<menuitem name="ToolsBeziergon" action="ToolsBeziergon" />
+			<separator name="ToolsSep1" />
+			<menuitem name="ToolsLine" action="ToolsLine" />
+			<menuitem name="ToolsArc" action="ToolsArc" />
+			<menuitem name="ToolsZigzagline" action="ToolsZigzagline" />
+			<menuitem name="ToolsPolyline" action="ToolsPolyline" />
+			<menuitem name="ToolsBezierline" action="ToolsBezierline" />
+			<separator name="ToolsSep1" />
+			<menuitem name="ToolsImage" action="ToolsImage" />
+		</menu>
+		<menu name="InputMethods" action="InputMethods">
+		</menu>
+		<menu name="Help" action="Help">
+			<menuitem name="HelpContents" action="HelpContents" />
+			<separator name="HelpExtensionStart" expand="true" />
+			<separator name="HelpExtensionEnd" expand="true" />
+			<menuitem name="HelpAbout" action="HelpAbout" />
+		</menu>
+	</menubar>
+</ui>

=== added file 'b/data/popup-ui.xml'
--- /dev/null	
+++ b/data/popup-ui.xml	
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ui>
+	<popup name="DisplayPopup">
+		<menu name="File" action="File">
+			<menuitem name="FileNew" action="FileNew" />
+			<menuitem name="FileOpen" action="FileOpen" />
+			<separator name="FileSep1" />
+			<menuitem name="FileSave" action="FileSave" />
+			<menuitem name="FileSaveas" action="FileSaveas" />
+			<menuitem name="FileExport" action="FileExport" />
+			<separator name="FileSep2 "/>
+			<menuitem name="FilePagesetup" action="FilePagesetup" />
+			<menuitem name="FilePrint" action="FilePrint" />
+			<separator name="FileSep3" />
+			<menuitem name="FileClose" action="FileClose" />
+			<menuitem name="FileQuit" action="FileQuit" />
+		</menu>
+		<menu name="Edit" action="Edit">
+			<menuitem name="EditUndo" action="EditUndo" />
+			<menuitem name="EditRedo" action="EditRedo" />
+			<separator name="EditSep1" />
+			<menuitem name="EditCopy" action="EditCopy" />
+			<menuitem name="EditCut" action="EditCut" />
+			<menuitem name="EditPaste" action="EditPaste" />
+			<menuitem name="EditDuplicate" action="EditDuplicate" />
+			<menuitem name="EditDelete" action="EditDelete" />
+			<separator name="EditSep2" />
+			<menuitem name="EditCopytext" action="EditCopytext" />
+			<menuitem name="EditCuttext" action="EditCuttext" />
+			<menuitem name="EditPastetext" action="EditPastetext" />
+		</menu>
+		<menu name="Diagram" action="Diagram">
+			<menuitem name="DiagramProperties" action="DiagramProperties" />
+			<menuitem name="DiagramLayers" action="DiagramLayers" />
+		</menu>
+		<menu name="View" action="View">
+			<menuitem name="ViewZoomin" action="ViewZoomin" />
+			<menuitem name="ViewZoomout" action="ViewZoomout" />
+			<menu name="ViewZoom" action="ViewZoom">
+				<menuitem name="ViewZoom16000" action="ViewZoom16000" />
+				<menuitem name="ViewZoom8000" action="ViewZoom8000" />
+				<menuitem name="ViewZoom4000" action="ViewZoom4000" />
+				<menuitem name="ViewZoom2830" action="ViewZoom2830" />
+				<menuitem name="ViewZoom2000" action="ViewZoom2000" />
+				<menuitem name="ViewZoom1410" action="ViewZoom1410" />
+				<menuitem name="ViewZoom1000" action="ViewZoom1000" />
+				<menuitem name="ViewZoom850" action="ViewZoom850" />
+				<menuitem name="ViewZoom707" action="ViewZoom707" />
+				<menuitem name="ViewZoom500" action="ViewZoom500" />
+				<menuitem name="ViewZoom354" action="ViewZoom354" />
+				<menuitem name="ViewZoom250" action="ViewZoom250" />
+			</menu>
+			<separator name="ViewSep1" />
+			<menuitem name="ViewFullscreen" action="ViewFullscreen" />
+			<menuitem name="ViewAntialiased" action="ViewAntialiased" />
+			<menuitem name="ViewShowgrid" action="ViewShowgrid" />
+			<menuitem name="ViewSnaptogrid" action="ViewSnaptogrid" />
+			<menuitem name="ViewSnaptoobjects" action="ViewSnaptoobjects" />
+			<menuitem name="ViewShowrulers" action="ViewShowrulers" />
+			<menuitem name="ViewShowconnectionpoints" action="ViewShowconnectionpoints" />
+			<separator name="ViewSep2" />
+			<menuitem name="ViewNewview" action="ViewNewview" />
+			<menuitem name="ViewCloneview" action="ViewCloneview" />
+			<menuitem name="ViewShowall" action="ViewShowall" />
+			<menuitem name="ViewRedraw" action="ViewRedraw" />
+		</menu>
+		<menu name="Objects" action="Objects">
+			<menuitem name="ObjectsSendtoback" action="ObjectsSendtoback" />
+			<menuitem name="ObjectsBringtofront" action="ObjectsBringtofront" />
+			<menuitem name="ObjectsSendbackwards" action="ObjectsSendbackwards" />
+			<menuitem name="ObjectsBringforwards" action="ObjectsBringforwards" />
+			<separator name="ObjectsSep1" />
+			<menuitem name="ObjectsGroup" action="ObjectsGroup" />
+			<menuitem name="ObjectsUngroup" action="ObjectsUngroup" />
+			<separator name="ObjectsSep2" />
+			<menuitem name="ObjectsParent" action="ObjectsParent" />
+			<menuitem name="ObjectsUnparent" action="ObjectsUnparent" />
+			<menuitem name="ObjectsUnparentchildren" action="ObjectsUnparentchildren" />
+			<separator name="ObjectsSep3" />
+			<menu name="ObjectsAlign" action="ObjectsAlign">
+				<menuitem name="ObjectsAlignLeft" action="ObjectsAlignLeft" />
+				<menuitem name="ObjectsAlignCenter" action="ObjectsAlignCenter" />
+				<menuitem name="ObjectsAlignRight" action="ObjectsAlignRight" />
+				<separator name="ObjectsAlignSep1" />
+				<menuitem name="ObjectsAlignTop" action="ObjectsAlignTop" />
+				<menuitem name="ObjectsAlignMiddle" action="ObjectsAlignMiddle" />
+				<menuitem name="ObjectsAlignBottom" action="ObjectsAlignBottom" />
+				<separator name="ObjectsAlignSep2" />
+				<menuitem name="ObjectsAlignSpreadouthorizontally" action="ObjectsAlignSpreadouthorizontally" />
+				<menuitem name="ObjectsAlignSpreadoutvertically" action="ObjectsAlignSpreadoutvertically" />
+				<menuitem name="ObjectsAlignAdjacent" action="ObjectsAlignAdjacent" />
+				<menuitem name="ObjectsAlignStacked" action="ObjectsAlignStacked" />
+			</menu>
+			<separator name="ObjectsSep4" />
+			<menuitem name="ObjectsProperties" action="ObjectsProperties" />
+		</menu>
+		<menu name="Select" action="Select">
+			<menuitem name="SelectAll" action="SelectAll" />
+			<menuitem name="SelectNone" action="SelectNone" />
+			<menuitem name="SelectInvert" action="SelectInvert" />
+			<separator name="SelectSep1" />
+			<menuitem name="SelectTransitive" action="SelectTransitive" />
+			<menuitem name="SelectConnected" action="SelectConnected" />
+			<menuitem name="SelectSametype" action="SelectSametype" />
+			<separator name="SelectSep2" />
+			<menuitem name="SelectReplace" action="SelectReplace" />
+			<menuitem name="SelectUnion" action="SelectUnion" />
+			<menuitem name="SelectIntersection" action="SelectIntersection" />
+			<menuitem name="SelectRemove" action="SelectRemove" />
+			<menuitem name="SelectInverse" action="SelectInverse" />
+			<separator name="SelectSep3" />
+		</menu>
+		<menu name="Tools" action="Tools">
+			<menuitem name="ToolsModify" action="ToolsModify" />
+			<menuitem name="ToolsMagnify" action="ToolsMagnify" />
+			<menuitem name="ToolsScroll" action="ToolsScroll" />
+			<menuitem name="ToolsText" action="ToolsText" />
+			<menuitem name="ToolsBox" action="ToolsBox" />
+			<menuitem name="ToolsEllipse" action="ToolsEllipse" />
+			<menuitem name="ToolsPolygon" action="ToolsPolygon" />
+			<menuitem name="ToolsBeziergon" action="ToolsBeziergon" />
+			<separator name="ToolsSep1" />
+			<menuitem name="ToolsLine" action="ToolsLine" />
+			<menuitem name="ToolsArc" action="ToolsArc" />
+			<menuitem name="ToolsZigzagline" action="ToolsZigzagline" />
+			<menuitem name="ToolsPolyline" action="ToolsPolyline" />
+			<menuitem name="ToolsBezierline" action="ToolsBezierline" />
+			<separator name="ToolsSep1" />
+			<menuitem name="ToolsImage" action="ToolsImage" />
+		</menu>
+		<menu name="InputMethods" action="InputMethods">
+		</menu>
+		<menu name="Help" action="Help">
+			<menuitem name="HelpContents" action="HelpContents" />
+			<separator name="HelpExtensionStart" expand="true" />
+			<separator name="HelpExtensionEnd" expand="true" />
+			<menuitem name="HelpAbout" action="HelpAbout" />
+		</menu>
+	</popup>
+</ui>

=== added file 'b/data/toolbox-ui.xml'
--- /dev/null	
+++ b/data/toolbox-ui.xml	
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ui>
+	<menubar name="ToolboxMenu">
+		<menu name="File" action="File">
+			<menuitem name="FileNew" action="FileNew" />
+			<menuitem name="FileOpen" action="FileOpen" />
+			<separator name="FileSep1" />
+			<menuitem name="FileTree" action="FileTree" />
+			<menuitem name="FileSheets" action="FileSheets" />
+			<separator name="FileSep2 "/>
+			<menuitem name="FilePrefs" action="FilePrefs" />
+			<menuitem name="FilePlugins" action="FilePlugins" />
+			<separator name="FileRecentStart"/>
+			<separator name="FileRecentEnd" />
+			<menuitem name="FileQuit" action="FileQuit" />
+		</menu>
+		<menu name="Help" action="Help">
+			<menuitem name="HelpContents" action="HelpContents" />
+			<separator name="HelpExtensionStart" expand="true" />
+			<separator name="HelpExtensionEnd" expand="true" />
+			<menuitem name="HelpAbout" action="HelpAbout" />
+		</menu>
+	</menubar>
+</ui>

=== modified file 'a/Makefile.am'
--- a/Makefile.am	
+++ b/Makefile.am	
@@ -1,6 +1,6 @@
 ## Process this file with automake to produce Makefile.in
 
-SUBDIRS = lib objects plug-ins shapes app samples po sheets doc
+SUBDIRS = lib objects plug-ins shapes app samples po sheets data doc
 
 gnomedatadir = $(datadir)
 

=== modified file 'a/app/Makefile.am'
--- a/app/Makefile.am	
+++ b/app/Makefile.am	
@@ -9,11 +9,12 @@
 	$(DEBUG_FLAGS) \
 	$(GTK_CFLAGS) \
 	$(LIBART_CFLAGS) \
-        -DPREFIX=\""$(prefix)"\" \
-        -DSYSCONFDIR=\""$(sysconfdir)"\" \
-        -DDATADIR=\""$(datadir)"\" \
-        -DLIBDIR=\""$(libdir)"\" \
-	-DLOCALEDIR=\"$(localedir)\"
+	-DPREFIX=\""$(prefix)"\" \
+	-DSYSCONFDIR=\""$(sysconfdir)"\" \
+	-DDATADIR=\""$(datadir)"\" \
+	-DLIBDIR=\""$(libdir)"\" \
+	-DLOCALEDIR=\"$(localedir)\" \
+	-DUIDATADIR=\"$(uidatadir)\"
 
 
 print_files = \

=== modified file 'a/app/commands.c'
--- a/app/commands.c	
+++ b/app/commands.c	
@@ -82,13 +82,14 @@
 #include "diagram_tree_window.h"
 #include "authors.h"                /* master contributors data */
 
-void file_quit_callback(gpointer data, guint action, GtkWidget *widget)
+void 
+file_quit_callback (GtkAction *action)
 {
   app_exit();
 }
 
 void
-file_pagesetup_callback(gpointer data, guint action, GtkWidget *widget)
+file_pagesetup_callback (GtkAction *action)
 {
   Diagram *dia;
 
@@ -98,7 +99,7 @@
 }
 
 void
-file_print_callback(gpointer data, guint action, GtkWidget *widget)
+file_print_callback (GtkAction *action)
 {
   Diagram *dia;
 
@@ -114,7 +115,7 @@
 }
 
 void
-file_close_callback(gpointer data, guint action, GtkWidget *widget)
+file_close_callback (GtkAction *action)
 {
   /* some people use tear-off menus and insist to close non existing displays */
   if (ddisplay_active())
@@ -122,7 +123,7 @@
 }
 
 void
-file_new_callback(gpointer data, guint action, GtkWidget *widget)
+file_new_callback (GtkAction *action)
 {
   Diagram *dia;
   DDisplay *ddisp;
@@ -139,14 +140,14 @@
 }
 
 void
-file_preferences_callback(gpointer data, guint action, GtkWidget *widget)
+file_preferences_callback (GtkAction *action)
 {
   prefs_show();
 }
 
 
 void
-edit_copy_callback(gpointer data, guint action, GtkWidget *widget)
+edit_copy_callback (GtkAction *action)
 {
   GList *copy_list;
   DDisplay *ddisp;
@@ -162,7 +163,7 @@
 }
 
 void
-edit_cut_callback(gpointer data, guint action, GtkWidget *widget)
+edit_cut_callback (GtkAction *action)
 {
   GList *cut_list;
   DDisplay *ddisp;
@@ -190,7 +191,7 @@
 }
 
 void
-edit_paste_callback(gpointer data, guint action, GtkWidget *widget)
+edit_paste_callback (GtkAction *action)
 {
   GList *paste_list;
   DDisplay *ddisp;
@@ -241,7 +242,7 @@
  * completely untested, basically it is copy+paste munged together
  */
 void
-edit_duplicate_callback(gpointer data, guint action, GtkWidget *widget)
+edit_duplicate_callback (GtkAction *action)
 { 
   GList *duplicate_list;
   DDisplay *ddisp;
@@ -360,7 +361,7 @@
 
 
 void
-edit_copy_text_callback(gpointer data, guint action, GtkWidget *widget)
+edit_copy_text_callback (GtkAction *action)
 {
   Focus *focus = active_focus();
   DDisplay *ddisp;
@@ -396,7 +397,7 @@
 }
 
 void
-edit_cut_text_callback(gpointer data, guint action, GtkWidget *widget)
+edit_cut_text_callback (GtkAction *action)
 {
   Focus *focus = active_focus();
   DDisplay *ddisp;
@@ -444,7 +445,7 @@
 }
 
 void
-edit_paste_text_callback(gpointer data, guint action, GtkWidget *widget)
+edit_paste_text_callback (GtkAction *action)
 {
   DDisplay *ddisp;
 
@@ -461,7 +462,7 @@
 }
 
 void
-edit_delete_callback(gpointer data, guint action, GtkWidget *widget)
+edit_delete_callback (GtkAction *action)
 {
   GList *delete_list;
   DDisplay *ddisp;
@@ -487,7 +488,7 @@
 } 
 
 void
-edit_undo_callback(gpointer data, guint action, GtkWidget *widget)
+edit_undo_callback (GtkAction *action)
 {
   Diagram *dia;
   
@@ -501,7 +502,7 @@
 } 
 
 void
-edit_redo_callback(gpointer data, guint action, GtkWidget *widget)
+edit_redo_callback (GtkAction *action)
 {
   Diagram *dia;
   
@@ -515,7 +516,7 @@
 } 
 
 void
-help_manual_callback(gpointer data, guint action, GtkWidget *widget)
+help_manual_callback (GtkAction *action)
 {
 #ifdef GNOME
   gnome_help_display("dia", NULL, NULL);
@@ -600,7 +601,7 @@
 }
 
 void
-help_about_callback(gpointer data, guint action, GtkWidget *widget)
+help_about_callback (GtkAction *action)
 {
   const gchar *translators = _("translator_credits-PLEASE_ADD_YOURSELF_HERE");
   const gchar *license = _(
@@ -643,7 +644,7 @@
 }
 
 void
-view_zoom_in_callback(gpointer data, guint action, GtkWidget *widget)
+view_zoom_in_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   Point middle;
@@ -659,7 +660,7 @@
 }
 
 void
-view_zoom_out_callback(gpointer data, guint action, GtkWidget *widget)
+view_zoom_out_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   Point middle;
@@ -675,26 +676,31 @@
 }
 
 void
-view_zoom_set_callback(gpointer data, guint action, GtkWidget *widget)
+view_zoom_set_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   real scale;
   Point middle;
   Rectangle *visible;
-  
-  ddisp = ddisplay_active();
-  if (!ddisp) return;
+  int factor;
+
+  ddisp = ddisplay_active();
+  if (!ddisp) return;
+
+  /* HACK the actual factor is a suffix to the action name */
+  factor = atoi (gtk_action_get_name (action) + strlen ("ViewZoom"));
+
   visible = &ddisp->visible;
   middle.x = visible->left*0.5 + visible->right*0.5;
   middle.y = visible->top*0.5 + visible->bottom*0.5;
 
-  scale = ((real) action)/1000.0 * DDISPLAY_NORMAL_ZOOM;
+  scale = ((real) factor)/1000.0 * DDISPLAY_NORMAL_ZOOM;
 
   ddisplay_zoom(ddisp, &middle, scale / ddisp->zoom_factor);  
 }
 
 void
-view_show_cx_pts_callback(gpointer data, guint action, GtkWidget *widget)
+view_show_cx_pts_callback (GtkToggleAction *action)
 {
   DDisplay *ddisp;
   int old_val;
@@ -703,7 +709,7 @@
   if (!ddisp) return;
 
   old_val = ddisp->show_cx_pts;
-  ddisp->show_cx_pts = GTK_CHECK_MENU_ITEM(widget)->active;
+  ddisp->show_cx_pts = gtk_toggle_action_get_active (action);
   
   if (old_val != ddisp->show_cx_pts) {
     ddisplay_add_update_all(ddisp);
@@ -712,23 +718,23 @@
 }
 
 void 
-view_unfullscreen(void)
-{
-  DDisplay *ddisp;
-  GtkMenuItem *item;
+view_unfullscreen (void)
+{
+  DDisplay *ddisp;
+  GtkToggleAction *item;
 
   ddisp = ddisplay_active();
   if (!ddisp) return;
 
   /* find the menuitem */
-  item = menus_get_item_from_path ("<Display>/View/Fullscreen", NULL);
-  if (item && GTK_CHECK_MENU_ITEM(item)->active) {
-    gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(item), FALSE);
-  }
-}
-
-void
-view_fullscreen_callback(gpointer data, guint action, GtkWidget *widget)
+  item = GTK_TOGGLE_ACTION (menus_get_action ("ViewFullscreen"));
+  if (item && gtk_toggle_action_get_active (item)) {
+    gtk_toggle_action_set_active (item, FALSE);
+  }
+}
+
+void
+view_fullscreen_callback (GtkToggleAction *action)
 {
   DDisplay *ddisp;
   int fs;
@@ -736,7 +742,7 @@
   ddisp = ddisplay_active();
   if (!ddisp) return;
 
-  fs =  GTK_CHECK_MENU_ITEM(widget)->active;
+  fs = gtk_toggle_action_get_active (action);
   
   if (fs) /* it is already toggled */
     gtk_window_fullscreen(GTK_WINDOW(ddisp->shell));
@@ -745,7 +751,7 @@
 }
 
 void
-view_aa_callback(gpointer data, guint action, GtkWidget *widget)
+view_aa_callback (GtkToggleAction *action)
 {
   DDisplay *ddisp;
   int aa;
@@ -753,7 +759,7 @@
   ddisp = ddisplay_active();
   if (!ddisp) return;
  
-  aa =  GTK_CHECK_MENU_ITEM(widget)->active;
+  aa = gtk_toggle_action_get_active (action);
   
   if (aa != ddisp->aa_renderer) {
     ddisplay_set_renderer(ddisp, aa);
@@ -763,7 +769,7 @@
 }
 
 void
-view_visible_grid_callback(gpointer data, guint action, GtkWidget *widget)
+view_visible_grid_callback (GtkToggleAction *action)
 {
   DDisplay *ddisp;
   int old_val;
@@ -772,7 +778,7 @@
   if (!ddisp) return;
   
   old_val = ddisp->grid.visible;
-  ddisp->grid.visible = GTK_CHECK_MENU_ITEM(widget)->active; 
+  ddisp->grid.visible = gtk_toggle_action_get_active (action); 
 
   if (old_val != ddisp->grid.visible) {
     ddisplay_add_update_all(ddisp);
@@ -781,42 +787,36 @@
 }
 
 void
-view_snap_to_grid_callback(gpointer data, guint action, GtkWidget *widget)
-{
-  DDisplay *ddisp;
-
-  ddisp = ddisplay_active();
-  if (!ddisp) return;
-  
-  ddisplay_set_snap_to_grid(ddisp, GTK_CHECK_MENU_ITEM(widget)->active);
-}
-
-void
-view_snap_to_objects_callback(gpointer data, guint action, GtkWidget *widget)
-{
-  DDisplay *ddisp;
-
-  ddisp = ddisplay_active();
-  if (!ddisp) return;
-  
-  ddisplay_set_snap_to_objects(ddisp, GTK_CHECK_MENU_ITEM(widget)->active);
-}
-
-void view_toggle_rulers_callback(gpointer data, guint action, GtkWidget*widget)
-{
-  DDisplay *ddisp;
-  
-  ddisp = ddisplay_active();
-  if (!ddisp) return;
-
-  /* The following is borrowed straight from the Gimp: */
-  
-  /* This routine use promiscuous knowledge of gtk internals
-   *  in order to hide and show the rulers "smoothly". This
-   *  is kludgy and a hack and may break if gtk is changed
-   *  internally.
-   */
-  if (!GTK_CHECK_MENU_ITEM(widget)->active) {
+view_snap_to_grid_callback (GtkToggleAction *action)
+{
+  DDisplay *ddisp;
+
+  ddisp = ddisplay_active();
+  if (!ddisp) return;
+  
+  ddisplay_set_snap_to_grid(ddisp, gtk_toggle_action_get_active (action));
+}
+
+void
+view_snap_to_objects_callback (GtkToggleAction *action)
+{
+  DDisplay *ddisp;
+
+  ddisp = ddisplay_active();
+  if (!ddisp) return;
+  
+  ddisplay_set_snap_to_objects(ddisp, gtk_toggle_action_get_active (action));
+}
+
+void 
+view_toggle_rulers_callback (GtkToggleAction *action)
+{
+  DDisplay *ddisp;
+  
+  ddisp = ddisplay_active();
+  if (!ddisp) return;
+
+  if (!gtk_toggle_action_get_active (action)) {
     if (GTK_WIDGET_VISIBLE (ddisp->origin)) {
       gtk_widget_unmap (ddisp->origin);
       gtk_widget_unmap (ddisp->hrule);
@@ -844,7 +844,7 @@
 }
 
 extern void
-view_new_view_callback(gpointer data, guint action, GtkWidget *widget)
+view_new_view_callback (GtkAction *action)
 {
   Diagram *dia;
 
@@ -855,7 +855,7 @@
 }
 
 extern void
-view_clone_view_callback(gpointer data, guint action, GtkWidget *widget)
+view_clone_view_callback (GtkAction *action)
 {
   DDisplay *ddisp;
 
@@ -866,7 +866,7 @@
 }
 
 void
-view_show_all_callback(gpointer data, guint action, GtkWidget *widget)
+view_show_all_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   Diagram *dia;
@@ -916,7 +916,7 @@
 }
 
 void
-view_redraw_callback(gpointer data, guint action, GtkWidget *widget)
+view_redraw_callback (GtkAction *action)
 {
   DDisplay *ddisp;
   ddisp = ddisplay_active();
@@ -926,7 +926,7 @@
 }
 
 void
-view_diagram_properties_callback(gpointer data, guint action, GtkWidget *widget)
+view_diagram_properties_callback (GtkAction *action)
 {
   DDisplay *ddisp;
 
@@ -937,49 +937,49 @@
 
 
 void
-objects_place_over_callback(gpointer data, guint action, GtkWidget *widget)
+objects_place_over_callback (GtkAction *action)
 {
   diagram_place_over_selected(ddisplay_active_diagram());
 }
 
 void
-objects_place_under_callback(gpointer data, guint action, GtkWidget *widget)
+objects_place_under_callback (GtkAction *action)
 {
   diagram_place_under_selected(ddisplay_active_diagram());
 }
 
 void
-objects_place_up_callback(gpointer data, guint action, GtkWidget *widget)
+objects_place_up_callback (GtkAction *action)
 {
   diagram_place_up_selected(ddisplay_active_diagram());
 }
 
 void
-objects_place_down_callback(gpointer data, guint action, GtkWidget *widget)
+objects_place_down_callback (GtkAction *action)
 {
   diagram_place_down_selected(ddisplay_active_diagram());
 }
 
 void
-objects_parent_callback(gpointer data, guint action, GtkWidget *widget)
+objects_parent_callback (GtkAction *action)
 {
   diagram_parent_selected(ddisplay_active_diagram());
 }
 
 void
-objects_unparent_callback(gpointer data, guint action, GtkWidget *widget)
+objects_unparent_callback (GtkAction *action)
 {
   diagram_unparent_selected(ddisplay_active_diagram());
 }
 
 void
-objects_unparent_children_callback(gpointer data, guint action, GtkWidget *widget)
+objects_unparent_children_callback (GtkAction *action)
 {
   diagram_unparent_children_selected(ddisplay_active_diagram());
 }
 
 void
-objects_group_callback(gpointer data, guint action, GtkWidget *widget)
+objects_group_callback (GtkAction *action)
 {
   DDisplay *ddisp;
 
@@ -990,7 +990,7 @@
 } 
 
 void
-objects_ungroup_callback(gpointer data, guint action, GtkWidget *widget)
+objects_ungroup_callback (GtkAction *action)
 {
   DDisplay *ddisp;
 
@@ -1001,7 +1001,7 @@
 } 
 
 void
-dialogs_properties_callback(gpointer data, guint action, GtkWidget *widget)
+dialogs_properties_callback (GtkAction *action)
 {
   Diagram *dia;
   DiaObject *selected;
@@ -1018,7 +1018,7 @@
 }
 
 void
-dialogs_layers_callback(gpointer data, guint action, GtkWidget *widget)
+dialogs_layers_callback (GtkAction *action)
 {
   layer_dialog_set_diagram(ddisplay_active_diagram());
   layer_dialog_show();
@@ -1026,13 +1026,30 @@
 
 
 void
-objects_align_h_callback(gpointer data, guint action, GtkWidget *widget)
-{
-  int align;
+objects_align_h_callback (GtkAction *action)
+{
+  gchar *a;
+  int align = DIA_ALIGN_LEFT;
   Diagram *dia;
   GList *objects;
 
-  align = action;
+  /* HACK align is suffix to action name */
+  a = gtk_action_get_name (action) + strlen ("ObjectsAlign");
+  if (0 == strcmp ("Left", a)) {
+	align = DIA_ALIGN_LEFT;
+  } 
+  else if (0 == strcmp ("Center", a)) {
+	align = DIA_ALIGN_CENTER;
+  } 
+  else if (0 == strcmp ("Right", a)) {
+	align = DIA_ALIGN_RIGHT;
+  } 
+  else if (0 == strcmp ("Spreadouthorizontally", a)) {
+	align = DIA_ALIGN_EQUAL;
+  } 
+  else if (0 == strcmp ("Adjacent", a)) {
+	align = DIA_ALIGN_ADJACENT;
+  }
 
   dia = ddisplay_active_diagram();
   if (!dia) return;
@@ -1049,13 +1066,30 @@
 }
 
 void
-objects_align_v_callback(gpointer data, guint action, GtkWidget *widget)
-{
+objects_align_v_callback (GtkAction *action)
+{
+  gchar *a;
   int align;
   Diagram *dia;
   GList *objects;
 
-  align = action;
+  /* HACK align is suffix to action name */
+  a = gtk_action_get_name (action) + strlen ("ObjectsAlign");
+  if (0 == strcmp ("Top", a)) {
+	align = DIA_ALIGN_TOP;
+  } 
+  else if (0 == strcmp ("Middle", a)) {
+	align = DIA_ALIGN_CENTER;
+  } 
+  else if (0 == strcmp ("Bottom", a)) {
+	align = DIA_ALIGN_BOTTOM;
+  } 
+  else if (0 == strcmp ("Spreadoutvertically", a)) {
+	align = DIA_ALIGN_EQUAL;
+  } 
+  else if (0 == strcmp ("Stacked", a)) {
+	align = DIA_ALIGN_ADJACENT;
+  } 
 
   dia = ddisplay_active_diagram();
   if (!dia) return;

=== modified file 'a/app/commands.h'
--- a/app/commands.h	
+++ b/app/commands.h	
@@ -20,78 +20,63 @@
 
 #include <gtk/gtk.h>
 
-void file_quit_callback(gpointer data, guint action, GtkWidget *widget);
-void file_pagesetup_callback(gpointer data, guint action, GtkWidget *widget);
-void file_print_callback(gpointer data, guint action, GtkWidget *widget);
-void file_close_callback(gpointer data, guint action, GtkWidget *widget);
-void file_new_callback(gpointer data, guint action, GtkWidget *widget);
-void file_preferences_callback(gpointer data, guint action, GtkWidget *widget);
+void file_quit_callback        (GtkAction *action);
+void file_pagesetup_callback   (GtkAction *action);
+void file_print_callback       (GtkAction *action);
+void file_close_callback       (GtkAction *action);
+void file_new_callback         (GtkAction *action);
+void file_preferences_callback (GtkAction *action);
 
-void help_manual_callback(gpointer data, guint action, GtkWidget *widget);
-void help_about_callback(gpointer data, guint action, GtkWidget *widget);
+void help_manual_callback (GtkAction *action);
+void help_about_callback  (GtkAction *action);
 
-void edit_copy_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_cut_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_paste_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_duplicate_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_delete_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_undo_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_redo_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_paste_text_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_copy_text_callback(gpointer data, guint action, GtkWidget *widget);
-void edit_cut_text_callback(gpointer data, guint action, GtkWidget *widget);
+void edit_copy_callback       (GtkAction *action);
+void edit_cut_callback        (GtkAction *action);
+void edit_paste_callback      (GtkAction *action);
+void edit_duplicate_callback  (GtkAction *action);
+void edit_delete_callback     (GtkAction *action);
+void edit_undo_callback       (GtkAction *action);
+void edit_redo_callback       (GtkAction *action);
+void edit_paste_text_callback (GtkAction *action);
+void edit_copy_text_callback  (GtkAction *action);
+void edit_cut_text_callback   (GtkAction *action);
 
-void received_selection_handler(GtkWidget *widget, GtkSelectionData *selection,
+void received_selection_handler (GtkWidget *widget, GtkSelectionData *selection,
 				gpointer data);
 void get_selection_handler(GtkWidget *widget, GtkSelectionData *selection,
 			   gpointer data);
 
-void view_zoom_in_callback(gpointer data, guint action, GtkWidget *widget);
-void view_zoom_out_callback(gpointer data, guint action, GtkWidget *widget);
+void view_zoom_in_callback         (GtkAction *action);
+void view_zoom_out_callback        (GtkAction *action);
+void view_zoom_set_callback        (GtkAction *action);
+void view_unfullscreen             (void);
+void view_fullscreen_callback      (GtkToggleAction *action);
+void view_aa_callback              (GtkToggleAction *action);
+void view_visible_grid_callback    (GtkToggleAction *action);
+void view_snap_to_grid_callback    (GtkToggleAction *action);
+void view_snap_to_objects_callback (GtkToggleAction *action);
+void view_toggle_rulers_callback   (GtkToggleAction *action);
+void view_show_cx_pts_callback     (GtkToggleAction *action);
+void view_new_view_callback           (GtkAction *action);
+void view_clone_view_callback         (GtkAction *action);
+void view_show_all_callback           (GtkAction *action);
+void view_redraw_callback             (GtkAction *action);
+void view_diagram_properties_callback (GtkAction *action);
 
-void view_zoom_set_callback(gpointer data, guint action, GtkWidget *widget);
+void objects_place_over_callback        (GtkAction *action);
+void objects_place_under_callback       (GtkAction *action);
+void objects_place_up_callback          (GtkAction *action);
+void objects_place_down_callback        (GtkAction *action);
+void objects_parent_callback            (GtkAction *action);
+void objects_unparent_callback          (GtkAction *action);
+void objects_unparent_children_callback (GtkAction *action);
+void objects_group_callback             (GtkAction *action);
+void objects_ungroup_callback           (GtkAction *action);
+void objects_align_h_callback           (GtkAction *action);
+void objects_align_v_callback           (GtkAction *action);
 
-void view_unfullscreen(void);
-void view_fullscreen_callback(gpointer data, guint action, GtkWidget *widget);
+void dialogs_properties_callback (GtkAction *action);
+void dialogs_layers_callback     (GtkAction *action);
 
-void view_aa_callback(gpointer data, guint action, GtkWidget *widget);
-void view_visible_grid_callback (gpointer data, guint action,
-				 GtkWidget *widget);
-void view_snap_to_grid_callback (gpointer data, guint action,
-				 GtkWidget *widget);
-void view_snap_to_objects_callback(gpointer data, guint action,
-				   GtkWidget *widget);
-void view_toggle_rulers_callback(gpointer data, guint action,
-				 GtkWidget *widget);
-void view_show_cx_pts_callback  (gpointer data, guint action,
-				 GtkWidget *widget);
-
-void view_new_view_callback(gpointer data, guint action, GtkWidget *widget);
-void view_clone_view_callback(gpointer data, guint action, GtkWidget *widget);
-void view_show_all_callback(gpointer data, guint action, GtkWidget *widget);
-void view_redraw_callback(gpointer data, guint action, GtkWidget *widget);
-void view_diagram_properties_callback(gpointer data, guint action,
-				      GtkWidget *widget);
-
-void objects_place_over_callback(gpointer data, guint action,
-				 GtkWidget *widget);
-void objects_place_under_callback(gpointer data, guint action,
-				  GtkWidget *widget);
-void objects_place_up_callback(gpointer data, guint action,
-				 GtkWidget *widget);
-void objects_place_down_callback(gpointer data, guint action,
-				  GtkWidget *widget);
-void objects_parent_callback(gpointer data, guint action, GtkWidget *widget);
-void objects_unparent_callback(gpointer data, guint action, GtkWidget *widget);
-void objects_unparent_children_callback(gpointer data, guint action, GtkWidget *widget);
-void objects_group_callback(gpointer data, guint action, GtkWidget *widget);
-void objects_ungroup_callback(gpointer data, guint action, GtkWidget *widget);
-
-void dialogs_properties_callback(gpointer data, guint action,
-				 GtkWidget *widget);
-void dialogs_layers_callback(gpointer data, guint action, GtkWidget *widget);
-
-void objects_align_h_callback(gpointer data, guint action, GtkWidget *widget);
-void objects_align_v_callback(gpointer data, guint action, GtkWidget *widget);
 
 #endif /* COMMANDS_H */

=== modified file 'a/app/dia_embedd.c'
--- a/app/dia_embedd.c	
+++ b/app/dia_embedd.c	
@@ -378,24 +378,25 @@
   app_init(0, NULL);
   app_splash_done();
 
+/* TODO is this needed, what for?
 #ifdef GNOME
-  menuitem = menus_get_item_from_path("<Toolbox>/File/New diagram", NULL);
-  gtk_widget_hide(menuitem);
-  menuitem = menus_get_item_from_path("<Toolbox>/File/Open...", NULL);
-  gtk_widget_hide(menuitem);
-  menuitem = menus_get_item_from_path("<Toolbox>/File/Exit", NULL);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileNew");
+  gtk_widget_hide(menuitem);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileOpen");
+  gtk_widget_hide(menuitem);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileExit");
   gtk_widget_hide(menuitem);
 #else
-  menuitem = menus_get_item_from_path("<Toolbox>/File/New", NULL);
-  gtk_widget_hide(menuitem);
-  menuitem = menus_get_item_from_path("<Toolbox>/File/Open...", NULL);
-  gtk_widget_hide(menuitem);
-  menuitem = menus_get_item_from_path("<Toolbox>/File/sep1", NULL);
-  gtk_widget_hide(menuitem);
-  menuitem = menus_get_item_from_path("<Toolbox>/File/Quit", NULL);
-  gtk_widget_hide(menuitem);
-#endif
-
+  menuitem = menus_get_item("/ToolboxMenu/File/FileNew");
+  gtk_widget_hide(menuitem);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileOpen");
+  gtk_widget_hide(menuitem);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileSep1");
+  gtk_widget_hide(menuitem);
+  menuitem = menus_get_item("/ToolboxMenu/File/FileQuit");
+  gtk_widget_hide(menuitem);
+#endif
+*/
 
   g_signal_connect (GTK_OBJECT (bonobo_context_running_get ()),
 		      "last_unref",

=== modified file 'a/app/diagram.c'
--- a/app/diagram.c	
+++ b/app/diagram.c	
@@ -446,48 +446,42 @@
 {
   gint selected_count = g_list_length (dia->data->selected);
   /* Edit menu */
-  gtk_widget_set_sensitive(GTK_WIDGET(items->copy), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->cut), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->paste),
-			   cnp_exist_stored_objects());
-  gtk_widget_set_sensitive(GTK_WIDGET(items->edit_delete), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->edit_duplicate), selected_count > 0);
-
-  gtk_widget_set_sensitive(GTK_WIDGET(items->copy_text),
-			   active_focus() != NULL);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->cut_text),
-			   active_focus() != NULL);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->paste_text),
-			   active_focus() != NULL);
+  gtk_action_set_sensitive (items->copy, selected_count > 0);
+  gtk_action_set_sensitive (items->cut, selected_count > 0);
+  gtk_action_set_sensitive (items->paste, cnp_exist_stored_objects());
+  gtk_action_set_sensitive (items->edit_delete, selected_count > 0);
+  gtk_action_set_sensitive (items->edit_duplicate, selected_count > 0);
+
+  gtk_action_set_sensitive (items->copy_text, active_focus() != NULL);
+  gtk_action_set_sensitive (items->cut_text, active_focus() != NULL);
+  gtk_action_set_sensitive (items->paste_text, active_focus() != NULL);
   
   /* Objects menu */
-  gtk_widget_set_sensitive(GTK_WIDGET(items->send_to_back), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->bring_to_front), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->send_backwards), selected_count > 0);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->bring_forwards), selected_count > 0);
-    
-  gtk_widget_set_sensitive(GTK_WIDGET(items->parent),
-			   diagram_selected_can_parent(dia));
-  gtk_widget_set_sensitive(GTK_WIDGET(items->unparent),
-			   diagram_selected_any_children(dia));
-  gtk_widget_set_sensitive(GTK_WIDGET(items->unparent_children),
-			   diagram_selected_any_parents(dia));
-  gtk_widget_set_sensitive(GTK_WIDGET(items->group), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->ungroup),
-			   diagram_selected_any_groups(dia));
-  gtk_widget_set_sensitive(GTK_WIDGET(items->properties), selected_count > 0);
+  gtk_action_set_sensitive (items->send_to_back, selected_count > 0);
+  gtk_action_set_sensitive (items->bring_to_front, selected_count > 0);
+  gtk_action_set_sensitive (items->send_backwards, selected_count > 0);
+  gtk_action_set_sensitive (items->bring_forwards, selected_count > 0);
+    
+  gtk_action_set_sensitive (items->parent, diagram_selected_can_parent (dia));
+  gtk_action_set_sensitive (items->unparent, 
+							diagram_selected_any_children (dia));
+  gtk_action_set_sensitive (items->unparent_children, 
+							diagram_selected_any_parents (dia));
+  gtk_action_set_sensitive (items->group, selected_count > 1);
+  gtk_action_set_sensitive (items->ungroup, diagram_selected_any_groups (dia));
+  gtk_action_set_sensitive (items->properties, selected_count > 0);
   
   /* Objects->Align menu */
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_h_l), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_h_c), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_h_r), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_h_e), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_h_a), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_v_t), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_v_c), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_v_b), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_v_e), selected_count > 1);
-  gtk_widget_set_sensitive(GTK_WIDGET(items->align_v_a), selected_count > 1);
+  gtk_action_set_sensitive (items->align_h_l, selected_count > 1);
+  gtk_action_set_sensitive (items->align_h_c, selected_count > 1);
+  gtk_action_set_sensitive (items->align_h_r, selected_count > 1);
+  gtk_action_set_sensitive (items->align_h_e, selected_count > 1);
+  gtk_action_set_sensitive (items->align_h_a, selected_count > 1);
+  gtk_action_set_sensitive (items->align_v_t, selected_count > 1);
+  gtk_action_set_sensitive (items->align_v_c, selected_count > 1);
+  gtk_action_set_sensitive (items->align_v_b, selected_count > 1);
+  gtk_action_set_sensitive (items->align_v_e, selected_count > 1);
+  gtk_action_set_sensitive (items->align_v_a, selected_count > 1);
 }
     
   
@@ -501,16 +495,12 @@
 {
   static int initialized = 0;
   static UpdatableMenuItems items;
-  
-
-  char *display = "<Display>";
-  
+ 
   if (initialized==0) {
-      menus_initialize_updatable_items (&items, NULL, display);
-      
+      menus_initialize_updatable_items (&items, NULL);      
       initialized = 1;
   }
-  
+
   diagram_update_menu_sensitivity (dia, &items);
 }
 
@@ -1415,11 +1405,3 @@
 {
   diagram_tree_update_object(diagram_tree(), dia, object);
 }
-
-static 
-void close_dialog(gpointer data, gpointer user_data)
-{
-  if (data != NULL) {
-    g_signal_emit_by_name(G_OBJECT(data), "delete_event");
-  }
-}

=== modified file 'a/app/diagram_tree_window.c'
--- a/app/diagram_tree_window.c	
+++ b/app/diagram_tree_window.c	
@@ -35,7 +35,7 @@
 #include "persistence.h"
 
 static GtkWidget *diagwindow_ = NULL;
-static GtkCheckMenuItem *menu_item_ = NULL;
+static GtkToggleAction *toggle_action_ = NULL;
 static DiagramTree *diagtree_ = NULL;
 static DiagramTreeConfig *config_ = NULL;
 
@@ -43,7 +43,10 @@
 static void
 diagram_tree_window_hide(GtkWidget *window)
 {
-  if (menu_item_) menu_item_->active = FALSE;
+  if (toggle_action_ && 
+	  gtk_toggle_action_get_active(toggle_action_)) {
+	gtk_toggle_action_set_active(toggle_action_, FALSE);
+  }
   gtk_widget_hide(window);
 }
 
@@ -54,7 +57,11 @@
   diagwindow_ = NULL;
   g_free(diagtree_);
   diagtree_ = NULL;
-  if (menu_item_) menu_item_->active = FALSE;
+
+  if (toggle_action_ && 
+	  gtk_toggle_action_get_active(toggle_action_)) {
+	gtk_toggle_action_set_active(toggle_action_, FALSE);
+  }
 }
 
 /* create a diagram_tree_window window */
@@ -116,19 +123,19 @@
 }
 
 void
-create_diagram_tree_window(DiagramTreeConfig *config, GtkWidget *menuitem)
+create_diagram_tree_window(DiagramTreeConfig *config, GtkToggleAction *action)
 {
   config_ = config;
-  menu_item_ = GTK_CHECK_MENU_ITEM(menuitem);
+  toggle_action_ = action;
   if (!diagwindow_) {
     diagwindow_ = diagram_tree_window_new(config_);
   }
-  gtk_check_menu_item_set_active(menu_item_, GTK_WIDGET_REALIZED(diagwindow_));
+  gtk_toggle_action_set_active(action, GTK_WIDGET_REALIZED(diagwindow_));
 }
 
 /* menu callbacks */
 void
-diagtree_show_callback(gpointer data, guint action, GtkWidget *widget)
+diagtree_show_callback (GtkToggleAction *action, gpointer user_data)
 {
   if (!diagwindow_) {
     diagwindow_ = diagram_tree_window_new(config_);
@@ -139,11 +146,9 @@
       open = g_list_next(open);
     }
   }
-  if (!menu_item_) menu_item_ = GTK_CHECK_MENU_ITEM(widget);
-  if (menu_item_->active)
+  if (!toggle_action_) toggle_action_ = action;
+  if (gtk_toggle_action_get_active (toggle_action_))
     gtk_widget_show(diagwindow_);
   else
     gtk_widget_hide(diagwindow_);
 }
-
-    

=== modified file 'a/app/diagram_tree_window.h'
--- a/app/diagram_tree_window.h	
+++ b/app/diagram_tree_window.h	
@@ -41,13 +41,11 @@
 diagram_tree(void);
 
 extern void
-create_diagram_tree_window(DiagramTreeConfig *config, GtkWidget *menuitem);
+create_diagram_tree_window(DiagramTreeConfig *config, GtkToggleAction *action);
 
 
 /* show the diagtree window (menu callback) */
 extern void
-diagtree_show_callback(gpointer data, guint action,
-		       GtkWidget *widget);
-
+diagtree_show_callback (GtkToggleAction *action, gpointer user_data);
 
 #endif /* DIAGRAM_TREE_WINDOW_H */

=== modified file 'a/app/disp_callbacks.c'
--- a/app/disp_callbacks.c	
+++ b/app/disp_callbacks.c	
@@ -356,7 +356,7 @@
   GtkWidget *menu;
 
   popup_shell = ddisp->shell;
-  menus_get_image_menu(&menu, NULL);
+  menu = menus_get_display_popup();
 
   gtk_menu_popup(GTK_MENU(menu), NULL, NULL, NULL, NULL,
 		 event->button, event->time);

=== modified file 'a/app/display.c'
--- a/app/display.c	
+++ b/app/display.c	
@@ -140,18 +140,27 @@
 }
 
 static void
-append_im_menu (DDisplay* ddisp, GtkMenuItem* im_menu_item)
-{
-  GtkWidget* im_menu;
-  GtkWidget* im_menu_tearoff;
-  
-  im_menu = gtk_menu_new ();
-  im_menu_tearoff = gtk_tearoff_menu_item_new ();
-  gtk_menu_shell_append (GTK_MENU_SHELL(im_menu), im_menu_tearoff);
-  gtk_im_multicontext_append_menuitems (
-      GTK_IM_MULTICONTEXT(ddisp->im_context),
-      GTK_MENU_SHELL(im_menu));
-  gtk_menu_item_set_submenu (GTK_MENU_ITEM(im_menu_item), im_menu);
+append_im_menu (DDisplay* ddisp, GtkAction* action)
+{
+  GSList    *proxies;
+  GtkWidget *im_menu;
+  /* GtkWidget *im_menu_tearoff; */
+  
+  proxies = gtk_action_get_proxies (action);
+  while (proxies) {
+	if (GTK_IS_MENU_ITEM (proxies)) {
+	  im_menu = gtk_menu_new ();
+	  /* tearoff should be added depending on gtk settings
+	  im_menu_tearoff = gtk_tearoff_menu_item_new ();
+	  gtk_menu_shell_append (GTK_MENU_SHELL(im_menu), im_menu_tearoff);
+	  */
+	  gtk_im_multicontext_append_menuitems (
+		GTK_IM_MULTICONTEXT(ddisp->im_context),
+		GTK_MENU_SHELL(im_menu));
+	  gtk_menu_item_set_submenu (GTK_MENU_ITEM(proxies), im_menu);
+	}
+	proxies = proxies->next;
+  }
 }
 
 /** Initialize the various GTK-level thinks in a display after the internal
@@ -161,9 +170,7 @@
 static void
 initialize_display_widgets(DDisplay *ddisp)
 {
-  GtkMenuItem* im_menu_item;
-  GtkWidget* im_menu;
-  GtkWidget* im_menu_tearoff;
+  GtkAction* im_menu_item;
   static gboolean input_methods_done = FALSE;
   Diagram *dia = ddisp->diagram;
   gchar *filename;
@@ -204,15 +211,15 @@
   g_hash_table_insert (display_ht, ddisp->canvas, ddisp);
 
   if (!input_methods_done) {
-      im_menu_item = menus_get_item_from_path("<Display>/Input Methods", NULL);
+      im_menu_item = menus_get_action ("InputMethods");
       if (im_menu_item) {
         append_im_menu (ddisp, im_menu_item);
-	input_methods_done = TRUE;
+        input_methods_done = TRUE;
       }
   }
   /* the diagram menubar gets recreated for every diagram */ 	 
   if (ddisp->menu_bar) {
-    im_menu_item = menus_get_item_from_path("<DisplayMBar>/Input Methods", ddisp->mbar_item_factory);
+    im_menu_item = gtk_action_group_get_action (ddisp->actions, "InputMethods");
     if (im_menu_item)
       append_im_menu (ddisp, im_menu_item);
   }	 
@@ -273,25 +280,11 @@
 DDisplay *
 new_display(Diagram *dia)
 {
-  GtkMenuItem* im_menu_item;
   DDisplay *ddisp;
   Rectangle visible;
-  static gboolean input_methods_done = FALSE;
   
   ddisp = g_new0(DDisplay,1);
 
-  ddisp->menu_bar = NULL;
-  ddisp->mbar_item_factory = NULL;
-
-  ddisp->rulers = NULL;
-  /*
-  ddisp->visible_grid = NULL;
-  ddisp->snap_to_grid = NULL;
-  ddisp->show_cx_pts_mitem = NULL;
-#ifdef HAVE_LIBART
-  ddisp->antialiased = NULL;
-#endif
-  */
   /* initialize the whole struct to 0 so that we are sure to catch errors.*/
   memset (&ddisp->updatable_menu_items, 0, sizeof (UpdatableMenuItems));
   
@@ -793,19 +786,18 @@
 void
 ddisplay_set_snap_to_grid(DDisplay *ddisp, gboolean snap)
 {
-  GtkCheckMenuItem *snap_to_grid;
+  GtkToggleAction *snap_to_grid;
   ddisp->grid.snap = snap;
 
   if (ddisp->menu_bar == NULL) {
-    snap_to_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Snap To Grid", NULL));
+    snap_to_grid = GTK_TOGGLE_ACTION (menus_get_action ("ViewSnaptogrid"));
   } else {
-    snap_to_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Snap To Grid", ddisp->mbar_item_factory));
+    snap_to_grid = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewSnaptogrid"));
   }
 
   /* Currently, this can cause double emit, but that's a small problem.
    */
-  gtk_check_menu_item_set_active(snap_to_grid,
-				 ddisp->grid.snap);
+  gtk_toggle_action_set_active (snap_to_grid, ddisp->grid.snap);
   ddisplay_update_statusbar(ddisp);
 }
 
@@ -822,19 +814,18 @@
 void
 ddisplay_set_snap_to_objects(DDisplay *ddisp, gboolean magnetic)
 {
-  GtkCheckMenuItem *mainpoint_magnetism;
+  GtkToggleAction *mainpoint_magnetism;
   ddisp->mainpoint_magnetism = magnetic;
 
   if (ddisp->menu_bar == NULL) {
-    mainpoint_magnetism = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Snap To Objects", NULL));
+    mainpoint_magnetism = GTK_TOGGLE_ACTION (menus_get_action ("ViewSnaptoobjects"));
   } else {
-    mainpoint_magnetism = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Snap To Objects", ddisp->mbar_item_factory));
+    mainpoint_magnetism = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewSnaptoobjects"));
   }
 
   /* Currently, this can cause double emit, but that's a small problem.
    */
-  gtk_check_menu_item_set_active(mainpoint_magnetism,
-				 ddisp->mainpoint_magnetism);
+  gtk_toggle_action_set_active (mainpoint_magnetism, ddisp->mainpoint_magnetism);
   ddisplay_update_statusbar(ddisp);
 }
 
@@ -1171,47 +1162,45 @@
 void
 display_update_menu_state(DDisplay *ddisp)
 {
-  GtkCheckMenuItem *rulers;
-  GtkCheckMenuItem *visible_grid;
-  GtkCheckMenuItem *snap_to_grid;
-  GtkCheckMenuItem *show_cx_pts;
+  GtkToggleAction *rulers;
+  GtkToggleAction *visible_grid;
+  GtkToggleAction *snap_to_grid;
+  GtkToggleAction *show_cx_pts;
 #ifdef HAVE_LIBART
-  GtkCheckMenuItem *antialiased;
+  GtkToggleAction *antialiased;
 #endif
 
   if (ddisp->menu_bar == NULL) {
-    rulers       = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Show Rulers", NULL));
-    visible_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Show Grid", NULL));
-    snap_to_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Snap To Grid", NULL));
-    show_cx_pts  = 
-      GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/Show Connection Points", NULL));
+    rulers       = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowrulers"));
+    visible_grid = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowgrid"));
+    snap_to_grid = GTK_TOGGLE_ACTION (menus_get_action ("ViewSnaptogrid"));
+    show_cx_pts  = GTK_TOGGLE_ACTION (menus_get_action ("ViewShowconnectionpoints"));
 #ifdef HAVE_LIBART
-    antialiased = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<Display>/View/AntiAliased", NULL));
+    antialiased  = GTK_TOGGLE_ACTION (menus_get_action ("ViewAntialiased"));
 #endif
   } else {
-    rulers       = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Show Rulers", ddisp->mbar_item_factory));
-    visible_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Show Grid", ddisp->mbar_item_factory));
-    snap_to_grid = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Snap To Grid", ddisp->mbar_item_factory));
-    show_cx_pts  = 
-      GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/Show Connection Points", ddisp->mbar_item_factory));
+    rulers       = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowrulers"));
+    visible_grid = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowgrid"));
+    snap_to_grid = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewSnaptogrid"));
+    show_cx_pts  = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewShowconnectionpoints"));
 #ifdef HAVE_LIBART
-    antialiased = GTK_CHECK_MENU_ITEM(menus_get_item_from_path("<DisplayMBar>/View/AntiAliased", ddisp->mbar_item_factory));
+    antialiased  = GTK_TOGGLE_ACTION (gtk_action_group_get_action (ddisp->actions, "ViewAntialiased"));
 #endif
   }
 
 
   ddisplay_do_update_menu_sensitivity (ddisp);
   
-  gtk_check_menu_item_set_active(rulers,
+  gtk_toggle_action_set_active (rulers,
 				 GTK_WIDGET_VISIBLE (ddisp->hrule) ? 1 : 0); 
-  gtk_check_menu_item_set_active(visible_grid,
+  gtk_toggle_action_set_active (visible_grid,
 				 ddisp->grid.visible);
-  gtk_check_menu_item_set_active(snap_to_grid,
+  gtk_toggle_action_set_active (snap_to_grid,
 				 ddisp->grid.snap);
-  gtk_check_menu_item_set_active(show_cx_pts,
+  gtk_toggle_action_set_active (show_cx_pts,
 				 ddisp->show_cx_pts); 
 #ifdef HAVE_LIBART
-  gtk_check_menu_item_set_active(antialiased,
+  gtk_toggle_action_set_active (antialiased,
 				 ddisp->aa_renderer);
 #endif 
 }

=== modified file 'a/app/display.h'
--- a/app/display.h	
+++ b/app/display.h	
@@ -45,15 +45,16 @@
 #define DDISPLAY_MIN_ZOOM 0.01
 */
 struct _DDisplay {
-  Diagram *diagram;               /* pointer to the associated diagram */
+  Diagram *diagram;                  /* pointer to the associated diagram */
 
-  GtkWidget *shell;               /* shell widget for this ddisplay    */
-  GtkWidget *canvas;              /* canvas widget for this ddisplay   */
-  GtkWidget *hsb, *vsb;           /* widgets for scroll bars           */
-  GtkWidget *hrule, *vrule;       /* widgets for rulers                */
-  GtkWidget *origin;              /* widgets for rulers                */
-  GtkWidget *menu_bar;            /* widget for the menu bar           */
-  GtkItemFactory *mbar_item_factory; /* item factory used to create the menu bar */
+  GtkWidget      *shell;               /* shell widget for this ddisplay    */
+  GtkWidget      *canvas;              /* canvas widget for this ddisplay   */
+  GtkWidget      *hsb, *vsb;           /* widgets for scroll bars           */
+  GtkWidget      *hrule, *vrule;       /* widgets for rulers                */
+  GtkWidget      *origin;              /* widgets for rulers                */
+  GtkWidget      *menu_bar;            /* widget for the menu bar           */
+  GtkUIManager   *ui_manager;     /* ui manager used to create the menu bar */
+  GtkActionGroup *actions;        
 
   /* menu bar widgets */
   GtkMenuItem *rulers;

=== modified file 'a/app/interface.c'
--- a/app/interface.c	
+++ b/app/interface.c	
@@ -55,72 +55,72 @@
 {
   { (char **) dia_modify_tool_icon,
     N_("Modify object(s)"),
-    N_("Modify"),
+    N_("ToolsModify"),
     { MODIFY_TOOL, NULL, NULL}
   },
   { (char **) dia_zoom_tool_icon,
     N_("Magnify"),
-    N_("Magnify"),
+    N_("ToolsMagnify"),
     { MAGNIFY_TOOL, NULL, NULL}
   },
   { (char **) dia_scroll_tool_icon,
     N_("Scroll around the diagram"),
-    N_("Scroll"),
+    N_("ToolsScroll"),
     { SCROLL_TOOL, NULL, NULL}
   },
   { NULL,
     N_("Text"),
-    N_("Text"),
+    N_("ToolsText"),
     { CREATE_OBJECT_TOOL, "Standard - Text", NULL }
   },
   { NULL,
     N_("Box"),
-    N_("Box"),
+    N_("ToolsBox"),
     { CREATE_OBJECT_TOOL, "Standard - Box", NULL }
   },
   { NULL,
     N_("Ellipse"),
-    N_("Ellipse"),
+    N_("ToolsEllipse"),
     { CREATE_OBJECT_TOOL, "Standard - Ellipse", NULL }
   },
   { NULL,
     N_("Polygon"),
-    N_("Polygon"),
+    N_("ToolsPolygon"),
     { CREATE_OBJECT_TOOL, "Standard - Polygon", NULL }
   },
   { NULL,
     N_("Beziergon"),
-    N_("Beziergon"),
+    N_("ToolsBeziergon"),
     { CREATE_OBJECT_TOOL, "Standard - Beziergon", NULL }
   },
   { NULL,
     N_("Line"),
-    N_("Line"),
+    N_("ToolsLine"),
     { CREATE_OBJECT_TOOL, "Standard - Line", NULL }
   },
   { NULL,
     N_("Arc"),
-    N_("Arc"),
+    N_("ToolsArc"),
     { CREATE_OBJECT_TOOL, "Standard - Arc", NULL }
   },
   { NULL,
     N_("Zigzagline"),
-    N_("Zigzagline"),
+    N_("ToolsZigzagline"),
     { CREATE_OBJECT_TOOL, "Standard - ZigZagLine", NULL }
   },
   { NULL,
     N_("Polyline"),
-    N_("Polyline"),
+    N_("ToolsPolyline"),
     { CREATE_OBJECT_TOOL, "Standard - PolyLine", NULL }
   },
   { NULL,
     N_("Bezierline"),
-    N_("Bezierline"),
+    N_("ToolsBezierline"),
     { CREATE_OBJECT_TOOL, "Standard - BezierLine", NULL }
   },
   { NULL,
     N_("Image"),
-    N_("Image"),
+    N_("ToolsImage"),
     { CREATE_OBJECT_TOOL, "Standard - Image", NULL }
   }
 };
@@ -486,18 +486,16 @@
   gtk_table_attach (GTK_TABLE (table), navigation_button, 2, 3, 2, 3,
                     GTK_FILL, GTK_FILL, 0, 0);
 
-  menus_get_image_menu (NULL, &ddisp->accel_group);
+  /* TODO rob use per window accel */
+  ddisp->accel_group = menus_get_display_accels ();
   if (top_level_window)
     gtk_window_add_accel_group(GTK_WINDOW(ddisp->shell), ddisp->accel_group);
   if (use_mbar) 
   {
-    GString *path;
-    char *display = "<DisplayMBar>";
-
-    menus_get_image_menubar(&ddisp->menu_bar, &ddisp->mbar_item_factory);
+    ddisp->menu_bar = menus_create_display_menubar (&ddisp->ui_manager, &ddisp->actions);
+    g_assert (ddisp->menu_bar);
     gtk_box_pack_start (GTK_BOX (root_vbox), ddisp->menu_bar, FALSE, TRUE, 0);
-
-    menus_initialize_updatable_items (&ddisp->updatable_menu_items, ddisp->mbar_item_factory, display);
+    menus_initialize_updatable_items (&ddisp->updatable_menu_items, ddisp->actions);
   }
 
   /* the statusbars */
@@ -1334,9 +1332,8 @@
 void
 create_tree_window(void)
 {
-  GtkCheckMenuItem *item = GTK_CHECK_MENU_ITEM
-    (menus_get_item_from_path("<Toolbox>/File/Diagram tree", NULL));
-  create_diagram_tree_window(&prefs.dia_tree, GTK_WIDGET(item));
+  GtkAction *action = menus_get_action ("FileTree");
+  create_diagram_tree_window(&prefs.dia_tree, GTK_TOGGLE_ACTION(action));
 }
 
 GtkWidget *

=== modified file 'a/app/menus.c'
--- a/app/menus.c	
+++ b/app/menus.c	
@@ -1,5 +1,6 @@
 /* Dia -- an diagram creation/manipulation program
  * Copyright (C) 1998 Alexander Larsson
+ * Copyright (C) 2006 Robert Staudinger <robert.staudinger@gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -40,390 +41,204 @@
 #include "sheets.h"
 #include "dia-app-icons.h"
 
+#define DIA_STOCK_GROUP "dia-stock-group"
+#define DIA_STOCK_UNGROUP "dia-stock-ungroup"
+
 static void plugin_callback (GtkWidget *widget, gpointer data);
 
-#define MRU_MENU_ENTRY_SIZE (strlen ("/File/MRU00 ") + 1)
-#define MRU_MENU_ACCEL_SIZE sizeof ("<control>0")
-
-static GtkItemFactoryEntry toolbox_menu_items[] =
-{
-  {N_("/_File"),               NULL,         NULL,       0,    "<Branch>" },
-  {   "/File/tearoff",         NULL,         NULL,       0,   "<Tearoff>" },
-  {N_("/File/_New"),           "<control>N", file_new_callback,         0,
-      "<StockItem>", GTK_STOCK_NEW },
-  {N_("/File/_Open..."),       "<control>O", file_open_callback,        0,
-      "<StockItem>", GTK_STOCK_OPEN },
-/*  {N_("/Open _Recent"),           NULL,         NULL,           0, "<Branch>"}, */
-/*  {   "/Open Recent/tearoff",     NULL,         NULL,         0, "<Tearoff>" }, */
-  {N_("/File/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/File/_Diagram tree"),  "F8",         diagtree_show_callback,    0,
-   "<ToggleItem>" },
-  {N_("/File/Sheets and Objects..."),
-                               "F9",         sheets_dialog_show_callback, 0 },
-  {N_("/File/---"),            NULL,         NULL,       0, "<Separator>" },
- {N_("/File/_Preferences..."),NULL,         file_preferences_callback, 0,
-      "<StockItem>", GTK_STOCK_PREFERENCES },
-   {N_("/File/P_lugins..."),   NULL,         file_plugins_callback,     0,
-      "<StockItem>", GTK_STOCK_EXECUTE },
-  {N_("/File/---"),            NULL,         NULL,       0, "<Separator>" },
-    /* recent file list is dynamically inserted here */
-  {N_("/File/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/File/_Quit"),          "<control>Q", file_quit_callback,        0,
-      "<StockItem>", GTK_STOCK_QUIT },
-  {N_("/_Help"),               NULL,         NULL,       0,    "<Branch>" },
-  {   "/Help/tearoff",         NULL,         NULL,       0,   "<Tearoff>" },
-  {N_("/Help/_Contents"),        "F1",         help_manual_callback,      0,
-      "<StockItem>", GTK_STOCK_HELP },
-  {N_("/Help/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/Help/_About..."),      NULL,         help_about_callback,       0 }
+/* Actions common to toolbox and diagram window */
+static const GtkActionEntry common_entries[] =
+{
+  { "File", NULL, N_("_File"), NULL, NULL, NULL },
+    { "FileNew", GTK_STOCK_NEW, NULL, NULL, NULL, G_CALLBACK (file_new_callback) },
+    { "FileOpen", GTK_STOCK_OPEN, NULL, NULL, NULL, G_CALLBACK (file_open_callback) },
+    { "FileQuit", GTK_STOCK_QUIT, NULL, NULL, NULL, G_CALLBACK (file_quit_callback) }, 
+  { "Help", NULL, N_("_Help"), NULL, NULL, NULL },
+    { "HelpContents", GTK_STOCK_HELP, NULL, NULL, NULL, G_CALLBACK (help_manual_callback) },
+    { "HelpAbout", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK (help_about_callback) }
 };
 
-/* calculate the number of menu_item's */
-static int toolbox_nmenu_items = sizeof(toolbox_menu_items) / sizeof(toolbox_menu_items[0]);
-
-/* this one is needed while we create the menubar in GTK instead of Gnome */
-static GtkItemFactoryEntry display_menu_items[] =
-{
-  {   "/tearoff",                 NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/_File"),                  NULL,         NULL,           0, "<Branch>"},
-  {   "/File/tearoff",            NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/File/_New"),              "<control>N", file_new_callback,          0,
-      "<StockItem>", GTK_STOCK_NEW },
-  {N_("/File/_Open..."),          "<control>O", file_open_callback,         0,
-      "<StockItem>", GTK_STOCK_OPEN },
-/*  {N_("/Open _Recent"),           NULL,         NULL,           0, "<Branch>"}, */
-/*  {   "/Open Recent/tearoff",     NULL,         NULL,         0, "<Tearoff>" }, */
-  {N_("/File/---"),               NULL,         NULL,        0, "<Separator>"},
-  {N_("/File/_Save"),             "<control>S", file_save_callback,         0,
-      "<StockItem>", GTK_STOCK_SAVE },
-  {N_("/File/Save _As..."),       "<control><shift>S", file_save_as_callback,      0,
-      "<StockItem>", GTK_STOCK_SAVE_AS },
-  {N_("/File/_Export..."),        NULL,         file_export_callback,         0,
-      "<StockItem>", GTK_STOCK_CONVERT},
-  {N_("/File/---"),               NULL,         NULL,        0, "<Separator>"},
-  {N_("/File/Page Set_up..."),    NULL,         file_pagesetup_callback,    0},
-  {N_("/File/_Print Diagram..."), "<control>P", file_print_callback,        0,
-      "<StockItem>", GTK_STOCK_PRINT },
-  {N_("/File/---"),               NULL,         NULL,        0, "<Separator>"},
-  {N_("/File/_Close"),            "<control>W",         file_close_callback,        0,
-      "<StockItem>", GTK_STOCK_CLOSE },
-  {   "/File/---MRU",             NULL,         NULL,        0, "<Separator>"},
-  {N_("/File/_Quit"),              "<control>Q", file_quit_callback,        0,
-      "<StockItem>", GTK_STOCK_QUIT},
-  {N_("/_Edit"),                  NULL,         NULL,           0, "<Branch>"},
-  {   "/Edit/tearoff",            NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/Edit/_Undo"),             "<control>Z", edit_undo_callback,         0,
-      "<StockItem>", GTK_STOCK_UNDO },
-  {N_("/Edit/_Redo"),             "<control><shift>Z", edit_redo_callback,         0,
-      "<StockItem>", GTK_STOCK_REDO },
-  {N_("/Edit/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/Edit/_Copy"),             "<control>C", edit_copy_callback,         0,
-      "<StockItem>", GTK_STOCK_COPY },
-  {N_("/Edit/C_ut"),              "<control>X", edit_cut_callback,          0,
-      "<StockItem>", GTK_STOCK_CUT },
-  {N_("/Edit/_Paste"),            "<control>V", edit_paste_callback,        0,
-      "<StockItem>", GTK_STOCK_PASTE },
-  {N_("/Edit/_Duplicate"),        "<control>D", edit_duplicate_callback, 0, },
-  {N_("/Edit/_Delete"),           "Delete", edit_delete_callback,       0,
-      "<StockItem>", GTK_STOCK_DELETE },
-  {N_("/Edit/---"),            NULL,         NULL,       0, "<Separator>" },
-  /* the following used to bind to <control><shift>C which collides with Unicode input. <control>>alt> doesn't work either */
-  {N_("/Edit/Copy Text"),      NULL,         edit_copy_text_callback,    0,
-      "<StockItem>", GTK_STOCK_COPY },
-  {N_("/Edit/Cut Text"),       "<control><shift>X",         edit_cut_text_callback,     0,
-      "<StockItem>", GTK_STOCK_CUT },
-  {N_("/Edit/Paste _Text"),    "<control><shift>V",         edit_paste_text_callback,   0,
-      "<StockItem>", GTK_STOCK_PASTE },
-  {N_("/_Diagram"),               NULL,         NULL,           0, "<Branch>"},
-  {   "/Diagram/tearoff",            NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/Diagram/_Properties..."), NULL,         view_diagram_properties_callback,          0,
-      "<StockItem>", GTK_STOCK_PROPERTIES},
-  {N_("/Diagram/_Layers..."),     NULL,     dialogs_layers_callback,        0},
-  {N_("/_View"),                  NULL,         NULL,           0, "<Branch>"},
-  {   "/View/tearoff",            NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/View/Zoom _In"),          "<control>+", view_zoom_in_callback,     0,
-      "<StockItem>", GTK_STOCK_ZOOM_IN },
-  {N_("/View/Zoom _Out"),         "<control>-", view_zoom_out_callback,    0,
-      "<StockItem>", GTK_STOCK_ZOOM_OUT },
-  {N_("/View/_Zoom"),             NULL,         NULL,           0, "<Branch>"},
-  {   "/View/Zoom/tearoff",       NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/View/Zoom/1600%"),        NULL,         view_zoom_set_callback,  16000},
-  {N_("/View/Zoom/800%"),         NULL,         view_zoom_set_callback,  8000},
-  {N_("/View/Zoom/400%"),         "<alt>4",     view_zoom_set_callback,  4000},
-  {N_("/View/Zoom/283%"),         NULL,         view_zoom_set_callback,  2828},
-  {N_("/View/Zoom/200%"),         "<alt>2",     view_zoom_set_callback,  2000},
-  {N_("/View/Zoom/141%"),         NULL,         view_zoom_set_callback,  1414},
-  {N_("/View/Zoom/100%"),         "<alt>1",     view_zoom_set_callback,  1000,
-      "<StockItem>", GTK_STOCK_ZOOM_100 },
-  {N_("/View/Zoom/85%"),          NULL,         view_zoom_set_callback,   850},
-  {N_("/View/Zoom/70.7%"),        NULL,         view_zoom_set_callback,   707},
-  {N_("/View/Zoom/50%"),          "<alt>5",     view_zoom_set_callback,   500},
-  {N_("/View/Zoom/35.4%"),        NULL,         view_zoom_set_callback,   354},
-  {N_("/View/Zoom/25%"),          NULL,         view_zoom_set_callback,   250},
-  {N_("/View/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/View/Fullscr_een"),      "F11",        view_fullscreen_callback,   0, "<ToggleItem>"},
+/* Actions for toolbox menu */
+static const GtkActionEntry toolbox_entries[] = 
+{
+    { "FileSheets", NULL, N_("Sheets and Objects..."), "F9", NULL, G_CALLBACK (sheets_dialog_show_callback) },
+    { "FilePrefs", GTK_STOCK_PREFERENCES, NULL, NULL, NULL, G_CALLBACK (file_preferences_callback) },
+    { "FilePlugins", NULL, N_("Plugins..."), NULL, NULL, G_CALLBACK (file_plugins_callback) }
+};
+
+/* Toggle-Actions for toolbox menu */
+static const GtkToggleActionEntry toolbox_toggle_entries[] = 
+{
+    { "FileTree", NULL, N_("_Diagram tree..."), "F8", NULL, G_CALLBACK (diagtree_show_callback) }
+};
+
+/* Actions for diagram window */
+static const GtkActionEntry display_entries[] =
+{
+    { "FileSave", GTK_STOCK_SAVE, NULL, NULL, NULL, G_CALLBACK (file_save_callback) },
+    { "FileSaveas", GTK_STOCK_SAVE_AS, NULL, NULL, NULL, G_CALLBACK (file_save_as_callback) },
+    { "FileExport", GTK_STOCK_CONVERT, N_("_Export ..."), NULL, NULL, G_CALLBACK (file_export_callback) },
+    { "FilePagesetup", NULL, N_("Page Set_up..."), NULL, NULL, G_CALLBACK (file_pagesetup_callback) },
+    { "FilePrint", GTK_STOCK_PRINT, NULL, NULL, NULL, G_CALLBACK (file_print_callback) },
+    { "FileClose", GTK_STOCK_CLOSE, NULL, NULL, NULL, G_CALLBACK (file_close_callback) },
+
+  { "Edit", NULL, N_("_Edit"), NULL, NULL, NULL },
+    { "EditUndo", GTK_STOCK_UNDO, NULL, NULL, NULL, G_CALLBACK (edit_undo_callback) },
+    { "EditRedo", GTK_STOCK_REDO, NULL, NULL, NULL, G_CALLBACK (edit_redo_callback) },
+
+    { "EditCopy", GTK_STOCK_COPY, NULL, NULL, NULL, G_CALLBACK (edit_copy_callback) },
+    { "EditCut", GTK_STOCK_CUT, NULL, NULL, NULL, G_CALLBACK (edit_cut_callback) },
+    { "EditPaste", GTK_STOCK_PASTE, NULL, NULL, NULL, G_CALLBACK (edit_paste_callback) },
+    { "EditDuplicate", NULL, N_("_Duplicate"), "<control>D", NULL, G_CALLBACK (edit_duplicate_callback) },
+    { "EditDelete", GTK_STOCK_DELETE, NULL, NULL, NULL, G_CALLBACK (edit_delete_callback) },
+
+    /* the following used to bind to <control><shift>C which collides with Unicode input. 
+     * <control>>alt> doesn't work either */
+    { "EditCopytext", NULL, N_("Copy Text"), NULL, NULL, G_CALLBACK (edit_copy_text_callback) },
+    { "EditCuttext", NULL, N_("Cut Text"), "<control><shift>X", NULL, G_CALLBACK (edit_cut_text_callback) },
+    { "EditPastetext", NULL, N_("Paste _Text"), "<control><shift>V", NULL, G_CALLBACK (edit_paste_text_callback) },
+
+  { "Diagram", NULL, N_("_Diagram"), NULL, NULL, NULL }, 
+    { "DiagramProperties", GTK_STOCK_PROPERTIES, NULL, NULL, NULL, G_CALLBACK (view_diagram_properties_callback) },
+    { "DiagramLayers", NULL, N_("_Layers..."), NULL, NULL, G_CALLBACK (dialogs_layers_callback) },
+
+  { "View", NULL, N_("_View"), NULL, NULL, NULL },
+    { "ViewZoomin", GTK_STOCK_ZOOM_IN, NULL, NULL, NULL, G_CALLBACK (view_zoom_in_callback) },
+    { "ViewZoomout", GTK_STOCK_ZOOM_OUT, NULL, NULL, NULL, G_CALLBACK (view_zoom_out_callback) },
+    { "ViewZoom", NULL, N_("_Zoom"), NULL, NULL, NULL },
+      { "ViewZoom16000", NULL, N_("1600%"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom8000", NULL, N_("800%"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom4000", NULL, N_("400%"), "<alt>4", NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom2830", NULL, N_("283"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom2000", NULL, N_("200"), "<alt>2", NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom1410", NULL, N_("141"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom1000", GTK_STOCK_ZOOM_100, NULL, "<alt>1", NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom850", NULL, N_("85"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom707", NULL, N_("70.7"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom500", NULL, N_("50"), "<alt>5", NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom354", NULL, N_("35.4"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+      { "ViewZoom250", NULL, N_("25"), NULL, NULL, G_CALLBACK (view_zoom_set_callback) },
+
+  /* "display_toggle_entries" items go here */
+
+    { "ViewNewview", NULL, N_("New _View"), NULL, NULL, G_CALLBACK (view_new_view_callback) },
+    { "ViewCloneview", NULL, N_("C_lone View"), NULL, NULL, G_CALLBACK (view_clone_view_callback) },
+    /* Show All, Best Fit.  Same as the Gimp, Ctrl+E */
+    { "ViewShowall", GTK_STOCK_ZOOM_FIT, NULL, "<control>E", NULL, G_CALLBACK (view_show_all_callback) },
+    { "ViewRedraw", GTK_STOCK_REFRESH, NULL, NULL, NULL, G_CALLBACK (view_redraw_callback) },
+
+  { "Objects", NULL, N_("_Objects"), NULL, NULL },
+    { "ObjectsSendtoback", GTK_STOCK_GOTO_BOTTOM, N_("Send to _Back"), "<control>B", NULL, G_CALLBACK (objects_place_under_callback) },
+    { "ObjectsBringtofront", GTK_STOCK_GOTO_TOP, N_("Bring to _Front"), "<control>F", NULL, G_CALLBACK (objects_place_over_callback) },
+    { "ObjectsSendbackwards", GTK_STOCK_GO_DOWN, N_("Send Backwards"), NULL, NULL, G_CALLBACK (objects_place_down_callback) },
+    { "ObjectsBringforwards", GTK_STOCK_GO_UP, N_("Bring Forwards"), NULL, NULL, G_CALLBACK (objects_place_up_callback) },
+
+    { "ObjectsGroup", DIA_STOCK_GROUP, N_("_Group"), "<control>G", NULL, G_CALLBACK (objects_group_callback) },
+    /* deliberately not using Ctrl+U for Ungroup */
+    { "ObjectsUngroup", DIA_STOCK_UNGROUP, N_("_Ungroup"), "<control><shift>G", NULL, G_CALLBACK (objects_ungroup_callback) }, 
+
+    { "ObjectsParent", NULL, N_("_Parent"), "<control>L", NULL, G_CALLBACK (objects_parent_callback) },
+    { "ObjectsUnparent", NULL, N_("_Unparent"), "<control><shift>L", NULL, G_CALLBACK (objects_unparent_callback) },
+    { "ObjectsUnparentchildren", NULL, N_("_Unparent Children"), NULL, NULL, G_CALLBACK (objects_unparent_children_callback) },
+
+    { "ObjectsAlign", NULL, N_("Align"), NULL, NULL, NULL },
+      { "ObjectsAlignLeft", GTK_STOCK_JUSTIFY_LEFT, NULL, NULL, NULL, G_CALLBACK (objects_align_h_callback) },
+      { "ObjectsAlignCenter", GTK_STOCK_JUSTIFY_CENTER, NULL, NULL, NULL, G_CALLBACK (objects_align_h_callback) },
+      { "ObjectsAlignRight", GTK_STOCK_JUSTIFY_RIGHT, NULL, NULL, NULL, G_CALLBACK (objects_align_h_callback) },
+
+      { "ObjectsAlignTop", NULL, N_("Top"), NULL, NULL, G_CALLBACK (objects_align_v_callback) },
+      { "ObjectsAlignMiddle", NULL, N_("Middle"), NULL, NULL, G_CALLBACK (objects_align_v_callback) },
+      { "ObjectsAlignBottom", NULL, N_("Bottom"), NULL, NULL, G_CALLBACK (objects_align_v_callback) },
+
+      { "ObjectsAlignSpreadouthorizontally", NULL, N_("Spread Out Horizontally"), NULL, NULL, G_CALLBACK (objects_align_h_callback) },
+      { "ObjectsAlignSpreadoutvertically", NULL, N_("Spread Out Vertically"), NULL, NULL, G_CALLBACK (objects_align_v_callback) },
+      { "ObjectsAlignAdjacent", NULL, N_("Adjacent"), NULL, NULL, G_CALLBACK (objects_align_h_callback) },
+      { "ObjectsAlignStacked", NULL, N_("Stacked"), NULL, NULL, G_CALLBACK (objects_align_v_callback) },
+
+      { "ObjectsProperties", GTK_STOCK_PROPERTIES, NULL, NULL, NULL, G_CALLBACK (dialogs_properties_callback) },
+
+  { "Select", NULL, N_("_Select"), NULL, NULL, NULL },
+    { "SelectAll", NULL, N_("All"), "<control>A", NULL, G_CALLBACK (select_all_callback) },
+    { "SelectNone", NULL, N_("None"), NULL, NULL, G_CALLBACK (select_none_callback) },
+    { "SelectInvert", NULL, N_("Invert"), "<control>I", NULL, G_CALLBACK (select_invert_callback) },
+
+    { "SelectTransitive", NULL, N_("Transitive"), "<control>T", NULL, G_CALLBACK (select_transitive_callback) },
+    { "SelectConnected", NULL, N_("Connected"), "<control><shift>T", NULL, G_CALLBACK (select_connected_callback) },
+    { "SelectSametype", NULL, N_("Same Type"), NULL, NULL, G_CALLBACK (select_same_type_callback) },
+
+  { "InputMethods", NULL, N_("_Input Methods"), NULL, NULL, NULL }
+};
+
+/* Standard-Tool entries */
+static const GtkActionEntry tool_entries[] = 
+{
+  { "Tools", NULL, N_("_Tools"), NULL, NULL, NULL },
+    { "ToolsModify", NULL, N_("Modify"), NULL, NULL, NULL },
+    { "ToolsMagnify", NULL, N_("Magnify"), "<alt>M", NULL, NULL },
+    { "ToolsScroll", NULL, N_("Scroll"), "<alt>S", NULL, NULL },
+    { "ToolsText", NULL, N_("Text"), "<alt>T", NULL, NULL },
+    { "ToolsBox", NULL, N_("Box"), "<alt>R", NULL, NULL },
+    { "ToolsEllipse", NULL, N_("Ellipse"), "<alt>E", NULL, NULL },
+    { "ToolsPolygon", NULL, N_("Polygon"), "<alt>P", NULL, NULL },
+    { "ToolsBeziergon", NULL, N_("Beziergon"), "<alt>B", NULL, NULL },
+
+    { "ToolsLine", NULL, N_("Line"), "<alt>L", NULL, NULL },
+    { "ToolsArc", NULL, N_("Arc"), "<alt>A", NULL, NULL },
+    { "ToolsZigzagline", NULL, N_("Zigzagline"), "<alt>Z", NULL, NULL },
+    { "ToolsPolyline", NULL, N_("Polyline"), NULL, NULL },
+    { "ToolsBezierline", NULL, N_("Bezierline"), "<alt>C", NULL, NULL },
+
+    { "ToolsImage", NULL, N_("Image"), "<alt>I", NULL, NULL },
+};
+
+/* Toggle-Actions for diagram window */
+static const GtkToggleActionEntry display_toggle_entries[] = 
+{
+    { "ViewFullscreen", GTK_STOCK_FULLSCREEN, NULL, "F11", NULL, G_CALLBACK (view_fullscreen_callback) },
 #ifdef HAVE_LIBART  
-  {N_("/View/_AntiAliased"),      NULL,         view_aa_callback,           0, "<ToggleItem>"},
+    { "ViewAntialiased", NULL, N_("_AntiAliased"), NULL, NULL, G_CALLBACK (view_aa_callback) },
 #endif
-  {N_("/View/Show _Grid"),     NULL,         view_visible_grid_callback, 0, "<ToggleItem>"},
-  {N_("/View/_Snap To Grid"),     NULL,         view_snap_to_grid_callback, 0, "<ToggleItem>"},
-  {N_("/View/Snap To _Objects"),     NULL,         view_snap_to_objects_callback, 0, "<ToggleItem>"},
-  {N_("/View/Show _Rulers"),      NULL,         view_toggle_rulers_callback,0, "<ToggleItem>"},
-  {N_("/View/Show _Connection Points"),	  NULL,		view_show_cx_pts_callback,   0,	"<ToggleItem>"},
-  {N_("/View/---"),               NULL,         NULL,        0, "<Separator>"},
-  {N_("/View/New _View"),         NULL, view_new_view_callback,     0},
-  {N_("/View/C_lone View"),       NULL, view_clone_view_callback,   0},
-  /* Show All, Best Fit.  Same as the Gimp, Ctrl+E */
-  {N_("/View/Show _All"),         "<control>E", view_show_all_callback,     0,
-      "<StockItem>", GTK_STOCK_ZOOM_FIT },
-  {N_("/View/Re_draw"),           NULL,         view_redraw_callback,       0,
-      "<StockItem>", GTK_STOCK_REFRESH },
-  {N_("/_Objects"),               NULL,         NULL,           0, "<Branch>"},
-  {   "/Objects/tearoff",         NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/Objects/Send to _Back"),  "<control>B",objects_place_under_callback, 0,
-      "<StockItem>", GTK_STOCK_GOTO_BOTTOM },
-  {N_("/Objects/Bring to _Front"),"<control>F", objects_place_over_callback,0,
-      "<StockItem>", GTK_STOCK_GOTO_TOP},
-  {N_("/Objects/Send Backwards"),  NULL, objects_place_down_callback,0,
-      "<StockItem>", GTK_STOCK_GO_DOWN},
-  {N_("/Objects/Bring Forwards"), NULL, objects_place_up_callback,0,
-      "<StockItem>", GTK_STOCK_GO_UP},
-  {N_("/Objects/---"),            NULL,         NULL,        0, "<Separator>"},
-  {N_("/Objects/_Group"),         "<control>G", objects_group_callback,     0, 
-  "<ImageItem>", dia_group_icon},
-  /* deliberately not using Ctrl+U for Ungroup */
-  {N_("/Objects/_Ungroup"),       "<control><shift>G", objects_ungroup_callback, 0,
-  "<ImageItem>", dia_ungroup_icon}, 
-  {N_("/Objects/---"),            NULL,         NULL,        0, "<Separator>"},
-  {N_("/Objects/_Parent"),         "<control>L", objects_parent_callback,     0},
-  {N_("/Objects/_Unparent"),       "<control><shift>L", objects_unparent_callback,   0},
-  {N_("/Objects/_Unparent Children"),       NULL, objects_unparent_children_callback,   0},
-  {N_("/Objects/---"),            NULL,         NULL,        0, "<Separator>"},
-  {N_("/Objects/Align"),       NULL, NULL,          0, "<Branch>"},
-  {   "/Objects/Align/tearoff", NULL, NULL,        0, "<Tearoff>" },
-  {N_("/Objects/Align/Left"),   NULL, objects_align_h_callback,  DIA_ALIGN_LEFT,
-      "<StockItem>", GTK_STOCK_JUSTIFY_LEFT },
-  {N_("/Objects/Align/Center"), NULL, objects_align_h_callback,  DIA_ALIGN_CENTER,
-      "<StockItem>", GTK_STOCK_JUSTIFY_CENTER},
-  {N_("/Objects/Align/Right"),  NULL, objects_align_h_callback,  DIA_ALIGN_RIGHT,
-      "<StockItem>", GTK_STOCK_JUSTIFY_RIGHT},
-  {N_("/Objects/Align/---"),            NULL,         NULL,        0, "<Separator>"},
-  {N_("/Objects/Align/Top"),      NULL, objects_align_v_callback,  DIA_ALIGN_TOP},
-  {N_("/Objects/Align/Middle"),   NULL, objects_align_v_callback,  DIA_ALIGN_CENTER},
-  {N_("/Objects/Align/Bottom"),   NULL, objects_align_v_callback,  DIA_ALIGN_BOTTOM},
-  {N_("/Objects/Align/---"),             NULL,         NULL,        0, "<Separator>"},
-  {N_("/Objects/Align/Spread Out Horizontally"), NULL, objects_align_h_callback,    DIA_ALIGN_EQUAL},
-  {N_("/Objects/Align/Spread Out Vertically"),   NULL, objects_align_v_callback,    DIA_ALIGN_EQUAL},
-  {N_("/Objects/Align/Adjacent"), NULL, objects_align_h_callback,    DIA_ALIGN_ADJACENT},
-  {N_("/Objects/Align/Stacked"), NULL, objects_align_v_callback,  DIA_ALIGN_ADJACENT},
-  {N_("/Objects/---"),            NULL,     NULL,                           0, "<Separator>"},
-  {N_("/Objects/_Properties..."), NULL,     dialogs_properties_callback,         0,
-      "<StockItem>", GTK_STOCK_PROPERTIES},
-  {N_("/_Select"),                NULL,         NULL,           0, "<Branch>"},
-  {   "/Select/tearoff",          NULL,         NULL,         0, "<Tearoff>" },
-  {N_("/Select/All"),             "<control>A", select_all_callback,        0},
-  {N_("/Select/None"),            NULL, select_none_callback,   0},
-  {N_("/Select/Invert"),          "<control>I",         select_invert_callback,     0},
-  {N_("/Select/---"),             NULL,         NULL,        0, "<Separator>"},
-  {N_("/Select/Transitive"),      "<control>T", select_transitive_callback, 0},
-  {N_("/Select/Connected"),       "<control><shift>T",         select_connected_callback,  0},
-  {N_("/Select/Same Type"),       NULL,         select_same_type_callback,  0},
-  {N_("/Select/---"),             NULL,         NULL,        0, "<Separator>"},
-  {N_("/Select/Replace"),       NULL, select_style_callback,
-   SELECT_REPLACE, "<RadioItem>"},
-  {N_("/Select/Union"),     NULL, select_style_callback,
-   SELECT_UNION, "/Select/Replace"},
-  {N_("/Select/Intersection"), NULL, select_style_callback,
-   SELECT_INTERSECTION, "/Select/Replace"},
-  {N_("/Select/Remove"),    NULL, select_style_callback,
-   SELECT_REMOVE, "/Select/Replace"},
+    { "ViewShowgrid", NULL, N_("Show _Grid"), NULL, NULL, G_CALLBACK (view_visible_grid_callback) },
+    { "ViewSnaptogrid", NULL, N_("_Snap To Grid"), NULL, NULL, G_CALLBACK (view_snap_to_grid_callback) },
+    { "ViewSnaptoobjects", NULL, N_("Snap To _Objects"), NULL, NULL, G_CALLBACK (view_snap_to_objects_callback) },
+    { "ViewShowrulers", NULL, N_("Show _Rulers"), NULL, NULL, G_CALLBACK (view_toggle_rulers_callback)  },
+    { "ViewShowconnectionpoints", NULL, N_("Show _Connection Points"), NULL, NULL, G_CALLBACK (view_show_cx_pts_callback) }
+};
+
+/* Radio-Actions for the diagram window's "Select"-Menu */
+static const GtkRadioActionEntry display_select_radio_entries[] =
+{
+  { "SelectReplace", NULL, N_("Replace"), NULL, NULL, SELECT_REPLACE },
+  { "SelectUnion", NULL, N_("Union"), NULL, NULL, SELECT_UNION },
+  { "SelectIntersection", NULL, N_("Intersection"), NULL, NULL, SELECT_INTERSECTION },
+  { "SelectRemove", NULL, N_("Remove"), NULL, NULL, SELECT_REMOVE },
   /* Cannot also be called Invert, duplicate names caused keybinding problems */
-  {N_("/Select/Inverse"),    NULL, select_style_callback,
-   SELECT_INVERT, "/Select/Replace"},
-  {N_("/_Tools"),                 NULL,     NULL,               0, "<Branch>"},
-  {   "/Tools/tearoff",           NULL,     NULL,         0, "<Tearoff>" },
-  {N_("/Tools/Modify"),           "<alt>.", NULL,                         0},
-  {N_("/Tools/Magnify"),          "<alt>M", NULL,                           0},
-  {N_("/Tools/Scroll"),           "<alt>S", NULL,                           0},
-  {N_("/Tools/Text"),             "<alt>T", NULL,                           0},
-  {N_("/Tools/Box"),              "<alt>R", NULL,                           0},
-  {N_("/Tools/Ellipse"),          "<alt>E", NULL,                           0},
-  {N_("/Tools/Polygon"),          "<alt>P", NULL,                           0},
-  {N_("/Tools/Beziergon"),        "<alt>B", NULL,                           0},
-  {N_("/Tools/---"),              NULL,     NULL,       0, "<Separator>" },
-  {N_("/Tools/Line"),             "<alt>L", NULL,                           0},
-  {N_("/Tools/Arc"),              "<alt>A", NULL,                           0},
-  {N_("/Tools/Zigzagline"),       "<alt>Z", NULL,                           0},
-  {N_("/Tools/Polyline"),         NULL,     NULL,                           0},
-  {N_("/Tools/Bezierline"),       "<alt>C", NULL,                           0},
-  {N_("/Tools/---"),              NULL,     NULL,       0, "<Separator>" },
-  {N_("/Tools/Image"),            "<alt>I", NULL,                           0},
-  {N_("/_Input Methods"),         NULL,     NULL,               0, "<Branch>"},
-  {   "/Input Methods/tearoff",   NULL,     NULL,               0, "<Tearoff>" },
-  {N_("/_Help"),               NULL,         NULL,       0,    "<Branch>" },
-  {   "/Help/tearoff",         NULL,         NULL,       0,   "<Tearoff>" },
-  {N_("/Help/_Contents"),        "F1",         help_manual_callback,      0,
-      "<StockItem>", GTK_STOCK_HELP },
-  {N_("/Help/---"),            NULL,         NULL,       0, "<Separator>" },
-  {N_("/Help/_About..."),      NULL,         help_about_callback,       0,
-   /* FOR 2.6 "<StockItem>", GTK_STOCK_ABOUT */},
+  { "SelectInverse", NULL, N_("Inverse"), NULL, NULL, SELECT_INVERT }
 };
-
-static int display_nmenu_items = (sizeof(display_menu_items) /
-				  sizeof(display_menu_items[0]));
-
 
 /* need initialisation? */
 static gboolean initialise = TRUE;
 
-/* the actual menus */
+/* toolbox */
+static GtkUIManager *toolbox_ui_manager = NULL;
+static GtkActionGroup *toolbox_actions = NULL;
+static GtkAccelGroup *toolbox_accels = NULL;
 static GtkWidget *toolbox_menubar = NULL;
-static GtkAccelGroup *toolbox_accels = NULL;
-static GtkWidget *display_menus = NULL;
+
+GtkActionGroup *recent_actions = NULL;
+static GSList *recent_merge_ids = NULL;
+
+/* diagram */
+static GtkUIManager *display_ui_manager = NULL;
+static GtkActionGroup *display_actions = NULL;
+static GtkActionGroup *display_tool_actions = NULL;
 static GtkAccelGroup *display_accels = NULL;
-
-static GtkItemFactory *toolbox_item_factory = NULL;
-static GtkItemFactory *display_item_factory = NULL;
-
-#ifdef ENABLE_NLS
-
-static gchar *
-menu_translate (const gchar *path,
-    		gpointer     data)
-{
-  static gchar *menupath = NULL;
-
-  GtkItemFactory *item_factory = NULL;
-  gchar *retval;
-  gchar *factory;
-  gchar *translation;
-  gchar *domain = NULL;
-  gchar *complete = NULL;
-  gchar *p, *t;
-
-  factory = (gchar *) data;
-
-  if (menupath)
-    g_free (menupath);
-
-  retval = menupath = g_strdup (path);
-
-  if ((strstr (path, "/tearoff1") != NULL) ||
-      (strstr (path, "/---") != NULL) ||
-      (strstr (path, "/MRU") != NULL))
-    return retval;
-
-  if (factory)
-    item_factory = gtk_item_factory_from_path (factory);
-  if (item_factory)
-    {
-      domain = gtk_object_get_data (GTK_OBJECT (item_factory), "textdomain");
-      complete = gtk_object_get_data (GTK_OBJECT (item_factory), "complete");
-    }
-  
-  if (domain)   /*  use the plugin textdomain  */
-    {
-      g_free (menupath);
-      menupath = g_strconcat (factory, path, NULL);
-
-      if (complete)
-	{
-	  /*  
-           *  This is a branch, use the complete path for translation, 
-	   *  then strip off entries from the end until it matches. 
-	   */
-	  complete = g_strconcat (factory, complete, NULL);
-	  translation = g_strdup (dgettext (domain, complete));
-
-	  while (*complete && *translation && strcmp (complete, menupath))
-	    {
-	      p = strrchr (complete, '/');
-	      t = strrchr (translation, '/');
-	      if (p && t)
-		{
-		  *p = '\0';
-		  *t = '\0';
-		}
-	      else
-		break;
-	    }
-
-	  g_free (complete);
-	}
-      else
-	{
-	  translation = dgettext (domain, menupath);
-	}
-
-      /* 
-       * Work around a bug in GTK+ prior to 1.2.7 (similar workaround below)
-       */
-      if (strncmp (factory, translation, strlen (factory)) == 0)
-	{
-	  retval = translation + strlen (factory);
-	  if (complete)
-	    {
-	      g_free (menupath);
-	      menupath = translation;
-	    }
-	}
-      else
-	{
-	  g_warning ("bad translation for menupath: %s", menupath);
-	  retval = menupath + strlen (factory);
-	  if (complete)
-	    g_free (translation);
-	}
-    }
-  else   /*  use the dia textdomain  */
-    {
-      if (complete)
-	{
-	  /*  
-           *  This is a branch, use the complete path for translation, 
-	   *  then strip off entries from the end until it matches. 
-	   */
-	  complete = g_strdup (complete);
-	  translation = g_strdup (gettext (complete));
-	  
-	  while (*complete && *translation && strcmp (complete, menupath))
-	    {
-	      p = strrchr (complete, '/');
-	      t = strrchr (translation, '/');
-	      if (p && t)
-		{
-		  *p = '\0';
-		  *t = '\0';
-		}
-	      else
-		break;
-	    }
-	  g_free (complete);
-	}
-      else
-	translation = gettext (menupath);
-
-      if (*translation == '/')
-	{
-	  retval = translation;
-	  if (complete)
-	    {
-	      g_free (menupath);
-	      menupath = translation;
-	    }
-	}
-      else
-	{
-	  g_warning ("bad translation for menupath: %s", menupath);
-	  if (complete)
-	    g_free (translation);
-	}
-    }
-  
-  return retval;
-}
-
-#endif  /*  ENABLE_NLS  */
+static GtkWidget *display_menubar = NULL;
+
+/* plugins */
+static GtkActionGroup *toolbox_plugin_actions = NULL;
+static GtkActionGroup *display_plugin_actions = NULL;
+
 
 static void
 tool_menu_select(GtkWidget *w, gpointer   data) {
@@ -450,98 +265,250 @@
   return TRUE;
 }
 
-
-/*
-  Purpose: set the generic callback for all the items in the menu "Tools"
- */
-static void 
-menus_set_tools_callback (const char * menu_name, GtkItemFactory *item_factory)
-{
-    gint i, len;
-    GString *path;
-    GtkMenuItem *menuitem;
-    
-    path = g_string_new(menu_name);
-    g_string_append(path, "/Tools/");
-    len = path->len;
-    for (i = 0; i < num_tools; i++) {
-	g_string_append(path, tool_data[i].menuitem_name);
-	menuitem = menus_get_item_from_path(path->str, item_factory);
-	if (menuitem != NULL)
-	    g_signal_connect(GTK_OBJECT(menuitem), "activate",
-			     G_CALLBACK(tool_menu_select),
-			       &tool_data[i].callback_data);
-        else
-            g_warning ("couldn't find tool menu item %s", path->str);
-	g_string_truncate(path, len);
+/* initialise tool actions */
+static GtkActionGroup *
+create_tool_actions (void)
+{
+  GtkActionGroup *actions;
+  GtkAction      *action;
+  guint           i;
+  gchar          *name;
+  static guint    cnt = 0;
+
+  name = g_strdup_printf ("tool-actions-%d", cnt);
+  actions = gtk_action_group_new (name);
+  gtk_action_group_set_translation_domain (actions, NULL);
+  g_free (name);
+  name = NULL;
+  cnt++;
+
+  gtk_action_group_add_actions (actions, tool_entries, 
+				G_N_ELEMENTS (tool_entries), NULL);
+
+  for (i = 0; i < num_tools; i++) {
+    action = gtk_action_group_get_action (actions, tool_data[i].menuitem_name);
+    if (action != NULL) {
+      g_signal_connect (G_OBJECT (action), "activate",
+			G_CALLBACK (tool_menu_select),
+			&tool_data[i].callback_data);
     }
-    g_string_free(path, TRUE);
-}
-
+    else {
+      g_warning ("couldn't find tool menu item %s", tool_data[i].menuitem_name);
+    }
+  }
+  return actions;
+}
+
+/* initialize callbacks from plug-ins */
+static GtkActionGroup *
+add_plugin_actions (GtkUIManager *ui_manager)
+{
+  GtkActionGroup    *actions;
+  GtkAction         *action;
+  GList             *cblist;
+  DiaCallbackFilter *cbf = NULL;
+  gchar             *name;
+  guint              id;
+  static guint       cnt = 0;
+
+  name = g_strdup_printf ("plugin-actions-%d", cnt);
+  actions = gtk_action_group_new (name);
+  gtk_action_group_set_translation_domain (actions, NULL);
+  g_free (name);
+  name = NULL;
+  cnt++;
+
+  for (cblist = filter_get_callbacks(); cblist; cblist = cblist->next) {
+
+  if (0 == strncmp (cbf->menupath, TOOLBOX_MENU, strlen (TOOLBOX_MENU))) {
+    /* hook for toolbox, skip */
+    continue;
+  }
+
+  cbf = cblist->data;
+  action = gtk_action_group_get_action (actions, cbf->action);
+  if (action == NULL) {
+    /* that's ok, it could be an action for the toolbox */
+    continue;
+  }
+
+  action = gtk_action_new (cbf->action, cbf->description, NULL, NULL);
+  g_signal_connect (G_OBJECT (action), "activate", 
+            G_CALLBACK (plugin_callback), 
+            (gpointer) cbf);
+  gtk_action_group_add_action (actions, action);
+  id = gtk_ui_manager_new_merge_id (ui_manager);
+  gtk_ui_manager_add_ui (ui_manager, id, 
+               cbf->menupath, 
+               cbf->description, 
+               cbf->action, 
+               GTK_UI_MANAGER_AUTO, 
+               FALSE);
+  }
+
+  return actions;
+}
+
+static void
+register_stock_icons (void)
+{
+  GtkIconFactory *factory;
+  GtkIconSet     *set;
+  GdkPixbuf      *pixbuf;
+  GError         *err = NULL;
+
+  factory = gtk_icon_factory_new ();
+
+  pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_group_icon), dia_group_icon, FALSE, &err);
+  if (err) {
+    g_warning (err->message);
+    g_error_free (err);
+    err = NULL;
+  }
+  set = gtk_icon_set_new_from_pixbuf (pixbuf);
+  gtk_icon_factory_add (factory, DIA_STOCK_GROUP, set);
+  g_object_unref (pixbuf);
+  pixbuf = NULL;
+
+  pixbuf = gdk_pixbuf_new_from_inline (sizeof (dia_ungroup_icon), dia_ungroup_icon, FALSE, &err);
+  if (err) {
+    g_warning (err->message);
+    g_error_free (err);
+    err = NULL;
+  }
+  set = gtk_icon_set_new_from_pixbuf (pixbuf);
+  gtk_icon_factory_add (factory, DIA_STOCK_UNGROUP, set);
+  g_object_unref (pixbuf); 
+  pixbuf = NULL;
+
+  gtk_icon_factory_add_default (factory);
+  g_object_unref (factory);
+  factory = NULL;
+}
 
 static void
 menus_init(void)
 {
   gchar *accelfilename;
   GList *cblist;
+  GError *error = NULL;
 
   if (!initialise)
     return;
   
   initialise = FALSE;
 
+  register_stock_icons ();
+
   /* the toolbox menu */
-  toolbox_accels = gtk_accel_group_new();
-  toolbox_item_factory = gtk_item_factory_new(GTK_TYPE_MENU_BAR, "<Toolbox>",
-					      toolbox_accels);
-  gtk_object_set_data (GTK_OBJECT (toolbox_item_factory), "factory_path",
-		       (gpointer) "toolbox");
-#ifdef ENABLE_NLS
-  gtk_item_factory_set_translate_func (toolbox_item_factory, menu_translate,
-				       "<Toolbox>", NULL);
-#endif
-  gtk_item_factory_create_items (toolbox_item_factory,
-				 toolbox_nmenu_items,
-				 toolbox_menu_items,
-				 NULL);
-  
-  toolbox_menubar = gtk_item_factory_get_widget(toolbox_item_factory,
-						"<Toolbox>");
+  toolbox_actions = gtk_action_group_new ("toolbox-actions");
+  gtk_action_group_set_translation_domain (toolbox_actions, NULL);
+  gtk_action_group_add_actions (toolbox_actions, common_entries, 
+                G_N_ELEMENTS (common_entries), NULL);
+  gtk_action_group_add_actions (toolbox_actions, toolbox_entries, 
+                G_N_ELEMENTS (toolbox_entries), NULL);
+  gtk_action_group_add_toggle_actions (toolbox_actions, toolbox_toggle_entries,
+                G_N_ELEMENTS (toolbox_toggle_entries), 
+                NULL);
+
+  toolbox_ui_manager = gtk_ui_manager_new ();
+  gtk_ui_manager_insert_action_group (toolbox_ui_manager, toolbox_actions, 0);
+  if (!gtk_ui_manager_add_ui_from_file (toolbox_ui_manager,
+                    UIDATADIR"/toolbox-ui.xml",
+                    &error)) {
+  g_warning ("building menus failed: %s", error->message);
+  g_error_free (error);
+  }
+
+  toolbox_accels = gtk_ui_manager_get_accel_group (toolbox_ui_manager);
+  toolbox_menubar = gtk_ui_manager_get_widget (toolbox_ui_manager, "/ToolboxMenu");
+
 
   /* the display menu */
-  display_accels = gtk_accel_group_new();
-  display_item_factory = gtk_item_factory_new(GTK_TYPE_MENU, "<Display>",
-					      display_accels);
-#ifdef ENABLE_NLS
-  gtk_item_factory_set_translate_func (display_item_factory, menu_translate,
-				       "<Display>", NULL);
-#endif
-  gtk_item_factory_create_items (display_item_factory,
-				 display_nmenu_items,
-				 display_menu_items,
-				 NULL);
-
-  display_menus = gtk_item_factory_get_widget(display_item_factory,
-					      "<Display>");
-  gtk_menu_set_accel_path(GTK_MENU(display_menus), "<Display>/");
-  
-  menus_set_tools_callback ("<Display>", NULL);
-
-  gtk_menu_set_title(GTK_MENU(display_menus), _("Diagram Menu"));
-  
-  /* initialize callbacks from plug-ins */
+  display_actions = gtk_action_group_new ("display-actions");
+  gtk_action_group_set_translation_domain (display_actions, NULL);
+  gtk_action_group_add_actions (display_actions, common_entries, 
+                G_N_ELEMENTS (common_entries), NULL);
+  gtk_action_group_add_actions (display_actions, display_entries, 
+                G_N_ELEMENTS (display_entries), NULL);
+  gtk_action_group_add_toggle_actions (display_actions, display_toggle_entries,
+                G_N_ELEMENTS (display_toggle_entries), 
+                NULL);
+  gtk_action_group_add_radio_actions (display_actions,
+                display_select_radio_entries,
+                G_N_ELEMENTS (display_select_radio_entries),
+                1,
+                G_CALLBACK (select_style_callback),
+                NULL);
+
+  display_tool_actions = create_tool_actions ();
+
+  display_ui_manager = gtk_ui_manager_new ();
+  gtk_ui_manager_insert_action_group (display_ui_manager, display_actions, 0);
+  gtk_ui_manager_insert_action_group (display_ui_manager, display_tool_actions, 0);
+  if (!gtk_ui_manager_add_ui_from_file (display_ui_manager,
+                    UIDATADIR"/display-ui.xml",
+                    &error)) {
+    g_warning ("building menus failed: %s", error->message);
+    g_error_free (error);
+    error = NULL;
+  }
+  if (!gtk_ui_manager_add_ui_from_file (display_ui_manager,
+                    UIDATADIR"/popup-ui.xml",
+                    &error)) {
+    g_warning ("building menus failed: %s", error->message);
+    g_error_free (error);
+    error = NULL;
+  }
+
+  display_accels = gtk_ui_manager_get_accel_group (display_ui_manager);
+  display_menubar = gtk_ui_manager_get_widget (display_ui_manager, "/DisplayPopup");
+  g_assert (display_menubar);
+
+
+  /* plugin menu hooks */  
+  toolbox_plugin_actions = gtk_action_group_new ("toolbox-plugin-actions");
+  gtk_action_group_set_translation_domain (toolbox_plugin_actions, NULL);
+  gtk_ui_manager_insert_action_group (toolbox_ui_manager, 
+                    toolbox_plugin_actions, 5 /* "back" */);
+
   for (cblist = filter_get_callbacks(); cblist; cblist = cblist->next) {
+
     DiaCallbackFilter *cbf = cblist->data;
-    GtkWidget *newitem;
-
-    newitem = menus_add_path(cbf->menupath);
-    if (!newitem) {
-      g_warning("Don't know where to add \"%s\" menu entry.", cbf->menupath);
+    GtkAction *action;
+    guint id;
+
+    if (cbf->action == NULL) {
+      g_warning ("Plugin '%s': doesn't specify action. Loading failed.\n", 
+		cbf->description);
       continue;
     }
-    g_signal_connect(GTK_OBJECT(newitem), "activate",
-		     G_CALLBACK(plugin_callback), cbf);
-  } /* for filter_callbacks */
+
+    if (0 != strncmp (cbf->menupath, TOOLBOX_MENU, strlen (TOOLBOX_MENU))) {
+      /* hook for display, skip */
+      continue;
+    }
+
+    action = gtk_action_new (cbf->action, cbf->description, 
+                             NULL, NULL);
+    g_signal_connect (G_OBJECT (action), "activate", 
+                      G_CALLBACK (plugin_callback), 
+                      (gpointer) cbf);
+
+    gtk_action_group_add_action (toolbox_plugin_actions, action);
+    id = gtk_ui_manager_new_merge_id (toolbox_ui_manager);
+    gtk_ui_manager_add_ui (toolbox_ui_manager, id, 
+                           cbf->menupath, 
+                           cbf->description, 
+                           cbf->action, 
+                           GTK_UI_MANAGER_AUTO, 
+                           FALSE);
+  }
+
+  display_plugin_actions = add_plugin_actions (display_ui_manager);
+  g_assert (display_plugin_actions);
+  gtk_ui_manager_insert_action_group (display_ui_manager, 
+                                      display_plugin_actions, 5 /* "back" */);
 
   /* load accelerators and prepare to later save them */
   accelfilename = dia_config_filename("menurc");
@@ -551,11 +518,10 @@
     g_free(accelfilename);
   }
   gtk_quit_add(1, save_accels, NULL);
-
 }
 
 void
-menus_get_toolbox_menubar (GtkWidget **menubar,
+menus_get_toolbox_menubar (GtkWidget     **menubar,
 			   GtkAccelGroup **accel_group)
 {
   if (initialise)
@@ -567,181 +533,193 @@
     *accel_group = toolbox_accels;
 }
 
-void
-menus_get_image_menu (GtkWidget **menu,
-		      GtkAccelGroup **accel_group)
+GtkWidget * 
+menus_get_display_popup (void)
 {
   if (initialise)
     menus_init();
 
-  if (menu)
-    *menu = display_menus;
-  if (accel_group)
-    *accel_group = display_accels;
+  return display_menubar;
+}
+
+GtkAccelGroup * 
+menus_get_display_accels (void)
+{
+  if (initialise)
+    menus_init();
+
+  return display_accels;
+}
+
+GtkWidget *
+menus_create_display_menubar (GtkUIManager   **ui_manager, 
+			      GtkActionGroup **actions)
+{
+  GtkActionGroup *tool_actions;
+  GtkActionGroup *plugin_actions;
+  GtkWidget      *menu_bar;
+  GError         *error = NULL;
+
+  *actions = gtk_action_group_new ("display-actions");
+  gtk_action_group_set_translation_domain (*actions, NULL);
+
+  gtk_action_group_add_actions (*actions, common_entries, 
+                G_N_ELEMENTS (common_entries), NULL);
+  gtk_action_group_add_actions (*actions, display_entries, 
+                G_N_ELEMENTS (display_entries), NULL);
+  gtk_action_group_add_toggle_actions (*actions, display_toggle_entries,
+                G_N_ELEMENTS (display_toggle_entries), 
+                NULL);
+  gtk_action_group_add_radio_actions (*actions,
+                    display_select_radio_entries,
+                    G_N_ELEMENTS (display_select_radio_entries),
+                    1,
+                    G_CALLBACK (select_style_callback),
+                    NULL);
+
+  tool_actions = create_tool_actions (); 
+
+  *ui_manager = gtk_ui_manager_new ();
+  gtk_ui_manager_insert_action_group (*ui_manager, *actions, 0);
+  gtk_ui_manager_insert_action_group (*ui_manager, tool_actions, 0);
+  if (!gtk_ui_manager_add_ui_from_file (*ui_manager,
+                    UIDATADIR"/display-ui.xml",
+                    &error)) {
+    g_warning ("building menus failed: %s", error->message);
+    g_error_free (error);
+    return NULL;
+  }
+
+  plugin_actions = add_plugin_actions (*ui_manager);
+  gtk_ui_manager_insert_action_group (*ui_manager, plugin_actions, 5 /* "back" */);
+  g_object_unref (plugin_actions);
+  plugin_actions = NULL;
+
+  menu_bar = gtk_ui_manager_get_widget (*ui_manager, "/DisplayMenu");
+  return menu_bar;
+}
+
+GtkAccelGroup *
+menus_get_accel_group ()
+{
+  return toolbox_accels;
+}
+
+GtkActionGroup *
+menus_get_action_group ()
+{
+  return toolbox_actions;
+}
+
+GtkAction *
+menus_get_action (const gchar *name)
+{
+  GtkAction *action;
+
+  action = gtk_action_group_get_action (toolbox_actions, name);
+  if (action == NULL) {
+    action = gtk_action_group_get_action (display_actions, name);
+  }
+
+  return action;
 }
 
 void
-menus_get_image_menubar (GtkWidget **menu, GtkItemFactory **display_mbar_item_factory)
-{
-    if (menu) 
-    {
-	GtkAccelGroup *display_mbar_accel_group;
-	display_mbar_accel_group = gtk_accel_group_new ();
-	*display_mbar_item_factory =  gtk_item_factory_new (GTK_TYPE_MENU_BAR,
-							    "<DisplayMBar>",
-							    display_mbar_accel_group);
-#ifdef ENABLE_NLS
-	gtk_item_factory_set_translate_func (*display_mbar_item_factory, 
-					     menu_translate,
-					     "<DisplayMBar>", NULL);
-#endif
-	gtk_item_factory_create_items (*display_mbar_item_factory,
-				       display_nmenu_items - 1,
-				       &(display_menu_items[1]), NULL);
-
-	*menu = gtk_item_factory_get_widget (*display_mbar_item_factory, "<DisplayMBar>");
-	menus_set_tools_callback ("<DisplayMBar>", *display_mbar_item_factory);
-    }
-}
-
-
-GtkWidget *
-menus_add_path (const gchar *path)
-{
-  GtkItemFactory *item_factory;
-  GtkItemFactoryEntry new_entry = { 0 };
-
-  new_entry.item_type = "<Item>";
-  new_entry.accelerator = NULL;
-  new_entry.callback = NULL;
-  new_entry.callback_action = 0;
-
-  if (strncmp(path, "<Display>/", strlen("<Display>/")) == 0) {
-    item_factory = display_item_factory;
-    new_entry.path = (gchar *) (path + strlen("<Display>"));
-  } else if (strncmp(path, "<Toolbox>/", strlen("<Toolbox>/")) == 0) {
-    item_factory = toolbox_item_factory;
-    new_entry.path = (gchar *) (path + strlen("<Toolbox>"));
-  } else {
-    g_warning("bad menu path `%s'", path);
-    return NULL;
-  }
-
-  gtk_item_factory_create_item(item_factory, &new_entry, NULL, 1);
-  return gtk_item_factory_get_widget(item_factory, path);
-}
-
-
-/*
-  Get a menu item widget from a path. 
-  In case of an item in the <DisplayMBar> menu bar, provide the corresponding 
-  item factory: ddisp->mbar_item_factory.
- */
-GtkMenuItem *
-menus_get_item_from_path (char *path, GtkItemFactory *item_factory)
-{
-  GtkWidget *wid = NULL;
-  GtkMenuItem *widget = NULL;
-
-  if (display_item_factory) {
-    wid =
-      gtk_item_factory_get_item(display_item_factory, path);
-    if (wid != NULL) widget = GTK_MENU_ITEM(wid);
-  }
+menus_set_recent (GtkActionGroup *actions)
+{
+  GList *list;
+  guint id;
+
+  if (recent_actions) {
+    menus_clear_recent ();
+  }
+
+  list = gtk_action_group_list_actions (actions);
+  g_return_if_fail (list);
+
+  recent_actions = actions;
+  g_object_ref (G_OBJECT (recent_actions));
+  gtk_ui_manager_insert_action_group (toolbox_ui_manager, 
+                    recent_actions, 
+                    10 /* insert at back */ );
+
+  do {
+    id = gtk_ui_manager_new_merge_id (toolbox_ui_manager);
+    recent_merge_ids = g_slist_prepend (recent_merge_ids, (gpointer) id);
+
+    gtk_ui_manager_add_ui (toolbox_ui_manager, id, 
+                 "/ToolboxMenu/File/FileRecentEnd", 
+                 gtk_action_get_name (GTK_ACTION (list->data)), 
+                 gtk_action_get_name (GTK_ACTION (list->data)), 
+                 GTK_UI_MANAGER_AUTO, 
+                 TRUE);
+
+  } while (NULL != (list = list->next));
+}
+
+void
+menus_clear_recent (void)
+{
+  GSList *id;
+
+  g_return_if_fail (recent_merge_ids);
+
+  id = recent_merge_ids;
+  do {
+    gtk_ui_manager_remove_ui (toolbox_ui_manager, (guint) id->data);
+
+  } while (NULL != (id = id->next));
+
+  g_slist_free (recent_merge_ids);
+  recent_merge_ids = NULL;
+
+  gtk_ui_manager_remove_action_group (toolbox_ui_manager, recent_actions);
+  g_object_unref (G_OBJECT (recent_actions));
+  recent_actions = NULL;
+}
+
+void 
+menus_initialize_updatable_items (UpdatableMenuItems *items, GtkActionGroup *actions)
+{
+  if (actions == NULL) {
+    actions = display_actions;
+  }
+
+    items->copy = gtk_action_group_get_action (actions, "EditCopy");
+    items->cut = gtk_action_group_get_action (actions, "EditCut");
+    items->paste = gtk_action_group_get_action (actions, "EditPaste");
+    items->edit_delete = gtk_action_group_get_action (actions, "EditDelete");
+    items->edit_duplicate = gtk_action_group_get_action (actions, "EditDuplicate");
+
+    items->copy_text = gtk_action_group_get_action (actions, "EditCopytext");
+    items->cut_text = gtk_action_group_get_action (actions, "EditCuttext");
+    items->paste_text = gtk_action_group_get_action (actions, "EditPastetext");
+
+    items->send_to_back = gtk_action_group_get_action (actions, "ObjectsSendtoback");
+    items->bring_to_front = gtk_action_group_get_action (actions, "ObjectsBringtofront");
+    items->send_backwards = gtk_action_group_get_action (actions, "ObjectsSendbackwards");
+    items->bring_forwards = gtk_action_group_get_action (actions, "ObjectsBringforwards");
   
-  if ((widget == NULL) && (item_factory)) {
-      wid = 
-	gtk_item_factory_get_item(item_factory, path);
-    if (wid != NULL) widget = GTK_MENU_ITEM(wid);
-  }
-  
-  if (widget == NULL) {
-    wid = 
-      gtk_item_factory_get_item(toolbox_item_factory, path);
-    if (wid != NULL) widget = GTK_MENU_ITEM(wid);
-  }
-
-  if (! widget) {
-    g_warning(_("Can't find menu entry '%s'!\nThis is probably a i18n problem "
-                "(try LANG=C)."), path);
-  }
-
-  return widget;
-}
-
-
-void
-menus_initialize_updatable_items (UpdatableMenuItems *items, 
-				  GtkItemFactory *factory, const char *display)
-{
-    static GString *path;
-    
-    path = g_string_new (display);
-    g_string_append (path,"/Edit/Copy");
-    items->copy = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Cut");
-    items->cut = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Paste");
-    items->paste = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Delete");
-    items->edit_delete = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Duplicate");
-    items->edit_duplicate = menus_get_item_from_path(path->str, factory);
-
-    g_string_append (g_string_assign(path, display),"/Edit/Copy Text");
-    items->copy_text = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Cut Text");
-    items->cut_text = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Edit/Paste Text");
-    items->paste_text = menus_get_item_from_path(path->str, factory);
-
-    g_string_append (g_string_assign(path, display),"/Objects/Send to Back");
-    items->send_to_back = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Bring to Front");
-    items->bring_to_front = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Send Backwards");
-    items->send_backwards = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Bring Forwards");
-    items->bring_forwards = menus_get_item_from_path(path->str, factory);
-  
-    g_string_append (g_string_assign(path, display),"/Objects/Group");
-    items->group = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Ungroup");
-    items->ungroup = menus_get_item_from_path(path->str, factory);
-
-    g_string_append (g_string_assign(path, display),"/Objects/Parent");
-    items->parent = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Unparent");
-    items->unparent = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Unparent Children");
-    items->unparent_children = menus_get_item_from_path(path->str, factory);
-
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Left");
-    items->align_h_l = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Center");
-    items->align_h_c = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Right");
-    items->align_h_r = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Spread Out Horizontally");
-    items->align_h_e = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Adjacent");
-    items->align_h_a = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Top");
-    items->align_v_t = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Middle");
-    items->align_v_c = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Bottom");
-    items->align_v_b = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Spread Out Vertically");
-    items->align_v_e = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Align/Stacked");
-    items->align_v_a = menus_get_item_from_path(path->str, factory);
-    g_string_append (g_string_assign(path, display),"/Objects/Properties...");
-    items->properties = menus_get_item_from_path(path->str, factory);
-    
-    g_string_free (path,TRUE);
-}
-
+    items->group = gtk_action_group_get_action (actions, "ObjectsGroup");
+    items->ungroup = gtk_action_group_get_action (actions, "ObjectsUngroup");
+
+    items->parent = gtk_action_group_get_action (actions, "ObjectsParent");
+    items->unparent = gtk_action_group_get_action (actions, "ObjectsUnparent");
+    items->unparent_children = gtk_action_group_get_action (actions, "ObjectsUnparentchildren");
+
+    items->align_h_l = gtk_action_group_get_action (actions, "ObjectsAlignLeft");
+    items->align_h_c = gtk_action_group_get_action (actions, "ObjectsAlignCenter");
+    items->align_h_r = gtk_action_group_get_action (actions, "ObjectsAlignRight");
+    items->align_h_e = gtk_action_group_get_action (actions, "ObjectsAlignSpreadouthorizontally");
+    items->align_h_a = gtk_action_group_get_action (actions, "ObjectsAlignAdjacent");
+    items->align_v_t = gtk_action_group_get_action (actions, "ObjectsAlignTop");
+    items->align_v_c = gtk_action_group_get_action (actions, "ObjectsAlignMiddle");
+    items->align_v_b = gtk_action_group_get_action (actions, "ObjectsAlignBottom");
+    items->align_v_e = gtk_action_group_get_action (actions, "ObjectsAlignSpreadoutvertically");
+    items->align_v_a = gtk_action_group_get_action (actions, "ObjectsAlignStacked");
+
+    items->properties = gtk_action_group_get_action (actions, "ObjectsProperties");
+}
 
 static void
 plugin_callback (GtkWidget *widget, gpointer data)

=== modified file 'a/app/menus.h'
--- a/app/menus.h	
+++ b/app/menus.h	
@@ -20,6 +20,10 @@
 
 #include <gtk/gtk.h>
 
+#define TOOLBOX_MENU "/ToolboxMenu"
+#define DISPLAY_MENU "/DisplayMenu"
+#define POPUP_MENU   "/PopupMenu"
+
 struct zoom_pair { const gchar *string; const gint value; };
 
 extern const struct zoom_pair zooms[10];
@@ -27,53 +31,56 @@
 /* all the menu items that can be updated */
 struct _UpdatableMenuItems 
 {
-  GtkMenuItem *copy;
-  GtkMenuItem *cut;
-  GtkMenuItem *paste;
-  GtkMenuItem *edit_delete;
-  GtkMenuItem *edit_duplicate;
-  GtkMenuItem *copy_text;
-  GtkMenuItem *cut_text;
-  GtkMenuItem *paste_text;
+  GtkAction *copy;
+  GtkAction *cut;
+  GtkAction *paste;
+  GtkAction *edit_delete;
+  GtkAction *edit_duplicate;
+  GtkAction *copy_text;
+  GtkAction *cut_text;
+  GtkAction *paste_text;
 
-  GtkMenuItem *send_to_back;
-  GtkMenuItem *bring_to_front;
-  GtkMenuItem *send_backwards;
-  GtkMenuItem *bring_forwards;
+  GtkAction *send_to_back;
+  GtkAction *bring_to_front;
+  GtkAction *send_backwards;
+  GtkAction *bring_forwards;
 
-  GtkMenuItem *group;
-  GtkMenuItem *ungroup;
+  GtkAction *group;
+  GtkAction *ungroup;
 
-  GtkMenuItem *parent;
-  GtkMenuItem *unparent;
-  GtkMenuItem *unparent_children;
+  GtkAction *parent;
+  GtkAction *unparent;
+  GtkAction *unparent_children;
 
-  GtkMenuItem *align_h_l;
-  GtkMenuItem *align_h_c;
-  GtkMenuItem *align_h_r;
-  GtkMenuItem *align_h_e;
-  GtkMenuItem *align_h_a;
+  GtkAction *align_h_l;
+  GtkAction *align_h_c;
+  GtkAction *align_h_r;
+  GtkAction *align_h_e;
+  GtkAction *align_h_a;
 
-  GtkMenuItem *align_v_t;
-  GtkMenuItem *align_v_c;
-  GtkMenuItem *align_v_b;
-  GtkMenuItem *align_v_e;
-  GtkMenuItem *align_v_a;
+  GtkAction *align_v_t;
+  GtkAction *align_v_c;
+  GtkAction *align_v_b;
+  GtkAction *align_v_e;
+  GtkAction *align_v_a;
 
-  GtkMenuItem *properties;
+  GtkAction *properties;
 };
 
 typedef struct _UpdatableMenuItems UpdatableMenuItems;
 
-void menus_get_toolbox_menubar (GtkWidget **menubar, GtkAccelGroup **accel);
-void menus_get_image_menu      (GtkWidget **menu,    GtkAccelGroup **accel);
-void menus_get_image_menubar   (GtkWidget **menu, GtkItemFactory **display_mbar_item_factory);
+void            menus_get_toolbox_menubar        (GtkWidget **menubar, GtkAccelGroup **accel);
+GtkWidget     * menus_get_display_popup          (void);
+GtkAccelGroup * menus_get_display_accels         (void);
+GtkWidget *     menus_create_display_menubar     (GtkUIManager **ui_manager, GtkActionGroup **actions);
+void            menus_initialize_updatable_items (UpdatableMenuItems *items, GtkActionGroup *actions);
 
-GtkMenuItem *menus_get_item_from_path(char *path, GtkItemFactory *item_factory);
-GtkWidget *menus_add_path           (const gchar *path);
-void menus_initialize_updatable_items (UpdatableMenuItems *items, 
-				       GtkItemFactory *factory, const char *display);
+GtkAccelGroup  * menus_get_accel_group  (void);
+GtkActionGroup * menus_get_action_group (void);
 
+GtkAction *     menus_get_action       (const gchar *name);
+void            menus_set_recent       (GtkActionGroup *actions);
+void            menus_clear_recent     (void);
 
 #endif /* MENUS_H */
 

=== modified file 'a/app/pixmaps/Makefile.am'
--- a/app/pixmaps/Makefile.am	
+++ b/app/pixmaps/Makefile.am	
@@ -8,8 +8,6 @@
 	on-grid.png \
 	off-grid.png \
 	visible.png \
-	visible-empty.png \
-	group.png \
-	ungroup.png
+	visible-empty.png
 
 EXTRA_DIST = $(IMAGES)

=== modified file 'a/app/recent_files.c'
--- a/app/recent_files.c	
+++ b/app/recent_files.c	
@@ -52,98 +52,57 @@
 static void open_recent_file_callback (GtkWidget *widget, gpointer data);
 void recent_file_history_remove (const char *fname);
 
-static GtkWidget *
-recent_file_filemenu_get(void)
-{
-    /* Use the Plugins menu item to get a pointer to the File menu,
-       but any item on the File menu will do */
-    
-    return GTK_WIDGET(menus_get_item_from_path(N_("<Toolbox>/File/Plugins..."),
-					       NULL))->parent;
-}
-
 static void
 recent_file_history_clear_menu()
 {
-    GtkWidget *file_menu = recent_file_filemenu_get();
-    GList *menu_items = GTK_MENU_SHELL(file_menu)->children;
-    GList *next_item;
-    
-    for (;menu_items != NULL; menu_items = next_item) {
-	GtkMenuItem *item;
-	next_item = g_list_next(menu_items);
-	item = GTK_MENU_ITEM(menu_items->data);
-	if (g_signal_handler_find(G_OBJECT(item), G_SIGNAL_MATCH_FUNC,
-				  0, 0, NULL, open_recent_file_callback, NULL)) {
-	    gtk_container_remove (GTK_CONTAINER (file_menu), GTK_WIDGET(item));
-	}
-    }
+	menus_clear_recent ();
 }
 
-/** Create a single menu item at position pos in the recent files list.
- * Pos starts from 0.
+/** 
+ * Build and insert the recent files menu.
  */
-static void
-recent_file_menuitem_create(GtkWidget *menu, gchar *filename, 
-			    guint pos, guint offset)
-{
-    gchar *basename, *label;
-    GtkWidget *item;
-    GtkAccelGroup *accel_group;
-    /* FIXME: filename encoding, but we need utf-8 here */
-    basename = g_path_get_basename(filename);
-    
-    label = g_strdup_printf("%d. %s", pos+1, basename);
-    item = gtk_menu_item_new_with_label(label);
-    gtk_menu_insert(GTK_MENU(menu), item,
-		    pos + offset);
-    
-    g_signal_connect(GTK_OBJECT(item), "activate",
-		     G_CALLBACK(open_recent_file_callback), filename);
-    
-    gtk_tooltips_set_tip(GTK_TOOLTIPS(tooltips), item,
-    			 filename, NULL);
-    
-    if (pos < 9)
-    {
-	accel_group = gtk_accel_group_new();
-	gtk_window_add_accel_group(GTK_WINDOW(interface_get_toolbox_shell()),
-				   accel_group);
-	gtk_widget_add_accelerator(item, "activate", accel_group,
-				   GDK_1 + pos,
-				   GDK_CONTROL_MASK, GTK_ACCEL_VISIBLE);
-    }
-    
-    gtk_widget_show(item);
-    
-    g_free(basename);
-    /* gtk_label_set_text() g_strdup's our label, so... */
-    g_free(label);
-}
-
-/** Build and insert the recent files menu */
 static void
 recent_file_history_make_menu()
 {
-    guint i;
+	GList *items;
+	GtkActionGroup *group;
+	GtkAction *action;
+	gchar *name;
+	gchar *file;
+	gchar *label;
+	gchar *accel;
+	gint i = 0;
 
-    GList *items = persistent_list_get_glist("recent-files");
+	items = persistent_list_get_glist ("recent-files");
+	g_return_if_fail (items != NULL);
 
-    GtkWidget *file_menu = recent_file_filemenu_get();
+	group = gtk_action_group_new ("recent-files");
 
-    GtkMenuItem *menu_item = 
-	menus_get_item_from_path(N_("<Toolbox>/File/Quit"), NULL);
+	for (i = 0; 
+		 items != NULL && i < prefs.recent_documents_list_size; 
+		 items = g_list_next(items), i++) {
 
-    GList *list_item = g_list_find(GTK_MENU_SHELL(file_menu)->children,
-				   (gpointer)menu_item);
-    
-    int offset = g_list_position(GTK_MENU_SHELL(file_menu)->children,
-			  list_item) - 1;  /* fudge factor */
+		name = g_strdup_printf ("FileRecent_%d", i);
+		file = g_path_get_basename ((const gchar *) items->data);
+		label = g_strdup_printf ("_%d. %s", i + 1, file);
 
-    for (i = 0; items != NULL && i < prefs.recent_documents_list_size;
-	 items = g_list_next(items), i++) {
-	recent_file_menuitem_create(file_menu, (gchar *)items->data, i, offset);
-    }
+		action = gtk_action_new (name, label, 
+								 (const gchar *) items->data, 
+								 NULL);
+		g_signal_connect (G_OBJECT (action), "activate", 
+						  G_CALLBACK (open_recent_file_callback), 
+						  items->data);
+
+		accel = g_strdup_printf ("<control>%d", i + 1);
+		gtk_action_group_add_action_with_accel (group, action, accel);
+		
+		g_free (name);  name = NULL;
+		g_free (file);  file = NULL;
+		g_free (label); label = NULL;
+		g_free (accel); accel = NULL;
+	}
+
+	menus_set_recent (group);
 }
 
 /** Add a new item to the file history list.

=== modified file 'a/configure.in'
--- a/configure.in	
+++ b/configure.in	
@@ -341,6 +341,11 @@
 
 CFLAGS="${CFLAGS} ${Z_CFLAGS}"
 LIBS="${LIBS} ${Z_LIBS}"
+
+
+dnl Path to UI resources
+AC_SUBST(uidatadir, '${pkgdatadir}/ui')
+
 
 dnl Platform-specific fixes.
 dnl 
@@ -507,6 +512,7 @@
 plug-ins/wpg/Makefile
 plug-ins/xfig/Makefile
 plug-ins/xslt/Makefile
+data/Makefile
 doc/Makefile
 doc/en/Makefile
 doc/eu/Makefile

=== modified file 'a/lib/filter.h'
--- a/lib/filter.h	
+++ b/lib/filter.h	
@@ -68,6 +68,7 @@
                                   void* user_data);
 
 struct _DiaCallbackFilter {
+  const gchar *action;
   const gchar *description;
   const gchar *menupath;
   DiaCallbackFunc callback;

=== modified file 'a/plug-ins/python/diamodule.c'
--- a/plug-ins/python/diamodule.c	
+++ b/plug-ins/python/diamodule.c	
@@ -371,6 +371,39 @@
     Py_INCREF(func); /* stay alive, where to kill ?? */
 
     filter = g_new0 (DiaCallbackFilter, 1);
+    filter->description = g_strdup (desc);
+    filter->menupath = g_strdup (menupath);
+    filter->callback = &PyDia_callback_func;
+    filter->user_data = func;
+
+    filter_register_callback(filter);
+
+    Py_INCREF(Py_None);
+    return Py_None;
+}
+
+static PyObject *
+PyDia_RegisterAction(PyObject *self, PyObject *args)
+{
+	gchar *action;
+    gchar *desc;
+    gchar *menupath;
+    PyObject *func;
+    DiaCallbackFilter *filter;
+
+    if (!PyArg_ParseTuple(args, "sssO:dia.register_action",
+			  &action, &desc, &menupath, &func))
+	return NULL;
+
+    if (!PyCallable_Check(func)) {
+        PyErr_SetString(PyExc_TypeError, "third parameter must be callable");
+        return NULL;
+    }
+
+    Py_INCREF(func); /* stay alive, where to kill ?? */
+
+    filter = g_new0 (DiaCallbackFilter, 1);
+	filter->action = g_strdup (action);
     filter->description = g_strdup (desc);
     filter->menupath = g_strdup (menupath);
     filter->callback = &PyDia_callback_func;
@@ -428,6 +461,9 @@
       "allows to register an import filter written in Python, that is mainly a callback function which fills the"
       "given DiaDiagramData from the given filename" },
     { "register_callback", PyDia_RegisterCallback, METH_VARARGS,
+      "register a callback function which appears in the menu. Depending on the menu path used during registration"
+      "the callback gets called with the current DiaDiagramData object" },
+    { "register_action", PyDia_RegisterAction, METH_VARARGS,
       "register a callback function which appears in the menu. Depending on the menu path used during registration"
       "the callback gets called with the current DiaDiagramData object" },
     { NULL, NULL }

=== modified file 'a/plug-ins/python/otypes.py'
--- a/plug-ins/python/otypes.py	
+++ b/plug-ins/python/otypes.py	
@@ -172,6 +172,6 @@
 	diagram.update_extents()
 	diagram.flush()
 
-dia.register_callback ("Dia Object Types", 
-                       "<Toolbox>/Help/Self Doc/Object Types", 
-                       otypes_cb)
+dia.register_action ("HelpOtypes", "Dia Object Types",
+                     "/ToolboxMenu/Help/HelpExtensionStart", 
+                     otypes_cb)

=== modified file 'a/plug-ins/python/pydiadoc.py'
--- a/plug-ins/python/pydiadoc.py	
+++ b/plug-ins/python/pydiadoc.py	
@@ -141,6 +141,6 @@
 	diagram.update_extents()
 	diagram.flush()
 
-dia.register_callback ("PyDia Auto Documentation", 
-                       "<Toolbox>/Help/Self Doc/PyDia Docs", 
+dia.register_action ("HelpPydia", "PyDia Docs", 
+                       "/ToolboxMenu/Help/HelpExtensionStart", 
                        autodoc_cb)

