mirror of
https://github.com/SubtitleEdit/subtitleedit.git
synced 2024-11-25 12:44:46 +01:00
Testing "Go to error" (like go to next error but with list)
This commit is contained in:
parent
ed6c535349
commit
94b5d72852
@ -2168,6 +2168,7 @@ $HorzAlign = Center
|
||||
public string MainListViewColumnTextUp { get; set; }
|
||||
public string MainListViewColumnTextDown { get; set; }
|
||||
public string MainListViewGoToNextError { get; set; }
|
||||
public string MainListViewListErrors { get; set; }
|
||||
public string MainListViewRemoveTimeCodes { get; set; }
|
||||
public string MainTextBoxSplitAtCursor { get; set; }
|
||||
public string MainTextBoxSplitAtCursorAndVideoPos { get; set; }
|
||||
@ -2336,6 +2337,7 @@ $HorzAlign = Center
|
||||
MainVideoGoToStartCurrent = "F6";
|
||||
MainVideo3000MsLeft = "F7";
|
||||
MainListViewGoToNextError = "F8";
|
||||
MainListViewListErrors = "Control+F8";
|
||||
MainCreateSetStart = "F11";
|
||||
MainCreateSetEnd = "F12";
|
||||
MainAdjustSetStartAndOffsetTheRest = "Control+Space";
|
||||
@ -8044,6 +8046,12 @@ $HorzAlign = Center
|
||||
shortcuts.MainListViewGoToNextError = subNode.InnerText;
|
||||
}
|
||||
|
||||
subNode = node.SelectSingleNode("MainListViewListErrors");
|
||||
if (subNode != null)
|
||||
{
|
||||
shortcuts.MainListViewListErrors = subNode.InnerText;
|
||||
}
|
||||
|
||||
subNode = node.SelectSingleNode("GeneralRemoveBlankLines");
|
||||
if (subNode != null)
|
||||
{
|
||||
@ -9784,6 +9792,7 @@ $HorzAlign = Center
|
||||
textWriter.WriteElementString("MainListViewColumnTextUp", shortcuts.MainListViewColumnTextUp);
|
||||
textWriter.WriteElementString("MainListViewColumnTextDown", shortcuts.MainListViewColumnTextDown);
|
||||
textWriter.WriteElementString("MainListViewGoToNextError", shortcuts.MainListViewGoToNextError);
|
||||
textWriter.WriteElementString("MainListViewListErrors", shortcuts.MainListViewListErrors);
|
||||
textWriter.WriteElementString("GeneralRemoveBlankLines", shortcuts.GeneralRemoveBlankLines);
|
||||
textWriter.WriteElementString("GeneralApplyAssaOverrideTags", shortcuts.GeneralApplyAssaOverrideTags);
|
||||
textWriter.WriteElementString("GeneralSetAssaPosition", shortcuts.GeneralSetAssaPosition);
|
||||
|
143
src/ui/Forms/ErrorsGoTo.Designer.cs
generated
Normal file
143
src/ui/Forms/ErrorsGoTo.Designer.cs
generated
Normal file
@ -0,0 +1,143 @@
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
sealed partial class ErrorsGoTo
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.buttonCancel = new System.Windows.Forms.Button();
|
||||
this.buttonOK = new System.Windows.Forms.Button();
|
||||
this.listViewBookmarks = new System.Windows.Forms.ListView();
|
||||
this.columnHeaderNumber = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderStartTime = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.columnHeaderText = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
|
||||
this.buttonExport = new System.Windows.Forms.Button();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// buttonCancel
|
||||
//
|
||||
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonCancel.Location = new System.Drawing.Point(706, 595);
|
||||
this.buttonCancel.Name = "buttonCancel";
|
||||
this.buttonCancel.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonCancel.TabIndex = 30;
|
||||
this.buttonCancel.Text = "C&ancel";
|
||||
this.buttonCancel.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// buttonOK
|
||||
//
|
||||
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonOK.Location = new System.Drawing.Point(625, 595);
|
||||
this.buttonOK.Name = "buttonOK";
|
||||
this.buttonOK.Size = new System.Drawing.Size(75, 23);
|
||||
this.buttonOK.TabIndex = 20;
|
||||
this.buttonOK.Text = "&OK";
|
||||
this.buttonOK.UseVisualStyleBackColor = true;
|
||||
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
|
||||
//
|
||||
// listViewBookmarks
|
||||
//
|
||||
this.listViewBookmarks.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.listViewBookmarks.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
|
||||
this.columnHeaderNumber,
|
||||
this.columnHeaderStartTime,
|
||||
this.columnHeaderText});
|
||||
this.listViewBookmarks.FullRowSelect = true;
|
||||
this.listViewBookmarks.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable;
|
||||
this.listViewBookmarks.HideSelection = false;
|
||||
this.listViewBookmarks.Location = new System.Drawing.Point(13, 12);
|
||||
this.listViewBookmarks.Name = "listViewBookmarks";
|
||||
this.listViewBookmarks.Size = new System.Drawing.Size(768, 576);
|
||||
this.listViewBookmarks.TabIndex = 0;
|
||||
this.listViewBookmarks.UseCompatibleStateImageBehavior = false;
|
||||
this.listViewBookmarks.View = System.Windows.Forms.View.Details;
|
||||
this.listViewBookmarks.DoubleClick += new System.EventHandler(this.listViewErrors_DoubleClick);
|
||||
//
|
||||
// columnHeaderNumber
|
||||
//
|
||||
this.columnHeaderNumber.Width = 50;
|
||||
//
|
||||
// columnHeaderStartTime
|
||||
//
|
||||
this.columnHeaderStartTime.Width = 75;
|
||||
//
|
||||
// columnHeaderText
|
||||
//
|
||||
this.columnHeaderText.Width = 480;
|
||||
//
|
||||
// buttonExport
|
||||
//
|
||||
this.buttonExport.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.buttonExport.ImeMode = System.Windows.Forms.ImeMode.NoControl;
|
||||
this.buttonExport.Location = new System.Drawing.Point(522, 595);
|
||||
this.buttonExport.Name = "buttonExport";
|
||||
this.buttonExport.Size = new System.Drawing.Size(97, 23);
|
||||
this.buttonExport.TabIndex = 10;
|
||||
this.buttonExport.Text = "Export...";
|
||||
this.buttonExport.UseVisualStyleBackColor = true;
|
||||
this.buttonExport.Click += new System.EventHandler(this.buttonExport_Click);
|
||||
//
|
||||
// ErrorsGoTo
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.ClientSize = new System.Drawing.Size(793, 628);
|
||||
this.Controls.Add(this.buttonExport);
|
||||
this.Controls.Add(this.listViewBookmarks);
|
||||
this.Controls.Add(this.buttonOK);
|
||||
this.Controls.Add(this.buttonCancel);
|
||||
this.KeyPreview = true;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.MinimumSize = new System.Drawing.Size(658, 380);
|
||||
this.Name = "ErrorsGoTo";
|
||||
this.ShowIcon = false;
|
||||
this.ShowInTaskbar = false;
|
||||
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
|
||||
this.Text = "BookmarksGoTo";
|
||||
this.Shown += new System.EventHandler(this.ErrorsGoTo_Shown);
|
||||
this.ResizeEnd += new System.EventHandler(this.ErrorsGoTo_ResizeEnd);
|
||||
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ErrorsGoTo_KeyDown);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.Button buttonCancel;
|
||||
private System.Windows.Forms.Button buttonOK;
|
||||
private System.Windows.Forms.ListView listViewBookmarks;
|
||||
private System.Windows.Forms.ColumnHeader columnHeaderNumber;
|
||||
private System.Windows.Forms.ColumnHeader columnHeaderStartTime;
|
||||
private System.Windows.Forms.ColumnHeader columnHeaderText;
|
||||
private System.Windows.Forms.Button buttonExport;
|
||||
}
|
||||
}
|
240
src/ui/Forms/ErrorsGoTo.cs
Normal file
240
src/ui/Forms/ErrorsGoTo.cs
Normal file
@ -0,0 +1,240 @@
|
||||
using Nikse.SubtitleEdit.Core.Common;
|
||||
using Nikse.SubtitleEdit.Logic;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Nikse.SubtitleEdit.Forms
|
||||
{
|
||||
public sealed partial class ErrorsGoTo : Form
|
||||
{
|
||||
private readonly Subtitle _subtitle;
|
||||
|
||||
public ErrorsGoTo(Subtitle subtitle)
|
||||
{
|
||||
UiUtil.PreInitialize(this);
|
||||
InitializeComponent();
|
||||
UiUtil.FixFonts(this);
|
||||
Text = "Errors";
|
||||
buttonExport.Text = LanguageSettings.Current.MultipleReplace.Export;
|
||||
buttonOK.Text = LanguageSettings.Current.General.Ok;
|
||||
buttonCancel.Text = LanguageSettings.Current.General.Cancel;
|
||||
columnHeaderNumber.Text = LanguageSettings.Current.General.NumberSymbol;
|
||||
columnHeaderStartTime.Text = LanguageSettings.Current.General.StartTime;
|
||||
columnHeaderText.Text = "Errors";
|
||||
|
||||
_subtitle = new Subtitle(subtitle);
|
||||
foreach (var p in _subtitle.Paragraphs)
|
||||
{
|
||||
var errors = GetErrors(p, _subtitle.Paragraphs.IndexOf(p), subtitle.Paragraphs);
|
||||
|
||||
p.Bookmark = string.Empty;
|
||||
if (errors.Count > 0)
|
||||
{
|
||||
p.Bookmark = string.Join(" -- ", errors);
|
||||
ListViewItem item = new ListViewItem("#" + p.Number) { Tag = p };
|
||||
item.SubItems.Add(p.StartTime.ToShortDisplayString());
|
||||
item.SubItems.Add(p.Bookmark);
|
||||
listViewBookmarks.Items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> GetErrors(Paragraph paragraph, int i, List<Paragraph> paragraphs)
|
||||
{
|
||||
var errors = new List<string>();
|
||||
|
||||
if (paragraph.StartTime.IsMaxTime || paragraph.EndTime.IsMaxTime)
|
||||
{
|
||||
errors.Add("START/END: No time code");
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paragraph.WordsPerMinute > Configuration.Settings.General.SubtitleMaximumWordsPerMinute)
|
||||
{
|
||||
errors.Add($"WPM: {paragraph.WordsPerMinute:#,###.00} > {Configuration.Settings.General.SubtitleMaximumWordsPerMinute}");
|
||||
}
|
||||
|
||||
double charactersPerSecond = Utilities.GetCharactersPerSecond(paragraph);
|
||||
if (charactersPerSecond > Configuration.Settings.General.SubtitleMaximumCharactersPerSeconds)
|
||||
{
|
||||
errors.Add($"CPS: {charactersPerSecond:#,###.00} > {Configuration.Settings.General.SubtitleMaximumCharactersPerSeconds}");
|
||||
}
|
||||
|
||||
if (paragraph.Duration.TotalMilliseconds < Configuration.Settings.General.SubtitleMinimumDisplayMilliseconds)
|
||||
{
|
||||
errors.Add($"Min duration: {paragraph.Duration.TotalMilliseconds:#,###.00} < {Configuration.Settings.General.SubtitleMinimumDisplayMilliseconds}");
|
||||
}
|
||||
|
||||
if (paragraph.Duration.TotalMilliseconds > Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds)
|
||||
{
|
||||
errors.Add($"Max duration: {paragraph.Duration.TotalMilliseconds:#,###.00} > {Configuration.Settings.General.SubtitleMaximumDisplayMilliseconds}");
|
||||
}
|
||||
|
||||
if (i > 0 && i < paragraphs.Count)
|
||||
{
|
||||
var prev = paragraphs[i - 1];
|
||||
if (paragraph.StartTime.TotalMilliseconds < prev.EndTime.TotalMilliseconds && !prev.EndTime.IsMaxTime)
|
||||
{
|
||||
errors.Add("Overlap with prev");
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= 0 && i < paragraphs.Count - 1)
|
||||
{
|
||||
Paragraph next = paragraphs[i + 1];
|
||||
var gapMilliseconds = (int)Math.Round(next.StartTime.TotalMilliseconds - paragraph.EndTime.TotalMilliseconds);
|
||||
if (gapMilliseconds < Configuration.Settings.General.MinimumMillisecondsBetweenLines)
|
||||
{
|
||||
errors.Add("Overlap with next");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
string s = HtmlUtil.RemoveHtmlTags(paragraph.Text, true);
|
||||
foreach (string line in s.SplitToLines())
|
||||
{
|
||||
var count = line.CountCharacters(false, Configuration.Settings.General.IgnoreArabicDiacritics);
|
||||
if (count > Configuration.Settings.General.SubtitleLineMaximumLength)
|
||||
{
|
||||
errors.Add($"Line too long: {count} > {Configuration.Settings.General.SubtitleLineMaximumLength}");
|
||||
}
|
||||
}
|
||||
|
||||
int noOfLines = paragraph.NumberOfLines;
|
||||
if (s.CountCharacters(false, Configuration.Settings.General.IgnoreArabicDiacritics) <= Configuration.Settings.General.SubtitleLineMaximumLength * noOfLines)
|
||||
{
|
||||
if (noOfLines > Configuration.Settings.General.MaxNumberOfLines)
|
||||
{
|
||||
errors.Add($"Too many lines: {noOfLines} > {Configuration.Settings.General.MaxNumberOfLines}");
|
||||
}
|
||||
}
|
||||
|
||||
if (Configuration.Settings.Tools.ListViewSyntaxColorWideLines)
|
||||
{
|
||||
s = HtmlUtil.RemoveHtmlTags(paragraph.Text, true);
|
||||
foreach (string line in s.SplitToLines())
|
||||
{
|
||||
var pixels = TextWidth.CalcPixelWidth(line);
|
||||
if (pixels > Configuration.Settings.General.SubtitleLineMaximumPixelWidth)
|
||||
{
|
||||
errors.Add($"Line too wide in pixels: {pixels} > {Configuration.Settings.General.SubtitleLineMaximumPixelWidth}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return errors;
|
||||
}
|
||||
|
||||
public int ErrorIndex { get; private set; }
|
||||
|
||||
private void listViewErrors_DoubleClick(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewBookmarks.SelectedItems.Count > 0)
|
||||
{
|
||||
var p = (Paragraph)listViewBookmarks.SelectedItems[0].Tag;
|
||||
ErrorIndex = _subtitle.Paragraphs.IndexOf(p);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
private void buttonOK_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (listViewBookmarks.SelectedItems.Count > 0)
|
||||
{
|
||||
var p = (Paragraph)listViewBookmarks.SelectedItems[0].Tag;
|
||||
ErrorIndex = _subtitle.Paragraphs.IndexOf(p);
|
||||
DialogResult = DialogResult.OK;
|
||||
}
|
||||
}
|
||||
|
||||
private void ErrorsGoTo_KeyDown(object sender, KeyEventArgs e)
|
||||
{
|
||||
if (listViewBookmarks.Focused && e.KeyCode == Keys.Enter)
|
||||
{
|
||||
buttonOK_Click(sender, e);
|
||||
}
|
||||
else if (e.KeyCode == Keys.Escape)
|
||||
{
|
||||
DialogResult = DialogResult.Cancel;
|
||||
}
|
||||
else if (e.KeyData == UiUtil.HelpKeys)
|
||||
{
|
||||
UiUtil.ShowHelp(string.Empty);
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void ErrorsGoTo_ResizeEnd(object sender, EventArgs e)
|
||||
{
|
||||
listViewBookmarks.AutoSizeLastColumn();
|
||||
}
|
||||
|
||||
private void ErrorsGoTo_Shown(object sender, EventArgs e)
|
||||
{
|
||||
ErrorsGoTo_ResizeEnd(sender, e);
|
||||
listViewBookmarks.Focus();
|
||||
}
|
||||
|
||||
private void buttonExport_Click(object sender, EventArgs e)
|
||||
{
|
||||
ExportErrorsAsCsv(_subtitle, this);
|
||||
}
|
||||
|
||||
public static void ExportErrorsAsCsv(Subtitle subtitle, Form form)
|
||||
{
|
||||
using (var saveDialog = new SaveFileDialog { FileName = string.Empty, Filter = "CSV|*.csv" })
|
||||
{
|
||||
if (saveDialog.ShowDialog(form) != DialogResult.OK)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
foreach (var p in subtitle.Paragraphs.Where(p => p.Bookmark != null))
|
||||
{
|
||||
sb.AppendLine(MakeParagraphCsvLine(p));
|
||||
}
|
||||
|
||||
File.WriteAllText(saveDialog.FileName, sb.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private static string MakeParagraphCsvLine(Paragraph paragraph)
|
||||
{
|
||||
const string separator = ";";
|
||||
var sb = new StringBuilder();
|
||||
sb.Append(paragraph.Number + separator);
|
||||
sb.Append(ToCsvText(paragraph.StartTime.ToDisplayString()) + separator);
|
||||
sb.Append(ToCsvText(paragraph.EndTime.ToDisplayString()) + separator);
|
||||
sb.Append(ToCsvText(paragraph.Duration.ToShortDisplayString()) + separator);
|
||||
sb.Append(ToCsvText(paragraph.Text) + separator);
|
||||
sb.Append(ToCsvText(paragraph.Bookmark) + separator);
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
private static string ToCsvText(string input)
|
||||
{
|
||||
if (string.IsNullOrEmpty(input))
|
||||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
var sb = new StringBuilder();
|
||||
sb.Append("\"");
|
||||
foreach (var nextChar in input)
|
||||
{
|
||||
sb.Append(nextChar);
|
||||
if (nextChar == '"')
|
||||
{
|
||||
sb.Append("\"");
|
||||
}
|
||||
}
|
||||
sb.Append("\"");
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
120
src/ui/Forms/ErrorsGoTo.resx
Normal file
120
src/ui/Forms/ErrorsGoTo.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
@ -16609,6 +16609,11 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
GoToNextSyntaxError();
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
else if (e.KeyData == _shortcuts.MainListViewListErrors)
|
||||
{
|
||||
ListSyntaxErrors();
|
||||
e.SuppressKeyPress = true;
|
||||
}
|
||||
else if (e.KeyData == _shortcuts.MainListViewRemoveBlankLines)
|
||||
{
|
||||
if (_subtitle != null && _subtitle.Paragraphs.Any(p => string.IsNullOrWhiteSpace(p.Text)))
|
||||
@ -19330,6 +19335,21 @@ namespace Nikse.SubtitleEdit.Forms
|
||||
}
|
||||
}
|
||||
|
||||
private void ListSyntaxErrors()
|
||||
{
|
||||
using (var form = new ErrorsGoTo(_subtitle))
|
||||
{
|
||||
if (form.ShowDialog(this) == DialogResult.OK)
|
||||
{
|
||||
SelectListViewIndexAndEnsureVisible(form.ErrorIndex);
|
||||
if (mediaPlayer.VideoPlayer != null)
|
||||
{
|
||||
mediaPlayer.VideoPlayer.CurrentPosition = _subtitle.Paragraphs[form.ErrorIndex].StartTime.TotalSeconds;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void RestartHistory()
|
||||
{
|
||||
_listViewTextUndoLast = null;
|
||||
|
@ -183,6 +183,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
public Keys MainListViewColor3 { get; set; }
|
||||
public Keys MainListViewColor4 { get; set; }
|
||||
public Keys MainListViewGoToNextError { get; set; }
|
||||
public Keys MainListViewListErrors { get; set; }
|
||||
public Keys MainListViewRemoveBlankLines { get; set; }
|
||||
public Keys MainListViewRemoveTimeCodes { get; set; }
|
||||
public Keys MainListViewCopyText { get; set; }
|
||||
@ -318,6 +319,7 @@ namespace Nikse.SubtitleEdit.Logic
|
||||
MainListViewColor3 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainListViewColor3);
|
||||
MainListViewColor4 = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainListViewColor4);
|
||||
MainListViewGoToNextError = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainListViewGoToNextError);
|
||||
MainListViewListErrors = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainListViewListErrors);
|
||||
MainListViewRemoveBlankLines = UiUtil.GetKeys(Configuration.Settings.Shortcuts.GeneralRemoveBlankLines);
|
||||
MainListViewRemoveTimeCodes = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainListViewRemoveTimeCodes);
|
||||
MainEditFixRTLViaUnicodeChars = UiUtil.GetKeys(Configuration.Settings.Shortcuts.MainEditFixRTLViaUnicodeChars);
|
||||
|
@ -222,6 +222,12 @@
|
||||
<Compile Include="Forms\AddWaveformBatch.Designer.cs">
|
||||
<DependentUpon>AddWaveformBatch.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ErrorsGoTo.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ErrorsGoTo.Designer.cs">
|
||||
<DependentUpon>ErrorsGoTo.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Forms\BookmarksGoTo.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
@ -1356,6 +1362,9 @@
|
||||
<EmbeddedResource Include="Forms\AddWaveformBatch.resx">
|
||||
<DependentUpon>AddWaveformBatch.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\ErrorsGoTo.resx">
|
||||
<DependentUpon>ErrorsGoTo.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Forms\BookmarksGoTo.resx">
|
||||
<DependentUpon>BookmarksGoTo.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
Loading…
Reference in New Issue
Block a user