Merge pull request #782 from onesounds/FileManager

Default File manager
This commit is contained in:
Jeremy Wu 2021-11-12 07:37:48 +11:00 committed by GitHub
commit b7d5f4f342
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 691 additions and 158 deletions

View file

@ -0,0 +1,30 @@
using Flow.Launcher.Plugin;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Flow.Launcher.ViewModel
{
public class CustomExplorerViewModel : BaseModel
{
public string Name { get; set; }
public string Path { get; set; }
public string FileArgument { get; set; } = "\"%d\"";
public string DirectoryArgument { get; set; } = "\"%d\"";
public bool Editable { get; init; } = true;
public CustomExplorerViewModel Copy()
{
return new CustomExplorerViewModel
{
Name = Name,
Path = Path,
FileArgument = FileArgument,
DirectoryArgument = DirectoryArgument,
Editable = Editable
};
}
}
}

View file

@ -1,10 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel; using System.Collections.ObjectModel;
using System.Drawing; using System.Drawing;
using System.Text.Json.Serialization; using System.Text.Json.Serialization;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher; using Flow.Launcher;
using Flow.Launcher.ViewModel;
namespace Flow.Launcher.Infrastructure.UserSettings namespace Flow.Launcher.Infrastructure.UserSettings
{ {
@ -37,6 +39,49 @@ namespace Flow.Launcher.Infrastructure.UserSettings
public string ResultFontStretch { get; set; } public string ResultFontStretch { get; set; }
public bool UseGlyphIcons { get; set; } = true; public bool UseGlyphIcons { get; set; } = true;
public int CustomExplorerIndex { get; set; } = 0;
[JsonIgnore]
public CustomExplorerViewModel CustomExplorer
{
get => CustomExplorerList[CustomExplorerIndex < CustomExplorerList.Count ? CustomExplorerIndex : 0];
set => CustomExplorerList[CustomExplorerIndex] = value;
}
public List<CustomExplorerViewModel> CustomExplorerList { get; set; } = new()
{
new()
{
Name = "Explorer",
Path = "explorer",
DirectoryArgument = "\"%d\"",
FileArgument = "/select, \"%f\"",
Editable = false
},
new()
{
Name = "Total Commander",
Path = @"C:\Program Files\totalcmd\TOTALCMD64.exe",
DirectoryArgument = "/O /A /S /T \"%d\"",
FileArgument = "/O /A /S /T \"%f\""
},
new()
{
Name = "Directory Opus",
Path = @"C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe",
DirectoryArgument = "/cmd Go \"%d\" NEW",
FileArgument = "/cmd Go \"%f\" NEW"
},
new()
{
Name = "Files",
Path = "Files",
DirectoryArgument = "-select \"%d\"",
FileArgument = "-select \"%f\""
}
};
/// <summary> /// <summary>
/// when false Alphabet static service will always return empty results /// when false Alphabet static service will always return empty results

View file

@ -190,5 +190,12 @@ namespace Flow.Launcher.Plugin
/// <typeparam name="T">Type for Serialization</typeparam> /// <typeparam name="T">Type for Serialization</typeparam>
/// <returns></returns> /// <returns></returns>
void SaveSettingJsonStorage<T>() where T : new(); void SaveSettingJsonStorage<T>() where T : new();
/// <summary>
/// Open directory in an explorer configured by user via Flow's Settings. The default is Windows Explorer
/// </summary>
/// <param name="DirectoryPath">Directory Path to open</param>
/// <param name="FileName">Extra FileName Info</param>
public void OpenDirectory(string DirectoryPath, string FileName = null);
} }
} }

View file

@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
<!--MainWindow--> xmlns:system="clr-namespace:System;assembly=mscorlib">
<!-- MainWindow -->
<system:String x:Key="registerHotkeyFailed">Failed to register hotkey: {0}</system:String> <system:String x:Key="registerHotkeyFailed">Failed to register hotkey: {0}</system:String>
<system:String x:Key="couldnotStartCmd">Could not start {0}</system:String> <system:String x:Key="couldnotStartCmd">Could not start {0}</system:String>
<system:String x:Key="invalidFlowLauncherPluginFileFormat">Invalid Flow Launcher plugin file format</system:String> <system:String x:Key="invalidFlowLauncherPluginFileFormat">Invalid Flow Launcher plugin file format</system:String>
@ -15,7 +16,7 @@
<system:String x:Key="iconTrayExit">Exit</system:String> <system:String x:Key="iconTrayExit">Exit</system:String>
<system:String x:Key="closeWindow">Close</system:String> <system:String x:Key="closeWindow">Close</system:String>
<!--Setting General--> <!-- Setting General -->
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String> <system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>
<system:String x:Key="general">General</system:String> <system:String x:Key="general">General</system:String>
<system:String x:Key="portableMode">Portable Mode</system:String> <system:String x:Key="portableMode">Portable Mode</system:String>
@ -33,6 +34,8 @@
<system:String x:Key="maxShowResults">Maximum results shown</system:String> <system:String x:Key="maxShowResults">Maximum results shown</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String> <system:String x:Key="ignoreHotkeysOnFullscreen">Ignore hotkeys in fullscreen mode</system:String>
<system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Disable Flow Launcher activation when a full screen application is active (Recommended for games).</system:String> <system:String x:Key="ignoreHotkeysOnFullscreenToolTip">Disable Flow Launcher activation when a full screen application is active (Recommended for games).</system:String>
<system:String x:Key="defaultFileManager">Default File Manager</system:String>
<system:String x:Key="defaultFileManagerToolTip">Select the file manager to use when opening the folder.</system:String>
<system:String x:Key="pythonDirectory">Python Directory</system:String> <system:String x:Key="pythonDirectory">Python Directory</system:String>
<system:String x:Key="autoUpdates">Auto Update</system:String> <system:String x:Key="autoUpdates">Auto Update</system:String>
<system:String x:Key="selectPythonDirectory">Select</system:String> <system:String x:Key="selectPythonDirectory">Select</system:String>
@ -44,7 +47,7 @@
<system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese</system:String> <system:String x:Key="ShouldUsePinyinToolTip">Allows using Pinyin to search. Pinyin is the standard system of romanized spelling for translating Chinese</system:String>
<system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String> <system:String x:Key="shadowEffectNotAllowed">Shadow effect is not allowed while current theme has blur effect enabled</system:String>
<!--Setting Plugin--> <!-- Setting Plugin -->
<system:String x:Key="plugin">Plugins</system:String> <system:String x:Key="plugin">Plugins</system:String>
<system:String x:Key="browserMorePlugins">Find more plugins</system:String> <system:String x:Key="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">On</system:String> <system:String x:Key="enable">On</system:String>
@ -62,12 +65,12 @@
<system:String x:Key="plugin_query_time">Query time:</system:String> <system:String x:Key="plugin_query_time">Query time:</system:String>
<!--Setting Plugin Store--> <!-- Setting Plugin Store -->
<system:String x:Key="pluginStore">Plugin Store</system:String> <system:String x:Key="pluginStore">Plugin Store</system:String>
<system:String x:Key="refresh">Refresh</system:String> <system:String x:Key="refresh">Refresh</system:String>
<system:String x:Key="install">Install</system:String> <system:String x:Key="install">Install</system:String>
<!--Setting Theme--> <!-- Setting Theme -->
<system:String x:Key="theme">Theme</system:String> <system:String x:Key="theme">Theme</system:String>
<system:String x:Key="browserMoreThemes">Theme Gallery</system:String> <system:String x:Key="browserMoreThemes">Theme Gallery</system:String>
<system:String x:Key="howToCreateTheme">How to create a theme</system:String> <system:String x:Key="howToCreateTheme">How to create a theme</system:String>
@ -81,7 +84,7 @@
<system:String x:Key="ThemeFolder">Theme Folder</system:String> <system:String x:Key="ThemeFolder">Theme Folder</system:String>
<system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String> <system:String x:Key="OpenThemeFolder">Open Theme Folder</system:String>
<!--Setting Hotkey--> <!-- Setting Hotkey -->
<system:String x:Key="hotkey">Hotkey</system:String> <system:String x:Key="hotkey">Hotkey</system:String>
<system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String> <system:String x:Key="flowlauncherHotkey">Flow Launcher Hotkey</system:String>
<system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String> <system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String>
@ -102,7 +105,7 @@
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String> <system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String> <system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>
<!--Setting Proxy--> <!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</system:String> <system:String x:Key="proxy">HTTP Proxy</system:String>
<system:String x:Key="enableProxy">Enable HTTP Proxy</system:String> <system:String x:Key="enableProxy">Enable HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String> <system:String x:Key="server">HTTP Server</system:String>
@ -118,7 +121,7 @@
<system:String x:Key="proxyIsCorrect">Proxy configured correctly</system:String> <system:String x:Key="proxyIsCorrect">Proxy configured correctly</system:String>
<system:String x:Key="proxyConnectFailed">Proxy connection failed</system:String> <system:String x:Key="proxyConnectFailed">Proxy connection failed</system:String>
<!--Setting About--> <!-- Setting About -->
<system:String x:Key="about">About</system:String> <system:String x:Key="about">About</system:String>
<system:String x:Key="website">Website</system:String> <system:String x:Key="website">Website</system:String>
<system:String x:Key="version">Version</system:String> <system:String x:Key="version">Version</system:String>
@ -133,12 +136,22 @@
<system:String x:Key="releaseNotes">Release Notes</system:String> <system:String x:Key="releaseNotes">Release Notes</system:String>
<system:String x:Key="documentation">Usage Tips:</system:String> <system:String x:Key="documentation">Usage Tips:</system:String>
<!--Priority Setting Dialog--> <!-- FileManager Setting Dialog -->
<system:String x:Key="fileManagerWindow">Select File Manager</system:String>
<system:String x:Key="fileManager_tips">Please specify the file location of the file manager you using and add arguments if necessary. The default arguments is &quot;%d&quot;, and a path is entered at that location. For example, If a command is required such as &quot;totalcmd.exe /A c:\windows&quot;, argument is /A &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_tips2">&quot;%f&quot; is an argument that represent the file path. It is used to emphasize the file/folder name when opening a specific file location in 3rd party file manager. This argument is only available in the &quot;Arg for File&quot; item. If the file manager does not have that function, you can use &quot;%d&quot;.</system:String>
<system:String x:Key="fileManager_name">File Manager</system:String>
<system:String x:Key="fileManager_profile_name">Profile Name</system:String>
<system:String x:Key="fileManager_path">File Manager Path</system:String>
<system:String x:Key="fileManager_directory_arg">Arg For Folder</system:String>
<system:String x:Key="fileManager_file_arg">Arg For File</system:String>
<!-- Priority Setting Dialog -->
<system:String x:Key="changePriorityWindow">Change Priority</system:String> <system:String x:Key="changePriorityWindow">Change Priority</system:String>
<system:String x:Key="priority_tips">Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number</system:String> <system:String x:Key="priority_tips">Greater the number, the higher the result will be ranked. Try setting it as 5. If you want the results to be lower than any other plugin's, provide a negative number</system:String>
<system:String x:Key="invalidPriority">Please provide an valid integer for Priority!</system:String> <system:String x:Key="invalidPriority">Please provide an valid integer for Priority!</system:String>
<!--Action Keyword Setting Dialog--> <!-- Action Keyword Setting Dialog -->
<system:String x:Key="oldActionKeywords">Old Action Keyword</system:String> <system:String x:Key="oldActionKeywords">Old Action Keyword</system:String>
<system:String x:Key="newActionKeywords">New Action Keyword</system:String> <system:String x:Key="newActionKeywords">New Action Keyword</system:String>
<system:String x:Key="cancel">Cancel</system:String> <system:String x:Key="cancel">Cancel</system:String>
@ -148,9 +161,9 @@
<system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String> <system:String x:Key="newActionKeywordsHasBeenAssigned">This new Action Keyword is already assigned to another plugin, please choose a different one</system:String>
<system:String x:Key="success">Success</system:String> <system:String x:Key="success">Success</system:String>
<system:String x:Key="completedSuccessfully">Completed successfully</system:String> <system:String x:Key="completedSuccessfully">Completed successfully</system:String>
<system:String x:Key="actionkeyword_tips">Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords. </system:String> <system:String x:Key="actionkeyword_tips">Enter the action keyword you need to start the plug-in. Use * if you don't want to specify an action keyword. In the case, The plug-in works without keywords.</system:String>
<!--Custom Query Hotkey Dialog--> <!-- Custom Query Hotkey Dialog -->
<system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String> <system:String x:Key="customeQueryHotkeyTitle">Custom Query Hotkey</system:String>
<system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String> <system:String x:Key="customeQueryHotkeyTips">Press the custom hotkey to automatically insert the specified query.</system:String>
<system:String x:Key="preview">Preview</system:String> <system:String x:Key="preview">Preview</system:String>
@ -158,10 +171,10 @@
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String> <system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
<system:String x:Key="update">Update</system:String> <system:String x:Key="update">Update</system:String>
<!--Hotkey Control--> <!-- Hotkey Control -->
<system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String> <system:String x:Key="hotkeyUnavailable">Hotkey Unavailable</system:String>
<!--Crash Reporter--> <!-- Crash Reporter -->
<system:String x:Key="reportWindow_version">Version</system:String> <system:String x:Key="reportWindow_version">Version</system:String>
<system:String x:Key="reportWindow_time">Time</system:String> <system:String x:Key="reportWindow_time">Time</system:String>
<system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String> <system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String>
@ -177,16 +190,18 @@
<system:String x:Key="reportWindow_report_failed">Failed to send report</system:String> <system:String x:Key="reportWindow_report_failed">Failed to send report</system:String>
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String> <system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher got an error</system:String>
<!--General Notice--> <!-- General Notice -->
<system:String x:Key="pleaseWait">Please wait...</system:String> <system:String x:Key="pleaseWait">Please wait...</system:String>
<!--update--> <!-- update -->
<system:String x:Key="update_flowlauncher_update_check">Checking for new update</system:String> <system:String x:Key="update_flowlauncher_update_check">Checking for new update</system:String>
<system:String x:Key="update_flowlauncher_already_on_latest">You already have the latest Flow Launcher version</system:String> <system:String x:Key="update_flowlauncher_already_on_latest">You already have the latest Flow Launcher version</system:String>
<system:String x:Key="update_flowlauncher_update_found">Update found</system:String> <system:String x:Key="update_flowlauncher_update_found">Update found</system:String>
<system:String x:Key="update_flowlauncher_updating">Updating...</system:String> <system:String x:Key="update_flowlauncher_updating">Updating...</system:String>
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">Flow Launcher was not able to move your user profile data to the new update version. <system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">
Please manually move your profile data folder from {0} to {1}</system:String> Flow Launcher was not able to move your user profile data to the new update version.
Please manually move your profile data folder from {0} to {1}
</system:String>
<system:String x:Key="update_flowlauncher_new_update">New Update</system:String> <system:String x:Key="update_flowlauncher_new_update">New Update</system:String>
<system:String x:Key="update_flowlauncher_update_new_version_available">New Flow Launcher release {0} is now available</system:String> <system:String x:Key="update_flowlauncher_update_new_version_available">New Flow Launcher release {0} is now available</system:String>
<system:String x:Key="update_flowlauncher_update_error">An error occurred while trying to install software updates</system:String> <system:String x:Key="update_flowlauncher_update_error">An error occurred while trying to install software updates</system:String>

View file

@ -22,6 +22,8 @@ using System.Runtime.CompilerServices;
using Flow.Launcher.Infrastructure.Logger; using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Storage; using Flow.Launcher.Infrastructure.Storage;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using Flow.Launcher.Plugin.SharedCommands;
using System.Diagnostics;
namespace Flow.Launcher namespace Flow.Launcher
{ {
@ -158,7 +160,7 @@ namespace Flow.Launcher
if (!_pluginJsonStorages.ContainsKey(type)) if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>(); _pluginJsonStorages[type] = new PluginJsonStorage<T>();
return ((PluginJsonStorage<T>) _pluginJsonStorages[type]).Load(); return ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Load();
} }
public void SaveSettingJsonStorage<T>() where T : new() public void SaveSettingJsonStorage<T>() where T : new()
@ -167,7 +169,7 @@ namespace Flow.Launcher
if (!_pluginJsonStorages.ContainsKey(type)) if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>(); _pluginJsonStorages[type] = new PluginJsonStorage<T>();
((PluginJsonStorage<T>) _pluginJsonStorages[type]).Save(); ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
} }
public void SaveJsonStorage<T>(T settings) where T : new() public void SaveJsonStorage<T>(T settings) where T : new()
@ -175,7 +177,22 @@ namespace Flow.Launcher
var type = typeof(T); var type = typeof(T);
_pluginJsonStorages[type] = new PluginJsonStorage<T>(settings); _pluginJsonStorages[type] = new PluginJsonStorage<T>(settings);
((PluginJsonStorage<T>) _pluginJsonStorages[type]).Save(); ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
}
public void OpenDirectory(string DirectoryPath, string FileName = null)
{
using Process explorer = new Process();
var explorerInfo = _settingsVM.Settings.CustomExplorer;
explorer.StartInfo = new ProcessStartInfo
{
FileName = explorerInfo.Path,
Arguments = FileName is null ?
explorerInfo.DirectoryArgument.Replace("%d", DirectoryPath) :
explorerInfo.FileArgument.Replace("%d", DirectoryPath).Replace("%f",
Path.IsPathRooted(FileName) ? FileName : Path.Combine(DirectoryPath, FileName))
};
explorer.Start();
} }
public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent; public event FlowLauncherGlobalKeyboardEventHandler GlobalKeyboardEvent;
@ -188,7 +205,7 @@ namespace Flow.Launcher
{ {
if (GlobalKeyboardEvent != null) if (GlobalKeyboardEvent != null)
{ {
return GlobalKeyboardEvent((int) keyevent, vkcode, state); return GlobalKeyboardEvent((int)keyevent, vkcode, state);
} }
return true; return true;

View file

@ -0,0 +1,244 @@
<Window
x:Class="Flow.Launcher.SelectFileManagerWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019"
Title="{DynamicResource fileManagerWindow}"
Background="#f3f3f3"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
ResizeMode="NoResize"
SizeToContent="WidthAndHeight"
WindowStartupLocation="CenterScreen"
mc:Ignorable="d">
<Grid Width="600">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="80" />
</Grid.RowDefinitions>
<Border
Padding="26,26,26,0"
Background="#ffffff"
BorderBrush="#e5e5e5"
BorderThickness="0,0,0,1">
<Grid>
<StackPanel>
<StackPanel Grid.Row="0" Margin="0,0,0,12">
<TextBlock
Grid.Column="0"
Margin="0,0,0,0"
FontFamily="Segoe UI"
FontSize="20"
FontWeight="SemiBold"
Text="{DynamicResource fileManagerWindow}"
TextAlignment="Left" />
</StackPanel>
<StackPanel>
<TextBlock
FontSize="14"
Foreground="#1b1b1b"
Text="{DynamicResource fileManager_tips}"
TextAlignment="Left"
TextWrapping="WrapWithOverflow" />
<TextBlock
Margin="0,14,0,0"
FontSize="14"
Foreground="#1b1b1b">
<TextBlock Text="{DynamicResource fileManager_tips2}" TextWrapping="WrapWithOverflow" />
</TextBlock>
</StackPanel>
<StackPanel Margin="14,28,0,0" Orientation="Horizontal">
<TextBlock
Grid.Column="1"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_name}" />
<ComboBox
Name="comboBox"
Width="200"
Height="35"
Margin="14,0,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ItemsSource="{Binding CustomExplorers}"
SelectedIndex="{Binding SelectedCustomExplorerIndex}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
<Button
Margin="10,0,0,0"
Click="btnAdd_Click"
Content="{DynamicResource add}" />
<Button
Margin="10,0,0,0"
Click="btnDelete_Click"
Content="{DynamicResource delete}"
IsEnabled="{Binding CustomExplorer.Editable}" />
</StackPanel>
<Rectangle
Height="1"
Margin="0,20,0,12"
Fill="#cecece" />
<StackPanel
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
DataContext="{Binding CustomExplorer}"
Orientation="Horizontal">
<Grid Width="545">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="180" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<TextBlock
Grid.Row="0"
Grid.Column="0"
Margin="14,5,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_profile_name}" />
<TextBox
x:Name="ProfileTextBox"
Grid.Row="0"
Grid.Column="1"
Width="Auto"
Margin="10,5,15,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding Name}" />
<TextBlock
Grid.Row="1"
Grid.Column="0"
Margin="14,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_path}" />
<DockPanel Grid.Row="1" Grid.Column="1">
<TextBox
x:Name="PathTextBox"
Width="250"
Margin="10,10,10,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding Path}" />
<Button
Name="btnBrowseFile"
Width="80"
Margin="0,10,15,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Click="btnBrowseFile_Click"
Content="{DynamicResource selectPythonDirectory}"
DockPanel.Dock="Right">
<Button.Style>
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged, Path=IsEnabled}" Value="False">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</DockPanel>
<TextBlock
Grid.Row="2"
Grid.Column="0"
Margin="14,10,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_directory_arg}"
TextWrapping="WrapWithOverflow" />
<TextBox
x:Name="directoryArgTextBox"
Grid.Row="2"
Grid.Column="1"
Width="Auto"
Margin="10,10,15,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding DirectoryArgument}" />
<TextBlock
Grid.Row="3"
Grid.Column="0"
Margin="14,10,0,20"
HorizontalAlignment="Left"
VerticalAlignment="Center"
FontSize="14"
Text="{DynamicResource fileManager_file_arg}"
TextWrapping="WrapWithOverflow" />
<TextBox
x:Name="fileArgTextBox"
Grid.Row="3"
Grid.Column="1"
Width="Auto"
Margin="10,10,15,20"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
IsEnabled="{Binding Editable}"
Text="{Binding FileArgument}" />
</Grid>
</StackPanel>
</StackPanel>
</Grid>
</Border>
<StackPanel
Grid.Row="1"
HorizontalAlignment="Center"
Orientation="Horizontal">
<Button
x:Name="btnCancel"
Width="100"
Height="30"
Margin="0,0,5,0"
Click="btnCancel_Click"
Content="{DynamicResource cancel}" />
<Button
x:Name="btnDone"
Width="100"
Height="30"
Margin="5,0,0,0"
Click="btnDone_Click"
Content="{DynamicResource done}"
ForceCursor="True">
<Button.Style>
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
<Style.Triggers>
<DataTrigger Binding="{Binding Text.Length, ElementName=ProfileTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=PathTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=directoryArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
<DataTrigger Binding="{Binding Text.Length, ElementName=fileArgTextBox, UpdateSourceTrigger=PropertyChanged}" Value="0">
<Setter Property="IsEnabled" Value="False" />
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
</Button>
</StackPanel>
</Grid>
</Window>

View file

@ -0,0 +1,88 @@
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.ViewModel;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace Flow.Launcher
{
public partial class SelectFileManagerWindow : Window, INotifyPropertyChanged
{
private int selectedCustomExplorerIndex;
public event PropertyChangedEventHandler PropertyChanged;
public Settings Settings { get; }
public int SelectedCustomExplorerIndex
{
get => selectedCustomExplorerIndex; set
{
selectedCustomExplorerIndex = value;
PropertyChanged?.Invoke(this, new(nameof(CustomExplorer)));
}
}
public ObservableCollection<CustomExplorerViewModel> CustomExplorers { get; set; }
public CustomExplorerViewModel CustomExplorer => CustomExplorers[SelectedCustomExplorerIndex];
public SelectFileManagerWindow(Settings settings)
{
Settings = settings;
CustomExplorers = new ObservableCollection<CustomExplorerViewModel>(Settings.CustomExplorerList.Select(x => x.Copy()));
SelectedCustomExplorerIndex = Settings.CustomExplorerIndex;
InitializeComponent();
}
private void btnCancel_Click(object sender, RoutedEventArgs e)
{
Close();
}
private void btnDone_Click(object sender, RoutedEventArgs e)
{
Settings.CustomExplorerList = CustomExplorers.ToList();
Settings.CustomExplorerIndex = SelectedCustomExplorerIndex;
Close();
}
private void btnAdd_Click(object sender, RoutedEventArgs e)
{
CustomExplorers.Add(new()
{
Name = "New Profile"
});
SelectedCustomExplorerIndex = CustomExplorers.Count - 1;
}
private void btnDelete_Click(object sender, RoutedEventArgs e)
{
CustomExplorers.RemoveAt(SelectedCustomExplorerIndex--);
}
private void btnBrowseFile_Click(object sender, RoutedEventArgs e)
{
Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
Nullable<bool> result = dlg.ShowDialog();
if (result == true)
{
TextBox path = (TextBox)(((FrameworkElement)sender).Parent as FrameworkElement).FindName("PathTextBox");
path.Text = dlg.FileName;
path.Focus();
((Button)sender).Focus();
}
}
}
}

View file

@ -688,6 +688,35 @@
</StackPanel> </StackPanel>
</Border> </Border>
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock
Grid.Column="1"
VerticalAlignment="Center"
Text="{DynamicResource defaultFileManager}" />
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource defaultFileManagerToolTip}" />
</StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal">
<Button
Width="160"
MaxWidth="250"
Margin="10,0,18,0"
Click="OnSelectFileManagerClick"
Content="{Binding Settings.CustomExplorer.Name}" />
</StackPanel>
<TextBlock
Grid.Column="0"
Margin="24,0,16,0"
VerticalAlignment="Center"
FontFamily="/Resources/#Segoe Fluent Icons"
FontSize="20">
&#xe838;
</TextBlock>
</ItemsControl>
</Border>
<Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}"> <Border Margin="0,30,0,0" Style="{DynamicResource SettingGroupBox}">
<ItemsControl Style="{StaticResource SettingGrid}"> <ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}"> <StackPanel Style="{StaticResource TextPanel}">
@ -1388,11 +1417,15 @@
TextAlignment="left" /> TextAlignment="left" />
</Border> </Border>
<StackPanel Grid.Row="1" Margin="0" Background="{Binding PreviewBackground}"> <StackPanel
<StackPanel Margin="0,30,0,0" Grid.Row="1"
HorizontalAlignment="Center" Margin="0"
VerticalAlignment="Center" Background="{Binding PreviewBackground}">
Orientation="Horizontal"> <StackPanel
Margin="0,30,0,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Orientation="Horizontal">
<Border Width="{Binding WindowWidthSize}" Style="{DynamicResource WindowBorderStyle}"> <Border Width="{Binding WindowWidthSize}" Style="{DynamicResource WindowBorderStyle}">
<Border Style="{DynamicResource WindowRadius}"> <Border Style="{DynamicResource WindowRadius}">
<Border.Clip> <Border.Clip>
@ -1470,26 +1503,29 @@
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource windowWidthSize}" /> <TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource windowWidthSize}" />
</StackPanel> </StackPanel>
<StackPanel Grid.Column="2" Orientation="Horizontal"> <StackPanel Grid.Column="2" Orientation="Horizontal">
<TextBlock Width="100" <TextBlock
Margin="0,0,8,2" Width="100"
VerticalAlignment="Center" Margin="0,0,8,2"
Text="{Binding ElementName=WindowWidthValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"
TextAlignment="Right" /> Text="{Binding ElementName=WindowWidthValue, Path=Value, UpdateSourceTrigger=PropertyChanged}"
<Slider Name="WindowWidthValue" TextAlignment="Right" />
Width="300" <Slider
Margin="0,0,18,0" Name="WindowWidthValue"
IsMoveToPointEnabled="True" Width="300"
IsSnapToTickEnabled="True" Margin="0,0,18,0"
Maximum="900" IsMoveToPointEnabled="True"
Minimum="400" IsSnapToTickEnabled="True"
TickFrequency="10" Maximum="900"
Value="{Binding WindowWidthSize, Mode=TwoWay}" /> Minimum="400"
TickFrequency="10"
Value="{Binding WindowWidthSize, Mode=TwoWay}" />
</StackPanel> </StackPanel>
<TextBlock Grid.Column="0" <TextBlock
Margin="24,0,16,0" Grid.Column="0"
VerticalAlignment="Center" Margin="24,0,16,0"
FontFamily="/Resources/#Segoe Fluent Icons" VerticalAlignment="Center"
FontSize="20"> FontFamily="/Resources/#Segoe Fluent Icons"
FontSize="20">
&#xe740; &#xe740;
</TextBlock> </TextBlock>
</ItemsControl> </ItemsControl>

View file

@ -115,6 +115,12 @@ namespace Flow.Launcher
} }
} }
private void OnSelectFileManagerClick(object sender, RoutedEventArgs e)
{
SelectFileManagerWindow fileManagerChangeWindow = new SelectFileManagerWindow(settings);
fileManagerChangeWindow.ShowDialog();
}
#endregion #endregion
#region Hotkey #region Hotkey
@ -225,7 +231,7 @@ namespace Flow.Launcher
{ {
var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory; var directory = viewModel.SelectedPlugin.PluginPair.Metadata.PluginDirectory;
if (!string.IsNullOrEmpty(directory)) if (!string.IsNullOrEmpty(directory))
FilesFolders.OpenPath(directory); PluginManager.API.OpenDirectory(directory);
} }
} }
#endregion #endregion
@ -263,7 +269,7 @@ namespace Flow.Launcher
private void OpenPluginFolder(object sender, RoutedEventArgs e) private void OpenPluginFolder(object sender, RoutedEventArgs e)
{ {
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes)); PluginManager.API.OpenDirectory(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
} }
private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e) private void OnPluginStoreRefreshClick(object sender, RoutedEventArgs e)

View file

@ -230,7 +230,7 @@ namespace Flow.Launcher.Plugin.Explorer
{ {
try try
{ {
FilesFolders.OpenContainingFolder(record.FullPath); Context.API.OpenDirectory(Path.GetDirectoryName(record.FullPath), record.FullPath);
} }
catch (Exception e) catch (Exception e)
{ {

View file

@ -34,7 +34,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
{ {
try try
{ {
FilesFolders.OpenPath(path); Context.API.OpenDirectory(path);
return true; return true;
} }
catch (Exception ex) catch (Exception ex)
@ -101,7 +101,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
Score = 500, Score = 500,
Action = c => Action = c =>
{ {
FilesFolders.OpenPath(retrievedDirectoryPath); Context.API.OpenDirectory(retrievedDirectoryPath);
return true; return true;
}, },
TitleToolTip = retrievedDirectoryPath, TitleToolTip = retrievedDirectoryPath,
@ -150,7 +150,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
} }
else if (c.SpecialKeyState.CtrlPressed) else if (c.SpecialKeyState.CtrlPressed)
{ {
FilesFolders.OpenContainingFolder(filePath); Context.API.OpenDirectory(Path.GetDirectoryName(filePath), filePath);
} }
else else
{ {

View file

@ -10,7 +10,7 @@
"Name": "Explorer", "Name": "Explorer",
"Description": "Search and manage files and folders. Explorer utilises Windows Index Search", "Description": "Search and manage files and folders. Explorer utilises Windows Index Search",
"Author": "Jeremy Wu", "Author": "Jeremy Wu",
"Version": "1.9.1", "Version": "1.10.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Explorer.dll",

View file

@ -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;
@ -63,7 +63,7 @@ namespace Flow.Launcher.Plugin.Program
.AsParallel() .AsParallel()
.WithCancellation(token) .WithCancellation(token)
.Where(p => p.Enabled) .Where(p => p.Enabled)
.Select(p => p.Result(query.Search, _context.API)) .Select(p => p.Result(query.Search, Context.API))
.Where(r => r?.Score > 0) .Where(r => r?.Score > 0)
.ToList()); .ToList());
@ -80,7 +80,7 @@ namespace Flow.Launcher.Plugin.Program
public async Task InitAsync(PluginInitContext context) public async Task InitAsync(PluginInitContext context)
{ {
_context = context; Context = context;
_settings = context.API.LoadSettingJsonStorage<Settings>(); _settings = context.API.LoadSettingJsonStorage<Settings>();
@ -155,17 +155,17 @@ namespace Flow.Launcher.Plugin.Program
public Control CreateSettingPanel() public Control CreateSettingPanel()
{ {
return new ProgramSetting(_context, _settings, _win32s, _uwps); return new ProgramSetting(Context, _settings, _win32s, _uwps);
} }
public string GetTranslatedPluginTitle() public string GetTranslatedPluginTitle()
{ {
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_name"); return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_name");
} }
public string GetTranslatedPluginDescription() public string GetTranslatedPluginDescription()
{ {
return _context.API.GetTranslation("flowlauncher_plugin_program_plugin_description"); return Context.API.GetTranslation("flowlauncher_plugin_program_plugin_description");
} }
public List<Result> LoadContextMenus(Result selectedResult) public List<Result> LoadContextMenus(Result selectedResult)
@ -174,19 +174,19 @@ namespace Flow.Launcher.Plugin.Program
var program = selectedResult.ContextData as IProgram; var program = selectedResult.ContextData as IProgram;
if (program != null) if (program != null)
{ {
menuOptions = program.ContextMenus(_context.API); menuOptions = program.ContextMenus(Context.API);
} }
menuOptions.Add( menuOptions.Add(
new Result new Result
{ {
Title = _context.API.GetTranslation("flowlauncher_plugin_program_disable_program"), Title = Context.API.GetTranslation("flowlauncher_plugin_program_disable_program"),
Action = c => Action = c =>
{ {
DisableProgram(program); DisableProgram(program);
_context.API.ShowMsg( Context.API.ShowMsg(
_context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"), Context.API.GetTranslation("flowlauncher_plugin_program_disable_dlgtitle_success"),
_context.API.GetTranslation( Context.API.GetTranslation(
"flowlauncher_plugin_program_disable_dlgtitle_success_message")); "flowlauncher_plugin_program_disable_dlgtitle_success_message"));
return false; return false;
}, },
@ -235,7 +235,7 @@ namespace Flow.Launcher.Plugin.Program
{ {
var name = "Plugin: Program"; var name = "Plugin: Program";
var message = $"Unable to start: {info.FileName}"; var message = $"Unable to start: {info.FileName}";
_context.API.ShowMsg(name, message, string.Empty); Context.API.ShowMsg(name, message, string.Empty);
} }
} }

View file

@ -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;
}, },

View file

@ -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;
}, },

View file

@ -1,91 +1,166 @@
<UserControl x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting" <UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" x:Class="Flow.Launcher.Plugin.Program.Views.ProgramSetting"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext="{Binding RelativeSource={RelativeSource Self}}" xmlns:program="clr-namespace:Flow.Launcher.Plugin.Program"
mc:Ignorable="d" Height="450"
d:DesignHeight="404.508" d:DesignWidth="600"> d:DesignHeight="404.508"
<Grid Margin="10"> d:DesignWidth="600"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d">
<Grid Margin="20">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<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
<StackPanel Orientation="Vertical" Width="Auto"> Grid.Row="0"
<CheckBox Name="StartMenuEnabled" IsChecked="{Binding EnableStartMenuSource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_start}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" /> HorizontalAlignment="Stretch"
<CheckBox Name="RegistryEnabled" IsChecked="{Binding EnableRegistrySource}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" /> Orientation="Horizontal">
<CheckBox Name="DescriptionEnabled" IsChecked="{Binding EnableDescription}" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_enable_description}" ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" /> <StackPanel Width="Auto" Orientation="Vertical">
<CheckBox
Name="StartMenuEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_index_start}"
IsChecked="{Binding EnableStartMenuSource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_start_tooltip}" />
<CheckBox
Name="RegistryEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_index_registry}"
IsChecked="{Binding EnableRegistrySource}"
ToolTip="{DynamicResource flowlauncher_plugin_program_index_registry_tooltip}" />
<CheckBox
Name="DescriptionEnabled"
Margin="5"
Content="{DynamicResource flowlauncher_plugin_program_enable_description}"
IsChecked="{Binding EnableDescription}"
ToolTip="{DynamicResource flowlauncher_plugin_program_enable_description_tooltip}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal" Width="Auto"> <StackPanel
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" /> Width="Auto"
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnProgramSuffixes" Click="BtnProgramSuffixes_OnClick" Content="{DynamicResource flowlauncher_plugin_program_suffixes}" /> HorizontalAlignment="Right"
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnReindex" Click="btnReindex_Click" Content="{DynamicResource flowlauncher_plugin_program_reindex}" /> Orientation="Horizontal">
<Button
x:Name="btnLoadAllProgramSource"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="btnLoadAllProgramSource_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
<Button
x:Name="btnProgramSuffixes"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="BtnProgramSuffixes_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
<Button
x:Name="btnReindex"
Width="100"
Height="31"
Margin="10"
HorizontalAlignment="Right"
Click="btnReindex_Click"
Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}" <ListView
Margin="0,13,0,10" x:Name="programSourceView"
BorderBrush="DarkGray" Grid.Row="1"
BorderThickness="1" Margin="0,13,0,10"
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler" AllowDrop="True"
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp" BorderBrush="DarkGray"
DragEnter="programSourceView_DragEnter" BorderThickness="1"
Drop="programSourceView_Drop"> DragEnter="programSourceView_DragEnter"
Drop="programSourceView_Drop"
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
SelectionMode="Extended"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
<ListView.ItemContainerStyle> <ListView.ItemContainerStyle>
<Style TargetType="ListViewItem"> <Style TargetType="ListViewItem">
<EventSetter Event="PreviewMouseUp" Handler="Row_OnClick"/> <EventSetter Event="PreviewMouseUp" Handler="Row_OnClick" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style> </Style>
</ListView.ItemContainerStyle> </ListView.ItemContainerStyle>
<ListView.View> <ListView.View>
<GridView> <GridView>
<GridViewColumn Header="Name" Width="150"> <GridViewColumn Width="150" Header="Name">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Name}"/> <TextBlock Text="{Binding Name}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="Enabled"> <GridViewColumn Header="Enabled">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Enabled}" MaxWidth="60" TextAlignment="Center"/> <TextBlock
MaxWidth="60"
Text="{Binding Enabled}"
TextAlignment="Center" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn Header="{DynamicResource flowlauncher_plugin_program_location}" Width="550"> <GridViewColumn Width="550" Header="{DynamicResource flowlauncher_plugin_program_location}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}"/> <TextBlock Text="{Binding Location, ConverterParameter=(null), Converter={program:LocationConverter}}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
</GridView> </GridView>
</ListView.View> </ListView.View>
</ListView> </ListView>
<DockPanel Grid.Row="2" Margin="0,0,0,0" Grid.RowSpan="1"> <DockPanel
<StackPanel x:Name="indexingPanel" Visibility="Hidden" HorizontalAlignment="Left" Orientation="Horizontal"> Grid.Row="2"
<ProgressBar x:Name="progressBarIndexing" Height="20" Width="80" Minimum="0" Maximum="100" IsIndeterminate="True" /> Grid.RowSpan="1"
<TextBlock Margin="10 0 0 0" Height="20" HorizontalAlignment="Center" Text="{DynamicResource flowlauncher_plugin_program_indexing}" /> Margin="0,0,0,0">
<StackPanel
x:Name="indexingPanel"
HorizontalAlignment="Left"
Orientation="Horizontal"
Visibility="Hidden">
<ProgressBar
x:Name="progressBarIndexing"
Width="80"
Height="20"
IsIndeterminate="True"
Maximum="100"
Minimum="0" />
<TextBlock
Height="20"
Margin="10,0,0,0"
HorizontalAlignment="Center"
Text="{DynamicResource flowlauncher_plugin_program_indexing}" />
</StackPanel> </StackPanel>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
<Button x:Name="btnProgramSourceStatus" Click="btnProgramSourceStatus_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_disable}" /> <Button
<Button x:Name="btnEditProgramSource" Click="btnEditProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_edit}"/> x:Name="btnProgramSourceStatus"
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10 10 0 10" Content="{DynamicResource flowlauncher_plugin_program_add}"/> Width="100"
Margin="10"
Click="btnProgramSourceStatus_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_disable}" />
<Button
x:Name="btnEditProgramSource"
Width="100"
Margin="10"
Click="btnEditProgramSource_OnClick"
Content="{DynamicResource flowlauncher_plugin_program_edit}" />
<Button
x:Name="btnAddProgramSource"
Width="100"
Margin="10,10,0,10"
Click="btnAddProgramSource_OnClick"
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>

View file

@ -347,15 +347,5 @@ namespace Flow.Launcher.Plugin.Program.Views
btnProgramSourceStatus.Content = "Enable"; 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;
}
} }
} }

View file

@ -4,7 +4,7 @@
"Name": "Program", "Name": "Program",
"Description": "Search programs in Flow.Launcher", "Description": "Search programs in Flow.Launcher",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.6.1", "Version": "1.7.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Program.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Program.dll",

View file

@ -304,7 +304,7 @@ namespace Flow.Launcher.Plugin.Sys
Action = c => Action = c =>
{ {
var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version); var logPath = Path.Combine(DataLocation.DataDirectory(), "Logs", Constant.Version);
FilesFolders.OpenPath(logPath); context.API.OpenDirectory(logPath);
return true; return true;
} }
}, },
@ -326,7 +326,7 @@ namespace Flow.Launcher.Plugin.Sys
IcoPath = "Images\\app.png", IcoPath = "Images\\app.png",
Action = c => Action = c =>
{ {
FilesFolders.OpenPath(DataLocation.DataDirectory()); context.API.OpenDirectory(DataLocation.DataDirectory());
return true; return true;
} }
} }

View file

@ -4,7 +4,7 @@
"Name": "System Commands", "Name": "System Commands",
"Description": "Provide System related commands. e.g. shutdown,lock, setting etc.", "Description": "Provide System related commands. e.g. shutdown,lock, setting etc.",
"Author": "qianlifeng", "Author": "qianlifeng",
"Version": "1.4.1", "Version": "1.5.0",
"Language": "csharp", "Language": "csharp",
"Website": "https://github.com/Flow-Launcher/Flow.Launcher", "Website": "https://github.com/Flow-Launcher/Flow.Launcher",
"ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll", "ExecuteFileName": "Flow.Launcher.Plugin.Sys.dll",