[gnome-games] gnomime: Refactor unnecessary function
- From: Robert Ancell <rancell src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnomime: Refactor unnecessary function
- Date: Mon, 6 Feb 2012 08:42:01 +0000 (UTC)
commit 121be2e232d6539574c225894e756c600042cdfd
Author: Robert Ancell <robert ancell canonical com>
Date: Mon Feb 6 19:41:55 2012 +1100
gnomime: Refactor unnecessary function
gnomine/src/gnomine.vala | 56 ++++++++++++++++++++-------------------------
1 files changed, 25 insertions(+), 31 deletions(-)
---
diff --git a/gnomine/src/gnomine.vala b/gnomine/src/gnomine.vala
index 2296778..2c33b0b 100644
--- a/gnomine/src/gnomine.vala
+++ b/gnomine/src/gnomine.vala
@@ -74,7 +74,31 @@ public class GnoMine : Gtk.Application
window.add (main_vbox);
main_vbox.show ();
- var ui_manager = create_ui_manager ("GnomineActions");
+ var action_group = new Gtk.ActionGroup ("group");
+ action_group.set_translation_domain (GETTEXT_PACKAGE);
+ action_group.add_actions (actions, this);
+
+ var ui_manager = new Gtk.UIManager ();
+ ui_manager.insert_action_group (action_group, 0);
+ try
+ {
+ ui_manager.add_ui_from_string (ui_description, -1);
+ }
+ catch (Error e)
+ {
+ }
+ hint_action = action_group.get_action ("Hint");
+ hint_action.is_important = true;
+
+ action_group.get_action ("NewGame").is_important = true;
+
+ fullscreen_action = new GnomeGamesSupport.FullscreenAction ("Fullscreen", window);
+ action_group.add_action_with_accel (fullscreen_action, null);
+
+ pause_action = new GnomeGamesSupport.PauseAction ("PauseGame");
+ pause_action.state_changed.connect (pause_cb);
+ action_group.add_action_with_accel (pause_action, null);
+
window.add_accel_group (ui_manager.get_accel_group ());
var menubar = (Gtk.MenuBar) ui_manager.get_widget ("/MainMenu");
menubar.show ();
@@ -294,36 +318,6 @@ public class GnoMine : Gtk.Application
" </toolbar>" +
"</ui>";
- private Gtk.UIManager create_ui_manager (string group)
- {
- var action_group = new Gtk.ActionGroup ("group");
- action_group.set_translation_domain (GETTEXT_PACKAGE);
- action_group.add_actions (actions, this);
-
- var ui_manager = new Gtk.UIManager ();
- ui_manager.insert_action_group (action_group, 0);
- try
- {
- ui_manager.add_ui_from_string (ui_description, -1);
- }
- catch (Error e)
- {
- }
- hint_action = action_group.get_action ("Hint");
- hint_action.is_important = true;
-
- action_group.get_action ("NewGame").is_important = true;
-
- fullscreen_action = new GnomeGamesSupport.FullscreenAction ("Fullscreen", window);
- action_group.add_action_with_accel (fullscreen_action, null);
-
- pause_action = new GnomeGamesSupport.PauseAction ("PauseGame");
- pause_action.state_changed.connect (pause_cb);
- action_group.add_action_with_accel (pause_action, null);
-
- return ui_manager;
- }
-
public void start ()
{
window.show ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]