(MenuCommand c, VirtualList d)
| 180 | } |
| 181 | |
| 182 | public void menuAction(MenuCommand c, VirtualList d) { |
| 183 | super.menuAction(c, d); |
| 184 | |
| 185 | String nick = nickField.getValue(); |
| 186 | String name = nameField.getValue(); |
| 187 | String host = hostField.getValue(); |
| 188 | String room = roomField.getValue(); |
| 189 | String pass = passField.getValue(); |
| 190 | int msgLimit = Integer.parseInt(msgLimitField.getValue()); |
| 191 | |
| 192 | boolean autojoin = autoJoin.getValue(); |
| 193 | |
| 194 | if (nick.length() == 0) { |
| 195 | return; |
| 196 | } |
| 197 | if (room.length() == 0) { |
| 198 | return; |
| 199 | } |
| 200 | if (host.length() == 0) { |
| 201 | return; |
| 202 | } |
| 203 | |
| 204 | StringBuffer gchat = new StringBuffer(room.trim()).append('@').append(host.trim()); |
| 205 | |
| 206 | if (name.length() == 0) { |
| 207 | name = gchat.toString(); |
| 208 | } |
| 209 | |
| 210 | saveMsgCount(msgLimit); |
| 211 | |
| 212 | if (c == cmdEdit) { |
| 213 | sd.account.bookmarks.removeElement(editConf); |
| 214 | Bookmark newItem = new Bookmark(name, gchat.toString(), nick, pass, autojoin); |
| 215 | BookmarkItem item = new BookmarkItem(newItem); |
| 216 | if (cursor < sd.account.bookmarks.size()) { |
| 217 | sd.account.bookmarks.insertElementAt(newItem, cursor); |
| 218 | } else { |
| 219 | sd.account.bookmarks.addElement(newItem); |
| 220 | } |
| 221 | sd.getTheStream().addBlockListener(new BookmarkQuery(BookmarkQuery.SAVE)); |
| 222 | destroyView(); |
| 223 | } else if (c == cmdAdd) { |
| 224 | new Bookmarks(new BookmarkItem(new Bookmark(name, gchat.toString(), nick, pass, autojoin))); |
| 225 | } else if (c == cmdJoin) { |
| 226 | //#ifdef PRIVACY |
| 227 | if (!sd.account.isGoogle) { |
| 228 | if (QuickPrivacy.conferenceList == null) { |
| 229 | QuickPrivacy.conferenceList = new Vector(); |
| 230 | } |
| 231 | QuickPrivacy.conferenceList.addElement(host); |
| 232 | new QuickPrivacy().updateQuickPrivacyList(); |
| 233 | } |
| 234 | //#endif |
| 235 | |
| 236 | try { |
| 237 | cf.defGcRoom = room + "@" + host; |
| 238 | cf.saveToStorage(); |
| 239 | gchat.append('/').append(nick); |
nothing calls this directly
no test coverage detected