better project load failure notification
This commit is contained in:
parent
0f0aab0005
commit
4af3e29af8
1 changed files with 10 additions and 5 deletions
|
@ -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.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;
|
package se.sics.cooja;
|
||||||
|
@ -363,11 +363,13 @@ public class GUI extends Observable {
|
||||||
try {
|
try {
|
||||||
reparseProjectConfig();
|
reparseProjectConfig();
|
||||||
} catch (ParseProjectsException e) {
|
} catch (ParseProjectsException e) {
|
||||||
logger.fatal("Error when loading project directories: " + e.getMessage());
|
logger.fatal("Error when loading projects: " + e.getMessage());
|
||||||
if (isVisualized()) {
|
if (isVisualized()) {
|
||||||
JOptionPane.showMessageDialog(GUI.getTopParentContainer(),
|
JOptionPane.showMessageDialog(GUI.getTopParentContainer(),
|
||||||
"Loading project directories failed.\nStack trace printed to console.",
|
"Default projects could not load, try to reconfigure project directories:" +
|
||||||
"Error", JOptionPane.ERROR_MESSAGE);
|
"\n\tMenu->Settings->Manage project directories" +
|
||||||
|
"\n\nSee console for stack trace with more information.",
|
||||||
|
"Project loading error", JOptionPane.ERROR_MESSAGE);
|
||||||
} else {
|
} else {
|
||||||
logger.fatal("Loading project directories failed");
|
logger.fatal("Loading project directories failed");
|
||||||
logger.fatal("Stack trace:");
|
logger.fatal("Stack trace:");
|
||||||
|
@ -845,7 +847,9 @@ public class GUI extends Observable {
|
||||||
private static void configureFrame(final GUI gui, boolean createSimDialog) {
|
private static void configureFrame(final GUI gui, boolean createSimDialog) {
|
||||||
|
|
||||||
// Create and set up the window.
|
// 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);
|
frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
|
||||||
|
|
||||||
// Add menu bar
|
// Add menu bar
|
||||||
|
@ -3322,6 +3326,7 @@ public class GUI extends Observable {
|
||||||
public void run() {
|
public void run() {
|
||||||
JDesktopPane desktop = new JDesktopPane();
|
JDesktopPane desktop = new JDesktopPane();
|
||||||
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
|
desktop.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
|
||||||
|
frame = new JFrame("COOJA Simulator");
|
||||||
GUI gui = new GUI(desktop);
|
GUI gui = new GUI(desktop);
|
||||||
configureFrame(gui, false);
|
configureFrame(gui, false);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue