Skip to content

Instantly share code, notes, and snippets.

@srohde
Created December 20, 2009 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srohde/260516 to your computer and use it in GitHub Desktop.
Save srohde/260516 to your computer and use it in GitHub Desktop.
<s:Window width="240" height="210"
xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo" title="Update" alwaysInFront="true" resizable="false" showStatusBar="false">
<s:layout>
<s:BasicLayout />
</s:layout>
<fx:Script>
<![CDATA[
import flash.events.MouseEvent;
import com.soenkerohde.desktop.ISwizUpdateBean;
import com.soenkerohde.desktop.info.IUpdateInfo;
[Bindable]
[Autowire(bean="swizUpdateBean", property="updateInfo")]
public var updateInfo:IUpdateInfo;
[Bindable]
[Autowire]
public var swizUpdateBean:ISwizUpdateBean;
protected function clickHandler( event : MouseEvent ) : void {
swizUpdateBean.executeUpdate( false )
}
]]>
</fx:Script>
<s:VGroup horizontalCenter="0">
<mx:Form verticalGap="0">
<mx:FormItem label="Your Version:">
<s:Label text="{updateInfo.localVersion}" />
</mx:FormItem>
<mx:FormItem label="New Version:">
<s:Label text="{updateInfo.remoteVersion}" />
</mx:FormItem>
</mx:Form>
<s:Label text="Progress: {updateInfo.bytesLoaded}/{updateInfo.bytesTotal} Bytes" />
<mx:ProgressBar indeterminate="false" label="Remaining: {updateInfo.timeRemaining} sec with {updateInfo.kiloBytePerSecond} KB/s" mode="polled"
source="{updateInfo}" />
</s:VGroup>
<s:Button bottom="10"
horizontalCenter="0" label="Update and Restart" enabled="{updateInfo.complete}" click="clickHandler(event)" />
</s:Window>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment