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/comp-editor.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/comp-editor.c')
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 109 |
1 files changed, 101 insertions, 8 deletions
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 3e245a0c98..1179453aff 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -35,9 +35,11 @@ #include <libgnomeui/gnome-dialog-util.h> #include <libgnomeui/gnome-stock.h> #include <libgnomeui/gnome-window-icon.h> +#include <libgnomeui/gnome-messagebox.h> #include <bonobo/bonobo-ui-container.h> #include <bonobo/bonobo-ui-util.h> #include <gal/widgets/e-unicode.h> +#include <gal/widgets/e-gui-utils.h> #include <e-util/e-dialog-utils.h> #include <evolution-shell-component-utils.h> #include "../print.h" @@ -70,7 +72,12 @@ struct _CompEditorPrivate { gboolean changed; gboolean needs_send; - gboolean needs_send_new; + + gboolean existing_org; + gboolean user_org; + + gboolean warned; + gboolean updating; }; @@ -240,7 +247,9 @@ comp_editor_init (CompEditor *editor) priv->pages = NULL; priv->changed = FALSE; priv->needs_send = FALSE; - priv->needs_send_new = FALSE; + priv->existing_org = FALSE; + priv->user_org = FALSE; + priv->warned = FALSE; } @@ -311,7 +320,13 @@ save_comp (CompEditor *editor) return FALSE; } } - cal_component_commit_sequence (clone); + + /* If we are not the organizer, we don't update the sequence number */ + if (!cal_component_has_organizer (clone) || itip_organizer_is_user (clone)) + cal_component_commit_sequence (clone); + else + cal_component_abort_sequence (clone); + gtk_object_unref (GTK_OBJECT (priv->comp)); priv->comp = clone; @@ -364,8 +379,12 @@ save_comp_with_send (CompEditor *editor) if (!save_comp (editor)) return FALSE; - if (send && send_component_dialog (priv->comp, priv->needs_send_new)) - comp_editor_send_comp (editor, CAL_COMPONENT_METHOD_REQUEST); + if (send && send_component_dialog (priv->comp, priv->existing_org)) { + if (itip_organizer_is_user (priv->comp)) + comp_editor_send_comp (editor, CAL_COMPONENT_METHOD_REQUEST); + else + comp_editor_send_comp (editor, CAL_COMPONENT_METHOD_REPLY); + } return TRUE; } @@ -437,6 +456,59 @@ close_dialog (CompEditor *editor) +void +comp_editor_set_existing_org (CompEditor *editor, gboolean existing_org) +{ + CompEditorPrivate *priv; + + g_return_if_fail (editor != NULL); + g_return_if_fail (IS_COMP_EDITOR (editor)); + + priv = editor->priv; + + priv->existing_org = existing_org; +} + +gboolean +comp_editor_get_existing_org (CompEditor *editor) +{ + CompEditorPrivate *priv; + + g_return_val_if_fail (editor != NULL, FALSE); + g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); + + priv = editor->priv; + + return priv->existing_org; +} + +void +comp_editor_set_user_org (CompEditor *editor, gboolean user_org) +{ + CompEditorPrivate *priv; + + g_return_if_fail (editor != NULL); + g_return_if_fail (IS_COMP_EDITOR (editor)); + + priv = editor->priv; + + priv->user_org = user_org; +} + +gboolean +comp_editor_get_user_org (CompEditor *editor) +{ + CompEditorPrivate *priv; + + g_return_val_if_fail (editor != NULL, FALSE); + g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); + + priv = editor->priv; + + return priv->user_org; +} + + /** * comp_editor_set_changed: * @editor: A component editor @@ -853,7 +925,7 @@ static void real_edit_comp (CompEditor *editor, CalComponent *comp) { CompEditorPrivate *priv; - + g_return_if_fail (editor != NULL); g_return_if_fail (IS_COMP_EDITOR (editor)); @@ -867,8 +939,10 @@ real_edit_comp (CompEditor *editor, CalComponent *comp) if (comp) priv->comp = cal_component_clone (comp); - priv->needs_send_new = !priv->needs_send; - + priv->existing_org = cal_component_has_organizer (comp); + priv->user_org = itip_organizer_is_user (comp); + priv->warned = FALSE; + set_title_from_comp (editor); set_icon_from_comp (editor); fill_widgets (editor); @@ -1219,6 +1293,13 @@ page_changed_cb (GtkObject *obj, gpointer data) priv = editor->priv; priv->changed = TRUE; + + if (!priv->warned && priv->existing_org && !priv->user_org) { + e_notice (NULL, GNOME_MESSAGE_BOX_INFO, + _("Changes made to this item may be discarded if an update arrives via email")); + priv->warned = TRUE; + } + } /* Page signal callbacks */ @@ -1236,6 +1317,12 @@ page_summary_changed_cb (GtkObject *obj, const char *summary, gpointer data) comp_editor_page_set_summary (l->data, summary); priv->changed = TRUE; + + if (!priv->warned && priv->existing_org && !priv->user_org) { + e_notice (NULL, GNOME_MESSAGE_BOX_INFO, + _("Changes made to this item may be discarded if an update arrives via email")); + priv->warned = TRUE; + } } static void @@ -1254,6 +1341,12 @@ page_dates_changed_cb (GtkObject *obj, comp_editor_page_set_dates (l->data, dates); priv->changed = TRUE; + + if (!priv->warned && priv->existing_org && !priv->user_org) { + e_notice (NULL, GNOME_MESSAGE_BOX_INFO, + _("Changes made to this item may be discarded if an update arrives via email")); + priv->warned = TRUE; + } } static void |