diff options
author | JP Rosevear <jpr@ximian.com> | 2002-06-25 21:11:47 +0800 |
---|---|---|
committer | JP Rosevear <jpr@src.gnome.org> | 2002-06-25 21:11:47 +0800 |
commit | 5ab2df3c08cfc14b0388e5042fa4221f81ac54a5 (patch) | |
tree | 707fc122106a769a3350d216c81567e7b62d1f02 /calendar/gui/dialogs/meeting-page.c | |
parent | af877240e40f2eb12fc49fcc4639a4bd5d78a112 (diff) | |
download | gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.gz gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.bz2 gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.lz gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.xz gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.zst gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.zip |
add back proto
2002-06-25 JP Rosevear <jpr@ximian.com>
* gui/dialogs/comp-editor-page.h: add back proto
* gui/dialogs/comp-editor-page.c
(comp_editor_page_notify_needs_send): add page needs_send signal
* gui/e-meeting-time-sel.c
(e_meeting_time_selector_on_invite_others_button_draw): check to
see if the button should be sensitive when drawing
(e_meeting_time_selector_construct): listen for the button draw
signal
* cal-util/cal-component.c (cal_component_strip_errors): remove
X-LIC-ERROR x properties
* cal-util/cal-component.h: new proto
* gui/dialogs/meeting-page.c (change_clicked_cb): set needs_send
to true
(meeting_page_fill_widgets): set up gui based on if the user or
someone else is the organizer
(meeting_page_construct): read the addresses here for the combo
box
(get_widgets): explicitly set the value in list values
* gui/dialogs/event-editor.c (set_menu_sens): base this on the
exist org and user org values of the comp editor
(event_editor_edit_comp): set up editable row restrictions on the
meeting model if the user is not an organizer, and don't set needs
send if we aren't the organizer initially
(model_row_changed_cb): set needs_send to true
(row_count_changed_cb): ditto
* gui/dialogs/meeting-page.glade: update gui
* gui/dialogs/comp-editor.c (save_comp_with_send): if the user is
not the organizer, REPLY rather than REQUEST
(comp_editor_set_existing_org): accessor
(comp_editor_get_existing_org): ditto
(comp_editor_set_user_org): ditto
(comp_editor_get_user_org): ditto
(real_edit_comp): determine if there is an existing organizer and
if the organizers is a user
(page_changed_cb): warn the user that changes may be discarded
(page_summary_changed_cb): ditto
(page_dates_changed_cb): ditto
* gui/dialogs/comp-editor.h: new protos
* gui/itip-utils.c (itip_organizer_is_user): determine if the
organizer of a component is a user
(itip_sentby_is_user): same for sentby field of organizer
(comp_sentby): use above routines instead
(comp_compliant): strip all X-LIC-ERROR fields generated by
libical
* gui/e-meeting-model.c (is_cell_editable): if there is a list of
editable rows, allow only the status column of those rows to be
edited
(init): init edit_rows
(e_meeting_model_restricted_add): add an editable row to the model
(e_meeting_model_restricted_remove): remove an editable row
(e_meeting_model_restricted_clear): clear all editable rows
(e_meeting_model_etable_click_to_add): set the click to add arg on
all tables
(e_meeting_model_etable_from_model): track the tables
(table_destroy_list_cb): remove the table being destroyed from the
list
(table_destroy_state_cb): remove the table being destroyed from
the list
* gui/e-meeting-model.h: new protos
* gui/e-itip-control.c (update_attendee_status): kill warning
svn path=/trunk/; revision=17274
Diffstat (limited to 'calendar/gui/dialogs/meeting-page.c')
-rw-r--r-- | calendar/gui/dialogs/meeting-page.c | 162 |
1 files changed, 71 insertions, 91 deletions
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c index 2504ed3993..554afd2ecd 100644 --- a/calendar/gui/dialogs/meeting-page.c +++ b/calendar/gui/dialogs/meeting-page.c @@ -26,6 +26,7 @@ #endif #include <glib.h> +#include <gtk/gtkcombo.h> #include <gtk/gtksignal.h> #include <gtk/gtktogglebutton.h> #include <gtk/gtkvbox.h> @@ -87,10 +88,6 @@ struct _MeetingPagePrivate { GtkWidget *main; GtkWidget *organizer_table; GtkWidget *organizer; - GtkWidget *organizer_lbl; - GtkWidget *other_organizer; - GtkWidget *other_organizer_lbl; - GtkWidget *other_organizer_btn; GtkWidget *existing_organizer_table; GtkWidget *existing_organizer; GtkWidget *existing_organizer_btn; @@ -102,8 +99,8 @@ struct _MeetingPagePrivate { gint row; /* For handling who the organizer is */ - gboolean other; gboolean existing; + gboolean updating; }; @@ -184,13 +181,16 @@ static void meeting_page_init (MeetingPage *mpage) { MeetingPagePrivate *priv; - + priv = g_new0 (MeetingPagePrivate, 1); mpage->priv = priv; - + priv->deleted_attendees = g_ptr_array_new (); priv->comp = NULL; + + priv->addresses = NULL; + priv->address_strings = NULL; priv->xml = NULL; priv->main = NULL; @@ -254,8 +254,6 @@ meeting_page_destroy (GtkObject *object) g_ptr_array_free (priv->deleted_attendees, FALSE); itip_addresses_free (priv->addresses); - g_list_foreach (priv->address_strings, (GFunc) g_free, NULL); - g_list_free (priv->address_strings); gtk_object_unref (GTK_OBJECT (priv->model)); @@ -308,17 +306,12 @@ clear_widgets (MeetingPage *mpage) priv = mpage->priv; gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry), ""); - gtk_entry_set_text (GTK_ENTRY (priv->other_organizer), ""); gtk_label_set_text (GTK_LABEL (priv->existing_organizer), _("None")); gtk_widget_show (priv->organizer_table); gtk_widget_hide (priv->existing_organizer_table); - gtk_widget_hide (priv->other_organizer_lbl); - gtk_widget_hide (priv->other_organizer); - priv->existing = FALSE; - priv->other = FALSE; } /* fill_widgets handler for the meeting page */ @@ -328,7 +321,6 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp) MeetingPage *mpage; MeetingPagePrivate *priv; CalComponentOrganizer organizer; - GList *l; mpage = MEETING_PAGE (page); priv = mpage->priv; @@ -348,45 +340,41 @@ meeting_page_fill_widgets (CompEditorPage *page, CalComponent *comp) /* Component for cancellation */ priv->comp = cal_component_clone (comp); - /* Organizer */ - cal_component_get_organizer (comp, &organizer); - priv->addresses = itip_addresses_get (); - for (l = priv->addresses; l != NULL; l = l->next) { - ItipAddress *a = l->data; - char *s; - - s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full); - priv->address_strings = g_list_append (priv->address_strings, s); - if (a->default_address) - priv->default_address = s; - } + /* List the user identities for default organizers */ gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings); - if (organizer.value != NULL) { - const gchar *strip = itip_strip_mailto (organizer.value); - gchar *s, *string; - - gtk_widget_hide (priv->organizer_table); - gtk_widget_show (priv->existing_organizer_table); - gtk_widget_hide (priv->invite); - - if (organizer.cn != NULL) - string = g_strdup_printf ("%s <%s>", organizer.cn, strip); - else - string = g_strdup (strip); - s = e_utf8_to_gtk_string (priv->existing_organizer, string); - gtk_label_set_text (GTK_LABEL (priv->existing_organizer), s); - g_free (s); - g_free (string); - - priv->existing = TRUE; + /* If there is an existing organizer show it properly */ + if (cal_component_has_organizer (comp)) { + cal_component_get_organizer (comp, &organizer); + if (organizer.value != NULL) { + const gchar *strip = itip_strip_mailto (organizer.value); + gchar *s, *string; + + gtk_widget_hide (priv->organizer_table); + gtk_widget_show (priv->existing_organizer_table); + if (itip_organizer_is_user (comp)) { + gtk_widget_show (priv->invite); + e_meeting_model_etable_click_to_add (priv->model, TRUE); + } else { + gtk_widget_hide (priv->invite); + e_meeting_model_etable_click_to_add (priv->model, FALSE); + } + + if (organizer.cn != NULL) + string = g_strdup_printf ("%s <%s>", organizer.cn, strip); + else + string = g_strdup (strip); + s = e_utf8_to_gtk_string (priv->existing_organizer, string); + gtk_label_set_text (GTK_LABEL (priv->existing_organizer), s); + g_free (s); + g_free (string); + + priv->existing = TRUE; + } } else { - gtk_widget_hide (priv->other_organizer_lbl); - gtk_widget_hide (priv->other_organizer); - e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address); } - + priv->updating = FALSE; } @@ -402,24 +390,24 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) priv = mpage->priv; if (!priv->existing) { - gchar *addr = NULL, *cn = NULL; + gchar *addr = NULL, *cn = NULL, *sentby = NULL, *str; GList *l; + + str = e_dialog_editable_get (GTK_COMBO (priv->organizer)->entry); - if (priv->other) { - addr = e_dialog_editable_get (priv->other_organizer); - } else { - gchar *str = e_dialog_editable_get (GTK_COMBO (priv->organizer)->entry); - for (l = priv->addresses; l != NULL; l = l->next) { - ItipAddress *a = l->data; + /* Find the identity for the organizer or sentby field */ + for (l = priv->addresses; l != NULL; l = l->next) { + ItipAddress *a = l->data; - if (!strcmp (a->full, str)) { + if (!strcmp (a->full, str)) { addr = g_strdup (a->address); cn = g_strdup (a->name); - } } - g_free (str); } + + g_free (str); + /* Sanity Check */ if (addr == NULL || strlen (addr) == 0) { e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, _("An organizer is required.")); @@ -436,9 +424,12 @@ meeting_page_fill_component (CompEditorPage *page, CalComponent *comp) organizer.value = addr; organizer.cn = cn; + organizer.sentby = sentby; cal_component_set_organizer (comp, &organizer); + g_free (addr); g_free (cn); + g_free (sentby); } if (e_meeting_model_count_actual_attendees (priv->model) < 1) { @@ -482,12 +473,12 @@ get_widgets (MeetingPage *mpage) gtk_widget_ref (priv->main); gtk_widget_unparent (priv->main); + /* For making the user the organizer */ priv->organizer_table = GW ("organizer-table"); priv->organizer = GW ("organizer"); - priv->organizer_lbl = GW ("organizer-label"); - priv->other_organizer = GW ("other-organizer"); - priv->other_organizer_lbl = GW ("other-organizer-label"); - priv->other_organizer_btn = GW ("other-organizer-button"); + gtk_combo_set_value_in_list (GTK_COMBO (priv->organizer), TRUE, FALSE); + + /* For showing existing organizers */ priv->existing_organizer_table = GW ("existing-organizer-table"); priv->existing_organizer = GW ("existing-organizer"); priv->existing_organizer_btn = GW ("existing-organizer-button"); @@ -498,10 +489,6 @@ get_widgets (MeetingPage *mpage) return (priv->invite && priv->organizer_table && priv->organizer - && priv->organizer_lbl - && priv->other_organizer - && priv->other_organizer_lbl - && priv->other_organizer_btn && priv->existing_organizer_table && priv->existing_organizer && priv->existing_organizer_btn); @@ -517,29 +504,10 @@ field_changed_cb (GtkWidget *widget, gpointer data) mpage = MEETING_PAGE (data); priv = mpage->priv; - if (!priv->updating) + if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage)); } -/* Function called to make the organizer other than the user */ -static void -other_clicked_cb (GtkWidget *widget, gpointer data) -{ - MeetingPage *mpage; - MeetingPagePrivate *priv; - - mpage = MEETING_PAGE (data); - priv = mpage->priv; - - gtk_widget_hide (priv->organizer_lbl); - gtk_widget_hide (priv->organizer); - gtk_widget_hide (priv->other_organizer_btn); - gtk_widget_show (priv->other_organizer_lbl); - gtk_widget_show (priv->other_organizer); - - priv->other = TRUE; -} - /* Function called to change the organizer */ static void change_clicked_cb (GtkWidget *widget, gpointer data) @@ -553,10 +521,11 @@ change_clicked_cb (GtkWidget *widget, gpointer data) gtk_widget_show (priv->organizer_table); gtk_widget_hide (priv->existing_organizer_table); gtk_widget_show (priv->invite); + e_meeting_model_etable_click_to_add (priv->model, TRUE); - gtk_combo_set_popdown_strings (GTK_COMBO (priv->organizer), priv->address_strings); e_dialog_editable_set (GTK_COMBO (priv->organizer)->entry, priv->default_address); - + comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (mpage)); + priv->existing = FALSE; } @@ -585,8 +554,6 @@ init_widgets (MeetingPage *mpage) gtk_signal_connect (GTK_OBJECT (GTK_COMBO (priv->organizer)->entry), "changed", GTK_SIGNAL_FUNC (field_changed_cb), mpage); - gtk_signal_connect (GTK_OBJECT (priv->other_organizer_btn), "clicked", - GTK_SIGNAL_FUNC (other_clicked_cb), mpage); gtk_signal_connect (GTK_OBJECT (priv->existing_organizer_btn), "clicked", GTK_SIGNAL_FUNC (change_clicked_cb), mpage); @@ -770,6 +737,7 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm) MeetingPagePrivate *priv; ETable *real_table; gchar *filename; + GList *l; priv = mpage->priv; @@ -786,6 +754,18 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm) "Could not find all widgets in the XML file!"); return NULL; } + + /* Address information */ + priv->addresses = itip_addresses_get (); + for (l = priv->addresses; l != NULL; l = l->next) { + ItipAddress *a = l->data; + char *s; + + s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full); + priv->address_strings = g_list_append (priv->address_strings, s); + if (a->default_address) + priv->default_address = s; + } /* The etable displaying attendees and their status */ gtk_object_ref (GTK_OBJECT (emm)); |