diff --git a/EverythingToolbar/Helpers/ApplicationResources.cs b/EverythingToolbar/Helpers/ApplicationResources.cs index 867bff5b2..628fe1f4f 100644 --- a/EverythingToolbar/Helpers/ApplicationResources.cs +++ b/EverythingToolbar/Helpers/ApplicationResources.cs @@ -34,6 +34,12 @@ public void AddResource(ResourceDictionary resource) public void AddResource(string path) { + if (!File.Exists(path)) + { + ToolbarLogger.GetLogger("EverythingToolbar").Error("Could not find resource file " + path); + return; + } + ResourceChanged?.Invoke(this, new ResourcesChangedEventArgs() { NewResource = new ResourceDictionary() { Source = new Uri(path) } @@ -44,13 +50,6 @@ public void ApplyTheme(string themeName) { string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string themePath = Path.Combine(assemblyFolder, "Themes", themeName + ".xaml"); - - if (!File.Exists(themePath)) - { - ToolbarLogger.GetLogger("EverythingToolbar").Error("Theme file not found. Defaulting to 'Medium' theme."); - themePath = Path.Combine(assemblyFolder, "Themes", "Medium.xaml"); - } - AddResource(themePath); } @@ -58,13 +57,6 @@ public void ApplyItemTemplate(string templateName) { string assemblyFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); string templatePath = Path.Combine(assemblyFolder, "ItemTemplates", templateName + ".xaml"); - - if (!File.Exists(templatePath)) - { - ToolbarLogger.GetLogger("EverythingToolbar").Error("Item template file not found. Defaulting to 'Normal' template."); - templatePath = Path.Combine(assemblyFolder, "ItemTemplates", "Normal.xaml"); - } - AddResource(templatePath); } } diff --git a/EverythingToolbar/Properties/AssemblyInfo.cs b/EverythingToolbar/Properties/AssemblyInfo.cs index 6526479ce..05f814b0e 100644 --- a/EverythingToolbar/Properties/AssemblyInfo.cs +++ b/EverythingToolbar/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.5.2")] +[assembly: AssemblyVersion("0.6.0")] [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/EverythingToolbar/Properties/Settings.Designer.cs b/EverythingToolbar/Properties/Settings.Designer.cs index 553868ee8..71c536383 100644 --- a/EverythingToolbar/Properties/Settings.Designer.cs +++ b/EverythingToolbar/Properties/Settings.Designer.cs @@ -109,7 +109,7 @@ public string everythingPath { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] + [global::System.Configuration.DefaultSettingValueAttribute("Medium")] public string theme { get { return ((string)(this["theme"])); @@ -121,7 +121,7 @@ public string theme { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("")] + [global::System.Configuration.DefaultSettingValueAttribute("Normal")] public string itemTemplate { get { return ((string)(this["itemTemplate"])); diff --git a/EverythingToolbar/Properties/Settings.settings b/EverythingToolbar/Properties/Settings.settings index 85bee963e..d6bb8dcd8 100644 --- a/EverythingToolbar/Properties/Settings.settings +++ b/EverythingToolbar/Properties/Settings.settings @@ -24,10 +24,10 @@ C:\\Program Files\\Everything\\Everything.exe - + Medium - + Normal False diff --git a/EverythingToolbar/Rules.xaml.cs b/EverythingToolbar/Rules.xaml.cs index 902028807..290080186 100644 --- a/EverythingToolbar/Rules.xaml.cs +++ b/EverythingToolbar/Rules.xaml.cs @@ -155,6 +155,9 @@ private void CheckBox_Click(object sender, RoutedEventArgs e) public static bool HandleRule(SearchResult searchResult, string command="") { + if (searchResult == null) + return false; + if (Properties.Settings.Default.isAutoApplyRules && string.IsNullOrEmpty(command)) { foreach (Rule r in LoadRules()) diff --git a/EverythingToolbar/ToolbarControl.xaml.cs b/EverythingToolbar/ToolbarControl.xaml.cs index e07983cff..1f7568f81 100644 --- a/EverythingToolbar/ToolbarControl.xaml.cs +++ b/EverythingToolbar/ToolbarControl.xaml.cs @@ -24,7 +24,7 @@ public ToolbarControl() } catch (Exception ex) { - ToolbarLogger.GetLogger("EverythingToolbar").Error(ex, "Failed to apply resources."); + ToolbarLogger.GetLogger("EverythingToolbar").Error(ex, "Failed to apply resource."); } }; ApplicationResources.Instance.LoadDefaults(); diff --git a/EverythingToolbar/app.config b/EverythingToolbar/app.config index a3c5858ea..4ab2f9915 100644 --- a/EverythingToolbar/app.config +++ b/EverythingToolbar/app.config @@ -29,10 +29,10 @@ C:\\Program Files\\Everything\\Everything.exe - + Medium - + Normal False