mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-27 03:48:46 +00:00
Merge branch 'feat/printer-agent-impl' into feat/printer-agent-camera-stream
This commit is contained in:
@@ -1736,7 +1736,8 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
|
|||||||
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
|
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
|
||||||
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
||||||
// ORCA enabling / disabling buttons with conditions enough to change its style
|
// ORCA enabling / disabling buttons with conditions enough to change its style
|
||||||
m_button_ok->Enable(isIp(str_ip.ToStdString()) && str_access_code.Length() >= 8);
|
m_button_ok->Enable(isIp(str_ip.ToStdString()) &&
|
||||||
|
(str_access_code.IsEmpty() || str_access_code.Length() >= 8));
|
||||||
|
|
||||||
Layout();
|
Layout();
|
||||||
Fit();
|
Fit();
|
||||||
@@ -1801,6 +1802,8 @@ void InputIpAddressDialog::on_ok(wxMouseEvent& evt)
|
|||||||
m_trouble_shoot->Hide();
|
m_trouble_shoot->Hide();
|
||||||
std::string str_ip = m_input_ip->GetTextCtrl()->GetValue().ToStdString();
|
std::string str_ip = m_input_ip->GetTextCtrl()->GetValue().ToStdString();
|
||||||
std::string str_access_code = m_input_access_code->GetTextCtrl()->GetValue().ToStdString();
|
std::string str_access_code = m_input_access_code->GetTextCtrl()->GetValue().ToStdString();
|
||||||
|
if (str_access_code.empty())
|
||||||
|
str_access_code = "88888888";
|
||||||
std::string str_name = m_input_printer_name->GetTextCtrl()->GetValue().Strip(wxString::both).ToStdString();
|
std::string str_name = m_input_printer_name->GetTextCtrl()->GetValue().Strip(wxString::both).ToStdString();
|
||||||
// Serial number should not contain lower case letters, and bambu_network plugin crashes
|
// Serial number should not contain lower case letters, and bambu_network plugin crashes
|
||||||
// if user entered the wrong serial number, so we call `Upper()` here.
|
// if user entered the wrong serial number, so we call `Upper()` here.
|
||||||
@@ -1835,6 +1838,8 @@ void InputIpAddressDialog::on_send_retry()
|
|||||||
Fit();
|
Fit();
|
||||||
wxString ip = m_input_ip->GetTextCtrl()->GetValue();
|
wxString ip = m_input_ip->GetTextCtrl()->GetValue();
|
||||||
wxString str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
wxString str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
||||||
|
if (str_access_code.IsEmpty())
|
||||||
|
str_access_code = "88888888";
|
||||||
|
|
||||||
// check support function
|
// check support function
|
||||||
if (!m_obj) return;
|
if (!m_obj) return;
|
||||||
@@ -2068,7 +2073,7 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ORCA enabling / disabling buttons with conditions enough to change its style
|
// ORCA enabling / disabling buttons with conditions enough to change its style
|
||||||
bool valid_access_code_length = str_access_code.Length() >= 8;
|
bool valid_access_code_length = str_access_code.IsEmpty() || str_access_code.Length() >= 8;
|
||||||
bool enable_btns = isIp(str_ip.ToStdString()) && valid_access_code_length && invalid_access_code;
|
bool enable_btns = isIp(str_ip.ToStdString()) && valid_access_code_length && invalid_access_code;
|
||||||
m_button_manual_setup->Enable(enable_btns);
|
m_button_manual_setup->Enable(enable_btns);
|
||||||
m_button_ok->Enable(enable_btns);
|
m_button_ok->Enable(enable_btns);
|
||||||
|
|||||||
Reference in New Issue
Block a user