[Pkg-osm-commits] [SCM] josm branch, maverick, updated. debian/0.0.svn3514-2-2-g2b1d62e

David Paleino dapal at debian.org
Sat Apr 16 21:20:42 UTC 2011


The following commit has been merged in the maverick branch:
commit 2b1d62e1a1c3b42e995de1661fafe9df272726e4
Author: David Paleino <dapal at debian.org>
Date:   Sat Apr 16 23:20:23 2011 +0200

    Backport fixed failed authorisation dialog from 4021, gives more verbose message of why the authorisation process failed. (needed for OSM License Change Phase III) (LP: #762634)

diff --git a/debian/changelog b/debian/changelog
index 8b397ee..a6eea7a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,11 @@
 josm (0.0.svn3514-2ubuntu1) UNRELEASED; urgency=low
 
   * Update Maintainer field
+  * Backport fixed failed authorisation dialog from 4021, gives
+    more verbose message of why the authorisation process failed.
+    (needed for OSM License Change Phase III) (LP: #762634)
 
- -- David Paleino <dapal at debian.org>  Sat, 16 Apr 2011 19:47:30 +0200
+ -- David Paleino <dapal at debian.org>  Sat, 16 Apr 2011 23:20:05 +0200
 
 josm (0.0.svn3514-2) unstable; urgency=low
 
diff --git a/debian/patches/100-backport_failedauth_explaination.patch b/debian/patches/100-backport_failedauth_explaination.patch
new file mode 100644
index 0000000..d1ccec5
--- /dev/null
+++ b/debian/patches/100-backport_failedauth_explaination.patch
@@ -0,0 +1,57 @@
+From: David Paleino <dapal at debian.org>
+Subject: backport fixed failed authorisation dialog from 4021
+Origin: vendor
+Forwarded: not-needed
+
+---
+ src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java |    3 +-
+ src/org/openstreetmap/josm/tools/ExceptionUtil.java     |   24 ++++++++++++++++
+ 2 files changed, 26 insertions(+), 1 deletion(-)
+
+--- josm.orig/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
++++ josm/src/org/openstreetmap/josm/gui/ExceptionDialogUtil.java
+@@ -271,9 +271,10 @@ public class ExceptionDialogUtil {
+      * @param e the exception
+      */
+     public static void explainAuthorizationFailed(OsmApiException e) {
++        // Fixme: add special handling that calls ExceptionUtil.explainFailedOAuthAuthorisation(e)
+         HelpAwareOptionPane.showOptionDialog(
+                 Main.parent,
+-                ExceptionUtil.explainFailedOAuthAuthorisation(e),
++                ExceptionUtil.explainFailedAuthorisation(e),
+                 tr("Authorisation Failed"),
+                 JOptionPane.ERROR_MESSAGE,
+                 ht("/ErrorMessages#AuthenticationFailed")
+--- josm.orig/src/org/openstreetmap/josm/tools/ExceptionUtil.java
++++ josm/src/org/openstreetmap/josm/tools/ExceptionUtil.java
+@@ -128,6 +128,30 @@ public class ExceptionUtil {
+         );
+     }
+ 
++   public static String explainFailedAuthorisation(OsmApiException e) {
++        e.printStackTrace();
++        String header = e.getErrorHeader();
++        String body = e.getErrorBody();
++        String msg = null;
++        if (header != null) {
++            if (body != null && !header.equals(body)) {
++                msg = header + " (" + body + ")";
++            } else {
++                msg = header;
++            }
++        } else {
++            msg = body;
++        }
++
++        return tr("<html>"
++                + "Authorisation at the OSM server failed.<br>"
++                + "The server reported the following error:<br>"
++                + "''{0}''"
++                + "</html>",
++                msg
++        );
++    }
++
+     public static String explainFailedOAuthAuthorisation(OsmApiException e) {
+         e.printStackTrace();
+         return tr("<html>"
diff --git a/debian/patches/series b/debian/patches/series
index f6aacf6..01e3792 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@
 70-default_look_and_feel.patch
 80-fix_images.patch
 90-fix_version.patch
+100-backport_failedauth_explaination.patch

-- 
Editor for OpenStreetMap



More information about the Pkg-osm-commits mailing list