File tree Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Expand file tree Collapse file tree 2 files changed +45
-0
lines changed Original file line number Diff line number Diff line change @@ -1256,6 +1256,10 @@ bool GUI_App::on_init_inner()
1256
1256
// Set initialization of image handlers before any UI actions - See GH issue #7469
1257
1257
wxInitAllImageHandlers ();
1258
1258
1259
+ // Set our own gui log as an active target
1260
+ m_log_gui = new LogGui ();
1261
+ wxLog::SetActiveTarget (m_log_gui);
1262
+
1259
1263
#if defined(_WIN32) && ! defined(_WIN64)
1260
1264
// Win32 32bit build.
1261
1265
if (wxPlatformInfo::Get ().GetArchName ().substr (0 , 2 ) == " 64" ) {
@@ -4146,5 +4150,31 @@ void GUI_App::show_printer_webview_tab()
4146
4150
mainframe->show_printer_webview_tab (preset_bundle->physical_printers .get_selected_printer_config ());
4147
4151
}
4148
4152
4153
+
4154
+
4155
+ bool LogGui::ignorred_message (const wxString& msg)
4156
+ {
4157
+ for (const wxString& err : std::initializer_list<wxString>{ wxString (" cHRM chunk does not match sRGB" ),
4158
+ wxString (" known incorrect sRGB profile" ) }) {
4159
+ if (msg.Contains (err))
4160
+ return true ;
4161
+ }
4162
+ return false ;
4163
+ }
4164
+
4165
+ void LogGui::DoLogText (const wxString& msg)
4166
+ {
4167
+ if (ignorred_message (msg))
4168
+ return ;
4169
+ wxLogGui::DoLogText (msg);
4170
+ }
4171
+
4172
+ void LogGui::DoLogRecord (wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info)
4173
+ {
4174
+ if (ignorred_message (msg))
4175
+ return ;
4176
+ wxLogGui::DoLogRecord (level, msg, info);
4177
+ }
4178
+
4149
4179
} // GUI
4150
4180
} // Slic3r
Original file line number Diff line number Diff line change @@ -119,6 +119,20 @@ static wxString dots("…", wxConvUTF8);
119
119
#define SUPPORTS_MARKUP
120
120
#endif
121
121
122
+
123
+ // A wrapper class to allow ignoring some known warnings
124
+ // and not bothering users with redundant messages.
125
+ // see https://github.com/prusa3d/PrusaSlicer/issues/12920
126
+ class LogGui : public wxLogGui
127
+ {
128
+ protected:
129
+ void DoLogText (const wxString& msg) override ;
130
+ void DoLogRecord (wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) override ;
131
+
132
+ private:
133
+ bool ignorred_message (const wxString& msg);
134
+ };
135
+
122
136
class GUI_App : public wxApp
123
137
{
124
138
public:
@@ -181,6 +195,7 @@ class GUI_App : public wxApp
181
195
size_t m_instance_hash_int;
182
196
183
197
Search::OptionsSearcher* m_searcher{ nullptr };
198
+ LogGui* m_log_gui { nullptr };
184
199
185
200
public:
186
201
bool OnInit () override ;
You can’t perform that action at this time.
0 commit comments