2024-08-16 21:35:12 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2024-11-04 14:45:27 +01:00
|
|
|
#include "../AddSourceWindow/AddSourceWindow.h"
|
2025-06-17 17:03:07 +02:00
|
|
|
#include "../EditEventWindow/EditEventWindow.h"
|
2024-11-04 14:45:27 +01:00
|
|
|
#include "../EditSourceWindow/EditSourceWindow.h"
|
|
|
|
#include "../SettingsWindow/SettingsWindow.h"
|
2024-08-16 21:35:12 +02:00
|
|
|
#include "mirai-core/Mirai.h"
|
2024-10-11 16:26:13 +02:00
|
|
|
#include "mirai-core/View.h"
|
2024-08-16 21:35:12 +02:00
|
|
|
#include "slint.h"
|
2024-11-04 14:45:27 +01:00
|
|
|
#include "ui.h"
|
2024-08-16 21:35:12 +02:00
|
|
|
|
2024-11-04 14:45:27 +01:00
|
|
|
class AppWindow
|
2024-08-16 21:35:12 +02:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
2024-11-04 14:45:27 +01:00
|
|
|
AppWindow(mirai::Mirai *mirai);
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
void run();
|
|
|
|
|
2024-09-02 11:52:06 +02:00
|
|
|
void reloadSources();
|
2024-08-16 21:35:12 +02:00
|
|
|
void reloadTasks();
|
2024-11-04 14:45:27 +01:00
|
|
|
void refreshModels();
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
void setupCallbacks();
|
2024-11-04 14:45:27 +01:00
|
|
|
const ui::AppWindowModels &models();
|
|
|
|
const ui::AppWindowActions &actions();
|
2024-08-16 21:35:12 +02:00
|
|
|
|
2024-10-15 16:51:05 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
|
|
|
|
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
|
2024-10-29 15:02:46 +01:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::CalendarDay>> calendar_;
|
2024-10-15 16:51:05 +02:00
|
|
|
std::shared_ptr<slint::VectorModel<ui::TaskData>> unscheduledTasks_;
|
2024-08-16 21:35:12 +02:00
|
|
|
|
2024-10-15 16:51:05 +02:00
|
|
|
slint::ComponentHandle<ui::AppWindow> mainWindow_ = ui::AppWindow::create();
|
2024-11-04 14:45:27 +01:00
|
|
|
SettingsWindow settingsWindow_;
|
|
|
|
AddSourceWindow addSourceWindow_;
|
|
|
|
EditSourceWindow editSourceWindow_;
|
2025-06-17 17:03:07 +02:00
|
|
|
EditEventWindow editEventWindow_;
|
2024-08-16 21:35:12 +02:00
|
|
|
|
|
|
|
mirai::Mirai *miraiInstance_;
|
2024-10-11 16:26:13 +02:00
|
|
|
mirai::View view_;
|
2024-08-16 21:35:12 +02:00
|
|
|
};
|