X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Futil%2FPrefs.java;fp=src%2Fnet%2Fsf%2Fopenrocket%2Futil%2FPrefs.java;h=2b7c4101ddfe1fc4a71d3af6b5da4a26f2733347;hb=b3c3c1071dfdca4c6b3eb9935dc461201abdaf60;hp=049b546832ee5d657abebe15be1be8be50185cb6;hpb=fa61335265b0af5f9bc8800df953d41cde2d75f6;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/util/Prefs.java b/src/net/sf/openrocket/util/Prefs.java index 049b5468..2b7c4101 100644 --- a/src/net/sf/openrocket/util/Prefs.java +++ b/src/net/sf/openrocket/util/Prefs.java @@ -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); } }