refactor: invert the last engine-to-UI dependencies
- NodeFactory's menu creation moves to UI-side widget/menu/factorymenu (the factory only exposes its node library read-only now) - DiskManager's cache-settings dialog is created through a registered std::function handler (registered by Core at startup) - OlivePluginInstance creates progress UIs through a PluginProgressReporter interface (Null fallback headless) and queries the active viewer through a provider callback, both registered by Core - factory.h, diskmanager and pluginSupport no longer reference any widget//dialog//panel//window headers or classes
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include <QObject>
|
||||
#include <QTimer>
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "common/define.h"
|
||||
#include "node/project.h"
|
||||
|
||||
@@ -143,6 +145,19 @@ public:
|
||||
|
||||
static QString get_default_disk_cache_path();
|
||||
|
||||
/**
|
||||
* @brief Handler showing the disk cache settings dialog for a folder
|
||||
*
|
||||
* Registered by the UI layer (e.g. a DiskCacheDialog-based
|
||||
* implementation), since the engine cannot show dialogs itself. Without
|
||||
* a handler, the request is logged and skipped.
|
||||
*/
|
||||
using ShowDiskCacheSettingsHandler =
|
||||
std::function<void(DiskCacheFolder *folder, QWidget *parent)>;
|
||||
|
||||
static void set_show_disk_cache_settings_handler(
|
||||
ShowDiskCacheSettingsHandler handler);
|
||||
|
||||
void show_disk_cache_settings_dialog(DiskCacheFolder *folder, QWidget *parent);
|
||||
void show_disk_cache_settings_dialog(const QString &path, QWidget *parent);
|
||||
|
||||
@@ -165,6 +180,8 @@ private:
|
||||
|
||||
static DiskManager *instance_;
|
||||
|
||||
static ShowDiskCacheSettingsHandler show_disk_cache_settings_handler_;
|
||||
|
||||
QVector<DiskCacheFolder *> open_folders_;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user