X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=jarrg-owen.git;a=blobdiff_plain;f=src%2Fcom%2Ftedpearson%2Fypp%2Fmarket%2FControlPanel.java;h=b42232fec912e9dc9800b85df1dfbf50e55e4caa;hp=a00e734d86389598b9382df6e4bfe2fdd2aa56d0;hb=fd6771cc8d1fcd52119c3658f62ebd7f39ee4f81;hpb=3cff51a7f2bf5a5d9b78482f408da1b70037994c diff --git a/src/com/tedpearson/ypp/market/ControlPanel.java b/src/com/tedpearson/ypp/market/ControlPanel.java index a00e734..b42232f 100644 --- a/src/com/tedpearson/ypp/market/ControlPanel.java +++ b/src/com/tedpearson/ypp/market/ControlPanel.java @@ -17,36 +17,41 @@ public class ControlPanel extends JFrame { public ControlPanel() { super("PCTB 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 JRadioButton live = new JRadioButton("Use live servers"); final JRadioButton testing = new JRadioButton("Use testing servers"); - live.setSelected(prefs.getBoolean("useLiveServers", false)); - testing.setSelected(!prefs.getBoolean("useLiveServers", false)); + live.setSelected(prefs.getBoolean("useLiveServers", true)); + testing.setSelected(!prefs.getBoolean("useLiveServers", true)); ButtonGroup liveortest = new ButtonGroup(); liveortest.add(live); liveortest.add(testing); + String version_label = " version: " + + com.tedpearson.ypp.market.Version.version; + JLabel version = new JLabel(version_label); + setLayout(new GridLayout(6,1)); - add(cb); add(toPCTB); add(toYarrg); add(live); add(testing); + add(version); + + 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("launchAtStartup", true); prefs.putBoolean("uploadToPCTB", toPCTB.isSelected()); prefs.putBoolean("uploadToYarrg", toYarrg.isSelected()); prefs.putBoolean("useLiveServers", live.isSelected()); - System.exit(0); + System.exit(exitstatus); } }); pack();