Changeset 12846 in josm for trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
- Timestamp:
- 2017-09-13T23:24:50+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java
r12841 r12846 71 71 import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset; 72 72 import org.openstreetmap.josm.gui.util.GuiHelper; 73 import org.openstreetmap.josm.spi.preferences.Config; 73 74 import org.openstreetmap.josm.tools.GBC; 74 75 import org.openstreetmap.josm.tools.ImageProvider; … … 488 489 private void setActionAndAdapt(ActionDefinition action) { 489 490 this.act = action; 490 doNotHide.setSelected( Main.pref.getBoolean("toolbar.always-visible", true));491 doNotHide.setSelected(Config.getPref().getBoolean("toolbar.always-visible", true)); 491 492 remove.setVisible(act != null); 492 493 shortcutEdit.setVisible(act != null); … … 502 503 // remove the button from toolbar preferences 503 504 t.remove(res); 504 Main.pref.putList("toolbar", t);505 Config.getPref().putList("toolbar", t); 505 506 MainApplication.getToolbar().refreshToolbarControl(); 506 507 } … … 532 533 public void actionPerformed(ActionEvent e) { 533 534 boolean sel = ((JCheckBoxMenuItem) e.getSource()).getState(); 534 Main.pref.putBoolean("toolbar.always-visible", sel);535 Main.pref.putBoolean("menu.always-visible", sel);535 Config.getPref().putBoolean("toolbar.always-visible", sel); 536 Config.getPref().putBoolean("menu.always-visible", sel); 536 537 } 537 538 }); … … 987 988 t = Collections.singletonList(EMPTY_TOOLBAR_MARKER); 988 989 } 989 Main.pref.putList("toolbar", t);990 Config.getPref().putList("toolbar", t); 990 991 MainApplication.getToolbar().refreshToolbarControl(); 991 992 return false; … … 1002 1003 control.setComponentPopupMenu(popupMenu); 1003 1004 }); 1004 Main.pref.addPreferenceChangeListener(e -> {1005 Config.getPref().addPreferenceChangeListener(e -> { 1005 1006 if ("toolbar.visible".equals(e.getKey())) { 1006 1007 refreshToolbarControl(); … … 1074 1075 public static Collection<String> getToolString() { 1075 1076 1076 Collection<String> toolStr = Main.pref.getList("toolbar", Arrays.asList(deftoolbar));1077 Collection<String> toolStr = Config.getPref().getList("toolbar", Arrays.asList(deftoolbar)); 1077 1078 if (toolStr == null || toolStr.isEmpty()) { 1078 1079 toolStr = Arrays.asList(deftoolbar); … … 1188 1189 } 1189 1190 1190 boolean visible = Main.pref.getBoolean("toolbar.visible", true);1191 boolean visible = Config.getPref().getBoolean("toolbar.visible", true); 1191 1192 1192 1193 control.setFocusTraversalKeysEnabled(!unregisterTab); … … 1214 1215 } 1215 1216 } 1216 Main.pref.putList("toolbar", t);1217 Config.getPref().putList("toolbar", t); 1217 1218 MainApplication.getToolbar().refreshToolbarControl(); 1218 1219 }
Note:
See TracChangeset
for help on using the changeset viewer.