~ubuntu-branches/ubuntu/quantal/rhythmbox/quantal-proposed

« back to all changes in this revision

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

  • Committer: Package Import Robot
  • Author(s): Sebastien Bacher, Rico Tzschichholz
  • Date: 2011-12-05 19:31:23 UTC
  • mfrom: (1.1.60)
  • Revision ID: package-import@ubuntu.com-20111205193123-89047p8yplb0w1vx
Tags: 2.90.1~20111126.89c872b0-0ubuntu1
* Upload the new version to Ubuntu, should solve those issues:
  - the lack of rhythmbox-client command (lp: #875064)
  - the music sharing preferences dialog (lp: #894153)
  - several segfaults (lp: #859195, #814614)
* debian/control.in:
  - let the rhythmbox gir depends on gir1.2-peas-1.0 (lp: #874973)

[ Rico Tzschichholz ]
* New upstream git snapshot

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
#include "rb-metadata.h"
54
54
#include "rb-cut-and-paste-code.h"
55
55
#include "rb-source-search-basic.h"
 
56
#include "rb-source-toolbar.h"
56
57
 
57
58
/* icon names */
58
59
#define IRADIO_SOURCE_ICON  "library-internet-radio"
89
90
 
90
91
/* page methods */
91
92
static gboolean impl_show_popup (RBDisplayPage *page);
92
 
static GList *impl_get_ui_actions (RBDisplayPage *page);
93
93
static void impl_get_status (RBDisplayPage *page, char **text, char **progress_text, float *progress);
94
94
 
95
95
/* source methods */
133
133
{
134
134
        RhythmDB *db;
135
135
 
136
 
        GtkWidget *vbox;
137
 
        GtkWidget *paned;
138
136
        GtkActionGroup *action_group;
139
137
 
140
138
        RBPropertyView *genres;
203
201
 
204
202
        page_class->show_popup = impl_show_popup;
205
203
        page_class->get_status  = impl_get_status;
206
 
        page_class->get_ui_actions = impl_get_ui_actions;
207
204
 
208
 
        source_class->impl_can_browse = (RBSourceFeatureFunc) rb_true_function;
209
205
        source_class->impl_can_copy = (RBSourceFeatureFunc) rb_false_function;
210
206
        source_class->impl_can_delete = (RBSourceFeatureFunc) rb_true_function;
211
207
        source_class->impl_can_pause = (RBSourceFeatureFunc) rb_false_function;
236
232
 
237
233
        source->priv = RB_IRADIO_SOURCE_GET_PRIVATE (source);
238
234
 
239
 
        source->priv->vbox = gtk_vbox_new (FALSE, 5);
240
 
 
241
 
        gtk_container_add (GTK_CONTAINER (source), source->priv->vbox);
242
 
 
243
235
        gtk_icon_size_lookup (RB_SOURCE_ICON_SIZE, &size, NULL);
244
236
        pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
245
237
                                           IRADIO_SOURCE_ICON,
300
292
        RBShell *shell;
301
293
        GtkAction *action;
302
294
        GSettings *settings;
 
295
        GtkUIManager *ui_manager;
 
296
        GtkWidget *grid;
 
297
        GtkWidget *paned;
 
298
        RBSourceToolbar *toolbar;
303
299
 
304
300
        RB_CHAIN_GOBJECT_METHOD (rb_iradio_source_parent_class, constructed, object);
305
301
        source = RB_IRADIO_SOURCE (object);
306
302
 
307
 
        source->priv->paned = gtk_hpaned_new ();
 
303
        paned = gtk_hpaned_new ();
308
304
 
309
305
        g_object_get (source, "shell", &shell, NULL);
310
306
        g_object_get (shell,
311
307
                      "db", &source->priv->db,
312
308
                      "shell-player", &source->priv->player,
 
309
                      "ui-manager", &ui_manager,
313
310
                      NULL);
314
311
        g_object_unref (shell);
315
312
 
343
340
                                              "MusicNewInternetRadioStation");
344
341
        /* Translators: this is the toolbar button label for 
345
342
           New Internet Radio Station action. */
346
 
        g_object_set (action, "short-label", C_("Radio", "New"), NULL);
 
343
        g_object_set (action, "short-label", C_("Radio", "Add"), NULL);
347
344
 
348
345
 
349
346
        /* set up stations view */
395
392
        g_object_set (source->priv->genres, "vscrollbar_policy",
396
393
                      GTK_POLICY_AUTOMATIC, NULL);
397
394
 
398
 
        gtk_paned_pack1 (GTK_PANED (source->priv->paned),
399
 
                         GTK_WIDGET (source->priv->genres), FALSE, FALSE);
400
 
        gtk_paned_pack2 (GTK_PANED (source->priv->paned),
401
 
                         GTK_WIDGET (source->priv->stations), TRUE, FALSE);
402
 
 
403
 
        gtk_box_pack_start (GTK_BOX (source->priv->vbox), source->priv->paned, TRUE, TRUE, 0);
 
395
        gtk_paned_pack1 (GTK_PANED (paned), GTK_WIDGET (source->priv->genres), FALSE, FALSE);
 
396
        gtk_paned_pack2 (GTK_PANED (paned), GTK_WIDGET (source->priv->stations), TRUE, FALSE);
 
397
 
 
398
        /* 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"));
 
401
 
 
402
        grid = gtk_grid_new ();
 
403
        gtk_grid_set_column_spacing (GTK_GRID (grid), 6);
 
404
        gtk_grid_set_row_spacing (GTK_GRID (grid), 6);
 
405
        gtk_grid_attach (GTK_GRID (grid), GTK_WIDGET (toolbar), 0, 0, 1, 1);
 
406
        gtk_grid_attach (GTK_GRID (grid), paned, 0, 1, 1, 1);
 
407
 
 
408
        gtk_container_add (GTK_CONTAINER (source), grid);
404
409
 
405
410
        rb_source_bind_settings (RB_SOURCE (source),
406
411
                                 GTK_WIDGET (source->priv->stations),
407
 
                                 source->priv->paned,
 
412
                                 paned,
408
413
                                 GTK_WIDGET (source->priv->genres));
409
414
 
410
415
        gtk_widget_show_all (GTK_WIDGET (source));
482
487
                                          "shell", shell,
483
488
                                          "entry-type", entry_type,
484
489
                                          "plugin", plugin,
485
 
                                          "search-type", RB_SOURCE_SEARCH_INCREMENTAL,
486
490
                                          "settings", g_settings_get_child (settings, "source"),
 
491
                                          "toolbar-path", "/IRadioSourceToolBar",
487
492
                                          NULL));
488
493
        g_object_unref (settings);
489
494
        rb_shell_register_entry_type_for_source (shell, source, entry_type);
935
940
        return TRUE;
936
941
}
937
942
 
938
 
static GList*
939
 
impl_get_ui_actions (RBDisplayPage *page)
940
 
{
941
 
        GList *actions = NULL;
942
 
 
943
 
        actions = g_list_prepend (actions, g_strdup ("MusicNewInternetRadioStation"));
944
 
 
945
 
        return actions;
946
 
}
947
 
 
948
943
static void
949
944
new_station_location_added (RBURIDialog    *dialog,
950
945
                            const char     *uri,