~matttbe/ubuntu/raring/rhythmbox/lp1010619_RB_2.98

« back to all changes in this revision

Viewing changes to plugins/iradio/rb-iradio-source.c

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-11-06 20:52:57 UTC
  • mfrom: (1.1.67) (214.1.1 quantal-proposed)
  • Revision ID: package-import@ubuntu.com-20121106205257-0btjh8jqley153el
Tags: 2.98-0ubuntu1
* New upstream release (LP: #1060601)
* debian/control.in:
  - Bump minimum glib, gtk, totem-plparser, clutter, and clutter-gst
  - Drop no longer needed musicbrainz dependency
* Refreshed 09_keywords.patch
* Updated 11_fix_cd_pausing.patch with fix from git
* Dropped patches applied in new version:
  - 00git_musicbrainz5.patch
  - 08_CVE-2012-3355.patch
  - dont_free_consumed_floating_gvariant.patch
  - git_scale_click.patch
  - git_crash_during_monitor.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
                          GDestroyNotify destroy_data);
108
108
 
109
109
static void rb_iradio_source_do_query (RBIRadioSource *source);
 
110
static void impl_reset_filters (RBSource *source);
110
111
 
111
112
void rb_iradio_source_show_columns_changed_cb (GtkToggleButton *button,
112
113
                                             RBIRadioSource *source);
135
136
 
136
137
        GtkActionGroup *action_group;
137
138
 
 
139
        RBSourceToolbar *toolbar;
138
140
        RBPropertyView *genres;
139
141
        RBEntryView *stations;
140
142
        gboolean setting_new_query;
211
213
        source_class->impl_song_properties = impl_song_properties;
212
214
        source_class->impl_want_uri = impl_want_uri;
213
215
        source_class->impl_add_uri = impl_add_uri;
 
216
        source_class->impl_reset_filters = impl_reset_filters;
214
217
 
215
218
        g_object_class_override_property (object_class,
216
219
                                          PROP_SHOW_BROWSER,
227
230
static void
228
231
rb_iradio_source_init (RBIRadioSource *source)
229
232
{
230
 
        gint size;
231
 
        GdkPixbuf *pixbuf;
232
 
 
233
233
        source->priv = RB_IRADIO_SOURCE_GET_PRIVATE (source);
234
 
 
235
 
        gtk_icon_size_lookup (RB_SOURCE_ICON_SIZE, &size, NULL);
236
 
        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
237
 
                                           IRADIO_SOURCE_ICON,
238
 
                                           size,
239
 
                                           0, NULL);
240
 
        g_object_set (source, "pixbuf", pixbuf, NULL);
241
 
        if (pixbuf != NULL) {
242
 
                g_object_unref (pixbuf);
243
 
        }
244
234
}
245
235
 
246
236
static void
295
285
        GtkUIManager *ui_manager;
296
286
        GtkWidget *grid;
297
287
        GtkWidget *paned;
298
 
        RBSourceToolbar *toolbar;
 
288
        gint size;
 
289
        GdkPixbuf *pixbuf;
299
290
 
300
291
        RB_CHAIN_GOBJECT_METHOD (rb_iradio_source_parent_class, constructed, object);
301
292
        source = RB_IRADIO_SOURCE (object);
310
301
                      NULL);
311
302
        g_object_unref (shell);
312
303
 
 
304
        gtk_icon_size_lookup (RB_SOURCE_ICON_SIZE, &size, NULL);
 
305
        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
 
306
                                           IRADIO_SOURCE_ICON,
 
307
                                           size,
 
308
                                           0, NULL);
 
309
        g_object_set (source, "pixbuf", pixbuf, NULL);
 
310
        if (pixbuf != NULL) {
 
311
                g_object_unref (pixbuf);
 
312
        }
 
313
 
313
314
        settings = g_settings_new ("org.gnome.rhythmbox.plugins.iradio");
314
315
        if (g_settings_get_boolean (settings, "initial-stations-loaded") == FALSE) {
315
316
                GObject *plugin;
396
397
        gtk_paned_pack2 (GTK_PANED (paned), GTK_WIDGET (source->priv->stations), TRUE, FALSE);
397
398
 
398
399
        /* set up toolbar */
399
 
        toolbar = rb_source_toolbar_new (RB_SOURCE (source), ui_manager);
400
 
        rb_source_toolbar_add_search_entry (toolbar, NULL, _("Search your internet radio stations"));
 
400
        source->priv->toolbar = rb_source_toolbar_new (RB_DISPLAY_PAGE (source), ui_manager);
 
401
        rb_source_toolbar_add_search_entry (source->priv->toolbar, NULL, _("Search your internet radio stations"));
401
402
 
402
403
        grid = gtk_grid_new ();
403
404
        gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
404
405
        gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
405
406
        gtk_widget_set_margin_top (GTK_WIDGET (grid), 6);
406
 
        gtk_grid_attach (GTK_GRID (grid), GTK_WIDGET (toolbar), 0, 0, 1, 1);
 
407
        gtk_grid_attach (GTK_GRID (grid), GTK_WIDGET (source->priv->toolbar), 0, 0, 1, 1);
407
408
        gtk_grid_attach (GTK_GRID (grid), paned, 0, 1, 1, 1);
408
409
 
409
410
        gtk_container_add (GTK_CONTAINER (source), grid);
855
856
}
856
857
 
857
858
static void
 
859
impl_reset_filters (RBSource *asource)
 
860
{
 
861
        RBIRadioSource *source = RB_IRADIO_SOURCE (asource);
 
862
 
 
863
        if (source->priv->search_query != NULL) {
 
864
                rhythmdb_query_free (source->priv->search_query);
 
865
                source->priv->search_query = NULL;
 
866
        }
 
867
        rb_source_toolbar_clear_search_entry (source->priv->toolbar);
 
868
 
 
869
        rb_property_view_set_selection (source->priv->genres, NULL);
 
870
}
 
871
 
 
872
static void
858
873
handle_playlist_entry_cb (TotemPlParser *playlist,
859
874
                          const char *uri,
860
875
                          GHashTable *metadata,