From 8e2207074456fa9f39eb5ead72bf1a237e7ded0a Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Thu, 18 Feb 2021 19:42:39 +0100 Subject: [PATCH] Add err msg about empty sub when saving --- LanguageMaster.xml | 1 + src/ui/Forms/Main.cs | 3 +++ src/ui/Logic/Language.cs | 1 + src/ui/Logic/LanguageDeserializer.cs | 3 +++ src/ui/Logic/LanguageStructure.cs | 1 + 5 files changed, 9 insertions(+) diff --git a/LanguageMaster.xml b/LanguageMaster.xml index 88723387e..011582829 100644 --- a/LanguageMaster.xml +++ b/LanguageMaster.xml @@ -1333,6 +1333,7 @@ To use an API key go to "Options -> Settings -> Tools" to enter your Googl Save changes to original {0}? Save subtitle as... Save original subtitle as... + Cannot save empty subtitle No subtitle loaded Visual sync - selected lines Visual sync diff --git a/src/ui/Forms/Main.cs b/src/ui/Forms/Main.cs index 54382a4ef..6b74ef700 100644 --- a/src/ui/Forms/Main.cs +++ b/src/ui/Forms/Main.cs @@ -3970,6 +3970,7 @@ namespace Nikse.SubtitleEdit.Forms { if (!IsSubtitleLoaded) { + ShowStatus(_language.CannotSaveEmptySubtitle); return; } @@ -3982,6 +3983,7 @@ namespace Nikse.SubtitleEdit.Forms { if (!IsSubtitleLoaded) { + ShowStatus(_language.CannotSaveEmptySubtitle); return; } @@ -5359,6 +5361,7 @@ namespace Nikse.SubtitleEdit.Forms { if (!IsSubtitleLoaded) { + ShowStatus(_language.CannotSaveEmptySubtitle); return; } diff --git a/src/ui/Logic/Language.cs b/src/ui/Logic/Language.cs index 4a5318d4e..e13517493 100644 --- a/src/ui/Logic/Language.cs +++ b/src/ui/Logic/Language.cs @@ -1223,6 +1223,7 @@ namespace Nikse.SubtitleEdit.Logic SaveChangesToOriginalX = "Save changes to original {0}?", SaveSubtitleAs = "Save subtitle as...", SaveOriginalSubtitleAs = "Save original subtitle as...", + CannotSaveEmptySubtitle = "Cannot save empty subtitle", NoSubtitleLoaded = "No subtitle loaded", VisualSyncSelectedLines = "Visual sync - selected lines", VisualSyncTitle = "Visual sync", diff --git a/src/ui/Logic/LanguageDeserializer.cs b/src/ui/Logic/LanguageDeserializer.cs index c92db3717..9c70d94c5 100644 --- a/src/ui/Logic/LanguageDeserializer.cs +++ b/src/ui/Logic/LanguageDeserializer.cs @@ -2680,6 +2680,9 @@ namespace Nikse.SubtitleEdit.Logic case "Main/SaveOriginalSubtitleAs": language.Main.SaveOriginalSubtitleAs = reader.Value; break; + case "Main/CannotSaveEmptySubtitle": + language.Main.CannotSaveEmptySubtitle = reader.Value; + break; case "Main/NoSubtitleLoaded": language.Main.NoSubtitleLoaded = reader.Value; break; diff --git a/src/ui/Logic/LanguageStructure.cs b/src/ui/Logic/LanguageStructure.cs index 0cebd0698..244e240fb 100644 --- a/src/ui/Logic/LanguageStructure.cs +++ b/src/ui/Logic/LanguageStructure.cs @@ -1095,6 +1095,7 @@ public string SaveChangesToOriginalX { get; set; } public string SaveSubtitleAs { get; set; } public string SaveOriginalSubtitleAs { get; set; } + public string CannotSaveEmptySubtitle { get; set; } public string NoSubtitleLoaded { get; set; } public string VisualSyncSelectedLines { get; set; } public string VisualSyncTitle { get; set; }