Changeset 28912 in osm for applications
- Timestamp:
- 2012-11-09T18:38:59+01:00 (12 years ago)
- Location:
- applications/editors/josm/plugins/mirrored_download/src/mirrored_download
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadAction.java
r28418 r28912 162 162 return overpassQuery.isEmpty() && "*".equals(overpassType) 163 163 ? super.getRequestForBbox(lon1, lat1, lon2, lat2) 164 : overpassType + "[bbox=" + lon1 + "," + lat1 + "," + lon2 + "," + lat2 + "][@meta]" + overpassQuery; 164 : overpassType + "[bbox=" + lon1 + "," + lat1 + "," + lon2 + "," + lat2 + "]" 165 + (MirroredDownloadPlugin.getAddMeta() ? "[@meta]" : "") + overpassQuery; 165 166 } 166 167 -
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/MirroredDownloadPlugin.java
r28911 r28912 15 15 } 16 16 private static String downloadUrl = null; 17 private static boolean addMeta = true; 17 18 18 19 public static String getDownloadUrl() { … … 22 23 if (downloadUrl == null) 23 24 downloadUrl = "http://overpass-api.de/api/xapi?"; 25 26 String metaFlag = Main.pref.get("plugin.mirrored_download.preferred-meta-flag"); 27 addMeta = !("void".equals(metaFlag)); 24 28 } 25 29 return downloadUrl; 30 } 31 32 public static boolean getAddMeta() { 33 return addMeta; 26 34 } 27 35 … … 29 37 downloadUrl = downloadUrl_; 30 38 } 39 40 public static void setAddMeta(boolean addMeta_) { 41 addMeta = addMeta_; 42 } 43 31 44 } -
applications/editors/josm/plugins/mirrored_download/src/mirrored_download/UrlSelectionDialog.java
r28108 r28912 30 30 import javax.swing.DefaultListModel; 31 31 import javax.swing.JButton; 32 import javax.swing.JCheckBox; 32 33 import javax.swing.JComboBox; 33 34 import javax.swing.JComponent; … … 75 76 private JTabbedPane tabbedPane = null; 76 77 private JComboBox cbSelectUrl = null; 78 private JCheckBox cbAddMeta = null; 77 79 78 80 public UrlSelectionDialog() { … … 105 107 cbSelectUrl.setEditable(true); 106 108 107 String preferredUrl = Main.pref.get("plugin.mirrored_download.preferred-url"); 108 if (preferredUrl != null && !"".equals(preferredUrl)) 109 cbSelectUrl.addItem(preferredUrl); 109 cbSelectUrl.addItem(MirroredDownloadPlugin.getDownloadUrl()); 110 110 111 111 for (String url: getURLs()) { … … 118 118 layoutCons.gridx = 0; 119 119 layoutCons.gridy = 1; 120 layoutCons.gridwidth = 1;120 layoutCons.gridwidth = 2; 121 121 layoutCons.weightx = 0.0; 122 122 layoutCons.weighty = 0.0; … … 124 124 gridbag.setConstraints(cbSelectUrl, layoutCons); 125 125 contentPane.add(cbSelectUrl); 126 127 cbAddMeta = new JCheckBox(tr("Enforce meta data")); 128 cbAddMeta.setEnabled(true); 129 cbAddMeta.setSelected(MirroredDownloadPlugin.getAddMeta()); 130 131 cbAddMeta.setActionCommand("selectMetaFlag"); 132 cbAddMeta.addActionListener(new MetaFlagChangedAction()); 133 134 layoutCons.gridx = 0; 135 layoutCons.gridy = 2; 136 layoutCons.gridwidth = 2; 137 layoutCons.weightx = 0.0; 138 layoutCons.weighty = 0.0; 139 layoutCons.fill = GridBagConstraints.BOTH; 140 gridbag.setConstraints(cbAddMeta, layoutCons); 141 contentPane.add(cbAddMeta); 126 142 127 143 jDialog.pack(); … … 164 180 } 165 181 182 public class MetaFlagChangedAction implements ActionListener { 183 184 public void actionPerformed(ActionEvent e) { 185 MirroredDownloadPlugin.setAddMeta(cbAddMeta.isSelected()); 186 Main.pref.put("plugin.mirrored_download.preferred-meta-flag", 187 cbAddMeta.isSelected() ? "meta" : "void"); 188 } 189 190 } 191 166 192 public void setVisible(boolean visible) { 167 193 jDialog.setVisible(visible);
Note:
See TracChangeset
for help on using the changeset viewer.