From 1359335208dd9260b6b0541b692e534fa70bed7b Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 10 Oct 2001 14:37:14 +0000 Subject: fix logic checks 2001-10-10 JP Rosevear * pcs/cal-factory.c (add_uri): fix logic checks * gui/dialogs/event-editor.c (event_editor_init): init the exisiting_org boolean (set_menu_sens): base sensitivity on existing_org boolean (event_editor_edit_comp): set exisiting_org boolean * gui/dialogs/task-editor.c: same as above * gui/calendar-offline-handler.c (add_connection): handle the protocol or host being unknown * cal-util/cal-component.c (cal_component_has_organizer): implement svn path=/trunk/; revision=13552 --- calendar/ChangeLog | 17 +++++++++++++++++ calendar/cal-util/cal-component.c | 22 ++++++++++++++++++++++ calendar/gui/calendar-offline-handler.c | 12 +++++++++--- calendar/gui/dialogs/event-editor.c | 14 +++++++++++--- calendar/gui/dialogs/task-editor.c | 14 +++++++++++--- calendar/pcs/cal-factory.c | 4 ++-- 6 files changed, 72 insertions(+), 11 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 9220f6aae7..6fe9f516fe 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,20 @@ +2001-10-10 JP Rosevear + + * pcs/cal-factory.c (add_uri): fix logic checks + + * gui/dialogs/event-editor.c (event_editor_init): init the + exisiting_org boolean + (set_menu_sens): base sensitivity on existing_org boolean + (event_editor_edit_comp): set exisiting_org boolean + + * gui/dialogs/task-editor.c: same as above + + * gui/calendar-offline-handler.c (add_connection): handle the + protocol or host being unknown + + * cal-util/cal-component.c (cal_component_has_organizer): + implement + 2001-10-09 Federico Mena Quintero Fixes bug #884. diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index 0d58d41017..fd543debfe 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -2853,6 +2853,28 @@ cal_component_set_organizer (CalComponent *comp, CalComponentOrganizer *organize } + + +/** + * cal_component_has_organizer: + * @comp: + * + * + * + * Return value: + **/ +gboolean +cal_component_has_organizer (CalComponent *comp) +{ + CalComponentPrivate *priv; + + g_return_val_if_fail (comp != NULL, FALSE); + g_return_val_if_fail (IS_CAL_COMPONENT (comp), FALSE); + + priv = comp->priv; + + return priv->organizer.prop != NULL; +} /** * cal_component_get_percent: diff --git a/calendar/gui/calendar-offline-handler.c b/calendar/gui/calendar-offline-handler.c index 53db8f46e5..d1140e9123 100644 --- a/calendar/gui/calendar-offline-handler.c +++ b/calendar/gui/calendar-offline-handler.c @@ -54,8 +54,14 @@ add_connection (gpointer data, gpointer user_data) g_return_if_fail (uri != NULL); - list->_buffer[list->_length].hostName = CORBA_string_dup (uri->host); - list->_buffer[list->_length].type = CORBA_string_dup (uri->protocol); + if (uri->host != NULL) + list->_buffer[list->_length].hostName = CORBA_string_dup (uri->host); + else + list->_buffer[list->_length].hostName = CORBA_string_dup ("Unknown"); + if (uri->protocol != NULL) + list->_buffer[list->_length].type = CORBA_string_dup (uri->protocol); + else + list->_buffer[list->_length].type = CORBA_string_dup ("Unknown"); list->_length++; e_uri_free (uri); @@ -70,7 +76,7 @@ create_connection_list (CalendarOfflineHandler *offline_handler) priv = offline_handler->priv; - uris = cal_client_uri_list (priv->client, CAL_MODE_REMOTE); + uris = cal_client_uri_list (priv->client, CAL_MODE_REMOTE); list = GNOME_Evolution_ConnectionList__alloc (); list->_length = 0; diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 0b5fe9ec16..f464015fb0 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -49,6 +49,7 @@ struct _EventEditorPrivate { EMeetingModel *model; gboolean meeting_shown; + gboolean existing_org; gboolean updating; }; @@ -137,18 +138,22 @@ static void set_menu_sens (EventEditor *ee) { EventEditorPrivate *priv; + gboolean sens; priv = ee->priv; + sens = priv->meeting_shown; comp_editor_set_ui_prop (COMP_EDITOR (ee), "/commands/ActionScheduleMeeting", - "sensitive", priv->meeting_shown ? "0" : "1"); + "sensitive", sens ? "0" : "1"); + + sens = sens && priv->existing_org; comp_editor_set_ui_prop (COMP_EDITOR (ee), "/commands/ActionRefreshMeeting", - "sensitive", priv->meeting_shown ? "1" : "0"); + "sensitive", sens ? "1" : "0"); comp_editor_set_ui_prop (COMP_EDITOR (ee), "/commands/ActionCancelMeeting", - "sensitive", priv->meeting_shown ? "1" : "0"); + "sensitive", sens ? "1" : "0"); } static void @@ -207,6 +212,7 @@ event_editor_init (EventEditor *ee) verbs); priv->meeting_shown = TRUE; + priv->existing_org = FALSE; priv->updating = FALSE; init_widgets (ee); @@ -239,6 +245,8 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp) priv = ee->priv; priv->updating = TRUE; + + priv->existing_org = cal_component_has_organizer (comp); cal_component_get_attendee_list (comp, &attendees); if (attendees == NULL) { diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 3c09dece79..774a9cc1c3 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -44,6 +44,7 @@ struct _TaskEditorPrivate { EMeetingModel *model; gboolean meeting_shown; + gboolean existing_org; gboolean updating; }; @@ -128,18 +129,22 @@ static void set_menu_sens (TaskEditor *te) { TaskEditorPrivate *priv; + gboolean sens; priv = te->priv; + sens = priv->meeting_shown; comp_editor_set_ui_prop (COMP_EDITOR (te), "/commands/ActionAssignTask", - "sensitive", priv->meeting_shown ? "0" : "1"); + "sensitive", sens ? "0" : "1"); + + sens = sens && priv->existing_org; comp_editor_set_ui_prop (COMP_EDITOR (te), "/commands/ActionRefreshTask", - "sensitive", priv->meeting_shown ? "1" : "0"); + "sensitive", sens ? "1" : "0"); comp_editor_set_ui_prop (COMP_EDITOR (te), "/commands/ActionCancelTask", - "sensitive", priv->meeting_shown ? "1" : "0"); + "sensitive", sens ? "1" : "0"); } static void @@ -188,6 +193,7 @@ task_editor_init (TaskEditor *te) verbs); priv->meeting_shown = TRUE; + priv->existing_org = FALSE; priv->updating = FALSE; init_widgets (te); @@ -206,6 +212,8 @@ task_editor_edit_comp (CompEditor *editor, CalComponent *comp) priv->updating = TRUE; + priv->existing_org = cal_component_has_organizer (comp); + cal_component_get_attendee_list (comp, &attendees); if (attendees == NULL) { comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page)); diff --git a/calendar/pcs/cal-factory.c b/calendar/pcs/cal-factory.c index a404ee49f4..d962b22862 100644 --- a/calendar/pcs/cal-factory.c +++ b/calendar/pcs/cal-factory.c @@ -349,12 +349,12 @@ add_uri (gpointer key, gpointer value, gpointer data) switch (mode) { case GNOME_Evolution_Calendar_MODE_LOCAL: backend = lookup_backend (factory, uri_string); - if (backend == NULL && cal_backend_get_mode (backend) == CAL_MODE_LOCAL) + if (backend == NULL || cal_backend_get_mode (backend) != CAL_MODE_LOCAL) return; break; case GNOME_Evolution_Calendar_MODE_REMOTE: backend = lookup_backend (factory, uri_string); - if (backend == NULL && cal_backend_get_mode (backend) == CAL_MODE_REMOTE) + if (backend == NULL || cal_backend_get_mode (backend) != CAL_MODE_REMOTE) return; break; case GNOME_Evolution_Calendar_MODE_ANY: -- cgit v1.2.3