From b0f4f25ba2e009a7d4ec5b8a752c36a90d835722 Mon Sep 17 00:00:00 2001 From: Kevin Ruland Date: Fri, 3 Feb 2012 01:38:50 +0000 Subject: [PATCH] Improved message provided during progress. --- .../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 69714cbdc..81ce21044 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;