Release 2.14.1 #72
@@ -241,18 +241,31 @@ class EventEditViewModel @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Seed a fresh event from a parsed `.ics` file (the single-event "open into
|
* Seed a fresh event from a prefilled [form] — a parsed single-event `.ics`
|
||||||
* the create form" path). [form] already carries the file's fields; its
|
* file or an external `ACTION_INSERT` intent (another app/widget creating an
|
||||||
* [EventForm.calendarId] is null so the calendar still resolves to the
|
* event, e.g. Google Maps' "add to calendar"; #30, #49). [EventForm.calendarId]
|
||||||
* last-used/first-writable one, and reminders are frozen as touched so the
|
* is null so the calendar still resolves to the last-used/first-writable one.
|
||||||
* settings default never overwrites what the file specified. No-op when a
|
*
|
||||||
* form is already open, so the prefill survives configuration changes.
|
* Reminders follow the source rather than the path: a form that carries its
|
||||||
|
* own (an `.ics` with VALARMs) freezes them as touched, so the settings
|
||||||
|
* default never overwrites what it specified; a form with none — every
|
||||||
|
* insert intent, and an `.ics` without VALARMs — falls back to the settings
|
||||||
|
* default exactly like [openNew], instead of the empty freeze suppressing it.
|
||||||
|
* No-op when a form is already open, so the prefill survives configuration
|
||||||
|
* changes.
|
||||||
*/
|
*/
|
||||||
fun openImported(form: EventForm) {
|
fun openImported(form: EventForm) {
|
||||||
if (_form.value != null || _editTarget.value != null) return
|
if (_form.value != null || _editTarget.value != null) return
|
||||||
_remindersTouched.value = true
|
|
||||||
_revealed.value = form.populatedFields()
|
_revealed.value = form.populatedFields()
|
||||||
_form.value = form
|
_form.value = form
|
||||||
|
if (form.reminders.isNotEmpty()) {
|
||||||
|
// Source specified its own reminders — freeze so the default can't
|
||||||
|
// clobber them (and a later calendar/all-day switch won't re-apply).
|
||||||
|
_remindersTouched.value = true
|
||||||
|
} else {
|
||||||
|
// Nothing carried: inherit the settings default like a new event.
|
||||||
|
applyDefaultReminder()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user