Ticket #5626: 5626.patch

File 5626.patch, 1.8 KB (added by Don-vip, 13 years ago)
  • src/cadastre_fr/CadastrePlugin.java

     
    240240            cadastreJMenu.add(menuLoadFromCache);
    241241            // all SVG features disabled until official WMS is released
    242242            //cadastreJMenu.add(menuActionBoundaries);
     243            cadastreJMenu.add(new JMenuItem(new MenuActionOpenPreferences()));
    243244        }
    244245        setEnabledAll(menuEnabled);
    245246    }
  • src/cadastre_fr/MenuActionOpenPreferences.java

     
     1// License: GPL. v2 and later. Copyright 2008-2009 by Pieren <pieren3@gmail.com> and others
     2package cadastre_fr;
     3
     4import static org.openstreetmap.josm.tools.I18n.marktr;
     5import static org.openstreetmap.josm.tools.I18n.tr;
     6
     7import java.awt.event.ActionEvent;
     8
     9import org.openstreetmap.josm.Main;
     10import org.openstreetmap.josm.actions.JosmAction;
     11import org.openstreetmap.josm.gui.preferences.PreferenceDialog;
     12
     13public class MenuActionOpenPreferences extends JosmAction {
     14    private static final long serialVersionUID = 1L;
     15
     16    public static String name = marktr("Preferences");
     17
     18    public MenuActionOpenPreferences() {
     19        super(tr(name), "cadastre_small", tr("Open Cadastre Preferences"), null, false, "cadastrefr/openpreferences", true);
     20    }
     21
     22    public void actionPerformed(ActionEvent e) {
     23        PreferenceDialog p = new PreferenceDialog(Main.parent);
     24        p.selectPreferencesTabByClass(CadastrePreferenceSetting.class);
     25        p.setVisible(true);
     26    }
     27}