Commit 13593352 authored by JP Rosevear's avatar JP Rosevear Committed by JP Rosevear

fix logic checks

2001-10-10  JP Rosevear  <jpr@ximian.com>

	* 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
parent a46bcc80
2001-10-10 JP Rosevear <jpr@ximian.com>
* 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 <federico@ximian.com>
Fixes bug #884.
......
......@@ -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:
......
......@@ -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;
......
......@@ -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) {
......
......@@ -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));
......
......@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment