Ignore:
Timestamp:
2008-11-09T22:10:39+01:00 (15 years ago)
Author:
stoecker
Message:

added some plugin checks

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

Legend:

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

    r794 r1073  
    3535                pane.add(cancel, GBC.eol().anchor(GBC.CENTER));
    3636                setContentPane(pane);
    37                 setSize(400,100);
     37                setSize(Main.pref.getInteger("progressdialog.size",400),100);
    3838                setLocationRelativeTo(Main.parent);
    3939        }
  • trunk/src/org/openstreetmap/josm/gui/preferences/PluginPreference.java

    r1053 r1073  
    198198        private void update() {
    199199                // refresh description
    200                 PluginDownloader.downloadDescription();
     200                int num = PluginDownloader.downloadDescription();
     201                Boolean done = false;
    201202                refreshPluginPanel(gui);
    202203
     
    205206                for (PluginProxy proxy : Main.plugins) {
    206207                        PluginDescription description = findDescription(proxy.info.name);
    207                         if (description != null && (description.version == null || description.version.equals("")) ? (proxy.info.version != null && proxy.info.version.equals("")) : !description.version.equals(proxy.info.version)) {
     208                        if (description != null && (description.version == null || description.version.equals(""))
     209                        ? (proxy.info.version != null && proxy.info.version.equals("")) : !description.version.equals(proxy.info.version)) {
    208210                                toUpdate.add(description);
    209211                                toUpdateStr.append(description.name+"\n");
     
    212214                if (toUpdate.isEmpty()) {
    213215                        JOptionPane.showMessageDialog(Main.parent, tr("All installed plugins are up to date."));
    214                         return;
    215                 }
    216                 int answer = JOptionPane.showConfirmDialog(Main.parent, tr("Update the following plugins:\n\n{0}", toUpdateStr.toString()), tr("Update"), JOptionPane.OK_CANCEL_OPTION);
    217                 if (answer != JOptionPane.OK_OPTION)
    218                         return;
    219                 PluginDownloader.update(toUpdate);
     216                        done = true;
     217                }
     218                else
     219                {
     220                        int answer = JOptionPane.showConfirmDialog(Main.parent, tr("Update the following plugins:\n\n{0}",
     221                        toUpdateStr.toString()), tr("Update"), JOptionPane.OK_CANCEL_OPTION);
     222                        if (answer == JOptionPane.OK_OPTION)
     223                        {
     224                                PluginDownloader.update(toUpdate);
     225                                done = true;
     226                        }
     227                }
     228                if(done && num >= 1)
     229                        Main.pref.put("pluginmanager.lastupdate", Long.toString(System.currentTimeMillis()));
    220230        }
    221231
Note: See TracChangeset for help on using the changeset viewer.