Add more customized args

This commit is contained in:
弘韬 张 2020-11-09 10:25:43 +08:00
parent d5d263be60
commit ead4c9a99b
3 changed files with 7 additions and 4 deletions

View file

@ -44,7 +44,7 @@
<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. Check the explorer's website for details on additional args.</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>
<!--Dialogs-->
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success">Success</system:String>

View file

@ -141,8 +141,9 @@ 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} \"{ParentDirectory}\"".Trim()));
!string.IsNullOrWhiteSpace(Main._settings.CustomizedExplorer) ? Main._settings.CustomizedExplorer:Settings.Explorer,
!string.IsNullOrWhiteSpace(Main._settings.CustomizedArgs)?Main._settings.CustomizedArgs.Replace("%s",$"\"{ParentDirectory}\"").Replace("%f",$"\"{FullPath}\""):
Settings.ExplorerArgs));
return true;
},
IcoPath = "Images/folder.png"

View file

@ -15,12 +15,14 @@ namespace Flow.Launcher.Plugin.Program
public bool EnableRegistrySource { get; set; } = true;
public string CustomizedExplorer { get; set; } = Explorer;
public string CustomizedArgs { get; set; }
public string CustomizedArgs { get; set; } = ExplorerArgs;
internal const char SuffixSeperator = ';';
internal const string Explorer = "explorer";
internal const string ExplorerArgs = "/select,%f";
/// <summary>
/// Contains user added folder location contents as well as all user disabled applications
/// </summary>