Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/plugin
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/preferences/plugin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreference.java
r12841 r12846 61 61 import org.openstreetmap.josm.plugins.ReadLocalPluginInformationTask; 62 62 import org.openstreetmap.josm.plugins.ReadRemotePluginInformationTask; 63 import org.openstreetmap.josm.spi.preferences.Config; 63 64 import org.openstreetmap.josm.tools.GBC; 64 65 import org.openstreetmap.josm.tools.ImageProvider; … … 302 303 List<String> l = new LinkedList<>(model.getSelectedPluginNames()); 303 304 Collections.sort(l); 304 Main.pref.putList("plugins", l);305 Config.getPref().putList("plugins", l); 305 306 if (!model.getNewlyDeactivatedPlugins().isEmpty()) 306 307 return true; … … 359 360 model.updateAvailablePlugins(task.getAvailablePlugins()); 360 361 pnlPluginPreferences.refreshView(); 361 Main.pref.putInt("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030362 Config.getPref().putInt("pluginmanager.version", Version.getInstance().getVersion()); // fix #7030 362 363 }); 363 364 } -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginPreferencesModel.java
r12841 r12846 15 15 import java.util.Set; 16 16 17 import org.openstreetmap.josm.Main;18 17 import org.openstreetmap.josm.gui.util.ChangeNotifier; 19 18 import org.openstreetmap.josm.plugins.PluginException; 20 19 import org.openstreetmap.josm.plugins.PluginHandler; 21 20 import org.openstreetmap.josm.plugins.PluginInformation; 21 import org.openstreetmap.josm.spi.preferences.Config; 22 22 import org.openstreetmap.josm.tools.Logging; 23 23 … … 40 40 public PluginPreferencesModel() { 41 41 currentActivePlugins = new HashSet<>(); 42 currentActivePlugins.addAll( Main.pref.getList("plugins"));42 currentActivePlugins.addAll(Config.getPref().getList("plugins")); 43 43 } 44 44 … … 80 80 filterDisplayedPlugins(filterExpression); 81 81 Set<String> activePlugins = new HashSet<>(); 82 activePlugins.addAll( Main.pref.getList("plugins"));82 activePlugins.addAll(Config.getPref().getList("plugins")); 83 83 for (PluginInformation pi: availablePlugins) { 84 84 if (selectedPluginsMap.get(pi) == null && activePlugins.contains(pi.name)) { … … 230 230 */ 231 231 public void initFromPreferences() { 232 Collection<String> enabledPlugins = Main.pref.getList("plugins", null);232 Collection<String> enabledPlugins = Config.getPref().getList("plugins", null); 233 233 if (enabledPlugins == null) { 234 234 this.selectedPluginsMap.clear(); -
trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginUpdatePolicyPanel.java
r12841 r12846 20 20 import javax.swing.event.ChangeListener; 21 21 22 import org.openstreetmap.josm.Main;23 22 import org.openstreetmap.josm.gui.widgets.JMultilineLabel; 24 23 import org.openstreetmap.josm.gui.widgets.JosmTextField; 25 24 import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator; 26 25 import org.openstreetmap.josm.plugins.PluginHandler; 26 import org.openstreetmap.josm.spi.preferences.Config; 27 27 import org.openstreetmap.josm.tools.Logging; 28 28 … … 175 175 */ 176 176 public final void initFromPreferences() { 177 rbVersionBasedUpatePolicy.get(Optional.ofNullable(Policy.fromPreferenceValue( 178 Main.pref.get("pluginmanager.version-based-update.policy", "ask"))).orElse(Policy.ASK)).setSelected(true); 179 rbTimeBasedUpatePolicy.get(Optional.ofNullable(Policy.fromPreferenceValue( 180 Main.pref.get("pluginmanager.time-based-update.policy", "ask"))).orElse(Policy.ASK)).setSelected(true); 181 182 String pref = Main.pref.get("pluginmanager.warntime", null); 177 rbVersionBasedUpatePolicy.get(Optional.ofNullable(Policy.fromPreferenceValue(Config.getPref().get("pluginmanager.version-based-update.policy", "ask"))).orElse(Policy.ASK)).setSelected(true); 178 rbTimeBasedUpatePolicy.get(Optional.ofNullable(Policy.fromPreferenceValue(Config.getPref().get("pluginmanager.time-based-update.policy", "ask"))).orElse(Policy.ASK)).setSelected(true); 179 180 String pref = Config.getPref().get("pluginmanager.warntime", null); 183 181 int days = 0; 184 182 if (pref != null) { 185 183 // remove legacy preference 186 Main.pref.put("pluginmanager.warntime", null);184 Config.getPref().put("pluginmanager.warntime", null); 187 185 try { 188 186 days = Integer.parseInt(pref.trim()); … … 196 194 } 197 195 if (days == 0) { 198 days = Main.pref.getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL);196 days = Config.getPref().getInt("pluginmanager.time-based-update.interval", PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL); 199 197 } 200 198 tfUpdateInterval.setText(Integer.toString(days)); … … 210 208 for (Policy p: Policy.values()) { 211 209 if (rbVersionBasedUpatePolicy.get(p).isSelected()) { 212 Main.pref.put("pluginmanager.version-based-update.policy", p.getPreferencesValue());210 Config.getPref().put("pluginmanager.version-based-update.policy", p.getPreferencesValue()); 213 211 break; 214 212 } … … 219 217 for (Policy p: Policy.values()) { 220 218 if (rbTimeBasedUpatePolicy.get(p).isSelected()) { 221 Main.pref.put("pluginmanager.time-based-update.policy", p.getPreferencesValue());219 Config.getPref().put("pluginmanager.time-based-update.policy", p.getPreferencesValue()); 222 220 break; 223 221 } … … 235 233 days = PluginHandler.DEFAULT_TIME_BASED_UPDATE_INTERVAL; 236 234 } 237 Main.pref.putInt("pluginmanager.time-based-update.interval", days);235 Config.getPref().putInt("pluginmanager.time-based-update.interval", days); 238 236 } 239 237
Note:
See TracChangeset
for help on using the changeset viewer.