示例#1
0
 public void commandAction(Command c, Displayable d) {
   boolean[] vals = new boolean[Util.explode(getNames(), '|').length];
   useItems(vals);
   Options.setInt(Options.OPTION_MAGIC_EYE, getValues(vals));
   Options.safe_save();
   if (eye != null) {
     Jimm.setDisplay(eye);
     return;
   }
   Jimm.back();
 }
示例#2
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();
    }
  }
示例#3
0
文件: Notify.java 项目: fin-nick/fj
  // #sijapp cond.end #
  private void vibrate(int duration) {

    Jimm.getJimm().getDisplay().vibrate(duration);
    // #sijapp cond.if modules_ANDROID is "true" #
    if (0 < duration) {
      new Timer().schedule(new StopVibro(), duration);
    }
    // #sijapp cond.end #
  }
示例#4
0
 public void addAction(String uin, String action) {
   if (action.equals("maybe_invisible")) {
     if (invisiblePackets++ == 0) {
       Jimm.getTimerRef().schedule(initTimerTask(new Object[] {uin, action}), 5000);
     }
   } else {
     registerAction(uin, action, null);
   }
 }
示例#5
0
 public void commandAction(Command c, Displayable d) {
   if (c == JimmUI.cmdMenu) {
     showMenu();
   } else {
     // if (prvScreen != null) {
     //    Jimm.setDisplay(prvScreen);
     //    prvScreen = null;
     // } else
     // {
     Jimm.getContactList().activate();
     // }
   }
 }
示例#6
0
 private void showMenu() {
   Menu menu = new Menu(this);
   if (uins.size() > 0) {
     menu.addMenuItem("user_menu", MENU_CONTACTMENU);
   }
   // #sijapp cond.if modules_DEBUGLOG is "true"#
   menu.addMenuItem("*DebugList*", MENU_DEBUGLOG);
   // #sijapp cond.end#
   if (uins.size() > 0) {
     menu.addMenuItem("copy_text", MENU_COPYTEXT);
     menu.addMenuItem("copy_uin", MENU_COPYUIN);
     menu.addMenuItem("copy_all_text", MENU_COPY_ALLTEXT);
   }
   menu.addMenuItem("options_lng", MENU_OPTIONS);
   if (uins.size() > 0) {
     menu.addMenuItem("clear", MENU_CLEAR);
   }
   menu.setMenuListener(this);
   Jimm.setDisplay(menu);
 }
示例#7
0
文件: Notify.java 项目: fin-nick/fj
  private void playNotification(int notType) {
    final long now = System.currentTimeMillis();
    if (!isCompulsory(playingType) && isCompulsory(notType)) {
      nextPlayTime = 0;
    }
    if (NOTIFY_ALARM == notType) {
      if (!Options.getBoolean(Options.OPTION_ALARM)) return;
      if (now < nextPlayTime) return;
      nextPlayTime = now + 0; // it is changed
      playingType = notType;
      vibrate(1500);
      if (Options.getBoolean(Options.OPTION_SILENT_MODE)) return;
      playNotify(notType, 100);
      return;
    }

    // #sijapp cond.if modules_MAGIC_EYE is "true" #
    // //eye sound
    if (NOTIFY_EYE == notType) { // eye sound
      if (Options.getBoolean(Options.OPTION_SILENT_MODE)) return; // eye sound
      if (Options.getBoolean(Options.OPTION_EYE_NOTIF)) { // eye sound
        if (!_this.play("eye.wav", 60))
          if (!_this.play("eye.amr", 60)) _this.play("eye.mp3", 60); // eye sound
      } // eye sound
    } // eye sound
    // #sijapp cond.end #
    // //eye sound

    int vibraKind = Options.getInt(Options.OPTION_VIBRATOR);
    if (vibraKind == 2) {
      vibraKind = Jimm.isLocked() ? 1 : 0;
    }
    if ((vibraKind > 0) && ((NOTIFY_MESSAGE == notType) || (NOTIFY_MULTIMESSAGE == notType))) {
      vibrate(Util.strToIntDef(Options.getString(Options.OPTION_VIBRATOR_TIME), 150)); // vibra time
    }

    if (Options.getBoolean(Options.OPTION_SILENT_MODE)) return;
    if (now < nextPlayTime) return;
    nextPlayTime = now + 2000;
    playingType = notType;

    // #sijapp cond.if target is "MIDP2" | target is "MOTOROLA" | target is "SIEMENS2"#
    switch (getNotificationMode(notType)) {
      case 1:
        try {
          switch (notType) {
            case NOTIFY_MESSAGE:
              Manager.playTone(ToneControl.C4, 750, Options.getInt(Options.OPTION_MESS_NOTIF_VOL));
              break;
            case NOTIFY_ONLINE:
            case NOTIFY_OFFLINE: // offline sound
            case NOTIFY_TYPING:
            case NOTIFY_OTHER: // other sound
              Manager.playTone(
                  ToneControl.C4 + 7, 750, Options.getInt(Options.OPTION_ONLINE_NOTIF_VOL));
          }

        } catch (Exception e) {
        }
        break;

      case 2:
        int notifyType = NOTIFY_MESSAGE;
        int volume = 0;
        switch (notType) {
          case NOTIFY_MESSAGE:
            volume = Options.getInt(Options.OPTION_MESS_NOTIF_VOL);
            break;

          case NOTIFY_ONLINE:
            volume = Options.getInt(Options.OPTION_ONLINE_NOTIF_VOL);
            break;

          case NOTIFY_OFFLINE: // offline sound
            volume = Options.getInt(Options.OPTION_OFFLINE_NOTIF_VOL); // offline sound
            break; // offline sound

          case NOTIFY_TYPING:
            volume = Options.getInt(Options.OPTION_TYPING_VOL); // typing
            break;

          case NOTIFY_OTHER: // other sound
            volume = Options.getInt(Options.OPTION_OTHER_NOTIF_VOL); // other sound
            break; // other sound
        }
        playNotify(notType, volume);
        break;
    }
  }
示例#8
0
 public OptionsEye(MagicEye magicEye) {
   eye = magicEye;
   Jimm.setDisplay(fillList(Options.getInt(Options.OPTION_MAGIC_EYE)));
 }
示例#9
0
 public static int uniqueValue() {
   int time = (int) (Jimm.getCurrentGmtTime() & 0x7FFF);
   return (time << 16) | (rand.nextInt() & 0xFFFF);
 }
示例#10
0
 /* Creates current date (local) */
 public static long createCurrentLocalTime() {
   return gmtTimeToLocalTime(Jimm.getCurrentGmtTime());
 }
示例#11
0
 // #sijapp cond.if modules_UPDATES is "true" # //add updates modules
 // #sijapp cond.if target is "MIDP2" | target is "SIEMENS2" | target is "MOTOROLA"#
 public static void updateProgram() {
   Jimm.platformRequestAndExit("jimm:update");
 }