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/gui/e-cal-popup.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'calendar/gui/e-cal-popup.c') 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 } }; -- cgit v1.2.3