mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
add option to suppress notification when calling copy
This commit is contained in:
parent
2b862f702a
commit
6f7c3eba4d
3 changed files with 14 additions and 10 deletions
|
|
@ -46,7 +46,10 @@ namespace Flow.Launcher.Plugin
|
|||
/// </summary>
|
||||
/// <param name="text">Text to save on clipboard</param>
|
||||
/// <param name="directCopy">When true it will directly copy the file/folder from the path specified in text</param>
|
||||
public void CopyToClipboard(string text, bool directCopy = false);
|
||||
/// <param name="showDefaultNotification">Whether to show the default notification from this method after copy is done.
|
||||
/// It will show file/folder/text is copied successfully.
|
||||
/// Turn this off to show your own notification after copy is done.</param>>
|
||||
public void CopyToClipboard(string text, bool directCopy = false, bool showDefaultNotification = true);
|
||||
|
||||
/// <summary>
|
||||
/// Save everything, all of Flow Launcher and plugins' data and settings
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ namespace Flow.Launcher
|
|||
}
|
||||
else if (!string.IsNullOrEmpty(QueryTextBox.Text))
|
||||
{
|
||||
System.Windows.Clipboard.SetDataObject(QueryTextBox.SelectedText);
|
||||
App.API.CopyToClipboard(QueryTextBox.SelectedText, showDefaultNotification: false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ namespace Flow.Launcher
|
|||
ShellCommand.Execute(startInfo);
|
||||
}
|
||||
|
||||
public void CopyToClipboard(string stringToCopy, bool directCopy = false)
|
||||
public void CopyToClipboard(string stringToCopy, bool directCopy = false, bool showDefaultNotification = true)
|
||||
{
|
||||
if (string.IsNullOrEmpty(stringToCopy))
|
||||
return;
|
||||
|
|
@ -132,20 +132,21 @@ namespace Flow.Launcher
|
|||
|
||||
Clipboard.SetFileDropList(paths);
|
||||
|
||||
ShowMsg(
|
||||
$"{GetTranslation("copy")} {(isFile ? GetTranslation("fileTitle") : GetTranslation("folderTitle"))}",
|
||||
GetTranslation("completedSuccessfully"));
|
||||
if (showDefaultNotification)
|
||||
ShowMsg(
|
||||
$"{GetTranslation("copy")} {(isFile ? GetTranslation("fileTitle") : GetTranslation("folderTitle"))}",
|
||||
GetTranslation("completedSuccessfully"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Clipboard.SetDataObject(stringToCopy);
|
||||
|
||||
ShowMsg(
|
||||
$"{GetTranslation("copy")} {GetTranslation("textTitle")}",
|
||||
GetTranslation("completedSuccessfully"));
|
||||
if (showDefaultNotification)
|
||||
ShowMsg(
|
||||
$"{GetTranslation("copy")} {GetTranslation("textTitle")}",
|
||||
GetTranslation("completedSuccessfully"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void StartLoadingBar() => _mainVM.ProgressBarVisibility = Visibility.Visible;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue