Fix sort en gen video w hardsub

This commit is contained in:
Nikolaj Olsson 2024-04-29 18:22:47 +02:00
parent 7b15d11cc1
commit a72ebd04d5

View File

@ -979,12 +979,18 @@ namespace Nikse.SubtitleEdit.Forms
if (_abort) if (_abort)
{ {
process.Kill(); process.Kill();
return false;
} }
var v = (int)_processedFrames; var v = (int)_processedFrames;
SetProgress(v); SetProgress(v);
} }
if (_abort)
{
return false;
}
if (process.ExitCode != 0) if (process.ExitCode != 0)
{ {
_log.AppendLine("ffmpeg exit code: " + process.ExitCode); _log.AppendLine("ffmpeg exit code: " + process.ExitCode);
@ -2113,6 +2119,7 @@ namespace Nikse.SubtitleEdit.Forms
try try
{ {
Cursor = Cursors.WaitCursor; Cursor = Cursors.WaitCursor;
Refresh();
Application.DoEvents(); Application.DoEvents();
for (var i = 0; i < listViewBatch.Columns.Count; i++) for (var i = 0; i < listViewBatch.Columns.Count; i++)
{ {
@ -2121,6 +2128,7 @@ namespace Nikse.SubtitleEdit.Forms
foreach (var fileName in openFileDialog1.FileNames) foreach (var fileName in openFileDialog1.FileNames)
{ {
Application.DoEvents();
AddInputFile(fileName); AddInputFile(fileName);
} }
} }
@ -2297,13 +2305,14 @@ namespace Nikse.SubtitleEdit.Forms
return; return;
} }
try var fileNames = (string[])e.Data.GetData(DataFormats.FileDrop);
{ labelPleaseWait.Visible = true;
var fileNames = (string[])e.Data.GetData(DataFormats.FileDrop);
labelPleaseWait.Visible = true;
TaskDelayHelper.RunDelayed(TimeSpan.FromMilliseconds(5), () => TaskDelayHelper.RunDelayed(TimeSpan.FromMilliseconds(5), () =>
{
try
{ {
Cursor = Cursors.WaitCursor;
foreach (var fileName in fileNames) foreach (var fileName in fileNames)
{ {
if (FileUtil.IsDirectory(fileName)) if (FileUtil.IsDirectory(fileName))
@ -2312,15 +2321,17 @@ namespace Nikse.SubtitleEdit.Forms
} }
else else
{ {
Application.DoEvents();
AddInputFile(fileName); AddInputFile(fileName);
} }
} }
}); }
} finally
finally {
{ Cursor = Cursors.Default;
labelPleaseWait.Visible = false; labelPleaseWait.Visible = false;
} }
});
} }
private void SearchFolder(string path) private void SearchFolder(string path)
@ -2418,6 +2429,11 @@ namespace Nikse.SubtitleEdit.Forms
return; return;
} }
for (var i = 0; i < listViewBatch.Columns.Count; i++)
{
ListViewSorter.SetSortArrow(listViewBatch.Columns[i], SortOrder.None);
}
var lv = (ListView)sender; var lv = (ListView)sender;
if (!(lv.ListViewItemSorter is ListViewSorter sorter)) if (!(lv.ListViewItemSorter is ListViewSorter sorter))
{ {
@ -2436,6 +2452,8 @@ namespace Nikse.SubtitleEdit.Forms
else else
{ {
sorter.ColumnNumber = e.Column; sorter.ColumnNumber = e.Column;
sorter.Descending = false;
sorter.IsDisplayFileSize = e.Column == ListViewBatchSubItemIndexColumnVideoSize;
} }
lv.Sort(); lv.Sort();