static RBSource *
create_source_cb (RBRemovableMediaManager *rmm, GMount *mount, RBIpodPlugin *plugin)
{
	RBSource *src;
	if (!rb_ipod_helpers_is_ipod (mount)) {
		return NULL;
	}

	if (rb_ipod_helpers_needs_init (mount)) {
		gboolean inited;
		gchar *glade_file;
		glade_file = rb_plugin_find_file (RB_PLUGIN (plugin),
						  "ipod-init.glade");
		inited = rb_ipod_helpers_show_first_time_dialog (mount,
								 glade_file);
		g_free (glade_file);
		if (!inited) {
			return NULL;
		}
	}

	src = RB_SOURCE (rb_ipod_source_new (RB_PLUGIN (plugin),
					     plugin->shell,
					     mount));

	plugin->ipod_sources = g_list_prepend (plugin->ipod_sources, src);
	g_signal_connect_object (G_OBJECT (src),
				 "deleted", G_CALLBACK (rb_ipod_plugin_source_deleted),
				 plugin, 0);

	return src;
}
Пример #2
0
static RBSource *
create_source_cb (RBRemovableMediaManager *rmm, GMount *mount, MPIDDevice *device_info, RBIpodPlugin *plugin)
{
	RBSource *src;
	RBShell *shell;

	if (!rb_ipod_helpers_is_ipod (mount, device_info)) {
		return NULL;
	}

	if (rb_ipod_helpers_needs_init (mount)) {
		gboolean inited;
		gchar *builder_file;
		builder_file = rb_find_plugin_data_file (G_OBJECT (plugin), "ipod-init.ui");
		inited = rb_ipod_helpers_show_first_time_dialog (mount,
								 builder_file);
		g_free (builder_file);
		if (!inited) {
			return NULL;
		}
	}

	g_object_get (plugin, "object", &shell, NULL);
	src = RB_SOURCE (rb_ipod_source_new (G_OBJECT (plugin),
					     shell,
					     mount,
					     device_info));
	g_object_unref (shell);

	plugin->ipod_sources = g_list_prepend (plugin->ipod_sources, src);
	g_signal_connect_object (G_OBJECT (src),
				 "deleted", G_CALLBACK (rb_ipod_plugin_source_deleted),
				 plugin, 0);

	return src;
}
static RBSource *
create_source_cb (RBRemovableMediaManager *rmm, GMount *mount, MPIDDevice *device_info, RBIpodPlugin *plugin)
{
    RBSource *src;
    if (!rb_ipod_helpers_is_ipod (mount, device_info)) {
        return NULL;
    }

    if (rb_ipod_helpers_needs_init (mount)) {
        gboolean inited;
        gchar *builder_file;
        builder_file = rb_plugin_find_file (RB_PLUGIN (plugin), "ipod-init.ui");
        inited = rb_ipod_helpers_show_first_time_dialog (mount,
                 builder_file);
        g_free (builder_file);
        if (!inited) {
            return NULL;
        }
    }

    GtkAction *sync_action = gtk_action_group_get_action (plugin->action_group, "iPodSourceSync");

    src = RB_SOURCE (rb_ipod_source_new (RB_PLUGIN (plugin),
                                         plugin->shell,
                                         mount,
                                         device_info,
                                         &plugin->key_file,
                                         sync_action));

    plugin->ipod_sources = g_list_prepend (plugin->ipod_sources, src);
    g_signal_connect_object (G_OBJECT (src),
                             "deleted", G_CALLBACK (rb_ipod_plugin_source_deleted),
                             plugin, 0);

    return src;
}