[pdfmod] Remove Action suffix from all actions



commit 297c9a63753630260b63881318c0ba71c2669643
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Mon Aug 10 10:24:25 2009 -0700

    Remove Action suffix from all actions

 src/PdfMod/PdfMod/GlobalActions.cs     |  120 ++++++++++++++++----------------
 src/PdfMod/PdfMod/MetadataEditorBox.cs |    2 +-
 src/PdfMod/PdfMod/PdfIconView.cs       |    4 +-
 src/PdfMod/PdfMod/PdfMod.cs            |    2 +-
 src/PdfMod/Resources/UIManager.xml     |  100 +++++++++++++-------------
 5 files changed, 114 insertions(+), 114 deletions(-)
---
diff --git a/src/PdfMod/PdfMod/GlobalActions.cs b/src/PdfMod/PdfMod/GlobalActions.cs
index 52f49c6..0dbc2af 100644
--- a/src/PdfMod/PdfMod/GlobalActions.cs
+++ b/src/PdfMod/PdfMod/GlobalActions.cs
@@ -24,12 +24,12 @@ namespace PdfMod
         private const string WIKI_URL = "http://live.gnome.org/PdfMod";;
 
         private static string [] require_doc_actions = new string[] {
-            "SaveAction", "SaveAsAction", "PropertiesAction", "UndoAction", "RedoAction", "ZoomFitAction", "OpenInViewerAction",
-            "SelectAllAction", "SelectEvensAction", "SelectOddsAction", "SelectMatchingAction", "InsertFromAction", "ExportImagesAction"
+            "Save", "SaveAs", "Properties", "Undo", "Redo", "ZoomFit", "OpenInViewer",
+            "SelectAll", "SelectEvens", "SelectOdds", "SelectMatching", "InsertFrom", "ExportImages"
         };
 
         private static string [] require_page_actions = new string[] {
-            "RemoveAction", "ExtractAction", "RotateRightAction", "RotateLeftAction"
+            "Remove", "Extract", "RotateRight", "RotateLeft"
         };
 
         public UndoManager UndoManager {
@@ -42,56 +42,56 @@ namespace PdfMod
             undo_manager = new UndoManager ();
 
             AddImportant (
-                new ActionEntry ("OpenAction",   Gtk.Stock.Open,   null, "<control>O", Catalog.GetString ("Open a document"), OnOpen),
-                new ActionEntry ("InsertFromAction", Gtk.Stock.Add, Catalog.GetString("_Insert From..."), null, Catalog.GetString("Insert pages from another document"), OnInsertFrom),
-                new ActionEntry ("SaveAction",   Gtk.Stock.Save,   null, "<control>S", Catalog.GetString ("Save changes to this document, overwriting the existing file"), OnSave),
-                new ActionEntry ("SaveAsAction", Gtk.Stock.SaveAs, null, "<control><shift>S", Catalog.GetString ("Save this document to a new file"), OnSaveAs),
-
-                new ActionEntry ("FileMenuAction", null, Catalog.GetString ("_File"), null, null, null),
-                new ActionEntry ("RecentMenuAction", null, Catalog.GetString ("Recent _Files"), null, null, null),
-                new ActionEntry ("CloseAction", Gtk.Stock.Close, null, "<control>W", null, OnClose),
-                new ActionEntry ("RemoveAction", Gtk.Stock.Remove, null, "Delete", null, OnRemove),
-                new ActionEntry ("ExtractAction", Gtk.Stock.New, null, null, null, OnExtractPages),
-                new ActionEntry ("RotateRightAction", null, Catalog.GetString ("Rotate Right"), "bracketright", Catalog.GetString ("Rotate right"), OnRotateRight),
-                new ActionEntry ("RotateLeftAction", null, Catalog.GetString ("Rotate Left"), "bracketleft", Catalog.GetString ("Rotate left"), OnRotateLeft),
-                new ActionEntry ("ExportImagesAction", null, Catalog.GetString ("Export Images"), null, Catalog.GetString ("Save all images in this document to a new folder"), OnExportImages),
-
-                new ActionEntry ("EditMenuAction", null, Catalog.GetString ("_Edit"), null, null, null),
-                new ActionEntry ("SelectAllAction", Stock.SelectAll, null, "<control>A", null, OnSelectAll),
-                new ActionEntry ("SelectEvensAction", null, Catalog.GetString ("Select Even Pages"), null, null, OnSelectEvens),
-                new ActionEntry ("SelectOddsAction", null, Catalog.GetString ("Select Odd Pages"), null, null, OnSelectOdds),
-                new ActionEntry ("SelectMatchingAction", null, Catalog.GetString ("Select Matching..."), "<control>F", null, OnSelectMatching),
-                new ActionEntry ("UndoAction", Stock.Undo, null, "<control>z", null, OnUndo),
-                new ActionEntry ("RedoAction", Stock.Redo, null, "<control>y", null, OnRedo),
-
-                new ActionEntry ("ViewMenuAction", null, Catalog.GetString ("_View"), null, null, null),
-                new ActionEntry ("ZoomInAction", Stock.ZoomIn, null, "<control>plus", null, OnZoomIn),
-                new ActionEntry ("ZoomOutAction", Stock.ZoomOut, null, "<control>minus", null, OnZoomOut),
-
-                new ActionEntry ("HelpMenuAction", null, Catalog.GetString ("_Help"), null, null, null),
-                new ActionEntry ("HelpAction", Stock.Help, Catalog.GetString ("_Contents"), "F1", null, OnHelp),
-                new ActionEntry ("AboutAction", Stock.About, null, null, null, OnAbout),
-
-                new ActionEntry ("PageContextMenuAction", null, "", null, null, OnPageContextMenu),
-
-                new ActionEntry ("OpenInViewerAction", null, Catalog.GetString ("Open in Viewer"), "F5", Catalog.GetString ("Open in viewer"), OnOpenInViewer)
+                new ActionEntry ("Open",   Gtk.Stock.Open,   null, "<control>O", Catalog.GetString ("Open a document"), OnOpen),
+                new ActionEntry ("InsertFrom", Gtk.Stock.Add, Catalog.GetString("_Insert From..."), null, Catalog.GetString("Insert pages from another document"), OnInsertFrom),
+                new ActionEntry ("Save",   Gtk.Stock.Save,   null, "<control>S", Catalog.GetString ("Save changes to this document, overwriting the existing file"), OnSave),
+                new ActionEntry ("SaveAs", Gtk.Stock.SaveAs, null, "<control><shift>S", Catalog.GetString ("Save this document to a new file"), OnSaveAs),
+
+                new ActionEntry ("FileMenu", null, Catalog.GetString ("_File"), null, null, null),
+                new ActionEntry ("RecentMenu", null, Catalog.GetString ("Recent _Files"), null, null, null),
+                new ActionEntry ("Close", Gtk.Stock.Close, null, "<control>W", null, OnClose),
+                new ActionEntry ("Remove", Gtk.Stock.Remove, null, "Delete", null, OnRemove),
+                new ActionEntry ("Extract", Gtk.Stock.New, null, null, null, OnExtractPages),
+                new ActionEntry ("RotateRight", null, Catalog.GetString ("Rotate Right"), "bracketright", Catalog.GetString ("Rotate right"), OnRotateRight),
+                new ActionEntry ("RotateLeft", null, Catalog.GetString ("Rotate Left"), "bracketleft", Catalog.GetString ("Rotate left"), OnRotateLeft),
+                new ActionEntry ("ExportImages", null, Catalog.GetString ("Export Images"), null, Catalog.GetString ("Save all images in this document to a new folder"), OnExportImages),
+
+                new ActionEntry ("EditMenu", null, Catalog.GetString ("_Edit"), null, null, null),
+                new ActionEntry ("SelectAll", Stock.SelectAll, null, "<control>A", null, OnSelectAll),
+                new ActionEntry ("SelectEvens", null, Catalog.GetString ("Select Even Pages"), null, null, OnSelectEvens),
+                new ActionEntry ("SelectOdds", null, Catalog.GetString ("Select Odd Pages"), null, null, OnSelectOdds),
+                new ActionEntry ("SelectMatching", null, Catalog.GetString ("Select Matching..."), "<control>F", null, OnSelectMatching),
+                new ActionEntry ("Undo", Stock.Undo, null, "<control>z", null, OnUndo),
+                new ActionEntry ("Redo", Stock.Redo, null, "<control>y", null, OnRedo),
+
+                new ActionEntry ("ViewMenu", null, Catalog.GetString ("_View"), null, null, null),
+                new ActionEntry ("ZoomIn", Stock.ZoomIn, null, "<control>plus", null, OnZoomIn),
+                new ActionEntry ("ZoomOut", Stock.ZoomOut, null, "<control>minus", null, OnZoomOut),
+
+                new ActionEntry ("HelpMenu", null, Catalog.GetString ("_Help"), null, null, null),
+                new ActionEntry ("Help", Stock.Help, Catalog.GetString ("_Contents"), "F1", null, OnHelp),
+                new ActionEntry ("About", Stock.About, null, null, null, OnAbout),
+
+                new ActionEntry ("PageContextMenu", null, "", null, null, OnPageContextMenu),
+
+                new ActionEntry ("OpenInViewer", null, Catalog.GetString ("Open in Viewer"), "F5", Catalog.GetString ("Open in viewer"), OnOpenInViewer)
             );
 
             AddImportant (
-                new ToggleActionEntry ("PropertiesAction", Stock.Properties, null, "<alt>Return", Catalog.GetString ("View and edit the title, keywords, and more for this document"), OnProperties, false),
-                new ToggleActionEntry ("ZoomFitAction", Stock.ZoomFit, null, "<control>0", null, OnZoomFit, true),
+                new ToggleActionEntry ("Properties", Stock.Properties, null, "<alt>Return", Catalog.GetString ("View and edit the title, keywords, and more for this document"), OnProperties, false),
+                new ToggleActionEntry ("ZoomFit", Stock.ZoomFit, null, "<control>0", null, OnZoomFit, true),
                 new ToggleActionEntry ("ViewToolbar", null, Catalog.GetString ("Toolbar"), null, null, OnViewToolbar, true)
             );
 
-            this["RotateRightAction"].IconName = "object-rotate-right";
-            this["RotateLeftAction"].IconName = "object-rotate-left";
-            this["ExportImagesAction"].IconName = "image-x-generic";
+            this["RotateRight"].IconName = "object-rotate-right";
+            this["RotateLeft"].IconName = "object-rotate-left";
+            this["ExportImages"].IconName = "image-x-generic";
 
-            // Don't show HelpAction unless we can at least access some of the GNOME api
-            UpdateAction ("HelpAction", false);
+            // Don't show Help unless we can at least access some of the GNOME api
+            UpdateAction ("Help", false);
             try {
                 Gnome.Program.Get ();
-                UpdateAction ("HelpAction", true);
+                UpdateAction ("Help", true);
             } catch {}
 
             Update ();
@@ -107,19 +107,19 @@ namespace PdfMod
             Register ();
 
             // Add additional menu item keybindings
-            var item = ActionManager.UIManager.GetWidget ("/MainMenu/ViewMenu/ZoomInAction");
+            var item = ActionManager.UIManager.GetWidget ("/MainMenu/ViewMenu/ZoomIn");
             item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint) Gdk.Key.KP_Add, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible);
             item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint) Gdk.Key.equal, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible);
 
-            item = ActionManager.UIManager.GetWidget ("/MainMenu/ViewMenu/ZoomOutAction");
+            item = ActionManager.UIManager.GetWidget ("/MainMenu/ViewMenu/ZoomOut");
             item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint) Gdk.Key.KP_Subtract, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible);
             item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint) Gdk.Key.underscore, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible);
 
-            item = ActionManager.UIManager.GetWidget ("/MainMenu/FileMenu/CloseAction");
+            item = ActionManager.UIManager.GetWidget ("/MainMenu/FileMenu/Close");
             item.AddAccelerator ("activate", ActionManager.UIManager.AccelGroup, (uint) Gdk.Key.q, Gdk.ModifierType.ControlMask, Gtk.AccelFlags.Visible);
 
             // Set up recent documents menu
-            MenuItem recent_item = ActionManager.UIManager.GetWidget ("/MainMenu/FileMenu/RecentMenuAction") as MenuItem;
+            MenuItem recent_item = ActionManager.UIManager.GetWidget ("/MainMenu/FileMenu/RecentMenu") as MenuItem;
             var recent_chooser_item = new RecentChooserMenu (RecentManager.Default) {
                 Filter = new RecentFilter (),
                 SortType = RecentSortType.Mru
@@ -146,34 +146,34 @@ namespace PdfMod
             foreach (string action in require_page_actions)
                 UpdateAction (action, true, have_page);
 
-            UpdateAction ("UndoAction", true, have_doc && undo_manager.CanUndo);
-            UpdateAction ("RedoAction", true, have_doc && undo_manager.CanRedo);
+            UpdateAction ("Undo", true, have_doc && undo_manager.CanUndo);
+            UpdateAction ("Redo", true, have_doc && undo_manager.CanRedo);
 
             var undo = undo_manager.UndoAction as IDescribedUndoAction;
-            this["UndoAction"].Label = undo == null
+            this["Undo"].Label = undo == null
                 ? Catalog.GetString ("_Undo")
                 : String.Format (Catalog.GetString ("Undo {0}"), undo.Description);
 
             var redo = undo_manager.RedoAction as IDescribedUndoAction;
-            this["RedoAction"].Label = redo == null
+            this["Redo"].Label = redo == null
                 ? Catalog.GetString ("_Redo")
                 : String.Format (Catalog.GetString ("Redo {0}"), redo.Description);
 
-            UpdateActions (true, have_doc && app.Document.HasUnsavedChanged, "SaveAction", "SaveAsAction");
-            UpdateAction ("ZoomInAction", true, have_doc && app.IconView.CanZoomIn);
-            UpdateAction ("ZoomOutAction", true, have_doc && app.IconView.CanZoomOut);
+            UpdateActions (true, have_doc && app.Document.HasUnsavedChanged, "Save", "SaveAs");
+            UpdateAction ("ZoomIn", true, have_doc && app.IconView.CanZoomIn);
+            UpdateAction ("ZoomOut", true, have_doc && app.IconView.CanZoomOut);
 
             int selection_count = app.IconView.SelectedItems.Length;
-            this["RemoveAction"].Label = String.Format (Catalog.GetPluralString (
+            this["Remove"].Label = String.Format (Catalog.GetPluralString (
                 "Remove Page", "Remove {0} Pages", selection_count),
                 selection_count);
-            this["RemoveAction"].Tooltip = String.Format (Catalog.GetPluralString (
+            this["Remove"].Tooltip = String.Format (Catalog.GetPluralString (
                 "Remove the selected page", "Remove the {0} selected pages", selection_count),
                 selection_count);
-            this["ExtractAction"].Label = String.Format (Catalog.GetPluralString (
+            this["Extract"].Label = String.Format (Catalog.GetPluralString (
                 "Extract Page", "Extract {0} Pages", selection_count),
                 selection_count);
-            this["ExtractAction"].Tooltip = String.Format (Catalog.GetPluralString (
+            this["Extract"].Tooltip = String.Format (Catalog.GetPluralString (
                 "Extract the selected page", "Extract the {0} selected pages", selection_count),
                 selection_count);
         }
@@ -255,7 +255,7 @@ namespace PdfMod
 
         private void OnProperties (object o, EventArgs args)
         {
-            app.EditorBox.Visible = (this["PropertiesAction"] as ToggleAction).Active;
+            app.EditorBox.Visible = (this["Properties"] as ToggleAction).Active;
             if (app.EditorBox.Visible) {
                 app.EditorBox.GrabFocus ();
             }
diff --git a/src/PdfMod/PdfMod/MetadataEditorBox.cs b/src/PdfMod/PdfMod/MetadataEditorBox.cs
index 341c888..0197fd7 100644
--- a/src/PdfMod/PdfMod/MetadataEditorBox.cs
+++ b/src/PdfMod/PdfMod/MetadataEditorBox.cs
@@ -151,7 +151,7 @@ namespace PdfMod
 
         public new void Hide ()
         {
-            (app.GlobalActions["PropertiesAction"] as Gtk.ToggleAction).Active = false;
+            (app.GlobalActions["Properties"] as Gtk.ToggleAction).Active = false;
             base.Hide ();
             app.IconView.GrabFocus ();
         }
diff --git a/src/PdfMod/PdfMod/PdfIconView.cs b/src/PdfMod/PdfMod/PdfIconView.cs
index 5fd3ed0..001de0b 100644
--- a/src/PdfMod/PdfMod/PdfIconView.cs
+++ b/src/PdfMod/PdfMod/PdfIconView.cs
@@ -160,7 +160,7 @@ namespace PdfMod
 
         private void HandlePopupMenu (object o, PopupMenuArgs args)
         {
-            app.GlobalActions["PageContextMenuAction"].Activate ();
+            app.GlobalActions["PageContextMenu"].Activate ();
         }
 
         #endregion
@@ -420,7 +420,7 @@ namespace PdfMod
 
             if (!zoom_manually_set) {
                 zoom_manually_set = true;
-                (app.GlobalActions["ZoomFitAction"] as ToggleAction).Active = false;
+                (app.GlobalActions["ZoomFit"] as ToggleAction).Active = false;
             }
 
             int new_width = ItemWidth + pixels;
diff --git a/src/PdfMod/PdfMod/PdfMod.cs b/src/PdfMod/PdfMod/PdfMod.cs
index 02c5777..15f85b7 100644
--- a/src/PdfMod/PdfMod/PdfMod.cs
+++ b/src/PdfMod/PdfMod/PdfMod.cs
@@ -170,7 +170,7 @@ namespace PdfMod
                 message_dialog.Destroy ();
                 switch (response) {
                     case ResponseType.Ok:
-                        GlobalActions["SaveAsAction"].Activate ();
+                        GlobalActions["SaveAs"].Activate ();
                         return PromptIfUnsavedChanges ();
                     case ResponseType.Close:
                         return false;
diff --git a/src/PdfMod/Resources/UIManager.xml b/src/PdfMod/Resources/UIManager.xml
index 94c4972..288df54 100644
--- a/src/PdfMod/Resources/UIManager.xml
+++ b/src/PdfMod/Resources/UIManager.xml
@@ -1,78 +1,78 @@
 <ui>
-  <menubar name="MainMenu" action="MainMenuAction">
-    <menu name="FileMenu" action="FileMenuAction">
-      <menuitem action="OpenAction"/>
-      <menuitem action="SaveAction"/>
-      <menuitem action="SaveAsAction"/>
-      <menuitem action="RecentMenuAction"/>
+  <menubar action="MainMenu">
+    <menu action="FileMenu">
+      <menuitem action="Open"/>
+      <menuitem action="Save"/>
+      <menuitem action="SaveAs"/>
+      <menuitem action="RecentMenu"/>
       <separator/>
-      <menuitem action="ExportImagesAction"/>
-      <menuitem action="InsertFromAction"/>
+      <menuitem action="ExportImages"/>
+      <menuitem action="InsertFrom"/>
       <separator/>
-      <menuitem action="PropertiesAction"/>
+      <menuitem action="Properties"/>
       <separator/>
-      <menuitem action="CloseAction"/>
+      <menuitem action="Close"/>
     </menu>
-    <menu name="EditMenu" action="EditMenuAction">
-      <menuitem action="UndoAction"/>
-      <menuitem action="RedoAction"/>
+    <menu action="EditMenu">
+      <menuitem action="Undo"/>
+      <menuitem action="Redo"/>
       <separator/>
-      <menuitem action="ExtractAction"/>
-      <menuitem action="RemoveAction"/>
+      <menuitem action="Extract"/>
+      <menuitem action="Remove"/>
       <separator/>
-      <menuitem action="RotateLeftAction"/>
-      <menuitem action="RotateRightAction"/>
-      <!--<menuitem action="RotateArbitraryAction"/>-->
+      <menuitem action="RotateLeft"/>
+      <menuitem action="RotateRight"/>
+      <!--<menuitem action="RotateArbitrary"/>-->
       <separator/>
-      <menuitem action="SelectAllAction"/>
-      <menuitem action="SelectOddsAction"/>
-      <menuitem action="SelectEvensAction"/>
-      <menuitem action="SelectMatchingAction"/>
+      <menuitem action="SelectAll"/>
+      <menuitem action="SelectOdds"/>
+      <menuitem action="SelectEvens"/>
+      <menuitem action="SelectMatching"/>
       <separator/>
     </menu>
-    <menu name="ViewMenu" action="ViewMenuAction">
-      <menuitem action="ZoomInAction"/>
-      <menuitem action="ZoomOutAction"/>
-      <menuitem action="ZoomFitAction"/>
+    <menu action="ViewMenu">
+      <menuitem action="ZoomIn"/>
+      <menuitem action="ZoomOut"/>
+      <menuitem action="ZoomFit"/>
       <separator/>
-      <menuitem action="OpenInViewerAction"/>
+      <menuitem action="OpenInViewer"/>
       <separator/>
       <menuitem action="ViewToolbar"/>
     </menu>
-    <menu name="HelpMenu" action="HelpMenuAction">
-      <menuitem action="HelpAction"/>
-      <menuitem action="AboutAction"/>
+    <menu action="HelpMenu">
+      <menuitem action="Help"/>
+      <menuitem action="About"/>
     </menu>
   </menubar>
 
   <toolbar name="HeaderToolbar">
-    <toolitem action="OpenAction"/>
-    <toolitem action="SaveAsAction"/>
+    <toolitem action="Open"/>
+    <toolitem action="SaveAs"/>
     <separator/>
-    <toolitem action="PropertiesAction"/>
-    <toolitem action="ExportImagesAction"/>
-    <toolitem action="InsertFromAction"/>
+    <toolitem action="Properties"/>
+    <toolitem action="ExportImages"/>
+    <toolitem action="InsertFrom"/>
     <separator/>
-    <toolitem action="ExtractAction"/>
-    <toolitem action="RemoveAction"/>
-    <toolitem action="RotateLeftAction"/>
-    <toolitem action="RotateRightAction"/>
+    <toolitem action="Extract"/>
+    <toolitem action="Remove"/>
+    <toolitem action="RotateLeft"/>
+    <toolitem action="RotateRight"/>
     <separator/>
-    <!-- Commented out until we have a good icon <toolitem action="OpenInViewerAction"/>-->
+    <!-- Commented out until we have a good icon <toolitem action="OpenInViewer"/>-->
   </toolbar>
 
-  <popup name="PageContextMenu" action="PageContextMenuAction">
-    <menuitem action="ExtractAction"/>
-    <menuitem action="RemoveAction"/>
+  <popup action="PageContextMenu">
+    <menuitem action="Extract"/>
+    <menuitem action="Remove"/>
     <separator/>
-    <menuitem action="RotateLeftAction"/>
-    <menuitem action="RotateRightAction"/>
-    <!--<menuitem action="RotateArbitraryAction"/>-->
+    <menuitem action="RotateLeft"/>
+    <menuitem action="RotateRight"/>
+    <!--<menuitem action="RotateArbitrary"/>-->
     <separator/>
-    <menuitem action="SelectAllAction"/>
-    <menuitem action="SelectOddsAction"/>
-    <menuitem action="SelectEvensAction"/>
-    <menuitem action="SelectMatchingAction"/>
+    <menuitem action="SelectAll"/>
+    <menuitem action="SelectOdds"/>
+    <menuitem action="SelectEvens"/>
+    <menuitem action="SelectMatching"/>
     <separator/>
   </popup>
 </ui>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]