Go to next error now also works in 'Fix common errors'

This commit is contained in:
niksedk 2014-04-08 18:42:11 +02:00
parent f1ecb26698
commit 7978ec7866
3 changed files with 36 additions and 3 deletions

View File

@ -410,6 +410,9 @@ namespace Nikse.SubtitleEdit.Forms
this.subtitleListView1.Name = "subtitleListView1"; this.subtitleListView1.Name = "subtitleListView1";
this.subtitleListView1.OwnerDraw = true; this.subtitleListView1.OwnerDraw = true;
this.subtitleListView1.Size = new System.Drawing.Size(785, 156); this.subtitleListView1.Size = new System.Drawing.Size(785, 156);
this.subtitleListView1.SubtitleFontBold = false;
this.subtitleListView1.SubtitleFontName = "Tahoma";
this.subtitleListView1.SubtitleFontSize = 8;
this.subtitleListView1.TabIndex = 110; this.subtitleListView1.TabIndex = 110;
this.subtitleListView1.UseCompatibleStateImageBehavior = false; this.subtitleListView1.UseCompatibleStateImageBehavior = false;
this.subtitleListView1.UseSyntaxColoring = true; this.subtitleListView1.UseSyntaxColoring = true;
@ -538,7 +541,7 @@ namespace Nikse.SubtitleEdit.Forms
this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 27); this.timeUpDownStartTime.Location = new System.Drawing.Point(8, 27);
this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4); this.timeUpDownStartTime.Margin = new System.Windows.Forms.Padding(4);
this.timeUpDownStartTime.Name = "timeUpDownStartTime"; this.timeUpDownStartTime.Name = "timeUpDownStartTime";
this.timeUpDownStartTime.Size = new System.Drawing.Size(92, 25); this.timeUpDownStartTime.Size = new System.Drawing.Size(96, 25);
this.timeUpDownStartTime.TabIndex = 112; this.timeUpDownStartTime.TabIndex = 112;
// //
// numericUpDownDuration // numericUpDownDuration
@ -662,8 +665,8 @@ namespace Nikse.SubtitleEdit.Forms
this.Controls.Add(this.buttonBack); this.Controls.Add(this.buttonBack);
this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonNextFinish); this.Controls.Add(this.buttonNextFinish);
this.Controls.Add(this.groupBoxStep1);
this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBoxStep1);
this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Font = new System.Drawing.Font("Tahoma", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.KeyPreview = true; this.KeyPreview = true;
this.MaximizeBox = false; this.MaximizeBox = false;

View File

@ -74,6 +74,7 @@ namespace Nikse.SubtitleEdit.Forms
Keys _preview = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainToolsFixCommonErrorsPreview); Keys _preview = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainToolsFixCommonErrorsPreview);
Keys _mainGeneralGoToNextSubtitle = Utilities.GetKeys(Configuration.Settings.Shortcuts.GeneralGoToNextSubtitle); Keys _mainGeneralGoToNextSubtitle = Utilities.GetKeys(Configuration.Settings.Shortcuts.GeneralGoToNextSubtitle);
Keys _mainGeneralGoToPrevSubtitle = Utilities.GetKeys(Configuration.Settings.Shortcuts.GeneralGoToPrevSubtitle); Keys _mainGeneralGoToPrevSubtitle = Utilities.GetKeys(Configuration.Settings.Shortcuts.GeneralGoToPrevSubtitle);
Keys _mainListViewGoToNextError = Utilities.GetKeys(Configuration.Settings.Shortcuts.MainListViewGoToNextError);
class FixItem class FixItem
{ {
@ -4464,6 +4465,33 @@ namespace Nikse.SubtitleEdit.Forms
} }
subtitleListView1.SelectIndexAndEnsureVisible(selectedIndex); subtitleListView1.SelectIndexAndEnsureVisible(selectedIndex);
} }
else if (_mainListViewGoToNextError == e.KeyData)
{
GoToNextSynaxError();
e.SuppressKeyPress = true;
}
}
private void GoToNextSynaxError()
{
int idx = 0;
try
{
if (listViewFixes.SelectedItems.Count > 0)
idx = listViewFixes.SelectedItems[0].Index;
idx++;
if (listViewFixes.Items.Count > idx)
{
listViewFixes.Items[idx].Selected = true;
listViewFixes.Items[idx].EnsureVisible();
if (idx > 0)
listViewFixes.Items[idx-1].Selected = false;
}
}
catch
{
}
} }
private void GoToLineNumber() private void GoToLineNumber()

View File

@ -155,7 +155,7 @@ namespace Nikse.SubtitleEdit.Forms
Keys _mainListViewToggleDashes = Keys.None; Keys _mainListViewToggleDashes = Keys.None;
Keys _mainListViewAutoDuration = Keys.None; Keys _mainListViewAutoDuration = Keys.None;
Keys _mainListViewFocusWaveform = Keys.None; Keys _mainListViewFocusWaveform = Keys.None;
Keys _mainListViewGoToNextError = Keys.None; Keys _mainListViewGoToNextError = Keys.None;
Keys _mainListViewCopyText = Keys.None; Keys _mainListViewCopyText = Keys.None;
Keys _mainEditReverseStartAndEndingForRTL = Keys.None; Keys _mainEditReverseStartAndEndingForRTL = Keys.None;
Keys _waveformVerticalZoom = Keys.None; Keys _waveformVerticalZoom = Keys.None;
@ -7209,6 +7209,7 @@ namespace Nikse.SubtitleEdit.Forms
else if (e.KeyData == _mainListViewGoToNextError) else if (e.KeyData == _mainListViewGoToNextError)
{ {
GoToNextSynaxError(); GoToNextSynaxError();
e.SuppressKeyPress = true;
} }
// last key down in text // last key down in text
@ -11508,6 +11509,7 @@ namespace Nikse.SubtitleEdit.Forms
else if (e.KeyData == _mainListViewGoToNextError) else if (e.KeyData == _mainListViewGoToNextError)
{ {
GoToNextSynaxError(); GoToNextSynaxError();
e.SuppressKeyPress = true;
} }
else if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control) //Ctrl+vPaste from clipboard else if (e.KeyCode == Keys.V && e.Modifiers == Keys.Control) //Ctrl+vPaste from clipboard
{ {