[Esbox-commits] r846 - trunk/common/org.maemo.esbox.core/src/org/maemo/esbox/core

lwang at garage.maemo.org lwang at garage.maemo.org
Thu Oct 9 01:00:31 EEST 2008


Author: lwang
Date: 2008-10-09 01:00:31 +0300 (Thu, 09 Oct 2008)
New Revision: 846

Modified:
   trunk/common/org.maemo.esbox.core/src/org/maemo/esbox/core/JobUtils.java
Log:
Make sure "monitorMsg" is honored.

Modified: trunk/common/org.maemo.esbox.core/src/org/maemo/esbox/core/JobUtils.java
===================================================================
--- trunk/common/org.maemo.esbox.core/src/org/maemo/esbox/core/JobUtils.java	2008-10-08 19:41:08 UTC (rev 845)
+++ trunk/common/org.maemo.esbox.core/src/org/maemo/esbox/core/JobUtils.java	2008-10-08 22:00:31 UTC (rev 846)
@@ -69,7 +69,7 @@
 	 * @param monitor a monitor to use while waiting for the job to finish
 	 * @return the status of the runnable
 	 */
-	public static IStatus waitForRunnable(final IJob runnable, IProgressMonitor monitor, String monitorMsg) {
+	public static IStatus waitForRunnable(final IJob runnable, IProgressMonitor monitor, final String monitorMsg) {
 		if (monitor == null)
 			monitor = new NullProgressMonitor();
 		
@@ -83,14 +83,14 @@
 		IStatus status;
 		Display display = Display.getCurrent();
 		if (display != null && workbench != null) { 
-			monitor.beginTask(monitorMsg, IProgressMonitor.UNKNOWN);
 			final IStatus[] statuses = { null };
 			try {
 				workbench.getProgressService().busyCursorWhile(new IRunnableWithProgress() {
 	
-					public void run(IProgressMonitor monitor)
+					public void run(IProgressMonitor _monitor)
 							throws InvocationTargetException, InterruptedException {
-						statuses[0] = runnable.run(monitor);
+						_monitor.beginTask(monitorMsg, IProgressMonitor.UNKNOWN);
+						statuses[0] = runnable.run(_monitor);
 					}
 					
 				});



More information about the Esbox-commits mailing list