diff options
author | Suman Manjunath <msuman@src.gnome.org> | 2008-10-13 18:24:07 +0800 |
---|---|---|
committer | Suman Manjunath <msuman@src.gnome.org> | 2008-10-13 18:24:07 +0800 |
commit | a3b38ef1293fa8c8f162be5310e5b3dec8782a2e (patch) | |
tree | 71abf784120c4ad329a10d0868a934569425045a /calendar/gui/memos-component.c | |
parent | 1f9fc79ef8f6a5391d51b4970b8d4c367f8edc52 (diff) | |
download | gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar.gz gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar.bz2 gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar.lz gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar.xz gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.tar.zst gsoc2013-evolution-a3b38ef1293fa8c8f162be5310e5b3dec8782a2e.zip |
Fix for bug #424818 (bugzilla.novell.com) - Integrate the mark-calendar-offline plugin into the main code as we already have a similar per-calendar option which does the same thing.
svn path=/trunk/; revision=36610
Diffstat (limited to 'calendar/gui/memos-component.c')
-rw-r--r-- | calendar/gui/memos-component.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index dc2b888fe4..931367cf39 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -460,12 +460,39 @@ edit_memo_list_cb (EPopup *ep, EPopupItem *pitem, void *data) calendar_setup_edit_memo_list (GTK_WINDOW (gtk_widget_get_toplevel(ep->target->widget)), selected_source); } +static void +set_offline_availability (EPopup *ep, EPopupItem *pitem, void *data, const char *value) +{ + MemosComponentView *component_view = data; + ESource *selected_source; + + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); + if (!selected_source) + return; + + e_source_set_property (selected_source, "offline_sync", value); +} + +static void +mark_no_offline_cb (EPopup *ep, EPopupItem *pitem, void *data) +{ + set_offline_availability (ep, pitem, data, "0"); +} + +static void +mark_offline_cb (EPopup *ep, EPopupItem *pitem, void *data) +{ + set_offline_availability (ep, pitem, data, "1"); +} + static EPopupItem emc_source_popups[] = { { E_POPUP_ITEM, "10.new", N_("_New Memo List"), new_memo_list_cb, NULL, "stock_notes", 0, 0 }, { E_POPUP_ITEM, "15.copy", N_("_Copy..."), copy_memo_list_cb, NULL, "edit-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY }, { E_POPUP_BAR, "20.bar" }, { E_POPUP_ITEM, "20.delete", N_("_Delete"), delete_memo_list_cb, NULL, "edit-delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY }, + { E_POPUP_ITEM, "30.mark_memos_offline", N_("_Make available for offline use"), mark_offline_cb, NULL, "stock_disconnect", E_CAL_POPUP_SOURCE_OFFLINE, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY|E_CAL_POPUP_SOURCE_OFFLINE }, + { E_POPUP_ITEM, "40.mark_memos_no_offline", N_("_Do not make available for offline use"), mark_no_offline_cb, NULL, "stock_connect", E_CAL_POPUP_SOURCE_NO_OFFLINE, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY|E_CAL_POPUP_SOURCE_NO_OFFLINE }, { E_POPUP_BAR, "99.bar" }, { E_POPUP_ITEM, "99.properties", N_("_Properties"), edit_memo_list_cb, NULL, "document-properties", 0, E_CAL_POPUP_SOURCE_PRIMARY }, |