Ejemplo n.º 1
0
  @Override
  public void init(boolean install) throws DesktopInitialisationException {
    // Initialises trash management.
    DesktopManager.setTrashProvider(getTrashProvider());

    // Registers KDE specific commands.
    try {
      String execCommand = getBaseCommand() + " exec $f";
      CommandManager.registerDefaultCommand(
          new Command(
              CommandManager.FILE_OPENER_ALIAS, execCommand, CommandType.SYSTEM_COMMAND, null));
      CommandManager.registerDefaultCommand(
          new Command(
              CommandManager.URL_OPENER_ALIAS, execCommand, CommandType.SYSTEM_COMMAND, null));
      CommandManager.registerDefaultCommand(
          new Command(
              CommandManager.FILE_MANAGER_ALIAS,
              execCommand,
              CommandType.SYSTEM_COMMAND,
              getFileManagerName()));
    } catch (CommandException e) {
      throw new DesktopInitialisationException(e);
    }

    // Multi-click interval retrieval
    try {
      String value = KdeConfig.getValue(DOUBLE_CLICK_CONFIG_KEY);
      if (value == null) multiClickInterval = super.getMultiClickInterval();

      multiClickInterval = Integer.parseInt(value);
    } catch (Exception e) {
      LOGGER.debug("Error while retrieving double-click interval from gconftool", e);
      multiClickInterval = super.getMultiClickInterval();
    }
  }