#---------- run the control panel ----------
-"$javadir/bin/java" -jar "$srcjardir/PCTB-ControlPanel.jar"
+set +e
+"$javadir/bin/java" \
+ -Dcom.tedpearson.ypp.market.controlpanel.exitstatus=12 \
+ -jar "$srcjardir/PCTB-ControlPanel.jar"
+rc=$?
+set -e
+
+case $rc in
+0) echo "launcher dialogue closed, quitting"; exit 0 ;;
+12) ;;
+*) echo >&2 "control panel failed with exit status $rc" ;;
+esac
+
#---------- create the temporary are and link farm ----------
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));
liveortest.add(testing);
setLayout(new GridLayout(6,1));
- add(cb);
add(toPCTB);
add(toYarrg);
add(live);
add(testing);
- JButton but = new JButton("Save");
+ final int exitstatus = Integer.parseInt(System.getProperty("com.tedpearson.ypp.market.controlpanel.exitstatus", "0"));
+
+ 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();