mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 22:54:08 -06:00
Refactor OptionsGroup to decouple it from the config repository, add ConfigOptionsGroup
This commit is contained in:
parent
09a222f8b2
commit
1d364d7823
6 changed files with 290 additions and 119 deletions
|
@ -202,12 +202,22 @@ sub config_wizard {
|
|||
my $self = shift;
|
||||
|
||||
return unless $self->check_unsaved_changes;
|
||||
if (Slic3r::GUI::ConfigWizard->new($self)->run) {
|
||||
$_->() for values %Slic3r::GUI::OptionsGroup::reload_callbacks;
|
||||
$_->set_dirty(1) for values %{$self->{options_tabs}};
|
||||
if (my %settings = Slic3r::GUI::ConfigWizard->new($self)->run) {
|
||||
$self->set_value($_, $settings{$_}) for keys %settings;
|
||||
}
|
||||
}
|
||||
|
||||
sub set_value {
|
||||
my $self = shift;
|
||||
my ($opt_key, $value) = @_;
|
||||
|
||||
my $changed = 0;
|
||||
foreach my $tab (values %{$self->{options_tabs}}) {
|
||||
$changed = 1 if $tab->set_value($opt_key, $value);
|
||||
}
|
||||
return $changed;
|
||||
}
|
||||
|
||||
sub check_unsaved_changes {
|
||||
my $self = shift;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue