Changeset 29412 in osm for applications/editors/josm/plugins/imagery_offset_db/src/iodb/ImageryOffsetPlugin.java
- Timestamp:
- 2013-03-27T20:56:51+01:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/imagery_offset_db/src/iodb/ImageryOffsetPlugin.java
r29408 r29412 5 5 import javax.swing.JMenu; 6 6 import org.openstreetmap.josm.Main; 7 import org.openstreetmap.josm.data.Version; 7 8 import org.openstreetmap.josm.plugins.Plugin; 8 9 import org.openstreetmap.josm.plugins.PluginInformation; … … 31 32 storeAction = new StoreImageryOffsetAction(); 32 33 33 JMenu offsetMenu = Main.main.menu.addMenu(marktr("Offset"), KeyEvent.VK_O, 6, "help"); 34 // before 5803 imagery menu was constantly regenerated, erasing extra items 35 // before 5729 it was regenerated only when the imagery list was modified (also bad) 36 int version = Version.getInstance().getVersion(); 37 JMenu offsetMenu = version < 5803 38 ? Main.main.menu.addMenu(marktr("Offset"), KeyEvent.VK_O, 6, "help") 39 : Main.main.menu.imageryMenu; 34 40 offsetMenu.add(getAction); 35 41 offsetMenu.add(storeAction); 42 if( version >= 5803 ) // todo: check if this is needed 43 offsetMenu.addSeparator(); 36 44 37 45 // 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); 46 if( Main.pref.getBoolean("iodb.modify.toolbar", true) ) { 47 Collection<String> toolbar = new LinkedList<String>(Main.toolbar.getToolString()); 48 if( !toolbar.contains("getoffset") ) { 49 toolbar.add("getoffset"); 50 Main.pref.putCollection("toolbar", toolbar); 51 Main.toolbar.refreshToolbarControl(); 52 } 42 53 Main.pref.put("iodb.modify.toolbar", false); 43 Main.toolbar.refreshToolbarControl();44 54 } 45 55 }
Note:
See TracChangeset
for help on using the changeset viewer.