mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-21 21:58:03 -06:00
Load the wxWidgets PNG handler only once.
This commit is contained in:
parent
a0268a1906
commit
354408c7e6
2 changed files with 3 additions and 2 deletions
|
@ -112,7 +112,7 @@ sub OnInit {
|
||||||
$run_wizard = 1 if $self->{preset_bundle}->has_defauls_only;
|
$run_wizard = 1 if $self->{preset_bundle}->has_defauls_only;
|
||||||
|
|
||||||
# application frame
|
# application frame
|
||||||
Wx::Image::AddHandler(Wx::PNGHandler->new);
|
Wx::Image::FindHandlerType(wxBITMAP_TYPE_PNG) || Wx::Image::AddHandler(Wx::PNGHandler->new);
|
||||||
$self->{mainframe} = my $frame = Slic3r::GUI::MainFrame->new(
|
$self->{mainframe} = my $frame = Slic3r::GUI::MainFrame->new(
|
||||||
# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden.
|
# If set, the "Controller" tab for the control of the printer over serial line and the serial port settings are hidden.
|
||||||
no_controller => $self->{app_config}->get('no_controller'),
|
no_controller => $self->{app_config}->get('no_controller'),
|
||||||
|
|
|
@ -34,7 +34,8 @@ PresetBundle::PresetBundle() :
|
||||||
m_bitmapCompatible(new wxBitmap),
|
m_bitmapCompatible(new wxBitmap),
|
||||||
m_bitmapIncompatible(new wxBitmap)
|
m_bitmapIncompatible(new wxBitmap)
|
||||||
{
|
{
|
||||||
::wxInitAllImageHandlers();
|
if (wxImage::FindHandler(wxBITMAP_TYPE_PNG) == nullptr)
|
||||||
|
wxImage::AddHandler(new wxPNGHandler);
|
||||||
|
|
||||||
// Create the ID config keys, as they are not part of the Static print config classes.
|
// Create the ID config keys, as they are not part of the Static print config classes.
|
||||||
this->prints.preset(0).config.opt_string("print_settings_id", true);
|
this->prints.preset(0).config.opt_string("print_settings_id", true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue