Search in sources :

Example 1 with PluginAdapter

use of com.biglybt.pif.PluginAdapter in project BiglyBT by BiglySoftware.

the class AENameServiceJava9 method checkI2PInstall.

private static void checkI2PInstall(final String host_name) {
    synchronized (AENameServiceJava9.class) {
        if (i2p_checked) {
            return;
        }
        try {
            Core core = CoreFactory.getSingleton();
            if (core != null) {
                i2p_checked = true;
                PluginInterface pi = core.getPluginManager().getDefaultPluginInterface();
                pi.addListener(new PluginAdapter() {

                    @Override
                    public void initializationComplete() {
                        if (I2PHelpers.isI2PInstalled()) {
                            return;
                        }
                        final boolean[] install_outcome = { false };
                        String enable_i2p_reason = MessageText.getString("azneti2phelper.install.reason.dns", new String[] { host_name });
                        I2PHelpers.installI2PHelper(enable_i2p_reason, "azneti2phelper.install.dns.resolve", install_outcome, new Runnable() {

                            @Override
                            public void run() {
                                if (!install_outcome[0]) {
                                }
                            }
                        });
                    }
                });
            }
        } catch (Throwable e) {
        }
    }
}
Also used : PluginAdapter(com.biglybt.pif.PluginAdapter) PluginInterface(com.biglybt.pif.PluginInterface) Core(com.biglybt.core.Core)

Example 2 with PluginAdapter

use of com.biglybt.pif.PluginAdapter in project BiglyBT by BiglySoftware.

the class AENameServiceDescriptor method checkI2PInstall.

private static void checkI2PInstall(final String host_name) {
    synchronized (AENameServiceDescriptor.class) {
        if (i2p_checked) {
            return;
        }
        try {
            Core core = CoreFactory.getSingleton();
            if (core != null) {
                i2p_checked = true;
                PluginInterface pi = core.getPluginManager().getDefaultPluginInterface();
                pi.addListener(new PluginAdapter() {

                    @Override
                    public void initializationComplete() {
                        if (I2PHelpers.isI2PInstalled()) {
                            return;
                        }
                        final boolean[] install_outcome = { false };
                        String enable_i2p_reason = MessageText.getString("azneti2phelper.install.reason.dns", new String[] { host_name });
                        I2PHelpers.installI2PHelper(enable_i2p_reason, "azneti2phelper.install.dns.resolve", install_outcome, new Runnable() {

                            @Override
                            public void run() {
                                if (!install_outcome[0]) {
                                }
                            }
                        });
                    }
                });
            }
        } catch (Throwable e) {
        }
    }
}
Also used : PluginAdapter(com.biglybt.pif.PluginAdapter) PluginInterface(com.biglybt.pif.PluginInterface) Core(com.biglybt.core.Core)

Aggregations

Core (com.biglybt.core.Core)2 PluginAdapter (com.biglybt.pif.PluginAdapter)2 PluginInterface (com.biglybt.pif.PluginInterface)2