Update dependencies and adapt code

This commit is contained in:
Vyn 2024-10-27 22:11:11 +01:00
parent f11f4bf1c9
commit a80515ff90
9 changed files with 72 additions and 29 deletions

38
src/AppWindowBackend.h Normal file
View file

@ -0,0 +1,38 @@
/*
* 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/View.h"
#include "slint.h"
class AppWindowBackend
{
public:
AppWindowBackend(mirai::Mirai *mirai);
void run();
void reloadSources();
void reloadTasks();
private:
void setupCallbacks();
void setupUtilsCallbacks();
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
std::shared_ptr<slint::VectorModel<slint::SharedString>> tags_;
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
std::shared_ptr<slint::VectorModel<ui::TaskData>> unscheduledTasks_;
slint::ComponentHandle<ui::AppWindow> mainWindow_ = ui::AppWindow::create();
mirai::Mirai *miraiInstance_;
mirai::View view_;
};