Give a hopefully helpful message when clicking Open without selecting a folder (...
authorCarl Hetherington <cth@carlh.net>
Sun, 7 Apr 2013 14:20:47 +0000 (15:20 +0100)
committerCarl Hetherington <cth@carlh.net>
Sun, 7 Apr 2013 14:20:47 +0000 (15:20 +0100)
ChangeLog
src/tools/dvdomatic.cc

index ece1117b0e724571e095f56f7bc052db2e3c4e4b..1235944df3d88798efce852b67fef5fc6e6e2c94 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,9 @@
        * Add more explanatory text to describe what is
        happening with scaling, cropping and padding (#106).
 
+       * Give a hopefully helpful message when clicking Open
+       without selecting a folder (#99).
+
 2013-04-01  Carl Hetherington  <cth@carlh.net>
 
        * Version 0.79 released.
index b408ef50592be03a67d0e9168da7a03a823aca1a..80a33efefd9400116b91be16d2e189158bb3e160 100644 (file)
@@ -317,8 +317,16 @@ private:
        void file_open (wxCommandEvent &)
        {
                wxDirDialog* c = new wxDirDialog (this, _("Select film to open"), wxStandardPaths::Get().GetDocumentsDir(), wxDEFAULT_DIALOG_STYLE | wxDD_DIR_MUST_EXIST);
-               int const r = c->ShowModal ();
-               
+               int r;
+               while (1) {
+                       r = c->ShowModal ();
+                       if (r == wxID_OK && c->GetPath() == wxStandardPaths::Get().GetDocumentsDir()) {
+                               error_dialog (this, _("You did not select a folder.  Make sure that you select a folder before clicking Open."));
+                       } else {
+                               break;
+                       }
+               }
+                       
                if (r == wxID_OK) {
                        maybe_save_then_delete_film ();
                        try {