Changeset 4172 in josm


Ignore:
Timestamp:
2011-06-26T13:43:35+02:00 (8 years ago)
Author:
stoecker
Message:

remove unused icons, make connection timouts configurable and increase them a bit to handle JOSM server delays

Location:
trunk
Files:
2 added
1 deleted
14 edited
2 copied
64 moved

Legend:

Unmodified
Added
Removed
  • trunk/geticons.pl

    r3945 r4172  
    55my @default = (
    66  "styles/standard/*.xml",
     7  "styles/standard/*.mapcss",
    78  "data/*.xml",
    89  "src/org/openstreetmap/josm/*.java",
     
    3233        my $img = "styles/standard/$1";
    3334        $img = "styles/$1" if((!-f "images/$img") && -f "images/styles/$1");
     35        $img = $1 if((!-f "images/$img") && -f "images/$1");
    3436        ++$icons{$img};
    3537      }
    36       elsif($l =~ /icon\s*=\s*["']([^+]+?)["']/)
     38      elsif($l =~ /icon\s*[:=]\s*["']([^+]+?)["']/)
    3739      {
    3840        ++$icons{$1};
    3941      }
    4042
     43      if($l =~ /icon-image:\s*\"?(.*?)\"?\s*;/)
     44      {
     45        my $img = "styles/standard/$1";
     46        $img = "styles/$1" if((!-f "images/$img") && -f "images/styles/$1");
     47        $img = $1 if((!-f "images/$img") && -f "images/$1");
     48        ++$icons{$img};
     49      }
    4150      if($l =~ /ImageProvider\.get\(\"([^\"]*?)\"\)/)
    4251      {
     
    4554        ++$icons{$i};
    4655      }
     56      while($l =~ /\/\*\s*ICON\s*\*\/\s*\"(.*?)\"/g)
     57      {
     58        my $i = $1;
     59        $i .= ".png" if !($i =~ /\.png$/);
     60        ++$icons{$i};
     61      }
     62      while($l =~ /\/\*\s*ICON\((.*?)\)\s*\*\/\s*\"(.*?)\"/g)
     63      {
     64        my $i = "$1$2";
     65        $i .= ".png" if !($i =~ /\.png$/);
     66        ++$icons{$i};
     67      }
    4768      if($l =~ /new\s+ImageLabel\(\"(.*?)\"/)
    4869      {
     
    81102      {
    82103        my $i = "cursor/$1";
     104        $i .= ".png" if !($i =~ /\.png$/);
     105        ++$icons{$i};
     106      }
     107      if($l =~ /SideButton*\(\s*(?:mark)?tr\s*\(\s*\".*?\"\s*\)\s*,\s*\"(.*?)\"/)
     108      {
     109        my $i = "dialogs/$1";
    83110        $i .= ".png" if !($i =~ /\.png$/);
    84111        ++$icons{$i};
  • trunk/src/org/openstreetmap/josm/actions/AddImageryLayerAction.java

    r4032 r4172  
    1616
    1717    public AddImageryLayerAction(ImageryInfo info) {
    18         super(info.getMenuName(), "imagery_menu", tr("Add imagery layer {0}",info.getName()), null, false, false);
     18        super(info.getMenuName(), /* ICON */"imagery_menu", tr("Add imagery layer {0}",info.getName()), null, false, false);
    1919        putValue("toolbar", "imagery_" + info.getToolbarName());
    2020        this.info = info;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitiveType.java

    r4100 r4172  
    88public enum OsmPrimitiveType {
    99
    10     NODE (marktr("node"), Node.class, NodeData.class),
    11     WAY  (marktr("way"), Way.class, WayData.class),
    12     RELATION (marktr("relation"), Relation.class, RelationData.class),
     10    NODE (marktr(/* ICON(data/) */"node"), Node.class, NodeData.class),
     11    WAY  (marktr(/* ICON(data/) */"way"), Way.class, WayData.class),
     12    RELATION (marktr(/* ICON(data/) */"relation"), Relation.class, RelationData.class),
    1313
    1414    /* only for display, no real type */
    15     CLOSEDWAY  (marktr("closedway"), null, WayData.class),
    16     MULTIPOLYGON (marktr("multipolygon"), null, RelationData.class);
     15    CLOSEDWAY  (marktr(/* ICON(data/) */"closedway"), null, WayData.class),
     16    MULTIPOLYGON (marktr(/* ICON(data/) */"multipolygon"), null, RelationData.class);
    1717
    1818    private final String apiTypeName;
  • trunk/src/org/openstreetmap/josm/data/validation/Severity.java

    r4162 r4172  
    1212public enum Severity {
    1313    /** Error messages */
    14     ERROR(tr("Errors"), "error",       Main.pref.getColor(marktr("validation error"), Color.RED)),
     14    ERROR(tr("Errors"), /* ICON(data/) */"error",       Main.pref.getColor(marktr("validation error"), Color.RED)),
    1515    /** Warning messages */
    16     WARNING(tr("Warnings"), "warning", Main.pref.getColor(marktr("validation warning"), Color.YELLOW)),
     16    WARNING(tr("Warnings"), /* ICON(data/) */"warning", Main.pref.getColor(marktr("validation warning"), Color.YELLOW)),
    1717    /** Other messages */
    18     OTHER(tr("Other"), "other",        Main.pref.getColor(marktr("validation other"), Color.CYAN));
     18    OTHER(tr("Other"), /* ICON(data/) */"other",        Main.pref.getColor(marktr("validation other"), Color.CYAN));
    1919
    2020    /** Description of the severity code */
  • trunk/src/org/openstreetmap/josm/gui/ImageryMenu.java

    r4143 r4172  
    7070    Map_Rectifier_WMSmenuAction rectaction = new Map_Rectifier_WMSmenuAction();
    7171    JosmAction blankmenu = new JosmAction(
    72             tr("Blank Layer"), "blankmenu", tr("Open a blank WMS layer to load data from a file"), null, false) {
     72            tr("Blank Layer"), /* ICON */"blankmenu", tr("Open a blank WMS layer to load data from a file"), null, false) {
    7373        @Override
    7474        public void actionPerformed(ActionEvent ev) {
  • trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java

    r4141 r4172  
    11581158                            for (URI u : uris) {
    11591159                                conn = (HttpURLConnection) u.toURL().openConnection();
    1160                                 conn.setConnectTimeout(5000);
     1160                                conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
    11611161
    11621162                                if (conn.getResponseCode() != 200) {
     
    11711171                                            .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=")
    11721172                                    ).toURL().openConnection();
    1173                                     conn.setConnectTimeout(5000);
     1173                                    conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
    11741174
    11751175                                    /* redirect pages have different content length, but retrieving a "nonredirect"
  • trunk/src/org/openstreetmap/josm/gui/download/PlaceSelection.java

    r3719 r4172  
    365365                    connection = (HttpURLConnection)url.openConnection();
    366366                }
    367                 connection.setConnectTimeout(15000);
     367                connection.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
    368368                InputStream inputStream = connection.getInputStream();
    369369                InputSource inputSource = new InputSource(new InputStreamReader(inputStream, "UTF-8"));
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java

    r4135 r4172  
    179179        this.offset = offset;
    180180        this.time = time;
     181        // /* ICON(markers/) */"Bridge"
     182        // /* ICON(markers/) */"Crossing"
    181183        this.symbol = ImageProvider.getIfAvailable("markers",iconName);
    182184        this.parentLayer = parentLayer;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r4007 r4172  
    8484        if(i == null)
    8585        {
    86             System.out.println("Mappaint style \""+namespace+"\" icon \"" + ref.iconName + "\" not found.");
     86            System.out.println("Mappaint style \""+namespace+"\" ("+ref.source.getDisplayString()+") icon \"" + ref.iconName + "\" not found.");
    8787            return null;
    8888        }
  • trunk/src/org/openstreetmap/josm/gui/tagging/TaggingPreset.java

    r4170 r4172  
    8888
    8989    public enum PresetType {
    90         NODE("Mf_node"), WAY("Mf_way"), RELATION("Mf_relation"), CLOSEDWAY("Mf_closedway");
     90        NODE(/* ICON */"Mf_node"), WAY(/* ICON */"Mf_way"), RELATION(/* ICON */"Mf_relation"), CLOSEDWAY(/* ICON */"Mf_closedway");
    9191
    9292        private final String iconName;
  • trunk/src/org/openstreetmap/josm/io/MirroredInputStream.java

    r4153 r4172  
    6565                if(Main.applet) {
    6666                    URLConnection conn = url.openConnection();
    67                     conn.setConnectTimeout(5000);
    68                     conn.setReadTimeout(5000);
     67                    conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
     68                    conn.setReadTimeout(Main.pref.getInteger("socket.timeout.read",30)*1000);
    6969                    fs = new BufferedInputStream(conn.getInputStream());
    7070                    file = new File(url.getFile());
     
    218218        try {
    219219            URLConnection conn = url.openConnection();
    220             conn.setConnectTimeout(5000);
    221             conn.setReadTimeout(5000);
     220            conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
     221            conn.setReadTimeout(Main.pref.getInteger("socket.timeout.read",30)*1000);
    222222            bis = new BufferedInputStream(conn.getInputStream());
    223223            FileOutputStream fos = new FileOutputStream(destDirFile);
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r4100 r4172  
    546546                System.out.print(requestMethod + " " + url + "... ");
    547547                activeConnection = (HttpURLConnection)url.openConnection();
    548                 activeConnection.setConnectTimeout(fastFail ? 1000 : 15000);
     548                activeConnection.setConnectTimeout(fastFail ? 1000 : Main.pref.getInteger("socket.timeout.connect",15)*1000);
    549549                activeConnection.setRequestMethod(requestMethod);
    550550                if (doAuthenticate) {
  • trunk/src/org/openstreetmap/josm/io/OsmServerReader.java

    r3511 r4172  
    7979            }
    8080
    81             activeConnection.setConnectTimeout(15000);
     81            activeConnection.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15)*1000);
    8282
    8383            try {
  • trunk/src/org/openstreetmap/josm/io/imagery/WMSGrabber.java

    r4126 r4172  
    175175        }
    176176        conn.setRequestProperty("User-Agent", Main.pref.get("imagery.wms.user_agent", Version.getInstance().getAgentString()));
    177         conn.setConnectTimeout(Main.pref.getInteger("imagery.wms.timeout.connect", 30) * 1000);
    178         conn.setReadTimeout(Main.pref.getInteger("imagery.wms.timeout.read", 30) * 1000);
     177        conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect",15) * 1000);
     178        conn.setReadTimeout(Main.pref.getInteger("socket.timeout.read", 30) * 1000);
    179179
    180180        String contentType = conn.getHeaderField("Content-Type");
Note: See TracChangeset for help on using the changeset viewer.