Handle cancel properly on dir picker.
authorCarl Hetherington <cth@carlh.net>
Wed, 24 Jul 2013 21:25:43 +0000 (22:25 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 24 Jul 2013 21:25:43 +0000 (22:25 +0100)
src/wx/dir_picker_ctrl.cc

index ec7854764e048c435819e129467c33a051f0a28f..962dd50ece04b58c72df5d233ec08efdca90da95 100644 (file)
@@ -68,7 +68,8 @@ void
 DirPickerCtrl::browse_clicked (wxCommandEvent &)
 {
        wxDirDialog* d = new wxDirDialog (this);
-       d->ShowModal ();
-       SetPath (d->GetPath ());
+       if (d->ShowModal () == wxID_OK) {
+               SetPath (d->GetPath ());
+       }
        d->Destroy ();
 }