Fix #1773 - close if ocr is cancelled (and SE was started with file for ocr)

This commit is contained in:
Nikolaj Olsson 2016-05-31 22:12:59 +02:00
parent e18d704205
commit ea6946f05f
3 changed files with 33 additions and 6 deletions

View File

@ -795,6 +795,7 @@
this.comboBoxSubtitleFormats.DropDownHeight = 215;
this.comboBoxSubtitleFormats.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxSubtitleFormats.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.comboBoxSubtitleFormats.IntegralHeight = false;
this.comboBoxSubtitleFormats.Name = "comboBoxSubtitleFormats";
this.comboBoxSubtitleFormats.Size = new System.Drawing.Size(150, 40);
this.comboBoxSubtitleFormats.DropDown += new System.EventHandler(this.MenuOpened);
@ -818,6 +819,7 @@
this.comboBoxEncoding.DropDownHeight = 215;
this.comboBoxEncoding.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.comboBoxEncoding.FlatStyle = System.Windows.Forms.FlatStyle.Standard;
this.comboBoxEncoding.IntegralHeight = false;
this.comboBoxEncoding.Items.AddRange(new object[] {
"ANSI",
"UTF-7",
@ -2291,7 +2293,7 @@
this.changeCasingForSelectedLinesToolStripMenuItem,
this.toolStripMenuItemSaveSelectedLines});
this.contextMenuStripListview.Name = "contextMenuStripListview";
this.contextMenuStripListview.Size = new System.Drawing.Size(285, 804);
this.contextMenuStripListview.Size = new System.Drawing.Size(285, 826);
this.contextMenuStripListview.Closed += new System.Windows.Forms.ToolStripDropDownClosedEventHandler(this.MenuClosed);
this.contextMenuStripListview.Opening += new System.ComponentModel.CancelEventHandler(this.ContextMenuStripListviewOpening);
this.contextMenuStripListview.Opened += new System.EventHandler(this.MenuOpened);

View File

@ -82,6 +82,7 @@ namespace Nikse.SubtitleEdit.Forms
private LanguageStructure.General _languageGeneral;
private SpellCheck _spellCheckForm;
private bool _loading = true;
private bool _exitWhenLoaded;
private int _repeatCount = -1;
private double _endSeconds = -1;
private const double EndDelay = 0.05;
@ -1696,6 +1697,10 @@ namespace Nikse.SubtitleEdit.Forms
{
ImportAndOcrVobSubSubtitleNew(fileName, _loading);
}
else
{
_exitWhenLoaded = _loading;
}
return;
}
@ -1706,7 +1711,7 @@ namespace Nikse.SubtitleEdit.Forms
ImportAndOcrBluRaySup(fileName, _loading);
return;
}
else if (FileUtil.IsSpDvdSup(fileName))
if (FileUtil.IsSpDvdSup(fileName))
{
ImportAndOcrSpDvdSup(fileName, _loading);
return;
@ -8888,6 +8893,10 @@ namespace Nikse.SubtitleEdit.Forms
{
OpenVideo(matroska.Path);
}
else
{
_exitWhenLoaded = _loading;
}
}
}
}
@ -8898,6 +8907,10 @@ namespace Nikse.SubtitleEdit.Forms
{
OpenVideo(matroska.Path);
}
else
{
_exitWhenLoaded = _loading;
}
}
}
}
@ -9527,6 +9540,7 @@ namespace Nikse.SubtitleEdit.Forms
if (tsParser.SubtitlePacketIds.Count == 0)
{
MessageBox.Show(_language.NoSubtitlesFound);
_exitWhenLoaded = _loading;
return false;
}
@ -9576,6 +9590,7 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.Save();
return true;
}
_exitWhenLoaded = _loading;
return false;
}
}
@ -10387,8 +10402,7 @@ namespace Nikse.SubtitleEdit.Forms
vobSubOcr.ShowInTaskbar = true;
vobSubOcr.ShowIcon = true;
}
if (vobSubOcr.Initialize(fileName, Configuration.Settings.VobSubOcr, this)
&& vobSubOcr.ShowDialog(this) == DialogResult.OK)
if (vobSubOcr.Initialize(fileName, Configuration.Settings.VobSubOcr, this) && vobSubOcr.ShowDialog(this) == DialogResult.OK)
{
MakeHistoryForUndo(_language.BeforeImportingVobSubFile);
FileNew();
@ -10413,6 +10427,10 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.Save();
}
else
{
_exitWhenLoaded = _loading;
}
}
}
@ -14500,6 +14518,9 @@ namespace Nikse.SubtitleEdit.Forms
}
_dragAndDropTimer.Interval = 50;
_dragAndDropTimer.Tick += DoSubtitleListview1Drop;
if (_exitWhenLoaded)
Application.Exit();
}
private void TimerCheckForUpdatesTick(object sender, EventArgs e)
@ -15574,6 +15595,10 @@ namespace Nikse.SubtitleEdit.Forms
Configuration.Settings.Save();
}
else
{
_exitWhenLoaded = _loading;
}
}
}

View File

@ -722,7 +722,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
CAAAAk1TRnQBSQFMAgEBAgEAAagBIgGoASIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAARgBIwEYASMBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@ -770,6 +770,6 @@
<value>150, 95</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>134</value>
<value>144</value>
</metadata>
</root>