ENH: do not show dialog if no bambu network lib
Change-Id: I9dbdb89b7161515ec7995969106764f66a5dd6e3
This commit is contained in:
parent
da732ac396
commit
acc6d70db9
|
@ -237,20 +237,24 @@ wxBoxSizer *PreferencesDialog::create_item_region_combobox(wxString title, wxWin
|
||||||
else
|
else
|
||||||
area = "Others";
|
area = "Others";
|
||||||
|
|
||||||
MessageDialog msg_wingow(nullptr, _L("Changing the region will log out your account.\n") + "\n" + _L("Do you want to continue?"), L("Region selection"),
|
NetworkAgent* agent = wxGetApp().getAgent();
|
||||||
wxICON_QUESTION | wxOK | wxCANCEL);
|
AppConfig* config = GUI::wxGetApp().app_config;
|
||||||
if (msg_wingow.ShowModal() == wxID_CANCEL) {
|
if (agent) {
|
||||||
combobox->SetSelection(current_region);
|
MessageDialog msg_wingow(this, _L("Changing the region will log out your account.\n") + "\n" + _L("Do you want to continue?"), L("Region selection"),
|
||||||
return;
|
wxICON_QUESTION | wxOK | wxCANCEL);
|
||||||
} else {
|
if (msg_wingow.ShowModal() == wxID_CANCEL) {
|
||||||
NetworkAgent *agent = wxGetApp().getAgent();
|
combobox->SetSelection(current_region);
|
||||||
wxGetApp().request_user_logout();
|
return;
|
||||||
AppConfig * config = GUI::wxGetApp().app_config;
|
} else {
|
||||||
if (agent) {
|
wxGetApp().request_user_logout();
|
||||||
agent->set_country_code(area);
|
if (agent) {
|
||||||
|
agent->set_country_code(area);
|
||||||
|
}
|
||||||
|
config->set("region", region.ToStdString());
|
||||||
|
EndModal(wxID_CANCEL);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
config->set("region", region.ToStdString());
|
config->set("region", region.ToStdString());
|
||||||
EndModal(wxID_CANCEL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
e.Skip();
|
e.Skip();
|
||||||
|
|
Loading…
Reference in New Issue