From 6d1c65ceda0c4072f6cbc504aab439437291d0d9 Mon Sep 17 00:00:00 2001 From: Taka Date: Thu, 22 Aug 2019 15:21:24 +0000 Subject: [PATCH] Show the shortcuts report at startup. --- src/MainForm.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/MainForm.cs b/src/MainForm.cs index 2e9f5cb..e38ed3a 100644 --- a/src/MainForm.cs +++ b/src/MainForm.cs @@ -107,16 +107,20 @@ public partial class MainForm : Form string unconfiguredImages = Program.getStartupMsgs( "unconfigured-image", "WARNING: Found image files with no configuration:" ) ; string badShortcuts = Program.getStartupMsgs( "bad-shortcut", "WARNING: Couldn't parse shortcuts:" ) ; string otherMsgs = Program.getStartupMsgs( "", "" ) ; - string buf = "" ; - string fname = Path.Combine( Program.resourcesDir, "startup-msgs.html" ) ; - if ( File.Exists( fname ) ) { - buf = File.ReadAllText( fname ) ; - buf = buf.Replace( "{{UNUSED-CONFIGS}}", unusedConfigs ) ; - buf = buf.Replace( "{{UNCONFIGURED-IMAGES}}", unconfiguredImages ) ; - buf = buf.Replace( "{{BAD-SHORTCUTS}}", badShortcuts ) ; - buf = buf.Replace( "{{OTHER-MESSAGES}}", otherMsgs ) ; + if ( unusedConfigs != "" || unconfiguredImages != "" || badShortcuts != "" || otherMsgs != "" ) { + string fname = Path.Combine( Program.resourcesDir, "startup-msgs.html" ) ; + if ( File.Exists( fname ) ) { + string buf = File.ReadAllText( fname ) ; + buf = buf.Replace( "{{UNUSED-CONFIGS}}", unusedConfigs ) ; + buf = buf.Replace( "{{UNCONFIGURED-IMAGES}}", unconfiguredImages ) ; + buf = buf.Replace( "{{BAD-SHORTCUTS}}", badShortcuts ) ; + buf = buf.Replace( "{{OTHER-MESSAGES}}", otherMsgs ) ; + mWebBrowser.DocumentText = buf ; + } + } else { + // NOTE: Nothing bad happened, just show the shortcuts report. + showShortcuts() ; } - mWebBrowser.DocumentText = buf ; // allow searches mSearchLabel.Enabled = true ;