The following commit has been merged in the master branch:
commit bab4965d5cdc9c1c96a07ed60bc75ab13135323c
Author: Giovanni Mascellani <[email protected]>
Date: Sun Feb 20 11:32:23 2011 +0100
Fixing presets icons loading when the presets come from
openstreetmap-map-icons-*
packages.
diff --git a/debian/patches/40-elemstyles.patch
b/debian/patches/40-elemstyles.patch
index 09c9524..bf7d774 100644
--- a/debian/patches/40-elemstyles.patch
+++ b/debian/patches/40-elemstyles.patch
@@ -1,25 +1,80 @@
From: Andreas Putzo <[email protected]>
-Subject: the icons have been removed from the JAR file because they are
- already provided by the openstreetmap-map-icons-* packages.
- Point josm to the correct directory so that the icons are found.
-Forwarded: not-needed
+Date: Sun, 20 Feb 2011 10:15:10 +0100
+Subject: the icons have been removed from the JAR file because they are
already provided by the openstreetmap-map-icons-* packages. Point josm to the
correct directory so that the icons are found.
---
- src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java | 6 ++++--
- 1 file changed, 4 insertions(+), 2 deletions(-)
+ .../josm/gui/mappaint/MapPaintStyles.java | 10 ++++++++--
+ .../josm/gui/tagging/TaggingPreset.java | 17 +++++++++++++----
+ 2 files changed, 21 insertions(+), 6 deletions(-)
---- josm.orig/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
-+++ josm/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
-@@ -65,8 +65,10 @@ public class MapPaintStyles {
+diff --git a/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
b/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
+index 8c27b85..a6ae8ec 100644
+--- a/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
++++ b/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java
+@@ -58,6 +58,13 @@ public class MapPaintStyles {
+ return i;
+ }
+
++ public static void addDebianDirs(Collection<String> f) {
++ f.add("/usr/share/icons/openstreetmap/classic.small");
++ f.add("/usr/share/icons/openstreetmap/square.small");
++ f.add("/usr/share/icons/openstreetmap/classic.big");
++ f.add("/usr/share/icons/openstreetmap/square.big");
++ }
++
+ @SuppressWarnings("null")
+ public static void readFromPreferences() {
+ iconDirs = Main.pref.getCollection("mappaint.icon.sources",
Collections.<String>emptySet());
+@@ -65,8 +72,7 @@ public class MapPaintStyles {
{
LinkedList<String> f = new LinkedList<String>(iconDirs);
/* don't prefix icon path, as it should be generic */
- f.add("resource://images/styles/standard/");
- f.add("resource://images/styles/");
-+ f.add("/usr/share/icons/openstreetmap/classic.small");
-+ f.add("/usr/share/icons/openstreetmap/square.small");
-+ f.add("/usr/share/icons/openstreetmap/classic.big");
-+ f.add("/usr/share/icons/openstreetmap/square.big");
++ addDebianDirs(f);
iconDirs = f;
}
+diff --git a/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
b/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
+index e373f78..12fb479 100644
+--- a/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
++++ b/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java
+@@ -60,6 +60,7 @@ import org.openstreetmap.josm.gui.QuadStateCheckBox;
+ import org.openstreetmap.josm.gui.dialogs.relation.RelationEditor;
+ import org.openstreetmap.josm.gui.layer.Layer;
+ import org.openstreetmap.josm.gui.layer.OsmDataLayer;
++import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
+ import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
+ import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionItemPritority;
+ import org.openstreetmap.josm.gui.tagging.ac.AutoCompletionList;
+@@ -409,8 +410,8 @@ public class TaggingPreset extends AbstractAction
implements MapView.LayerChange
+ for (int i=0; i<value_array.length; i++) {
+ PresetListEnty e = new PresetListEnty(value_array[i]);
+ e.display_value = (locale_display_values == null)
+- ? (values_context == null ? tr(display_array[i])
+- : trc(values_context, display_array[i])) :
display_array[i];
++ ? (values_context == null ? tr(display_array[i])
++ : trc(values_context, display_array[i])) :
display_array[i];
+ if (short_descriptions_array != null) {
+ e.short_description = locale_short_descriptions == null ?
tr(short_descriptions_array[i])
+ : short_descriptions_array[i];
+@@ -826,8 +827,16 @@ public class TaggingPreset extends AbstractAction
implements MapView.LayerChange
+ ImageIcon icon = ImageProvider.getIfAvailable(s, "presets", null,
iconName, zipIcons);
+ if (icon == null)
+ {
+- System.out.println("Could not get presets icon " + iconName);
+- icon = new ImageIcon(iconName);
++ if (iconName.startsWith("styles/standard/")) {
++ String realIconName = iconName.replaceAll("styles/standard/",
"");
++ LinkedList<String> dirs = new LinkedList<String>();
++ MapPaintStyles.addDebianDirs(dirs);
++ icon = ImageProvider.getIfAvailable(dirs, "presets", null,
realIconName, zipIcons);
++ }
++ if (icon == null) {
++ System.out.println("Could not get presets icon " + iconName);
++ icon = new ImageIcon(iconName);
++ }
+ }
+ if (Math.max(icon.getIconHeight(), icon.getIconWidth()) != 16) {
+ icon = new ImageIcon(icon.getImage().getScaledInstance(16, 16,
Image.SCALE_SMOOTH));
+--
--
Java OpenStreetMap editor
_______________________________________________
Pkg-grass-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-grass-devel