Changeset 4512 in josm


Ignore:
Timestamp:
2011-10-10T00:16:18+02:00 (10 years ago)
Author:
stoecker
Message:

introduce expert mode, make dynamic toolbar buttons default

Location:
trunk/src/org/openstreetmap/josm
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/Preferences.java

    r4452 r4512  
    461461        }
    462462        updateSystemProperties();
     463        /* FIXME: TODO: remove special version check end of 2012 */
     464        if(!properties.containsKey("expert")) {
     465            try {
     466                String v = get("josm.version");
     467                if(v.isEmpty() || Integer.parseInt(v) <= 4511)
     468                    properties.put("expert", "true");
     469            } catch(Exception e) {
     470                properties.put("expert", "true");
     471            }
     472        }
    463473    }
    464474
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ToggleDialog.java

    r4366 r4512  
    680680                buttonsPanel.add(button);
    681681            add(buttonsPanel, BorderLayout.SOUTH);
    682             if(Main.pref.getBoolean("dialog.dynamic.buttons", false)) {
     682            if(Main.pref.getBoolean("dialog.dynamic.buttons", true)) {
    683683                Toolkit.getDefaultToolkit().addAWTEventListener(this, AWTEvent.MOUSE_MOTION_EVENT_MASK);
    684684                buttonsPanel.setVisible(false);
  • trunk/src/org/openstreetmap/josm/gui/preferences/LafPreference.java

    r2745 r4512  
    4141    private JCheckBox drawHelperLine = new JCheckBox(tr("Draw rubber-band helper line"));
    4242    private JCheckBox modeless = new JCheckBox(tr("Modeless working (Potlatch style)"));
     43    private JCheckBox expert = new JCheckBox(tr("Expert mode"));
     44    private JCheckBox dynamicButtons = new JCheckBox(tr("Dynamic buttons in side menus"));
    4345
    4446    public void addGui(PreferenceTabbedPane gui) {
     
    8183        panel.add(showSplashScreen, GBC.eop().insets(20, 0, 0, 0));
    8284
    83         // Show ID in selection
    84         showID.setToolTipText(tr("Show object ID in selection lists"));
    85         showID.setSelected(Main.pref.getBoolean("osm-primitives.showid", false));
    86         panel.add(showID, GBC.eop().insets(20, 0, 0, 0));
     85        if(Main.pref.getBoolean("expert", false)) {
     86            // Show ID in selection
     87            showID.setToolTipText(tr("Show object ID in selection lists"));
     88            showID.setSelected(Main.pref.getBoolean("osm-primitives.showid", false));
     89            panel.add(showID, GBC.eop().insets(20, 0, 0, 0));
    8790
    88         // Show localized names
    89         showLocalizedName.setToolTipText(tr("Show localized name in selection lists, if available"));
    90         showLocalizedName.setSelected(Main.pref.getBoolean("osm-primitives.localize-name", true));
    91         panel.add(showLocalizedName, GBC.eop().insets(20, 0, 0, 0));
     91            // Show localized names
     92            showLocalizedName.setToolTipText(tr("Show localized name in selection lists, if available"));
     93            showLocalizedName.setSelected(Main.pref.getBoolean("osm-primitives.localize-name", true));
     94            panel.add(showLocalizedName, GBC.eop().insets(20, 0, 0, 0));
    9295
    93         drawHelperLine.setToolTipText(tr("Draw rubber-band helper line"));
    94         drawHelperLine.setSelected(Main.pref.getBoolean("draw.helper-line", true));
    95         panel.add(drawHelperLine, GBC.eop().insets(20, 0, 0, 0));
     96            drawHelperLine.setToolTipText(tr("Draw rubber-band helper line"));
     97            drawHelperLine.setSelected(Main.pref.getBoolean("draw.helper-line", true));
     98            panel.add(drawHelperLine, GBC.eop().insets(20, 0, 0, 0));
    9699
    97         modeless.setToolTipText(tr("Do not require to switch modes (potlatch style workflow)"));
    98         modeless.setSelected(Main.pref.getBoolean("modeless", false));
    99         panel.add(modeless, GBC.eop().insets(20, 0, 0, 0));
     100            modeless.setToolTipText(tr("Do not require to switch modes (potlatch style workflow)"));
     101            modeless.setSelected(Main.pref.getBoolean("modeless", false));
     102            panel.add(modeless, GBC.eop().insets(20, 0, 0, 0));
     103        }
     104
     105        dynamicButtons.setToolTipText(tr("Display buttons in right side menus only when mouse is inside the element"));
     106        dynamicButtons.setSelected(Main.pref.getBoolean("dialog.dynamic.buttons", true));
     107        panel.add(dynamicButtons, GBC.eop().insets(20, 0, 0, 0));
     108
     109        expert.setToolTipText(tr("The expert mode shows a lot of additional settings hidden from normal user"));
     110        expert.setSelected(Main.pref.getBoolean("expert", false));
     111        panel.add(expert, GBC.eop().insets(20, 0, 0, 0));
    100112
    101113        panel.add(Box.createVerticalGlue(), GBC.eol().insets(0, 20, 0, 0));
     
    111123
    112124    public boolean ok() {
     125        boolean mod = false;
    113126        Main.pref.put("draw.splashscreen", showSplashScreen.isSelected());
    114127        Main.pref.put("osm-primitives.showid", showID.isSelected());
     
    116129        Main.pref.put("draw.helper-line", drawHelperLine.isSelected());
    117130        Main.pref.put("modeless", modeless.isSelected());
    118         return Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName());
     131        if(Main.pref.put("expert", expert.isSelected()))
     132            mod = true;
     133        Main.pref.put("dialog.dynamic.buttons", dynamicButtons.isSelected());
     134        if(Main.pref.put("laf", ((LookAndFeelInfo)lafCombo.getSelectedItem()).getClassName()))
     135            mod = true;
     136        return mod;
    119137    }
    120138}
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r4191 r4512  
    276276        PluginHandler.getPreferenceSetting(settingsFactory);
    277277
    278         // always the last: advanced tab
    279         settingsFactory.add(new AdvancedPreference.Factory());
     278        if(Main.pref.getBoolean("expert", false)) {
     279            // always the last: advanced tab
     280            settingsFactory.add(new AdvancedPreference.Factory());
     281        }
    280282    }
    281283
Note: See TracChangeset for help on using the changeset viewer.