feature: Allow populating the repository URL from the clipboard

Allow populating the repository URL from the clipboard if the clipboard contains a valid URL.
This commit is contained in:
Giuseppe Lippolis 2024-06-19 16:24:51 +02:00
parent fec2b402e0
commit 7b0444d317
2 changed files with 28 additions and 0 deletions

View file

@ -317,6 +317,18 @@ namespace SourceGit
});
}
public static async Task<string> GetClipboardTextAsync()
{
if (Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
if (desktop.MainWindow.Clipboard is { } clipboard)
{
return await clipboard.GetTextAsync();
}
}
return default;
}
private ResourceDictionary _activeLocale = null;
private ResourceDictionary _colorOverrides = null;
private Models.INotificationReceiver _notificationReceiver = null;