Index: applications/editors/josm/plugins/agpifoj/.classpath
===================================================================
--- applications/editors/josm/plugins/agpifoj/.classpath	(revision 16603)
+++ applications/editors/josm/plugins/agpifoj/.classpath	(revision 16603)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/JOSM"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: applications/editors/josm/plugins/agpifoj/.project
===================================================================
--- applications/editors/josm/plugins/agpifoj/.project	(revision 16603)
+++ applications/editors/josm/plugins/agpifoj/.project	(revision 16603)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JOSM-agpifoj</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: applications/editors/josm/plugins/agpifoj/build.xml
===================================================================
--- applications/editors/josm/plugins/agpifoj/build.xml	(revision 16602)
+++ applications/editors/josm/plugins/agpifoj/build.xml	(revision 16603)
@@ -34,5 +34,5 @@
                 <attribute name="Plugin-Early" value="false"/>
                 <attribute name="Plugin-Link" value="http://wiki.openstreetmap.org/index.php/JOSM/Plugins/AgPifoJ"/>
-                <attribute name="Plugin-Mainversion" value="1725"/>
+                <attribute name="Plugin-Mainversion" value="1815"/>
                 <attribute name="Plugin-Version" value="${version.entry.commit.revision}"/>
             </manifest>
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 16602)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/AgpifojLayer.java	(revision 16603)
@@ -30,5 +30,4 @@
 import org.openstreetmap.josm.actions.RenameLayerAction;
 import org.openstreetmap.josm.data.coor.CachedLatLon;
-import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
@@ -103,4 +102,5 @@
         private final File[] selection;
         private HashSet<String> loadedDirectories = new HashSet<String>();
+        private String errorMessage = "";
 
         public Loader(File[] selection) {
@@ -111,5 +111,5 @@
         @Override protected void realRun() throws IOException {
 
-            Main.pleaseWaitDlg.currentAction.setText(tr("Starting directory scan"));
+            progressMonitor.subTask(tr("Starting directory scan"));
             List<File> files = new ArrayList<File>();
             try {
@@ -123,13 +123,10 @@
             }
 
-            Main.pleaseWaitDlg.currentAction.setText(tr("Read photos..."));
+            progressMonitor.subTask(tr("Read photos..."));
+            progressMonitor.setTicksCount(files.size());
 
             // read the image files
             ArrayList<ImageEntry> data = new ArrayList<ImageEntry>(files.size());
 
-            int progress = 0;
-            Main.pleaseWaitDlg.progress.setMaximum(files.size());
-            Main.pleaseWaitDlg.progress.setValue(progress);
-
             for (File f : files) {
 
@@ -138,6 +135,6 @@
                 }
 
-                Main.pleaseWaitDlg.currentAction.setText(tr("Reading {0}...", f.getName()));
-                Main.pleaseWaitDlg.progress.setValue(progress++);
+                progressMonitor.subTask(tr("Reading {0}...", f.getName()));
+                progressMonitor.worked(1);
 
                 ImageEntry e = new ImageEntry();
@@ -157,4 +154,5 @@
             layer = new AgpifojLayer(data);
             files.clear();
+            progressMonitor.setErrorMessage(errorMessage);
         }
 
@@ -189,5 +187,5 @@
                     File[] children = f.listFiles(AgpifojPlugin.JPEG_FILE_FILTER);
                     if (children != null) {
-                        Main.pleaseWaitDlg.currentAction.setText(tr("Scanning directory {0}", f.getPath()));
+                        progressMonitor.subTask(tr("Scanning directory {0}", f.getPath()));
                         try {
                             addRecursiveFiles(files, children);
@@ -197,5 +195,5 @@
                         }
                     } else {
-                        errorMessage += tr("Error while getting files from directory {0}\n", f.getPath());
+                    	errorMessage += tr("Error while getting files from directory {0}\n", f.getPath());
                     }
 
Index: applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java
===================================================================
--- applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 16602)
+++ applications/editors/josm/plugins/agpifoj/src/org/openstreetmap/josm/plugins/agpifoj/CorrelateGpxWithImages.java	(revision 16603)
@@ -10,13 +10,13 @@
 import java.awt.Cursor;
 import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
 import java.awt.FlowLayout;
 import java.awt.GridBagConstraints;
 import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
 import java.io.File;
 import java.io.FileInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -35,9 +35,4 @@
 import javax.swing.AbstractListModel;
 import javax.swing.ButtonGroup;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.filechooser.FileFilter;
 import javax.swing.JButton;
 import javax.swing.JComboBox;
@@ -52,6 +47,11 @@
 import javax.swing.JTextField;
 import javax.swing.ListSelectionModel;
-
-import org.openstreetmap.josm.data.coor.EastNorth;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.filechooser.FileFilter;
+
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.data.gpx.GpxTrack;
@@ -62,5 +62,4 @@
 import org.openstreetmap.josm.gui.layer.Layer;
 import org.openstreetmap.josm.io.GpxReader;
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.plugins.agpifoj.AgpifojLayer.ImageEntry;
 import org.openstreetmap.josm.tools.ExifReader;
@@ -678,6 +677,4 @@
         }
 
-        // Free the user's vision
-        Main.pleaseWaitDlg.setVisible(false);
         AgpifojDialog dialog = AgpifojDialog.getInstance();
         dialog.action.button.setSelected(true);
