From 99fbcdfa1c76a4e0e3bc8de82868fc2179d3354c Mon Sep 17 00:00:00 2001 From: kruland2607 Date: Fri, 3 Feb 2012 01:38:50 +0000 Subject: [PATCH] Improved message provided during progress. git-svn-id: https://openrocket.svn.sourceforge.net/svnroot/openrocket/trunk@387 180e2498-e6e9-4542-8430-84ac67f01cd8 --- .../android/thrustcurve/TCQueryAction.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/android/src/net/sf/openrocket/android/thrustcurve/TCQueryAction.java b/android/src/net/sf/openrocket/android/thrustcurve/TCQueryAction.java index 69714cbd..81ce2104 100644 --- a/android/src/net/sf/openrocket/android/thrustcurve/TCQueryAction.java +++ b/android/src/net/sf/openrocket/android/thrustcurve/TCQueryAction.java @@ -64,7 +64,7 @@ public class TCQueryAction { public void setOnCompleteListener(OnComplete onCompleteListener) { this.onCompleteListener = onCompleteListener; } - + public void start( SearchRequest request) { Downloader d = new Downloader(request); @@ -78,14 +78,14 @@ public class TCQueryAction { public void dismiss() { // TODO - need to kill the thread. - + mDbHelper.close(); - + if ( progress != null && progress.isShowing() ) { progress.dismiss(); } } - + private class UpdateMessage implements Runnable { private String newMessage; UpdateMessage( String message ) { @@ -147,7 +147,18 @@ public class TCQueryAction { int total = res.getResults().size(); int count = 1; for( TCMotor mi : res.getResults() ) { - handler.post(new UpdateMessage("Downloading details " + count + " of " + total)); + StringBuilder message = new StringBuilder(); + message.append("Downloading details "); + if ( total > 1 ) { + message.append(count); + message.append(" of " ); + message.append(total); + message.append("\n"); + } + message.append(mi.getManufacturer()); + message.append(" "); + message.append(mi.getCommon_name()); + handler.post(new UpdateMessage(message.toString())); count++; if ( mi.getData_files() == null || mi.getData_files().intValue() == 0 ) { continue; -- 2.47.2