From fea8c3743fd0710c2716fc6de5a283d378338800 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sun, 7 Apr 2013 15:20:47 +0100 Subject: [PATCH] Give a hopefully helpful message when clicking Open without selecting a folder (#99). --- ChangeLog | 3 +++ src/tools/dvdomatic.cc | 12 ++++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ece1117b0..1235944df 100644 --- 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 * Version 0.79 released. diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index b408ef505..80a33efef 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -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 { -- 2.30.2