[evolution-patches] hide property options



This patch hides most of the property options that don't apply based on
the source type as per JP's request.

--Larry


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2455
diff -u -p -r1.2455 ChangeLog
--- ChangeLog	22 Jul 2004 18:11:24 -0000	1.2455
+++ ChangeLog	28 Jul 2004 15:38:50 -0000
@@ -1,3 +1,10 @@
+2004-07-28  Larry Ewing  <lewing ximian com>
+
+	* 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-16  Larry Ewing  <lewing ximian com>
 
 	* gui/e-meeting-time-sel.c (e_meeting_time_selector_style_set):
Index: gui/dialogs/calendar-setup.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/calendar-setup.c,v
retrieving revision 1.27
diff -u -p -r1.27 calendar-setup.c
--- gui/dialogs/calendar-setup.c	2 Jun 2004 03:53:44 -0000	1.27
+++ gui/dialogs/calendar-setup.c	28 Jul 2004 15:38:50 -0000
@@ -371,7 +371,7 @@ general_update_dialog (SourceDialog *sou
 	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 */
@@ -595,6 +595,23 @@ dialog_to_source (SourceDialog *source_d
 }
 
 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)
 {
 	source_dialog->source_group =
@@ -731,7 +748,8 @@ calendar_setup_edit_calendar (GtkWindow 
 		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;
 }
 
@@ -859,7 +877,8 @@ calendar_setup_edit_task_list (GtkWindow
 		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;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]