diff audacious/prefswin.c @ 1429:a360afd8df52 trunk

[svn] Make annoying recursion that consistently returns wrong art, optional.
author nemo
date Mon, 24 Jul 2006 16:20:05 -0700
parents 878c7f8d0a8c
children f12d7e208b43
line wrap: on
line diff
--- a/audacious/prefswin.c	Fri Jul 21 10:24:28 2006 -0700
+++ b/audacious/prefswin.c	Mon Jul 24 16:20:05 2006 -0700
@@ -2049,6 +2049,38 @@
 }
 
 static void
+on_recurse_for_cover_depth_realize(GtkSpinButton * button,
+                                    gpointer data)
+{
+    gtk_spin_button_set_value(button, cfg.recurse_for_cover_depth);
+}
+
+static void
+on_recurse_for_cover_depth_changed(GtkSpinButton * button,
+                                    gpointer data)
+{
+    cfg.recurse_for_cover_depth = gtk_spin_button_get_value_as_int(button);
+}
+
+static void
+on_recurse_for_cover_realize(GtkToggleButton * button,
+                               gpointer data)
+{
+    gboolean state = cfg.recurse_for_cover;
+    gtk_toggle_button_set_active(button, state);
+    gtk_widget_set_sensitive(GTK_WIDGET(data), state);
+}
+
+static void
+on_recurse_for_cover_toggled(GtkToggleButton * button,
+                               gpointer data)
+{
+    gboolean state = gtk_toggle_button_get_active(button);
+    cfg.recurse_for_cover = state;
+    gtk_widget_set_sensitive(GTK_WIDGET(data), state);
+}
+
+static void
 on_filepopup_settings_ok_clicked(GtkButton *button, gpointer data)
 {
 	GladeXML *xml = prefswin_get_xml();
@@ -2144,6 +2176,8 @@
     FUNC_MAP_ENTRY(on_audio_format_det_cb_realize)
     FUNC_MAP_ENTRY(on_show_filepopup_for_tuple_realize)
     FUNC_MAP_ENTRY(on_show_filepopup_for_tuple_toggled)
+    FUNC_MAP_ENTRY(on_recurse_for_cover_depth_realize)
+    FUNC_MAP_ENTRY(on_recurse_for_cover_depth_changed)
     FUNC_MAP_ENTRY(on_filepopup_for_tuple_settings_clicked)
     FUNC_MAP_ENTRY(on_continue_playback_on_startup_realize)
     FUNC_MAP_ENTRY(on_continue_playback_on_startup_toggled)
@@ -2378,6 +2412,14 @@
 	/* Create window for filepopup settings */
 	filepopup_settings = glade_xml_get_widget(xml, "filepopup_for_tuple_settings");
 	gtk_window_set_transient_for(GTK_WINDOW(filepopup_settings), GTK_WINDOW(prefswin));
+    widget = glade_xml_get_widget(xml, "recurse_for_cover_depth_box");
+    widget2 = glade_xml_get_widget(xml, "recurse_for_cover");
+    g_signal_connect_after(G_OBJECT(widget2), "realize",
+                           G_CALLBACK(on_recurse_for_cover_realize),
+                           widget);
+    g_signal_connect(G_OBJECT(widget2), "toggled",
+                     G_CALLBACK(on_recurse_for_cover_toggled),
+                     widget);
 }
 
 void