[glide] Theme chooser now gets a list of themes



commit 77a416d39dfbde95c34e4af3bb253cf5e04512c3
Author: Robert Carr <racarr Valentine localdomain>
Date:   Tue May 25 14:35:38 2010 -0400

    Theme chooser now gets a list of themes

 libglide/glide-theme-chooser-priv.h |    2 +-
 libglide/glide-theme-chooser.c      |    9 +++++++++
 libglide/glide-theme-manager.c      |    6 ++++++
 libglide/glide-theme-manager.h      |    1 +
 4 files changed, 17 insertions(+), 1 deletions(-)
---
diff --git a/libglide/glide-theme-chooser-priv.h b/libglide/glide-theme-chooser-priv.h
index e556bd9..391fc90 100644
--- a/libglide/glide-theme-chooser-priv.h
+++ b/libglide/glide-theme-chooser-priv.h
@@ -26,7 +26,7 @@ G_BEGIN_DECLS
 
 struct _GlideThemeChooserPrivate
 {
-  gpointer filler;
+  GList *themes;
 };
 
 G_END_DECLS
diff --git a/libglide/glide-theme-chooser.c b/libglide/glide-theme-chooser.c
index 6b9b68e..6fcad2f 100644
--- a/libglide/glide-theme-chooser.c
+++ b/libglide/glide-theme-chooser.c
@@ -26,6 +26,8 @@
 #include "glide-theme-chooser.h"
 #include "glide-theme-chooser-priv.h"
 
+#include "glide-theme-manager.h"
+
 #include "glide-debug.h"
 
 #define GLIDE_THEME_CHOOSER_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_THEME_CHOOSER, GlideThemeChooserPrivate))
@@ -39,7 +41,10 @@ enum {
 static void
 glide_theme_chooser_finalize (GObject *object)
 {
+  GlideThemeChooser *chooser = (GlideThemeChooser *)object;
   GLIDE_NOTE(THEME_CHOOSER, "Finalizing theme chooser: %p", object);
+  
+  g_list_free (chooser->priv->themes);
 }
 
 static void
@@ -75,6 +80,10 @@ glide_theme_chooser_init (GlideThemeChooser *chooser)
 {
   GLIDE_NOTE(THEME_CHOOSER, "Initializing theme chooser: %p", chooser);
   chooser->priv = GLIDE_THEME_CHOOSER_GET_PRIVATE (chooser);
+
+  glide_theme_manager_refresh_theme_list ();
+  glide_theme_manager_load_all ();
+  chooser->priv->themes = glide_theme_manager_get_themes ();
 }
 
 static void
diff --git a/libglide/glide-theme-manager.c b/libglide/glide-theme-manager.c
index 7bf40e3..d85d6bc 100644
--- a/libglide/glide-theme-manager.c
+++ b/libglide/glide-theme-manager.c
@@ -29,6 +29,12 @@
 static GList *themes = NULL;
 static GHashTable *loaded_themes = NULL;
 
+GList *
+glide_theme_manager_get_themes ()
+{
+  return g_hash_table_get_keys (loaded_themes);
+}
+
 static gboolean
 glide_theme_manager_theme_hash_find (gpointer key,
 				     gpointer value,
diff --git a/libglide/glide-theme-manager.h b/libglide/glide-theme-manager.h
index 13e9209..349a8e2 100644
--- a/libglide/glide-theme-manager.h
+++ b/libglide/glide-theme-manager.h
@@ -24,6 +24,7 @@
 
 G_BEGIN_DECLS
 
+GList *glide_theme_manager_get_themes ();
 GlideTheme *glide_theme_manager_get_theme (const gchar *theme_name);
 
 GlideTheme *glide_theme_manager_load_theme (const gchar *theme_path);



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