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