Пример #1
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();
  }
Пример #2
0
 public MagicEye(Profile profile) {
   super(ResourceBundle.getString("magic_eye"));
   this.profile = profile;
   setMode(VirtualList.MODE_LIST);
   setVLCommands(this);
   setColorScheme();
 }
Пример #3
0
 private FormEx fillList(int values) {
   FormEx form =
       new FormEx(ResourceBundle.getString("options_lng"), JimmUI.cmdSave, JimmUI.cmdBack);
   form.removeCommand(JimmUI.cmdSave);
   initItems(form, getNames(), toByteArray(values));
   form.setCommandListener(this);
   return form;
 }
Пример #4
0
 private void initItems(FormEx form, String name, boolean[] values) {
   String[] names = Util.explode(name, '|');
   items = new LineChoiseBoolean[names.length];
   int size = Math.min(names.length, values.length);
   for (int i = 0; i < size; i++) {
     items[i] = new LineChoiseBoolean(ResourceBundle.getString(names[i]), values[i]);
     form.append(items[i]);
   }
 }
Пример #5
0
 public static void changeSoundMode(boolean showPopup) {
   boolean newValue = !Options.getBoolean(Options.OPTION_SILENT_MODE);
   if (showPopup) {
     PopupWindow.showShadowPopup(
         "Jimm", ResourceBundle.getString(newValue ? "#sound_is_off" : "#sound_is_on"));
   }
   getSound().vibrate(newValue ? 0 : 100);
   getSound().closePlayer();
   Options.setBoolean(Options.OPTION_SILENT_MODE, newValue);
   Options.safeSave();
 }