mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-29 00:03:15 +08:00
ENH:Only display one instance of duplicated warnings
jira:[STUDIO-10756] Change-Id: I0a42341677cc9c15f2d6ef3c9223b6f86c248fd2
This commit is contained in:
parent
d3ac9a4b9d
commit
a5123f132d
@ -173,7 +173,6 @@ PrinterMsgPanel::PrinterMsgPanel(wxWindow *parent)
|
|||||||
|
|
||||||
void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxColour &colour)
|
void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxColour &colour)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (texts == m_last_texts)
|
if (texts == m_last_texts)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -181,17 +180,16 @@ void PrinterMsgPanel::SetLabelList(const std::vector<wxString> &texts, const wxC
|
|||||||
|
|
||||||
m_labels.clear();
|
m_labels.clear();
|
||||||
m_sizer->Clear(true);
|
m_sizer->Clear(true);
|
||||||
//for (auto *label : m_labels) {
|
|
||||||
// m_sizer->Detach(label);
|
std::set<wxString> unique_texts;
|
||||||
// label->Destroy();
|
|
||||||
//}
|
|
||||||
//m_labels.clear();
|
|
||||||
|
|
||||||
for (const wxString &text : texts) {
|
for (const wxString &text : texts) {
|
||||||
if (text.empty()) {
|
if (text.empty()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!unique_texts.insert(text).second) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Label *label = new Label(this);
|
Label *label = new Label(this);
|
||||||
label->SetFont(::Label::Body_13);
|
label->SetFont(::Label::Body_13);
|
||||||
label->SetForegroundColour(colour);
|
label->SetForegroundColour(colour);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user