feat: Python Plugins

This commit is contained in:
Ian Chua
2026-07-02 17:49:36 +08:00
parent 395e070a0e
commit ecddf3d18f
183 changed files with 49955 additions and 2120 deletions
+60
View File
@@ -0,0 +1,60 @@
#ifndef SLIC3R_GUI_PLUGINPICKERDIALOG_HPP
#define SLIC3R_GUI_PLUGINPICKERDIALOG_HPP
#include <wx/wxprec.h>
#ifndef WX_PRECOMP
# include <wx/wx.h>
#endif
#include <vector>
#include <string>
#include "slic3r/plugin/PluginManager.hpp"
namespace Slic3r { namespace GUI {
class PluginPickerDialog : public wxDialog
{
public:
// Entry for capability-level selection (plugin_type non-empty path).
struct CapabilityEntry {
std::string plugin_key;
std::string name;
wxString label;
wxString description;
};
// Existing constructor: offer all loaded plugin packages (plugin_type empty path).
PluginPickerDialog(wxWindow* parent,
const wxString& plugin_type_label,
const std::vector<Slic3r::PluginDescriptor>& plugins);
// New constructor: offer a list of capabilities (plugin_type non-empty path).
PluginPickerDialog(wxWindow* parent,
const wxString& plugin_type_label,
std::vector<CapabilityEntry> capabilities);
// Returns the plugin_key of the selected plugin package (package path).
std::string selected_plugin_key() const;
// Returns the {plugin_key, name} of the selected capability (capability path).
CapabilityEntry selected_capability() const;
void update_plugin_list(const std::vector<PluginDescriptor>& updated_plugins) { m_plugins = updated_plugins; }
private:
void build_ui(const wxString& plugin_type_label);
void build_capability_ui(const wxString& plugin_type_label);
void update_description(int selection);
void update_capability_description(int selection);
wxChoice* m_choice { nullptr };
wxStaticText* m_description { nullptr };
std::vector<Slic3r::PluginDescriptor> m_plugins;
std::vector<CapabilityEntry> m_capabilities;
bool m_capability_mode { false };
};
}} // namespace Slic3r::GUI
#endif // SLIC3R_GUI_PLUGINPICKERDIALOG_HPP