From c532d3d9841887b32917855adaf679403a966c28 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Tue, 8 Jun 2004 17:07:18 +0000 Subject: Fixes #57579 2004-06-08 Rodrigo Moya Fixes #57579 * gui/dialogs/select-source-dialog.c (select_source_dialog): start with the OK button disabled. (primary_selection_changed_cb): enable/disable the OK button depending on the selection on the ESourceSelector. svn path=/trunk/; revision=26256 --- calendar/ChangeLog | 9 +++++++++ calendar/gui/dialogs/select-source-dialog.c | 12 ++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index f47f7933f4..8fe583f903 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,12 @@ +2004-06-08 Rodrigo Moya + + Fixes #57579 + + * gui/dialogs/select-source-dialog.c (select_source_dialog): start + with the OK button disabled. + (primary_selection_changed_cb): enable/disable the OK button depending + on the selection on the ESourceSelector. + 2004-06-08 Rodrigo Moya * gui/dialogs/comp-editor.[ch] (comp_editor_notify_client_changed): diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index 0b8f93e7e4..35e45b3c5e 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -37,7 +37,15 @@ primary_selection_changed_cb (ESourceSelector *selector, gpointer user_data) if (*our_selection) g_object_unref (*our_selection); - *our_selection = g_object_ref (e_source_selector_peek_primary_selection (selector)); + *our_selection = e_source_selector_peek_primary_selection (selector); + if (*our_selection) { + g_object_ref (*our_selection); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (gtk_widget_get_toplevel (selector)), GTK_RESPONSE_OK, TRUE); + } else { + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (gtk_widget_get_toplevel (selector)), GTK_RESPONSE_OK, FALSE); + } } /** @@ -80,7 +88,7 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - /* gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); */ + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); -- cgit