Ignore:
Timestamp:
2012-01-21T23:04:50+01:00 (12 years ago)
Author:
bastiK
Message:

expert mode rework:

  • toggling of expert mode does not require restart
  • checkbox at a more prominent places (MainMenu > View and in the preference dialog at the bottom)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceDialog.java

    r4586 r4840  
    99import java.awt.Dimension;
    1010import java.awt.FlowLayout;
     11import java.awt.GridBagLayout;
    1112import java.awt.Insets;
    1213import java.awt.Toolkit;
    1314import java.awt.event.ActionEvent;
     15import java.awt.event.ActionListener;
    1416import java.awt.event.KeyEvent;
    1517import java.awt.event.WindowAdapter;
     
    1820import javax.swing.AbstractAction;
    1921import javax.swing.BorderFactory;
     22import javax.swing.JCheckBox;
    2023import javax.swing.JComponent;
    2124import javax.swing.JDialog;
     
    2427import javax.swing.KeyStroke;
    2528
     29import org.openstreetmap.josm.Main;
    2630import org.openstreetmap.josm.gui.SideButton;
    2731import org.openstreetmap.josm.gui.help.ContextSensitiveHelpAction;
    2832import org.openstreetmap.josm.gui.help.HelpUtil;
    2933import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane.ValidationListener;
     34import org.openstreetmap.josm.tools.GBC;
    3035import org.openstreetmap.josm.tools.ImageProvider;
    3136import org.openstreetmap.josm.tools.WindowGeometry;
     
    3742
    3843    protected JPanel buildActionPanel() {
    39         JPanel pnl = new JPanel(new FlowLayout(FlowLayout.CENTER));
    40         pnl.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
    41         pnl.add(new SideButton(new OKAction()));
    42         pnl.add(new SideButton(new CancelAction()));
    43         pnl.add(new SideButton(new ContextSensitiveHelpAction(HelpUtil.ht("/Action/Preferences"))));
     44        JPanel pnl = new JPanel(new GridBagLayout());
     45
     46        JCheckBox expert = new JCheckBox(tr("Expert mode"));
     47        expert.setSelected(Main.main.menu.expert.isSelected());
     48        expert.addActionListener(new ActionListener() {
     49            public void actionPerformed(ActionEvent e) {
     50                Main.main.menu.expert.actionPerformed(null);
     51            }
     52        });
     53
     54        JPanel btns = new JPanel(new FlowLayout(FlowLayout.CENTER));
     55        btns.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
     56        btns.add(new SideButton(new OKAction()));
     57        btns.add(new SideButton(new CancelAction()));
     58        btns.add(new SideButton(new ContextSensitiveHelpAction(HelpUtil.ht("/Action/Preferences"))));
     59        pnl.add(expert, GBC.std().insets(5,0,0,0));
     60        pnl.add(btns, GBC.std().fill(GBC.HORIZONTAL));
    4461        return pnl;
    4562    }
Note: See TracChangeset for help on using the changeset viewer.