FIX: fix the country code not correct issue under pre environment
Change-Id: I5fa3f20949b3f50304d42a50b3819cc5e04c0656
This commit is contained in:
parent
b3575b47d1
commit
0ddd7ed5e7
1 changed files with 8 additions and 7 deletions
|
@ -157,7 +157,7 @@ wxBoxSizer *PreferencesDialog::create_item_language_combobox(
|
||||||
if (wxGetApp().plater()->is_project_dirty()) {
|
if (wxGetApp().plater()->is_project_dirty()) {
|
||||||
auto result = MessageDialog(static_cast<wxWindow*>(this), _L("The current project has unsaved changes, save it before continue?"),
|
auto result = MessageDialog(static_cast<wxWindow*>(this), _L("The current project has unsaved changes, save it before continue?"),
|
||||||
wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Save"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal();
|
wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Save"), wxYES_NO | wxCANCEL | wxYES_DEFAULT | wxCENTRE).ShowModal();
|
||||||
|
|
||||||
if (result == wxID_YES) {
|
if (result == wxID_YES) {
|
||||||
wxGetApp().plater()->save_project();
|
wxGetApp().plater()->save_project();
|
||||||
}
|
}
|
||||||
|
@ -241,7 +241,7 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxWin
|
||||||
auto region_index = e.GetSelection();
|
auto region_index = e.GetSelection();
|
||||||
auto region = local_regions[region_index];
|
auto region = local_regions[region_index];
|
||||||
|
|
||||||
auto area = "";
|
/*auto area = "";
|
||||||
if (region == "CHN" || region == "China")
|
if (region == "CHN" || region == "China")
|
||||||
area = "CN";
|
area = "CN";
|
||||||
else if (region == "USA")
|
else if (region == "USA")
|
||||||
|
@ -253,7 +253,7 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxWin
|
||||||
else if (region == "North America")
|
else if (region == "North America")
|
||||||
area = "US";
|
area = "US";
|
||||||
else
|
else
|
||||||
area = "Others";
|
area = "Others";*/
|
||||||
|
|
||||||
NetworkAgent* agent = wxGetApp().getAgent();
|
NetworkAgent* agent = wxGetApp().getAgent();
|
||||||
AppConfig* config = GUI::wxGetApp().app_config;
|
AppConfig* config = GUI::wxGetApp().app_config;
|
||||||
|
@ -265,10 +265,11 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxWin
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
wxGetApp().request_user_logout();
|
wxGetApp().request_user_logout();
|
||||||
|
config->set("region", region.ToStdString());
|
||||||
|
auto area = config->get_country_code();
|
||||||
if (agent) {
|
if (agent) {
|
||||||
agent->set_country_code(area);
|
agent->set_country_code(area);
|
||||||
}
|
}
|
||||||
config->set("region", region.ToStdString());
|
|
||||||
EndModal(wxID_CANCEL);
|
EndModal(wxID_CANCEL);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -497,7 +498,7 @@ wxBoxSizer* PreferencesDialog::create_item_darkmode_checkbox(wxString title, wxW
|
||||||
#ifdef _MSW_DARK_MODE
|
#ifdef _MSW_DARK_MODE
|
||||||
wxGetApp().force_colors_update();
|
wxGetApp().force_colors_update();
|
||||||
wxGetApp().update_ui_from_settings();
|
wxGetApp().update_ui_from_settings();
|
||||||
set_dark_mode();
|
set_dark_mode();
|
||||||
#endif
|
#endif
|
||||||
SimpleEvent evt = SimpleEvent(EVT_GLCANVAS_COLOR_MODE_CHANGED);
|
SimpleEvent evt = SimpleEvent(EVT_GLCANVAS_COLOR_MODE_CHANGED);
|
||||||
wxPostEvent(wxGetApp().plater(), evt);
|
wxPostEvent(wxGetApp().plater(), evt);
|
||||||
|
@ -729,7 +730,7 @@ void PreferencesDialog::create()
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
int screen_height = wxGetDisplaySize().GetY();
|
int screen_height = wxGetDisplaySize().GetY();
|
||||||
if (this->GetSize().GetY() > screen_height)
|
if (this->GetSize().GetY() > screen_height)
|
||||||
this->SetSize(this->GetSize().GetX() + FromDIP(40), screen_height * 4 / 5);
|
this->SetSize(this->GetSize().GetX() + FromDIP(40), screen_height * 4 / 5);
|
||||||
|
|
||||||
CenterOnParent();
|
CenterOnParent();
|
||||||
|
@ -848,7 +849,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||||
auto title_darkmode = create_item_title(_L("Dark Mode"), page, _L("Dark Mode"));
|
auto title_darkmode = create_item_title(_L("Dark Mode"), page, _L("Dark Mode"));
|
||||||
auto item_darkmode = create_item_darkmode_checkbox(_L("Enable Dark mode"), page,_L("Enable Dark mode"), 50, "dark_color_mode");
|
auto item_darkmode = create_item_darkmode_checkbox(_L("Enable Dark mode"), page,_L("Enable Dark mode"), 50, "dark_color_mode");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
sizer_page->Add(title_general_settings, 0, wxEXPAND, 0);
|
sizer_page->Add(title_general_settings, 0, wxEXPAND, 0);
|
||||||
sizer_page->Add(item_language, 0, wxTOP, FromDIP(3));
|
sizer_page->Add(item_language, 0, wxTOP, FromDIP(3));
|
||||||
|
|
Loading…
Reference in a new issue