<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chorus Send/Receive</title>
	<atom:link href="http://chorussr.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chorussr.wordpress.com</link>
	<description>Info for developers using the Chorus library</description>
	<lastBuildDate>Thu, 30 Jun 2011 15:22:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='chorussr.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Chorus Send/Receive</title>
		<link>http://chorussr.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chorussr.wordpress.com/osd.xml" title="Chorus Send/Receive" />
	<atom:link rel='hub' href='http://chorussr.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Using Chorus to download a project in your application</title>
		<link>http://chorussr.wordpress.com/2009/08/26/using-chorus-to-download-a-project-in-your-application/</link>
		<comments>http://chorussr.wordpress.com/2009/08/26/using-chorus-to-download-a-project-in-your-application/#comments</comments>
		<pubDate>Wed, 26 Aug 2009 05:52:57 +0000</pubDate>
		<dc:creator>hattonjohn</dc:creator>
				<category><![CDATA[Chorus]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/120</guid>
		<description><![CDATA[(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 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=120&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(<a href="http://projects.palaso.org/projects/show/chorus">Chorus</a> is an open-source version control <em>porcelain</em> (over <a href="http://palaso.org/www.selenic.com/mercurial/">Mercurial</a> 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.)</p>
<p>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:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-153436979.png"><img style="display:inline;border:0;" title="2009-08-26_15-34-36-979" src="http://palaso.org/wp-content/uploads/2009/08/20090826-153436979-thumb.png" border="0" alt="2009-08-26_15-34-36-979" width="367" height="159" /></a></p>
<p>&nbsp;</p>
<p>Here’s the code WeSay runs when the user clicks the “Get from Internet”:</p>
<pre class="code"><span style="color:blue;">private void </span>OnGetFromInternet(<span style="color:blue;">object </span>sender, <span style="color:#2b91af;">LinkLabelLinkClickedEventArgs </span>e)
{
   <span style="color:blue;">using </span>(<span style="color:blue;">var </span>dlg = <span style="color:blue;">new </span>Chorus.UI.Clone.<span style="color:#2b91af;">GetCloneFromInternetDialog</span>(WeSay.Project.<span style="color:#2b91af;">WeSayWordsProject</span>.NewProjectDirectory))
    {
        <span style="color:blue;">if </span>(<span style="color:#2b91af;">DialogResult</span>.Cancel == dlg.ShowDialog())
            <span style="color:blue;">return</span>;
        OpenSpecifiedProject(dlg.PathToNewProject);
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a>And here’s what Chorus puts up in response:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-153822518.png"><img style="display:inline;border:0;" title="2009-08-26_15-38-22-518" src="http://palaso.org/wp-content/uploads/2009/08/20090826-153822518-thumb.png" border="0" alt="2009-08-26_15-38-22-518" width="377" height="344" /></a></p>
<p>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:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-154035056.png"><img style="display:inline;border:0;" title="2009-08-26_15-40-35-056" src="http://palaso.org/wp-content/uploads/2009/08/20090826-154035056-thumb.png" border="0" alt="2009-08-26_15-40-35-056" width="377" height="344" /></a></p>
<p>Once everybody is happy, the “Download” button is enabled:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-154133816.png"><img style="display:inline;border:0;" title="2009-08-26_15-41-33-816" src="http://palaso.org/wp-content/uploads/2009/08/20090826-154133816-thumb.png" border="0" alt="2009-08-26_15-41-33-816" width="377" height="344" /></a></p>
<p>And clicking it starts the download:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-154142560.png"><img style="display:inline;border:0;" title="2009-08-26_15-41-42-560" src="http://palaso.org/wp-content/uploads/2009/08/20090826-154142560-thumb.png" border="0" alt="2009-08-26_15-41-42-560" width="377" height="344" /></a></p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-154205584.png"><img style="display:inline;border:0;" title="2009-08-26_15-42-05-584" src="http://palaso.org/wp-content/uploads/2009/08/20090826-154205584-thumb.png" border="0" alt="2009-08-26_15-42-05-584" width="377" height="344" /></a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>If something goes wrong, the dialog will attempt to interpret some common network errors to help the user figure out the problem:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090826-154950906.png"><img style="display:inline;border:0;" title="2009-08-26_15-49-50-906" src="http://palaso.org/wp-content/uploads/2009/08/20090826-154950906-thumb.png" border="0" alt="2009-08-26_15-49-50-906" width="377" height="344" /></a></p>
<p>&nbsp;</p>
<h3>Final Notes</h3>
<p>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.</p>
<p>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:  <a href="http://john_hatton:mypassword@hg-public.languagedepot.org">http://john_hatton:mypassword@hg-public.languagedepot.org</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chorussr.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chorussr.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chorussr.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=120&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chorussr.wordpress.com/2009/08/26/using-chorus-to-download-a-project-in-your-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d221b6c4668bce78adb3d8fcc5628c63?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hattonjohn</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-153436979-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-34-36-979</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-153822518-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-38-22-518</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-154035056-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-40-35-056</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-154133816-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-41-33-816</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-154142560-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-41-42-560</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-154205584-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-42-05-584</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090826-154950906-thumb.png" medium="image">
			<media:title type="html">2009-08-26_15-49-50-906</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Chorus to grab a project from a USB drive</title>
		<link>http://chorussr.wordpress.com/2009/08/24/using-the-chorus-to-grab-a-project-from-a-usb-drive/</link>
		<comments>http://chorussr.wordpress.com/2009/08/24/using-the-chorus-to-grab-a-project-from-a-usb-drive/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 05:47:30 +0000</pubDate>
		<dc:creator>hattonjohn</dc:creator>
				<category><![CDATA[Chorus]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/102</guid>
		<description><![CDATA[(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.&#160; Chorus is designed to be integrated into other applications, and installed with their installers.&#160; This blog is the second in which I describe what an application developer needs to do to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=102&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>(<a href="http://http://projects.palaso.org/projects/show/chorus">Chorus</a> is an open-source version control <em>porcelain</em> (over <a href="www.selenic.com/mercurial/">Mercurial</a> plumbing) designed to enable workflows appropriate for typical language development teams who are geographically distributed.&#160; Chorus is designed to be integrated into other applications, and installed with their installers.&#160; This blog is the second in which I describe what an application developer needs to do to incorporate Chorus.)</p>
<p>In Language Software, we are perhaps more keenly aware than many developers just how complicated computers are for folks who haven’t grown up driving them.&#160; Even well-intentioned informational dialog boxes act as stumbling blocks to the people I consult with here in Papua New Guinea, expat and national alike.&#160; And the worst thing we can do, of course, is to take for granted how challenging the “Open File” and “Choose Directory” dialog boxes are to many users.&#160; So, we need an easier way to help users get a Chorus-enabled project off of a USB flash drive and onto the right place on their computer.&#160; They’ll want to do this when they’re setting up a new computer, recovering from a broken hard drive, or just adding&#160; a new person to the team.&#160; (If they have a good internet connection, they could instead pull directly from a distant repository, and how to help them do that will be the subject of my next post.)&#160;&#160; Chorus gives you an simple way to help these users rapidly grab the right thing and put it in the right place, without ever dealing with the file system.</p>
<p>Let’s walk through some sample client code (this sample taken from WeSay):</p>
<pre class="code"><span style="color:blue;">private void </span>OnGetFromUsb(<span style="color:blue;">object </span>sender, <span style="color:#2b91af;">LinkLabelLinkClickedEventArgs </span>e)
{
    <span style="color:blue;">using </span>(<span style="color:blue;">var </span>dlg = <span style="color:blue;">new </span>Chorus.UI.Clone.<span style="color:#2b91af;">GetCloneFromUsbDialog</span>(WeSay.Project.<span style="color:#2b91af;">WeSayWordsProject</span>.NewProjectDirectory))
    {</pre>
<p><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a><a href="http://11011.net/software/vspaste"></a></p>
<p>The first line makes us the dialog and tells it where we put WeSay projects, by default.&#160; That way we don’t have to bother asking our users, most of whom don’t care and shouldn’t be asked. The next line sets up a callback so that projects from other applications (or just raw Mercurial directories) won’t be listed:</p>
<blockquote>
<p>dlg.Model.ProjectFilter = dir =&gt; GetLooksLikeWeSayProject(dir);<br />
    </p>
</blockquote>
<p>And finally, we fire off the dialog and, after a successful completion, we go ahead and open the newly-cloned project in WeSay:</p>
<pre class="code">        <span style="color:blue;">if </span>(<span style="color:#2b91af;">DialogResult</span>.Cancel == dlg.ShowDialog())
            <span style="color:blue;">return</span>;
        OpenSpecifiedProject(dlg.PathToNewProject);
    }
}</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Here’s what the user sees:</p>
<p>If no USB drives are found, the dialog prompts the user with an icon and message:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090824-152557136.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-24_15-25-57-136" border="0" alt="2009-08-24_15-25-57-136" src="http://palaso.org/wp-content/uploads/2009/08/20090824-152557136-thumb.png" width="377" height="344" /></a></p>
<p>Once one or more USB drives are found, the dialog walks the devices (only to a level of 2 deep), and displays those Mercurial projects which pass our filter:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090824-152948895.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-24_15-29-48-895" border="0" alt="2009-08-24_15-29-48-895" src="http://palaso.org/wp-content/uploads/2009/08/20090824-152948895-thumb.png" width="377" height="344" /></a></p>
</p>
<p>&#160;</p>
<p>Note, if the project already exists at the default location on the user’s computer, what should we do?&#160; The answer is difficult, because there are several possible scenarios.&#160; The user might be confused, and trying to synchronize. In that case, we had better NOT make it easy for him to make and start using a second copy. The user might not have realized that they already had the project. They might just want to have a parallel “branch” of the project. Or they may know they have it, but are trying to use this vector to replace what they have.&#160; With all those choices, I’m giving up for now and just show this notification box.&#160; Maybe we can do better in the future.</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090824-154142952.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-24_15-41-42-952" border="0" alt="2009-08-24_15-41-42-952" src="http://palaso.org/wp-content/uploads/2009/08/20090824-154142952-thumb.png" width="484" height="223" /></a></p>
</p>
<p>&#160;</p>
<p>A final note:&#160; you don&#8217;t have to use this UI.&#160; If you want, you can code against the underlying to the&#160; CloneFromUsb class:</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090824-155434383.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-24_15-54-34-383" border="0" alt="2009-08-24_15-54-34-383" src="http://palaso.org/wp-content/uploads/2009/08/20090824-155434383-thumb.png" width="325" height="127" /></a></p>
<p>&#160;</p>
<p>Ok, next time, I’ll describe our first pass at a dialog for grabbing projects from internet-hosted repositories.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chorussr.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chorussr.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chorussr.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=102&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chorussr.wordpress.com/2009/08/24/using-the-chorus-to-grab-a-project-from-a-usb-drive/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d221b6c4668bce78adb3d8fcc5628c63?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hattonjohn</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090824-152557136-thumb.png" medium="image">
			<media:title type="html">2009-08-24_15-25-57-136</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090824-152948895-thumb.png" medium="image">
			<media:title type="html">2009-08-24_15-29-48-895</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090824-154142952-thumb.png" medium="image">
			<media:title type="html">2009-08-24_15-41-42-952</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090824-155434383-thumb.png" medium="image">
			<media:title type="html">2009-08-24_15-54-34-383</media:title>
		</media:content>
	</item>
		<item>
		<title>Using the Chorus Synchronization Dialog</title>
		<link>http://chorussr.wordpress.com/2009/08/15/using-the-chorus-synchronization-dialog/</link>
		<comments>http://chorussr.wordpress.com/2009/08/15/using-the-chorus-synchronization-dialog/#comments</comments>
		<pubDate>Sat, 15 Aug 2009 00:06:58 +0000</pubDate>
		<dc:creator>hattonjohn</dc:creator>
				<category><![CDATA[Chorus]]></category>

		<guid isPermaLink="false">http://palaso.org/archives/95</guid>
		<description><![CDATA[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.&#160; Chorus is designed to be integrated into other applications, and installed with their installers.&#160; This blog is the first of several in which I will describe what an application developer needs [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=95&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://http://projects.palaso.org/projects/show/chorus">Chorus</a> is an open-source version control <em>porcelain</em> (over <a href="www.selenic.com/mercurial/">Mercurial</a> plumbing) designed to enable workflows appropriate for typical language development teams who are geographically distributed.&#160; Chorus is designed to be integrated into other applications, and installed with their installers.&#160; This blog is the first of several in which I will describe what an application developer needs to do to incorporate Chorus.&#160; It is not logically the <em>first</em> thing I should write about, but there are a couple projects which already have the more basic stuff worked out, so I’ve decided to just start with the next thing they need.&#160; Someday, I’ll go back and blog about some previous steps to incorporating Chorus into your application.&#160; Note that for now, you need to use a .net language to use Chorus. If there is demand, it will be simple matter to provide the most important functionality via the command line, so that non-.net apps can use Chorus as well.&#160; Chorus works with mono, so you can use this on linux as well.</p>
<p>The easiest way to start a synchronization job is to use Chorus’ new “SyncDialog”.&#160; Using this, you give the user feedback and offer some control over the process. You don’t have to use it, but it will improve over time at little cost to you, and it is designed to be customizable for your needs. It is also available as a Control, so you can embed it in some other view, if you don’t want the whole dialog. </p>
<h2>Using Chorus for Backup</h2>
<p> <a href="http://11011.net/software/vspaste"></a>
<p>One common use of Chorus will be for performing automated backup.&#160; This is a big issue in many Language Software applications, because the user often </p>
<ol>
<li>possesses relatively low computer-skills</li>
<li>in environmental conditions which are hard on computer hardware (dust, sea-spray, humidity, lightning)</li>
<li>subject to high theft rates, particularly of expensive, light-weight things like netbooks</li>
</ol>
<p>So automated backup is&#160; a great thing to build into your applications.&#160; Simply by “checking in” to the local version control in the folder holding your application’s documents, you provide a full history of the project so that it is possible to roll-back to a previous state.&#160; By adding a secondary media backup location, like an SD card, you decrease the chance that a hardware failure will result in loss of work.&#160; </p>
<p>For this kind of synchronization, which we’ll call “backup”, you just want to assure the user that it is happening and let them know if something went wrong.&#160; You could do this in various ways which are less intrusive than a dialog box.&#160; But if you do use the SyncDialog to do it, you’ll want to keep it pretty minimal. For example, when WeSay does its automated backup, it invokes the dialog like this:</p>
<pre class="code"><span style="color:blue;">var </span>dlg = <span style="color:blue;">new </span><span style="color:#2b91af;">SyncDialog</span>(configuration,
       <span style="color:#2b91af;">SyncUIDialogBehaviors</span>.StartImmediatelyAndCloseWhenFinished,
       <span style="color:#2b91af;">SyncUIFeatures</span>.Minimal);</pre>
<pre class="code">dlg.Text = <span style="color:#a31515;">&quot;Wesay Automatic Backup&quot;</span>;
dlg.SyncOptions.DoMergeWithOthers = <span style="color:blue;">false</span>;
dlg.SyncOptions.DoPullFromOthers = <span style="color:blue;">false</span>;
dlg.SyncOptions.DoPushToLocalSources = <span style="color:blue;">true</span>;</pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<pre class="code"> Which gives us:</pre>
<pre class="code"><a href="http://palaso.org/wp-content/uploads/2009/08/20090815-100050652.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-15_10-00-50-652" border="0" alt="2009-08-15_10-00-50-652" src="http://palaso.org/wp-content/uploads/2009/08/20090815-100050652-thumb.png" width="510" height="105" /></a></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>&#160;</p>
<p>When the backup is over, the user sees the following for about a second, and then the box closes.</p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/20090815-100241842.png"><img style="border-bottom:0;border-left:0;display:inline;border-top:0;border-right:0;" title="2009-08-15_10-02-41-842" border="0" alt="2009-08-15_10-02-41-842" src="http://palaso.org/wp-content/uploads/2009/08/20090815-100241842-thumb.png" width="510" height="105" /></a></p>
<p>(Note, I’ll describe the “configuration” parameter above in a separate post.&#160; It basically tells Chorus what file types you want checked in.&#160; Also not described in this post is how you can tell the Chorus Synchronizer whether you’re interested in pulling from other sources, or just pushing to them, as in the case of backup).</p>
<h2>Using Chorus For Synchronization</h2>
<p>Whereas backup should be totally automated, there are other times when its appropriate to give the user full control. For example, when an advanced user clicks “Send/Receive” in your application, you may want to give the user the chance to clarify which devices/people/servers he’s planning to synchronize with, view the steps Chorus is taking to locate, pull, merge, and push back to remote servers, etc.&#160; To simply bring up a dialog box with all the controls the dialog has to offer, we use code like this: </p>
<p><span style="color:blue;">var </span>dlg = <span style="color:blue;">new </span><span style="color:#2b91af;">SyncDialog</span>(configuration,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SyncUIDialogBehaviors</span>.Lazy,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SyncUIFeatures</span>.Everything)) </p>
<p>&#160; </p>
<p>Which gives us: </p>
<p>&#160;</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/clip-image008.jpg"><img style="display:inline;border-width:0;" title="clip_image008" border="0" alt="clip_image008" src="http://palaso.org/wp-content/uploads/2009/08/clip-image008-thumb.jpg" width="510" height="402" /></a> </p>
<p>&#160; </p>
<p>When you click the Send/Receive button, it switches you to the log tab: </p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/clip-image010.jpg"><img style="display:inline;border-width:0;" title="clip_image010" border="0" alt="clip_image010" src="http://palaso.org/wp-content/uploads/2009/08/clip-image010-thumb.jpg" width="510" height="402" /></a> </p>
<p>And if there is a problem, it plays an error sound and displays a warning icon: </p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/clip-image012.jpg"><img style="display:inline;border-width:0;" title="clip_image012" border="0" alt="clip_image012" src="http://palaso.org/wp-content/uploads/2009/08/clip-image012-thumb.jpg" width="510" height="402" /></a> </p>
<p>If you click the “Show diagnostic information” box, you get exhaustive details on everything Chorus and Mercurial are saying to each other : </p>
<p><a href="http://palaso.org/wp-content/uploads/2009/08/clip-image014.jpg"><img style="display:inline;border-width:0;" title="clip_image014" border="0" alt="clip_image014" src="http://palaso.org/wp-content/uploads/2009/08/clip-image014-thumb.jpg" width="510" height="402" /></a> </p>
<p>&#160; </p>
<p>Some applications, like WeSay, need to allow the administrator to lock things down a bit, so that the user doesn’t uncheck the team repository and then forget to ever check it again.&#160; To do that, instead of the <em>everything</em> flag, we might limit it to just one tasks tab (not shown), plus a confirmation sound. For example, we might say: </p>
<p>&#160;<span style="color:blue;">var </span>dlg = <span style="color:blue;">new</span><span style="color:#2b91af;">SyncDialog</span>(configuration,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SyncUIDialogBehaviors</span>.Lazy,</p>
<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <span style="color:#2b91af;">SyncUIFeatures</span>.PlaySoundIfSuccessful | <span style="color:#2b91af;">SyncUIFeatures</span>.TaskList))</p>
<p><a href="http://11011.net/software/vspaste"></a></p>
<p>Which would leave out the “choose repositories” and “log” tabs, and instead show the (not yet implemented) tasks tab (see below). </p>
<h2>Flags</h2>
<p>At the time of this posting, here are the compete set of&#160; flags you can tailor its startup/close down behavior.</p>
<pre class="code"><span style="color:blue;">public enum </span><span style="color:#2b91af;">SyncUIDialogBehaviors
</span>{
    Lazy=0,
    StartImmediately,
    StartImmediatelyAndCloseWhenFinished
} ;</pre>
<pre class="code">[<span style="color:#2b91af;">Flags</span>]
<span style="color:blue;">public enum </span><span style="color:#2b91af;">SyncUIFeatures
</span>{
    Minimal =0,
    SendReceiveButton=2,
    TaskList=4,
    Log = 8,
    RepositoryChooser = 16,
    PlaySoundIfSuccessful = 32,
    Everything = 0xFFFF
}</pre>
<h3>TODO</h3>
<ul>
<li>Add the tasks tab, which shows you an outline of the tasks that will be attempted and the status of each one (similar to the dialog in MS Outlook). </li>
<li>The cancel button currently doesn’t have the ability to kill a long-running mercurial operation (I’m a bit scared of doing it). So the cancellation only happens in-between steps chorus itself is taking. </li>
<li>Nothing in Chorus is internationalized yet. </li>
<li>The progress bar is just one of those “I’m alive” ones at this point… it has no idea how much progress has been made. </li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chorussr.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chorussr.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chorussr.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chorussr.wordpress.com&amp;blog=10266151&amp;post=95&amp;subd=chorussr&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://chorussr.wordpress.com/2009/08/15/using-the-chorus-synchronization-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d221b6c4668bce78adb3d8fcc5628c63?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">hattonjohn</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090815-100050652-thumb.png" medium="image">
			<media:title type="html">2009-08-15_10-00-50-652</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/20090815-100241842-thumb.png" medium="image">
			<media:title type="html">2009-08-15_10-02-41-842</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/clip-image008-thumb.jpg" medium="image">
			<media:title type="html">clip_image008</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/clip-image010-thumb.jpg" medium="image">
			<media:title type="html">clip_image010</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/clip-image012-thumb.jpg" medium="image">
			<media:title type="html">clip_image012</media:title>
		</media:content>

		<media:content url="http://palaso.org/wp-content/uploads/2009/08/clip-image014-thumb.jpg" medium="image">
			<media:title type="html">clip_image014</media:title>
		</media:content>
	</item>
	</channel>
</rss>
