mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-02 07:42:14 +00:00
feature diff cn and the other area to download soft.and request to server fail show the error dialog.
This commit is contained in:
@@ -2592,6 +2592,12 @@ bool GUI_App::on_init_inner()
|
||||
InfoDialog dlg(nullptr, _L("Info"), msg);
|
||||
dlg.ShowModal();
|
||||
});
|
||||
|
||||
Bind(EVT_REQUEST_SERVER_FAIL, [this](const wxCommandEvent& evt) {
|
||||
wxString msg = evt.GetString();
|
||||
InfoDialog dlg(nullptr, _L("Error"), msg);
|
||||
dlg.ShowModal();
|
||||
});
|
||||
}
|
||||
else {
|
||||
#ifdef __WXMSW__
|
||||
@@ -4743,27 +4749,23 @@ void GUI_App::check_preset_version()
|
||||
}
|
||||
void GUI_App::check_new_version_sf(bool show_tips, bool by_user)
|
||||
{
|
||||
std::string update_url = "";
|
||||
|
||||
#ifdef __WINDOWS__
|
||||
update_url = "https://public.resource.snapmaker.com/upgrade/packages/orca/win/manifest.json";
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
update_url = "https://public.resource.snapmaker.com/upgrade/packages/orca/mac/manifest.json";
|
||||
#endif
|
||||
#ifdef __LINUX__
|
||||
update_url = "https://public.resource.snapmaker.com/upgrade/packages/orca/linux/manifest.json";
|
||||
#endif
|
||||
std::string update_url = app_config->get_version_upgrade_url();
|
||||
|
||||
AppConfig* app_config = wxGetApp().app_config;
|
||||
|
||||
Http::get(update_url)
|
||||
.on_error([&](std::string body, std::string error, unsigned http_status) {
|
||||
(void)body;
|
||||
|
||||
wxCommandEvent* evt = new wxCommandEvent(EVT_REQUEST_SERVER_FAIL);
|
||||
wxString errorMsg = wxString::Format(_L("request to server update soft fail with body:%s,error:%s,status:%d"), body,
|
||||
error, http_status);
|
||||
evt->SetString(errorMsg);
|
||||
GUI::wxGetApp().QueueEvent(evt);
|
||||
BOOST_LOG_TRIVIAL(error) << format("Error getting: `%1%`: HTTP %2%, %3%", "check_new_version_sf", http_status,
|
||||
error);
|
||||
})
|
||||
.timeout_connect(1)
|
||||
.timeout_connect(TIMEOUT_CONNECT)
|
||||
.on_complete([this,by_user](std::string body, unsigned http_status) {
|
||||
// Http response OK
|
||||
if (http_status != 200) {
|
||||
|
||||
@@ -1198,7 +1198,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||
app_config->save();
|
||||
|
||||
|
||||
auto item_check_stable_version_only = create_item_checkbox(_L("Check for stable updates only"), page, _L("Check for stable updates only"), 50, "check_stable_update_only");
|
||||
//auto item_check_stable_version_only = create_item_checkbox(_L("Check for stable updates only"), page, _L("Check for stable updates only"), 50, "check_stable_update_only");
|
||||
|
||||
std::vector<wxString> Units = {_L("Metric") + " (mm, g)", _L("Imperial") + " (in, oz)"};
|
||||
auto item_currency = create_item_combobox(_L("Units"), page, _L("Units"), "use_inches", Units);
|
||||
@@ -1233,7 +1233,7 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||
auto item_multi_machine = create_item_checkbox(_L("Multi-device Management (Take effect after restarting Snapmaker Orca)."), page, _L("With this option enabled, you can send a task to multiple devices at the same time and manage multiple devices."), 50, "enable_multi_machine");
|
||||
auto item_auto_arrange = create_item_checkbox(_L("Auto arrange plate after cloning"), page, _L("Auto arrange plate after object cloning"), 50, "auto_arrange");
|
||||
auto title_presets = create_item_title(_L("Presets"), page, _L("Presets"));
|
||||
auto title_network = create_item_title(_L("Network"), page, _L("Network"));
|
||||
//auto title_network = create_item_title(_L("Network"), page, _L("Network"));
|
||||
auto item_user_sync = create_item_checkbox(_L("Auto sync user presets (Printer/Filament/Process)"), page, _L("User Sync"), 50, "sync_user_preset");
|
||||
auto item_system_sync = create_item_checkbox(_L("Update built-in Presets automatically."), page, _L("System Sync"), 50, "sync_system_preset");
|
||||
auto item_save_presets = create_item_button(_L("Clear my choice on the unsaved presets."), _L("Clear"), page, L"", _L("Clear my choice on the unsaved presets."), []() {
|
||||
@@ -1338,8 +1338,8 @@ wxWindow* PreferencesDialog::create_general_page()
|
||||
sizer_page->Add(item_system_sync, 0, wxTOP, FromDIP(3));
|
||||
sizer_page->Add(item_remember_printer_config, 0, wxTOP, FromDIP(3));
|
||||
sizer_page->Add(item_save_presets, 0, wxTOP, FromDIP(3));
|
||||
sizer_page->Add(title_network, 0, wxTOP | wxEXPAND, FromDIP(20));
|
||||
sizer_page->Add(item_check_stable_version_only, 0, wxTOP, FromDIP(3));
|
||||
//sizer_page->Add(title_network, 0, wxTOP | wxEXPAND, FromDIP(20));
|
||||
//sizer_page->Add(item_check_stable_version_only, 0, wxTOP, FromDIP(3));
|
||||
|
||||
// SM Beta: temporarily open the item_stealth_mode and close the network plugin
|
||||
|
||||
|
||||
Reference in New Issue
Block a user