doc: Add 1.9.5 release notes
[fw/altos] / altosui / AltosIgniteUI.java
index 1a2dc4f1881c155e0c8ee26d2cedec9cf318d747..8256722a513269405ece3db08e16b5c7d8c0a5ca 100644 (file)
@@ -3,7 +3,8 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 2 of the License.
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful, but
  * WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -24,8 +25,8 @@ import java.io.*;
 import java.text.*;
 import java.util.*;
 import java.util.concurrent.*;
-import org.altusmetrum.altoslib_6.*;
-import org.altusmetrum.altosuilib_6.*;
+import org.altusmetrum.altoslib_14.*;
+import org.altusmetrum.altosuilib_14.*;
 
 public class AltosIgniteUI
        extends AltosUIDialog
@@ -48,6 +49,8 @@ public class AltosIgniteUI
        int             time_remaining;
        boolean         timer_running;
 
+       int             poll_remaining;
+
        LinkedBlockingQueue<String>     command_queue;
 
        class Igniter {
@@ -62,7 +65,7 @@ public class AltosIgniteUI
                }
 
                Igniter(AltosIgniteUI ui, String label, String name, int y) {
-                       Container               pane = getContentPane();
+                       Container               pane = getScrollablePane();
                        GridBagConstraints      c = new GridBagConstraints();
                        Insets                  i = new Insets(4,4,4,4);
 
@@ -210,6 +213,8 @@ public class AltosIgniteUI
                        fired();
                } else if (reply.startsWith("npyro")) {
                        npyro = Integer.parseInt(reply.substring(6));
+                       if (npyro == AltosLib.MISSING)
+                               npyro = 0;
                        make_ui();
                }
        }
@@ -252,17 +257,18 @@ public class AltosIgniteUI
 
        boolean getting_status = false;
 
-       boolean visible = false;
-
        void set_ignite_status() {
                getting_status = false;
-               if (!visible) {
-                       visible = true;
+               poll_remaining = 2;
+               if (!isVisible())
                        setVisible(true);
-               }
        }
 
        void poll_ignite_status() {
+               if (poll_remaining > 0) {
+                       --poll_remaining;
+                       return;
+               }
                if (!getting_status) {
                        getting_status = true;
                        send_command("get_status");
@@ -382,7 +388,7 @@ public class AltosIgniteUI
        private void make_ui() {
                group = new ButtonGroup();
 
-               Container               pane = getContentPane();
+               Container               pane = getScrollablePane();
 
                GridBagConstraints      c = new GridBagConstraints();
                Insets                  i = new Insets(4,4,4,4);