Changeset 18147 in osm for applications


Ignore:
Timestamp:
2009-10-14T21:36:51+02:00 (15 years ago)
Author:
hampelratte
Message:

removed "active" flag and use dialog.isDialogShowing() instead

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/OsbDownloadLoop.java

    r13497 r18147  
    7878
    7979                // auto download if configured
    80                 if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) && OsbPlugin.active ) {
     80                if( Main.pref.getBoolean(ConfigKeys.OSB_AUTO_DOWNLOAD) &&
     81                        plugin != null && plugin.getDialog() != null && plugin.getDialog().isDialogShowing() ) {
    8182                    if(countdown < 0) {
    8283                        if(!downloadDone) {
  • applications/editors/josm/plugins/openstreetbugs/src/org/openstreetmap/josm/plugins/osb/OsbPlugin.java

    r17713 r18147  
    3131
    3232import java.net.URL;
    33 import java.util.LinkedList;
    3433
    3534import javax.swing.ImageIcon;
     
    6564    private OsbLayer layer;
    6665
    67     public static boolean active = false;
    68 
    6966    private DownloadAction download = new DownloadAction();
    7067
     
    164161
    165162            // display the parsed data
    166             if(!dataSet.nodes.isEmpty()) {
     163            if(!dataSet.nodes.isEmpty() && dialog.isDialogShowing()) {
    167164                // if the map layer has been closed, while we are requesting the osb db,
    168165                // we don't have to update the gui, because the user is not interested
     
    218215    public void layerAdded(Layer newLayer) {
    219216        if(newLayer instanceof OsmDataLayer) {
    220             active = dialog.isDialogShowing();
    221 
    222217            // start the auto download loop
    223218            OsbDownloadLoop.getInstance().setPlugin(this);
     
    246241        this.dataSet = dataSet;
    247242    }
     243   
     244    public OsbDialog getDialog() {
     245        return dialog;
     246    }
    248247}
Note: See TracChangeset for help on using the changeset viewer.