From b7b8b1dd90731180652164ba9c77e0e7c84b47ad Mon Sep 17 00:00:00 2001 From: Nikolaj Olsson Date: Mon, 7 Oct 2019 08:39:21 +0200 Subject: [PATCH] Add remove entry via del key in batch waveforms - thx Jamakmake :) --- src/Forms/AddWaveformBatch.Designer.cs | 1 + src/Forms/AddWaveformBatch.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Forms/AddWaveformBatch.Designer.cs b/src/Forms/AddWaveformBatch.Designer.cs index 467b68574..e15741e33 100644 --- a/src/Forms/AddWaveformBatch.Designer.cs +++ b/src/Forms/AddWaveformBatch.Designer.cs @@ -136,6 +136,7 @@ this.listViewInputFiles.View = System.Windows.Forms.View.Details; this.listViewInputFiles.DragDrop += new System.Windows.Forms.DragEventHandler(this.listViewInputFiles_DragDrop); this.listViewInputFiles.DragEnter += new System.Windows.Forms.DragEventHandler(this.listViewInputFiles_DragEnter); + this.listViewInputFiles.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ListViewInputFiles_KeyDown); // // columnHeaderFName // diff --git a/src/Forms/AddWaveformBatch.cs b/src/Forms/AddWaveformBatch.cs index 669a813a2..5d3bde45f 100644 --- a/src/Forms/AddWaveformBatch.cs +++ b/src/Forms/AddWaveformBatch.cs @@ -54,7 +54,7 @@ namespace Nikse.SubtitleEdit.Forms private void RemoveSelectedFiles() { - if (_converting) + if (_converting || listViewInputFiles.SelectedIndices.Count == 0) { return; } @@ -410,5 +410,12 @@ namespace Nikse.SubtitleEdit.Forms } } + private void ListViewInputFiles_KeyDown(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Delete) + { + RemoveSelectedFiles(); + } + } } -} +} \ No newline at end of file