Return-Path: X-Original-To: apmail-flex-commits-archive@www.apache.org Delivered-To: apmail-flex-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BC0A410D36 for ; Fri, 7 Mar 2014 07:43:15 +0000 (UTC) Received: (qmail 78556 invoked by uid 500); 7 Mar 2014 07:43:15 -0000 Delivered-To: apmail-flex-commits-archive@flex.apache.org Received: (qmail 78381 invoked by uid 500); 7 Mar 2014 07:43:07 -0000 Mailing-List: contact commits-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list commits@flex.apache.org Received: (qmail 78325 invoked by uid 99); 7 Mar 2014 07:43:03 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 07:43:03 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 74D2693F2C1; Fri, 7 Mar 2014 07:43:03 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aharui@apache.org To: commits@flex.apache.org Message-Id: <5878873045fc4f12a0bc5ab8a79197e3@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: [flex-utilities] [refs/heads/develop] - fix osmf download when not caching and no cache folder Date: Fri, 7 Mar 2014 07:43:03 +0000 (UTC) Repository: flex-utilities Updated Branches: refs/heads/develop c6d5523e0 -> c3a906ffa fix osmf download when not caching and no cache folder Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/c3a906ff Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/c3a906ff Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/c3a906ff Branch: refs/heads/develop Commit: c3a906ffa6cce51168d3cde83b5e30e60ab519ad Parents: c6d5523 Author: Alex Harui Authored: Thu Mar 6 23:42:47 2014 -0800 Committer: Alex Harui Committed: Thu Mar 6 23:42:47 2014 -0800 ---------------------------------------------------------------------- installer/src/InstallApacheFlex.mxml | 63 +++++++++++++++++-------------- 1 file changed, 35 insertions(+), 28 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/c3a906ff/installer/src/InstallApacheFlex.mxml ---------------------------------------------------------------------- diff --git a/installer/src/InstallApacheFlex.mxml b/installer/src/InstallApacheFlex.mxml index e8e9816..022743b 100644 --- a/installer/src/InstallApacheFlex.mxml +++ b/installer/src/InstallApacheFlex.mxml @@ -106,7 +106,8 @@ variables are not required because the locations of these pieces are known. import mx.core.IFlexDisplayObject; import mx.events.FlexEvent; import mx.events.PropertyChangeEvent; - import mx.managers.PopUpManager; + import mx.managers.CursorManager; + import mx.managers.PopUpManager; import mx.resources.ResourceBundle; import mx.rpc.events.FaultEvent; import mx.rpc.events.ResultEvent; @@ -366,6 +367,8 @@ variables are not required because the locations of these pieces are known. } protected function handleApplicationComplete(event:FlexEvent):void { + CursorManager.setBusyCursor(); + updateWindow(); loadXML(); } @@ -391,7 +394,8 @@ variables are not required because the locations of these pieces are known. } private function updateWindowTitle():void { - this.nativeWindow.title = StringUtil.substitute(_viewResourceConstants.INFO_WINDOW_TITLE, [APACHE_FLEX_BIN_DISTRO_VERSION_DISPLAY]); + if (_viewResourceConstants) + this.nativeWindow.title = StringUtil.substitute(_viewResourceConstants.INFO_WINDOW_TITLE, [APACHE_FLEX_BIN_DISTRO_VERSION_DISPLAY]); } protected function selectDefaultLanguage():void { @@ -504,6 +508,7 @@ variables are not required because the locations of these pieces are known. _viewResourceConstants.FETCH_MIRROR_CGI_ERROR); _mirrorURLUtil.getMirrorURL(Constants.APACHE_FLEX_URL + _mirrorURLCGI, getMirrorURLResultHandler); + CursorManager.removeBusyCursor(); } protected function updateWindow():void { @@ -1879,34 +1884,35 @@ variables are not required because the locations of these pieces are known. var httpService:HTTPService = new HTTPService(); httpService.resultFormat = HTTPService.RESULT_FORMAT_TEXT; url = httpService.url = Constants.SOURCEFORGE_DOWNLOAD_URL + OSMF_SWC_URL + OSMF_SWC_FILE; - var cacheURL:String; - if (url.indexOf("http") == 0) - { - var c:int = url.indexOf("/"); - c = url.indexOf("/", c + 1); - c = url.indexOf("/", c + 1); - // that should find the slash after the server. - cacheURL = url.substr(c + 1); - if (debugMode) - log("http caching. url = " + cacheURL); - } - var cacheFile:File = File.applicationStorageDirectory.resolvePath(downloadCacheFolder); - cacheFile = cacheFile.resolvePath(cacheURL); - if (debugMode) - log("searching cache for " + cacheFile.url); - if (cacheFile.exists) + if (usingDownloadCache) { + var cacheURL:String; + if (url.indexOf("http") == 0) + { + var c:int = url.indexOf("/"); + c = url.indexOf("/", c + 1); + c = url.indexOf("/", c + 1); + // that should find the slash after the server. + cacheURL = url.substr(c + 1); + if (debugMode) + log("http caching. url = " + cacheURL); + } + var cacheFile:File = File.applicationStorageDirectory.resolvePath(downloadCacheFolder); + cacheFile = cacheFile.resolvePath(cacheURL); if (debugMode) - log("found file in cache"); - url = cacheFile.url; - actuallyDownloadOSMF2SWC(new URLRequest(url)); - } - else - { - httpService.addEventListener(ResultEvent.RESULT, getMirrorInfo); - httpService.addEventListener(FaultEvent.FAULT, handleOSMFSWCUnzipError); - httpService.send(); + log("searching cache for " + cacheFile.url); + if (cacheFile.exists) + { + if (debugMode) + log("found file in cache"); + url = cacheFile.url; + actuallyDownloadOSMF2SWC(new URLRequest(url)); + return; + } } + httpService.addEventListener(ResultEvent.RESULT, getMirrorInfo); + httpService.addEventListener(FaultEvent.FAULT, handleOSMFSWCUnzipError); + httpService.send(); } protected function getMirrorInfo(event:ResultEvent):void @@ -1928,7 +1934,8 @@ variables are not required because the locations of these pieces are known. { loader = new URLLoader(); loader.dataFormat = URLLoaderDataFormat.BINARY; - loader.addEventListener(Event.COMPLETE, cacheOSMF2SWC); + if (usingDownloadCache) + loader.addEventListener(Event.COMPLETE, cacheOSMF2SWC); loader.addEventListener(Event.COMPLETE, handleOSMFSWCFileDownloaded); loader.addEventListener(ErrorEvent.ERROR, handleOSMFSWCInstallError); loader.addEventListener(IOErrorEvent.IO_ERROR, handleOSMFSWCInstallError);