diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index f10ca13148..da0d7ec707 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -190,6 +190,7 @@ sub new { }); # right pane buttons + $self->{btn_slice_gcode} = Wx::Button->new($self, -1, "Slice Now…", wxDefaultPosition, [-1, 30], wxBU_LEFT); $self->{btn_export_gcode} = Wx::Button->new($self, -1, "Export G-code…", wxDefaultPosition, [-1, 30], wxBU_LEFT); $self->{btn_print} = Wx::Button->new($self, -1, "Print…", wxDefaultPosition, [-1, 30], wxBU_LEFT); $self->{btn_send_gcode} = Wx::Button->new($self, -1, "Send to printer", wxDefaultPosition, [-1, 30], wxBU_LEFT); @@ -207,6 +208,7 @@ sub new { arrange bricks.png export_gcode cog_go.png print arrow_up.png + slice_gcode cog_go.png send_gcode arrow_up.png export_stl brick_go.png @@ -225,6 +227,10 @@ sub new { } $self->selection_changed(0); $self->object_list_changed; + EVT_BUTTON($self, $self->{btn_slice_gcode}, sub { + $self->{send_gcode_file} = $self->export_gcode(Wx::StandardPaths::Get->GetTempDir()); + Slic3r::thread_cleanup(); + }); EVT_BUTTON($self, $self->{btn_export_gcode}, sub { $self->export_gcode; }); @@ -391,6 +397,7 @@ sub new { $buttons_sizer->Add($self->{btn_print}, 0, wxALIGN_RIGHT, 0); $buttons_sizer->Add($self->{btn_send_gcode}, 0, wxALIGN_RIGHT, 0); $buttons_sizer->Add($self->{btn_export_gcode}, 0, wxALIGN_RIGHT, 0); + $buttons_sizer->Add($self->{btn_slice_gcode}, 0, wxALIGN_RIGHT, 0); my $right_sizer = Wx::BoxSizer->new(wxVERTICAL); $right_sizer->Add($presets, 0, wxEXPAND | wxTOP, 10) if defined $presets;