Ignore:
Timestamp:
2009-09-02T21:17:52+02:00 (15 years ago)
Author:
Gubaer
Message:

new: improved dialog for uploading/saving modified layers on exit
new: improved dialog for uploading/saving modified layers if layers are deleted
new: new progress monitor which can delegate rendering to any Swing component
more setters/getters for properties in OSM data classes (fields are @deprecated); started to update references in the code base

File:
1 edited

Legend:

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

    r2017 r2025  
    4747        mainFrame.addWindowListener(new WindowAdapter(){
    4848            @Override public void windowClosing(final WindowEvent arg0) {
    49                 if (Main.breakBecauseUnsavedChanges())
     49                if (!Main.saveUnsavedModifications())
    5050                    return;
    5151                Main.saveGuiGeometry();
     
    7373        final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>();
    7474        for (String arg : argArray) {
    75             if (!arg.startsWith("--"))
     75            if (!arg.startsWith("--")) {
    7676                arg = "--download="+arg;
     77            }
    7778            int i = arg.indexOf('=');
    7879            String key = i == -1 ? arg.substring(2) : arg.substring(2,i);
    7980            String value = i == -1 ? "" : arg.substring(i+1);
    8081            Collection<String> v = args.get(key);
    81             if (v == null)
     82            if (v == null) {
    8283                v = new LinkedList<String>();
     84            }
    8385            v.add(value);
    8486            args.put(key, v);
     
    8890
    8991        // Check if passed as parameter
    90         if (args.containsKey("language"))
     92        if (args.containsKey("language")) {
    9193            I18n.set((String)(args.get("language").toArray()[0]));
    92         else
     94        } else {
    9395            I18n.set(Main.pref.get("language", null));
     96        }
    9497
    9598        if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) {
     
    143146
    144147        if (((!args.containsKey("no-maximize") && !args.containsKey("geometry")
    145         && Main.pref.get("gui.geometry").length() == 0) || args.containsKey("maximize"))
    146         && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH))
     148                && Main.pref.get("gui.geometry").length() == 0) || args.containsKey("maximize"))
     149                && Toolkit.getDefaultToolkit().isFrameStateSupported(JFrame.MAXIMIZED_BOTH)) {
    147150            mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH);
     151        }
    148152
    149153        EventQueue.invokeLater(new Runnable() {
     
    161165    public static void removeObsoletePreferences() {
    162166        String[] obsolete = {
    163            "sample.preference.that.does.not.exist", // sample comment, expiry date should go here
    164            "osm-server.version", // remove this around 10/2009
    165            "osm-server.additional-versions", // remove this around 10/2009
    166            null
     167                "sample.preference.that.does.not.exist", // sample comment, expiry date should go here
     168                "osm-server.version", // remove this around 10/2009
     169                "osm-server.additional-versions", // remove this around 10/2009
     170                null
    167171        };
    168172        for (String i : obsolete) {
    169             if (i == null) continue;
     173            if (i == null) {
     174                continue;
     175            }
    170176            if (Main.pref.hasKey(i)) {
    171177                Main.pref.removeFromCollection(i, Main.pref.get(i));
Note: See TracChangeset for help on using the changeset viewer.