diff options
author | Gilles Dartiguelongue <gdartigu@src.gnome.org> | 2007-11-18 06:11:53 +0800 |
---|---|---|
committer | Gilles Dartiguelongue <gdartigu@src.gnome.org> | 2007-11-18 06:11:53 +0800 |
commit | aad95f711ac77ec640f250449453aed0a522a2ed (patch) | |
tree | c1103edc1eceafa4f2258ce0206c0cc380bacba5 /plugins/ipod-sync | |
parent | dd92a1c0e4f9d13ad58d4d1a0d7367a85e4bd038 (diff) | |
download | gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar.gz gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar.bz2 gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar.lz gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar.xz gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.tar.zst gsoc2013-evolution-aad95f711ac77ec640f250449453aed0a522a2ed.zip |
** Fix bug #495872
uniformization of actions with memos/calendars/tasks
svn path=/trunk/; revision=34547
Diffstat (limited to 'plugins/ipod-sync')
-rw-r--r-- | plugins/ipod-sync/ChangeLog | 9 | ||||
-rw-r--r-- | plugins/ipod-sync/ipod-sync.c | 25 | ||||
-rw-r--r-- | plugins/ipod-sync/org-gnome-ipod-sync-evolution.eplug.xml | 11 | ||||
-rw-r--r-- | plugins/ipod-sync/sync.c | 28 |
4 files changed, 68 insertions, 5 deletions
diff --git a/plugins/ipod-sync/ChangeLog b/plugins/ipod-sync/ChangeLog index 5d792691c2..2c0b42a170 100644 --- a/plugins/ipod-sync/ChangeLog +++ b/plugins/ipod-sync/ChangeLog @@ -1,3 +1,12 @@ +2007-11-11 Gilles Dartiguelongue <gdartigu@svn.gnome.org> + + ** Fix bug #495872 + + * ipod-sync.c: (org_gnome_sync_memos): + * org-gnome-ipod-sync-evolution.eplug.xml: + * sync.c: (export_memos), (export_to_ipod): + add memo support + 2007-10-26 Kjartan Maraas <kmaraas@gnome.org> * evolution-ipod-sync.c: (ipod_check_status): Don't mix code diff --git a/plugins/ipod-sync/ipod-sync.c b/plugins/ipod-sync/ipod-sync.c index dd89b34e8f..43eaf30dd9 100644 --- a/plugins/ipod-sync/ipod-sync.c +++ b/plugins/ipod-sync/ipod-sync.c @@ -48,6 +48,7 @@ void org_gnome_sync_calendar (EPlugin *ep, ECalPopupTargetSource *target); void org_gnome_sync_tasks (EPlugin *ep, ECalPopupTargetSource *target); +void org_gnome_sync_memos (EPlugin *ep, ECalPopupTargetSource *target); void org_gnome_sync_addressbook (EPlugin *ep, EABPopupTargetSource *target); @@ -148,7 +149,21 @@ destination_save_cal (EPlugin *ep, ECalPopupTargetSource *target, ECalSourceType /* The available formathandlers */ handler= ical_format_handler_new (); - path = g_strdup_printf((type==E_CAL_SOURCE_TYPE_EVENT)? "Evolution-Calendar-%s" : "Evolution-Tasks-%s", e_source_peek_name (primary_source)); + switch (type) { + case E_CAL_SOURCE_TYPE_EVENT: + path = g_strdup_printf ("Evolution-Calendar-%s", e_source_peek_name (primary_source)); + break; + case E_CAL_SOURCE_TYPE_TODO: + path = g_strdup_printf ("Evolution-Tasks-%s", e_source_peek_name (primary_source)); + break; + case E_CAL_SOURCE_TYPE_JOURNAL: + path = g_strdup_printf ("Evolution-Tasks-%s", e_source_peek_name (primary_source)); + break; + default: + path = NULL; + g_assert_not_reached (); + } + dest_uri = g_strdup_printf("%s/%s/%s.ics", mount, "Calendars", path); g_free (path); @@ -179,6 +194,14 @@ org_gnome_sync_tasks (EPlugin *ep, ECalPopupTargetSource *target) destination_save_cal (ep, target, E_CAL_SOURCE_TYPE_TODO); } +void +org_gnome_sync_memos (EPlugin *ep, ECalPopupTargetSource *target) +{ + if (!ipod_check_status(FALSE)) + return; + + destination_save_cal (ep, target, E_CAL_SOURCE_TYPE_JOURNAL); +} void org_gnome_sync_addressbook (EPlugin *ep, EABPopupTargetSource *target) diff --git a/plugins/ipod-sync/org-gnome-ipod-sync-evolution.eplug.xml b/plugins/ipod-sync/org-gnome-ipod-sync-evolution.eplug.xml index 3f17ef5f98..6e3afa8037 100644 --- a/plugins/ipod-sync/org-gnome-ipod-sync-evolution.eplug.xml +++ b/plugins/ipod-sync/org-gnome-ipod-sync-evolution.eplug.xml @@ -4,19 +4,22 @@ _name="iPod Synchronization" location="@PLUGINDIR@/liborg-gnome-ipod-sync-evolution@SOEXT@"> <author name="Srinivasa Ragavan" email="sragavan@novell.com"/> - <_description>Synchronize the selected task/calendar/addressbook with Apple iPod</_description> + <_description>Synchronize the selected task/memo/calendar/addressbook with Apple iPod</_description> <hook class="org.gnome.evolution.calendar.popup:1.0"> <menu id="org.gnome.evolution.tasks.source.popup" target="source"> - <item type="item" path="20.sync_ipod.00." _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_tasks"/> + <item type="item" path="40.sync_ipod.00" _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_tasks"/> </menu> <menu id="org.gnome.evolution.calendar.source.popup" target="source"> - <item type="item" path="20.sync_ipod.00" _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_calendar"/> + <item type="item" path="40.sync_ipod.00" _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_calendar"/> + </menu> + <menu id="org.gnome.evolution.memos.source.popup" target="source"> + <item type="item" path="40.sync_ipod.00" _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_memos"/> </menu> </hook> <hook class="org.gnome.evolution.addressbook.popup:1.0"> <menu id="org.gnome.evolution.addressbook.source.popup" target="source"> - <item type="item" path="20.sync_ipod.00." _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_addressbook"/> + <item type="item" path="40.sync_ipod.00" _label="Synchronize to iPod" icon="gnome-dev-ipod" activate="org_gnome_sync_addressbook"/> </menu> </hook> </e-plugin> diff --git a/plugins/ipod-sync/sync.c b/plugins/ipod-sync/sync.c index b826dca5f3..fe0fa9af9d 100644 --- a/plugins/ipod-sync/sync.c +++ b/plugins/ipod-sync/sync.c @@ -24,6 +24,7 @@ #define EBOOK_SOURCE_LIST "/apps/evolution/addressbook/sources" #define ECAL_SOURCE_LIST "/apps/evolution/calendar/sources" #define ETASK_SOURCE_LIST "/apps/evolution/tasks/sources" +#define EMEMO_SOURCE_LIST "/apps/evolution/memos/sources" extern GtkWidget *progress_bar; extern IPod ipod_info; @@ -392,6 +393,30 @@ export_tasks (void) pulse (); } +/* Attempt to export the memo list(s). */ +static void +export_memos (void) +{ + GSList *uris; + GString *data; + + pulse (); + + uris = get_source_uris_for_type (EMEMO_SOURCE_LIST); + + pulse (); + + data = uri_list_to_vcal_string (uris, E_CAL_SOURCE_TYPE_JOURNAL); + + write_to_ipod (data, "/Calendars/", "evolution-memo.ics"); + + g_string_free (data, TRUE); + + free_uri_list (uris); + + pulse (); +} + void export_to_ipod (void) { @@ -406,6 +431,9 @@ export_to_ipod (void) if (ipod_info.tasks == TRUE) export_tasks (); + if (ipod_info.memos == TRUE) + export_memos (); + pulse (); sync (); pulse (); |