mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
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:
parent
fec2b402e0
commit
7b0444d317
2 changed files with 28 additions and 0 deletions
|
@ -56,6 +56,22 @@ namespace SourceGit.ViewModels
|
|||
_page = launcher.ActivePage;
|
||||
|
||||
View = new Views.Clone() { DataContext = this };
|
||||
App.GetClipboardTextAsync()
|
||||
.ContinueWith(t =>
|
||||
{
|
||||
if (t.IsFaulted)
|
||||
{
|
||||
t.Exception.Handle(static _ => true);
|
||||
}
|
||||
else if (t.IsCompleted)
|
||||
{
|
||||
var result = t.Result;
|
||||
if (Models.Remote.IsValidURL(result))
|
||||
{
|
||||
Remote = result;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static ValidationResult ValidateRemote(string remote, ValidationContext _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue