Changeset 2259 in josm


Ignore:
Timestamp:
Oct 9, 2009 10:58:14 PM (4 years ago)
Author:
stoecker
Message:

added unmaintained plugin warning

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r2070 r2259  
    6262                "lang-ru", "ewmsplugin", "ywms", "tways-0.2", "geotagged", "landsat", 
    6363                "namefinder", "waypoints", "slippy_map_chooser", "tcx-support"}; 
     64        String [] unmaintained = new String[] {"multipoly", "gpsbabelgui", 
     65                "Intersect_way"}; 
    6466        for (String p : oldplugins) { 
    6567            if (plugins.contains(p)) { 
     
    7375                ); 
    7476            } 
     77        } 
     78        for (String p : unmaintained) { 
     79            if (plugins.contains(p) && disablePlugin(tr("<html>Loading of {0} plugin was requested." 
     80            +"<br>This plugin is no longer developed and very likely will produce errors." 
     81            +"<br>It should be disabled.<br>Delete from preferences?</html>", p), p)) 
     82                plugins.remove(p); 
    7583        } 
    7684 
     
    171179                } catch (Throwable e) { 
    172180                    e.printStackTrace(); 
    173                     ExtendedDialog dialog = new ExtendedDialog( 
    174                             Main.parent, 
    175                             tr("Disable plugin"), 
    176                             new String[] {tr("Disable plugin"), tr("Keep plugin")} 
    177                     ); 
    178                     dialog.setContent(tr("Could not load plugin {0}. Delete from preferences?", info.name)); 
    179                     dialog.setButtonIcons( new String[] {"dialogs/delete.png", "cancel.png"}); 
    180                     dialog.showDialog(); 
    181                     int result = dialog.getValue(); 
    182  
    183                     if(result == 1) 
    184                     { 
    185                         plugins.remove(info.name); 
    186                         Main.pref.removeFromCollection("plugins", info.name); 
    187                     } 
    188                 } 
    189             } 
    190         } 
    191     } 
     181                    disablePlugin(tr("Could not load plugin {0}. Delete from preferences?", info.name), info.name); 
     182                } 
     183            } 
     184        } 
     185    } 
     186    public static boolean disablePlugin(String reason, String name) 
     187    { 
     188        ExtendedDialog dialog = new ExtendedDialog( 
     189                Main.parent, 
     190                tr("Disable plugin"), 
     191                new String[] {tr("Disable plugin"), tr("Keep plugin")} 
     192        ); 
     193        dialog.setContent(reason); 
     194        dialog.setButtonIcons( new String[] {"dialogs/delete.png", "cancel.png"}); 
     195        dialog.showDialog(); 
     196        int result = dialog.getValue(); 
     197 
     198        if(result == 1) 
     199        { 
     200            Main.pref.removeFromCollection("plugins", name); 
     201            return true; 
     202        } 
     203        return false; 
     204    } 
     205 
    192206    public static void setMapFrame(MapFrame old, MapFrame map) { 
    193207        for (PluginProxy plugin : pluginList) { 
Note: See TracChangeset for help on using the changeset viewer.