static void
new_playlist_action_cb (GSimpleAction *action, GVariant *parameters, gpointer data)
{
	RBGenericPlayerSource *source = RB_GENERIC_PLAYER_SOURCE (data);
	RBShell *shell;
	RBSource *playlist;
	RBDisplayPageTree *page_tree;
	RhythmDBEntryType *entry_type;
	GMenuModel *playlist_menu;

	g_object_get (source,
		      "shell", &shell,
		      "entry-type", &entry_type,
		      "playlist-menu", &playlist_menu,
		      NULL);

	playlist = rb_generic_player_playlist_source_new (shell, source, NULL, NULL, entry_type, playlist_menu);
	g_object_unref (entry_type);

	rb_generic_player_source_add_playlist (source, shell, playlist);

	g_object_get (shell, "display-page-tree", &page_tree, NULL);
	rb_display_page_tree_edit_source_name (page_tree, playlist);
	g_object_unref (page_tree);

	g_object_unref (playlist_menu);
	g_object_unref (shell);
}
Example #2
0
static void
rb_ipod_plugin_cmd_playlist_rename (GtkAction *action, RBSource *source)
{
	RBDisplayPageTree *page_tree = NULL;
	RBShell *shell;

	g_return_if_fail (RB_IS_IPOD_STATIC_PLAYLIST_SOURCE (source));

	g_object_get (source, "shell", &shell, NULL);
	g_object_get (shell, "display-page-tree", &page_tree, NULL);
	rb_display_page_tree_edit_source_name (page_tree, source);
	g_object_unref (page_tree);
	g_object_unref (shell);
}
Example #3
0
static void
rb_mtp_plugin_rename (GtkAction *action, RBSource *source)
{
	RBShell *shell;
	RBDisplayPageTree *page_tree;

	g_return_if_fail (RB_IS_MTP_SOURCE (source));

	g_object_get (source, "shell", &shell, NULL);
	g_object_get (shell, "display-page-tree", &page_tree, NULL);

	rb_display_page_tree_edit_source_name (page_tree, source);

	g_object_unref (page_tree);
	g_object_unref (shell);
}
Example #4
0
static void
rb_ipod_plugin_cmd_rename (GtkAction *action, RBSource *source)
{
	RBDisplayPageTree *page_tree = NULL;
	RBShell *shell;

	g_return_if_fail (RB_IS_IPOD_SOURCE (source));

	/* FIXME: this is pretty ugly, the sourcelist should automatically add
	 * a "rename" menu item for sources that have can_rename == TRUE.
	 * This is a bit trickier to handle though, since playlists want
	 * to make rename sensitive/unsensitive instead of showing/hiding it
	 */

	g_object_get (source, "shell", &shell, NULL);
	g_object_get (shell, "display-page-tree", &page_tree, NULL);

	rb_display_page_tree_edit_source_name (page_tree, source);
	/* Once editing is done, notify::name will be fired on the source, and
	 * we'll catch that in our rename callback
	 */
	g_object_unref (page_tree);
	g_object_unref (shell);
}