From 6d72b349d45e18f1ab48f6d01a1aca8b9d481c05 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 8 Jun 2004 14:41:35 +0000 Subject: connect to "client_changed" signal on the page. (client_changed_cb): new 2004-06-08 Rodrigo Moya * gui/dialogs/recurrence-page.c (recurrence_page_construct): connect to "client_changed" signal on the page. (client_changed_cb): new callback. * gui/dialogs/alarm-page.c (sensitize_buttons): fixed missing stuff in last commit. svn path=/trunk/; revision=26252 --- calendar/gui/dialogs/alarm-page.c | 2 +- calendar/gui/dialogs/recurrence-page.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'calendar/gui') diff --git a/calendar/gui/dialogs/alarm-page.c b/calendar/gui/dialogs/alarm-page.c index 7b77cd7d74..d7faebf14c 100644 --- a/calendar/gui/dialogs/alarm-page.c +++ b/calendar/gui/dialogs/alarm-page.c @@ -335,7 +335,7 @@ sensitize_buttons (AlarmPage *apage) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list)); have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter); - if (e_cal_is_read_only (client, &read_only, NULL) && read_only) + if (e_cal_is_read_only (COMP_EDITOR_PAGE (apage)->client, &read_only, NULL) && read_only) sensitivity = FALSE; else sensitivity = TRUE; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 0868ed5cca..cec2685a7c 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -508,9 +508,13 @@ sensitize_recur_widgets (RecurrencePage *rpage) RecurrencePagePrivate *priv; enum recur_type type; GtkWidget *label; + gboolean read_only; priv = rpage->priv; + if (!e_cal_is_read_only (COMP_EDITOR_PAGE (rpage)->client, &read_only, NULL)) + read_only = TRUE; + type = e_dialog_radio_get (priv->none, type_map); /* We can't preview that well for instances right now */ @@ -2345,6 +2349,14 @@ init_widgets (RecurrencePage *rpage) +static void +client_changed_cb (CompEditorPage *page, ECal *client, gpointer user_data) +{ + RecurrencePage *rpage = RECURRENCE_PAGE (page); + + sensitize_recur_widgets (rpage); +} + /** * recurrence_page_construct: * @rpage: A recurrence page. @@ -2377,6 +2389,9 @@ recurrence_page_construct (RecurrencePage *rpage) init_widgets (rpage); + g_signal_connect (G_OBJECT (rpage), "client_changed", + G_CALLBACK (client_changed_cb), NULL); + return rpage; } -- cgit v1.2.3