aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2004-09-23 21:10:57 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-09-23 21:10:57 +0800
commit919c45d4f55966934f4a07105ec468871e6add2c (patch)
treea582d331e86e95d29caebd7bb1b8aa891d96ee15
parentb15d8461ddf10cabbba7e9a963c0bd0c893489d3 (diff)
downloadgsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar
gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.gz
gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.bz2
gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.lz
gsoc2013-evolution-919c45d4f55966934f4a07105ec468871e6add2c.tar.xz
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
-rw-r--r--calendar/ChangeLog7
-rw-r--r--calendar/gui/calendar-component.c16
-rw-r--r--calendar/gui/tasks-component.c14
3 files changed, 28 insertions, 9 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index f899e8a4be..8a6a170703 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,10 @@
+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
+
2004-09-21 JP Rosevear <jpr@novell.com>
Fixes #60904
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);
}
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index 76843b264e..a817ca8546 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -364,17 +364,23 @@ edit_task_list_cb (GtkWidget *widget, TasksComponentView *component_view)
static void
fill_popup_menu_cb (ESourceSelector *selector, GtkMenu *menu, TasksComponentView *component_view)
{
- gboolean sensitive;
+ 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;
- sensitive = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)) ?
- 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 Task List"), "stock_todo",
G_CALLBACK (new_task_list_cb), component_view, TRUE);
add_popup_menu_item (menu, _("Copy"), "stock_folder-copy",
G_CALLBACK (copy_task_list_cb), component_view, sensitive);
add_popup_menu_item (menu, _("Delete"), "stock_delete", G_CALLBACK (delete_task_list_cb),
- component_view, sensitive);
+ component_view, sensitive && !system);
add_popup_menu_item (menu, _("Properties..."), NULL, G_CALLBACK (edit_task_list_cb),
component_view, sensitive);
}