Remove unused code, move logic from .h to their .cpp, clean some things

This commit is contained in:
Vyn 2024-09-02 11:52:06 +02:00
parent 924e35ecc4
commit cb6c663833
41 changed files with 492 additions and 978 deletions

View file

@ -29,7 +29,7 @@ export component EventWindow inherits Window {
default-font-size: 16px;
background: Palette.background;
in-out property<int> sourceId <=> resourceInput.current-index;
in-out property<int> sourceId <=> sourceInput.current-index;
in-out property<int> eventId: -1;
in-out property<Date> taskDate <=> taskDateInput.date;
in-out property<string> taskTitle <=> taskTitleInput.text;
@ -46,8 +46,8 @@ export component EventWindow inherits Window {
text: eventId == -1 ? "New event" : "Edit event";
}
resourceInput := ComboBox {
model: Backend.resources;
sourceInput := ComboBox {
model: Backend.sources;
enabled: eventId == -1;
}

View file

@ -16,7 +16,7 @@ export struct SaveTaskData {
date: Date,
}
export component TaskEdit inherits Window {
export component TaskWindow inherits Window {
title: "Mirai - " + (taskId == -1 ? "New task" : "Edit task");
min-width: 100px;
max-width: 1920px;
@ -30,7 +30,7 @@ export component TaskEdit inherits Window {
in-out property<int> eventId: -1;
in-out property<Date> taskDate <=> taskDateInput.date;
in-out property<string> taskTitle <=> taskTitleInput.text;
in-out property<int> taskResourceIndex <=> resourceInput.current-index;
in-out property<int> taskSourceIndex <=> sourceInput.current-index;
callback create(NewTaskData);
callback save(SaveTaskData);
@ -42,8 +42,8 @@ export component TaskEdit inherits Window {
text: taskId == -1 ? "New task" : "Edit task";
}
resourceInput := ComboBox {
model: Backend.resources;
sourceInput := ComboBox {
model: Backend.sources;
enabled: taskId == -1 && eventId == -1;
}
@ -63,14 +63,14 @@ export component TaskEdit inherits Window {
clicked => {
if (taskId == -1) {
create({
sourceId: taskResourceIndex,
sourceId: taskSourceIndex,
eventId: eventId,
title: taskTitle,
date: taskDate,
});
} else {
save({
sourceId: taskResourceIndex,
sourceId: taskSourceIndex,
id: taskId,
title: taskTitle,
date: taskDate,