mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 10:46:33 +02:00
[AdvancedPaste]Add Semantic Kernel opt-in to allow chaining of paste actions (#35902)
* [AdvancedPaste] Semantic Kernel support * Changed log-line with potentially sensitive info * Spellcheck issues * Various improvements for Semantic Kernel * Spellcheck issue * Refactored Clipboard routines * Added integration tests for KernelService * Extra telemetry for AdvancedPaste * Added 'Hotkey' suffix to AdvancedPaste_Settings telemetry event * Added IsSavedQuery * Added KernelQueryCache * Refactoring * Added KernelQueryCache to BugReportTool delete list * Added opt-n for Semantic Kernel * Fixed bug with KernelQueryCache * Ability to view last AI chat message on error * Improved kernel query cache * Used System.IO.Abstractions and improved tests * Fixed under-count of token usage * Used Semantic Kernel icon * Cleanup * Add missing EndProject line * Fix dependency version conflicts * Fix NOTICE.md * Correct place of SemanticKernel in NOTICE.md * Unlinked CustomPreview toggle from AI * Added Microsoft.Bcl.AsyncInterfaces dependency to AdvancedPaste * Fixed NOTICE.md order * Moved Custom Preview to behaviour section * Made Image to Text raise error on empty output * Added AIServiceBatchIntegrationTests * Updated AIServiceBatchIntegrationTests * Added prompt moderation * Moved GPO Infobar to better location
This commit is contained in:
@@ -53,16 +53,18 @@ namespace Microsoft.PowerToys.Settings.UI.Library.Utilities
|
||||
return sendCustomAction.ToJsonString();
|
||||
}
|
||||
|
||||
public static IFileSystemWatcher GetFileWatcher(string moduleName, string fileName, Action onChangedCallback)
|
||||
public static IFileSystemWatcher GetFileWatcher(string moduleName, string fileName, Action onChangedCallback, IFileSystem fileSystem = null)
|
||||
{
|
||||
var path = FileSystem.Path.Combine(LocalApplicationDataFolder(), $"Microsoft\\PowerToys\\{moduleName}");
|
||||
fileSystem ??= FileSystem;
|
||||
|
||||
if (!FileSystem.Directory.Exists(path))
|
||||
var path = fileSystem.Path.Combine(LocalApplicationDataFolder(), $"Microsoft\\PowerToys\\{moduleName}");
|
||||
|
||||
if (!fileSystem.Directory.Exists(path))
|
||||
{
|
||||
FileSystem.Directory.CreateDirectory(path);
|
||||
fileSystem.Directory.CreateDirectory(path);
|
||||
}
|
||||
|
||||
var watcher = FileSystem.FileSystemWatcher.New();
|
||||
var watcher = fileSystem.FileSystemWatcher.New();
|
||||
watcher.Path = path;
|
||||
watcher.Filter = fileName;
|
||||
watcher.NotifyFilter = NotifyFilters.LastWrite;
|
||||
|
||||
Reference in New Issue
Block a user