From f760ed9d3454e75d30e1d9ea77c9647282cdb900 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Pol=C3=A1=C5=A1ek?= Date: Wed, 3 Sep 2025 22:37:38 +0200 Subject: [PATCH] CmdPal: Add option to Clipboard History extension to keep item after pasting (#41444) ## Summary of the Pull Request This PR introduces a new toggle in the Clipboard History extension settings that allows items to remain in history after being pasted into another application. It also adds a separate menu item to remove items from history manually. Item deletion is protected by a confirmation prompt, which can be disabled in the settings. Additionally, it introduces a shared `ConfirmableCommand` that can wrap any command with a confirmation prompt. Pictures? Pictures! image image image ## PR Checklist - [x] Closes: #41433 - [ ] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [ ] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments ## Validation Steps Performed --- .../Commands/ConfirmableCommand.cs | 155 ++++++++++++++++++ .../ClipboardHistoryCommandsProvider.cs | 9 +- .../Commands/DeleteItemCommand.cs | 31 ++++ .../Commands/PasteCommand.cs | 11 +- .../Helpers/ISettingOptions.cs | 12 ++ .../Helpers/SettingsManager.cs | 54 ++++++ .../Icons.cs | 2 + .../KeyChords.cs | 19 +++ .../Models/ClipboardItem.cs | 31 +++- .../Pages/ClipboardHistoryListPage.cs | 11 +- .../Properties/Resources.Designer.cs | 72 ++++++++ .../Properties/Resources.resx | 24 +++ 12 files changed, 420 insertions(+), 11 deletions(-) create mode 100644 src/modules/cmdpal/Microsoft.CmdPal.Common/Commands/ConfirmableCommand.cs create mode 100644 src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/DeleteItemCommand.cs create mode 100644 src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/ISettingOptions.cs create mode 100644 src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/SettingsManager.cs create mode 100644 src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/KeyChords.cs diff --git a/src/modules/cmdpal/Microsoft.CmdPal.Common/Commands/ConfirmableCommand.cs b/src/modules/cmdpal/Microsoft.CmdPal.Common/Commands/ConfirmableCommand.cs new file mode 100644 index 0000000000..c2748b6f6a --- /dev/null +++ b/src/modules/cmdpal/Microsoft.CmdPal.Common/Commands/ConfirmableCommand.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Diagnostics.CodeAnalysis; +using Microsoft.CommandPalette.Extensions; +using Microsoft.CommandPalette.Extensions.Toolkit; + +namespace Microsoft.CmdPal.Common.Commands; + +public sealed partial class ConfirmableCommand : InvokableCommand +{ + private readonly IInvokableCommand? _command; + + public Func? IsConfirmationRequired { get; init; } + + public required string ConfirmationTitle { get; init; } + + public required string ConfirmationMessage { get; init; } + + public required IInvokableCommand Command + { + get => _command!; + init + { + if (_command is INotifyPropChanged oldNotifier) + { + oldNotifier.PropChanged -= InnerCommand_PropChanged; + } + + _command = value; + + if (_command is INotifyPropChanged notifier) + { + notifier.PropChanged += InnerCommand_PropChanged; + } + + OnPropertyChanged(nameof(Name)); + OnPropertyChanged(nameof(Id)); + OnPropertyChanged(nameof(Icon)); + } + } + + public override string Name + { + get => (_command as Command)?.Name ?? base.Name; + set + { + if (_command is Command cmd) + { + cmd.Name = value; + } + else + { + base.Name = value; + } + } + } + + public override string Id + { + get => (_command as Command)?.Id ?? base.Id; + set + { + var previous = Id; + if (_command is Command cmd) + { + cmd.Id = value; + } + else + { + base.Id = value; + } + + if (previous != Id) + { + OnPropertyChanged(nameof(Id)); + } + } + } + + public override IconInfo Icon + { + get => (_command as Command)?.Icon ?? base.Icon; + set + { + if (_command is Command cmd) + { + cmd.Icon = value; + } + else + { + base.Icon = value; + } + } + } + + public ConfirmableCommand() + { + // Allow init-only construction + } + + [SetsRequiredMembers] + public ConfirmableCommand(IInvokableCommand command, string confirmationTitle, string confirmationMessage, Func? isConfirmationRequired = null) + { + ArgumentNullException.ThrowIfNull(command); + ArgumentException.ThrowIfNullOrWhiteSpace(confirmationMessage); + ArgumentNullException.ThrowIfNull(confirmationMessage); + + IsConfirmationRequired = isConfirmationRequired; + ConfirmationTitle = confirmationTitle; + ConfirmationMessage = confirmationMessage; + Command = command; + } + + private void InnerCommand_PropChanged(object sender, IPropChangedEventArgs args) + { + var property = args.PropertyName; + + if (string.IsNullOrEmpty(property) || property == nameof(Name)) + { + OnPropertyChanged(nameof(Name)); + } + + if (string.IsNullOrEmpty(property) || property == nameof(Id)) + { + OnPropertyChanged(nameof(Id)); + } + + if (string.IsNullOrEmpty(property) || property == nameof(Icon)) + { + OnPropertyChanged(nameof(Icon)); + } + } + + public override ICommandResult Invoke() + { + var showConfirmationDialog = IsConfirmationRequired?.Invoke() ?? true; + if (showConfirmationDialog) + { + return CommandResult.Confirm(new ConfirmationArgs + { + Title = ConfirmationTitle, + Description = ConfirmationMessage, + PrimaryCommand = Command, + IsPrimaryCommandCritical = true, + }); + } + else + { + return Command.Invoke(this) ?? CommandResult.Dismiss(); + } + } +} diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/ClipboardHistoryCommandsProvider.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/ClipboardHistoryCommandsProvider.cs index c15658c96c..d88bffc9e0 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/ClipboardHistoryCommandsProvider.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/ClipboardHistoryCommandsProvider.cs @@ -2,6 +2,7 @@ // The Microsoft Corporation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. +using Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; using Microsoft.CmdPal.Ext.ClipboardHistory.Pages; using Microsoft.CommandPalette.Extensions; using Microsoft.CommandPalette.Extensions.Toolkit; @@ -11,19 +12,25 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory; public partial class ClipboardHistoryCommandsProvider : CommandProvider { private readonly ListItem _clipboardHistoryListItem; + private readonly SettingsManager _settingsManager = new(); public ClipboardHistoryCommandsProvider() { - _clipboardHistoryListItem = new ListItem(new ClipboardHistoryListPage()) + _clipboardHistoryListItem = new ListItem(new ClipboardHistoryListPage(_settingsManager)) { Title = Properties.Resources.list_item_title, Subtitle = Properties.Resources.list_item_subtitle, Icon = Icons.ClipboardListIcon, + MoreCommands = [ + new CommandContextItem(_settingsManager.Settings.SettingsPage), + ], }; DisplayName = Properties.Resources.provider_display_name; Icon = Icons.ClipboardListIcon; Id = "Windows.ClipboardHistory"; + + Settings = _settingsManager.Settings; } public override IListItem[] TopLevelCommands() diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/DeleteItemCommand.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/DeleteItemCommand.cs new file mode 100644 index 0000000000..e6b028f820 --- /dev/null +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/DeleteItemCommand.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using Microsoft.CmdPal.Ext.ClipboardHistory.Models; +using Microsoft.CommandPalette.Extensions.Toolkit; +using Windows.ApplicationModel.DataTransfer; + +namespace Microsoft.CmdPal.Ext.ClipboardHistory.Commands; + +internal sealed partial class DeleteItemCommand : InvokableCommand +{ + private readonly ClipboardItem _clipboardItem; + + internal DeleteItemCommand(ClipboardItem clipboardItem) + { + _clipboardItem = clipboardItem; + Name = Properties.Resources.delete_command_name; + Icon = Icons.DeleteIcon; + } + + public override CommandResult Invoke() + { + Clipboard.DeleteItemFromHistory(_clipboardItem.Item); + return CommandResult.ShowToast(new ToastArgs + { + Message = Properties.Resources.delete_toast_text, + Result = CommandResult.KeepOpen(), + }); + } +} diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/PasteCommand.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/PasteCommand.cs index 87f5fe1633..76f8db9b62 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/PasteCommand.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Commands/PasteCommand.cs @@ -4,6 +4,7 @@ using CommunityToolkit.Mvvm.Messaging; using Microsoft.CmdPal.Common.Messages; +using Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; using Microsoft.CmdPal.Ext.ClipboardHistory.Models; using Microsoft.CommandPalette.Extensions.Toolkit; using Windows.ApplicationModel.DataTransfer; @@ -14,11 +15,13 @@ internal sealed partial class PasteCommand : InvokableCommand { private readonly ClipboardItem _clipboardItem; private readonly ClipboardFormat _clipboardFormat; + private readonly ISettingOptions _settings; - internal PasteCommand(ClipboardItem clipboardItem, ClipboardFormat clipboardFormat) + internal PasteCommand(ClipboardItem clipboardItem, ClipboardFormat clipboardFormat, ISettingOptions settings) { _clipboardItem = clipboardItem; _clipboardFormat = clipboardFormat; + _settings = settings; Name = Properties.Resources.paste_command_name; Icon = Icons.PasteIcon; } @@ -39,7 +42,11 @@ internal sealed partial class PasteCommand : InvokableCommand ClipboardHelper.SendPasteKeyCombination(); - Clipboard.DeleteItemFromHistory(_clipboardItem.Item); + if (!_settings.KeepAfterPaste) + { + Clipboard.DeleteItemFromHistory(_clipboardItem.Item); + } + return CommandResult.ShowToast(Properties.Resources.paste_toast_text); } } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/ISettingOptions.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/ISettingOptions.cs new file mode 100644 index 0000000000..b98c7c0d83 --- /dev/null +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/ISettingOptions.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; + +public interface ISettingOptions +{ + bool KeepAfterPaste { get; } + + bool DeleteFromHistoryRequiresConfirmation { get; } +} diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/SettingsManager.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/SettingsManager.cs new file mode 100644 index 0000000000..6ccc987d52 --- /dev/null +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Helpers/SettingsManager.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.IO; +using Microsoft.CmdPal.Ext.ClipboardHistory.Properties; +using Microsoft.CommandPalette.Extensions.Toolkit; + +namespace Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; + +internal sealed class SettingsManager : JsonSettingsManager, ISettingOptions +{ + private const string Namespace = "clipboardHistory"; + + private static string Namespaced(string propertyName) => $"{Namespace}.{propertyName}"; + + private readonly ToggleSetting _keepAfterPaste = new( + Namespaced(nameof(KeepAfterPaste)), + Resources.settings_keep_after_paste_title!, + Resources.settings_keep_after_paste_description!, + false); + + private readonly ToggleSetting _confirmDelete = new( + Namespaced(nameof(DeleteFromHistoryRequiresConfirmation)), + Resources.settings_confirm_delete_title!, + Resources.settings_confirm_delete_description!, + true); + + public bool KeepAfterPaste => _keepAfterPaste.Value; + + public bool DeleteFromHistoryRequiresConfirmation => _confirmDelete.Value; + + private static string SettingsJsonPath() + { + var directory = Utilities.BaseSettingsPath("Microsoft.CmdPal"); + Directory.CreateDirectory(directory); + + // now, the state is just next to the exe + return Path.Combine(directory, "settings.json"); + } + + public SettingsManager() + { + FilePath = SettingsJsonPath(); + + Settings.Add(_keepAfterPaste); + Settings.Add(_confirmDelete); + + // Load settings from file upon initialization + LoadSettings(); + + Settings.SettingsChanged += (_, _) => SaveSettings(); + } +} diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Icons.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Icons.cs index be7533d569..824a6a2233 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Icons.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Icons.cs @@ -14,5 +14,7 @@ internal sealed class Icons internal static IconInfo PasteIcon { get; } = new("\uE77F"); + internal static IconInfo DeleteIcon { get; } = new("\uE74D"); + internal static IconInfo ClipboardListIcon { get; } = IconHelpers.FromRelativePath("Assets\\ClipboardHistory.svg"); } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/KeyChords.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/KeyChords.cs new file mode 100644 index 0000000000..5d59d0d1f2 --- /dev/null +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/KeyChords.cs @@ -0,0 +1,19 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.CommandPalette.Extensions; +using Microsoft.CommandPalette.Extensions.Toolkit; +using Windows.System; + +namespace Microsoft.CmdPal.Ext.ClipboardHistory; + +internal static class KeyChords +{ + internal static KeyChord DeleteEntry { get; } = KeyChordHelpers.FromModifiers(ctrl: true, shift: true, vkey: VirtualKey.Delete); +} diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Models/ClipboardItem.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Models/ClipboardItem.cs index ec01883b87..dd66410e6d 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Models/ClipboardItem.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Models/ClipboardItem.cs @@ -7,7 +7,9 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Linq; +using Microsoft.CmdPal.Common.Commands; using Microsoft.CmdPal.Ext.ClipboardHistory.Commands; +using Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; using Microsoft.CommandPalette.Extensions.Toolkit; using Windows.ApplicationModel.DataTransfer; using Windows.Storage.Streams; @@ -16,9 +18,11 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory.Models; public class ClipboardItem { - public string? Content { get; set; } + public string? Content { get; init; } - public required ClipboardHistoryItem Item { get; set; } + public required ClipboardHistoryItem Item { get; init; } + + public required ISettingOptions Settings { get; init; } public DateTimeOffset Timestamp => Item?.Timestamp ?? DateTimeOffset.MinValue; @@ -87,6 +91,19 @@ public class ClipboardItem Data = new DetailsLink(Item.Timestamp.DateTime.ToString(DateTimeFormatInfo.CurrentInfo)), }); + var deleteConfirmationCommand = new ConfirmableCommand() + { + Command = new DeleteItemCommand(this), + ConfirmationTitle = Properties.Resources.delete_confirmation_title!, + ConfirmationMessage = Properties.Resources.delete_confirmation_message!, + IsConfirmationRequired = () => Settings.DeleteFromHistoryRequiresConfirmation, + }; + var deleteContextMenuItem = new CommandContextItem(deleteConfirmationCommand) + { + IsCritical = true, + RequestedShortcut = KeyChords.DeleteEntry, + }; + if (IsImage) { var iconData = new IconData(ImageData); @@ -103,7 +120,9 @@ public class ClipboardItem Metadata = metadata.ToArray(), }, MoreCommands = [ - new CommandContextItem(new PasteCommand(this, ClipboardFormat.Image)) + new CommandContextItem(new PasteCommand(this, ClipboardFormat.Image, Settings)), + new Separator(), + deleteContextMenuItem, ], }; } @@ -126,8 +145,10 @@ public class ClipboardItem Metadata = metadata.ToArray(), }, MoreCommands = [ - new CommandContextItem(new PasteCommand(this, ClipboardFormat.Text)), - ], + new CommandContextItem(new PasteCommand(this, ClipboardFormat.Text, Settings)), + new Separator(), + deleteContextMenuItem, + ], }; } else diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Pages/ClipboardHistoryListPage.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Pages/ClipboardHistoryListPage.cs index b6b72afba3..c0d564eb5e 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Pages/ClipboardHistoryListPage.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Pages/ClipboardHistoryListPage.cs @@ -7,6 +7,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Threading; using System.Threading.Tasks; +using Microsoft.CmdPal.Ext.ClipboardHistory.Helpers; using Microsoft.CmdPal.Ext.ClipboardHistory.Models; using Microsoft.CommandPalette.Extensions; using Microsoft.CommandPalette.Extensions.Toolkit; @@ -17,11 +18,15 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory.Pages; internal sealed partial class ClipboardHistoryListPage : ListPage { + private readonly SettingsManager _settingsManager; private readonly ObservableCollection clipboardHistory; private readonly string _defaultIconPath; - public ClipboardHistoryListPage() + public ClipboardHistoryListPage(SettingsManager settingsManager) { + ArgumentNullException.ThrowIfNull(settingsManager); + + _settingsManager = settingsManager; clipboardHistory = []; _defaultIconPath = string.Empty; Icon = Icons.ClipboardListIcon; @@ -84,11 +89,11 @@ internal sealed partial class ClipboardHistoryListPage : ListPage if (item.Content.Contains(StandardDataFormats.Text)) { var text = await item.Content.GetTextAsync(); - items.Add(new ClipboardItem { Content = text, Item = item }); + items.Add(new ClipboardItem { Settings = _settingsManager, Content = text, Item = item }); } else if (item.Content.Contains(StandardDataFormats.Bitmap)) { - items.Add(new ClipboardItem { Item = item }); + items.Add(new ClipboardItem { Settings = _settingsManager, Item = item }); } } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.Designer.cs b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.Designer.cs index 349e4e47c9..a0b1882d14 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.Designer.cs +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.Designer.cs @@ -96,6 +96,42 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory.Properties { } } + /// + /// Looks up a localized string similar to Delete. + /// + public static string delete_command_name { + get { + return ResourceManager.GetString("delete_command_name", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete this item from clipboard history? This action cannot be undone.. + /// + public static string delete_confirmation_message { + get { + return ResourceManager.GetString("delete_confirmation_message", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete item?. + /// + public static string delete_confirmation_title { + get { + return ResourceManager.GetString("delete_confirmation_title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted from clipboard history. + /// + public static string delete_toast_text { + get { + return ResourceManager.GetString("delete_toast_text", resourceCulture); + } + } + /// /// Looks up a localized string similar to Copy, paste, and search items on the clipboard. /// @@ -140,5 +176,41 @@ namespace Microsoft.CmdPal.Ext.ClipboardHistory.Properties { return ResourceManager.GetString("provider_display_name", resourceCulture); } } + + /// + /// Looks up a localized string similar to . + /// + public static string settings_confirm_delete_description { + get { + return ResourceManager.GetString("settings_confirm_delete_description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show a confirmation dialog when manually deleting an item. + /// + public static string settings_confirm_delete_title { + get { + return ResourceManager.GetString("settings_confirm_delete_title", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to . + /// + public static string settings_keep_after_paste_description { + get { + return ResourceManager.GetString("settings_keep_after_paste_description", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Keep items in clipboard history after pasting. + /// + public static string settings_keep_after_paste_title { + get { + return ResourceManager.GetString("settings_keep_after_paste_title", resourceCulture); + } + } } } diff --git a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.resx b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.resx index 1ca2a9b57b..e67ba1747c 100644 --- a/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.resx +++ b/src/modules/cmdpal/ext/Microsoft.CmdPal.Ext.ClipboardHistory/Properties/Resources.resx @@ -144,4 +144,28 @@ Loading clipboard history failed + + Delete + + + Deleted from clipboard history + + + + + + Keep items in clipboard history after pasting + + + Show a confirmation dialog when manually deleting an item + + + + + + Delete item? + + + Are you sure you want to delete this item from clipboard history? This action cannot be undone. + \ No newline at end of file