gnome-games r8274 - in trunk: glines gnobots2 gnometris gnotski gtali mahjongg



Author: thomashpa
Date: Thu Nov  6 23:46:27 2008
New Revision: 8274
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8274&view=rev

Log:
Scores should always be sensitive in the menu. Patch based on initial work by Jason Clinton. Fixes bug #488057

Modified:
   trunk/glines/glines.c
   trunk/gnobots2/game.c
   trunk/gnobots2/gnobots.c
   trunk/gnobots2/menu.c
   trunk/gnobots2/menu.h
   trunk/gnobots2/properties.c
   trunk/gnometris/highscores.cpp
   trunk/gnometris/highscores.h
   trunk/gnometris/tetris.cpp
   trunk/gnometris/tetris.h
   trunk/gnotski/gnotski.c
   trunk/gtali/gyahtzee.c
   trunk/mahjongg/mahjongg.c

Modified: trunk/glines/glines.c
==============================================================================
--- trunk/glines/glines.c	(original)
+++ trunk/glines/glines.c	Thu Nov  6 23:46:27 2008
@@ -502,15 +502,6 @@
 }
 
 static void
-update_score_state ()
-{
-  GList *top;
-
-  top = games_scores_get (highscores);
-  gtk_widget_set_sensitive (scoreitem, top != NULL);
-}
-
-static void
 game_over (void)
 {
   int pos;
@@ -520,7 +511,6 @@
   hiscore.plain = score;
   pos = games_scores_add_score (highscores, hiscore);
   show_scores (pos, TRUE);
-  update_score_state ();
   return;
 }
 
@@ -1953,8 +1943,6 @@
   GTK_WIDGET_SET_FLAGS (draw_area, GTK_CAN_FOCUS);
   gtk_widget_grab_focus (draw_area);
 
-  update_score_state ();
-
   load_properties ();
 
   gtk_widget_show_all (app);

Modified: trunk/gnobots2/game.c
==============================================================================
--- trunk/gnobots2/game.c	(original)
+++ trunk/gnobots2/game.c	Thu Nov  6 23:46:27 2008
@@ -241,7 +241,6 @@
     pos = games_scores_add_score (highscores, score);
   }
   g_free (sbuf);
-  update_score_state ();
 
   return pos;
 }

Modified: trunk/gnobots2/gnobots.c
==============================================================================
--- trunk/gnobots2/gnobots.c	(original)
+++ trunk/gnobots2/gnobots.c	Thu Nov  6 23:46:27 2008
@@ -379,8 +379,6 @@
     }
   }
 
-  update_score_state ();
-
   gtk_main ();
 
   games_conf_shutdown ();

Modified: trunk/gnobots2/menu.c
==============================================================================
--- trunk/gnobots2/menu.c	(original)
+++ trunk/gnobots2/menu.c	Thu Nov  6 23:46:27 2008
@@ -373,21 +373,6 @@
 
 /**********************************************************************/
 
-/**
- * update_score_state
- *
- * Description:
- * Changes menu item enabled/disabled state depending on high score availability
- **/
-void
-update_score_state (void)
-{
-  GList *top;
-
-  top = games_scores_get (highscores);
-  gtk_action_set_sensitive (scores_action, top != NULL);
-}
-
 void
 set_move_menu_sensitivity (gboolean state)
 {

Modified: trunk/gnobots2/menu.h
==============================================================================
--- trunk/gnobots2/menu.h	(original)
+++ trunk/gnobots2/menu.h	Thu Nov  6 23:46:27 2008
@@ -7,7 +7,6 @@
 /**********************************************************************/
 void create_game_menus (GtkUIManager *);
 void quit_cb (GtkAction *, gpointer);
-void update_score_state (void);
 void set_move_menu_sensitivity (gboolean state);
 void connect_toolbar_toggle (GtkWidget *);
 gboolean window_state_cb (GtkWidget * widget, GdkEventWindowState * event);

Modified: trunk/gnobots2/properties.c
==============================================================================
--- trunk/gnobots2/properties.c	(original)
+++ trunk/gnobots2/properties.c	Thu Nov  6 23:46:27 2008
@@ -140,7 +140,6 @@
 {
   load_keys ();
   keyboard_set (properties.keys);
-  update_score_state ();
 }
 
 
@@ -662,7 +661,6 @@
   set_game_graphics (properties.themename);
   set_game_config (properties.selected_config);
   keyboard_set (properties.keys);
-  update_score_state ();
   return TRUE;
 }
 

Modified: trunk/gnometris/highscores.cpp
==============================================================================
--- trunk/gnometris/highscores.cpp	(original)
+++ trunk/gnometris/highscores.cpp	Thu Nov  6 23:46:27 2008
@@ -45,11 +45,6 @@
   return games_scores_add_score (highscores, value);
 }
 
-gboolean HighScores::empty (void)
-{
-  return games_scores_get (highscores) == NULL;
-}
-
 void HighScores::show (GtkWindow *parent_window, gint highlight)
 {
   if (!dialog)

Modified: trunk/gnometris/highscores.h
==============================================================================
--- trunk/gnometris/highscores.h	(original)
+++ trunk/gnometris/highscores.h	Thu Nov  6 23:46:27 2008
@@ -34,7 +34,6 @@
     HighScores ();
 
   gint add (gint score);
-  gboolean empty (void);
   void show (GtkWindow *parent_window, gint highlight = 0);
 };
 

Modified: trunk/gnometris/tetris.cpp
==============================================================================
--- trunk/gnometris/tetris.cpp	(original)
+++ trunk/gnometris/tetris.cpp	Thu Nov  6 23:46:27 2008
@@ -244,7 +244,6 @@
 	high_scores = new HighScores ();
 
 	setOptions ();
-	setupScoreState ();
 
 	themeList = NULL;
 	
@@ -285,16 +284,6 @@
                 g_signal_handler_disconnect (games_conf_get_default (), confNotifyID);
 }
 
-void
-Tetris::setupScoreState ()
-{
-	if (high_scores->empty ()) {
-		gtk_action_set_sensitive (scores_action, FALSE);
-	} else {
-		gtk_action_set_sensitive (scores_action, TRUE);
-	}
-}
-
 void 
 Tetris::setupdialogDestroy(GtkWidget *widget, void *d)
 {

Modified: trunk/gnometris/tetris.h
==============================================================================
--- trunk/gnometris/tetris.h	(original)
+++ trunk/gnometris/tetris.h	Thu Nov  6 23:46:27 2008
@@ -157,7 +157,6 @@
   void initOptions ();
   void setOptions ();
   void writeOptions ();
-  void setupScoreState ();
   void manageFallen ();
 
   GdkPixbuf *bgimage;

Modified: trunk/gnotski/gnotski.c
==============================================================================
--- trunk/gnotski/gnotski.c	(original)
+++ trunk/gnotski/gnotski.c	Thu Nov  6 23:46:27 2008
@@ -883,18 +883,6 @@
   show_score_dialog (0, FALSE);
 }
 
-static void
-update_score_state (void)
-{
-  GtkAction *score_action;
-  GList *top;
-
-  score_action = gtk_action_group_get_action (action_group, "Scores");
-  top = games_scores_get (highscores);
-  gtk_action_set_sensitive (score_action, top != NULL);
-
-}
-
 void
 game_score ()
 {
@@ -910,7 +898,6 @@
 
   score.plain = (guint32) moves;
   pos = games_scores_add_score (highscores, score);
-  update_score_state ();
   if (show_score_dialog (pos, TRUE) == GTK_RESPONSE_REJECT)
     gtk_main_quit ();
   else
@@ -1462,7 +1449,6 @@
   games_grid_frame_set (GAMES_GRID_FRAME (gameframe), width, height);
   configure_pixmaps ();
   update_menu_state ();
-  update_score_state ();
 }
 
 void

Modified: trunk/gtali/gyahtzee.c
==============================================================================
--- trunk/gtali/gyahtzee.c	(original)
+++ trunk/gtali/gyahtzee.c	Thu Nov  6 23:46:27 2008
@@ -136,7 +136,6 @@
 static gint modify_dice (GtkWidget * widget, gpointer data);
 static gint roll_dice (GtkWidget * widget, GdkEvent * event,
 			     gpointer data);
-void update_score_state (void);
 static void UpdateRollLabel (void);
 
 static void
@@ -215,8 +214,6 @@
       gtk_dialog_run (GTK_DIALOG (dialog));
       gtk_widget_hide (dialog);
     }
-
-    update_score_state ();
   }
 
   if (players[winner].name)
@@ -688,15 +685,6 @@
 }
 
 void
-update_score_state (void)
-{
-  GList *top;
-
-  top = games_scores_get (highscores);
-  gtk_action_set_sensitive (scores_action, top != NULL);
-}
-
-void
 update_undo_sensitivity (void)
 {
   gtk_action_set_sensitive(undo_action, UndoVisible());
@@ -871,9 +859,6 @@
   gtk_widget_show (vbox);
 
   gtk_widget_show (window);
-
-  update_score_state ();
-
 }
 
 int

Modified: trunk/mahjongg/mahjongg.c
==============================================================================
--- trunk/mahjongg/mahjongg.c	(original)
+++ trunk/mahjongg/mahjongg.c	Thu Nov  6 23:46:27 2008
@@ -439,15 +439,6 @@
 		 GUINT_TO_POINTER (flashid));
 }
 
-static void
-update_score_state ()
-{
-  GList *top;
-
-  top = games_scores_get (highscores);
-  gtk_action_set_sensitive (scores_action, top != NULL);
-}
-
 static gint
 update_moves_left (void)
 {
@@ -688,7 +679,6 @@
     gtk_dialog_run (GTK_DIALOG (dialog));
     gtk_widget_hide (dialog);
   }
-  update_score_state ();
 }
 
 static void
@@ -1202,8 +1192,6 @@
   draw_all_tiles ();
 
   init_game ();
-
-  update_score_state ();
 }
 
 void
@@ -1530,7 +1518,6 @@
 
   do_game ();
   init_game ();
-  update_score_state ();
 
   /* Don't leave the keyboard focus on the toolbar */
   gtk_widget_grab_focus (board);



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