implement

2001-07-02  JP Rosevear  <jpr@ximian.com>

	* gui/e-itip-control.c (send_freebusy): implement

	* cal-util/cal-component.c (set_attendee_list): add the delto
	property rather than the delfrom property twice

	* gui/dialogs/task-editor.c (task_editor_edit_comp): show
	delegation info if appropriate
	(delegate_task_cmd): delegate command
	(cancel_task_cmd): cancel command
	(refresh_task_cmd): refresh command

	* gui/dialogs/task-details-page.c: Load new widgets
	(task_details_page_show_delegation): show/hide delegation info widgets

	* gui/dialogs/task-details-page.h: new proto

	* gui/dialogs/event-editor.c (event_editor_edit_comp): free
	attendee list when finished

	* gui/dialogs/comp-editor.c (setup_widgets): explicitly show the
	widgets, update pixmaps after the verbs have been added
	(comp_editor_focus): don't do a show all

svn path=/trunk/; revision=10697
This commit is contained in:
JP Rosevear
2001-07-02 19:21:49 +00:00
committed by JP Rosevear
parent e28ff48d57
commit b4e780fd75
10 changed files with 400 additions and 35 deletions

View File

@ -1,4 +1,29 @@
2001-06-30 Federico Mena Quintero <federico@ximian.com>
2001-07-02 JP Rosevear <jpr@ximian.com>
* gui/e-itip-control.c (send_freebusy): implement
* cal-util/cal-component.c (set_attendee_list): add the delto
property rather than the delfrom property twice
* gui/dialogs/task-editor.c (task_editor_edit_comp): show
delegation info if appropriate
(delegate_task_cmd): delegate command
(cancel_task_cmd): cancel command
(refresh_task_cmd): refresh command
* gui/dialogs/task-details-page.c: Load new widgets
(task_details_page_show_delegation): show/hide delegation info widgets
* gui/dialogs/task-details-page.h: new proto
* gui/dialogs/event-editor.c (event_editor_edit_comp): free
attendee list when finished
* gui/dialogs/comp-editor.c (setup_widgets): explicitly show the
widgets, update pixmaps after the verbs have been added
(comp_editor_focus): don't do a show all
2001-07-02 Federico Mena Quintero <federico@ximian.com>
Fixes bug #1406.

View File

@ -3727,7 +3727,7 @@ set_attendee_list (CalComponent *comp,
}
if (a->delto) {
attendee->delto_param = icalparameter_new_delegatedto (a->delto);
icalproperty_add_parameter (attendee->prop, attendee->delfrom_param);
icalproperty_add_parameter (attendee->prop, attendee->delto_param);
}
if (a->sentby) {
attendee->sentby_param = icalparameter_new_sentby (a->sentby);

View File

@ -104,8 +104,8 @@ static EPixmap pixmaps [] =
E_PIXMAP ("/menu/File/FilePrint", "print.xpm"),
E_PIXMAP ("/menu/File/FilePrintPreview", "print-preview.xpm"),
E_PIXMAP ("/Toolbar/Print", "print.xpm"),
E_PIXMAP ("/Toolbar/Print Preview", "print-preview.xpm"),
E_PIXMAP ("/Toolbar/FilePrint", "print.xpm"),
E_PIXMAP ("/Toolbar/FilePrintPreview", "print-preview.xpm"),
E_PIXMAP_END
};
@ -188,18 +188,20 @@ setup_widgets (CompEditor *editor)
bonobo_ui_component_set_container (priv->uic, BONOBO_OBJREF (container));
bonobo_ui_engine_config_set_path (bonobo_window_get_ui_engine (BONOBO_WINDOW (priv->window)),
"/evolution/UIConf/kvps");
e_pixmaps_update (priv->uic, pixmaps);
bonobo_ui_component_add_verb_list_with_data (priv->uic, verbs, editor);
bonobo_ui_util_set_ui (priv->uic, EVOLUTION_DATADIR "/gnome/gui",
"evolution-comp-editor.xml", "evolution-calendar");
e_pixmaps_update (priv->uic, pixmaps);
vbox = gtk_vbox_new (FALSE, GNOME_PAD_SMALL);
gtk_widget_show (vbox);
gtk_container_set_border_width (GTK_CONTAINER (vbox), GNOME_PAD_SMALL);
bonobo_window_set_contents (BONOBO_WINDOW (priv->window), vbox);
/* Notebook */
priv->notebook = GTK_NOTEBOOK (gtk_notebook_new ());
gtk_widget_show (priv->notebook);
gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->notebook),
TRUE, TRUE, 0);
}
@ -297,7 +299,6 @@ comp_editor_append_page (CompEditor *editor,
GTK_SIGNAL_FUNC (page_summary_changed_cb), editor);
gtk_signal_connect (GTK_OBJECT (page), "dates_changed",
GTK_SIGNAL_FUNC (page_dates_changed_cb), editor);
}
/**
@ -643,7 +644,7 @@ comp_editor_focus (CompEditor *editor)
priv = editor->priv;
gtk_widget_show_all (priv->window);
gtk_widget_show (priv->window);
raise_and_focus (priv->window);
}

View File

@ -172,6 +172,7 @@ event_editor_edit_comp (CompEditor *editor, CalComponent *comp)
comp_editor_remove_page (editor, COMP_EDITOR_PAGE (priv->meet_page));
priv->meeting_shown = FALSE;
}
cal_component_free_attendee_list (attendees);
if (parent_class->edit_comp)
parent_class->edit_comp (editor, comp);

View File

@ -54,6 +54,13 @@ struct _TaskDetailsPagePrivate {
GtkWidget *url;
GtkWidget *organizer;
GtkWidget *organizer_lbl;
GtkWidget *delegated_to;
GtkWidget *delegated_to_lbl;
GtkWidget *delegated_from;
GtkWidget *delegated_from_lbl;
gboolean updating;
};
@ -215,7 +222,9 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
GSList *list;
CalComponentText text;
CalComponentOrganizer organizer;
const char *url;
CompEditorPageDates dates;
@ -239,6 +248,23 @@ task_details_page_fill_widgets (CompEditorPage *page, CalComponent *comp)
cal_component_get_url (comp, &url);
e_dialog_editable_set (priv->url, url);
/* Delegation */
cal_component_get_organizer (comp, &organizer);
if (organizer.value)
e_dialog_editable_set (priv->organizer, organizer.value);
cal_component_get_attendee_list (comp, &list);
if (list != NULL) {
CalComponentAttendee *attendee;
attendee = list->data;
if (attendee->delto)
e_dialog_editable_set (priv->delegated_to, attendee->delto);
if (attendee->delfrom)
e_dialog_editable_set (priv->delegated_from, attendee->delfrom);
}
cal_component_free_attendee_list (list);
priv->updating = FALSE;
}
@ -248,7 +274,10 @@ task_details_page_fill_component (CompEditorPage *page, CalComponent *comp)
{
TaskDetailsPage *tdpage;
TaskDetailsPagePrivate *priv;
GSList list;
CalComponentDateTime date;
CalComponentOrganizer organizer;
CalComponentAttendee attendee;
time_t t;
char *url;
@ -274,6 +303,31 @@ task_details_page_fill_component (CompEditorPage *page, CalComponent *comp)
cal_component_set_url (comp, url);
if (url)
g_free (url);
/* Delegation */
organizer.value = e_dialog_editable_get (priv->organizer);
organizer.sentby = NULL;
organizer.cn = NULL;
organizer.language = NULL;
cal_component_set_organizer (comp, &organizer);
attendee.value = e_dialog_editable_get (priv->delegated_to);
attendee.member = NULL;
attendee.cutype = CAL_COMPONENT_CUTYPE_INDIVIDUAL;
attendee.role = CAL_COMPONENT_ROLE_REQUIRED;
attendee.status = CAL_COMPONENT_PARTSTAT_NEEDSACTION;
attendee.rsvp = TRUE;
attendee.delto = e_dialog_editable_get (priv->delegated_to);
attendee.delfrom = NULL;
attendee.sentby = NULL;
attendee.cn = NULL;
attendee.language = NULL;
list.data = &attendee;
list.next = NULL;
cal_component_set_attendee_list (comp, &list);
g_free ((char *)organizer.value);
g_free ((char *)attendee.value);
g_free ((char *)attendee.delto);
g_free ((char *)attendee.delfrom);
}
/* set_summary handler for the task page */
@ -334,13 +388,26 @@ get_widgets (TaskDetailsPage *tdpage)
priv->url = GW ("url");
priv->organizer = GW ("organizer");
priv->organizer_lbl = GW ("organizer-label");
priv->delegated_to = GW ("delegated-to");
priv->delegated_to_lbl = GW ("delegated-to-label");
priv->delegated_from = GW ("delegated-from");
priv->delegated_from_lbl = GW ("delegated-from-label");
#undef GW
return (priv->summary
&& priv->date_time
&& priv->completed_date
&& priv->completed_timezone
&& priv->url);
&& priv->url
&& priv->organizer
&& priv->organizer_lbl
&& priv->delegated_to
&& priv->delegated_to_lbl
&& priv->delegated_from
&& priv->delegated_from_lbl);
}
/* Callback used when the start or end date widgets change. We check that the
@ -400,6 +467,14 @@ init_widgets (TaskDetailsPage *tdpage)
/* URL */
gtk_signal_connect (GTK_OBJECT (priv->url), "changed",
GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
/* Delegation */
gtk_signal_connect (GTK_OBJECT (priv->organizer), "changed",
GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
gtk_signal_connect (GTK_OBJECT (priv->delegated_to), "changed",
GTK_SIGNAL_FUNC (field_changed_cb), tdpage);
}
@ -461,6 +536,33 @@ task_details_page_new (void)
return tdpage;
}
void
task_details_page_show_delegation (TaskDetailsPage *tdpage, gboolean show)
{
TaskDetailsPagePrivate *priv;
priv = tdpage->priv;
if (show) {
gtk_widget_show (priv->organizer);
gtk_widget_show (priv->organizer_lbl);
gtk_widget_show (priv->delegated_to);
gtk_widget_show (priv->delegated_to_lbl);
gtk_widget_show (priv->delegated_from);
gtk_widget_show (priv->delegated_from_lbl);
comp_editor_page_notify_needs_send (COMP_EDITOR_PAGE (tdpage));
} else {
gtk_widget_hide (priv->organizer);
gtk_widget_hide (priv->organizer_lbl);
gtk_widget_hide (priv->delegated_to);
gtk_widget_hide (priv->delegated_to_lbl);
gtk_widget_hide (priv->delegated_from);
gtk_widget_hide (priv->delegated_from_lbl);
}
// gtk_widget_queue_draw (priv->main);
}
GtkWidget *task_details_page_create_date_edit (void);
GtkWidget *

View File

@ -163,7 +163,7 @@
<class>GtkTable</class>
<name>table1</name>
<border_width>4</border_width>
<rows>2</rows>
<rows>5</rows>
<columns>2</columns>
<homogeneous>False</homogeneous>
<row_spacing>2</row_spacing>
@ -174,6 +174,130 @@
<fill>True</fill>
</child>
<widget>
<class>GtkEntry</class>
<name>url</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>delegated-to</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkEntry</class>
<name>organizer</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>delegated-from-label</name>
<label>Delegated By:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>delegated-to-label</name>
<label>Delegated To:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>2</top_attach>
<bottom_attach>3</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>label12</name>
@ -187,8 +311,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -213,8 +337,8 @@
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>1</top_attach>
<bottom_attach>2</bottom_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
@ -227,13 +351,41 @@
</widget>
<widget>
<class>GtkEntry</class>
<name>url</name>
<can_focus>True</can_focus>
<editable>True</editable>
<text_visible>True</text_visible>
<text_max_length>0</text_max_length>
<text></text>
<class>GtkLabel</class>
<name>organizer-label</name>
<label>Organizer:</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget>
<class>GtkLabel</class>
<name>delegated-from</name>
<label>No one</label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>0</xalign>
<yalign>0.5</yalign>
<xpad>0</xpad>
<ypad>0</ypad>
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
@ -241,7 +393,7 @@
<bottom_attach>2</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>True</xexpand>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
@ -258,8 +410,8 @@
<child>
<left_attach>1</left_attach>
<right_attach>2</right_attach>
<top_attach>0</top_attach>
<bottom_attach>1</bottom_attach>
<top_attach>3</top_attach>
<bottom_attach>4</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>

View File

@ -51,9 +51,11 @@ typedef struct {
} TaskDetailsPageClass;
GtkType task_details_page_get_type (void);
TaskDetailsPage *task_details_page_construct (TaskDetailsPage *tdpage);
TaskDetailsPage *task_details_page_new (void);
GtkType task_details_page_get_type (void);
TaskDetailsPage *task_details_page_construct (TaskDetailsPage *tdpage);
TaskDetailsPage *task_details_page_new (void);
void task_details_page_show_delegation (TaskDetailsPage *tdpage,
gboolean show);

View File

@ -1,6 +1,5 @@
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/* Evolution calendar - Event editor dialog
/* Evolution calendar - Task editor dialog
*
* Copyright (C) 2000 Ximian, Inc.
* Copyright (C) 2001 Ximian, Inc.
@ -8,6 +7,7 @@
* Authors: Miguel de Icaza <miguel@ximian.com>
* Federico Mena-Quintero <federico@ximian.com>
* Seth Alves <alves@hungry.com>
* JP Rosevear <jpr@ximian.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -33,6 +33,7 @@
#include "task-page.h"
#include "task-details-page.h"
#include "recurrence-page.h"
#include "cancel-comp.h"
#include "task-editor.h"
struct _TaskEditorPrivate {
@ -44,17 +45,24 @@ struct _TaskEditorPrivate {
static void task_editor_class_init (TaskEditorClass *class);
static void task_editor_init (TaskEditor *te);
static void task_editor_edit_comp (CompEditor *editor, CalComponent *comp);
static void task_editor_destroy (GtkObject *object);
static void delegate_task_cmd (GtkWidget *widget, gpointer data);
static void refresh_task_cmd (GtkWidget *widget, gpointer data);
static void cancel_task_cmd (GtkWidget *widget, gpointer data);
static void forward_cmd (GtkWidget *widget, gpointer data);
static BonoboUIVerb verbs [] = {
BONOBO_UI_UNSAFE_VERB ("ActionDelegateTask", delegate_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionRefreshTask", refresh_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionCancelTask", cancel_task_cmd),
BONOBO_UI_UNSAFE_VERB ("ActionForward", forward_cmd),
BONOBO_UI_VERB_END
};
static CompEditor *parent_class;
static CompEditorClass *parent_class;
@ -92,14 +100,18 @@ task_editor_get_type (void)
/* Class initialization function for the event editor */
static void
task_editor_class_init (TaskEditorClass *class)
task_editor_class_init (TaskEditorClass *klass)
{
GtkObjectClass *object_class;
CompEditorClass *editor_class;
object_class = (GtkObjectClass *) class;
object_class = (GtkObjectClass *) klass;
editor_class = (CompEditorClass *) klass;
parent_class = gtk_type_class (TYPE_COMP_EDITOR);
editor_class->edit_comp = task_editor_edit_comp;
object_class->destroy = task_editor_destroy;
}
@ -127,6 +139,27 @@ task_editor_init (TaskEditor *te)
verbs);
}
static void
task_editor_edit_comp (CompEditor *editor, CalComponent *comp)
{
TaskEditor *te;
TaskEditorPrivate *priv;
GSList *attendees = NULL;
te = TASK_EDITOR (editor);
priv = te->priv;
cal_component_get_attendee_list (comp, &attendees);
if (attendees == NULL)
task_details_page_show_delegation (priv->task_details_page, FALSE);
else
task_details_page_show_delegation (priv->task_details_page, TRUE);
cal_component_free_attendee_list (attendees);
if (parent_class->edit_comp)
parent_class->edit_comp (editor, comp);
}
/* Destroy handler for the event editor */
static void
task_editor_destroy (GtkObject *object)
@ -158,6 +191,40 @@ task_editor_new (void)
return TASK_EDITOR (gtk_type_new (TYPE_TASK_EDITOR));
}
static void
delegate_task_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
TaskEditorPrivate *priv;
priv = te->priv;
task_details_page_show_delegation (priv->task_details_page, TRUE);
comp_editor_show_page (COMP_EDITOR (te),
COMP_EDITOR_PAGE (priv->task_details_page));
}
static void
refresh_task_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_REFRESH);
}
static void
cancel_task_cmd (GtkWidget *widget, gpointer data)
{
TaskEditor *te = TASK_EDITOR (data);
CalComponent *comp;
comp = comp_editor_get_current_comp (COMP_EDITOR (te));
if (cancel_component_dialog (comp)) {
comp_editor_send_comp (COMP_EDITOR (te), CAL_COMPONENT_METHOD_CANCEL);
comp_editor_delete_comp (COMP_EDITOR (te));
}
}
static void
forward_cmd (GtkWidget *widget, gpointer data)
{

View File

@ -895,8 +895,23 @@ remove_item (EItipControl *itip)
}
static void
send_freebusy (void)
send_freebusy (EItipControl *itip)
{
EItipControlPrivate *priv;
CalComponent *comp;
CalComponentDateTime datetime;
CalClientGetStatus status;
time_t start, end;
priv = itip->priv;
cal_component_get_dtstart (priv->comp, &datetime);
start = icaltime_as_timet (*datetime.value);
cal_component_get_dtend (priv->comp, &datetime);
end = icaltime_as_timet (*datetime.value);
status = cal_client_get_free_busy (priv->event_client, start, end, &comp);
if (status == CAL_CLIENT_GET_SUCCESS)
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp);
}
static void
@ -983,7 +998,7 @@ ok_clicked_cb (GtkWidget *widget, gpointer data)
itip_send_comp (CAL_COMPONENT_METHOD_REPLY, priv->comp);
} else if (priv->map == request_fb_map) {
send_freebusy ();
send_freebusy (itip);
} else if (priv->map == reply_map) {
update_item (itip);

View File

@ -204,8 +204,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *comp)
description = CORBA_string_dup (tempstr);
show_inline = FALSE;
/* I need to create an encapsulating iCalendar component, and stuff our vEvent
into it. */
/* Need to create an encapsulating iCalendar component, and
stuff our component into it. */
{
icalcomponent *icomp, *clone;
icalproperty *prop;