Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 17089)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastreInterface.java	(revision 17181)
@@ -72,9 +72,9 @@
         } catch (IOException e) {
             /*JOptionPane.showMessageDialog(Main.parent,
-                    tr("Town/city {0} not found or not available in WMS.\n" +
-                            "Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation()));*/
+                    tr("Town/city {0} not found or not available\n" +
+                            "or action canceled", wmsLayer.getLocation()));*/
             JOptionPane pane = new JOptionPane(
-                    tr("Town/city {0} not found or not available in WMS.\n" +
-                            "Please check its availibility on www.cadastre.gouv.fr", wmsLayer.getLocation()),
+                    tr("Town/city {0} not found or not available\n" +
+                            "or action canceled", wmsLayer.getLocation()),
                             JOptionPane.INFORMATION_MESSAGE);
             // this below is a temporary workaround to fix the "always on top" issue
@@ -260,16 +260,18 @@
                 // list of values parsed in listOfFeuilles (list all non-georeferenced images)
                 lines = getFeuillesList();
-                parseFeuillesList(lines);
-                if (listOfFeuilles.size() > 0) {
-                    int res = selectFeuilleDialog();
-                    if (res != -1) {
-                        wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).name);
-                        checkLayerDuplicates(wmsLayer);
-                        interfaceRef = buildRasterFeuilleInterfaceRef(wmsLayer.getCodeCommune());
-                        wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).ref);
-                        lines = buildRasterFeuilleInterfaceRef(listOfFeuilles.elementAt(res).ref);
-                        System.out.println("interface ref.:"+lines);
-                        return lines;
-                    }
+                if (!downloadCancelled) {
+                	parseFeuillesList(lines);
+	                if (listOfFeuilles.size() > 0) {
+	                    int res = selectFeuilleDialog();
+	                    if (res != -1) {
+	                        wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).name);
+	                        checkLayerDuplicates(wmsLayer);
+	                        interfaceRef = buildRasterFeuilleInterfaceRef(wmsLayer.getCodeCommune());
+	                        wmsLayer.setCodeCommune(listOfFeuilles.elementAt(res).ref);
+	                        lines = buildRasterFeuilleInterfaceRef(listOfFeuilles.elementAt(res).ref);
+	                        System.out.println("interface ref.:"+lines);
+	                        return lines;
+	                    }
+	                }
                 }
                 return null;
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 17089)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/CadastrePreferenceSetting.java	(revision 17181)
@@ -6,4 +6,5 @@
 import java.awt.event.ActionListener;
 import javax.swing.*;
+
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
@@ -34,4 +35,6 @@
     private JCheckBox drawBoundaries = new JCheckBox(tr("Draw boundaries of downloaded data."));
 
+    private JCheckBox disableImageCropping = new JCheckBox(tr("Disable image cropping during georeferencing."));
+    
     private JRadioButton grabMultiplier1 = new JRadioButton("", true);
 
@@ -106,4 +109,7 @@
         cadastrewms.add(drawBoundaries, GBC.eop().insets(0, 0, 0, 5));
 
+        // separator
+        cadastrewms.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
+        
         // the vectorized images multiplier
         JLabel jLabelScale = new JLabel(tr("Vector images grab multiplier:"));
@@ -154,4 +160,7 @@
         cadastrewms.add(grabMultiplier4Size, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 0, 5));
 
+        // separator
+        cadastrewms.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
+
         // for raster images (not vectorized), image grab divider (from 1 to 10)
         String savedRasterDivider = Main.pref.get("cadastrewms.rasterDivider", DEFAULT_RASTER_DIVIDER);
@@ -161,4 +170,11 @@
         cadastrewms.add(jLabelRasterDivider, GBC.std().insets(0, 5, 10, 0));
         cadastrewms.add(rasterDivider, GBC.eol().fill(GBC.HORIZONTAL).insets(5, 5, 200, 5));
+        // option to disable image cropping during raster image georeferencing
+        disableImageCropping.setSelected(Main.pref.getBoolean("cadastrewms.noImageCropping", false));
+        disableImageCropping.setToolTipText(tr("Disable image cropping during georeferencing."));
+        cadastrewms.add(disableImageCropping, GBC.eop().insets(0, 0, 0, 5));
+
+        // separator
+        cadastrewms.add(new JSeparator(SwingConstants.HORIZONTAL), GBC.eol().fill(GBC.HORIZONTAL));
 
         // option to enable automatic caching
@@ -213,4 +229,5 @@
         } catch (NumberFormatException e) { // ignore the last input
         }
+        Main.pref.put("cadastrewms.noImageCropping", disableImageCropping.isSelected());
         Main.pref.put("cadastrewms.enableCaching", enableCache.isSelected());
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 17089)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/DownloadWMSPlanImage.java	(revision 17181)
@@ -91,4 +91,5 @@
         protected void cancel() {
             grabber.getWmsInterface().cancel();
+            dontGeoreference = true;
         }
 
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 17089)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrab.java	(revision 17181)
@@ -37,5 +37,5 @@
                         tr("To enable the cadastre WMS plugin, change\n"
                          + "the current projection to one of the cadastre\n"
-                         + "projection and retry"));
+                         + "projections and retry"));
             }
         }
Index: applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java
===================================================================
--- applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 17089)
+++ applications/editors/josm/plugins/cadastre-fr/src/cadastre_fr/MenuActionGrabPlanImage.java	(revision 17181)
@@ -81,5 +81,5 @@
                         tr("To enable the cadastre WMS plugin, change\n"
                          + "the current projection to one of the cadastre\n"
-                         + "projection and retry"));
+                         + "projections and retry"));
             }
         }
@@ -91,9 +91,9 @@
         if (wmsLayer.images.size() == 1 && !loadedFromCache) {
             Main.map.mapView.addMouseListener(this);
-            mousePrevious.setLocation(0, 0);
-            mode = cGetCorners;
-            JOptionPane.showMessageDialog(Main.parent,tr("Click first corner for image cropping\n"+
-                    "(two points required)"));
-        } else // action cancelled or image loaded from cache (and already georeferenced)
+            if (Main.pref.getBoolean("cadastrewms.noImageCropping", false) == false)
+                startCropping();
+            else
+                startGeoreferencing();
+    	} else // action cancelled or image loaded from cache (and already georeferenced)
             Main.map.repaint();
     }
@@ -114,36 +114,130 @@
             if (countMouseClicked == 1) {
                 ea1 = ea;
-                JOptionPane.showMessageDialog(Main.parent,tr("Click second corner for image cropping"));
+                continueCropping();
             }
             if (countMouseClicked == 2) {
                 wmsLayer.cropImage(ea1, ea);
                 Main.map.mapView.repaint();
-                countMouseClicked = 0;
-                mode = cGetLambertCrosspieces;
-                JOptionPane.showMessageDialog(Main.parent,tr("Click first Lambert crosspiece for georeferencing\n"+
-                    "(two points required)"));
+                startGeoreferencing();
             }
         } else if (mode == cGetLambertCrosspieces) {
             if (countMouseClicked == 1) {
                 ea1 = ea; 
-                georefpoint1 = inputLambertPosition();
-                if (georefpoint1 == null)
-                    return;
-                JOptionPane.showMessageDialog(Main.parent,tr("Click second Lambert crosspiece for georeferencing\n"));
+                if (inputLambertPosition())
+                    continueGeoreferencing();
             }
             if (countMouseClicked == 2) {
-                Main.map.mapView.removeMouseListener(this);
-                georefpoint2 = inputLambertPosition();
-                if (georefpoint2 == null)
-                    return;
-                affineTransform(ea1, ea, georefpoint1, georefpoint2);
-                wmsLayer.saveNewCache();
-                Main.map.mapView.repaint();
-                actionCompleted();
+                if (inputLambertPosition()) {
+                    Main.map.mapView.removeMouseListener(this);
+                    affineTransform(ea1, ea, georefpoint1, georefpoint2);
+                    wmsLayer.saveNewCache();
+                    Main.map.mapView.repaint();
+                    actionCompleted();
+                }
             }
         }
     }
     
-    private EastNorth inputLambertPosition() {
+    /**
+     * 
+     * @return false if all operations are canceled
+     */
+    private boolean startCropping() {
+	    mode = cGetCorners;
+	    countMouseClicked = 0;
+		Object[] options = { "OK", "Cancel" };
+		int ret = JOptionPane.showOptionDialog( null, 
+				tr("Click first corner for image cropping\n(two points required)"),
+				tr("Image cropping"),
+	    		JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
+	    		null, options, options[0]);
+	    if (ret == JOptionPane.OK_OPTION) {
+	        mousePrevious.setLocation(0, 0);
+	    } else
+	    	if (canceledOrRestartCurrAction("image cropping"))
+	    		return startCropping();
+	    return true;
+    }
+    
+    /**
+     * 
+     * @return false if all operations are canceled
+     */
+    private boolean continueCropping() {
+		Object[] options = { "OK", "Cancel" };
+		int ret = JOptionPane.showOptionDialog( null, 
+				tr("Click second corner for image cropping"),
+				tr("Image cropping"),
+	    		JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
+	    		null, options, options[0]);
+	    if (ret != JOptionPane.OK_OPTION) {
+	    	if (canceledOrRestartCurrAction("image cropping"))
+	    		return startCropping();
+	    }
+	    return true;
+    }
+    
+    /**
+     * 
+     * @return false if all operations are canceled
+     */
+    private boolean startGeoreferencing() {
+	    countMouseClicked = 0;
+	    mode = cGetLambertCrosspieces;
+		Object[] options = { "OK", "Cancel" };
+		int ret = JOptionPane.showOptionDialog( null, 
+				tr("Click first Lambert crosspiece for georeferencing\n(two points required)"),
+				tr("Image georeferencing"),
+	    		JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
+	    		null, options, options[0]);
+	    if (ret == JOptionPane.OK_OPTION) {
+	        mousePrevious.setLocation(0, 0);
+	    } else
+	    	if (canceledOrRestartCurrAction("georeferencing"))
+	    		return startGeoreferencing();
+	    return true;
+    }
+
+    /**
+     * 
+     * @return false if all operations are canceled
+     */
+    private boolean continueGeoreferencing() {
+		Object[] options = { "OK", "Cancel" };
+		int ret = JOptionPane.showOptionDialog( null, 
+				tr("Click second Lambert crosspiece for georeferencing"),
+				tr("Image georeferencing"),
+	    		JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE,
+	    		null, options, options[0]);
+	    if (ret != JOptionPane.OK_OPTION) {
+	    	if (canceledOrRestartCurrAction("georeferencing"))
+	    		return startGeoreferencing();
+	    }
+	    return true;
+    }
+    
+    /**
+     * 
+     * @return false if all operations are canceled
+     */
+    private boolean canceledOrRestartCurrAction(String action) {
+    	Object[] options = { "Cancel", "Retry" };
+    	int selectedValue = JOptionPane.showOptionDialog( null, 
+        		tr("Do you want to cancel completely\n"+
+        				"or just retry "+action+" ?"), "",
+        		JOptionPane.DEFAULT_OPTION, JOptionPane.WARNING_MESSAGE,
+        		null, options, options[0]);
+        if (selectedValue == 0) { // "Cancel"
+        	// remove layer
+        	Main.map.mapView.removeLayer(wmsLayer);
+            wmsLayer = null;
+            Main.map.mapView.removeMouseListener(this);
+        	return false;
+        } else
+            countMouseClicked = 0;
+        return true;
+    }
+    
+    private boolean inputLambertPosition() {
         JLabel labelEnterPosition = new JLabel(tr("Enter cadastre east,north position"));
         JLabel labelWarning = new JLabel(tr("(Warning: verify north with arrow !!)"));
@@ -160,16 +254,27 @@
         p.add(inputNorth, GBC.eol().fill(GBC.HORIZONTAL).insets(10, 5, 0, 5));
         JOptionPane pane = new JOptionPane(p, JOptionPane.INFORMATION_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null);
-        pane.createDialog(Main.parent, tr("Set Lambert coordinate")).setVisible(true);
-        if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue()))
-            return null;
-        if (inputEast.getText().length() == 0 || inputNorth.getText().length() == 0)
-            return null;
-        try {
-            double e = Double.parseDouble(inputEast.getText());
-            double n = Double.parseDouble(inputNorth.getText());
-            return new EastNorth(e, n);
-        } catch (NumberFormatException e) {
-            return null;
-        }        
+        String number;
+        if (countMouseClicked == 1) number = "first";
+        else number = "second";
+        pane.createDialog(Main.parent, tr("Set "+number+" Lambert coordinate")).setVisible(true);
+        if (!Integer.valueOf(JOptionPane.OK_OPTION).equals(pane.getValue())) {
+            if (canceledOrRestartCurrAction("georeferencing"))
+                startGeoreferencing();
+            return false;
+        }
+        if (inputEast.getText().length() != 0 && inputNorth.getText().length() != 0) {
+            try {
+                double e = Double.parseDouble(inputEast.getText());
+                double n = Double.parseDouble(inputNorth.getText());
+                if (countMouseClicked == 1)
+                    georefpoint1 = new EastNorth(e, n);
+                else
+                    georefpoint2 = new EastNorth(e, n);
+                return true;
+            } catch (NumberFormatException e) {
+                return false;
+            }
+        }
+        return false;
     }
     
