diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llfloaterfriends.cpp | 65 |
1 files changed, 37 insertions, 28 deletions
diff --git a/linden/indra/newview/llfloaterfriends.cpp b/linden/indra/newview/llfloaterfriends.cpp index 3d2e60a..97b7131 100644 --- a/linden/indra/newview/llfloaterfriends.cpp +++ b/linden/indra/newview/llfloaterfriends.cpp | |||
@@ -51,7 +51,7 @@ | |||
51 | #include "llnotify.h" | 51 | #include "llnotify.h" |
52 | #include "llresmgr.h" | 52 | #include "llresmgr.h" |
53 | #include "llimview.h" | 53 | #include "llimview.h" |
54 | #include "llvieweruictrlfactory.h" | 54 | #include "lluictrlfactory.h" |
55 | #include "llmenucommands.h" | 55 | #include "llmenucommands.h" |
56 | #include "llviewercontrol.h" | 56 | #include "llviewercontrol.h" |
57 | #include "llviewermessage.h" | 57 | #include "llviewermessage.h" |
@@ -178,7 +178,7 @@ void LLPanelFriends::updateFriends(U32 changed_mask) | |||
178 | // virtual | 178 | // virtual |
179 | BOOL LLPanelFriends::postBuild() | 179 | BOOL LLPanelFriends::postBuild() |
180 | { | 180 | { |
181 | mFriendsList = LLUICtrlFactory::getScrollListByName(this, "friend_list"); | 181 | mFriendsList = getChild<LLScrollListCtrl>("friend_list"); |
182 | mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); | 182 | mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT); |
183 | mFriendsList->setMaximumSelectCallback(onMaximumSelect); | 183 | mFriendsList->setMaximumSelectCallback(onMaximumSelect); |
184 | mFriendsList->setCommitOnSelectionChange(TRUE); | 184 | mFriendsList->setCommitOnSelectionChange(TRUE); |
@@ -201,7 +201,7 @@ BOOL LLPanelFriends::postBuild() | |||
201 | 201 | ||
202 | // primary sort = online status, secondary sort = name | 202 | // primary sort = online status, secondary sort = name |
203 | mFriendsList->sortByColumn("friend_name", TRUE); | 203 | mFriendsList->sortByColumn("friend_name", TRUE); |
204 | mFriendsList->sortByColumn("icon_online_status", TRUE); | 204 | mFriendsList->sortByColumn("icon_online_status", FALSE); |
205 | 205 | ||
206 | return TRUE; | 206 | return TRUE; |
207 | } | 207 | } |
@@ -219,37 +219,46 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id) | |||
219 | 219 | ||
220 | LLSD element; | 220 | LLSD element; |
221 | element["id"] = agent_id; | 221 | element["id"] = agent_id; |
222 | element["columns"][LIST_FRIEND_NAME]["column"] = "friend_name"; | 222 | LLSD& friend_column = element["columns"][LIST_FRIEND_NAME]; |
223 | element["columns"][LIST_FRIEND_NAME]["value"] = fullname; | 223 | friend_column["column"] = "friend_name"; |
224 | element["columns"][LIST_FRIEND_NAME]["font"] = "SANSSERIF"; | 224 | friend_column["value"] = fullname; |
225 | element["columns"][LIST_FRIEND_NAME]["font-style"] = "NORMAL"; | 225 | friend_column["font"] = "SANSSERIF"; |
226 | element["columns"][LIST_ONLINE_STATUS]["column"] = "icon_online_status"; | 226 | friend_column["font-style"] = "NORMAL"; |
227 | element["columns"][LIST_ONLINE_STATUS]["type"] = "icon"; | 227 | |
228 | LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; | ||
229 | online_status_column["column"] = "icon_online_status"; | ||
230 | online_status_column["type"] = "icon"; | ||
231 | |||
228 | if (online) | 232 | if (online) |
229 | { | 233 | { |
230 | element["columns"][LIST_FRIEND_NAME]["font-style"] = "BOLD"; | 234 | friend_column["font-style"] = "BOLD"; |
231 | element["columns"][LIST_ONLINE_STATUS]["value"] = gViewerArt.getString("icon_avatar_online.tga"); | 235 | online_status_column["value"] = "icon_avatar_online.tga"; |
232 | } | 236 | } |
233 | 237 | ||
234 | element["columns"][LIST_VISIBLE_ONLINE]["column"] = "icon_visible_online"; | 238 | LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE]; |
235 | element["columns"][LIST_VISIBLE_ONLINE]["type"] = "checkbox"; | 239 | online_column["column"] = "icon_visible_online"; |
236 | element["columns"][LIST_VISIBLE_ONLINE]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); | 240 | online_column["type"] = "checkbox"; |
241 | online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS); | ||
237 | 242 | ||
238 | element["columns"][LIST_VISIBLE_MAP]["column"] = "icon_visible_map"; | 243 | LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP]; |
239 | element["columns"][LIST_VISIBLE_MAP]["type"] = "checkbox"; | 244 | visible_map_column["column"] = "icon_visible_map"; |
240 | element["columns"][LIST_VISIBLE_MAP]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); | 245 | visible_map_column["type"] = "checkbox"; |
246 | visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION); | ||
241 | 247 | ||
242 | element["columns"][LIST_EDIT_MINE]["column"] = "icon_edit_mine"; | 248 | LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE]; |
243 | element["columns"][LIST_EDIT_MINE]["type"] = "checkbox"; | 249 | edit_my_object_column["column"] = "icon_edit_mine"; |
244 | element["columns"][LIST_EDIT_MINE]["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); | 250 | edit_my_object_column["type"] = "checkbox"; |
251 | edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS); | ||
245 | 252 | ||
246 | element["columns"][LIST_EDIT_THEIRS]["column"] = "icon_edit_theirs"; | 253 | LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS]; |
247 | element["columns"][LIST_EDIT_THEIRS]["type"] = "checkbox"; | 254 | edit_their_object_column["column"] = "icon_edit_theirs"; |
248 | element["columns"][LIST_EDIT_THEIRS]["enabled"] = ""; | 255 | edit_their_object_column["type"] = "checkbox"; |
249 | element["columns"][LIST_EDIT_THEIRS]["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); | 256 | edit_their_object_column["enabled"] = ""; |
257 | edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS); | ||
250 | 258 | ||
251 | element["columns"][LIST_FRIEND_UPDATE_GEN]["column"] = "friend_last_update_generation"; | 259 | LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN]; |
252 | element["columns"][LIST_FRIEND_UPDATE_GEN]["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; | 260 | update_gen_column["column"] = "friend_last_update_generation"; |
261 | update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1; | ||
253 | 262 | ||
254 | mFriendsList->addElement(element, ADD_BOTTOM); | 263 | mFriendsList->addElement(element, ADD_BOTTOM); |
255 | return have_name; | 264 | return have_name; |
@@ -265,7 +274,7 @@ BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh | |||
265 | std::string fullname; | 274 | std::string fullname; |
266 | BOOL have_name = gCacheName->getFullName(agent_id, fullname); | 275 | BOOL have_name = gCacheName->getFullName(agent_id, fullname); |
267 | 276 | ||
268 | itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? gViewerArt.getString("icon_avatar_online.tga") : LLString()); | 277 | itemp->getColumn(LIST_ONLINE_STATUS)->setValue(info->isOnline() ? "icon_avatar_online.tga" : LLString::null); |
269 | itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); | 278 | itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname); |
270 | // render name of online friends in bold text | 279 | // render name of online friends in bold text |
271 | ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(info->isOnline() ? LLFontGL::BOLD : LLFontGL::NORMAL); | 280 | ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle(info->isOnline() ? LLFontGL::BOLD : LLFontGL::NORMAL); |
@@ -292,7 +301,7 @@ void LLPanelFriends::refreshRightsChangeList() | |||
292 | bool can_offer_teleport = num_selected >= 1; | 301 | bool can_offer_teleport = num_selected >= 1; |
293 | bool selected_friends_online = true; | 302 | bool selected_friends_online = true; |
294 | 303 | ||
295 | LLTextBox* processing_label = LLUICtrlFactory::getTextBoxByName(this, "process_rights_label"); | 304 | LLTextBox* processing_label = getChild<LLTextBox>("process_rights_label"); |
296 | 305 | ||
297 | if(!mAllowRightsChange) | 306 | if(!mAllowRightsChange) |
298 | { | 307 | { |