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:
@@ -31,13 +31,15 @@
|
||||
#include "common/filefunctions.h"
|
||||
#include "config/config.h"
|
||||
#include "coreengine.h"
|
||||
#include "dialog/diskcache/diskcachedialog.h"
|
||||
|
||||
namespace olive
|
||||
{
|
||||
|
||||
DiskManager *DiskManager::instance_ = nullptr;
|
||||
|
||||
DiskManager::ShowDiskCacheSettingsHandler
|
||||
DiskManager::show_disk_cache_settings_handler_;
|
||||
|
||||
DiskManager::DiskManager()
|
||||
{
|
||||
// Add default cache location
|
||||
@@ -181,11 +183,21 @@ QString DiskManager::get_default_disk_cache_path()
|
||||
.filePath("mediacache");
|
||||
}
|
||||
|
||||
void DiskManager::set_show_disk_cache_settings_handler(
|
||||
ShowDiskCacheSettingsHandler handler)
|
||||
{
|
||||
show_disk_cache_settings_handler_ = std::move(handler);
|
||||
}
|
||||
|
||||
void DiskManager::show_disk_cache_settings_dialog(DiskCacheFolder *folder,
|
||||
QWidget *parent)
|
||||
{
|
||||
DiskCacheDialog d(folder, parent);
|
||||
d.exec();
|
||||
if (show_disk_cache_settings_handler_) {
|
||||
show_disk_cache_settings_handler_(folder, parent);
|
||||
return;
|
||||
}
|
||||
|
||||
qWarning() << "No disk cache settings dialog handler registered, skipping";
|
||||
}
|
||||
|
||||
void DiskManager::show_disk_cache_settings_dialog(const QString &path,
|
||||
|
||||
Reference in New Issue
Block a user