From 8768a855af9ccc482a9520ce708ef32e0e6e0e7d Mon Sep 17 00:00:00 2001
From: Normand Briere <nbriere@noware.ca>
Date: Fri, 04 Oct 2019 20:06:36 -0400
Subject: [PATCH] Block multiple download.

---
 ObjEditor.java |   18 ++++++++++++++----
 1 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/ObjEditor.java b/ObjEditor.java
index 05fa7cb..af5b921 100644
--- a/ObjEditor.java
+++ b/ObjEditor.java
@@ -5090,7 +5090,7 @@
         
         if (copy.versionindex == 0)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return false;
         }
 
@@ -5126,7 +5126,7 @@
         
         if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return false;
         }
 
@@ -5149,7 +5149,7 @@
         // < 0 means == -2 || == -1
         if (copy.versionindex < 0 || copy.versionlist[copy.versionindex] == null)
         {
-            // No version yet. OK. java.awt.Toolkit.getDefaultToolkit().beep();
+            // No version yet. OK. Grafreed.Beep();
             return false;
         }
 
@@ -5167,7 +5167,7 @@
         
         if (copy.versionlist[copy.versionindex + 1] == null)
         {
-            java.awt.Toolkit.getDefaultToolkit().beep();
+            Grafreed.Beep();
             return;
         }
 
@@ -6104,6 +6104,8 @@
         //String filename;
         //iCallBack callback;
 
+        boolean running;
+            
         java.util.Stack stack;
 
         LoadGFDThread(/*String fullname, iCallBack cb*/)
@@ -6133,6 +6135,7 @@
                 };
                 if (!stack.empty())
                 {
+                    running = true;
                     frame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
                     iCallBack callback = (iCallBack) stack.pop();
                     String filename = (String) stack.pop();
@@ -6140,6 +6143,7 @@
                     callback.Callback(ReadGFD(filename));
                     System.gc();
                     wasbusy = true;
+                    running = false;
                 } else
                 {
                     if (wasbusy)
@@ -6162,6 +6166,12 @@
             loadGFDThread.start();
         }
 
+        if (loadGFDThread.running)
+        {
+            Grafreed.Beep();
+            return;
+        }
+        
         loadGFDThread.add(fullname, cb);
     }
 

--
Gitblit v1.6.2