minor bugfix: use isVisualized() method to determine if Cooja is visualized

This commit is contained in:
fros4943 2008-12-19 12:48:09 +00:00
parent 9d7e9fe297
commit e9fa905ff1

View file

@ -24,7 +24,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* *
* $Id: GUI.java,v 1.99 2008/12/17 13:12:07 fros4943 Exp $ * $Id: GUI.java,v 1.100 2008/12/19 12:48:09 fros4943 Exp $
*/ */
package se.sics.cooja; package se.sics.cooja;
@ -364,12 +364,15 @@ public class GUI extends Observable {
reparseProjectConfig(); reparseProjectConfig();
} catch (ParseProjectsException e) { } catch (ParseProjectsException e) {
logger.fatal("Error when loading project directories: " + e.getMessage()); logger.fatal("Error when loading project directories: " + e.getMessage());
e.printStackTrace(); if (isVisualized()) {
if (myDesktopPane != null) {
JOptionPane.showMessageDialog(GUI.getTopParentContainer(), JOptionPane.showMessageDialog(GUI.getTopParentContainer(),
"Loading project directories failed.\nStack trace printed to console.", "Loading project directories failed.\nStack trace printed to console.",
"Error", JOptionPane.ERROR_MESSAGE); "Error", JOptionPane.ERROR_MESSAGE);
} else {
logger.fatal("Loading project directories failed");
logger.fatal("Stack trace:");
} }
e.printStackTrace();
} }
} }