From 45b7361e794d393c01428abf46a8ab18fd344118 Mon Sep 17 00:00:00 2001 From: Paddy Xu Date: Sun, 23 Jul 2017 15:00:18 +0300 Subject: [PATCH] longer update notification time --- QuickLook/Helpers/Updater.cs | 4 +++- QuickLook/TrayIconManager.cs | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/QuickLook/Helpers/Updater.cs b/QuickLook/Helpers/Updater.cs index b49dfe0..aaca0b1 100644 --- a/QuickLook/Helpers/Updater.cs +++ b/QuickLook/Helpers/Updater.cs @@ -68,7 +68,9 @@ namespace QuickLook.Helpers ViewWindowManager.GetInstance().InvokeViewer(changeLogPath); TrayIconManager.GetInstance().ShowNotification("", string.Format(TranslationHelper.GetString("Update_Found"), nVersion), - clickEvent: () => Process.Start( + timeout: 20000, + clickEvent: + () => Process.Start( @"https://github.com/xupefei/QuickLook/releases/latest")); }); } diff --git a/QuickLook/TrayIconManager.cs b/QuickLook/TrayIconManager.cs index a081a3c..efe0daa 100644 --- a/QuickLook/TrayIconManager.cs +++ b/QuickLook/TrayIconManager.cs @@ -66,10 +66,11 @@ namespace QuickLook _icon.Visible = false; } - public void ShowNotification(string title, string content, bool isError = false, Action clickEvent = null, + public void ShowNotification(string title, string content, bool isError = false, int timeout = 5000, + Action clickEvent = null, Action closeEvent = null) { - _icon.ShowBalloonTip(5000, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info); + _icon.ShowBalloonTip(timeout, title, content, isError ? ToolTipIcon.Error : ToolTipIcon.Info); _icon.BalloonTipClicked += OnIconOnBalloonTipClicked; _icon.BalloonTipClosed += OnIconOnBalloonTipClosed;