mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-21 15:51:10 -06:00
Merge branch 'master' into SoftFever
# Conflicts: # resources/i18n/zh_cn/BambuStudio.mo # version.inc
This commit is contained in:
commit
69e9a7454e
28 changed files with 375 additions and 274 deletions
|
@ -300,7 +300,7 @@ void MachineObject::set_access_code(std::string code)
|
|||
bool MachineObject::is_lan_mode_printer()
|
||||
{
|
||||
bool result = false;
|
||||
if (connection_type() == "lan")
|
||||
if (!dev_connection_type.empty() && dev_connection_type == "lan")
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -1156,7 +1156,12 @@ void GUI_App::post_init()
|
|||
while (files_vec.size() > LOG_FILES_MAX_NUM) {
|
||||
auto full_path = log_folder / boost::filesystem::path(files_vec[files_vec.size() - 1].second);
|
||||
BOOST_LOG_TRIVIAL(info) << "delete log file over " << LOG_FILES_MAX_NUM << ", filename: "<< files_vec[files_vec.size() - 1].second;
|
||||
boost::filesystem::remove(full_path);
|
||||
try {
|
||||
boost::filesystem::remove(full_path);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
BOOST_LOG_TRIVIAL(error) << "failed to delete log file: "<< files_vec[files_vec.size() - 1].second << ". Error: " << ex.what();
|
||||
}
|
||||
files_vec.pop_back();
|
||||
}
|
||||
}
|
||||
|
@ -1213,7 +1218,10 @@ void GUI_App::shutdown()
|
|||
}
|
||||
|
||||
if (m_agent) {
|
||||
//BBS avoid a crash on mac platform
|
||||
#ifdef __WINDOWS__
|
||||
m_agent->start_discovery(false, false);
|
||||
#endif
|
||||
delete m_agent;
|
||||
m_agent = nullptr;
|
||||
}
|
||||
|
@ -3094,6 +3102,7 @@ void GUI_App::request_user_logout()
|
|||
|
||||
m_agent->user_logout();
|
||||
m_agent->set_user_selected_machine("");
|
||||
app_config->set("preset_folder", "");
|
||||
/* delete old user settings */
|
||||
m_device_manager->clean_user_info();
|
||||
GUI::wxGetApp().sidebar().load_ams_list({});
|
||||
|
@ -3651,8 +3660,15 @@ void GUI_App::sync_preset(Preset* preset)
|
|||
preset->setting_id.clear();
|
||||
result = 0;
|
||||
}
|
||||
else
|
||||
else {
|
||||
result = m_agent->put_setting(preset->setting_id, preset->name, &values_map, &http_code);
|
||||
if (http_code >= 400) {
|
||||
result = 0;
|
||||
updated_info = "hold";
|
||||
BOOST_LOG_TRIVIAL(error) << "[sync_preset] put setting_id = " << preset->setting_id << " failed, http_code = " << http_code;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(trace) << "[sync_preset]update: can not generate differed key-values, we need to skip this preset "<< preset->name;
|
||||
|
@ -3761,8 +3777,10 @@ void GUI_App::start_sync_user_preset(bool with_progress_dlg)
|
|||
it = delete_cache_presets.erase(it);
|
||||
BOOST_LOG_TRIVIAL(trace) << "sync_preset: sync operation: delete success! setting id = " << del_setting_id;
|
||||
}
|
||||
else
|
||||
else {
|
||||
BOOST_LOG_TRIVIAL(info) << "delete setting = " <<del_setting_id << " failed";
|
||||
it++;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -9394,7 +9394,7 @@ void Plater::on_config_change(const DynamicPrintConfig &config)
|
|||
if ( seq_print && view3d_canvas && view3d_canvas->is_initialized() && view3d_canvas->is_rendering_enabled() ) {
|
||||
NotificationManager *notify_manager = get_notification_manager();
|
||||
if (seq_print->value == PrintSequence::ByObject) {
|
||||
std::string info_text = L("Print By Object: \nSuggest to use auto-arrange to avoid collisions when printing.");
|
||||
std::string info_text = _u8L("Print By Object: \nSuggest to use auto-arrange to avoid collisions when printing.");
|
||||
notify_manager->bbl_show_seqprintinfo_notification(info_text);
|
||||
//always show label when switch to sequence print
|
||||
if (print_sequence_changed)
|
||||
|
|
|
@ -660,32 +660,30 @@ void MachineInfoPanel::upgrade_firmware_internal() {
|
|||
|
||||
void MachineInfoPanel::on_upgrade_firmware(wxCommandEvent &event)
|
||||
{
|
||||
ConfirmHintDialog* confirm_dlg = new ConfirmHintDialog(this->GetParent(), wxID_ANY, _L("Upgrade firmware"));
|
||||
confirm_dlg->SetHint(_L(
|
||||
ConfirmHintDialog confirm_dlg(this->GetParent(), wxID_ANY, _L("Upgrade firmware"));
|
||||
confirm_dlg.SetHint(_L(
|
||||
"Are you sure you want to update? This will take about 10 minutes. Do not turn off the power while the printer is updating."
|
||||
));
|
||||
confirm_dlg->Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent &e) {
|
||||
confirm_dlg.Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent &e) {
|
||||
if (m_obj){
|
||||
m_obj->command_upgrade_confirm();
|
||||
}
|
||||
});
|
||||
if(confirm_dlg->ShowModal())
|
||||
delete confirm_dlg;
|
||||
confirm_dlg.ShowModal();
|
||||
}
|
||||
|
||||
void MachineInfoPanel::on_consisitency_upgrade_firmware(wxCommandEvent &event)
|
||||
{
|
||||
ConfirmHintDialog* confirm_dlg = new ConfirmHintDialog(this->GetParent(), wxID_ANY, _L("Upgrade firmware"));
|
||||
confirm_dlg->SetHint(_L(
|
||||
ConfirmHintDialog confirm_dlg(this->GetParent(), wxID_ANY, _L("Upgrade firmware"));
|
||||
confirm_dlg.SetHint(_L(
|
||||
"Are you sure you want to update? This will take about 10 minutes. Do not turn off the power while the printer is updating."
|
||||
));
|
||||
confirm_dlg->Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent &e) {
|
||||
confirm_dlg.Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent &e) {
|
||||
if (m_obj){
|
||||
m_obj->command_consistency_upgrade_confirm();
|
||||
}
|
||||
});
|
||||
if(confirm_dlg->ShowModal())
|
||||
delete confirm_dlg;
|
||||
confirm_dlg.ShowModal();
|
||||
}
|
||||
|
||||
void MachineInfoPanel::on_show_release_note(wxMouseEvent &event)
|
||||
|
@ -800,13 +798,16 @@ void UpgradePanel::update(MachineObject *obj)
|
|||
if (m_obj && m_show_forced_hint) {
|
||||
if (m_obj->upgrade_force_upgrade) {
|
||||
m_show_forced_hint = false; //lock hint
|
||||
ConfirmHintDialog* force_dlg = new ConfirmHintDialog(m_scrolledWindow, wxID_ANY, _L("Upgrade firmware"));
|
||||
force_dlg->SetHint(_L(
|
||||
ConfirmHintDialog force_dlg(m_scrolledWindow, wxID_ANY, _L("Upgrade firmware"), ConfirmHintDialog::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize, wxPD_APP_MODAL);
|
||||
force_dlg.SetHint(_L(
|
||||
"An important update was detected and needs to be run before printing can continue. Do you want to update now? You can also update later from 'Upgrade firmware'."
|
||||
));
|
||||
force_dlg->Bind(EVT_CONFIRM_HINT, &MachineInfoPanel::on_upgrade_firmware, m_push_upgrade_panel);
|
||||
if (force_dlg->ShowModal())
|
||||
delete force_dlg;
|
||||
force_dlg.Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent& e) {
|
||||
if (m_obj) {
|
||||
m_obj->command_upgrade_confirm();
|
||||
}
|
||||
});
|
||||
force_dlg.ShowModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -818,13 +819,16 @@ void UpgradePanel::update(MachineObject *obj)
|
|||
if (m_obj && m_show_consistency_hint) {
|
||||
if (m_obj->upgrade_consistency_request) {
|
||||
m_show_consistency_hint = false;
|
||||
ConfirmHintDialog* consistency_dlg = new ConfirmHintDialog(m_scrolledWindow, wxID_ANY, _L("Upgrade firmware"));
|
||||
consistency_dlg->SetHint(_L(
|
||||
ConfirmHintDialog consistency_dlg(m_scrolledWindow, wxID_ANY, _L("Upgrade firmware"), ConfirmHintDialog::CONFIRM_AND_CANCEL, wxDefaultPosition, wxDefaultSize, wxPD_APP_MODAL);
|
||||
consistency_dlg.SetHint(_L(
|
||||
"The firmware version is abnormal. Repairing and updating are required before printing. Do you want to update now? You can also update later on printer or update next time starting the studio."
|
||||
));
|
||||
consistency_dlg->Bind(EVT_CONFIRM_HINT, &MachineInfoPanel::on_consisitency_upgrade_firmware, m_push_upgrade_panel);
|
||||
if (consistency_dlg->ShowModal())
|
||||
delete consistency_dlg;
|
||||
consistency_dlg.Bind(EVT_CONFIRM_HINT, [this](wxCommandEvent& e) {
|
||||
if (m_obj) {
|
||||
m_obj->command_consistency_upgrade_confirm();
|
||||
}
|
||||
});
|
||||
consistency_dlg.ShowModal();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -914,4 +918,4 @@ bool UpgradePanel::Show(bool show)
|
|||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue