Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add public StartClone() method #325

Merged
merged 13 commits into from
Oct 13, 2023
22 changes: 21 additions & 1 deletion src/Chorus/UI/Clone/GetCloneFromInternetDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,27 @@ private void _cancelButton_Click(object sender, EventArgs e)
}

private void OnDownloadClick(object sender, EventArgs e)
{
StartClone();
}

public void StartClone(string username, string password, Uri targetUri)
{
_model.Username = username;
_model.Password = password;
_model.CustomUrl = targetUri.ToString();
_model.IsCustomUrl = true;
_model.LocalFolderName = GetProjectName(targetUri);
hahn-kev marked this conversation as resolved.
Show resolved Hide resolved

StartClone();
}

private void StartClone()
{
lock (this)
{
_logBox.Clear();
if(_backgroundWorker.IsBusy)
if (_backgroundWorker.IsBusy)
return;
UpdateDisplay(State.MakingClone);
_model.SaveUserSettings();
Expand All @@ -275,6 +291,10 @@ private void OnDownloadClick(object sender, EventArgs e)
}
}

private string GetProjectName(Uri uri)
{
return uri.Segments[1].ToString();
}

public string ThreadSafeUrl
{
Expand Down
Loading