Add color for events and source tags

This commit is contained in:
Vyn 2025-06-26 10:12:23 +02:00
parent d208fc6ca4
commit 4bca7fac3e
Signed by: vyn
GPG key ID: E1B2BE34E7A971E7
12 changed files with 95 additions and 39 deletions

View file

@ -24,7 +24,8 @@ class Mirai
void addSource(
const std::string &name, const std::string &type, std::unique_ptr<DataProvider> &&source
);
void editSource(int id, const std::string &name, const std::string &path);
void
editSource(int id, const std::string &name, const std::string &color, const std::string &path);
void deleteSource(int id);
void unloadAllSources();
void save();

View file

@ -32,6 +32,7 @@ struct createEventParams {
struct SourceConstructor {
std::string name;
std::string color;
DataProvider *sourceDataProvider;
};
@ -39,7 +40,8 @@ class Source
{
public:
Source(SourceConstructor params)
: data(params.sourceDataProvider), name_(params.name), type_("FileSystemMarkdown")
: data(params.sourceDataProvider), name_(params.name), color_(params.color),
type_("FileSystemMarkdown")
{
}
@ -56,9 +58,11 @@ class Source
std::string name() const;
std::string type() const;
std::string color() const;
DataProvider *dataProvider();
void setName(const std::string &name);
void setColor(const std::string &color);
void createTask(const createTaskParams &task);
void removeTask(const Task &task);
@ -92,6 +96,7 @@ class Source
std::string name_;
std::string type_;
std::string color_;
DataProvider *data;
};
} // namespace mirai