Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
6a2d7fc
Add File Manager Item and popup window
onesounds Oct 30, 2021
962af51
add some string
onesounds Oct 30, 2021
6f004a4
Custom Explorer Binding (Part 1)
taooceros Nov 2, 2021
de7c462
Merge remote-tracking branch 'upstream/dev' into FileManager
taooceros Nov 5, 2021
5ebe5d4
Revert a test change
taooceros Nov 5, 2021
b8d1611
Merge SettingWidth for the inclusion of fody in infrastrature project
taooceros Nov 5, 2021
99d8575
File Explore Binding (Part 2)
taooceros Nov 5, 2021
fb36c0c
Adjust width and height to display hided element
taooceros Nov 6, 2021
1965ba1
Implement the API call to custom explorer via ipublicapi, and migrate…
taooceros Nov 6, 2021
6e83e2e
Add add & delete feature
taooceros Nov 6, 2021
84ebbd9
Migrate Program Plugin Custom Explorer
taooceros Nov 6, 2021
83a6be6
Adjust Window Button Style
onesounds Nov 6, 2021
0c5442c
Change the window size to responsive
onesounds Nov 6, 2021
1856f7f
Change 2nd Argument textbox label
onesounds Nov 6, 2021
9eb8d53
Adjust popup layout
onesounds Nov 6, 2021
a7f46ce
Add argument setting for file managers and Adjust Label Text
onesounds Nov 6, 2021
af7bab4
fix directory opus default path
onesounds Nov 6, 2021
fb923c4
Fix rename issue
taooceros Nov 6, 2021
16a07dc
Merge branch 'FileManager' of github.com:onesounds/Flow.Launcher into…
taooceros Nov 6, 2021
8f2163c
migrate explorer open containing folder to new api
taooceros Nov 7, 2021
434b409
Fix IndexOutOfBound issue when adding new profile
taooceros Nov 7, 2021
c385b95
- Add Height Program Plugin Setting Panel
onesounds Nov 7, 2021
60907ec
Change the text to string
onesounds Nov 8, 2021
a32a71e
Fix Border
onesounds Nov 8, 2021
c727150
Remove Button Style
onesounds Nov 8, 2021
07b42ff
Add File Select Dialogue
onesounds Nov 9, 2021
c6054d4
Add File Manager Item and popup window
onesounds Oct 30, 2021
7dc5806
add some string
onesounds Oct 30, 2021
4eb36c8
Custom Explorer Binding (Part 1)
taooceros Nov 2, 2021
6bfebe9
Revert a test change
taooceros Nov 5, 2021
a69f4a7
File Explore Binding (Part 2)
taooceros Nov 5, 2021
b3a04a9
Adjust width and height to display hided element
taooceros Nov 6, 2021
8a312d4
Implement the API call to custom explorer via ipublicapi, and migrate…
taooceros Nov 6, 2021
992735f
Add add & delete feature
taooceros Nov 6, 2021
5ee6c4b
Migrate Program Plugin Custom Explorer
taooceros Nov 6, 2021
a3b62bc
Fix rename issue
taooceros Nov 6, 2021
5be5d81
Adjust Window Button Style
onesounds Nov 6, 2021
e648ef0
Change the window size to responsive
onesounds Nov 6, 2021
696eaa9
Change 2nd Argument textbox label
onesounds Nov 6, 2021
dff0670
Adjust popup layout
onesounds Nov 6, 2021
c27a87c
Add argument setting for file managers and Adjust Label Text
onesounds Nov 6, 2021
7e849ee
fix directory opus default path
onesounds Nov 6, 2021
2c1e070
migrate explorer open containing folder to new api
taooceros Nov 7, 2021
a02d020
Fix IndexOutOfBound issue when adding new profile
taooceros Nov 7, 2021
f35d36b
Fix delete index out of bound issue
taooceros Nov 10, 2021
7d18c3e
- Add Height Program Plugin Setting Panel
onesounds Nov 7, 2021
15756f7
Change the text to string
onesounds Nov 8, 2021
b779557
Fix Border
onesounds Nov 8, 2021
a2c1233
Remove Button Style
onesounds Nov 8, 2021
67c9004
Add File Select Dialogue
onesounds Nov 9, 2021
1b4aa19
Pull
onesounds Nov 10, 2021
b15ec0f
Json Ignore CustomExplorer Property because we don't use that to stor…
taooceros Nov 10, 2021
07905e8
update api description comment
jjw24 Nov 10, 2021
d8b4050
remove summary
jjw24 Nov 10, 2021
e09248f
bump version for plugins
jjw24 Nov 10, 2021
0e91d29
Merge branch 'FileManager' of https://github.com/onesounds/Flow.Launc…
onesounds Nov 11, 2021
0cdeb71
Merge Dev
onesounds Nov 11, 2021
994d7eb
- Add "%f" tip text and adjust string
onesounds Nov 11, 2021
b0cb8ad
update wording
jjw24 Nov 11, 2021
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
Original file line number Diff line number Diff line change
@@ -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
};
}
}
}
45 changes: 45 additions & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Text.Json.Serialization;
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher;
using Flow.Launcher.ViewModel;

namespace Flow.Launcher.Infrastructure.UserSettings
{
Expand Down Expand Up @@ -37,6 +39,49 @@ public string Language
public string ResultFontStretch { get; set; }
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>
/// when false Alphabet static service will always return empty results
Expand Down
7 changes: 7 additions & 0 deletions Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,5 +190,12 @@ public interface IPublicAPI
/// <typeparam name="T">Type for Serialization</typeparam>
/// <returns></returns>
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);
}
}
59 changes: 37 additions & 22 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!--MainWindow-->
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<!-- MainWindow -->
<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="invalidFlowLauncherPluginFileFormat">Invalid Flow Launcher plugin file format</system:String>
Expand All @@ -15,7 +16,7 @@
<system:String x:Key="iconTrayExit">Exit</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="general">General</system:String>
<system:String x:Key="portableMode">Portable Mode</system:String>
Expand All @@ -33,6 +34,8 @@
<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="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="autoUpdates">Auto Update</system:String>
<system:String x:Key="selectPythonDirectory">Select</system:String>
Expand All @@ -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="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="browserMorePlugins">Find more plugins</system:String>
<system:String x:Key="enable">On</system:String>
Expand All @@ -62,12 +65,12 @@
<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="refresh">Refresh</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="browserMoreThemes">Theme Gallery</system:String>
<system:String x:Key="howToCreateTheme">How to create a theme</system:String>
Expand All @@ -81,7 +84,7 @@
<system:String x:Key="ThemeFolder">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="flowlauncherHotkey">Flow Launcher Hotkey</system:String>
<system:String x:Key="flowlauncherHotkeyToolTip">Enter shortcut to show/hide Flow Launcher.</system:String>
Expand All @@ -102,7 +105,7 @@
<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>

<!--Setting Proxy-->
<!-- Setting Proxy -->
<system:String x:Key="proxy">HTTP Proxy</system:String>
<system:String x:Key="enableProxy">Enable HTTP Proxy</system:String>
<system:String x:Key="server">HTTP Server</system:String>
Expand All @@ -118,7 +121,7 @@
<system:String x:Key="proxyIsCorrect">Proxy configured correctly</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="website">Website</system:String>
<system:String x:Key="version">Version</system:String>
Expand All @@ -127,18 +130,28 @@
<system:String x:Key="newVersionTips">New version {0} is available, would you like to restart Flow Launcher to use the update?</system:String>
<system:String x:Key="checkUpdatesFailed">Check updates failed, please check your connection and proxy settings to api.github.com.</system:String>
<system:String x:Key="downloadUpdatesFailed">
Download updates failed, please check your connection and proxy settings to github-cloud.s3.amazonaws.com,
Download updates failed, please check your connection and proxy settings to github-cloud.s3.amazonaws.com,
or go to https://github.com/Flow-Launcher/Flow.Launcher/releases to download updates manually.
</system:String>
<system:String x:Key="releaseNotes">Release Notes</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="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>

<!--Action Keyword Setting Dialog-->
<!-- Action Keyword Setting Dialog -->
<system:String x:Key="oldActionKeywords">Old Action Keyword</system:String>
<system:String x:Key="newActionKeywords">New Action Keyword</system:String>
<system:String x:Key="cancel">Cancel</system:String>
Expand All @@ -148,20 +161,20 @@
<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="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="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="hotkeyIsNotUnavailable">Hotkey is unavailable, please select a new hotkey</system:String>
<system:String x:Key="invalidPluginHotkey">Invalid plugin hotkey</system:String>
<system:String x:Key="update">Update</system:String>

<!--Hotkey Control-->
<!-- Hotkey Control -->
<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_time">Time</system:String>
<system:String x:Key="reportWindow_reproduce">Please tell us how application crashed so we can fix it</system:String>
Expand All @@ -177,16 +190,18 @@
<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>

<!--General Notice-->
<!-- General Notice -->
<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_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_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.
Please manually move your profile data folder from {0} to {1}</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.
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_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>
Expand Down
25 changes: 21 additions & 4 deletions Flow.Launcher/PublicAPIInstance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
using Flow.Launcher.Infrastructure.Logger;
using Flow.Launcher.Infrastructure.Storage;
using System.Collections.Concurrent;
using Flow.Launcher.Plugin.SharedCommands;
using System.Diagnostics;

namespace Flow.Launcher
{
Expand Down Expand Up @@ -158,7 +160,7 @@ public void SavePluginSettings()
if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>();

return ((PluginJsonStorage<T>) _pluginJsonStorages[type]).Load();
return ((PluginJsonStorage<T>)_pluginJsonStorages[type]).Load();
}

public void SaveSettingJsonStorage<T>() where T : new()
Expand All @@ -167,15 +169,30 @@ public void SavePluginSettings()
if (!_pluginJsonStorages.ContainsKey(type))
_pluginJsonStorages[type] = new PluginJsonStorage<T>();

((PluginJsonStorage<T>) _pluginJsonStorages[type]).Save();
((PluginJsonStorage<T>)_pluginJsonStorages[type]).Save();
}

public void SaveJsonStorage<T>(T settings) where T : new()
{
var type = typeof(T);
_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;
Expand All @@ -188,7 +205,7 @@ private bool KListener_hookedKeyboardCallback(KeyEvent keyevent, int vkcode, Spe
{
if (GlobalKeyboardEvent != null)
{
return GlobalKeyboardEvent((int) keyevent, vkcode, state);
return GlobalKeyboardEvent((int)keyevent, vkcode, state);
}

return true;
Expand Down
Loading