Skip to content
Snippets Groups Projects
Commit e8d025c1 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

Do not show startup errors as balloon tips - too disturbing

Instead, the error is logged and the tray app will exit.

Fixes #44
parent 844ac746
No related branches found
No related tags found
No related merge requests found
...@@ -109,13 +109,21 @@ namespace ATxTray ...@@ -109,13 +109,21 @@ namespace ATxTray
catch (Exception ex) { catch (Exception ex) {
var msg = "Error during initialization: " + ex.Message; var msg = "Error during initialization: " + ex.Message;
Log.Error(msg); Log.Error(msg);
_notifyIcon.ShowBalloonTip(5000, AppTitle, msg, ToolTipIcon.Error);
// we cannot terminate the message loop (Application.Run()) while the constructor // we cannot terminate the message loop (Application.Run()) while the constructor
// is being run as it is not active yet - therefore we set the _status object to // is being run as it is not active yet - therefore we set the _status object to
// null which will terminate the application during the next "Elapsed" event: // null which will terminate the application during the next "Elapsed" event:
_status = null; _status = null;
/* Do NOT show the balloon tip at all, as this is highly disturbing for the
user. For debugging purposes, the log message is definitely enough:
_notifyIcon.ShowBalloonTip(5000, AppTitle, msg, ToolTipIcon.Error);
// suspend the thread for 5s to make sure the balloon tip is shown for a while: // suspend the thread for 5s to make sure the balloon tip is shown for a while:
System.Threading.Thread.Sleep(5000); System.Threading.Thread.Sleep(5000);
*/
// sleep briefly before exiting:
System.Threading.Thread.Sleep(100);
} }
// we need to enable the timer no matter whether the initialization steps above have // we need to enable the timer no matter whether the initialization steps above have
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment