From e876ec981d4042b89a5dc77ccc67e851efe5db30 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Fri, 18 Jun 2004 13:30:36 +0000 Subject: Fixes #60293 2004-06-18 Rodrigo Moya Fixes #60293 * gui/dialogs/recurrence-page.c (type_toggled_cb): make sure we enable/disable correctly the 'Add' button. svn path=/trunk/; revision=26417 --- calendar/gui/dialogs/recurrence-page.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index f08107c8e2..50bdb108b9 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -2066,15 +2066,29 @@ static void type_toggled_cb (GtkToggleButton *toggle, gpointer data) { RecurrencePage *rpage; + RecurrencePagePrivate *priv; + gboolean read_only; rpage = RECURRENCE_PAGE (data); + priv = rpage->priv; + field_changed (rpage); if (toggle->active) { sensitize_buttons (rpage); preview_recur (rpage); } + + /* enable/disable the 'Add' button */ + if (!e_cal_is_read_only (COMP_EDITOR_PAGE (rpage)->client, &read_only, NULL)) + read_only = TRUE; + + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->none)) || read_only) + gtk_widget_set_sensitive (priv->exception_add, FALSE); + else if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->simple)) || + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->custom))) + gtk_widget_set_sensitive (priv->exception_add, TRUE); } /* Callback used when the recurrence interval value spin button changes. */ -- cgit