From 702a1513b2c8cd38cef2d6fa023d11dfb80d6b18 Mon Sep 17 00:00:00 2001
From: Garulf <535299+Garulf@users.noreply.github.com>
Date: Tue, 30 Nov 2021 04:14:03 -0500
Subject: [PATCH 1/3] Add clipboard function
---
Flow.Launcher/PublicAPIInstance.cs | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index 49788bfac..de24be6d5 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -114,6 +114,11 @@ namespace Flow.Launcher
var startInfo = ShellCommand.SetProcessStartInfo(filename, arguments: args, createNoWindow: true);
ShellCommand.Execute(startInfo);
}
+
+ public void CopyToClipboard(string text)
+ {
+ Clipboard.SetText(text);
+ }
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
@@ -222,4 +227,4 @@ namespace Flow.Launcher
#endregion
}
-}
\ No newline at end of file
+}
From b0b4bffda4449e4f6058f0b7c782c10d35bc3a66 Mon Sep 17 00:00:00 2001
From: Garulf <535299+Garulf@users.noreply.github.com>
Date: Tue, 30 Nov 2021 04:15:55 -0500
Subject: [PATCH 2/3] Add clipboard function
---
Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
index 908284bb9..0b59371f8 100644
--- a/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
+++ b/Flow.Launcher.Plugin/Interfaces/IPublicAPI.cs
@@ -37,6 +37,12 @@ namespace Flow.Launcher.Plugin
/// Thrown when unable to find the file specified in the command
/// Thrown when error occurs during the execution of the command
void ShellRun(string cmd, string filename = "cmd.exe");
+
+ ///
+ /// Copy Text to clipboard
+ ///
+ /// Text to save on clipboard
+ public void CopyToClipboard(string text);
///
/// Save everything, all of Flow Launcher and plugins' data and settings
From 17bcb27a4916a14723dfbefa100a362a7f6f9f23 Mon Sep 17 00:00:00 2001
From: Garulf <535299+Garulf@users.noreply.github.com>
Date: Tue, 30 Nov 2021 05:18:06 -0500
Subject: [PATCH 3/3] Use Clipboard.SetDataObject()
---
Flow.Launcher/PublicAPIInstance.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Flow.Launcher/PublicAPIInstance.cs b/Flow.Launcher/PublicAPIInstance.cs
index de24be6d5..eb62733b7 100644
--- a/Flow.Launcher/PublicAPIInstance.cs
+++ b/Flow.Launcher/PublicAPIInstance.cs
@@ -117,7 +117,7 @@ namespace Flow.Launcher
public void CopyToClipboard(string text)
{
- Clipboard.SetText(text);
+ Clipboard.SetDataObject(text);
}
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;