[gnome-klotski] Make a method private.



commit 0f2174620750b85b60376aba37211037ab035508
Author: Arnaud Bonatti <arnaud bonatti gmail com>
Date:   Mon Feb 10 04:12:30 2020 +0100

    Make a method private.

 data/klotski.ui         | 2 +-
 src/gnome-klotski.vala  | 8 +-------
 src/klotski-window.vala | 3 ++-
 3 files changed, 4 insertions(+), 9 deletions(-)
---
diff --git a/data/klotski.ui b/data/klotski.ui
index 618277a..a450a15 100644
--- a/data/klotski.ui
+++ b/data/klotski.ui
@@ -22,7 +22,7 @@
       <item>
         <!-- Translators: label of an entry in the Hamburger menu (with a mnemonic that appears pressing 
Alt); opens the Scores dialog -->
         <attribute name="label" translatable="yes">_Scores</attribute>
-        <attribute name="action">app.scores</attribute>
+        <attribute name="action">win.show-scores</attribute>
       </item>
     </section>
     <section>
diff --git a/src/gnome-klotski.vala b/src/gnome-klotski.vala
index 3dccae9..27126ae 100644
--- a/src/gnome-klotski.vala
+++ b/src/gnome-klotski.vala
@@ -35,7 +35,6 @@ private class Klotski : Gtk.Application
 
     private const GLib.ActionEntry action_entries [] =
     {
-        {"scores", scores_cb},
         {"help", help_cb},
         {"about", about_cb},
         {"quit", quit_cb}
@@ -94,7 +93,7 @@ private class Klotski : Gtk.Application
         set_accels_for_action ("win.start-game",    { "<Shift><Primary>n",
                                                       "<Shift><Primary>r"   }); // TODO just <Primary>n/r?
 
-        set_accels_for_action ("app.scores",        {        "<Primary>s",      // TODO that's a weird 
shortcut
+        set_accels_for_action ("win.show-scores",   {        "<Primary>s",      // TODO that's a weird 
shortcut
                                                       "<Shift><Primary>s"   });
         set_accels_for_action ("app.help",          {                 "F1"  });
         set_accels_for_action ("app.about",         {          "<Shift>F1"  });
@@ -111,11 +110,6 @@ private class Klotski : Gtk.Application
     * * App-menu callbacks
     \*/
 
-    private void scores_cb ()
-    {
-        window.show_scores ();
-    }
-
     private void help_cb ()
     {
         try
diff --git a/src/klotski-window.vala b/src/klotski-window.vala
index ff14df5..09da3ab 100644
--- a/src/klotski-window.vala
+++ b/src/klotski-window.vala
@@ -454,6 +454,7 @@ private class KlotskiWindow : ApplicationWindow
 
     private const GLib.ActionEntry win_actions [] =
     {
+        { "show-scores", show_scores     },
         { "prev-pack",   prev_pack_cb    },
         { "next-pack",   next_pack_cb    },
         { "prev-puzzle", prev_puzzle_cb  },
@@ -864,7 +865,7 @@ private class KlotskiWindow : ApplicationWindow
             });
     }
 
-    internal void show_scores ()
+    private void show_scores ()
     {
         scores_context.run_dialog ();
     }


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