Ask for confirmation when deselecting a dirty preset.
This commit is contained in:
parent
848784ad95
commit
9e1308c03f
1 changed files with 6 additions and 1 deletions
|
@ -142,7 +142,12 @@ sub on_select_preset {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
|
|
||||||
if (defined $self->{dirty}) {
|
if (defined $self->{dirty}) {
|
||||||
# TODO: prompt user?
|
my $confirm = Wx::MessageDialog->new($self, 'You have unsaved changes. Discard changes and continue anyway?',
|
||||||
|
'Unsaved Changes', wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION);
|
||||||
|
if ($confirm->ShowModal == wxID_NO) {
|
||||||
|
$self->{presets_choice}->SetSelection($self->{dirty});
|
||||||
|
return;
|
||||||
|
}
|
||||||
$self->set_dirty(0);
|
$self->set_dirty(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue