static void
rb_ipod_plugin_cmd_rename (GtkAction *action,
			   RBIpodPlugin *plugin)
{
	RBSourceList *sourcelist = NULL;
	RBSource *source = NULL;

	/* 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 (G_OBJECT (plugin->shell),
		      "selected-source", &source,
		      NULL);
	if ((source == NULL) || !RB_IS_IPOD_SOURCE (source)) {
		g_critical ("got iPodSourceRename action for non-ipod source");
		if (source != NULL)
			g_object_unref (source);
		return;
	}

	g_object_get (plugin->shell, "sourcelist", &sourcelist, NULL);

	rb_sourcelist_edit_source_name (sourcelist, 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 (sourcelist);
	g_object_unref (source);
}
static void
rb_ipod_plugin_cmd_properties (GtkAction *action,
			       RBIpodPlugin *plugin)
{
	RBSource *source = NULL;

	g_object_get (G_OBJECT (plugin->shell), 
		      "selected-source", &source,
		      NULL);
	if ((source == NULL) || !RB_IS_IPOD_SOURCE (source)) {
		g_critical ("got iPodSourceProperties action for non-ipod source");
		return;
	}

	rb_ipod_source_show_properties (RB_IPOD_SOURCE (source));
	g_object_unref (G_OBJECT (source));
}
static void
rb_ipod_plugin_cmd_sync (GtkAction *action,
                         RBIpodPlugin *plugin)
{
    RBSource *source = NULL;

    g_object_get (G_OBJECT (plugin->shell),
                  "selected-source", &source,
                  NULL);
    if ((source == NULL) || !RB_IS_IPOD_SOURCE (source)) {
        g_critical ("got iPodSourceSync action for non-ipod source");
        return;
    }

    rb_media_player_source_sync (RB_MEDIA_PLAYER_SOURCE (source));
    g_object_unref (G_OBJECT (source));
}
static void
rb_ipod_plugin_cmd_playlist_new (GtkAction *action,
			   RBIpodPlugin *plugin)
{
	RBSource *source = NULL;

	g_object_get (G_OBJECT (plugin->shell),
		      "selected-source", &source,
		      NULL);

	if ((source == NULL) || !RB_IS_IPOD_SOURCE (source)) {
		g_critical ("got iPodSourceRename action for non-ipod source");
		if (source != NULL)
			g_object_unref (source);
		return;
	}

	rb_ipod_source_new_playlist (RB_IPOD_SOURCE (source));

	g_object_unref (source);
}
Beispiel #5
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);
}
Beispiel #6
0
static void
rb_ipod_plugin_cmd_playlist_new (GtkAction *action, RBSource *source)
{
	g_return_if_fail (RB_IS_IPOD_SOURCE (source));
	rb_ipod_source_new_playlist (RB_IPOD_SOURCE (source));
}
Beispiel #7
0
static void
rb_ipod_plugin_cmd_properties (GtkAction *action, RBSource *source)
{
	g_return_if_fail (RB_IS_IPOD_SOURCE (source));
	rb_media_player_source_show_properties (RB_MEDIA_PLAYER_SOURCE (source));
}