aboutsummaryrefslogtreecommitdiffstats
path: root/calendar
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-10-19 05:34:04 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-10-19 05:34:04 +0800
commitf6dfb498619f36e5038b305318c2db657362ca79 (patch)
tree7d027ced62345ed9ac8f94adfe651861a300697c /calendar
parentd4fd9c55c7f5d5b7ad3f0bf1c4a2481023f7bceb (diff)
downloadgsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar.gz
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar.bz2
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar.lz
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar.xz
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.tar.zst
gsoc2013-evolution-f6dfb498619f36e5038b305318c2db657362ca79.zip
call the invite others dialog in the model
2001-10-18 JP Rosevear <jpr@ximian.com> * gui/e-meeting-time-sel.c (e_meeting_time_selector_on_invite_others_button_clicked): call the invite others dialog in the model * gui/e-meeting-attendee.c (e_meeting_attendee_get_atype): pick attendee type based on role and cutype * gui/e-meeting-attendee.h: remove proto * gui/Makefile.am: compile select names idl * gui/e-meeting-model.h: new proto * gui/dialogs/meeting-page.c: remove invite others dialogs bits from here * gui/e-meeting-model.c (e_meeting_model_invite_others_dialog): and put them here * gui/dialogs/Makefile.am: compile corba bits in parent dir * gui/dialogs/comp-editor-util.h: reflect above in includes * gui/dialogs/e-delegate-dialog.c: ditto * gui/dialogs/schedule-page.c: ditto and clean includes svn path=/trunk/; revision=13775
Diffstat (limited to 'calendar')
-rw-r--r--calendar/ChangeLog29
-rw-r--r--calendar/gui/Makefile.am13
-rw-r--r--calendar/gui/dialogs/Makefile.am18
-rw-r--r--calendar/gui/dialogs/comp-editor-util.h2
-rw-r--r--calendar/gui/dialogs/e-delegate-dialog.c2
-rw-r--r--calendar/gui/dialogs/meeting-page.c147
-rw-r--r--calendar/gui/dialogs/schedule-page.c6
-rw-r--r--calendar/gui/e-meeting-attendee.c21
-rw-r--r--calendar/gui/e-meeting-attendee.h1
-rw-r--r--calendar/gui/e-meeting-model.c165
-rw-r--r--calendar/gui/e-meeting-model.h3
-rw-r--r--calendar/gui/e-meeting-time-sel.c3
12 files changed, 217 insertions, 193 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 50df773314..6b2e4b695b 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,32 @@
+2001-10-18 JP Rosevear <jpr@ximian.com>
+
+ * gui/e-meeting-time-sel.c
+ (e_meeting_time_selector_on_invite_others_button_clicked): call
+ the invite others dialog in the model
+
+ * gui/e-meeting-attendee.c (e_meeting_attendee_get_atype): pick
+ attendee type based on role and cutype
+
+ * gui/e-meeting-attendee.h: remove proto
+
+ * gui/Makefile.am: compile select names idl
+
+ * gui/e-meeting-model.h: new proto
+
+ * gui/dialogs/meeting-page.c: remove invite others dialogs bits
+ from here
+
+ * gui/e-meeting-model.c (e_meeting_model_invite_others_dialog):
+ and put them here
+
+ * gui/dialogs/Makefile.am: compile corba bits in parent dir
+
+ * gui/dialogs/comp-editor-util.h: reflect above in includes
+
+ * gui/dialogs/e-delegate-dialog.c: ditto
+
+ * gui/dialogs/schedule-page.c: ditto and clean includes
+
2001-10-18 Larry Ewing <lewing@ximian.com>
* gui/alarm-notify/alarm-notify-dialog.c: add html widget
diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am
index 45403cd69c..caf867926f 100644
--- a/calendar/gui/Makefile.am
+++ b/calendar/gui/Makefile.am
@@ -1,14 +1,19 @@
## CORBA stuff
-IDLS = \
- $(top_srcdir)/composer/Evolution-Composer.idl \
- $(top_srcdir)/calendar/idl/evolution-calendar.idl
+IDLS = \
+ $(top_srcdir)/composer/Evolution-Composer.idl \
+ $(top_srcdir)/calendar/idl/evolution-calendar.idl \
+ $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
IDL_GENERATED = \
Evolution-Composer.h \
Evolution-Composer-common.c \
Evolution-Composer-skels.c \
Evolution-Composer-stubs.c \
+ Evolution-Addressbook-SelectNames.h \
+ Evolution-Addressbook-SelectNames-common.c \
+ Evolution-Addressbook-SelectNames-skels.c \
+ Evolution-Addressbook-SelectNames-stubs.c \
evolution-calendar.h \
evolution-calendar-common.c \
evolution-calendar-skels.c \
@@ -19,6 +24,8 @@ $(IDL_GENERATED): $(IDLS)
$(srcdir)/../../composer/Evolution-Composer.idl
$(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
$(top_srcdir)/calendar/idl/evolution-calendar.idl
+ $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
+ $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
BUILT_SOURCES = $(IDL_GENERATED)
diff --git a/calendar/gui/dialogs/Makefile.am b/calendar/gui/dialogs/Makefile.am
index 2784a36004..67a890def0 100644
--- a/calendar/gui/dialogs/Makefile.am
+++ b/calendar/gui/dialogs/Makefile.am
@@ -1,20 +1,3 @@
-## CORBA stuff
-
-IDLS = \
- $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-
-IDL_GENERATED = \
- Evolution-Addressbook-SelectNames.h \
- Evolution-Addressbook-SelectNames-common.c \
- Evolution-Addressbook-SelectNames-skels.c \
- Evolution-Addressbook-SelectNames-stubs.c
-
-$(IDL_GENERATED): $(IDLS)
- $(ORBIT_IDL) -I $(srcdir) -I $(datadir)/idl `$(GNOME_CONFIG) --cflags idl` \
- $(top_srcdir)/addressbook/gui/component/select-names/Evolution-Addressbook-SelectNames.idl
-
-BUILT_SOURCES = $(IDL_GENERATED)
-
INCLUDES = \
-DG_LOG_DOMAIN=\"calendar-gui\" \
-I$(top_srcdir) \
@@ -39,7 +22,6 @@ INCLUDES = \
noinst_LIBRARIES = libcal-dialogs.a
libcal_dialogs_a_SOURCES = \
- $(IDL_GENERATED) \
alarm-options.c \
alarm-options.h \
alarm-page.c \
diff --git a/calendar/gui/dialogs/comp-editor-util.h b/calendar/gui/dialogs/comp-editor-util.h
index 37c1c0d5f7..d44f63d81f 100644
--- a/calendar/gui/dialogs/comp-editor-util.h
+++ b/calendar/gui/dialogs/comp-editor-util.h
@@ -24,7 +24,7 @@
#include <gtk/gtkwidget.h>
#include <bonobo/bonobo-control.h>
-#include "Evolution-Addressbook-SelectNames.h"
+#include "../Evolution-Addressbook-SelectNames.h"
#include "comp-editor-page.h"
void comp_editor_dates (CompEditorPageDates *date, CalComponent *comp);
diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c
index 93c3e773d7..5d99c0c222 100644
--- a/calendar/gui/dialogs/e-delegate-dialog.c
+++ b/calendar/gui/dialogs/e-delegate-dialog.c
@@ -34,7 +34,7 @@
#include <glade/glade.h>
#include <widgets/misc/e-map.h>
#include <e-destination.h>
-#include "Evolution-Addressbook-SelectNames.h"
+#include "../Evolution-Addressbook-SelectNames.h"
#include "e-delegate-dialog.h"
struct _EDelegateDialogPrivate {
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index bef302cb9f..fbef04d18e 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -27,10 +27,6 @@
#endif
#include <glib.h>
-#include <liboaf/liboaf.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <bonobo/bonobo-exception.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
@@ -48,8 +44,6 @@
#include <gal/widgets/e-gui-utils.h>
#include <widgets/misc/e-dateedit.h>
#include <e-util/e-dialog-widgets.h>
-#include <e-destination.h>
-#include "Evolution-Addressbook-SelectNames.h"
#include "../component-factory.h"
#include "../e-meeting-attendee.h"
#include "../e-meeting-model.h"
@@ -59,7 +53,6 @@
#include "meeting-page.h"
-#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames"
enum columns {
MEETING_ATTENDEE_COL,
@@ -113,9 +106,6 @@ struct _MeetingPagePrivate {
gboolean other;
gboolean existing;
gboolean updating;
-
- /* For handling the invite button */
- GNOME_Evolution_Addressbook_SelectNames corba_select_names;
};
@@ -512,132 +502,6 @@ get_widgets (MeetingPage *mpage)
&& priv->existing_organizer_btn);
}
-static void
-invite_entry_changed (BonoboListener *listener,
- char *event_name,
- CORBA_any *arg,
- CORBA_Environment *ev,
- gpointer data)
-{
- MeetingPage *mpage = data;
- MeetingPagePrivate *priv;
- Bonobo_Control corba_control;
- GtkWidget *control_widget;
- EDestination **destv;
- char *string = NULL, *section;
- int i;
-
- priv = mpage->priv;
-
- section = BONOBO_ARG_GET_STRING (arg);
-
- g_message ("event: \"%s\", section \"%s\"", event_name, section);
-
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (priv->corba_select_names, section, ev);
- control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
-
- bonobo_widget_get_property (BONOBO_WIDGET (control_widget), "destinations", &string, NULL);
- destv = e_destination_importv (string);
- if (destv == NULL)
- return;
-
- for (i = 0; destv[i] != NULL; i++) {
- EMeetingAttendee *ia;
- const char *name, *address;
-
- name = e_destination_get_name (destv[i]);
- address = e_destination_get_email (destv[i]);
-
- if (e_meeting_model_find_attendee (priv->model, address, NULL) == NULL) {
- ia = e_meeting_model_add_attendee_with_defaults (priv->model);
-
- e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", address));
- if (!strcmp (section, _("Chair Persons")))
- e_meeting_attendee_set_role (ia, ICAL_ROLE_CHAIR);
- else if (!strcmp (section, _("Required Participants")))
- e_meeting_attendee_set_role (ia, ICAL_ROLE_REQPARTICIPANT);
- else if (!strcmp (section, _("Optional Participants")))
- e_meeting_attendee_set_role (ia, ICAL_ROLE_OPTPARTICIPANT);
- else if (!strcmp (section, _("Non-Participants")))
- e_meeting_attendee_set_role (ia, ICAL_ROLE_NONPARTICIPANT);
- e_meeting_attendee_set_cn (ia, g_strdup (name));
- }
- }
- e_destination_freev (destv);
-}
-
-static void
-add_section (GNOME_Evolution_Addressbook_SelectNames corba_select_names, const char *name, int limit)
-{
- CORBA_Environment ev;
-
- CORBA_exception_init (&ev);
-
- if (limit != 0)
- GNOME_Evolution_Addressbook_SelectNames_addSectionWithLimit (corba_select_names,
- name, name, limit, &ev);
- else
- GNOME_Evolution_Addressbook_SelectNames_addSection (corba_select_names,
- name, name, &ev);
-
- CORBA_exception_free (&ev);
-}
-
-static gboolean
-get_select_name_dialog (MeetingPage *mpage)
-{
- MeetingPagePrivate *priv;
- const char *sections[] = {_("Chair Persons"), _("Required Participants"), _("Optional Participants"), _("Non-Participants")};
- CORBA_Environment ev;
-
- priv = mpage->priv;
-
- if (priv->corba_select_names != CORBA_OBJECT_NIL) {
- Bonobo_Control corba_control;
- GtkWidget *control_widget;
- int i;
-
- CORBA_exception_init (&ev);
- for (i = 0; i < 4; i++) {
- corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (priv->corba_select_names, sections[i], &ev);
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
-
- bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", "", NULL);
- }
- CORBA_exception_free (&ev);
-
- return TRUE;
- }
-
- CORBA_exception_init (&ev);
-
- priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
-
- add_section (priv->corba_select_names, sections[0], 0);
- add_section (priv->corba_select_names, sections[1], 0);
- add_section (priv->corba_select_names, sections[2], 0);
- add_section (priv->corba_select_names, sections[3], 0);
-
- bonobo_event_source_client_add_listener (priv->corba_select_names,
- invite_entry_changed,
- "GNOME/Evolution:changed:model",
- NULL, mpage);
-
- if (BONOBO_EX (&ev)) {
- CORBA_exception_free (&ev);
- return FALSE;
- }
-
- CORBA_exception_free (&ev);
-
- return TRUE;
-}
-
/* This is called when any field is changed; it notifies upstream. */
static void
field_changed_cb (GtkWidget *widget, gpointer data)
@@ -697,20 +561,11 @@ invite_cb (GtkWidget *widget, gpointer data)
{
MeetingPage *mpage;
MeetingPagePrivate *priv;
- CORBA_Environment ev;
mpage = MEETING_PAGE (data);
priv = mpage->priv;
-
- if (!get_select_name_dialog (mpage))
- return;
-
- CORBA_exception_init (&ev);
-
- GNOME_Evolution_Addressbook_SelectNames_activateDialog (
- priv->corba_select_names, _("Required Participants"), &ev);
- CORBA_exception_free (&ev);
+ e_meeting_model_invite_others_dialog (priv->model);
}
/* Hooks the widget signals */
diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c
index 510bd3070b..25e20a1e4a 100644
--- a/calendar/gui/dialogs/schedule-page.c
+++ b/calendar/gui/dialogs/schedule-page.c
@@ -27,10 +27,6 @@
#endif
#include <glib.h>
-#include <liboaf/liboaf.h>
-#include <bonobo/bonobo-control.h>
-#include <bonobo/bonobo-widget.h>
-#include <bonobo/bonobo-exception.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktogglebutton.h>
#include <gtk/gtkvbox.h>
@@ -49,8 +45,6 @@
#include <gal/widgets/e-gui-utils.h>
#include <widgets/misc/e-dateedit.h>
#include <e-util/e-dialog-widgets.h>
-#include <e-destination.h>
-#include "Evolution-Addressbook-SelectNames.h"
#include "../e-meeting-time-sel.h"
#include "../itip-utils.h"
#include "comp-editor-util.h"
diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c
index 08ec9a1152..02d550fa2a 100644
--- a/calendar/gui/e-meeting-attendee.c
+++ b/calendar/gui/e-meeting-attendee.c
@@ -30,8 +30,6 @@
#include "e-meeting-attendee.h"
struct _EMeetingAttendeePrivate {
- EMeetingAttendeeType type;
-
gchar *address;
gchar *member;
@@ -153,8 +151,6 @@ init (EMeetingAttendee *ia)
ia->priv = priv;
- priv->type = E_MEETING_ATTENDEE_REQUIRED_PERSON;
-
priv->address = string_test (NULL);
priv->member = string_test (NULL);
@@ -609,20 +605,17 @@ e_meeting_attendee_get_atype (EMeetingAttendee *ia)
priv = ia->priv;
- return priv->type;
-}
+ if (priv->cutype == ICAL_CUTYPE_ROOM
+ || priv->cutype == ICAL_CUTYPE_RESOURCE)
+ return E_MEETING_ATTENDEE_RESOURCE;
-void
-e_meeting_attendee_set_atype (EMeetingAttendee *ia, EMeetingAttendeeType type)
-{
- EMeetingAttendeePrivate *priv;
+ if (priv->role == ICAL_ROLE_CHAIR
+ || priv->role == ICAL_ROLE_REQPARTICIPANT)
+ return E_MEETING_ATTENDEE_REQUIRED_PERSON;
- priv = ia->priv;
-
- priv->type = type;
+ return E_MEETING_ATTENDEE_OPTIONAL_PERSON;
}
-
static gint
compare_times (EMeetingTime *time1,
EMeetingTime *time2)
diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h
index 97de14f8e9..cf51a66171 100644
--- a/calendar/gui/e-meeting-attendee.h
+++ b/calendar/gui/e-meeting-attendee.h
@@ -119,7 +119,6 @@ void e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language);
gboolean e_meeting_attendee_is_set_language (EMeetingAttendee *ia);
EMeetingAttendeeType e_meeting_attendee_get_atype (EMeetingAttendee *ia);
-void e_meeting_attendee_set_atype (EMeetingAttendee *ia, EMeetingAttendeeType type);
gboolean e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia);
void e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info);
diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c
index 273a25672a..472c12ce4e 100644
--- a/calendar/gui/e-meeting-model.c
+++ b/calendar/gui/e-meeting-model.c
@@ -26,6 +26,10 @@
#endif
#include <glib.h>
+#include <liboaf/liboaf.h>
+#include <bonobo/bonobo-control.h>
+#include <bonobo/bonobo-widget.h>
+#include <bonobo/bonobo-exception.h>
#include <libgnome/gnome-defs.h>
#include <libgnome/gnome-i18n.h>
#include <libgnome/gnome-util.h>
@@ -38,14 +42,18 @@
#include <e-card-cursor.h>
#include <e-card.h>
#include <e-card-simple.h>
+#include <e-destination.h>
#include <cal-util/cal-component.h>
#include <cal-util/cal-util.h>
#include <cal-util/timeutil.h>
+#include "Evolution-Addressbook-SelectNames.h"
#include "calendar-config.h"
#include "itip-utils.h"
#include "e-meeting-attendee.h"
#include "e-meeting-model.h"
+#define SELECT_NAMES_OAFID "OAFIID:GNOME_Evolution_Addressbook_SelectNames"
+
enum columns {
ITIP_ADDRESS_COL,
ITIP_MEMBER_COL,
@@ -74,6 +82,9 @@ struct _EMeetingModelPrivate
GList *refresh_data;
gint refresh_count;
gboolean refreshing;
+
+ /* For invite others dialogs */
+ GNOME_Evolution_Addressbook_SelectNames corba_select_names;
};
#define BUF_SIZE 1024
@@ -99,10 +110,14 @@ static void init (EMeetingModel *model);
static void destroy (GtkObject *obj);
static void attendee_changed_cb (EMeetingAttendee *ia, gpointer data);
+static void invite_entry_changed_cb (BonoboListener *listener,
+ char *event_name,
+ CORBA_any *arg,
+ CORBA_Environment *ev,
+ gpointer data);
static ETableModelClass *parent_class = NULL;
-
GtkType
e_meeting_model_get_type (void)
{
@@ -1311,6 +1326,154 @@ e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, co
}
static void
+add_section (GNOME_Evolution_Addressbook_SelectNames corba_select_names, const char *name, int limit)
+{
+ CORBA_Environment ev;
+
+ CORBA_exception_init (&ev);
+
+ if (limit != 0)
+ GNOME_Evolution_Addressbook_SelectNames_addSectionWithLimit (corba_select_names,
+ name, name, limit, &ev);
+ else
+ GNOME_Evolution_Addressbook_SelectNames_addSection (corba_select_names,
+ name, name, &ev);
+
+ CORBA_exception_free (&ev);
+}
+
+static gboolean
+get_select_name_dialog (EMeetingModel *im)
+{
+ EMeetingModelPrivate *priv;
+ const char *sections[] = {_("Chair Persons"),
+ _("Required Participants"),
+ _("Optional Participants"),
+ _("Non-Participants")};
+ CORBA_Environment ev;
+
+ priv = im->priv;
+
+ if (priv->corba_select_names != CORBA_OBJECT_NIL) {
+ Bonobo_Control corba_control;
+ GtkWidget *control_widget;
+ int i;
+
+ CORBA_exception_init (&ev);
+ for (i = 0; i < 4; i++) {
+ corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (priv->corba_select_names, sections[i], &ev);
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
+
+ control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
+
+ bonobo_widget_set_property (BONOBO_WIDGET (control_widget), "text", "", NULL);
+ }
+ CORBA_exception_free (&ev);
+
+ return TRUE;
+ }
+
+ CORBA_exception_init (&ev);
+
+ priv->corba_select_names = oaf_activate_from_id (SELECT_NAMES_OAFID, 0, NULL, &ev);
+
+ add_section (priv->corba_select_names, sections[0], 0);
+ add_section (priv->corba_select_names, sections[1], 0);
+ add_section (priv->corba_select_names, sections[2], 0);
+ add_section (priv->corba_select_names, sections[3], 0);
+
+ bonobo_event_source_client_add_listener (priv->corba_select_names,
+ invite_entry_changed_cb,
+ "GNOME/Evolution:changed:model",
+ NULL, im);
+
+ if (BONOBO_EX (&ev)) {
+ CORBA_exception_free (&ev);
+ return FALSE;
+ }
+
+ CORBA_exception_free (&ev);
+
+ return TRUE;
+}
+
+void
+e_meeting_model_invite_others_dialog (EMeetingModel *im)
+{
+ EMeetingModelPrivate *priv;
+ CORBA_Environment ev;
+
+ priv = im->priv;
+
+ if (!get_select_name_dialog (im))
+ return;
+
+ CORBA_exception_init (&ev);
+
+ GNOME_Evolution_Addressbook_SelectNames_activateDialog (
+ priv->corba_select_names, _("Required Participants"), &ev);
+
+ CORBA_exception_free (&ev);
+}
+
+static void
+invite_entry_changed_cb (BonoboListener *listener,
+ char *event_name,
+ CORBA_any *arg,
+ CORBA_Environment *ev,
+ gpointer data)
+{
+ EMeetingModel *im = data;
+ EMeetingModelPrivate *priv;
+ Bonobo_Control corba_control;
+ GtkWidget *control_widget;
+ EDestination **destv;
+ char *string = NULL, *section;
+ int i;
+
+ priv = im->priv;
+
+ section = BONOBO_ARG_GET_STRING (arg);
+
+ g_message ("event: \"%s\", section \"%s\"", event_name, section);
+
+ corba_control = GNOME_Evolution_Addressbook_SelectNames_getEntryBySection (priv->corba_select_names, section, ev);
+ control_widget = bonobo_widget_new_control_from_objref (corba_control, CORBA_OBJECT_NIL);
+
+ bonobo_widget_get_property (BONOBO_WIDGET (control_widget), "destinations", &string, NULL);
+ destv = e_destination_importv (string);
+ if (destv == NULL)
+ return;
+
+ for (i = 0; destv[i] != NULL; i++) {
+ EMeetingAttendee *ia;
+ const char *name, *address;
+
+ name = e_destination_get_name (destv[i]);
+ address = e_destination_get_email (destv[i]);
+
+ if (e_meeting_model_find_attendee (im, address, NULL) == NULL) {
+ ia = e_meeting_model_add_attendee_with_defaults (im);
+
+ e_meeting_attendee_set_address (ia, g_strdup_printf ("MAILTO:%s", address));
+ if (!strcmp (section, _("Chair Persons")))
+ e_meeting_attendee_set_role (ia, ICAL_ROLE_CHAIR);
+ else if (!strcmp (section, _("Required Participants")))
+ e_meeting_attendee_set_role (ia, ICAL_ROLE_REQPARTICIPANT);
+ else if (!strcmp (section, _("Optional Participants")))
+ e_meeting_attendee_set_role (ia, ICAL_ROLE_OPTPARTICIPANT);
+ else if (!strcmp (section, _("Non-Participants")))
+ e_meeting_attendee_set_role (ia, ICAL_ROLE_NONPARTICIPANT);
+ e_meeting_attendee_set_cn (ia, g_strdup (name));
+ }
+ }
+ e_destination_freev (destv);
+}
+
+static void
attendee_changed_cb (EMeetingAttendee *ia, gpointer data)
{
EMeetingModel *im = E_MEETING_MODEL (data);
diff --git a/calendar/gui/e-meeting-model.h b/calendar/gui/e-meeting-model.h
index 2b90ea1d7b..13db3dda66 100644
--- a/calendar/gui/e-meeting-model.h
+++ b/calendar/gui/e-meeting-model.h
@@ -82,8 +82,11 @@ gint e_meeting_model_count_attendees (EMeetingModel *im);
const GPtrArray *e_meeting_model_get_attendees (EMeetingModel *im);
void e_meeting_model_refresh_busy_periods (EMeetingModel *im, EMeetingModelRefreshCallback call_back, gpointer data);
+/* Helpful functions */
ETableScrolled *e_meeting_model_etable_from_model (EMeetingModel *im, const gchar *spec_file, const gchar *state_file);
+void e_meeting_model_invite_others_dialog (EMeetingModel *im);
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c
index d90a0142c7..aba83f9cf8 100644
--- a/calendar/gui/e-meeting-time-sel.c
+++ b/calendar/gui/e-meeting-time-sel.c
@@ -1267,8 +1267,7 @@ static void
e_meeting_time_selector_on_invite_others_button_clicked (GtkWidget *button,
EMeetingTimeSelector *mts)
{
-
-
+ e_meeting_model_invite_others_dialog (mts->model);
}