Skip to content
Browse files

Be careful not to change the current selection when working around ht…

  • Loading branch information...
1 parent 1cc0a79 commit 40f1176346efa3e320aaf3ea90a51fcc04c8c478 @henrikbrixandersen henrikbrixandersen committed
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/Slic3r/GUI/Tab.pm
View
7 lib/Slic3r/GUI/Tab.pm
@@ -229,20 +229,21 @@ sub set_dirty {
my $self = shift;
my ($dirty) = @_;
- my $i = $self->{dirty} // $self->{presets_choice}->GetSelection; #/
+ my $selection = $self->{presets_choice}->GetSelection;
+ my $i = $self->{dirty} // $selection; #/
my $text = $self->{presets_choice}->GetString($i);
if ($dirty) {
$self->{dirty} = $i;
if ($text !~ / \(modified\)$/) {
$self->{presets_choice}->SetString($i, "$text (modified)");
- $self->{presets_choice}->SetSelection($i); # wxMSW needs this after every SetString()
+ $self->{presets_choice}->SetSelection($selection); # http://trac.wxwidgets.org/ticket/13769
}
} else {
$self->{dirty} = undef;
$text =~ s/ \(modified\)$//;
$self->{presets_choice}->SetString($i, $text);
- $self->{presets_choice}->SetSelection($i); # wxMSW needs this after every SetString()
+ $self->{presets_choice}->SetSelection($selection); # http://trac.wxwidgets.org/ticket/13769
}
$self->sync_presets;
}

0 comments on commit 40f1176

Please sign in to comment.
Something went wrong with that request. Please try again.