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
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.5" />
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.6" />
<PackageReference Include="Microsoft.Data.Sqlite" Version="9.0.9" />
<PackageReference Include="Svg.Skia" Version="3.0.6" />
<PackageReference Include="SkiaSharp" Version="3.119.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.5" />
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.6" />
<PackageReference Include="Mages" Version="3.0.0" />
</ItemGroup>

Expand Down
114 changes: 52 additions & 62 deletions Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.0" />
<PackageReference Include="Droplex" Version="1.7.0" />
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.5" />
<PackageReference Include="Flow.Launcher.Localization" Version="0.0.6" />
<PackageReference Include="System.Data.OleDb" Version="9.0.9" />
<PackageReference Include="System.Linq.Async" Version="6.0.3" />
<PackageReference Include="tlbimp-Microsoft.Search.Interop" Version="1.0.0" />
Expand Down
1 change: 1 addition & 0 deletions Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<system:String x:Key="plugin_explorer_directoryinfosearch_error">Error occurred during search: {0}</system:String>
<system:String x:Key="plugin_explorer_opendir_error">Could not open folder</system:String>
<system:String x:Key="plugin_explorer_openfile_error">Could not open file</system:String>
<system:String x:Key="plugin_explorer_new_action_keyword_assigned">This new action keyword is already assigned to another plugin, please choose a different one</system:String>

<!-- Controls -->
<system:String x:Key="plugin_explorer_delete">Delete</system:String>
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Explorer/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ public async Task<List<Result>> QueryAsync(Query query, CancellationToken token)

public string GetTranslatedPluginTitle()
{
return Context.API.GetTranslation("plugin_explorer_plugin_name");
return Localize.plugin_explorer_plugin_name();
}

public string GetTranslatedPluginDescription()
{
return Context.API.GetTranslation("plugin_explorer_plugin_description");
return Localize.plugin_explorer_plugin_description();
}

public void OnCultureInfoChanged(CultureInfo newCulture)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ public static async Task<string> PromptDownloadIfNotInstallAsync(string installe
if (string.IsNullOrEmpty(installedLocation))
{
if (api.ShowMsgBox(
string.Format(api.GetTranslation("flowlauncher_plugin_everything_installing_select"), Environment.NewLine),
api.GetTranslation("flowlauncher_plugin_everything_installing_title"),
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
Localize.flowlauncher_plugin_everything_installing_select(Environment.NewLine),
Localize.flowlauncher_plugin_everything_installing_title(),
MessageBoxButton.YesNo) == MessageBoxResult.Yes)
{
var dlg = new System.Windows.Forms.OpenFileDialog
{
Expand All @@ -41,13 +41,13 @@ public static async Task<string> PromptDownloadIfNotInstallAsync(string installe
return installedLocation;
}

api.ShowMsg(api.GetTranslation("flowlauncher_plugin_everything_installing_title"),
api.GetTranslation("flowlauncher_plugin_everything_installing_subtitle"), "", useMainWindowAsOwner: false);
api.ShowMsg(Localize.flowlauncher_plugin_everything_installing_title(),
Localize.flowlauncher_plugin_everything_installing_subtitle(), "", useMainWindowAsOwner: false);

await DroplexPackage.Drop(App.Everything1_4_1_1009).ConfigureAwait(false);

api.ShowMsg(api.GetTranslation("flowlauncher_plugin_everything_installing_title"),
api.GetTranslation("flowlauncher_plugin_everything_installationsuccess_subtitle"), "", useMainWindowAsOwner: false);
api.ShowMsg(Localize.flowlauncher_plugin_everything_installing_title(),
Localize.flowlauncher_plugin_everything_installationsuccess_subtitle(), "", useMainWindowAsOwner: false);

installedLocation = "C:\\Program Files\\Everything\\Everything.exe";

Expand Down Expand Up @@ -83,6 +83,5 @@ internal static string GetInstalledPath()

var scoopInstalledPath = Environment.ExpandEnvironmentVariables(@"%userprofile%\scoop\apps\everything\current\Everything.exe");
return File.Exists(scoopInstalledPath) ? scoopInstalledPath : string.Empty;

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken tok
if (!await EverythingApi.IsEverythingRunningAsync(token))
throw new EngineNotAvailableException(
Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_click_to_launch_or_install"),
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_is_not_running"),
Localize.flowlauncher_plugin_everything_click_to_launch_or_install(),
Localize.flowlauncher_plugin_everything_is_not_running(),
Constants.EverythingErrorImagePath,
ClickToInstallEverythingAsync);
}
Expand All @@ -38,7 +38,7 @@ private async ValueTask ThrowIfEverythingNotAvailableAsync(CancellationToken tok
Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
"Please check whether your system is x86 or x64",
Constants.GeneralSearchErrorImagePath,
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_sdk_issue"));
Localize.flowlauncher_plugin_everything_sdk_issue());
}
}

Expand All @@ -50,7 +50,7 @@ private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)

if (installedPath == null)
{
Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_not_found"));
Main.Context.API.ShowMsgError(Localize.flowlauncher_plugin_everything_not_found());
Main.Context.API.LogError(ClassName, "Unable to find Everything.exe");

return false;
Expand All @@ -65,7 +65,7 @@ private async ValueTask<bool> ClickToInstallEverythingAsync(ActionContext _)
// Just let the user know that Everything is not installed properly and ask them to install it manually
catch (Exception e)
{
Main.Context.API.ShowMsgError(Main.Context.API.GetTranslation("flowlauncher_plugin_everything_install_issue"));
Main.Context.API.ShowMsgError(Localize.flowlauncher_plugin_everything_install_issue());
Main.Context.API.LogException(ClassName, "Failed to install Everything", e);

return false;
Expand Down Expand Up @@ -97,8 +97,8 @@ public async IAsyncEnumerable<SearchResult> ContentSearchAsync(string plainSearc
if (!Settings.EnableEverythingContentSearch)
{
throw new EngineNotAvailableException(Enum.GetName(Settings.IndexSearchEngineOption.Everything)!,
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search"),
Main.Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search_tips"),
Localize.flowlauncher_plugin_everything_enable_content_search(),
Localize.flowlauncher_plugin_everything_enable_content_search_tips(),
Constants.EverythingErrorImagePath,
_ =>
{
Expand Down
29 changes: 13 additions & 16 deletions Plugins/Flow.Launcher.Plugin.Explorer/Search/ResultManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
Expand Down Expand Up @@ -124,7 +124,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
}
catch (Exception ex)
{
Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error"));
Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error());
return false;
}
}
Expand All @@ -138,7 +138,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
}
catch (Exception ex)
{
Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error"));
Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error());
return false;
}
}
Expand All @@ -153,7 +153,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
}
catch (Exception ex)
{
Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_opendir_error"));
Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_opendir_error());
return false;
}
}
Expand All @@ -166,7 +166,7 @@ internal static Result CreateFolderResult(string title, string subtitle, string
return false;
},
Score = score,
TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenDirectory"),
TitleToolTip = Localize.plugin_explorer_plugin_ToolTipOpenDirectory(),
SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFolderMoreInfoTooltip(path) : path,
ContextData = new SearchResult { Type = ResultType.Folder, FullPath = path, WindowsIndexed = windowsIndexed }
};
Expand All @@ -190,7 +190,7 @@ private static Result CreateDriveSpaceDisplayResult(string path, string actionKe
DriveInfo drv = new DriveInfo(driveLetter);
var freespace = ToReadableSize(drv.AvailableFreeSpace, 2);
var totalspace = ToReadableSize(drv.TotalSize, 2);
var subtitle = string.Format(Context.API.GetTranslation("plugin_explorer_diskfreespace"), freespace, totalspace);
var subtitle = Localize.plugin_explorer_diskfreespace(freespace, totalspace);
double usingSize = (Convert.ToDouble(drv.TotalSize) - Convert.ToDouble(drv.AvailableFreeSpace)) / Convert.ToDouble(drv.TotalSize) * 100;

int? progressValue = Convert.ToInt32(usingSize);
Expand Down Expand Up @@ -262,8 +262,8 @@ internal static Result CreateOpenCurrentFolderResult(string path, string actionK

return new Result
{
Title = Context.API.GetTranslation("plugin_explorer_openresultfolder"),
SubTitle = Context.API.GetTranslation("plugin_explorer_openresultfolder_subtitle"),
Title = Localize.plugin_explorer_openresultfolder(),
SubTitle = Localize.plugin_explorer_openresultfolder_subtitle(),
AutoCompleteText = GetPathWithActionKeyword(folderPath, ResultType.Folder, actionKeyword),
IcoPath = folderPath,
Score = 500,
Expand Down Expand Up @@ -330,12 +330,12 @@ internal static Result CreateFileResult(string filePath, Query query, int score
}
catch (Exception ex)
{
Context.API.ShowMsgBox(ex.Message, Context.API.GetTranslation("plugin_explorer_openfile_error"));
Context.API.ShowMsgBox(ex.Message, Localize.plugin_explorer_openfile_error());
}

return true;
},
TitleToolTip = Main.Context.API.GetTranslation("plugin_explorer_plugin_ToolTipOpenContainingFolder"),
TitleToolTip = Localize.plugin_explorer_plugin_ToolTipOpenContainingFolder(),
SubTitleToolTip = Settings.DisplayMoreInformationInToolTip ? GetFileMoreInfoTooltip(filePath) : filePath,
ContextData = new SearchResult { Type = ResultType.File, FullPath = filePath, WindowsIndexed = windowsIndexed }
};
Expand Down Expand Up @@ -374,8 +374,7 @@ private static string GetFileMoreInfoTooltip(string filePath)
var fileSize = PreviewPanel.GetFileSize(filePath);
var fileCreatedAt = PreviewPanel.GetFileCreatedAt(filePath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel);
var fileModifiedAt = PreviewPanel.GetFileLastModifiedAt(filePath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel);
return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info"),
filePath, fileSize, fileCreatedAt, fileModifiedAt, Environment.NewLine);
return Localize.plugin_explorer_plugin_tooltip_more_info(filePath, fileSize, fileCreatedAt, fileModifiedAt, Environment.NewLine);
}
catch (Exception e)
{
Expand All @@ -391,8 +390,7 @@ private static string GetFolderMoreInfoTooltip(string folderPath)
var folderSize = PreviewPanel.GetFolderSize(folderPath);
var folderCreatedAt = PreviewPanel.GetFolderCreatedAt(folderPath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel);
var folderModifiedAt = PreviewPanel.GetFolderLastModifiedAt(folderPath, Settings.PreviewPanelDateFormat, Settings.PreviewPanelTimeFormat, Settings.ShowFileAgeInPreviewPanel);
return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info"),
folderPath, folderSize, folderCreatedAt, folderModifiedAt, Environment.NewLine);
return Localize.plugin_explorer_plugin_tooltip_more_info(folderPath, folderSize, folderCreatedAt, folderModifiedAt, Environment.NewLine);
}
catch (Exception e)
{
Expand All @@ -403,8 +401,7 @@ private static string GetFolderMoreInfoTooltip(string folderPath)

private static string GetVolumeMoreInfoTooltip(string volumePath, string freespace, string totalspace)
{
return string.Format(Context.API.GetTranslation("plugin_explorer_plugin_tooltip_more_info_volume"),
volumePath, freespace, totalspace, Environment.NewLine);
return Localize.plugin_explorer_plugin_tooltip_more_info_volume(volumePath, freespace, totalspace, Environment.NewLine);
}

private static readonly string[] MediaExtensions =
Expand Down
4 changes: 2 additions & 2 deletions Plugins/Flow.Launcher.Plugin.Explorer/Search/SearchManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ private List<Result> EverythingContentSearchResult(Query query)
{
new()
{
Title = Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search"),
SubTitle = Context.API.GetTranslation("flowlauncher_plugin_everything_enable_content_search_tips"),
Title = Localize.flowlauncher_plugin_everything_enable_content_search(),
SubTitle = Localize.flowlauncher_plugin_everything_enable_content_search_tips(),
IcoPath = "Images/index_error.png",
Action = c =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ private IAsyncEnumerable<SearchResult> HandledEngineNotAvailableExceptionAsync()

throw new EngineNotAvailableException(
"Windows Index",
Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceFix"),
Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceNotRunning"),
Localize.plugin_explorer_windowsSearchServiceFix(),
Localize.plugin_explorer_windowsSearchServiceNotRunning(),
Constants.WindowsIndexErrorImagePath,
c =>
{
Expand Down
9 changes: 3 additions & 6 deletions Plugins/Flow.Launcher.Plugin.Explorer/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ public class Settings
{
public int MaxResult { get; set; } = 100;

public ObservableCollection<AccessLink> QuickAccessLinks { get; set; } = new();
public ObservableCollection<AccessLink> QuickAccessLinks { get; set; } = [];

public ObservableCollection<AccessLink> IndexSearchExcludedSubdirectoryPaths { get; set; } = new ObservableCollection<AccessLink>();
public ObservableCollection<AccessLink> IndexSearchExcludedSubdirectoryPaths { get; set; } = [];

public string EditorPath { get; set; } = "";

Expand Down Expand Up @@ -58,7 +58,6 @@ public class Settings

public bool QuickAccessKeywordEnabled { get; set; }


public bool WarnWindowsSearchServiceOff { get; set; } = true;

public bool ShowFileSizeInPreviewPanel { get; set; } = true;
Expand All @@ -69,7 +68,6 @@ public class Settings

public bool ShowFileAgeInPreviewPanel { get; set; } = false;


public string PreviewPanelDateFormat { get; set; } = "yyyy-MM-dd";

public string PreviewPanelTimeFormat { get; set; } = "HH:mm";
Expand All @@ -82,8 +80,8 @@ public class Settings
private EverythingSearchManager EverythingManagerInstance => _everythingManagerInstance ??= new EverythingSearchManager(this);
private WindowsIndexSearchManager WindowsIndexSearchManager => _windowsIndexSearchManager ??= new WindowsIndexSearchManager(this);


public IndexSearchEngineOption IndexSearchEngine { get; set; } = IndexSearchEngineOption.WindowsIndex;

[JsonIgnore]
public IIndexProvider IndexProvider => IndexSearchEngine switch
{
Expand Down Expand Up @@ -139,7 +137,6 @@ public enum ContentIndexSearchEngineOption

#endregion


#region Everything Settings

public string EverythingInstalledPath { get; set; }
Expand Down
Loading
Loading