From: Bob J. <jac...@us...> - 2002-07-29 06:14:35
|
Update of /cvsroot/jmri/apps In directory usw-pr-cvs1:/tmp/cvs-serv30163 Modified Files: AbstractConfigFrame.java Log Message: dialog if port in config file not available. Fix errors with null attributes during store Index: AbstractConfigFrame.java =================================================================== RCS file: /cvsroot/jmri/apps/AbstractConfigFrame.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** AbstractConfigFrame.java 28 Jul 2002 05:41:38 -0000 1.13 --- AbstractConfigFrame.java 29 Jul 2002 06:14:32 -0000 1.14 *************** *** 553,558 **** public Element getConnection() { Element e = new Element("connection"); ! e.addAttribute("class", getCurrentProtocolName()); ! e.addAttribute("port", getCurrentPortName()); if (getCurrentBaudRate()!=null) e.addAttribute("speed", getCurrentBaudRate()); --- 553,563 ---- public Element getConnection() { Element e = new Element("connection"); ! // many of the following are required by the DTD; failing to include ! // them makes the XML file unreadable, but at least the next ! // invocation of the program can then continue. ! if (getCurrentProtocolName()!=null) ! e.addAttribute("class", getCurrentProtocolName()); ! if (getCurrentPortName()!=null) ! e.addAttribute("port", getCurrentPortName()); if (getCurrentBaudRate()!=null) e.addAttribute("speed", getCurrentBaudRate()); *************** *** 590,594 **** // can't connect to a non-existant port! log.error("Configured port \""+portName+"\" doesn't exist, no connection to layout made"); ! return false; } --- 595,601 ---- // can't connect to a non-existant port! log.error("Configured port \""+portName+"\" doesn't exist, no connection to layout made"); ! JOptionPane.showMessageDialog(null, "Configured port \""+portName+"\" doesn't exist, no connection to layout made", ! "Error", JOptionPane.ERROR_MESSAGE); ! return false; } |