diff options
author | Miguel Costa <miguel.costa@qt.io> | 2022-03-22 14:23:13 +0100 |
---|---|---|
committer | Miguel Costa <miguel.costa@qt.io> | 2022-03-22 16:11:14 +0000 |
commit | 3190ff546f840160f2ffe176e2ed8caa712a61ee (patch) | |
tree | 5c1a1f2741f7bf79552f9d8d22ca829c7aac0edd | |
parent | 299f8a25d87b426c8341f5bee0f5e9e8d3a0eb61 (diff) |
Improve InfoBar notifications
Notification of new version installated:
* Using information ('i') icon instead of the warning ('!') icon.
* New option that enables/disables the notification.
* Action hyperlink to disable the notification ("Don't show again").
* Minor change in the message text.
Notification of Qt version not found:
* Using warning ('!') icon instead of the information ('i') icon.
Change-Id: I75d5fc5b5a5eb2df191f99c92e5492d90d4eb894
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
-rw-r--r-- | QtVsTools.Package/Options/QtOptionsPage.cs | 14 | ||||
-rw-r--r-- | QtVsTools.Package/Package/InfoBarMessages.cs | 19 | ||||
-rw-r--r-- | QtVsTools.Package/QtVsToolsPackage.cs | 3 |
3 files changed, 30 insertions, 6 deletions
diff --git a/QtVsTools.Package/Options/QtOptionsPage.cs b/QtVsTools.Package/Options/QtOptionsPage.cs index 6f059be1..298274af 100644 --- a/QtVsTools.Package/Options/QtOptionsPage.cs +++ b/QtVsTools.Package/Options/QtOptionsPage.cs @@ -87,6 +87,11 @@ namespace QtVsTools.Options [String("BkgBuild_LoggerVerbosity")] LoggerVerbosity, } + public enum Notifications + { + [String("Notifications_Installed")] Installed, + } + public enum Timeout : uint { Disabled = 0 } class TimeoutConverter : EnumConverter @@ -222,6 +227,12 @@ namespace QtVsTools.Options [Description("Configure verbosity level of background build log.")] public LoggerVerbosity BuildLoggerVerbosity { get; set; } + [Category("Notifications")] + [DisplayName("New version installed")] + [Description("Show notification when a new version was recently installed.")] + [TypeConverter(typeof(EnableDisableConverter))] + public bool NotifyInstalled { get; set; } + public override void ResetSettings() { ThreadHelper.ThrowIfNotOnUIThread(); @@ -236,6 +247,7 @@ namespace QtVsTools.Options BuildRunQtTools = ProjectTracking = true; BuildDebugInformation = false; BuildLoggerVerbosity = LoggerVerbosity.Quiet; + NotifyInstalled = true; //////// // Get Qt Help keyboard shortcut @@ -275,6 +287,7 @@ namespace QtVsTools.Options Load(() => BuildRunQtTools, key, BkgBuild.RunQtTools); Load(() => BuildDebugInformation, key, BkgBuild.DebugInfo); Load(() => BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity); + Load(() => NotifyInstalled, key, Notifications.Installed); } } catch (Exception exception) { Messages.Print( @@ -308,6 +321,7 @@ namespace QtVsTools.Options Save(BuildRunQtTools, key, BkgBuild.RunQtTools); Save(BuildDebugInformation, key, BkgBuild.DebugInfo); Save(BuildLoggerVerbosity, key, BkgBuild.LoggerVerbosity); + Save(NotifyInstalled, key, Notifications.Installed); } } catch (Exception exception) { Messages.Print( diff --git a/QtVsTools.Package/Package/InfoBarMessages.cs b/QtVsTools.Package/Package/InfoBarMessages.cs index bb53e3cd..f94f39e3 100644 --- a/QtVsTools.Package/Package/InfoBarMessages.cs +++ b/QtVsTools.Package/Package/InfoBarMessages.cs @@ -41,7 +41,7 @@ namespace QtVsTools public static IMessage NoQtVersion => StaticLazy.Get(() => NoQtVersion, () => new Message { - Icon = KnownMonikers.StatusInformation, + Icon = KnownMonikers.StatusWarning, Text = new TextSpan[] { new TextSpan { Bold = true, Text = "Qt Visual Studio Tools" }, @@ -66,14 +66,14 @@ namespace QtVsTools public static IMessage NotifyInstall => StaticLazy.Get(() => NotifyInstall, () => new Message { - Icon = KnownMonikers.StatusWarning, + Icon = KnownMonikers.StatusInformation, Text = new TextSpan[] { new TextSpan { Bold = true, Text = "Qt Visual Studio Tools" }, new TextSpacer(2), "\u2014", // Em dash new TextSpacer(2), - $"Version {Version.USER_VERSION} was installed." + $"Version {Version.USER_VERSION} was recently installed." }, Hyperlinks = new Hyperlink[] { @@ -81,10 +81,21 @@ namespace QtVsTools { Text = "Release Notes", CloseInfoBar = false, - OnClicked= () => { + OnClicked= () => + { VsShellUtilities.OpenSystemBrowser( "https://code.qt.io/cgit/qt-labs/vstools.git/tree/Changelog"); } + }, + new Hyperlink + { + Text = "Don't show again", + CloseInfoBar = true, + OnClicked = () => + { + QtVsToolsPackage.Instance.Options.NotifyInstalled = false; + QtVsToolsPackage.Instance.Options.SaveSettingsToStorage(); + } } } } diff --git a/QtVsTools.Package/QtVsToolsPackage.cs b/QtVsTools.Package/QtVsToolsPackage.cs index 150f53d8..b3801d71 100644 --- a/QtVsTools.Package/QtVsToolsPackage.cs +++ b/QtVsTools.Package/QtVsToolsPackage.cs @@ -339,9 +339,8 @@ namespace QtVsTools { if (QtVersionManager.The().GetVersions()?.Length == 0) InfoBarMessages.NoQtVersion.Show(); - if (TestVersionInstalled()) { + if (Options.NotifyInstalled && TestVersionInstalled()) InfoBarMessages.NotifyInstall.Show(); - } } protected override int QueryClose(out bool canClose) |