Changeset 7484 in josm


Ignore:
Timestamp:
2014-09-02T01:29:05+02:00 (10 years ago)
Author:
Don-vip
Message:

see #10455 - use OS X Window-Modified Indicator with Window.documentModified

File:
1 edited

Legend:

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

    r7005 r7484  
    3333import javax.swing.ActionMap;
    3434import javax.swing.InputMap;
    35 import javax.swing.JOptionPane;
     35import javax.swing.JFrame;
    3636import javax.swing.JPanel;
    3737
     
    4040import org.openstreetmap.josm.actions.mapmode.MapMode;
    4141import org.openstreetmap.josm.data.Bounds;
    42 import org.openstreetmap.josm.data.ViewportData;
    4342import org.openstreetmap.josm.data.Preferences.PreferenceChangeEvent;
    4443import org.openstreetmap.josm.data.Preferences.PreferenceChangedListener;
    4544import org.openstreetmap.josm.data.SelectionChangedListener;
     45import org.openstreetmap.josm.data.ViewportData;
    4646import org.openstreetmap.josm.data.coor.EastNorth;
    4747import org.openstreetmap.josm.data.coor.LatLon;
     
    924924    protected void refreshTitle() {
    925925        boolean dirty = editLayer != null && (editLayer.requiresSaveToFile() || (editLayer.requiresUploadToServer() && !editLayer.isUploadDiscouraged()));
    926         if (dirty) {
    927             JOptionPane.getFrameForComponent(Main.parent).setTitle("* " + tr("Java OpenStreetMap Editor"));
    928         } else {
    929             JOptionPane.getFrameForComponent(Main.parent).setTitle(tr("Java OpenStreetMap Editor"));
    930         }
     926        ((JFrame) Main.parent).setTitle((dirty ? "* " : "") + tr("Java OpenStreetMap Editor"));
     927        ((JFrame) Main.parent).getRootPane().putClientProperty("Window.documentModified", dirty);
    931928    }
    932929
Note: See TracChangeset for help on using the changeset viewer.