Skip to content

Commit 2611c22

Browse files
committed
Fixed calendar save
1 parent 0642f0a commit 2611c22

File tree

6 files changed

+60
-6
lines changed

6 files changed

+60
-6
lines changed

.idea/workspace.xml

Lines changed: 15 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Calendar.todo

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/main/java/org/idaesbasic/controllers/MainController.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,8 @@ void saveCurrentFile() throws IOException {
448448
((TodolistController) controller).saveCurrentFile();
449449
} else if (controller.getClass().equals(new CalendarController().getClass())) {
450450
((CalendarController) controller).saveCurrentFile();
451+
} else if (controller.getClass().equals(new KanbanController().getClass())) {
452+
((KanbanController) controller).saveCurrentFile();
451453
}
452454
}
453455

@@ -503,8 +505,10 @@ Tab get_current_tab() {
503505
TreeItem<String> currentTreeItem() {
504506
MultipleSelectionModel<TreeItem<String>> selectionModel = fileExplorer.getSelectionModel();
505507
if(selectionModel.getSelectedItem() != null) {
508+
// Non root item is selected
506509
return (selectionModel.getSelectedItem());
507510
} else {
511+
// Root item is selected
508512
return fileExplorer.getRoot();
509513
}
510514
}

src/main/java/org/idaesbasic/controllers/calendar/CalendarController.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,11 @@ public void run() {
158158
calendarModel.removeEvent(i);
159159
}
160160
}
161-
//Add a calendareventitem with the summary and start / and end calendar to the events list
162-
calendarModel.addEvent(new CalendarEventItem(evt.getEntry().getTitle(), startTime, endTime, evt.getEntry().getId()));
161+
// Check if the entry is deleted
162+
if (evt.getEntry().getCalendar() != null) {
163+
//Add a calendareventitem with the summary and start / and end calendar to the events list
164+
calendarModel.addEvent(new CalendarEventItem(evt.getEntry().getTitle(), startTime, endTime, evt.getEntry().getId()));
165+
}
163166
}
164167
};
165168
viewContainer.getChildren().add(view);

src/main/java/org/idaesbasic/controllers/kanban/KanbanController.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,4 +155,7 @@ public void saveFile(String filePath) throws IOException {
155155
// close writer
156156
writer.close();
157157
}
158+
159+
public void saveCurrentFile() throws IOException {
160+
}
158161
}

test.ics

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
BEGIN:VCALENDAR
2+
PRODID:-//Ben Fortuna//iCal4j 1.0//EN
3+
CALSCALE:GREGORIAN
4+
VERSION:2.0
5+
BEGIN:VEVENT
6+
DTSTAMP:20211111T091735Z
7+
DTSTART:20211111T110000
8+
DTEND:20211111T120000
9+
SUMMARY:Neues Ereignis 1
10+
UID:48
11+
END:VEVENT
12+
BEGIN:VEVENT
13+
DTSTAMP:20211111T091735Z
14+
DTSTART:20211111T131500
15+
DTEND:20211111T153000
16+
SUMMARY:Neues Ereignis 1
17+
UID:49
18+
END:VEVENT
19+
BEGIN:VEVENT
20+
DTSTAMP:20211111T091735Z
21+
DTSTART:20211111T091500
22+
DTEND:20211111T101500
23+
SUMMARY:Neues Ereignis 2
24+
UID:50
25+
END:VEVENT
26+
BEGIN:VEVENT
27+
DTSTAMP:20211111T091735Z
28+
DTSTART:20211113T111500
29+
DTEND:20211114T124500
30+
SUMMARY:Neues Ereignis 1
31+
UID:55
32+
END:VEVENT
33+
END:VCALENDAR

0 commit comments

Comments
 (0)