altoslib: Let the application disable the link cancel dialog
authorKeith Packard <keithp@keithp.com>
Wed, 17 Jun 2015 06:40:34 +0000 (23:40 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 17 Jun 2015 07:13:03 +0000 (00:13 -0700)
This lets the application control whether to pop up the cancel dialog
when the link isn't working.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosLink.java

index fca8beb8a2713ef9f4510eca581f0a0d793fbe55..4f3a1ed24a1d3db89b4393a5771d8b8c050c6857 100644 (file)
@@ -86,10 +86,17 @@ public abstract class AltosLink implements Runnable {
 
        public boolean  reply_abort;
        public int      in_reply;
+       boolean cancel_enable = true;
+
+       public void set_cancel_enable(boolean e) {
+               cancel_enable = e;
+       }
 
        boolean         reply_timeout_shown = false;
 
        private boolean check_reply_timeout() {
+               if (!cancel_enable)
+                       return false;
                if (!reply_timeout_shown)
                        reply_timeout_shown = show_reply_timeout();
                return reply_abort;