From 21743ac2cfa2d2ddcd539e9b7695cc8dd720ef36 Mon Sep 17 00:00:00 2001 From: Ettore Perazzoli Date: Tue, 21 Oct 2003 18:51:30 +0000 Subject: Merge new-ui-branch into the trunk. svn path=/trunk/; revision=22966 --- calendar/gui/dialogs/alarm-page.c | 16 +-- calendar/gui/dialogs/comp-editor-util.c | 1 - calendar/gui/dialogs/comp-editor.c | 40 +++---- calendar/gui/dialogs/delete-error.c | 25 ++-- calendar/gui/dialogs/delete-error.h | 2 +- calendar/gui/dialogs/e-delegate-dialog.c | 26 ++--- calendar/gui/dialogs/event-editor.c | 5 +- calendar/gui/dialogs/event-page.c | 23 ++-- calendar/gui/dialogs/meeting-page.c | 12 +- calendar/gui/dialogs/meeting-page.etspec | 21 ++++ calendar/gui/dialogs/new-calendar.c | 150 ++++++++++++++++++++++++ calendar/gui/dialogs/new-calendar.glade | 193 +++++++++++++++++++++++++++++++ calendar/gui/dialogs/new-calendar.h | 28 +++++ calendar/gui/dialogs/recurrence-page.c | 6 +- calendar/gui/dialogs/schedule-page.c | 23 ++-- calendar/gui/dialogs/task-editor.c | 5 +- calendar/gui/dialogs/task-page.c | 17 +-- 17 files changed, 490 insertions(+), 103 deletions(-) create mode 100644 calendar/gui/dialogs/meeting-page.etspec create mode 100644 calendar/gui/dialogs/new-calendar.c create mode 100644 calendar/gui/dialogs/new-calendar.glade create mode 100644 calendar/gui/dialogs/new-calendar.h (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index 785734ad8c..919ed9a2c8 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -677,10 +677,9 @@ add_clicked_cb (GtkButton *button, gpointer data) action = e_dialog_option_menu_get (priv->action, action_map); cal_component_alarm_set_action (alarm, action); if (action == CAL_ALARM_EMAIL && !cal_component_alarm_has_attendees (alarm)) { - const char *email; + char *email; - email = cal_client_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client); - if (email != NULL) { + if (!cal_client_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client, &email, NULL)) { CalComponentAttendee *a; GSList attendee_list; @@ -689,6 +688,7 @@ add_clicked_cb (GtkButton *button, gpointer data) attendee_list.data = a; attendee_list.next = NULL; cal_component_alarm_set_attendee_list (alarm, &attendee_list); + g_free (email); g_free (a); } } @@ -741,7 +741,7 @@ button_options_clicked_cb (GtkWidget *widget, gpointer data) AlarmPage *apage; AlarmPagePrivate *priv; gboolean repeat; - const char *email; + char *email; apage = ALARM_PAGE (data); priv = apage->priv; @@ -751,9 +751,11 @@ button_options_clicked_cb (GtkWidget *widget, gpointer data) repeat = !cal_client_get_static_capability (COMP_EDITOR_PAGE (apage)->client, CAL_STATIC_CAPABILITY_NO_ALARM_REPEAT); - email = cal_client_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client); - if (!alarm_options_dialog_run (priv->alarm, email, repeat)) - g_message ("button_options_clicked_cb(): Could not create the alarm options dialog"); + + if (cal_client_get_alarm_email_address (COMP_EDITOR_PAGE (apage)->client, &email, NULL)) { + if (!alarm_options_dialog_run (priv->alarm, email, repeat)) + g_message ("button_options_clicked_cb(): Could not create the alarm options dialog"); + } } /* Hooks the widget signals */ diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index ce3cbc42f6..d06234edda 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include "../calendar-config.h" diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index f9c9919338..2bbcf92df3 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -41,6 +41,7 @@ #include #include #include "../print.h" +#include "../comp-util.h" #include "save-comp.h" #include "delete-comp.h" #include "send-comp.h" @@ -294,7 +295,8 @@ save_comp (CompEditor *editor) CompEditorPrivate *priv; CalComponent *clone; GList *l; - CalClientResult result; + gboolean result; + GError *error = NULL; priv = editor->priv; @@ -321,32 +323,24 @@ save_comp (CompEditor *editor) priv->updating = TRUE; - if (cal_component_is_instance (priv->comp)) - result = cal_client_update_object_with_mod (priv->client, priv->comp, priv->mod); - else - result = cal_client_update_object (priv->client, priv->comp); - if (result != CAL_CLIENT_RESULT_SUCCESS) { + if (!cal_comp_is_on_server (priv->comp, priv->client)) { + result = cal_client_create_object (priv->client, cal_component_get_icalcomponent (priv->comp), NULL, &error); + } else { + result = cal_client_modify_object (priv->client, cal_component_get_icalcomponent (priv->comp), priv->mod, &error); + } + + if (!result) { GtkWidget *dlg; char *msg; - switch (result) { - case CAL_CLIENT_RESULT_INVALID_OBJECT : - msg = g_strdup (_("Could not update invalid object")); - break; - case CAL_CLIENT_RESULT_NOT_FOUND : - msg = g_strdup (_("Object not found, not updated")); - break; - case CAL_CLIENT_RESULT_PERMISSION_DENIED : - msg = g_strdup (_("You don't have permissions to update this object")); - break; - default : - msg = g_strdup (_("Could not update object")); - break; - } + msg = g_strdup (error ? error->message : _("Could not update object")); dlg = gnome_error_dialog (msg); gnome_dialog_run_and_close (GNOME_DIALOG (dlg)); + g_free (msg); + if (error) + g_error_free (error); return FALSE; } else { @@ -391,7 +385,7 @@ delete_comp (CompEditor *editor) cal_component_get_uid (priv->comp, &uid); priv->updating = TRUE; - cal_client_remove_object (priv->client, uid); + cal_client_remove_object (priv->client, uid, NULL); priv->updating = FALSE; close_dialog (editor); } @@ -1442,7 +1436,6 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data) CompEditor *editor = COMP_EDITOR (data); CompEditorPrivate *priv; CalComponent *comp = NULL; - CalClientGetStatus status; const char *edit_uid; priv = editor->priv; @@ -1453,8 +1446,7 @@ obj_updated_cb (CalClient *client, const char *uid, gpointer data) if (changed_component_dialog ((GtkWindow *) editor, priv->comp, FALSE, priv->changed)) { icalcomponent *icalcomp; - status = cal_client_get_object (priv->client, uid, &icalcomp); - if (status == CAL_CLIENT_GET_SUCCESS) { + if (!cal_client_get_object (priv->client, uid, NULL, &icalcomp, NULL)) { comp = cal_component_new (); if (cal_component_set_icalcomponent (comp, icalcomp)) comp_editor_edit_comp (editor, comp); diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index 947aab1e97..edbcaf9880 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -38,13 +38,16 @@ * **/ void -delete_error_dialog (CalClientResult result, CalComponentVType vtype) +delete_error_dialog (GError *error, CalComponentVType vtype) { GtkWidget *dialog; const char *str; - switch (result) { - case CAL_CLIENT_RESULT_CORBA_ERROR: + if (!error) + return; + + switch (error->code) { + case E_CALENDAR_STATUS_CORBA_EXCEPTION: switch (vtype) { case CAL_COMPONENT_EVENT: str = _("The event could not be deleted due to a corba error"); @@ -60,7 +63,7 @@ delete_error_dialog (CalClientResult result, CalComponentVType vtype) break; } break; - case CAL_CLIENT_RESULT_PERMISSION_DENIED: + case E_CALENDAR_STATUS_PERMISSION_DENIED: switch (vtype) { case CAL_COMPONENT_EVENT: str = _("The event could not be deleted because permission was denied"); @@ -76,24 +79,24 @@ delete_error_dialog (CalClientResult result, CalComponentVType vtype) break; } break; - case CAL_CLIENT_RESULT_INVALID_OBJECT: + case E_CALENDAR_STATUS_OTHER_ERROR: switch (vtype) { case CAL_COMPONENT_EVENT: - str = _("The event could not be deleted because it was invalid"); + str = _("The event could not be deleted due to an error"); break; case CAL_COMPONENT_TODO: - str = _("The task could not be deleted because it was invalid"); + str = _("The task could not be deleted due to an error"); break; case CAL_COMPONENT_JOURNAL: - str = _("The journal entry could not be deleted because it was invalid"); + str = _("The journal entry could not be deleted due to an error"); break; default: - str = _("The item could not be deleted because it was invalid"); + str = _("The item could not be deleted due to an error"); break; } break; - case CAL_CLIENT_RESULT_SUCCESS: - case CAL_CLIENT_RESULT_NOT_FOUND: + case E_CALENDAR_STATUS_OK: + case E_CALENDAR_STATUS_OBJECT_NOT_FOUND: default: /* If not found, we don't care - its gone anyhow */ return; diff --git a/calendar/gui/dialogs/delete-error.h b/calendar/gui/dialogs/delete-error.h index dcef2fa3be..4ac8cf4515 100644 --- a/calendar/gui/dialogs/delete-error.h +++ b/calendar/gui/dialogs/delete-error.h @@ -25,6 +25,6 @@ #include #include -void delete_error_dialog (CalClientResult result, CalComponentVType vtype); +void delete_error_dialog (GError *error, CalComponentVType vtype); #endif diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index 85c17bbd4b..709ea41178 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "Evolution-Addressbook-SelectNames.h" #include "e-delegate-dialog.h" @@ -126,8 +126,8 @@ EDelegateDialog * e_delegate_dialog_construct (EDelegateDialog *edd, const char *name, const char *address) { EDelegateDialogPrivate *priv; - EDestination *dest; - EDestination *destv[2] = {NULL, NULL}; + EABDestination *dest; + EABDestination *destv[2] = {NULL, NULL}; Bonobo_Control corba_control; CORBA_Environment ev; char *str; @@ -178,13 +178,13 @@ e_delegate_dialog_construct (EDelegateDialog *edd, const char *name, const char gtk_widget_show (priv->entry); gtk_box_pack_start (GTK_BOX (priv->hbox), priv->entry, TRUE, TRUE, 6); - dest = e_destination_new (); + dest = eab_destination_new (); destv[0] = dest; if (name != NULL && *name) - e_destination_set_name (dest, name); + eab_destination_set_name (dest, name); if (address != NULL && *address) - e_destination_set_email (dest, address); - str = e_destination_exportv(destv); + eab_destination_set_email (dest, address); + str = eab_destination_exportv(destv); bonobo_widget_set_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, str, NULL); g_free(str); g_object_unref((dest)); @@ -256,7 +256,7 @@ char * e_delegate_dialog_get_delegate (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; - EDestination **destv; + EABDestination **destv; char *string = NULL; g_return_val_if_fail (edd != NULL, NULL); @@ -265,11 +265,11 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd) priv = edd->priv; bonobo_widget_get_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, &string, NULL); - destv = e_destination_importv (string); + destv = eab_destination_importv (string); if (destv && destv[0] != NULL) { g_free (priv->address); - priv->address = g_strdup (e_destination_get_email (destv[0])); + priv->address = g_strdup (eab_destination_get_email (destv[0])); g_free (destv); } @@ -283,7 +283,7 @@ char * e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) { EDelegateDialogPrivate *priv; - EDestination **destv; + EABDestination **destv; char *string = NULL; g_return_val_if_fail (edd != NULL, NULL); @@ -292,13 +292,13 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) priv = edd->priv; bonobo_widget_get_property (BONOBO_WIDGET (priv->entry), "destinations", TC_CORBA_string, &string, NULL); - destv = e_destination_importv (string); + destv = eab_destination_importv (string); g_message ("importv: [%s]", string); if (destv && destv[0] != NULL) { g_free (priv->name); - priv->name = g_strdup (e_destination_get_name (destv[0])); + priv->name = g_strdup (eab_destination_get_name (destv[0])); g_free (destv); } diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 978a2dbb22..861a52c203 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -122,13 +122,14 @@ static void set_menu_sens (EventEditor *ee) { EventEditorPrivate *priv; - gboolean sens, existing, user, read_only; + gboolean sens, existing, user, read_only = TRUE; priv = ee->priv; existing = comp_editor_get_existing_org (COMP_EDITOR (ee)); user = comp_editor_get_user_org (COMP_EDITOR (ee)); - read_only = cal_client_is_read_only (comp_editor_get_cal_client (COMP_EDITOR (ee))); + + cal_client_is_read_only (comp_editor_get_cal_client (COMP_EDITOR (ee)), &read_only, NULL); sens = priv->meeting_shown; comp_editor_set_ui_prop (COMP_EDITOR (ee), diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index b55e67dedd..8813081f4d 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -270,7 +270,6 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat EventPagePrivate *priv; struct icaltimetype *start_tt, *end_tt, implied_tt; icaltimezone *start_zone = NULL, *end_zone = NULL; - CalClientGetStatus status; gboolean all_day_event; priv = epage->priv; @@ -280,24 +279,22 @@ update_time (EventPage *epage, CalComponentDateTime *start_date, CalComponentDat first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { - status = cal_client_get_timezone (COMP_EDITOR_PAGE (epage)->client, - start_date->tzid, - &start_zone); /* FIXME: Handle error better. */ - if (status != CAL_CLIENT_GET_SUCCESS) + if (!cal_client_get_timezone (COMP_EDITOR_PAGE (epage)->client, + start_date->tzid, &start_zone, NULL)) { g_warning ("Couldn't get timezone from server: %s", - start_date->tzid ? start_date->tzid : ""); + start_date->tzid ? start_date->tzid : ""); + } } end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid); if (!end_zone) { - status = cal_client_get_timezone (COMP_EDITOR_PAGE (epage)->client, - end_date->tzid, - &end_zone); - /* FIXME: Handle error better. */ - if (status != CAL_CLIENT_GET_SUCCESS) - g_warning ("Couldn't get timezone from server: %s", - end_date->tzid ? end_date->tzid : ""); + if (!cal_client_get_timezone (COMP_EDITOR_PAGE (epage)->client, + end_date->tzid, &end_zone, NULL)) { + /* FIXME: Handle error better. */ + g_warning ("Couldn't get timezone from server: %s", + end_date->tzid ? end_date->tzid : ""); + } } /* If both times are DATE values, we set the 'All Day Event' checkbox. diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 6c8212e93c..800b0d56c6 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -693,7 +694,9 @@ meeting_page_construct (MeetingPage *mpage, EMeetingStore *ems, CalClient *client) { MeetingPagePrivate *priv; - const char *backend_address; + ETable *real_table; + gchar *filename; + char *backend_address; EIterator *it; EAccount *def_account; GList *address_strings = NULL, *l; @@ -716,7 +719,8 @@ meeting_page_construct (MeetingPage *mpage, EMeetingStore *ems, } /* Address information */ - backend_address = cal_client_get_cal_address (client); + if (!cal_client_get_cal_address (client, &backend_address, NULL)) + return NULL; priv->accounts = itip_addresses_get (); def_account = itip_addresses_get_default(); @@ -743,7 +747,8 @@ meeting_page_construct (MeetingPage *mpage, EMeetingStore *ems, } } g_object_unref(it); - + g_free (backend_address); + if (address_strings) gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), address_strings); else @@ -753,6 +758,7 @@ meeting_page_construct (MeetingPage *mpage, EMeetingStore *ems, g_free (l->data); g_list_free (address_strings); + /* The etable displaying attendees and their status */ g_object_ref((ems)); priv->model = ems; diff --git a/calendar/gui/dialogs/meeting-page.etspec b/calendar/gui/dialogs/meeting-page.etspec new file mode 100644 index 0000000000..96bc480fe9 --- /dev/null +++ b/calendar/gui/dialogs/meeting-page.etspec @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/calendar/gui/dialogs/new-calendar.c b/calendar/gui/dialogs/new-calendar.c new file mode 100644 index 0000000000..aa647b55b2 --- /dev/null +++ b/calendar/gui/dialogs/new-calendar.c @@ -0,0 +1,150 @@ +/* Evolution calendar - Send calendar component dialog + * + * Copyright (C) 2001 Ximian, Inc. + * + * Author: JP Rosevear + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "new-calendar.h" + +static gboolean +create_new_source_with_group (GtkWindow *parent, + ESourceGroup *group, + const char *source_name) +{ + ESource *source; + char *new_dir; + + if (e_source_group_peek_source_by_name (group, source_name)) { + e_notice (parent, GTK_MESSAGE_ERROR, + _("Source with name '%s' already exists in the selected group"), + source_name); + return FALSE; + } + + /* create the new source */ + new_dir = g_build_filename (e_source_group_peek_base_uri (group), + source_name, NULL); + if (e_mkdir_hier (new_dir, 0700)) { + g_free (new_dir); + e_notice (parent, GTK_MESSAGE_ERROR, + _("Could not create directory for new calendar")); + return FALSE; + } + + source = e_source_new (source_name, source_name); + e_source_group_add_source (group, source, -1); + + g_free (new_dir); + + return TRUE; +} + +/** + * new_calendar_dialog + * + * Displays a dialog that allows the user to create a new calendar. + */ +gboolean +new_calendar_dialog (GtkWindow *parent) +{ + GtkWidget *dialog, *cal_group, *cal_name; + GladeXML *xml; + ESourceList *source_list; + GConfClient *gconf_client; + GSList *groups, *sl; + gboolean result = FALSE, retry = TRUE; + + /* load the Glade file */ + xml = glade_xml_new (EVOLUTION_GLADEDIR "/new-calendar.glade", "new-calendar-dialog", NULL); + if (!xml) { + g_warning ("new_calendar_dialog(): cannot load Glade file"); + return FALSE; + } + + dialog = glade_xml_get_widget (xml, "new-calendar-dialog"); + cal_group = glade_xml_get_widget (xml, "calendar-group"); + cal_name = glade_xml_get_widget (xml, "calendar-name"); + + /* set up widgets */ + gconf_client = gconf_client_get_default (); + source_list = e_source_list_new_for_gconf (gconf_client, "/apps/evolution/calendar/sources"); + + groups = e_source_list_peek_groups (source_list); + for (sl = groups; sl != NULL; sl = sl->next) { + GtkWidget *menu_item, *menu; + ESourceGroup *group = sl->data; + + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (cal_group)); + if (!GTK_IS_MENU (menu)) { + menu = gtk_menu_new (); + gtk_option_menu_set_menu (GTK_OPTION_MENU (cal_group), menu); + gtk_widget_show (menu); + } + + menu_item = gtk_menu_item_new_with_label (e_source_group_peek_name (group)); + gtk_widget_show (menu_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), menu_item); + } + + if (groups) + gtk_option_menu_set_history (GTK_OPTION_MENU (cal_group), 0); + + /* run the dialog */ + do { + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { + char *name; + + name = gtk_entry_get_text (GTK_ENTRY (cal_name)); + sl = g_slist_nth (groups, gtk_option_menu_get_history (GTK_OPTION_MENU (cal_group))); + if (sl) { + if (create_new_source_with_group (GTK_WINDOW (dialog), + sl->data, + name)) + retry = FALSE; + } else { + e_notice (dialog, GTK_MESSAGE_ERROR, + _("A group must be selected")); + continue; + } + } else + retry = FALSE; /* user pressed Cancel */ + } while (retry); + + /* free memory */ + g_object_unref (gconf_client); + g_object_unref (source_list); + gtk_widget_destroy (dialog); + + /* free memory */ + g_object_unref (xml); + + return result; +} diff --git a/calendar/gui/dialogs/new-calendar.glade b/calendar/gui/dialogs/new-calendar.glade new file mode 100644 index 0000000000..42717a87a8 --- /dev/null +++ b/calendar/gui/dialogs/new-calendar.glade @@ -0,0 +1,193 @@ + + + + + + + + 12 + True + Add New Calendar + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER + False + False + False + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-cancel + True + GTK_RELIEF_NORMAL + -6 + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + -5 + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + 3 + 3 + False + 6 + 6 + + + + True + Calendar Group + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 1 + 2 + 6 + fill + + + + + + + True + Calendar Name + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 1 + 2 + 2 + 3 + 6 + fill + + + + + + + True + True + -1 + + + 2 + 3 + 1 + 2 + 6 + fill + + + + + + + True + True + True + True + 0 + + True + * + False + + + 2 + 3 + 2 + 3 + 6 + + + + + + + True + <b>Calendar options</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 0 + 3 + 0 + 1 + 6 + + + + + + 0 + True + True + + + + + + + diff --git a/calendar/gui/dialogs/new-calendar.h b/calendar/gui/dialogs/new-calendar.h new file mode 100644 index 0000000000..9890f9e1f8 --- /dev/null +++ b/calendar/gui/dialogs/new-calendar.h @@ -0,0 +1,28 @@ +/* Evolution calendar - Send calendar component dialog + * + * Copyright (C) 2001 Ximian, Inc. + * + * Author: JP Rosevear + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef NEW_CALENDAR_H +#define NEW_CALENDAR_H + +#include + +gboolean new_calendar_dialog (GtkWindow *parent); + +#endif diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 275ba26c44..4599001c27 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -852,7 +852,8 @@ preview_recur (RecurrencePage *rpage) cal_component_get_dtstart (priv->comp, &cdt); if (cdt.tzid != NULL) { - if (cal_client_get_timezone (COMP_EDITOR_PAGE (rpage)->client, cdt.tzid, &zone) != CAL_CLIENT_GET_SUCCESS) + /* FIXME Will cal_client_get_timezone really not return builtin zones? */ + if (!cal_client_get_timezone (COMP_EDITOR_PAGE (rpage)->client, cdt.tzid, &zone, NULL)) zone = icaltimezone_get_builtin_timezone_from_tzid (cdt.tzid); } cal_component_set_dtstart (comp, &cdt); @@ -1448,7 +1449,8 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) else if (dt.tzid == NULL) to_zone = icaltimezone_get_utc_timezone (); else - cal_client_get_timezone (client, dt.tzid, &to_zone); + /* FIXME Error checking? */ + cal_client_get_timezone (client, dt.tzid, &to_zone, NULL); from_zone = icaltimezone_get_utc_timezone (); icaltimezone_convert_time (&r->until, from_zone, to_zone); diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 8cad77360b..06c2d57131 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -208,7 +208,6 @@ update_time (SchedulePage *spage, CalComponentDateTime *start_date, CalComponent SchedulePagePrivate *priv; struct icaltimetype start_tt, end_tt; icaltimezone *start_zone = NULL, *end_zone = NULL; - CalClientGetStatus status; gboolean all_day; priv = spage->priv; @@ -218,24 +217,22 @@ update_time (SchedulePage *spage, CalComponentDateTime *start_date, CalComponent first. */ start_zone = icaltimezone_get_builtin_timezone_from_tzid (start_date->tzid); if (!start_zone) { - status = cal_client_get_timezone (COMP_EDITOR_PAGE (spage)->client, - start_date->tzid, - &start_zone); - /* FIXME: Handle error better. */ - if (status != CAL_CLIENT_GET_SUCCESS) + if (!cal_client_get_timezone (COMP_EDITOR_PAGE (spage)->client, + start_date->tzid, &start_zone, NULL)) { + /* FIXME: Handle error better. */ g_warning ("Couldn't get timezone from server: %s", start_date->tzid ? start_date->tzid : ""); + } } end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid); if (!end_zone) { - status = cal_client_get_timezone (COMP_EDITOR_PAGE (spage)->client, - end_date->tzid, - &end_zone); - /* FIXME: Handle error better. */ - if (status != CAL_CLIENT_GET_SUCCESS) - g_warning ("Couldn't get timezone from server: %s", - end_date->tzid ? end_date->tzid : ""); + if (!cal_client_get_timezone (COMP_EDITOR_PAGE (spage)->client, + end_date->tzid, &end_zone, NULL)) { + /* FIXME: Handle error better. */ + g_warning ("Couldn't get timezone from server: %s", + end_date->tzid ? end_date->tzid : ""); + } } start_tt = *start_date->value; diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 4ef971fe85..339fdca80d 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -112,13 +112,14 @@ static void set_menu_sens (TaskEditor *te) { TaskEditorPrivate *priv; - gboolean sens, existing, user, read_only; + gboolean sens, existing, user, read_only = TRUE; priv = te->priv; existing = comp_editor_get_existing_org (COMP_EDITOR (te)); user = comp_editor_get_user_org (COMP_EDITOR (te)); - read_only = cal_client_is_read_only (comp_editor_get_cal_client (COMP_EDITOR (te))); + + cal_client_is_read_only (comp_editor_get_cal_client (COMP_EDITOR (te)), &read_only, NULL); sens = cal_client_get_static_capability (comp_editor_get_cal_client (COMP_EDITOR (te)), CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT) diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 760b3e6f9e..fb7558ce5a 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -253,7 +253,6 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) CalComponentText text; CalComponentDateTime d; CalComponentClassification cl; - CalClientGetStatus get_tz_status; GSList *l; const char *categories; icaltimezone *zone, *default_zone; @@ -317,12 +316,10 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) if (!zone) zone = icaltimezone_get_builtin_timezone_from_tzid (d.tzid); if (!zone) { - get_tz_status = cal_client_get_timezone (page->client, d.tzid, - &zone); - /* FIXME: Handle error better. */ - if (get_tz_status != CAL_CLIENT_GET_SUCCESS) - g_warning ("Couldn't get timezone from server: %s", - d.tzid ? d.tzid : ""); + if (!cal_client_get_timezone (page->client, d.tzid, &zone, NULL)) + /* FIXME: Handle error better. */ + g_warning ("Couldn't get timezone from server: %s", + d.tzid ? d.tzid : ""); } e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->due_timezone), zone); @@ -359,10 +356,8 @@ task_page_fill_widgets (CompEditorPage *page, CalComponent *comp) if (!zone) zone = icaltimezone_get_builtin_timezone_from_tzid (d.tzid); if (!zone) { - get_tz_status = cal_client_get_timezone (page->client, d.tzid, - &zone); - /* FIXME: Handle error better. */ - if (get_tz_status != CAL_CLIENT_GET_SUCCESS) + if (!cal_client_get_timezone (page->client, d.tzid, &zone, NULL)) + /* FIXME: Handle error better. */ g_warning ("Couldn't get timezone from server: %s", d.tzid ? d.tzid : ""); } -- cgit