Fix numerous web search plugin bugs
This commit is contained in:
bao-qian
2016-04-26 02:40:23 +01:00
parent fc2d7b41d8
commit 57c33fe693
11 changed files with 132 additions and 103 deletions

View File

@@ -21,7 +21,6 @@ namespace Wox
{
private const string Unique = "Wox_Unique_Application_Mutex";
public static MainWindow Window { get; private set; }
public static ImageLoader ImageLoader;
public static PublicAPIInstance API { get; private set; }
[STAThread]
@@ -44,7 +43,6 @@ namespace Wox
WoxDirectroy.Executable = Directory.GetParent(Assembly.GetExecutingAssembly().Location).ToString();
RegisterUnhandledException();
ImageLoader = new ImageLoader();
Task.Factory.StartNew(ImageLoader.PreloadImages);
PluginManager.Initialize();

View File

@@ -2,6 +2,7 @@ using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
using Wox.Infrastructure.Image;
namespace Wox.Converters
{
@@ -13,7 +14,7 @@ namespace Wox.Converters
{
return null;
}
var image = App.ImageLoader.Load(value.ToString());
var image = ImageLoader.Load(value.ToString());
return image;
}

View File

@@ -7,6 +7,7 @@ using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using Wox.Helper;
using Wox.Infrastructure;
using Wox.Infrastructure.Image;
namespace Wox
{
@@ -37,7 +38,7 @@ namespace Wox
Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath(TopProperty));
fadeOutStoryboard.Children.Add(fadeOutAnimation);
imgClose.Source = App.ImageLoader.Load(Path.Combine(WoxDirectroy.Executable, "Images\\close.png"));
imgClose.Source = ImageLoader.Load(Path.Combine(WoxDirectroy.Executable, "Images\\close.png"));
imgClose.MouseUp += imgClose_MouseUp;
}
@@ -65,10 +66,10 @@ namespace Wox
}
if (!File.Exists(iconPath))
{
imgIco.Source = App.ImageLoader.Load(Path.Combine(WoxDirectroy.Executable, "Images\\app.png"));
imgIco.Source = ImageLoader.Load(Path.Combine(WoxDirectroy.Executable, "Images\\app.png"));
}
else {
imgIco.Source = App.ImageLoader.Load(iconPath);
imgIco.Source = ImageLoader.Load(iconPath);
}
Show();

View File

@@ -19,6 +19,7 @@ using Wox.Core.Updater;
using Wox.Core.UserSettings;
using Wox.Helper;
using Wox.Infrastructure.Hotkey;
using Wox.Infrastructure.Image;
using Wox.Plugin;
using Wox.ViewModel;
using Application = System.Windows.Forms.Application;
@@ -550,7 +551,7 @@ namespace Wox
pluginAuthor.Text = InternationalizationManager.Instance.GetTranslation("author") + ": " + pair.Metadata.Author;
pluginSubTitle.Text = pair.Metadata.Description;
pluginId = pair.Metadata.ID;
pluginIcon.Source = App.ImageLoader.Load(pair.Metadata.FullIcoPath);
pluginIcon.Source = ImageLoader.Load(pair.Metadata.FullIcoPath);
var customizedPluginConfig = _settings.PluginSettings[pluginId];
cbDisablePlugin.IsChecked = customizedPluginConfig != null && customizedPluginConfig.Disabled;