mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-18 08:22:06 +00:00
refactor: collapse speed-dial action source abstraction
Only one action source ever existed, so the IActionSource interface and ScriptActionSource are gone. ActionRegistry now subscribes to the plugin loader and enumerates actions directly in init() - no polymorphism for one impl. Replace the opaque FNV-hash SpeedDialActionId with a readable composed id of the form prefix:title:source_key. Split AppAction's single source field into source_key (stable identity, e.g. plugin_key) and source_name (display), so identity and display no longer share one field.
This commit is contained in:
@@ -142,7 +142,6 @@
|
||||
|
||||
#include "PluginsDialog.hpp"
|
||||
#include "SpeedDialDialog.hpp"
|
||||
#include "ScriptActionSource.hpp"
|
||||
#include "TerminalDialog.hpp"
|
||||
|
||||
//#ifdef WIN32
|
||||
@@ -3172,15 +3171,7 @@ bool GUI_App::on_init_inner()
|
||||
|
||||
init_plugin_gui_wiring();
|
||||
|
||||
// Register all AppAction sources
|
||||
m_action_registry.add_source(std::make_unique<ScriptActionSource>());
|
||||
// m_action_registry.add_source(std::make_unique<AnotherActionSource>());
|
||||
// m_action_registry.add_source(std::make_unique<YetAnotherActionSource>());
|
||||
// ...
|
||||
|
||||
// Initialize with all added sources
|
||||
// - register callbacks,
|
||||
// - then enumerate: upsert all actions into registry
|
||||
// Subscribe to the plugin loader and enumerate current actions (UI thread, once).
|
||||
m_action_registry.init();
|
||||
|
||||
for (const std::string& plugin_key : plugin_mgr.get_enabled_plugin_keys()) {
|
||||
|
||||
Reference in New Issue
Block a user