[gnome-chess] Revert "Swap Pause/Resume menu label as appropriate"



commit 3bc8f09d1dceb71585345d33504a8a6663441e5a
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Feb 16 15:39:30 2014 -0600

    Revert "Swap Pause/Resume menu label as appropriate"
    
    This reverts commit af1d76a4dcde59be1f1bbc1226b8e508da3eae2f.
    
    Let's use a button for Pause instead.

 data/menu.ui         |   18 ++++++++++++++++++
 src/gnome-chess.vala |   23 ++++-------------------
 2 files changed, 22 insertions(+), 19 deletions(-)
---
diff --git a/data/menu.ui b/data/menu.ui
index 4bc1f5b..cf1ec74 100644
--- a/data/menu.ui
+++ b/data/menu.ui
@@ -25,4 +25,22 @@
       </item>
     </section>
   </menu>
+  <menu id="windowmenu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Save As…</attribute>
+        <attribute name="action">win.save-as</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Claim Draw</attribute>
+        <attribute name="action">win.claim-draw</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Resign</attribute>
+        <attribute name="action">win.resign</attribute>
+      </item>
+    </section>
+  </menu>
 </interface>
diff --git a/src/gnome-chess.vala b/src/gnome-chess.vala
index ee7140d..af27573 100644
--- a/src/gnome-chess.vala
+++ b/src/gnome-chess.vala
@@ -118,6 +118,8 @@ public class Application : Gtk.Application
         var app_menu = (Menu) builder.get_object ("appmenu");
         set_app_menu (app_menu);
 
+        var window_menu = (Menu) builder.get_object ("windowmenu");
+
         try
         {
             builder.add_from_file (Path.build_filename (PKGDATADIR, "gnome-chess.ui", null));
@@ -153,6 +155,8 @@ public class Application : Gtk.Application
         undo_move_image.icon_name = rtl ? "edit-undo-rtl-symbolic" : "edit-undo-symbolic";
 
         window.add_action_entries (window_entries, this);
+        menu_button.set_menu_model (window_menu);
+
         add_window (window);
 
         scene = new ChessScene ();
@@ -214,7 +218,6 @@ public class Application : Gtk.Application
         }
 
         add_accelerators ();
-        update_window_menu ();
         show ();
     }
 
@@ -1077,23 +1080,6 @@ public class Application : Gtk.Application
         add_accelerator ("Pause", "win." + PAUSE_RESUME_ACTION_NAME, null);
     }
 
-    private void update_window_menu ()
-    {
-        var window_menu = new Menu ();
-
-        var section = new Menu ();
-        section.append (_("Save As…"), "win." + SAVE_GAME_AS_ACTION_NAME);
-        if (game.is_paused)
-            section.append (_("Resume"), "win." + PAUSE_RESUME_ACTION_NAME);
-        else
-            section.append (_("Pause"), "win." + PAUSE_RESUME_ACTION_NAME);
-        section.append (_("Claim Draw"), "win." + CLAIM_DRAW_ACTION_NAME);
-        section.append (_("Resign"), "win." + RESIGN_ACTION_NAME);
-        window_menu.append_section (null, section);
-
-        menu_button.set_menu_model (window_menu);
-    }
-
     private void game_end_cb (ChessGame game)
     {
         disable_window_action (RESIGN_ACTION_NAME);
@@ -1366,7 +1352,6 @@ public class Application : Gtk.Application
 
         update_history_panel ();
         update_action_status ();
-        update_window_menu ();
     }
 
     public void quit_cb ()


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