mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-04 18:53:19 +00:00
Refactor the whole structure, no more separation for C++ and Slint files
This commit is contained in:
parent
d6c781faa2
commit
893fcc11e3
35 changed files with 920 additions and 518 deletions
46
src/windows/AppWindow/AppWindow.h
Normal file
46
src/windows/AppWindow/AppWindow.h
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* 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 "../AddSourceWindow/AddSourceWindow.h"
|
||||
#include "../EditSourceWindow/EditSourceWindow.h"
|
||||
#include "../SettingsWindow/SettingsWindow.h"
|
||||
#include "mirai-core/Mirai.h"
|
||||
#include "mirai-core/View.h"
|
||||
#include "slint.h"
|
||||
#include "ui.h"
|
||||
|
||||
class AppWindow
|
||||
{
|
||||
|
||||
public:
|
||||
AppWindow(mirai::Mirai *mirai);
|
||||
|
||||
void run();
|
||||
|
||||
void reloadSources();
|
||||
void reloadTasks();
|
||||
void refreshModels();
|
||||
|
||||
private:
|
||||
void setupCallbacks();
|
||||
const ui::AppWindowModels &models();
|
||||
const ui::AppWindowActions &actions();
|
||||
|
||||
std::shared_ptr<slint::VectorModel<ui::Source>> sources_;
|
||||
std::shared_ptr<slint::VectorModel<ui::Day>> days_;
|
||||
std::shared_ptr<slint::VectorModel<ui::CalendarDay>> calendar_;
|
||||
std::shared_ptr<slint::VectorModel<ui::TaskData>> unscheduledTasks_;
|
||||
|
||||
slint::ComponentHandle<ui::AppWindow> mainWindow_ = ui::AppWindow::create();
|
||||
SettingsWindow settingsWindow_;
|
||||
AddSourceWindow addSourceWindow_;
|
||||
EditSourceWindow editSourceWindow_;
|
||||
|
||||
mirai::Mirai *miraiInstance_;
|
||||
mirai::View view_;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue