@@ -19,18 +19,19 @@ namespace ResultsPanel
19
19
{
20
20
public class PluginUI : DockPanelControl
21
21
{
22
+ public ToolStripMenuItem clearEntriesContextMenuItem ;
23
+ public ToolStripMenuItem copyEntryContextMenuItem ;
24
+ public ToolStripMenuItem ignoreEntryContextMenuItem ;
25
+ public ToolStripMenuItem clearIgnoredEntriesContextMenuItem ;
26
+ public ToolStripMenuItem nextEntry ;
27
+ public ToolStripMenuItem previousEntry ;
28
+
22
29
private ListViewEx entriesView ;
23
30
private ColumnHeader entryFile ;
24
31
private ColumnHeader entryDesc ;
25
32
private ColumnHeader entryLine ;
26
33
private ColumnHeader entryPath ;
27
34
private ColumnHeader entryType ;
28
- private ToolStripMenuItem nextEntry ;
29
- private ToolStripMenuItem previousEntry ;
30
- private ToolStripMenuItem ignoreEntriesContextMenuItem ;
31
- private ToolStripMenuItem ignoreEntryContextMenuItem ;
32
- private ToolStripMenuItem copyEntryContextMenuItem ;
33
- private ToolStripMenuItem clearIgnoredEntriesContextMenuItem ;
34
35
private IDictionary < String , Boolean > ignoredEntries ;
35
36
private List < ListViewItem > allListViewItems = new List < ListViewItem > ( ) ;
36
37
private ToolStripButton toolStripButtonError ;
@@ -267,22 +268,24 @@ public void InitializeGraphics()
267
268
public void InitializeContextMenu ( )
268
269
{
269
270
ContextMenuStrip menu = new ContextMenuStrip ( ) ;
270
- this . ignoreEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearEntries" ) , null , new EventHandler ( this . ClearOutputClick ) ) ;
271
- menu . Items . Add ( this . ignoreEntriesContextMenuItem ) ;
271
+ this . clearEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearEntries" ) , null , new EventHandler ( this . ClearOutputClick ) ) ;
272
+ this . clearEntriesContextMenuItem . ShortcutKeys = this . pluginMain . ClearResults ;
273
+ menu . Items . Add ( this . clearEntriesContextMenuItem ) ;
272
274
this . copyEntryContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.CopyEntry" ) , null , new EventHandler ( this . CopyTextClick ) ) ;
273
- this . copyEntryContextMenuItem . ShortcutKeyDisplayString = DataConverter . KeysToString ( this . pluginMain . CopyEntry ) ;
275
+ this . copyEntryContextMenuItem . ShortcutKeys = this . pluginMain . CopyEntry ;
274
276
menu . Items . Add ( this . copyEntryContextMenuItem ) ;
275
277
this . ignoreEntryContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.IgnoreEntry" ) , null , new EventHandler ( this . IgnoreEntryClick ) ) ;
276
- this . ignoreEntryContextMenuItem . ShortcutKeyDisplayString = DataConverter . KeysToString ( this . pluginMain . IgnoreEntry ) ;
278
+ this . ignoreEntryContextMenuItem . ShortcutKeys = this . pluginMain . IgnoreEntry ;
277
279
menu . Items . Add ( this . ignoreEntryContextMenuItem ) ;
278
- this . clearIgnoredEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearIgnoredEntries" ) , null , new EventHandler ( this . ClearIgnoredEntries ) ) ;
280
+ this . clearIgnoredEntriesContextMenuItem = new ToolStripMenuItem ( TextHelper . GetString ( "Label.ClearIgnoredEntries" ) , null , new EventHandler ( this . ClearIgnoredEntriesClick ) ) ;
281
+ this . clearIgnoredEntriesContextMenuItem . ShortcutKeys = this . pluginMain . ClearIgnoredEntries ;
279
282
menu . Items . Add ( this . clearIgnoredEntriesContextMenuItem ) ;
280
283
menu . Items . Add ( new ToolStripSeparator ( ) ) ;
281
284
this . nextEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.NextEntry" ) , null , new EventHandler ( this . NextEntry ) ) ;
282
- this . nextEntry . ShortcutKeyDisplayString = DataConverter . KeysToString ( this . pluginMain . NextError ) ;
285
+ this . nextEntry . ShortcutKeys = this . pluginMain . NextError ;
283
286
menu . Items . Add ( this . nextEntry ) ;
284
287
this . previousEntry = new ToolStripMenuItem ( TextHelper . GetString ( "Label.PreviousEntry" ) , null , new EventHandler ( this . PreviousEntry ) ) ;
285
- this . previousEntry . ShortcutKeyDisplayString = DataConverter . KeysToString ( this . pluginMain . PrevError ) ;
288
+ this . previousEntry . ShortcutKeys = this . pluginMain . PrevError ;
286
289
menu . Items . Add ( this . previousEntry ) ;
287
290
this . entriesView . ContextMenuStrip = menu ;
288
291
menu . Font = PluginBase . Settings . DefaultFont ;
@@ -389,10 +392,17 @@ public void CopyTextClick(Object sender, System.EventArgs e)
389
392
/// <summary>
390
393
/// Clears any result entries that are ignored. Invoked from the context menu.
391
394
/// </summary>
392
- public void ClearIgnoredEntries ( Object sender , System . EventArgs e )
395
+ public void ClearIgnoredEntriesClick ( Object sender , System . EventArgs e )
396
+ {
397
+ ClearIgnoredEntries ( ) ;
398
+ }
399
+
400
+ public bool ClearIgnoredEntries ( )
393
401
{
402
+ if ( this . ignoredEntries . Count == 0 ) return false ;
394
403
this . ignoredEntries . Clear ( ) ;
395
404
this . FilterResults ( false ) ;
405
+ return true ;
396
406
}
397
407
398
408
/// <summary>
@@ -452,7 +462,7 @@ private void PluginUIResize(object sender, EventArgs e)
452
462
/// </summary>
453
463
private void ContextMenuOpening ( object sender , System . ComponentModel . CancelEventArgs e )
454
464
{
455
- this . nextEntry . Enabled = this . previousEntry . Enabled = this . ignoreEntriesContextMenuItem . Enabled = this . entriesView . Items . Count > 0 ;
465
+ this . nextEntry . Enabled = this . previousEntry . Enabled = this . clearEntriesContextMenuItem . Enabled = this . entriesView . Items . Count > 0 ;
456
466
this . ignoreEntryContextMenuItem . Enabled = this . copyEntryContextMenuItem . Enabled = this . entriesView . SelectedItems . Count > 0 ;
457
467
this . clearIgnoredEntriesContextMenuItem . Enabled = this . ignoredEntries . Count > 0 ;
458
468
}
@@ -556,8 +566,10 @@ private void MBSafeSetSelAndFocus(ScintillaControl sci, Int32 line, Int32 startP
556
566
/// <summary>
557
567
/// Clears the output
558
568
/// </summary>
559
- public void ClearOutput ( )
569
+ public bool ClearOutput ( )
560
570
{
571
+ if ( ! this . clearEntriesContextMenuItem . Enabled ) return false ;
572
+
561
573
this . ClearSquiggles ( ) ;
562
574
this . allListViewItems . Clear ( ) ;
563
575
this . toolStripTextBoxFilter . Text = "" ;
@@ -566,6 +578,7 @@ public void ClearOutput()
566
578
this . DisableContextMenuItems ( ) ;
567
579
this . entryIndex = - 1 ;
568
580
this . UpdateButtons ( ) ;
581
+ return true ;
569
582
}
570
583
571
584
/// <summary>
0 commit comments