mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 03:36:44 +02:00
Add some workarounds for clean environment.
This commit is contained in:
@@ -9,20 +9,21 @@ namespace WinAlfred.Helper
|
||||
public class Settings
|
||||
{
|
||||
private string configPath = Directory.GetCurrentDirectory() + "\\config.ini";
|
||||
private static readonly Settings settings = new Settings();
|
||||
IniParser parser = new IniParser("config.ini");
|
||||
private static readonly Settings settings = new Settings();
|
||||
IniParser parser;
|
||||
|
||||
public string Theme { get; set; }
|
||||
public bool ReplaceWinR { get; set; }
|
||||
|
||||
private Settings()
|
||||
{
|
||||
{
|
||||
if (!File.Exists(configPath)) File.Create(configPath);
|
||||
parser = new IniParser(configPath);
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
private void LoadSettings()
|
||||
{
|
||||
if (!File.Exists(configPath)) File.Create(configPath);
|
||||
Theme = parser.GetSetting("ui", "theme");
|
||||
|
||||
string replaceWinRStr = parser.GetSetting("hotkey", "replaceWinR");
|
||||
|
||||
@@ -39,11 +39,17 @@ namespace WinAlfred
|
||||
hook.RegisterHotKey(XModifierKeys.Alt, Keys.Space);
|
||||
resultCtrl.resultItemChangedEvent += resultCtrl_resultItemChangedEvent;
|
||||
ThreadPool.SetMaxThreads(30, 10);
|
||||
InitProgressbarAnimation();
|
||||
|
||||
|
||||
ChangeStyles(Settings.Instance.Theme);
|
||||
InitProgressbarAnimation();
|
||||
|
||||
try
|
||||
{
|
||||
ChangeStyles(Settings.Instance.Theme);
|
||||
|
||||
}
|
||||
catch (System.IO.IOException)
|
||||
{
|
||||
ChangeStyles(Settings.Instance.Theme = "Default");
|
||||
}
|
||||
}
|
||||
|
||||
private void WakeupApp()
|
||||
|
||||
@@ -41,7 +41,10 @@ namespace WinAlfred.PluginLoader
|
||||
}
|
||||
|
||||
private static void ParseThirdPartyPlugins()
|
||||
{
|
||||
{
|
||||
if (!Directory.Exists(PluginPath))
|
||||
Directory.CreateDirectory(PluginPath);
|
||||
|
||||
string[] directories = Directory.GetDirectories(PluginPath);
|
||||
foreach (string directory in directories)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user