From 9e1308c03fa7dcfb112ba7849327ee4e24aeafec Mon Sep 17 00:00:00 2001 From: Henrik Brix Andersen Date: Fri, 27 Jul 2012 13:57:58 +0200 Subject: [PATCH] Ask for confirmation when deselecting a dirty preset. --- lib/Slic3r/GUI/Tab.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/GUI/Tab.pm b/lib/Slic3r/GUI/Tab.pm index 2ac1fb422..7b2a65b8c 100644 --- a/lib/Slic3r/GUI/Tab.pm +++ b/lib/Slic3r/GUI/Tab.pm @@ -142,7 +142,12 @@ sub on_select_preset { my $self = shift; 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); }