From 49cf4095ecb055b82c50e58bc9c744fb3d67da64 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Thu, 8 Oct 2015 22:55:02 -0500 Subject: [PATCH] added "slice now" button to plater UI --- lib/Slic3r/GUI/Plater.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 79e9ae2598..9aaf07597d 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;