mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 10:43:19 +00:00
Ui changes, remove unused buttons
This commit is contained in:
parent
36a2fe9220
commit
e28ba796cd
53 changed files with 133 additions and 27125 deletions
18
external/mirai-core/src/Task.cpp
vendored
18
external/mirai-core/src/Task.cpp
vendored
|
@ -5,8 +5,9 @@
|
|||
*/
|
||||
|
||||
#include "Task.h"
|
||||
#include "DataProvider.h"
|
||||
#include "Day.h"
|
||||
#include "SourceDataProvider.h"
|
||||
#include "utils.h"
|
||||
#include <optional>
|
||||
#include <string>
|
||||
|
||||
|
@ -38,6 +39,11 @@ bool Task::checked() const
|
|||
return task_.state == mirai::DONE;
|
||||
}
|
||||
|
||||
bool Task::hasEvent() const
|
||||
{
|
||||
return task_.eventId.has_value();
|
||||
}
|
||||
|
||||
void Task::setTitle(const std::string &newTitle)
|
||||
{
|
||||
data_->updateTask(id(), {.title = newTitle});
|
||||
|
@ -49,6 +55,16 @@ void Task::setDay(const Day &day)
|
|||
data_->updateTask(id(), {.dayId = day.id(), .eventId = emptyEventId});
|
||||
}
|
||||
|
||||
void Task::setDate(const Date &date)
|
||||
{
|
||||
auto day = data_->getDayByDate(date);
|
||||
if (!day.has_value()) {
|
||||
day = data_->insertDay({.id = generateUniqueId(), .date = date});
|
||||
}
|
||||
auto emptyEventId = std::optional<std::optional<int>>(std::optional<int>(std::nullopt));
|
||||
data_->updateTask(id(), {.dayId = day.value().id, .eventId = emptyEventId});
|
||||
}
|
||||
|
||||
void Task::setEvent(const Event &event)
|
||||
{
|
||||
auto emptyDayId = std::optional<std::optional<int>>(std::optional<int>(std::nullopt));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue