From fda4d9f0a99b55960f6cfb19bf51171d7f3196f8 Mon Sep 17 00:00:00 2001 From: Anton Kasyanov Date: Thu, 29 Mar 2018 01:34:49 +0300 Subject: [PATCH] Some EVE clients should not be minimized even if the 'Minimize inactive clients' option is enabled --- .../Implementation/ThumbnailConfiguration.cs | 8 ++++++++ .../Configuration/Interface/IThumbnailConfiguration.cs | 2 ++ Eve-O-Preview/Services/Implementation/ThumbnailManager.cs | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs b/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs index 2d65319..b22c926 100644 --- a/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs +++ b/Eve-O-Preview/Configuration/Implementation/ThumbnailConfiguration.cs @@ -19,6 +19,7 @@ namespace EveOPreview.Configuration.Omplementation this.ClientLayout = new Dictionary(); this.ClientHotkey = new Dictionary(); this.DisableThumbnail = new Dictionary(); + this.PriorityClients = new List(); this.MinimizeToTray = false; this.ThumbnailRefreshPeriod = 500; @@ -119,6 +120,8 @@ namespace EveOPreview.Configuration.Omplementation private Dictionary ClientHotkey { get; set; } [JsonProperty] private Dictionary DisableThumbnail { get; set; } + [JsonProperty] + private List PriorityClients { get; set; } public Point GetDefaultThumbnailLocation() { @@ -208,6 +211,11 @@ namespace EveOPreview.Configuration.Omplementation this.ClientHotkey[currentClient] = (new KeysConverter()).ConvertToInvariantString(hotkey); } + public bool IsPriorityClient(string currentClient) + { + return this.PriorityClients.Contains(currentClient); + } + public bool IsThumbnailDisabled(string currentClient) { return this.DisableThumbnail.TryGetValue(currentClient, out bool isDisabled) && isDisabled; diff --git a/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs b/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs index d182f78..565e395 100644 --- a/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs +++ b/Eve-O-Preview/Configuration/Interface/IThumbnailConfiguration.cs @@ -44,6 +44,8 @@ namespace EveOPreview.Configuration Keys GetClientHotkey(string currentClient); void SetClientHotkey(string currentClient, Keys hotkey); + bool IsPriorityClient(string currentClient); + bool IsThumbnailDisabled(string currentClient); void ToggleThumbnail(string currentClient, bool isDisabled); diff --git a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs index 15b9de1..1fe7862 100644 --- a/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs +++ b/Eve-O-Preview/Services/Implementation/ThumbnailManager.cs @@ -334,7 +334,7 @@ namespace EveOPreview.Services } // Minimize the currently active client if needed - if (this._configuration.MinimizeInactiveClients) + if (this._configuration.MinimizeInactiveClients && !this._configuration.IsPriorityClient(this._activeClient.Title)) { this._windowManager.MinimizeWindow(this._activeClient.Handle, false); }