[rhythmbox] playlist-manager: remove gtk_dialog_run usage
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] playlist-manager: remove gtk_dialog_run usage
- Date: Wed, 8 Feb 2012 12:38:03 +0000 (UTC)
commit f0cf16ee3a64b9ba9ac791cf56d3a081f2daef14
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed Feb 8 22:37:22 2012 +1000
playlist-manager: remove gtk_dialog_run usage
shell/rb-playlist-manager.c | 35 ++++++++++++++++++++++++-----------
1 files changed, 24 insertions(+), 11 deletions(-)
---
diff --git a/shell/rb-playlist-manager.c b/shell/rb-playlist-manager.c
index f3a90c8..da1b9df 100644
--- a/shell/rb-playlist-manager.c
+++ b/shell/rb-playlist-manager.c
@@ -857,26 +857,39 @@ rb_playlist_manager_set_automatic_playlist (RBPlaylistManager *mgr,
}
static void
-rb_playlist_manager_cmd_new_automatic_playlist (GtkAction *action,
- RBPlaylistManager *mgr)
+new_automatic_playlist_response_cb (GtkDialog *dialog, int response, RBPlaylistManager *mgr)
{
- RBQueryCreator *creator = RB_QUERY_CREATOR (rb_query_creator_new (mgr->priv->db));
RBSource *playlist;
- switch (gtk_dialog_run (GTK_DIALOG (creator))) {
+ switch (response) {
case GTK_RESPONSE_NONE:
case GTK_RESPONSE_CLOSE:
- gtk_widget_destroy (GTK_WIDGET (creator));
- return;
- }
+ break;
+
+ default:
+ playlist = rb_playlist_manager_new_playlist (mgr, _("New Playlist"), TRUE);
- playlist = rb_playlist_manager_new_playlist (mgr, _("New Playlist"), TRUE);
+ rb_playlist_manager_set_automatic_playlist (mgr,
+ RB_AUTO_PLAYLIST_SOURCE (playlist),
+ RB_QUERY_CREATOR (dialog));
+ rb_playlist_manager_set_dirty (mgr, TRUE);
+ break;
+ }
- rb_playlist_manager_set_automatic_playlist (mgr, RB_AUTO_PLAYLIST_SOURCE (playlist), creator);
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+}
- rb_playlist_manager_set_dirty (mgr, TRUE);
+static void
+rb_playlist_manager_cmd_new_automatic_playlist (GtkAction *action,
+ RBPlaylistManager *mgr)
+{
+ GtkWidget *creator = rb_query_creator_new (mgr->priv->db);
+ gtk_widget_show_all (creator);
- gtk_widget_destroy (GTK_WIDGET (creator));
+ g_signal_connect (creator,
+ "response",
+ G_CALLBACK (new_automatic_playlist_response_cb),
+ mgr);
}
typedef struct {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]