Skip to content

Commit 8343bc7

Browse files
committed
Add hide uwp/lnk path setting
1 parent 5e57d73 commit 8343bc7

File tree

6 files changed

+48
-9
lines changed

6 files changed

+48
-9
lines changed

Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3-
xmlns:system="clr-namespace:System;assembly=mscorlib">
1+
<ResourceDictionary
2+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4+
xmlns:system="clr-namespace:System;assembly=mscorlib">
45

5-
<!--Program setting-->
6+
<!-- Program setting -->
67
<system:String x:Key="flowlauncher_plugin_program_delete">Delete</system:String>
78
<system:String x:Key="flowlauncher_plugin_program_edit">Edit</system:String>
89
<system:String x:Key="flowlauncher_plugin_program_add">Add</system:String>
@@ -16,6 +17,8 @@
1617
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
1718
<system:String x:Key="flowlauncher_plugin_program_index_registry">Index Registry</system:String>
1819
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
20+
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide Apps path</system:String>
21+
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath_tooltip">For executable files such as UWP or lnk, hide the file path from being visible</system:String>
1922
<system:String x:Key="flowlauncher_plugin_program_enable_description">Enable Program Description</system:String>
2023
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>
2124
<system:String x:Key="flowlauncher_plugin_program_suffixes_header">Suffixes</system:String>
@@ -50,7 +53,7 @@
5053
<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>
5154
<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>
5255

53-
<!--Dialogs-->
56+
<!-- Dialogs -->
5457
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success">Success</system:String>
5558
<system:String x:Key="flowlauncher_plugin_program_disable_dlgtitle_success_message">Successfully disabled this program from displaying in your query</system:String>
5659
<system:String x:Key="flowlauncher_plugin_program_run_as_administrator_not_supported_message">This app is not intended to be run as administrator</system:String>

Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public Result Result(string query, IPublicAPI api)
314314
var result = new Result
315315
{
316316
Title = title,
317-
SubTitle = Package.Location,
317+
SubTitle = HideLnkPath(),
318318
Icon = Logo,
319319
Score = matchResult.Score,
320320
TitleHighlightData = matchResult.MatchData,
@@ -351,6 +351,18 @@ public Result Result(string query, IPublicAPI api)
351351

352352
return result;
353353
}
354+
public string HideLnkPath()
355+
{
356+
bool lnkSetting = Main._settings.EnableHideLnkPath;
357+
if (lnkSetting)
358+
{
359+
return "";
360+
}
361+
else
362+
{
363+
return Package.Location;
364+
}
365+
}
354366

355367
public List<Result> ContextMenus(IPublicAPI api)
356368
{

Plugins/Flow.Launcher.Plugin.Program/Programs/Win32.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public Result Result(string query, IPublicAPI api)
9797
var result = new Result
9898
{
9999
Title = title,
100-
SubTitle = LnkResolvedPath ?? FullPath,
100+
SubTitle = HideLnkPath(),
101101
IcoPath = IcoPath,
102102
Score = matchResult.Score,
103103
TitleHighlightData = matchResult.MatchData,
@@ -545,5 +545,17 @@ public bool Equals([AllowNull] Win32 other)
545545

546546
return UniqueIdentifier == other.UniqueIdentifier;
547547
}
548+
549+
public string HideLnkPath()
550+
{
551+
bool lnkSetting = Main._settings.EnableHideLnkPath;
552+
if (lnkSetting) {
553+
return "";
554+
}
555+
else
556+
{
557+
return LnkResolvedPath ?? FullPath;
558+
}
559+
}
548560
}
549561
}

Plugins/Flow.Launcher.Plugin.Program/Settings.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ public class Settings
1313

1414
public bool EnableStartMenuSource { get; set; } = true;
1515

16-
public bool EnableDescription { get; set; } = true;
16+
public bool EnableDescription { get; set; } = false;
17+
public bool EnableHideLnkPath { get; set; } = true;
1718
public bool EnableRegistrySource { get; set; } = true;
1819
public string CustomizedExplorer { get; set; } = Explorer;
1920
public string CustomizedArgs { get; set; } = ExplorerArgs;

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
mc:Ignorable="d">
1313
<Grid Margin="20">
1414
<Grid.RowDefinitions>
15-
<RowDefinition Height="120" />
15+
<RowDefinition Height="165" />
1616
<RowDefinition Height="*" />
1717
<RowDefinition Height="50" />
1818
</Grid.RowDefinitions>
@@ -33,6 +33,12 @@
3333
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
3434
IsChecked="{Binding EnableRegistrySource}"
3535
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
36+
<CheckBox
37+
Name="HideLnkEnabled"
38+
Margin="5"
39+
Content="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath}"
40+
IsChecked="{Binding EnableHideLnkPath}"
41+
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_hidelnkpath_tooltip}" />
3642
<CheckBox
3743
Name="DescriptionEnabled"
3844
Margin="5"

Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ public bool EnableDescription
3232
get => _settings.EnableDescription;
3333
set => _settings.EnableDescription = value;
3434
}
35+
public bool EnableHideLnkPath
36+
{
37+
get => _settings.EnableHideLnkPath;
38+
set => _settings.EnableHideLnkPath = value;
39+
}
3540

3641
public bool EnableRegistrySource
3742
{

0 commit comments

Comments
 (0)