Changeset 17354 in osm for applications/editors/josm/plugins/openstreetbugs/src
- Timestamp:
- 2009-08-30T17:05:37+02:00 (15 years ago)
- Location:
- applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java
r16135 r17354 209 209 hooks.add(0, uploadHook); 210 210 211 // add a listener to the plugin toggle button212 final JToggleButton toggle = (JToggleButton) dialog.action.button;213 active = toggle.isSelected();214 toggle.addActionListener(new ActionListener() {215 private boolean download = true;216 217 public void actionPerformed(ActionEvent e) {218 active = toggle.isSelected();219 if (toggle.isSelected() && download) {220 Main.worker.execute(new Runnable() {221 public void run() {222 updateData();223 }224 });225 download = false;226 }227 }228 });229 211 } else if (oldFrame!=null && newFrame==null ) { // map frame removed 230 212 … … 241 223 public void layerAdded(Layer newLayer) { 242 224 if(newLayer instanceof OsmDataLayer) { 243 active = ((JToggleButton)dialog.action.button).isSelected();225 active = dialog.isDialogShowing(); 244 226 245 227 // start the auto download loop -
applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/gui/OsbDialog.java
r16622 r17354 311 311 312 312 } 313 314 private boolean downloaded = false; 315 protected void initialDownload() { 316 Main.worker.execute(new Runnable() { 317 public void run() { 318 osbPlugin.updateData(); 319 } 320 }); 321 } 322 323 @Override 324 public void showDialog() { 325 if (!downloaded) { 326 initialDownload(); 327 downloaded = true; 328 } 329 super.showDialog(); 330 } 313 331 }
Note:
See TracChangeset
for help on using the changeset viewer.