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
2 changes: 2 additions & 0 deletions Plugins/Flow.Launcher.Plugin.Program/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<system:String x:Key="flowlauncher_plugin_program_indexing">Indexing</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_source">Index Sources</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_option">Options</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_uwp">UWP Apps</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_uwp_tooltip">When enabled, Flow will load UWP Applications</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_start">Start Menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_start_tooltip">When enabled, Flow will load programs from the start menu</system:String>
<system:String x:Key="flowlauncher_plugin_program_index_registry">Registry</system:String>
Expand Down
5 changes: 1 addition & 4 deletions Plugins/Flow.Launcher.Plugin.Program/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Controls;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Storage;
using Flow.Launcher.Plugin.Program.Programs;
Expand Down Expand Up @@ -115,9 +114,7 @@ public static void IndexWin32Programs()

public static void IndexUwpPrograms()
{
var windows10 = new Version(10, 0);
var support = Environment.OSVersion.Version.Major >= windows10.Major;
var applications = support ? UWP.All() : Array.Empty<UWP.Application>();
var applications = UWP.All(_settings);
_uwps = applications;
ResetCache();
}
Expand Down
14 changes: 10 additions & 4 deletions Plugins/Flow.Launcher.Plugin.Program/Programs/UWP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,10 @@ private PackageVersion GetPackageVersionFromManifest(XmlNode xmlRoot)
},
};

public static Application[] All()
public static Application[] All(Settings settings)
{
var windows10 = new Version(10, 0);
var support = Environment.OSVersion.Version.Major >= windows10.Major;
if (support)
var support = SupportUWP();
if (support && settings.EnableUWP)
{
var applications = CurrentUserPackages().AsParallel().SelectMany(p =>
{
Expand Down Expand Up @@ -241,6 +240,13 @@ public static Application[] All()
}
}

public static bool SupportUWP()
{
var windows10 = new Version(10, 0);
var support = Environment.OSVersion.Version.Major >= windows10.Major;
return support;
}

private static IEnumerable<Package> CurrentUserPackages()
{
var u = WindowsIdentity.GetCurrent().User;
Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Program/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ private void RemoveRedundantSuffixes()
public bool HideAppsPath { get; set; } = true;
public bool EnableRegistrySource { get; set; } = true;
public bool EnablePathSource { get; set; } = false;
public bool EnableUWP { get; set; } = true;

public string CustomizedExplorer { get; set; } = Explorer;
public string CustomizedArgs { get; set; } = ExplorerArgs;
Expand Down
11 changes: 10 additions & 1 deletion Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
Height="520"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<UserControl.Resources>
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
</UserControl.Resources>
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
Expand All @@ -27,6 +30,13 @@
Margin="0,0,14,0"
HorizontalAlignment="Right"
DockPanel.Dock="Right">
<CheckBox
Name="UWPEnabled"
Margin="12,0,12,0"
Visibility="{Binding ShowUWPCheckbox, Converter={StaticResource BooleanToVisibilityConverter}}"
Content="{DynamicResource flowlauncher_plugin_program_index_uwp}"
IsChecked="{Binding EnableUWP}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_uwp_tooltip}" />
<CheckBox
Name="StartMenuEnabled"
Margin="12,0,12,0"
Expand All @@ -39,7 +49,6 @@
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
IsChecked="{Binding EnableRegistrySource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />

<CheckBox
Name="PATHEnabled"
Margin="12,0,12,0"
Expand Down
19 changes: 17 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Program/Views/ProgramSetting.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,16 @@ public bool EnablePATHSource
}
}

public bool EnableUWP
{
get => _settings.EnableUWP;
set
{
_settings.EnableUWP = value;
ReIndexing();
}
}

public string CustomizedExplorerPath
{
get => _settings.CustomizedExplorer;
Expand All @@ -89,6 +99,8 @@ public string CustomizedExplorerArg
set => _settings.CustomizedArgs = value;
}

public bool ShowUWPCheckbox => UWP.SupportUWP();

public ProgramSetting(PluginInitContext context, Settings settings, Win32[] win32s, UWP.Application[] uwps)
{
this.context = context;
Expand Down Expand Up @@ -383,8 +395,11 @@ private void programSourceView_SelectionChanged(object sender, SelectionChangedE

private void programSourceView_MouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var selectedProgramSource = programSourceView.SelectedItem as ProgramSource;
EditProgramSource(selectedProgramSource);
if (((FrameworkElement)e.OriginalSource).DataContext is ProgramSource)
{
var selectedProgramSource = programSourceView.SelectedItem as ProgramSource;
EditProgramSource(selectedProgramSource);
}
}

private bool IsAllItemsUserAdded(List<ProgramSource> items)
Expand Down