From 1d7e1db8e514a6e414592a27436aed1c982a0b20 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sat, 9 Jul 2022 21:02:08 +0200 Subject: [PATCH] Fixed creating new project over an existing one doesn't replaces the old one Closes #16 --- I18N Commander/UI WinForms/Components/LoaderStart.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/I18N Commander/UI WinForms/Components/LoaderStart.cs b/I18N Commander/UI WinForms/Components/LoaderStart.cs index 40f614f..052fe29 100644 --- a/I18N Commander/UI WinForms/Components/LoaderStart.cs +++ b/I18N Commander/UI WinForms/Components/LoaderStart.cs @@ -110,6 +110,12 @@ public partial class LoaderStart : UserControl return; var destinationFilePath = saveDialog.FileName; + + // When the user chose an existing file, we delete it: + // (note: the user already accepts overwriting the file) + if (File.Exists(destinationFilePath)) + File.Delete(destinationFilePath); + LoaderStart.UpdateRecentProjectsWithPruning(destinationFilePath); this.OpenProject(destinationFilePath); }