[evolution-patches] Patch for bug#271541



hi,

This patch is regarding disabling options or displaying warning to user
whenever there is an attempt to add appointments to an read-only
calendar.

thanx,
Viren. 






Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2733
diff -u -p -r1.2733 ChangeLog
--- ChangeLog	13 May 2005 11:08:28 -0000	1.2733
+++ ChangeLog	24 May 2005 07:09:19 -0000
@@ -1,3 +1,7 @@
+2005-05-18  Viren.L<lviren novell com>
+	* gui/e-calendar-view.c:(e_calendar_view_edit_appointment):Check whether calendar is            read only and display warning dialog if user attempts to add appointment.
+	Specify the sensitivity mask E_CAL_POPUP_SELECT_EDITABLE for the popup items New Appoint	ment,New AlldayEvent and Meeting.
+	Fixes #271541
 2005-05-13  Thouis R. Jones  <thouis csail mit edu>
 
 	Fixes #272301
Index: calendar-errors.xml
===================================================================
RCS file: /cvs/gnome/evolution/calendar/Attic/calendar-errors.xml,v
retrieving revision 1.12
diff -u -p -r1.12 calendar-errors.xml
--- calendar-errors.xml	6 May 2005 05:17:05 -0000	1.12
+++ calendar-errors.xml	24 May 2005 07:09:20 -0000
@@ -212,5 +212,8 @@
  <primary>Some features may not work properly with your current server</primary>
  <secondary>You are connecting to an unsupported GroupWise server and may encounter problems using Evolution. For best results the server should be upgraded to a supported version</secondary>
  </error>
-
+<error id="read-only-calendar" type="warning">
+<primary>Can't create New Appointment</primary>
+<secondary>You are attempting to add appointment for a READ-ONLY calendar</secondary>
+</error>
 </error-list>
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.80
diff -u -p -r1.80 e-calendar-view.c
--- gui/e-calendar-view.c	6 May 2005 03:29:55 -0000	1.80
+++ gui/e-calendar-view.c	24 May 2005 07:09:23 -0000
@@ -1391,9 +1391,9 @@ on_paste (EPopup *ep, EPopupItem *pitem,
 }
 
 static EPopupItem ecv_main_items [] = {
-	{ E_POPUP_ITEM, "00.new", N_("New _Appointment..."), on_new_appointment, NULL, "stock_new-appointment", 0, 0 },
-	{ E_POPUP_ITEM, "10.newallday", N_("New All Day _Event"), on_new_event, NULL, "stock_new-24h-appointment", 0, 0},
-	{ E_POPUP_ITEM, "20.meeting", N_("New Meeting"), on_new_meeting, NULL, "stock_new-meeting", 0, 0},
+	{ E_POPUP_ITEM, "00.new", N_("New _Appointment..."), on_new_appointment, NULL, "stock_new-appointment", 0, E_CAL_POPUP_SELECT_EDITABLE},
+	{ E_POPUP_ITEM, "10.newallday", N_("New All Day _Event"), on_new_event, NULL, "stock_new-24h-appointment", 0, E_CAL_POPUP_SELECT_EDITABLE},
+	{ E_POPUP_ITEM, "20.meeting", N_("New Meeting"), on_new_meeting, NULL, "stock_new-meeting", 0, E_CAL_POPUP_SELECT_EDITABLE},
 	{ E_POPUP_ITEM, "30.task", N_("New Task"), on_new_task, NULL, "stock_task", 0, 0},
 
 	{ E_POPUP_BAR, "40."},
@@ -1650,11 +1650,20 @@ e_calendar_view_edit_appointment (ECalen
 	CompEditor *ce;
 	const char *uid;
 	ECalComponent *comp;
-
+	GError **error;
+	gboolean read_only;	
+	GtkWidget *dialog;
+	 
 	g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
 	g_return_if_fail (E_IS_CAL (client));
 	g_return_if_fail (icalcomp != NULL);
 
+	if (e_cal_is_read_only (client ,&read_only ,error) &&  read_only) {
+	dialog = e_error_new (NULL ,"calendar:read-only-calendar" ,NULL);
+	g_signal_connect_swapped (dialog ,"response" ,G_CALLBACK (gtk_widget_destroy) ,dialog);
+	gtk_widget_show (dialog);
+	return;
+		}
 	priv = cal_view->priv;
 
 	uid = icalcomponent_get_uid (icalcomp);


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