mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 03:07:55 -06:00
Merge branch 'profile_changes_reset' into updating
This commit is contained in:
commit
62d67d35ec
28 changed files with 803 additions and 394 deletions
|
@ -149,6 +149,7 @@ sub _init_tabpanel {
|
|||
if (defined $presets){
|
||||
my $reload_dependent_tabs = $tab->get_dependent_tabs;
|
||||
$self->{plater}->update_presets($tab_name, $reload_dependent_tabs, $presets);
|
||||
$self->{plater}->{"selected_item_$tab_name"} = $tab->get_selected_preset_item;
|
||||
if ($tab_name eq 'printer') {
|
||||
# Printer selected at the Printer tab, update "compatible" marks at the print and filament selectors.
|
||||
for my $tab_name_other (qw(print filament)) {
|
||||
|
|
|
@ -514,6 +514,13 @@ sub new {
|
|||
$self->SetSizer($sizer);
|
||||
}
|
||||
|
||||
# Last correct selected item for each preset
|
||||
{
|
||||
$self->{selected_item_print} = 0;
|
||||
$self->{selected_item_filament} = 0;
|
||||
$self->{selected_item_printer} = 0;
|
||||
}
|
||||
|
||||
$self->update_ui_from_settings();
|
||||
|
||||
return $self;
|
||||
|
@ -538,9 +545,21 @@ sub _on_select_preset {
|
|||
# Only update the platter UI for the 2nd and other filaments.
|
||||
wxTheApp->{preset_bundle}->update_platter_filament_ui($idx, $choice);
|
||||
} else {
|
||||
my $selected_item = $choice->GetSelection();
|
||||
return if ($selected_item == $self->{"selected_item_$group"});
|
||||
|
||||
my $selected_string = $choice->GetString($selected_item);
|
||||
if ($selected_string eq "------- System presets -------" ||
|
||||
$selected_string eq "------- User presets -------"){
|
||||
$choice->SetSelection($self->{"selected_item_$group"});
|
||||
return;
|
||||
}
|
||||
|
||||
# call GetSelection() in scalar context as it's context-aware
|
||||
$self->{on_select_preset}->($group, $choice->GetStringSelection)
|
||||
if $self->{on_select_preset};
|
||||
# $self->{on_select_preset}->($group, $choice->GetStringSelection)
|
||||
$self->{on_select_preset}->($group, $selected_string)
|
||||
if $self->{on_select_preset};
|
||||
$self->{"selected_item_$group"} = $selected_item;
|
||||
}
|
||||
# Synchronize config.ini with the current selections.
|
||||
wxTheApp->{preset_bundle}->export_selections(wxTheApp->{app_config});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue