Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Everything
Submodule Flow.Launcher.Plugin.Everything added at 6d5b68
7 changes: 6 additions & 1 deletion Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,12 @@
<system:String x:Key="flowlauncher_plugin_program_plugin_description">Search programs in Flow Launcher</system:String>

<system:String x:Key="flowlauncher_plugin_program_invalid_path">Invalid Path</system:String>


<system:String x:Key="flowlauncher_plugin_program_customizedexplorer">Customized Explorer</system:String>
<system:String x:Key="flowlauncher_plugin_program_args">Args</system:String>
<system:String x:Key="flowlauncher_plugin_program_tooltip_customizedexplorer">You can customized the explorer used for opening the container folder by inputing the Environmental Variable of the explorer you want to use. It will be useful to use CMD to test whether the Environmental Variable is avaliable.</system:String>
<system:String x:Key="flowlauncher_plugin_program_tooltip_args">Enter the customized args you want to add for your customized explorer. %s for parent directory, %f for full path (which only works for win32). Check the explorer's website for details.</system:String>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry i am not too across how the %s and %f option can be used. Could you give me an example?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

%s is the parent directory and %f is the file path (.exe, .lnk, etc.) I get the idea from the everything plugin which can select the file while opening the parent directory. However, that seems may work not good for uwp.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh ok so this option allows for win32 programs to open both file and parent directory when using 'open containing folder' ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let me think how I can fix that. If I can't, I will remove that


<!--Dialogs-->
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success">Success</system:String>
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success_message">Successfully disabled this program from displaying in your query</system:String>
Expand Down
4 changes: 3 additions & 1 deletion Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,9 @@ public List<Result> ContextMenus(IPublicAPI api)

Action = _ =>
{
Main.StartProcess(Process.Start, new ProcessStartInfo(Package.Location));
Main.StartProcess(Process.Start, new ProcessStartInfo(
!string.IsNullOrEmpty(Main._settings.CustomizedExplorer) ? Main._settings.CustomizedExplorer:Settings.Explorer,
Main._settings.CustomizedArgs.Replace("%s",$"\"{Package.Location}\"").Trim()));

return true;
},
Expand Down
17 changes: 13 additions & 4 deletions Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,19 @@ public List<Result> ContextMenus(IPublicAPI api)
Title = api.GetTranslation("flowlauncher_plugin_program_open_containing_folder"),
Action = _ =>
{


Main.StartProcess(Process.Start, new ProcessStartInfo("explorer", ParentDirectory));

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));
return true;
},
IcoPath = "Images/folder.png"
Expand Down
6 changes: 6 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Program/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ public class Settings
public bool EnableStartMenuSource { get; set; } = true;

public bool EnableRegistrySource { get; set; } = true;
public string CustomizedExplorer { get; set; } = Explorer;
public string CustomizedArgs { get; set; } = ExplorerArgs;

internal const char SuffixSeperator = ';';

internal const string Explorer = "explorer";

internal const string ExplorerArgs = "%s";

/// <summary>
/// Contains user added folder location contents as well as all user disabled applications
/// </summary>
Expand Down
18 changes: 14 additions & 4 deletions Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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"
Expand Down Expand Up @@ -63,17 +64,26 @@
</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}" />
</StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button x:Name="btnProgramSourceStatus" Click="btnProgramSourceStatus_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_disable}" />
<Button x:Name="btnEditProgramSource" Click="btnEditProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_edit}"/>
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="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>
</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"
TextChanged="CustomizeExplorer" 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" TextChanged="CustomizeExplorerArgs"></TextBox>
</StackPanel>
</Grid>
</UserControl>

Expand Down
13 changes: 13 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ private void Setting_Loaded(object sender, RoutedEventArgs e)
StartMenuEnabled.IsChecked = _settings.EnableStartMenuSource;
RegistryEnabled.IsChecked = _settings.EnableRegistrySource;

CustomizeExplorerBox.Text = _settings.CustomizedExplorer;
CustomizeArgsBox.Text = _settings.CustomizedArgs;

ViewRefresh();
}

Expand Down Expand Up @@ -326,5 +329,15 @@ private void Row_OnClick(object sender, RoutedEventArgs e)
btnProgramSourceStatus.Content = "Enable";
}
}

private void CustomizeExplorer(object sender, TextChangedEventArgs e)
{
_settings.CustomizedExplorer = CustomizeExplorerBox.Text;
}

private void CustomizeExplorerArgs(object sender, TextChangedEventArgs e)
{
_settings.CustomizedArgs = CustomizeArgsBox.Text;
}
}
}
2 changes: 1 addition & 1 deletion Plugins/Flow.Launcher.Plugin.Program/plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Name": "Program",
"Description": "Search programs in Flow.Launcher",
"Author": "qianlifeng",
"Version": "1.0.0",
"Version": "1.1.0",
"Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Program.dll",
Expand Down