(Chorus is an open-source version control porcelain (over Mercurial plumbing) designed to enable workflows appropriate for typical language development teams who are geographically distributed. Chorus is designed to be integrated into other applications, and installed with their installers. This blog is the third in which I describe what an application developer needs to do to incorporate Chorus.)
Last time, I showed how it’s easy to let Chorus deal with finding USB keys, find projects on then, and get a clone to the user’s computer. This time, we’ll see that you do about the same thing on your end, but the user gets a different dialog. For some context, here’s a portion of WeSay “Welcome” screen:
Here’s the code WeSay runs when the user clicks the “Get from Internet”:
private void OnGetFromInternet(object sender, LinkLabelLinkClickedEventArgs e) { using (var dlg = new Chorus.UI.Clone.GetCloneFromInternetDialog(WeSay.Project.WeSayWordsProject.NewProjectDirectory)) { if (DialogResult.Cancel == dlg.ShowDialog()) return; OpenSpecifiedProject(dlg.PathToNewProject); } }
And here’s what Chorus puts up in response:
This dialog has a lot of code to help the user over many of the little things that can go wrong, but with the URL and the intended destination. When you type in a valid URL, a destination folder is filled in for you, and it tells you if there is already a folder with that name there:
Once everybody is happy, the “Download” button is enabled:
And clicking it starts the download:
If something goes wrong, the dialog will attempt to interpret some common network errors to help the user figure out the problem:
Final Notes
Chorus enters the URL that was used in the .hgrc file of the downloaded project, so when the user goes to sync, the location is presented to the user as the place they probably want to synchronize with.
Not shown here, because I haven’t done anything about it yet, is user names and passwords. For the moment, these can just be embedded in the URL in the usual way: http://john_hatton:mypassword@hg-public.languagedepot.org.
