// virtual BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); if ( mContextMenu && !isAvalineItemSelected()) { uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); mContextMenu->show(this, selected_uuids, x, y); } return handled; }
// virtual BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); if ( mContextMenu ) { std::vector<LLUUID> selected_uuids; getSelectedUUIDs(selected_uuids); mContextMenu->show(this, selected_uuids, x, y); } return handled; }
void LLWearableItemsList::onRightClick(S32 x, S32 y) { uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); if (selected_uuids.empty()) { return; } ContextMenu::instance().show(this, selected_uuids, x, y); }
// virtual BOOL LLAvatarList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); // if ( mContextMenu && !isAvalineItemSelected()) // [RLVa:KB] - Checked: 2010-06-04 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d if ( (mContextMenu && !isAvalineItemSelected()) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ) // [/RLVa:KB] { uuid_vec_t selected_uuids; getSelectedUUIDs(selected_uuids); mContextMenu->show(this, selected_uuids, x, y); } return handled; }
void LLCOFWearables::onListRightClick(LLUICtrl* ctrl, S32 x, S32 y, LLListContextMenu* menu) { if(menu) { uuid_vec_t selected_uuids; if(getSelectedUUIDs(selected_uuids)) { bool show_menu = false; for(uuid_vec_t::iterator it = selected_uuids.begin();it!=selected_uuids.end();++it) { if ((*it).notNull()) { show_menu = true; break; } } if(show_menu) { menu->show(ctrl, selected_uuids, x, y); } } } }
////////////////////////////////////////////////////////////////////////// // PROTECTED SECTION ////////////////////////////////////////////////////////////////////////// void LLAvatarList::refresh() { bool have_names = TRUE; bool add_limit_exceeded = false; bool modified = false; bool have_filter = !mNameFilter.empty(); // Save selection. uuid_vec_t selected_ids; getSelectedUUIDs(selected_ids); LLUUID current_id = getSelectedUUID(); // Determine what to add and what to remove. uuid_vec_t added, removed; LLAvatarList::computeDifference(getIDs(), added, removed); // Handle added items. unsigned nadded = 0; const std::string waiting_str = LLTrans::getString("AvatarNameWaiting"); for (uuid_vec_t::const_iterator it=added.begin(); it != added.end(); it++) { const LLUUID& buddy_id = *it; LLAvatarName av_name; have_names &= LLAvatarNameCache::get(buddy_id, &av_name); if (!have_filter || findInsensitive(av_name.mDisplayName, mNameFilter)) { if (nadded >= ADD_LIMIT) { add_limit_exceeded = true; break; } else { // *NOTE: If you change the UI to show a different string, // be sure to change the filter code below. if (LLRecentPeople::instance().isAvalineCaller(buddy_id)) { const LLSD& call_data = LLRecentPeople::instance().getData(buddy_id); addAvalineItem(buddy_id, call_data["session_id"].asUUID(), call_data["call_number"].asString()); } else { addNewItem(buddy_id, av_name.mDisplayName.empty() ? waiting_str : av_name.mDisplayName, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); } modified = true; nadded++; } } } // Handle removed items. for (uuid_vec_t::const_iterator it=removed.begin(); it != removed.end(); it++) { removeItemByUUID(*it); modified = true; } // Handle filter. if (have_filter) { std::vector<LLSD> cur_values; getValues(cur_values); for (std::vector<LLSD>::const_iterator it=cur_values.begin(); it != cur_values.end(); it++) { const LLUUID& buddy_id = it->asUUID(); LLAvatarName av_name; have_names &= LLAvatarNameCache::get(buddy_id, &av_name); if (!findInsensitive(av_name.mDisplayName, mNameFilter)) { removeItemByUUID(buddy_id); modified = true; } } } // Changed item in place, need to request sort and update columns // because we might have changed data in a column on which the user // has already sorted. JC sort(); // re-select items // selectMultiple(selected_ids); // TODO: implement in LLFlatListView if need selectItemByUUID(current_id); // If the name filter is specified and the names are incomplete, // we need to re-update when the names are complete so that // the filter can be applied correctly. // // Otherwise, if we have no filter then no need to update again // because the items will update their names. bool dirty = add_limit_exceeded || (have_filter && !have_names); setDirty(dirty); // Refreshed all items. if(!dirty) { // Highlight items matching the filter. std::vector<LLPanel*> items; getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { static_cast<LLAvatarListItem*>(*it)->setHighlight(mNameFilter); } // Send refresh_complete signal. mRefreshCompleteSignal(this, LLSD((S32)size(false))); } // Commit if we've added/removed items. if (modified) onCommit(); }
void LLAvatarList::refresh() { bool have_names = TRUE; bool add_limit_exceeded = false; bool modified = false; bool have_filter = !mNameFilter.empty(); // Save selection. std::vector<LLUUID> selected_ids; getSelectedUUIDs(selected_ids); LLUUID current_id = getSelectedUUID(); // Determine what to add and what to remove. std::vector<LLUUID> added, removed; LLAvatarList::computeDifference(getIDs(), added, removed); // Handle added items. unsigned nadded = 0; for (std::vector<LLUUID>::const_iterator it=added.begin(); it != added.end(); it++) { std::string name; const LLUUID& buddy_id = *it; have_names &= (bool)gCacheName->getFullName(buddy_id, name); if (!have_filter || findInsensitive(name, mNameFilter)) { if (nadded >= ADD_LIMIT) { add_limit_exceeded = true; break; } else { addNewItem(buddy_id, name, LLAvatarTracker::instance().isBuddyOnline(buddy_id)); modified = true; nadded++; } } } // Handle removed items. for (std::vector<LLUUID>::const_iterator it=removed.begin(); it != removed.end(); it++) { removeItemByUUID(*it); modified = true; } // Handle filter. if (have_filter) { std::vector<LLSD> cur_values; getValues(cur_values); for (std::vector<LLSD>::const_iterator it=cur_values.begin(); it != cur_values.end(); it++) { std::string name; const LLUUID& buddy_id = it->asUUID(); have_names &= (bool)gCacheName->getFullName(buddy_id, name); if (!findInsensitive(name, mNameFilter)) { removeItemByUUID(buddy_id); modified = true; } } } // Changed item in place, need to request sort and update columns // because we might have changed data in a column on which the user // has already sorted. JC sort(); // re-select items // selectMultiple(selected_ids); // TODO: implement in LLFlatListView if need selectItemByUUID(current_id); // If the name filter is specified and the names are incomplete, // we need to re-update when the names are complete so that // the filter can be applied correctly. // // Otherwise, if we have no filter then no need to update again // because the items will update their names. bool dirty = add_limit_exceeded || (have_filter && !have_names); setDirty(dirty); // Refreshed all items. if(!dirty) { // Highlight items matching the filter. std::vector<LLPanel*> items; getItems(items); for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) { static_cast<LLAvatarListItem*>(*it)->setHighlight(mNameFilter); } // Send refresh_complete signal. std::vector<LLSD> cur_values; getValues(cur_values); mRefreshCompleteSignal(this, LLSD((S32)cur_values.size())); } // Commit if we've added/removed items. if (modified) onCommit(); }