Skip to content

Commit 8839f1b

Browse files
committed
add copy notification
1 parent c5be5b8 commit 8839f1b

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

Flow.Launcher/Languages/en.xaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
<system:String x:Key="copy">Copy</system:String>
1919
<system:String x:Key="cut">Cut</system:String>
2020
<system:String x:Key="paste">Paste</system:String>
21+
<system:String x:Key="fileTitle">File</system:String>
22+
<system:String x:Key="folderTitle">Folder</system:String>
23+
<system:String x:Key="textTitle">Text</system:String>
2124
<system:String x:Key="GameMode">Game Mode</system:String>
2225
<system:String x:Key="GameModeToolTip">Suspend the use of Hotkeys.</system:String>
2326

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -890,18 +890,28 @@ public void ResultCopy(string stringToCopy)
890890
if (result != null)
891891
{
892892
string copyText = string.IsNullOrEmpty(result.CopyText) ? result.SubTitle : result.CopyText;
893-
if (File.Exists(copyText) || Directory.Exists(copyText))
893+
var isFile = File.Exists(copyText);
894+
var isFolder = Directory.Exists(copyText);
895+
if (isFile || isFolder)
894896
{
895-
896897
var paths = new StringCollection();
897898
paths.Add(copyText);
898899

899900
Clipboard.SetFileDropList(paths);
900-
901+
App.API.ShowMsg(
902+
App.API.GetTranslation("copy")
903+
+" "
904+
+ (isFile? App.API.GetTranslation("fileTitle") : App.API.GetTranslation("folderTitle")),
905+
App.API.GetTranslation("completedSuccessfully"));
901906
}
902907
else
903908
{
904909
Clipboard.SetDataObject(copyText.ToString());
910+
App.API.ShowMsg(
911+
App.API.GetTranslation("copy")
912+
+ " "
913+
+ App.API.GetTranslation("textTitle"),
914+
App.API.GetTranslation("completedSuccessfully"));
905915
}
906916
}
907917

0 commit comments

Comments
 (0)