gnome-games r8492 - in trunk: aisleriot libgames-support



Author: chpe
Date: Tue Jan  6 18:20:21 2009
New Revision: 8492
URL: http://svn.gnome.org/viewvc/gnome-games?rev=8492&view=rev

Log:
Fix setting the current theme's radio action to active.

Modified:
   trunk/aisleriot/window.c
   trunk/libgames-support/games-card-selector.c
   trunk/libgames-support/games-card-theme-private.h
   trunk/libgames-support/games-card-theme.c
   trunk/libgames-support/games-card-theme.h

Modified: trunk/aisleriot/window.c
==============================================================================
--- trunk/aisleriot/window.c	(original)
+++ trunk/aisleriot/window.c	Tue Jan  6 18:20:21 2009
@@ -1561,6 +1561,7 @@
   /* See gtk bug #424448 */
   gtk_ui_manager_ensure_update (priv->ui_manager);
 
+  games_card_themes_request_themes (priv->theme_manager);
   list = games_card_themes_get_themes (priv->theme_manager);
 
   /* No need to install the menu when there's only one theme available anyway */
@@ -1604,7 +1605,7 @@
     radio_group = gtk_radio_action_get_group (action);
 
     /* Check if this is the current theme's action. Do this before connecting the callback */
-    if (info == current_theme_info) {
+    if (games_card_theme_info_equal (info, current_theme_info)) {
       gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action), TRUE);
     }
 

Modified: trunk/libgames-support/games-card-selector.c
==============================================================================
--- trunk/libgames-support/games-card-selector.c	(original)
+++ trunk/libgames-support/games-card-selector.c	Tue Jan  6 18:20:21 2009
@@ -79,6 +79,8 @@
 
   store = gtk_list_store_new (N_COLUMNS, GAMES_TYPE_CARD_THEME_INFO, G_TYPE_STRING);
 
+  games_card_themes_request_themes (theme_manager);
+
   themes = games_card_themes_get_themes (theme_manager);
 
   for (l = themes; l != NULL; l = l->next) {
@@ -88,7 +90,7 @@
                                        COL_INFO, info,
                                        COL_NAME, games_card_theme_info_get_display_name (info),
                                        -1);
-    if (info == selected_info) {
+    if (games_card_theme_info_equal (info, selected_info)) {
       selection_iter = iter;
       selection_iter_set = TRUE;
     }

Modified: trunk/libgames-support/games-card-theme-private.h
==============================================================================
--- trunk/libgames-support/games-card-theme-private.h	(original)
+++ trunk/libgames-support/games-card-theme-private.h	Tue Jan  6 18:20:21 2009
@@ -46,9 +46,6 @@
 
 guint _games_card_theme_info_hash  (const GamesCardThemeInfo *a);
 
-gboolean _games_card_theme_info_equal (const GamesCardThemeInfo *a,
-                                       const GamesCardThemeInfo *b);
-
 int _games_card_theme_info_collate (const GamesCardThemeInfo *a,
                                     const GamesCardThemeInfo *b);
 

Modified: trunk/libgames-support/games-card-theme.c
==============================================================================
--- trunk/libgames-support/games-card-theme.c	(original)
+++ trunk/libgames-support/games-card-theme.c	Tue Jan  6 18:20:21 2009
@@ -413,17 +413,6 @@
          g_str_hash (a->filename);
 }
 
-gboolean
-_games_card_theme_info_equal (const GamesCardThemeInfo *a,
-                              const GamesCardThemeInfo *b)
-{
-  g_return_val_if_fail (a != NULL && b != NULL, FALSE);
-
-  return a->type == b->type &&
-         strcmp (a->path, b->path) == 0 &&
-         strcmp (a->filename, b->filename) == 0;
-}
-
 /**
  * _games_card_theme_info_collate:
  * @a:
@@ -543,3 +532,19 @@
 
   return info->pref_name;
 }
+
+/**
+ * games_card_theme_info_equal:
+ *
+ * Returns: %TRUE iff @a and @b refer to the same card theme
+ */
+gboolean
+games_card_theme_info_equal (const GamesCardThemeInfo *a,
+                              const GamesCardThemeInfo *b)
+{
+  g_return_val_if_fail (a != NULL && b != NULL, FALSE);
+
+  return a->type == b->type &&
+         strcmp (a->path, b->path) == 0 &&
+         strcmp (a->filename, b->filename) == 0;
+}

Modified: trunk/libgames-support/games-card-theme.h
==============================================================================
--- trunk/libgames-support/games-card-theme.h	(original)
+++ trunk/libgames-support/games-card-theme.h	Tue Jan  6 18:20:21 2009
@@ -50,6 +50,9 @@
 
 const char *games_card_theme_info_get_persistent_name (GamesCardThemeInfo *info);
 
+gboolean games_card_theme_info_equal (const GamesCardThemeInfo *a,
+                                      const GamesCardThemeInfo *b);
+
 /* GamesCardTheme (abstract) */
 
 #define GAMES_TYPE_CARD_THEME            (games_card_theme_get_type ())



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