diff options
author | JP Rosevear <jpr@novell.com> | 2004-09-23 21:10:57 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2004-09-23 21:10:57 +0800 |
commit | 919c45d4f55966934f4a07105ec468871e6add2c (patch) | |
tree | a582d331e86e95d29caebd7bb1b8aa891d96ee15 /calendar/gui/calendar-component.c | |
parent | b15d8461ddf10cabbba7e9a963c0bd0c893489d3 (diff) | |
download | gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.gz gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.zst gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.zip |
ditto
2004-09-22 JP Rosevear <jpr@novell.com>
* gui/calendar-component.c (fill_popup_menu_cb): ditto
* gui/tasks-component.c (fill_popup_menu_cb): don't allow a delete
of the system calendar
svn path=/trunk/; revision=27339
Diffstat (limited to 'calendar/gui/calendar-component.c')
-rw-r--r-- | calendar/gui/calendar-component.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index e7c9b01ccd..41d5a0c8ab 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -418,16 +418,22 @@ edit_calendar_cb (GtkWidget *widget, CalendarComponentView *component_view) static void fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, CalendarComponentView *component_view) { - gboolean sensitive; - - sensitive = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)) ? - TRUE : FALSE; + ESource *source; + gboolean sensitive, system; + const char *source_uri; + + source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); + sensitive = source ? TRUE : FALSE; + /* FIXME Gross hack, should have a property or something */ + source_uri = e_source_peek_relative_uri (source); + system = source_uri && !strcmp ("system", source_uri); + add_popup_menu_item (menu, _("New Calendar"), "stock_calendar", G_CALLBACK (new_calendar_cb), component_view, TRUE); add_popup_menu_item (menu, _("Copy"), "stock_folder-copy", G_CALLBACK (copy_calendar_cb), component_view, sensitive); - add_popup_menu_item (menu, _("Delete"), "stock_delete", G_CALLBACK (delete_calendar_cb), component_view, sensitive); + add_popup_menu_item (menu, _("Delete"), "stock_delete", G_CALLBACK (delete_calendar_cb), component_view, sensitive && !system); add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_calendar_cb), component_view, sensitive); } |