aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/comp-editor.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-09-19 12:33:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-09-19 12:33:33 +0800
commitd639a620a6438ea93787cedfe9f3eb87014275a3 (patch)
tree602d9156e8e33197fc27752d8fb976cce99d896c /calendar/gui/dialogs/comp-editor.c
parentd284de85386149adba1e94f1b05b6b2d631e8585 (diff)
downloadgsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.gz
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.bz2
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.lz
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.xz
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.tar.zst
gsoc2013-evolution-d639a620a6438ea93787cedfe9f3eb87014275a3.zip
A page that shows the meeting time selector and free/busy data for
2001-09-18 JP Rosevear <jpr@ximian.com> * gui/dialogs/schedule-page.*: A page that shows the meeting time selector and free/busy data for attendees * gui/dialogs/meeting-page.c: use the meeting model to track/edit attendees, remove table value conversion routines and simple table routines (set_attendees): take a pointer array (meeting_page_destroy): destroy the pointer array, save state (meeting_page_init): new pointer array (meeting_page_fill_widgets): don't null the deleted attendees field (popup_delegate_cb): array add (popup_delete_cb): array add (cleanup_attendees): iterate over the array to unref now (meeting_page_fill_widgets): don't null out fields, no need to add attendees here (invite_entry_changed): use e_meeting_attendee routines (popup_delegate_cb): ditto (popup_delete_cb): ditto (meeting_page_new): take new arg and pass it to construct (meeting_page_construct): take new arg, use e-meeting-model routines to construct table * gui/dialogs/task-editor.c (task_editor_init): new meeting model (task_editor_destroy): unref the model * gui/dialogs/event-editor.c (event_editor_init): make new model and pass it to meeting and schedule pages (event_editor_set_cal_client): virtual function, set meeting model client (event_editor_edit_comp): add the attendees to the model (event_editor_destroy): unref model * gui/dialogs/comp-editor.h: add virtual function * gui/dialogs/comp-editor.c (comp_editor_set_cal_client): make set_cal_client a virutal function * gui/e-meeting-types.h: generally useful type defines * gui/e-meeting-time-sel*.[hc]: Move here and use an e-table for the attendee list and extract display information from the new meeting model and attendees * gui/e-meeting-time-sel.etspec: spec for the table * gui/e-meeting-attendee.[hc]: meeting attendees for the model, with to/from conversions for CalComponentAttendee structure, emits changed signal and allows getting and setting of free busy periods * gui/e-meeting-model.[hc]: move the model out on its own * gui/e-itip-control.c (write_error_html): clean up warnings svn path=/trunk/; revision=12968
Diffstat (limited to 'calendar/gui/dialogs/comp-editor.c')
-rw-r--r--calendar/gui/dialogs/comp-editor.c89
1 files changed, 51 insertions, 38 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 433a9879aa..de4e528334 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -76,6 +76,7 @@ static void comp_editor_class_init (CompEditorClass *class);
static void comp_editor_init (CompEditor *editor);
static void comp_editor_destroy (GtkObject *object);
+static void real_set_cal_client (CompEditor *editor, CalClient *client);
static void real_edit_comp (CompEditor *editor, CalComponent *comp);
static void real_send_comp (CompEditor *editor, CalComponentItipMethod method);
static void save_comp (CompEditor *editor);
@@ -174,6 +175,7 @@ comp_editor_class_init (CompEditorClass *klass)
parent_class = gtk_type_class (GTK_TYPE_OBJECT);
+ klass->set_cal_client = real_set_cal_client;
klass->edit_comp = real_edit_comp;
klass->send_comp = real_send_comp;
@@ -242,7 +244,6 @@ comp_editor_destroy (GtkObject *object)
{
CompEditor *editor;
CompEditorPrivate *priv;
- GList *l;
editor = COMP_EDITOR (object);
priv = editor->priv;
@@ -252,12 +253,6 @@ comp_editor_destroy (GtkObject *object)
priv->window = NULL;
}
- /* We want to destroy the pages after the widgets get destroyed,
- since they have lots of signal handlers connected to the widgets
- with the pages as the data. */
- for (l = priv->pages; l != NULL; l = l->next)
- gtk_object_unref (GTK_OBJECT (l->data));
-
gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), editor);
g_free (priv);
@@ -398,41 +393,15 @@ comp_editor_show_page (CompEditor *editor, CompEditorPage *page)
void
comp_editor_set_cal_client (CompEditor *editor, CalClient *client)
{
- CompEditorPrivate *priv;
- GList *elem;
-
+ CompEditorClass *klass;
+
g_return_if_fail (editor != NULL);
g_return_if_fail (IS_COMP_EDITOR (editor));
- priv = editor->priv;
-
- if (client == priv->client)
- return;
-
- if (client) {
- g_return_if_fail (IS_CAL_CLIENT (client));
- g_return_if_fail (cal_client_get_load_state (client) ==
- CAL_CLIENT_LOAD_LOADED);
- gtk_object_ref (GTK_OBJECT (client));
- }
+ klass = COMP_EDITOR_CLASS (GTK_OBJECT (editor)->klass);
- if (priv->client) {
- gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
- editor);
- gtk_object_unref (GTK_OBJECT (priv->client));
- }
-
- priv->client = client;
-
- /* Pass the client to any pages that need it. */
- for (elem = priv->pages; elem; elem = elem->next)
- comp_editor_page_set_cal_client (elem->data, client);
-
- gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated",
- GTK_SIGNAL_FUNC (obj_updated_cb), editor);
-
- gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed",
- GTK_SIGNAL_FUNC (obj_removed_cb), editor);
+ if (klass->set_cal_client)
+ klass->set_cal_client (editor, client);
}
/**
@@ -519,6 +488,46 @@ fill_widgets (CompEditor *editor)
for (l = priv->pages; l != NULL; l = l->next)
comp_editor_page_fill_widgets (l->data, priv->comp);
+}
+
+static void
+real_set_cal_client (CompEditor *editor, CalClient *client)
+{
+ CompEditorPrivate *priv;
+ GList *elem;
+
+ g_return_if_fail (editor != NULL);
+ g_return_if_fail (IS_COMP_EDITOR (editor));
+
+ priv = editor->priv;
+
+ if (client == priv->client)
+ return;
+
+ if (client) {
+ g_return_if_fail (IS_CAL_CLIENT (client));
+ g_return_if_fail (cal_client_get_load_state (client) ==
+ CAL_CLIENT_LOAD_LOADED);
+ gtk_object_ref (GTK_OBJECT (client));
+ }
+
+ if (priv->client) {
+ gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client),
+ editor);
+ gtk_object_unref (GTK_OBJECT (priv->client));
+ }
+
+ priv->client = client;
+
+ /* Pass the client to any pages that need it. */
+ for (elem = priv->pages; elem; elem = elem->next)
+ comp_editor_page_set_cal_client (elem->data, client);
+
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_updated",
+ GTK_SIGNAL_FUNC (obj_updated_cb), editor);
+
+ gtk_signal_connect (GTK_OBJECT (priv->client), "obj_removed",
+ GTK_SIGNAL_FUNC (obj_removed_cb), editor);
}
static void
@@ -814,11 +823,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));
}