@@ -14,8 +14,8 @@ namespace FlashDevelop.Dialogs
14
14
{
15
15
public class ShortcutDialog : SmartForm
16
16
{
17
- const string ViewConflictsKey = "?" ; // TODO: Change the type to char after #969 is merged
18
- const string ViewCustomKey = "*" ; // TODO: Change the type to char after #969 is merged
17
+ const char ViewConflictsKey = '?' ;
18
+ const char ViewCustomKey = '*' ;
19
19
20
20
Timer updateTimer ;
21
21
ToolStripMenuItem removeShortcut ;
@@ -330,6 +330,8 @@ bool ShowConflictsPresent()
330
330
if ( MessageBox . Show ( this , text , " " + caption , MessageBoxButtons . YesNo , MessageBoxIcon . Warning ) == DialogResult . No )
331
331
{
332
332
this . filterTextBox . Text = ViewConflictsKey . ToString ( ) ;
333
+ this . filterTextBox . SelectAll ( ) ;
334
+ this . filterTextBox . Focus ( ) ;
333
335
return true ;
334
336
}
335
337
return false ;
@@ -365,17 +367,17 @@ void PopulateListView(string filter)
365
367
366
368
/// <summary>
367
369
/// Reads and removes filter keywords from the start of the filter.
368
- /// Order of the keywords is irrelevant.
370
+ /// The order of the keywords is irrelevant.
369
371
/// </summary>
370
372
static string ExtractFilterKeywords ( string filter , ref bool viewCustom , ref bool viewConflicts )
371
373
{
372
- if ( ! viewCustom && filter . StartsWith ( ViewCustomKey ) )
374
+ if ( ! viewCustom && filter . Length != 0 && filter [ 0 ] == ViewCustomKey )
373
375
{
374
376
filter = filter . Substring ( 1 ) ;
375
377
viewCustom = true ;
376
378
return ExtractFilterKeywords ( filter , ref viewCustom , ref viewConflicts ) ;
377
379
}
378
- if ( ! viewConflicts && filter . StartsWith ( ViewConflictsKey ) )
380
+ if ( ! viewConflicts && filter . Length != 0 && filter [ 0 ] == ViewConflictsKey )
379
381
{
380
382
filter = filter . Substring ( 1 ) ;
381
383
viewConflicts = true ;
@@ -585,14 +587,10 @@ void SelectCustomShortcut(object sender, EventArgs e)
585
587
586
588
if ( dialog . ShowDialog ( this ) == DialogResult . OK )
587
589
{
588
- string extension = Path . GetExtension ( dialog . FileName ) ;
589
- if ( extension . Equals ( ".fda" , StringComparison . OrdinalIgnoreCase ) )
590
- {
591
- this . listView . BeginUpdate ( ) ;
592
- ShortcutManager . LoadCustomShortcuts ( dialog . FileName , this . shortcutListItems ) ;
593
- this . UpdateAllShortcutsConflicts ( ) ;
594
- this . listView . EndUpdate ( ) ;
595
- }
590
+ this . listView . BeginUpdate ( ) ;
591
+ ShortcutManager . LoadCustomShortcuts ( dialog . FileName , this . shortcutListItems ) ;
592
+ this . UpdateAllShortcutsConflicts ( ) ;
593
+ this . listView . EndUpdate ( ) ;
596
594
}
597
595
}
598
596
0 commit comments