mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-26 11:27:41 +00:00
fix: extend access code requirements t 0, 8 or more characters.
This commit is contained in:
@@ -1736,7 +1736,7 @@ void InputIpAddressDialog::set_machine_obj(MachineObject* obj)
|
||||
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
|
||||
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
||||
// 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.Length() >= 8);
|
||||
|
||||
Layout();
|
||||
Fit();
|
||||
@@ -2056,10 +2056,6 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
|
||||
auto str_ip = m_input_ip->GetTextCtrl()->GetValue();
|
||||
auto str_access_code = m_input_access_code->GetTextCtrl()->GetValue();
|
||||
|
||||
if (str_access_code.empty()) {
|
||||
str_access_code = "88888888";
|
||||
}
|
||||
|
||||
auto str_name = m_input_printer_name->GetTextCtrl()->GetValue().Strip(wxString::both);
|
||||
auto str_sn = m_input_sn->GetTextCtrl()->GetValue().Strip(wxString::both);
|
||||
bool invalid_access_code = true;
|
||||
@@ -2072,7 +2068,8 @@ void InputIpAddressDialog::on_text(wxCommandEvent &evt)
|
||||
}
|
||||
|
||||
// ORCA enabling / disabling buttons with conditions enough to change its style
|
||||
bool enable_btns = isIp(str_ip.ToStdString()) && str_access_code.Length() == 8 && invalid_access_code;
|
||||
bool valid_access_code_length = str_access_code.Length() >= 8;
|
||||
bool enable_btns = isIp(str_ip.ToStdString()) && valid_access_code_length && invalid_access_code;
|
||||
m_button_manual_setup->Enable(enable_btns);
|
||||
m_button_ok->Enable(enable_btns);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user