From 9c991d15d156ab9765f073b5679cf435e41aa06d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 14 Apr 2012 15:37:28 +0200 Subject: [PATCH] Don't ask for confirmation (and reset values) when duplicate is set to 'no'. #311 --- lib/Slic3r/GUI/OptionsGroup.pm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Slic3r/GUI/OptionsGroup.pm b/lib/Slic3r/GUI/OptionsGroup.pm index 080127b1d..7a77276d2 100644 --- a/lib/Slic3r/GUI/OptionsGroup.pm +++ b/lib/Slic3r/GUI/OptionsGroup.pm @@ -103,11 +103,17 @@ sub new { } sub update_duplicate_controls { + # prevent infinite loops when calling ourselves + return if +(caller 1)[3] =~ /::update_duplicate_controls$/; + my $value = Slic3r::Config->get('duplicate_mode'); $_->Enable($value eq 'autoarrange') for @{$fields{duplicate}}; $_->Enable($value eq 'autoarrange') for @{$fields{bed_size}}; $_->Enable($value eq 'grid') for @{$fields{duplicate_grid}}; $_->Enable($value ne 'no') for @{$fields{duplicate_distance}}; + Slic3r::Config->set('duplicate', 1) if $value ne 'autoarrange'; + Slic3r::Config->set('duplicate_grid', [1,1]) if $value ne 'grid'; + $_->() for @reload_callbacks; # apply new values } 1;