Ignore:
Timestamp:
2008-10-05T11:21:12+02:00 (16 years ago)
Author:
stoecker
Message:

separated display URL and shown URL in downloader

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/download/BoundingBoxSelection.java

    r999 r1015  
    4141                        new JTextField(11) };
    4242        final JTextArea osmUrl = new JTextArea();
     43        final JLabel showUrl = new JLabel();
    4344        String noteUrl = tr("You can paste an URL here to download the area.");
    44         String oldUrl = "";
    4545       
    4646        final JLabel sizeCheck = new JLabel();
     
    8484                        public void removeUpdate(DocumentEvent e) { dowork(); }
    8585                        private void dowork() {
    86                                 if(!oldUrl.equals(osmUrl.getText()))
    87                                 {
    88                                         Bounds b = osmurl2bounds(osmUrl.getText());
    89                                         if (b != null) {
    90                                                 gui.minlon = b.min.lon();
    91                                                 gui.minlat = b.min.lat();
    92                                                 gui.maxlon = b.max.lon();
    93                                                 gui.maxlat = b.max.lat();
    94                                                 gui.boundingBoxChanged(BoundingBoxSelection.this);
    95                                                 updateBboxFields(gui);
    96                                                 updateSizeCheck(gui);
    97                                                 oldUrl = osmUrl.getText();
    98                                         }
     86                                Bounds b = osmurl2bounds(osmUrl.getText());
     87                                if (b != null) {
     88                                        gui.minlon = b.min.lon();
     89                                        gui.minlat = b.min.lat();
     90                                        gui.maxlon = b.max.lon();
     91                                        gui.maxlat = b.max.lat();
     92                                        gui.boundingBoxChanged(BoundingBoxSelection.this);
     93                                        updateBboxFields(gui);
     94                                        updateSizeCheck(gui);
    9995                                }
    10096                        }
     
    132128                dlg.add(new JLabel(tr("URL from www.openstreetmap.org")), GBC.eol().insets(10,20,5,0));
    133129                dlg.add(osmUrl, GBC.eop().insets(10,0,5,0).fill());
     130                dlg.add(showUrl, GBC.eop().insets(10,0,5,20));
    134131                dlg.add(sizeCheck, GBC.eop().insets(10,0,5,20));
    135132
     
    169166                        zoom++;
    170167                }
    171                 // setting old URL prevents refresh based on this URL
    172                 oldUrl = noteUrl+"\n"+"http://www.openstreetmap.org/index.html?mlat="+lat+"&mlon="+lon+"&zoom="+zoom;
    173                 osmUrl.setText(oldUrl);
     168                showUrl.setText("http://www.openstreetmap.org/index.html?mlat="+lat+"&mlon="+lon+"&zoom="+zoom);
    174169        }
    175170       
Note: See TracChangeset for help on using the changeset viewer.