[evolution-patches] Fix for bug#271810 [UIHACKFEST]



Hi,
  Have attached the fix for the bug. Please see ChangeLog for more
information.

thanks, Chenthill.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2926
diff -u -p -u -p -r1.2926 ChangeLog
--- ChangeLog	10 Jan 2006 08:08:20 -0000	1.2926
+++ ChangeLog	12 Jan 2006 12:20:00 -0000
@@ -1,3 +1,13 @@
+2006-01-14  Chenthill Palanisamy  <pchenthill novell com>
+
+	Fixes #271810
+	* gui/dialogs/comp-editor.c: (comp_editor_class_init), (save_comp):
+	* gui/dialogs/comp-editor.h: Added to signal to indicate the object
+	has been created.
+	* gui/e-calendar-view.c: (user_created_cb),
+	(open_event_with_flags): Emit the user_created signal if object
+	is created to ensure the calendar is selected.
+
 2006-01-10  Simon Zheng  <simon zheng sun com>
 
 	* gui/calendar-component.c: (calendar_component_peek):
Index: gui/dialogs/comp-editor.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/dialogs/comp-editor.c,v
retrieving revision 1.160
diff -u -p -u -p -r1.160 comp-editor.c
--- gui/dialogs/comp-editor.c	20 Dec 2005 06:03:57 -0000	1.160
+++ gui/dialogs/comp-editor.c	12 Jan 2006 12:20:00 -0000
@@ -182,6 +182,13 @@ static struct {
 	{ "text/calendar", 0, GDK_ACTION_COPY },
 };
 
+enum {
+	OBJECT_CREATED,
+	LAST_SIGNAL
+};
+
+static guint comp_editor_signals[LAST_SIGNAL] = { 0 };
+
 static void
 attach_message(CompEditor *editor, CamelMimeMessage *msg)
 {
@@ -534,6 +541,16 @@ comp_editor_class_init (CompEditorClass 
 	klass->set_e_cal = real_set_e_cal;
 	klass->edit_comp = real_edit_comp;
 	klass->send_comp = real_send_comp;
+	klass->object_created = NULL;
+
+	comp_editor_signals[OBJECT_CREATED] =
+		g_signal_new ("object_created",
+			      G_TYPE_FROM_CLASS (klass),
+			      G_SIGNAL_RUN_LAST,
+			      G_STRUCT_OFFSET (CompEditorClass, object_created),
+			      NULL, NULL,
+			      g_cclosure_marshal_VOID__VOID,
+			      G_TYPE_NONE, 0);
 
 	widget_class->key_press_event = comp_editor_key_press_event;
 	object_class->finalize = comp_editor_finalize;
@@ -735,6 +752,8 @@ save_comp (CompEditor *editor)
 	/* send the component to the server */
 	if (!cal_comp_is_on_server (priv->comp, priv->client)) {
 		result = e_cal_create_object (priv->client, icalcomp, NULL, &error);
+		if (result)
+			g_signal_emit_by_name (editor, "object_created");
 	} else {
 		if (priv->mod == CALOBJ_MOD_THIS) {
 			e_cal_component_set_rdate_list (priv->comp, NULL);
Index: gui/e-calendar-view.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/e-calendar-view.c,v
retrieving revision 1.108
diff -u -p -u -p -r1.108 e-calendar-view.c
--- gui/e-calendar-view.c	2 Jan 2006 14:12:39 -0000	1.108
+++ gui/e-calendar-view.c	12 Jan 2006 12:20:01 -0000
@@ -1779,6 +1779,13 @@ e_calendar_view_new_appointment (ECalend
 	e_calendar_view_new_appointment_full (cal_view, FALSE, FALSE);
 }
 
+/* Ensures the calendar is selected */
+static void
+object_created_cb (CompEditor *ce, ECalendarView *cal_view)
+{
+	g_signal_emit_by_name (cal_view, "user_created");
+}
+
 static void
 open_event_with_flags (ECalendarView *cal_view, ECal *client, icalcomponent *icalcomp, guint32 flags)
 {
@@ -1798,6 +1805,8 @@ open_event_with_flags (ECalendarView *ca
 
 		ee = event_editor_new (client, flags);
 		ce = COMP_EDITOR (ee);
+
+		g_signal_connect (ce, "object_created", G_CALLBACK (object_created_cb), cal_view);
 
 		comp = e_cal_component_new ();
 		e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp));


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