Author: gmascellani-guest
Date: 2008-12-26 14:30:20 +0000 (Fri, 26 Dec 2008)
New Revision: 1829

Modified:
   packages/josm/trunk/debian/patches/20_bts.dpatch
Log:
Version, Debian release and last commit date are shown in the "About" dialog


Modified: packages/josm/trunk/debian/patches/20_bts.dpatch
===================================================================
--- packages/josm/trunk/debian/patches/20_bts.dpatch    2008-12-24 17:11:09 UTC 
(rev 1828)
+++ packages/josm/trunk/debian/patches/20_bts.dpatch    2008-12-26 14:30:20 UTC 
(rev 1829)
@@ -6,18 +6,58 @@
 
 @DPATCH@
 diff -urNad 
josm-0.0.svn1137~/src/org/openstreetmap/josm/actions/AboutAction.java 
josm-0.0.svn1137/src/org/openstreetmap/josm/actions/AboutAction.java
---- josm-0.0.svn1137~/src/org/openstreetmap/josm/actions/AboutAction.java      
2008-12-23 11:56:50.000000000 +0100
-+++ josm-0.0.svn1137/src/org/openstreetmap/josm/actions/AboutAction.java       
2008-12-23 11:57:49.000000000 +0100
-@@ -55,7 +55,7 @@
-               if(u == null) u = 
Main.class.getResource("/META-INF/MANIFEST.MF");
+--- josm-0.0.svn1137~/src/org/openstreetmap/josm/actions/AboutAction.java      
2008-12-25 12:19:43.000000000 +0100
++++ josm-0.0.svn1137/src/org/openstreetmap/josm/actions/AboutAction.java       
2008-12-25 12:20:52.000000000 +0100
+@@ -12,6 +12,7 @@
+ import java.io.IOException;
+ import java.io.InputStream;
+ import java.io.InputStreamReader;
++import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.util.Map.Entry;
+ import java.util.regex.Matcher;
+@@ -46,19 +47,31 @@
+ public class AboutAction extends JosmAction {
+ 
+       public static final String version;
++      public static final String debianRelease;
+ 
+       private final static JTextArea revision;
+       private static String time;
+ 
+       static {
+               URL u = Main.class.getResource("/REVISION");
+-              if(u == null) u = 
Main.class.getResource("/META-INF/MANIFEST.MF");
++        if(u == null) {
++            try {
++                u = new URL("jar:" + 
Main.class.getProtectionDomain().getCodeSource().getLocation().toString() 
++                        + "!/META-INF/MANIFEST.MF");
++            } catch (MalformedURLException e) {
++                e.printStackTrace();
++            }
++        }
                revision = loadFile(u);
  
 -              Pattern versionPattern = 
Pattern.compile(".*?(?:Revision|Main-Version): ([0-9]*).*", 
Pattern.CASE_INSENSITIVE|Pattern.DOTALL);
-+              Pattern versionPattern = 
Pattern.compile(".*?(?:Revision|Main-Version): ([[0-9].-]*).*", 
Pattern.CASE_INSENSITIVE|Pattern.DOTALL);
++              Pattern versionPattern = 
Pattern.compile(".*?(?:Revision|Main-Version): ([0-9]*(?: SVN)?).*", 
Pattern.CASE_INSENSITIVE|Pattern.DOTALL);
                Matcher match = versionPattern.matcher(revision.getText());
                version = match.matches() ? match.group(1) : tr("UNKNOWN");
  
-@@ -86,7 +86,7 @@
++              Pattern debianReleasePattern = 
Pattern.compile(".*?(?:Debian-Release): ([^\n]*).*", 
Pattern.CASE_INSENSITIVE|Pattern.DOTALL);
++              match = debianReleasePattern.matcher(revision.getText());
++              debianRelease = match.matches() ? match.group(1) : 
tr("UNKNOWN");
++
+               Pattern timePattern = Pattern.compile(".*?(?:Last Changed 
Date|Main-Date): ([^\n]*).*", Pattern.CASE_INSENSITIVE|Pattern.DOTALL);
+               match = timePattern.matcher(revision.getText());
+               time = match.matches() ? match.group(1) : tr("UNKNOWN");
+@@ -80,13 +93,14 @@
+ 
+               JPanel info = new JPanel(new GridBagLayout());
+               info.add(new JLabel(tr("Java OpenStreetMap Editor Version 
{0}",version)), GBC.eol().fill(GBC.HORIZONTAL));
++              info.add(new JLabel(tr("Debian release: {0}",debianRelease)), 
GBC.eol().fill(GBC.HORIZONTAL));
+               info.add(new JLabel(tr("last change at {0}",time)), 
GBC.eol().fill(GBC.HORIZONTAL));
+               info.add(new JLabel(tr("Java Version 
{0}",System.getProperty("java.version"))), GBC.eol().fill(GBC.HORIZONTAL));
+               info.add(GBC.glue(0,10), GBC.eol());
                info.add(new JLabel(tr("Homepage")), 
GBC.std().insets(0,0,10,0));
                info.add(new UrlLabel("http://josm.openstreetmap.de";), 
GBC.eol().fill(GBC.HORIZONTAL));
                info.add(new JLabel(tr("Bug Reports")), 
GBC.std().insets(0,0,10,0));
@@ -27,8 +67,8 @@
                info.add(new UrlLabel("http://www.opengeodata.org/?cat=17";), 
GBC.eol().fill(GBC.HORIZONTAL));
  
 diff -urNad 
josm-0.0.svn1137~/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
 
josm-0.0.svn1137/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
---- 
josm-0.0.svn1137~/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
  2008-12-23 11:56:50.000000000 +0100
-+++ 
josm-0.0.svn1137/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
   2008-12-23 11:56:59.000000000 +0100
+--- 
josm-0.0.svn1137~/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
  2008-12-25 12:19:43.000000000 +0100
++++ 
josm-0.0.svn1137/src/org/openstreetmap/josm/tools/BugReportExceptionHandler.java
   2008-12-25 12:20:36.000000000 +0100
 @@ -91,8 +91,8 @@
  
                        Object[] options = new String[]{tr("Do nothing"), 
tr("Report Bug")};


_______________________________________________
Pkg-grass-devel mailing list
Pkg-grass-devel@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel

Reply via email to