[hitori] Move the board size preference to the app menu



commit 236fc7a90900f310f84af97b24ff2b4f515558ee
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Jun 4 23:05:05 2014 -0500

    Move the board size preference to the app menu
    
    We're going to treat this as an application-level preference.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=731312

 data/hitori.ui  |   54 ++++++++++++++++++++++++++++--------------------------
 src/interface.c |    4 ++--
 2 files changed, 30 insertions(+), 28 deletions(-)
---
diff --git a/data/hitori.ui b/data/hitori.ui
index 5088b00..a01cad4 100644
--- a/data/hitori.ui
+++ b/data/hitori.ui
@@ -10,61 +10,63 @@
                        </item>
                </section>
                <section>
-                       <item>
-                               <attribute name="action">app.help</attribute>
-                               <attribute name="label" translatable="yes">_Help</attribute>
-                               <attribute name="accel">F1</attribute>
-                       </item>
-                       <item>
-                               <attribute name="action">app.about</attribute>
-                               <attribute name="label" translatable="yes">_About</attribute>
-                       </item>
-                       <item>
-                               <attribute name="action">app.quit</attribute>
-                               <attribute name="label" translatable="yes">_Quit</attribute>
-                               <attribute name="accel">&lt;Primary&gt;q</attribute>
-                       </item>
-               </section>
-       </menu>
-
-       <menu id="win_menu">
-               <submenu>
-                       <attribute name="label" translatable="yes">_Game</attribute>
                        <submenu id="board_size_menu">
                                <attribute name="label" translatable="yes">Board _Size</attribute>
                                <section>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">5×5</attribute>
                                                <attribute name="target">5</attribute>
                                        </item>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">6×6</attribute>
                                                <attribute name="target">6</attribute>
                                        </item>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">7×7</attribute>
                                                <attribute name="target">7</attribute>
                                        </item>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">8×8</attribute>
                                                <attribute name="target">8</attribute>
                                        </item>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">9×9</attribute>
                                                <attribute name="target">9</attribute>
                                        </item>
                                        <item>
-                                               <attribute name="action">win.board-size</attribute>
+                                               <attribute name="action">app.board-size</attribute>
                                                <attribute name="label" translatable="yes">10×10</attribute>
                                                <attribute name="target">10</attribute>
                                        </item>
                                </section>
                        </submenu>
+               </section>
+               <section>
+                       <item>
+                               <attribute name="action">app.help</attribute>
+                               <attribute name="label" translatable="yes">_Help</attribute>
+                               <attribute name="accel">F1</attribute>
+                       </item>
+                       <item>
+                               <attribute name="action">app.about</attribute>
+                               <attribute name="label" translatable="yes">_About</attribute>
+                       </item>
+                       <item>
+                               <attribute name="action">app.quit</attribute>
+                               <attribute name="label" translatable="yes">_Quit</attribute>
+                               <attribute name="accel">&lt;Primary&gt;q</attribute>
+                       </item>
+               </section>
+       </menu>
+
+       <menu id="win_menu">
+               <submenu>
+                       <attribute name="label" translatable="yes">_Game</attribute>
                        <section>
                                <item>
                                        <attribute name="action">win.hint</attribute>
diff --git a/src/interface.c b/src/interface.c
index 2ec969b..e335cad 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -56,13 +56,13 @@ static void board_size_change_cb (GSimpleAction *action, GVariant *state, gpoint
 
 static GActionEntry app_entries[] = {
        { "new-game", new_game_cb, NULL, NULL, NULL },
+       { "board-size", board_size_activate_cb, "s", "'5'", board_size_change_cb },
        { "about", about_cb, NULL, NULL, NULL },
        { "help", help_cb, NULL, NULL, NULL },
        { "quit", quit_cb, NULL, NULL, NULL },
 };
 
 static GActionEntry win_entries[] = {
-       { "board-size", board_size_activate_cb, "s", "'5'", board_size_change_cb },
        { "hint", hint_cb, NULL, NULL, NULL },
        { "undo", undo_cb, NULL, NULL, NULL },
        { "redo", redo_cb, NULL, NULL, NULL },
@@ -137,7 +137,7 @@ hitori_create_interface (Hitori *hitori)
        g_simple_action_set_enabled (hitori->redo_action, FALSE);
 
        /* Set the initial board size. */
-       g_simple_action_set_state (G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP 
(hitori->window), "board-size")), g_variant_new_string ("5"));
+       g_simple_action_set_state (G_SIMPLE_ACTION (g_action_map_lookup_action (G_ACTION_MAP (hitori), 
"board-size")), g_variant_new_string ("5"));
 
        return hitori->window;
 }


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