aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/alarm-notify/alarm-notify.glade4
-rw-r--r--calendar/gui/caltypes.xml70
-rw-r--r--calendar/gui/dialogs/alarm-dialog.c17
-rw-r--r--calendar/gui/dialogs/alarm-dialog.glade6
-rw-r--r--calendar/gui/dialogs/cal-prefs-dialog.glade4
-rw-r--r--calendar/gui/dialogs/comp-editor.c7
-rw-r--r--calendar/gui/dialogs/event-editor.c3
-rw-r--r--calendar/gui/dialogs/event-page.c6
-rw-r--r--calendar/gui/dialogs/event-page.glade4
-rw-r--r--calendar/gui/dialogs/memo-editor.c1
-rw-r--r--calendar/gui/dialogs/memo-page.c6
-rw-r--r--calendar/gui/dialogs/recurrence-page.glade2
-rw-r--r--calendar/gui/dialogs/task-details-page.glade2
-rw-r--r--calendar/gui/dialogs/task-editor.c2
-rw-r--r--calendar/gui/dialogs/task-page.c6
-rw-r--r--calendar/gui/e-cal-model.c1
-rw-r--r--calendar/gui/e-calendar-table.c1
-rw-r--r--calendar/gui/e-calendar-view.c102
-rw-r--r--calendar/gui/e-calendar-view.h1
-rw-r--r--calendar/gui/e-day-view-top-item.c26
-rw-r--r--calendar/gui/e-day-view.c196
-rw-r--r--calendar/gui/e-week-view.c188
-rw-r--r--calendar/gui/goto-dialog.glade2
-rw-r--r--calendar/gui/itip-utils.c11
-rw-r--r--calendar/gui/memotypes.xml70
-rw-r--r--calendar/gui/tasktypes.xml71
26 files changed, 397 insertions, 412 deletions
diff --git a/calendar/gui/alarm-notify/alarm-notify.glade b/calendar/gui/alarm-notify/alarm-notify.glade
index df1b1f92a2..9c2993d474 100644
--- a/calendar/gui/alarm-notify/alarm-notify.glade
+++ b/calendar/gui/alarm-notify/alarm-notify.glade
@@ -269,7 +269,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">0 0 12 1 5 5</property>
+ <property name="adjustment">0 0 12 1 5 0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -313,7 +313,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">5 0 59 1 10 10</property>
+ <property name="adjustment">5 0 59 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/caltypes.xml b/calendar/gui/caltypes.xml
index 16dc19c333..c1997a4fb0 100644
--- a/calendar/gui/caltypes.xml
+++ b/calendar/gui/caltypes.xml
@@ -129,75 +129,7 @@
</option>
</input>
<input type="optionlist" name="category">
- <option value="Anniversary">
- <_title>Anniversary</_title>
- </option>
- <option value="Holiday">
- <_title>Holiday</_title>
- </option>
- <option value="Ideas">
- <_title>Ideas</_title>
- </option>
- <option value="Status">
- <_title>Status</_title>
- </option>
- <option value="Holiday Cards">
- <_title>Holiday Cards</_title>
- </option>
- <option value="Hot Contacts">
- <_title>Hot Contacts</_title>
- </option>
- <option value="International">
- <_title>International</_title>
- </option>
- <option value="Next 7 Days">
- <_title>Next 7 Days</_title>
- </option>
- <option value="Birthday">
- <_title>Birthday</_title>
- </option>
- <option value="VIP">
- <_title>VIP</_title>
- </option>
- <option value="Gifts">
- <_title>Gifts</_title>
- </option>
- <option value="Waiting">
- <_title>Waiting</_title>
- </option>
- <option value="Key Customer">
- <_title>Key Customer</_title>
- </option>
- <option value="Time &amp; Expenses">
- <_title>Time &amp; Expenses </_title>
- </option>
- <option value="Miscellaneous">
- <_title>Miscellaneous</_title>
- </option>
- <option value="Business">
- <_title>Business</_title>
- </option>
- <option value="Personal">
- <_title>Personal</_title>
- </option>
- <option value="Suppliers">
- <_title>Suppliers</_title>
- </option>
- <option value="Goals/Objectives">
- <_title>Goals/Objectives</_title>
- </option>
- <option value="Strategies">
- <_title>Strategies</_title>
- </option>
- <option value="Competition">
- <_title>Competition</_title>
- </option>
- <option value="Favourites">
- <_title>Favourites</_title>
- </option>
- <option value="Phone Calls">
- <_title>Phone Calls</_title>
- </option>
+ <dynamic func="e_util_get_category_filter_options"/>
</input>
</part>
diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c
index a5f13ccb51..7e429a28b2 100644
--- a/calendar/gui/dialogs/alarm-dialog.c
+++ b/calendar/gui/dialogs/alarm-dialog.c
@@ -623,19 +623,18 @@ populate_widgets_from_alarm (Dialog *dialog)
break;
}
- if ( trigger->u.rel_duration.hours ) {
+ if ( trigger->u.rel_duration.days ) {
+ e_dialog_option_menu_set (dialog->value_units, DAYS, value_map);
+ e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.days);
+ } else if ( trigger->u.rel_duration.hours ) {
e_dialog_option_menu_set (dialog->value_units, HOURS, value_map);
e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.hours);
- }
-
- if ( trigger->u.rel_duration.minutes ){
+ } else if ( trigger->u.rel_duration.minutes ) {
e_dialog_option_menu_set (dialog->value_units, MINUTES, value_map);
e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.minutes);
- }
-
- if ( trigger->u.rel_duration.days ){
- e_dialog_option_menu_set (dialog->value_units, DAYS, value_map);
- e_dialog_spin_set (dialog->interval_value, trigger->u.rel_duration.days);
+ } else {
+ e_dialog_option_menu_set (dialog->value_units, MINUTES, value_map);
+ e_dialog_spin_set (dialog->interval_value, 0);
}
/* Repeat options */
diff --git a/calendar/gui/dialogs/alarm-dialog.glade b/calendar/gui/dialogs/alarm-dialog.glade
index 4e32374928..5a5d4ef291 100644
--- a/calendar/gui/dialogs/alarm-dialog.glade
+++ b/calendar/gui/dialogs/alarm-dialog.glade
@@ -197,7 +197,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1 0 999 1 10 10</property>
+ <property name="adjustment">1 0 999 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -431,7 +431,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1 1 999 1 10 10</property>
+ <property name="adjustment">1 1 999 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -475,7 +475,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">5 0 999 1 10 10</property>
+ <property name="adjustment">5 0 999 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade
index c24321e0a2..d3003bdb6f 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.glade
+++ b/calendar/gui/dialogs/cal-prefs-dialog.glade
@@ -808,7 +808,7 @@ Sunday</property>
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">0 0 9999 1 10 10</property>
+ <property name="adjustment">0 0 9999 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -1312,7 +1312,7 @@ Days</property>
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1 0 9999 1 10 10</property>
+ <property name="adjustment">1 0 9999 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c
index 41e245ceef..f3d9eb7b34 100644
--- a/calendar/gui/dialogs/comp-editor.c
+++ b/calendar/gui/dialogs/comp-editor.c
@@ -137,6 +137,7 @@ static const gchar *ui =
" <menubar action='main-menu'>"
" <menu action='file-menu'>"
" <menuitem action='save'/>"
+" <menuitem action='print'/>"
" <menuitem action='close'/>"
" </menu>"
" <menu action='edit-menu'>"
@@ -158,6 +159,7 @@ static const gchar *ui =
" </menubar>"
" <toolbar name='main-toolbar'>"
" <toolitem action='save'/>"
+" <toolitem action='print'/>"
" <toolitem action='close'/>"
" <separator/>"
" <toolitem action='attach'/>"
@@ -1306,7 +1308,7 @@ static GtkActionEntry core_entries[] = {
{ "print",
GTK_STOCK_PRINT,
NULL,
- NULL,
+ "<Control>p",
NULL,
G_CALLBACK (action_print_cb) },
@@ -3080,7 +3082,8 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method)
set_attendees_for_delegation (send_comp, address, method);
}
- if (!e_cal_component_has_attachments (priv->comp)) {
+ if (!e_cal_component_has_attachments (priv->comp)
+ || e_cal_get_static_capability (priv->client, CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) {
if (itip_send_comp (method, send_comp, priv->client,
NULL, NULL, users)) {
g_object_unref (send_comp);
diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c
index c4393b0174..2a4883cdfd 100644
--- a/calendar/gui/dialogs/event-editor.c
+++ b/calendar/gui/dialogs/event-editor.c
@@ -123,7 +123,6 @@ create_schedule_page (CompEditor *editor)
priv->sched_page = schedule_page_new (priv->model, editor);
page = COMP_EDITOR_PAGE (priv->sched_page);
- g_object_ref_sink (priv->sched_page);
gtk_container_add (
GTK_CONTAINER (GTK_DIALOG (priv->sched_window)->vbox),
comp_editor_page_get_widget (page));
@@ -289,7 +288,6 @@ event_editor_constructor (GType type,
gtk_action_group_set_visible (action_group, is_meeting);
priv->event_page = event_page_new (priv->model, editor);
- g_object_ref_sink (priv->event_page);
comp_editor_append_page (
editor, COMP_EDITOR_PAGE (priv->event_page),
_("Appoint_ment"), TRUE);
@@ -306,7 +304,6 @@ event_editor_constructor (GType type,
priv->recur_page = recurrence_page_new (editor);
page = COMP_EDITOR_PAGE (priv->recur_page);
- g_object_ref_sink (priv->recur_page);
gtk_container_add (
GTK_CONTAINER ((GTK_DIALOG (priv->recur_window)->vbox)),
comp_editor_page_get_widget (page));
diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c
index 2855113e92..53707432d9 100644
--- a/calendar/gui/dialogs/event-page.c
+++ b/calendar/gui/dialogs/event-page.c
@@ -34,6 +34,7 @@
#include <glib/gi18n.h>
#include <glade/glade.h>
#include <gdk/gdkkeysyms.h>
+#include <libedataserverui/e-category-completion.h>
#include <libedataserverui/e-source-combo-box.h>
#include "common/authentication.h"
#include "e-util/e-categories-config.h"
@@ -2152,6 +2153,7 @@ static gboolean
get_widgets (EventPage *epage)
{
CompEditorPage *page = COMP_EDITOR_PAGE (epage);
+ GtkEntryCompletion *completion;
EventPagePrivate *priv;
GSList *accel_groups;
GtkWidget *toplevel;
@@ -2245,6 +2247,10 @@ get_widgets (EventPage *epage)
#undef GW
+ completion = e_category_completion_new ();
+ gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion);
+ g_object_unref (completion);
+
return (priv->summary
&& priv->location
&& priv->start_time
diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade
index f0f1d2e090..c7d00dda94 100644
--- a/calendar/gui/dialogs/event-page.glade
+++ b/calendar/gui/dialogs/event-page.glade
@@ -451,7 +451,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1 0 0 1 1 1</property>
+ <property name="adjustment">1 0 0 1 1 0</property>
</widget>
<packing>
<property name="padding">0</property>
@@ -495,7 +495,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">0 0 59 5 10 10</property>
+ <property name="adjustment">0 0 59 5 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c
index 377cceef84..c76c96b94c 100644
--- a/calendar/gui/dialogs/memo-editor.c
+++ b/calendar/gui/dialogs/memo-editor.c
@@ -133,7 +133,6 @@ memo_editor_init (MemoEditor *me)
}
me->priv->memo_page = memo_page_new (editor);
- g_object_ref_sink (me->priv->memo_page);
comp_editor_append_page (
COMP_EDITOR (me),
COMP_EDITOR_PAGE (me->priv->memo_page),
diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c
index 421fdcf56b..362a8b0e9a 100644
--- a/calendar/gui/dialogs/memo-page.c
+++ b/calendar/gui/dialogs/memo-page.c
@@ -34,6 +34,7 @@
#include <gtk/gtk.h>
#include <glib/gi18n.h>
#include <glade/glade.h>
+#include <libedataserverui/e-category-completion.h>
#include <libedataserverui/e-source-combo-box.h>
#include <libedataserverui/e-name-selector.h>
#include <libedataserverui/e-name-selector-entry.h>
@@ -746,6 +747,7 @@ static gboolean
get_widgets (MemoPage *mpage)
{
CompEditorPage *page = COMP_EDITOR_PAGE (mpage);
+ GtkEntryCompletion *completion;
MemoPagePrivate *priv;
GSList *accel_groups;
GtkWidget *toplevel;
@@ -795,6 +797,10 @@ get_widgets (MemoPage *mpage)
#undef GW
+ completion = e_category_completion_new ();
+ gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion);
+ g_object_unref (completion);
+
return (priv->memo_content
&& priv->categories_btn
&& priv->categories
diff --git a/calendar/gui/dialogs/recurrence-page.glade b/calendar/gui/dialogs/recurrence-page.glade
index 62654322b0..14d6c2fa04 100644
--- a/calendar/gui/dialogs/recurrence-page.glade
+++ b/calendar/gui/dialogs/recurrence-page.glade
@@ -141,7 +141,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1 1 10000 1 10 10</property>
+ <property name="adjustment">1 1 10000 1 10 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade
index bca7da4a08..aac90876ed 100644
--- a/calendar/gui/dialogs/task-details-page.glade
+++ b/calendar/gui/dialogs/task-details-page.glade
@@ -297,7 +297,7 @@
<property name="update_policy">GTK_UPDATE_ALWAYS</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">0 0 100 1 10 10</property>
+ <property name="adjustment">0 0 100 1 10 0</property>
</widget>
<packing>
<property name="left_attach">1</property>
diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c
index 57a4063755..3ef5b4bcf2 100644
--- a/calendar/gui/dialogs/task-editor.c
+++ b/calendar/gui/dialogs/task-editor.c
@@ -311,7 +311,6 @@ task_editor_init (TaskEditor *te)
te->priv->updating = FALSE;
te->priv->task_page = task_page_new (te->priv->model, editor);
- g_object_ref_sink (te->priv->task_page);
comp_editor_append_page (
editor, COMP_EDITOR_PAGE (te->priv->task_page),
_("_Task"), TRUE);
@@ -327,7 +326,6 @@ task_editor_init (TaskEditor *te)
G_CALLBACK(gtk_widget_hide), NULL);
te->priv->task_details_page = task_details_page_new (editor);
- g_object_ref_sink (te->priv->task_details_page);
gtk_container_add (
GTK_CONTAINER (GTK_DIALOG (te->priv->task_details_window)->vbox),
comp_editor_page_get_widget ((CompEditorPage *) te->priv->task_details_page));
diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c
index a4bc4816a3..7d674d20a0 100644
--- a/calendar/gui/dialogs/task-page.c
+++ b/calendar/gui/dialogs/task-page.c
@@ -34,6 +34,7 @@
#include <glib/gi18n.h>
#include <glade/glade.h>
#include <gdk/gdkkeysyms.h>
+#include <libedataserverui/e-category-completion.h>
#include <libedataserverui/e-source-combo-box.h>
#include <misc/e-dateedit.h>
#include <e-util/e-dialog-utils.h>
@@ -1372,6 +1373,7 @@ static gboolean
get_widgets (TaskPage *tpage)
{
CompEditorPage *page = COMP_EDITOR_PAGE (tpage);
+ GtkEntryCompletion *completion;
TaskPagePrivate *priv;
GSList *accel_groups;
GtkWidget *toplevel;
@@ -1444,6 +1446,10 @@ get_widgets (TaskPage *tpage)
#undef GW
+ completion = e_category_completion_new ();
+ gtk_entry_set_completion (GTK_ENTRY (priv->categories), completion);
+ g_object_unref (completion);
+
return (priv->summary
&& priv->summary_label
&& priv->due_date
diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c
index 47922c0ba9..9074c7e0ed 100644
--- a/calendar/gui/e-cal-model.c
+++ b/calendar/gui/e-cal-model.c
@@ -2226,6 +2226,7 @@ copy_ecdv (ECellDateEditValue *ecdv)
struct _ECalModelComponentPrivate {
+ char nouse;
};
static void e_cal_model_component_finalize (GObject *object);
diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c
index 0189813af9..3e9dae9f78 100644
--- a/calendar/gui/e-calendar-table.c
+++ b/calendar/gui/e-calendar-table.c
@@ -469,6 +469,7 @@ calendar_table_query_tooltip_cb (ECalendarTable *cal_table,
if (tmp2->len) {
l = gtk_label_new (tmp2->str);
+ gtk_label_set_line_wrap (GTK_LABEL (l), TRUE);
gtk_misc_set_alignment (GTK_MISC (l), 0.0, 0.5);
gtk_box_pack_start (GTK_BOX (box), l, FALSE, FALSE, 0);
}
diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c
index 594527aee8..d8d517c9d9 100644
--- a/calendar/gui/e-calendar-view.c
+++ b/calendar/gui/e-calendar-view.c
@@ -74,7 +74,6 @@ static void e_calendar_view_set_property (GObject *object, guint property_id, co
static void e_calendar_view_destroy (GtkObject *object);
static void open_event_with_flags (ECalendarView *cal_view, ECal *client, icalcomponent *icalcomp, guint32 flags);
-static GdkAtom clipboard_atom = GDK_NONE;
/* Property IDs */
enum props {
@@ -99,6 +98,17 @@ static guint e_calendar_view_signals[LAST_SIGNAL] = { 0 };
G_DEFINE_TYPE (ECalendarView, e_calendar_view, GTK_TYPE_TABLE)
+enum TargetType{
+ TARGET_TYPE_VCALENDAR
+};
+
+static GtkTargetEntry target_types[] = {
+ { "text/x-calendar", 0, TARGET_TYPE_VCALENDAR },
+ { "text/calendar", 0, TARGET_TYPE_VCALENDAR }
+};
+
+static guint n_target_types = G_N_ELEMENTS (target_types);
+
static void
e_calendar_view_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
@@ -158,6 +168,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
klass->get_visible_time_range = NULL;
klass->update_query = NULL;
klass->open_event = e_calendar_view_open_event;
+ klass->paste_text = NULL;
g_object_class_install_property (gobject_class, PROP_MODEL,
g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL,
@@ -227,11 +238,6 @@ e_calendar_view_class_init (ECalendarViewClass *klass)
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
- /* clipboard atom */
- if (!clipboard_atom)
- clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
-
-
/*
* Key bindings
*/
@@ -663,6 +669,34 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view)
g_list_free (selected);
}
+static void
+clipboard_clear_calendar_cb (GtkClipboard *clipboard,
+ gpointer data)
+{
+ g_free (data);
+}
+
+static void
+clipboard_get_calendar_cb (GtkClipboard *clipboard,
+ GtkSelectionData *selection_data,
+ guint info,
+ gpointer data)
+{
+ gchar *comp_str = (gchar *) data;
+
+ switch (info) {
+ case TARGET_TYPE_VCALENDAR:
+ gtk_selection_data_set (selection_data,
+ selection_data->target,
+ 8,
+ (const guchar *) comp_str,
+ (gint) strlen (comp_str));
+ break;
+ default:
+ break;
+ }
+}
+
void
e_calendar_view_copy_clipboard (ECalendarView *cal_view)
{
@@ -671,6 +705,7 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
icalcomponent *vcal_comp;
icalcomponent *new_icalcomp;
ECalendarViewEvent *event;
+ GtkClipboard *clipboard;
g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
@@ -704,19 +739,25 @@ e_calendar_view_copy_clipboard (ECalendarView *cal_view)
}
/* copy the VCALENDAR to the clipboard */
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (cal_view), GDK_SELECTION_CLIPBOARD);
comp_str = icalcomponent_as_ical_string (vcal_comp);
- gtk_clipboard_set_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (const gchar *) comp_str,
- strlen (comp_str));
+
+ if (!gtk_clipboard_set_with_data (clipboard, target_types, n_target_types,
+ clipboard_get_calendar_cb,
+ clipboard_clear_calendar_cb,
+ comp_str)) {
+ g_free (comp_str);
+ } else {
+ gtk_clipboard_set_can_store (clipboard, target_types + 1, n_target_types - 1);
+ }
/* free memory */
icalcomponent_free (vcal_comp);
- g_free (comp_str);
g_list_free (selected);
}
static void
-clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView *cal_view)
+clipboard_get_calendar_data (ECalendarView *cal_view, const gchar *text)
{
icalcomponent *icalcomp;
icalcomponent_kind kind;
@@ -796,13 +837,48 @@ clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView
#endif
}
+static void
+e_calendar_view_paste_text (ECalendarView *cal_view)
+{
+ g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
+
+ if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text)
+ E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (cal_view))->paste_text (cal_view);
+}
+
+static void
+clipboard_paste_received_cb (GtkClipboard *clipboard,
+ GtkSelectionData *selection_data,
+ gpointer data)
+{
+ if (gtk_clipboard_wait_is_text_available (clipboard)) {
+ e_calendar_view_paste_text (E_CALENDAR_VIEW (data));
+ } else {
+ GdkAtom type = selection_data->type;
+ if (type == gdk_atom_intern (target_types[TARGET_TYPE_VCALENDAR].target, TRUE)) {
+ gchar *result = NULL;
+ result = g_strndup ((const gchar *) selection_data->data,
+ selection_data->length);
+ clipboard_get_calendar_data (E_CALENDAR_VIEW (data), result);
+ g_free (result);
+ }
+ }
+ g_object_unref (data);
+}
+
void
e_calendar_view_paste_clipboard (ECalendarView *cal_view)
{
+ GtkClipboard *clipboard;
+
g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view));
- gtk_clipboard_request_text (gtk_widget_get_clipboard (GTK_WIDGET (cal_view), clipboard_atom),
- (GtkClipboardTextReceivedFunc) clipboard_get_text_cb, cal_view);
+ clipboard = gtk_widget_get_clipboard (GTK_WIDGET (cal_view), GDK_SELECTION_CLIPBOARD);
+ g_object_ref (cal_view);
+
+ gtk_clipboard_request_contents (clipboard,
+ gdk_atom_intern (target_types[TARGET_TYPE_VCALENDAR].target, FALSE),
+ clipboard_paste_received_cb, cal_view);
}
static void
diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h
index 16a5548249..0d577a9f24 100644
--- a/calendar/gui/e-calendar-view.h
+++ b/calendar/gui/e-calendar-view.h
@@ -111,6 +111,7 @@ struct _ECalendarViewClass {
gboolean (* get_visible_time_range) (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
void (* update_query) (ECalendarView *cal_view);
void (* open_event) (ECalendarView *cal_view);
+ void (* paste_text) (ECalendarView *cal_view);
};
GType e_calendar_view_get_type (void);
diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c
index 4523fa6978..2f9bbf00fb 100644
--- a/calendar/gui/e-day-view-top-item.c
+++ b/calendar/gui/e-day-view-top-item.c
@@ -33,6 +33,7 @@
#include "e-util/e-categories-config.h"
#include <libecal/e-cal-time-util.h>
#include <libedataserver/e-data-server-util.h>
+#include <libedataserver/e-categories.h>
#include "e-calendar-view.h"
#include "e-day-view-top-item.h"
@@ -687,29 +688,28 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem,
e_cal_component_get_categories_list (comp, &categories_list);
for (elem = categories_list; elem; elem = elem->next) {
char *category;
- GdkPixmap *pixmap = NULL;
- GdkBitmap *mask = NULL;
+ const char *file;
+ GdkPixbuf *pixbuf;
category = (char *) elem->data;
- e_categories_config_get_icon_for (category, &pixmap, &mask);
- if (pixmap == NULL)
+ file = e_categories_get_icon_file_for (category);
+ if (!file)
+ continue;
+
+ pixbuf = gdk_pixbuf_new_from_file (file, NULL);
+ if (pixbuf == NULL)
continue;
if (icon_x <= max_icon_x) {
gdk_gc_set_clip_origin (gc, icon_x, icon_y);
- if (mask != NULL)
- gdk_gc_set_clip_mask (gc, mask);
- gdk_draw_drawable (drawable, gc,
- pixmap,
+ gdk_draw_pixbuf (drawable, gc,
+ pixbuf,
0, 0, icon_x, icon_y,
E_DAY_VIEW_ICON_WIDTH,
- E_DAY_VIEW_ICON_HEIGHT);
+ E_DAY_VIEW_ICON_HEIGHT,
+ GDK_RGB_DITHER_NORMAL, 0, 0);
icon_x -= icon_x_inc;
}
-
- g_object_unref (pixmap);
- if (mask != NULL)
- g_object_unref (mask);
}
e_cal_component_free_categories_list (categories_list);
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index 150e72e6c1..7235c8dc58 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -152,6 +152,7 @@ static GList *e_day_view_get_selected_events (ECalendarView *cal_view);
static gboolean e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
static void e_day_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
static gboolean e_day_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
+static void e_day_view_paste_text (ECalendarView *day_view);
static void e_day_view_update_query (EDayView *day_view);
static void e_day_view_goto_start_of_work_day (EDayView *day_view);
static void e_day_view_goto_end_of_work_day (EDayView *day_view);
@@ -466,6 +467,7 @@ e_day_view_class_init (EDayViewClass *class)
view_class->get_selected_time_range = e_day_view_get_selected_time_range;
view_class->set_selected_time_range = e_day_view_set_selected_time_range;
view_class->get_visible_time_range = e_day_view_get_visible_time_range;
+ view_class->paste_text = e_day_view_paste_text;
#if 0 /* KILL-BONOBO */
/* init the accessibility support for e_day_view */
@@ -4725,16 +4727,13 @@ e_day_view_event_sort_func (const void *arg1,
}
static gboolean
-e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
+e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key_event)
{
- EDayView *day_view;
icalcomponent *icalcomp;
ECal *ecal;
ECalModel *model;
ECalComponent *comp;
gint day, event_num;
- guint keyval;
- gboolean stop_emission;
time_t dtstart, dtend;
ECalComponentDateTime start_dt, end_dt;
struct icaltimetype start_tt, end_tt;
@@ -4742,6 +4741,80 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
AddEventData add_event_data;
gboolean read_only = TRUE;
+ /* Check if the client is read only */
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
+ ecal = e_cal_model_get_default_client (model);
+ if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
+ return FALSE;
+
+ icalcomp = e_cal_model_create_component_with_defaults (model);
+ if (!icalcomp)
+ return FALSE;
+
+ uid = icalcomponent_get_uid (icalcomp);
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomp);
+
+ e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
+
+ start_tt = icaltime_from_timet_with_zone (dtstart, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+
+ end_tt = icaltime_from_timet_with_zone (dtend, FALSE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+
+ if (day_view->selection_in_top_canvas) {
+ start_dt.tzid = NULL;
+ start_tt.is_date = 1;
+ end_tt.is_date = 1;
+
+ /* Editor default in day/work-week view - top canvas */
+ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+ } else {
+ start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+
+ /* Editor default in day/work-week view - main canvas */
+ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
+ }
+
+ start_dt.value = &start_tt;
+ end_dt.value = &end_tt;
+ end_dt.tzid = start_dt.tzid;
+ e_cal_component_set_dtstart (comp, &start_dt);
+ e_cal_component_set_dtend (comp, &end_dt);
+
+ e_cal_component_set_categories (
+ comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view)));
+
+ /* We add the event locally and start editing it. We don't send it
+ to the server until the user finishes editing it. */
+ add_event_data.day_view = day_view;
+ add_event_data.comp_data = NULL;
+ e_day_view_add_event (comp, dtstart, dtend, &add_event_data);
+ e_day_view_check_layout (day_view);
+ gtk_widget_queue_draw (day_view->top_canvas);
+ gtk_widget_queue_draw (day_view->main_canvas);
+
+ if (!e_day_view_find_event_from_uid (day_view, ecal, uid, NULL, &day, &event_num)) {
+ g_warning ("Couldn't find event to start editing.\n");
+ g_object_unref (comp);
+ return FALSE;
+ }
+
+ e_day_view_start_editing_event (day_view, day, event_num, key_event);
+
+ g_object_unref (comp);
+ return TRUE;
+}
+
+static gboolean
+e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
+{
+ EDayView *day_view;
+ guint keyval;
+ gboolean stop_emission;
+
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -4865,12 +4938,6 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
return FALSE;
}
- /* Check if the client is read only */
- model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
- ecal = e_cal_model_get_default_client (model);
- if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
- return FALSE;
-
/* We only want to start an edit with a return key or a simple
character. */
if ((keyval != GDK_Return) &&
@@ -4881,64 +4948,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
return FALSE;
}
- /* Add a new event covering the selected range */
- icalcomp = e_cal_model_create_component_with_defaults (model);
- if (!icalcomp)
- return FALSE;
- uid = icalcomponent_get_uid (icalcomp);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend);
-
- start_tt = icaltime_from_timet_with_zone (dtstart, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- end_tt = icaltime_from_timet_with_zone (dtend, FALSE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- if (day_view->selection_in_top_canvas) {
- start_dt.tzid = NULL;
- start_tt.is_date = 1;
- end_tt.is_date = 1;
-
- /* Editor default in day/work-week view - top canvas */
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
- } else {
- start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
-
- /* Editor default in day/work-week view - main canvas */
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
- }
-
- start_dt.value = &start_tt;
- end_dt.value = &end_tt;
- end_dt.tzid = start_dt.tzid;
- e_cal_component_set_dtstart (comp, &start_dt);
- e_cal_component_set_dtend (comp, &end_dt);
-
- e_cal_component_set_categories (
- comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view)));
-
- /* We add the event locally and start editing it. We don't send it
- to the server until the user finishes editing it. */
- add_event_data.day_view = day_view;
- add_event_data.comp_data = NULL;
- e_day_view_add_event (comp, dtstart, dtend, &add_event_data);
- e_day_view_check_layout (day_view);
- gtk_widget_queue_draw (day_view->top_canvas);
- gtk_widget_queue_draw (day_view->main_canvas);
-
- if (e_day_view_find_event_from_uid (day_view, ecal, uid, NULL, &day, &event_num)) {
- e_day_view_start_editing_event (day_view, day, event_num, event);
- } else {
- g_warning ("Couldn't find event to start editing.\n");
- }
-
- g_object_unref (comp);
-
- return TRUE;
+ return e_day_view_add_new_event_in_selected_range (day_view, event);
}
static gboolean
@@ -5861,6 +5871,15 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
ECalendarViewPosition pos;
gboolean main_canvas = TRUE;
+ if (day_view->editing_event_num != -1)
+ break;
+
+ if (day_view->resize_event_num != -1)
+ break;
+
+ if (day_view->drag_event_num != -1)
+ break;
+
/* Convert the coords to the main canvas window, or return if the
window is not found. */
if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event,
@@ -5889,15 +5908,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item,
}
if (pos == E_CALENDAR_VIEW_POS_OUTSIDE)
- return FALSE;
-
- if (day_view->editing_event_num != -1)
- break;
-
- if (day_view->resize_event_num != -1)
break;
- if (day_view->drag_event_num != -1)
+ /* even when returns position inside, or other, then the day and/or event_num
+ can be unknown, thus check for this here, otherwise it will crash later */
+ if (day == -1 || event_num == -1)
break;
pevent = tooltip_get_view_event (day_view, day, event_num);
@@ -7848,3 +7863,34 @@ e_day_view_get_num_events_selected (EDayView *day_view)
return (day_view->editing_event_day != -1) ? 1 : 0;
}
+
+static void
+e_day_view_paste_text (ECalendarView *cal_view)
+{
+ EDayView *day_view;
+ EDayViewEvent *event;
+
+ g_return_if_fail (E_IS_DAY_VIEW (cal_view));
+
+ day_view = E_DAY_VIEW (cal_view);
+
+ if (day_view->editing_event_num == -1 &&
+ !e_day_view_add_new_event_in_selected_range (day_view, NULL))
+ return;
+
+ if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT) {
+ event = &g_array_index (day_view->long_events,
+ EDayViewEvent,
+ day_view->editing_event_num);
+ } else {
+ event = &g_array_index (day_view->events[day_view->editing_event_day],
+ EDayViewEvent,
+ day_view->editing_event_num);
+ }
+
+ if (event->canvas_item &&
+ E_IS_TEXT (event->canvas_item) &&
+ E_TEXT (event->canvas_item)->editing) {
+ e_text_paste_clipboard (E_TEXT (event->canvas_item));
+ }
+}
diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c
index 2ac77a7be6..427511b044 100644
--- a/calendar/gui/e-week-view.c
+++ b/calendar/gui/e-week-view.c
@@ -113,6 +113,7 @@ static GList *e_week_view_get_selected_events (ECalendarView *cal_view);
static gboolean e_week_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
static void e_week_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time);
static gboolean e_week_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time);
+static void e_week_view_paste_text (ECalendarView *week_view);
static void e_week_view_update_query (EWeekView *week_view);
static void e_week_view_draw_shadow (EWeekView *week_view);
@@ -224,6 +225,7 @@ e_week_view_class_init (EWeekViewClass *class)
view_class->get_selected_time_range = e_week_view_get_selected_time_range;
view_class->set_selected_time_range = e_week_view_set_selected_time_range;
view_class->get_visible_time_range = e_week_view_get_visible_time_range;
+ view_class->paste_text = e_week_view_paste_text;
#if 0 /* KILL-BONOBO */
/* init the accessibility support for e_week_view */
@@ -3929,7 +3931,7 @@ e_week_view_cursor_key_right (EWeekView *week_view, GnomeCalendarViewType view_t
}
static gboolean
-e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
+e_week_view_add_new_event_in_selected_range (EWeekView *week_view, const gchar *initial_text)
{
#if 0 /* KILL-BONOBO */
EWeekView *week_view;
@@ -3938,15 +3940,96 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
ECalComponent *comp;
icalcomponent *icalcomp;
gint event_num;
- gchar *initial_text;
ECalComponentDateTime date;
struct icaltimetype itt;
time_t dtstart, dtend;
const char *uid;
AddEventData add_event_data;
- guint keyval;
gboolean read_only = TRUE;
+ EWeekViewEvent *wvevent;
+ EWeekViewEventSpan *span;
+
+ /* Check if the client is read only */
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
+ ecal = e_cal_model_get_default_client (model);
+ if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
+ return FALSE;
+
+ /* Add a new event covering the selected range. */
+ icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)));
+ if (!icalcomp)
+ return FALSE;
+ uid = icalcomponent_get_uid (icalcomp);
+
+ comp = e_cal_component_new ();
+ e_cal_component_set_icalcomponent (comp, icalcomp);
+
+ dtstart = week_view->day_starts[week_view->selection_start_day];
+ dtend = week_view->day_starts[week_view->selection_end_day + 1];
+
+ date.value = &itt;
+ date.tzid = NULL;
+
+ /* We use DATE values now, so we don't need the timezone. */
+ /*date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));*/
+
+ *date.value = icaltime_from_timet_with_zone (dtstart, TRUE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ e_cal_component_set_dtstart (comp, &date);
+
+ *date.value = icaltime_from_timet_with_zone (dtend, TRUE,
+ e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
+ e_cal_component_set_dtend (comp, &date);
+
+ /* Editor default in week/month view */
+ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
+
+ e_cal_component_set_categories (
+ comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (week_view)));
+
+ /* We add the event locally and start editing it. We don't send it
+ to the server until the user finishes editing it. */
+ add_event_data.week_view = week_view;
+ add_event_data.comp_data = NULL;
+ e_week_view_add_event (comp, dtstart, dtend, TRUE, &add_event_data);
+ e_week_view_check_layout (week_view);
+ gtk_widget_queue_draw (week_view->main_canvas);
+
+ if (!e_week_view_find_event_from_uid (week_view, ecal, uid, NULL, &event_num)) {
+ g_warning ("Couldn't find event to start editing.\n");
+ g_object_unref (comp);
+ return FALSE;
+ }
+
+ wvevent = &g_array_index (week_view->events, EWeekViewEvent,
+ event_num);
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ wvevent->spans_index + 0);
+
+ /* If the event can't be fit on the screen, don't try to edit it. */
+ if (!span->text_item) {
+ e_week_view_foreach_event_with_uid (week_view, uid,
+ e_week_view_remove_event_cb, NULL);
+ g_object_unref (comp);
+ return FALSE;
+ } else {
+ e_week_view_start_editing_event (week_view, event_num, 0,
+ (gchar *) initial_text);
+ }
+
+ g_object_unref (comp);
+
+ return TRUE;
+}
+
+static gboolean
+e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
+{
+ EWeekView *week_view;
+ gchar *initial_text;
+ guint keyval;
gboolean stop_emission;
+ gboolean ret_val;
GnomeCalendarViewType view_type;
g_return_val_if_fail (widget != NULL, FALSE);
@@ -4022,12 +4105,6 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
if (week_view->selection_start_day == -1)
return FALSE;
- /* Check if the client is read only */
- model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view));
- ecal = e_cal_model_get_default_client (model);
- if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
- return FALSE;
-
/* We only want to start an edit with a return key or a simple
character. */
if (event->keyval == GDK_Return) {
@@ -4040,75 +4117,13 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
} else
initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
- /* Add a new event covering the selected range. */
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)));
- if (!icalcomp)
- return FALSE;
- uid = icalcomponent_get_uid (icalcomp);
-
- comp = e_cal_component_new ();
- e_cal_component_set_icalcomponent (comp, icalcomp);
-
- dtstart = week_view->day_starts[week_view->selection_start_day];
- dtend = week_view->day_starts[week_view->selection_end_day + 1];
-
- date.value = &itt;
- date.tzid = NULL;
-
- /* We use DATE values now, so we don't need the timezone. */
- /*date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));*/
-
- *date.value = icaltime_from_timet_with_zone (dtstart, TRUE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtstart (comp, &date);
-
- *date.value = icaltime_from_timet_with_zone (dtend, TRUE,
- e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtend (comp, &date);
-
- /* Editor default in week/month view */
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT);
-
- e_cal_component_set_categories (
- comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (week_view)));
-
- /* We add the event locally and start editing it. We don't send it
- to the server until the user finishes editing it. */
- add_event_data.week_view = week_view;
- add_event_data.comp_data = NULL;
- e_week_view_add_event (comp, dtstart, dtend, TRUE, &add_event_data);
- e_week_view_check_layout (week_view);
- gtk_widget_queue_draw (week_view->main_canvas);
-
- if (e_week_view_find_event_from_uid (week_view, ecal, uid, NULL, &event_num)) {
- EWeekViewEvent *wvevent;
- EWeekViewEventSpan *span;
-
- wvevent = &g_array_index (week_view->events, EWeekViewEvent,
- event_num);
- span = &g_array_index (week_view->spans, EWeekViewEventSpan,
- wvevent->spans_index + 0);
-
- /* If the event can't be fit on the screen, don't try to edit it. */
- if (!span->text_item) {
- e_week_view_foreach_event_with_uid (week_view, uid,
- e_week_view_remove_event_cb, NULL);
- } else {
- e_week_view_start_editing_event (week_view, event_num, 0,
- initial_text);
- }
-
- } else {
- g_warning ("Couldn't find event to start editing.\n");
- }
+ ret_val = e_week_view_add_new_event_in_selected_range (week_view, initial_text);
if (initial_text)
g_free (initial_text);
- g_object_unref (comp);
+ return ret_val;
#endif
-
- return TRUE;
}
static gint
@@ -4368,3 +4383,30 @@ e_week_view_is_jump_button_visible (EWeekView *week_view, gint day)
return week_view->jump_buttons[day]->object.flags & GNOME_CANVAS_ITEM_VISIBLE;
return FALSE;
}
+
+static void
+e_week_view_paste_text (ECalendarView *cal_view)
+{
+ EWeekViewEvent *event;
+ EWeekViewEventSpan *span;
+ EWeekView *week_view;
+
+ g_return_if_fail (E_IS_WEEK_VIEW (cal_view));
+
+ week_view = E_WEEK_VIEW (cal_view);
+
+ if (week_view->editing_event_num == -1 &&
+ !e_week_view_add_new_event_in_selected_range (week_view, NULL))
+ return;
+
+ event = &g_array_index (week_view->events, EWeekViewEvent,
+ week_view->editing_event_num);
+ span = &g_array_index (week_view->spans, EWeekViewEventSpan,
+ event->spans_index + week_view->editing_span_num);
+
+ if (span->text_item &&
+ E_IS_TEXT (span->text_item) &&
+ E_TEXT (span->text_item)->editing) {
+ e_text_paste_clipboard (E_TEXT (span->text_item));
+ }
+}
diff --git a/calendar/gui/goto-dialog.glade b/calendar/gui/goto-dialog.glade
index 31a61ce9ff..ab832f335d 100644
--- a/calendar/gui/goto-dialog.glade
+++ b/calendar/gui/goto-dialog.glade
@@ -192,7 +192,7 @@
<property name="update_policy">GTK_UPDATE_IF_VALID</property>
<property name="snap_to_ticks">False</property>
<property name="wrap">False</property>
- <property name="adjustment">1969 1969 2038 1 5 10</property>
+ <property name="adjustment">1969 1969 2038 1 5 0</property>
</widget>
<packing>
<property name="padding">0</property>
diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c
index 5a954b5ff9..5b292e1901 100644
--- a/calendar/gui/itip-utils.c
+++ b/calendar/gui/itip-utils.c
@@ -1147,7 +1147,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
gchar *subject = NULL;
gboolean retval = FALSE;
- /* check whether backend could handle sending requests/updates */
+ /* check whether backend could handle auto-saving requests/updates */
if (method != E_CAL_COMPONENT_METHOD_PUBLISH && e_cal_get_save_schedules (client))
return TRUE;
@@ -1157,6 +1157,15 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
goto cleanup;
}
+ /* check whether backend could handle sending requests/updates */
+ if (method != E_CAL_COMPONENT_METHOD_PUBLISH && e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) {
+ if (users) {
+ g_list_foreach (users, (GFunc) g_free, NULL);
+ g_list_free (users);
+ }
+ return TRUE;
+ }
+
/* Tidy up the comp */
comp = comp_compliant (method, send_comp, client, zones);
diff --git a/calendar/gui/memotypes.xml b/calendar/gui/memotypes.xml
index 3b9a560a96..1872461ab4 100644
--- a/calendar/gui/memotypes.xml
+++ b/calendar/gui/memotypes.xml
@@ -99,75 +99,7 @@
</option>
</input>
<input type="optionlist" name="category">
- <option value="Anniversary">
- <_title>Anniversary</_title>
- </option>
- <option value="Holiday">
- <_title>Holiday</_title>
- </option>
- <option value="Ideas">
- <_title>Ideas</_title>
- </option>
- <option value="Status">
- <_title>Status</_title>
- </option>
- <option value="Holiday Cards">
- <_title>Holiday Cards</_title>
- </option>
- <option value="Hot Contacts">
- <_title>Hot Contacts</_title>
- </option>
- <option value="International">
- <_title>International</_title>
- </option>
- <option value="Next 7 days">
- <_title>Next 7 Days</_title>
- </option>
- <option value="Birthday">
- <_title>Birthday</_title>
- </option>
- <option value="VIP">
- <_title>VIP</_title>
- </option>
- <option value="Gifts">
- <_title>Gifts</_title>
- </option>
- <option value="Waiting">
- <_title>Waiting</_title>
- </option>
- <option value="Key Customer">
- <_title>Key Customer</_title>
- </option>
- <option value="Time &amp; Expenses">
- <_title>Time &amp; Expenses</_title>
- </option>
- <option value="Miscellaneous">
- <_title>Miscellaneous</_title>
- </option>
- <option value="Business">
- <_title>Business</_title>
- </option>
- <option value="Personal">
- <_title>Personal</_title>
- </option>
- <option value="Suppliers">
- <_title>Suppliers</_title>
- </option>
- <option value="Goals/Objectives">
- <_title>Goals/Objectives</_title>
- </option>
- <option value="Strategies">
- <_title>Strategies</_title>
- </option>
- <option value="Competition">
- <_title>Competition</_title>
- </option>
- <option value="Favourites">
- <_title>Favourites</_title>
- </option>
- <option value="Phone Calls">
- <_title>Phone Calls</_title>
- </option>
+ <dynamic func="e_util_get_category_filter_options"/>
</input>
</part>
diff --git a/calendar/gui/tasktypes.xml b/calendar/gui/tasktypes.xml
index ee560addf3..cd9876bd29 100644
--- a/calendar/gui/tasktypes.xml
+++ b/calendar/gui/tasktypes.xml
@@ -165,76 +165,7 @@
</option>
</input>
<input type="optionlist" name="category">
- <option value="Anniversary">
- <_title>Anniversary</_title>
- </option>
- <option value="Holiday">
- <_title>Holiday</_title>
- </option>
- <option value="Ideas">
- <_title>Ideas</_title>ke
- </option>
- <option value="Status">
- <_title>Status</_title>
- </option>
- <option value="Holiday Cards">
- <_title>Holiday Cards</_title>
- </option>
- <option value="Hot Contacts">
- <_title>Hot Contacts</_title>
- </option>
- <option value="International">
- <_title>International</_title>
- </option>
- <option value="Next 7 Days">
- <_title>Next 7 Days</_title>
- </option>
- <option value="Birthday">
- <_title>Birthday</_title>
- </option>
- <option value="VIP">
- <_title>VIP</_title>
- </option>
- <option value="Gifts">
- <_title>Gifts</_title>
- </option>
- <option value="Waiting">
- <_title>Waiting</_title>
- </option>
- <option value="Key Customer">
- <_title>Key Customer</_title>
- </option>
- <option value="Time &amp; Expenses">
- <_title>Time &amp; Expenses </_title>
- </option>
- <option value="Miscellaneous">
- <_title>Miscellaneous</_title>
- </option>
- <option value="Business">
- <_title>Business</_title>
- </option>
- <option value="Personal">
- ke
- <_title>Personal</_title>
- </option>
- <option value="Suppliers">
- <_title>Suppliers</_title>
- </option>
- <option value="Goals/Objectives">
- <_title>Goals/Objectives</_title>
- </option>
- <option value="Strategies">
- <_title>Strategies</_title>
- </option>
- <option value="Competition">
- <_title>Competition</_title>
- </option>
- <option value="Favourites">
- <_title>Favourites</_title>
- </option>
- <option value="Phone Calls">
- <_title>Phone Calls</_title>
- </option>
+ <dynamic func="e_util_get_category_filter_options"/>
</input>
</part>