mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 08:47:52 -06:00
Imperial units selection is added to the ConfigWizard
This commit is contained in:
parent
0a7e2aa8da
commit
1713142670
3 changed files with 14 additions and 0 deletions
|
@ -98,6 +98,9 @@ void AppConfig::set_defaults()
|
||||||
set("use_environment_map", "0");
|
set("use_environment_map", "0");
|
||||||
#endif // ENABLE_ENVIRONMENT_MAP
|
#endif // ENABLE_ENVIRONMENT_MAP
|
||||||
|
|
||||||
|
if (get("use_inches").empty())
|
||||||
|
set("use_inches", "0");
|
||||||
|
|
||||||
// Remove legacy window positions/sizes
|
// Remove legacy window positions/sizes
|
||||||
erase("", "main_frame_maximized");
|
erase("", "main_frame_maximized");
|
||||||
erase("", "main_frame_pos");
|
erase("", "main_frame_pos");
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "GUI.hpp"
|
#include "GUI.hpp"
|
||||||
#include "GUI_App.hpp"
|
#include "GUI_App.hpp"
|
||||||
#include "GUI_Utils.hpp"
|
#include "GUI_Utils.hpp"
|
||||||
|
#include "GUI_ObjectManipulation.hpp"
|
||||||
#include "slic3r/Config/Snapshot.hpp"
|
#include "slic3r/Config/Snapshot.hpp"
|
||||||
#include "slic3r/Utils/PresetUpdater.hpp"
|
#include "slic3r/Utils/PresetUpdater.hpp"
|
||||||
|
|
||||||
|
@ -840,6 +841,10 @@ PageMode::PageMode(ConfigWizard *parent)
|
||||||
append(radio_simple);
|
append(radio_simple);
|
||||||
append(radio_advanced);
|
append(radio_advanced);
|
||||||
append(radio_expert);
|
append(radio_expert);
|
||||||
|
|
||||||
|
append_text("\n" + _L("The size of the object can be specified in inches"));
|
||||||
|
check_inch = new wxCheckBox(this, wxID_ANY, _L("Use inches"));
|
||||||
|
append(check_inch);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageMode::on_activate()
|
void PageMode::on_activate()
|
||||||
|
@ -850,6 +855,8 @@ void PageMode::on_activate()
|
||||||
if (mode == "advanced") { radio_advanced->SetValue(true); }
|
if (mode == "advanced") { radio_advanced->SetValue(true); }
|
||||||
else if (mode == "expert") { radio_expert->SetValue(true); }
|
else if (mode == "expert") { radio_expert->SetValue(true); }
|
||||||
else { radio_simple->SetValue(true); }
|
else { radio_simple->SetValue(true); }
|
||||||
|
|
||||||
|
check_inch->SetValue(wxGetApp().app_config->get("use_inches") == "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
void PageMode::serialize_mode(AppConfig *app_config) const
|
void PageMode::serialize_mode(AppConfig *app_config) const
|
||||||
|
@ -866,6 +873,7 @@ void PageMode::serialize_mode(AppConfig *app_config) const
|
||||||
return;
|
return;
|
||||||
|
|
||||||
app_config->set("view_mode", mode);
|
app_config->set("view_mode", mode);
|
||||||
|
app_config->set("use_inches", check_inch->GetValue() ? "1" : "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
PageVendors::PageVendors(ConfigWizard *parent)
|
PageVendors::PageVendors(ConfigWizard *parent)
|
||||||
|
@ -2179,6 +2187,7 @@ bool ConfigWizard::run(RunReason reason, StartPage start_page)
|
||||||
p->apply_config(app.app_config, app.preset_bundle, app.preset_updater);
|
p->apply_config(app.app_config, app.preset_bundle, app.preset_updater);
|
||||||
app.app_config->set_legacy_datadir(false);
|
app.app_config->set_legacy_datadir(false);
|
||||||
app.update_mode();
|
app.update_mode();
|
||||||
|
app.obj_manipul()->update_ui_from_settings();
|
||||||
BOOST_LOG_TRIVIAL(info) << "ConfigWizard applied";
|
BOOST_LOG_TRIVIAL(info) << "ConfigWizard applied";
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -316,6 +316,8 @@ struct PageMode: ConfigWizardPage
|
||||||
wxRadioButton *radio_advanced;
|
wxRadioButton *radio_advanced;
|
||||||
wxRadioButton *radio_expert;
|
wxRadioButton *radio_expert;
|
||||||
|
|
||||||
|
wxCheckBox *check_inch;
|
||||||
|
|
||||||
PageMode(ConfigWizard *parent);
|
PageMode(ConfigWizard *parent);
|
||||||
|
|
||||||
void serialize_mode(AppConfig *app_config) const;
|
void serialize_mode(AppConfig *app_config) const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue