From 4dd33c6b05cf8a1c3264406a473b9c47968b9744 Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Sun, 5 Feb 2012 16:43:44 +0100 Subject: [PATCH] Ask for confirmation when slicing more than one copy. #165 --- lib/Slic3r/GUI/SkeinPanel.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/SkeinPanel.pm b/lib/Slic3r/GUI/SkeinPanel.pm index bb00af96e..58b5198e0 100644 --- a/lib/Slic3r/GUI/SkeinPanel.pm +++ b/lib/Slic3r/GUI/SkeinPanel.pm @@ -4,8 +4,8 @@ use warnings; use utf8; use File::Basename qw(basename dirname); -use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxID_OK wxFD_OPEN - wxFD_SAVE wxDEFAULT wxNORMAL); +use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxICON_QUESTION + wxOK wxCANCEL wxID_OK wxFD_OPEN wxFD_SAVE wxDEFAULT wxNORMAL); use Wx::Event qw(EVT_BUTTON); use base 'Wx::Panel'; @@ -152,6 +152,14 @@ sub do_slice { eval { # validate configuration Slic3r::Config->validate; + + # confirm slicing of more than one copies + my $copies = Slic3r::Config->get('duplicate_x') * Slic3r::Config->get('duplicate_y'); + if ($copies > 1) { + my $confirmation = Wx::MessageDialog->new($self, "Are you sure you want to slice $copies copies?", + 'Confirm', wxICON_QUESTION | wxOK | wxCANCEL); + return unless $confirmation->ShowModal == wxID_OK; + } # select input file my $dir = $last_skein_dir || $last_config_dir || "";