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
(cherry picked from commit c0ac52cb58cffcb80db94e8985da94ff1c7add2d)
This commit is contained in:
milk
2025-05-20 17:01:47 +08:00
committed by Noisyfox
parent 760eb890bb
commit 7a22989e89
3 changed files with 35 additions and 15 deletions

View File

@@ -177,10 +177,8 @@ void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxC
return; return;
m_last_texts = texts; m_last_texts = texts;
m_labels.clear(); m_labels.clear();
m_sizer->Clear(true); m_sizer->Clear(true);
std::set<wxString> unique_texts; std::set<wxString> unique_texts;
for (const wxString &text : texts) { for (const wxString &text : texts) {
@@ -226,6 +224,15 @@ wxString PrinterMsgPanel::GetLabel() {
return wxEmptyString; 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); // void SetLabelSingle(const wxString &texts,const wxColour& colour);
wxString GetLabel(); wxString GetLabel();
std::vector<wxString> GetLabelList();
private: private:
wxBoxSizer * m_sizer = nullptr; wxBoxSizer * m_sizer = nullptr;

View File

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