mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-04 02:06:36 +02:00
Removed UI related to python path and the bindings related to that
This commit is contained in:
@@ -14,8 +14,6 @@ namespace Wox.Core.Plugin
|
||||
public static class PluginsLoader
|
||||
{
|
||||
public const string PATH = "PATH";
|
||||
public const string Python = "python";
|
||||
public const string PythonExecutable = "pythonw.exe";
|
||||
|
||||
public static List<PluginPair> Plugins(List<PluginMetadata> metadatas, PluginsSettings settings)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,6 @@ namespace Wox.Infrastructure.UserSettings
|
||||
{
|
||||
public class PluginsSettings : BaseModel
|
||||
{
|
||||
public string PythonDirectory { get; set; }
|
||||
public Dictionary<string, Plugin> Plugins { get; set; } = new Dictionary<string, Plugin>();
|
||||
|
||||
public void UpdatePluginSettings(List<PluginMetadata> metadatas)
|
||||
|
||||
@@ -81,12 +81,6 @@
|
||||
<ComboBox Margin="10 0 0 0" Width="45" ItemsSource="{Binding MaxResultsRange}"
|
||||
SelectedItem="{Binding Settings.MaxResultsToShow}" />
|
||||
</StackPanel>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<TextBlock Margin="10" Text="{DynamicResource pythonDirectory}" />
|
||||
<TextBox Width="300" Margin="10" Text="{Binding Settings.PluginSettings.PythonDirectory}" />
|
||||
<Button Margin="10" Click="OnSelectPythonDirectoryClick"
|
||||
Content="{DynamicResource selectPythonDirectory}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</TabItem>
|
||||
<TabItem Header="{DynamicResource plugin}">
|
||||
|
||||
@@ -87,34 +87,6 @@ namespace Wox
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectPythonDirectoryClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new System.Windows.Forms.FolderBrowserDialog
|
||||
{
|
||||
SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles)
|
||||
};
|
||||
|
||||
var result = dlg.ShowDialog();
|
||||
if (result == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
string pythonDirectory = dlg.SelectedPath;
|
||||
if (!string.IsNullOrEmpty(pythonDirectory))
|
||||
{
|
||||
var pythonPath = Path.Combine(pythonDirectory, PluginsLoader.PythonExecutable);
|
||||
if (File.Exists(pythonPath))
|
||||
{
|
||||
_settings.PluginSettings.PythonDirectory = pythonDirectory;
|
||||
MessageBox.Show("Remember to restart Wox use new Python path");
|
||||
}
|
||||
else
|
||||
{
|
||||
MessageBox.Show("Can't find python in given directory");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Hotkey
|
||||
|
||||
Reference in New Issue
Block a user