aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog10
-rw-r--r--calendar/gui/dialogs/comp-editor.c19
-rw-r--r--calendar/gui/dialogs/comp-editor.h1
-rw-r--r--calendar/gui/e-calendar-view.c9
4 files changed, 39 insertions, 0 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 2e67cece10..ab71efc7b0 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,13 @@
+2006-01-13 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-13 Srinivasa Ragavan <sragavan@novell.com>
** Fixes bug #274234
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 93ab7fe52d..f17999334e 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -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)
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);
diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h
index 3affcb22b6..1c11e1540c 100644
--- a/calendar/gui/dialogs/comp-editor.h
+++ b/calendar/gui/dialogs/comp-editor.h
@@ -55,6 +55,7 @@ typedef struct {
/* Virtual functions */
void (* set_e_cal) (CompEditor *page, ECal *client);
void (* edit_comp) (CompEditor *page, ECalComponent *comp);
+ void (* object_created) (CompEditor *page);
gboolean (* send_comp) (CompEditor *page, ECalComponentItipMethod method);
} CompEditorClass;
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 9ebfa248d5..95eca81959 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -1791,6 +1791,13 @@ e_calendar_view_new_appointment (ECalendarView *cal_view)
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)
{
@@ -1811,6 +1818,8 @@ open_event_with_flags (ECalendarView *cal_view, ECal *client, icalcomponent *ica
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));
comp_editor_edit_comp (ce, comp);