monkey-bubble r273 - in trunk: . src/ui



Author: herzi
Date: Wed Feb  6 23:54:14 2008
New Revision: 273
URL: http://svn.gnome.org/viewvc/monkey-bubble?rev=273&view=rev

Log:
2008-02-07  Sven Herzberg  <sven imendio com>

	* src/ui/ui-main.c: (ui_main_new), (ui_main_finalize): save the action
	group within the UiMainPrivate structure (to be able to enable and
	disable actions)


Modified:
   trunk/ChangeLog
   trunk/src/ui/ui-main.c

Modified: trunk/src/ui/ui-main.c
==============================================================================
--- trunk/src/ui/ui-main.c	(original)
+++ trunk/src/ui/ui-main.c	Wed Feb  6 23:54:14 2008
@@ -118,11 +118,12 @@
         MonkeyCanvas * canvas;
         GtkWidget * window;
         Block * main_image;
-        Game * game;  
+        Game * game;
         GameManager * manager;
         gboolean fullscreen;
         SoundManager * sm;
         GladeXML * glade_xml;
+	GtkActionGroup* actions;
 #ifdef MAEMO
 	ConIcConnection *ic;
 #endif
@@ -246,7 +247,6 @@
 {
 	GtkUIManager* ui_manager;
 	GError* error = NULL;
-	GtkActionGroup* actions;
 	GtkActionEntry  entries[] = {
 #ifdef MAEMO
 		{"GameNew", NULL, N_("New Game"),
@@ -332,10 +332,10 @@
 
 	ui_manager = gtk_ui_manager_new ();
 
-	actions    = gtk_action_group_new ("main");
-	gtk_action_group_add_actions (actions, entries,
+	PRIVATE (ui_main)->actions = gtk_action_group_new ("main");
+	gtk_action_group_add_actions (PRIVATE (ui_main)->actions, entries,
 				      G_N_ELEMENTS (entries), ui_main);
-	gtk_ui_manager_insert_action_group (ui_manager, actions, 0);
+	gtk_ui_manager_insert_action_group (ui_manager, PRIVATE (ui_main)->actions, 0);
 
 #ifdef MAEMO
 	gtk_ui_manager_add_ui_from_string (ui_manager,
@@ -431,7 +431,6 @@
 				   gtk_ui_manager_get_widget (ui_manager, "/ui/help_menu"));
 #endif
 
-	g_object_unref (actions);
 	g_object_unref (ui_manager);
 
         PRIVATE(ui_main)->game = NULL;
@@ -482,11 +481,15 @@
 }
 
 
-static void ui_main_finalize(GObject* object) {
+static void
+ui_main_finalize (GObject* object)
+{
+	UiMain* self = UI_MAIN (object);
 
+	g_object_unref (PRIVATE (self)->actions);
 
         if (G_OBJECT_CLASS (parent_class)->finalize) {
-                (* G_OBJECT_CLASS (parent_class)->finalize) (object);
+                (G_OBJECT_CLASS (parent_class)->finalize) (object);
         }
 }
 



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