aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs
diff options
context:
space:
mode:
authorDan Winship <danw@src.gnome.org>2002-09-28 04:23:20 +0800
committerDan Winship <danw@src.gnome.org>2002-09-28 04:23:20 +0800
commitfc2c499f8bc737190309484a96e13dccd3cefbdf (patch)
tree00a346afe0e783978d6c684ebabc7de25eff9fe8 /calendar/gui/dialogs
parent7ed66fac42704097175f778660e391e86cc6d55d (diff)
downloadgsoc2013-evolution-fc2c499f8bc737190309484a96e13dccd3cefbdf.tar.gz
gsoc2013-evolution-fc2c499f8bc737190309484a96e13dccd3cefbdf.tar.zst
gsoc2013-evolution-fc2c499f8bc737190309484a96e13dccd3cefbdf.zip
Non-Connector part of #29334 (meeting created by a delegate in the
delegator's calendar should have the delegator as Organizer). * idl/evolution-calendar.idl: add Cal_getEmailAddress, to return the email address associated with a backend (if any). * pcs/cal-backend.c (cal_backend_get_email_address): New. * pcs/cal-backend-file.c (cal_backend_file_get_email_address): Return NULL (for now). * pcs/cal.c (impl_Cal_get_email_address): Implement this by calling cal_backend_get_email_address and returning a NotFound exception if it returns NULL. * cal-client/cal-client.c (cal_client_get_email_address): New. (cal_client_init, cal_client_destroy, etc): initialize/free email_address * gui/dialogs/event-editor.c (event_editor_construct): Split this out of event_editor_init. Take and set a CalClient. (event_editor_new): Take a CalClient. * gui/dialogs/task-editor.c (task_editor_construct, task_editor_new): Likewise. * gui/dialogs/meeting-page.c (meeting_page_new, meeting_page_construct): Take a CalClient and call cal_client_get_email_address to find the default organizer address. (Also fix a bug if the default account's name has non-ASCII characters.) * gui/itip-utils.c (comp_from): New. When sending a REQUEST or CANCEL, use the Organizer as the From address. (itip_send_comp): Call comp_from and pass the result to Composer_setHeaders. * gui/comp-editor-factory.c (edit_existing, edit_new): Pass the CalClient to event_editor_new/task_editor_new * gui/e-calendar-table.c (open_task): Likewise. * gui/e-tasks.c (e_tasks_new_task): Likewise. * gui/gnome-cal.c (gnome_calendar_edit_object, gnome_calendar_new_task): Likewise. svn path=/trunk/; revision=18253
Diffstat (limited to 'calendar/gui/dialogs')
-rw-r--r--calendar/gui/dialogs/event-editor.c31
-rw-r--r--calendar/gui/dialogs/event-editor.h5
-rw-r--r--calendar/gui/dialogs/meeting-page.c20
-rw-r--r--calendar/gui/dialogs/meeting-page.h6
-rw-r--r--calendar/gui/dialogs/task-editor.c32
-rw-r--r--calendar/gui/dialogs/task-editor.h5
6 files changed, 72 insertions, 27 deletions
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index 20b91475d4..4ee2556d97 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -188,6 +188,18 @@ event_editor_init (EventEditor *ee)
priv = g_new0 (EventEditorPrivate, 1);
ee->priv = priv;
+ priv->model = E_MEETING_MODEL (e_meeting_model_new ());
+ priv->meeting_shown = TRUE;
+ priv->updating = FALSE;
+}
+
+EventEditor *
+event_editor_construct (EventEditor *ee, CalClient *client)
+{
+ EventEditorPrivate *priv;
+
+ priv = ee->priv;
+
priv->event_page = event_page_new ();
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->event_page),
@@ -203,25 +215,24 @@ event_editor_init (EventEditor *ee)
COMP_EDITOR_PAGE (priv->recur_page),
_("Recurrence"));
- priv->model = E_MEETING_MODEL (e_meeting_model_new ());
-
priv->sched_page = schedule_page_new (priv->model);
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->sched_page),
_("Scheduling"));
- priv->meet_page = meeting_page_new (priv->model);
+ priv->meet_page = meeting_page_new (priv->model, client);
comp_editor_append_page (COMP_EDITOR (ee),
COMP_EDITOR_PAGE (priv->meet_page),
_("Meeting"));
- comp_editor_merge_ui (COMP_EDITOR (ee), "evolution-event-editor.xml", verbs, pixmaps);
+ comp_editor_set_cal_client (COMP_EDITOR (ee), client);
- priv->meeting_shown = TRUE;
- priv->updating = FALSE;
+ comp_editor_merge_ui (COMP_EDITOR (ee), "evolution-event-editor.xml", verbs, pixmaps);
init_widgets (ee);
set_menu_sens (ee);
+
+ return ee;
}
static void
@@ -382,6 +393,7 @@ event_editor_destroy (GtkObject *object)
/**
* event_editor_new:
+ * @client: a CalClient
*
* Creates a new event editor dialog.
*
@@ -389,9 +401,12 @@ event_editor_destroy (GtkObject *object)
* editor could not be created.
**/
EventEditor *
-event_editor_new (void)
+event_editor_new (CalClient *client)
{
- return EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR));
+ EventEditor *ee;
+
+ ee = EVENT_EDITOR (gtk_type_new (TYPE_EVENT_EDITOR));
+ return event_editor_construct (ee, client);
}
static void
diff --git a/calendar/gui/dialogs/event-editor.h b/calendar/gui/dialogs/event-editor.h
index d27bb8e52d..1b6f72829a 100644
--- a/calendar/gui/dialogs/event-editor.h
+++ b/calendar/gui/dialogs/event-editor.h
@@ -52,8 +52,9 @@ struct _EventEditorClass {
};
GtkType event_editor_get_type (void);
-EventEditor *event_editor_construct (EventEditor *ee);
-EventEditor *event_editor_new (void);
+EventEditor *event_editor_construct (EventEditor *ee,
+ CalClient *client);
+EventEditor *event_editor_new (CalClient *client);
void event_editor_show_meeting (EventEditor *ee);
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index 011f1301af..44ff76eb08 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -733,11 +733,13 @@ table_canvas_focus_out_cb (GtkWidget *widget, GdkEventFocus *event, gpointer dat
* be created.
**/
MeetingPage *
-meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm)
+meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm,
+ CalClient *client)
{
MeetingPagePrivate *priv;
ETable *real_table;
gchar *filename;
+ const char *backend_address;
GList *l;
priv = mpage->priv;
@@ -757,6 +759,8 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm)
}
/* Address information */
+ backend_address = cal_client_get_email_address (client);
+
priv->addresses = itip_addresses_get ();
for (l = priv->addresses; l != NULL; l = l->next) {
ItipAddress *a = l->data;
@@ -764,8 +768,14 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm)
s = e_utf8_to_gtk_string (GTK_COMBO (priv->organizer)->entry, a->full);
priv->address_strings = g_list_append (priv->address_strings, s);
- if (a->default_address)
- priv->default_address = s;
+
+ /* Note that the address specified by the backend gets
+ * precedence over the default mail address.
+ */
+ if (backend_address && !strcmp (backend_address, a->address))
+ priv->default_address = a->full;
+ else if (a->default_address && !priv->default_address)
+ priv->default_address = a->full;
}
/* The etable displaying attendees and their status */
@@ -803,12 +813,12 @@ meeting_page_construct (MeetingPage *mpage, EMeetingModel *emm)
* not be created.
**/
MeetingPage *
-meeting_page_new (EMeetingModel *emm)
+meeting_page_new (EMeetingModel *emm, CalClient *client)
{
MeetingPage *mpage;
mpage = gtk_type_new (TYPE_MEETING_PAGE);
- if (!meeting_page_construct (mpage, emm)) {
+ if (!meeting_page_construct (mpage, emm, client)) {
gtk_object_unref (GTK_OBJECT (mpage));
return NULL;
}
diff --git a/calendar/gui/dialogs/meeting-page.h b/calendar/gui/dialogs/meeting-page.h
index b7c8571b44..be55aecf98 100644
--- a/calendar/gui/dialogs/meeting-page.h
+++ b/calendar/gui/dialogs/meeting-page.h
@@ -53,8 +53,10 @@ typedef struct {
GtkType meeting_page_get_type (void);
MeetingPage *meeting_page_construct (MeetingPage *mpage,
- EMeetingModel *emm);
-MeetingPage *meeting_page_new (EMeetingModel *emm);
+ EMeetingModel *emm,
+ CalClient *client);
+MeetingPage *meeting_page_new (EMeetingModel *emm,
+ CalClient *client);
CalComponent *meeting_page_get_cancel_comp (MeetingPage *mpage);
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 6261b8deda..e3c55ffe29 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -176,6 +176,19 @@ task_editor_init (TaskEditor *te)
priv = g_new0 (TaskEditorPrivate, 1);
te->priv = priv;
+ priv->model = E_MEETING_MODEL (e_meeting_model_new ());
+ priv->assignment_shown = TRUE;
+ priv->updating = FALSE;
+
+}
+
+TaskEditor *
+task_editor_construct (TaskEditor *te, CalClient *client)
+{
+ TaskEditorPrivate *priv;
+
+ priv = te->priv;
+
priv->task_page = task_page_new ();
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_page),
@@ -186,20 +199,19 @@ task_editor_init (TaskEditor *te)
COMP_EDITOR_PAGE (priv->task_details_page),
_("Details"));
- priv->model = E_MEETING_MODEL (e_meeting_model_new ());
-
- priv->meet_page = meeting_page_new (priv->model);
+ priv->meet_page = meeting_page_new (priv->model, client);
comp_editor_append_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->meet_page),
_("Assignment"));
- comp_editor_merge_ui (COMP_EDITOR (te), "evolution-task-editor.xml", verbs, NULL);
+ comp_editor_set_cal_client (COMP_EDITOR (te), client);
- priv->assignment_shown = TRUE;
- priv->updating = FALSE;
+ comp_editor_merge_ui (COMP_EDITOR (te), "evolution-task-editor.xml", verbs, NULL);
init_widgets (te);
set_menu_sens (te);
+
+ return te;
}
static void
@@ -334,6 +346,7 @@ task_editor_destroy (GtkObject *object)
/**
* task_editor_new:
+ * @client: a CalClient
*
* Creates a new event editor dialog.
*
@@ -341,9 +354,12 @@ task_editor_destroy (GtkObject *object)
* editor could not be created.
**/
TaskEditor *
-task_editor_new (void)
+task_editor_new (CalClient *client)
{
- return TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
+ TaskEditor *te;
+
+ te = TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
+ return task_editor_construct (te, client);
}
static void
diff --git a/calendar/gui/dialogs/task-editor.h b/calendar/gui/dialogs/task-editor.h
index e9888f446a..070546bee0 100644
--- a/calendar/gui/dialogs/task-editor.h
+++ b/calendar/gui/dialogs/task-editor.h
@@ -53,8 +53,9 @@ struct _TaskEditorClass {
};
GtkType task_editor_get_type (void);
-TaskEditor *task_editor_construct (TaskEditor *te);
-TaskEditor *task_editor_new (void);
+TaskEditor *task_editor_construct (TaskEditor *te,
+ CalClient *client);
+TaskEditor *task_editor_new (CalClient *client);
void task_editor_show_assignment(TaskEditor *te);