Ticket #15709: josm_fix-r13264-regression_imageviewerdialog-opening-two-windows-if-undocked_bugfix-variant2.patch

File josm_fix-r13264-regression_imageviewerdialog-opening-two-windows-if-undocked_bugfix-variant2.patch, 1.7 KB (added by cmuelle8, 3 weeks ago)

this moves the setup of the image viewer dialog instance to the MapFrame, i.e. to the place where LayerListDialog is set up (and destroyed); if this variant is chosen, it might make sense to refactor LayerListDialog instance creation to match that used in ImageViewerDialog

  • src/org/openstreetmap/josm/gui/MapFrame.java

     
    7575import org.openstreetmap.josm.gui.layer.LayerManager.LayerRemoveEvent;
    7676import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeEvent;
    7777import org.openstreetmap.josm.gui.layer.MainLayerManager.ActiveLayerChangeListener;
     78import org.openstreetmap.josm.gui.layer.geoimage.ImageViewerDialog;
    7879import org.openstreetmap.josm.gui.util.AdvancedKeyPressDetector;
    7980import org.openstreetmap.josm.spi.preferences.Config;
    8081import org.openstreetmap.josm.spi.preferences.PreferenceChangedListener;
     
    262263        noteDialog = new NotesDialog();
    263264
    264265        addToggleDialog(LayerListDialog.getInstance());
     266        addToggleDialog(ImageViewerDialog.getInstance());
    265267        addToggleDialog(propertiesDialog);
    266268        addToggleDialog(selectionListDialog);
    267269        addToggleDialog(relationListDialog);
  • src/org/openstreetmap/josm/gui/layer/geoimage/GeoImageLayer.java

     
    996996            }
    997997        };
    998998        MainApplication.getLayerManager().addActiveLayerChangeListener(activeLayerChangeListener);
    999 
    1000         MapFrame map = MainApplication.getMap();
    1001         if (map.getToggleDialog(ImageViewerDialog.class) == null) {
    1002             map.addToggleDialog(ImageViewerDialog.getInstance());
    1003         }
    1004999    }
    10051000
    10061001    @Override