mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-23 17:53:12 +08:00
FIX: close edit preset paramsDialog, mac unresponsive
Change-Id: Ic816754a20b7f6a5cdb46475750eb301fec3ad3a
This commit is contained in:
parent
2126999097
commit
8ecafa356f
@ -12,7 +12,6 @@
|
|||||||
#include "MsgDialog.hpp"
|
#include "MsgDialog.hpp"
|
||||||
#include "FileHelp.hpp"
|
#include "FileHelp.hpp"
|
||||||
#include "Tab.hpp"
|
#include "Tab.hpp"
|
||||||
#include "ParamsDialog.hpp"
|
|
||||||
#include "MainFrame.hpp"
|
#include "MainFrame.hpp"
|
||||||
|
|
||||||
#define NAME_OPTION_COMBOBOX_SIZE wxSize(FromDIP(200), FromDIP(24))
|
#define NAME_OPTION_COMBOBOX_SIZE wxSize(FromDIP(200), FromDIP(24))
|
||||||
@ -4431,10 +4430,12 @@ void EditFilamentPresetDialog::edit_preset()
|
|||||||
wxGetApp().get_tab(need_edit_preset->type)->select_preset(need_edit_preset_name);
|
wxGetApp().get_tab(need_edit_preset->type)->select_preset(need_edit_preset_name);
|
||||||
// when some preset have modified, if the printer is not need_edit_preset_name compatible printer, the preset will jump to other preset, need select again
|
// when some preset have modified, if the printer is not need_edit_preset_name compatible printer, the preset will jump to other preset, need select again
|
||||||
if (!need_edit_preset->is_compatible) wxGetApp().get_tab(need_edit_preset->type)->select_preset(need_edit_preset_name);
|
if (!need_edit_preset->is_compatible) wxGetApp().get_tab(need_edit_preset->type)->select_preset(need_edit_preset_name);
|
||||||
wxGetApp().params_dialog()->Popup(true);
|
|
||||||
|
|
||||||
m_selected_printer.clear();
|
m_selected_printer.clear();
|
||||||
m_need_edit_preset_index = -1;
|
m_need_edit_preset_index = -1;
|
||||||
|
|
||||||
|
wxGetApp().params_dialog()->set_editing_filament_id(m_filament_id);
|
||||||
|
EndModal(wxID_EDIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBoxSizer *EditFilamentPresetDialog::create_filament_basic_info()
|
wxBoxSizer *EditFilamentPresetDialog::create_filament_basic_info()
|
||||||
@ -4917,7 +4918,7 @@ wxPanel *PresetTree::get_child_item(wxPanel *parent, std::shared_ptr<Preset> pre
|
|||||||
edit_preset_btn->SetBackgroundColor(flush_bg_col);
|
edit_preset_btn->SetBackgroundColor(flush_bg_col);
|
||||||
edit_preset_btn->SetBorderColor(flush_bd_col);
|
edit_preset_btn->SetBorderColor(flush_bd_col);
|
||||||
edit_preset_btn->SetTextColor(flush_fg_col);
|
edit_preset_btn->SetTextColor(flush_fg_col);
|
||||||
edit_preset_btn->Hide();
|
//edit_preset_btn->Hide();
|
||||||
sizer->Add(edit_preset_btn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0);
|
sizer->Add(edit_preset_btn, 0, wxALL | wxALIGN_CENTER_VERTICAL, 0);
|
||||||
sizer->Add(0, 0, 0, wxLEFT, 5);
|
sizer->Add(0, 0, 0, wxLEFT, 5);
|
||||||
|
|
||||||
|
@ -11,17 +11,11 @@
|
|||||||
#include "Widgets/CheckBox.hpp"
|
#include "Widgets/CheckBox.hpp"
|
||||||
#include "Widgets/ComboBox.hpp"
|
#include "Widgets/ComboBox.hpp"
|
||||||
#include "miniz.h"
|
#include "miniz.h"
|
||||||
|
#include "ParamsDialog.hpp"
|
||||||
|
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
class FilamentInfomation : public wxObject
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
std::string filament_id;
|
|
||||||
std::string filament_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CreateFilamentPresetDialog : public DPIDialog
|
class CreateFilamentPresetDialog : public DPIDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
@ -52,6 +52,12 @@ ParamsDialog::ParamsDialog(wxWindow * parent)
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
Hide();
|
Hide();
|
||||||
|
if (!m_editing_filament_id.empty()) {
|
||||||
|
FilamentInfomation *filament_info = new FilamentInfomation();
|
||||||
|
filament_info->filament_id = m_editing_filament_id;
|
||||||
|
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_MODIFY_FILAMENT, filament_info));
|
||||||
|
m_editing_filament_id.clear();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
wxGetApp().sidebar().finish_param_edit();
|
wxGetApp().sidebar().finish_param_edit();
|
||||||
});
|
});
|
||||||
|
@ -11,6 +11,15 @@
|
|||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
namespace GUI {
|
namespace GUI {
|
||||||
|
|
||||||
|
wxDECLARE_EVENT(EVT_MODIFY_FILAMENT, SimpleEvent);
|
||||||
|
|
||||||
|
class FilamentInfomation : public wxObject
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
std::string filament_id;
|
||||||
|
std::string filament_name;
|
||||||
|
};
|
||||||
|
|
||||||
class ParamsPanel;
|
class ParamsPanel;
|
||||||
|
|
||||||
class ParamsDialog : public DPIDialog
|
class ParamsDialog : public DPIDialog
|
||||||
@ -22,10 +31,13 @@ public:
|
|||||||
|
|
||||||
void Popup(bool just_edit = false);
|
void Popup(bool just_edit = false);
|
||||||
|
|
||||||
|
void set_editing_filament_id(std::string id) { m_editing_filament_id = id; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
std::string m_editing_filament_id;
|
||||||
ParamsPanel * m_panel;
|
ParamsPanel * m_panel;
|
||||||
wxWindowDisabler *m_winDisabler = nullptr;
|
wxWindowDisabler *m_winDisabler = nullptr;
|
||||||
};
|
};
|
||||||
|
@ -7633,12 +7633,18 @@ void Plater::priv::on_create_filament(SimpleEvent &)
|
|||||||
|
|
||||||
void Plater::priv::on_modify_filament(SimpleEvent &evt)
|
void Plater::priv::on_modify_filament(SimpleEvent &evt)
|
||||||
{
|
{
|
||||||
FilamentInfomation * filament_info = static_cast<FilamentInfomation *>(evt.GetEventObject());
|
FilamentInfomation *filament_info = static_cast<FilamentInfomation *>(evt.GetEventObject());
|
||||||
EditFilamentPresetDialog dlg(wxGetApp().mainframe, filament_info);
|
int res;
|
||||||
int res = dlg.ShowModal();
|
{
|
||||||
|
EditFilamentPresetDialog dlg(wxGetApp().mainframe, filament_info);
|
||||||
|
res = dlg.ShowModal();
|
||||||
|
}
|
||||||
wxGetApp().mainframe->update_side_preset_ui();
|
wxGetApp().mainframe->update_side_preset_ui();
|
||||||
update_ui_from_settings();
|
update_ui_from_settings();
|
||||||
sidebar->update_all_preset_comboboxes();
|
sidebar->update_all_preset_comboboxes();
|
||||||
|
if (wxID_EDIT == res) {
|
||||||
|
wxGetApp().params_dialog()->Popup(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Plater::priv::enter_gizmos_stack()
|
void Plater::priv::enter_gizmos_stack()
|
||||||
|
@ -367,11 +367,8 @@ void GuideFrame::OnScriptMessage(wxWebViewEvent &evt)
|
|||||||
this->EndModal(wxID_OK);
|
this->EndModal(wxID_OK);
|
||||||
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_CREATE_FILAMENT));
|
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_CREATE_FILAMENT));
|
||||||
} else if (strCmd == "modify_custom_filament") {
|
} else if (strCmd == "modify_custom_filament") {
|
||||||
this->EndModal(wxID_OK);
|
m_editing_filament_id = j["id"];
|
||||||
FilamentInfomation *filament_info = new FilamentInfomation();
|
this->EndModal(wxID_EDIT);
|
||||||
filament_info->filament_id = j["id"];
|
|
||||||
//filament_info->filament_name = j["name"];
|
|
||||||
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_MODIFY_FILAMENT, filament_info));
|
|
||||||
}
|
}
|
||||||
else if (strCmd == "save_userguide_models")
|
else if (strCmd == "save_userguide_models")
|
||||||
{
|
{
|
||||||
@ -917,6 +914,12 @@ bool GuideFrame::run()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
} else if (result == wxID_EDIT) {
|
||||||
|
this->Close();
|
||||||
|
FilamentInfomation *filament_info = new FilamentInfomation();
|
||||||
|
filament_info->filament_id = m_editing_filament_id;
|
||||||
|
wxQueueEvent(wxGetApp().plater(), new SimpleEvent(EVT_MODIFY_FILAMENT, filament_info));
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
@ -124,6 +124,7 @@ private:
|
|||||||
wxString m_response_js;
|
wxString m_response_js;
|
||||||
|
|
||||||
wxString m_bbl_user_agent;
|
wxString m_bbl_user_agent;
|
||||||
|
std::string m_editing_filament_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
}} // namespace Slic3r::GUI
|
}} // namespace Slic3r::GUI
|
||||||
|
Loading…
x
Reference in New Issue
Block a user