Warn about the need to restart Slic3r to make certain preferences effective

This commit is contained in:
Alessandro Ranellucci 2018-11-10 22:58:31 +01:00
parent 5712674940
commit 1e4fb2d1b1

View File

@ -1,6 +1,7 @@
# Preferences dialog, opens from Menu: File->Preferences # Preferences dialog, opens from Menu: File->Preferences
package Slic3r::GUI::Preferences; package Slic3r::GUI::Preferences;
use List::Util qw(any);
use Wx qw(:dialog :id :misc :sizer :systemsettings wxTheApp); use Wx qw(:dialog :id :misc :sizer :systemsettings wxTheApp);
use Wx::Event qw(EVT_BUTTON EVT_TEXT_ENTER); use Wx::Event qw(EVT_BUTTON EVT_TEXT_ENTER);
use base 'Wx::Dialog'; use base 'Wx::Dialog';
@ -82,7 +83,7 @@ sub new {
opt_id => 'show_host', opt_id => 'show_host',
type => 'bool', type => 'bool',
label => 'Show Controller Tab (requires restart)', label => 'Show Controller Tab (requires restart)',
tooltip => 'Shows/Hides the Controller Tab. Requires a restart of Slic3r.', tooltip => 'Shows/Hides the Controller Tab. (Restart of Slic3r required.)',
default => $Slic3r::GUI::Settings->{_}{show_host}, default => $Slic3r::GUI::Settings->{_}{show_host},
)); ));
$optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( # nudge_val $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( # nudge_val
@ -113,7 +114,7 @@ sub new {
opt_id => 'extended_gui', opt_id => 'extended_gui',
type => 'select', type => 'select',
label => 'Extended GUI: ', label => 'Extended GUI: ',
tooltip => 'Choose extended rotate commands in the toolbar and/or in the context menu. If you don\'t use the default color scheme, the themed icons for the toolbar will be used. Requires a restart of Slic3r.', tooltip => 'Choose extended rotate commands in the toolbar and/or in the context menu. If you don\'t use the default color scheme, the themed icons for the toolbar will be used.(Restart of Slic3r required.)',
labels => ['Default', 'Context only', 'Toolbar only', 'Toolbar and Context', 'Toolbar only (big)', 'Toolbar (big) and Context'], labels => ['Default', 'Context only', 'Toolbar only', 'Toolbar and Context', 'Toolbar only (big)', 'Toolbar (big) and Context'],
values => [0, 1, 2, 3, 4, 5], values => [0, 1, 2, 3, 4, 5],
default => $Slic3r::GUI::Settings->{_}{extended_gui}, default => $Slic3r::GUI::Settings->{_}{extended_gui},
@ -123,7 +124,7 @@ sub new {
opt_id => 'colorscheme', opt_id => 'colorscheme',
type => 'select', type => 'select',
label => 'Color Scheme', label => 'Color Scheme',
tooltip => 'Choose between color schemes - restart of Slic3r required.', tooltip => 'Choose between color schemes. (Restart of Slic3r required.)',
labels => ['Default','Solarized'], # add more schemes, if you want in ColorScheme.pm. labels => ['Default','Solarized'], # add more schemes, if you want in ColorScheme.pm.
values => ['getDefault','getSolarized'], # add more schemes, if you want - those are the names of the corresponding function in ColorScheme.pm. values => ['getDefault','getSolarized'], # add more schemes, if you want - those are the names of the corresponding function in ColorScheme.pm.
default => $Slic3r::GUI::Settings->{_}{colorscheme}, default => $Slic3r::GUI::Settings->{_}{colorscheme},
@ -146,7 +147,7 @@ sub new {
sub _accept { sub _accept {
my $self = shift; my $self = shift;
if ($self->{values}{mode}) { if (any { exists $self->{values}{$_} } qw(show_host extended_gui colorscheme)) {
Slic3r::GUI::warning_catcher($self)->("You need to restart Slic3r to make the changes effective."); Slic3r::GUI::warning_catcher($self)->("You need to restart Slic3r to make the changes effective.");
} }