X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;ds=sidebyside;f=src%2Fcom%2Ftedpearson%2Fypp%2Fmarket%2FControlPanel.java;h=bbd75f6c71bcd33b19605e363dcb232600a57380;hb=ba378a6dd2f4cf83c4d1b0781fab380259ff1a16;hp=a43da10d588b4ae5802147854fb7ce9a092fa16b;hpb=2495da67787e2eb46e84f8f76c8884b7ad6e0419;p=jarrg-ian.git diff --git a/src/com/tedpearson/ypp/market/ControlPanel.java b/src/com/tedpearson/ypp/market/ControlPanel.java index a43da10..bbd75f6 100644 --- a/src/com/tedpearson/ypp/market/ControlPanel.java +++ b/src/com/tedpearson/ypp/market/ControlPanel.java @@ -7,7 +7,7 @@ import java.util.prefs.*; /** * ControlPanel is a simple management utility that sets -* a preference for whether the PCTB client is to launch or not. +* a preference for which server(s) to upload to. */ public class ControlPanel extends JFrame { public static void main(String[] args) { @@ -15,11 +15,11 @@ public class ControlPanel extends JFrame { } public ControlPanel() { - super("PCTB Control Panel"); + super("Jarrg Control Panel"); final Preferences prefs = Preferences.userNodeForPackage(getClass()); - final JCheckBox cb = new JCheckBox("Launch PCTB Uploader when YPP starts?", prefs.getBoolean("launchAtStartup", true)); final JCheckBox toPCTB = new JCheckBox("Upload to PCTB?", prefs.getBoolean("uploadToPCTB", true)); final JCheckBox toYarrg = new JCheckBox("Upload to Yarrg?", prefs.getBoolean("uploadToYarrg", true)); + final JCheckBox showArbitrage = new JCheckBox("Show arbitrage?", prefs.getBoolean("showArbitrage", false)); final JRadioButton live = new JRadioButton("Use live servers"); final JRadioButton testing = new JRadioButton("Use testing servers"); @@ -31,22 +31,33 @@ public class ControlPanel extends JFrame { liveortest.add(live); liveortest.add(testing); - setLayout(new GridLayout(6,1)); - add(cb); + String version_label = " version: " + + com.tedpearson.ypp.market.Version.version; + JLabel version = new JLabel(version_label); + + final JCheckBox enableDebug = new JCheckBox("Write debug files?", prefs.getBoolean("writeDebugFiles", false)); + + setLayout(new GridLayout(8,1)); add(toPCTB); add(toYarrg); + add(showArbitrage); add(live); add(testing); + add(version); + add(enableDebug); + + final int exitstatus = Integer.parseInt(System.getProperty("com.tedpearson.ypp.market.controlpanel.exitstatus", "0")); - JButton but = new JButton("Save"); + JButton but = new JButton("Save options"); add(but); but.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - prefs.putBoolean("launchAtStartup", cb.isSelected()); prefs.putBoolean("uploadToPCTB", toPCTB.isSelected()); prefs.putBoolean("uploadToYarrg", toYarrg.isSelected()); + prefs.putBoolean("showArbitrage", showArbitrage.isSelected()); prefs.putBoolean("useLiveServers", live.isSelected()); - System.exit(0); + prefs.putBoolean("writeDebugFiles", enableDebug.isSelected()); + System.exit(exitstatus); } }); pack();