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



Author: herzi
Date: Thu Feb  7 00:21:58 2008
New Revision: 284
URL: http://svn.gnome.org/viewvc/monkey-bubble?rev=284&view=rev

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

	* src/ui/ui-main.c: (ui_main_enabled_games_item),
	(ui_main_game_changed): update the visibility and GamePause and
	GameResume properly, as well as the sensitivity of GamePause and
	GameStop


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	Thu Feb  7 00:21:58 2008
@@ -561,11 +561,12 @@
 	 
 }
 
-void ui_main_enabled_games_item(UiMain * ui_main ,gboolean enabled) {
+void
+ui_main_enabled_games_item (UiMain  * ui_main,
+			    gboolean  enabled)
+{
         GtkWidget * item;
 
-
-
         item = glade_xml_get_widget(PRIVATE(ui_main)->glade_xml,"pause_game");
         gtk_widget_set_sensitive(item,!enabled);
 
@@ -575,7 +576,16 @@
         item = glade_xml_get_widget(PRIVATE(ui_main)->glade_xml,"stop_game");
         gtk_widget_set_sensitive(item,!enabled);
 
-
+#ifdef GNOME
+	gtk_action_set_sensitive (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GameStop"),
+				  !enabled);
+	gtk_action_set_sensitive (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GamePause"),
+				  !enabled);
+	gtk_action_set_visible   (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GamePause"),
+				  TRUE);
+	gtk_action_set_visible   (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GameResume"),
+				  FALSE);
+#endif
 }
 
 static void
@@ -671,34 +681,38 @@
         }
 }
 
-void ui_main_game_changed(Game * game,
-                          UiMain * ui_main) {
-
-
+void
+ui_main_game_changed(Game  * game,
+                     UiMain* ui_main)
+{
         GtkWidget * item;
-  
 
         if( game_get_state(game) == GAME_PAUSED ) {
-
-
                 item = glade_xml_get_widget(PRIVATE(ui_main)->glade_xml,"pause_game");
-    
+
                 item = gtk_bin_get_child( GTK_BIN(item));
                 gtk_label_set_text( GTK_LABEL(item), _("Resume game"));
 
+#ifdef GNOME
+		gtk_action_set_visible (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GameResume"),
+					TRUE);
+		gtk_action_set_visible (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GamePause"),
+					FALSE);
+#endif
         } else if( game_get_state(game) == GAME_PLAYING ) {
-  
                 item = glade_xml_get_widget(PRIVATE(ui_main)->glade_xml,"pause_game");
 
                 item = gtk_bin_get_child( GTK_BIN(item));
                 gtk_label_set_text( GTK_LABEL(item), _("Pause game"));
 
-
-		
-
+#ifdef GNOME
+		gtk_action_set_visible (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GameResume"),
+					FALSE);
+		gtk_action_set_visible (gtk_action_group_get_action (PRIVATE (ui_main)->actions, "GamePause"),
+					TRUE);
+#endif
         } else if( game_get_state(game) == GAME_STOPPED ) {
         }
-  
 }
 
 #ifdef MAEMO



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