From: Ian Jackson Date: Sun, 5 Sep 2010 13:06:48 +0000 (+0100) Subject: show a message in the resultSummary if PCTB is lacking commods X-Git-Tag: 0.9.9~7 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-ian.git;a=commitdiff_plain;h=34700e8c14355da269191a09744b36f112a4f085 show a message in the resultSummary if PCTB is lacking commods --- diff --git a/src/com/tedpearson/ypp/market/MarketUploader.java b/src/com/tedpearson/ypp/market/MarketUploader.java index f8437f9..5fb927a 100644 --- a/src/com/tedpearson/ypp/market/MarketUploader.java +++ b/src/com/tedpearson/ypp/market/MarketUploader.java @@ -40,6 +40,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis private JButton findMarket = null; private JLabel resultSummary = null; private JLabel arbitrageResult = null; + private int unknownPCTBcommods = 0; private long startTime = 0; private final static String PCTB_LIVE_HOST_URL = "http://pctb.crabdance.com/"; @@ -297,6 +298,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis startTime = new Date().getTime(); resultSummary.setText(""); arbitrageResult.setText(""); + unknownPCTBcommods = 0; try { runUpload(); } catch(Exception e) { @@ -607,6 +609,8 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis if ((uploadToPCTB && !donepctb) || (uploadToYarrg && !doneyarrg)) { resultSummary.setText("trouble"); + } else if (unknownPCTBcommods != 0) { + resultSummary.setText("PCTB lacks "+unknownPCTBcommods+" commod"); } else if (donepctb || doneyarrg) { resultSummary.setText("Done " + islandName); } else { @@ -810,6 +814,7 @@ public class MarketUploader implements TopLevelWindowListener, GUIInitializedLis buySellCount[1]++; } } catch(IllegalArgumentException e) { + unknownPCTBcommods++; if (dtxt!=null) dtxt.println("Error: Unsupported Commodity \"" + offer.get(0) + "\""); } }