Better error handling in new ocr

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@1842 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2013-05-26 17:42:14 +00:00
parent cbaf6ab1b1
commit 86e78659b6

View File

@ -3724,6 +3724,13 @@ namespace Nikse.SubtitleEdit.Forms
if (_nocrChars == null)
LoadNOcrWithCurrentLanguage();
if (_nocrChars == null)
{
MessageBox.Show("Fatal - No NOCR dictionary loaded!");
SetButtonsEnabledAfterOcrDone();
return;
}
_nocrThreadsStop = false;
_nocrThreads = new List<BackgroundWorker>();
_nocrThreadResults = new string[_subtitle.Paragraphs.Count];
@ -3839,9 +3846,12 @@ namespace Nikse.SubtitleEdit.Forms
private void LoadNOcrWithCurrentLanguage()
{
string fileName = GetNOcrLanguageFileName();
LoadNOcr(fileName, true);
fileName = fileName.Insert(fileName.Length - 4, "_User");
LoadNOcr(fileName, false);
if (!string.IsNullOrEmpty(fileName))
{
LoadNOcr(fileName, true);
fileName = fileName.Insert(fileName.Length - 4, "_User");
LoadNOcr(fileName, false);
}
}
internal void SaveNOcrWithCurrentLanguage()