diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm index 80532784c..57e92f134 100644 --- a/lib/Slic3r.pm +++ b/lib/Slic3r.pm @@ -21,6 +21,9 @@ BEGIN { $have_threads = $Config{useithreads} && eval "use threads; use Thread::Queue; 1"; } +use FindBin; +our $var = "$FindBin::Bin/var"; + use Moo; use Slic3r::Config; use Slic3r::ExPolygon; @@ -43,6 +46,7 @@ use Slic3r::Print; use Slic3r::Print::Object; use Slic3r::Surface; use Slic3r::TriangleMesh; +eval "use Slic3r::Build"; our $threads = $have_threads ? 2 : 1; diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index 00f2c30d2..600708bfb 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -21,7 +21,7 @@ sub OnInit { my $frame = Wx::Frame->new( undef, -1, 'Slic3r', [-1, -1], Wx::wxDefaultSize, wxDEFAULT_FRAME_STYLE ^ (wxRESIZE_BORDER | wxMAXIMIZE_BOX) ); Wx::Image::AddHandler(Wx::PNGHandler->new); - $frame->SetIcon(Wx::Icon->new("$FindBin::Bin/var/Slic3r_128px.png", &Wx::wxBITMAP_TYPE_PNG) ); + $frame->SetIcon(Wx::Icon->new("$Slic3r::var/Slic3r_128px.png", &Wx::wxBITMAP_TYPE_PNG) ); my $panel = Slic3r::GUI::SkeinPanel->new($frame); my $box = Wx::BoxSizer->new(wxVERTICAL); diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index db4467bed..87c736e30 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -57,16 +57,16 @@ sub new { if (!&Wx::wxMSW) { Wx::ToolTip::Enable(1); $self->{htoolbar} = Wx::ToolBar->new($self, -1, [-1, -1], [-1, -1], &Wx::wxTB_HORIZONTAL | &Wx::wxTB_HORZ_TEXT); - $self->{htoolbar}->AddTool(TB_MORE, "More", Wx::Bitmap->new("$FindBin::Bin/var/add.png", &Wx::wxBITMAP_TYPE_PNG), ''); - $self->{htoolbar}->AddTool(TB_LESS, "Less", Wx::Bitmap->new("$FindBin::Bin/var/delete.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_MORE, "More", Wx::Bitmap->new("$Slic3r::var/add.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_LESS, "Less", Wx::Bitmap->new("$Slic3r::var/delete.png", &Wx::wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddSeparator; - $self->{htoolbar}->AddTool(TB_45CCW, "45° ccw", Wx::Bitmap->new("$FindBin::Bin/var/arrow_rotate_anticlockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); - $self->{htoolbar}->AddTool(TB_45CW, "45° cw", Wx::Bitmap->new("$FindBin::Bin/var/arrow_rotate_clockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); - $self->{htoolbar}->AddTool(TB_ROTATE, "Rotate...", Wx::Bitmap->new("$FindBin::Bin/var/arrow_rotate_clockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_45CCW, "45° ccw", Wx::Bitmap->new("$Slic3r::var/arrow_rotate_anticlockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_45CW, "45° cw", Wx::Bitmap->new("$Slic3r::var/arrow_rotate_clockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_ROTATE, "Rotate...", Wx::Bitmap->new("$Slic3r::var/arrow_rotate_clockwise.png", &Wx::wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddSeparator; - $self->{htoolbar}->AddTool(TB_SCALE, "Scale...", Wx::Bitmap->new("$FindBin::Bin/var/arrow_out.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_SCALE, "Scale...", Wx::Bitmap->new("$Slic3r::var/arrow_out.png", &Wx::wxBITMAP_TYPE_PNG), ''); $self->{htoolbar}->AddSeparator; - $self->{htoolbar}->AddTool(TB_SPLIT, "Split", Wx::Bitmap->new("$FindBin::Bin/var/shape_ungroup.png", &Wx::wxBITMAP_TYPE_PNG), ''); + $self->{htoolbar}->AddTool(TB_SPLIT, "Split", Wx::Bitmap->new("$Slic3r::var/shape_ungroup.png", &Wx::wxBITMAP_TYPE_PNG), ''); } else { my %tbar_buttons = (increase => "More", decrease => "Less", rotate45ccw => "45°", rotate45cw => "45°", rotate => "Rotate…", changescale => "Scale…", split => "Split"); @@ -104,7 +104,7 @@ sub new { split shape_ungroup.png ); for (grep $self->{"btn_$_"}, keys %icons) { - $self->{"btn_$_"}->SetBitmap(Wx::Bitmap->new("$FindBin::Bin/var/$icons{$_}", &Wx::wxBITMAP_TYPE_PNG)); + $self->{"btn_$_"}->SetBitmap(Wx::Bitmap->new("$Slic3r::var/$icons{$_}", &Wx::wxBITMAP_TYPE_PNG)); } } $self->selection_changed(0); diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index 8c5ff1d35..f695acca7 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -90,7 +90,7 @@ sub new { if (eval "use Growl::GNTP; 1") { # register growl notifications eval { - $self->{growler} = Growl::GNTP->new(AppName => 'Slic3r', AppIcon => "$FindBin::Bin/var/Slic3r.png"); + $self->{growler} = Growl::GNTP->new(AppName => 'Slic3r', AppIcon => "$Slic3r::var/Slic3r.png"); $self->{growler}->register([{Name => 'SKEIN_DONE', DisplayName => 'Slicing Done'}]); }; }