FIX: the data and UI are out of sync when creating printer

jira: STUDIO-11080
Change-Id: I4cc86174b4ed847b53c87f85f9e590742e6dd9ff
(cherry picked from commit c366876acfb95b16bedb57f9e22e1623fc749f7e)
This commit is contained in:
zhimin.zeng
2025-03-24 19:18:33 +08:00
committed by Noisyfox
parent c2c4fbe3a8
commit 5ce2ec11a8
4 changed files with 116 additions and 53 deletions

View File

@@ -14,7 +14,7 @@
#include "miniz.h"
#include "ParamsDialog.hpp"
namespace Slic3r {
namespace Slic3r {
namespace GUI {
class CreateFilamentPresetDialog : public DPIDialog
@@ -24,7 +24,7 @@ public:
~CreateFilamentPresetDialog();
protected:
enum FilamentOptionType {
enum FilamentOptionType {
VENDOR = 0,
TYPE,
SERIAL,
@@ -126,6 +126,7 @@ protected:
/********************************************************** Data Interaction *******************************************************/
bool data_init();
void on_select_printer_model(wxCommandEvent &e);
void set_current_visible_printer();
void select_curr_radiobox(std::vector<std::pair<RadioBox *, wxString>> &radiobox_list, int btn_idx);
void select_all_preset_template(std::vector<std::pair<::CheckBox *, Preset *>> &preset_templates);
@@ -236,7 +237,7 @@ public:
~ExportConfigsDialog();//to do: delete preset
protected:
struct ExportType
{
wxString preset_bundle;
@@ -326,7 +327,7 @@ class PresetTree
{
public:
PresetTree(EditFilamentPresetDialog *dialog);
wxPanel *get_preset_tree(std::pair<std::string, std::vector<std::shared_ptr<Preset>>> printer_and_presets);
private:
@@ -349,7 +350,7 @@ class EditFilamentPresetDialog : public DPIDialog
public:
EditFilamentPresetDialog(wxWindow *parent, Filamentinformation *filament_info);
~EditFilamentPresetDialog();
wxPanel *get_preset_tree_panel() { return m_preset_tree_panel; }
std::shared_ptr<Preset> get_need_edit_preset() { return m_need_edit_preset; }
void set_printer_name(const std::string &printer_name) { m_selected_printer = printer_name; }