OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::PreferencesDialog Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Preferences.hpp>

Inheritance diagram for Slic3r::GUI::PreferencesDialog:
Collaboration diagram for Slic3r::GUI::PreferencesDialog:

Public Member Functions

bool seq_top_layer_only_changed () const
bool recreate_GUI () const
const std::string & pending_language () const
void on_dpi_changed (const wxRect &suggested_rect) override
 PreferencesDialog (wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=wxT(""), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxSYSTEM_MENU|wxCAPTION|wxCLOSE_BOX)
 ~PreferencesDialog ()
void select_tab (PreferencesTab tab, const std::string &option={})
void create ()
wxBoxSizer * create_item_title (wxString title)
wxBoxSizer * create_item_label (wxString label, const wxString tooltip="", const wxString wiki_url="")
wxBoxSizer * create_item_combobox (wxString title, wxString tooltip, std::string param, std::vector< wxString > vlist, std::function< void(wxString)> onchange={}, const wxString wiki_url="")
wxBoxSizer * create_item_combobox (wxString title, wxString tooltip, std::string param, std::vector< wxString > vlist, std::vector< std::string > config_name_index, const wxString wiki_url="")
wxBoxSizer * create_item_region_combobox (wxString title, wxString tooltip)
wxBoxSizer * create_item_language_combobox (wxString title, wxString tooltip)
wxBoxSizer * create_item_loglevel_combobox (wxString title, wxString tooltip, std::vector< wxString > vlist)
wxBoxSizer * create_item_checkbox (wxString title, wxString tooltip, std::string param, const wxString secondary_title="", const wxString wiki_url="")
wxBoxSizer * create_item_darkmode (wxString title, wxString tooltip, std::string param)
void set_dark_mode ()
wxBoxSizer * create_item_button (wxString title, wxString title2, wxString tooltip, wxString tooltip2, std::function< void()> onclick, const wxString wiki_url="")
wxBoxSizer * create_item_downloads (wxString title, wxString tooltip)
wxBoxSizer * create_item_input (wxString title, wxString title2, wxString tooltip, std::string param, std::function< void(wxString)> onchange={}, const wxString wiki_url="")
wxBoxSizer * create_item_spinctrl (wxString title, wxString title2, wxString side_label, wxString tooltip, std::string param, int min, int max, std::function< void(int)> onchange=nullptr, const wxString wiki_url="")
wxBoxSizer * create_camera_orbit_mult_input (wxString title, wxString tooltip)
wxBoxSizer * create_item_decimal_input (wxString title, wxString title2, wxString tooltip, std::string param, double min, double max, int decimals, const wxString wiki_url="")
wxBoxSizer * create_item_backup (wxString title, wxString tooltip)
wxBoxSizer * create_item_auto_reslice (wxString title, wxString checkbox_tooltip, wxString delay_tooltip)
wxBoxSizer * create_item_bambu_cloud (wxString title, wxString tooltip)
wxBoxSizer * create_item_network_plugin_version (wxString title, wxString tooltip)
void create_items ()
void create_sync_page ()
wxBoxSizer * create_debug_page ()
void UpdateSidebarLayout ()
void create_select_domain_widget ()
void Split (const std::string &src, const std::string &separator, std::vector< wxString > &dest)
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Public Attributes

wxString m_backup_interval_time
wxTimer m_filament_height_timer
::CheckBox * m_developer_mode_ckeckbox = {nullptr}
::CheckBox * m_internal_developer_mode_ckeckbox = {nullptr}
::CheckBox * m_dark_mode_ckeckbox = {nullptr}
::CheckBox * m_sync_user_preset_checkbox = {nullptr}
::CheckBox * m_bambu_cloud_checkbox = {nullptr}
::CheckBox * m_skip_identical_frames_checkbox = {nullptr}
::TextInput * m_backup_interval_textinput = {nullptr}
::SpinInput * m_dim_previous_layers_brightness_input = {nullptr}
::ComboBox * m_network_version_combo = {nullptr}
std::vector< NetworkLibraryVersionInfo > m_available_versions
wxString m_developer_mode_def
wxString m_internal_developer_mode_def
wxString m_backup_interval_def
wxString m_iot_environment_def
std::vector< wxFlexGridSizer * > f_sizers
int m_current_language_selected = {0}

Protected Member Functions

virtual void on_sys_color_changed ()

Protected Attributes

wxBoxSizer * m_sizer_body
wxScrolledWindow * m_parent
TabCtrl * m_pref_tabs
std::map< PreferencesTab, int > m_tab_index
bool m_seq_top_layer_only_changed {false}
bool m_recreate_GUI {false}
std::string m_pending_language

Private Member Functions

std::tuple< wxBoxSizer *, ComboBox * > create_item_combobox_base (wxString title, wxString tooltip, std::string param, std::vector< wxString > vlist, unsigned int current_index, const wxString wiki_url="")
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

AppConfig * app_config
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description

Constructor & Destructor Documentation

◆ PreferencesDialog()

Slic3r::GUI::PreferencesDialog::PreferencesDialog ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxString & title = wxT(""),
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxSYSTEM_MENU | wxCAPTION | wxCLOSE_BOX )
1526 : DPIDialog(parent, id, _L("Preferences"), pos, size, style)
1527{
1528 SetBackgroundColour(*wxWHITE);
1529 SetMinSize(DESIGN_WINDOW_SIZE);
1530 create();
1531 wxGetApp().UpdateDlgDarkUI(this);
1532}
#define DESIGN_WINDOW_SIZE
Definition ExportPresetBundleDialog.hpp:30
#define _L(s)
Definition OBJ.cpp:34
#define style
Definition WipeTowerDialog.cpp:101
void create()
Definition Preferences.cpp:1534

References _L, create(), DESIGN_WINDOW_SIZE, and style.

Here is the call graph for this function:

◆ ~PreferencesDialog()

Slic3r::GUI::PreferencesDialog::~PreferencesDialog ( )
1584{
1585}

Member Function Documentation

◆ create()

void Slic3r::GUI::PreferencesDialog::create ( )
1535{
1537
1538 m_parent = new MyscrolledWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
1539 m_parent->SetScrollRate(0, FromDIP(20));
1540 m_parent->SetBackgroundColour(*wxWHITE);
1541
1542 m_sizer_body = new wxBoxSizer(wxVERTICAL);
1543
1544 m_pref_tabs = new TabCtrl(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_NONE | wxWANTS_CHARS | wxTR_FULL_ROW_HIGHLIGHT);
1545 m_pref_tabs->Bind(wxEVT_RIGHT_DOWN, [](auto &e) {}); // disable right select
1546 m_pref_tabs->SetFont(Label::Body_14);
1547
1548 create_items();
1549
1550 m_pref_tabs->Bind(wxEVT_TAB_SEL_CHANGED, [this](wxCommandEvent& e) {
1551 Freeze();
1552 #ifdef __linux__
1553 m_pref_tabs->SetFocus();
1554 #endif
1555 int selection = e.GetSelection();
1556 for (size_t i = 0; i < m_pref_tabs->GetCount(); ++i){
1557 m_pref_tabs->SetItemBold(i, i == selection);
1558 f_sizers[i]->Show(i == selection);
1559 }
1560 Layout();
1561 Thaw();
1562 });
1563
1564 auto item_color = StateColor(
1565 std::make_pair(wxColour("#6B6B6C"), (int) StateColor::NotChecked),
1566 std::make_pair(wxColour("#363636"), (int) StateColor::Normal)
1567 );
1568
1569 for (size_t i = 0; i < m_pref_tabs->GetCount(); ++i)
1570 m_pref_tabs->SetItemTextColour(i, item_color);
1571
1572 m_pref_tabs->SelectItem(0);
1573
1574 m_sizer_body->Add(m_pref_tabs, 0, wxEXPAND | wxBOTTOM | wxTOP, FromDIP(5));
1575 m_sizer_body->Add(m_parent, 1, wxEXPAND);
1576
1577 SetSizer(m_sizer_body);
1578 Layout();
1579 Fit();
1580 CenterOnParent();
1581}
static wxFont Body_14
Definition Label.hpp:53
wxScrolledWindow * m_parent
Definition Preferences.hpp:49
TabCtrl * m_pref_tabs
Definition Preferences.hpp:50
AppConfig * app_config
Definition Preferences.hpp:45
wxBoxSizer * m_sizer_body
Definition Preferences.hpp:48
void create_items()
Definition Preferences.cpp:1663
std::vector< wxFlexGridSizer * > f_sizers
Definition Preferences.hpp:98
@ NotChecked
Definition StateColor.hpp:23
@ Normal
Definition StateColor.hpp:16
AppConfig * get_app_config()
Definition GUI.cpp:539

References app_config, Label::Body_14, create_items(), f_sizers, Slic3r::GUI::get_app_config(), m_parent, m_pref_tabs, m_sizer_body, StateColor::Normal, and StateColor::NotChecked.

Referenced by PreferencesDialog().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_camera_orbit_mult_input()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_camera_orbit_mult_input ( wxString title,
wxString tooltip )
788{
789 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
790
791 wxBoxSizer *m_sizer = create_item_label(title, tip);
792
793 auto param = "camera_orbit_mult";
794
795 auto input = new ::TextInput(m_parent, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, DESIGN_INPUT_SIZE, wxTE_PROCESS_ENTER);
796 StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
797 input->SetBackgroundColor(input_bg);
798 input->GetTextCtrl()->SetValue(app_config->get(param));
799 wxTextValidator validator(wxFILTER_NUMERIC);
800 input->SetToolTip(tip);
801 input->GetTextCtrl()->SetValidator(validator);
802
803 m_sizer->Add(input, 0, wxALIGN_CENTER_VERTICAL);
804
805 const double min = 0.05;
806 const double max = 2.0;
807
808 input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, param, input, min, max](wxCommandEvent &e) {
809 auto value = input->GetTextCtrl()->GetValue();
810 double conv = 1.0;
811 if (value.ToCDouble(&conv)) {
812 conv = conv < min ? min : conv > max ? max : conv;
813 auto strval = std::string(wxString::FromCDouble(conv, 2).mb_str());
814 input->GetTextCtrl()->SetValue(strval);
815 app_config->set(param, strval);
816 app_config->save();
817 }
818 e.Skip();
819 });
820
821 input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [this, param, input, min, max](wxFocusEvent &e) {
822 auto value = input->GetTextCtrl()->GetValue();
823 double conv = 1.0;
824 if (value.ToCDouble(&conv)) {
825 conv = conv < min ? min : conv > max ? max : conv;
826 auto strval = std::string(wxString::FromCDouble(conv, 2).mb_str());
827 input->GetTextCtrl()->SetValue(strval);
828 app_config->set(param, strval);
829 }
830 e.Skip();
831 });
832
833 return m_sizer;
834}
#define DESIGN_INPUT_SIZE
Definition ExportPresetBundleDialog.hpp:34
wxBoxSizer * create_item_label(wxString label, const wxString tooltip="", const wxString wiki_url="")
Definition Preferences.cpp:310
@ Disabled
Definition StateColor.hpp:22
@ Enabled
Definition StateColor.hpp:17

References app_config, create_item_label(), DESIGN_INPUT_SIZE, StateColor::Disabled, StateColor::Enabled, and m_parent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_debug_page()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_debug_page ( )
2419{
2420 m_internal_developer_mode_def = app_config->get("internal_developer_mode");
2421 m_backup_interval_def = app_config->get("backup_interval");
2422 m_iot_environment_def = app_config->get("iot_environment");
2423
2424 wxBoxSizer *bSizer = new wxBoxSizer(wxVERTICAL);
2425
2426 auto enable_ssl_for_mqtt = create_item_checkbox(_L("Enable SSL(MQTT)"), _L("Enable SSL(MQTT)"), "enable_ssl_for_mqtt");
2427 auto enable_ssl_for_ftp = create_item_checkbox(_L("Enable SSL(FTP)"), _L("Enable SSL(MQTT)"), "enable_ssl_for_ftp");
2428 auto item_internal_developer = create_item_checkbox(_L("Internal developer mode"), _L("Internal developer mode"), "internal_developer_mode");
2429
2430 auto title_host = create_item_title(_L("Host Setting"));
2431 // ORCA RadioGroup
2432 auto radio_group = new RadioGroup(m_parent, {
2433 _L("DEV host: api-dev.bambu-lab.com/v1"), // 0
2434 _L("QA host: api-qa.bambu-lab.com/v1"), // 1
2435 _L("PRE host: api-pre.bambu-lab.com/v1"), // 2
2436 _L("Product host") // 3
2437 }, wxVERTICAL);
2438
2439 radio_group->SetRadioTooltip(0, "dev_host");
2440 radio_group->SetRadioTooltip(1, "qa_host");
2441 radio_group->SetRadioTooltip(2, "pre_host");
2442 radio_group->SetRadioTooltip(3, "product_host");
2443
2445 radio_group->SetSelection(0);
2446 } else if (m_iot_environment_def == ENV_QAT_HOST) {
2447 radio_group->SetSelection(1);
2448 } else if (m_iot_environment_def == ENV_PRE_HOST) {
2449 radio_group->SetSelection(2);
2451 radio_group->SetSelection(3);
2452 }
2453
2454 Button* debug_button = new Button(m_parent, _L("Debug save button"));
2456
2457 debug_button->Bind(wxEVT_LEFT_DOWN, [this, radio_group](wxMouseEvent &e) {
2458 // success message box
2459 MessageDialog dialog(this, _L("Save debug settings"), _L("Debug settings have been saved successfully!"), wxNO_DEFAULT | wxYES_NO | wxICON_INFORMATION);
2460 dialog.SetSize(400,-1);
2461 switch (dialog.ShowModal()) {
2462 case wxID_NO: {
2463 //if (m_developer_mode_def != app_config->get("developer_mode")) {
2464 // app_config->set_bool("developer_mode", m_developer_mode_def == "true" ? true : false);
2465 // m_developer_mode_ckeckbox->SetValue(m_developer_mode_def == "true" ? true : false);
2466 //}
2467 //if (m_internal_developer_mode_def != app_config->get("internal_developer_mode")) {
2468 // app_config->set_bool("internal_developer_mode", m_internal_developer_mode_def == "true" ? true : false);
2469 // m_internal_developer_mode_ckeckbox->SetValue(m_internal_developer_mode_def == "true" ? true : false);
2470 //}
2471
2473
2475 radio_group->SetSelection(0);
2476 } else if (m_iot_environment_def == ENV_QAT_HOST) {
2477 radio_group->SetSelection(1);
2478 } else if (m_iot_environment_def == ENV_PRE_HOST) {
2479 radio_group->SetSelection(2);
2481 radio_group->SetSelection(3);
2482 }
2483
2484 break;
2485 }
2486
2487 case wxID_YES: {
2488 // bbs domain changed
2489 auto param = radio_group->GetSelection();
2490
2491 std::map<wxString, wxString> iot_environment_map;
2492 iot_environment_map["dev_host"] = ENV_DEV_HOST;
2493 iot_environment_map["qa_host"] = ENV_QAT_HOST;
2494 iot_environment_map["pre_host"] = ENV_PRE_HOST;
2495 iot_environment_map["product_host"] = ENV_PRODUCT_HOST;
2496
2497 //if (iot_environment_map[param] != m_iot_environment_def) {
2498 if (true) {
2499 NetworkAgent* agent = wxGetApp().getAgent();
2500 if (param == 0) { // "dev_host"
2501 app_config->set("iot_environment", ENV_DEV_HOST);
2502 }
2503 else if (param == 1) { // "qa_host"
2504 app_config->set("iot_environment", ENV_QAT_HOST);
2505 }
2506 else if (param == 2) { // "pre_host"
2507 app_config->set("iot_environment", ENV_PRE_HOST);
2508 }
2509 else if (param == 3) { // "product_host"
2510 app_config->set("iot_environment", ENV_PRODUCT_HOST);
2511 }
2512
2513 AppConfig* config = GUI::wxGetApp().app_config;
2514 std::string country_code = config->get_country_code();
2515 if (agent) {
2516 wxGetApp().request_user_logout(ORCA_CLOUD_PROVIDER, /*user_initiated=*/true);
2517 agent->set_country_code(country_code);
2518 }
2519 ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"), ConfirmBeforeSendDialog::VisibleButtons::ONLY_CONFIRM); // ORCA VisibleButtons instead ButtonStyle
2520 confirm_dlg.update_text(_L("Cloud environment switched; please login again!"));
2521 confirm_dlg.on_show();
2522 }
2523
2524 // bbs backup
2525 //app_config->set("backup_interval", std::string(m_backup_interval_time.mb_str()));
2526 app_config->save();
2527 Slic3r::set_backup_interval(boost::lexical_cast<long>(app_config->get("backup_interval")));
2528
2529 this->Close();
2530 break;
2531 }
2532 }
2533 });
2534
2535 bSizer->Add(enable_ssl_for_mqtt, 0, wxTOP, FromDIP(3));
2536 bSizer->Add(enable_ssl_for_ftp, 0, wxTOP, FromDIP(3));
2537 bSizer->Add(item_internal_developer, 0, wxTOP, FromDIP(3));
2538 bSizer->Add(title_host, 0, wxEXPAND | wxTOP, FromDIP(10));
2539 bSizer->Add(radio_group, 0, wxEXPAND | wxLEFT, FromDIP(DESIGN_LEFT_MARGIN));
2540 bSizer->Add(debug_button, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP, FromDIP(15));
2541
2542 return bSizer;
2543}
#define ENV_PRODUCT_HOST
Definition AppConfig.hpp:20
#define ENV_PRE_HOST
Definition AppConfig.hpp:19
#define ENV_DEV_HOST
Definition AppConfig.hpp:17
#define ENV_QAT_HOST
Definition AppConfig.hpp:18
@ Confirm
Definition Button.hpp:25
@ Window
Definition Button.hpp:32
#define DESIGN_LEFT_MARGIN
Definition ExportPresetBundleDialog.hpp:35
void SetStyle(const ButtonStyle style, const ButtonType type)
Definition Button.cpp:200
@ ONLY_CONFIRM
Definition ReleaseNote.hpp:257
::TextInput * m_backup_interval_textinput
Definition Preferences.hpp:88
wxBoxSizer * create_item_title(wxString title)
Definition Preferences.cpp:296
wxBoxSizer * create_item_checkbox(wxString title, wxString tooltip, std::string param, const wxString secondary_title="", const wxString wiki_url="")
Definition Preferences.cpp:1048
wxString m_backup_interval_def
Definition Preferences.hpp:95
wxString m_backup_interval_time
Definition Preferences.hpp:76
wxString m_iot_environment_def
Definition Preferences.hpp:96
wxString m_internal_developer_mode_def
Definition Preferences.hpp:94
wxMouseEvent
Definition CameraPopup.cpp:47
void set_backup_interval(long interval)
Definition bbs_3mf.cpp:9779
static const std::string ORCA_CLOUD_PROVIDER("orca")

References _L, app_config, Confirm, create_item_checkbox(), create_item_title(), DESIGN_LEFT_MARGIN, ENV_DEV_HOST, ENV_PRE_HOST, ENV_PRODUCT_HOST, ENV_QAT_HOST, Slic3r::AppConfig::get_country_code(), m_backup_interval_def, m_backup_interval_textinput, m_backup_interval_time, m_internal_developer_mode_def, m_iot_environment_def, m_parent, Slic3r::GUI::ConfirmBeforeSendDialog::on_show(), Slic3r::GUI::ConfirmBeforeSendDialog::ONLY_CONFIRM, Slic3r::ORCA_CLOUD_PROVIDER(), Slic3r::set_backup_interval(), Slic3r::NetworkAgent::set_country_code(), RadioGroup::SetRadioTooltip(), Button::SetStyle(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::ConfirmBeforeSendDialog::update_text(), Window, and Slic3r::GUI::wxMouseEvent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_auto_reslice()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_auto_reslice ( wxString title,
wxString checkbox_tooltip,
wxString delay_tooltip )
943{
944 wxBoxSizer *m_sizer = create_item_label(title, checkbox_tooltip);
945
946 auto checkbox = new ::CheckBox(m_parent);
947 checkbox->SetValue(app_config->get_bool("auto_slice_after_change"));
948 checkbox->SetToolTip(checkbox_tooltip);
949
950 wxString delay_value = app_config->get("auto_slice_change_delay_seconds");
951 if (delay_value.empty())
952 delay_value = "0";
953
954 auto input = new ::TextInput(m_parent, wxEmptyString, _L("sec"), wxEmptyString, wxDefaultPosition, wxSize(FromDIP(97), -1), wxTE_PROCESS_ENTER);
955 StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
956 input->SetBackgroundColor(input_bg);
957 input->GetTextCtrl()->SetValue(delay_value);
958 wxTextValidator validator(wxFILTER_DIGITS);
959 input->SetToolTip(delay_tooltip);
960 input->GetTextCtrl()->SetValidator(validator);
961
962 m_sizer->Add(checkbox, 0, wxALIGN_CENTER);
963 m_sizer->Add(input , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5));
964
965 auto commit_delay = [this, input]() {
966 wxString value = input->GetTextCtrl()->GetValue();
967 long seconds = 0;
968 if (!value.ToLong(&seconds) || seconds < 0)
969 seconds = 0;
970 wxString sanitized = wxString::Format("%ld", seconds);
971 input->GetTextCtrl()->SetValue(sanitized);
972 app_config->set("auto_slice_change_delay_seconds", std::string(sanitized.mb_str()));
973 app_config->save();
974 };
975
976 input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [commit_delay](wxCommandEvent &e) {
977 commit_delay();
978 e.Skip();
979 });
980
981 input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [commit_delay](wxFocusEvent &e) {
982 commit_delay();
983 e.Skip();
984 });
985
986 checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, input](wxCommandEvent &e) {
987 const bool enabled = checkbox->GetValue();
988 app_config->set_bool("auto_slice_after_change", enabled);
989 app_config->save();
990 input->Enable(enabled);
991 input->Refresh();
992 e.Skip();
993 });
994
995 input->Enable(checkbox->GetValue());
996 input->Refresh();
997
998 return m_sizer;
999}

References _L, app_config, create_item_label(), StateColor::Disabled, StateColor::Enabled, and m_parent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_backup()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_backup ( wxString title,
wxString tooltip )
878{
879 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
880
881 wxBoxSizer *m_sizer = create_item_label(title, tip);
882
883 auto checkbox = new ::CheckBox(m_parent);
884 checkbox->SetValue(app_config->get_bool("backup_switch"));
885 checkbox->SetToolTip(tip);
886
887 checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox](wxCommandEvent &e) {
888 app_config->set_bool("backup_switch", checkbox->GetValue());
889 app_config->save();
890 bool pbool = app_config->get("backup_switch") == "true" ? true : false;
891 std::string backup_interval = "10";
892 app_config->get("backup_interval", backup_interval);
893 Slic3r::set_backup_interval(pbool ? boost::lexical_cast<long>(backup_interval) : 0);
894 if (m_backup_interval_textinput != nullptr) { m_backup_interval_textinput->Enable(pbool); }
895 e.Skip();
896 });
897
898 m_backup_interval_time = app_config->get("backup_interval");
899
900 auto input = new ::TextInput(m_parent, wxEmptyString, _L("sec"), "loop", wxDefaultPosition, wxSize(FromDIP(97), -1), wxTE_PROCESS_ENTER);
901 StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
902 input->SetBackgroundColor(input_bg);
903 input->GetTextCtrl()->SetValue(m_backup_interval_time);
904 wxTextValidator validator(wxFILTER_DIGITS);
905 input->SetToolTip(_L("The period of backup in seconds."));
906 input->GetTextCtrl()->SetValidator(validator);
907
908 m_sizer->Add(checkbox, 0, wxALIGN_CENTER);
909 m_sizer->Add(input , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5));
910
911 input->GetTextCtrl()->Bind(wxEVT_COMMAND_TEXT_UPDATED, [this, input](wxCommandEvent &e) {
912 m_backup_interval_time = input->GetTextCtrl()->GetValue();
913 e.Skip();
914 });
915
916 std::function<void()> backup_interval = [this, input]() {
917 m_backup_interval_time = input->GetTextCtrl()->GetValue();
918 app_config->set("backup_interval", std::string(m_backup_interval_time.mb_str()));
919 app_config->save();
920 long backup_interval = 0;
921 m_backup_interval_time.ToLong(&backup_interval);
922 Slic3r::set_backup_interval(backup_interval);
923 };
924
925 input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [backup_interval](wxCommandEvent &e) {
926 backup_interval();
927 e.Skip();
928 });
929
930 input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [backup_interval](wxFocusEvent &e) {
931 backup_interval();
932 e.Skip();
933 });
934
935 input->Enable(app_config->get("backup_switch") == "true");
936 input->Refresh();
937
939 return m_sizer;
940}

References _L, app_config, create_item_label(), StateColor::Disabled, StateColor::Enabled, m_backup_interval_textinput, m_backup_interval_time, m_parent, and Slic3r::set_backup_interval().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_bambu_cloud()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_bambu_cloud ( wxString title,
wxString tooltip )
1298{
1299 wxBoxSizer *m_sizer = create_item_label(title, tooltip);
1300
1301 auto cb = new ::CheckBox(m_parent);
1303 cb->SetValue(app_config->has_cloud_provider(BBL_CLOUD_PROVIDER));
1304 cb->SetToolTip(tooltip);
1305
1306 cb->Bind(wxEVT_TOGGLEBUTTON, [this, cb](wxCommandEvent &e) {
1307 e.Skip(); // let CheckBox::update() refresh the bitmap
1308 if (cb->GetValue()) {
1309 app_config->add_cloud_provider(BBL_CLOUD_PROVIDER);
1310 } else {
1311 app_config->remove_cloud_provider(BBL_CLOUD_PROVIDER);
1312 }
1313 app_config->save();
1314
1315 // Update homepage visibility immediately
1316 if (WebViewPanel* home = WebViewPanel::if_built())
1317 home->SendCloudProvidersInfo();
1318 });
1319
1320 m_sizer->Add(cb, 0, wxALIGN_CENTER);
1321
1322 return m_sizer;
1323};
static WebViewPanel * if_built()
Definition Lazy.hpp:183
::CheckBox * m_bambu_cloud_checkbox
Definition Preferences.hpp:86
static const std::string BBL_CLOUD_PROVIDER("bbl")

References app_config, Slic3r::BBL_CLOUD_PROVIDER(), create_item_label(), Slic3r::GUI::LazyInstance< WebViewPanel >::if_built(), m_bambu_cloud_checkbox, and m_parent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_button()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_button ( wxString title,
wxString title2,
wxString tooltip,
wxString tooltip2,
std::function< void()> onclick,
const wxString wiki_url = "" )
1245{
1246 auto tip = tooltip.IsEmpty() ? tooltip2 : tooltip; // use button tooltip if label tooltip empty
1247
1248 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
1249
1250 auto m_button_download = new Button(m_parent, title2);
1251 m_button_download->SetStyle(title2 == _L("Clear") ? ButtonStyle::Alert : ButtonStyle::Regular, ButtonType::Parameter);
1252 m_button_download->SetToolTip(tooltip2.IsEmpty() ? tooltip : tooltip2); // use label tooltip if button tooltip empty
1253
1254 m_button_download->Bind(wxEVT_BUTTON, [onclick](auto &e) { onclick(); });
1255
1256 m_sizer->Add(m_button_download, 0, wxALIGN_CENTER_VERTICAL);
1257
1258 return m_sizer;
1259}
@ Alert
Definition Button.hpp:26
@ Regular
Definition Button.hpp:24
@ Parameter
Definition Button.hpp:34

References _L, Alert, create_item_label(), m_parent, Parameter, and Regular.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_checkbox()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_checkbox ( wxString title,
wxString tooltip,
std::string param,
const wxString secondary_title = "",
const wxString wiki_url = "" )
1049{
1050 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
1051
1052 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
1053
1054 auto checkbox = new ::CheckBox(m_parent);
1055 checkbox->SetValue(app_config->get_bool(param));
1056 checkbox->SetToolTip(tip);
1057
1058 if (param == "sync_user_preset") { m_sync_user_preset_checkbox = checkbox; }
1060
1061 m_sizer->Add(checkbox, 0, wxALIGN_CENTER);
1062
1063 if(!secondary_title.IsEmpty()){
1064 auto sec_title = new wxStaticText(m_parent, wxID_ANY, secondary_title);
1065 sec_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
1066 sec_title->SetFont(::Label::Body_14);
1067 sec_title->Wrap(-1);
1068 sec_title->SetToolTip(tip);
1069 m_sizer->Add(sec_title, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
1070 }
1071
1073 checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent &e) {
1074 app_config->set_bool(param, checkbox->GetValue());
1075 app_config->save();
1076
1077 if (param == "sync_user_preset") {
1078 bool sync = app_config->get("sync_user_preset") == "true" ? true : false;
1079 if (sync) {
1080 wxGetApp().start_sync_user_preset();
1081 } else {
1082 wxGetApp().stop_sync_user_preset();
1083 }
1084 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " sync_user_preset: " << (sync ? "true" : "false");
1085 }
1086 else if (param == SETTING_OPENGL_SCENE_CACHE) {
1087 if (m_skip_identical_frames_checkbox) m_skip_identical_frames_checkbox->Enable(checkbox->GetValue());
1088 }
1089 else if (param == "stealth_mode") {
1090 bool enabled = app_config->get_stealth_mode();
1091 if (enabled) wxGetApp().on_stealth_mode_enter();
1093 if (m_bambu_cloud_checkbox) m_bambu_cloud_checkbox->Enable(!enabled);
1094 }
1095 else if (param == "hide_login_side_panel") {
1096 if (WebViewPanel* home = WebViewPanel::if_built()) {
1097 home->SendCloudProvidersInfo();
1098 }
1099 }
1100 // ORCA: apply the filament translucency change immediately to the currently loaded preview
1101 else if (param == "preview_translucent_filaments") {
1102 if (Plater* plater = wxGetApp().plater()) {
1103 if (GLCanvas3D* canvas = plater->get_preview_canvas3D()) {
1104 canvas->get_gcode_viewer().set_translucent_filaments(app_config->get_bool(param));
1105 canvas->set_as_dirty();
1106 canvas->request_extra_frame();
1107 }
1108 }
1109 }
1110 // ORCA: apply the preview dimming change immediately to the currently loaded preview
1111 else if (param == "preview_dim_previous_layers") {
1113 m_dim_previous_layers_brightness_input->Enable(app_config->get_bool(param));
1114 if (Plater* plater = wxGetApp().plater()) {
1115 if (GLCanvas3D* canvas = plater->get_preview_canvas3D()) {
1116 canvas->get_gcode_viewer().set_dim_previous_layers(app_config->get_bool(param));
1117 canvas->set_as_dirty();
1118 canvas->request_extra_frame();
1119 }
1120 }
1121 }
1122
1123#ifdef __WXMSW__
1124 if (param == "associate_3mf") {
1125 bool pbool = app_config->get("associate_3mf") == "true" ? true : false;
1126 if (pbool) {
1127 wxGetApp().associate_files(L"3mf");
1128 } else {
1129 wxGetApp().disassociate_files(L"3mf");
1130 }
1131 }
1132
1133 if (param == "associate_drc") {
1134 bool pbool = app_config->get("associate_drc") == "true" ? true : false;
1135 if (pbool) {
1136 wxGetApp().associate_files(L"drc");
1137 } else {
1138 wxGetApp().disassociate_files(L"drc");
1139 }
1140 }
1141
1142 if (param == "associate_stl") {
1143 bool pbool = app_config->get("associate_stl") == "true" ? true : false;
1144 if (pbool) {
1145 wxGetApp().associate_files(L"stl");
1146 } else {
1147 wxGetApp().disassociate_files(L"stl");
1148 }
1149 }
1150
1151 if (param == "associate_step") {
1152 bool pbool = app_config->get("associate_step") == "true" ? true : false;
1153 if (pbool) {
1154 wxGetApp().associate_files(L"step");
1155 } else {
1156 wxGetApp().disassociate_files(L"step");
1157 }
1158 }
1159
1160 if (param == "installed_networking") {
1161 bool pbool = app_config->get_bool("installed_networking");
1162 if (pbool) {
1163 GUI::wxGetApp().CallAfter([] { GUI::wxGetApp().ShowDownNetPluginDlg(); });
1164 }
1165 }
1166
1167#endif // __WXMSW__
1168
1169 if (param == "developer_mode") {
1170 m_developer_mode_def = app_config->get("developer_mode");
1171 Slic3r::GUI::wxGetApp().update_mode();
1172 }
1173
1174 // webview dump_vedio
1175 if (param == "internal_developer_mode") {
1176 m_internal_developer_mode_def = app_config->get("internal_developer_mode");
1177 if (m_internal_developer_mode_def == "true") {
1178 Slic3r::GUI::wxGetApp().update_internal_development();
1179 Slic3r::GUI::wxGetApp().mainframe->show_log_window();
1180 } else {
1181 Slic3r::GUI::wxGetApp().update_internal_development();
1182 }
1183 }
1184
1185 if (param == "show_unsupported_presets") {
1186 wxGetApp().plater()->sidebar().update_presets(Preset::TYPE_FILAMENT);
1187 }
1188
1189 if (param == "use_printer_agents")
1190 {
1191 // Rebuild the Device tab so the native/web-UI choice reflects the new flag
1192 // immediately, instead of only on the next printer-preset change or restart.
1193 if (wxGetApp().plater())
1194 wxGetApp().plater()->sidebar().update_all_preset_comboboxes();
1195 }
1196
1197 if (param == "enable_high_low_temp_mixed_printing") {
1198 if (checkbox->GetValue()) {
1199 const wxString warning_title = _L("Bed Temperature Difference Warning");
1200 const wxString warning_message =
1201 _L("Using filaments with significantly different temperatures may cause:\n"
1202 "• Extruder clogging\n"
1203 "• Nozzle damage\n"
1204 "• Layer adhesion issues\n\n"
1205 "Continue with enabling this feature?");
1206 std::function<void(const wxString&)> link_callback = [](const wxString&) {
1207 const std::string lang_code = wxGetApp().app_config->get("language");
1208 const wxString region = (lang_code.find("zh") != std::string::npos) ? L"zh" : L"en";
1209 const wxString wiki_url = wxString::Format(
1210 L"https://wiki.bambulab.com/%s/filament-acc/filament/h2d-filament-config-limit",
1211 region
1212 );
1213 wxGetApp().open_browser_with_warning_dialog(wiki_url);
1214 };
1215
1216 MessageDialog msg_dialog(
1217 nullptr,
1218 warning_message,
1219 warning_title,
1220 wxICON_WARNING | wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE,
1221 wxEmptyString,
1222 _L("Click Wiki for help."),
1223 link_callback
1224 );
1225
1226 if (msg_dialog.ShowModal() != wxID_YES) {
1227 checkbox->SetValue(false);
1228 app_config->set_bool(param, false);
1229 app_config->save();
1230 }
1231 }
1232 }
1233
1234 e.Skip();
1235 });
1236
1238 if (param == "developer_mode") { m_developer_mode_ckeckbox = checkbox; }
1239 if (param == "internal_developer_mode") { m_internal_developer_mode_ckeckbox = checkbox; }
1240
1241 return m_sizer;
1242}
#define SETTING_OPENGL_SCENE_CACHE
Definition AppConfig.hpp:37
#define SETTING_OPENGL_SKIP_IDENTICAL_FRAMES
Definition AppConfig.hpp:38
#define DESIGN_GRAY900_COLOR
Definition ExportPresetBundleDialog.hpp:27
#define L(s)
Definition ExtrusionEntity.cpp:25
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
GLCanvas3D * get_preview_canvas3D()
Definition Plater.cpp:22087
::CheckBox * m_internal_developer_mode_ckeckbox
Definition Preferences.hpp:83
::CheckBox * m_developer_mode_ckeckbox
Definition Preferences.hpp:82
::SpinInput * m_dim_previous_layers_brightness_input
Definition Preferences.hpp:89
::CheckBox * m_skip_identical_frames_checkbox
Definition Preferences.hpp:87
::CheckBox * m_sync_user_preset_checkbox
Definition Preferences.hpp:85
wxString m_developer_mode_def
Definition Preferences.hpp:93
@ TYPE_FILAMENT
Definition Preset.hpp:248
static Plater * plater()
Definition GUI_Factories.cpp:400
@ Plater
Definition Shortcuts.hpp:21

References _L, app_config, Label::Body_14, create_item_label(), DESIGN_GRAY900_COLOR, Slic3r::GUI::LazyInstance< WebViewPanel >::if_built(), L, m_bambu_cloud_checkbox, m_developer_mode_ckeckbox, m_developer_mode_def, m_dim_previous_layers_brightness_input, m_internal_developer_mode_ckeckbox, m_internal_developer_mode_def, m_parent, m_skip_identical_frames_checkbox, m_sync_user_preset_checkbox, Slic3r::GUI::plater(), SETTING_OPENGL_SCENE_CACHE, SETTING_OPENGL_SKIP_IDENTICAL_FRAMES, Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::Preset::TYPE_FILAMENT, and wxStaticText.

Referenced by create_debug_page(), create_items(), and create_sync_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_combobox() [1/2]

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_combobox ( wxString title,
wxString tooltip,
std::string param,
std::vector< wxString > vlist,
std::function< void(wxString)> onchange = {},
const wxString wiki_url = "" )
353{
354 unsigned int current_index = 0;
355
356 auto current_setting = app_config->get(param);
357 if (!current_setting.empty()) {
358 current_index = atoi(current_setting.c_str());
359 }
360
361 auto [sizer, combobox] = create_item_combobox_base(title, tooltip, param, vlist, current_index, wiki_url);
362
364 combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, param, onchange](wxCommandEvent& e) {
365 app_config->set(param, std::to_string(e.GetSelection()));
366 if (onchange)
367 onchange(std::to_string(e.GetSelection()));
368 e.Skip();
369 });
370
371 return sizer;
372}
std::tuple< wxBoxSizer *, ComboBox * > create_item_combobox_base(wxString title, wxString tooltip, std::string param, std::vector< wxString > vlist, unsigned int current_index, const wxString wiki_url="")
Definition Preferences.cpp:329

References app_config, and create_item_combobox_base().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_combobox() [2/2]

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_combobox ( wxString title,
wxString tooltip,
std::string param,
std::vector< wxString > vlist,
std::vector< std::string > config_name_index,
const wxString wiki_url = "" )
375{
376 assert(vlist.size() == config_name_index.size());
377 unsigned int current_index = 0;
378
379 auto current_setting = app_config->get(param);
380 if (!current_setting.empty()) {
381 auto compare = [current_setting](std::string possible_setting) { return current_setting == possible_setting; };
382 auto iterator = find_if(config_name_index.begin(), config_name_index.end(), compare);
383 if (iterator != config_name_index.end())
384 current_index = static_cast<unsigned int>(iterator - config_name_index.begin());
385 }
386
387 auto [sizer, combobox] = create_item_combobox_base(title, tooltip, param, vlist, current_index);
388
390 combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, param, config_name_index](wxCommandEvent& e) {
391 app_config->set(param, config_name_index[e.GetSelection()]);
392 e.Skip();
393 });
394
395 return sizer;
396}

References app_config, and create_item_combobox_base().

Here is the call graph for this function:

◆ create_item_combobox_base()

std::tuple< wxBoxSizer *, ComboBox * > Slic3r::GUI::PreferencesDialog::create_item_combobox_base ( wxString title,
wxString tooltip,
std::string param,
std::vector< wxString > vlist,
unsigned int current_index,
const wxString wiki_url = "" )
private
330{
331 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
332
333 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
334
335 auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
336 combobox->GetDropDown().SetUseContentWidth(true);
337 combobox->SetToolTip(tip);
338 combobox->SetName(param); // select_tab() finds the row by this name
339
340 std::vector<wxString>::iterator iter;
341 for (iter = vlist.begin(); iter != vlist.end(); iter++) {
342 combobox->Append(*iter);
343 }
344
345 combobox->SetSelection(current_index);
346
347 m_sizer->Add(combobox, 0, wxALIGN_CENTER);
348
349 return {m_sizer, combobox};
350}
#define DESIGN_LARGE_COMBOBOX_SIZE
Definition ExportPresetBundleDialog.hpp:33

References create_item_label(), DESIGN_LARGE_COMBOBOX_SIZE, and m_parent.

Referenced by create_item_combobox(), and create_item_combobox().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_darkmode()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_darkmode ( wxString title,
wxString tooltip,
std::string param )
1002{
1003 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
1004
1005 wxBoxSizer *m_sizer = create_item_label(title, tip);
1006
1007 auto checkbox = new ::CheckBox(m_parent);
1008 checkbox->SetValue((app_config->get(param) == "1") ? true : false);
1009 checkbox->SetToolTip(tip);
1010 m_dark_mode_ckeckbox = checkbox;
1011
1012 m_sizer->Add(checkbox, 0, wxALIGN_CENTER);
1013
1015 checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent& e) {
1016 app_config->set(param, checkbox->GetValue() ? "1" : "0");
1017 app_config->save();
1018 wxGetApp().Update_dark_mode_flag();
1019
1020 //dark mode
1021#ifdef _MSW_DARK_MODE
1022 wxGetApp().force_colors_update();
1023 wxGetApp().update_ui_from_settings();
1024 set_dark_mode();
1025#endif
1026 SimpleEvent evt = SimpleEvent(EVT_GLCANVAS_COLOR_MODE_CHANGED);
1027 wxPostEvent(wxGetApp().plater(), evt);
1028 e.Skip();
1029 });
1030
1031
1032 return m_sizer;
1033}
void set_dark_mode()
Definition Preferences.cpp:1035
::CheckBox * m_dark_mode_ckeckbox
Definition Preferences.hpp:84

References app_config, create_item_label(), m_dark_mode_ckeckbox, m_parent, Slic3r::GUI::plater(), and set_dark_mode().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_decimal_input()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_decimal_input ( wxString title,
wxString title2,
wxString tooltip,
std::string param,
double min,
double max,
int decimals,
const wxString wiki_url = "" )
837{
838 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
839
840 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
841
842 auto input = new ::TextInput(m_parent, wxEmptyString, title2, wxEmptyString, wxDefaultPosition, DESIGN_INPUT_SIZE, wxTE_PROCESS_ENTER);
843 StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
844 input->SetBackgroundColor(input_bg);
845 input->GetTextCtrl()->SetValue(app_config->get(param));
846 wxTextValidator validator(wxFILTER_NUMERIC);
847 input->SetToolTip(tooltip);
848 input->GetTextCtrl()->SetValidator(validator);
849
850 m_sizer->Add(input, 0, wxALIGN_CENTER_VERTICAL);
851
852 auto apply_value = [this, param, input, min, max, decimals]() {
853 auto value = input->GetTextCtrl()->GetValue();
854 double conv = min;
855 if (value.ToCDouble(&conv)) {
856 conv = conv < min ? min : conv > max ? max : conv;
857 auto strval = std::string(wxString::FromCDouble(conv, decimals).mb_str());
858 input->GetTextCtrl()->SetValue(strval);
859 app_config->set(param, strval);
860 }
861 };
862
863 input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [apply_value](wxCommandEvent &e) {
864 apply_value();
865 wxGetApp().app_config->save();
866 e.Skip();
867 });
868
869 input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [apply_value](wxFocusEvent &e) {
870 apply_value();
871 e.Skip();
872 });
873
874 return m_sizer;
875}

References app_config, create_item_label(), DESIGN_INPUT_SIZE, StateColor::Disabled, StateColor::Enabled, and m_parent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_downloads()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_downloads ( wxString title,
wxString tooltip )
1262{
1263 wxString download_path = wxString::FromUTF8(app_config->get("download_path"));
1264
1265 wxBoxSizer *m_sizer = create_item_label(title, tooltip);
1266
1267 auto m_staticTextPath = new wxStaticText(m_parent, wxID_ANY, download_path, wxDefaultPosition, wxSize(FromDIP(120),-1), wxST_ELLIPSIZE_END);
1268 m_staticTextPath->SetForegroundColour(DESIGN_GRAY600_COLOR);
1269 m_staticTextPath->SetFont(::Label::Body_14);
1270 m_staticTextPath->Wrap(-1);
1271 m_staticTextPath->SetToolTip(download_path);
1272
1273 auto m_button_download = new Button(m_parent, _L("Browse") + dots);
1274 m_button_download->SetStyle(ButtonStyle::Regular, ButtonType::Parameter);
1275 m_button_download->SetToolTip(_L("Choose folder for downloaded items"));
1276
1277 m_button_download->Bind(wxEVT_BUTTON, [this, m_staticTextPath, m_sizer](auto& e) {
1278 wxString defaultPath = wxT("/");
1279 wxDirDialog dialog(this, _L("Choose Download Directory"), defaultPath, wxDD_NEW_DIR_BUTTON);
1280
1281 if (dialog.ShowModal() == wxID_OK) {
1282 wxString download_path = dialog.GetPath();
1283 std::string download_path_str = download_path.ToUTF8().data();
1284 app_config->set("download_path", download_path_str);
1285 m_staticTextPath->SetLabelText(download_path);
1286 m_staticTextPath->SetToolTip(download_path);
1287 m_sizer->Layout();
1288 }
1289 });
1290
1291 m_sizer->Add(m_button_download, 0, wxALIGN_CENTER_VERTICAL);
1292 m_sizer->Add(m_staticTextPath , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(10));
1293
1294 return m_sizer;
1295}
#define DESIGN_GRAY600_COLOR
Definition ExportPresetBundleDialog.hpp:28
static wxString dots("...", wxConvUTF8)

References _L, app_config, Label::Body_14, create_item_label(), DESIGN_GRAY600_COLOR, Slic3r::GUI::dots(), m_parent, Parameter, Regular, and wxStaticText.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_input()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_input ( wxString title,
wxString title2,
wxString tooltip,
std::string param,
std::function< void(wxString)> onchange = {},
const wxString wiki_url = "" )
696{
697 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
698
699 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
700
701 auto input = new ::TextInput(m_parent, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, DESIGN_INPUT_SIZE, wxTE_PROCESS_ENTER);
702 StateColor input_bg(std::pair<wxColour, int>(wxColour("#F0F0F1"), StateColor::Disabled), std::pair<wxColour, int>(*wxWHITE, StateColor::Enabled));
703 input->SetBackgroundColor(input_bg);
704 input->GetTextCtrl()->SetValue(app_config->get(param));
705 wxTextValidator validator(wxFILTER_DIGITS);
706 input->SetToolTip(tip);
707 input->GetTextCtrl()->SetValidator(validator);
708
709 auto second_title = new wxStaticText(m_parent, wxID_ANY, title2, wxDefaultPosition, wxDefaultSize, 0);
710 second_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
711 second_title->SetFont(::Label::Body_14);
712 second_title->SetToolTip(tip);
713 second_title->Wrap(-1);
714
715 m_sizer->Add(input , 0, wxALIGN_CENTER_VERTICAL);
716 m_sizer->Add(second_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(2));
717
718 input->GetTextCtrl()->Bind(wxEVT_TEXT_ENTER, [this, param, input, onchange](wxCommandEvent &e) {
719 auto value = input->GetTextCtrl()->GetValue();
720 app_config->set(param, std::string(value.mb_str()));
721 app_config->save();
722 onchange(value);
723 e.Skip();
724 });
725
726 input->GetTextCtrl()->Bind(wxEVT_KILL_FOCUS, [this, param, input, onchange](wxFocusEvent &e) {
727 auto value = input->GetTextCtrl()->GetValue();
728 app_config->set(param, std::string(value.mb_str()));
729 onchange(value);
730 e.Skip();
731 });
732
733 return m_sizer;
734}

References app_config, Label::Body_14, create_item_label(), DESIGN_GRAY900_COLOR, DESIGN_INPUT_SIZE, StateColor::Disabled, StateColor::Enabled, m_parent, and wxStaticText.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_label()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_label ( wxString label,
const wxString tooltip = "",
const wxString wiki_url = "" )
311{
312 wxBoxSizer *sizer = new wxBoxSizer(wxHORIZONTAL);
313 sizer->AddSpacer(FromDIP(DESIGN_LEFT_MARGIN));
314
315 wxString url;
316 if(!wiki_url.IsEmpty())
317 url = "https://www.orcaslicer.com/wiki/" + wiki_url;
318
319 auto label_ctrl = new WikiLabel(m_parent, label, url, wxDefaultPosition, DESIGN_TITLE_SIZE);
320
321 label_ctrl->SetToolTip(tooltip);
322
323 sizer->Add(label_ctrl, 0, wxALIGN_CENTER | wxTOP | wxBOTTOM, FromDIP(3));
324 sizer->AddSpacer(FromDIP(5));
325
326 return sizer;
327}
#define DESIGN_TITLE_SIZE
Definition ExportPresetBundleDialog.hpp:31

References DESIGN_LEFT_MARGIN, DESIGN_TITLE_SIZE, and m_parent.

Referenced by create_camera_orbit_mult_input(), create_item_auto_reslice(), create_item_backup(), create_item_bambu_cloud(), create_item_button(), create_item_checkbox(), create_item_combobox_base(), create_item_darkmode(), create_item_decimal_input(), create_item_downloads(), create_item_input(), create_item_language_combobox(), create_item_loglevel_combobox(), create_item_network_plugin_version(), create_item_region_combobox(), and create_item_spinctrl().

Here is the caller graph for this function:

◆ create_item_language_combobox()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_language_combobox ( wxString title,
wxString tooltip )
399{
400 wxLanguage supported_languages[]{
401 wxLANGUAGE_ENGLISH,
402 wxLANGUAGE_CHINESE_SIMPLIFIED,
403 wxLANGUAGE_CHINESE_TRADITIONAL,
404 wxLANGUAGE_GERMAN,
405 wxLANGUAGE_CZECH,
406 wxLANGUAGE_FRENCH,
407 wxLANGUAGE_SPANISH,
408 wxLANGUAGE_SWEDISH,
409 wxLANGUAGE_DUTCH,
410 wxLANGUAGE_HUNGARIAN,
411 wxLANGUAGE_JAPANESE,
412 wxLANGUAGE_ITALIAN,
413 wxLANGUAGE_KOREAN,
414 wxLANGUAGE_RUSSIAN,
415 wxLANGUAGE_UKRAINIAN,
416 wxLANGUAGE_TURKISH,
417 wxLANGUAGE_POLISH,
418 wxLANGUAGE_CATALAN,
419 wxLANGUAGE_PORTUGUESE_BRAZILIAN,
420 wxLANGUAGE_LITHUANIAN,
421 wxLANGUAGE_VIETNAMESE,
422 wxLANGUAGE_THAI,
423 wxLANGUAGE_ROMANIAN
424 };
425
426 auto translations = wxTranslations::Get()->GetAvailableTranslations(SLIC3R_APP_KEY);
427 std::vector<const wxLanguageInfo *> language_infos;
428 language_infos.emplace_back(wxLocale::GetLanguageInfo(wxLANGUAGE_ENGLISH));
429 for (size_t i = 0; i < translations.GetCount(); ++i) {
430 const wxLanguageInfo *langinfo = wxLocale::FindLanguageInfo(translations[i]);
431
432 if (langinfo == nullptr) continue;
433 int language_num = sizeof(supported_languages) / sizeof(supported_languages[0]);
434 for (auto si = 0; si < language_num; si++) {
435 if (langinfo == wxLocale::GetLanguageInfo(supported_languages[si])) {
436 language_infos.emplace_back(langinfo);
437 }
438 }
439 //if (langinfo != nullptr) language_infos.emplace_back(langinfo);
440 }
441 sort_remove_duplicates(language_infos);
442 std::sort(language_infos.begin(), language_infos.end(), [](const wxLanguageInfo *l, const wxLanguageInfo *r) { return l->Description < r->Description; });
443
444 auto vlist = language_infos;
445 auto param = "language";
446
447 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
448
449 wxBoxSizer *m_sizer = create_item_label(title, tip);
450
451 auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
452 combobox->GetDropDown().SetUseContentWidth(true);
453 combobox->SetToolTip(tip);
454
455 auto language = app_config->get(param);
457 std::vector<wxString>::iterator iter;
458 for (size_t i = 0; i < vlist.size(); ++i) {
459 auto language_name = vlist[i]->Description;
460
461 if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_CHINESE_SIMPLIFIED)) {
462 language_name = wxString::FromUTF8("\xe4\xb8\xad\xe6\x96\x87\x28\xe7\xae\x80\xe4\xbd\x93\x29");
463 }
464 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_CHINESE_TRADITIONAL)) {
465 language_name = wxString::FromUTF8("\xe4\xb8\xad\xe6\x96\x87\x28\xe7\xb9\x81\xe9\xab\x94\x29");
466 }
467 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_SPANISH)) {
468 language_name = wxString::FromUTF8("\x45\x73\x70\x61\xc3\xb1\x6f\x6c");
469 }
470 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_GERMAN)) {
471 language_name = wxString::FromUTF8("Deutsch");
472 }
473 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_CZECH)) {
474 language_name = wxString::FromUTF8("Czech");
475 }
476 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_SWEDISH)) {
477 language_name = wxString::FromUTF8("\x53\x76\x65\x6e\x73\x6b\x61"); //Svenska
478 }
479 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_DUTCH)) {
480 language_name = wxString::FromUTF8("Nederlands");
481 }
482 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_FRENCH)) {
483 language_name = wxString::FromUTF8("\x46\x72\x61\x6E\xC3\xA7\x61\x69\x73");
484 }
485 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_HUNGARIAN)) {
486 language_name = wxString::FromUTF8("Magyar");
487 }
488 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_JAPANESE)) {
489 language_name = wxString::FromUTF8("\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E");
490 }
491 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_ITALIAN)) {
492 language_name = wxString::FromUTF8("\x69\x74\x61\x6c\x69\x61\x6e\x6f");
493 }
494 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_KOREAN)) {
495 language_name = wxString::FromUTF8("\xED\x95\x9C\xEA\xB5\xAD\xEC\x96\xB4");
496 }
497 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_RUSSIAN)) {
498 language_name = wxString::FromUTF8("\xd0\xa0\xd1\x83\xd1\x81\xd1\x81\xd0\xba\xd0\xb8\xd0\xb9");
499 }
500 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_UKRAINIAN)) {
501 language_name = wxString::FromUTF8("Ukrainian");
502 }
503 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_TURKISH)) {
504 language_name = wxString::FromUTF8("Turkish");
505 }
506 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_POLISH)) {
507 language_name = wxString::FromUTF8("Polski");
508 }
509 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_CATALAN)) {
510 language_name = wxString::FromUTF8("Catalan");
511 }
512 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_PORTUGUESE_BRAZILIAN)) {
513 language_name = wxString::FromUTF8("Português (Brasil)");
514 }
515 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_LITHUANIAN)) {
516 language_name = wxString::FromUTF8("Lietuvių");
517 }
518 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_VIETNAMESE)) {
519 language_name = wxString::FromUTF8("Tiếng Việt");
520 }
521 else if (vlist[i] == wxLocale::GetLanguageInfo(wxLANGUAGE_THAI)) {
522 language_name = wxString::FromUTF8("\xE0\xB9\x84\xE0\xB8\x97\xE0\xB8\xA2");
523 }
524
525 if (app_config->get(param) == vlist[i]->CanonicalName) {
527 }
528 combobox->Append(language_name);
529 }
530 if (m_current_language_selected == -1 && language.size() >= 5) {
531 language = language.substr(0, 2);
532 for (size_t i = 0; i < vlist.size(); ++i) {
533 if (vlist[i]->CanonicalName.StartsWith(language)) {
535 break;
536 }
537 }
538 }
539 combobox->SetSelection(m_current_language_selected);
540
541 m_sizer->Add(combobox, 0, wxALIGN_CENTER);
542
543 combobox->Bind(wxEVT_LEFT_DOWN, [this, combobox](wxMouseEvent &e) {
544 m_current_language_selected = combobox->GetSelection();
545 e.Skip();
546 });
547
548 combobox->Bind(wxEVT_COMBOBOX, [this, param, vlist, combobox](wxCommandEvent &e) {
549 if (combobox->GetSelection() == m_current_language_selected)
550 return;
551
552 if (e.GetString().ToStdString() != app_config->get(param)) {
553 {
554 //check if the project has changed
555 if (wxGetApp().plater()->is_project_dirty()) {
556 auto result = MessageDialog(static_cast<wxWindow*>(this), _L("The current project has unsaved changes. Would you like to save before continuing\?"),
557 wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Save"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal();
558
559 if (result == wxID_YES) {
560 wxGetApp().plater()->save_project();
561 }
562 }
563
564 MessageDialog msg_window(nullptr, _L("Switching languages requires the application to restart.\n") + "\n" + _L("Do you want to continue?"),
565 _L("Language selection"), wxICON_QUESTION | wxOK | wxCANCEL);
566 if (msg_window.ShowModal() == wxID_CANCEL) {
567 combobox->SetSelection(m_current_language_selected);
568 return;
569 }
570 }
571
572 m_current_language_selected = combobox->GetSelection();
573 if (m_current_language_selected >= 0 && m_current_language_selected < vlist.size()) {
574 m_pending_language = vlist[m_current_language_selected]->CanonicalName.ToUTF8().data();
575 m_recreate_GUI = true;
576 EndModal(wxID_OK);
577 return;
578 }
579 }
580
581 e.Skip();
582 });
583
584 return m_sizer;
585}
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305
bool m_recreate_GUI
Definition Preferences.hpp:55
int m_current_language_selected
Definition Preferences.hpp:134
std::string m_pending_language
Definition Preferences.hpp:56
#define SLIC3R_APP_FULL_NAME
Definition libslic3r.h:11
void sort_remove_duplicates(std::vector< T > &vec)
Definition libslic3r.h:231

References _L, app_config, create_item_label(), DESIGN_LARGE_COMBOBOX_SIZE, Slic3r::GUI::DPIDialog::EndModal(), m_current_language_selected, m_parent, m_pending_language, m_recreate_GUI, Slic3r::GUI::plater(), Slic3r::GUI::DPIAware< P >::ShowModal(), SLIC3R_APP_FULL_NAME, Slic3r::sort_remove_duplicates(), and Slic3r::GUI::wxMouseEvent.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_loglevel_combobox()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_loglevel_combobox ( wxString title,
wxString tooltip,
std::vector< wxString > vlist )
668{
669 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
670
671 wxBoxSizer *m_sizer = create_item_label(title, tip);
672
673 auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
674 combobox->GetDropDown().SetUseContentWidth(true);
675 combobox->SetToolTip(tip);
676
677 std::vector<wxString>::iterator iter;
678 for (iter = vlist.begin(); iter != vlist.end(); iter++) { combobox->Append(*iter); }
679
680 auto severity_level = app_config->get("log_severity_level");
681 if (!severity_level.empty()) { combobox->SetValue(severity_level); }
682
683 m_sizer->Add(combobox, 0, wxALIGN_CENTER);
684
686 combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this](wxCommandEvent &e) {
687 auto level = Slic3r::get_string_logging_level(e.GetSelection());
689 app_config->set("log_severity_level",level);
690 e.Skip();
691 });
692 return m_sizer;
693}
#define DESIGN_COMBOBOX_SIZE
Definition ExportPresetBundleDialog.hpp:32
void set_logging_level(unsigned int level)
Definition utils.cpp:171
std::string get_string_logging_level(unsigned level)
Definition utils.cpp:208
unsigned int level_string_to_boost(std::string level)
Definition utils.cpp:195

References app_config, create_item_label(), DESIGN_COMBOBOX_SIZE, Slic3r::get_string_logging_level(), Slic3r::level_string_to_boost(), m_parent, and Slic3r::set_logging_level().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_network_plugin_version()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_network_plugin_version ( wxString title,
wxString tooltip )
1326{
1327 wxBoxSizer *m_sizer = create_item_label(title, tooltip);
1328
1329 m_network_version_combo = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
1330 m_network_version_combo->GetDropDown().SetUseContentWidth(true);
1331 m_network_version_combo->SetToolTip(tooltip);
1332
1333 std::string current_version = app_config->get_network_plugin_version();
1334 if (current_version.empty()) {
1335 current_version = get_latest_network_version();
1336 }
1337 int current_selection = 0;
1338
1340
1341 for (size_t i = 0; i < m_available_versions.size(); i++) {
1342 const auto& ver = m_available_versions[i];
1344 if (current_version == ver.version) {
1345 current_selection = i;
1346 }
1347 }
1348
1349 m_network_version_combo->SetSelection(current_selection);
1350 m_sizer->Add(m_network_version_combo, 0, wxALIGN_CENTER);
1351
1352 m_network_version_combo->GetDropDown().Bind(wxEVT_COMBOBOX, [this](wxCommandEvent& e) {
1353 e.Skip(); // order-independent flag read after this handler returns; every path just returns
1354 int selection = e.GetSelection();
1355 if (selection < 0 || selection >= (int) m_available_versions.size())
1356 return;
1357
1358 const auto& selected_ver = m_available_versions[selection];
1359 const std::string new_version = selected_ver.version;
1360 std::string old_version = app_config->get_network_plugin_version();
1361 if (old_version.empty())
1362 old_version = get_latest_network_version();
1363
1364 // Move the combo back to the row for `version`, so the UI never shows a build other
1365 // than the one actually configured/loaded (e.g. after a declined or refused switch).
1366 auto reselect = [this](const std::string& version) {
1367 for (size_t i = 0; i < m_available_versions.size(); ++i)
1368 if (m_available_versions[i].version == version) {
1369 m_network_version_combo->SetSelection((int) i);
1370 break;
1371 }
1372 };
1373
1374 if (new_version == old_version)
1375 return;
1376
1377 BOOST_LOG_TRIVIAL(info) << "Network plugin version selection changed from " << old_version << " to " << new_version;
1378
1379 if (!selected_ver.warning.empty()) {
1380 MessageDialog warn_dlg(this, wxString::FromUTF8(selected_ver.warning), _L("Warning"), wxOK | wxCANCEL | wxICON_WARNING);
1381 if (warn_dlg.ShowModal() != wxID_OK) {
1382 reselect(old_version);
1383 return;
1384 }
1385 }
1386
1387 // A build already present on disk loads directly with a hot reload - on any platform
1388 // and across series (legacy <-> modern). Only claim success once the build that
1389 // actually loaded is the one that was requested.
1391 app_config->set_network_plugin_version(new_version);
1392 app_config->save();
1393 BOOST_LOG_TRIVIAL(info) << "Version " << new_version << " already exists on disk, triggering hot reload";
1394 // Claim success only once the series that actually loaded is the one requested - the
1395 // loaded plug-in reports its full build (02.08.01.53) while the requested identity is
1396 // the series (02.08.01), so compare series, not the raw string.
1397 if (wxGetApp().hot_reload_network_plugin() &&
1399 MessageDialog dlg(this, _L("Network plug-in switched successfully."), _L("Success"), wxOK | wxICON_INFORMATION);
1400 dlg.ShowModal();
1401 } else {
1402 MessageDialog dlg(this, _L("Failed to load network plug-in. Please restart the application."), _L("Restart Required"), wxOK | wxICON_WARNING);
1403 dlg.ShowModal();
1404 reselect(app_config->get_network_plugin_version());
1405 }
1406 return;
1407 }
1408
1409 // Not on disk: offer to download it. The endpoint is series-keyed and serves that series'
1410 // newest build. (A same-series custom build is only ever listed when its file is on disk,
1411 // so it takes the hot-reload branch above; the only not-on-disk selectable is a series or
1412 // legacy entry that genuinely needs fetching.)
1413 wxString msg = wxString::Format(
1414 _L("You've selected network plug-in version %s.\n\nWould you like to download and install this version now?\n\nNote: The application may need to restart after installation."),
1415 wxString::FromUTF8(new_version));
1416 MessageDialog dlg(this, msg, _L("Download Network Plug-in"), wxYES_NO | wxICON_QUESTION);
1417 if (dlg.ShowModal() == wxID_YES) {
1418 app_config->set_network_plugin_version(new_version);
1419 app_config->save();
1420 DownloadProgressDialog progress_dlg(_L("Downloading Network Plug-in"));
1421 progress_dlg.ShowModal();
1422 reselect(app_config->get_network_plugin_version());
1423 } else {
1424 reselect(old_version);
1425 }
1426 });
1427
1428 auto reload_btn = new Button(m_parent, wxEmptyString, "refresh", 0, 16);
1429 reload_btn->SetStyle(ButtonStyle::Regular, ButtonType::Icon);
1430 reload_btn->SetToolTip(_L("Reload the network plug-in without restarting the application"));
1431 reload_btn->Bind(wxEVT_BUTTON, [this](auto& e) {
1432 if (wxGetApp().hot_reload_network_plugin()) {
1433 MessageDialog dlg(this, _L("Network plug-in reloaded successfully."), _L("Reload"), wxOK | wxICON_INFORMATION);
1434 dlg.ShowModal();
1435 } else {
1436 MessageDialog dlg(this, _L("Failed to reload network plug-in. Please restart the application."), _L("Reload Failed"), wxOK | wxICON_ERROR);
1437 dlg.ShowModal();
1438 }
1439 });
1440 m_sizer->Add(reload_btn, 0, wxALIGN_CENTER | wxLEFT, FromDIP(5));
1441
1442 return m_sizer;
1443}
@ Icon
Definition Button.hpp:35
::ComboBox * m_network_version_combo
Definition Preferences.hpp:90
std::vector< NetworkLibraryVersionInfo > m_available_versions
Definition Preferences.hpp:91
static bool versioned_library_exists(const std::string &version)
Definition NetworkAgent.cpp:61
static std::string get_version()
Definition NetworkAgent.cpp:84
wxString network_version_label(const NetworkLibraryVersionInfo &ver)
Definition NetworkPluginDialog.cpp:204
const char * get_latest_network_version()
Definition bambu_networking.hpp:443
std::vector< NetworkLibraryVersionInfo > get_all_available_versions()
Definition BBLNetworkPlugin.cpp:885
std::string network_plugin_series(const std::string &version)
Definition bambu_networking.hpp:454

References _L, app_config, create_item_label(), DESIGN_LARGE_COMBOBOX_SIZE, Slic3r::get_all_available_versions(), Slic3r::get_latest_network_version(), Slic3r::NetworkAgent::get_version(), Icon, m_available_versions, m_network_version_combo, m_parent, Slic3r::network_plugin_series(), Slic3r::GUI::network_version_label(), Regular, Slic3r::GUI::DPIAware< P >::ShowModal(), and Slic3r::NetworkAgent::versioned_library_exists().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_region_combobox()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_region_combobox ( wxString title,
wxString tooltip )
588{
589
590 std::vector<wxString> Regions = {_L("Asia-Pacific"), _L("China"), _L("Europe"), _L("North America"), _L_CONTEXT("Others", "Region")};
591 std::vector<wxString> local_regions = {"Asia-Pacific", "China", "Europe", "North America", "Others"};
592
593 auto vlist = Regions;
594
595 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
596
597 wxBoxSizer *m_sizer = create_item_label(title, tip);
598
599 auto combobox = new ::ComboBox(m_parent, wxID_ANY, wxEmptyString, wxDefaultPosition, DESIGN_LARGE_COMBOBOX_SIZE, 0, nullptr, wxCB_READONLY);
600 combobox->GetDropDown().SetUseContentWidth(true);
601 combobox->SetToolTip(tip);
602
603 m_sizer->Add(combobox, 0, wxALIGN_CENTER);
604
605 std::vector<wxString>::iterator iter;
606 for (iter = vlist.begin(); iter != vlist.end(); iter++) { combobox->Append(*iter); }
607
608 AppConfig * config = GUI::wxGetApp().app_config;
609
610 int current_region = 0;
611 if (!config->get("region").empty()) {
612 std::string country_code = config->get("region");
613 for (auto i = 0; i < vlist.size(); i++) {
614 if (local_regions[i].ToStdString() == country_code) {
615 combobox->SetSelection(i);
616 current_region = i;
617 }
618 }
619 }
620
621 combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, combobox, current_region, local_regions](wxCommandEvent &e) {
622 auto region_index = e.GetSelection();
623 auto region = local_regions[region_index];
624
625 /*auto area = "";
626 if (region == "CHN" || region == "China")
627 area = "CN";
628 else if (region == "USA")
629 area = "US";
630 else if (region == "Asia-Pacific")
631 area = "Others";
632 else if (region == "Europe")
633 area = "US";
634 else if (region == "North America")
635 area = "US";
636 else
637 area = "Others";*/
638 combobox->SetSelection(region_index);
639 NetworkAgent* agent = wxGetApp().getAgent();
640 AppConfig* config = GUI::wxGetApp().app_config;
641 if (agent) {
642 MessageDialog msg_wingow(this, _L("Changing the region will log you out of your account.\n") + "\n" + _L("Do you want to continue?"), _L("Region selection"),
643 wxICON_QUESTION | wxOK | wxCANCEL);
644 if (msg_wingow.ShowModal() == wxID_CANCEL) {
645 combobox->SetSelection(current_region);
646 return;
647 } else {
648 wxGetApp().request_user_logout(ORCA_CLOUD_PROVIDER, /*user_initiated=*/true);
649 config->set("region", region.ToStdString());
650 auto area = config->get_country_code();
651 if (agent) {
652 agent->set_country_code(area);
653 }
654 EndModal(wxID_CANCEL);
655 }
656 } else {
657 config->set("region", region.ToStdString());
658 }
659
660 wxGetApp().update_publish_status();
661 e.Skip();
662 });
663
664 return m_sizer;
665}
double area(const ExPolygon &poly)
Definition ExPolygon.hpp:511
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _L, _L_CONTEXT, Slic3r::area(), create_item_label(), DESIGN_LARGE_COMBOBOX_SIZE, Slic3r::GUI::DPIDialog::EndModal(), Slic3r::AppConfig::get(), Slic3r::AppConfig::get_country_code(), m_parent, Slic3r::ORCA_CLOUD_PROVIDER(), Slic3r::AppConfig::set(), Slic3r::NetworkAgent::set_country_code(), and Slic3r::GUI::DPIAware< P >::ShowModal().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_spinctrl()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_spinctrl ( wxString title,
wxString title2,
wxString side_label,
wxString tooltip,
std::string param,
int min,
int max,
std::function< void(int)> onchange = nullptr,
const wxString wiki_url = "" )
737{
738 auto tip = tooltip.IsEmpty() ? title : tooltip; // auto fill tooltips with title if its empty
739
740 wxBoxSizer *m_sizer = create_item_label(title, tip, wiki_url);
741
742 auto input = new SpinInput(m_parent, wxEmptyString, side_label, wxDefaultPosition, DESIGN_INPUT_SIZE, wxSP_ARROW_KEYS, min, max, stoi(app_config->get(param)));
743 input->SetToolTip(tip);
744
745 // ORCA: this one is only meaningful while the dimming it controls is enabled
746 if (param == "preview_dim_previous_layers_brightness") {
748 input->Enable(app_config->get_bool("preview_dim_previous_layers"));
749 }
750
751 m_sizer->Add(input, 0, wxALIGN_CENTER_VERTICAL);
752
753 if(!title2.empty()){
754 auto second_title = new wxStaticText(m_parent, wxID_ANY, title2, wxDefaultPosition, wxDefaultSize, 0);
755 second_title->SetForegroundColour(DESIGN_GRAY900_COLOR);
756 second_title->SetFont(::Label::Body_14);
757 second_title->SetToolTip(tip);
758 m_sizer->Add(second_title, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(5));
759 }
760
761 input->Bind(wxEVT_TEXT_ENTER, [this, param, input, onchange](wxCommandEvent& e) {
762 auto value = input->GetValue();
763 app_config->set(param, std::to_string(value));
764 app_config->save();
765 if (onchange != nullptr) onchange(value);
766 e.Skip();
767 });
768
769 input->Bind(wxEVT_SPINCTRL, [this, param, input, onchange](wxCommandEvent& e) {
770 auto value = input->GetValue();
771 app_config->set(param, std::to_string(value));
772 app_config->save();
773 if (onchange != nullptr) onchange(value);
774 e.Skip();
775 });
776
777 input->Bind(wxEVT_KILL_FOCUS, [this, param, input, onchange](wxFocusEvent &e) {
778 auto value = input->GetValue();
779 app_config->set(param, std::to_string(value));
780 if (onchange != nullptr) onchange(value);
781 e.Skip();
782 });
783
784 return m_sizer;
785}

References app_config, Label::Body_14, create_item_label(), DESIGN_GRAY900_COLOR, DESIGN_INPUT_SIZE, m_dim_previous_layers_brightness_input, m_parent, and wxStaticText.

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_item_title()

wxBoxSizer * Slic3r::GUI::PreferencesDialog::create_item_title ( wxString title)
297{
298 wxBoxSizer *m_sizer_title = new wxBoxSizer(wxHORIZONTAL);
299
300 auto title_ctrl = new StaticLine(m_parent, 0, title);
301 title_ctrl->SetFont(Label::Head_14);
302 title_ctrl->SetForegroundColour(DESIGN_GRAY900_COLOR);
303 m_sizer_title->AddSpacer(FromDIP(DESIGN_LEFT_MARGIN - 10));
304 m_sizer_title->Add(title_ctrl, 1, wxEXPAND | wxBOTTOM | wxTOP, FromDIP(6));
305 m_sizer_title->AddSpacer(FromDIP(DESIGN_LEFT_MARGIN - 10));
306
307 return m_sizer_title;
308}
static wxFont Head_14
Definition Label.hpp:45

References DESIGN_GRAY900_COLOR, DESIGN_LEFT_MARGIN, Label::Head_14, and m_parent.

Referenced by create_debug_page(), create_items(), and create_sync_page().

Here is the caller graph for this function:

◆ create_items()

void Slic3r::GUI::PreferencesDialog::create_items ( )
1664{
1665 // ORCA
1666 // Window focus follows item creation order. so below code has to be in same order with UI
1667 // Create functions for custom controls to keep list clean
1668 // Tooltips added automatically from related title if its empty
1669
1670 wxBoxSizer*sizer_page = new wxBoxSizer(wxVERTICAL);
1671 wxFlexGridSizer* g_sizer; // use same name on all sizers to make easier to ordering without renaming
1672 auto v_gap = FromDIP(4);
1673
1677 m_tab_index[PreferencesTab::General] = m_pref_tabs->AppendItem(_L("General"));
1678 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
1679 g_sizer = f_sizers.back();
1680 g_sizer->AddGrowableCol(0, 1);
1681
1683 g_sizer->Add(create_item_title(_L("Settings")), 1, wxEXPAND);
1684
1685 auto item_language = create_item_language_combobox(_L("Language"), "");
1686 g_sizer->Add(item_language);
1687
1688 std::vector<wxString>Units = {_L("Metric") + " (mm, g)", _L("Imperial") + " (in, oz)"};
1689 auto item_currency = create_item_combobox(_L("Units"), "", "use_inches", Units);
1690 g_sizer->Add(item_currency);
1691
1692 std::vector<wxString> DefaultPage = {_L("Home"), _L("Prepare")};
1693 auto item_default_page = create_item_combobox(_L("Default page"), _L("Set the page opened on startup."), "default_page", DefaultPage);
1694 g_sizer->Add(item_default_page);
1695
1696#ifdef _WIN32
1697 auto item_darkmode = create_item_darkmode(_L("Enable dark Mode"), "", "dark_color_mode");
1698 g_sizer->Add(item_darkmode);
1699#endif
1700
1701 auto item_single_instance = create_item_checkbox(_L("Allow only one OrcaSlicer instance"),
1702 #if __APPLE__
1703 _L("On OSX there is always only one instance of app running by default. However it is allowed to run multiple instances "
1704 "of same app from the command line. In such case this settings will allow only one instance."),
1705 #else
1706 _L("If this is enabled, when starting OrcaSlicer and another instance of the same OrcaSlicer is already running, that instance will be reactivated instead."),
1707 #endif
1708 "single_instance");
1709 g_sizer->Add(item_single_instance);
1710
1711 auto item_show_splash_scr = create_item_checkbox(_L("Show splash screen"), _L("Show the splash screen during startup."), "show_splash_screen");
1712 g_sizer->Add(item_show_splash_scr);
1713
1714#ifdef __linux__
1715 auto item_window_button_pos = create_item_checkbox(_L("Use window buttons on left side"), "", "window_buttons_on_left", _L("(Requires restart)"));
1716 g_sizer->Add(item_window_button_pos);
1717#endif
1718
1719 //auto item_hints = create_item_checkbox(_L("Show \"Daily Tips\" after start"), page, _L("If enabled, useful hints are displayed at startup."), "show_daily_tips");
1720 //g_sizer->Add(item_hints);
1721
1722 auto item_downloads = create_item_downloads(_L("Downloads folder"), _L("Target folder for downloaded items"));
1723 g_sizer->Add(item_downloads);
1724
1726 g_sizer->Add(create_item_title(_L("Project")), 1, wxEXPAND);
1727
1728 std::vector<wxString> projectLoadSettingsBehaviourOptions = {_L("Load All"), _L("Ask When Relevant"), _L("Always Ask"), _L("Load Geometry Only")};
1730 auto item_project_load = create_item_combobox(_L("Load behavior"), _L("Should printer/filament/process settings be loaded when opening a 3MF file?"), SETTING_PROJECT_LOAD_BEHAVIOUR, projectLoadSettingsBehaviourOptions, projectLoadSettingsConfigOptions);
1731 g_sizer->Add(item_project_load);
1732
1733 auto item_backup = create_item_backup(_L("Auto backup"), _L("Backup your project periodically to help with restoring from an occasional crash."));
1734 g_sizer->Add(item_backup);
1735
1736 auto item_max_recent_count = create_item_input(_L("Maximum recent files"), "", _L("Maximum count of recent files"), "max_recent_count", [](wxString value) {
1737 long max = 0;
1738 if (value.ToLong(&max))
1739 wxGetApp().mainframe->set_max_recent_count(max);
1740 });
1741 g_sizer->Add(item_max_recent_count);
1742
1743 auto item_recent_models = create_item_checkbox(_L("Add STL/STEP files to recent files list"), "", "recent_models");
1744 g_sizer->Add(item_recent_models);
1745
1746 auto item_gcodes_warning = create_item_checkbox(_L("Don't warn when loading 3MF with modified G-code"), "", "no_warn_when_modified_gcodes");
1747 g_sizer->Add(item_gcodes_warning);
1748
1749 auto item_step_dialog = create_item_checkbox(
1750 _L("Show options when importing STEP file"), _L("If enabled, a parameter settings dialog will appear during STEP file import."),
1751 "enable_step_mesh_setting", wxEmptyString, "import_export#dont-show-again"
1752 );
1753 g_sizer->Add(item_step_dialog);
1754
1755 auto item_step_linear = create_item_decimal_input(_L("STEP importing: linear deflection"), "mm", _L("Linear deflection used when meshing imported STEP files.\nSmaller values produce higher-quality meshes but increase processing time.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: 0.003 mm."), "linear_deflection", 0.001, 0.1, 3);
1756 g_sizer->Add(item_step_linear);
1757
1758 auto item_step_angle = create_item_decimal_input(_L("STEP importing: angle deflection"), "", _L("Angle deflection used when meshing imported STEP files.\nSmaller values produce higher-quality meshes but increase processing time.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: 0.5."), "angle_deflection", 0.01, 1.0, 2);
1759 g_sizer->Add(item_step_angle);
1760
1761 auto item_step_split = create_item_checkbox(_L("STEP importing: Split into multiple objects"), _L("If enabled, compound and compsolid shapes in imported STEP files are split into multiple objects.\nUsed as the default in the import dialog, or directly when the import dialog is disabled.\nDefault: disabled."), "is_split_compound");
1762 g_sizer->Add(item_step_split);
1763
1764 auto item_draco_bits = create_item_spinctrl(_L("Quality level for Draco export"), "",
1765 _L("bits"),
1766 _L("Controls the quantization bit depth used when compressing the mesh to Draco format.\n"
1767 "0 = lossless compression (geometry is preserved at full precision). Valid lossy values range from 8 to 30.\n"
1768 "Lower values produce smaller files but lose more geometric detail; higher values preserve more detail at the cost of larger files."),
1769 "drc_bits", DRC_BITS_MIN, DRC_BITS_MAX, nullptr, "import_export#drc"
1770 );
1771 g_sizer->Add(item_draco_bits);
1772
1773 auto item_full_source_paths = create_item_checkbox(_L("Store full source file paths in projects"),
1774 _L("If enabled, saved projects store the absolute path to imported source files (STEP/STL/...), so "
1775 "\"Reload from disk\" still works when the source file is kept in a different folder than the project. "
1776 "If disabled, only the filename is stored, which keeps projects portable and avoids embedding absolute paths."),
1777 "export_sources_full_pathnames");
1778 g_sizer->Add(item_full_source_paths);
1779
1781 g_sizer->Add(create_item_title(_L("Preset")), 1, wxEXPAND);
1782
1783 auto item_remember_printer = create_item_checkbox(_L("Remember printer configuration"), _L("If enabled, Orca will remember and switch filament/process configuration for each printer automatically."), "remember_printer_config");
1784 g_sizer->Add(item_remember_printer);
1785
1786 auto item_filament_preset_grouping = create_item_combobox(_L("Group user filament presets"), _L("Group user filament presets based on selection"),
1787 "group_filament_presets", {_L("All"), _L("None"), _L("By type"), _L("By vendor")}, [](wxString value) {wxGetApp().plater()->sidebar().update_presets(Preset::TYPE_FILAMENT);});
1788 g_sizer->Add(item_filament_preset_grouping);
1789
1790 // prevent burst calling on keyboard / spin events
1791 m_filament_height_timer.Bind(wxEVT_TIMER, [this](wxTimerEvent&) {
1792 wxGetApp().plater()->sidebar().update_filaments_area_height();
1794 });
1795 auto item_filament_area_height = create_item_spinctrl(_L("Optimize filaments area height for..."), "", _L("filaments"), _L("Optimizes filament area maximum height by chosen filament count."),
1796 "filaments_area_preferred_count", 8, 99, [this](int value) {m_filament_height_timer.StartOnce(500);});
1797 g_sizer->Add(item_filament_area_height);
1798
1799 auto item_shared_profiles = create_item_checkbox(_L("Show shared profiles notification"), _L("Show a notification with a link to browse shared profiles when the selected printer is changed."), "show_shared_profiles_notification");
1800 g_sizer->Add(item_shared_profiles);
1801
1803 g_sizer->Add(create_item_title(_L("Features")), 1, wxEXPAND);
1804
1805 auto item_multi_machine = create_item_checkbox(_L("Multi device management"), _L("With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices."), "enable_multi_machine", _L("(Requires restart)"));
1806 g_sizer->Add(item_multi_machine);
1807
1808 auto item_speed_dial = create_item_checkbox(_L("Open the Speed Dial from the keyboard"),
1809 _L("When enabled, the Speed Dial keyboard shortcut (Space by default) opens the action search from any page."),
1810 "enable_speed_dial");
1811 g_sizer->Add(item_speed_dial);
1812
1813 auto item_speed_dial_recents = create_item_spinctrl(
1814 _L("Recent actions"),
1815 "",
1816 // TRN Unit shown after the number of recent actions, as in "5 actions".
1817 _L("actions"),
1818 _L("How many recently launched actions to show at the top of the Speed Dial. Set to 0 to hide recent actions."),
1822 g_sizer->Add(item_speed_dial_recents);
1823
1824#ifdef SLIC3R_CAD
1825 auto item_cad_feature = create_item_checkbox(_L("CAD feature (experimental)"),
1826 _L("With this option enabled, the Design tab is shown, where models can be built and edited "
1827 "parametrically. This feature is experimental and still under development."),
1828 "enable_cad_feature", _L("(Requires restart)"));
1829 g_sizer->Add(item_cad_feature);
1830#endif
1831
1832#if 0
1833 g_sizer->Add(create_item_title(_L("Filament Grouping")), 1, wxEXPAND);
1834 //temporarily disable it
1835 //auto item_ignore_ext_filament = create_item_checkbox(_L("Ignore ext filament when auto grouping"), _L("Ignore ext filament when auto grouping"), 50, "ignore_ext_filament_when_group");
1836 auto item_pop_up_filament_map_dialog = create_item_checkbox(_L("Pop up to select filament grouping mode"), _L("Pop up to select filament grouping mode"), 50, "pop_up_filament_map_dialog");
1837 g_sizer->Add(item_pop_up_filament_map_dialog);
1838#endif
1839
1841 g_sizer->Add(create_item_title(_L("Plugins")), 1, wxEXPAND);
1842
1843 auto item_plugin_pages_visible_count = create_item_spinctrl(
1844 _L("Visible plugin pages"),
1845 "",
1846 _L("pages"),
1847 _L("Number of plugin pages shown as fixed tabs before the remaining pages collapse into a dropdown on the last tab."),
1851 [](int value) { wxGetApp().mainframe->plugin_pages().set_visible_page_count(value); }
1852 );
1853 g_sizer->Add(item_plugin_pages_visible_count);
1854
1855 g_sizer->AddSpacer(FromDIP(10));
1856 sizer_page->Add(g_sizer, 0, wxEXPAND);
1857
1861 m_tab_index[PreferencesTab::Control] = m_pref_tabs->AppendItem(_L("Control"));
1862 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
1863 g_sizer = f_sizers.back();
1864 g_sizer->AddGrowableCol(0, 1);
1865
1867 g_sizer->Add(create_item_title(_L("Behavior")), 1, wxEXPAND);
1868
1869 std::vector<wxString> FlushOptionLabels = {_L("All"),_L("Color"),_L("None")};
1870 std::vector<std::string> FlushOptionValues = { "all","color change","disabled" };
1871 auto item_auto_flush = create_item_combobox(_L("Auto flush after changing..."), _L("Auto calculate flushing volumes when selected values changed"), "auto_calculate_flush", FlushOptionLabels, FlushOptionValues);
1872 g_sizer->Add(item_auto_flush);
1873
1874 auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), "", "auto_arrange");
1875 g_sizer->Add(item_auto_arrange);
1876
1878 g_sizer->Add(create_item_title(_L("Slicing")), 1, wxEXPAND);
1879
1880 auto item_auto_reslice = create_item_auto_reslice(
1881 _L("Auto slice after changes"),
1882 _L("If enabled, OrcaSlicer will re-slice automatically whenever slicing-related settings change."),
1883 _L("Delay in seconds before auto slicing starts, allowing multiple edits to be grouped. Use 0 to slice immediately."));
1884 g_sizer->Add(item_auto_reslice);
1885
1886 auto item_mix_print_high_low_temperature = create_item_checkbox(_L("Remove mixed temperature restriction"), _L("With this option enabled, you can print materials with a large temperature difference together."), "enable_high_low_temp_mixed_printing");
1887 g_sizer->Add(item_mix_print_high_low_temperature);
1888
1889 auto item_remember_print_action = create_item_checkbox(_L("Remember last print action"), _L("If enabled, OrcaSlicer will remember the last selected option in the print button's dropdown (e.g. Print, Export plate sliced file, Export G-code file) and use it as the default on next startup."), "remember_print_action");
1890 g_sizer->Add(item_remember_print_action);
1891
1893 g_sizer->Add(create_item_title(_L("Camera")), 1, wxEXPAND);
1894
1895 std::vector<wxString> CameraNavStyle = {_L("Default"), _L("Touchpad")};
1896 auto item_camera_nav_style = create_item_combobox(_L("Camera style"), _L("Select camera navigation style.\nDefault: LMB+move for rotation, RMB/MMB+move for panning.\nTouchpad: Alt+move for rotation, Shift+move for panning."), "camera_navigation_style", CameraNavStyle);
1897 g_sizer->Add(item_camera_nav_style);
1898
1899 auto camera_orbit_mult = create_camera_orbit_mult_input(_L("Orbit speed multiplier"), _L("Multiplies the orbit speed for finer or coarser camera movement."));
1900 g_sizer->Add(camera_orbit_mult);
1901
1902 auto item_zoom_to_mouse = create_item_checkbox(_L("Zoom to mouse position"), _L("Zoom in towards the mouse pointer's position in the 3D view, rather than the 2D window center."), "zoom_to_mouse");
1903 g_sizer->Add(item_zoom_to_mouse);
1904
1905 auto item_use_free_camera = create_item_checkbox(_L("Use free camera"), _L("If enabled, use free camera. If not enabled, use constrained camera."), "use_free_camera");
1906 g_sizer->Add(item_use_free_camera);
1907
1908 auto reverse_mouse_zoom = create_item_checkbox(_L("Reverse mouse zoom"), _L("If enabled, reverses the direction of zoom with mouse wheel."), "reverse_mouse_wheel_zoom");
1909 g_sizer->Add(reverse_mouse_zoom);
1910
1911#ifdef SLIC3R_CAD
1912 // Design-tab only, so it stays out of the way while the CAD feature is switched off.
1913 if (wxGetApp().is_enable_cad_feature()) {
1914 auto item_connector_face_glyph = create_item_checkbox(_L("Draw mate connectors as a face"),
1915 _L("In the Design tab, draw a mate connector as a small face instead of the conventional "
1916 "disc with a roll quadrant. A face shows its orientation at a glance, without learning the disc convention. "
1917 "Turn this off for the conventional CAD representation."), "design_connector_face_glyph");
1918 g_sizer->Add(item_connector_face_glyph);
1919
1920 // Saved WITH each design (it decides which loops are closed, i.e. what solid a project
1921 // rebuilds into), so it applies to designs started from now on; an open design keeps
1922 // the rule it was made with.
1923 auto item_auto_close_sketch_loops = create_item_checkbox(_L("Auto-close sketch loops"),
1924 _L("Treat sketch endpoints within 0.001 mm as one joint and weld the loop shut. "
1925 "Off: only exactly coincident endpoints join, so a loop with a tiny gap is "
1926 "shown as open instead of being closed for you. Saved with each design; "
1927 "applies to designs started after the change."),
1928 "auto_close_sketch_loops");
1929 g_sizer->Add(item_auto_close_sketch_loops);
1930 }
1931#endif
1932
1933 std::vector<wxString> ButtonDragActions = {_L("None"), _L("Pan"), _L("Rotate")};
1934 auto item_left_mouse_drag = create_item_combobox(_L("Left Mouse Drag"), _L("Set the action that dragging the left mouse button should perform."), "left_mouse_drag_action", ButtonDragActions);
1935 g_sizer->Add(item_left_mouse_drag);
1936 auto item_middle_mouse_drag = create_item_combobox(_L("Middle Mouse Drag"), _L("Set the action that dragging the middle mouse button should perform."), "middle_mouse_drag_action", ButtonDragActions);
1937 g_sizer->Add(item_middle_mouse_drag);
1938 auto item_right_mouse_drag = create_item_combobox(_L("Right Mouse Drag"), _L("Set the action that dragging the right mouse button should perform."), "right_mouse_drag_action", ButtonDragActions);
1939 g_sizer->Add(item_right_mouse_drag);
1940
1942 g_sizer->Add(create_item_title(_L("Keyboard")), 1, wxEXPAND);
1943
1944 auto item_shortcuts = create_item_button(_L("Keyboard shortcuts"), _L("Edit") + dots, "", _L("Choose the key for each action."), [this]() {
1945 wxGetApp().keyboard_shortcuts(ShortcutContext::Global, this);
1946 });
1947 g_sizer->Add(item_shortcuts);
1948
1950 g_sizer->Add(create_item_title(_L("Clear my choice on...")), 1, wxEXPAND);
1951
1952 auto item_save_choise = create_item_button(_L("Unsaved projects"), _L("Clear"), "", _L("Clear my choice on the unsaved projects."), []() {
1953 wxGetApp().app_config->set("save_project_choise", "");
1954 });
1955 g_sizer->Add(item_save_choise);
1956
1957 auto item_save_presets = create_item_button(_L("Unsaved presets"), _L("Clear"), "", _L("Clear my choice on the unsaved presets."), []() {
1958 wxGetApp().app_config->set("save_preset_choise", "");
1959 });
1960 g_sizer->Add(item_save_presets);
1961
1962 auto item_restore_hide_pop_ups = create_item_button(_L("Synchronizing printer preset"), _L("Clear"), L"", _L("Clear my choice for synchronizing printer preset after loading the file."), []() {
1963 wxGetApp().app_config->erase("app", "sync_after_load_file_show_flag");
1964 });
1965 g_sizer->Add(item_restore_hide_pop_ups);
1966
1967 g_sizer->AddSpacer(FromDIP(10));
1968 sizer_page->Add(g_sizer, 0, wxEXPAND);
1969
1973 m_tab_index[PreferencesTab::Graphics] = m_pref_tabs->AppendItem(_L("Graphics"));
1974 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
1975 g_sizer = f_sizers.back();
1976 g_sizer->AddGrowableCol(0, 1);
1977
1979 g_sizer->Add(create_item_title(_L("General")), 1, wxEXPAND);
1980
1981 auto smooth_normals = create_item_checkbox(
1982 _L("Smooth normals"),
1983 _L("Applies smooth normals to the model.\n\nRequires manual scene reload to take effect "
1984 "(right-click on 3D view → \"Reload All\")."),
1986 );
1987 g_sizer->Add(smooth_normals);
1988
1990 g_sizer->Add(create_item_title(_L("Realistic View")), 1, wxEXPAND);
1991
1992 auto item_realistic_phong = create_item_checkbox(
1993 _L("Phong shading"),
1994 _L("Uses Phong shading inside realistic view.")
1996 );
1997 g_sizer->Add(item_realistic_phong);
1998
1999 auto item_realistic_preview = create_item_checkbox(
2000 _L("Enable in Preview"),
2001 _L("Also applies realistic view to the Preview canvas, not just Prepare.\n"
2002 "Preview draws the full toolpath geometry, so shadows and SSAO cost considerably"
2003 " more there than on a plain model."),
2005 );
2006 g_sizer->Add(item_realistic_preview);
2007
2008 auto item_realistic_ssao = create_item_checkbox(
2009 _L("SSAO ambient occlusion"),
2010 _L("Applies SSAO in realistic view."),
2012 );
2013 g_sizer->Add(item_realistic_ssao);
2014
2015 std::vector<wxString> ShadowsLabels = { _L("Off"),
2016 // TRN Realistic-view shadow mode: the light stays fixed in the scene.
2017 _L("Static"),
2018 // TRN Realistic-view shadow mode: the light turns with the camera.
2019 _L("Orbit") };
2020 std::vector<std::string> ShadowsValues = { "off", "static", "orbit" };
2021 auto item_realistic_shadows = create_item_combobox(
2022 _L("Shadows"),
2023 _L("Renders cast shadows on the plate, other objects, and each object onto itself in realistic view.\n"
2024 "Static: the light stays fixed in the world, so the shadows are only recomputed when the scene changes.\n"
2025 "Orbit: the light turns with the camera, recomputing the shadows every frame the camera moves."),
2026 SETTING_OPENGL_REALISTIC_SHADOWS, ShadowsLabels, ShadowsValues);
2027 g_sizer->Add(item_realistic_shadows);
2028
2029 auto item_realistic_gloss = create_item_checkbox(
2030 _L("Glossy toolpaths"),
2031 _L("Highlights the toolpaths in Preview as glossy plastic in realistic view.\n"
2032 "Off, a translucent filament is matte and an opaque one keeps the highlight of the plain view."),
2034 );
2035 g_sizer->Add(item_realistic_gloss);
2036
2038 g_sizer->Add(create_item_title(_L("Anti-aliasing")), 1, wxEXPAND);
2039
2040 auto item_antialiasing = create_item_combobox(
2041 _L("MSAA Multiplier"),
2042 _L("Set the Multi-Sample Anti-Aliasing level.\n"
2043 "Higher values result in smoother edges, but the impact on performance is exponential.\n"
2044 "Lower values improve performance, at the cost of jagged edges.\n"
2045 "If disabled, its recommended to enable FXAA to reduce jagged edges with minimal performance impact.\n\n"
2046 "Requires application restart."),
2048 {_L("Disabled"), "2x", "4x", "8x", "16x"},
2049 {"0", "2", "4", "8", "16"}
2050 );
2051 g_sizer->Add(item_antialiasing);
2052
2053 auto item_fxaa = create_item_checkbox(
2054 _L("FXAA post-processing"),
2055 _L("Applies Fast Approximate Anti-Aliasing as a screen-space pass.\n"
2056 "Useful for disabling or reducing the MSAA setting to improve performance.\n\n"
2057 "Takes effect immediately."),
2059 );
2060 g_sizer->Add(item_fxaa);
2061
2063 g_sizer->Add(create_item_title(_L("FPS")), 1, wxEXPAND);
2064
2065 auto item_fps_cap = create_item_spinctrl(
2066 _L("FPS cap"),
2067 _L("(0 = unlimited)"),
2068 _L("FPS"),
2069 _L("Limits viewport frame rate to reduce GPU load and power usage.\n"
2070 "Set to 0 for unlimited frame rate."),
2072 0,
2073 240
2074 );
2075 g_sizer->Add(item_fps_cap);
2076
2077 auto item_scene_cache = create_item_checkbox(
2078 _L("Reuse the 3D scene while idle"),
2079 _L("Skips redrawing the 3D scene when only the mouse cursor moves over the viewport,\n"
2080 "and reuses the previous frame's scene instead. Reduces GPU load.\n"
2081 "Disable it if the viewport shows stale or missing contents.\n\n"
2082 "Takes effect immediately."),
2084 );
2085 g_sizer->Add(item_scene_cache);
2086
2087 auto item_skip_identical_frames = create_item_checkbox(
2088 _L("Skip unchanged frames"),
2089 _L("Skips drawing a frame altogether when it would be identical to the one already on screen.\n"
2090 "Only applies to frames that reuse the 3D scene, so it needs Reuse the 3D scene while idle.\n"
2091 "Disable it if a hover highlight, tooltip or animation stops updating.\n\n"
2092 "Takes effect immediately."),
2094 );
2095 g_sizer->Add(item_skip_identical_frames);
2097
2098 auto item_fps_overlay = create_item_checkbox(
2099 _L("Show FPS overlay"),
2100 _L("Displays rendering counts in the top-right corner of the viewport.") + "\n" +
2101 _L("FPS: frames presented to the screen per second.") + "\n" +
2102 _L("3D: frames per second that redrew the 3D scene."),
2104 );
2105 g_sizer->Add(item_fps_overlay);
2106
2107 auto item_render_timings = create_item_checkbox(
2108 _L("Show render timings"),
2109 _L("Displays how many milliseconds each part of a frame that redraws the 3D scene takes, in the top-right corner of the viewport.") + "\n" +
2110 _L("CPU: time spent issuing the drawing commands.") + "\n" +
2111 _L("GPU: time the graphics card spent running them.") + "\n" +
2112 _L("Adds a small overhead to each frame while enabled."),
2114 );
2115 g_sizer->Add(item_render_timings);
2116
2117 if (wxGetApp().is_editor()) {
2118 auto item_benchmark = create_item_button(_L("3D scene benchmark"), _L("Run") + " " + dots, "",
2119 _L("Replaces the current project with the OrcaSliced Combo, then measures the frame rate and render timings while the camera turns around it in Prepare and Preview, and while the layer slider moves through the sliced layers."),
2120 [this]() {
2121 EndModal(wxID_OK);
2122 wxGetApp().CallAfter([] { run_scene_benchmark(); });
2123 });
2124 g_sizer->Add(item_benchmark);
2125 }
2126
2128 g_sizer->Add(create_item_title(_L("G-code Preview")), 1, wxEXPAND);
2129
2130 // ORCA: view type the preview opens with
2131 std::vector<wxString> PreviewViewTypeLabels;
2132 std::vector<std::string> PreviewViewTypeValues;
2133 for (const auto& [value, label] : GCodeViewer::default_view_type_choices()) {
2134 PreviewViewTypeValues.push_back(value);
2135 PreviewViewTypeLabels.push_back(from_u8(label));
2136 }
2137 auto item_preview_view_type = create_item_combobox(
2138 _L("Default view type"),
2139 _L("The color scheme the sliced preview opens with.\n"
2140 "Automatic: Filament for multi material prints, Line Type for single material ones.\n"
2141 "Last used: the view type you selected last.\n"
2142 "Any other value always opens that view type.\n"
2143 "You can still switch the view type in the preview afterwards."),
2144 "preview_default_view_type", PreviewViewTypeLabels, PreviewViewTypeValues);
2145 g_sizer->Add(item_preview_view_type);
2146
2147 auto item_dim_previous_layers = create_item_checkbox(
2148 _L("Dim lower layers"),
2149 _L("When scrubbing the layer slider in the sliced preview, render the layers below the current one darkened so that only the layer being viewed is shown at full brightness."),
2150 "preview_dim_previous_layers"
2151 );
2152 g_sizer->Add(item_dim_previous_layers);
2153
2154 auto item_dim_previous_layers_brightness = create_item_spinctrl(
2155 _L("Dimmed layer brightness"),
2156 "",
2157 _L("%"),
2158 _L("How brightly the dimmed layers are rendered when \"Dim lower layers\" is enabled.\n"
2159 "99% is barely darkened, 0% renders them black. Capped at 99% because 100% would be the same as disabling the option."),
2160 "preview_dim_previous_layers_brightness",
2161 0,
2162 99,
2163 // ORCA: apply the new brightness immediately to the currently loaded preview
2164 [](int value) {
2165 if (Plater* plater = wxGetApp().plater()) {
2166 if (GLCanvas3D* canvas = plater->get_preview_canvas3D()) {
2167 canvas->get_gcode_viewer().set_dim_previous_layers_brightness(0.01f * value);
2168 canvas->set_as_dirty();
2169 canvas->request_extra_frame();
2170 }
2171 }
2172 }
2173 );
2174 g_sizer->Add(item_dim_previous_layers_brightness);
2175
2176 auto item_translucent_filaments = create_item_checkbox(
2177 _L("Translucent filaments"),
2178 _L("Draw the toolpaths of filaments whose color is partly transparent as see-through, as the 3D view draws their objects. Turn it off to draw every filament opaque."),
2179 "preview_translucent_filaments"
2180 );
2181 g_sizer->Add(item_translucent_filaments);
2182
2183 g_sizer->AddSpacer(FromDIP(10));
2184 sizer_page->Add(g_sizer, 0, wxEXPAND);
2185
2189 m_tab_index[PreferencesTab::Online] = m_pref_tabs->AppendItem(_L("Online"));
2190 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
2191 g_sizer = f_sizers.back();
2192 g_sizer->AddGrowableCol(0, 1);
2193
2195 g_sizer->Add(create_item_title(_L("Connection")), 1, wxEXPAND);
2196
2197 auto item_region = create_item_region_combobox(_L("Login region"), "");
2198 g_sizer->Add(item_region);
2199
2200 auto item_stealth_mode = create_item_checkbox(_L("Stealth mode"), _L("This disables all cloud features, including Orca Cloud profile syncing. Users who prefer to work entirely offline can enable this option.\nNote: When Stealth Mode is enabled, your user profiles will not be backed up to Orca Cloud."), "stealth_mode");
2201 g_sizer->Add(item_stealth_mode);
2202
2203 auto item_hide_login_side_panel = create_item_checkbox(_L("Hide login side panel"), _L("Hide the login side panel on the home page."), "hide_login_side_panel");
2204 g_sizer->Add(item_hide_login_side_panel);
2205
2206 auto item_network_test = create_item_button(_L("Network test"), _L("Test") + " " + dots, "", _L("Open Network Test"), []() {
2207 NetworkTestDialog dlg(wxGetApp().mainframe);
2208 dlg.ShowModal();
2209 });
2210 g_sizer->Add(item_network_test);
2211
2213 g_sizer->Add(create_item_title(_L("Cloud Providers")), 1, wxEXPAND);
2214
2215 auto item_bambu_cloud = create_item_bambu_cloud(_L("Enable Bambu Cloud"), _L("Allow logging into Bambu Cloud alongside Orca Cloud. When enabled, a Bambu login section appears on the homepage."));
2216 g_sizer->Add(item_bambu_cloud);
2217
2219 g_sizer->Add(create_item_title(_L("Update & sync")), 1, wxEXPAND);
2220
2221 auto item_stable_updates = create_item_checkbox(_L("Check for stable updates only"), "", "check_stable_update_only");
2222 g_sizer->Add(item_stable_updates);
2223
2224 auto item_user_sync = create_item_checkbox(_L("Auto sync user presets (Printer/Filament/Process)"), "", "sync_user_preset");
2225 g_sizer->Add(item_user_sync);
2226
2227 if (app_config->get_stealth_mode()) {
2230 }
2231
2232 auto item_filament_sync_mode = create_item_combobox(
2233 _L("Filament sync mode"),
2234 _L("Choose whether sync updates both filament preset and color, or only color."),
2235 "sync_ams_filament_mode",
2236 {_L("Filament & Color"), _L("Color only")});
2237 g_sizer->Add(item_filament_sync_mode);
2238
2239 auto item_system_sync = create_item_checkbox(_L("Update built-in presets automatically."), "", "sync_system_preset");
2240 g_sizer->Add(item_system_sync);
2241
2242 auto item_token_storage = create_item_checkbox(_L("Use encrypted file for token storage"),
2243 _L("Store authentication tokens in an encrypted file instead of the system keychain. (Requires restart)"),
2245 g_sizer->Add(item_token_storage);
2246
2248 g_sizer->Add(create_item_title(_L("Bambu network plug-in")), 1, wxEXPAND);
2249
2250 auto item_enable_plugin = create_item_checkbox(_L("Enable Bambu network plug-in"), "", "installed_networking");
2251 g_sizer->Add(item_enable_plugin);
2252
2253 auto item_plugin_version = create_item_network_plugin_version(_L("Network plug-in version"), _L("Select the network plug-in version to use"));
2254 g_sizer->Add(item_plugin_version);
2255
2256 g_sizer->AddSpacer(FromDIP(10));
2257 sizer_page->Add(g_sizer, 0, wxEXPAND);
2258
2262#ifdef _WIN32
2263 // MSIX: associations are declared in the package manifest and defaults are
2264 // managed by Windows Settings; the runtime registry toggles below cannot work.
2265 // Show a minimal page that sends the user to Windows' Default Apps settings instead.
2266 if (is_running_in_msix()) {
2267 m_pref_tabs->AppendItem(_L("Associate"));
2268 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
2269 g_sizer = f_sizers.back();
2270 g_sizer->AddGrowableCol(0, 1);
2271
2272 g_sizer->Add(create_item_title(_L("Associate files to OrcaSlicer")), 1, wxEXPAND);
2273
2274 auto item_open_default_apps = create_item_button(
2275 _L("File associations for the Microsoft Store version are managed by Windows Settings."),
2276 _L("Open Windows Default Apps Settings"), "", "",
2277 []() { wxLaunchDefaultBrowser("ms-settings:defaultapps"); });
2278 g_sizer->Add(item_open_default_apps);
2279
2280 g_sizer->AddSpacer(FromDIP(10));
2281 sizer_page->Add(g_sizer, 0, wxEXPAND);
2282 } else {
2283 m_pref_tabs->AppendItem(_L("Associate"));
2284 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
2285 g_sizer = f_sizers.back();
2286 g_sizer->AddGrowableCol(0, 1);
2287
2289 g_sizer->Add(create_item_title(_L("Associate files to OrcaSlicer")), 1, wxEXPAND);
2290
2291 auto item_associate_3mf = create_item_checkbox(_L("Associate 3MF files to OrcaSlicer"), _L("If enabled, this sets OrcaSlicer as the default application to open 3MF files.") , "associate_3mf");
2292 g_sizer->Add(item_associate_3mf);
2293
2294 auto item_associate_drc = create_item_checkbox(_L("Associate DRC files to OrcaSlicer"), _L("If enabled, sets OrcaSlicer as default application to open DRC files."), "associate_drc");
2295 g_sizer->Add(item_associate_drc);
2296
2297 auto item_associate_stl = create_item_checkbox(_L("Associate STL files to OrcaSlicer"), _L("If enabled, this sets OrcaSlicer as the default application to open STL files.") , "associate_stl");
2298 g_sizer->Add(item_associate_stl);
2299
2300 auto item_associate_step = create_item_checkbox(_L("Associate STEP files to OrcaSlicer"), _L("If enabled, this sets OrcaSlicer as the default application to open STEP files."), "associate_step");
2301 g_sizer->Add(item_associate_step);
2302
2304 g_sizer->Add(create_item_title(_L("Associate web links to OrcaSlicer")), 1, wxEXPAND);
2305
2306 auto associate_url_prusa = create_item_link_association(L"prusaslicer", "Printables.com");
2307 g_sizer->Add(associate_url_prusa);
2308
2309 auto associate_url_bambu = create_item_link_association(L"bambustudio", "Makerworld.com");
2310 g_sizer->Add(associate_url_bambu);
2311
2312 auto associate_url_cura = create_item_link_association(L"cura", "Thingiverse.com");
2313 g_sizer->Add(associate_url_cura);
2314
2315 g_sizer->AddSpacer(FromDIP(10));
2316 sizer_page->Add(g_sizer, 0, wxEXPAND);
2317 }
2318#endif // _WIN32
2319
2323 m_pref_tabs->AppendItem(_L("Developer"));
2324 f_sizers.push_back(new wxFlexGridSizer(1, 1, v_gap, 0));
2325 g_sizer = f_sizers.back();
2326 g_sizer->AddGrowableCol(0, 1);
2327
2329 g_sizer->Add(create_item_title(_L("Settings")), 1, wxEXPAND);
2330
2331 auto item_develop_mode = create_item_checkbox(_L("Developer mode"), "", "developer_mode", wxEmptyString, "option_mode#developer+mode");
2332 g_sizer->Add(item_develop_mode);
2333
2334 auto item_ams_blacklist = create_item_checkbox(_L("Skip AMS blacklist check"), "", "skip_ams_blacklist_check");
2335 g_sizer->Add(item_ams_blacklist);
2336
2337 auto item_show_unsupported = create_item_checkbox(_L("Show unsupported presets"), _L("Show incompatible/unsupported presets in the printer and filament dropdown lists. These presets cannot be selected."), "show_unsupported_presets");
2338 g_sizer->Add(item_show_unsupported);
2339
2340 auto item_export_statistics = create_item_checkbox(_L("Export statistics with G-code"),
2341 _L("If enabled, exporting a G-code file also writes its statistics as JSON next to it, as <name>.statistics.json, "
2342 "and an exported sliced 3MF file holds them inside: print time, filament and feature totals, "
2343 "and the same per layer and per object."),
2344 "export_statistics");
2345 g_sizer->Add(item_export_statistics);
2346
2348 g_sizer->Add(create_item_title(_L("Experimental Features")), 1, wxEXPAND);
2349
2350 auto item_keep_painting = create_item_checkbox(_L("Keep painted feature after mesh change"), _L("Attempt to keep painted features (color/seam/support/fuzzy etc.) after changing the object mesh (such as cut/reload from disk/simplify/fix etc.)\nHighly experimental! Slow and may create artifact."), "keep_painting");
2351 g_sizer->Add(item_keep_painting);
2352
2353 auto item_plugin_printer_agents = create_item_checkbox(
2354 _L("Use printer agents instead of print hosts"), _L(
2355 "Route print jobs for non-Bambu printers through printer plug-in agents instead of the classic print-host upload flow.\nWhen disabled, OrcaSlicer uses the legacy print-host behavior."),
2356 "use_printer_agents");
2357 g_sizer->Add(item_plugin_printer_agents);
2358
2360
2361 g_sizer->Add(create_item_title(_L("Storage")), 1, wxEXPAND);
2362 auto item_allow_abnormal_storage = create_item_checkbox(_L("Allow Abnormal Storage"), _L("This allows the use of Storage that is marked as abnormal by the Printer.\nUse at your own risk, can cause issues!"), "allow_abnormal_storage");
2363 g_sizer->Add(item_allow_abnormal_storage);
2364
2366 g_sizer->Add(create_item_title(_L("Log Level")), 1, wxEXPAND);
2367 auto log_level_list = std::vector<wxString>{_L("fatal"), _L("error"), _L("warning"), _L("info"), _L("debug"), _L("trace")};
2368 auto loglevel_combox = create_item_loglevel_combobox(_L("Log Level"), _L("Log Level"), log_level_list);
2369 g_sizer->Add(loglevel_combox);
2370
2372#if !BBL_RELEASE_TO_PUBLIC
2373 g_sizer->Add(create_item_title(_L("Debug")), 1, wxEXPAND);
2374 auto debug_page = create_debug_page();
2375 g_sizer->Add(debug_page, 1, wxEXPAND);
2376#endif
2377
2378 g_sizer->AddSpacer(FromDIP(10));
2379 sizer_page->Add(g_sizer, 0, wxEXPAND);
2380
2383
2384 g_sizer = nullptr;
2385
2386 // Hide all tabs instead first one
2387 for (size_t i = 1; i < f_sizers.size(); ++i)
2388 f_sizers[i]->Show(false);
2389
2392
2393 m_parent->SetSizer(sizer_page);
2394 m_parent->Layout();
2395 sizer_page->Fit(m_parent);
2396}
#define OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK
Definition AppConfig.hpp:25
#define SETTING_OPENGL_PHONG_SSAO
Definition AppConfig.hpp:47
#define OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_ALL
Definition AppConfig.hpp:23
#define SETTING_OPENGL_FXAA_ENABLED
Definition AppConfig.hpp:35
#define SETTING_SPEED_DIAL_RECENT_COUNT
Definition AppConfig.hpp:57
#define SETTING_OPENGL_SHOW_RENDER_TIMINGS
Definition AppConfig.hpp:40
#define SPEED_DIAL_RECENT_COUNT_MIN
Definition AppConfig.hpp:58
#define SETTING_USE_ENCRYPTED_TOKEN_FILE
Definition AppConfig.hpp:32
#define SETTING_OPENGL_REALISTIC_SHADOWS
Definition AppConfig.hpp:46
#define SETTING_PLUGIN_PAGES_VISIBLE_COUNT
Definition AppConfig.hpp:52
#define SETTING_OPENGL_PHONG_SMOOTH_NORMALS
Definition AppConfig.hpp:48
#define SETTING_OPENGL_REALISTIC_PREVIEW
Definition AppConfig.hpp:49
#define PLUGIN_PAGES_VISIBLE_COUNT_MAX
Definition AppConfig.hpp:55
#define SPEED_DIAL_RECENT_COUNT_MAX
Definition AppConfig.hpp:60
#define OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT
Definition AppConfig.hpp:24
#define SETTING_OPENGL_AA_SAMPLES
Definition AppConfig.hpp:34
#define SETTING_OPENGL_FPS_CAP
Definition AppConfig.hpp:36
#define PLUGIN_PAGES_VISIBLE_COUNT_MIN
Definition AppConfig.hpp:53
#define SETTING_PROJECT_LOAD_BEHAVIOUR
Definition AppConfig.hpp:22
#define OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY
Definition AppConfig.hpp:26
#define SETTING_OPENGL_SHOW_FPS_OVERLAY
Definition AppConfig.hpp:39
#define SETTING_OPENGL_REALISTIC_GLOSS
Definition AppConfig.hpp:50
#define SETTING_OPENGL_REALISTIC_PHONG
Definition AppConfig.hpp:42
#define DRC_BITS_MIN
Definition DRC.hpp:6
#define DRC_BITS_MAX
Definition DRC.hpp:7
static std::vector< std::pair< std::string, std::string > > default_view_type_choices()
Definition GCodeViewer.cpp:1256
wxBoxSizer * create_item_backup(wxString title, wxString tooltip)
Definition Preferences.cpp:877
wxBoxSizer * create_debug_page()
Definition Preferences.cpp:2418
wxBoxSizer * create_item_spinctrl(wxString title, wxString title2, wxString side_label, wxString tooltip, std::string param, int min, int max, std::function< void(int)> onchange=nullptr, const wxString wiki_url="")
Definition Preferences.cpp:736
wxBoxSizer * create_camera_orbit_mult_input(wxString title, wxString tooltip)
Definition Preferences.cpp:787
wxBoxSizer * create_item_language_combobox(wxString title, wxString tooltip)
Definition Preferences.cpp:398
wxBoxSizer * create_item_downloads(wxString title, wxString tooltip)
Definition Preferences.cpp:1261
wxBoxSizer * create_item_input(wxString title, wxString title2, wxString tooltip, std::string param, std::function< void(wxString)> onchange={}, const wxString wiki_url="")
Definition Preferences.cpp:695
wxBoxSizer * create_item_loglevel_combobox(wxString title, wxString tooltip, std::vector< wxString > vlist)
Definition Preferences.cpp:667
wxBoxSizer * create_item_combobox(wxString title, wxString tooltip, std::string param, std::vector< wxString > vlist, std::function< void(wxString)> onchange={}, const wxString wiki_url="")
Definition Preferences.cpp:352
std::map< PreferencesTab, int > m_tab_index
Definition Preferences.hpp:51
wxBoxSizer * create_item_auto_reslice(wxString title, wxString checkbox_tooltip, wxString delay_tooltip)
Definition Preferences.cpp:942
wxBoxSizer * create_item_bambu_cloud(wxString title, wxString tooltip)
Definition Preferences.cpp:1297
wxBoxSizer * create_item_darkmode(wxString title, wxString tooltip, std::string param)
Definition Preferences.cpp:1001
void UpdateSidebarLayout()
Definition Preferences.cpp:2545
wxBoxSizer * create_item_button(wxString title, wxString title2, wxString tooltip, wxString tooltip2, std::function< void()> onclick, const wxString wiki_url="")
Definition Preferences.cpp:1244
wxTimer m_filament_height_timer
Definition Preferences.hpp:77
wxBoxSizer * create_item_decimal_input(wxString title, wxString title2, wxString tooltip, std::string param, double min, double max, int decimals, const wxString wiki_url="")
Definition Preferences.cpp:836
wxBoxSizer * create_item_network_plugin_version(wxString title, wxString tooltip)
Definition Preferences.cpp:1325
wxBoxSizer * create_item_region_combobox(wxString title, wxString tooltip)
Definition Preferences.cpp:587
@ General
Definition Preferences.hpp:40
@ Online
Definition Preferences.hpp:40
@ Control
Definition Preferences.hpp:40
@ Graphics
Definition Preferences.hpp:40
bool is_running_in_msix()
Definition GUI_Utils.cpp:197
void run_scene_benchmark()
Definition SceneBenchmark.cpp:547
@ Global
Definition Shortcuts.hpp:21
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References _L, app_config, Slic3r::GUI::Control, create_camera_orbit_mult_input(), create_debug_page(), create_item_auto_reslice(), create_item_backup(), create_item_bambu_cloud(), create_item_button(), create_item_checkbox(), create_item_combobox(), create_item_darkmode(), create_item_decimal_input(), create_item_downloads(), create_item_input(), create_item_language_combobox(), create_item_loglevel_combobox(), create_item_network_plugin_version(), create_item_region_combobox(), create_item_spinctrl(), create_item_title(), Slic3r::GUI::GCodeViewer::default_view_type_choices(), Slic3r::GUI::dots(), DRC_BITS_MAX, DRC_BITS_MIN, Slic3r::GUI::DPIDialog::EndModal(), f_sizers, Slic3r::GUI::from_u8(), Slic3r::GUI::General, Slic3r::GUI::Global, Slic3r::GUI::Graphics, Slic3r::GUI::is_running_in_msix(), L, m_bambu_cloud_checkbox, m_filament_height_timer, m_parent, m_pref_tabs, m_skip_identical_frames_checkbox, m_sync_user_preset_checkbox, m_tab_index, Slic3r::GUI::Online, OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK, OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT, OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_ALL, OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY, Slic3r::GUI::plater(), PLUGIN_PAGES_VISIBLE_COUNT_MAX, PLUGIN_PAGES_VISIBLE_COUNT_MIN, Slic3r::GUI::run_scene_benchmark(), SETTING_OPENGL_AA_SAMPLES, SETTING_OPENGL_FPS_CAP, SETTING_OPENGL_FXAA_ENABLED, SETTING_OPENGL_PHONG_SMOOTH_NORMALS, SETTING_OPENGL_PHONG_SSAO, SETTING_OPENGL_REALISTIC_GLOSS, SETTING_OPENGL_REALISTIC_PHONG, SETTING_OPENGL_REALISTIC_PREVIEW, SETTING_OPENGL_REALISTIC_SHADOWS, SETTING_OPENGL_SCENE_CACHE, SETTING_OPENGL_SHOW_FPS_OVERLAY, SETTING_OPENGL_SHOW_RENDER_TIMINGS, SETTING_OPENGL_SKIP_IDENTICAL_FRAMES, SETTING_PLUGIN_PAGES_VISIBLE_COUNT, SETTING_PROJECT_LOAD_BEHAVIOUR, SETTING_SPEED_DIAL_RECENT_COUNT, SETTING_USE_ENCRYPTED_TOKEN_FILE, Slic3r::GUI::DPIAware< P >::ShowModal(), SPEED_DIAL_RECENT_COUNT_MAX, SPEED_DIAL_RECENT_COUNT_MIN, Slic3r::Preset::TYPE_FILAMENT, and UpdateSidebarLayout().

Referenced by create().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_select_domain_widget()

void Slic3r::GUI::PreferencesDialog::create_select_domain_widget ( )

◆ create_sync_page()

void Slic3r::GUI::PreferencesDialog::create_sync_page ( )
2399{
2400 auto page = new wxWindow(this, wxID_ANY);
2401 wxBoxSizer *sizer_page = new wxBoxSizer(wxVERTICAL);
2402
2403 auto title_sync_settingy = create_item_title(_L("Sync settings"));
2404 auto item_user_sync = create_item_checkbox(_L("User sync"), _L("User sync"), "user_sync_switch");
2405 auto item_preset_sync = create_item_checkbox(_L("Preset sync"), _L("Preset sync"), "preset_sync_switch");
2406 auto item_preferences_sync = create_item_checkbox(_L("Preferences sync"), _L("Preferences sync"), "preferences_sync_switch");
2407
2408 sizer_page->Add(title_sync_settingy, 0, wxTOP, 26);
2409 sizer_page->Add(item_user_sync, 0, wxTOP, 6);
2410 sizer_page->Add(item_preset_sync, 0, wxTOP, 6);
2411 sizer_page->Add(item_preferences_sync, 0, wxTOP, 6);
2412
2413 page->SetSizer(sizer_page);
2414 page->Layout();
2415 sizer_page->Fit(page);
2416}

References _L, create_item_checkbox(), and create_item_title().

Here is the call graph for this function:

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ normal_font()

◆ on_dpi_changed()

void Slic3r::GUI::PreferencesDialog::on_dpi_changed ( const wxRect & suggested_rect)
overridevirtual

Implements Slic3r::GUI::DPIAware< wxDialog >.

1600 {
1601 m_pref_tabs->Rescale();
1602
1603 int sel = m_pref_tabs->GetSelection();
1604 for (size_t i = 0; i < m_pref_tabs->GetCount(); ++i)
1605 f_sizers[i]->Show(true);
1606
1607 std::function<void(wxWindow*, int)> WalkControls;
1608 WalkControls = [&](wxWindow* parent, int depth) -> void {
1609 if (!parent) return;
1610
1611 for (auto* child : parent->GetChildren()) {
1612 if (!child)
1613 continue;
1614 else if (auto* btn = dynamic_cast<Button*>(child))
1615 btn->Rescale();
1616 else if (auto* chk = dynamic_cast<CheckBox*>(child))
1617 chk->msw_rescale();
1618 else if (auto* txt = dynamic_cast<TextInput*>(child))
1619 txt->Rescale();
1620 else if (auto* cmb = dynamic_cast<ComboBox*>(child))
1621 cmb->Rescale();
1622 else if (auto* spn = dynamic_cast<SpinInput*>(child))
1623 spn->Rescale();
1624 else if (auto* lbl = dynamic_cast<WikiLabel*>(child)){
1625 lbl->SetSize(DESIGN_TITLE_SIZE);
1626 lbl->Rescale();
1627 }
1628
1629 WalkControls(child, depth + 1);
1630 }
1631 };
1632 WalkControls(this, 0);
1633
1634 wxCommandEvent event(wxEVT_TAB_SEL_CHANGED, m_pref_tabs->GetId());
1635 event.SetInt(sel);
1636 event.SetEventObject(m_pref_tabs);
1637 m_pref_tabs->GetEventHandler()->ProcessEvent(event);
1638
1639 Refresh();
1640}

References DESIGN_TITLE_SIZE, f_sizers, and m_pref_tabs.

◆ on_sys_color_changed()

◆ pending_language()

const std::string & Slic3r::GUI::PreferencesDialog::pending_language ( ) const
inline
61{ return m_pending_language; }

References m_pending_language.

Referenced by Slic3r::GUI::GUI_App::open_preferences().

Here is the caller graph for this function:

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ recreate_GUI()

bool Slic3r::GUI::PreferencesDialog::recreate_GUI ( ) const
inline
60{ return m_recreate_GUI; }

References m_recreate_GUI.

Referenced by Slic3r::GUI::GUI_App::open_preferences().

Here is the caller graph for this function:

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ select_tab()

void Slic3r::GUI::PreferencesDialog::select_tab ( PreferencesTab tab,
const std::string & option = {} )
1588{
1589 if (const auto index = m_tab_index.find(tab); index != m_tab_index.end())
1590 m_pref_tabs->SelectItem(index->second);
1591 wxWindow* control = option.empty() ? nullptr : m_parent->FindWindow(wxString(option));
1592 if (control == nullptr)
1593 return;
1594 int unit = 1;
1595 m_parent->GetScrollPixelsPerUnit(nullptr, &unit);
1596 m_parent->Scroll(wxDefaultCoord, (m_parent->CalcUnscrolledPosition(control->GetPosition()).y - FromDIP(10)) / unit);
1597 control->SetFocus(); // the focused tint marks the row
1598}

References m_parent, m_pref_tabs, and m_tab_index.

Referenced by Slic3r::GUI::GUI_App::open_preferences().

Here is the caller graph for this function:

◆ seq_top_layer_only_changed()

bool Slic3r::GUI::PreferencesDialog::seq_top_layer_only_changed ( ) const
inline
bool m_seq_top_layer_only_changed
Definition Preferences.hpp:54

References m_seq_top_layer_only_changed.

Referenced by Slic3r::GUI::GUI_App::open_preferences().

Here is the caller graph for this function:

◆ set_dark_mode()

void Slic3r::GUI::PreferencesDialog::set_dark_mode ( )
1036{
1037#ifdef __WINDOWS__
1038#ifdef _MSW_DARK_MODE
1039 NppDarkMode::SetDarkExplorerTheme(this->GetHWND());
1040 NppDarkMode::SetDarkTitleBar(this->GetHWND());
1041 wxGetApp().UpdateDlgDarkUI(this);
1042 SetActiveWindow(wxGetApp().mainframe->GetHWND());
1043 SetActiveWindow(GetHWND());
1044#endif
1045#endif
1046}
void SetDarkTitleBar(HWND hwnd)
Definition dark_mode.cpp:357
void SetDarkExplorerTheme(HWND hwnd)
Definition dark_mode.cpp:367

References NppDarkMode::SetDarkExplorerTheme(), and NppDarkMode::SetDarkTitleBar().

Referenced by create_item_darkmode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ ShowModal()

◆ Split()

void Slic3r::GUI::PreferencesDialog::Split ( const std::string & src,
const std::string & separator,
std::vector< wxString > & dest )
1643{
1644 std::string str = src;
1645 std::string substring;
1646 std::string::size_type start = 0, index;
1647 dest.clear();
1648 index = str.find_first_of(separator, start);
1649 do {
1650 if (index != std::string::npos) {
1651 substring = str.substr(start, index - start);
1652 dest.push_back(substring);
1653 start = index + separator.size();
1654 index = str.find(separator, start);
1655 if (start == std::string::npos) break;
1656 }
1657 } while (index != std::string::npos);
1658
1659 substring = str.substr(start);
1660 dest.push_back(substring);
1661}

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

◆ UpdateSidebarLayout()

void Slic3r::GUI::PreferencesDialog::UpdateSidebarLayout ( )
2546{
2547 Plater* plater = wxGetApp().plater();
2548 if (!plater) return;
2549
2550 Sidebar& sidebar = plater->sidebar();
2551
2552 sidebar.Freeze();
2553
2554 sidebar.Layout();
2555 //plater->Layout();
2556 //wxGetApp().mainframe->Layout();
2557
2558 sidebar.Thaw();
2559
2560 plater->PostSizeEvent();
2561}
Sidebar & sidebar()
Definition Plater.cpp:16046

References Slic3r::GUI::plater().

Referenced by create_items().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ app_config

◆ f_sizers

std::vector<wxFlexGridSizer*> Slic3r::GUI::PreferencesDialog::f_sizers

◆ m_available_versions

std::vector<NetworkLibraryVersionInfo> Slic3r::GUI::PreferencesDialog::m_available_versions

◆ m_backup_interval_def

wxString Slic3r::GUI::PreferencesDialog::m_backup_interval_def

Referenced by create_debug_page().

◆ m_backup_interval_textinput

::TextInput* Slic3r::GUI::PreferencesDialog::m_backup_interval_textinput = {nullptr}
88{nullptr};

Referenced by create_debug_page(), and create_item_backup().

◆ m_backup_interval_time

wxString Slic3r::GUI::PreferencesDialog::m_backup_interval_time

◆ m_bambu_cloud_checkbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_bambu_cloud_checkbox = {nullptr}

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_current_language_selected

int Slic3r::GUI::PreferencesDialog::m_current_language_selected = {0}
134{0};

Referenced by create_item_language_combobox().

◆ m_dark_mode_ckeckbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_dark_mode_ckeckbox = {nullptr}
84{nullptr};

Referenced by create_item_darkmode().

◆ m_developer_mode_ckeckbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_developer_mode_ckeckbox = {nullptr}
82{nullptr};

Referenced by create_item_checkbox().

◆ m_developer_mode_def

wxString Slic3r::GUI::PreferencesDialog::m_developer_mode_def

Referenced by create_item_checkbox().

◆ m_dim_previous_layers_brightness_input

::SpinInput* Slic3r::GUI::PreferencesDialog::m_dim_previous_layers_brightness_input = {nullptr}
89{nullptr};

Referenced by create_item_checkbox(), and create_item_spinctrl().

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_filament_height_timer

wxTimer Slic3r::GUI::PreferencesDialog::m_filament_height_timer

Referenced by create_items().

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_internal_developer_mode_ckeckbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_internal_developer_mode_ckeckbox = {nullptr}
83{nullptr};

Referenced by create_item_checkbox().

◆ m_internal_developer_mode_def

wxString Slic3r::GUI::PreferencesDialog::m_internal_developer_mode_def

◆ m_iot_environment_def

wxString Slic3r::GUI::PreferencesDialog::m_iot_environment_def

Referenced by create_debug_page().

◆ m_network_version_combo

::ComboBox* Slic3r::GUI::PreferencesDialog::m_network_version_combo = {nullptr}
90{nullptr};

Referenced by create_item_network_plugin_version().

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_parent

◆ m_pending_language

std::string Slic3r::GUI::PreferencesDialog::m_pending_language
protected

◆ m_pref_tabs

TabCtrl* Slic3r::GUI::PreferencesDialog::m_pref_tabs
protected

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_recreate_GUI

bool Slic3r::GUI::PreferencesDialog::m_recreate_GUI {false}
protected
55{false};

Referenced by create_item_language_combobox(), and recreate_GUI().

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_seq_top_layer_only_changed

bool Slic3r::GUI::PreferencesDialog::m_seq_top_layer_only_changed {false}
protected
54{false};

Referenced by seq_top_layer_only_changed().

◆ m_sizer_body

wxBoxSizer* Slic3r::GUI::PreferencesDialog::m_sizer_body
protected

Referenced by create().

◆ m_skip_identical_frames_checkbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_skip_identical_frames_checkbox = {nullptr}
87{nullptr};

Referenced by create_item_checkbox(), and create_items().

◆ m_sync_user_preset_checkbox

::CheckBox* Slic3r::GUI::PreferencesDialog::m_sync_user_preset_checkbox = {nullptr}
85{nullptr};

Referenced by create_item_checkbox(), and create_items().

◆ m_tab_index

std::map<PreferencesTab, int> Slic3r::GUI::PreferencesDialog::m_tab_index
protected

Referenced by create_items(), and select_tab().


The documentation for this class was generated from the following files: