aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--calendar/ChangeLog8
-rw-r--r--calendar/gui/e-cal-popup.c26
2 files changed, 24 insertions, 10 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index d83e496419..30a25f7c37 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,5 +1,13 @@
2007-08-23 Milan Crha <mcrha@redhat.com>
+ ** Fix for bug #272167
+
+ * gui/e-cal-popup.c: (e_cal_popup_target_new_source):
+ Marks both offline flags on local calendars, so both popup menu
+ items are hidden.
+
+2007-08-23 Milan Crha <mcrha@redhat.com>
+
** Fix for bug #308636
* gui/dialogs/calendar-setup.c: (eccp_get_source_type):
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index f6ce2efe5f..7eccfedc14 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -669,6 +669,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
ECalPopupTargetSource *t = e_popup_target_new(&eabp->popup, E_CAL_POPUP_TARGET_SOURCE, sizeof(*t));
guint32 mask = ~0;
const char *source_uri;
+ char *uri;
ESource *source;
const char *offline = NULL;
const char *delete = NULL;
@@ -690,18 +691,23 @@ 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;
+ uri = e_source_get_uri (source);
+ if (!uri || (g_strncasecmp (uri, "file://", 7) && g_strncasecmp (uri, "contacts://", 11))) {
+ /* 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;
+ }
+ } else {
+ mask |= E_CAL_POPUP_SOURCE_NO_OFFLINE;
+ mask |= E_CAL_POPUP_SOURCE_OFFLINE;
}
+ g_free (uri);
source = e_source_selector_peek_primary_selection (selector);
/*check for delete_status property here*/