Changeset 29408 in osm for applications/editors/josm


Ignore:
Timestamp:
2013-03-26T19:54:03+01:00 (11 years ago)
Author:
zverik
Message:

auto-add iodb to toolbar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/imagery_offset_db/src/iodb/ImageryOffsetPlugin.java

    r29384 r29408  
    22
    33import java.awt.event.KeyEvent;
     4import java.util.*;
    45import javax.swing.JMenu;
    56import org.openstreetmap.josm.Main;
     
    3334        offsetMenu.add(getAction);
    3435        offsetMenu.add(storeAction);
     36
     37        // an ugly hack to add this plugin to the toolbar
     38        Collection<String> toolbar = new LinkedList<String>(Main.toolbar.getToolString());
     39        if( !toolbar.contains("getoffset") && Main.pref.getBoolean("iodb.modify.toolbar", true) ) {
     40            toolbar.add("getoffset");
     41            Main.pref.putCollection("toolbar", toolbar);
     42            Main.pref.put("iodb.modify.toolbar", false);
     43            Main.toolbar.refreshToolbarControl();
     44        }
    3545    }
    3646}
Note: See TracChangeset for help on using the changeset viewer.