diff options
author | Srinivasa Ragavan <sragavan@novell.com> | 2005-10-18 17:25:51 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2005-10-18 17:25:51 +0800 |
commit | ecc167430b4a2fd2f9418ef753da62a9f1aab891 (patch) | |
tree | 4c1ae48a666d6fb290ae7da39f89a0a6e06e3018 /plugins/ipod-sync/evolution-ipod-sync.c | |
parent | 82af9cb973cc15c93afb2f0dfd2598de009a158b (diff) | |
download | gsoc2013-evolution-ecc167430b4a2fd2f9418ef753da62a9f1aab891.tar.gz gsoc2013-evolution-ecc167430b4a2fd2f9418ef753da62a9f1aab891.tar.zst gsoc2013-evolution-ecc167430b4a2fd2f9418ef753da62a9f1aab891.zip |
Added iPod sync e-plugin to experimental plugins. Added plugins/ipod-sync
2005-10-18 Srinivasa Ragavan <sragavan@novell.com>
* configure.in: Added iPod sync e-plugin to experimental plugins.
Added plugins/ipod-sync
svn path=/trunk/; revision=30523
Diffstat (limited to 'plugins/ipod-sync/evolution-ipod-sync.c')
-rw-r--r-- | plugins/ipod-sync/evolution-ipod-sync.c | 84 |
1 files changed, 84 insertions, 0 deletions
diff --git a/plugins/ipod-sync/evolution-ipod-sync.c b/plugins/ipod-sync/evolution-ipod-sync.c new file mode 100644 index 0000000000..fe31bdb4d7 --- /dev/null +++ b/plugins/ipod-sync/evolution-ipod-sync.c @@ -0,0 +1,84 @@ +/* + * evolution-ipod-sync.c - Evolution->Ipod synchronisation + * + * (C)2004 Justin Wake <jwake@iinet.net.au> + * + * Licensed under the GNU GPL v2. See COPYING. + * + */ + +#include "config.h" +#include "evolution-ipod-sync.h" + +#include <gnome.h> +#include <glade/glade.h> +#include <libhal.h> + +char * mount_point = NULL; +LibHalContext *ctx; + +gboolean +ipod_check_status (gboolean silent) +{ + LibHalContext *ctx; + DBusConnection *conn; + + if (check_hal () == FALSE) + { + if (!silent) { + GtkWidget *message = gtk_message_dialog_new_with_markup ( + NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "<span weight=\"bold\" size=\"larger\">" + "Hardware Abstraction Layer not loaded" + "</span>\n\n" + "The \"hald\" service is required but not currently " + "running. Please enable the service and rerun this " + "program, or contact your system administrator."); + + gtk_dialog_run (GTK_DIALOG (message)); + gtk_widget_destroy (message); + } + return FALSE; + + } + + conn = dbus_bus_get (DBUS_BUS_SYSTEM, NULL); + + ctx = libhal_ctx_new (); + libhal_ctx_set_dbus_connection (ctx, conn); + if (!libhal_ctx_init(ctx, NULL)) + return FALSE; + + + mount_point = find_ipod_mount_point (ctx); + + if (mount_point == NULL) { + /* Either the iPod wasn't mounted when we started, or + * it wasn't plugged in. Either way, we want to umount + * the iPod when we finish syncing. */ + if (!silent) { + GtkWidget *message = gtk_message_dialog_new_with_markup ( + NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "<span weight=\"bold\" size=\"larger\">" + "Search for a iPod failed" + "</span>\n\n" + "Evolution could not find a iPod to synchronize with." + "Either it is not connected to the system or it is " + "not powered on."); + + gtk_dialog_run (GTK_DIALOG (message)); + gtk_widget_destroy (message); + } + + return FALSE; + } + + return TRUE; +} + +char * +ipod_get_mount () +{ + return mount_point; +} + |