Migrate Program Plugin Custom Explorer

This commit is contained in:
Kevin Zhang 2021-11-06 01:10:29 -05:00
parent 6e83e2e78f
commit 84ebbd99ae
4 changed files with 3 additions and 33 deletions

View file

@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.Program
private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today;
private static PluginInitContext _context;
internal static PluginInitContext Context { get; private set; }
private static BinaryStorage<Win32[]> _win32Storage;
private static BinaryStorage<UWP.Application[]> _uwpStorage;

View file

@ -362,14 +362,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
Action = _ =>
{
Main.StartProcess(Process.Start,
new ProcessStartInfo(
!string.IsNullOrEmpty(Main._settings.CustomizedExplorer)
? Main._settings.CustomizedExplorer
: Settings.Explorer,
Main._settings.CustomizedArgs
.Replace("%s",$"\"{Package.Location}\"")
.Trim()));
Main.Context.API.OpenDirectory(Package.Location);
return true;
},

View file

@ -177,20 +177,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
Action = _ =>
{
var args = !string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)
? Main._settings.CustomizedArgs
.Replace("%s", $"\"{ParentDirectory}\"")
.Replace("%f", $"\"{FullPath}\"")
: Main._settings.CustomizedExplorer == Settings.Explorer
? $"/select,\"{FullPath}\""
: Settings.ExplorerArgs;
Main.StartProcess(Process.Start,
new ProcessStartInfo(
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer)
? Main._settings.CustomizedExplorer
: Settings.Explorer,
args));
Main.Context.API.OpenDirectory(ParentDirectory, FullPath);
return true;
},

View file

@ -12,7 +12,6 @@
<RowDefinition Height="120"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
<StackPanel Orientation="Vertical" Width="Auto">
@ -77,15 +76,6 @@
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10 10 0 10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
</StackPanel>
</DockPanel>
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Stretch">
<TextBlock Text="{DynamicResource flowlauncher_plugin_program_customizedexplorer}" VerticalAlignment="Center" FontSize="15"
ToolTip= "{DynamicResource flowlauncher_plugin_program_tooltip_customizedexplorer}"/>
<TextBox Margin="10,0,10,0" TextWrapping="NoWrap" VerticalAlignment="Center" Width="200" Height="30" FontSize="15"
Text="{Binding CustomizedExplorerPath}" x:Name="CustomizeExplorerBox"/>
<TextBlock Text="{DynamicResource flowlauncher_plugin_program_args}" VerticalAlignment="Center" FontSize="15"
ToolTip="{DynamicResource flowlauncher_plugin_program_tooltip_args}" />
<TextBox Margin="10,0,0,0" Width="135" Height="30" FontSize="15" x:Name="CustomizeArgsBox" Text="{Binding CustomizedExplorerArg}"></TextBox>
</StackPanel>
</Grid>
</UserControl>