Ignore:
Timestamp:
2010-02-02T18:54:51+01:00 (14 years ago)
Author:
Gubaer
Message:

Fixed automatic update policy for plugins.
new: policy for version and time based automatic update can be configured in the preferences, see help

Location:
trunk/src/org/openstreetmap/josm/gui/preferences
Files:
1 added
1 edited
1 moved

Legend:

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

    r2864 r2924  
    4141import org.openstreetmap.josm.gui.HelpAwareOptionPane;
    4242import org.openstreetmap.josm.gui.help.HelpUtil;
     43import org.openstreetmap.josm.gui.preferences.plugin.PluginListPanel;
    4344import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferencesModel;
    44 import org.openstreetmap.josm.gui.preferences.plugin.PluginPreferencesPanel;
     45import org.openstreetmap.josm.gui.preferences.plugin.PluginUpdatePolicyPanel;
    4546import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
    4647import org.openstreetmap.josm.plugins.PluginDownloadTask;
     
    9495
    9596    private JTextField tfFilter;
    96     private PluginPreferencesPanel pnlPluginPreferences;
     97    private PluginListPanel pnlPluginPreferences;
    9798    private PluginPreferencesModel model;
    9899    private JScrollPane spPluginPreferences;
     100    private PluginUpdatePolicyPanel pnlPluginUpdatePolicy;
     101
    99102    /**
    100103     * is set to true if this preference pane has been selected
     
    132135    }
    133136
    134     protected JPanel buildContentPane() {
     137    protected JPanel buildPluginListPanel() {
    135138        JPanel pnl = new JPanel(new BorderLayout());
    136139        pnl.add(buildSearchFieldPanel(), BorderLayout.NORTH);
    137140        model  = new PluginPreferencesModel();
    138         spPluginPreferences = new JScrollPane(pnlPluginPreferences = new PluginPreferencesPanel(model));
     141        spPluginPreferences = new JScrollPane(pnlPluginPreferences = new PluginListPanel(model));
    139142        spPluginPreferences.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
    140143        spPluginPreferences.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
     
    157160    }
    158161
     162    protected JPanel buildContentPanel() {
     163        JPanel pnl = new JPanel(new BorderLayout());
     164        JTabbedPane tpPluginPreferences = new JTabbedPane();
     165        tpPluginPreferences.add(buildPluginListPanel());
     166        tpPluginPreferences.add(pnlPluginUpdatePolicy  =new PluginUpdatePolicyPanel());
     167        tpPluginPreferences.setTitleAt(0, tr("Plugins"));
     168        tpPluginPreferences.setTitleAt(1, tr("Plugin update policy"));
     169
     170        pnl.add(tpPluginPreferences, BorderLayout.CENTER);
     171        return pnl;
     172    }
     173
    159174    public void addGui(final PreferenceTabbedPane gui) {
    160175        GridBagConstraints gc = new GridBagConstraints();
     
    163178        gc.anchor = GridBagConstraints.NORTHWEST;
    164179        gc.fill = GridBagConstraints.BOTH;
    165         gui.plugins.add(buildContentPane(), gc);
     180        gui.plugins.add(buildContentPanel(), gc);
    166181        pnlPluginPreferences.refreshView();
    167182        gui.addChangeListener(new PluginPreferenceActivationListener(gui.plugins));
     
    255270        if (! pluginPreferencesActivated)
    256271            return false;
     272        pnlPluginUpdatePolicy.rememberInPreferences();
    257273        if (model.isActivePluginsChanged()) {
    258274            LinkedList<String> l = new LinkedList<String>(model.getSelectedPluginNames());
  • trunk/src/org/openstreetmap/josm/gui/preferences/plugin/PluginListPanel.java

    r2921 r2924  
    2525import org.openstreetmap.josm.tools.OpenBrowser;
    2626
    27 public class PluginPreferencesPanel extends VerticallyScrollablePanel{
    28     private static final Logger logger = Logger.getLogger(PluginPreferencesPanel.class.getName());
     27public class PluginListPanel extends VerticallyScrollablePanel{
     28    private static final Logger logger = Logger.getLogger(PluginListPanel.class.getName());
    2929
    3030    private PluginPreferencesModel model;
    3131
    32     public PluginPreferencesPanel() {
     32    public PluginListPanel() {
    3333        model = new PluginPreferencesModel();
    3434        setLayout(new GridBagLayout());
    3535    }
    3636
    37     public PluginPreferencesPanel(PluginPreferencesModel model) {
     37    public PluginListPanel(PluginPreferencesModel model) {
    3838        this.model = model;
    3939        setLayout(new GridBagLayout());
Note: See TracChangeset for help on using the changeset viewer.