Esempio n. 1
0
  public void menuSelect(Menu menu, byte action) {
    switch (action) {
      case MENU_CONTACTMENU:
        if (uins.size() < 1) {
          return;
        }
        String uincm = (String) uins.elementAt(getCurrTextIndex());
        ContactItem cItemcm;
        if (profile.getItemByUIN(uincm) == null) {
          cItemcm = profile.createTempContact(uincm);
        } else {
          cItemcm = profile.getItemByUIN(uincm);
        }
        Menu mc = new Menu(this, (byte) 1);
        JimmUI.fillContactMenu(cItemcm, mc);
        Jimm.setPrevScreen(getVisibleObject());
        Jimm.setDisplay(mc);
        return;
        // #sijapp cond.if modules_DEBUGLOG is "true"#
      case MENU_DEBUGLOG:
        DebugLog.activateEx();
        return;
        // #sijapp cond.end#
      case MENU_OPTIONS:
        new OptionsEye(this);
        return;
      case MENU_COPYTEXT:
      case MENU_COPY_ALLTEXT:
        JimmUI.setClipBoardText(getCurrText(0, (action == MENU_COPY_ALLTEXT)));
        break;

      case MENU_COPYUIN:
        JimmUI.setClipBoardText((String) uins.elementAt(getCurrTextIndex()));
        break;

      case MENU_CLEAR:
        boolean needRemoveCommands = uins.size() > 0;
        idx = 0;
        uins = null;
        uins = new Vector();
        lock();
        if (uins.size() == 0 && needRemoveCommands) {
          removeCommandEx(JimmUI.cmdMenu);
        }
        clear();
        setColorScheme();
        unlock();
        break;
    }

    if (menu != null) {
      menu.back();
    }
  }
Esempio n. 2
0
  private void registerAction(String uin, String laction, String msg) {
    if (!profile.getBoolean(Profile.OPTION_ENABLE_MM)) {
      return;
    }
    boolean needAddCommands = uins.size() == 0;
    uins.addElement(uin);

    if (uins.size() >= 1 && needAddCommands) {
      addCommandEx(JimmUI.cmdMenu, MENU_TYPE_LEFT_BAR);
    }
    ContactItem contact = profile.getItemByUIN(uin);
    String action = ResourceBundle.getString(laction);
    int counter = idx++;
    String date = DateAndTime.getDateString(true, false);
    int color = getColor(COLOR_CAP2);
    lock();

    if (contact == null) {
      addBigText(
          "[" + counter + "]: " + uin + " (" + date + ")\n", color, Font.STYLE_BOLD, counter);
    } else {
      addBigText(
          "[" + counter + "]: " + contact.name + " (" + date + ")\n",
          color,
          Font.STYLE_BOLD,
          counter);
    }
    color = getColor(COLOR_TEXT);

    if (contact != null) {
      if ((contact.getIntValue(ContactItem.CONTACTITEM_STATUS) == ContactItem.STATUS_OFFLINE)
          && (action.equals(ResourceBundle.getString("read xtraz"))
              || action.equals(ResourceBundle.getString("read status message")))
          && !contact.getBooleanValue(ContactItem.CONTACTITEM_IS_TEMP)) {
        addBigText(ResourceBundle.getString("status_invisible"), color, Font.STYLE_PLAIN, counter);
        contact.setStatus(ContactItem.STATUS_INVISIBLE, true);
      } else {
        addBigText(action, color, Font.STYLE_PLAIN, counter);
      }
    } else {
      addBigText(action, color, Font.STYLE_PLAIN, counter);
    }

    if (msg != null) {
      doCRLF(counter);
      addBigText(msg, color, Font.STYLE_PLAIN, counter);
    }

    doCRLF(counter);
    unlock();
  }