-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
Changes from 5 commits
f49d876
ad42833
0f884e8
0baa937
31df94d
6d98401
45ba1ef
57ce434
448125f
dd31a7e
2f15202
6e7c775
473c798
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -261,11 +261,43 @@ private void _cancelButton_Click(object sender, EventArgs e) | |
} | ||
|
||
private void OnDownloadClick(object sender, EventArgs e) | ||
{ | ||
StartClone(); | ||
} | ||
|
||
|
||
/// <summary> | ||
/// Starts a clone operation with the supplied information. | ||
/// <param name="username">Username for Mercurial authentication</param> | ||
/// <param name="password">Password for Mercurial authentication</param> | ||
/// <param name="projectFolder">The parent directory to put the clone in</param> | ||
/// <param name="projectName">Name of the project to clone</param> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How about: "Name for the project on the local machine"? When I read, "Project to clone," I think of the name on the server. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure! |
||
/// <param name="projectUri">URI where the project can be found</param> | ||
/// </summary> | ||
public static GetCloneFromInternetDialog StartClone(string username, string password, string projectFolder, string projectName, Uri projectUri) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm concerned about removing the Form return result, at first glance. FB needs to provide Application.Run() with something to keep from moving on immediately. Maybe it's just as simple as moving that call in here? I'll look into it. Edit: Everything hunky-dory! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nitpicking: This dialog seems kind of a funny place for this method. I'd consider There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you'd like me to move it, let me know where. (It doesn't matter too much to me.) I put it here, because it needs the model and dialog, both of which are present here. But its being static now makes separation easier |
||
{ | ||
var model = new GetCloneFromInternetModel(projectFolder) | ||
{ | ||
Username = username, | ||
Password = password, | ||
CustomUrl = projectUri.ToString(), | ||
IsCustomUrl = true, | ||
LocalFolderName = projectName | ||
}; | ||
|
||
var dialog = new GetCloneFromInternetDialog(model); | ||
dialog.Show(); | ||
dialog.StartClone(); | ||
|
||
return dialog; | ||
} | ||
|
||
private void StartClone() | ||
{ | ||
lock (this) | ||
{ | ||
_logBox.Clear(); | ||
if(_backgroundWorker.IsBusy) | ||
if (_backgroundWorker.IsBusy) | ||
return; | ||
UpdateDisplay(State.MakingClone); | ||
_model.SaveUserSettings(); | ||
|
@@ -275,7 +307,6 @@ private void OnDownloadClick(object sender, EventArgs e) | |
} | ||
} | ||
|
||
|
||
public string ThreadSafeUrl | ||
{ | ||
get; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"without user interaction": there's no indirect interaction, either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my mind, the indirect user interaction is them using the wrapping software. They still have to do something to get the clone to happen.