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/e-meeting-model.c | |
parent | af877240e40f2eb12fc49fcc4639a4bd5d78a112 (diff) | |
download | gsoc2013-evolution-5ab2df3c08cfc14b0388e5042fa4221f81ac54a5.tar.gz 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/e-meeting-model.c')
-rw-r--r-- | calendar/gui/e-meeting-model.c | 119 |
1 files changed, 114 insertions, 5 deletions
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c index 6adfb9c1c9..7f1479f452 100644 --- a/calendar/gui/e-meeting-model.c +++ b/calendar/gui/e-meeting-model.c @@ -59,7 +59,10 @@ struct _EMeetingModelPrivate { GPtrArray *attendees; + GList *edit_rows; + ETableWithout *without; + GList *tables; CalClient *client; icaltimezone *zone; @@ -127,7 +130,8 @@ static void select_names_ok_cb (BonoboListener *listener, CORBA_Environment *ev, gpointer data); -static void table_destroy_cb (ETableScrolled *etable, gpointer data); +static void table_destroy_state_cb (ETableScrolled *etable, gpointer data); +static void table_destroy_list_cb (ETableScrolled *etable, gpointer data); static ETableModelClass *parent_class = NULL; @@ -498,6 +502,25 @@ set_value_at (ETableModel *etm, int col, int row, const void *val) static gboolean is_cell_editable (ETableModel *etm, int col, int row) { + EMeetingModel *im; + EMeetingModelPrivate *priv; + GList *l; + + im = E_MEETING_MODEL (etm); + priv = im->priv; + + if (priv->edit_rows != NULL) { + if (col != E_MEETING_MODEL_STATUS_COL) + return FALSE; + + for (l = priv->edit_rows; l != NULL; l = l->next) { + if (GPOINTER_TO_INT (l->data) == row) + return TRUE; + } + + return FALSE; + } + switch (col) { case E_MEETING_MODEL_DELTO_COL: case E_MEETING_MODEL_DELFROM_COL: @@ -648,6 +671,7 @@ init (EMeetingModel *im) im->priv = priv; priv->attendees = g_ptr_array_new (); + priv->edit_rows = NULL; priv->without = E_TABLE_WITHOUT (e_table_without_new (E_TABLE_MODEL (im), g_str_hash, @@ -658,7 +682,8 @@ init (EMeetingModel *im) free_duplicated_key, NULL)); e_table_without_hide (priv->without, g_strdup ("delegator")); - + priv->tables = NULL; + priv->client = NULL; priv->zone = icaltimezone_get_builtin_timezone (calendar_config_get_timezone ()); @@ -686,6 +711,8 @@ destroy (GtkObject *obj) gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->attendees, i))); g_ptr_array_free (priv->attendees, TRUE); + g_list_free (priv->tables); + if (priv->client != NULL) gtk_object_unref (GTK_OBJECT (priv->client)); @@ -851,7 +878,7 @@ build_etable (ETableModel *model, const gchar *spec_file, const gchar *state_fil #endif gtk_signal_connect (GTK_OBJECT (etable), "destroy", - GTK_SIGNAL_FUNC (table_destroy_cb), g_strdup (state_file)); + GTK_SIGNAL_FUNC (table_destroy_state_cb), g_strdup (state_file)); gtk_object_unref (GTK_OBJECT (extras)); @@ -1022,6 +1049,47 @@ e_meeting_model_get_attendees (EMeetingModel *im) return priv->attendees; } +void +e_meeting_model_restricted_add (EMeetingModel *im, int row) +{ + EMeetingModelPrivate *priv; + + g_return_if_fail (im != NULL); + g_return_if_fail (E_IS_MEETING_MODEL (im)); + + priv = im->priv; + + priv->edit_rows = g_list_append (priv->edit_rows, GINT_TO_POINTER (row)); +} + +void +e_meeting_model_restricted_remove (EMeetingModel *im, int row) +{ + EMeetingModelPrivate *priv; + + g_return_if_fail (im != NULL); + g_return_if_fail (E_IS_MEETING_MODEL (im)); + + priv = im->priv; + + priv->edit_rows = g_list_remove (priv->edit_rows, GINT_TO_POINTER (row)); +} + +void +e_meeting_model_restricted_clear (EMeetingModel *im) +{ + EMeetingModelPrivate *priv; + + g_return_if_fail (im != NULL); + g_return_if_fail (E_IS_MEETING_MODEL (im)); + + priv = im->priv; + + if (priv->edit_rows) + g_list_free (priv->edit_rows); + priv->edit_rows = NULL; +} + static icaltimezone * find_zone (icalproperty *ip, icalcomponent *tz_top_level) { @@ -1518,13 +1586,43 @@ ETableScrolled * e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, const gchar *state_file) { EMeetingModelPrivate *priv; + ETableScrolled *ets; g_return_val_if_fail (im != NULL, NULL); g_return_val_if_fail (E_IS_MEETING_MODEL (im), NULL); priv = im->priv; - return build_etable (E_TABLE_MODEL (priv->without), spec_file, state_file); + ets = build_etable (E_TABLE_MODEL (priv->without), spec_file, state_file); + + priv->tables = g_list_prepend (priv->tables, ets); + + gtk_signal_connect (GTK_OBJECT (ets), "destroy", + GTK_SIGNAL_FUNC (table_destroy_list_cb), im); + + return ets; +} + +void +e_meeting_model_etable_click_to_add (EMeetingModel *im, gboolean click_to_add) +{ + EMeetingModelPrivate *priv; + GList *l; + + g_return_if_fail (im != NULL); + g_return_if_fail (E_IS_MEETING_MODEL (im)); + + priv = im->priv; + + for (l = priv->tables; l != NULL; l = l->next) { + ETableScrolled *ets; + ETable *real_table; + + ets = l->data; + real_table = e_table_scrolled_get_table (ets); + + gtk_object_set (GTK_OBJECT (real_table), "use_click_to_add", click_to_add, NULL); + } } int @@ -1735,7 +1833,7 @@ attendee_changed_cb (EMeetingAttendee *ia, gpointer data) } static void -table_destroy_cb (ETableScrolled *etable, gpointer data) +table_destroy_state_cb (ETableScrolled *etable, gpointer data) { ETable *real_table; char *filename = data; @@ -1746,3 +1844,14 @@ table_destroy_cb (ETableScrolled *etable, gpointer data) g_free (data); } +static void +table_destroy_list_cb (ETableScrolled *etable, gpointer data) +{ + EMeetingModel *im = E_MEETING_MODEL (data); + EMeetingModelPrivate *priv; + + priv = im->priv; + + priv->tables = g_list_remove (priv->tables, etable); +} + |