changeset 2679:fb5375e86a03

make setting random skin on play working
author Tomasz Mon <desowin@gmail.com>
date Sun, 01 Jun 2008 17:12:08 +0200
parents 59af999361d8
children e540e041b34b af3d529a7c74
files src/skins/skins_cfg.c src/skins/skins_cfg.h src/skins/ui_main_evlisteners.c src/skins/ui_skin.c
diffstat 4 files changed, 6 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/skins_cfg.c	Sun Jun 01 17:01:47 2008 +0200
+++ b/src/skins/skins_cfg.c	Sun Jun 01 17:12:08 2008 +0200
@@ -90,6 +90,7 @@
     .mainwin_font = NULL,
     .show_filepopup_for_tuple = TRUE,
     .filepopup_delay = 20,             /* delay until the filepopup comes up */
+    .random_skin_on_play = FALSE,
 };
 
 typedef struct skins_cfg_boolent_t {
@@ -127,6 +128,7 @@
     {"show_numbers_in_pl", &config.show_numbers_in_pl, TRUE},
     {"show_separator_in_pl", &config.show_separator_in_pl, TRUE},
     {"show_filepopup_for_tuple", &config.show_filepopup_for_tuple, TRUE},
+    {"random_skin_on_play", &config.random_skin_on_play, TRUE},
 };
 
 static gint ncfgbent = G_N_ELEMENTS(skins_boolents);
--- a/src/skins/skins_cfg.h	Sun Jun 01 17:01:47 2008 +0200
+++ b/src/skins/skins_cfg.h	Sun Jun 01 17:12:08 2008 +0200
@@ -77,6 +77,7 @@
     gchar *playlist_font, *mainwin_font;
     gboolean show_filepopup_for_tuple;
     gint filepopup_delay;
+    gboolean random_skin_on_play;
 } skins_cfg_t;
 
 extern skins_cfg_t config;
--- a/src/skins/ui_main_evlisteners.c	Sun Jun 01 17:01:47 2008 +0200
+++ b/src/skins/ui_main_evlisteners.c	Sun Jun 01 17:12:08 2008 +0200
@@ -174,10 +174,8 @@
 static void
 ui_main_evlistener_playback_play_file(gpointer hook_data, gpointer user_data)
 {
-#if 0
-    if (cfg.random_skin_on_play)
+    if (config.random_skin_on_play)
         skin_set_random_skin();
-#endif
 }
 
 static void
--- a/src/skins/ui_skin.c	Sun Jun 01 17:01:47 2008 +0200
+++ b/src/skins/ui_skin.c	Sun Jun 01 17:12:08 2008 +0200
@@ -548,10 +548,10 @@
             return FALSE;
         }
     }
-#if 0
+
     if (config.random_skin_on_play)
         skinlist_update();
-#endif
+
     return TRUE;
 }
 
@@ -2030,7 +2030,6 @@
 void
 skin_set_random_skin(void)
 {
-#if 0
     SkinNode *node;
     guint32 randval;
 
@@ -2038,7 +2037,6 @@
     randval = g_random_int_range(0, g_list_length(skinlist));
     node = g_list_nth(skinlist, randval)->data;
     aud_active_skin_load(node->path);
-#endif
 }