FIX:displayed error file name

If the file name sent to the printer is changed to be too long, the final display format is incorrect

Jira:STUDIO-3137

Change-Id: Ia2a542a559ae8ff0343b159cff9e0317397e866f
This commit is contained in:
hu.wang 2023-07-20 11:17:25 +08:00 committed by Lane.Wei
parent 7be9b591b8
commit 55453af689
2 changed files with 26 additions and 0 deletions

View File

@ -2868,6 +2868,18 @@ void SelectMachineDialog::on_rename_enter()
}
auto new_file_name = m_rename_input->GetTextCtrl()->GetValue();
wxString temp;
int num = 0;
for (auto t : new_file_name) {
if (t == wxString::FromUTF8("\x20")) {
num++;
if (num == 1) temp += t;
} else {
num = 0;
temp += t;
}
}
new_file_name = temp;
auto m_valid_type = Valid;
wxString info_line;

View File

@ -107,6 +107,20 @@ void SendToPrinterDialog::on_rename_enter()
}
auto new_file_name = m_rename_input->GetTextCtrl()->GetValue();
wxString temp;
int num = 0;
for (auto t : new_file_name) {
if (t == wxString::FromUTF8("\x20")) {
num++;
if (num == 1) temp += t;
} else {
num = 0;
temp += t;
}
}
new_file_name = temp;
auto m_valid_type = Valid;
wxString info_line;