From 10204a4526c4026954eaecf5c580151392a51a01 Mon Sep 17 00:00:00 2001 From: Coenraad Stijne Date: Sat, 19 Jul 2014 14:31:19 +0200 Subject: [PATCH] Save icons using GUID filename --- Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs | 6 +++--- Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs | 4 +++- Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs index e2af713e16..ba3bf828bb 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanel.cs @@ -51,9 +51,9 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel foreach (ControlPanelItem item in controlPanelItems) { - if (!File.Exists(iconFolder + item.LocalizedString + fileType) && item.Icon != null) + if (!File.Exists(iconFolder + item.GUID + fileType) && item.Icon != null) { - item.Icon.ToBitmap().Save(iconFolder + item.LocalizedString + fileType); + item.Icon.ToBitmap().Save(iconFolder + item.GUID + fileType); } } } @@ -75,7 +75,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel Title = item.LocalizedString, SubTitle = item.InfoTip, Score = item.Score, - IcoPath = "Images\\ControlPanelIcons\\" + item.LocalizedString + fileType, + IcoPath = "Images\\ControlPanelIcons\\" + item.GUID + fileType, Action = e => { try diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs index faceb6481d..6d76e269a0 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelItem.cs @@ -8,16 +8,18 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel { public string LocalizedString { get; private set; } public string InfoTip { get; private set; } + public string GUID { get; private set; } public ProcessStartInfo ExecutablePath { get; private set; } public Icon Icon { get; private set; } public int Score { get; set; } - public ControlPanelItem(string newLocalizedString, string newInfoTip, ProcessStartInfo newExecutablePath, Icon newIcon) + public ControlPanelItem(string newLocalizedString, string newInfoTip, string newGUID, ProcessStartInfo newExecutablePath, Icon newIcon) { LocalizedString = newLocalizedString; InfoTip = newInfoTip; ExecutablePath = newExecutablePath; Icon = newIcon; + GUID = newGUID; } } } diff --git a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs index f60d1b587f..11f824add7 100644 --- a/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs +++ b/Wox.Plugin.SystemPlugins/ControlPanel/ControlPanelList.cs @@ -78,7 +78,7 @@ namespace Wox.Plugin.SystemPlugins.ControlPanel myIcon = getIcon(currentKey, size); - controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, executablePath, myIcon)); + controlPanelItems.Add(new ControlPanelItem(localizedString, infoTip, key, executablePath, myIcon)); } }