aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/e-cal-popup.c16
-rw-r--r--calendar/gui/e-cal-popup.h2
3 files changed, 25 insertions, 0 deletions
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 <kharish@novell.com>
+
+ * 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 <rodrigo@novell.com>
* 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;