From 71b50d249c33e7008fd96f789a7de2c0f8879213 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 23 Aug 2007 07:54:00 +0000 Subject: 2007-08-23 mcrha Fix for bug #272167 svn path=/trunk/; revision=34069 --- calendar/ChangeLog | 8 ++++++++ calendar/gui/e-cal-popup.c | 26 ++++++++++++++++---------- 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,3 +1,11 @@ +2007-08-23 Milan Crha + + ** 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 ** Fix for bug #308636 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*/ -- cgit v1.2.3