Disable shortcuts until startup has completed.

master
Pacman Ghost 5 years ago
parent 858ed9eb7a
commit 939f0e83e1
  1. 4
      src/MainForm.cs
  2. 4
      src/MainForm.ui.cs

@ -17,6 +17,7 @@ public partial class MainForm : Form
private readonly HashSet<string> mValidImageExtensions = new HashSet<string>{ ".png", ".jpg", ".gif" } ;
private Dictionary<string,ChartImage> mChartImages = new Dictionary<string,ChartImage>() ;
private bool mIsReady = false ;
private SplitContainer mSplitter = new SplitContainer() ;
private UserControl mSearchUserControl = new UserControl() ;
@ -121,6 +122,9 @@ public partial class MainForm : Form
mSearchLabel.Enabled = true ;
mSearchQuery.Enabled = true ;
mSearchQuery.Focus() ;
// flag that we've finished initialization
mIsReady = true ;
}
private void updateSearchResults( string searchQuery )

@ -191,6 +191,10 @@ public partial class MainForm : Form
if ( keyCode == Keys.Return )
return true ; // nb: stop Windows from beeping :-/
// NOTE: The following keypress handling is only done after we've finished initialization.
if ( ! mIsReady )
return false ;
// handle shortcuts
if ( Shortcut.handleShortcut( keyData ) )
return true ;

Loading…
Cancel
Save