From 4c1706bebb206344e4c07189ab1d5e31099ecb82 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Wed, 21 Oct 2009 16:43:24 +0000 Subject: [PATCH] do not show dialog unless COOJA is visualized --- .../sics/cooja/plugins/NativeIPGateway.java | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/tools/cooja/apps/native_gateway/java/se/sics/cooja/plugins/NativeIPGateway.java b/tools/cooja/apps/native_gateway/java/se/sics/cooja/plugins/NativeIPGateway.java index 0e394549d..795b2cdf0 100644 --- a/tools/cooja/apps/native_gateway/java/se/sics/cooja/plugins/NativeIPGateway.java +++ b/tools/cooja/apps/native_gateway/java/se/sics/cooja/plugins/NativeIPGateway.java @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: NativeIPGateway.java,v 1.10 2009/10/20 09:22:07 fros4943 Exp $ + * $Id: NativeIPGateway.java,v 1.11 2009/10/21 16:43:24 fros4943 Exp $ */ package se.sics.cooja.plugins; @@ -542,10 +542,15 @@ public class NativeIPGateway extends VisPlugin { private void createTunInterfaceLinux() { /* Show progress bar while compiling */ - final JDialog progressDialog = new JDialog( - (Window)GUI.getTopParentContainer(), - "Starting Native IP Gateway plugin" - ); + final JDialog progressDialog; + if (GUI.isVisualized()) { + progressDialog = new JDialog( + (Window)GUI.getTopParentContainer(), + "Starting Native IP Gateway plugin" + ); + } else { + progressDialog = null; + } final MessageList output = new MessageList(); if (GUI.isVisualized()) { new RunnableInEDT() { @@ -586,8 +591,10 @@ public class NativeIPGateway extends VisPlugin { true ); if (p.exitValue() != 0) { - progressDialog.setVisible(false); - progressDialog.dispose(); + if (GUI.isVisualized()) { + progressDialog.setVisible(false); + progressDialog.dispose(); + } throw new Exception("Compile failed: " + tunContikiApp.getPath()); }