updates for 0.9.4
[debian/openrocket] / src / net / sf / openrocket / util / Prefs.java
index 049b546832ee5d657abebe15be1be8be50185cb6..2b7c4101ddfe1fc4a71d3af6b5da4a26f2733347 100644 (file)
@@ -18,6 +18,7 @@ import java.util.prefs.Preferences;
 
 import net.sf.openrocket.database.Databases;
 import net.sf.openrocket.document.Simulation;
+import net.sf.openrocket.gui.main.ExceptionHandler;
 import net.sf.openrocket.material.Material;
 import net.sf.openrocket.rocketcomponent.BodyComponent;
 import net.sf.openrocket.rocketcomponent.FinSet;
@@ -62,7 +63,8 @@ public class Prefs {
                        InputStream is = ClassLoader.getSystemResourceAsStream("build.properties");
                        if (is == null) {
                                throw new MissingResourceException(
-                                               "build.properties not found, distribution built wrong",
+                                               "build.properties not found, distribution built wrong" + 
+                                               "   path:"+System.getProperty("java.class.path"),
                                                "build.properties", "build.version");
                        }
                        
@@ -172,6 +174,16 @@ public class Prefs {
        }
        
        
+       public static String getUniqueID() {
+               String id = PREFNODE.get("id", null);
+               if (id == null) {
+                       id = UniqueID.generateHashedID();
+                       PREFNODE.put("id", id);
+               }
+               return id;
+       }
+       
+       
        
        public static void storeVersion() {
                PREFNODE.put("OpenRocketVersion", getVersion());
@@ -471,8 +483,7 @@ public class Prefs {
                        }
                        
                } catch (BackingStoreException e) {
-                       System.err.println("BackingStoreException:");
-                       e.printStackTrace();
+                       ExceptionHandler.handleErrorCondition(e);
                }
        }