aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-11-24 13:14:44 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-11-24 13:14:44 +0800
commit4f4615a46d5ba518c1e6a0c2412b1edf1e268d99 (patch)
tree828acaa7b76aa12a490a3238b0ec4a7086b8be16 /calendar/gui
parent076b7c45131482b87d18963d34d035435491ee8d (diff)
downloadgsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.gz
gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.tar.zst
gsoc2013-evolution-4f4615a46d5ba518c1e6a0c2412b1edf1e268d99.zip
Merge revisions 36737:36810 from trunk.
svn path=/branches/kill-bonobo/; revision=36811
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.c28
-rw-r--r--calendar/gui/alarm-notify/alarm-notify-dialog.h3
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.glade144
-rw-r--r--calendar/gui/alarm-notify/alarm-queue.c9
-rw-r--r--calendar/gui/calendar-component.h1
-rw-r--r--calendar/gui/dialogs/comp-editor.c4
-rw-r--r--calendar/gui/e-calendar-table.c10
-rw-r--r--calendar/gui/e-calendar-view.c89
-rw-r--r--calendar/gui/e-calendar-view.h1
-rw-r--r--calendar/gui/e-day-view.c35
-rw-r--r--calendar/gui/e-week-view.c28
-rw-r--r--calendar/gui/gnome-cal.c41
-rw-r--r--calendar/gui/memos-component.c50
-rw-r--r--calendar/gui/print.c2
-rw-r--r--calendar/gui/tasks-component.c63
15 files changed, 386 insertions, 122 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c
index 61eea70f52..ee09c0dde4 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c
@@ -67,6 +67,7 @@ typedef struct {
GtkWidget *snooze_time_min;
GtkWidget *snooze_time_hrs;
GtkWidget *snooze_btn;
+ GtkWidget *dismiss_btn;
GtkWidget *minutes_label;
GtkWidget *hrs_label;
GtkWidget *description;
@@ -191,7 +192,30 @@ snooze_pressed_cb (GtkButton *button, gpointer user_data)
if (!snooze_timeout)
snooze_timeout = DEFAULT_SNOOZE_MINS;
(* funcinfo->func) (ALARM_NOTIFY_SNOOZE, snooze_timeout, funcinfo->func_data);
+}
+
+static void
+dismiss_pressed_cb (GtkButton *button, gpointer user_data)
+{
+ AlarmNotify *an = user_data;
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (an->treeview));
+
+ g_return_if_fail (model != NULL);
+ if (gtk_tree_model_iter_n_children (model, NULL) <= 1) {
+ gtk_dialog_response (GTK_DIALOG (an->dialog), GTK_RESPONSE_CLOSE);
+ } else {
+ GtkTreeIter iter;
+ AlarmFuncInfo *funcinfo = NULL;
+ GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview));
+
+ if (gtk_tree_selection_get_selected (selection, &model, &iter))
+ gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1);
+
+ g_return_if_fail (funcinfo);
+
+ (* funcinfo->func) (ALARM_NOTIFY_DISMISS, -1, funcinfo->func_data);
+ }
}
static void
@@ -256,10 +280,11 @@ notified_alarms_dialog_new (void)
an->scrolledwindow = glade_xml_get_widget (an->xml, "treeview-scrolledwindow");
snooze_btn = glade_xml_get_widget (an->xml, "snooze-button");
an->snooze_btn = snooze_btn;
+ an->dismiss_btn = glade_xml_get_widget (an->xml, "dismiss-button");
edit_btn = glade_xml_get_widget (an->xml, "edit-button");
if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time_min && an->snooze_time_hrs
- && an->description && an->location && edit_btn && snooze_btn)) {
+ && an->description && an->location && edit_btn && snooze_btn && an->dismiss_btn)) {
g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!");
g_object_unref (an->xml);
g_free (an);
@@ -292,6 +317,7 @@ notified_alarms_dialog_new (void)
g_signal_connect (edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an);
g_signal_connect (snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an);
+ g_signal_connect (an->dismiss_btn, "clicked", G_CALLBACK (dismiss_pressed_cb), an);
g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an);
g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an);
diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h
index 4b2a3d9c95..7a94793eaa 100644
--- a/calendar/gui/alarm-notify/alarm-notify-dialog.h
+++ b/calendar/gui/alarm-notify/alarm-notify-dialog.h
@@ -32,7 +32,8 @@
typedef enum {
ALARM_NOTIFY_CLOSE,
ALARM_NOTIFY_SNOOZE,
- ALARM_NOTIFY_EDIT
+ ALARM_NOTIFY_EDIT,
+ ALARM_NOTIFY_DISMISS
} AlarmNotifyResult;
typedef struct _AlarmNotificationsDialog AlarmNotificationsDialog;
diff --git a/calendar/gui/alarm-notify/alarm-notify.glade b/calendar/gui/alarm-notify/alarm-notify.glade
index 539bd66269..df1b1f92a2 100644
--- a/calendar/gui/alarm-notify/alarm-notify.glade
+++ b/calendar/gui/alarm-notify/alarm-notify.glade
@@ -37,11 +37,73 @@
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
- <property name="label">gtk-close</property>
- <property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-7</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment4">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox9">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image6">
+ <property name="visible">True</property>
+ <property name="stock">gtk-close</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label19">
+ <property name="visible">True</property>
+ <property name="label">Dismiss _All</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
</widget>
</child>
</widget>
@@ -527,6 +589,84 @@
<property name="fill">False</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkButton" id="dismiss-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment5">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox10">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image7">
+ <property name="visible">True</property>
+ <property name="stock">gtk-apply</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label20">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Dismiss</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+ <property name="width_chars">-1</property>
+ <property name="single_line_mode">False</property>
+ <property name="angle">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c
index ad0abaa0e0..062c3acab5 100644
--- a/calendar/gui/alarm-notify/alarm-queue.c
+++ b/calendar/gui/alarm-notify/alarm-queue.c
@@ -1250,6 +1250,13 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
break;
+ case ALARM_NOTIFY_DISMISS:
+ if (alarm_notifications_dialog) {
+ GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (alarm_notifications_dialog->treeview));
+ gtk_list_store_remove (GTK_LIST_STORE (model), &tray_data->iter);
+ }
+ break;
+
case ALARM_NOTIFY_CLOSE:
d(printf("%s:%d (notify_dialog_cb) - Dialog close\n",__FILE__, __LINE__));
if (alarm_notifications_dialog) {
@@ -1270,7 +1277,7 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data)
/* Task to remove the tray icons */
tray_list_remove_icons ();
- }
+ }
break;
diff --git a/calendar/gui/calendar-component.h b/calendar/gui/calendar-component.h
index 1e23bd52c1..5fbba8758e 100644
--- a/calendar/gui/calendar-component.h
+++ b/calendar/gui/calendar-component.h
@@ -26,6 +26,7 @@
#include <bonobo/bonobo-object.h>
#include <libedataserver/e-source-list.h>
+#include <widgets/misc/e-activity-handler.h>
#include "Evolution.h"
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index c1f123e836..41e245ceef 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -2937,7 +2937,9 @@ fill_widgets (CompEditor *editor)
if (e_cal_component_has_attachments (priv->comp)) {
GSList *attachment_list = NULL;
e_cal_component_get_attachment_list (priv->comp, &attachment_list);
+ g_signal_handlers_block_by_func(priv->attachment_bar, G_CALLBACK (attachment_bar_changed_cb), editor);
set_attachment_list (editor, attachment_list);
+ g_signal_handlers_unblock_by_func(priv->attachment_bar, G_CALLBACK (attachment_bar_changed_cb), editor);
g_slist_foreach (attachment_list, (GFunc)g_free, NULL);
g_slist_free (attachment_list);
}
@@ -2950,7 +2952,6 @@ static void
real_edit_comp (CompEditor *editor, ECalComponent *comp)
{
CompEditorPrivate *priv;
- const char *uid;
g_return_if_fail (IS_COMP_EDITOR (editor));
@@ -2969,7 +2970,6 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp)
priv->warned = FALSE;
update_window_border (editor, NULL);
- e_cal_component_get_uid (comp, &uid);
fill_widgets (editor);
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 2929cddf9c..0189813af9 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -440,6 +440,16 @@ calendar_table_query_tooltip_cb (ECalendarTable *cal_table,
e_cal_component_free_datetime (&dtstart);
e_cal_component_free_datetime (&dtdue);
+ tmp = e_calendar_view_get_attendees_status_info (new_comp);
+ if (tmp) {
+ l = gtk_label_new (tmp);
+ gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (w), l, FALSE, FALSE, 0);
+
+ g_free (tmp);
+ tmp = NULL;
+ }
+
tmp2 = g_string_new ("");
e_cal_component_get_description_list (new_comp, &desc);
for (len = 0, p = desc; p != NULL; p = p->next) {
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 63740563f9..594527aee8 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -2034,6 +2034,83 @@ e_calendar_view_move_tip (GtkWidget *widget, int x, int y)
gtk_widget_show (widget);
}
+/**
+ * Returns information about attendees in the component. If no attendees, then returns NULL.
+ * The information is like "Status: Accepted: X Declined: Y ...".
+ * Free returned pointer with g_free.
+ **/
+char *
+e_calendar_view_get_attendees_status_info (ECalComponent *comp)
+{
+ struct _values {
+ icalparameter_partstat status;
+ const char *caption;
+ int count;
+ } values[] = {
+ { ICAL_PARTSTAT_ACCEPTED, N_("Accepted"), 0 },
+ { ICAL_PARTSTAT_DECLINED, N_("Declined"), 0 },
+ { ICAL_PARTSTAT_TENTATIVE, N_("Tentative"), 0 },
+ { ICAL_PARTSTAT_DELEGATED, N_("Delegated"), 0 },
+ { ICAL_PARTSTAT_NEEDSACTION, N_("Needs action"), 0 },
+ { ICAL_PARTSTAT_NONE, N_("Other"), 0 },
+ { ICAL_PARTSTAT_X, NULL, -1 }
+ };
+
+ GSList *attendees = NULL, *a;
+ gboolean have = FALSE;
+ char *res = NULL;
+ int i;
+
+ if (!comp || !e_cal_component_has_attendees (comp))
+ return NULL;
+
+ e_cal_component_get_attendee_list (comp, &attendees);
+
+ for (a = attendees; a; a = a->next) {
+ ECalComponentAttendee *att = a->data;
+
+ if (att && att->cutype == ICAL_CUTYPE_INDIVIDUAL &&
+ (att->role == ICAL_ROLE_CHAIR ||
+ att->role == ICAL_ROLE_REQPARTICIPANT ||
+ att->role == ICAL_ROLE_OPTPARTICIPANT)) {
+ have = TRUE;
+
+ for (i = 0; values[i].count != -1; i++) {
+ if (att->status == values[i].status || values[i].status == ICAL_PARTSTAT_NONE) {
+ values[i].count++;
+ break;
+ }
+ }
+ }
+ }
+
+ if (have) {
+ GString *str = g_string_new ("");
+
+ for (i = 0; values[i].count != -1; i++) {
+ if (values[i].count > 0) {
+ if (str->str && *str->str)
+ g_string_append (str, " ");
+
+ g_string_append_printf (str, "%s: %d", _(values[i].caption), values[i].count);
+ }
+ }
+
+ g_string_prepend (str, ": ");
+
+ /* To Translators: 'Status' here means the state of the attendees, the resulting string will be in a form:
+ Status: Accepted: X Declined: Y ... */
+ g_string_prepend (str, _("Status"));
+
+ res = g_string_free (str, FALSE);
+ }
+
+ if (attendees)
+ e_cal_component_free_attendee_list (attendees);
+
+ return res;
+}
+
/*
* It is expected to show the tooltips in this below format
*
@@ -2041,6 +2118,7 @@ e_calendar_view_move_tip (GtkWidget *widget, int x, int y)
* Organiser: NameOfTheUser<email@ofuser.com>
* Location: PlaceOfTheMeeting
* Time : DateAndTime (xx Minutes)
+ * Status: Accepted: X Declined: Y ...
*/
gboolean
@@ -2179,6 +2257,17 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data)
g_free (tmp2);
g_free (tmp1);
+ tmp = e_calendar_view_get_attendees_status_info (newcomp);
+ if (tmp) {
+ hbox = gtk_hbox_new (FALSE, 0);
+ gtk_box_pack_start ((GtkBox *)hbox, gtk_label_new (tmp), FALSE, FALSE, 0);
+ ebox = gtk_event_box_new ();
+ gtk_container_add ((GtkContainer *)ebox, hbox);
+ gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0);
+
+ g_free (tmp);
+ }
+
pevent->tooltip = gtk_window_new (GTK_WINDOW_POPUP);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type ((GtkFrame *)frame, GTK_SHADOW_IN);
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index eb701aeffb..16a5548249 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -171,6 +171,7 @@ gboolean e_calendar_view_get_tooltips (ECalendarViewEventData *data);
void e_calendar_view_move_tip (GtkWidget *widget, int x, int y);
const gchar *e_calendar_view_get_icalcomponent_summary (ECal *ecal, icalcomponent *icalcomp, gboolean *free_text);
+char *e_calendar_view_get_attendees_status_info (ECalComponent *comp);
void draw_curved_rectangle (cairo_t *cr,
double x0,
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 03cffc9d93..150e72e6c1 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -1776,41 +1776,38 @@ e_day_view_remove_event_cb (EDayView *day_view,
return TRUE;
}
-#if 0
-/* Checks if the users participation status is Needs action and shows the summary as bold text*/
+/* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */
static void
set_text_as_bold (EDayViewEvent *event)
{
ECalComponent *comp;
- char *address;
- GSList *attendees, *l;
+ GSList *attendees = NULL, *l;
+ gchar *address;
ECalComponentAttendee *at = NULL;
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
address = itip_get_comp_attendee (comp, event->comp_data->client);
e_cal_component_get_attendee_list (comp, &attendees);
-
for (l = attendees; l; l = l->next) {
ECalComponentAttendee *attendee = l->data;
- if (g_str_equal (itip_strip_mailto (attendee->value), address)) {
+ if ((g_str_equal (itip_strip_mailto (attendee->value), address))
+ || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
at = attendee;
break;
}
}
-
- /* The attendee has not yet accepted the meeting, display the summary as bolded .
- If the attendee is not present, it might have come through a mailing list*/
- if (!at || (at->status == ICAL_PARTSTAT_NEEDSACTION)) {
- gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL);
- }
-
e_cal_component_free_attendee_list (attendees);
- g_object_unref (comp);
g_free (address);
+ g_object_unref (comp);
+
+ /* The attendee has not yet accepted the meeting, display the summary as bolded.
+ If the attendee is not present, it might have come through a mailing list.
+ In that case, we never show the meeting as bold even if it is unaccepted. */
+ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION))
+ gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL);
}
-#endif
/* This updates the text shown for an event. If the event start or end do not
lie on a row boundary, the time is displayed before the summary. */
@@ -1860,9 +1857,9 @@ e_day_view_update_event_label (EDayView *day_view,
"text", text,
NULL);
-/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
+ if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
&& e_cal_util_component_has_attendee (event->comp_data->icalcomp))
- set_text_as_bold (event); */
+ set_text_as_bold (event);
if (free_text)
g_free (text);
@@ -1892,9 +1889,9 @@ e_day_view_update_long_event_label (EDayView *day_view,
if (free_text)
g_free ((gchar*)summary);
-/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
+ if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
&& e_cal_util_component_has_attendee (event->comp_data->icalcomp))
- set_text_as_bold (event); */
+ set_text_as_bold (event);
}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 6b9e43f581..2ac77a7be6 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -1878,41 +1878,38 @@ e_week_view_recalc_display_start_day (EWeekView *week_view)
return FALSE;
}
-#if 0
-/* Checks if the users participation status is Needs action and shows the summary as bold text*/
+/* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */
static void
set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span)
{
ECalComponent *comp;
- char *address;
- GSList *attendees, *l;
+ GSList *attendees = NULL, *l;
+ gchar *address;
ECalComponentAttendee *at = NULL;
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
address = itip_get_comp_attendee (comp, event->comp_data->client);
e_cal_component_get_attendee_list (comp, &attendees);
-
for (l = attendees; l; l = l->next) {
ECalComponentAttendee *attendee = l->data;
- if (g_str_equal (itip_strip_mailto (attendee->value), address)) {
+ if ((g_str_equal (itip_strip_mailto (attendee->value), address))
+ || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) {
at = attendee;
break;
}
}
+ e_cal_component_free_attendee_list (attendees);
+ g_free (address);
+ g_object_unref (comp);
/* The attendee has not yet accepted the meeting, display the summary as bolded.
- If the attendee is not present, it might have come through a mailing list*/
- if (!at || (at->status == ICAL_PARTSTAT_NEEDSACTION)) {
+ If the attendee is not present, it might have come through a mailing list.
+ In that case, we never show the meeting as bold even if it is unaccepted. */
+ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION))
gnome_canvas_item_set (span->text_item, "bold", TRUE, NULL);
- }
-
- e_cal_component_free_attendee_list (attendees);
- g_object_unref (comp);
- g_free (address);
}
-#endif
/* This calls a given function for each event instance that matches the given
uid. Note that it is safe for the callback to remove the event (since we
@@ -2817,11 +2814,10 @@ e_week_view_reshape_event_span (EWeekView *week_view,
if (free_text)
g_free ((gchar*)summary);
-/* Uncomment once the pango fix is in
if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING)
&& e_cal_util_component_has_attendee (event->comp_data->icalcomp)) {
set_text_as_bold (event, span);
- } */
+ }
g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num));
g_signal_connect (span->text_item, "event",
G_CALLBACK (e_week_view_on_text_item_event),
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index ca6fbe9721..a5ff34aa4f 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -179,6 +179,9 @@ struct _GnomeCalendarPrivate {
/* We should know which calendar has been used to create object, so store it here
before emitting "user_created" signal and make it NULL just after the emit. */
ECal *user_created_cal;
+
+ /* used in update_todo_view, to prevent interleaving when called in separate thread */
+ GMutex *todo_update_lock;
};
/* Signal IDs */
@@ -738,6 +741,8 @@ update_query_async (struct _date_query_msg *msg)
real_sexp = adjust_e_cal_view_sexp (gcal, priv->sexp);
if (!real_sexp) {
+ g_object_unref (msg->gcal);
+ g_slice_free (struct _date_query_msg, msg);
return; /* No time range is set, so don't start a query */
}
@@ -1048,18 +1053,30 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer
set_timezone (calendar);
}
+struct _mupdate_todo_msg {
+ Message header;
+ GnomeCalendar *gcal;
+};
+
static void
-update_todo_view (GnomeCalendar *gcal)
+update_todo_view_async (struct _mupdate_todo_msg *msg)
{
+ GnomeCalendar *gcal;
GnomeCalendarPrivate *priv;
ECalModel *model;
char *sexp = NULL;
+ g_return_if_fail (msg != NULL);
+
+ gcal = msg->gcal;
priv = gcal->priv;
+ g_mutex_lock (priv->todo_update_lock);
+
/* Set the query on the task pad */
if (priv->todo_sexp) {
g_free (priv->todo_sexp);
+ priv->todo_sexp = NULL;
}
model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo));
@@ -1074,6 +1091,22 @@ update_todo_view (GnomeCalendar *gcal)
e_cal_model_set_search_query (model, priv->todo_sexp);
}
+ g_mutex_unlock (priv->todo_update_lock);
+
+ g_object_unref (msg->gcal);
+ g_slice_free (struct _mupdate_todo_msg, msg);
+}
+
+static void
+update_todo_view (GnomeCalendar *gcal)
+{
+ struct _mupdate_todo_msg *msg;
+
+ msg = g_slice_new0 (struct _mupdate_todo_msg);
+ msg->header.func = (MessageFunc) update_todo_view_async;
+ msg->gcal = g_object_ref (gcal);
+
+ message_push ((Message *) msg);
}
static void
@@ -1384,7 +1417,7 @@ setup_widgets (GnomeCalendar *gcal)
gtk_widget_show (vbox);
gtk_widget_show (sep);
- update_todo_view (gcal);
+ /* update_todo_view (gcal); */
/* Timeout check to hide completed items */
priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL);
@@ -1500,6 +1533,8 @@ gnome_calendar_init (GnomeCalendar *gcal)
e_categories_register_change_listener (G_CALLBACK (categories_changed_cb), gcal);
+ priv->todo_update_lock = g_mutex_new ();
+
priv->current_view_type = GNOME_CAL_DAY_VIEW;
priv->range_selected = FALSE;
priv->lview_select_daten_range = TRUE;
@@ -1616,6 +1651,8 @@ gnome_calendar_destroy (GtkObject *object)
g_signal_handlers_disconnect_by_func (cal_model,
G_CALLBACK (view_done_cb), gcal);
+ g_mutex_free (priv->todo_update_lock);
+
g_free (priv);
gcal->priv = NULL;
}
diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c
index 45974af517..4edce662a6 100644
--- a/calendar/gui/memos-component.c
+++ b/calendar/gui/memos-component.c
@@ -218,43 +218,21 @@ update_objects (ECal *client, icalcomponent *icalcomp)
return TRUE;
}
-static void
-selector_tree_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data)
+static gboolean
+selector_tree_data_dropped (ESourceSelector *selector,
+ GtkSelectionData *data,
+ ESource *destination,
+ GdkDragAction action,
+ guint info,
+ MemosComponent *component)
{
- GtkTreePath *path = NULL;
- GtkTreeViewDropPosition pos;
- gpointer source = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
gboolean success = FALSE;
icalcomponent *icalcomp = NULL;
ECal *client = NULL;
GSList *components, *p;
- MemosComponent *component = MEMOS_COMPONENT (user_data);
-
- if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
- x, y, &path, &pos))
- goto finish;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
-
- if (!gtk_tree_model_get_iter (model, &iter, path))
- goto finish;
-
-
- gtk_tree_model_get (model, &iter, 0, &source, -1);
-
- if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source) || !data->data)
- goto finish;
- client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL);
+ client = auth_new_cal_from_source (
+ destination, E_CAL_SOURCE_TYPE_JOURNAL);
if (!client || !e_cal_open (client, TRUE, NULL))
goto finish;
@@ -280,7 +258,7 @@ selector_tree_drag_data_received (GtkWidget *widget,
continue;
/* FIXME deal with GDK_ACTION_ASK */
- if (context->action == GDK_ACTION_COPY) {
+ if (action == GDK_ACTION_COPY) {
old_uid = g_strdup (icalcomponent_get_uid (icalcomp));
uid = e_cal_component_gen_uid ();
icalcomponent_set_uid (icalcomp, uid);
@@ -297,7 +275,7 @@ selector_tree_drag_data_received (GtkWidget *widget,
/* this will report success by last item, but we don't care */
success = update_objects (client, icalcomp);
- if (success && context->action == GDK_ACTION_MOVE) {
+ if (success && action == GDK_ACTION_MOVE) {
/* remove components rather here, because we know which has been moved */
ESource *source_source;
ECal *source_client;
@@ -337,12 +315,8 @@ selector_tree_drag_data_received (GtkWidget *widget,
finish:
if (client)
g_object_unref (client);
- if (source)
- g_object_unref (source);
- if (path)
- gtk_tree_path_free (path);
- gtk_drag_finish (context, success, success && context->action == GDK_ACTION_MOVE, time);
+ return success;
}
static void
diff --git a/calendar/gui/print.c b/calendar/gui/print.c
index 67b2f729b0..f3c6312e3f 100644
--- a/calendar/gui/print.c
+++ b/calendar/gui/print.c
@@ -2531,7 +2531,7 @@ print_comp_draw_real (GtkPrintOperation *operation,
top += 20;
/* Attendees */
- if (e_cal_component_has_attendees (comp)) {
+ if ((page_nr == 0) && e_cal_component_has_attendees (comp)) {
top = bound_text (context, font, _("Attendees: "), -1, 0.0, top, width, height, FALSE, &page_start, &pages);
pango_font_description_free (font);
font = get_font_for_size (12, PANGO_WEIGHT_NORMAL);
diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c
index c2ad3a45ef..d2424ed158 100644
--- a/calendar/gui/tasks-component.c
+++ b/calendar/gui/tasks-component.c
@@ -238,6 +238,16 @@ new_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data)
}
static void
+rename_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data)
+{
+ TasksComponentView *component_view = data;
+ ESourceSelector *selector;
+
+ selector = E_SOURCE_SELECTOR (component_view->source_selector);
+ e_source_selector_edit_primary_selection (selector);
+}
+
+static void
edit_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data)
{
TasksComponentView *component_view = data;
@@ -278,6 +288,7 @@ mark_offline_cb (EPopup *ep, EPopupItem *pitem, void *data)
static EPopupItem etc_source_popups[] = {
{ E_POPUP_ITEM, "10.new", N_("_New Task List"), new_task_list_cb, NULL, "stock_todo", 0, 0 },
{ E_POPUP_ITEM, "15.copy", N_("_Copy..."), copy_task_list_cb, NULL, "edit-copy", 0, E_CAL_POPUP_SOURCE_PRIMARY },
+ { E_POPUP_ITEM, "18.rename", N_("_Rename..."), rename_task_list_cb, NULL, NULL, 0, E_CAL_POPUP_SOURCE_PRIMARY },
{ E_POPUP_BAR, "20.bar" },
{ E_POPUP_ITEM, "20.delete", N_("_Delete"), delete_task_list_cb, NULL, "edit-delete", 0, E_CAL_POPUP_SOURCE_USER|E_CAL_POPUP_SOURCE_PRIMARY },
@@ -397,43 +408,21 @@ update_objects (ECal *client, icalcomponent *icalcomp)
return TRUE;
}
-static void
-selector_tree_drag_data_received (GtkWidget *widget,
- GdkDragContext *context,
- gint x,
- gint y,
- GtkSelectionData *data,
- guint info,
- guint time,
- gpointer user_data)
-{
- GtkTreePath *path = NULL;
- GtkTreeViewDropPosition pos;
- gpointer source = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
+static gboolean
+selector_tree_data_dropped (ESourceSelector *selector,
+ GtkSelectionData *data,
+ ESource *destination,
+ GdkDragAction action,
+ guint info,
+ TasksComponent *component)
+{
gboolean success = FALSE;
icalcomponent *icalcomp = NULL;
ECal *client = NULL;
GSList *components, *p;
- TasksComponent *component = TASKS_COMPONENT (user_data);
-
- if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget),
- x, y, &path, &pos))
- goto finish;
-
- model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
-
- if (!gtk_tree_model_get_iter (model, &iter, path))
- goto finish;
-
-
- gtk_tree_model_get (model, &iter, 0, &source, -1);
-
- if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source) || !data->data)
- goto finish;
- client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO);
+ client = auth_new_cal_from_source (
+ destination, E_CAL_SOURCE_TYPE_TODO);
if (!client || !e_cal_open (client, TRUE, NULL))
goto finish;
@@ -459,7 +448,7 @@ selector_tree_drag_data_received (GtkWidget *widget,
continue;
/* FIXME deal with GDK_ACTION_ASK */
- if (context->action == GDK_ACTION_COPY) {
+ if (action == GDK_ACTION_COPY) {
old_uid = g_strdup (icalcomponent_get_uid (icalcomp));
uid = e_cal_component_gen_uid ();
icalcomponent_set_uid (icalcomp, uid);
@@ -476,7 +465,7 @@ selector_tree_drag_data_received (GtkWidget *widget,
/* this will report success by last item, but we don't care */
success = update_objects (client, icalcomp);
- if (success && context->action == GDK_ACTION_MOVE) {
+ if (success && action == GDK_ACTION_MOVE) {
/* remove components rather here, because we know which has been moved */
ESource *source_source;
ECal *source_client;
@@ -516,12 +505,8 @@ selector_tree_drag_data_received (GtkWidget *widget,
finish:
if (client)
g_object_unref (client);
- if (source)
- g_object_unref (source);
- if (path)
- gtk_tree_path_free (path);
- gtk_drag_finish (context, success, context->action == GDK_ACTION_MOVE, time);
+ return success;
}
static void