From 4af3e29af80088cd3d0fac1b5338e9713411ddb1 Mon Sep 17 00:00:00 2001 From: fros4943 Date: Thu, 8 Jan 2009 15:43:49 +0000 Subject: [PATCH] better project load failure notification --- tools/cooja/java/se/sics/cooja/GUI.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index dd0d8a0c1..207631298 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.100 2008/12/19 12:48:09 fros4943 Exp $ + * $Id: GUI.java,v 1.101 2009/01/08 15:43:49 fros4943 Exp $ */ package se.sics.cooja; @@ -363,11 +363,13 @@ public class GUI extends Observable { try { reparseProjectConfig(); } catch (ParseProjectsException e) { - logger.fatal("Error when loading project directories: " + e.getMessage()); + logger.fatal("Error when loading projects: " + e.getMessage()); if (isVisualized()) { JOptionPane.showMessageDialog(GUI.getTopParentContainer(), - "Loading project directories failed.\nStack trace printed to console.", - "Error", JOptionPane.ERROR_MESSAGE); + "Default projects could not load, try to reconfigure project directories:" + + "\n\tMenu->Settings->Manage project directories" + + "\n\nSee console for stack trace with more information.", + "Project loading error", JOptionPane.ERROR_MESSAGE); } else { logger.fatal("Loading project directories failed"); logger.fatal("Stack trace:"); @@ -845,7 +847,9 @@ public class GUI extends Observable { private static void configureFrame(final GUI gui, boolean createSimDialog) { // Create and set up the window. - frame = new JFrame("COOJA Simulator"); + if (frame == null) { + frame = new JFrame("COOJA Simulator"); + } frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); // Add menu bar @@ -3322,6 +3326,7 @@ public class GUI extends Observable { public void run() { JDesktopPane desktop = new JDesktopPane(); desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); + frame = new JFrame("COOJA Simulator"); GUI gui = new GUI(desktop); configureFrame(gui, false); }