Improve UI for "Merge text with same time codes" - thx Jamakmake :)

(Click on fix focuses fixed lines as in "Merge lines with same text")
This commit is contained in:
Nikolaj Olsson 2019-03-12 22:03:14 +01:00
parent 2024b918b5
commit 2b2dbad6f4
3 changed files with 26 additions and 3 deletions

View File

@ -109,6 +109,7 @@
this.listViewFixes.TabIndex = 0;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
this.listViewFixes.SelectedIndexChanged += new System.EventHandler(this.listViewFixes_SelectedIndexChanged);
//
// columnHeader4
//

View File

@ -3,6 +3,7 @@ using Nikse.SubtitleEdit.Logic;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Globalization;
using System.Windows.Forms;
namespace Nikse.SubtitleEdit.Forms
@ -222,5 +223,25 @@ namespace Nikse.SubtitleEdit.Forms
Cursor = Cursors.Default;
}
private void listViewFixes_SelectedIndexChanged(object sender, EventArgs e)
{
if (listViewFixes.SelectedIndices.Count > 0)
{
int index = listViewFixes.SelectedIndices[0];
ListViewItem item = listViewFixes.Items[index];
string[] numbers = item.SubItems[1].Text.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
foreach (string number in numbers)
{
foreach (Paragraph p in _subtitle.Paragraphs)
{
if (p.Number.ToString(CultureInfo.InvariantCulture) == number)
{
index = _subtitle.GetIndex(p);
SubtitleListview1.EnsureVisible(index);
}
}
}
}
}
}
}

View File

@ -25,9 +25,9 @@ namespace Nikse.SubtitleEdit.Forms.Styles
public string NewName { get; set; }
}
public List<NameEdit> RenameActions { get; set; } = new List<NameEdit>();
private string _startName = null;
private string _editedName = null;
public List<NameEdit> RenameActions { get; set; }
private string _startName;
private string _editedName;
private string _header;
private bool _doUpdate;
private string _oldSsaName;
@ -41,6 +41,7 @@ namespace Nikse.SubtitleEdit.Forms.Styles
InitializeComponent();
UiUtil.FixFonts(this);
RenameActions = new List<NameEdit>();
labelStatus.Text = string.Empty;
_header = subtitle.Header;
_format = format;