From 6c4af7d1fcc0b8ee246e2e00f82e16b26a47fd9e Mon Sep 17 00:00:00 2001 From: Harish Krishnaswamy Date: Thu, 21 Oct 2004 17:07:23 +0000 Subject: Add status bits to denote if the calendar source is available offline so * gui/e-cal-popup.[ch]: (e_cal_popup_target_new_source): Add status bits to denote if the calendar source is available offline so that plugins to calendar popups can use the status qualifier to denote their visibility preferences. svn path=/trunk/; revision=27680 --- calendar/ChangeLog | 7 +++++++ calendar/gui/e-cal-popup.c | 16 ++++++++++++++++ calendar/gui/e-cal-popup.h | 2 ++ 3 files changed, 25 insertions(+) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 7bb7e41149..29516e7ff0 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-10-21 Harish Krishnaswamy + + * gui/e-cal-popup.[ch]: (e_cal_popup_target_new_source): + Add status bits to denote if the calendar source is available offline + so that plugins to calendar popups can use the status qualifier to denote + their visibility preferences. + 2004-10-21 Rodrigo Moya * gui/dialogs/select-source-dialog.c: use the new source selector diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 38153cd4a3..3b8c361178 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -197,6 +197,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector) guint32 mask = ~0; const char *source_uri; ESource *source; + const char *offline = NULL; /* TODO: this is duplicated for addressbook too */ @@ -215,6 +216,19 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector) else mask &= ~E_CAL_POPUP_SOURCE_USER; + + source = e_source_selector_peek_primary_selection (selector); + /* check for e_target_selector's offline_status property here */ + offline = e_source_get_property (source, "offline"); + + if (offline && strcmp (offline,"1") == 0) { + /* set the menu item to Mark Offline - */ + mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE; + } + else { + mask &= ~E_CAL_POPUP_SOURCE_OFFLINE; + } + t->target.mask = mask; return t; @@ -269,6 +283,8 @@ static const EPopupHookTargetMask ecalph_source_masks[] = { { "primary", E_CAL_POPUP_SOURCE_PRIMARY }, { "system", E_CAL_POPUP_SOURCE_SYSTEM }, { "user", E_CAL_POPUP_SOURCE_USER }, + { "offline", E_CAL_POPUP_SOURCE_OFFLINE}, + { "no-offline", E_CAL_POPUP_SOURCE_NO_OFFLINE}, { 0 } }; diff --git a/calendar/gui/e-cal-popup.h b/calendar/gui/e-cal-popup.h index 1e7d7bc23a..a5043b1726 100644 --- a/calendar/gui/e-cal-popup.h +++ b/calendar/gui/e-cal-popup.h @@ -93,6 +93,8 @@ enum _e_cal_popup_target_source_t { E_CAL_POPUP_SOURCE_PRIMARY = 1<<0, E_CAL_POPUP_SOURCE_SYSTEM = 1<<1, /* system folder */ E_CAL_POPUP_SOURCE_USER = 1<<2, /* user folder (!system) */ + E_CAL_POPUP_SOURCE_OFFLINE = 1 <<3, + E_CAL_POPUP_SOURCE_NO_OFFLINE = 1 <<4 }; typedef struct _ECalPopupTargetSelect ECalPopupTargetSelect; -- cgit v1.2.3