void cal_process_attachment(wc_mime_attachment *Mime)
{
icalcomponent *cal;
-
+
cal = icalcomponent_new_from_string(ChrPtr(Mime->Data));
FlushStrBuf(Mime->Data);
if (cal == NULL) {
icalproperty_new_summary(bstr("summary")));
} else {
icalcomponent_add_property(vtodo,
- icalproperty_new_summary("Untitled Task"));
+ icalproperty_new_summary(_("Untitled Task")));
}
while (prop = icalcomponent_get_first_property(vtodo,
icalcomponent_remove_property(vtodo,prop);
icalproperty_free(prop);
}
+ while(prop = icalcomponent_get_first_property(vtodo,
+ ICAL_PERCENTCOMPLETE_PROPERTY), prop != NULL) {
+ icalcomponent_remove_property(vtodo,prop);
+ icalproperty_free(prop);
+ }
+
if (havebstr("status")) {
- icalproperty_status taskStatus = icalproperty_string_to_status(
- bstr("status"));
+ icalproperty_status taskStatus = icalproperty_string_to_status(bstr("status"));
icalcomponent_set_status(vtodo, taskStatus);
+ icalcomponent_add_property(vtodo,
+ icalproperty_new_percentcomplete(
+ (strcasecmp(bstr("status"), "completed") ? 0 : 100)
+ )
+ );
+ }
+ else {
+ icalcomponent_add_property(vtodo, icalproperty_new_percentcomplete(0));
}
while (prop = icalcomponent_get_first_property(vtodo,
ICAL_CATEGORIES_PROPERTY), prop != NULL) {
InitModule_CALENDAR
(void)
{
- RegisterPreference(HKEY("daystart"), _("Calendar day view begins at:"), PRF_INT, NULL);
- RegisterPreference(HKEY("dayend"), _("Calendar day view ends at:"), PRF_INT, NULL);
- RegisterPreference(HKEY("weekstart"), _("Week starts on:"), PRF_INT, NULL);
+ RegisterPreference("daystart", _("Calendar day view begins at:"), PRF_INT, NULL);
+ RegisterPreference("dayend", _("Calendar day view ends at:"), PRF_INT, NULL);
+ RegisterPreference("weekstart", _("Week starts on:"), PRF_INT, NULL);
WebcitAddUrlHandler(HKEY("display_edit_task"), display_edit_task, 0);
WebcitAddUrlHandler(HKEY("save_task"), save_task, 0);