Changeset 6851 in josm


Ignore:
Timestamp:
2014-02-14T12:03:27+01:00 (10 years ago)
Author:
Don-vip
Message:

see #9710 - enable OAuth debug output with --debug + single endpoint to change system properties

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r6798 r6851  
    12881288    }
    12891289
    1290     private void updateSystemProperty(String key, String value) {
     1290    /**
     1291     * Updates a given system property.
     1292     * @param key The property key
     1293     * @param value The property value
     1294     * @return the previous value of the system property, or {@code null} if it did not have one.
     1295     * @since 6851
     1296     */
     1297    public static String updateSystemProperty(String key, String value) {
    12911298        if (value != null) {
    12921299            String old = System.setProperty(key, value);
    12931300            Main.debug("System property '"+key+"' set to '"+value+"'. Old value was '"+old+"'");
    1294         }
     1301            return old;
     1302        }
     1303        return null;
    12951304    }
    12961305
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r6839 r6851  
    4040import org.openstreetmap.josm.data.AutosaveTask;
    4141import org.openstreetmap.josm.data.CustomConfigurator;
     42import org.openstreetmap.josm.data.Preferences;
    4243import org.openstreetmap.josm.data.Version;
    4344import org.openstreetmap.josm.gui.download.DownloadDialog;
     
    305306        // http://stackoverflow.com/q/75218/2257172
    306307        // To be replaced with official API when switching to Java 7: https://bugs.openjdk.java.net/browse/JDK-4714232
    307         System.setProperty("sun.awt.exception.handler", BugReportExceptionHandler.class.getName());
     308        Preferences.updateSystemProperty("sun.awt.exception.handler", BugReportExceptionHandler.class.getName());
    308309
    309310        // initialize the platform hook, and
     
    320321
    321322        if (args.containsKey(Option.DEBUG)) {
     323            // Enable JOSM debug level
    322324            logLevel = 4;
     325            // Enable debug in OAuth signpost
     326            Preferences.updateSystemProperty("debug", "true");
    323327            Main.debug(tr("Print debugging messages to console"));
    324328        }
  • trunk/src/org/openstreetmap/josm/tools/PlatformHookOsx.java

    r6443 r6851  
    1313
    1414import org.openstreetmap.josm.Main;
     15import org.openstreetmap.josm.data.Preferences;
    1516
    1617/**
     
    1920 */
    2021public class PlatformHookOsx extends PlatformHookUnixoid implements PlatformHook, InvocationHandler {
    21    
     22
    2223    private static PlatformHookOsx ivhandler = new PlatformHookOsx();
    23    
     24
    2425    @Override
    2526    public void preStartupHook() {
     
    2829        // And will not work when one of the system independent LAFs is used.
    2930        // They just insist on painting themselves...
    30         System.setProperty("apple.laf.useScreenMenuBar", "true");
    31     }
    32    
     31        Preferences.updateSystemProperty("apple.laf.useScreenMenuBar", "true");
     32    }
     33
    3334    @Override
    3435    public void startupHook() {
     
    4849        }
    4950    }
    50    
     51
    5152    @Override
    5253    public Object invoke (Object proxy, Method method, Object[] args) throws Throwable {
     
    6970        return null;
    7071    }
    71    
     72
    7273    @Override
    7374    public void openUrl(String url) throws IOException {
     
    212213        Shortcut.registerSystemShortcut("view:zoomout", tr("reserved"), KeyEvent.VK_SUBTRACT, KeyEvent.META_DOWN_MASK); // Zoom out
    213214    }
    214    
     215
    215216    @Override
    216217    public String makeTooltip(String name, Shortcut sc) {
Note: See TracChangeset for help on using the changeset viewer.