Use the correct prompt for file/folder.
authorCarl Hetherington <cth@carlh.net>
Sat, 28 Jan 2023 09:18:18 +0000 (10:18 +0100)
committerCarl Hetherington <cth@carlh.net>
Sat, 11 Feb 2023 21:26:38 +0000 (22:26 +0100)
src/tools/dcpomatic_kdm.cc

index f0406c1d0eecaaa346ba04184f60d27f23fa038e..0d79d67a88245c02f75420bc0e485b5ad2b0e3f5 100644 (file)
@@ -312,10 +312,17 @@ private:
 
        bool confirm_overwrite (boost::filesystem::path path)
        {
-               return confirm_dialog (
-                       this,
-                       wxString::Format (_("File %s already exists.  Do you want to overwrite it?"), std_to_wx(path.string()).data())
-                       );
+               if (boost::filesystem::is_directory(path)) {
+                       return confirm_dialog (
+                               this,
+                               wxString::Format(_("Folder %s already exists.  Do you want to overwrite it?"), std_to_wx(path.string()).data())
+                               );
+               } else {
+                       return confirm_dialog (
+                               this,
+                               wxString::Format(_("File %s already exists.  Do you want to overwrite it?"), std_to_wx(path.string()).data())
+                               );
+               }
        }
 
        /** @id if not nullptr this is filled in with the wxTreeItemId of the selection */