Skip to content

Commit 715aafd

Browse files
committed
Merge branch 'dev' into AcronymFuzzy
2 parents f3479f6 + d509b11 commit 715aafd

File tree

21 files changed

+240
-115
lines changed

21 files changed

+240
-115
lines changed

Flow.Launcher/Languages/sk.xaml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<!--Setting General-->
1818
<system:String x:Key="flowlauncher_settings">Nastavenia Flow Launchera</system:String>
1919
<system:String x:Key="general">Všeobecné</system:String>
20+
<system:String x:Key="portableMode">Prenosný režim</system:String>
2021
<system:String x:Key="startFlowLauncherOnSystemStartup">Spustiť Flow Launcher po štarte systému</system:String>
2122
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Schovať Flow Launcher po strate fokusu</system:String>
2223
<system:String x:Key="dontPromptUpdateMsg">Nezobrazovať upozornenia na novú verziu</system:String>
@@ -39,10 +40,13 @@
3940
<!--Setting Plugin-->
4041
<system:String x:Key="plugin">Plugin</system:String>
4142
<system:String x:Key="browserMorePlugins">Nájsť ďalšie pluginy</system:String>
43+
<system:String x:Key="enable">Povoliť</system:String>
4244
<system:String x:Key="disable">Zakázať</system:String>
4345
<system:String x:Key="actionKeywords">Skratka akcie</system:String>
4446
<system:String x:Key="currentActionKeywords">Aktuálna akcia skratky:</system:String>
4547
<system:String x:Key="newActionKeyword">Nová akcia skratky:</system:String>
48+
<system:String x:Key="currentPriority">Aktuálna priorita:</system:String>
49+
<system:String x:Key="newPriority">Nová priorita:</system:String>
4650
<system:String x:Key="pluginDirectory">Priečinok s pluginmi</system:String>
4751
<system:String x:Key="author">Autor</system:String>
4852
<system:String x:Key="plugin_init_time">Príprava:</system:String>
@@ -104,6 +108,10 @@
104108
</system:String>
105109
<system:String x:Key="releaseNotes">Poznámky k vydaniu</system:String>
106110

111+
<!--Priority Setting Dialog-->
112+
<system:String x:Key="priority_tips">Vyššie číslo znamená, že výsledok bude vyššie. Skúste nastaviť napr. 5. Ak chcete, aby boli výsledky nižšie ako ktorékoľvek iné doplnky, zadajte záporné číslo</system:String>
113+
<system:String x:Key="invalidPriority">Prosím, zadajte platné číslo pre prioritu!</system:String>
114+
107115
<!--Action Keyword Setting Dialog-->
108116
<system:String x:Key="oldActionKeywords">Stará skratka akcie</system:String>
109117
<system:String x:Key="newActionKeywords">Nová skratka akcie</system:String>
@@ -116,6 +124,7 @@
116124
<system:String x:Key="actionkeyword_tips">Použite * ak nechcete určiť skratku pre akciu</system:String>
117125

118126
<!--Custom Query Hotkey Dialog-->
127+
<system:String x:Key="customeQueryHotkeyTitle">Vlastná klávesová skratka pre plugin</system:String>
119128
<system:String x:Key="preview">Náhľad</system:String>
120129
<system:String x:Key="hotkeyIsNotUnavailable">Klávesová skratka je nedostupná, prosím, zadajte novú</system:String>
121130
<system:String x:Key="invalidPluginHotkey">Neplatná klávesová skratka pluginu</system:String>
@@ -140,11 +149,23 @@
140149
<system:String x:Key="reportWindow_report_failed">Odoslanie hlásenia zlyhalo</system:String>
141150
<system:String x:Key="reportWindow_flowlauncher_got_an_error">Flow Launcher zaznamenal chybu</system:String>
142151

152+
<!--General Notice-->
153+
<system:String x:Key="pleaseWait">Čakajte, prosím…</system:String>
154+
143155
<!--update-->
144-
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launcher {0}</system:String>
156+
<system:String x:Key="update_flowlauncher_update_check">Kontrolujú sa akutalizácie</system:String>
157+
<system:String x:Key="update_flowlauncher_already_on_latest">Už máte najnovšiu verizu Flow Launchera</system:String>
158+
<system:String x:Key="update_flowlauncher_update_found">Bola nájdená aktualizácia</system:String>
159+
<system:String x:Key="update_flowlauncher_updating">Aktualizuje sa…</system:String>
160+
<system:String x:Key="update_flowlauncher_fail_moving_portable_user_profile_data">Flow Launcher nedokázal presunúť používateľské údaje do aktualizovanej verzie.
161+
Prosím, presuňte profilový priečinok „data“ z {0} do {1}</system:String>
162+
<system:String x:Key="update_flowlauncher_new_update">Nová aktualizácia</system:String>
163+
<system:String x:Key="update_flowlauncher_update_new_version_available">Je dostupná nová verzia Flow Launchera {0}</system:String>
145164
<system:String x:Key="update_flowlauncher_update_error">Počas inštalácie aktualizácií došlo k chybe</system:String>
146165
<system:String x:Key="update_flowlauncher_update">Aktualizovať</system:String>
147166
<system:String x:Key="update_flowlauncher_update_cancel">Zrušiť</system:String>
167+
<system:String x:Key="update_flowlauncher_fail">Aktualizácia zlyhala</system:String>
168+
<system:String x:Key="update_flowlauncher_check_connection">Skontrolujte pripojenie a skúste aktualizovať nastavenia servera proxy na github-cloud.s3.amazonaws.com.</system:String>
148169
<system:String x:Key="update_flowlauncher_update_restart_flowlauncher_tip">Tento upgrade reštartuje Flow Launcher</system:String>
149170
<system:String x:Key="update_flowlauncher_update_upadte_files">Nasledujúce súbory budú aktualizované</system:String>
150171
<system:String x:Key="update_flowlauncher_update_files">Aktualizovať súbory</system:String>

Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Lines changed: 59 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@
77
using Flow.Launcher.Infrastructure.Logger;
88
using Flow.Launcher.Plugin.SharedCommands;
99
using Flow.Launcher.Plugin.Explorer.Search;
10-
using Flow.Launcher.Plugin.Explorer.Search.FolderLinks;
10+
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
1111
using System.Linq;
1212
using MessageBox = System.Windows.Forms.MessageBox;
1313
using MessageBoxIcon = System.Windows.Forms.MessageBoxIcon;
1414
using MessageBoxButton = System.Windows.Forms.MessageBoxButtons;
1515
using DialogResult = System.Windows.Forms.DialogResult;
16+
using Flow.Launcher.Plugin.Explorer.ViewModels;
1617

1718
namespace Flow.Launcher.Plugin.Explorer
1819
{
@@ -22,10 +23,13 @@ internal class ContextMenu : IContextMenu
2223

2324
private Settings Settings { get; set; }
2425

25-
public ContextMenu(PluginInitContext context, Settings settings)
26+
private SettingsViewModel ViewModel { get; set; }
27+
28+
public ContextMenu(PluginInitContext context, Settings settings, SettingsViewModel vm)
2629
{
2730
Context = context;
2831
Settings = settings;
32+
ViewModel = vm;
2933
}
3034

3135
public List<Result> LoadContextMenus(Result selectedResult)
@@ -50,6 +54,58 @@ public List<Result> LoadContextMenus(Result selectedResult)
5054

5155
var icoPath = (record.Type == ResultType.File) ? Constants.FileImagePath : Constants.FolderImagePath;
5256
var fileOrFolder = (record.Type == ResultType.File) ? "file" : "folder";
57+
58+
if (!Settings.QuickAccessLinks.Any(x => x.Path == record.FullPath))
59+
{
60+
contextMenus.Add(new Result
61+
{
62+
Title = Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_title"),
63+
SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_add_to_quickaccess_subtitle"), fileOrFolder),
64+
Action = (context) =>
65+
{
66+
Settings.QuickAccessLinks.Add(new AccessLink { Path = record.FullPath, Type = record.Type });
67+
68+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess"),
69+
string.Format(
70+
Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"),
71+
fileOrFolder),
72+
Constants.ExplorerIconImageFullPath);
73+
74+
ViewModel.Save();
75+
76+
return true;
77+
},
78+
SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"),
79+
TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_titletooltip"),
80+
IcoPath = Constants.QuickAccessImagePath
81+
});
82+
}
83+
else
84+
{
85+
contextMenus.Add(new Result
86+
{
87+
Title = Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_title"),
88+
SubTitle = string.Format(Context.API.GetTranslation("plugin_explorer_remove_from_quickaccess_subtitle"), fileOrFolder),
89+
Action = (context) =>
90+
{
91+
Settings.QuickAccessLinks.Remove(Settings.QuickAccessLinks.FirstOrDefault(x => x.Path == record.FullPath));
92+
93+
Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess"),
94+
string.Format(
95+
Context.API.GetTranslation("plugin_explorer_removefilefoldersuccess_detail"),
96+
fileOrFolder),
97+
Constants.ExplorerIconImageFullPath);
98+
99+
ViewModel.Save();
100+
101+
return true;
102+
},
103+
SubTitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"),
104+
TitleToolTip = Context.API.GetTranslation("plugin_explorer_contextmenu_remove_titletooltip"),
105+
IcoPath = Constants.RemoveQuickAccessImagePath
106+
});
107+
}
108+
53109
contextMenus.Add(new Result
54110
{
55111
Title = Context.API.GetTranslation("plugin_explorer_copypath"),
@@ -228,7 +284,7 @@ private Result CreateAddToIndexSearchExclusionListResult(SearchResult record)
228284
Action = _ =>
229285
{
230286
if(!Settings.IndexSearchExcludedSubdirectoryPaths.Any(x => x.Path == record.FullPath))
231-
Settings.IndexSearchExcludedSubdirectoryPaths.Add(new FolderLink { Path = record.FullPath });
287+
Settings.IndexSearchExcludedSubdirectoryPaths.Add(new AccessLink { Path = record.FullPath });
232288

233289
Task.Run(() =>
234290
{
42.8 KB
Loading
11.3 KB
Loading

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

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<system:String x:Key="plugin_explorer_edit">Edit</system:String>
1717
<system:String x:Key="plugin_explorer_add">Add</system:String>
1818
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
19-
<system:String x:Key="plugin_explorer_quickfolderaccess_header">Quick Folder Access Paths</system:String>
19+
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Links</system:String>
2020
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
2121
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
2222
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search Activation:</system:String>
@@ -42,5 +42,15 @@
4242
<system:String x:Key="plugin_explorer_openindexingoptions">Open Windows Indexing Options</system:String>
4343
<system:String x:Key="plugin_explorer_openindexingoptions_subtitle">Manage indexed files and folders</system:String>
4444
<system:String x:Key="plugin_explorer_openindexingoptions_errormsg">Failed to open Windows Indexing Options</system:String>
45+
<system:String x:Key="plugin_explorer_add_to_quickaccess_title">Add to Quick Access</system:String>
46+
<system:String x:Key="plugin_explorer_add_to_quickaccess_subtitle">Add the current {0} to Quick Access</system:String>
47+
<system:String x:Key="plugin_explorer_addfilefoldersuccess">Successfully Added</system:String>
48+
<system:String x:Key="plugin_explorer_addfilefoldersuccess_detail">Successfully added to Quick Access</system:String>
49+
<system:String x:Key="plugin_explorer_removefilefoldersuccess">Successfully Removed</system:String>
50+
<system:String x:Key="plugin_explorer_removefilefoldersuccess_detail">Successfully removed from Quick Access</system:String>
51+
<system:String x:Key="plugin_explorer_contextmenu_titletooltip">Add to Quick Access so it can be opened with Explorer's Search Activation action keyword</system:String>
52+
<system:String x:Key="plugin_explorer_contextmenu_remove_titletooltip">Remove from Quick Access</system:String>
53+
<system:String x:Key="plugin_explorer_remove_from_quickaccess_title">Remove from Quick Access</system:String>
54+
<system:String x:Key="plugin_explorer_remove_from_quickaccess_subtitle">Remove the current {0} from Quick Access</system:String>
4555

4656
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.Explorer/Main.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
using Flow.Launcher.Infrastructure.Storage;
22
using Flow.Launcher.Plugin.Explorer.Search;
3+
using Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks;
34
using Flow.Launcher.Plugin.Explorer.ViewModels;
45
using Flow.Launcher.Plugin.Explorer.Views;
56
using System.Collections.Generic;
7+
using System.Linq;
68
using System.Threading;
79
using System.Threading.Tasks;
810
using System.Windows.Controls;
@@ -32,7 +34,15 @@ public async Task InitAsync(PluginInitContext context)
3234
viewModel = new SettingsViewModel(context);
3335
await viewModel.LoadStorage();
3436
Settings = viewModel.Settings;
35-
contextMenu = new ContextMenu(Context, Settings);
37+
38+
// as at v1.7.0 this is to maintain backwards compatibility, need to be removed afterwards.
39+
if (Settings.QuickFolderAccessLinks.Any())
40+
{
41+
Settings.QuickAccessLinks = Settings.QuickFolderAccessLinks;
42+
Settings.QuickFolderAccessLinks = new List<AccessLink>();
43+
}
44+
45+
contextMenu = new ContextMenu(Context, Settings, viewModel);
3646
searchManager = new SearchManager(Settings, Context);
3747
}
3848

Plugins/Flow.Launcher.Plugin.Explorer/Search/Constants.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ internal static class Constants
1515
internal const string ExplorerIconImagePath = "Images\\explorer.png";
1616
internal const string DifferentUserIconImagePath = "Images\\user.png";
1717
internal const string IndexingOptionsIconImagePath = "Images\\windowsindexingoptions.png";
18+
internal const string QuickAccessImagePath = "Images\\quickaccess.png";
19+
internal const string RemoveQuickAccessImagePath = "Images\\removequickaccess.png";
1820

1921
internal const string ToolTipOpenDirectory = "Ctrl + Enter to open the directory";
2022

Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/QuickFolderAccess.cs

Lines changed: 0 additions & 36 deletions
This file was deleted.

Plugins/Flow.Launcher.Plugin.Explorer/Search/FolderLinks/FolderLink.cs renamed to Plugins/Flow.Launcher.Plugin.Explorer/Search/QuickAccessLinks/AccessLink.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
using System;
22
using System.Linq;
3-
using System.Text.Json;
43
using System.Text.Json.Serialization;
54

6-
namespace Flow.Launcher.Plugin.Explorer.Search.FolderLinks
5+
namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks
76
{
8-
public class FolderLink
7+
public class AccessLink
98
{
109
public string Path { get; set; }
1110

11+
public ResultType Type { get; set; } = ResultType.Folder;
12+
1213
[JsonIgnore]
1314
public string Nickname
1415
{
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
5+
namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks
6+
{
7+
public class QuickAccess
8+
{
9+
private readonly ResultManager resultManager;
10+
11+
public QuickAccess(PluginInitContext context)
12+
{
13+
resultManager = new ResultManager(context);
14+
}
15+
16+
internal List<Result> AccessLinkListMatched(Query query, List<AccessLink> accessLinks)
17+
{
18+
if (string.IsNullOrEmpty(query.Search))
19+
return new List<Result>();
20+
21+
string search = query.Search.ToLower();
22+
23+
var queriedAccessLinks =
24+
accessLinks
25+
.Where(x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase))
26+
.OrderBy(x => x.Type)
27+
.ThenBy(x => x.Nickname);
28+
29+
return queriedAccessLinks.Select(l => l.Type switch
30+
{
31+
ResultType.Folder => resultManager.CreateFolderResult(l.Nickname, l.Path, l.Path, query),
32+
ResultType.File => resultManager.CreateFileResult(l.Path, query),
33+
_ => throw new ArgumentOutOfRangeException()
34+
35+
}).ToList();
36+
}
37+
38+
internal List<Result> AccessLinkListAll(Query query, List<AccessLink> accessLinks)
39+
=> accessLinks
40+
.OrderBy(x => x.Type)
41+
.ThenBy(x => x.Nickname)
42+
.Select(l => l.Type switch
43+
{
44+
ResultType.Folder => resultManager.CreateFolderResult(l.Nickname, l.Path, l.Path, query),
45+
ResultType.File => resultManager.CreateFileResult(l.Path, query),
46+
_ => throw new ArgumentOutOfRangeException()
47+
48+
}).ToList();
49+
}
50+
}

0 commit comments

Comments
 (0)