ENH:Fix incomplete display of the printer block prompt when entering the print submission screen for the first time

jira:[STUDIO-12254]

Change-Id: I642e6a39f063c65fb9d61e8d589d2a326917d370
This commit is contained in:
milk 2025-05-20 17:01:47 +08:00 committed by lane.wei
parent d5be32428a
commit c0ac52cb58
3 changed files with 35 additions and 15 deletions

View File

@ -177,11 +177,9 @@ void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxC
return;
m_last_texts = texts;
m_labels.clear();
m_sizer->Clear(true);
std::set<wxString> unique_texts;
std::set<wxString> unique_texts;
for (const wxString &text : texts) {
if (text.empty()) {
@ -226,6 +224,15 @@ wxString PrinterMsgPanel::GetLabel() {
return wxEmptyString;
}
std::vector<wxString> PrinterMsgPanel::GetLabelList() {
if (m_last_texts.empty())
wxLogDebug(_L("No labels are currently stored."));
return m_last_texts;
}
}
};

View File

@ -169,7 +169,7 @@ public:
// void SetLabelSingle(const wxString &texts,const wxColour& colour);
wxString GetLabel();
std::vector<wxString> GetLabelList();
private:
wxBoxSizer * m_sizer = nullptr;

View File

@ -1435,13 +1435,19 @@ void SelectMachineDialog::update_ams_status_msg(vector<wxString> msg, bool is_er
}
}
else {
if (is_single)
m_statictext_ams_msg->SetLabelList({ msg[0] }, colour);
else {
m_statictext_ams_msg->SetLabelList(msg, colour);
m_statictext_ams_msg->Show();
}
if (m_statictext_ams_msg->GetLabelList() != msg) {
vector<wxString> TempMsg = {};
if (is_single)
TempMsg = {msg[0]};
else
TempMsg = msg;
m_statictext_ams_msg->SetLabelList(TempMsg, colour);
m_statictext_ams_msg->Show();
Layout();
Fit();
}
}
}
@ -1459,12 +1465,19 @@ void SelectMachineDialog::update_priner_status_msg(vector<wxString> msg, bool is
}
}
else {
if (is_single)
m_text_printer_msg->SetLabelList({msg[0]}, colour);
else {
m_text_printer_msg->SetLabelList(msg, colour);
if (m_text_printer_msg->GetLabelList() != msg) {
vector<wxString> TempMsg = {};
if (is_single)
TempMsg = {msg[0]};
else
TempMsg = msg;
m_text_printer_msg->SetLabelList(TempMsg, colour);
m_text_printer_msg->Show();
}
Layout();
Fit();
}
}
}