Ejemplo n.º 1
0
  /** @return */
  public static boolean hasFullBurn() {

    PluginInterface pi =
        PluginInitializer.getDefaultInterface().getPluginState().isInitialisationComplete()
            ? AzureusCoreFactory.getSingleton()
                .getPluginManager()
                .getPluginInterfaceByID("azburn_v")
            : null;
    if (pi == null) {
      // maybe not added yet.. use featman
      Set<String> featuresInstalled = UtilitiesImpl.getFeaturesInstalled();
      return featuresInstalled.contains("dvdburn_trial") && !featuresInstalled.contains("dvdburn");
    }
    return pi.getPluginState().isOperational();
  }
  public void performAction(int action_id, Object args, final actionListener listener) {
    if (action_id == ACTION_FULL_UPDATE) {

      FullUpdateWindow.handleUpdate((String) args, listener);

    } else if (action_id == ACTION_UPDATE_RESTART_REQUEST) {

      String MSG_PREFIX = "UpdateMonitor.messagebox.";

      String title = MessageText.getString(MSG_PREFIX + "restart.title");

      String text = MessageText.getString(MSG_PREFIX + "restart.text");

      bringToFront();

      boolean no_timeout = args instanceof Boolean && ((Boolean) args).booleanValue();

      int timeout = 180000;

      if (no_timeout
          || !PluginInitializer.getDefaultInterface().getPluginManager().isSilentRestartEnabled()) {

        timeout = -1;
      }

      promptUser(
          title,
          text,
          new String[] {
            MessageText.getString("UpdateWindow.restart"),
            MessageText.getString("UpdateWindow.restartLater")
          },
          0,
          null,
          null,
          false,
          timeout,
          new UserPrompterResultListener() {
            public void prompterClosed(int result) {
              listener.actionComplete(result == 0);
            }
          });
    } else {

      Debug.out("Unknown action " + action_id);
    }
  }
  protected void startUp() {
    plugin_interface = PluginInitializer.getDefaultInterface();

    if (COConfigurationManager.getStringParameter("ui").equals("az2")) {

      is_enabled = false;

    } else {

      is_enabled = COConfigurationManager.getBooleanParameter("devices.tivo.enabled", true);
    }

    uid = COConfigurationManager.getStringParameter("devices.tivo.uid", null);

    if (uid == null) {

      byte[] bytes = new byte[8];

      RandomUtils.nextBytes(bytes);

      uid = Base32.encode(bytes);

      COConfigurationManager.setParameter("devices.tivo.uid", uid);
    }

    boolean found_tivo = false;

    for (Device device : device_manager.getDevices()) {

      if (device instanceof DeviceTivo) {

        found_tivo = true;

        break;
      }
    }

    if (found_tivo || device_manager.getAutoSearch()) {

      search(found_tivo, false);
    }
  }
Ejemplo n.º 4
0
  public static boolean isStreamPermitted() {
    FeatureManager fm = PluginInitializer.getDefaultInterface().getUtilities().getFeatureManager();

    return (fm.isFeatureInstalled("core"));
  }