Save icons using GUID filename

This commit is contained in:
Coenraad Stijne 2014-07-19 14:31:19 +02:00
parent a5d63bc383
commit 10204a4526
3 changed files with 7 additions and 5 deletions

View File

@ -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

View File

@ -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;
}
}
}

View File

@ -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));
}
}