Don't show "Import" button for old image compare - thx MagicGreenDragon :)

Fix #2216
This commit is contained in:
Nikolaj Olsson 2017-02-11 13:06:54 +01:00
parent 137afe3b3f
commit dd9813d7e8
3 changed files with 21 additions and 24 deletions

View File

@ -37,6 +37,8 @@ namespace Nikse.SubtitleEdit.Forms
private void VobSubCharactersImport_Shown(object sender, EventArgs e)
{
openFileDialog1.Filter = "Binary OCR db files|*.db";
openFileDialog1.FileName = string.Empty;
openFileDialog1.InitialDirectory = Configuration.OcrDirectory;
if (openFileDialog1.ShowDialog(this) == DialogResult.OK)
{
imageList1.ImageSize = new Size(40, 40);

View File

@ -50,7 +50,7 @@
this.buttonCancel = new System.Windows.Forms.Button();
this.labelCount = new System.Windows.Forms.Label();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.button1 = new System.Windows.Forms.Button();
this.buttonImport = new System.Windows.Forms.Button();
this.groupBoxCurrentCompareImage.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
@ -264,25 +264,25 @@
this.labelCount.TabIndex = 8;
this.labelCount.Text = "labelCount";
//
// button1
// buttonImport
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.DialogResult = System.Windows.Forms.DialogResult.OK;
this.button1.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.button1.Location = new System.Drawing.Point(453, 27);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(123, 21);
this.button1.TabIndex = 9;
this.button1.Text = "&Import";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
this.buttonImport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonImport.DialogResult = System.Windows.Forms.DialogResult.OK;
this.buttonImport.ImeMode = System.Windows.Forms.ImeMode.NoControl;
this.buttonImport.Location = new System.Drawing.Point(453, 27);
this.buttonImport.Name = "buttonImport";
this.buttonImport.Size = new System.Drawing.Size(123, 21);
this.buttonImport.TabIndex = 9;
this.buttonImport.Text = "&Import";
this.buttonImport.UseVisualStyleBackColor = true;
this.buttonImport.Click += new System.EventHandler(this.buttonImport_Click);
//
// VobSubEditCharacters
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(588, 426);
this.Controls.Add(this.button1);
this.Controls.Add(this.buttonImport);
this.Controls.Add(this.labelCount);
this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.groupBoxCurrentCompareImage);
@ -335,6 +335,6 @@
private System.Windows.Forms.ToolStripMenuItem saveImageAsToolStripMenuItem;
private System.Windows.Forms.SaveFileDialog saveFileDialog1;
private System.Windows.Forms.Label labelExpandCount;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button buttonImport;
}
}

View File

@ -12,19 +12,13 @@ namespace Nikse.SubtitleEdit.Forms
{
public sealed partial class VobSubEditCharacters : Form
{
private XmlDocument _compareDoc = new XmlDocument();
private string _directoryPath;
private readonly XmlDocument _compareDoc = new XmlDocument();
private readonly string _directoryPath;
private List<bool> _italics = new List<bool>();
internal List<VobSubOcr.ImageCompareAddition> Additions { get; private set; }
private readonly BinaryOcrDb _binOcrDb;
public XmlDocument ImageCompareDocument
{
get
{
return _compareDoc;
}
}
public XmlDocument ImageCompareDocument => _compareDoc;
internal VobSubEditCharacters(string databaseFolderName, List<VobSubOcr.ImageCompareAddition> additions, BinaryOcrDb binOcrDb)
{
@ -69,6 +63,7 @@ namespace Nikse.SubtitleEdit.Forms
buttonOK.Text = Configuration.Settings.Language.General.Ok;
buttonCancel.Text = Configuration.Settings.Language.General.Cancel;
UiUtil.FixLargeFonts(this, buttonOK);
buttonImport.Visible = binOcrDb != null;
}
private void Refill(List<VobSubOcr.ImageCompareAddition> additions)
@ -635,7 +630,7 @@ namespace Nikse.SubtitleEdit.Forms
}
}
private void button1_Click(object sender, EventArgs e)
private void buttonImport_Click(object sender, EventArgs e)
{
using (var form = new VobSubCharactersImport(_binOcrDb))
{