polishing changes

This commit is contained in:
Koisu 2025-06-22 13:58:55 -07:00
parent 82823041b2
commit c943982684
4 changed files with 13 additions and 20 deletions

View file

@ -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")
});

View file

@ -30,7 +30,7 @@ namespace Flow.Launcher.Plugin.Explorer.Helper
}
else if (info is DirectoryInfo)
{
var invalidChars = Path.GetInvalidPathChars().ToList();
List<char> invalidChars = Path.GetInvalidPathChars().ToList();
invalidChars.Add('/');
invalidChars.Add('\\');
if (newName.IndexOfAny(invalidChars.ToArray()) >= 0)

View file

@ -199,4 +199,6 @@
<system:String x:Key="plugin_explorer_field_may_not_be_empty">{0} may not be empty.</system:String>
<system:String x:Key="plugin_explorer_invalid_name">{0} is an invalid name.</system:String>
<system:String x:Key="plugin_explorer_file_not_found">The specified file: {0} was not found</system:String>
<system:String x:Key="plugin_explorer_rename_subtitle">Open a dialog to rename this.</system:String>
<system:String x:Key="plugin_explorer_cannot_rename">This cannot be renamed.</system:String>
</ResourceDictionary>

View file

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