mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 01:07:57 -06:00
Implement #8106: Add setting to prevent loading printer information/project settings from .3mf (#8268)
* Initial implementation * Add remember option to open project/load geometry only popup * PR Feedback
This commit is contained in:
parent
d1161ea0e7
commit
cc92abf8b5
5 changed files with 133 additions and 49 deletions
|
@ -114,11 +114,6 @@ void AppConfig::set_defaults()
|
||||||
set_bool("background_processing", false);
|
set_bool("background_processing", false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef SUPPORT_SHOW_DROP_PROJECT
|
|
||||||
if (get("show_drop_project_dialog").empty())
|
|
||||||
set_bool("show_drop_project_dialog", true);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (get("drop_project_action").empty())
|
if (get("drop_project_action").empty())
|
||||||
set_bool("drop_project_action", true);
|
set_bool("drop_project_action", true);
|
||||||
|
|
||||||
|
@ -348,6 +343,10 @@ void AppConfig::set_defaults()
|
||||||
set("mouse_wheel", "0");
|
set("mouse_wheel", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (get(SETTING_PROJECT_LOAD_BEHAVIOUR).empty()) {
|
||||||
|
set(SETTING_PROJECT_LOAD_BEHAVIOUR, OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT);
|
||||||
|
}
|
||||||
|
|
||||||
if (get("max_recent_count").empty()) {
|
if (get("max_recent_count").empty()) {
|
||||||
set("max_recent_count", "18");
|
set("max_recent_count", "18");
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,6 +18,12 @@ using namespace nlohmann;
|
||||||
#define ENV_PRE_HOST "2"
|
#define ENV_PRE_HOST "2"
|
||||||
#define ENV_PRODUCT_HOST "3"
|
#define ENV_PRODUCT_HOST "3"
|
||||||
|
|
||||||
|
#define SETTING_PROJECT_LOAD_BEHAVIOUR "project_load_behaviour"
|
||||||
|
#define OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_ALL "load_all"
|
||||||
|
#define OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT "ask_when_relevant"
|
||||||
|
#define OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK "always_ask"
|
||||||
|
#define OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY "load_geometry_only"
|
||||||
|
|
||||||
#define SUPPORT_DARK_MODE
|
#define SUPPORT_DARK_MODE
|
||||||
//#define _MSW_DARK_MODE
|
//#define _MSW_DARK_MODE
|
||||||
|
|
||||||
|
|
|
@ -8926,7 +8926,7 @@ int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_
|
||||||
return wxID_YES;
|
return wxID_YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadType determine_load_type(std::string filename, std::string override_setting = "");
|
||||||
|
|
||||||
// BBS: FIXME, missing resotre logic
|
// BBS: FIXME, missing resotre logic
|
||||||
void Plater::load_project(wxString const& filename2,
|
void Plater::load_project(wxString const& filename2,
|
||||||
|
@ -8978,8 +8978,16 @@ void Plater::load_project(wxString const& filename2,
|
||||||
auto strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig;
|
auto strategy = LoadStrategy::LoadModel | LoadStrategy::LoadConfig;
|
||||||
if (originfile == "<silence>") {
|
if (originfile == "<silence>") {
|
||||||
strategy = strategy | LoadStrategy::Silence;
|
strategy = strategy | LoadStrategy::Silence;
|
||||||
|
} else if (originfile == "<loadall>") {
|
||||||
|
// Do nothing
|
||||||
} else if (originfile != "-") {
|
} else if (originfile != "-") {
|
||||||
strategy = strategy | LoadStrategy::Restore;
|
strategy = strategy | LoadStrategy::Restore;
|
||||||
|
} else {
|
||||||
|
switch (determine_load_type(filename.ToStdString())) {
|
||||||
|
case LoadType::OpenProject: break; // Do nothing
|
||||||
|
case LoadType::LoadGeometry:; strategy = LoadStrategy::LoadModel; break;
|
||||||
|
default: return; // User cancelled
|
||||||
|
}
|
||||||
}
|
}
|
||||||
bool load_restore = strategy & LoadStrategy::Restore;
|
bool load_restore = strategy & LoadStrategy::Restore;
|
||||||
|
|
||||||
|
@ -10441,7 +10449,7 @@ private:
|
||||||
wxColour m_def_color = wxColour(255, 255, 255);
|
wxColour m_def_color = wxColour(255, 255, 255);
|
||||||
RadioSelectorList m_radio_group;
|
RadioSelectorList m_radio_group;
|
||||||
int m_action{1};
|
int m_action{1};
|
||||||
bool m_show_again;
|
bool m_remember_choice{false};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ProjectDropDialog(const std::string &filename);
|
ProjectDropDialog(const std::string &filename);
|
||||||
|
@ -10464,7 +10472,7 @@ public:
|
||||||
int get_action() const { return m_action; }
|
int get_action() const { return m_action; }
|
||||||
void set_action(int index) { m_action = index; }
|
void set_action(int index) { m_action = index; }
|
||||||
|
|
||||||
wxBoxSizer *create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, std::string param);
|
wxBoxSizer *create_remember_checkbox(wxString title, wxWindow* parent, wxString tooltip);
|
||||||
wxBoxSizer *create_item_radiobox(wxString title, wxWindow *parent, int select_id, int groupid);
|
wxBoxSizer *create_item_radiobox(wxString title, wxWindow *parent, int select_id, int groupid);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -10558,14 +10566,12 @@ ProjectDropDialog::ProjectDropDialog(const std::string &filename)
|
||||||
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 10);
|
m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, 10);
|
||||||
|
|
||||||
wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *m_sizer_bottom = new wxBoxSizer(wxHORIZONTAL);
|
||||||
// hide the "Don't show again" checkbox
|
wxBoxSizer *m_sizer_left = new wxBoxSizer(wxHORIZONTAL);
|
||||||
//wxBoxSizer *m_sizer_left = new wxBoxSizer(wxHORIZONTAL);
|
|
||||||
|
|
||||||
//auto dont_show_again = create_item_checkbox(_L("Don't show again"), this, _L("Don't show again"), "show_drop_project_dialog");
|
auto dont_show_again = create_remember_checkbox(_L("Remember my choice."), this, _L("This option can be changed later in preferences, under 'Load Behaviour'."));
|
||||||
//m_sizer_left->Add(dont_show_again, 0, wxALL, 5);
|
m_sizer_left->Add(dont_show_again, 0, wxALL, 5);
|
||||||
|
|
||||||
//m_sizer_bottom->Add(m_sizer_left, 0, wxEXPAND, 5);
|
|
||||||
|
|
||||||
|
m_sizer_bottom->Add(m_sizer_left, 0, wxEXPAND, 5);
|
||||||
m_sizer_bottom->Add(0, 0, 1, wxEXPAND, 5);
|
m_sizer_bottom->Add(0, 0, 1, wxEXPAND, 5);
|
||||||
|
|
||||||
wxBoxSizer *m_sizer_right = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *m_sizer_right = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
@ -10654,13 +10660,14 @@ wxBoxSizer *ProjectDropDialog ::create_item_radiobox(wxString title, wxWindow *p
|
||||||
|
|
||||||
return sizer;
|
return sizer;
|
||||||
}
|
}
|
||||||
wxBoxSizer *ProjectDropDialog::create_item_checkbox(wxString title, wxWindow *parent, wxString tooltip, std::string param)
|
wxBoxSizer *ProjectDropDialog::create_remember_checkbox(wxString title, wxWindow *parent, wxString tooltip)
|
||||||
{
|
{
|
||||||
wxBoxSizer *m_sizer_checkbox = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *m_sizer_checkbox = new wxBoxSizer(wxHORIZONTAL);
|
||||||
|
|
||||||
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 5);
|
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 5);
|
||||||
|
|
||||||
auto checkbox = new ::CheckBox(parent);
|
auto checkbox = new ::CheckBox(parent);
|
||||||
|
checkbox->SetValue(m_remember_choice);
|
||||||
|
checkbox->SetToolTip(tooltip);
|
||||||
m_sizer_checkbox->Add(checkbox, 0, wxALIGN_CENTER, 0);
|
m_sizer_checkbox->Add(checkbox, 0, wxALIGN_CENTER, 0);
|
||||||
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 8);
|
m_sizer_checkbox->Add(0, 0, 0, wxEXPAND | wxLEFT, 8);
|
||||||
|
|
||||||
|
@ -10668,13 +10675,11 @@ wxBoxSizer *ProjectDropDialog::create_item_checkbox(wxString title, wxWindow *pa
|
||||||
checkbox_title->SetForegroundColour(wxColour(144,144,144));
|
checkbox_title->SetForegroundColour(wxColour(144,144,144));
|
||||||
checkbox_title->SetFont(::Label::Body_13);
|
checkbox_title->SetFont(::Label::Body_13);
|
||||||
checkbox_title->Wrap(-1);
|
checkbox_title->Wrap(-1);
|
||||||
|
checkbox_title->SetToolTip(tooltip);
|
||||||
m_sizer_checkbox->Add(checkbox_title, 0, wxALIGN_CENTER | wxALL, 3);
|
m_sizer_checkbox->Add(checkbox_title, 0, wxALIGN_CENTER | wxALL, 3);
|
||||||
|
|
||||||
m_show_again = wxGetApp().app_config->get(param) == "true" ? true : false;
|
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox](wxCommandEvent &e) {
|
||||||
checkbox->SetValue(m_show_again);
|
m_remember_choice = checkbox->GetValue();
|
||||||
|
|
||||||
checkbox->Bind(wxEVT_TOGGLEBUTTON, [this, checkbox, param](wxCommandEvent &e) {
|
|
||||||
m_show_again = m_show_again ? false : true;
|
|
||||||
e.Skip();
|
e.Skip();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -10740,7 +10745,19 @@ void ProjectDropDialog::on_select_radio(wxMouseEvent &event)
|
||||||
|
|
||||||
void ProjectDropDialog::on_select_ok(wxMouseEvent &event)
|
void ProjectDropDialog::on_select_ok(wxMouseEvent &event)
|
||||||
{
|
{
|
||||||
wxGetApp().app_config->set_bool("show_drop_project_dialog", m_show_again);
|
if (m_remember_choice) {
|
||||||
|
LoadType load_type = static_cast<LoadType>(get_action());
|
||||||
|
switch (load_type)
|
||||||
|
{
|
||||||
|
case LoadType::OpenProject:
|
||||||
|
wxGetApp().app_config->set(SETTING_PROJECT_LOAD_BEHAVIOUR, OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_ALL);
|
||||||
|
break;
|
||||||
|
case LoadType::LoadGeometry:
|
||||||
|
wxGetApp().app_config->set(SETTING_PROJECT_LOAD_BEHAVIOUR, OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10920,6 +10937,35 @@ bool Plater::load_files(const wxArrayString& filenames)
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LoadType determine_load_type(std::string filename, std::string override_setting)
|
||||||
|
{
|
||||||
|
std::string setting;
|
||||||
|
|
||||||
|
if (override_setting != "") {
|
||||||
|
setting = override_setting;
|
||||||
|
} else {
|
||||||
|
setting = wxGetApp().app_config->get(SETTING_PROJECT_LOAD_BEHAVIOUR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (setting == OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY) {
|
||||||
|
return LoadType::LoadGeometry;
|
||||||
|
} else if (setting == OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK) {
|
||||||
|
ProjectDropDialog dlg(filename);
|
||||||
|
if (dlg.ShowModal() == wxID_OK) {
|
||||||
|
int choice = dlg.get_action();
|
||||||
|
LoadType load_type = static_cast<LoadType>(choice);
|
||||||
|
wxGetApp().app_config->set("import_project_action", std::to_string(choice));
|
||||||
|
|
||||||
|
// BBS: jump to plater panel
|
||||||
|
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
|
||||||
|
return load_type;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LoadType::Unknown; // Cancel
|
||||||
|
} else {
|
||||||
|
return LoadType::OpenProject;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool Plater::open_3mf_file(const fs::path &file_path)
|
bool Plater::open_3mf_file(const fs::path &file_path)
|
||||||
{
|
{
|
||||||
|
@ -10928,31 +10974,16 @@ bool Plater::open_3mf_file(const fs::path &file_path)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
LoadType load_type = LoadType::Unknown;
|
bool not_empty_plate = !model().objects.empty();
|
||||||
if (!model().objects.empty()) {
|
bool load_setting_ask_when_relevant = wxGetApp().app_config->get(SETTING_PROJECT_LOAD_BEHAVIOUR) == OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT;
|
||||||
bool show_drop_project_dialog = true;
|
LoadType load_type = determine_load_type(filename, (not_empty_plate && load_setting_ask_when_relevant) ? OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK : "");
|
||||||
if (show_drop_project_dialog) {
|
|
||||||
ProjectDropDialog dlg(filename);
|
|
||||||
if (dlg.ShowModal() == wxID_OK) {
|
|
||||||
int choice = dlg.get_action();
|
|
||||||
load_type = static_cast<LoadType>(choice);
|
|
||||||
wxGetApp().app_config->set("import_project_action", std::to_string(choice));
|
|
||||||
|
|
||||||
// BBS: jump to plater panel
|
|
||||||
wxGetApp().mainframe->select_tab(MainFrame::tp3DEditor);
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
load_type = static_cast<LoadType>(
|
|
||||||
std::clamp(std::stoi(wxGetApp().app_config->get("import_project_action")), static_cast<int>(LoadType::OpenProject), static_cast<int>(LoadType::LoadConfig)));
|
|
||||||
} else
|
|
||||||
load_type = LoadType::OpenProject;
|
|
||||||
|
|
||||||
if (load_type == LoadType::Unknown) return false;
|
if (load_type == LoadType::Unknown) return false;
|
||||||
|
|
||||||
switch (load_type) {
|
switch (load_type) {
|
||||||
case LoadType::OpenProject: {
|
case LoadType::OpenProject: {
|
||||||
if (wxGetApp().can_load_project())
|
if (wxGetApp().can_load_project())
|
||||||
load_project(from_path(file_path));
|
load_project(from_path(file_path), "<loadall>");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LoadType::LoadGeometry: {
|
case LoadType::LoadGeometry: {
|
||||||
|
|
|
@ -67,7 +67,7 @@ wxBoxSizer *PreferencesDialog::create_item_title(wxString title, wxWindow *paren
|
||||||
return m_sizer_title;
|
return m_sizer_title;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBoxSizer *PreferencesDialog::create_item_combobox(wxString title, wxWindow *parent, wxString tooltip, std::string param, std::vector<wxString> vlist)
|
std::tuple<wxBoxSizer*, ComboBox*> PreferencesDialog::create_item_combobox_base(wxString title, wxWindow* parent, wxString tooltip, std::string param, std::vector<wxString> vlist, unsigned int current_index)
|
||||||
{
|
{
|
||||||
wxBoxSizer *m_sizer_combox = new wxBoxSizer(wxHORIZONTAL);
|
wxBoxSizer *m_sizer_combox = new wxBoxSizer(wxHORIZONTAL);
|
||||||
m_sizer_combox->Add(0, 0, 0, wxEXPAND | wxLEFT, 23);
|
m_sizer_combox->Add(0, 0, 0, wxEXPAND | wxLEFT, 23);
|
||||||
|
@ -84,20 +84,58 @@ wxBoxSizer *PreferencesDialog::create_item_combobox(wxString title, wxWindow *pa
|
||||||
combobox->GetDropDown().SetFont(::Label::Body_13);
|
combobox->GetDropDown().SetFont(::Label::Body_13);
|
||||||
|
|
||||||
std::vector<wxString>::iterator iter;
|
std::vector<wxString>::iterator iter;
|
||||||
for (iter = vlist.begin(); iter != vlist.end(); iter++) { combobox->Append(*iter); }
|
for (iter = vlist.begin(); iter != vlist.end(); iter++) {
|
||||||
|
combobox->Append(*iter);
|
||||||
|
}
|
||||||
|
|
||||||
|
combobox->SetSelection(current_index);
|
||||||
auto use_inch = app_config->get(param);
|
|
||||||
if (!use_inch.empty()) { combobox->SetSelection(atoi(use_inch.c_str())); }
|
|
||||||
|
|
||||||
m_sizer_combox->Add(combobox, 0, wxALIGN_CENTER, 0);
|
m_sizer_combox->Add(combobox, 0, wxALIGN_CENTER, 0);
|
||||||
|
|
||||||
|
return {m_sizer_combox, combobox};
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBoxSizer* PreferencesDialog::create_item_combobox(wxString title, wxWindow* parent, wxString tooltip, std::string param, std::vector<wxString> vlist)
|
||||||
|
{
|
||||||
|
unsigned int current_index = 0;
|
||||||
|
|
||||||
|
auto current_setting = app_config->get(param);
|
||||||
|
if (!current_setting.empty()) {
|
||||||
|
current_index = atoi(current_setting.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
|
auto [sizer, combobox] = create_item_combobox_base(title, parent, tooltip, param, vlist, current_index);
|
||||||
|
|
||||||
//// save config
|
//// save config
|
||||||
combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, param](wxCommandEvent &e) {
|
combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, param](wxCommandEvent& e) {
|
||||||
app_config->set(param, std::to_string(e.GetSelection()));
|
app_config->set(param, std::to_string(e.GetSelection()));
|
||||||
e.Skip();
|
e.Skip();
|
||||||
});
|
});
|
||||||
return m_sizer_combox;
|
|
||||||
|
return sizer;
|
||||||
|
}
|
||||||
|
|
||||||
|
wxBoxSizer *PreferencesDialog::create_item_combobox(wxString title, wxWindow *parent, wxString tooltip, std::string param, std::vector<wxString> vlist, std::vector<std::string> config_name_index)
|
||||||
|
{
|
||||||
|
assert(vlist.size() == config_name_index.size());
|
||||||
|
unsigned int current_index = 0;
|
||||||
|
|
||||||
|
auto current_setting = app_config->get(param);
|
||||||
|
if (!current_setting.empty()) {
|
||||||
|
auto compare = [current_setting](string possible_setting) { return current_setting == possible_setting; };
|
||||||
|
auto iterator = find_if(config_name_index.begin(), config_name_index.end(), compare);
|
||||||
|
current_index = iterator - config_name_index.begin();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto [sizer, combobox] = create_item_combobox_base(title, parent, tooltip, param, vlist, current_index);
|
||||||
|
|
||||||
|
//// save config
|
||||||
|
combobox->GetDropDown().Bind(wxEVT_COMBOBOX, [this, param, config_name_index](wxCommandEvent& e) {
|
||||||
|
app_config->set(param, config_name_index[e.GetSelection()]);
|
||||||
|
e.Skip();
|
||||||
|
});
|
||||||
|
|
||||||
|
return sizer;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxBoxSizer *PreferencesDialog::create_item_language_combobox(
|
wxBoxSizer *PreferencesDialog::create_item_language_combobox(
|
||||||
|
@ -1166,6 +1204,11 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
// auto item_modelmall = create_item_checkbox(_L("Show online staff-picked models on the home page"), page, _L("Show online staff-picked models on the home page"), 50, "staff_pick_switch");
|
// auto item_modelmall = create_item_checkbox(_L("Show online staff-picked models on the home page"), page, _L("Show online staff-picked models on the home page"), 50, "staff_pick_switch");
|
||||||
|
|
||||||
auto title_project = create_item_title(_L("Project"), page, "");
|
auto title_project = create_item_title(_L("Project"), page, "");
|
||||||
|
|
||||||
|
std::vector<wxString> projectLoadSettingsBehaviourOptions = {_L("Load All"), _L("Ask When Relevant"), _L("Always Ask"), _L("Load Geometry Only")};
|
||||||
|
std::vector<string> projectLoadSettingsConfigOptions = { OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_ALL, OPTION_PROJECT_LOAD_BEHAVIOUR_ASK_WHEN_RELEVANT, OPTION_PROJECT_LOAD_BEHAVIOUR_ALWAYS_ASK, OPTION_PROJECT_LOAD_BEHAVIOUR_LOAD_GEOMETRY };
|
||||||
|
auto item_project_load_behaviour = create_item_combobox(_L("Load Behaviour"), page, _L("Should printer/filament/process settings be loaded when opening a .3mf?"), SETTING_PROJECT_LOAD_BEHAVIOUR, projectLoadSettingsBehaviourOptions, projectLoadSettingsConfigOptions);
|
||||||
|
|
||||||
auto item_max_recent_count = create_item_input(_L("Maximum recent projects"), "", page, _L("Maximum count of recent projects"), "max_recent_count", [](wxString value) {
|
auto item_max_recent_count = create_item_input(_L("Maximum recent projects"), "", page, _L("Maximum count of recent projects"), "max_recent_count", [](wxString value) {
|
||||||
long max = 0;
|
long max = 0;
|
||||||
if (value.ToLong(&max))
|
if (value.ToLong(&max))
|
||||||
|
@ -1241,6 +1284,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
// update_modelmall(eee);
|
// update_modelmall(eee);
|
||||||
// item_region->GetItem(size_t(2))->GetWindow()->Bind(wxEVT_COMBOBOX, update_modelmall);
|
// item_region->GetItem(size_t(2))->GetWindow()->Bind(wxEVT_COMBOBOX, update_modelmall);
|
||||||
sizer_page->Add(title_project, 0, wxTOP| wxEXPAND, FromDIP(20));
|
sizer_page->Add(title_project, 0, wxTOP| wxEXPAND, FromDIP(20));
|
||||||
|
sizer_page->Add(item_project_load_behaviour, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(item_max_recent_count, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_max_recent_count, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(item_save_choise, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_save_choise, 0, wxTOP, FromDIP(3));
|
||||||
sizer_page->Add(item_gcodes_warning, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_gcodes_warning, 0, wxTOP, FromDIP(3));
|
||||||
|
|
|
@ -105,6 +105,7 @@ public:
|
||||||
|
|
||||||
wxBoxSizer *create_item_title(wxString title, wxWindow *parent, wxString tooltip);
|
wxBoxSizer *create_item_title(wxString title, wxWindow *parent, wxString tooltip);
|
||||||
wxBoxSizer *create_item_combobox(wxString title, wxWindow *parent, wxString tooltip, std::string param, std::vector<wxString> vlist);
|
wxBoxSizer *create_item_combobox(wxString title, wxWindow *parent, wxString tooltip, std::string param, std::vector<wxString> vlist);
|
||||||
|
wxBoxSizer *create_item_combobox(wxString title, wxWindow *parent, wxString tooltip, std::string param, std::vector<wxString> vlist, std::vector<std::string> config_name_index);
|
||||||
wxBoxSizer *create_item_region_combobox(wxString title, wxWindow *parent, wxString tooltip, std::vector<wxString> vlist);
|
wxBoxSizer *create_item_region_combobox(wxString title, wxWindow *parent, wxString tooltip, std::vector<wxString> vlist);
|
||||||
wxBoxSizer *create_item_language_combobox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param, std::vector<const wxLanguageInfo *> vlist);
|
wxBoxSizer *create_item_language_combobox(wxString title, wxWindow *parent, wxString tooltip, int padding_left, std::string param, std::vector<const wxLanguageInfo *> vlist);
|
||||||
wxBoxSizer *create_item_loglevel_combobox(wxString title, wxWindow *parent, wxString tooltip, std::vector<wxString> vlist);
|
wxBoxSizer *create_item_loglevel_combobox(wxString title, wxWindow *parent, wxString tooltip, std::vector<wxString> vlist);
|
||||||
|
@ -140,6 +141,9 @@ public:
|
||||||
protected:
|
protected:
|
||||||
void OnSelectTabel(wxCommandEvent &event);
|
void OnSelectTabel(wxCommandEvent &event);
|
||||||
void OnSelectRadio(wxMouseEvent &event);
|
void OnSelectRadio(wxMouseEvent &event);
|
||||||
|
|
||||||
|
private:
|
||||||
|
std::tuple<wxBoxSizer*, ComboBox*> create_item_combobox_base(wxString title, wxWindow* parent, wxString tooltip, std::string param, std::vector<wxString> vlist, unsigned int current_index);
|
||||||
};
|
};
|
||||||
|
|
||||||
wxDECLARE_EVENT(EVT_PREFERENCES_SELECT_TAB, wxCommandEvent);
|
wxDECLARE_EVENT(EVT_PREFERENCES_SELECT_TAB, wxCommandEvent);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue