From c228009c175669bc3a017ca7a7c7cc53c40841ab Mon Sep 17 00:00:00 2001 From: Larry Ewing Date: Fri, 30 Jul 2004 07:37:02 +0000 Subject: hide dialog items that don't apply when editing properties. 004-07-28 Larry Ewing * gui/dialogs/calendar-setup.c (dialog_hide_unused_options): hide dialog items that don't apply when editing properties. (general_update_dialog): check to make sure we have a source before checking its state. svn path=/trunk/; revision=26773 --- calendar/ChangeLog | 7 +++++++ calendar/gui/dialogs/calendar-setup.c | 25 ++++++++++++++++++++++--- 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/calendar/ChangeLog b/calendar/ChangeLog index e5e85fd19d..a75db139a2 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,10 @@ +2004-07-28 Larry Ewing + + * gui/dialogs/calendar-setup.c (dialog_hide_unused_options): hide + dialog items that don't apply when editing properties. + (general_update_dialog): check to make sure we have a source + before checking its state. + 2004-07-27 JP Rosevear Fixes #62006 diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index 213d0ac20f..01b63b9c1d 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -371,7 +371,7 @@ general_update_dialog (SourceDialog *source_dialog) gboolean remote = FALSE; gboolean mutable = source_group_is_mutable (source_dialog->source_group); - if (e_source_get_readonly (source_dialog->source)) + if (source_dialog->source && e_source_get_readonly (source_dialog->source)) gtk_widget_set_sensitive (glade_xml_get_widget (source_dialog->gui_xml, "settings-table"), FALSE); /* These are calendar specific so make sure we have them */ @@ -594,6 +594,23 @@ dialog_to_source (SourceDialog *source_dialog) colorpicker_get_color (GNOME_COLOR_PICKER (source_dialog->source_color))); } +static void +dialog_hide_unused_options (SourceDialog *source_dialog) +{ + ESource *source = source_dialog->source; + + if (source && (!source_is_remote (source) || !source_group_is_mutable (source_dialog->source_group))) { + if (source_dialog->uri_hbox) + gtk_widget_hide (source_dialog->uri_hbox); + if (source_dialog->uri_label) + gtk_widget_hide (source_dialog->uri_label); + if (source_dialog->refresh_label) + gtk_widget_hide (source_dialog->refresh_label); + if (source_dialog->refresh_hbox) + gtk_widget_hide (source_dialog->refresh_hbox); + } +} + static void source_group_changed_sensitive (SourceDialog *source_dialog) { @@ -733,7 +750,8 @@ calendar_setup_edit_calendar (GtkWindow *parent, ESource *source) g_list_free (icon_list); } - gtk_widget_show_all (source_dialog->window); + dialog_hide_unused_options (source_dialog); + gtk_widget_show (source_dialog->window); return TRUE; } @@ -862,7 +880,8 @@ calendar_setup_edit_task_list (GtkWindow *parent, ESource *source) g_list_free (icon_list); } - gtk_widget_show_all (source_dialog->window); + dialog_hide_unused_options (source_dialog); + gtk_widget_show (source_dialog->window); return TRUE; } -- cgit v1.2.3