mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 01:33:19 +00:00
Add create/modify button when creating/editing a task
This commit is contained in:
parent
e2b0c1ac74
commit
3650ddaccc
6 changed files with 69 additions and 39 deletions
|
@ -154,14 +154,16 @@ void UiState::setupCallbacks()
|
|||
task->setDate(date);
|
||||
}
|
||||
|
||||
if (!task.value().hasEvent() && date.year == 0) {
|
||||
task->unschedule();
|
||||
}
|
||||
|
||||
miraiInstance_->save();
|
||||
view_.update();
|
||||
reloadTasks();
|
||||
});
|
||||
|
||||
mainWindow_->global<ui::Backend>().on_create_task([&](ui::NewTaskData newTaskData) {
|
||||
std::cout << "Task date: " << newTaskData.date.year << " " << newTaskData.date.day
|
||||
<< std::endl;
|
||||
std::optional<mirai::Date> date = std::nullopt;
|
||||
if (newTaskData.date.year != 0) {
|
||||
date = SlintDateToMiraiDate(newTaskData.date);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue