[fixcommonerrors] - add reset default button.

This commit is contained in:
Ivandro Ismael 2017-05-29 12:48:58 +00:00
parent 74ec770d65
commit ffc3ccd436
7 changed files with 32 additions and 1 deletions

View File

@ -636,6 +636,7 @@ Note: Do check free disk space.</WaveFileMalformed>
<FixOcrErrorExample>D0n't -&gt; Don't</FixOcrErrorExample>
<FixSpaceBetweenNumbersExample>1 100 -&gt; 1100</FixSpaceBetweenNumbersExample>
<FixDialogsOneLineExample>Hi John! - Hi Ida! -&gt; Hi John!&lt;br /&gt;- Hi Ida!</FixDialogsOneLineExample>
<ResetDefault>Reset default</ResetDefault>
</FixCommonErrors>
<GetDictionaries>
<Title>Need dictionaries?</Title>

View File

@ -822,6 +822,7 @@ namespace Nikse.SubtitleEdit.Core
FixOcrErrorExample = "D0n't -> Don't",
FixSpaceBetweenNumbersExample = "1 100 -> 1100",
FixDialogsOneLineExample = "Hi John! - Hi Ida! -> Hi John!<br />- Hi Ida!",
ResetDefault = "Reset default",
};
GetDictionaries = new LanguageStructure.GetDictionaries

View File

@ -1687,6 +1687,9 @@ namespace Nikse.SubtitleEdit.Core
case "FixCommonErrors/FixDialogsOneLineExample":
language.FixCommonErrors.FixDialogsOneLineExample = reader.Value;
break;
case "FixCommonErrors/ResetDefault":
language.FixCommonErrors.ResetDefault = reader.Value;
break;
case "GetDictionaries/Title":
language.GetDictionaries.Title = reader.Value;
break;

View File

@ -698,6 +698,7 @@
public string FixOcrErrorExample { get; set; }
public string FixSpaceBetweenNumbersExample { get; set; }
public string FixDialogsOneLineExample { get; set; }
public string ResetDefault { get; set; }
}
public class GetDictionaries

View File

@ -476,6 +476,11 @@ namespace Nikse.SubtitleEdit.Core
public bool FixMusicNotationTicked { get; set; }
public FixCommonErrorsSettings()
{
LoadDeafultConfigs();
}
public void LoadDeafultConfigs()
{
EmptyLinesTicked = true;
OverlappingDisplayTimeTicked = true;
@ -502,6 +507,7 @@ namespace Nikse.SubtitleEdit.Core
FixMissingOpenBracketTicked = true;
FixMusicNotationTicked = true;
}
}
public class GeneralSettings

View File

@ -80,6 +80,7 @@ namespace Nikse.SubtitleEdit.Forms
this.tabPageLog = new System.Windows.Forms.TabPage();
this.textBoxFixedIssues = new System.Windows.Forms.TextBox();
this.labelNumberOfImportantLogMessages = new System.Windows.Forms.Label();
this.buttonResetDefault = new System.Windows.Forms.Button();
this.groupBoxStep1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.tabControl1.SuspendLayout();
@ -146,6 +147,7 @@ namespace Nikse.SubtitleEdit.Forms
this.groupBoxStep1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxStep1.Controls.Add(this.buttonResetDefault);
this.groupBoxStep1.Controls.Add(this.comboBoxLanguage);
this.groupBoxStep1.Controls.Add(this.labelLanguage);
this.groupBoxStep1.Controls.Add(this.buttonInverseSelection);
@ -654,6 +656,16 @@ namespace Nikse.SubtitleEdit.Forms
this.labelNumberOfImportantLogMessages.TabIndex = 11;
this.labelNumberOfImportantLogMessages.Text = "labelNumberOfImportantLogMessages";
//
// buttonResetDefault
//
this.buttonResetDefault.Location = new System.Drawing.Point(6, 19);
this.buttonResetDefault.Name = "buttonResetDefault";
this.buttonResetDefault.Size = new System.Drawing.Size(85, 23);
this.buttonResetDefault.TabIndex = 12;
this.buttonResetDefault.Text = "Reset default";
this.buttonResetDefault.UseVisualStyleBackColor = true;
this.buttonResetDefault.Click += new System.EventHandler(this.buttonResetDefault_Click);
//
// FixCommonErrors
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -750,5 +762,6 @@ namespace Nikse.SubtitleEdit.Forms
private System.Windows.Forms.Button buttonSplitLine;
private System.Windows.Forms.ComboBox comboBoxLanguage;
private System.Windows.Forms.Label labelLanguage;
private System.Windows.Forms.Button buttonResetDefault;
}
}

View File

@ -439,6 +439,7 @@ namespace Nikse.SubtitleEdit.Forms
labelLanguage.Text = Configuration.Settings.Language.ChooseLanguage.Language;
toolStripMenuItemDelete.Text = Configuration.Settings.Language.Main.Menu.ContextMenu.Delete;
mergeSelectedLinesToolStripMenuItem.Text = Configuration.Settings.Language.Main.Menu.ContextMenu.MergeSelectedLines;
buttonResetDefault.Text = _language.ResetDefault;
splitContainerStep2.Panel1MinSize = 110;
splitContainerStep2.Panel2MinSize = 160;
@ -530,7 +531,7 @@ namespace Nikse.SubtitleEdit.Forms
{
if (_nameList == null)
{
string languageTwoLetterCode = LanguageAutoDetect.AutoDetectGoogleLanguage(Subtitle);
string languageTwoLetterCode = LanguageAutoDetect.AutoDetectGoogleLanguage(Subtitle);
// Will contains both one word names and multi names
var namesList = new NameList(Configuration.DictionariesDirectory, languageTwoLetterCode, Configuration.Settings.WordLists.UseOnlineNames, Configuration.Settings.WordLists.NamesUrl);
_nameList = namesList.GetNames();
@ -1608,5 +1609,10 @@ namespace Nikse.SubtitleEdit.Forms
SaveConfiguration();
}
private void buttonResetDefault_Click(object sender, EventArgs e)
{
Configuration.Settings.CommonErrors.LoadDeafultConfigs();
AddFixActions(CultureInfo.GetCultureInfo(_autoDetectGoogleLanguage).ThreeLetterISOLanguageName);
}
}
}