mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-03 03:19:08 +08:00
Fix added websearch twice issue.
This commit is contained in:
parent
1a5bc2ddfe
commit
d8536c20b0
@ -36,6 +36,8 @@ namespace Wox.Infrastructure.Storage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected virtual void LoadDefaultConfig() { }
|
||||||
|
|
||||||
private void Load()
|
private void Load()
|
||||||
{
|
{
|
||||||
string configPath = Path.Combine(configFolder, ConfigName + fileSuffix);
|
string configPath = Path.Combine(configFolder, ConfigName + fileSuffix);
|
||||||
@ -55,8 +57,13 @@ namespace Wox.Infrastructure.Storage
|
|||||||
catch (Exception)
|
catch (Exception)
|
||||||
{
|
{
|
||||||
//no-op
|
//no-op
|
||||||
|
LoadDefaultConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LoadDefaultConfig();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Save()
|
public void Save()
|
||||||
|
@ -39,18 +39,6 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
|||||||
[JsonProperty]
|
[JsonProperty]
|
||||||
public bool EnablePythonPlugins { get; set; }
|
public bool EnablePythonPlugins { get; set; }
|
||||||
|
|
||||||
public UserSettingStorage()
|
|
||||||
{
|
|
||||||
EnablePythonPlugins = true;
|
|
||||||
Theme = "Dark";
|
|
||||||
ReplaceWinR = true;
|
|
||||||
WebSearches = LoadDefaultWebSearches();
|
|
||||||
ProgramSources = LoadDefaultProgramSources();
|
|
||||||
Hotkey = "Alt + Space";
|
|
||||||
QueryBoxFont = FontFamily.GenericSansSerif.Name;
|
|
||||||
ResultItemFont = FontFamily.GenericSansSerif.Name;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<WebSearch> LoadDefaultWebSearches()
|
public List<WebSearch> LoadDefaultWebSearches()
|
||||||
{
|
{
|
||||||
List<WebSearch> webSearches = new List<WebSearch>();
|
List<WebSearch> webSearches = new List<WebSearch>();
|
||||||
@ -107,5 +95,17 @@ namespace Wox.Infrastructure.Storage.UserSettings
|
|||||||
{
|
{
|
||||||
get { return "config"; }
|
get { return "config"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void LoadDefaultConfig()
|
||||||
|
{
|
||||||
|
EnablePythonPlugins = true;
|
||||||
|
Theme = "Dark";
|
||||||
|
ReplaceWinR = true;
|
||||||
|
WebSearches = LoadDefaultWebSearches();
|
||||||
|
ProgramSources = LoadDefaultProgramSources();
|
||||||
|
Hotkey = "Alt + Space";
|
||||||
|
QueryBoxFont = FontFamily.GenericSansSerif.Name;
|
||||||
|
ResultItemFont = FontFamily.GenericSansSerif.Name;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -93,8 +93,6 @@ namespace Wox
|
|||||||
//DwmDropShadow.DropShadowToWindow(this);
|
//DwmDropShadow.DropShadowToWindow(this);
|
||||||
|
|
||||||
WindowIntelopHelper.DisableControlBox(this);
|
WindowIntelopHelper.DisableControlBox(this);
|
||||||
|
|
||||||
throw new Exception();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||||
|
Loading…
Reference in New Issue
Block a user