aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/island/calendar/CalendarPanel.qml
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/island/calendar/CalendarPanel.qml')
-rw-r--r--desktop/island/calendar/CalendarPanel.qml13
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();