[Esbox-commits] r890 - trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse

lwang at garage.maemo.org lwang at garage.maemo.org
Fri Oct 24 00:43:22 EEST 2008


Author: lwang
Date: 2008-10-24 00:43:22 +0300 (Fri, 24 Oct 2008)
New Revision: 890

Modified:
   trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocol.java
Log:
Improved description on progress bar.

Modified: trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocol.java
===================================================================
--- trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocol.java	2008-10-23 21:41:45 UTC (rev 889)
+++ trunk/device/org.maemo.esbox.device.launch.rse/src/org/maemo/esbox/device/launch/rse/RSELaunchProtocol.java	2008-10-23 21:43:22 UTC (rev 890)
@@ -150,7 +150,7 @@
 		for (Map.Entry<IPath, List<IPath>> p : targetPathToHostFiles.entrySet())
 			total += p.getValue().size();
 
-		monitor.beginTask("", total*2 + targetPathToHostFiles.entrySet().size() + 1);
+		monitor.beginTask("Downloading: ", total*2 + targetPathToHostFiles.entrySet().size() + 1);
 		
 		IProgressMonitor subMon = null;
 
@@ -165,8 +165,8 @@
 			//
 			String msg = MessageFormat.format("Creating folder ''{0}'' on device ", targetPath);
 			monitor.subTask(msg);
-			subMon = new SubProgressMonitor(monitor, 1);
-			subMon.beginTask("", 100);
+			subMon = new SubProgressMonitor(monitor, 1, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+			subMon.beginTask(msg, 100);
 			IRemoteFile remoteFolder;
 			try {
 				remoteFolder = fss.getRemoteFileObject(targetPath, subMon);
@@ -185,11 +185,11 @@
 			for (IPath hostFilePath : hostFilePaths) {
 				String hostFile = hostFilePath.toPortableString();
 				
-				msg = MessageFormat.format("Download ''{0}'' to ''{1}''", hostFile, targetPath);
+				msg = MessageFormat.format("''{0}'' to ''{1}''", hostFilePath.lastSegment(), targetPath);
 				
 				monitor.subTask(msg);
-				subMon = new SubProgressMonitor(monitor, 2);
-				subMon.beginTask("", 100);
+				subMon = new SubProgressMonitor(monitor, 2, SubProgressMonitor.PREPEND_MAIN_LABEL_TO_SUBTASK);
+				subMon.beginTask(msg, 100);
 				
 				// TODO: check timestamps
 				
@@ -215,7 +215,8 @@
 						subMon.done();
 					}
 				} catch (SystemMessageException e) {
-					return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), msg + " failed", e);
+					msg = MessageFormat.format("Downloading ''{0}'' to ''{1}'' failed", hostFilePath.lastSegment(), targetPath);
+					return new Status(IStatus.ERROR, Activator.getUniqueIdentifier(), msg, e);
 				}
 
 				if (monitor.isCanceled())



More information about the Esbox-commits mailing list