Re: [evolution-patches] patch for #67403 (calendar) for 2.0.x



On Mon, 2004-12-06 at 19:27 -0800, Harish Krishnaswamy wrote:
> On Wed, 2004-12-01 at 13:21 +0100, Rodrigo Moya wrote:
> 
> >  gboolean have_selected, read_only;
> > +
> > +       if (!e_cal_is_read_only (dialog->ecal, &read_only, NULL))
> > +               read_only = TRUE;
> 
> 
> In the above line, we need to explicitly check for the error returned by
> e_cal_is_read_only. - This is because a BUSY error , common with
> groupwise and exchange back-ends, would cause the client to set the
> calendar as read_only.
> 
> the rest looks fine.
> 
ok, updated patch with your comments
-- 
Rodrigo Moya <rodrigo novell com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2573
diff -u -p -r1.2573 ChangeLog
--- ChangeLog	3 Dec 2004 03:40:46 -0000	1.2573
+++ ChangeLog	6 Dec 2004 15:17:39 -0000
@@ -1,3 +1,14 @@
+2004-12-06  Rodrigo Moya <rodrigo novell com>
+
+	Fixes #67403
+
+	* gui/dialogs/event-page.c (sensitize_widgets): don't unsensitize
+	the 'Customize' button, to allow users to look at the alarm list
+	for read only events.
+
+	* gui/dialogs/alarm-list-dialog.c (sensitize_buttons): unsensitize
+	buttons if the event is read only.
+
 2004-12-02  Chenthill Palanisamy  <pchenthill novell com>
 
 	* gui/dialogs/task-editor.[ch] (task_editor_new), (task_editor_construct),
@@ -35,6 +46,7 @@
 	week_view->last_edited_comp_string for the same reason above.
 	
 2004-11-29  Chenthill Palanisamy  <pchenthill novell com>
+
 	* calendar-errors.xml.h: committng this file. Missed to
 	commit this one.
 
Index: gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.75
diff -u -p -r1.75 event-page.c
--- gui/dialogs/event-page.c	13 Oct 2004 18:37:05 -0000	1.75
+++ gui/dialogs/event-page.c	6 Dec 2004 15:17:39 -0000
@@ -611,7 +611,7 @@ sensitize_widgets (EventPage *epage)
 	gtk_widget_set_sensitive (priv->show_time_as_busy, !read_only);
 	gtk_widget_set_sensitive (priv->alarm, !read_only);
 	gtk_widget_set_sensitive (priv->alarm_time, !read_only && !custom && alarm);
-	gtk_widget_set_sensitive (priv->alarm_custom, !read_only && alarm);
+	gtk_widget_set_sensitive (priv->alarm_custom, alarm);
 	if (custom)
 		gtk_widget_show (priv->alarm_warning);
 	else
Index: gui/dialogs/alarm-list-dialog.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/alarm-list-dialog.c,v
retrieving revision 1.3
diff -u -p -r1.3 alarm-list-dialog.c
--- gui/dialogs/alarm-list-dialog.c	24 Jun 2004 21:35:43 -0000	1.3
+++ gui/dialogs/alarm-list-dialog.c	6 Dec 2004 15:17:39 -0000
@@ -93,16 +93,23 @@ sensitize_buttons (Dialog *dialog)
 {
 	GtkTreeSelection *selection;
 	GtkTreeIter iter;
-	gboolean have_selected;
+	gboolean have_selected, read_only = FALSE;
+	GError *error = NULL;
+
+	if (!e_cal_is_read_only (dialog->ecal, &read_only, &error)) {
+		if (error->code != E_CALENDAR_STATUS_BUSY)
+			read_only = TRUE;
+		g_error_free (error);
+	}
 
 	selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list));
 	have_selected = gtk_tree_selection_get_selected (selection, NULL, &iter);
 
-	if (e_cal_get_one_alarm_only (dialog->ecal) && have_selected)
+	if ((e_cal_get_one_alarm_only (dialog->ecal) && have_selected) || read_only)
 		gtk_widget_set_sensitive (dialog->add, FALSE);
 	else
 		gtk_widget_set_sensitive (dialog->add, TRUE);
-	gtk_widget_set_sensitive (dialog->delete, have_selected);
+	gtk_widget_set_sensitive (dialog->delete, have_selected && !read_only);
 }
 
 /* Callback used for the "add reminder" button */


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