ENH:Only display one instance of duplicated warnings

jira:[STUDIO-10756]

Change-Id: I0a42341677cc9c15f2d6ef3c9223b6f86c248fd2
This commit is contained in:
milk 2025-05-16 22:29:33 +08:00 committed by lane.wei
parent d3ac9a4b9d
commit a5123f132d

View File

@ -173,7 +173,6 @@ PrinterMsgPanel::PrinterMsgPanel(wxWindow *parent)
void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxColour &colour)
{
if (texts == m_last_texts)
return;
@ -181,17 +180,16 @@ void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxC
m_labels.clear();
m_sizer->Clear(true);
//for (auto *label : m_labels) {
// m_sizer->Detach(label);
// label->Destroy();
//}
//m_labels.clear();
std::set<wxString> unique_texts;
for (const wxString &text : texts) {
if (text.empty()) {
continue;
}
if (!unique_texts.insert(text).second) {
continue;
}
Label *label = new Label(this);
label->SetFont(::Label::Body_13);
label->SetForegroundColour(colour);