Skip to content

Commit

Permalink
Improve exception handling on launch
Browse files Browse the repository at this point in the history
  • Loading branch information
srwi committed Nov 20, 2020
1 parent da5b214 commit 4ecab82
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion EverythingToolbar/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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.0")]
[assembly: AssemblyVersion("0.5.2")]
[assembly: AssemblyFileVersion("1.0.0.0")]
30 changes: 18 additions & 12 deletions EverythingToolbar/ToolbarControl.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@ public partial class ToolbarControl : UserControl
public ToolbarControl()
{
InitializeComponent();
LoadThemes();
LoadItemTemplates();
ApplyItemTemplate(Properties.Settings.Default.itemTemplate);
ApplyTheme(Properties.Settings.Default.theme);

// Fixes #3
if (Properties.Settings.Default.sortBy < 1)

try
{
Properties.Settings.Default.sortBy = 1;
Properties.Settings.Default.Save();
LoadThemes();
LoadItemTemplates();
ApplyItemTemplate(Properties.Settings.Default.itemTemplate);
ApplyTheme(Properties.Settings.Default.theme);
}
catch (Exception e)
{
ToolbarLogger.GetLogger("EverythingToolbar").Error(e, "Failed to load resources.");
}

(SortByMenu.Items[Properties.Settings.Default.sortBy - 1] as MenuItem).IsChecked = true;
Expand All @@ -41,9 +42,14 @@ public ToolbarControl()
searchResultsPopup.searchResultsView.FilterChanged += OnFilterChanged;
searchResultsPopup.Closed += SearchResultsPopup_Closed;

#if !DEBUG
HotkeyManager.Current.AddOrReplace("FocusSearchBox", Key.S, ModifierKeys.Windows | ModifierKeys.Alt, FocusSearchBox);
#endif
try
{
HotkeyManager.Current.AddOrReplace("FocusSearchBox", Key.S, ModifierKeys.Windows | ModifierKeys.Alt, FocusSearchBox);
}
catch (Exception e)
{
ToolbarLogger.GetLogger("EverythingToolbar").Error(e, "Hotkey could not be registered.");
}
}

public static void SetTaskbarEdge(Edge edge)
Expand Down

0 comments on commit 4ecab82

Please sign in to comment.