204
202
RBAutoPlaylistSourcePrivate *priv = GET_PRIVATE (object);
206
if (priv->action_group != NULL) {
207
g_object_unref (priv->action_group);
208
priv->action_group = NULL;
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);
238
rb_auto_playlist_source_create_actions (RBShell *shell)
240
RBAutoPlaylistSourceClass *klass;
241
GtkUIManager *uimanager;
243
klass = RB_AUTO_PLAYLIST_SOURCE_CLASS (g_type_class_ref (RB_TYPE_AUTO_PLAYLIST_SOURCE));
245
klass->action_group = gtk_action_group_new ("AutoPlaylistActions");
246
gtk_action_group_set_translation_domain (klass->action_group, GETTEXT_PACKAGE);
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);
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),
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));
262
g_type_class_unref (klass);
245
266
rb_auto_playlist_source_constructed (GObject *object)
273
294
G_CALLBACK (rb_auto_playlist_source_songs_sort_order_changed_cb),
276
g_object_get (source, "shell", &shell, NULL);
277
priv->action_group = _rb_display_page_register_action_group (RB_DISPLAY_PAGE (source),
278
"AutoPlaylistActions",
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),
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));
293
297
priv->default_search = rb_source_search_basic_new (RHYTHMDB_PROP_SEARCH_MATCH);
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);