mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-17 02:45:57 +08:00
Fix for #12920 - Prusa Slicer 2.8 rc 2 / iCCP: known incorrect sRGB profile
(SPE-2485)
This commit is contained in:
parent
33bafd28e3
commit
90017e5e6d
@ -1256,6 +1256,10 @@ bool GUI_App::on_init_inner()
|
|||||||
// Set initialization of image handlers before any UI actions - See GH issue #7469
|
// Set initialization of image handlers before any UI actions - See GH issue #7469
|
||||||
wxInitAllImageHandlers();
|
wxInitAllImageHandlers();
|
||||||
|
|
||||||
|
// Set our own gui log as an active target
|
||||||
|
m_log_gui = new LogGui();
|
||||||
|
wxLog::SetActiveTarget(m_log_gui);
|
||||||
|
|
||||||
#if defined(_WIN32) && ! defined(_WIN64)
|
#if defined(_WIN32) && ! defined(_WIN64)
|
||||||
// Win32 32bit build.
|
// Win32 32bit build.
|
||||||
if (wxPlatformInfo::Get().GetArchName().substr(0, 2) == "64") {
|
if (wxPlatformInfo::Get().GetArchName().substr(0, 2) == "64") {
|
||||||
@ -4146,5 +4150,31 @@ void GUI_App::show_printer_webview_tab()
|
|||||||
mainframe->show_printer_webview_tab(preset_bundle->physical_printers.get_selected_printer_config());
|
mainframe->show_printer_webview_tab(preset_bundle->physical_printers.get_selected_printer_config());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
bool LogGui::ignorred_message(const wxString& msg)
|
||||||
|
{
|
||||||
|
for(const wxString& err : std::initializer_list<wxString>{ wxString("cHRM chunk does not match sRGB"),
|
||||||
|
wxString("known incorrect sRGB profile") }) {
|
||||||
|
if (msg.Contains(err))
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogGui::DoLogText(const wxString& msg)
|
||||||
|
{
|
||||||
|
if (ignorred_message(msg))
|
||||||
|
return;
|
||||||
|
wxLogGui::DoLogText(msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LogGui::DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info)
|
||||||
|
{
|
||||||
|
if (ignorred_message(msg))
|
||||||
|
return;
|
||||||
|
wxLogGui::DoLogRecord(level, msg, info);
|
||||||
|
}
|
||||||
|
|
||||||
} // GUI
|
} // GUI
|
||||||
} //Slic3r
|
} //Slic3r
|
||||||
|
@ -119,6 +119,20 @@ static wxString dots("…", wxConvUTF8);
|
|||||||
#define SUPPORTS_MARKUP
|
#define SUPPORTS_MARKUP
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// A wrapper class to allow ignoring some known warnings
|
||||||
|
// and not bothering users with redundant messages.
|
||||||
|
// see https://github.com/prusa3d/PrusaSlicer/issues/12920
|
||||||
|
class LogGui : public wxLogGui
|
||||||
|
{
|
||||||
|
protected:
|
||||||
|
void DoLogText(const wxString& msg) override;
|
||||||
|
void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
bool ignorred_message(const wxString& msg);
|
||||||
|
};
|
||||||
|
|
||||||
class GUI_App : public wxApp
|
class GUI_App : public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -181,6 +195,7 @@ private:
|
|||||||
size_t m_instance_hash_int;
|
size_t m_instance_hash_int;
|
||||||
|
|
||||||
Search::OptionsSearcher* m_searcher{ nullptr };
|
Search::OptionsSearcher* m_searcher{ nullptr };
|
||||||
|
LogGui* m_log_gui { nullptr };
|
||||||
|
|
||||||
public:
|
public:
|
||||||
bool OnInit() override;
|
bool OnInit() override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user