mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 12:46:47 +02:00
[PTRun]Improve copying error handling on plugins (#35459)
This commit is contained in:
@@ -50,13 +50,13 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Components
|
||||
{
|
||||
try
|
||||
{
|
||||
Clipboard.Clear();
|
||||
Clipboard.SetText(text);
|
||||
return true;
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
Log.Exception("Can't copy to clipboard", exception, typeof(ResultHelper));
|
||||
MessageBox.Show(exception.Message, Resources.Microsoft_plugin_timedate_copy_failed);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,6 +60,15 @@ namespace Microsoft.PowerToys.Run.Plugin.TimeDate.Properties {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Copy failed.
|
||||
/// </summary>
|
||||
internal static string Microsoft_plugin_timedate_copy_failed {
|
||||
get {
|
||||
return ResourceManager.GetString("Microsoft_plugin_timedate_copy_failed", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Copy value (Ctrl+C).
|
||||
/// </summary>
|
||||
|
||||
@@ -121,6 +121,9 @@
|
||||
<value>Copy value (Ctrl+C)</value>
|
||||
<comment>'Ctrl+C' is a shortcut</comment>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_timedate_copy_failed" xml:space="preserve">
|
||||
<value>Copy failed</value>
|
||||
</data>
|
||||
<data name="Microsoft_plugin_timedate_Date" xml:space="preserve">
|
||||
<value>Date</value>
|
||||
</data>
|
||||
|
||||
Reference in New Issue
Block a user