mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-23 17:02:39 +00:00
feat: initial draft of lifecycle events API for plugins
This commit is contained in:
@@ -36,6 +36,7 @@
|
||||
#include "slic3r/Utils/NetworkAgentFactory.hpp"
|
||||
#include "slic3r/Utils/PresetUpdater.hpp"
|
||||
#include "slic3r/plugin/PluginConfig.hpp"
|
||||
#include "slic3r/plugin/PluginManager.hpp"
|
||||
#include "Plater.hpp"
|
||||
#include "MainFrame.hpp"
|
||||
#include "format.hpp"
|
||||
@@ -6900,6 +6901,20 @@ bool Tab::select_preset(
|
||||
}
|
||||
load_current_preset();
|
||||
|
||||
{
|
||||
Slic3r::LifecycleEventContext ctx;
|
||||
ctx.name = preset_name;
|
||||
ctx.code = Slic3r::LifecycleEvtCode::Ok;
|
||||
switch (m_type) {
|
||||
case Preset::TYPE_PRINT: ctx.msg = "print"; break;
|
||||
case Preset::TYPE_SLA_PRINT: ctx.msg = "sla_print"; break;
|
||||
case Preset::TYPE_FILAMENT: ctx.msg = "filament"; break;
|
||||
case Preset::TYPE_SLA_MATERIAL: ctx.msg = "sla_material"; break;
|
||||
case Preset::TYPE_PRINTER: ctx.msg = "printer"; break;
|
||||
default: break;
|
||||
}
|
||||
Slic3r::fire_lifecycle_event(Slic3r::LifecycleEvent::PresetSelected, ctx);
|
||||
}
|
||||
|
||||
if (delete_third_printer) {
|
||||
wxGetApp().CallAfter([filament_presets, process_presets]() {
|
||||
|
||||
Reference in New Issue
Block a user