mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
Add ProgramSources settings (code only, without GUI) #42
This commit is contained in:
@@ -63,6 +63,7 @@ namespace Wox.Infrastructure
|
||||
Instance.UserSetting.Theme = "Dark";
|
||||
Instance.UserSetting.ReplaceWinR = true;
|
||||
Instance.UserSetting.WebSearches = Instance.UserSetting.LoadDefaultWebSearches();
|
||||
Instance.UserSetting.ProgramSources = Instance.UserSetting.LoadDefaultProgramSources();
|
||||
Instance.UserSetting.Hotkey = "Win + W";
|
||||
}
|
||||
|
||||
|
||||
18
Wox.Infrastructure/UserSettings/ProgramSource.cs
Normal file
18
Wox.Infrastructure/UserSettings/ProgramSource.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Wox.Infrastructure.UserSettings
|
||||
{
|
||||
[Serializable]
|
||||
public class ProgramSource
|
||||
{
|
||||
public string Location { get; set; }
|
||||
public string Assembly { get; set; }
|
||||
public string Type { get; set; }
|
||||
public int BounsPoints { get; set; }
|
||||
public bool Enabled { get; set; }
|
||||
public Dictionary<string, string> Meta { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ namespace Wox.Infrastructure.UserSettings
|
||||
public string Theme { get; set; }
|
||||
public bool ReplaceWinR { get; set; }
|
||||
public List<WebSearch> WebSearches { get; set; }
|
||||
public List<ProgramSource> ProgramSources { get; set; }
|
||||
public List<CustomPluginHotkey> CustomPluginHotkeys { get; set; }
|
||||
public bool StartWoxOnSystemStartup { get; set; }
|
||||
|
||||
@@ -39,5 +40,29 @@ namespace Wox.Infrastructure.UserSettings
|
||||
|
||||
return webSearches;
|
||||
}
|
||||
|
||||
public List<ProgramSource> LoadDefaultProgramSources()
|
||||
{
|
||||
var list = new List<ProgramSource>();
|
||||
list.Add(new ProgramSource()
|
||||
{
|
||||
BounsPoints = 0,
|
||||
Enabled = true,
|
||||
Type = "CommonStartMenuProgramSource"
|
||||
});
|
||||
list.Add(new ProgramSource()
|
||||
{
|
||||
BounsPoints = 0,
|
||||
Enabled = true,
|
||||
Type = "UserStartMenuProgramSource"
|
||||
});
|
||||
list.Add(new ProgramSource()
|
||||
{
|
||||
BounsPoints = -10,
|
||||
Enabled = true,
|
||||
Type = "AppPathsProgramSource"
|
||||
});
|
||||
return list;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<Compile Include="IniParser.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="UserSettings\PluginHotkey.cs" />
|
||||
<Compile Include="UserSettings\ProgramSource.cs" />
|
||||
<Compile Include="UserSettings\UserSelectedRecords.cs" />
|
||||
<Compile Include="UserSettings\UserSetting.cs" />
|
||||
<Compile Include="UserSettings\WebSearch.cs" />
|
||||
|
||||
Reference in New Issue
Block a user