?? options.java.svn-base
字號:
setBoolean(Options.OPTION_CP1251_HACK, ResourceBundle.langAvailable[0] .equals("RU") || ResourceBundle.langAvailable[0].equals("BE") ); setBoolean(Options.OPTION_INIT_CAPS, true); //#sijapp cond.if target isnot "DEFAULT"# setInt(Options.OPTION_VIBRATOR, 0); //#sijapp cond.end# //#sijapp cond.if modules_TRAFFIC is "true" # setInt(Options.OPTION_COST_PER_PACKET, 0); setInt(Options.OPTION_COST_PER_DAY, 0); setInt(Options.OPTION_COST_PACKET_LENGTH, 1024); setString(Options.OPTION_CURRENCY, "$"); //#sijapp cond.end # setLong(Options.OPTION_ONLINE_STATUS, ContactList.STATUS_ONLINE); setBoolean(Options.OPTION_CHAT_SMALL_FONT, true); setBoolean(Options.OPTION_USE_GROUPS, false); setBoolean(Options.OPTION_HISTORY, false); setInt(Options.OPTION_COLOR_SCHEME, 0); setBoolean(Options.OPTION_USE_SMILES, true); setBoolean(Options.OPTION_SHOW_LAST_MESS, false); //#sijapp cond.if modules_PROXY is "true" # setInt(Options.OPTION_PRX_TYPE, 0); setString(Options.OPTION_PRX_SERV, emptyString); setString(Options.OPTION_PRX_PORT, "1080"); setString(Options.OPTION_AUTORETRY_COUNT, "1"); setString(Options.OPTION_PRX_NAME, emptyString); setString(Options.OPTION_PRX_PASS, emptyString); //#sijapp cond.end # setInt(Options.OPTION_VISIBILITY_ID, 0); setInt(Options.OPTION_EXT_CLKEY0, 0);//#sijapp cond.if target="MIDP2" | target="SIEMENS2"# setInt(Options.OPTION_EXT_CLKEYSTAR, HOTKEY_FULLSCR);//#sijapp cond.else# setInt (Options.OPTION_EXT_CLKEYSTAR, 0);//#sijapp cond.end #//#sijapp cond.if target isnot "DEFAULT" # setBoolean(Options.OPTION_SILENT_MODE, false);//#sijapp cond.end # setInt(Options.OPTION_EXT_CLKEY4, 0); setInt(Options.OPTION_EXT_CLKEY6, 0); setInt(Options.OPTION_EXT_CLKEYCALL, HOTKEY_NEWMSG); setInt(Options.OPTION_EXT_CLKEYPOUND, HOTKEY_LOCK); setString(Options.OPTION_UIN2, emptyString); setString(Options.OPTION_PASSWORD2, emptyString); setString(Options.OPTION_UIN3, emptyString); setString(Options.OPTION_PASSWORD3, emptyString); setInt(Options.OPTION_CURR_ACCOUNT, 0); setBoolean(Options.OPTION_FULL_SCREEN, false); //#sijapp cond.if target="MIDP2"# setBoolean(Options.OPTION_BRING_UP, true); //#sijapp cond.end# /* Offset (in hours) between GMT time and local zone time GMT_time + GMT_offset + DayLightSaving = Local_time */ setInt(Options.OPTION_GMT_OFFSET, 0); /* Offset (in hours) between GMT time and phone clock Phone_clock + Local_offset - DayLightSaving = GMT_time */ setInt(Options.OPTION_LOCAL_OFFSET, 0); /* DayLightSaving (int) */ setInt(Options.OPTION_DAYLIGHT_SAVING, 0); setBoolean(OPTION_LANG_CHANGED, false); setBoolean(OPTION_CREEPING_LINE, false); setBoolean(OPTION_SHOW_MESS_ICON, true); setBoolean(OPTION_SHOW_NICK, false); setBoolean(OPTION_SHOW_MESS_DATE, true); setBoolean(OPTION_SHOW_MESS_CLRF, false); setBoolean(OPTION_MESS_COLORED_TEXT, true); setBoolean(OPTION_CL_CLIENTS, true); setBoolean(OPTION_XSTATUSES, true); setBoolean(OPTION_ASK_FOR_WEB_FT, true); setInt(OPTION_XSTATUS, -1);//#sijapp cond.if (target!="DEFAULT")&(modules_FILES="true")#// setInt(OPTION_CAMERA_LOCATOR, 0); setInt(OPTION_CAMERA_RES, 0); setInt(OPTION_CAMERA_ENCODING, 0);//#sijapp cond.end#//#sijapp cond.if target isnot "DEFAULT"# selectSoundType("online.", OPTION_ONLINE_NOTIF_FILE); selectSoundType("message.", OPTION_MESS_NOTIF_FILE); selectSoundType("typing.", OPTION_TYPING_FILE);//#sijapp cond.end# setInt(OPTION_FT_MODE, FS_MODE_WEB); setBoolean(OPTION_USE_AUTOAWAY, true); setInt(OPTION_AUTOAWAY_TIME1, 5); setInt(OPTION_AUTOAWAY_TIME2, 15); setBoolean(OPTION_DELIV_MES_INFO, true); setBoolean(OPTION_MIRROR_MENU, false); setBoolean(OPTION_SHOW_DELETED_CONT, false); setBoolean(OPTION_SMALL_FONT, false); //#sijapp cond.if modules_ANTISPAM="true"# setBoolean(OPTION_ANTI_SPAM, false); setString(OPTION_ANTI_SPAM_QUESTION, "12-11"); setString(OPTION_ANTI_SPAM_ANS, "1");//#sijapp cond.end# setBoolean(OPTION_FULL_TEXTBOX, false); setInt(OPTION_CAPTION_OFFSET, (Jimm.getPhoneVendor() == Jimm.PHONE_NOKIA) ? 8 : 0);//#sijapp cond.if target!="DEFAULT"# setString(OPTION_BG_IMAGE_URL, emptyString); setInt (OPTION_BG_IMAGE, 0); setInt (OPTION_CURSOR_ALPHA, 128); setInt (OPTION_MENU_ALPHA, 64); setInt (OPTION_BG_IMAGE_MODE, BG_IMAGE_PAVE);//#sijapp cond.end# //#sijapp cond.if target="MIDP2" | target="SIEMENS2"# setInt (OPTION_IMG_SCALE, 100);//#sijapp cond.end# } static public void resetLangDependedOpts() { setString(Options.OPTION_STATUS_MESSAGE, ResourceBundle .getString("status_message_text")); } /* Delete all record stores */ static public void reset_rms() throws RecordStoreException { String[] stores = RecordStore.listRecordStores(); for (int i = 0;i < stores.length;i++) { RecordStore.deleteRecordStore(stores[i]); } } /* Load option values from record store */ static public void load() throws IOException, RecordStoreException { /* Open record store */ RecordStore account = null; try { account = RecordStore.openRecordStore("opt"+"ions"/*to avoid lang. preprocessor*/, false); /* Temporary variables */ byte[] buf; ByteArrayInputStream bais; DataInputStream dis; /* Get version info from record store */ buf = account.getRecord(1); bais = new ByteArrayInputStream(buf); dis = new DataInputStream(bais); Options.setDefaults(); /* Read all option key-value pairs */ buf = account.getRecord(2); bais = new ByteArrayInputStream(buf); dis = new DataInputStream(bais); int optionKey; byte[] optionValue; while (dis.available() > 0) { optionKey = dis.readUnsignedByte(); if (optionKey < 64) /* 0-63 = String */ { setString(optionKey, dis.readUTF()); } else if (optionKey < 128) /* 64-127 = int */ { setInt(optionKey, dis.readInt()); } else if (optionKey < 192) /* 128-191 = boolean */ { setBoolean(optionKey, dis.readBoolean()); } else if (optionKey < 224) /* 192-223 = long */ { setLong(optionKey, dis.readLong()); } else /* 226-255 = Scrambled String */ { optionValue = new byte[dis.readUnsignedShort()]; dis.readFully(optionValue); optionValue = Util.decipherPassword(optionValue); setString(optionKey, Util.byteArrayToString(optionValue, 0, optionValue.length, true)); } } optionValue = null; } finally { /* Close record store */ if (account != null) account.closeRecordStore(); } } /* Save option values to record store */ static public void save() throws IOException, RecordStoreException { /* Open record store */ RecordStore account = null; try { account = RecordStore.openRecordStore("opt"+"ions"/*to avoid lang. preprocessor*/, true); /* Add empty records if necessary */ while (account.getNumRecords() < 3) { account.addRecord(null, 0, 0); } /* Temporary variables */ byte[] buf; ByteArrayOutputStream baos; DataOutputStream dos; /* Add version info to record store */ baos = new ByteArrayOutputStream(); dos = new DataOutputStream(baos); dos.writeUTF(Jimm.VERSION); buf = baos.toByteArray(); account.setRecord(1, buf, 0, buf.length); /* Save all option key-value pairs */ baos = new ByteArrayOutputStream(); dos = new DataOutputStream(baos); Enumeration optionKeys = options.keys(); int optionKey; byte[] optionValue; while (optionKeys.hasMoreElements()) { optionKey = ((Integer) optionKeys.nextElement()).intValue(); dos.writeByte(optionKey); if (optionKey < 64) /* 0-63 = String */ { dos.writeUTF(getString(optionKey)); } else if (optionKey < 128) /* 64-127 = int */ { dos.writeInt(getInt(optionKey)); } else if (optionKey < 192) /* 128-191 = boolean */ { dos.writeBoolean(getBoolean(optionKey)); } else if (optionKey < 224) /* 192-223 = long */ { dos.writeLong(getLong(optionKey)); } else /* 226-255 = Scrambled String */ { optionValue = Util.stringToByteArray( getString(optionKey), true); optionValue = Util.decipherPassword(optionValue); dos.writeShort(optionValue.length); dos.write(optionValue); } } optionValue = null; buf = baos.toByteArray(); account.setRecord(2, buf, 0, buf.length); } finally { /* Close record store */ if (account != null) account.closeRecordStore(); } } static public void safeSave() { try { save(); } catch (Exception e) { JimmException.handleException(new JimmException(172, 0, true)); } } /* Option retrieval methods (no type checking!) */ static public synchronized String getString(int key) { switch (key) { case OPTION_UIN: case OPTION_PASSWORD: int index = getInt(Options.OPTION_CURR_ACCOUNT) * 2; return getString(accountKeys[key == OPTION_UIN ? index : index + 1]); } return ((String) options.get(new Integer(key))); } static public synchronized int getInt(int key) { return (((Integer) options.get(new Integer(key))).intValue()); } static public synchronized boolean getBoolean(int key) { return (((Boolean) options.get(new Integer(key))).booleanValue()); } static public synchronized long getLong(int key) { return (((Long) options.get(new Integer(key))).longValue()); } /* Option setting methods (no type checking!) */ static public synchronized void setString(int key, String value) { //#sijapp cond.if modules_DEBUGLOG is "true" # if (checkKeys && options.containsKey(new Integer(key))) System.out.println("Identical keys: " + key); //#sijapp cond.end# options.put(new Integer(key), value); } static public synchronized void setInt(int key, int value) { //#sijapp cond.if modules_DEBUGLOG is "true" # if (checkKeys && options.containsKey(new Integer(key))) System.out.println("Identical keys: " + key); //#sijapp cond.end# options.put(new Integer(key), new Integer(value)); } static public synchronized void setBoolean(int key, boolean value) { //#sijapp cond.if modules_DEBUGLOG is "true" # if (checkKeys && options.containsKey(new Integer(key))) System.out.println("Identical keys: " + key); //#sijapp cond.end# options.put(new Integer(key), new Boolean(value)); } static public synchronized void setLong(int key, long value) { //#sijapp cond.if modules_DEBUGLOG is "true" # if (checkKeys && options.containsKey(new Integer(key))) System.out.println("Identical keys: " + key); //#sijapp cond.end# options.put(new Integer(key), new Long(value)); } /**************************************************************************/ /* Retrieves color value from color scheme */ static public int getSchemeColor(int type, int theme) { if (theme == -1) theme = getInt(OPTION_COLOR_SCHEME); if ((theme + 1) * 8 > colors.length) { setInt(OPTION_COLOR_SCHEME, 0); theme = 0; } return (colors[theme * 8 + type - 1]); } static public void editOptions() { // Construct option form optionsForm = new OptionsForm(); optionsForm.activateForm(); } static public void setCaptchaImage(Image img) { int width = 9*SplashCanvas.getAreaWidth()/10-2; img = Util.createThumbnail(img, width, 0); optionsForm.addCaptchaToForm(img); img = null; } static public void submitNewUinPassword(String uin, String password) { optionsForm.addAccount(uin, password); } //#sijapp cond.if target isnot "DEFAULT"# private static void selectSoundType(String name, int option)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -