Changeset 23379 in osm for applications/editors
- Timestamp:
- 2010-09-27T20:30:59+02:00 (14 years ago)
- Location:
- applications/editors/josm/plugins/photo_geotagging
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/photo_geotagging/build.xml
r23378 r23379 25 25 26 26 <!-- enter the SVN commit message --> 27 <property name="commit.message" value=" update to josm latest; only recompile (setCancelButton)" />27 <property name="commit.message" value="remember selection of mtime (save to preference file)" /> 28 28 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 29 29 <property name="plugin.main.version" value="3408" /> -
applications/editors/josm/plugins/photo_geotagging/src/org/openstreetmap/josm/plugins/photo_geotagging/GeotaggingAction.java
r23192 r23379 41 41 42 42 /** 43 * The action to a ksthe user for confirmation and then do the tagging.43 * The action to ask the user for confirmation and then do the tagging. 44 44 */ 45 45 class GeotaggingAction extends AbstractAction implements LayerAction { 46 46 final static boolean debug = false; 47 47 final static String KEEP_BACKUP = "plugins.photo_geotagging.keep_backup"; 48 final static String CHANGE_MTIME = "plugins.photo_geotagging.change-mtime"; 49 final static String MTIME_MODE = "plugins.photo_geotagging.mtime-mode"; 48 50 final static int MTIME_MODE_GPS = 1; 49 51 final static int MTIME_MODE_PREVIOUS_VALUE = 2; … … 89 91 settingsPanel.add(backups, GBC.eol().insets(3,3,0,0)); 90 92 91 final JCheckBox setMTime = new JCheckBox(tr("change file modification time:"), false);93 final JCheckBox setMTime = new JCheckBox(tr("change file modification time:"), Main.pref.getBoolean(CHANGE_MTIME, false)); 92 94 settingsPanel.add(setMTime, GBC.std().insets(3,3,5,3)); 93 95 94 96 final String[] mTimeModeArray = {"----", tr("to gps time"), tr("to previous value (unchanged mtime)")}; 95 97 final JComboBox mTimeMode = new JComboBox(mTimeModeArray); 98 { 99 String mTimeModePref = Main.pref.get(MTIME_MODE, null); 100 int mTimeIdx = 0; 101 if ("gps".equals(mTimeModePref)) { 102 mTimeIdx = 1; 103 } else if ("previous".equals(mTimeModePref)) { 104 mTimeIdx = 2; 105 } 106 mTimeMode.setSelectedIndex(setMTime.isSelected() ? mTimeIdx : 0); 107 } 96 108 settingsPanel.add(mTimeMode, GBC.eol().insets(3,3,3,3)); 97 109 … … 126 138 127 139 final boolean keep_backup = backups.isSelected(); 140 final boolean change_mtime = setMTime.isSelected(); 128 141 Main.pref.put(KEEP_BACKUP, keep_backup); 142 Main.pref.put(CHANGE_MTIME, change_mtime); 143 if (change_mtime) { 144 String mTimeModePref; 145 switch (mTimeMode.getSelectedIndex()) { 146 case 1: 147 mTimeModePref = "gps"; 148 break; 149 case 2: 150 mTimeModePref = "previous"; 151 break; 152 default: 153 mTimeModePref = null; 154 } 155 Main.pref.put(MTIME_MODE, mTimeModePref); 156 } 129 157 130 158 Main.worker.execute(new GeoTaggingRunnable(images, keep_backup, mTimeMode.getSelectedIndex()));
Note:
See TracChangeset
for help on using the changeset viewer.