diff options
| author | Danilo M. <danix@danix.xyz> | 2026-11-26 10:23:59 +0100 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-11-26 10:23:59 +0100 |
| commit | abd85b71acd21eb3c7d20b4d04c0d77511cc09c8 (patch) | |
| tree | 65b061334be923f5f1df0b31169ca4345e556a22 /desktop/island/calendar/CalendarPanel.qml | |
| parent | 26956721dfb6c7f32153f283b1b07fd2eaf5b19b (diff) | |
| download | quickshell-abd85b71acd21eb3c7d20b4d04c0d77511cc09c8.tar.gz quickshell-abd85b71acd21eb3c7d20b4d04c0d77511cc09c8.zip | |
feat(calendar): a dropped .ics opens the event editor, filled in
A lone .ics dropped on the island's sliver goes to the calendar rather
than the assistant canvas: the panel opens on the event's month with the
new-event form filled from the file, for review before Save. The bubble
says where the drop will go while the drag is over it.
calctl gains `read FILE`, which returns the file's master VEVENT in the
same shape as `get`, with no UID so saving creates a new event in the
default calendar. A rule or alarm the form cannot express reads `none`:
`custom` would tell apply() to keep what is there, and a new event has
nothing there to keep. The drop no longer needs the assistant to be
present for .ics files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/island/calendar/CalendarPanel.qml')
| -rw-r--r-- | desktop/island/calendar/CalendarPanel.qml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/desktop/island/calendar/CalendarPanel.qml b/desktop/island/calendar/CalendarPanel.qml index fef672c..cea3898 100644 --- a/desktop/island/calendar/CalendarPanel.qml +++ b/desktop/island/calendar/CalendarPanel.qml @@ -86,6 +86,19 @@ Item { panel.editing = true; } + // A dropped .ics: the editor, filled from it, on its month. Nothing is + // saved until Save. + function importFile(path) { + Calendar.read(path, r => { + if (!r.ok) { panel.agendaError = r.error; return; } + const d = Cal.fromEvent(r.data); + panel.selected = d.startDay; + panel.show(+d.startDay.slice(0, 4), +d.startDay.slice(5, 7) - 1); + editor.load(d); + panel.editing = true; + }); + } + function closeEditor() { panel.editing = false; panel.forceActiveFocus(); |
