aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2001-07-03 11:48:53 +0800
committerJP Rosevear <jpr@src.gnome.org>2001-07-03 11:48:53 +0800
commitd1d0712ae20f07a59d7c2270ae5b7c5e3f37969a (patch)
tree2dd037774e2a3c348ae9f346d7a6e2b06fb93f0e
parente981cabe35d8fde0254eb32ea9091b0dd62db830 (diff)
downloadgsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar.gz
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar.bz2
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar.lz
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar.xz
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.tar.zst
gsoc2013-evolution-d1d0712ae20f07a59d7c2270ae5b7c5e3f37969a.zip
publish free/busy information for the currently viewed time range
2001-07-02 JP Rosevear <jpr@ximian.com> * gui/calendar-commands.c (publish_freebusy_cmd): publish free/busy information for the currently viewed time range svn path=/trunk/; revision=10723
-rw-r--r--calendar/ChangeLog5
-rw-r--r--calendar/gui/calendar-commands.c22
-rw-r--r--calendar/gui/dialogs/meeting-page.c99
3 files changed, 118 insertions, 8 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog
index 30dfeae151..02d67a7add 100644
--- a/calendar/ChangeLog
+++ b/calendar/ChangeLog
@@ -1,3 +1,8 @@
+2001-07-02 JP Rosevear <jpr@ximian.com>
+
+ * gui/calendar-commands.c (publish_freebusy_cmd): publish
+ free/busy information for the currently viewed time range
+
2001-07-02 Christopher James Lahey <clahey@ximian.com>
* gui/Makefile.am (INCLUDES): Added $(BONOBO_CONF_CFLAGS).
diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c
index 44036d727b..055fdf211b 100644
--- a/calendar/gui/calendar-commands.c
+++ b/calendar/gui/calendar-commands.c
@@ -53,6 +53,7 @@
#include "goto.h"
#include "print.h"
#include "dialogs/cal-prefs-dialog.h"
+#include "itip-utils.h"
#include "evolution-shell-component-utils.h"
/* A list of all of the calendars started */
@@ -259,6 +260,7 @@ show_month_view_clicked (BonoboUIComponent *uic, gpointer data, const char *path
}
+
static void
new_calendar_cmd (BonoboUIComponent *uic, gpointer data, const char *path)
{
@@ -400,6 +402,24 @@ paste_event_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
set_normal_cursor (gcal);
}
+static void
+publish_freebusy_cmd (BonoboUIComponent *uic, gpointer data, const gchar *path)
+{
+ GnomeCalendar *gcal;
+ CalClient *client;
+ CalClientGetStatus status;
+ CalComponent *comp;
+ time_t start, end;
+
+ gcal = GNOME_CALENDAR (data);
+ gnome_calendar_get_current_time_range (gcal, &start, &end);
+
+ client = gnome_calendar_get_cal_client (gcal);
+ status = cal_client_get_free_busy (client, start, end, &comp);
+ if (status == CAL_CLIENT_GET_SUCCESS)
+ itip_send_comp (CAL_COMPONENT_METHOD_PUBLISH, comp);
+}
+
static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB ("CalendarNew", new_calendar_cmd),
@@ -415,6 +435,8 @@ static BonoboUIVerb verbs [] = {
BONOBO_UI_VERB ("CopyEvent", copy_event_cmd),
BONOBO_UI_VERB ("PasteEvent", paste_event_cmd),
+ BONOBO_UI_VERB ("PublishFreeBusy", publish_freebusy_cmd),
+
BONOBO_UI_VERB ("CalendarPrev", previous_clicked),
BONOBO_UI_VERB ("CalendarToday", today_clicked),
BONOBO_UI_VERB ("CalendarNext", next_clicked),
diff --git a/calendar/gui/dialogs/meeting-page.c b/calendar/gui/dialogs/meeting-page.c
index fddaab1900..2ef94bafff 100644
--- a/calendar/gui/dialogs/meeting-page.c
+++ b/calendar/gui/dialogs/meeting-page.c
@@ -52,18 +52,30 @@
"<ETableSpecification click-to-add=\"true\" " \
" _click-to-add-message=\"Click here to add an attendee\" " \
" draw-grid=\"true\">" \
- " <ETableColumn model_col= \"0\" _title=\"Attendee\" " \
+ " <ETableColumn model_col= \"0\" _title=\"Attendee\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
- " cell=\"string\" compare=\"string\"/>" \
- " <ETableColumn model_col= \"1\" _title=\"Role\" " \
+ " cell=\"string\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"1\" _title=\"Member\" " \
+ " expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
+ " cell=\"text\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"2\" _title=\"Type\" " \
+ " expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
+ " cell=\"typeedit\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"3\" _title=\"Role\" " \
" expansion=\"1.0\" minimum_width=\"10\" resizable=\"true\" " \
- " cell=\"roleedit\" compare=\"string\"/>" \
- " <ETableColumn model_col= \"2\" _title=\"RSVP\" " \
+ " cell=\"roleedit\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"4\" _title=\"RSVP\" " \
+ " expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
+ " cell=\"rsvpedit\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"5\" _title=\"Status\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
- " cell=\"rsvpedit\" compare=\"string\"/>" \
- " <ETableColumn model_col= \"3\" _title=\"Status\" " \
+ " cell=\"statusedit\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"6\" _title=\"Common Name\" " \
" expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
- " cell=\"statusedit\" compare=\"string\"/>" \
+ " cell=\"text\" compare=\"string\"/>" \
+ " <ETableColumn model_col= \"7\" _title=\"Language\" " \
+ " expansion=\"2.0\" minimum_width=\"10\" resizable=\"true\" " \
+ " cell=\"text\" compare=\"string\"/>" \
" <ETableState>" \
" <column source=\"0\"/>" \
" <column source=\"1\"/>" \
@@ -75,9 +87,13 @@
enum columns {
MEETING_ATTENDEE_COL,
+ MEETING_MEMBER_COL,
+ MEETING_TYPE_COL,
MEETING_ROLE_COL,
MEETING_RSVP_COL,
MEETING_STATUS_COL,
+ MEETING_CN_COL,
+ MEETING_LANG_COL,
MEETING_COLUMN_COUNT
};
@@ -518,6 +534,41 @@ init_widgets (MeetingPage *mpage)
GTK_SIGNAL_FUNC (invite_cb), mpage);
}
+static CalComponentCUType
+text_to_type (const char *type)
+{
+ if (!g_strcasecmp (type, "Individual"))
+ return CAL_COMPONENT_CUTYPE_INDIVIDUAL;
+ else if (!g_strcasecmp (type, "Group"))
+ return CAL_COMPONENT_CUTYPE_GROUP;
+ else if (!g_strcasecmp (type, "Resource"))
+ return CAL_COMPONENT_CUTYPE_RESOURCE;
+ else if (!g_strcasecmp (type, "Room"))
+ return CAL_COMPONENT_CUTYPE_ROOM;
+ else
+ return CAL_COMPONENT_ROLE_UNKNOWN;
+}
+
+static char *
+type_to_text (CalComponentCUType type)
+{
+ switch (type) {
+ case CAL_COMPONENT_CUTYPE_INDIVIDUAL:
+ return "Individual";
+ case CAL_COMPONENT_CUTYPE_GROUP:
+ return "Group";
+ case CAL_COMPONENT_CUTYPE_RESOURCE:
+ return "Resource";
+ case CAL_COMPONENT_CUTYPE_ROOM:
+ return "Room";
+ default:
+ return "Unknown";
+ }
+
+ return NULL;
+
+}
+
static CalComponentRole
text_to_role (const char *role)
{
@@ -649,9 +700,13 @@ append_row (ETableModel *etm, ETableModel *model, int row, void *data)
attendee = g_new0 (struct attendee, 1);
attendee->address = g_strdup (e_table_model_value_at (model, MEETING_ATTENDEE_COL, row));
+ attendee->member = g_strdup (e_table_model_value_at (model, MEETING_MEMBER_COL, row));
+ attendee->cutype = text_to_type (e_table_model_value_at (model, MEETING_TYPE_COL, row));
attendee->role = text_to_role (e_table_model_value_at (model, MEETING_ROLE_COL, row));
attendee->rsvp = text_to_boolean (e_table_model_value_at (model, MEETING_RSVP_COL, row));
attendee->status = text_to_partstat (e_table_model_value_at (model, MEETING_STATUS_COL, row));
+ attendee->cn = g_strdup (e_table_model_value_at (model, MEETING_CN_COL, row));
+ attendee->language = g_strdup (e_table_model_value_at (model, MEETING_LANG_COL, row));
priv->attendees = g_slist_append (priv->attendees, attendee);
@@ -677,12 +732,20 @@ value_at (ETableModel *etm, int col, int row, void *data)
switch (col) {
case MEETING_ATTENDEE_COL:
return attendee->address;
+ case MEETING_MEMBER_COL:
+ return attendee->member;
+ case MEETING_TYPE_COL:
+ return type_to_text (attendee->cutype);
case MEETING_ROLE_COL:
return role_to_text (attendee->role);
case MEETING_RSVP_COL:
return boolean_to_text (attendee->rsvp);
case MEETING_STATUS_COL:
return partstat_to_text (attendee->status);
+ case MEETING_CN_COL:
+ return attendee->cn;
+ case MEETING_LANG_COL:
+ return attendee->language;
}
return NULL;
@@ -704,6 +767,12 @@ set_value_at (ETableModel *etm, int col, int row, const void *val, void *data)
case MEETING_ATTENDEE_COL:
attendee->address = g_strdup (val);
break;
+ case MEETING_MEMBER_COL:
+ attendee->member = g_strdup (val);
+ break;
+ case MEETING_TYPE_COL:
+ attendee->cutype = text_to_type (val);
+ break;
case MEETING_ROLE_COL:
attendee->role = text_to_role (val);
break;
@@ -713,6 +782,12 @@ set_value_at (ETableModel *etm, int col, int row, const void *val, void *data)
case MEETING_STATUS_COL:
attendee->status = text_to_partstat (val);
break;
+ case MEETING_CN_COL:
+ attendee->cn = g_strdup (val);
+ break;
+ case MEETING_LANG_COL:
+ attendee->language = g_strdup (val);
+ break;
}
if (!priv->updating) {
@@ -745,12 +820,20 @@ init_value (ETableModel *etm, int col, void *data)
switch (col) {
case MEETING_ATTENDEE_COL:
return g_strdup ("");
+ case MEETING_MEMBER_COL:
+ return g_strdup ("");
+ case MEETING_TYPE_COL:
+ return g_strdup ("Individual");
case MEETING_ROLE_COL:
return g_strdup ("Required Participant");
case MEETING_RSVP_COL:
return g_strdup ("Yes");
case MEETING_STATUS_COL:
return g_strdup ("Needs Action");
+ case MEETING_CN_COL:
+ return g_strdup ("");
+ case MEETING_LANG_COL:
+ return g_strdup ("English");
}
return g_strdup ("");