Fix concurrency issue in Wx when changing the number of extruders. #2863
This commit is contained in:
parent
d549393a84
commit
97c701cdac
@ -106,6 +106,7 @@ sub new {
|
|||||||
|
|
||||||
$self->{config} = Slic3r::Config->new;
|
$self->{config} = Slic3r::Config->new;
|
||||||
$self->build;
|
$self->build;
|
||||||
|
$self->update_tree;
|
||||||
$self->_update;
|
$self->_update;
|
||||||
if ($self->hidden_options) {
|
if ($self->hidden_options) {
|
||||||
$self->{config}->apply(Slic3r::Config->new_from_defaults($self->hidden_options));
|
$self->{config}->apply(Slic3r::Config->new_from_defaults($self->hidden_options));
|
||||||
@ -282,7 +283,6 @@ sub add_options_page {
|
|||||||
$page->Hide;
|
$page->Hide;
|
||||||
$self->{sizer}->Add($page, 1, wxEXPAND | wxLEFT, 5);
|
$self->{sizer}->Add($page, 1, wxEXPAND | wxLEFT, 5);
|
||||||
push @{$self->{pages}}, $page;
|
push @{$self->{pages}}, $page;
|
||||||
$self->update_tree;
|
|
||||||
return $page;
|
return $page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -961,7 +961,7 @@ sub _update_description {
|
|||||||
|
|
||||||
package Slic3r::GUI::Tab::Printer;
|
package Slic3r::GUI::Tab::Printer;
|
||||||
use base 'Slic3r::GUI::Tab';
|
use base 'Slic3r::GUI::Tab';
|
||||||
use Wx qw(:sizer :button :bitmap :misc :id);
|
use Wx qw(wxTheApp :sizer :button :bitmap :misc :id);
|
||||||
use Wx::Event qw(EVT_BUTTON);
|
use Wx::Event qw(EVT_BUTTON);
|
||||||
|
|
||||||
sub name { 'printer' }
|
sub name { 'printer' }
|
||||||
@ -1039,7 +1039,9 @@ sub build {
|
|||||||
my ($opt_id) = @_;
|
my ($opt_id) = @_;
|
||||||
if ($opt_id eq 'extruders_count') {
|
if ($opt_id eq 'extruders_count') {
|
||||||
$self->update_dirty;
|
$self->update_dirty;
|
||||||
|
wxTheApp->CallAfter(sub {
|
||||||
$self->_extruders_count_changed($optgroup->get_value('extruders_count'));
|
$self->_extruders_count_changed($optgroup->get_value('extruders_count'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -1225,8 +1227,6 @@ sub _build_extruder_pages {
|
|||||||
$optgroup->append_single_option_line($_, $extruder_idx)
|
$optgroup->append_single_option_line($_, $extruder_idx)
|
||||||
for qw(retract_length_toolchange retract_restart_extra_toolchange);
|
for qw(retract_length_toolchange retract_restart_extra_toolchange);
|
||||||
}
|
}
|
||||||
|
|
||||||
$self->{extruder_pages}[$extruder_idx]{disabled} = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# remove extra pages
|
# remove extra pages
|
||||||
|
Loading…
Reference in New Issue
Block a user