diff --git a/src/Forms/Main.Designer.cs b/src/Forms/Main.Designer.cs
index 3b09a3cda..e9a3f09ca 100644
--- a/src/Forms/Main.Designer.cs
+++ b/src/Forms/Main.Designer.cs
@@ -1574,7 +1574,7 @@
this.fixCommonErrorsInSelectedLinesToolStripMenuItem,
this.changeCasingForSelectedLinesToolStripMenuItem});
this.contextMenuStripListview.Name = "contextMenuStripListview";
- this.contextMenuStripListview.Size = new System.Drawing.Size(276, 562);
+ this.contextMenuStripListview.Size = new System.Drawing.Size(276, 540);
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
//
// toolStripMenuItemDelete
diff --git a/src/Forms/Main.cs b/src/Forms/Main.cs
index 9832b9c1e..bc2d161cb 100644
--- a/src/Forms/Main.cs
+++ b/src/Forms/Main.cs
@@ -85,7 +85,7 @@ namespace Nikse.SubtitleEdit.Forms
if (versionInfo.Length >= 3 && versionInfo[2] != "0")
_title += "." + versionInfo[2];
}
- _title = "Subtitle Edit 3.0 RC3";
+ _title = "Subtitle Edit 3.0 RC4";
return _title;
}
}
@@ -5988,7 +5988,7 @@ namespace Nikse.SubtitleEdit.Forms
private string GetPeakWaveFileName(string videoFileName)
{
- string dir = Configuration.BaseDirectory + "WaveForms";
+ string dir = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (!Directory.Exists(dir))
Directory.CreateDirectory(dir);
diff --git a/src/Forms/Main.resx b/src/Forms/Main.resx
index 9a18a96cb..7aaac89d8 100644
--- a/src/Forms/Main.resx
+++ b/src/Forms/Main.resx
@@ -127,28 +127,28 @@
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
- YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAATQSURBVFhH7ZfbT1xVFMax+qQv6l9h0sQHffNFHwxNpTNi
- MRQpNLFFWiOUWhWrrYnRGojG2sZ6aYhcBhmhIDCA1EyH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53FUaTmG9FTRBqOZF4XNPLHWiHDgwymhMMJxhFo0lVMMJFAT11NzUN7woRb06ZN
+ 7XCZ6w0bKxN4z3FEdBgfc5xnwIozhb6Q0LF/LKLzgAiH87cNUqU3c0NQEzryh8pAhie5pX9IYx4RU1JD
+ AlOCGQS2BI5vvvGGr6am+hUWi9VlO9MOlmZG8PGYhbglAkyepAOWunosiRvxQhfWhTjMi/C3xP3202is
+ UPZ/d0yB6hCG9FHm1EK6w9GsH5NbU2ICN4L5BH4ECZpqao1MpnqvjaUZrMyNwOe5wcxYH1osjeOP3Hu+
+ Bherv1ObcCR9/r/bP/Lfci3LW++RZdR6KmACAW0ofQITAisCewJXgnkECwhEVMTYsSMadLWY0Gcyb0+a
+ qHVPj1yT5xwCWobnHzNZjOkv+Olv5PlQgpGPMqD1p2WYTDCNwJzAkoA6QpcdLYndqFGjfCZpM8s1WBqF
+ rNGjaQwd//JGfKHCXwZTUEdoT9B6UmfoRyr9KqKg17RX6Cs4/Z3G0QSeHD8DUcLoZXrXvpcAAAAASUVO
RK5CYII=
diff --git a/src/Forms/Settings.cs b/src/Forms/Settings.cs
index 34261fcbf..e2b85d399 100644
--- a/src/Forms/Settings.cs
+++ b/src/Forms/Settings.cs
@@ -360,7 +360,7 @@ namespace Nikse.SubtitleEdit.Forms
private void InitializeWaveFormsFolderEmpty(LanguageStructure.Settings language)
{
- string waveFormsFolder = Path.Combine(Configuration.BaseDirectory, "WaveForms");
+ string waveFormsFolder = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (Directory.Exists(waveFormsFolder))
{
long bytes = 0;
@@ -1244,7 +1244,7 @@ namespace Nikse.SubtitleEdit.Forms
private void buttonWaveFormsFolderEmpty_Click(object sender, EventArgs e)
{
- string waveFormsFolder = Path.Combine(Configuration.BaseDirectory, "WaveForms");
+ string waveFormsFolder = Configuration.WaveFormsFolder.TrimEnd(Path.DirectorySeparatorChar);
if (Directory.Exists(waveFormsFolder))
{
DirectoryInfo di = new DirectoryInfo(waveFormsFolder);
diff --git a/src/Forms/VobSubEditCharacters.cs b/src/Forms/VobSubEditCharacters.cs
index f675bfd70..0fc9c2dfa 100644
--- a/src/Forms/VobSubEditCharacters.cs
+++ b/src/Forms/VobSubEditCharacters.cs
@@ -27,7 +27,7 @@ namespace Nikse.SubtitleEdit.Forms
InitializeComponent();
pictureBox1.SizeMode = PictureBoxSizeMode.AutoSize;
- _directoryPath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + databaseFolderName + Path.DirectorySeparatorChar;
+ _directoryPath = Configuration.VobSubCompareFolder + databaseFolderName + Path.DirectorySeparatorChar;
if (!File.Exists(_directoryPath + "CompareDescription.xml"))
_compareDoc.LoadXml("");
else
diff --git a/src/Forms/VobSubOcr.Designer.cs b/src/Forms/VobSubOcr.Designer.cs
index e83a9b6dd..aab151134 100644
--- a/src/Forms/VobSubOcr.Designer.cs
+++ b/src/Forms/VobSubOcr.Designer.cs
@@ -259,7 +259,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxUseModiInTesseractForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxUseModiInTesseractForUnknownWords.Location = new System.Drawing.Point(22, 74);
this.checkBoxUseModiInTesseractForUnknownWords.Name = "checkBoxUseModiInTesseractForUnknownWords";
- this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(167, 17);
+ this.checkBoxUseModiInTesseractForUnknownWords.Size = new System.Drawing.Size(165, 17);
this.checkBoxUseModiInTesseractForUnknownWords.TabIndex = 39;
this.checkBoxUseModiInTesseractForUnknownWords.Text = "Try MODI for unknown words";
this.checkBoxUseModiInTesseractForUnknownWords.UseVisualStyleBackColor = true;
@@ -334,7 +334,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxRightToLeft.AutoSize = true;
this.checkBoxRightToLeft.Location = new System.Drawing.Point(128, 112);
this.checkBoxRightToLeft.Name = "checkBoxRightToLeft";
- this.checkBoxRightToLeft.Size = new System.Drawing.Size(83, 17);
+ this.checkBoxRightToLeft.Size = new System.Drawing.Size(80, 17);
this.checkBoxRightToLeft.TabIndex = 40;
this.checkBoxRightToLeft.Text = "Right to left";
this.checkBoxRightToLeft.UseVisualStyleBackColor = true;
@@ -514,7 +514,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxGuessUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxGuessUnknownWords.Location = new System.Drawing.Point(11, 83);
this.checkBoxGuessUnknownWords.Name = "checkBoxGuessUnknownWords";
- this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(164, 17);
+ this.checkBoxGuessUnknownWords.Size = new System.Drawing.Size(162, 17);
this.checkBoxGuessUnknownWords.TabIndex = 39;
this.checkBoxGuessUnknownWords.Text = "Try to guess unknown words";
this.checkBoxGuessUnknownWords.UseVisualStyleBackColor = true;
@@ -620,7 +620,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPromptForUnknownWords.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxPromptForUnknownWords.Location = new System.Drawing.Point(11, 61);
this.checkBoxPromptForUnknownWords.Name = "checkBoxPromptForUnknownWords";
- this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(255, 17);
+ this.checkBoxPromptForUnknownWords.Size = new System.Drawing.Size(246, 17);
this.checkBoxPromptForUnknownWords.TabIndex = 38;
this.checkBoxPromptForUnknownWords.Text = "Prompt for unknown words (requires dictionary)";
this.checkBoxPromptForUnknownWords.UseVisualStyleBackColor = true;
@@ -632,7 +632,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoBreakLines.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoBreakLines.Location = new System.Drawing.Point(11, 105);
this.checkBoxAutoBreakLines.Name = "checkBoxAutoBreakLines";
- this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(208, 17);
+ this.checkBoxAutoBreakLines.Size = new System.Drawing.Size(200, 17);
this.checkBoxAutoBreakLines.TabIndex = 37;
this.checkBoxAutoBreakLines.Text = "Auto break subtitle, if line number > 2";
this.checkBoxAutoBreakLines.UseVisualStyleBackColor = true;
@@ -653,7 +653,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxAutoFixCommonErrors.CheckState = System.Windows.Forms.CheckState.Checked;
this.checkBoxAutoFixCommonErrors.Location = new System.Drawing.Point(11, 39);
this.checkBoxAutoFixCommonErrors.Name = "checkBoxAutoFixCommonErrors";
- this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(139, 17);
+ this.checkBoxAutoFixCommonErrors.Size = new System.Drawing.Size(137, 17);
this.checkBoxAutoFixCommonErrors.TabIndex = 34;
this.checkBoxAutoFixCommonErrors.Text = "Fix common OCR errors";
this.checkBoxAutoFixCommonErrors.UseVisualStyleBackColor = true;
@@ -679,7 +679,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis2Transparent.AutoSize = true;
this.checkBoxEmphasis2Transparent.Location = new System.Drawing.Point(437, 19);
this.checkBoxEmphasis2Transparent.Name = "checkBoxEmphasis2Transparent";
- this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(85, 17);
+ this.checkBoxEmphasis2Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis2Transparent.TabIndex = 6;
this.checkBoxEmphasis2Transparent.Text = "Transparent";
this.checkBoxEmphasis2Transparent.UseVisualStyleBackColor = true;
@@ -690,7 +690,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxEmphasis1Transparent.AutoSize = true;
this.checkBoxEmphasis1Transparent.Location = new System.Drawing.Point(304, 19);
this.checkBoxEmphasis1Transparent.Name = "checkBoxEmphasis1Transparent";
- this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(85, 17);
+ this.checkBoxEmphasis1Transparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxEmphasis1Transparent.TabIndex = 5;
this.checkBoxEmphasis1Transparent.Text = "Transparent";
this.checkBoxEmphasis1Transparent.UseVisualStyleBackColor = true;
@@ -701,7 +701,7 @@ namespace Nikse.SubtitleEdit.Forms
this.checkBoxPatternTransparent.AutoSize = true;
this.checkBoxPatternTransparent.Location = new System.Drawing.Point(167, 19);
this.checkBoxPatternTransparent.Name = "checkBoxPatternTransparent";
- this.checkBoxPatternTransparent.Size = new System.Drawing.Size(85, 17);
+ this.checkBoxPatternTransparent.Size = new System.Drawing.Size(83, 17);
this.checkBoxPatternTransparent.TabIndex = 4;
this.checkBoxPatternTransparent.Text = "Transparent";
this.checkBoxPatternTransparent.UseVisualStyleBackColor = true;
diff --git a/src/Forms/VobSubOcr.cs b/src/Forms/VobSubOcr.cs
index 174920d16..d3f91a406 100644
--- a/src/Forms/VobSubOcr.cs
+++ b/src/Forms/VobSubOcr.cs
@@ -10,6 +10,7 @@ using System.Xml;
using Nikse.SubtitleEdit.Logic;
using Nikse.SubtitleEdit.Logic.OCR;
using Nikse.SubtitleEdit.Logic.VobSub;
+using System.Diagnostics;
namespace Nikse.SubtitleEdit.Forms
{
@@ -83,8 +84,9 @@ namespace Nikse.SubtitleEdit.Forms
// Tesseract OCR
//tessnet2.Tesseract _tesseractOcrEngine;
- object _tesseractOcrEngine;
+// object _tesseractOcrEngine;
string _lastLine;
+ string _languageId;
// Dictionaries/spellchecking/fixing
OcrFixEngine _ocrFixEngine;
@@ -111,6 +113,11 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Text = Configuration.Settings.Language.General.OK;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
subtitleListView1.InitializeLanguage(Configuration.Settings.Language.General, Configuration.Settings);
+ subtitleListView1.Columns[0].Width = 45;
+ subtitleListView1.Columns[1].Width = 90;
+ subtitleListView1.Columns[2].Width = 90;
+ subtitleListView1.Columns[3].Width = 70;
+ subtitleListView1.Columns[4].Width = 150;
groupBoxImagePalette.Text = language.ImagePalette;
checkBoxCustomFourColors.Text = language.UseCustomColors;
@@ -218,7 +225,7 @@ namespace Nikse.SubtitleEdit.Forms
{
try
{
- string characterDatabasePath = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub";
+ string characterDatabasePath = Configuration.VobSubCompareFolder.TrimEnd(Path.DirectorySeparatorChar);
if (!Directory.Exists(characterDatabasePath))
Directory.CreateDirectory(characterDatabasePath);
@@ -251,7 +258,7 @@ namespace Nikse.SubtitleEdit.Forms
private void LoadImageCompareBitmaps()
{
_compareBitmaps = new List();
- string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
+ string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
if (!File.Exists(path + "CompareDescription.xml"))
_compareDoc.LoadXml("");
else
@@ -491,7 +498,7 @@ namespace Nikse.SubtitleEdit.Forms
private void SaveCompareItem(Bitmap newTarget, string text, bool isItalic, int expandCount)
{
- string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
+ string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
string name = Guid.NewGuid().ToString();
string fileName = path + name + ".bmp";
newTarget.Save(fileName);
@@ -941,17 +948,38 @@ namespace Nikse.SubtitleEdit.Forms
// }
//}
+ private string Tesseract3DoOcrViaExe(Bitmap bmp, string language)
+ {
+ string tempTiffFileName = Path.GetTempPath() + Guid.NewGuid().ToString() + ".tiff";
+ bmp.Save(tempTiffFileName, System.Drawing.Imaging.ImageFormat.Tiff);
+
+ string tempTextFileName = Path.GetTempPath() + Guid.NewGuid().ToString();
+
+ Process process = new Process();
+ process.StartInfo = new ProcessStartInfo(Configuration.BaseDirectory + "Tesseract" + Path.DirectorySeparatorChar + "tesseract.exe");
+ process.StartInfo.Arguments = "\"" + tempTiffFileName + "\" \"" + tempTextFileName + "\" -l " + language;
+ process.StartInfo.WorkingDirectory = (Configuration.BaseDirectory + "Tesseract");
+ process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
+ process.Start();
+ process.WaitForExit(2000);
+ string s = File.ReadAllText(tempTextFileName + ".txt");
+ try
+ {
+ File.Delete(tempTiffFileName);
+ File.Delete(tempTextFileName + ".txt");
+ }
+ catch
+ {
+ }
+ return s;
+ }
private string OcrViaTessnet(Bitmap bitmap, int index)
{
- if (_tesseractOcrEngine == null || _ocrFixEngine == null)
+ if (_ocrFixEngine == null)
{
- Cursor = Cursors.WaitCursor;
- _tesseractOcrEngine = new tessnet2.Tesseract();
- string languageId = (comboBoxTesseractLanguages.SelectedItem as TesseractLanguage).Id;
- (_tesseractOcrEngine as tessnet2.Tesseract).Init(Configuration.BaseDirectory + "tessdata", languageId, false); // _tesseractOcrEngine.Init("tessdata", "eng", false);
-
- _ocrFixEngine = new OcrFixEngine(languageId, this);
+ _languageId = (comboBoxTesseractLanguages.SelectedItem as TesseractLanguage).Id;
+ _ocrFixEngine = new OcrFixEngine(_languageId, this);
if (_ocrFixEngine.IsDictionaryLoaded)
labelDictionaryLoaded.Text = string.Format(Configuration.Settings.Language.VobSubOcr.DictionaryX, _ocrFixEngine.DictionaryCulture.NativeName);
else
@@ -964,45 +992,27 @@ namespace Nikse.SubtitleEdit.Forms
foreach (var modiLanguage in comboBoxModiLanguage.Items)
{
if ((modiLanguage as ModiLanguage).Text == tesseractLanguageText)
- {
comboBoxModiLanguage.SelectedIndex = i;
- }
i++;
}
}
- Cursor = Cursors.Default;
}
- // OCR bitmaps (splitted into lines)
var sb = new StringBuilder();
- var result = new List();
int badWords = 0;
var textWithOutFixes = new StringBuilder();
+ textWithOutFixes.Append(Tesseract3DoOcrViaExe(bitmap, _languageId));
+ sb.Append(textWithOutFixes.ToString());
+ int numberOfWords = sb.ToString().Split((" " + Environment.NewLine).ToCharArray(), StringSplitOptions.RemoveEmptyEntries).Length;
- foreach (ImageSplitterItem splitImage in ImageSplitter.SplitVertical(bitmap))
- {
- result = (_tesseractOcrEngine as tessnet2.Tesseract).DoOCR(splitImage.Bitmap, Rectangle.Empty);
- foreach (var s in result)
- {
- sb.Append(s.Text + " ");
- textWithOutFixes.Append(s.Text + " ");
- if (s.Confidence > 160)
- badWords++;
- if (s.Confidence > 200)
- badWords++;
- }
- sb.AppendLine();
- textWithOutFixes.AppendLine();
- splitImage.Bitmap.Dispose();
- }
string line = sb.ToString().Trim();
if (_ocrFixEngine.IsDictionaryLoaded)
{
if (checkBoxAutoFixCommonErrors.Checked)
line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked);
- int wordsNotFound = _ocrFixEngine.CountUnknownWordsViaDictionary(line);
+ int wordsNotFound = _ocrFixEngine.CountUnknownWordsViaDictionary(line);
- if (wordsNotFound > 0)
+ if (wordsNotFound > 0 || sb.ToString().Replace("~", string.Empty).Trim().Length == 0)
{
_ocrFixEngine.AutoGuessesUsed.Clear();
_ocrFixEngine.UnknownWordsFound.Clear();
@@ -1073,9 +1083,9 @@ namespace Nikse.SubtitleEdit.Forms
if (checkBoxAutoFixCommonErrors.Checked)
line = _ocrFixEngine.FixOcrErrors(line, index, _lastLine, true, checkBoxGuessUnknownWords.Checked);
- if (badWords >= result.Count)
+ if (badWords >= numberOfWords) //result.Count)
subtitleListView1.SetBackgroundColor(index, Color.Red);
- else if (badWords >= result.Count / 2)
+ else if (badWords >= numberOfWords / 2) // result.Count / 2)
subtitleListView1.SetBackgroundColor(index, Color.Orange);
else if (badWords > 0)
subtitleListView1.SetBackgroundColor(index, Color.Yellow);
@@ -1211,15 +1221,15 @@ namespace Nikse.SubtitleEdit.Forms
private void InitializeTesseract()
{
- string dir = Configuration.BaseDirectory + "tessdata";
+ string dir = Configuration.BaseDirectory + "Tesseract\\tessdata";
if (Directory.Exists(dir))
{
var list = new List();
comboBoxTesseractLanguages.Items.Clear();
foreach (var culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures))
{
- if (!list.Contains(culture.ThreeLetterISOLanguageName) &&
- Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + ".inttemp").Length > 0)
+ string trainDataFileName = dir + "\\" + culture.ThreeLetterISOLanguageName + ".traineddata";
+ if (!list.Contains(culture.ThreeLetterISOLanguageName) && File.Exists(trainDataFileName))
{
list.Add(culture.ThreeLetterISOLanguageName);
comboBoxTesseractLanguages.Items.Add(new TesseractLanguage { Id = culture.ThreeLetterISOLanguageName, Text = culture.EnglishName });
@@ -1228,7 +1238,7 @@ namespace Nikse.SubtitleEdit.Forms
}
if (comboBoxTesseractLanguages.Items.Count > 0)
{
- for (int i=0; i();
+ // comboBoxTesseractLanguages.Items.Clear();
+ // foreach (var culture in System.Globalization.CultureInfo.GetCultures(System.Globalization.CultureTypes.NeutralCultures))
+ // {
+ // if (!list.Contains(culture.ThreeLetterISOLanguageName) &&
+ // Directory.GetFiles(dir, culture.ThreeLetterISOLanguageName + ".inttemp").Length > 0)
+ // {
+ // list.Add(culture.ThreeLetterISOLanguageName);
+ // comboBoxTesseractLanguages.Items.Add(new TesseractLanguage { Id = culture.ThreeLetterISOLanguageName, Text = culture.EnglishName });
+ // }
+ // }
+ // }
+ // if (comboBoxTesseractLanguages.Items.Count > 0)
+ // {
+ // for (int i = 0; i < comboBoxTesseractLanguages.Items.Count; i++)
+ // {
+ // if ((comboBoxTesseractLanguages.Items[i] as TesseractLanguage).Id == Configuration.Settings.VobSubOcr.TesseractLastLanguage)
+ // comboBoxTesseractLanguages.SelectedIndex = i;
+ // }
+
+ // if (comboBoxTesseractLanguages.SelectedIndex == -1)
+ // comboBoxTesseractLanguages.SelectedIndex = 0;
+ // }
+ //}
+
private void InitializeModiLanguages()
{
foreach (ModiLanguage ml in ModiLanguage.AllLanguages)
@@ -1319,7 +1359,7 @@ namespace Nikse.SubtitleEdit.Forms
if (formVobSubEditCharacters.ShowDialog() == DialogResult.OK)
{
_compareDoc = formVobSubEditCharacters.ImageCompareDocument;
- string path = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
+ string path = Configuration.VobSubCompareFolder + comboBoxCharacterDatabase.SelectedItem + Path.DirectorySeparatorChar;
_compareDoc.Save(path + "CompareDescription.xml");
}
LoadImageCompareBitmaps();
diff --git a/src/Forms/VobSubOcrNewFolder.cs b/src/Forms/VobSubOcrNewFolder.cs
index a3e9e0179..d63690f65 100644
--- a/src/Forms/VobSubOcrNewFolder.cs
+++ b/src/Forms/VobSubOcrNewFolder.cs
@@ -33,7 +33,7 @@ namespace Nikse.SubtitleEdit.Forms
{
try
{
- string fullName = Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + @"VobSub" + Path.DirectorySeparatorChar + folderName;
+ string fullName = Configuration.VobSubCompareFolder + folderName;
Directory.CreateDirectory(fullName);
FolderName = folderName;
DialogResult = DialogResult.OK;
diff --git a/src/Logic/Configuration.cs b/src/Logic/Configuration.cs
index 19c572683..8106f8a02 100644
--- a/src/Logic/Configuration.cs
+++ b/src/Logic/Configuration.cs
@@ -1,4 +1,5 @@
using System.IO;
+using System;
namespace Nikse.SubtitleEdit.Logic
{
@@ -6,8 +7,75 @@ namespace Nikse.SubtitleEdit.Logic
{
static readonly Configuration Instance = new Configuration();
string _baseDir;
+ string _dataDir;
Settings _settings;
+ public static string SettingsFileName
+ {
+ get
+ {
+ return DataDirectory + "Settings.xml";
+ }
+ }
+
+ public static string DictionariesFolder
+ {
+ get
+ {
+ return DataDirectory + "Dictionaries" + Path.DirectorySeparatorChar;
+ }
+ }
+
+ public static string VobSubCompareFolder
+ {
+ get
+ {
+ return DataDirectory + "VobSub" + Path.DirectorySeparatorChar;
+ }
+ }
+
+ public static string WaveFormsFolder
+ {
+ get
+ {
+ return DataDirectory + "WaveForms" + Path.DirectorySeparatorChar;
+ }
+ }
+
+ public static string DataDirectory
+ {
+ get
+ {
+ if (Instance._dataDir == null)
+ {
+ if (BaseDirectory.StartsWith(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), StringComparison.OrdinalIgnoreCase))
+ {
+ try
+ {
+ string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + Path.DirectorySeparatorChar + "Nikse";
+ if (!Directory.Exists(path))
+ Directory.CreateDirectory(path);
+
+ path += Path.DirectorySeparatorChar + "SubtitleEdit";
+ if (!Directory.Exists(path))
+ Directory.CreateDirectory(path);
+
+ Instance._dataDir = path + Path.DirectorySeparatorChar;
+ }
+ catch
+ {
+ Instance._dataDir = BaseDirectory;
+ }
+ }
+ else
+ {
+ Instance._dataDir = BaseDirectory;
+ }
+ }
+ return Instance._dataDir;
+ }
+ }
+
public static string BaseDirectory
{
get
diff --git a/src/Logic/Settings.cs b/src/Logic/Settings.cs
index 4379fcf06..9a4192c55 100644
--- a/src/Logic/Settings.cs
+++ b/src/Logic/Settings.cs
@@ -333,7 +333,7 @@ namespace Nikse.SubtitleEdit.Logic
//Serialize(Configuration.BaseDirectory + "Settings.xml", this);
//Fast - TODO: Fix in release
- CustomSerialize(Configuration.BaseDirectory + "Settings.xml", this);
+ CustomSerialize(Configuration.SettingsFileName, this);
}
private static void Serialize(string fileName, Settings settings)
@@ -346,17 +346,17 @@ namespace Nikse.SubtitleEdit.Logic
public static Settings GetSettings()
{
- Settings settings = new Settings();
- if (File.Exists(Configuration.BaseDirectory + "Settings.xml"))
+ Settings settings = new Settings();
+ string settingsFileName = Configuration.SettingsFileName;
+ if (File.Exists(settingsFileName))
{
try
{
//TODO: Fix in release
- settings = CustomDeserialize(Configuration.BaseDirectory + "Settings.xml"); // 15 msecs
+ settings = CustomDeserialize(settingsFileName); // 15 msecs
//too slow... :(
//settings = Deserialize(Configuration.BaseDirectory + "Settings.xml"); // 688 msecs
-
}
catch
{
diff --git a/src/Logic/Utilities.cs b/src/Logic/Utilities.cs
index f9652702d..9405973e7 100644
--- a/src/Logic/Utilities.cs
+++ b/src/Logic/Utilities.cs
@@ -575,7 +575,7 @@ namespace Nikse.SubtitleEdit.Logic
{
get
{
- return Path.GetDirectoryName(Application.ExecutablePath).TrimEnd(Path.DirectorySeparatorChar) + Path.DirectorySeparatorChar + "Dictionaries" + Path.DirectorySeparatorChar;
+ return Configuration.DictionariesFolder;
}
}