aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/comp-editor-factory.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2002-02-08 03:35:18 +0800
committerJP Rosevear <jpr@src.gnome.org>2002-02-08 03:35:18 +0800
commit70398dd9e66a5b78c847ad45e42a168e99b5893a (patch)
tree16117c3769876e9fb0415e56ff0c4bcb7de769ef /calendar/gui/comp-editor-factory.c
parent91a3039067e05004f73abab588c4838ff7d10f18 (diff)
downloadgsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.gz
gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.tar.zst
gsoc2013-evolution-70398dd9e66a5b78c847ad45e42a168e99b5893a.zip
pass meeting boolean for gnome_calendar_edit_object and
2002-02-07 JP Rosevear <jpr@ximian.com> * gui/e-day-view.c: pass meeting boolean for gnome_calendar_edit_object and gnome_calendar_new_appointment_for * gui/e-week-view-event-item.c: ditto * gui/e-week-view.c: ditto * gui/tasks-control.c (confirm_expunge): kill warning * gui/calendar-commands.c (new_meeting_cb): show a new meeting dialog (new_event_cb): pass new param * gui/gnome-cal.c (gnome_calendar_edit_object): take meeting boolean and show meeting page if true (gnome_calendar_new_appointment_for): takeing meeting param and pass to above (gnome_calendar_new_appointment): add new param * gui/gnome-cal.h: update proto * gui/component-factory.c (create_component): take a comp editor mode, determine vtype (sc_user_create_new_item_cb): check for meeting user creatable item (create_object): add meeting as user creatable item * gui/comp-editor-factory.c (edit_new): get a comp editor mode now, determine vtype and show meeting page if required (queue_edit_new): get comp editor mode (impl_editNew): ditto, plus queue the mode directly instead of determining the vtype * gui/dialogs/event-editor.c (show_meeting): new internal util function to show meeting page (event_editor_show_meeting): show the meeting (schedule_meeting_cmd): use show_meeting * gui/dialogs/event-editor.h: new proto * idl/evolution-calendar.idl: editNew takes a mode rather than a type now * cal-util/Makefile.am: fix includes svn path=/trunk/; revision=15595
Diffstat (limited to 'calendar/gui/comp-editor-factory.c')
-rw-r--r--calendar/gui/comp-editor-factory.c52
1 files changed, 20 insertions, 32 deletions
diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c
index 928c50f937..fbf81248a7 100644
--- a/calendar/gui/comp-editor-factory.c
+++ b/calendar/gui/comp-editor-factory.c
@@ -22,6 +22,7 @@
#include <config.h>
#endif
+#include <evolution-calendar.h>
#include <e-util/e-url.h>
#include <cal-client/cal-client.h>
#include "calendar-config.h"
@@ -48,7 +49,7 @@ typedef struct {
} existing;
struct {
- CalComponentVType vtype;
+ GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type;
} new;
} u;
} Request;
@@ -379,21 +380,23 @@ get_default_component (CalComponentVType vtype)
/* Edits a new object in the context of a client */
static void
-edit_new (OpenClient *oc, CalComponentVType vtype)
+edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type)
{
CalComponent *comp;
Component *c;
CompEditor *editor;
-
- switch (vtype) {
- case CAL_COMPONENT_EVENT:
+ CalComponentVType vtype;
+
+ switch (type) {
+ case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT:
+ case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING:
editor = COMP_EDITOR (event_editor_new ());
+ vtype = CAL_COMPONENT_EVENT;
break;
-
- case CAL_COMPONENT_TODO:
+ case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO:
editor = COMP_EDITOR (task_editor_new ());
+ vtype = CAL_COMPONENT_TODO;
break;
-
default:
g_assert_not_reached ();
return;
@@ -415,6 +418,8 @@ edit_new (OpenClient *oc, CalComponentVType vtype)
comp_editor_set_cal_client (editor, oc->client);
comp_editor_edit_comp (editor, comp);
+ if (type == GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_MEETING)
+ event_editor_show_meeting (EVENT_EDITOR (editor));
comp_editor_focus (editor);
}
@@ -450,7 +455,7 @@ resolve_pending_requests (OpenClient *oc)
break;
case REQUEST_NEW:
- edit_new (oc, request->u.new.vtype);
+ edit_new (oc, request->u.new.type);
break;
}
@@ -637,7 +642,7 @@ impl_editExisting (PortableServer_Servant servant,
/* Queues a request for creating a new object */
static void
-queue_edit_new (OpenClient *oc, CalComponentVType vtype)
+queue_edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode type)
{
Request *request;
@@ -645,7 +650,7 @@ queue_edit_new (OpenClient *oc, CalComponentVType vtype)
request = g_new (Request, 1);
request->type = REQUEST_NEW;
- request->u.new.vtype = vtype;
+ request->u.new.type = type;
oc->pending = g_slist_append (oc->pending, request);
}
@@ -654,14 +659,13 @@ queue_edit_new (OpenClient *oc, CalComponentVType vtype)
static void
impl_editNew (PortableServer_Servant servant,
const CORBA_char *str_uri,
- const GNOME_Evolution_Calendar_CalObjType corba_type,
+ const GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode corba_type,
CORBA_Environment *ev)
{
CompEditorFactory *factory;
CompEditorFactoryPrivate *priv;
OpenClient *oc;
- CalComponentVType vtype;
-
+
factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant));
priv = factory->priv;
@@ -669,26 +673,10 @@ impl_editNew (PortableServer_Servant servant,
if (!oc)
return;
- switch (corba_type) {
- case GNOME_Evolution_Calendar_TYPE_EVENT:
- vtype = CAL_COMPONENT_EVENT;
- break;
-
- case GNOME_Evolution_Calendar_TYPE_TODO:
- vtype = CAL_COMPONENT_TODO;
- break;
-
- default:
- CORBA_exception_set (ev, CORBA_USER_EXCEPTION,
- ex_GNOME_Evolution_Calendar_CompEditorFactory_UnsupportedType,
- NULL);
- return;
- }
-
if (!oc->open)
- queue_edit_new (oc, vtype);
+ queue_edit_new (oc, corba_type);
else
- edit_new (oc, vtype);
+ edit_new (oc, corba_type);
}