Index: /applications/editors/josm/plugins/globalsat/build.xml
===================================================================
--- /applications/editors/josm/plugins/globalsat/build.xml	(revision 34513)
+++ /applications/editors/josm/plugins/globalsat/build.xml	(revision 34514)
@@ -5,5 +5,5 @@
     <property name="commit.message" value="Changed constructor signature of plugin main class"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
-    <property name="plugin.main.version" value="12840"/>
+    <property name="plugin.main.version" value="14153"/>
 
     <!-- Configure these properties (replace "..." accordingly).
Index: /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/GpsRec.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/GpsRec.java	(revision 34513)
+++ /applications/editors/josm/plugins/globalsat/src/org/kaintoch/gps/globalsat/dg100/GpsRec.java	(revision 34514)
@@ -69,23 +69,33 @@
 
     @Override
-    public boolean equals(Object arg0)
-    {
-        boolean isEqual = false;
-        if (arg0 != null && arg0 instanceof GpsRec)
-        {
-            GpsRec otherGpsRec = (GpsRec)arg0;
-            isEqual =
-                dg100TypeOfNextRec == otherGpsRec.dg100TypeOfNextRec
-                && dg100TypeOfCurRec == otherGpsRec.dg100TypeOfCurRec
-                && dg100Latitude == otherGpsRec.dg100Latitude
-                && dg100Longitude == otherGpsRec.dg100Longitude
-                && dg100TimeZ == otherGpsRec.dg100TimeZ
-                && dg100Date == otherGpsRec.dg100Date
-                && dg100Speed == otherGpsRec.dg100Speed
-                && dg100Altitude == otherGpsRec.dg100Altitude
-                //&& dg100Unk1 == otherGpsRec.unk1
-                ;
-        }
-        return isEqual;
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + dg100Altitude;
+        result = prime * result + dg100Date;
+        result = prime * result + dg100Latitude;
+        result = prime * result + dg100Longitude;
+        result = prime * result + dg100Speed;
+        result = prime * result + dg100TimeZ;
+        result = prime * result + dg100TypeOfCurRec;
+        result = prime * result + dg100TypeOfNextRec;
+        return result;
+    }
+
+    @Override
+    public boolean equals(Object obj) {
+        if (this == obj)
+            return true;
+        if (obj == null || getClass() != obj.getClass())
+            return false;
+        GpsRec other = (GpsRec) obj;
+        return dg100Altitude == other.dg100Altitude
+            && dg100Date == other.dg100Date
+            && dg100Latitude == other.dg100Latitude
+            && dg100Longitude == other.dg100Longitude
+            && dg100Speed == other.dg100Speed
+            && dg100TimeZ == other.dg100TimeZ
+            && dg100TypeOfCurRec == other.dg100TypeOfCurRec
+            && dg100TypeOfNextRec == other.dg100TypeOfNextRec;
     }
 
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 34513)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatConfigDialog.java	(revision 34514)
@@ -24,5 +24,5 @@
 
 import org.kaintoch.gps.globalsat.dg100.Dg100Config;
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
 
 /**
@@ -243,5 +243,5 @@
             break;
         default:
-            JOptionPane.showMessageDialog(Main.parent, tr("Unknown logFormat"));
+            JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Unknown logFormat"));
         }
 
@@ -260,5 +260,5 @@
     }
 
-    private static ButtonGroup createButtonGroup(AbstractButton ... buttons) {
+    private static ButtonGroup createButtonGroup(AbstractButton... buttons) {
         ButtonGroup group = new ButtonGroup();
         for (AbstractButton b : buttons) {
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 34513)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatImportDialog.java	(revision 34514)
@@ -21,5 +21,6 @@
 
 import org.kaintoch.gps.globalsat.dg100.Dg100Config;
-import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.MainApplication;
+import org.openstreetmap.josm.spi.preferences.Config;
 
 import gnu.io.CommPortIdentifier;
@@ -60,5 +61,5 @@
                     if (i instanceof CommPortIdentifier) {
                         GlobalsatPlugin.setPortIdent((CommPortIdentifier) i);
-                        Main.pref.put("globalsat.portIdentifier", ((CommPortIdentifier) i).getName());
+                        Config.getPref().put("globalsat.portIdentifier", ((CommPortIdentifier) i).getName());
                     }
                 }
@@ -105,5 +106,5 @@
                             GlobalsatConfigDialog dialog = new GlobalsatConfigDialog(conf);
                             JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-                            JDialog dlg = pane.createDialog(Main.parent, tr("Configure Device"));
+                            JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Configure Device"));
                             dlg.setVisible(true);
                             if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) {
@@ -112,8 +113,9 @@
                             dlg.dispose();
                         } else {
-                            JOptionPane.showMessageDialog(Main.parent, tr("Connection Error."), tr("Connection Error."), JOptionPane.ERROR);
+                            JOptionPane.showMessageDialog(MainApplication.getMainFrame(),
+                                    tr("Connection Error."), tr("Connection Error."), JOptionPane.ERROR);
                         }
                     } catch (GlobalsatDg100.ConnectionException ex) {
-                        JOptionPane.showMessageDialog(Main.parent, tr("Connection Error.") + " " + ex.toString());
+                        JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Connection Error.") + " " + ex.toString());
                     }
                     System.out.println("configuring the device finished");
@@ -130,5 +132,5 @@
 
         delete = new JCheckBox(tr("delete data after import"));
-        delete.setSelected(Main.pref.getBoolean("globalsat.deleteAfterDownload", false));
+        delete.setSelected(Config.getPref().getBoolean("globalsat.deleteAfterDownload", false));
 
         c.gridwidth = 3;
@@ -140,5 +142,5 @@
 
     public void refreshPorts() {
-        String sel = Main.pref.get("globalsat.portIdentifier");
+        String sel = Config.getPref().get("globalsat.portIdentifier");
         portCombo.setVisible(false);
         portCombo.removeAllItems();
Index: /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java
===================================================================
--- /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 34513)
+++ /applications/editors/josm/plugins/globalsat/src/org/openstreetmap/josm/plugins/globalsat/GlobalsatPlugin.java	(revision 34514)
@@ -12,5 +12,4 @@
 import javax.swing.JOptionPane;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
 import org.openstreetmap.josm.data.gpx.GpxData;
@@ -21,4 +20,5 @@
 import org.openstreetmap.josm.plugins.Plugin;
 import org.openstreetmap.josm.plugins.PluginInformation;
+import org.openstreetmap.josm.spi.preferences.Config;
 import org.openstreetmap.josm.tools.Logging;
 import org.openstreetmap.josm.tools.Shortcut;
@@ -61,12 +61,12 @@
         @Override protected void finish() {
             if (deleteAfter && GlobalsatPlugin.dg100().isCanceled() == false) {
-                Main.pref.putBoolean("globalsat.deleteAfterDownload", true);
+                Config.getPref().putBoolean("globalsat.deleteAfterDownload", true);
                 try {
                     GlobalsatPlugin.dg100().deleteData();
                 } catch (Exception ex) {
-                    JOptionPane.showMessageDialog(Main.parent, tr("Error deleting data.") + " " + ex.toString());
+                    JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Error deleting data.") + " " + ex.toString());
                 }
             } else {
-                Main.pref.putBoolean("globalsat.deleteAfterDownload", false);
+                Config.getPref().putBoolean("globalsat.deleteAfterDownload", false);
             }
             if (data != null && data.hasTrackPoints()) {
@@ -74,10 +74,10 @@
                 MainApplication.getMap().repaint();
             } else {
-                JOptionPane.showMessageDialog(Main.parent, tr("No data found on device."));
+                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("No data found on device."));
             }
             if (eee != null) {
                 eee.printStackTrace();
                 System.out.println(eee.getMessage());
-                JOptionPane.showMessageDialog(Main.parent, tr("Connection failed.") + " (" + eee.toString() + ")");
+                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), tr("Connection failed.") + " (" + eee.toString() + ")");
             }
             GlobalsatPlugin.dg100().disconnect();
@@ -103,5 +103,5 @@
             Logging.error(msg);
             if (!GraphicsEnvironment.isHeadless()) {
-                JOptionPane.showMessageDialog(Main.parent, "<html>" + msg + "</html>");
+                JOptionPane.showMessageDialog(MainApplication.getMainFrame(), "<html>" + msg + "</html>");
             }
         }
@@ -124,5 +124,5 @@
             GlobalsatImportDialog dialog = new GlobalsatImportDialog();
             JOptionPane pane = new JOptionPane(dialog, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-            JDialog dlg = pane.createDialog(Main.parent, tr("Import"));
+            JDialog dlg = pane.createDialog(MainApplication.getMainFrame(), tr("Import"));
             dlg.setVisible(true);
             if (((Integer) pane.getValue()) == JOptionPane.OK_OPTION) {
