mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Migrate Program Plugin Custom Explorer
This commit is contained in:
parent
6e83e2e78f
commit
84ebbd99ae
4 changed files with 3 additions and 33 deletions
|
|
@ -26,7 +26,7 @@ namespace Flow.Launcher.Plugin.Program
|
||||||
|
|
||||||
private static bool IsStartupIndexProgramsRequired => _settings.LastIndexTime.AddDays(3) < DateTime.Today;
|
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<Win32[]> _win32Storage;
|
||||||
private static BinaryStorage<UWP.Application[]> _uwpStorage;
|
private static BinaryStorage<UWP.Application[]> _uwpStorage;
|
||||||
|
|
|
||||||
|
|
@ -362,14 +362,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
||||||
|
|
||||||
Action = _ =>
|
Action = _ =>
|
||||||
{
|
{
|
||||||
Main.StartProcess(Process.Start,
|
Main.Context.API.OpenDirectory(Package.Location);
|
||||||
new ProcessStartInfo(
|
|
||||||
!string.IsNullOrEmpty(Main._settings.CustomizedExplorer)
|
|
||||||
? Main._settings.CustomizedExplorer
|
|
||||||
: Settings.Explorer,
|
|
||||||
Main._settings.CustomizedArgs
|
|
||||||
.Replace("%s",$"\"{Package.Location}\"")
|
|
||||||
.Trim()));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -177,20 +177,7 @@ namespace Flow.Launcher.Plugin.Program.Programs
|
||||||
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
|
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
|
||||||
Action = _ =>
|
Action = _ =>
|
||||||
{
|
{
|
||||||
var args = !string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)
|
Main.Context.API.OpenDirectory(ParentDirectory, FullPath);
|
||||||
? 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));
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
<RowDefinition Height="120"/>
|
<RowDefinition Height="120"/>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition Height="50"/>
|
<RowDefinition Height="50"/>
|
||||||
<RowDefinition Height="50"/>
|
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
<StackPanel Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
|
||||||
<StackPanel Orientation="Vertical" Width="Auto">
|
<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}"/>
|
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10 10 0 10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DockPanel>
|
</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>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue