Ticket #6629: coloringpatch2patch.patch

File coloringpatch2patch.patch, 2.3 KB (added by akks, 14 years ago)
  • org/openstreetmap/josm/gui/preferences/GPXSettingsPanel.java

     
    4848    private JComboBox waypointLabel = new JComboBox(new String[] {tr("Auto"), /* gpx data field name */ trc("gpx_field", "Name"),
    4949            /* gpx data field name */ trc("gpx_field", "Desc(ription)"), tr("Both"), tr("None")});
    5050    private String spec;
    51     private String specSp = "";
    52 
     51   
    5352    public GPXSettingsPanel(String layerName) {
    5453        super(new GridBagLayout());
    5554        this.spec="layer "+layerName;
    56         specSp = ".layer "+spec;
    5755        initComponents();
    5856        loadPreferences();
    5957    }
     
    8280        add(new JLabel(tr("Draw lines between raw GPS points")), GBC.eol().insets(20,0,0,0));
    8381        if (spec!=null) add(drawRawGpsLinesGlobal, GBC.eol().insets(40,0,0,0));
    8482        add(drawRawGpsLinesNone, GBC.eol().insets(40,0,0,0));
    85         add(drawRawGpsLinesLocal, GBC.eol().insets(40,0,0,0));
     83        if (spec==null) add(drawRawGpsLinesLocal, GBC.eol().insets(40,0,0,0));
    8684        add(drawRawGpsLinesAll, GBC.eol().insets(40,0,0,0));
    87 
     85       
    8886        drawRawGpsLinesActionListener = new ActionListener(){
    8987            public void actionPerformed(ActionEvent e) {
    9088                boolean f=drawRawGpsLinesNone.isSelected()||drawRawGpsLinesGlobal.isSelected();
     
    245243            colorDynamic.setEnabled(colorTypeVelocity.isSelected() || colorTypeDilution.isSelected());
    246244        }
    247245        if(spec != null)
    248           waypointLabel.setSelectedIndex(Main.pref.getInteger("draw.rawgps.layer.wpt"+specSp, 5));
     246          waypointLabel.setSelectedIndex(Main.pref.getInteger("draw.rawgps.layer.wpt",spec, 5));
    249247        else
    250248          waypointLabel.setSelectedIndex(Main.pref.getInteger("draw.rawgps.layer.wpt", 0));
    251249    }
     
    256254     * if spec==null, global preferences are written
    257255     */
    258256    public boolean savePreferences (String spec) {
     257        String specSp = ".layer "+spec;
    259258        Main.pref.put("marker.makeautomarkers"+specSp, makeAutoMarkers.isSelected());
    260259        if (drawRawGpsLinesGlobal.isSelected()) {
    261260            Main.pref.put("draw.rawgps.lines"+specSp, null);