mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
NEW: remember use options when printing
JIRA: STUDIO-2396 Change-Id: I21e6f91e3da53adf8dc28d9be223e03a4a275fca Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
parent
55f3e51bf4
commit
65db26a27d
2 changed files with 49 additions and 5 deletions
|
@ -1420,7 +1420,28 @@ wxWindow *SelectMachineDialog::create_item_checkbox(wxString title, wxWindow *pa
|
|||
checkbox->SetToolTip(tooltip);
|
||||
text->SetToolTip(tooltip);
|
||||
|
||||
text->Bind(wxEVT_LEFT_DOWN, [this, check](wxMouseEvent &) { check->SetValue(check->GetValue() ? false : true); });
|
||||
|
||||
|
||||
check->Bind(wxEVT_LEFT_DOWN, [this, check, param](wxMouseEvent &e) {
|
||||
AppConfig* config = wxGetApp().app_config;
|
||||
if (config) {
|
||||
if (check->GetValue())
|
||||
config->set_str("print", param, "0");
|
||||
else
|
||||
config->set_str("print", param, "1");
|
||||
}
|
||||
e.Skip();
|
||||
});
|
||||
text->Bind(wxEVT_LEFT_DOWN, [this, check, param](wxMouseEvent &) {
|
||||
check->SetValue(check->GetValue() ? false : true);
|
||||
AppConfig* config = wxGetApp().app_config;
|
||||
if (config) {
|
||||
if (check->GetValue())
|
||||
config->set_str("print", param, "1");
|
||||
else
|
||||
config->set_str("print", param, "0");
|
||||
}
|
||||
});
|
||||
m_checkbox_list[param] = check;
|
||||
return checkbox;
|
||||
}
|
||||
|
@ -2958,10 +2979,23 @@ void SelectMachineDialog::set_default()
|
|||
select_bed->Show();
|
||||
select_flow->Show();
|
||||
|
||||
// checkbox default values
|
||||
m_checkbox_list["bed_leveling"]->SetValue(true);
|
||||
m_checkbox_list["flow_cali"]->SetValue(true);
|
||||
m_checkbox_list["timelapse"]->SetValue(true);
|
||||
// load checkbox values from app config
|
||||
AppConfig* config = wxGetApp().app_config;
|
||||
if (config && config->get("print", "bed_leveling") == "0") {
|
||||
m_checkbox_list["bed_leveling"]->SetValue(false);
|
||||
} else {
|
||||
m_checkbox_list["bed_leveling"]->SetValue(true);
|
||||
}
|
||||
if (config && config->get("print", "flow_cali") == "0") {
|
||||
m_checkbox_list["flow_cali"]->SetValue(false);
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->SetValue(true);
|
||||
}
|
||||
if (config && config->get("print", "timelapse") == "0") {
|
||||
m_checkbox_list["timelapse"]->SetValue(false);
|
||||
} else {
|
||||
m_checkbox_list["timelapse"]->SetValue(true);
|
||||
}
|
||||
ams_check->SetValue(true);
|
||||
|
||||
// thumbmail
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue