From 720a792d11bbcadfd8bddfa8d68a0fbe0eb817d0 Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 4 Jul 2001 01:33:05 +0000 Subject: Add new columns for information specification (meeting_page_destroy): save 2001-07-03 JP Rosevear * gui/dialogs/meeting-page.c: Add new columns for information specification (meeting_page_destroy): save the table state (build_etable): load new table state * gui/dialogs/task-editor.c (task_editor_destroy): unref pages * gui/dialogs/event-editor.c (event_editor_destroy): unref pages * gui/dialogs/comp-editor.c (setup_widgets): kill warning (comp_editor_append_page): ref page passed in (close_dialog): unref pages svn path=/trunk/; revision=10777 --- calendar/ChangeLog | 15 +++++++++ calendar/cal-util/cal-component.c | 2 +- calendar/gui/dialogs/comp-editor.c | 10 ++++-- calendar/gui/dialogs/event-editor.c | 5 +++ calendar/gui/dialogs/meeting-page.c | 61 +++++++++++++++++++++++++++++-------- calendar/gui/dialogs/task-editor.c | 3 ++ calendar/gui/e-tasks.c | 1 - 7 files changed, 80 insertions(+), 17 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index cff0c1a1a5..c56c872508 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,18 @@ +2001-07-03 JP Rosevear + + * gui/dialogs/meeting-page.c: Add new columns for information + specification + (meeting_page_destroy): save the table state + (build_etable): load new table state + + * gui/dialogs/task-editor.c (task_editor_destroy): unref pages + + * gui/dialogs/event-editor.c (event_editor_destroy): unref pages + + * gui/dialogs/comp-editor.c (setup_widgets): kill warning + (comp_editor_append_page): ref page passed in + (close_dialog): unref pages + 2001-07-03 Damon Chaplin * gui/e-day-view.c (query_obj_updated_cb): fix warning, and added diff --git a/calendar/cal-util/cal-component.c b/calendar/cal-util/cal-component.c index 86b949dfed..1ebc398e63 100644 --- a/calendar/cal-util/cal-component.c +++ b/calendar/cal-util/cal-component.c @@ -3756,7 +3756,7 @@ set_attendee_list (CalComponent *comp, icalproperty_add_parameter (attendee->prop, attendee->cn_param); } if (a->language) { - attendee->language_param = icalparameter_new_language (a->cn); + attendee->language_param = icalparameter_new_language (a->language); icalproperty_add_parameter (attendee->prop, attendee->language_param); } diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index c001207783..ea42980c2c 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -201,7 +201,7 @@ setup_widgets (CompEditor *editor) /* Notebook */ priv->notebook = GTK_NOTEBOOK (gtk_notebook_new ()); - gtk_widget_show (priv->notebook); + gtk_widget_show (GTK_WIDGET (priv->notebook)); gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->notebook), TRUE, TRUE, 0); } @@ -273,6 +273,8 @@ comp_editor_append_page (CompEditor *editor, priv = editor->priv; + gtk_object_ref (GTK_OBJECT (page)); + /* If we are editing something, fill the widgets with current info */ if (priv->comp != NULL) { CalComponent *comp; @@ -723,11 +725,15 @@ static void close_dialog (CompEditor *editor) { CompEditorPrivate *priv; - + GList *l; + priv = editor->priv; g_assert (priv->window != NULL); + for (l = priv->pages; l != NULL; l = l->next) + gtk_object_unref (GTK_OBJECT (l->data)); + gtk_object_destroy (GTK_OBJECT (editor)); } diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 4a69fcbe43..6eb10cb0fb 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -191,6 +191,11 @@ event_editor_destroy (GtkObject *object) ee = EVENT_EDITOR (object); priv = ee->priv; + gtk_object_unref (GTK_OBJECT (priv->event_page)); + gtk_object_unref (GTK_OBJECT (priv->alarm_page)); + gtk_object_unref (GTK_OBJECT (priv->recur_page)); + gtk_object_unref (GTK_OBJECT (priv->meet_page)); + if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 566422aa9b..b67cf622ba 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -42,6 +42,7 @@ #include #include #include +#include "../component-factory.h" #include "comp-editor-util.h" #include "meeting-page.h" @@ -53,34 +54,35 @@ " _click-to-add-message=\"Click here to add an attendee\" " \ " draw-grid=\"true\">" \ " " \ " " \ + " cell=\"string\" compare=\"string\"/>" \ " " \ " " \ " " \ " " \ " " \ - " " \ + " " \ + " cell=\"string\" compare=\"string\"/>" \ " " \ " " \ - " " \ " " \ " " \ + " " \ + " " \ " " \ " " \ "" @@ -232,13 +234,21 @@ meeting_page_destroy (GtkObject *object) { MeetingPage *mpage; MeetingPagePrivate *priv; - + ETable *real_table; + char *filename; + g_return_if_fail (object != NULL); g_return_if_fail (IS_MEETING_PAGE (object)); mpage = MEETING_PAGE (object); priv = mpage->priv; + filename = g_strdup_printf ("%s/config/et-header-meeting-page", + evolution_dir); + real_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->etable)); + e_table_save_state (real_table, filename); + g_free (filename); + if (priv->xml) { gtk_object_unref (GTK_OBJECT (priv->xml)); priv->xml = NULL; @@ -357,7 +367,7 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) CalComponentAttendee *att = g_new0 (CalComponentAttendee, 1); att->value = attendee->address; - att->member = attendee->member; + att->member = (attendee->member && *attendee->member) ? attendee->member : NULL; att->cutype= attendee->cutype; att->role = attendee->role; att->status = attendee->status; @@ -365,8 +375,8 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) att->delto = attendee->delto; att->delfrom = attendee->delfrom; att->sentby = attendee->sentby; - att->cn = attendee->cn; - att->language = attendee->language; + att->cn = (attendee->cn && *attendee->cn) ? attendee->cn : NULL; + att->language = (attendee->language && *attendee->language) ? attendee->language : NULL; attendees = g_slist_prepend (attendees, att); @@ -862,13 +872,32 @@ static void build_etable (MeetingPage *mpage) { MeetingPagePrivate *priv; + ETable *real_table; ETableExtras *extras; GList *strings; ECell *popup_cell, *cell; + char *filename; + priv = mpage->priv; extras = e_table_extras_new (); + + /* For type */ + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); + popup_cell = e_cell_combo_new (); + e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); + gtk_object_unref (GTK_OBJECT (cell)); + + strings = NULL; + strings = g_list_append (strings, "Individual"); + strings = g_list_append (strings, "Group"); + strings = g_list_append (strings, "Resource"); + strings = g_list_append (strings, "Room"); + strings = g_list_append (strings, "Unknown"); + + e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), strings); + e_table_extras_add_cell (extras, "typeedit", popup_cell); /* For role */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); @@ -934,6 +963,12 @@ build_etable (MeetingPage *mpage) priv->etable = e_table_scrolled_new (priv->model, extras, MEETING_PAGE_TABLE_SPEC, NULL); + filename = g_strdup_printf ("%s/config/et-header-meeting-page", + evolution_dir); + real_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (priv->etable)); + e_table_load_state (real_table, filename); + g_free (filename); + gtk_object_unref (GTK_OBJECT (extras)); } diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 6b582315f4..6e5a6f689e 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -173,6 +173,9 @@ task_editor_destroy (GtkObject *object) te = TASK_EDITOR (object); priv = te->priv; + gtk_object_unref (GTK_OBJECT (priv->task_page)); + gtk_object_unref (GTK_OBJECT (priv->task_details_page)); + if (GTK_OBJECT_CLASS (parent_class)->destroy) (* GTK_OBJECT_CLASS (parent_class)->destroy) (object); } diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 92113f2702..6a14469213 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -33,7 +33,6 @@ #include "widgets/menus/gal-view-menus.h" #include "dialogs/task-editor.h" #include "calendar-config.h" -#include "calendar-config.h" #include "component-factory.h" #include "e-tasks.h" -- cgit v1.2.3