[rhythmbox] iradio: don't use gtk_dialog_run to display dialogs



commit 14054835feeb90c8c3fbf15f8d7af2a18a6e829d
Author: Jonathan Matthew <jonathan d14n org>
Date:   Mon Feb 6 09:20:06 2012 +1000

    iradio: don't use gtk_dialog_run to display dialogs
    
    say no to recursive mainloops.

 plugins/iradio/rb-iradio-source.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/plugins/iradio/rb-iradio-source.c b/plugins/iradio/rb-iradio-source.c
index b007985..5afb60d 100644
--- a/plugins/iradio/rb-iradio-source.c
+++ b/plugins/iradio/rb-iradio-source.c
@@ -949,6 +949,12 @@ new_station_location_added (RBURIDialog    *dialog,
 }
 
 static void
+new_station_response_cb (GtkDialog *dialog, int response, gpointer meh)
+{
+	gtk_widget_destroy (GTK_WIDGET (dialog));
+}
+
+static void
 rb_iradio_source_cmd_new_station (GtkAction *action,
 				  RBIRadioSource *source)
 {
@@ -956,14 +962,15 @@ rb_iradio_source_cmd_new_station (GtkAction *action,
 
 	rb_debug ("Got new station command");
 
+	/* should prevent multiple dialogs?  going to kill this nonsense anyway soon.. */
+
 	dialog = rb_uri_dialog_new (_("New Internet Radio Station"), _("URL of internet radio station:"));
 	g_signal_connect_object (dialog, "location-added",
 				 G_CALLBACK (new_station_location_added),
 				 source, 0);
+	g_signal_connect (dialog, "response", G_CALLBACK (new_station_response_cb), NULL);
 
-	gtk_dialog_run (GTK_DIALOG (dialog));
-
-	gtk_widget_destroy (dialog);
+	gtk_widget_show_all (dialog);
 }
 
 static gboolean



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