aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog9
-rw-r--r--calendar/gui/calendar-component.c9
-rw-r--r--calendar/gui/e-cal-popup.c14
-rw-r--r--calendar/gui/e-cal-popup.h4
4 files changed, 31 insertions, 5 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index b96ecdce71..02b23a4681 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,12 @@
+2007-05-27 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #326388 from Raghavendaran
+
+ * gui/calendar-component.c: (ensure_sources): Create a popup key for
+ readonly calendar.
+ * gui/e-cal-popup.c: (e_cal_popup_target_new_source):
+ * gui/e-cal-popup.h:
+
2007-05-25 Matthew Barnes <mbarnes@redhat.com>
* gui/migration.c (create_calendar_sources), (create_task_sources),
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c
index 2eaf22fd88..416a74a006 100644
--- a/calendar/gui/calendar-component.c
+++ b/calendar/gui/calendar-component.c
@@ -282,6 +282,7 @@ ensure_sources (CalendarComponent *component)
if (!birthdays_source) {
birthdays_source = e_source_new (_("Birthdays & Anniversaries"), "/");
e_source_group_add_source (contacts, birthdays_source, -1);
+ e_source_set_property(birthdays_source, "delete", "no");
}
if (!weather) {
@@ -586,7 +587,7 @@ edit_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data)
static EPopupItem ecc_source_popups[] = {
{ E_POPUP_ITEM, "10.new", N_("_New Calendar"), new_calendar_cb, NULL, "stock_calendar", 0, 0 },
{ E_POPUP_ITEM, "15.copy", N_("_Copy"), copy_calendar_cb, NULL, "stock_folder-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY },
- { E_POPUP_ITEM, "20.delete", N_("_Delete"), delete_calendar_cb, NULL, "stock_delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY },
+ { E_POPUP_ITEM, "20.delete", N_("_Delete"), delete_calendar_cb, NULL, "stock_delete", 0,E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY|E_CAL_POPUP_SOURCE_DELETE },
{ E_POPUP_ITEM, "30.properties", N_("_Properties..."), edit_calendar_cb, NULL, "stock_folder-properties", 0, E_CAL_POPUP_SOURCE_PRIMARY },
};
@@ -604,7 +605,7 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve
GSList *menus = NULL;
int i;
GtkMenu *menu;
-
+
/** @HookPoint-ECalPopup: Calendar Source Selector Context Menu
* @Id: org.gnome.evolution.calendar.source.popup
* @Class: org.gnome.evolution.calendar.popup:1.0
@@ -615,10 +616,10 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve
ep = e_cal_popup_new("org.gnome.evolution.calendar.source.popup");
t = e_cal_popup_target_new_source(ep, selector);
t->target.widget = (GtkWidget *)component_view->calendar;
-
+
for (i=0;i<sizeof(ecc_source_popups)/sizeof(ecc_source_popups[0]);i++)
menus = g_slist_prepend(menus, &ecc_source_popups[i]);
-
+
e_popup_add_items((EPopup *)ep, menus, NULL, ecc_source_popup_free, component_view);
menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0);
diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c
index a0c3ce2c3b..2afb14e9c8 100644
--- a/calendar/gui/e-cal-popup.c
+++ b/calendar/gui/e-cal-popup.c
@@ -668,6 +668,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
const char *source_uri;
ESource *source;
const char *offline = NULL;
+ const char *delete = NULL;
/* TODO: this is duplicated for addressbook too */
@@ -698,6 +699,19 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector)
else {
mask &= ~E_CAL_POPUP_SOURCE_OFFLINE;
}
+
+ source = e_source_selector_peek_primary_selection (selector);
+ /*check for delete_status property here*/
+ delete = e_source_get_property (source, "delete");
+
+ if (delete && strcmp (delete,"no") == 0) {
+ /*set the menu item to non deletable */
+ mask &= ~E_CAL_POPUP_SOURCE_NO_DELETE;
+ }
+ else {
+ mask &= ~E_CAL_POPUP_SOURCE_DELETE;
+ }
+
t->target.mask = mask;
diff --git a/calendar/gui/e-cal-popup.h b/calendar/gui/e-cal-popup.h
index c94faf0b3d..4e80b2d838 100644
--- a/calendar/gui/e-cal-popup.h
+++ b/calendar/gui/e-cal-popup.h
@@ -102,7 +102,9 @@ enum _e_cal_popup_target_source_t {
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
+ E_CAL_POPUP_SOURCE_NO_OFFLINE = 1 <<4,
+ E_CAL_POPUP_SOURCE_DELETE = 1<<5,
+ E_CAL_POPUP_SOURCE_NO_DELETE = 1<<6
};
/**