Ignore:
Timestamp:
2009-01-23T22:36:04+01:00 (16 years ago)
Author:
stoecker
Message:

fixes for new plugin handling

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/surveyor/src/at/dallermassl/josm/plugin/surveyor/SurveyorPlugin.java

    r12778 r13332  
    2222import org.openstreetmap.josm.Main;
    2323import org.openstreetmap.josm.gui.MainMenu;
    24 import org.openstreetmap.josm.plugins.PluginProxy;
     24import org.openstreetmap.josm.plugins.PluginHandler;
    2525
    2626/**
     
    4444        super();
    4545
    46         // try to determine if the livegps plugin was already loaded:
    47 //        PluginInformation pluginInfo = PluginInformation.getLoaded("livegps");
    48 //        if (pluginInfo == null) {
    49 //          JOptionPane.showMessageDialog(null, "Please install wmsplugin");
    50 //          return;
    51 //        }
    52 //        if (!pluginInfo.version.equals("2")) {
    53 //          JOptionPane.showMessageDialog(null, "livegps Version 2 required.");
    54 //          return;
    55 //        }
    56         try {
    57             Class.forName("livegps.LiveGpsPlugin");
    58         } catch(ClassNotFoundException cnfe) {
    59             String message =
    60                 tr("SurveyorPlugin depends on LiveGpsPlugin!") + "\n" +
    61                 tr("LiveGpsPlugin not found, please install and activate.") + "\n" +
    62                 tr("SurveyorPlugin is disabled for the moment");
    63             JOptionPane.showMessageDialog(Main.parent, message, tr("SurveyorPlugin"), JOptionPane.ERROR_MESSAGE);
    64             return;
    65         }
    66 
    67 
    68         LiveGpsPlugin gpsPlugin = null;
    69         Iterator<PluginProxy> proxyIter = Main.plugins.iterator();
    70         while(proxyIter.hasNext()) {
    71             Object plugin = proxyIter.next().plugin;
    72             if(plugin instanceof LiveGpsPlugin) {
    73                 gpsPlugin = (LiveGpsPlugin) plugin;
    74                 break;
    75             }
    76         }
     46        LiveGpsPlugin gpsPlugin = (LiveGpsPlugin) PluginHandler.getPlugin("livegps");
    7747        if(gpsPlugin == null)
    7848            throw new IllegalStateException(tr("SurveyorPlugin needs LiveGpsPlugin, but could not find it!"));
Note: See TracChangeset for help on using the changeset viewer.