Changeset 5880 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2013-04-18T17:36:14+02:00 (11 years ago)
Author:
akks
Message:

remote control: new public static method AddTagsDialog.addTags() to add tags with confirmation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/io/remotecontrol/AddTagsDialog.java

    r5876 r5880  
    138138                return types[c];
    139139            }
    140 
    141140        };
    142141
     
    224223        tablePanel.add(propertyTable.getTableHeader(), GBC.eol().fill(GBC.HORIZONTAL));
    225224        tablePanel.add(propertyTable, GBC.eol().fill(GBC.BOTH));
    226         if (!trustedSenders.contains(sender)) {
     225        if (!sender.isEmpty() && !trustedSenders.contains(sender)) {
    227226            final JCheckBox c = new JCheckBox();
    228227            c.setAction(new AbstractAction(tr("Accept all tags from {0} for this session", sender) ) {
     
    320319                            i++;
    321320                        }
    322                         addTagsIfNeeded(keyValue, sender);
     321                        addTags(keyValue, sender);
    323322                    }
    324323                }
     
    329328    }
    330329   
    331     private static void addTagsIfNeeded(String[][] keyValue, String sender) {
     330    /**
     331     * Ask user and add the tags he confirm
     332     * @param keyValue is a table or {{tag1,val1},{tag2,val2},...}
     333     * @param sender is a string for skipping confirmations. Use epmty string for always confirmed adding.
     334     */
     335    public static void addTags(String[][] keyValue, String sender) {
    332336        if (trustedSenders.contains(sender)) {
    333337            if (Main.main.getCurrentDataSet() != null) {
Note: See TracChangeset for help on using the changeset viewer.