From c943982684d643509ef129678e28bf9c98c93352 Mon Sep 17 00:00:00 2001 From: Koisu Date: Sun, 22 Jun 2025 13:58:55 -0700 Subject: [PATCH] polishing changes --- .../ContextMenu.cs | 24 ++++++++----------- .../Helper/RenameThing.cs | 2 +- .../Languages/en.xaml | 2 ++ .../Views/RenameFile.xaml.cs | 5 ---- 4 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs index a84979999..79d133181 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/ContextMenu.cs @@ -192,14 +192,11 @@ namespace Flow.Launcher.Plugin.Explorer }); contextMenus.Add(new Result { - Title = "Rename", - SubTitle = "Opens a dialogue to rename this", + Title = Context.API.GetTranslation("plugin_explorer_rename_a_file"), + SubTitle = Context.API.GetTranslation("plugin_explorer_rename_subtitle"), Action = _ => { - Type T; RenameFile window; - - switch (record.Type) { case ResultType.Folder: @@ -209,19 +206,18 @@ namespace Flow.Launcher.Plugin.Explorer window = new RenameFile(Context.API, new FileInfo(record.FullPath)); break; default: - Context.API.ShowMsgError("Cannot rename this."); + Context.API.ShowMsgError(Context.API.GetTranslation("plugin_explorer_cannot_rename")); return false; - } - - - - - window.ShowDialog(); - + return false; - } + + }, + // placeholder until real image is found + IcoPath = Constants.ShowContextMenuImagePath, + Glyph = new GlyphInfo(FontFamily: "/Resources/#Segoe Fluent Icons", Glyph: "\ue70f") + }); diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs index 1ba6c2709..a337b2dfb 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Helper/RenameThing.cs @@ -30,7 +30,7 @@ namespace Flow.Launcher.Plugin.Explorer.Helper } else if (info is DirectoryInfo) { - var invalidChars = Path.GetInvalidPathChars().ToList(); + List invalidChars = Path.GetInvalidPathChars().ToList(); invalidChars.Add('/'); invalidChars.Add('\\'); if (newName.IndexOfAny(invalidChars.ToArray()) >= 0) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml index 425655f87..688d177ab 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml @@ -199,4 +199,6 @@ {0} may not be empty. {0} is an invalid name. The specified file: {0} was not found + Open a dialog to rename this. + This cannot be renamed. diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Views/RenameFile.xaml.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Views/RenameFile.xaml.cs index deb26ec6c..068015844 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Views/RenameFile.xaml.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Views/RenameFile.xaml.cs @@ -115,11 +115,6 @@ namespace Flow.Launcher.Plugin.Explorer.Views btnDone.Focus(); OnDoneButtonClick(sender, e); e.Handled = true; - } - if (e.Key == Key.Space) - { - e.Handled = true; - } }