Changeset 4789 in josm for trunk


Ignore:
Timestamp:
2012-01-13T13:41:48+01:00 (13 years ago)
Author:
simon04
Message:

allow to change preference settings via cmd line arguments (e.g., --set=expert=true enables expert mode, helpful for testing with clean settings)

File:
1 edited

Legend:

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

    r4735 r4789  
    102102                "\t--[no-]maximize                           "+tr("Launch in maximized mode")+"\n"+
    103103                "\t--reset-preferences                       "+tr("Reset the preferences to default")+"\n\n"+
     104                "\t--set=<key>=<value>                       "+tr("Set preference key to value")+"\n\n"+
    104105                "\t--language=<language>                     "+tr("Set the language")+"\n\n"+
    105106                tr("options provided as Java system properties")+":\n"+
     
    194195        // Check if passed as parameter
    195196        if (args.containsKey("language")) {
    196             I18n.set((String)(args.get("language").toArray()[0]));
     197            I18n.set(args.get("language").iterator().next());
    197198        } else {
    198199            I18n.set(Main.pref.get("language", null));
    199200        }
    200201        Main.pref.updateSystemProperties();
     202
     203        if (args.containsKey("set")) {
     204            for (String i : args.get("set")) {
     205                String[] kv = i.split("=", 2);
     206                Main.pref.put(kv[0], "null".equals(kv[1]) ? null : kv[1]);
     207            }
     208        }
    201209
    202210        DefaultAuthenticator.createInstance();
Note: See TracChangeset for help on using the changeset viewer.