changeset 4675:48cdebc174ef

enabled interface destruction
author mf0102 <0102@gmx.at>
date Sun, 29 Jun 2008 18:04:43 +0200
parents b71d4f3f3afd
children 66dea2610f1c
files src/audacious/interface.c src/audacious/interface.h src/audacious/main.c src/audacious/ui_legacy.c
diffstat 4 files changed, 27 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/audacious/interface.c	Sun Jun 29 17:48:07 2008 +0200
+++ b/src/audacious/interface.c	Sun Jun 29 18:04:43 2008 +0200
@@ -52,6 +52,13 @@
     i->init();
 }
 
+void
+interface_destroy(Interface *i)
+{
+    if (i->fini != NULL)
+        i->fini();
+}
+
 Interface *
 interface_get(gchar *id)
 {
--- a/src/audacious/interface.h	Sun Jun 29 17:48:07 2008 +0200
+++ b/src/audacious/interface.h	Sun Jun 29 18:04:43 2008 +0200
@@ -38,6 +38,8 @@
 void interface_register(Interface *i);
 void interface_deregister(Interface *i);
 void interface_run(Interface *i);
+void interface_destroy(Interface *i);
+
 Interface *interface_get(gchar *id);
 
 #endif
--- a/src/audacious/main.c	Sun Jun 29 17:48:07 2008 +0200
+++ b/src/audacious/main.c	Sun Jun 29 18:04:43 2008 +0200
@@ -487,24 +487,13 @@
 aud_quit(void)
 {
     GList *playlists = NULL, *playlists_top = NULL;
+    Interface *i = interface_get(options.interface);
 
     playlist_stop_get_info_thread();
 
     aud_config_save();
 
-#if 0
-    if (options.headless == FALSE)
-    {
-        gtk_widget_hide(equalizerwin);
-        gtk_widget_hide(playlistwin);
-        gtk_widget_hide(mainwin);
-
-        gtk_accel_map_save(aud_paths[BMP_PATH_ACCEL_FILE]);
-        gtk_main_quit();
-
-        cleanup_skins();
-    }
-#endif
+    interface_destroy(i);
 
     plugin_system_cleanup();
 
--- a/src/audacious/ui_legacy.c	Sun Jun 29 17:48:07 2008 +0200
+++ b/src/audacious/ui_legacy.c	Sun Jun 29 18:04:43 2008 +0200
@@ -239,10 +239,26 @@
     return TRUE;
 }
 
+static gboolean
+_ui_finalize()
+{
+    gtk_widget_hide(equalizerwin);
+    gtk_widget_hide(playlistwin);
+    gtk_widget_hide(mainwin);
+
+    gtk_accel_map_save(aud_paths[BMP_PATH_ACCEL_FILE]);
+    gtk_main_quit();
+
+    cleanup_skins();
+
+    return TRUE;
+}
+
 static Interface legacy_interface = {
     .id = "legacy",
     .desc = N_("Legacy Interface"),
     .init = _ui_initialize,
+    .fini = _ui_finalize
 };
 
 void