Add Exploere Customize to Program Plugin

This commit is contained in:
弘韬 张 2020-11-04 07:42:35 +08:00
parent c254c93255
commit 465146d36f
5 changed files with 24 additions and 8 deletions

View file

@ -324,7 +324,9 @@ namespace Flow.Launcher.Plugin.Program.Programs
Action = _ =>
{
Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location));
Main.StartProcess(Process.Start, new ProcessStartInfo(
!string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere"
, Package.Location));
return true;
},

View file

@ -140,10 +140,9 @@ namespace Flow.Launcher.Plugin.Program.Programs
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
Action = _ =>
{
Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", ParentDirectory));
Main.StartProcess(Process.Start, new ProcessStartInfo(
!string.IsNullOrEmpty(Main._settings.CustomizedExploere)?Main._settings.CustomizedExploere:"exploere"
, ParentDirectory));
return true;
},
IcoPath = "Images/folder.png"

View file

@ -14,6 +14,7 @@ namespace Flow.Launcher.Plugin.Program
public bool EnableStartMenuSource { get; set; } = true;
public bool EnableRegistrySource { get; set; } = true;
public string CustomizedExploere { get; set; } = "exploere";
internal const char SuffixSeperator = ';';

View file

@ -5,12 +5,13 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="600">
d:DesignHeight="404.508" d:DesignWidth="600">
<Grid Margin="10">
<Grid.RowDefinitions>
<RowDefinition Height="75"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
<StackPanel Orientation="Vertical" Width="205">
@ -24,7 +25,7 @@
</StackPanel>
</StackPanel>
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
Margin="0 13 0 0"
Margin="0,13,0,10"
BorderBrush="DarkGray"
BorderThickness="1"
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
@ -63,7 +64,7 @@
</GridView>
</ListView.View>
</ListView>
<DockPanel Grid.Row="2">
<DockPanel Grid.Row="2" Margin="0,0,0,0" Grid.RowSpan="1">
<StackPanel x:Name="indexingPanel" Visibility="Hidden" HorizontalAlignment="Left" Orientation="Horizontal">
<ProgressBar x:Name="progressBarIndexing" Height="20" Width="80" Minimum="0" Maximum="100" IsIndeterminate="True" />
<TextBlock Margin="10 0 0 0" Height="20" HorizontalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
@ -74,6 +75,12 @@
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
</StackPanel>
</DockPanel>
<TextBlock Text="Customized Explorer" HorizontalAlignment="Left" Margin="20,0,0,0" Grid.Row="3" VerticalAlignment="Center" FontSize="15"
ToolTip="You can customized the exploere for opening the container folder
by inputing the Environmental Variable of the exploere you want to use.
It will be useful to use CMD to test whether the Environmental Variable is avaliable."/>
<TextBox HorizontalAlignment="Right" Margin="0,0,30,0" Grid.Row="3" Text="" TextWrapping="NoWrap" VerticalAlignment="Center" Width="250" Height="30" FontSize="15"
TextChanged="CustomizeExplorer" x:Name="CustomizeExplorerBox"/>
</Grid>
</UserControl>

View file

@ -43,6 +43,8 @@ namespace Flow.Launcher.Plugin.Program.Views
StartMenuEnabled.IsChecked = _settings.EnableStartMenuSource;
RegistryEnabled.IsChecked = _settings.EnableRegistrySource;
CustomizeExplorerBox.Text = _settings.CustomizedExploere;
ViewRefresh();
}
@ -326,5 +328,10 @@ namespace Flow.Launcher.Plugin.Program.Views
btnProgramSourceStatus.Content = "Enable";
}
}
private void CustomizeExplorer(object sender, TextChangedEventArgs e)
{
_settings.CustomizedExploere = CustomizeExplorerBox.Text;
}
}
}