Changeset 209

Show
Ignore:
Timestamp:
04/09/11 10:46:22 (14 months ago)
Author:
stefan
Message:

implemented issue #247: display error message when JErgometer is started without RXTX library

Location:
trunk
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGELOG

    r207 r209  
    44== coming 0.7.12 == 
    55* [stefan]  * fixed bug #182: JErgometer wants to update even if it's a bleeding edge version 
     6            * implemented issue #247: display error message when JErgometer is started without RXTX library 
    67 
    78== 0.7.11 == 
  • trunk/src/org/jergometer/communication/BikeConnectorSerial.java

    r208 r209  
    88 
    99import org.jergometer.translation.I18n; 
     10 
     11import javax.swing.*; 
    1012 
    1113/** 
     
    2325      driver.initialize(); 
    2426    } catch (Exception e) { 
    25       System.out.println("Didn't find " + driverName); 
     27      System.err.println("Could not load serial port driver \"" + driverName + "\"."); 
     28      e.printStackTrace(); 
    2629    } 
    2730  } 
  • trunk/src/org/jergometer/gui/SettingsWindow.java

    r208 r209  
    1515 */ 
    1616public class SettingsWindow extends JDialog { 
     17 
     18 
    1719  { 
    1820// GUI initializer generated by IntelliJ IDEA GUI Designer 
     
    258260  } 
    259261 
    260  
    261262  public enum ReturnCode { 
    262263    abort, save 
     
    380381    DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel(); 
    381382    int i = 0; 
    382     for (String s : BikeConnectorSerial.getPortNames()) { 
    383       comboBoxModel.addElement(s); 
    384       // check if this comport this the current comport 
    385       if (comPort != null && s.equals(comPort)) { 
    386         comPortIndex = i; 
    387       } 
    388       i++; 
    389     } 
     383 
     384    try { 
     385      // detect available serial ports 
     386      for (String s : BikeConnectorSerial.getPortNames()) { 
     387        comboBoxModel.addElement(s); 
     388        // check if this comport this the current comport 
     389        if (comPort != null && s.equals(comPort)) { 
     390          comPortIndex = i; 
     391        } 
     392        i++; 
     393      } 
     394    } catch (NoClassDefFoundError ignored) { 
     395    } catch (UnsatisfiedLinkError e) { 
     396      e.printStackTrace(); 
     397      JOptionPane.showMessageDialog(this, I18n.getString("msg.unsatisfied_link_error"), I18n.getString("error_dialog.title"), JOptionPane.ERROR_MESSAGE); 
     398    } catch (Exception e) { 
     399      e.printStackTrace(); 
     400      JOptionPane.showMessageDialog(this, I18n.getString("msg.connection_failed"), I18n.getString("error_dialog.title"), JOptionPane.ERROR_MESSAGE); 
     401    } 
     402 
    390403    // if comport is not in the list -> add it 
    391404    if (comPort != null && comPortIndex == -1) { 
  • trunk/src/org/jergometer/Jergometer.java

    r208 r209  
    364364        JOptionPane.showMessageDialog(mainWindow, I18n.getString("msg.configure_comport_first")); 
    365365        mainWindow.openSettingsWindow(); 
     366      } catch (NoClassDefFoundError e) { 
     367        JOptionPane.showMessageDialog(mainWindow, I18n.getString("msg.unsatisfied_link_error"), I18n.getString("error_dialog.title"), JOptionPane.ERROR_MESSAGE); 
     368        return; 
    366369      } catch (UnsatisfiedLinkError e) { 
    367370        e.printStackTrace(); 
  • trunk/src/org/jergometer/translation/jergometer_de.properties

    r207 r209  
    117117connection_tester.retrieving_ergometer_id=Hole Ergometer-ID 
    118118msg.com_port_used_by_the_following_application=Der COM-Port wird derzeit von der Anwendung "%s" genutzt! 
    119 msg.unsatisfied_link_error=JErgometer konnte leider nicht die richtige COM-Port-Bibliothek für Ihr Betriebssystem laden.\nBitte melden Sie das Problem dem Entwickler, indem Sie ihm eine Mail schreiben oder auf jergometer.org ein neues Ticket zu dem Problem anlegen.\nVergessen Sie dabei bitte nicht, Ihr Betriebsystem und die Fehlerausschriften im Konsolenfenster anzugeben. Danke. 
     119msg.unsatisfied_link_error=JErgometer konnte leider nicht die Serial-Port-Bibliothek für Ihr Betriebssystem laden.\nBitte melden Sie das Problem dem Entwickler, indem Sie ihm eine Mail schreiben oder auf jergometer.org ein einen Fehlerbericht (neues Ticket) verfassen.\nVergessen Sie dabei bitte nicht, Ihr Betriebsystem und die Fehlerausschriften im Konsolenfenster anzugeben. Danke. 
    120120error_dialog.title=Fehler! 
    121121menu.programs.edit=Editieren 
  • trunk/src/org/jergometer/translation/jergometer.properties

    r207 r209  
    9696connection_tester.retrieving_ergometer_id=Retrieving ergometer id 
    9797msg.com_port_used_by_the_following_application=COM port is currently owned by application "%s"! 
    98 msg.unsatisfied_link_error=JErgometer could not load the correct COM port library for your operating system.\nPlease file a bug report on jergometer.org and include the console output and the major information about your OS. Thanks. 
     98msg.unsatisfied_link_error=JErgometer could not load the serial port library for your operating system.\nPlease file a bug report on jergometer.org and include the console output and the info which OS you are using. Thanks. 
    9999error_dialog.title=Error! 
    100100menu.programs.edit=Edit