changeset 3074:177688d045db

Update playlist manager on when playlists changed.
author John Lindgren <john.lindgren@tds.net>
date Sun, 26 Apr 2009 04:26:40 -0400
parents fbe76a1d61e2
children eed75824b3f7
files src/skins/ui_playlist_manager.c
diffstat 1 files changed, 21 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/skins/ui_playlist_manager.c	Sun Apr 26 00:03:22 2009 -0500
+++ b/src/skins/ui_playlist_manager.c	Sun Apr 26 04:26:40 2009 -0400
@@ -338,6 +338,23 @@
     }
 }
 
+void playlist_manager_catch_changes (void) {
+   aud_hook_associate ("playlist create", (HookFunction) playlist_manager_update,
+    0);
+   aud_hook_associate ("playlist destroy",
+    (HookFunction) playlist_manager_update, 0);
+   aud_hook_associate ("playlist update", (HookFunction) playlist_manager_update,
+    0);
+}
+
+void playlist_manager_uncatch_changes (void) {
+   aud_hook_dissociate ("playlist create",
+    (HookFunction) playlist_manager_update);
+   aud_hook_dissociate ("playlist destroy",
+    (HookFunction) playlist_manager_update);
+   aud_hook_dissociate ("playlist update",
+    (HookFunction) playlist_manager_update);
+}
 
 void
 playlist_manager_ui_show ( void )
@@ -470,6 +487,10 @@
 
     g_object_unref( pl_store );
 
+    playlist_manager_catch_changes ();
+    g_signal_connect (G_OBJECT (playman_win), "destroy",
+     G_CALLBACK (playlist_manager_uncatch_changes), 0);
+
     gtk_widget_show_all( playman_win );
 }