Be careful not to change the current selection when working around http://trac.wxwidgets.org/ticket/13769
This commit is contained in:
parent
1cc0a79188
commit
40f1176346
1 changed files with 4 additions and 3 deletions
|
@ -229,20 +229,21 @@ sub set_dirty {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($dirty) = @_;
|
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);
|
my $text = $self->{presets_choice}->GetString($i);
|
||||||
|
|
||||||
if ($dirty) {
|
if ($dirty) {
|
||||||
$self->{dirty} = $i;
|
$self->{dirty} = $i;
|
||||||
if ($text !~ / \(modified\)$/) {
|
if ($text !~ / \(modified\)$/) {
|
||||||
$self->{presets_choice}->SetString($i, "$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 {
|
} else {
|
||||||
$self->{dirty} = undef;
|
$self->{dirty} = undef;
|
||||||
$text =~ s/ \(modified\)$//;
|
$text =~ s/ \(modified\)$//;
|
||||||
$self->{presets_choice}->SetString($i, $text);
|
$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;
|
$self->sync_presets;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue