mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add Node.js file path browser to Settings window
This commit is contained in:
parent
9e55fc5854
commit
9b4a592635
2 changed files with 40 additions and 2 deletions
|
|
@ -921,6 +921,25 @@
|
|||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource nodeFilePath}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBox
|
||||
Width="300"
|
||||
Height="34"
|
||||
Text="{Binding Settings.PluginSettings.NodeFilePath, TargetNullValue='No Setting'}" />
|
||||
<Button
|
||||
Height="34"
|
||||
Margin="10,10,18,10"
|
||||
Click="OnSelectNodeFilePathClick"
|
||||
Content="{DynamicResource select}" />
|
||||
</StackPanel>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Droplex;
|
||||
using Droplex;
|
||||
using Flow.Launcher.Core.ExternalPlugins;
|
||||
using Flow.Launcher.Core.Plugin;
|
||||
using Flow.Launcher.Core.Resource;
|
||||
|
|
@ -30,6 +30,7 @@ using KeyEventArgs = System.Windows.Input.KeyEventArgs;
|
|||
using MessageBox = System.Windows.MessageBox;
|
||||
using TextBox = System.Windows.Controls.TextBox;
|
||||
using ThemeManager = ModernWpf.ThemeManager;
|
||||
using OpenFileDialog = System.Windows.Forms.OpenFileDialog;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -86,7 +87,6 @@ namespace Flow.Launcher
|
|||
if (File.Exists(pythonPath))
|
||||
{
|
||||
settings.PluginSettings.PythonDirectory = pythonDirectory;
|
||||
MessageBox.Show("Remember to restart Flow Launcher use new Python path");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -96,6 +96,25 @@ namespace Flow.Launcher
|
|||
}
|
||||
}
|
||||
|
||||
private void OnSelectNodeFilePathClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dlg = new OpenFileDialog
|
||||
{
|
||||
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles),
|
||||
Multiselect = false,
|
||||
CheckFileExists = true,
|
||||
CheckPathExists = true,
|
||||
Title = $"Please select the Node.js executable"
|
||||
};
|
||||
|
||||
var result = dlg.ShowDialog();
|
||||
if (result == System.Windows.Forms.DialogResult.OK)
|
||||
{
|
||||
Constant.NodePath = dlg.FileName;
|
||||
settings.PluginSettings.NodeFilePath = Constant.NodePath;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectFileManagerClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(settings);
|
||||
|
|
|
|||
Loading…
Reference in a new issue