[evolution-patches] patch to fix popup of multiple offline error dialogs and hide sendoptionsframe for posted tasks when source is changed [calendar]



hi,
     Have attached the patch.

thanks, chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2666
diff -u -p -r1.2666 ChangeLog
--- ChangeLog	15 Feb 2005 22:14:45 -0000	1.2666
+++ ChangeLog	18 Feb 2005 04:38:40 -0000
@@ -1,3 +1,22 @@
+2005-02-18  Chenthill Palanisamy  <pchenthill novell com>
+
+	* _EventPagePrivate: added a boolean variable is_meeting.
+	* _TaskPagePrivate: added a boolean variable is_assignment.
+	* gui/dialogs/task-page.h:
+	* gui/dialogs/event-page.h: Added a function to set
+	the is_meeting boolean variable.
+	* gui/dialogs/event-editor.c: (show_meeting):
+	* gui/dialogs/task-editor.c: (show_assignment): Called
+	the function to set the boolean variable.
+	* gui/dialogs/event-page.c: (event_page_init),
+	(event_page_set_meeting), (source_changed_cb):
+	* gui/dialogs/task-page.c: (task_page_init),
+	(task_page_set_assignment), (source_changed_cb):
+	If the source is changed and only if its a group
+	event show the send options frame.
+	* gui/gnome-cal.c: (client_cal_opened_cb): Do not
+	popup the offline error dialog for tasks.
+
 2005-02-15  Rodrigo Moya <rodrigo novell com>
 
 	* gui/migration.c (migrate_ical_folder_to_source): check return value
Index: gui/gnome-cal.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/gnome-cal.c,v
retrieving revision 1.365
diff -u -p -r1.365 gnome-cal.c
--- gui/gnome-cal.c	5 Feb 2005 13:36:45 -0000	1.365
+++ gui/gnome-cal.c	18 Feb 2005 04:38:41 -0000
@@ -2170,7 +2170,6 @@ client_cal_opened_cb (ECal *ecal, ECalen
 	ECalSourceType source_type;
 	ESource *source;
 	char *msg;
-	const char *id;
 	int i;
 
 	priv = gcal->priv;
@@ -2180,11 +2179,9 @@ client_cal_opened_cb (ECal *ecal, ECalen
 
 	switch (source_type) {
 	case E_CAL_SOURCE_TYPE_EVENT:
-		id = "calendar:prompt-no-contents-offline-calendar";
 		e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL);
 		break;
 	case E_CAL_SOURCE_TYPE_TODO:
-		id = "calendar:prompt-no-contents-offline-tasks";
 		e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL);
 		break;
 	default:
@@ -2200,7 +2197,9 @@ client_cal_opened_cb (ECal *ecal, ECalen
 		status = E_CALENDAR_STATUS_OK;
 		break;
 	case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
-		e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL);
+		if (source_type == E_CAL_SOURCE_TYPE_EVENT)
+			e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), 
+				"calendar:prompt-no-contents-offline-calendar", NULL);
 	default:
 		/* Make sure the source doesn't disappear on us */
 		g_object_ref (source);
Index: gui/dialogs/task-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-editor.c,v
retrieving revision 1.79
diff -u -p -r1.79 task-editor.c
--- gui/dialogs/task-editor.c	4 Feb 2005 15:49:15 -0000	1.79
+++ gui/dialogs/task-editor.c	18 Feb 2005 04:38:41 -0000
@@ -352,6 +352,7 @@ show_assignment (TaskEditor *te)
 
 	priv = te->priv;
 
+	task_page_set_assignment (priv->task_page, TRUE);
 	if (!priv->assignment_shown) {
 		comp_editor_append_page (COMP_EDITOR (te),
 					 COMP_EDITOR_PAGE (priv->meet_page),
Index: gui/dialogs/task-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.c,v
retrieving revision 1.70
diff -u -p -r1.70 task-page.c
--- gui/dialogs/task-page.c	7 Jan 2005 18:33:44 -0000	1.70
+++ gui/dialogs/task-page.c	18 Feb 2005 04:38:41 -0000
@@ -78,6 +78,7 @@ struct _TaskPagePrivate {
 
 	gboolean updating;
 	gboolean sendoptions_shown;
+	gboolean is_assignment;
 
 	ESendOptionsDialog *sod;
 };
@@ -153,6 +154,7 @@ task_page_init (TaskPage *tpage)
 
 	priv->updating = FALSE;
 	priv->sendoptions_shown = FALSE;
+	priv->is_assignment = FALSE;
 }
 
 /* Destroy handler for the task page */
@@ -292,6 +294,14 @@ task_page_show_options (TaskPage *page)
 	page->priv->sendoptions_shown = TRUE;
 }
 
+void
+task_page_set_assignment (TaskPage *page, gboolean set)
+{
+	g_return_if_fail (IS_TASK_PAGE (page));
+
+	page->priv->is_assignment = set;
+}
+
 /* fill_widgets handler for the task page */
 static gboolean
 task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp)
@@ -873,7 +883,7 @@ source_changed_cb (GtkWidget *widget, ES
 			comp_editor_notify_client_changed (
 				COMP_EDITOR (gtk_widget_get_toplevel (priv->main)),
 				client);
-			if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS))
+			if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS) && priv->is_assignment)
 				task_page_show_options (tpage);
 			else
 				task_page_hide_options (tpage);
Index: gui/dialogs/task-page.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/task-page.h,v
retrieving revision 1.5
diff -u -p -r1.5 task-page.h
--- gui/dialogs/task-page.h	6 Jan 2005 09:25:21 -0000	1.5
+++ gui/dialogs/task-page.h	18 Feb 2005 04:38:41 -0000
@@ -54,6 +54,7 @@ TaskPage *task_page_construct (TaskPage 
 TaskPage *task_page_new       (void);
 void task_page_show_options (TaskPage *page);
 void task_page_hide_options (TaskPage *page);
+void task_page_set_assignment (TaskPage *page, gboolean set);
 
 
 
Index: gui/dialogs/event-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-editor.c,v
retrieving revision 1.57
diff -u -p -r1.57 event-editor.c
--- gui/dialogs/event-editor.c	9 Feb 2005 14:37:48 -0000	1.57
+++ gui/dialogs/event-editor.c	18 Feb 2005 04:38:41 -0000
@@ -372,6 +372,7 @@ show_meeting (EventEditor *ee)
 	priv = ee->priv;
 
 	
+	event_page_set_meeting (priv->event_page, TRUE);
 	if (!priv->meeting_shown) {
 		comp_editor_append_page (COMP_EDITOR (ee),
 					 COMP_EDITOR_PAGE (priv->sched_page),
Index: gui/dialogs/event-page.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.c,v
retrieving revision 1.78
diff -u -p -r1.78 event-page.c
--- gui/dialogs/event-page.c	7 Jan 2005 18:33:43 -0000	1.78
+++ gui/dialogs/event-page.c	18 Feb 2005 04:38:41 -0000
@@ -104,6 +104,7 @@ struct _EventPagePrivate {
 	   start timezone is then changed, we updated the end timezone to the
 	   same value, since 99% of events start and end in one timezone. */
 	gboolean sync_timezones;
+	gboolean is_meeting;
 };
 
 
@@ -178,6 +179,7 @@ event_page_init (EventPage *epage)
 	
 	priv->updating = FALSE;
 	priv->sendoptions_shown = FALSE;
+	priv->is_meeting = FALSE;
 	priv->sync_timezones = FALSE;
 
 }
@@ -660,6 +662,13 @@ event_page_show_options (EventPage *page
 	page->priv->sendoptions_shown = TRUE;
 }
 
+void 
+event_page_set_meeting (EventPage *page, gboolean set)
+{
+	g_return_if_fail (IS_EVENT_PAGE (page));
+
+	page->priv->is_meeting = set;
+}
 
 /* fill_widgets handler for the event page */
 static gboolean
@@ -1676,7 +1685,7 @@ source_changed_cb (GtkWidget *widget, ES
 			comp_editor_notify_client_changed (
 				COMP_EDITOR (gtk_widget_get_toplevel (priv->main)),
 				client);
-			if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS))
+			if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS) && priv->is_meeting)
 				event_page_show_options (epage);
 			else
 				event_page_hide_options (epage);
Index: gui/dialogs/event-page.h
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/event-page.h,v
retrieving revision 1.7
diff -u -p -r1.7 event-page.h
--- gui/dialogs/event-page.h	6 Jan 2005 09:25:21 -0000	1.7
+++ gui/dialogs/event-page.h	18 Feb 2005 04:38:41 -0000
@@ -55,7 +55,7 @@ EventPage *event_page_construct (EventPa
 EventPage *event_page_new       (void);
 void event_page_show_options (EventPage *page);
 void event_page_hide_options (EventPage *page);
-
+void event_page_set_meeting (EventPage *page, gboolean set);
 
 G_END_DECLS
 


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