Fix for ASSA line selector

This commit is contained in:
niksedk 2021-06-21 10:01:37 +02:00
parent d0e9193248
commit 70cf488f40
2 changed files with 16 additions and 0 deletions

View File

@ -109,6 +109,7 @@ namespace Nikse.SubtitleEdit.Forms.Assa
this.listViewFixes.TabIndex = 1;
this.listViewFixes.UseCompatibleStateImageBehavior = false;
this.listViewFixes.View = System.Windows.Forms.View.Details;
this.listViewFixes.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.listViewFixes_ItemChecked);
//
// columnHeaderApply
//

View File

@ -97,7 +97,9 @@ namespace Nikse.SubtitleEdit.Forms.Assa
}
Indices = indices.ToArray();
listViewFixes.ItemChecked -= listViewFixes_ItemChecked;
listViewFixes.Items.AddRange(listViewItems.ToArray());
listViewFixes.ItemChecked += listViewFixes_ItemChecked;
listViewFixes.EndUpdate();
groupBoxPreview.Text = string.Format(LanguageSettings.Current.ModifySelection.MatchingLinesX, listViewFixes.Items.Count);
listViewFixes.AutoSizeLastColumn();
@ -187,5 +189,18 @@ namespace Nikse.SubtitleEdit.Forms.Assa
e.SuppressKeyPress = true;
}
}
private void listViewFixes_ItemChecked(object sender, ItemCheckedEventArgs e)
{
if (e.Item == null)
{
return;
}
if (int.TryParse(e.Item.Tag.ToString(), out var index))
{
Indices = Indices.ToList().Where(p => p != index).ToArray();
}
}
}
}