From 6c7c089fc4d88166c25a69a054fc79273e953313 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 4 Jan 2015 19:29:34 +0100 Subject: [PATCH] Disable the "Export G-code" and "Send to print" buttons when other actions are pending --- lib/Slic3r/GUI/Plater.pm | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 63f1685b8..951a4f30b 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -1001,6 +1001,9 @@ sub export_gcode { $self->on_export_completed($result); } + # this updates buttons status + $self->object_list_changed; + return $self->{export_gcode_output_file}; } @@ -1080,6 +1083,9 @@ sub on_export_completed { $self->send_gcode if $send_gcode; $self->{send_gcode_file} = undef; + + # this updates buttons status + $self->object_list_changed; } sub send_gcode { @@ -1377,6 +1383,11 @@ sub object_list_changed { $self->{"btn_$_"}->$method for grep $self->{"btn_$_"}, qw(reset arrange export_gcode export_stl send_gcode); + if ($self->{export_gcode_output_file} || $self->{send_gcode_file}) { + $self->{btn_export_gcode}->Disable; + $self->{btn_send_gcode}->Disable; + } + if ($self->{htoolbar}) { $self->{htoolbar}->EnableTool($_, $have_objects) for (TB_RESET, TB_ARRANGE);