mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 04:08:02 -06:00
Ask for confirmation when slicing more than one copy. #165
This commit is contained in:
parent
cc040df42a
commit
4dd33c6b05
1 changed files with 10 additions and 2 deletions
|
@ -4,8 +4,8 @@ use warnings;
|
||||||
use utf8;
|
use utf8;
|
||||||
|
|
||||||
use File::Basename qw(basename dirname);
|
use File::Basename qw(basename dirname);
|
||||||
use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxID_OK wxFD_OPEN
|
use Wx qw(:sizer :progressdialog wxOK wxICON_INFORMATION wxICON_WARNING wxICON_ERROR wxICON_QUESTION
|
||||||
wxFD_SAVE wxDEFAULT wxNORMAL);
|
wxOK wxCANCEL wxID_OK wxFD_OPEN wxFD_SAVE wxDEFAULT wxNORMAL);
|
||||||
use Wx::Event qw(EVT_BUTTON);
|
use Wx::Event qw(EVT_BUTTON);
|
||||||
use base 'Wx::Panel';
|
use base 'Wx::Panel';
|
||||||
|
|
||||||
|
@ -152,6 +152,14 @@ sub do_slice {
|
||||||
eval {
|
eval {
|
||||||
# validate configuration
|
# validate configuration
|
||||||
Slic3r::Config->validate;
|
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
|
# select input file
|
||||||
my $dir = $last_skein_dir || $last_config_dir || "";
|
my $dir = $last_skein_dir || $last_config_dir || "";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue