From 4a8b6d717107d83401695ffdec711a5452095c27 Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Fri, 9 Apr 2004 15:56:21 +0000 Subject: Create an EUserCreatableItemsHandler for the view if there isn't one yet, * gui/gnome-cal.c (gnome_calendar_set_ui_component): Create an EUserCreatableItemsHandler for the view if there isn't one yet, and then activate it. (gnome_calendar_destroy): destroy it. * gui/calendar-component.c (impl__get_userCreatableItems): add object/folder flags to items. * gui/e-tasks.c (e_tasks_set_ui_component): Create an EUserCreatableItemsHandler for the view if there isn't one yet, and then activate it. (e_tasks_destroy): destroy it. * gui/tasks-component.c (impl__get_userCreatableItems): add object/folder flags. Change "Task List" to "Tasks Group" per new specs. * gui/calendar-commands.c (calendar_control_deactivate): clear the GnomeCal's ui_component rather than setting it again svn path=/trunk/; revision=25382 --- calendar/ChangeLog | 22 ++++++++++++++++++++++ calendar/gui/calendar-commands.c | 2 +- calendar/gui/calendar-component.c | 4 ++++ calendar/gui/e-tasks.c | 16 ++++++++++++++++ calendar/gui/gnome-cal.c | 17 +++++++++++++++++ calendar/gui/tasks-component.c | 8 +++++--- 6 files changed, 65 insertions(+), 4 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 3bc0740c82..1de5c69490 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,25 @@ +2004-04-09 Dan Winship + + * gui/gnome-cal.c (gnome_calendar_set_ui_component): Create an + EUserCreatableItemsHandler for the view if there isn't one yet, + and then activate it. + (gnome_calendar_destroy): destroy it. + + * gui/calendar-component.c (impl__get_userCreatableItems): add + object/folder flags to items. + + * gui/e-tasks.c (e_tasks_set_ui_component): Create an + EUserCreatableItemsHandler for the view if there isn't one yet, + and then activate it. + (e_tasks_destroy): destroy it. + + * gui/tasks-component.c (impl__get_userCreatableItems): add + object/folder flags. Change "Task List" to "Tasks Group" per new + specs. + + * gui/calendar-commands.c (calendar_control_deactivate): clear the + GnomeCal's ui_component rather than setting it again + 2004-04-07 Jeffrey Stedfast * gui/dialogs/cal-prefs-dialog.c: Fixed to be instant-apply. diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index d26230ce47..0b9d2a34c0 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -787,7 +787,7 @@ calendar_control_deactivate (BonoboControl *control, GnomeCalendar *gcal) uic = bonobo_control_get_ui_component (control); g_assert (uic != NULL); - gnome_calendar_set_ui_component (gcal, uic); + gnome_calendar_set_ui_component (gcal, NULL); focus = g_object_get_data (G_OBJECT (control), "focus_data"); g_assert (focus != NULL); diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 566e5b15d7..ccc5f888e9 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -925,6 +925,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].tooltip = _("Create a new appointment"); list->_buffer[0].menuShortcut = 'a'; list->_buffer[0].iconName = "new_appointment.xpm"; + list->_buffer[0].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[1].id = CREATE_MEETING_ID; list->_buffer[1].description = _("New meeting"); @@ -932,6 +933,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[1].tooltip = _("Create a new meeting request"); list->_buffer[1].menuShortcut = 'e'; list->_buffer[1].iconName = "meeting-request-16.png"; + list->_buffer[1].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[2].id = CREATE_ALLDAY_EVENT_ID; list->_buffer[2].description = _("New all day appointment"); @@ -939,6 +941,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[2].tooltip = _("Create a new all-day appointment"); list->_buffer[2].menuShortcut = 'd'; list->_buffer[2].iconName = "new_all_day_event.png"; + list->_buffer[2].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[3].id = CREATE_CALENDAR_ID; list->_buffer[3].description = _("New calendar"); @@ -946,6 +949,7 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[3].tooltip = _("Create a new calendar"); list->_buffer[3].menuShortcut = 'a'; list->_buffer[3].iconName = "evolution-calendar-mini.png"; + list->_buffer[3].type = GNOME_Evolution_CREATABLE_FOLDER; return list; } diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 162634c035..0072e26873 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -36,6 +36,7 @@ #include "e-util/e-categories-config.h" #include "e-util/e-time-utils.h" #include "e-util/e-url.h" +#include "shell/e-user-creatable-items-handler.h" #include #include "widgets/menus/gal-view-menus.h" #include "dialogs/delete-error.h" @@ -75,6 +76,8 @@ struct _ETasksPrivate { GalViewMenus *view_menus; GList *notifications; + + EUserCreatableItemsHandler *creatable_items_handler; }; @@ -692,6 +695,14 @@ e_tasks_set_ui_component (ETasks *tasks, g_return_if_fail (ui_component == NULL || BONOBO_IS_UI_COMPONENT (ui_component)); e_search_bar_set_ui_component (E_SEARCH_BAR (tasks->priv->search_bar), ui_component); + + if (ui_component) { + if (!tasks->priv->creatable_items_handler) { + tasks->priv->creatable_items_handler = + e_user_creatable_items_handler_new ("tasks"); + } + e_user_creatable_items_handler_activate (tasks->priv->creatable_items_handler, ui_component); + } } @@ -733,6 +744,11 @@ e_tasks_destroy (GtkObject *object) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); priv->notifications = NULL; + if (priv->creatable_items_handler) { + g_object_unref (priv->creatable_items_handler); + priv->creatable_items_handler = NULL; + } + g_free (priv); tasks->priv = NULL; } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 617d01c11c..31cec1741f 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -42,6 +42,7 @@ #include #include #include "e-util/e-url.h" +#include "shell/e-user-creatable-items-handler.h" #include #include #include @@ -154,6 +155,9 @@ struct _GnomeCalendarPrivate { 'dates-shown-changed' signal.*/ time_t visible_start; time_t visible_end; + + /* Our associated creatable items handler */ + EUserCreatableItemsHandler *creatable_items_handler; }; /* Signal IDs */ @@ -1193,6 +1197,11 @@ gnome_calendar_destroy (GtkObject *object) priv->view_menus = NULL; } + if (priv->creatable_items_handler) { + g_object_unref (priv->creatable_items_handler); + priv->creatable_items_handler = NULL; + } + g_free (priv); gcal->priv = NULL; } @@ -1992,6 +2001,14 @@ gnome_calendar_set_ui_component (GnomeCalendar *gcal, g_return_if_fail (ui_component == NULL || BONOBO_IS_UI_COMPONENT (ui_component)); e_search_bar_set_ui_component (E_SEARCH_BAR (gcal->priv->search_bar), ui_component); + + if (ui_component) { + if (!gcal->priv->creatable_items_handler) { + gcal->priv->creatable_items_handler = + e_user_creatable_items_handler_new ("calendar"); + } + e_user_creatable_items_handler_activate (gcal->priv->creatable_items_handler, ui_component); + } } /** diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 5b1683a0e4..12383124f4 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -562,13 +562,15 @@ impl__get_userCreatableItems (PortableServer_Servant servant, list->_buffer[0].tooltip = _("Create a new task"); list->_buffer[0].menuShortcut = 't'; list->_buffer[0].iconName = "new_task-16.png"; + list->_buffer[0].type = GNOME_Evolution_CREATABLE_OBJECT; list->_buffer[1].id = CREATE_TASK_LIST_ID; - list->_buffer[1].description = _("New task list"); - list->_buffer[1].menuDescription = _("_Task List"); - list->_buffer[1].tooltip = _("Create a new task list"); + list->_buffer[1].description = _("New tasks group"); + list->_buffer[1].menuDescription = _("_Tasks Group"); + list->_buffer[1].tooltip = _("Create a new tasks group"); list->_buffer[1].menuShortcut = 'n'; list->_buffer[1].iconName = "evolution-tasks-mini.png"; + list->_buffer[1].type = GNOME_Evolution_CREATABLE_FOLDER; return list; } -- cgit