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

« back to all changes in this revision

Viewing changes to sources/rb-auto-playlist-source.c

  • Committer: Package Import Robot
  • Author(s): Didier Roche
  • Date: 2012-01-17 16:56:40 UTC
  • mfrom: (1.1.62)
  • Revision ID: package-import@ubuntu.com-20120117165640-pr034mkhmti3efh6
Tags: 2.95-0ubuntu1
* New upstream release:
  - wrong shortcut for Show / Hide the Queue Sidebar (LP: #461279)
* debian/watch:
  - update to latest url    
* debian/patches/00_fix_for_glib_2.32.patch:
  - was taken upstream, removed

Show diffs side-by-side

added added

removed removed

Lines of Context:
134
134
 
135
135
        RBSourceSearch *default_search;
136
136
        RhythmDBQuery *search_query;
137
 
 
138
 
        GtkActionGroup *action_group;
139
137
};
140
138
 
141
139
static gpointer playlist_pixbuf = NULL;
203
201
{
204
202
        RBAutoPlaylistSourcePrivate *priv = GET_PRIVATE (object);
205
203
 
206
 
        if (priv->action_group != NULL) {
207
 
                g_object_unref (priv->action_group);
208
 
                priv->action_group = NULL;
209
 
        }
210
 
 
211
204
        if (priv->cached_all_query != NULL) {
212
205
                g_object_unref (priv->cached_all_query);
213
206
                priv->cached_all_query = NULL;
241
234
        G_OBJECT_CLASS (rb_auto_playlist_source_parent_class)->finalize (object);
242
235
}
243
236
 
 
237
void
 
238
rb_auto_playlist_source_create_actions (RBShell *shell)
 
239
{
 
240
        RBAutoPlaylistSourceClass *klass;
 
241
        GtkUIManager *uimanager;
 
242
 
 
243
        klass = RB_AUTO_PLAYLIST_SOURCE_CLASS (g_type_class_ref (RB_TYPE_AUTO_PLAYLIST_SOURCE));
 
244
 
 
245
        klass->action_group = gtk_action_group_new ("AutoPlaylistActions");
 
246
        gtk_action_group_set_translation_domain (klass->action_group, GETTEXT_PACKAGE);
 
247
 
 
248
        g_object_get (shell, "ui-manager", &uimanager, NULL);
 
249
        gtk_ui_manager_insert_action_group (uimanager, klass->action_group, 0);
 
250
        g_object_unref (uimanager);
 
251
 
 
252
        gtk_action_group_add_radio_actions (klass->action_group,
 
253
                                            rb_auto_playlist_source_radio_actions,
 
254
                                            G_N_ELEMENTS (rb_auto_playlist_source_radio_actions),
 
255
                                            0,
 
256
                                            NULL,
 
257
                                            NULL);
 
258
        rb_source_search_basic_create_for_actions (klass->action_group,
 
259
                                                   rb_auto_playlist_source_radio_actions,
 
260
                                                   G_N_ELEMENTS (rb_auto_playlist_source_radio_actions));
 
261
 
 
262
        g_type_class_unref (klass);
 
263
}
 
264
 
244
265
static void
245
266
rb_auto_playlist_source_constructed (GObject *object)
246
267
{
273
294
                                 G_CALLBACK (rb_auto_playlist_source_songs_sort_order_changed_cb),
274
295
                                 source, 0);
275
296
 
276
 
        g_object_get (source, "shell", &shell, NULL);
277
 
        priv->action_group = _rb_display_page_register_action_group (RB_DISPLAY_PAGE (source),
278
 
                                                                     "AutoPlaylistActions",
279
 
                                                                     NULL, 0,
280
 
                                                                     shell);
281
 
        if (gtk_action_group_get_action (priv->action_group,
282
 
                                         rb_auto_playlist_source_radio_actions[0].name) == NULL) {
283
 
                gtk_action_group_add_radio_actions (priv->action_group,
284
 
                                                    rb_auto_playlist_source_radio_actions,
285
 
                                                    G_N_ELEMENTS (rb_auto_playlist_source_radio_actions),
286
 
                                                    0,
287
 
                                                    NULL,
288
 
                                                    NULL);
289
 
                rb_source_search_basic_create_for_actions (priv->action_group,
290
 
                                                           rb_auto_playlist_source_radio_actions,
291
 
                                                           G_N_ELEMENTS (rb_auto_playlist_source_radio_actions));
292
 
        }
293
297
        priv->default_search = rb_source_search_basic_new (RHYTHMDB_PROP_SEARCH_MATCH);
294
298
 
295
 
 
296
299
        /* set up toolbar */
 
300
        g_object_get (source, "shell", &shell, NULL);
297
301
        g_object_get (shell, "ui-manager", &ui_manager, NULL);
298
302
        priv->toolbar = rb_source_toolbar_new (RB_SOURCE (source), ui_manager);
299
303
        rb_source_toolbar_add_search_entry (priv->toolbar, "/AutoPlaylistSourceSearchMenu", NULL);