evolution r37112 - in branches/kill-bonobo: . addressbook/gui/component addressbook/util calendar calendar/common calendar/conduits/calendar calendar/gui calendar/gui/dialogs calendar/modules e-util help help/C/figures help/es mail plugins/itip-formatter plugins/pst-import po ui
- From: mbarnes svn gnome org
- To: svn-commits-list gnome org
- Subject: evolution r37112 - in branches/kill-bonobo: . addressbook/gui/component addressbook/util calendar calendar/common calendar/conduits/calendar calendar/gui calendar/gui/dialogs calendar/modules e-util help help/C/figures help/es mail plugins/itip-formatter plugins/pst-import po ui
- Date: Wed, 21 Jan 2009 02:52:05 +0000 (UTC)
Author: mbarnes
Date: Wed Jan 21 02:52:05 2009
New Revision: 37112
URL: http://svn.gnome.org/viewvc/evolution?rev=37112&view=rev
Log:
Merge revisions 37075:37107 from trunk.
Added:
branches/kill-bonobo/plugins/pst-import/
- copied from r37107, /trunk/plugins/pst-import/
Modified:
branches/kill-bonobo/ (props changed)
branches/kill-bonobo/ChangeLog
branches/kill-bonobo/addressbook/gui/component/eab-composer-util.c (props changed)
branches/kill-bonobo/addressbook/gui/component/eab-composer-util.h (props changed)
branches/kill-bonobo/addressbook/util/addressbook.c (props changed)
branches/kill-bonobo/addressbook/util/addressbook.h (props changed)
branches/kill-bonobo/calendar/ChangeLog
branches/kill-bonobo/calendar/common/authentication.c
branches/kill-bonobo/calendar/conduits/calendar/calendar-conduit.c
branches/kill-bonobo/calendar/gui/apps_evolution_calendar.schemas.in
branches/kill-bonobo/calendar/gui/calendar-config-keys.h
branches/kill-bonobo/calendar/gui/calendar-config.c
branches/kill-bonobo/calendar/gui/calendar-config.h
branches/kill-bonobo/calendar/gui/comp-editor-factory.c
branches/kill-bonobo/calendar/gui/comp-util.c
branches/kill-bonobo/calendar/gui/comp-util.h
branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.c
branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.glade
branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.h
branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c
branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h
branches/kill-bonobo/calendar/gui/dialogs/event-editor.c
branches/kill-bonobo/calendar/gui/dialogs/send-comp.c
branches/kill-bonobo/calendar/gui/dialogs/send-comp.h
branches/kill-bonobo/calendar/gui/dialogs/task-editor.c
branches/kill-bonobo/calendar/gui/e-cal-model-calendar.c
branches/kill-bonobo/calendar/gui/e-cal-model.c
branches/kill-bonobo/calendar/gui/e-cal-model.h
branches/kill-bonobo/calendar/gui/e-calendar-view.c
branches/kill-bonobo/calendar/gui/e-day-view-layout.c
branches/kill-bonobo/calendar/gui/e-day-view-layout.h
branches/kill-bonobo/calendar/gui/e-day-view.c
branches/kill-bonobo/calendar/gui/e-day-view.h
branches/kill-bonobo/calendar/gui/e-itip-control.c
branches/kill-bonobo/calendar/gui/e-week-view.c
branches/kill-bonobo/calendar/gui/gnome-cal.c
branches/kill-bonobo/calendar/gui/itip-utils.c
branches/kill-bonobo/calendar/gui/itip-utils.h
branches/kill-bonobo/calendar/gui/print.c
branches/kill-bonobo/calendar/modules/e-cal-shell-content.c
branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c
branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
branches/kill-bonobo/configure.in
branches/kill-bonobo/e-util/ChangeLog
branches/kill-bonobo/e-util/e-plugin.c
branches/kill-bonobo/help/C/figures/account_editor_a.png
branches/kill-bonobo/help/C/figures/attach_reminder_a.png
branches/kill-bonobo/help/C/figures/evo_newmess_a.png
branches/kill-bonobo/help/C/figures/google_cal_view.png
branches/kill-bonobo/help/ChangeLog
branches/kill-bonobo/help/es/es.po
branches/kill-bonobo/mail/ChangeLog
branches/kill-bonobo/mail/em-composer-utils.c
branches/kill-bonobo/mail/em-composer-utils.h
branches/kill-bonobo/mail/filtertypes.xml
branches/kill-bonobo/mail/mail-session.c
branches/kill-bonobo/plugins/itip-formatter/ChangeLog
branches/kill-bonobo/plugins/itip-formatter/itip-formatter.c
branches/kill-bonobo/plugins/itip-formatter/itip-view.c
branches/kill-bonobo/plugins/itip-formatter/itip-view.h
branches/kill-bonobo/po/ChangeLog
branches/kill-bonobo/po/POTFILES.in
branches/kill-bonobo/po/ca.po
branches/kill-bonobo/po/de.po
branches/kill-bonobo/po/es.po
branches/kill-bonobo/po/he.po
branches/kill-bonobo/po/ru.po
branches/kill-bonobo/ui/evolution-mail-reader.ui (props changed)
Modified: branches/kill-bonobo/calendar/common/authentication.c
==============================================================================
--- branches/kill-bonobo/calendar/common/authentication.c (original)
+++ branches/kill-bonobo/calendar/common/authentication.c Wed Jan 21 02:52:05 2009
@@ -77,21 +77,21 @@
{
ESource *source = NULL;
const char *auth_domain = NULL, *component_name = NULL, *auth_type = NULL;
- char *key = NULL;
source = e_cal_get_source (ecal);
auth_domain = e_source_get_property (source, "auth-domain");
component_name = auth_domain ? auth_domain : "Calendar";
auth_type = e_source_get_property (source, "auth-type");
- if (auth_type)
- key = build_pass_key (ecal);
- else
- key = e_source_get_uri (source);
+ if (auth_type) {
+ char *key = NULL;
- e_passwords_forget_password (component_name, key);
+ key = build_pass_key (ecal);
+ e_passwords_forget_password (component_name, key);
+ g_free (key);
+ }
- g_free (key);
+ e_passwords_forget_password (component_name, e_source_get_uri (source));
}
ECal *
Modified: branches/kill-bonobo/calendar/conduits/calendar/calendar-conduit.c
==============================================================================
--- branches/kill-bonobo/calendar/conduits/calendar/calendar-conduit.c (original)
+++ branches/kill-bonobo/calendar/conduits/calendar/calendar-conduit.c Wed Jan 21 02:52:05 2009
@@ -1203,7 +1203,7 @@
{
ECalComponent *comp;
struct Appointment appt;
- struct icaltimetype now = icaltime_from_timet_with_zone (time (NULL), FALSE, timezone), it;
+ struct icaltimetype now = icaltime_current_time_with_zone (icaltimezone_get_utc_timezone ()), it;
struct icalrecurrencetype recur;
ECalComponentText summary = {NULL, NULL};
ECalComponentDateTime dt = {NULL, NULL};
Modified: branches/kill-bonobo/calendar/gui/apps_evolution_calendar.schemas.in
==============================================================================
--- branches/kill-bonobo/calendar/gui/apps_evolution_calendar.schemas.in (original)
+++ branches/kill-bonobo/calendar/gui/apps_evolution_calendar.schemas.in Wed Jan 21 02:52:05 2009
@@ -538,6 +538,18 @@
</locale>
</schema>
+ <schema>
+ <key>/schemas/apps/evolution/calendar/display/day_view_show_week_number</key>
+ <applyto>/apps/evolution/calendar/display/day_view_show_week_number</applyto>
+ <owner>evolution-calendar</owner>
+ <type>bool</type>
+ <default>false</default>
+ <locale name="C">
+ <short>Show week number in Day and Work Week View</short>
+ <long>Whether to show week number in the Day and Work Week View.</long>
+ </locale>
+ </schema>
+
<!-- Date navigator -->
<schema>
Modified: branches/kill-bonobo/calendar/gui/calendar-config-keys.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/calendar-config-keys.h (original)
+++ branches/kill-bonobo/calendar/gui/calendar-config-keys.h Wed Jan 21 02:52:05 2009
@@ -61,6 +61,7 @@
#define CALENDAR_CONFIG_COMPRESS_WEEKEND CALENDAR_CONFIG_PREFIX "/display/compress_weekend"
#define CALENDAR_CONFIG_SHOW_EVENT_END CALENDAR_CONFIG_PREFIX "/display/show_event_end"
#define CALENDAR_CONFIG_WORKING_DAYS CALENDAR_CONFIG_PREFIX "/display/working_days"
+#define CALENDAR_CONFIG_DV_WEEK_NUMBER CALENDAR_CONFIG_PREFIX "/display/day_view_show_week_number"
#define CALENDAR_CONFIG_DAY_SECOND_ZONE CALENDAR_CONFIG_PREFIX "/display/day_second_zone"
#define CALENDAR_CONFIG_DAY_SECOND_ZONES_LIST CALENDAR_CONFIG_PREFIX "/display/day_second_zones"
#define CALENDAR_CONFIG_DAY_SECOND_ZONES_MAX CALENDAR_CONFIG_PREFIX "/display/day_second_zones_max"
@@ -95,6 +96,11 @@
#define CALENDAR_CONFIG_TEMPLATE CALENDAR_CONFIG_PREFIX"/publish/template"
#define CALENDAR_CONFIG_SAVE_DIR CALENDAR_CONFIG_PREFIX"/audio_dir"
+
+/* Birthday & Anniversary reminder */
+#define CALENDAR_CONFIG_BA_REMINDER CALENDAR_CONFIG_PREFIX "/other/use_ba_reminder"
+#define CALENDAR_CONFIG_BA_REMINDER_INTERVAL CALENDAR_CONFIG_PREFIX "/other/ba_reminder_interval"
+#define CALENDAR_CONFIG_BA_REMINDER_UNITS CALENDAR_CONFIG_PREFIX "/other/ba_reminder_units"
G_END_DECLS
#endif
Modified: branches/kill-bonobo/calendar/gui/calendar-config.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/calendar-config.c (original)
+++ branches/kill-bonobo/calendar/gui/calendar-config.c Wed Jan 21 02:52:05 2009
@@ -106,6 +106,22 @@
}
}
+/* opposite function to 'units_to_string' */
+static CalUnits
+string_to_units (const char *units)
+{
+ CalUnits res;
+
+ if (units && !strcmp (units, "days"))
+ res = CAL_DAYS;
+ else if (units && !strcmp (units, "hours"))
+ res = CAL_HOURS;
+ else
+ res = CAL_MINUTES;
+
+ return res;
+}
+
/*
* Calendar Settings.
*/
@@ -678,6 +694,36 @@
*not_tcolor = gconf_client_notify_add (config, CALENDAR_CONFIG_MARCUS_BAINS_COLOR_TIMEBAR, func, data, NULL, NULL);
}
+/* Whether we show week number in the Day View. */
+gboolean
+calendar_config_get_dview_show_week_no (void)
+{
+ calendar_config_init ();
+
+ return gconf_client_get_bool (config, CALENDAR_CONFIG_DV_WEEK_NUMBER, NULL);
+}
+
+
+void
+calendar_config_set_dview_show_week_no (gboolean show_week_no)
+{
+ calendar_config_init ();
+
+ gconf_client_set_bool (config, CALENDAR_CONFIG_DV_WEEK_NUMBER, show_week_no, NULL);
+}
+
+guint
+calendar_config_add_notification_dview_show_week_no (GConfClientNotifyFunc func, gpointer data)
+{
+ guint id;
+
+ calendar_config_init ();
+
+ id = gconf_client_notify_add (config, CALENDAR_CONFIG_DV_WEEK_NUMBER, func, data, NULL, NULL);
+
+ return id;
+}
+
/* Whether we show week numbers in the Date Navigator. */
gboolean
calendar_config_get_dnav_show_week_no (void)
@@ -1424,13 +1470,7 @@
calendar_config_init ();
units = gconf_client_get_string (config, CALENDAR_CONFIG_DEFAULT_REMINDER_UNITS, NULL);
-
- if (units && !strcmp (units, "days"))
- cu = CAL_DAYS;
- else if (units && !strcmp (units, "hours"))
- cu = CAL_HOURS;
- else
- cu = CAL_MINUTES;
+ cu = string_to_units (units);
g_free (units);
return cu;
@@ -1451,6 +1491,59 @@
}
/**
+ * calendar_config_get_ba_reminder:
+ * Retrieves setup of the Birthdays & Anniversaries reminder.
+ *
+ * @interval: Retrieves the interval setup for the reminder; can be NULL.
+ * @units: Retrieves units for the interval; can be NULL.
+ *
+ * Returns whether the reminder is on or off. The values for interval and/or units
+ * are retrieved even when returns FALSE.
+ **/
+gboolean
+calendar_config_get_ba_reminder (int *interval, CalUnits *units)
+{
+ calendar_config_init ();
+
+ if (interval) {
+ *interval = gconf_client_get_int (config, CALENDAR_CONFIG_BA_REMINDER_INTERVAL, NULL);
+ }
+
+ if (units) {
+ char *str;
+
+ str = gconf_client_get_string (config, CALENDAR_CONFIG_BA_REMINDER_UNITS, NULL);
+ *units = string_to_units (str);
+ g_free (str);
+ }
+
+ return gconf_client_get_bool (config, CALENDAR_CONFIG_BA_REMINDER, NULL);
+}
+
+/**
+ * calendar_config_set_ba_reminder:
+ * Stores new values for Birthdays & Anniversaries reminder to GConf. Only those, which are not NULL.
+ *
+ * @enabled: The enabled state; can be NULL.
+ * @interval: The reminder interval; can be NULL.
+ * @units: The units of the reminder; can be NULL.
+ **/
+void
+calendar_config_set_ba_reminder (gboolean *enabled, int *interval, CalUnits *units)
+{
+ calendar_config_init ();
+
+ if (enabled)
+ gconf_client_set_bool (config, CALENDAR_CONFIG_BA_REMINDER, *enabled, NULL);
+
+ if (interval)
+ gconf_client_set_int (config, CALENDAR_CONFIG_BA_REMINDER_INTERVAL, *interval, NULL);
+
+ if (units)
+ gconf_client_set_string (config, CALENDAR_CONFIG_BA_REMINDER_UNITS, units_to_string (*units), NULL);
+}
+
+/**
* calendar_config_get_hide_completed_tasks_sexp:
*
* @get_completed: Whether to form subexpression that
Modified: branches/kill-bonobo/calendar/gui/calendar-config.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/calendar-config.h (original)
+++ branches/kill-bonobo/calendar/gui/calendar-config.h Wed Jan 21 02:52:05 2009
@@ -154,6 +154,11 @@
void calendar_config_set_dnav_show_week_no (gboolean show_week_no);
guint calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gpointer data);
+/* Whether we show week number in the day view. */
+gboolean calendar_config_get_dview_show_week_no (void);
+void calendar_config_set_dview_show_week_no (gboolean show_week_no);
+guint calendar_config_add_notification_dview_show_week_no (GConfClientNotifyFunc func, gpointer data);
+
/* The positions of the panes in the normal and month views. */
gint calendar_config_get_hpane_pos (void);
void calendar_config_set_hpane_pos (gint hpane_pos);
@@ -265,4 +270,8 @@
void calendar_config_select_day_second_zone (void);
guint calendar_config_add_notification_day_second_zone (GConfClientNotifyFunc func, gpointer data);
+/* Birthdays & Anniversaries reminder settings */
+gboolean calendar_config_get_ba_reminder (int *interval, CalUnits *units);
+void calendar_config_set_ba_reminder (gboolean *enabled, int *interval, CalUnits *units);
+
#endif /* _CALENDAR_CONFIG_H_ */
Modified: branches/kill-bonobo/calendar/gui/comp-editor-factory.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/comp-editor-factory.c (original)
+++ branches/kill-bonobo/calendar/gui/comp-editor-factory.c Wed Jan 21 02:52:05 2009
@@ -417,6 +417,12 @@
"%s", _("Permission denied to open the calendar"));
break;
+ case E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED:
+ dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
+ GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
+ "%s", _("Authentication Required"));
+ break;
+
case E_CALENDAR_STATUS_AUTHENTICATION_FAILED :
dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE,
Modified: branches/kill-bonobo/calendar/gui/comp-util.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/comp-util.c (original)
+++ branches/kill-bonobo/calendar/gui/comp-util.c Wed Jan 21 02:52:05 2009
@@ -530,3 +530,80 @@
return list;
}
+
+static void
+datetime_to_zone (ECal *client, ECalComponentDateTime *date, const char *tzid)
+{
+ icaltimezone *from, *to;
+
+ g_return_if_fail (date != NULL);
+
+ if (date->tzid == NULL || tzid == NULL ||
+ date->tzid == tzid || g_str_equal (date->tzid, tzid))
+ return;
+
+ from = icaltimezone_get_builtin_timezone_from_tzid (date->tzid);
+ if (!from) {
+ if (!e_cal_get_timezone (client, date->tzid, &from, NULL))
+ g_warning ("%s: Could not get timezone from server: %s", G_STRFUNC, date->tzid ? date->tzid : "");
+ }
+
+ to = icaltimezone_get_builtin_timezone_from_tzid (tzid);
+ if (!to) {
+ /* do not check failure here, maybe the zone is not available there */
+ e_cal_get_timezone (client, tzid, &to, NULL);
+ }
+
+ icaltimezone_convert_time (date->value, from, to);
+ date->tzid = tzid;
+}
+
+/**
+ * cal_comp_set_dtstart_with_oldzone:
+ * Changes 'dtstart' of the component, but converts time to the old timezone.
+ * @param client ECal structure, to retrieve timezone from, when required.
+ * @param comp Component, where make the change.
+ * @param pdate Value, to change to.
+ **/
+void
+cal_comp_set_dtstart_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate)
+{
+ ECalComponentDateTime olddate, date;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (pdate != NULL);
+
+ e_cal_component_get_dtstart (comp, &olddate);
+
+ date = *pdate;
+
+ datetime_to_zone (client, &date, olddate.tzid);
+ e_cal_component_set_dtstart (comp, &date);
+
+ e_cal_component_free_datetime (&olddate);
+}
+
+/**
+ * cal_comp_set_dtend_with_oldzone:
+ * Changes 'dtend' of the component, but converts time to the old timezone.
+ * @param client ECal structure, to retrieve timezone from, when required.
+ * @param comp Component, where make the change.
+ * @param pdate Value, to change to.
+ **/
+void
+cal_comp_set_dtend_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate)
+{
+ ECalComponentDateTime olddate, date;
+
+ g_return_if_fail (comp != NULL);
+ g_return_if_fail (pdate != NULL);
+
+ e_cal_component_get_dtend (comp, &olddate);
+
+ date = *pdate;
+
+ datetime_to_zone (client, &date, olddate.tzid);
+ e_cal_component_set_dtend (comp, &date);
+
+ e_cal_component_free_datetime (&olddate);
+}
Modified: branches/kill-bonobo/calendar/gui/comp-util.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/comp-util.h (original)
+++ branches/kill-bonobo/calendar/gui/comp-util.h Wed Jan 21 02:52:05 2009
@@ -54,4 +54,7 @@
void cal_comp_selection_set_string_list (GtkSelectionData *data, GSList *str_list);
GSList *cal_comp_selection_get_string_list (GtkSelectionData *data);
+void cal_comp_set_dtstart_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
+void cal_comp_set_dtend_with_oldzone (ECal *client, ECalComponent *comp, const ECalComponentDateTime *pdate);
+
#endif
Modified: branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.c Wed Jan 21 02:52:05 2009
@@ -49,6 +49,7 @@
CAL_MINUTES, CAL_HOURS, CAL_DAYS, -1
};
+/* same is used for Birthdays & Anniversaries calendar */
static const int default_reminder_units_map[] = {
CAL_MINUTES, CAL_HOURS, CAL_DAYS, -1
};
@@ -333,6 +334,12 @@
}
static void
+dview_show_week_no_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
+{
+ calendar_config_set_dview_show_week_no (gtk_toggle_button_get_active (toggle));
+}
+
+static void
hide_completed_tasks_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
{
gboolean hide;
@@ -408,6 +415,34 @@
}
static void
+ba_reminder_toggled (GtkToggleButton *toggle, CalendarPrefsDialog *prefs)
+{
+ gboolean enabled = gtk_toggle_button_get_active (toggle);
+
+ calendar_config_set_ba_reminder (&enabled, NULL, NULL);
+}
+
+static void
+ba_reminder_interval_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
+{
+ const gchar *str;
+ int value;
+
+ str = gtk_entry_get_text (GTK_ENTRY (widget));
+ value = (int) g_ascii_strtod (str, NULL);
+
+ calendar_config_set_ba_reminder (NULL, &value, NULL);
+}
+
+static void
+ba_reminder_units_changed (GtkWidget *widget, CalendarPrefsDialog *prefs)
+{
+ CalUnits units = e_dialog_combo_box_get (prefs->ba_reminder_units, default_reminder_units_map);
+
+ calendar_config_set_ba_reminder (NULL, NULL, &units);
+}
+
+static void
alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs)
{
ESourceList *source_list = prefs->alarms_list;
@@ -483,6 +518,7 @@
g_signal_connect (G_OBJECT (prefs->show_end_times), "toggled", G_CALLBACK (show_end_times_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->compress_weekend), "toggled", G_CALLBACK (compress_weekend_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->dnav_show_week_no), "toggled", G_CALLBACK (dnav_show_week_no_toggled), prefs);
+ g_signal_connect (G_OBJECT (prefs->dview_show_week_no), "toggled", G_CALLBACK (dview_show_week_no_toggled), prefs);
g_signal_connect (G_OBJECT (prefs->tasks_hide_completed), "toggled",
G_CALLBACK (hide_completed_tasks_toggled), prefs);
@@ -500,6 +536,11 @@
G_CALLBACK (default_reminder_interval_changed), prefs);
g_signal_connect (G_OBJECT (prefs->default_reminder_units), "changed", G_CALLBACK (default_reminder_units_changed), prefs);
+ g_signal_connect (G_OBJECT (prefs->ba_reminder), "toggled", G_CALLBACK (ba_reminder_toggled), prefs);
+ g_signal_connect (G_OBJECT (prefs->ba_reminder_interval), "changed",
+ G_CALLBACK (ba_reminder_interval_changed), prefs);
+ g_signal_connect (G_OBJECT (prefs->ba_reminder_units), "changed", G_CALLBACK (ba_reminder_units_changed), prefs);
+
g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs);
@@ -593,6 +634,8 @@
gboolean sensitive, set = FALSE;
icalcomponent *icalcomp, *dl_comp;
char *location;
+ CalUnits units;
+ int interval;
/* Timezone. */
location = calendar_config_get_timezone ();
@@ -654,6 +697,9 @@
/* Date Navigator - Show Week Numbers. */
e_dialog_toggle_set (prefs->dnav_show_week_no, calendar_config_get_dnav_show_week_no ());
+ /* Day/Work Week view - Show Week Number. */
+ e_dialog_toggle_set (prefs->dview_show_week_no, calendar_config_get_dview_show_week_no ());
+
/* Task list */
show_task_list_config (prefs);
@@ -668,6 +714,13 @@
e_dialog_toggle_set (prefs->default_reminder, calendar_config_get_use_default_reminder ());
e_dialog_spin_set (prefs->default_reminder_interval, calendar_config_get_default_reminder_interval ());
e_dialog_combo_box_set (prefs->default_reminder_units, calendar_config_get_default_reminder_units (), default_reminder_units_map);
+
+ /* Birthdays & Anniversaries reminder */
+ set = calendar_config_get_ba_reminder (&interval, &units);
+
+ e_dialog_toggle_set (prefs->ba_reminder, set);
+ e_dialog_spin_set (prefs->ba_reminder_interval, interval);
+ e_dialog_combo_box_set (prefs->ba_reminder_units, units, default_reminder_units_map);
}
/* plugin meta-data */
@@ -749,12 +802,16 @@
prefs->default_reminder = glade_xml_get_widget (gui, "default_reminder");
prefs->default_reminder_interval = glade_xml_get_widget (gui, "default_reminder_interval");
prefs->default_reminder_units = glade_xml_get_widget (gui, "default_reminder_units");
+ prefs->ba_reminder = glade_xml_get_widget (gui, "ba_reminder");
+ prefs->ba_reminder_interval = glade_xml_get_widget (gui, "ba_reminder_interval");
+ prefs->ba_reminder_units = glade_xml_get_widget (gui, "ba_reminder_units");
/* Display tab */
prefs->time_divisions = glade_xml_get_widget (gui, "time_divisions");
prefs->show_end_times = glade_xml_get_widget (gui, "show_end_times");
prefs->compress_weekend = glade_xml_get_widget (gui, "compress_weekend");
prefs->dnav_show_week_no = glade_xml_get_widget (gui, "dnav_show_week_no");
+ prefs->dview_show_week_no = glade_xml_get_widget (gui, "dview_show_week_no");
prefs->tasks_due_today_color = glade_xml_get_widget (gui, "tasks_due_today_color");
prefs->tasks_overdue_color = glade_xml_get_widget (gui, "tasks_overdue_color");
prefs->tasks_hide_completed = glade_xml_get_widget (gui, "tasks_hide_completed");
Modified: branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.glade
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.glade (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.glade Wed Jan 21 02:52:05 2009
@@ -950,6 +950,98 @@
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox25">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">4</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="ba_reminder">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show a _reminder</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkSpinButton" id="ba_reminder_interval">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="climb_rate">1</property>
+ <property name="digits">0</property>
+ <property name="numeric">False</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>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkComboBox" id="ba_reminder_units">
+ <property name="visible">True</property>
+ <property name="items" translatable="yes">Minutes
+Hours
+Days</property>
+ <property name="add_tearoffs">False</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="ba_reminder_label">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">before every anniversary/birthday</property>
+ <property name="use_underline">False</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>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="padding">0</property>
@@ -1176,6 +1268,24 @@
<property name="fill">False</property>
</packing>
</child>
+ <child>
+ <widget class="GtkCheckButton" id="dview_show_week_no">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show week n_umber in Day and Work Week View</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </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>
Modified: branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.h (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/cal-prefs-dialog.h Wed Jan 21 02:52:05 2009
@@ -55,12 +55,16 @@
GtkWidget *default_reminder;
GtkWidget *default_reminder_interval;
GtkWidget *default_reminder_units;
+ GtkWidget *ba_reminder;
+ GtkWidget *ba_reminder_interval;
+ GtkWidget *ba_reminder_units;
/* Display tab */
GtkWidget *time_divisions;
GtkWidget *show_end_times;
GtkWidget *compress_weekend;
GtkWidget *dnav_show_week_no;
+ GtkWidget *dview_show_week_no;
GtkWidget *tasks_due_today_color;
GtkWidget *tasks_overdue_color;
GtkWidget *tasks_hide_completed;
Modified: branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/comp-editor.c Wed Jan 21 02:52:05 2009
@@ -171,7 +171,7 @@
static void setup_widgets (CompEditor *editor);
static void real_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static gboolean real_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms);
static gboolean prompt_and_save_changes (CompEditor *editor, gboolean send);
static void close_dialog (CompEditor *editor);
@@ -897,6 +897,7 @@
CompEditorFlags flags;
gboolean send;
gboolean delegate;
+ gboolean strip_alarms = TRUE;
priv = editor->priv;
@@ -916,18 +917,18 @@
if (!save_comp (editor))
return FALSE;
- if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org))) {
+ if ((delegate && !e_cal_get_save_schedules (priv->client)) || (send && send_component_dialog ((GtkWindow *) editor, priv->client, priv->comp, !priv->existing_org, &strip_alarms))) {
if ((itip_organizer_is_user (priv->comp, priv->client) || itip_sentby_is_user (priv->comp))) {
if (e_cal_component_get_vtype (priv->comp) == E_CAL_COMPONENT_JOURNAL)
- return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_PUBLISH);
+ return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_PUBLISH, strip_alarms);
else
- return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST);
+ return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST, strip_alarms);
} else {
- if (!comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST))
+ if (!comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST, strip_alarms))
return FALSE;
if (delegate)
- return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REPLY);
+ return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REPLY, strip_alarms);
}
}
@@ -3083,7 +3084,7 @@
}
static gboolean
-real_send_comp (CompEditor *editor, ECalComponentItipMethod method)
+real_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms)
{
CompEditorPrivate *priv;
CompEditorFlags flags;
@@ -3129,7 +3130,7 @@
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)) {
+ NULL, NULL, users, strip_alarms)) {
g_object_unref (send_comp);
return TRUE;
}
@@ -3150,7 +3151,7 @@
/* mime_attach_list is freed by itip_send_comp */
mime_attach_list = comp_editor_get_mime_attach_list (editor);
if (itip_send_comp (method, send_comp, priv->client,
- NULL, mime_attach_list, users)) {
+ NULL, mime_attach_list, users, strip_alarms)) {
save_comp (editor);
g_object_unref (send_comp);
return TRUE;
@@ -3272,7 +3273,7 @@
*
**/
gboolean
-comp_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
+comp_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms)
{
CompEditorClass *class;
@@ -3281,7 +3282,7 @@
class = COMP_EDITOR_GET_CLASS (editor);
if (class->send_comp)
- return class->send_comp (editor, method);
+ return class->send_comp (editor, method, strip_alarms);
return FALSE;
}
Modified: branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/comp-editor.h Wed Jan 21 02:52:05 2009
@@ -67,7 +67,7 @@
/* Virtual functions */
void (*edit_comp) (CompEditor *page, ECalComponent *comp);
void (*object_created) (CompEditor *page);
- gboolean (*send_comp) (CompEditor *page, ECalComponentItipMethod method);
+ gboolean (*send_comp) (CompEditor *page, ECalComponentItipMethod method, gboolean strip_alarms);
void (*show_categories) (CompEditor *editor, gboolean visible);
void (*show_role) (CompEditor *editor, gboolean visible);
@@ -131,7 +131,8 @@
gboolean send);
void comp_editor_delete_comp (CompEditor *editor);
gboolean comp_editor_send_comp (CompEditor *editor,
- ECalComponentItipMethod method);
+ ECalComponentItipMethod method,
+ gboolean strip_alarms);
GSList * comp_editor_get_mime_attach_list(CompEditor *editor);
gboolean comp_editor_close (CompEditor *editor);
Modified: branches/kill-bonobo/calendar/gui/dialogs/event-editor.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/event-editor.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/event-editor.c Wed Jan 21 02:52:05 2009
@@ -98,7 +98,7 @@
"</ui>";
static void event_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static gboolean event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms);
G_DEFINE_TYPE (EventEditor, event_editor, TYPE_COMP_EDITOR)
@@ -619,7 +619,7 @@
}
static gboolean
-event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
+event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms)
{
EventEditorPrivate *priv;
ECalComponent *comp = NULL;
@@ -638,7 +638,7 @@
client = e_meeting_store_get_e_cal (priv->model);
result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- client, NULL, NULL, NULL);
+ client, NULL, NULL, NULL, strip_alarms);
g_object_unref (comp);
return result;
@@ -646,7 +646,7 @@
parent:
if (COMP_EDITOR_CLASS (event_editor_parent_class)->send_comp)
- return COMP_EDITOR_CLASS (event_editor_parent_class)->send_comp (editor, method);
+ return COMP_EDITOR_CLASS (event_editor_parent_class)->send_comp (editor, method, strip_alarms);
return FALSE;
}
Modified: branches/kill-bonobo/calendar/gui/dialogs/send-comp.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/send-comp.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/send-comp.c Wed Jan 21 02:52:05 2009
@@ -26,11 +26,44 @@
#include <config.h>
#endif
+#include <glib/gi18n-lib.h>
#include "e-util/e-error.h"
#include "send-comp.h"
+static gboolean
+have_nonprocedural_alarm (ECalComponent *comp)
+{
+ GList *uids, *l;
+
+ g_return_val_if_fail (comp != NULL, FALSE);
+
+ uids = e_cal_component_get_alarm_uids (comp);
+
+ for (l = uids; l; l = l->next) {
+ ECalComponentAlarm *alarm;
+ ECalComponentAlarmAction action = E_CAL_COMPONENT_ALARM_UNKNOWN;
+
+ alarm = e_cal_component_get_alarm (comp, (const char *)l->data);
+ if (alarm) {
+ e_cal_component_alarm_get_action (alarm, &action);
+ e_cal_component_alarm_free (alarm);
+
+ if (action != E_CAL_COMPONENT_ALARM_NONE &&
+ action != E_CAL_COMPONENT_ALARM_PROCEDURE &&
+ action != E_CAL_COMPONENT_ALARM_UNKNOWN) {
+ cal_obj_uid_list_free (uids);
+ return TRUE;
+ }
+ }
+ }
+
+ cal_obj_uid_list_free (uids);
+
+ return FALSE;
+}
+
/**
* send_component_dialog:
*
@@ -40,11 +73,14 @@
* Return value: TRUE if the user clicked Yes, FALSE otherwise.
**/
gboolean
-send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new)
+send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new, gboolean *strip_alarms)
{
ECalComponentVType vtype;
const char *id;
+ if (strip_alarms)
+ *strip_alarms = TRUE;
+
if (e_cal_get_save_schedules (client))
return FALSE;
@@ -72,10 +108,32 @@
return FALSE;
}
- if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES)
- return TRUE;
- else
- return FALSE;
+ if (strip_alarms && have_nonprocedural_alarm (comp)) {
+ GtkWidget *dialog, *checkbox, *align;
+ gboolean res;
+
+ dialog = e_error_new (parent, id, NULL);
+ checkbox = gtk_check_button_new_with_label (_("Send my alarms with this event"));
+ align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+ gtk_container_add (GTK_CONTAINER (align), checkbox);
+ gtk_widget_show (checkbox);
+ gtk_box_pack_end (GTK_BOX (GTK_DIALOG (dialog)->vbox), align, TRUE, TRUE, 6);
+ gtk_widget_show (align);
+
+ res = gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_YES;
+
+ if (res)
+ *strip_alarms = !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
+
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+
+ return res;
+ } else {
+ if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES)
+ return TRUE;
+ else
+ return FALSE;
+ }
}
gboolean
Modified: branches/kill-bonobo/calendar/gui/dialogs/send-comp.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/send-comp.h (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/send-comp.h Wed Jan 21 02:52:05 2009
@@ -28,7 +28,7 @@
#include <libecal/e-cal.h>
#include <libecal/e-cal-component.h>
-gboolean send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new);
+gboolean send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gboolean new, gboolean *strip_alarms);
gboolean send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *comp);
#endif
Modified: branches/kill-bonobo/calendar/gui/dialogs/task-editor.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/dialogs/task-editor.c (original)
+++ branches/kill-bonobo/calendar/gui/dialogs/task-editor.c Wed Jan 21 02:52:05 2009
@@ -87,7 +87,7 @@
"</ui>";
static void task_editor_edit_comp (CompEditor *editor, ECalComponent *comp);
-static gboolean task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method);
+static gboolean task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms);
G_DEFINE_TYPE (TaskEditor, task_editor, TYPE_COMP_EDITOR)
@@ -445,7 +445,7 @@
}
static gboolean
-task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method)
+task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method, gboolean strip_alarms)
{
TaskEditorPrivate *priv;
ECalComponent *comp = NULL;
@@ -464,7 +464,7 @@
client = e_meeting_store_get_e_cal (priv->model);
result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- client, NULL, NULL, NULL);
+ client, NULL, NULL, NULL, strip_alarms);
g_object_unref (comp);
if (!result)
@@ -473,7 +473,7 @@
parent:
if (COMP_EDITOR_CLASS (task_editor_parent_class)->send_comp)
- return COMP_EDITOR_CLASS (task_editor_parent_class)->send_comp (editor, method);
+ return COMP_EDITOR_CLASS (task_editor_parent_class)->send_comp (editor, method, strip_alarms);
return FALSE;
}
Modified: branches/kill-bonobo/calendar/gui/e-cal-model-calendar.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-cal-model-calendar.c (original)
+++ branches/kill-bonobo/calendar/gui/e-cal-model-calendar.c Wed Jan 21 02:52:05 2009
@@ -382,8 +382,10 @@
}
if (e_cal_modify_object (comp_data->client, comp_data->icalcomp, mod, NULL)) {
+ gboolean strip_alarms = TRUE;
+
if (itip_organizer_is_user (comp, comp_data->client) &&
- send_component_dialog (NULL, comp_data->client, comp, FALSE)) {
+ send_component_dialog (NULL, comp_data->client, comp, FALSE, &strip_alarms)) {
ECalComponent *send_comp = NULL;
if (mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (comp)) {
@@ -403,7 +405,7 @@
}
itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp,
- comp_data->client, NULL, NULL, NULL);
+ comp_data->client, NULL, NULL, NULL, strip_alarms);
if (send_comp)
g_object_unref (send_comp);
Modified: branches/kill-bonobo/calendar/gui/e-cal-model.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-cal-model.c (original)
+++ branches/kill-bonobo/calendar/gui/e-cal-model.c Wed Jan 21 02:52:05 2009
@@ -77,6 +77,10 @@
/* Whether we display dates in 24-hour format. */
gboolean use_24_hour_format;
+
+ /* callback, to retrieve start time for newly added rows by click-to-add */
+ ECalModelDefaultTimeFunc get_default_time;
+ gpointer get_default_time_user_data;
};
#define E_CAL_MODEL_COMPONENT_GET_PRIVATE(obj) \
@@ -816,9 +820,26 @@
set_categories (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_CATEGORIES, row));
set_classification (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_CLASSIFICATION, row));
set_description (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_DESCRIPTION, row));
- set_dtstart (model, &comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_DTSTART, row));
set_summary (&comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_SUMMARY, row));
+ if (e_table_model_value_at (source, E_CAL_MODEL_FIELD_DTSTART, row)) {
+ set_dtstart (model, &comp_data, e_table_model_value_at (source, E_CAL_MODEL_FIELD_DTSTART, row));
+ } else if (model->priv->get_default_time) {
+ time_t tt = model->priv->get_default_time (model, model->priv->get_default_time_user_data);
+
+ if (tt > 0) {
+ struct icaltimetype itt = icaltime_from_timet_with_zone (tt, FALSE, e_cal_model_get_timezone (model));
+ icalproperty *prop = icalcomponent_get_first_property (comp_data.icalcomp, ICAL_DTSTART_PROPERTY);
+
+ if (prop) {
+ icalproperty_set_dtstart (prop, itt);
+ } else {
+ prop = icalproperty_new_dtstart (itt);
+ icalcomponent_add_property (comp_data.icalcomp, prop);
+ }
+ }
+ }
+
/* call the class' method for filling the component */
model_class = (ECalModelClass *) G_OBJECT_GET_CLASS (model);
if (model_class->fill_component_from_model != NULL) {
@@ -2460,3 +2481,17 @@
}
comp_data->instance_end = icaltime_as_timet_with_zone (end_time, zone);
}
+
+/**
+ * e_cal_model_set_default_time_func:
+ * This function will be used when creating new item from the "click-to-add",
+ * when user didn't fill a start date there.
+ **/
+void
+e_cal_model_set_default_time_func (ECalModel *model, ECalModelDefaultTimeFunc func, gpointer user_data)
+{
+ g_return_if_fail (E_IS_CAL_MODEL (model));
+
+ model->priv->get_default_time = func;
+ model->priv->get_default_time_user_data = user_data;
+}
Modified: branches/kill-bonobo/calendar/gui/e-cal-model.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-cal-model.h (original)
+++ branches/kill-bonobo/calendar/gui/e-cal-model.h Wed Jan 21 02:52:05 2009
@@ -121,6 +121,8 @@
void (* cal_view_done) (ECalModel *model, ECalendarStatus status, ECalSourceType type);
} ECalModelClass;
+typedef time_t (*ECalModelDefaultTimeFunc)(ECalModel *model, gpointer user_data);
+
GType e_cal_model_get_type (void);
GType e_cal_model_component_get_type (void);
icalcomponent_kind e_cal_model_get_component_kind (ECalModel *model);
@@ -184,6 +186,8 @@
gboolean e_cal_model_test_row_editable (ECalModel *model, int row);
+void e_cal_model_set_default_time_func (ECalModel *model, ECalModelDefaultTimeFunc func, gpointer user_data);
+
G_END_DECLS
#endif
Modified: branches/kill-bonobo/calendar/gui/e-calendar-view.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-calendar-view.c (original)
+++ branches/kill-bonobo/calendar/gui/e-calendar-view.c Wed Jan 21 02:52:05 2009
@@ -372,6 +372,8 @@
/* FIXME Error handling */
uid = NULL;
if (e_cal_create_object (client, e_cal_component_get_icalcomponent (comp), &uid, NULL)) {
+ gboolean strip_alarms = TRUE;
+
if (uid) {
e_cal_component_set_uid (comp, uid);
g_free (uid);
@@ -379,9 +381,9 @@
if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) &&
send_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
- client, comp, TRUE)) {
+ client, comp, TRUE, &strip_alarms)) {
itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp,
- client, NULL, NULL, NULL);
+ client, NULL, NULL, NULL, strip_alarms);
}
} else {
g_message (G_STRLOC ": Could not create the object!");
@@ -635,7 +637,7 @@
&& cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)),
event->comp_data->client, comp, TRUE))
itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL, NULL, NULL);
+ event->comp_data->client, NULL, NULL, NULL, TRUE);
e_cal_component_get_uid (comp, &uid);
if (e_cal_component_is_instance (comp)) {
@@ -985,7 +987,7 @@
event->comp_data->client,
comp, TRUE))
itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp,
- event->comp_data->client, NULL, NULL, NULL);
+ event->comp_data->client, NULL, NULL, NULL, TRUE);
e_cal_component_get_uid (comp, &uid);
if (!uid || !*uid) {
@@ -1134,7 +1136,7 @@
e_cal_component_free_datetime (&range.datetime);
}
- itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, event->comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, event->comp_data->client, NULL, NULL, NULL, TRUE);
}
if (is_instance)
@@ -1312,7 +1314,28 @@
if (!e_cal_modify_object (dest_client, event->comp_data->icalcomp, CALOBJ_MOD_ALL, NULL))
return;
} else {
- orig_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
+ if (e_cal_util_component_is_instance (event->comp_data->icalcomp)) {
+ icalcomponent *icalcomp = NULL;
+
+ if (e_cal_get_object (event->comp_data->client, uid, NULL, &icalcomp, NULL)) {
+ /* use master object when working with recurring event */
+ orig_icalcomp = icalcomponent_new_clone (icalcomp);
+ icalcomponent_free (icalcomp);
+ } else {
+ /* ... or remove the recurrence id property... */
+ orig_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
+
+ if (e_cal_util_component_has_recurrences (orig_icalcomp)) {
+ /* ... for non-detached instances, to make it a master object */
+ icalproperty *prop;
+
+ prop = icalcomponent_get_first_property (orig_icalcomp, ICAL_RECURRENCEID_PROPERTY);
+ if (prop)
+ icalcomponent_remove_property (orig_icalcomp, prop);
+ }
+ }
+ } else
+ orig_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp);
icalprop = icalproperty_new_x ("1");
icalproperty_set_x_name (icalprop, "X-EVOLUTION-MOVE-CALENDAR");
@@ -1339,10 +1362,16 @@
/* remove the item from the source calendar */
if (remove_item) {
- if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_is_instance (event->comp_data->icalcomp))
- e_cal_remove_object_with_mod (event->comp_data->client, uid,
- NULL, CALOBJ_MOD_ALL, NULL);
- else
+ if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) {
+ char *rid = NULL;
+ struct icaltimetype recur_id = icalcomponent_get_recurrenceid (event->comp_data->icalcomp);
+
+ if (!icaltime_is_null_time (recur_id))
+ rid = icaltime_as_ical_string (recur_id);
+
+ e_cal_remove_object_with_mod (event->comp_data->client, uid, rid, CALOBJ_MOD_ALL, NULL);
+ g_free (rid);
+ } else
e_cal_remove_object (event->comp_data->client, uid, NULL);
}
}
@@ -1521,7 +1550,7 @@
comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp));
- itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, event->comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_PUBLISH, comp, event->comp_data->client, NULL, NULL, NULL, TRUE);
g_list_free (selected);
g_object_unref (comp);
@@ -1629,10 +1658,10 @@
*date.value = icaltime_from_timet_with_zone (event->comp_data->instance_start, FALSE,
e_calendar_view_get_timezone (cal_view));
- e_cal_component_set_dtstart (new_comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, new_comp, &date);
*date.value = icaltime_from_timet_with_zone (event->comp_data->instance_end, FALSE,
e_calendar_view_get_timezone (cal_view));
- e_cal_component_set_dtend (new_comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, new_comp, &date);
e_cal_component_commit_sequence (new_comp);
/* Now update both ECalComponents. Note that we do this last since at
@@ -2012,8 +2041,10 @@
gboolean new)
{
if (e_cal_modify_object (client, e_cal_component_get_icalcomponent (comp), mod, NULL)) {
+ gboolean strip_alarms = TRUE;
+
if ((itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp)) &&
- send_component_dialog (toplevel, client, comp, new)) {
+ send_component_dialog (toplevel, client, comp, new, &strip_alarms)) {
ECalComponent *send_comp = NULL;
if (mod == CALOBJ_MOD_ALL && e_cal_component_is_instance (comp)) {
@@ -2032,7 +2063,7 @@
}
}
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp, client, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, send_comp ? send_comp : comp, client, NULL, NULL, NULL, strip_alarms);
if (send_comp)
g_object_unref (send_comp);
Modified: branches/kill-bonobo/calendar/gui/e-day-view-layout.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-day-view-layout.c (original)
+++ branches/kill-bonobo/calendar/gui/e-day-view-layout.c Wed Jan 21 02:52:05 2009
@@ -29,6 +29,7 @@
#include <config.h>
#include "e-day-view-layout.h"
+#include "e-util/e-bit-array.h"
static void e_day_view_layout_long_event (EDayViewEvent *event,
guint8 *grid,
@@ -37,13 +38,14 @@
gint *rows_in_top_display);
static void e_day_view_layout_day_event (EDayViewEvent *event,
- guint8 *grid,
+ EBitArray **grid,
guint16 *group_starts,
guint8 *cols_per_row,
gint rows,
- gint mins_per_row);
+ gint mins_per_row,
+ gint max_cols);
static void e_day_view_expand_day_event (EDayViewEvent *event,
- guint8 *grid,
+ EBitArray **grid,
guint8 *cols_per_row,
gint mins_per_row);
static void e_day_view_recalc_cols_per_row (gint rows,
@@ -127,15 +129,17 @@
}
-void
+/* returns maximum number of columns among all rows */
+gint
e_day_view_layout_day_events (GArray *events,
gint rows,
gint mins_per_row,
- guint8 *cols_per_row)
+ guint8 *cols_per_row,
+ gint max_cols)
{
EDayViewEvent *event;
- gint row, event_num;
- guint8 *grid;
+ gint row, event_num, res;
+ EBitArray **grid;
/* This is a temporary array which keeps track of rows which are
connected. When an appointment spans multiple rows then the number
@@ -145,18 +149,20 @@
rows. */
guint16 group_starts[12 * 24];
+ /* This is a temporary 2-d grid which is used to place events.
+ Each element is 0 if the position is empty, or 1 if occupied. */
+ grid = g_new0 (EBitArray *, rows);
+
/* Reset the cols_per_row array, and initialize the connected rows so
that all rows are not connected - each row is the start of a new
group. */
for (row = 0; row < rows; row++) {
cols_per_row[row] = 0;
group_starts[row] = row;
- }
-
- /* This is a temporary 2-d grid which is used to place events.
- Each element is 0 if the position is empty, or 1 if occupied. */
- grid = g_new0 (guint8, rows * E_DAY_VIEW_MAX_COLUMNS);
+ /* row doesn't contain any event at the moment */
+ grid [row] = e_bit_array_new (0);
+ }
/* Iterate over the events, finding which rows they cover, and putting
them in the first free column available. Increment the number of
@@ -166,7 +172,7 @@
event = &g_array_index (events, EDayViewEvent, event_num);
e_day_view_layout_day_event (event, grid, group_starts,
- cols_per_row, rows, mins_per_row);
+ cols_per_row, rows, mins_per_row, max_cols);
}
/* Recalculate the number of columns needed in each row. */
@@ -180,8 +186,15 @@
mins_per_row);
}
- /* Free the grid. */
+ /* Free the grid and compute maximum number of columns used. */
+ res = 0;
+ for (row = 0; row < rows; row++) {
+ res = MAX (res, e_bit_array_bit_count (grid [row]));
+ g_object_unref (grid [row]);
+ }
g_free (grid);
+
+ return res;
}
@@ -190,11 +203,12 @@
sure they are all in one group. */
static void
e_day_view_layout_day_event (EDayViewEvent *event,
- guint8 *grid,
+ EBitArray **grid,
guint16 *group_starts,
guint8 *cols_per_row,
gint rows,
- gint mins_per_row)
+ gint mins_per_row,
+ gint max_cols)
{
gint start_row, end_row, free_col, col, row, group_start;
@@ -214,10 +228,11 @@
end_row = CLAMP (end_row, 0, rows - 1);
/* Try each column until we find a free one. */
- for (col = 0; col < E_DAY_VIEW_MAX_COLUMNS; col++) {
+ for (col = 0; max_cols <= 0 || col < max_cols; col++) {
free_col = col;
for (row = start_row; row <= end_row; row++) {
- if (grid[row * E_DAY_VIEW_MAX_COLUMNS + col]) {
+ if (e_bit_array_bit_count (grid [row]) > col &&
+ e_bit_array_value_at (grid [row], col)) {
free_col = -1;
break;
}
@@ -243,7 +258,11 @@
all the events have been layed out. Also make sure all the rows that
the event covers are in one group. */
for (row = start_row; row <= end_row; row++) {
- grid[row * E_DAY_VIEW_MAX_COLUMNS + free_col] = 1;
+ /* resize the array if necessary */
+ if (e_bit_array_bit_count (grid [row]) <= free_col)
+ e_bit_array_insert (grid [row], e_bit_array_bit_count (grid [row]), free_col - e_bit_array_bit_count (grid [row]) + 1);
+
+ e_bit_array_change_one_row (grid [row], free_col, TRUE);
cols_per_row[row]++;
group_starts[row] = group_start;
}
@@ -284,7 +303,7 @@
/* Expands the event horizontally to fill any free space. */
static void
e_day_view_expand_day_event (EDayViewEvent *event,
- guint8 *grid,
+ EBitArray **grid,
guint8 *cols_per_row,
gint mins_per_row)
{
@@ -300,7 +319,8 @@
clashed = FALSE;
for (col = event->start_row_or_col + 1; col < cols_per_row[start_row]; col++) {
for (row = start_row; row <= end_row; row++) {
- if (grid[row * E_DAY_VIEW_MAX_COLUMNS + col]) {
+ if (e_bit_array_bit_count (grid [row]) > col &&
+ e_bit_array_value_at (grid [row], col)) {
clashed = TRUE;
break;
}
Modified: branches/kill-bonobo/calendar/gui/e-day-view-layout.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-day-view-layout.h (original)
+++ branches/kill-bonobo/calendar/gui/e-day-view-layout.h Wed Jan 21 02:52:05 2009
@@ -39,10 +39,11 @@
gint *rows_in_top_display);
-void e_day_view_layout_day_events (GArray *events,
+gint e_day_view_layout_day_events (GArray *events,
gint rows,
gint mins_per_row,
- guint8 *cols_per_row);
+ guint8 *cols_per_row,
+ gint max_cols);
gboolean e_day_view_find_long_event_days (EDayViewEvent *event,
gint days_shown,
Modified: branches/kill-bonobo/calendar/gui/e-day-view.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-day-view.c (original)
+++ branches/kill-bonobo/calendar/gui/e-day-view.c Wed Jan 21 02:52:05 2009
@@ -181,8 +181,6 @@
static void e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top);
-static gboolean e_day_view_check_if_new_event_fits (EDayView *day_view);
-
static void e_day_view_on_canvas_realized (GtkWidget *widget,
EDayView *day_view);
@@ -705,6 +703,12 @@
}
static void
+dview_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
+{
+ e_day_view_set_show_week_number (data, calendar_config_get_dview_show_week_no ());
+}
+
+static void
e_day_view_init (EDayView *day_view)
{
gint day;
@@ -808,6 +812,12 @@
day_view->before_click_dtstart = 0;
day_view->before_click_dtend = 0;
+ day_view->week_number_label = gtk_label_new ("");
+ gtk_table_attach (GTK_TABLE (day_view), day_view->week_number_label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
+ day_view->wn_notif_id = calendar_config_add_notification_dview_show_week_no (dview_show_week_no_changed_cb, day_view);
+ if (calendar_config_get_dview_show_week_no ())
+ gtk_widget_show (day_view->week_number_label);
+
/*
* Top Canvas
*/
@@ -988,6 +998,10 @@
/*
* Scrollbar.
*/
+ day_view->mc_hscrollbar = gtk_hscrollbar_new (GTK_LAYOUT (day_view->main_canvas)->hadjustment);
+ gtk_table_attach (GTK_TABLE (day_view), day_view->mc_hscrollbar, 1, 2, 2, 3, GTK_FILL, 0, 0, 0);
+ gtk_widget_show (day_view->mc_hscrollbar);
+
day_view->tc_vscrollbar = gtk_vscrollbar_new (GTK_LAYOUT (day_view->top_canvas)->vadjustment);
gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar,
2, 3, 0, 1, 0, GTK_FILL, 0, 0);
@@ -1080,6 +1094,11 @@
e_day_view_stop_auto_scroll (day_view);
+ if (day_view->wn_notif_id) {
+ calendar_config_remove_notification (day_view->wn_notif_id);
+ day_view->wn_notif_id = 0;
+ }
+
if (day_view->large_font_desc) {
pango_font_description_free (day_view->large_font_desc);
day_view->large_font_desc = NULL;
@@ -1462,28 +1481,19 @@
pango_font_metrics_unref (font_metrics);
}
-/* This recalculates the sizes of each column. */
static void
-e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+e_day_view_recalc_main_canvas_size (EDayView *day_view)
{
- EDayView *day_view;
gint day, scroll_y;
gboolean need_reshape;
-#if 0
- g_print ("In e_day_view_size_allocate\n");
-#endif
- day_view = E_DAY_VIEW (widget);
-
- (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation);
-
- e_day_view_recalc_cell_sizes (day_view);
-
/* Set the scroll region of the top canvas */
e_day_view_update_top_scroll (day_view, TRUE);
need_reshape = e_day_view_update_scroll_regions (day_view);
+ e_day_view_recalc_cell_sizes (day_view);
+
/* Scroll to the start of the working day, if this is the initial
allocation. */
if (day_view->scroll_to_work_day) {
@@ -1504,6 +1514,17 @@
}
}
+/* This recalculates the sizes of each column. */
+static void
+e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
+{
+#if 0
+ g_print ("In e_day_view_size_allocate\n");
+#endif
+ (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation);
+
+ e_day_view_recalc_main_canvas_size (E_DAY_VIEW (widget));
+}
static void
e_day_view_recalc_cell_sizes (EDayView *day_view)
@@ -1530,6 +1551,8 @@
get divided evenly. Note that we use one more element than the
number of columns, to make it easy to get the column widths. */
width = day_view->main_canvas->allocation.width;
+ if (day_view->days_shown == 1)
+ width = MAX (width, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1);
width /= day_view->days_shown;
offset = 0;
for (day = 0; day <= day_view->days_shown; day++) {
@@ -2276,6 +2299,9 @@
time_t start_time)
{
gint day;
+ char *str;
+ struct icaltimetype tt;
+ GDate dt;
day_view->day_starts[0] = start_time;
for (day = 1; day <= day_view->days_shown; day++) {
@@ -2289,8 +2315,36 @@
day_view->lower = start_time;
day_view->upper = day_view->day_starts[day_view->days_shown];
+
+ tt = icaltime_from_timet_with_zone (day_view->day_starts[0], FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
+ g_date_clear (&dt, 1);
+ g_date_set_dmy (&dt, tt.day, tt.month, tt.year);
+ /* To Translators: the %d stands for a week number, it's value between 1 and 52/53 */
+ str = g_strdup_printf (_("Week %d"), g_date_get_iso8601_week_of_year (&dt));
+ gtk_label_set_text (GTK_LABEL (day_view->week_number_label), str);
+ g_free (str);
}
+gboolean
+e_day_view_get_show_week_number (EDayView *day_view)
+{
+ g_return_val_if_fail (day_view != NULL, FALSE);
+
+ return GTK_WIDGET_VISIBLE (day_view->week_number_label);
+}
+
+void
+e_day_view_set_show_week_number (EDayView *day_view, gboolean show)
+{
+ g_return_if_fail (day_view != NULL);
+
+ if (e_day_view_get_show_week_number (day_view) != show) {
+ if (show)
+ gtk_widget_show (day_view->week_number_label);
+ else
+ gtk_widget_hide (day_view->week_number_label);
+ }
+}
/* Whether we are displaying a work-week, in which case the display always
starts on the first day of the working week. */
@@ -2674,12 +2728,21 @@
gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->main_canvas),
NULL, NULL, &old_x2, &old_y2);
new_x2 = day_view->main_canvas->allocation.width - 1;
+
+ if (day_view->days_shown == 1)
+ new_x2 = MAX (new_x2, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1);
+
if (old_x2 != new_x2 || old_y2 != new_y2) {
need_reshape = TRUE;
gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->main_canvas),
0, 0, new_x2, new_y2);
}
+ if (new_x2 <= day_view->main_canvas->allocation.width - 1)
+ gtk_widget_hide (day_view->mc_hscrollbar);
+ else
+ gtk_widget_show (day_view->mc_hscrollbar);
+
return need_reshape;
}
@@ -3929,7 +3992,7 @@
dt = day_view->day_starts[day_view->resize_start_row];
*date.value = icaltime_from_timet_with_zone (dt, is_date,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
e_cal_component_free_datetime (&ecdt);
date.tzid = NULL; /* do not reuse it later */
} else {
@@ -3942,7 +4005,7 @@
dt = day_view->day_starts[day_view->resize_end_row + 1];
*date.value = icaltime_from_timet_with_zone (dt, is_date,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
e_cal_component_free_datetime (&ecdt);
date.tzid = NULL; /* do not reuse it later */
}
@@ -3960,12 +4023,12 @@
*date.value = icaltime_from_timet_with_zone (
event->comp_data->instance_end, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
} else {
*date.value = icaltime_from_timet_with_zone (
event->comp_data->instance_start, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
}
e_cal_component_set_rdate_list (comp, NULL);
@@ -4025,20 +4088,18 @@
}
date.value = &itt;
- /* FIXME: Should probably keep the timezone of the original start
- and end times. */
date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) {
dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row);
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
} else {
dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_end_row + 1);
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
}
e_cal_component_commit_sequence (comp);
@@ -4069,12 +4130,12 @@
*date.value = icaltime_from_timet_with_zone (
event->comp_data->instance_end, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
} else {
*date.value = icaltime_from_timet_with_zone (
event->comp_data->instance_start, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
}
e_cal_component_set_rdate_list (comp, NULL);
@@ -4265,13 +4326,13 @@
return TRUE;
}
-
/* This lays out the short (less than 1 day) events in the columns.
Any long events are simply skipped. */
void
e_day_view_check_layout (EDayView *day_view)
{
gint day, rows_in_top_display;
+ gint max_cols = -1;
/* Don't bother if we aren't visible. */
if (!E_CALENDAR_VIEW (day_view)->in_focus)
@@ -4281,11 +4342,17 @@
e_day_view_ensure_events_sorted (day_view);
for (day = 0; day < day_view->days_shown; day++) {
- if (day_view->need_layout[day])
- e_day_view_layout_day_events (day_view->events[day],
+ if (day_view->need_layout[day]) {
+ gint cols;
+
+ cols = e_day_view_layout_day_events (day_view->events[day],
day_view->rows,
day_view->mins_per_row,
- day_view->cols_per_row[day]);
+ day_view->cols_per_row[day],
+ day_view->days_shown == 1 ? -1 : E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS);
+
+ max_cols = MAX (cols, max_cols);
+ }
if (day_view->need_layout[day]
|| day_view->need_reshape[day]) {
@@ -4311,13 +4378,17 @@
}
}
-
if (day_view->long_events_need_layout
|| day_view->long_events_need_reshape)
e_day_view_reshape_long_events (day_view);
day_view->long_events_need_layout = FALSE;
day_view->long_events_need_reshape = FALSE;
+
+ if (max_cols != -1 && max_cols != day_view->max_cols) {
+ day_view->max_cols = max_cols;
+ e_day_view_recalc_main_canvas_size (day_view);
+ }
}
@@ -4930,13 +5001,6 @@
if (day_view->selection_start_day == -1)
return FALSE;
- /* Check if there is room for a new event to be typed in. If there
- isn't we don't want to add an event as we will then add a new
- event for every key press. */
- if (!e_day_view_check_if_new_event_fits (day_view)) {
- return FALSE;
- }
-
/* We only want to start an edit with a return key or a simple
character. */
if ((keyval != GDK_Return) &&
@@ -5588,33 +5652,6 @@
gtk_adjustment_set_value (adj, new_value);
}
-static gboolean
-e_day_view_check_if_new_event_fits (EDayView *day_view)
-{
- gint day, start_row, end_row, row;
-
- day = day_view->selection_start_day;
- start_row = day_view->selection_start_row;
- end_row = day_view->selection_end_row;
-
- /* Long events always fit, since we keep adding rows to the top
- canvas. */
- if (day != day_view->selection_end_day)
- return TRUE;
- if (start_row == 0 && end_row == day_view->rows)
- return TRUE;
-
- /* If any of the rows already have E_DAY_VIEW_MAX_COLUMNS columns,
- return FALSE. */
- for (row = start_row; row <= end_row; row++) {
- if (day_view->cols_per_row[day][row] >= E_DAY_VIEW_MAX_COLUMNS)
- return FALSE;
- }
-
- return TRUE;
-}
-
-
void
e_day_view_ensure_rows_visible (EDayView *day_view,
gint start_row,
@@ -6073,10 +6110,10 @@
*date.value = icaltime_from_timet_with_zone (start_dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
*date.value = icaltime_from_timet_with_zone (end_dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
e_cal_component_commit_sequence (comp);
@@ -7449,7 +7486,7 @@
the original start and end times. */
date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
}
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
if (end_offset == 0)
dt = day_view->day_starts[day + num_days];
@@ -7465,7 +7502,7 @@
the original start and end times. */
date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
}
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
gtk_drag_finish (context, TRUE, TRUE, time);
@@ -7662,11 +7699,11 @@
dt = e_day_view_convert_grid_position_to_time (day_view, day, row) + start_offset * 60;
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
dt = e_day_view_convert_grid_position_to_time (day_view, day, row + num_rows) - end_offset * 60;
*date.value = icaltime_from_timet_with_zone (dt, FALSE,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
e_cal_component_abort_sequence (comp);
gtk_drag_finish (context, TRUE, TRUE, time);
Modified: branches/kill-bonobo/calendar/gui/e-day-view.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-day-view.h (original)
+++ branches/kill-bonobo/calendar/gui/e-day-view.h Wed Jan 21 02:52:05 2009
@@ -45,8 +45,11 @@
of a normal event. */
#define E_DAY_VIEW_LONG_EVENT E_DAY_VIEW_MAX_DAYS
-/* The maximum number of columns of appointments within a day. */
-#define E_DAY_VIEW_MAX_COLUMNS 6
+/* The maximum number of columns of appointments within a day in multi-day view. */
+#define E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS 6
+
+/* minimum width of the event in one-day view in pixels */
+#define E_DAY_VIEW_MIN_DAY_COL_WIDTH 60
/* The width of the gap between appointments. This should be at least
E_DAY_VIEW_BAR_WIDTH, since in the top canvas we use this space to draw
@@ -204,6 +207,9 @@
/* scrollbar for top_canvas */
GtkWidget *tc_vscrollbar;
+ /* horizontal scrollbar for main_canvas */
+ GtkWidget *mc_hscrollbar;
+
/* The main canvas where the rest of the appointments are shown. */
GtkWidget *main_canvas;
GnomeCanvasItem *main_canvas_item;
@@ -214,6 +220,11 @@
GtkWidget *vscrollbar;
+ /* label showing week number in upper-left corner */
+ GtkWidget *week_number_label;
+ /* option change notification id for week number */
+ guint wn_notif_id;
+
/* S-expression for query and the query object */
ECalView *query;
@@ -310,6 +321,8 @@
Note that there are a maximum of 12 * 24 rows (when a row is 5 mins)
but we don't always have that many rows. */
guint8 cols_per_row[E_DAY_VIEW_MAX_DAYS][12 * 24];
+ /* The maximum number of columns from all rows in cols_per_row */
+ gint max_cols;
/* Sizes of the various time strings. */
gint small_hour_widths[24];
@@ -599,9 +612,12 @@
gint start_row,
gint end_row);
-
void e_day_view_update_marcus_bains (EDayView *day_view);
+/* Week number in upper-left corner of the day view widget */
+gboolean e_day_view_get_show_week_number (EDayView *day_view);
+void e_day_view_set_show_week_number (EDayView *day_view, gboolean show);
+
G_END_DECLS
#endif /* _E_DAY_VIEW_H_ */
Modified: branches/kill-bonobo/calendar/gui/e-itip-control.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-itip-control.c (original)
+++ branches/kill-bonobo/calendar/gui/e-itip-control.c Wed Jan 21 02:52:05 2009
@@ -2097,7 +2097,7 @@
comp = get_real_item (itip);
if (comp != NULL) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->current_ecal, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->current_ecal, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
dialog = gtk_message_dialog_new (
NULL, 0,
@@ -2152,7 +2152,7 @@
for (l = comp_list; l; l = l->next) {
ECalComponent *comp = E_CAL_COMPONENT (l->data);
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->current_ecal, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->current_ecal, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
}
@@ -2598,7 +2598,7 @@
g_slist_free (list);
e_cal_component_rescan (comp);
- itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->current_ecal, priv->top_level, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->current_ecal, priv->top_level, NULL, NULL, TRUE);
g_object_unref (comp);
}
Modified: branches/kill-bonobo/calendar/gui/e-week-view.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/e-week-view.c (original)
+++ branches/kill-bonobo/calendar/gui/e-week-view.c Wed Jan 21 02:52:05 2009
@@ -3432,10 +3432,10 @@
*date.value = icaltime_from_timet_with_zone (start_dt, is_all_day,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtstart (comp, &date);
+ cal_comp_set_dtstart_with_oldzone (client, comp, &date);
*date.value = icaltime_from_timet_with_zone (end_dt, is_all_day,
e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view)));
- e_cal_component_set_dtend (comp, &date);
+ cal_comp_set_dtend_with_oldzone (client, comp, &date);
e_cal_component_commit_sequence (comp);
Modified: branches/kill-bonobo/calendar/gui/gnome-cal.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/gnome-cal.c (original)
+++ branches/kill-bonobo/calendar/gui/gnome-cal.c Wed Jan 21 02:52:05 2009
@@ -1328,6 +1328,20 @@
return GTK_WIDGET (gcal->priv->date_navigator);
}
+static time_t
+gc_get_default_time (ECalModel *model, gpointer user_data)
+{
+ GnomeCalendar *gcal = user_data;
+ time_t res = 0, end;
+
+ g_return_val_if_fail (model != NULL, 0);
+ g_return_val_if_fail (GNOME_IS_CALENDAR (user_data), 0);
+
+ gnome_calendar_get_current_time_range (gcal, &res, &end);
+
+ return res;
+}
+
static void
setup_widgets (GnomeCalendar *gcal)
{
@@ -1511,6 +1525,8 @@
gtk_widget_show (label);
gtk_widget_show (vbox);
+ e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), gc_get_default_time, gcal);
+
update_memo_view (gcal);
}
@@ -2138,7 +2154,7 @@
source = e_cal_get_source (ecal);
state = e_cal_get_load_state (ecal);
- if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED)
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
auth_cal_forget_password (ecal);
switch (status) {
@@ -2164,17 +2180,10 @@
status = E_CALENDAR_STATUS_OK;
break;
- case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
- {
- const gchar *auth_domain = e_source_get_property (source, "auth-domain");
- const gchar *component_name;
-
- component_name = auth_domain ? auth_domain : "Calendar";
-
- /* Warn the user password is wrong */
- e_passwords_forget_password (component_name, e_cal_get_uri(ecal));
- return;
- }
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ /* try to reopen calendar - it'll ask for a password once again */
+ e_cal_open_async (ecal, FALSE);
+ return;
case E_CALENDAR_STATUS_REPOSITORY_OFFLINE:
/* check to see if we have dialog already running for this operation */
id = g_strdup ("calendar:unable-to-load-the-calendar");
@@ -2232,6 +2241,9 @@
source = e_cal_get_source (ecal);
state = e_cal_get_load_state (ecal);
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED || status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ auth_cal_forget_password (ecal);
+
switch (status) {
case E_CALENDAR_STATUS_OK:
break;
@@ -2239,13 +2251,18 @@
if (state == E_CAL_LOAD_NOT_LOADED)
e_cal_open_async (ecal, FALSE);
return;
- case E_CALENDAR_STATUS_INVALID_SERVER_VERSION :
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ /* try to reopen calendar - it'll ask for a password once again */
+ e_cal_open_async (ecal, FALSE);
+ return;
+ case E_CALENDAR_STATUS_INVALID_SERVER_VERSION:
e_error_run (NULL, "calendar:server-version", NULL);
- status = E_CALENDAR_STATUS_OK;
default:
/* Make sure the source doesn't disappear on us */
g_object_ref (source);
+ g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal);
+
/* FIXME should we do this to prevent multiple error dialogs? */
priv->clients_list = g_list_remove (priv->clients_list, ecal);
g_hash_table_remove (priv->clients, e_source_peek_uid (source));
@@ -2265,7 +2282,6 @@
g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL);
-
e_cal_model_set_default_client (
e_calendar_view_get_model (
E_CALENDAR_VIEW (priv->views[priv->current_view_type])),
Modified: branches/kill-bonobo/calendar/gui/itip-utils.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/itip-utils.c (original)
+++ branches/kill-bonobo/calendar/gui/itip-utils.c Wed Jan 21 02:52:05 2009
@@ -1023,7 +1023,7 @@
}
static ECalComponent *
-comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones)
+comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones, gboolean strip_alarms)
{
ECalComponent *clone, *temp_clone;
struct icaltimetype itt;
@@ -1080,8 +1080,31 @@
e_cal_component_free_recur_list (rrule_list);
}
- /* We delete incoming alarms anyhow, and this helps with outlook */
- e_cal_component_remove_all_alarms (clone);
+ /* We delete incoming alarms if requested, even this helps with outlook */
+ if (strip_alarms) {
+ e_cal_component_remove_all_alarms (clone);
+ } else {
+ /* Always strip procedure alarms, because of security */
+ GList *uids, *l;
+
+ uids = e_cal_component_get_alarm_uids (clone);
+
+ for (l = uids; l; l = l->next) {
+ ECalComponentAlarm *alarm;
+ ECalComponentAlarmAction action = E_CAL_COMPONENT_ALARM_UNKNOWN;
+
+ alarm = e_cal_component_get_alarm (clone, (const char *)l->data);
+ if (alarm) {
+ e_cal_component_alarm_get_action (alarm, &action);
+ e_cal_component_alarm_free (alarm);
+
+ if (action == E_CAL_COMPONENT_ALARM_PROCEDURE)
+ e_cal_component_remove_alarm (clone, (const char *)l->data);
+ }
+ }
+
+ cal_obj_uid_list_free (uids);
+ }
/* Strip X-LIC-ERROR stuff */
e_cal_component_strip_errors (clone);
@@ -1164,7 +1187,7 @@
gboolean
itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp,
- ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users)
+ ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users, gboolean strip_alarms)
{
EMsgComposer *composer;
EComposerHeaderTable *table;
@@ -1197,7 +1220,7 @@
}
/* Tidy up the comp */
- comp = comp_compliant (method, send_comp, client, zones);
+ comp = comp_compliant (method, send_comp, client, zones, strip_alarms);
if (comp == NULL)
goto cleanup;
@@ -1312,7 +1335,7 @@
gboolean retval = FALSE;
/* Tidy up the comp */
- comp = comp_compliant (method, send_comp, client, zones);
+ comp = comp_compliant (method, send_comp, client, zones, TRUE);
if (comp == NULL)
goto cleanup;
Modified: branches/kill-bonobo/calendar/gui/itip-utils.h
==============================================================================
--- branches/kill-bonobo/calendar/gui/itip-utils.h (original)
+++ branches/kill-bonobo/calendar/gui/itip-utils.h Wed Jan 21 02:52:05 2009
@@ -58,7 +58,7 @@
char *itip_get_comp_attendee (ECalComponent *comp, ECal *client);
gboolean itip_send_comp (ECalComponentItipMethod method, ECalComponent *comp,
- ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users);
+ ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users, gboolean strip_alarms);
gboolean itip_publish_comp (ECal *client, gchar* uri, gchar* username,
gchar* password, ECalComponent **pub_comp);
Modified: branches/kill-bonobo/calendar/gui/print.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/print.c (original)
+++ branches/kill-bonobo/calendar/gui/print.c Wed Jan 21 02:52:05 2009
@@ -1062,13 +1062,33 @@
return top;
}
+static char *
+get_summary_with_location (icalcomponent *icalcomp)
+{
+ const gchar *summary, *location;
+ char *text;
+
+ g_return_val_if_fail (icalcomp != NULL, NULL);
+
+ summary = icalcomponent_get_summary (icalcomp);
+ text = summary ? (char*) summary : "";
+
+ location = icalcomponent_get_location (icalcomp);
+ if (location && *location) {
+ text = g_strdup_printf ("%s (%s)", text, location);
+ } else {
+ text = g_strdup (text);
+ }
+
+ return text;
+}
+
static void
print_day_long_event (GtkPrintContext *context, PangoFontDescription *font,
double left, double right, double top, double bottom,
double row_height, EDayViewEvent *event,
struct pdinfo *pdi, ECalModel *model)
{
- const gchar *summary;
double x1, x2, y1, y2;
double left_triangle_width = -1.0, right_triangle_width = -1.0;
char *text;
@@ -1134,12 +1154,13 @@
}
/* Print the text. */
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
+ text = get_summary_with_location (event->comp_data->icalcomp);
x1 += 4;
x2 -= 4;
print_text (context, font, text, PANGO_ALIGN_CENTER, x1, x2, y1, y2);
+
+ g_free (text);
}
@@ -1148,11 +1169,10 @@
double left, double right, double top, double bottom,
EDayViewEvent *event, struct pdinfo *pdi, ECalModel *model)
{
- const gchar *summary, *location;
double x1, x2, y1, y2, col_width, row_height;
int start_offset, end_offset, start_row, end_row;
char *text, start_buffer[32], end_buffer[32];
- gboolean display_times = FALSE, free_text = FALSE;
+ gboolean display_times = FALSE;
struct tm date_tm;
double red, green, blue;
@@ -1188,14 +1208,7 @@
e_cal_model_get_rgb_color_for_component (model, event->comp_data, &red, &green, &blue);
print_border_rgb (context, x1, x2, y1, y2, 1.0, red, green, blue);
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
-
- location = icalcomponent_get_location (event->comp_data->icalcomp);
- if (location && *location) {
- text = g_strdup_printf ("%s (%s)", text, location);
- free_text = TRUE;
- }
+ text = get_summary_with_location (event->comp_data->icalcomp);
if (display_times) {
gchar *t = NULL;
@@ -1217,22 +1230,16 @@
e_time_format_time (&date_tm, pdi->use_24_hour_format, FALSE,
end_buffer, sizeof (end_buffer));
- if (free_text)
- t = text;
-
+ t = text;
text = g_strdup_printf ("%s - %s %s ", start_buffer,
end_buffer, text);
- free_text = TRUE;
-
- if (t)
- g_free (t);
+ g_free (t);
}
bound_text (context, font, text, -1, x1 + 2, y1, x2 - 2, y2, FALSE, NULL, NULL);
- if (free_text)
- g_free (text);
+ g_free (text);
}
@@ -1337,7 +1344,7 @@
/* lay out the short events, within the day. */
e_day_view_layout_day_events (pdi.events[0], DAY_VIEW_ROWS,
- DAY_VIEW_MINS_PER_ROW, pdi.cols_per_row);
+ DAY_VIEW_MINS_PER_ROW, pdi.cols_per_row, -1);
/* print the short events. */
if (top > bottom )
@@ -1497,15 +1504,13 @@
{
EWeekViewEventSpan *span;
gint span_num;
- const gchar *summary;
char *text;
int num_days, start_x, start_y, start_h, end_x, end_y, end_h;
double x1, x2, y1, y2;
double red, green, blue;
GdkPixbuf *pixbuf = NULL;
- summary = icalcomponent_get_summary (event->comp_data->icalcomp);
- text = summary ? (char*) summary : "";
+ text = get_summary_with_location (event->comp_data->icalcomp);
for (span_num = 0; span_num < event->num_spans; span_num++) {
span = &g_array_index (spans, EWeekViewEventSpan,
@@ -1610,6 +1615,8 @@
if (pixbuf)
g_object_unref (pixbuf);
+
+ g_free (text);
}
Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-content.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-content.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-content.c Wed Jan 21 02:52:05 2009
@@ -473,7 +473,7 @@
container = priv->vpaned;
widget = gtk_vbox_new (FALSE, 0);
- gtk_paned_pack1 (GTK_PANED (container), widget, TRUE, TRUE);
+ gtk_paned_pack1 (GTK_PANED (container), widget, FALSE, FALSE);
gtk_widget_show (widget);
container = widget;
@@ -501,7 +501,7 @@
container = priv->vpaned;
widget = gtk_vbox_new (FALSE, 0);
- gtk_paned_pack2 (GTK_PANED (container), widget, TRUE, TRUE);
+ gtk_paned_pack2 (GTK_PANED (container), widget, TRUE, FALSE);
gtk_widget_show (widget);
container = widget;
Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-sidebar.c Wed Jan 21 02:52:05 2009
@@ -172,6 +172,10 @@
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
+ status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ auth_cal_forget_password (client);
+
switch (status) {
case E_CALENDAR_STATUS_OK:
g_signal_handlers_disconnect_matched (
@@ -186,6 +190,10 @@
cal_shell_sidebar, NULL);
break;
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ e_cal_open_async (client, FALSE);
+ break;
+
case E_CALENDAR_STATUS_BUSY:
break;
Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-actions.c Wed Jan 21 02:52:05 2009
@@ -1038,6 +1038,9 @@
gtk_action_group_add_actions (
action_group, calendar_entries,
G_N_ELEMENTS (calendar_entries), cal_shell_view);
+ e_action_group_add_popup_actions (
+ action_group, calendar_popup_entries,
+ G_N_ELEMENTS (calendar_popup_entries));
gtk_action_group_add_radio_actions (
action_group, calendar_view_entries,
G_N_ELEMENTS (calendar_view_entries), GNOME_CAL_DAY_VIEW,
Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-memopad.c Wed Jan 21 02:52:05 2009
@@ -88,7 +88,6 @@
ECalModelComponent *comp_data;
ECalComponent *comp;
icalcomponent *clone;
- ECalComponentItipMethod method;
GSList *list;
cal_shell_content = cal_shell_view->priv->cal_shell_content;
@@ -102,9 +101,10 @@
/* XXX We only forward the first selected memo. */
comp = e_cal_component_new ();
clone = icalcomponent_new_clone (comp_data->icalcomp);
- method = E_CAL_COMPONENT_METHOD_PUBLISH;
e_cal_component_set_icalcomponent (comp, clone);
- itip_send_comp (method, comp, comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (
+ E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+ comp_data->client, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
}
Modified: branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c (original)
+++ branches/kill-bonobo/calendar/modules/e-cal-shell-view-taskpad.c Wed Jan 21 02:52:05 2009
@@ -111,7 +111,6 @@
ECalModelComponent *comp_data;
ECalComponent *comp;
icalcomponent *clone;
- ECalComponentItipMethod method;
GSList *list;
cal_shell_content = cal_shell_view->priv->cal_shell_content;
@@ -125,9 +124,10 @@
/* XXX We only forward the first selected task. */
comp = e_cal_component_new ();
clone = icalcomponent_new_clone (comp_data->icalcomp);
- method = E_CAL_COMPONENT_METHOD_PUBLISH;
e_cal_component_set_icalcomponent (comp, clone);
- itip_send_comp (method, comp, comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (
+ E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+ comp_data->client, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
}
Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-sidebar.c Wed Jan 21 02:52:05 2009
@@ -194,6 +194,10 @@
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
+ status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ auth_cal_forget_password (client);
+
switch (status) {
case E_CALENDAR_STATUS_OK:
g_signal_handlers_disconnect_matched (
@@ -208,6 +212,10 @@
memo_shell_sidebar, NULL);
break;
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ e_cal_open_async (client, FALSE);
+ break;
+
case E_CALENDAR_STATUS_BUSY:
break;
Modified: branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c (original)
+++ branches/kill-bonobo/calendar/modules/e-memo-shell-view-actions.c Wed Jan 21 02:52:05 2009
@@ -109,7 +109,6 @@
ECalModelComponent *comp_data;
ECalComponent *comp;
icalcomponent *clone;
- ECalComponentItipMethod method;
GSList *list;
memo_shell_content = memo_shell_view->priv->memo_shell_content;
@@ -123,9 +122,10 @@
/* XXX We only forward the first selected memo. */
comp = e_cal_component_new ();
clone = icalcomponent_new_clone (comp_data->icalcomp);
- method = E_CAL_COMPONENT_METHOD_PUBLISH;
e_cal_component_set_icalcomponent (comp, clone);
- itip_send_comp (method, comp, comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (
+ E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+ comp_data->client, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
}
Modified: branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-sidebar.c Wed Jan 21 02:52:05 2009
@@ -167,6 +167,10 @@
shell_view = e_shell_sidebar_get_shell_view (shell_sidebar);
shell_window = e_shell_view_get_shell_window (shell_view);
+ if (status == E_CALENDAR_STATUS_AUTHENTICATION_FAILED ||
+ status == E_CALENDAR_STATUS_AUTHENTICATION_REQUIRED)
+ auth_cal_forget_password (client);
+
switch (status) {
case E_CALENDAR_STATUS_OK:
g_signal_handlers_disconnect_matched (
@@ -181,6 +185,10 @@
task_shell_sidebar, NULL);
break;
+ case E_CALENDAR_STATUS_AUTHENTICATION_FAILED:
+ e_cal_open_async (client, FALSE);
+ break;
+
case E_CALENDAR_STATUS_BUSY:
break;
Modified: branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c (original)
+++ branches/kill-bonobo/calendar/modules/e-task-shell-view-actions.c Wed Jan 21 02:52:05 2009
@@ -156,7 +156,6 @@
ECalModelComponent *comp_data;
ECalComponent *comp;
icalcomponent *clone;
- ECalComponentItipMethod method;
GSList *list;
task_shell_content = task_shell_view->priv->task_shell_content;
@@ -170,9 +169,10 @@
/* XXX We only forward the first selected task. */
comp = e_cal_component_new ();
clone = icalcomponent_new_clone (comp_data->icalcomp);
- method = E_CAL_COMPONENT_METHOD_PUBLISH;
e_cal_component_set_icalcomponent (comp, clone);
- itip_send_comp (method, comp, comp_data->client, NULL, NULL, NULL);
+ itip_send_comp (
+ E_CAL_COMPONENT_METHOD_PUBLISH, comp,
+ comp_data->client, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
}
Modified: branches/kill-bonobo/configure.in
==============================================================================
--- branches/kill-bonobo/configure.in (original)
+++ branches/kill-bonobo/configure.in Wed Jan 21 02:52:05 2009
@@ -23,7 +23,7 @@
# Required Packages
m4_define([glib_minimum_version], [2.18.0])
m4_define([gtk_minimum_version], [2.14.0])
-m4_define([eds_minimum_version], [2.25.5])
+m4_define([eds_minimum_version], [evo_version])
m4_define([gnome_icon_theme_minimum_version], [2.19.91])
m4_define([libbonobo_minimum_version], [2.20.3])
m4_define([libbonoboui_minimum_version], [2.4.2])
@@ -1763,7 +1763,7 @@
plugins_base="$plugins_base_always $SA_JUNK_PLUGIN $BF_JUNK_PLUGIN $EXCHANGE_PLUGIN $MONO_PLUGIN "
all_plugins_base="$plugins_base_always sa-junk-plugin bogo-junk-plugin exchange-operations mono"
-plugins_standard_always="bbdb subject-thread save-calendar copy-tool mail-to-task audio-inline mailing-list-actions default-mailer import-ics-attachments prefer-plain mail-notification attachment-reminder face backup-restore email-custom-header templates"
+plugins_standard_always="bbdb subject-thread save-calendar copy-tool mail-to-task audio-inline mailing-list-actions default-mailer import-ics-attachments prefer-plain mail-notification attachment-reminder face backup-restore email-custom-header templates pst-import"
plugins_standard="$plugins_standard_always"
all_plugins_standard="$plugins_standard"
@@ -1795,6 +1795,7 @@
dnl mono
dnl plugin-manager
dnl prefer-plain
+dnl pst-import
dnl publish-calendar
dnl python
dnl startup-wizard
@@ -1906,6 +1907,23 @@
fi
fi
+if echo ${plugins_enabled} | grep "pst-import" > /dev/null
+then
+ if ${PKG_CONFIG} --exists libpst
+ then
+ dnl *********************
+ dnl libpst
+ dnl *********************
+ PKG_CHECK_MODULES(LIBPST, libpst)
+ AC_SUBST(LIBPST_CFLAGS)
+ AC_SUBST(LIBPST_LIBS)
+ else
+ plugins_enabled=`echo $plugins_enabled | sed -e "s/pst-import//g"`
+ echo "warning: libpst was not found, pst-import plugin will not be built."
+ echo "you are probably missing libpst-devel package."
+ fi
+fi
+
dnl ***********
dnl GConf stuff
dnl ***********
@@ -2109,6 +2127,7 @@
plugins/imap-features/Makefile
plugins/tnef-attachments/Makefile
plugins/templates/Makefile
+plugins/pst-import/Makefile
plugins/face/Makefile
plugins/external-editor/Makefile
plugins/webdav-account-setup/Makefile
Modified: branches/kill-bonobo/e-util/e-plugin.c
==============================================================================
--- branches/kill-bonobo/e-util/e-plugin.c (original)
+++ branches/kill-bonobo/e-util/e-plugin.c Wed Jan 21 02:52:05 2009
@@ -1100,7 +1100,7 @@
tmp = xmlGetProp(root, (const unsigned char *)"load-on-startup");
if (tmp) {
- if (strcmp (tmp, "after-ui") == 0) {
+ if (strcmp ((const char *)tmp, "after-ui") == 0) {
missing_symbols = g_list_prepend (missing_symbols, g_object_ref (ep));
} else {
if (epl_loadmodule(ep, FALSE) != 0) {
Modified: branches/kill-bonobo/help/C/figures/account_editor_a.png
==============================================================================
Binary files. No diff available.
Modified: branches/kill-bonobo/help/C/figures/attach_reminder_a.png
==============================================================================
Binary files. No diff available.
Modified: branches/kill-bonobo/help/C/figures/evo_newmess_a.png
==============================================================================
Binary files. No diff available.
Modified: branches/kill-bonobo/help/C/figures/google_cal_view.png
==============================================================================
Binary files branches/kill-bonobo/help/C/figures/google_cal_view.png (original) and branches/kill-bonobo/help/C/figures/google_cal_view.png Wed Jan 21 02:52:05 2009 differ
Modified: branches/kill-bonobo/mail/em-composer-utils.c
==============================================================================
--- branches/kill-bonobo/mail/em-composer-utils.c (original)
+++ branches/kill-bonobo/mail/em-composer-utils.c Wed Jan 21 02:52:05 2009
@@ -1557,6 +1557,102 @@
mail_append_mail (out_folder, receipt, info, em_utils_receipt_done, NULL);
}
+static void
+emu_forward_raw_done (CamelFolder *folder, CamelMimeMessage *msg, CamelMessageInfo *info,
+ int queued, const char *appended_uid, void *data)
+{
+ camel_message_info_free (info);
+ /* do not call mail send, just pile them all in the outbox */
+ /* mail_send (); */
+}
+
+/**
+ * em_utils_forward_message_raw:
+ * @param folder Where's a message located.
+ * @param message Message to forward.
+ * @param address Forward to whom.
+ * @param ex Exception.
+ * Forwards message to the address, in very similar way as redirect does.
+ **/
+void
+em_utils_forward_message_raw (CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex)
+{
+ EAccount *account;
+ CamelMimeMessage *forward;
+ CamelStream *mem;
+ CamelInternetAddress *addr;
+ CamelFolder *out_folder;
+ CamelMessageInfo *info;
+ struct _camel_header_raw *xev;
+ char *subject;
+
+ g_return_if_fail (folder != NULL);
+ g_return_if_fail (message != NULL);
+ g_return_if_fail (address != NULL);
+
+ if (!*address) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("No destination address provided, forward of the message has been cancelled."));
+ return;
+ }
+
+ account = guess_account (message, folder);
+ if (!account) {
+ camel_exception_set (ex, CAMEL_EXCEPTION_SYSTEM, _("No account found to use, forward of the message has been cancelled."));
+ return;
+ }
+
+ forward = camel_mime_message_new ();
+
+ /* make copy of the message, because we are going to modify it */
+ mem = camel_stream_mem_new ();
+ camel_data_wrapper_write_to_stream ((CamelDataWrapper *)message, mem);
+ camel_seekable_stream_seek (CAMEL_SEEKABLE_STREAM (mem), 0, CAMEL_STREAM_SET);
+ camel_data_wrapper_construct_from_stream ((CamelDataWrapper *)forward, mem);
+ camel_object_unref (mem);
+
+ /* clear previous recipients */
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_TO, NULL);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_CC, NULL);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_BCC, NULL);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_TO, NULL);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_CC, NULL);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_BCC, NULL);
+
+ /* remove all delivery and notification headers */
+ while (camel_medium_get_header (CAMEL_MEDIUM (forward), "Disposition-Notification-To"))
+ camel_medium_remove_header (CAMEL_MEDIUM (forward), "Disposition-Notification-To");
+
+ while (camel_medium_get_header (CAMEL_MEDIUM (forward), "Delivered-To"))
+ camel_medium_remove_header (CAMEL_MEDIUM (forward), "Delivered-To");
+
+ /* remove any X-Evolution-* headers that may have been set */
+ xev = mail_tool_remove_xevolution_headers (forward);
+ camel_header_raw_clear (&xev);
+
+ /* from */
+ addr = camel_internet_address_new ();
+ camel_internet_address_add (addr, account->id->name, account->id->address);
+ camel_mime_message_set_from (forward, addr);
+ camel_object_unref (addr);
+
+ /* to */
+ addr = camel_internet_address_new ();
+ camel_address_decode (CAMEL_ADDRESS (addr), address);
+ camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_TO, addr);
+ camel_object_unref (addr);
+
+ /* subject */
+ subject = mail_tool_generate_forward_subject (message);
+ camel_mime_message_set_subject (forward, subject);
+ g_free (subject);
+
+ /* and send it */
+ out_folder = mail_component_get_folder (NULL, MAIL_COMPONENT_FOLDER_OUTBOX);
+ info = camel_message_info_new (NULL);
+ camel_message_info_set_flags (info, CAMEL_MESSAGE_SEEN, CAMEL_MESSAGE_SEEN);
+ mail_append_mail (out_folder, forward, info, emu_forward_raw_done, NULL);
+}
+
/* Replying to messages... */
static GHashTable *
Modified: branches/kill-bonobo/mail/em-composer-utils.h
==============================================================================
--- branches/kill-bonobo/mail/em-composer-utils.h (original)
+++ branches/kill-bonobo/mail/em-composer-utils.h Wed Jan 21 02:52:05 2009
@@ -33,6 +33,7 @@
struct _CamelFolder;
struct _CamelMimeMessage;
+struct _CamelException;
struct _EMsgComposer;
struct _EMFormat;
struct _EAccount;
@@ -57,6 +58,8 @@
void em_utils_redirect_message (struct _CamelMimeMessage *message);
void em_utils_redirect_message_by_uid (struct _CamelFolder *folder, const char *uid);
+void em_utils_forward_message_raw (struct _CamelFolder *folder, struct _CamelMimeMessage *message, const char *address, struct _CamelException *ex);
+
void em_utils_handle_receipt (struct _CamelFolder *folder, const char *uid, struct _CamelMimeMessage *msg);
void em_utils_send_receipt (struct _CamelFolder *folder, struct _CamelMimeMessage *message);
Modified: branches/kill-bonobo/mail/filtertypes.xml
==============================================================================
--- branches/kill-bonobo/mail/filtertypes.xml (original)
+++ branches/kill-bonobo/mail/filtertypes.xml Wed Jan 21 02:52:05 2009
@@ -1012,5 +1012,11 @@
<code>(pipe-message "/bin/sh" "-c" ${command})</code>
<input type="command" name="command"/>
</part>
+
+ <part name="forward">
+ <title>Forward to</title>
+ <code>(forward-to ${address})</code>
+ <input type="address" name="address"/>
+ </part>
</actionset>
</filterdescription>
Modified: branches/kill-bonobo/mail/mail-session.c
==============================================================================
--- branches/kill-bonobo/mail/mail-session.c (original)
+++ branches/kill-bonobo/mail/mail-session.c Wed Jan 21 02:52:05 2009
@@ -49,6 +49,7 @@
#include "e-account-combo-box.h"
#include "shell/e-shell.h"
+#include "em-composer-utils.h"
#include "em-filter-context.h"
#include "em-filter-rule.h"
#include "em-utils.h"
@@ -95,6 +96,7 @@
static void ms_thread_status(CamelSession *session, CamelSessionThreadMsg *msg, const char *text, int pc);
static void *ms_thread_msg_new(CamelSession *session, CamelSessionThreadOps *ops, unsigned int size);
static void ms_thread_msg_free(CamelSession *session, CamelSessionThreadMsg *m);
+static void ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex);
static void
init (MailSession *session)
@@ -126,6 +128,7 @@
camel_session_class->thread_msg_new = ms_thread_msg_new;
camel_session_class->thread_msg_free = ms_thread_msg_free;
camel_session_class->thread_status = ms_thread_status;
+ camel_session_class->forward_to = ms_forward_to;
}
static CamelType
@@ -622,6 +625,16 @@
printf("Thread status '%s' %d%%\n", text, pc);
}
+static void
+ms_forward_to (CamelSession *session, CamelFolder *folder, CamelMimeMessage *message, const char *address, CamelException *ex)
+{
+ g_return_if_fail (session != NULL);
+ g_return_if_fail (message != NULL);
+ g_return_if_fail (address != NULL);
+
+ em_utils_forward_message_raw (folder, message, address, ex);
+}
+
char *
mail_session_get_password (const char *url_string)
{
Modified: branches/kill-bonobo/plugins/itip-formatter/itip-formatter.c
==============================================================================
--- branches/kill-bonobo/plugins/itip-formatter/itip-formatter.c (original)
+++ branches/kill-bonobo/plugins/itip-formatter/itip-formatter.c Wed Jan 21 02:52:05 2009
@@ -630,6 +630,16 @@
if (!pitip->current_ecal && e_cal_get_object (ecal, fd->uid, fd->rid, &icalcomp, NULL)) {
+ if ((pitip->method == ICAL_METHOD_PUBLISH || pitip->method == ICAL_METHOD_REQUEST) &&
+ (icalcomponent_get_first_component (icalcomp, ICAL_VALARM_COMPONENT) ||
+ icalcomponent_get_first_component (icalcomp, ICAL_XAUDIOALARM_COMPONENT) ||
+ icalcomponent_get_first_component (icalcomp, ICAL_XDISPLAYALARM_COMPONENT) ||
+ icalcomponent_get_first_component (icalcomp, ICAL_XPROCEDUREALARM_COMPONENT) ||
+ icalcomponent_get_first_component (icalcomp, ICAL_XEMAILALARM_COMPONENT)))
+ itip_view_set_show_keep_alarm_check (ITIP_VIEW (pitip->view), TRUE);
+ else
+ itip_view_set_show_keep_alarm_check (ITIP_VIEW (pitip->view), FALSE);
+
icalcomponent_free (icalcomp);
pitip->current_ecal = ecal;
@@ -652,7 +662,8 @@
_("Found the appointment in the calendar '%s'"), e_source_peek_name (source));
set_buttons_sensitive (pitip);
- }
+ } else if (!pitip->current_ecal)
+ itip_view_set_show_keep_alarm_check (ITIP_VIEW (pitip->view), FALSE);
if (pitip->current_ecal) {
if (e_cal_get_static_capability (pitip->current_ecal, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) {
@@ -991,6 +1002,19 @@
icalcomponent_add_component (pitip->top_level, clone);
icalcomponent_set_method (pitip->top_level, pitip->method);
+ if (!itip_view_get_inherit_alarm_check_state (ITIP_VIEW (pitip->view))) {
+ icalcomponent *alarm_comp;
+ icalcompiter alarm_iter;
+
+ alarm_iter = icalcomponent_begin_component (clone, ICAL_VALARM_COMPONENT);
+ while ((alarm_comp = icalcompiter_deref (&alarm_iter)) != NULL) {
+ icalcompiter_next (&alarm_iter);
+
+ icalcomponent_remove_component (clone, alarm_comp);
+ icalcomponent_free (alarm_comp);
+ }
+ }
+
clone_comp = e_cal_component_new ();
if (!e_cal_component_set_icalcomponent (clone_comp, clone)) {
itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, _("Unable to parse item"));
@@ -999,6 +1023,35 @@
}
source = e_cal_get_source (pitip->current_ecal);
+ if (itip_view_get_keep_alarm_check_state (ITIP_VIEW (pitip->view))) {
+ ECalComponent *real_comp;
+ GList *alarms, *l;
+ ECalComponentAlarm *alarm;
+
+ real_comp = get_real_item (pitip);
+ if (real_comp != NULL) {
+ alarms = e_cal_component_get_alarm_uids (real_comp);
+
+ for (l = alarms; l; l = l->next) {
+ alarm = e_cal_component_get_alarm (real_comp, (const char *)l->data);
+
+ if (alarm) {
+ ECalComponentAlarm *aclone = e_cal_component_alarm_clone (alarm);
+
+ if (aclone) {
+ e_cal_component_add_alarm (clone_comp, aclone);
+ e_cal_component_alarm_free (aclone);
+ }
+
+ e_cal_component_alarm_free (alarm);
+ }
+ }
+
+ cal_obj_uid_list_free (alarms);
+ g_object_unref (real_comp);
+ }
+ }
+
if ((response != ITIP_VIEW_RESPONSE_CANCEL)
&& (response != ITIP_VIEW_RESPONSE_DECLINE)){
GSList *attachments = NULL, *new_attachments = NULL, *l;
@@ -1160,7 +1213,7 @@
}
/* FIXME send the attachments in the request */
- status = itip_send_comp (method, send_comp, client, NULL, NULL, NULL);
+ status = itip_send_comp (method, send_comp, client, NULL, NULL, NULL, TRUE);
g_object_unref (send_comp);
@@ -1310,7 +1363,7 @@
if (itip_view_get_update (ITIP_VIEW (pitip->view))) {
e_cal_component_commit_sequence (comp);
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL, TRUE);
}
if (!e_cal_modify_object (pitip->current_ecal, icalcomp, rid ? CALOBJ_MOD_THIS : CALOBJ_MOD_ALL, &error)) {
@@ -1340,7 +1393,7 @@
comp = get_real_item (pitip);
if (comp != NULL) {
- itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL);
+ itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL, NULL, NULL, TRUE);
g_object_unref (comp);
switch (pitip->type) {
@@ -1421,7 +1474,7 @@
}
static gboolean
-extract_itip_data (struct _itip_puri *pitip, GtkContainer *container)
+extract_itip_data (struct _itip_puri *pitip, GtkContainer *container, gboolean *have_alarms)
{
icalproperty *prop;
icalcomponent_kind kind = ICAL_NO_COMPONENT;
@@ -1581,14 +1634,24 @@
prop = icalcomponent_get_next_property (pitip->ical_comp, ICAL_X_PROPERTY);
}
- /* Strip out alarms for security purposes */
+ /* Strip out procedural alarms for security purposes */
alarm_iter = icalcomponent_begin_component (pitip->ical_comp, ICAL_VALARM_COMPONENT);
while ((alarm_comp = icalcompiter_deref (&alarm_iter)) != NULL) {
+ icalproperty *p;
+
icalcompiter_next (&alarm_iter);
- icalcomponent_remove_component (pitip->ical_comp, alarm_comp);
+ p = icalcomponent_get_first_property (alarm_comp, ICAL_ACTION_PROPERTY);
+ if (icalproperty_get_action (p) == ICAL_ACTION_PROCEDURE)
+ icalcomponent_remove_component (pitip->ical_comp, alarm_comp);
+
icalcomponent_free (alarm_comp);
}
+
+ if (have_alarms) {
+ alarm_iter = icalcomponent_begin_component (pitip->ical_comp, ICAL_VALARM_COMPONENT);
+ *have_alarms = icalcompiter_deref (&alarm_iter) != NULL;
+ }
}
pitip->comp = e_cal_component_new ();
@@ -1911,7 +1974,7 @@
}
e_cal_component_rescan (comp);
- if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL)) {
+ if (itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, pitip->current_ecal, pitip->top_level, NULL, NULL, TRUE)) {
camel_folder_set_message_flags (pitip->folder, pitip->uid, CAMEL_MESSAGE_ANSWERED, CAMEL_MESSAGE_ANSWERED);
}
@@ -1974,6 +2037,7 @@
const char *string, *org;
int i;
gboolean response_enabled;
+ gboolean have_alarms = FALSE;
info = (struct _itip_puri *) em_format_find_puri((EMFormat *)efh, pobject->classid);
@@ -1991,7 +2055,7 @@
}
/* FIXME Handle multiple VEVENTS with the same UID, ie detached instances */
- if (!extract_itip_data (info, GTK_CONTAINER (eb)))
+ if (!extract_itip_data (info, GTK_CONTAINER (eb), &have_alarms))
return TRUE;
info->view = itip_view_new ();
@@ -2003,6 +2067,8 @@
if (!response_enabled) {
itip_view_set_mode (ITIP_VIEW (info->view), ITIP_VIEW_MODE_HIDE_ALL);
} else {
+ itip_view_set_show_inherit_alarm_check (ITIP_VIEW (info->view), have_alarms && (info->method == ICAL_METHOD_PUBLISH || info->method == ICAL_METHOD_REQUEST));
+
switch (info->method) {
case ICAL_METHOD_PUBLISH:
case ICAL_METHOD_REQUEST:
Modified: branches/kill-bonobo/plugins/itip-formatter/itip-view.c
==============================================================================
--- branches/kill-bonobo/plugins/itip-formatter/itip-view.c (original)
+++ branches/kill-bonobo/plugins/itip-formatter/itip-view.c Wed Jan 21 02:52:05 2009
@@ -121,6 +121,8 @@
GtkWidget *options_box;
GtkWidget *free_time_check;
+ GtkWidget *keep_alarm_check;
+ GtkWidget *inherit_alarm_check;
GtkWidget *button_box;
gboolean buttons_sensitive;
@@ -947,6 +949,18 @@
itip_view_set_mode (view, priv->mode);
}
+/*
+ alarm_check_toggled_cb
+ check1 was changed, so make the second available based on state of the first check.
+*/
+static void
+alarm_check_toggled_cb (GtkWidget *check1, GtkWidget *check2)
+{
+ g_return_if_fail (check1 != NULL);
+ g_return_if_fail (check2 != NULL);
+
+ gtk_widget_set_sensitive (check2, !(GTK_WIDGET_VISIBLE (check1) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check1))));
+}
static void
itip_view_init (ItipView *view)
@@ -1119,6 +1133,17 @@
priv->free_time_check = gtk_check_button_new_with_mnemonic (_("Show time as _free"));
gtk_box_pack_start (GTK_BOX (priv->options_box), priv->free_time_check, FALSE, FALSE, 0);
+ priv->keep_alarm_check = gtk_check_button_new_with_mnemonic (_("_Preserve my reminder"));
+ /* default value is to keep user's alarms */
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->keep_alarm_check), TRUE);
+ gtk_box_pack_start (GTK_BOX (priv->options_box), priv->keep_alarm_check, FALSE, FALSE, 0);
+
+ priv->inherit_alarm_check = gtk_check_button_new_with_mnemonic (_("_Inherit reminder"));
+ gtk_box_pack_start (GTK_BOX (priv->options_box), priv->inherit_alarm_check, FALSE, FALSE, 0);
+
+ g_signal_connect (priv->keep_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->inherit_alarm_check);
+ g_signal_connect (priv->inherit_alarm_check, "toggled", G_CALLBACK (alarm_check_toggled_cb), priv->keep_alarm_check);
+
/* The buttons for actions */
priv->button_box = gtk_hbutton_box_new ();
gtk_button_box_set_layout (GTK_BUTTON_BOX (priv->button_box), GTK_BUTTONBOX_START);
@@ -2118,7 +2143,7 @@
if (show)
gtk_widget_show (view->priv->recur_check);
- else {
+ else {
gtk_widget_hide (view->priv->recur_check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->recur_check), FALSE);
}
@@ -2132,7 +2157,7 @@
if (show)
gtk_widget_show (view->priv->free_time_check);
- else {
+ else {
gtk_widget_hide (view->priv->free_time_check);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->free_time_check), FALSE);
}
@@ -2145,3 +2170,51 @@
return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view->priv->free_time_check));
}
+
+void
+itip_view_set_show_keep_alarm_check (ItipView *view, gboolean show)
+{
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (ITIP_IS_VIEW (view));
+
+ if (show)
+ gtk_widget_show (view->priv->keep_alarm_check);
+ else
+ gtk_widget_hide (view->priv->keep_alarm_check);
+
+ /* and update state of the second check */
+ alarm_check_toggled_cb (view->priv->keep_alarm_check, view->priv->inherit_alarm_check);
+}
+
+gboolean
+itip_view_get_keep_alarm_check_state (ItipView *view)
+{
+ g_return_val_if_fail (view != NULL, FALSE);
+
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view->priv->keep_alarm_check));
+}
+
+void
+itip_view_set_show_inherit_alarm_check (ItipView *view, gboolean show)
+{
+ g_return_if_fail (view != NULL);
+ g_return_if_fail (ITIP_IS_VIEW (view));
+
+ if (show)
+ gtk_widget_show (view->priv->inherit_alarm_check);
+ else {
+ gtk_widget_hide (view->priv->inherit_alarm_check);
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (view->priv->inherit_alarm_check), FALSE);
+ }
+
+ /* and update state of the second check */
+ alarm_check_toggled_cb (view->priv->inherit_alarm_check, view->priv->keep_alarm_check);
+}
+
+gboolean
+itip_view_get_inherit_alarm_check_state (ItipView *view)
+{
+ g_return_val_if_fail (view != NULL, FALSE);
+
+ return gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (view->priv->inherit_alarm_check));
+}
Modified: branches/kill-bonobo/plugins/itip-formatter/itip-view.h
==============================================================================
--- branches/kill-bonobo/plugins/itip-formatter/itip-view.h (original)
+++ branches/kill-bonobo/plugins/itip-formatter/itip-view.h Wed Jan 21 02:52:05 2009
@@ -180,6 +180,12 @@
void itip_view_set_show_free_time_check (ItipView *view, gboolean show);
gboolean itip_view_get_free_time_check_state (ItipView *view);
+void itip_view_set_show_keep_alarm_check (ItipView *view, gboolean show);
+gboolean itip_view_get_keep_alarm_check_state (ItipView *view);
+
+void itip_view_set_show_inherit_alarm_check (ItipView *view, gboolean show);
+gboolean itip_view_get_inherit_alarm_check_state (ItipView *view);
+
G_END_DECLS
#endif
Modified: branches/kill-bonobo/po/POTFILES.in
==============================================================================
--- branches/kill-bonobo/po/POTFILES.in (original)
+++ branches/kill-bonobo/po/POTFILES.in Wed Jan 21 02:52:05 2009
@@ -397,6 +397,7 @@
plugins/prefer-plain/org-gnome-prefer-plain.eplug.xml
plugins/prefer-plain/prefer-plain.c
plugins/profiler/org-gnome-evolution-profiler.eplug.xml
+plugins/pst-import/org-gnome-pst-import.eplug.xml
plugins/publish-calendar/org-gnome-publish-calendar.eplug.xml
plugins/publish-calendar/org-gnome-publish-calendar.xml
plugins/publish-calendar/publish-calendar.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]