Changeset 6969 in josm


Ignore:
Timestamp:
2014-04-11T00:58:44+02:00 (10 years ago)
Author:
Don-vip
Message:

fix #9913 - update icon of mappaint preferences

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

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/PreferencesAction.java

    r6830 r6969  
    2626    private final Class<? extends SubPreferenceSetting> subTab;
    2727
    28     private PreferencesAction(String name, String tooltip,
     28    private PreferencesAction(String name, String icon, String tooltip,
    2929                              Class<? extends TabPreferenceSetting> tab, Class<? extends SubPreferenceSetting> subTab) {
    30         super(name, "preference", tooltip, null, false, "preference_" + Utils.<Class>firstNonNull(tab, subTab).getName(), false);
     30        super(name, icon, tooltip, null, false, "preference_" + Utils.<Class>firstNonNull(tab, subTab).getName(), false);
    3131        this.tab = tab;
    3232        this.subTab = subTab;
    3333    }
    3434
     35    /**
     36     * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given tab, with default icon.
     37     * @param name The action name
     38     * @param tooltip The action tooltip
     39     * @param tab The preferences tab to select
     40     * @return The created action
     41     */
    3542    public static PreferencesAction forPreferenceTab(String name, String tooltip, Class<? extends TabPreferenceSetting> tab) {
    36         CheckParameterUtil.ensureParameterNotNull(tab);
    37         return new PreferencesAction(name, tooltip, tab, null);
     43        return forPreferenceTab(name, tooltip, tab, "preference");
    3844    }
    3945
     46    /**
     47     * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given tab, with custom icon.
     48     * @param name The action name
     49     * @param tooltip The action tooltip
     50     * @param tab The preferences tab to select
     51     * @param icon The action icon
     52     * @return The created action
     53     * @since 6969
     54     */
     55    public static PreferencesAction forPreferenceTab(String name, String tooltip, Class<? extends TabPreferenceSetting> tab, String icon) {
     56        CheckParameterUtil.ensureParameterNotNull(tab);
     57        return new PreferencesAction(name, icon, tooltip, tab, null);
     58    }
     59
     60    /**
     61     * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given subtab, with default icon.
     62     * @param name The action name
     63     * @param tooltip The action tooltip
     64     * @param subTab The preferences subtab to select
     65     * @return The created action
     66     */
    4067    public static PreferencesAction forPreferenceSubTab(String name, String tooltip, Class<? extends SubPreferenceSetting> subTab) {
     68        return forPreferenceSubTab(name, tooltip, subTab, "preference");
     69    }
     70
     71    /**
     72     * Returns a new {@code PreferenceAction} opening preferences dialog directly to the given subtab, with custom icon.
     73     * @param name The action name
     74     * @param tooltip The action tooltip
     75     * @param subTab The preferences subtab to select
     76     * @param icon The action icon
     77     * @return The created action
     78     * @since 6969
     79     */
     80    public static PreferencesAction forPreferenceSubTab(String name, String tooltip, Class<? extends SubPreferenceSetting> subTab, String icon) {
    4181        CheckParameterUtil.ensureParameterNotNull(subTab);
    42         return new PreferencesAction(name, tooltip, null, subTab);
     82        return new PreferencesAction(name, icon, tooltip, null, subTab);
    4383    }
    4484
  • trunk/src/org/openstreetmap/josm/gui/dialogs/MapPaintDialog.java

    r6920 r6969  
    9494
    9595    public static final JosmAction PREFERENCE_ACTION = PreferencesAction.forPreferenceSubTab(
    96             tr("Map paint preferences"), null, MapPaintPreference.class);
     96            tr("Map paint preferences"), null, MapPaintPreference.class, "dialogs/mappaintpreference");
    9797
    9898    /**
     
    102102        super(tr("Map Paint Styles"), "mapstyle", tr("configure the map painting style"),
    103103                Shortcut.registerShortcut("subwindow:mappaint", tr("Toggle: {0}", tr("MapPaint")),
    104                         KeyEvent.VK_M, Shortcut.ALT_SHIFT), 150);
     104                        KeyEvent.VK_M, Shortcut.ALT_SHIFT), 150, false, MapPaintPreference.class);
    105105        build();
    106106    }
Note: See TracChangeset for help on using the changeset viewer.