mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-02 01:13:19 +00:00
43 lines
1.1 KiB
C++
43 lines
1.1 KiB
C++
/*
|
|
* Mirai. Copyright (C) 2024 Vyn
|
|
* This file is licensed under version 3 of the GNU General Public License (GPL-3.0-only)
|
|
* The license can be found in the LICENSE file or at https://www.gnu.org/licenses/gpl-3.0.txt
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "appwindow.h"
|
|
#include "mirai-core/Mirai.h"
|
|
#include "mirai-core/TasksView.h"
|
|
#include "slint.h"
|
|
|
|
class UiState
|
|
{
|
|
|
|
public:
|
|
UiState(mirai::Mirai *mirai);
|
|
|
|
void run();
|
|
|
|
void reloadSources();
|
|
void reloadTags();
|
|
void reloadTasks();
|
|
|
|
private:
|
|
void setupCallbacks();
|
|
void setupTaskWindowCallbacks();
|
|
void setupEventWindowCallbacks();
|
|
void setupUtilsCallbacks();
|
|
|
|
std::shared_ptr<slint::VectorModel<Source>> sources_;
|
|
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
|
|
std::shared_ptr<slint::VectorModel<Day>> days_;
|
|
std::shared_ptr<slint::VectorModel<TaskData>> unscheduledTasks_;
|
|
|
|
slint::ComponentHandle<AppWindow> mainWindow_ = AppWindow::create();
|
|
slint::ComponentHandle<TaskWindow> taskWindow_ = TaskWindow::create();
|
|
slint::ComponentHandle<EventWindow> eventWindow_ = EventWindow::create();
|
|
|
|
mirai::Mirai *miraiInstance_;
|
|
mirai::TasksView view_;
|
|
};
|