config.addLabelParameter2( "Plugin.localtracker.networks.info" );
final StringParameter subnets = config.addStringParameter2( "Plugin.localtracker.networks", "Plugin.localtracker.networks", "" );
final BooleanParameter include_wellknown = config.addBooleanParameter2( "Plugin.localtracker.wellknownlocals", "Plugin.localtracker.wellknownlocals", true );
config.addLabelParameter2( "Plugin.localtracker.autoadd.info" );
final StringParameter autoadd = config.addStringParameter2( "Plugin.localtracker.autoadd", "Plugin.localtracker.autoadd", "" );
/*
* actually these parameters affect LAN detection as a whole, not just the local tracker,
* so leave them enabled...
*
enabled.addEnabledOnSelection( lp1 );
enabled.addEnabledOnSelection( subnets );
enabled.addEnabledOnSelection( lp2 );
enabled.addEnabledOnSelection( autoadd );
*/
final BasicPluginViewModel view_model =
plugin_interface.getUIManager().createBasicPluginViewModel( "Plugin.localtracker.name" );
view_model.setConfigSectionID(PLUGIN_CONFIGSECTION_ID);
view_model.getActivity().setVisible( false );
view_model.getProgress().setVisible( false );
log.addListener(
new LoggerChannelListener()
{
public void
messageLogged(
int type,
String content )
{
view_model.getLogArea().appendText( content + "\n" );
}
public void
messageLogged(
String str,
Throwable error )
{
if ( str.length() > 0 ){
view_model.getLogArea().appendText( str + "\n" );
}
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter( sw );
error.printStackTrace( pw );
pw.flush();
view_model.getLogArea().appendText( sw.toString() + "\n" );
}
});
plugin_start_time = plugin_interface.getUtilities().getCurrentSystemTime();
// Assume we have a core, since this is a plugin
instance_manager = AzureusCoreFactory.getSingleton().getInstanceManager();
instance_manager.addListener( this );
plugin_interface.getPluginconfig().addListener(
new PluginConfigListener()
{
public void
configSaved()
{
processSubNets( subnets.getValue(),include_wellknown.getValue() );
processAutoAdd( autoadd.getValue());
}
});
processSubNets(subnets.getValue(), include_wellknown.getValue());
processAutoAdd(autoadd.getValue());
final DelayedTask dt = plugin_interface.getUtilities().createDelayedTask(new Runnable()
{
public void