// static void LLFloaterGesture::refreshAll() { if (sInstance) { sInstance->buildGestureList(); LLCtrlListInterface *list = sInstance->childGetListInterface("gesture_list"); if (!list) return; if (sInstance->mSelectedID.isNull()) { list->selectFirstItem(); } else { if (list->setCurrentByID(sInstance->mSelectedID)) { LLCtrlScrollInterface *scroll = sInstance->childGetScrollInterface("gesture_list"); if (scroll) scroll->scrollToShowSelected(); } else { list->selectFirstItem(); } } // Update button labels onCommitList(NULL, sInstance); } }
// No longer really builds a list. Instead, just updates mAvatarCombo. void LLFloaterWorldMap::buildAvatarIDList() { LLCtrlListInterface *list = childGetListInterface("friend combo"); if (!list) return; // Delete all but the "None" entry S32 list_size = list->getItemCount(); while (list_size > 1) { list->selectNthItem(1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); --list_size; } LLSD default_column; default_column["name"] = "friend name"; default_column["label"] = "Friend Name"; default_column["width"] = 500; list->addColumn(default_column); // Get all of the calling cards for avatar that are currently online LLCollectMappableBuddies collector; LLAvatarTracker::instance().applyFunctor(collector); LLCollectMappableBuddies::buddy_map_t::iterator it; LLCollectMappableBuddies::buddy_map_t::iterator end; it = collector.mMappable.begin(); end = collector.mMappable.end(); for( ; it != end; ++it) { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); list->selectFirstItem(); }
// virtual void LLPanelDirBrowser::draw() { // HACK: If the results panel has data, we want to select the first // item. Unfortunately, we don't know when the find is actually done, // so only do this if it's been some time since the last packet of // results was received. if (mLastResultTimer.getElapsedTimeF32() > 0.5) { if (!mDidAutoSelect && hasChild("results") && !childHasFocus("results")) { LLCtrlListInterface *list = childGetListInterface("results"); if (list) { if (list->getCanSelect()) { list->selectFirstItem(); // select first item by default childSetFocus("results", TRUE); } // Request specific data from the server onCommitList(); } } mDidAutoSelect = TRUE; } LLPanel::draw(); }
// No longer really builds a list. Instead, just updates mAvatarCombo. void LLFloaterWorldMap::buildAvatarIDList() { LLCtrlListInterface *list = mListFriendCombo; if (!list) return; // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } // Get all of the calling cards for avatar that are currently online LLCollectMappableBuddies collector; LLAvatarTracker::instance().applyFunctor(collector); LLCollectMappableBuddies::buddy_map_t::iterator it; LLCollectMappableBuddies::buddy_map_t::iterator end; it = collector.mMappable.begin(); end = collector.mMappable.end(); for( ; it != end; ++it) { list->addSimpleElement((*it).first, ADD_BOTTOM, (*it).second); } list->setCurrentByID( LLAvatarTracker::instance().getAvatarID() ); list->selectFirstItem(); }
// static void LLFloaterClothing::refreshAll() { if (sInstance) { sInstance->buildClothingList(); LLCtrlListInterface* list = sInstance->childGetListInterface("clothing_list"); if (list) { if (!sInstance->mAllowSelection) { // no selection, no commit on change list->operateOnSelection(LLCtrlListInterface::OP_DESELECT); } else if (sInstance->mSelectedID.isNull()) { list->selectFirstItem(); } else { if (list->setCurrentByID(sInstance->mSelectedID)) { LLCtrlScrollInterface *scroll = sInstance->childGetScrollInterface("clothing_list"); if (scroll) { scroll->scrollToShowSelected(); } } else { list->selectFirstItem(); } } // Update button labels onCommitList(NULL, sInstance); } } }
void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = childGetListInterface("landmark combo"); if (!list) { return; } // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(gAgent.getInventoryRootID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } list->sortByColumn(std::string("landmark name"), TRUE); list->selectFirstItem(); }
void LLGestureComboList::onCommitGesture() { LLCtrlListInterface* gestures = getListInterface(); if (gestures) { S32 sel_index = gestures->getFirstSelectedIndex(); if (sel_index == 0) { return; } S32 index = gestures->getSelectedValue().asInteger(); if (mViewAllItemIndex == index) { // The same behavior as Ctrl+G. EXT-823 LLFloaterReg::toggleInstance("gestures"); gestures->selectFirstItem(); return; } if (mGetMoreItemIndex == index) { LLWeb::loadURLExternal(gSavedSettings.getString("GesturesMarketplaceURL")); return; } if (index<0 || index >= (S32)mGestures.size()) { llwarns << "out of range gesture index" << llendl; } else { LLMultiGesture* gesture = mGestures.at(index); if(gesture) { LLGestureMgr::instance().playGesture(gesture); if(!gesture->mReplaceText.empty()) { LLNearbyChatBar::sendChatFromViewer(gesture->mReplaceText, CHAT_TYPE_NORMAL, FALSE); } } } } }
void LLChatBar::refresh() { // HACK: Leave the name of the gesture in place for a few seconds. const F32 SHOW_GESTURE_NAME_TIME = 2.f; if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) { LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; if (gestures) gestures->selectFirstItem(); mGestureLabelTimer.stop(); } if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) { gAgent.stopTyping(); } childSetEnabled("Say", mInputEditor->getText().size() > 0); }
void LLChatBar::refresh() { // HACK: Leave the name of the gesture in place for a few seconds. const F32 SHOW_GESTURE_NAME_TIME = 2.f; if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) { LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; if (gestures) gestures->selectFirstItem(); mGestureLabelTimer.stop(); } if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) { gAgent.stopTyping(); } childSetValue("History", LLFloaterChat::instanceVisible(LLSD())); //childSetValue("channel_control",( 1.f * ((S32)(mChannelControl->get()))) ); childSetEnabled("Say", mInputEditor->getText().size() > 0); childSetEnabled("Shout", mInputEditor->getText().size() > 0); }
void LLChatBar::refresh() { // HACK: Leave the name of the gesture in place for a few seconds. const F32 SHOW_GESTURE_NAME_TIME = 2.f; if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) { LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; if (gestures) gestures->selectFirstItem(); mGestureLabelTimer.stop(); } if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) { gAgent.stopTyping(); } if (LLUICtrl* history_ctrl = findChild<LLUICtrl>("History")) history_ctrl->setValue(LLFloaterChat::instanceVisible()); if (LLUICtrl* say_ctrl = getChild<LLUICtrl>("Say")) say_ctrl->setEnabled(mInputEditor->getText().size() > 0); //childSetEnabled("Shout", mInputEditor->getText().size() > 0); createDummyWidget Making Dummy -HgB }
// static void LLFloaterGesture::show() { if (sInstance) { sInstance->open(); /*Flawfinder: ignore*/ return; } LLFloaterGesture *self = new LLFloaterGesture(); // Builds and adds to gFloaterView LLUICtrlFactory::getInstance()->buildFloater(self, "floater_gesture.xml"); // Fix up rectangle LLRect rect = gSavedSettings.getRect("FloaterGestureRect2"); self->reshape(rect.getWidth(), rect.getHeight()); self->setRect(rect); self->buildGestureList(); self->childSetFocus("gesture_list"); LLCtrlListInterface *list = self->childGetListInterface("gesture_list"); if (list) { const BOOL ascending = TRUE; list->sortByColumn(std::string("name"), ascending); list->selectFirstItem(); } self->mSelectedID = LLUUID::null; // Update button labels onCommitList(NULL, self); self->open(); /*Flawfinder: ignore*/ }
void LLFloaterWorldMap::buildLandmarkIDLists() { LLCtrlListInterface *list = mListLandmarkCombo; if (!list) return; // Delete all but the "None" entry S32 list_size = list->getItemCount(); if (list_size > 1) { list->selectItemRange(1, -1); list->operateOnSelection(LLCtrlListInterface::OP_DELETE); } mLandmarkItemIDList.reset(); mLandmarkAssetIDList.reset(); // Get all of the current landmarks mLandmarkAssetIDList.put( LLUUID::null ); mLandmarkItemIDList.put( LLUUID::null ); mLandmarkAssetIDList.put( sHomeID ); mLandmarkItemIDList.put( sHomeID ); LLInventoryModel::cat_array_t cats; LLInventoryModel::item_array_t items; LLIsType is_landmark(LLAssetType::AT_LANDMARK); gInventory.collectDescendentsIf(gInventory.getRootFolderID(), cats, items, LLInventoryModel::EXCLUDE_TRASH, is_landmark); std::sort(items.begin(), items.end(), LLViewerInventoryItem::comparePointers()); std::list<LLInventoryItem*> usedLMs; BOOL filterLandmarks = gSavedSettings.getBOOL("WorldmapFilterDuplicateLandmarks"); S32 count = items.count(); for(S32 i = 0; i < count; ++i) { LLInventoryItem* item = items.get(i); if (filterLandmarks) { bool skip = false; for (std::list<LLInventoryItem*>::iterator it = usedLMs.begin(); it != usedLMs.end(); ++it) { if ((*it)->getAssetUUID() == item->getAssetUUID()) { skip = true; break; } } if (skip) continue; usedLMs.push_front(item); } list->addSimpleElement(item->getName(), ADD_BOTTOM, item->getUUID()); mLandmarkAssetIDList.put( item->getAssetUUID() ); mLandmarkItemIDList.put( item->getUUID() ); } list->selectFirstItem(); }
void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) { U32 request_flags; U32 total_count; msg->getU32Fast(_PREHASH_RequestData, _PREHASH_RequestFlags, request_flags); msg->getU32Fast(_PREHASH_RequestData, _PREHASH_TotalObjectCount, total_count); msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ReportType, mCurrentMode); LLCtrlListInterface *list = childGetListInterface("objects_list"); if (!list) return; S32 block_count = msg->getNumberOfBlocks("ReportData"); for (S32 block = 0; block < block_count; ++block) { U32 task_local_id; U32 time_stamp = 0; LLUUID task_id; F32 location_x, location_y, location_z; F32 score; std::string name_buf; std::string owner_buf; F32 mono_score = 0.f; bool have_extended_data = false; msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block); msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block); msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationX, location_x, block); msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block); msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block); msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block); msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, name_buf, block); msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, owner_buf, block); if(msg->getNumberOfBlocks("DataExtended")) { have_extended_data = true; msg->getU32("DataExtended", "TimeStamp", time_stamp, block); msg->getF32(_PREHASH_ReportData, "MonoScore", mono_score, block); } LLSD element; element["id"] = task_id; element["object_name"] = name_buf; element["owner_name"] = owner_buf; element["columns"][0]["column"] = "score"; element["columns"][0]["value"] = llformat("%0.3f", score); element["columns"][0]["font"] = "SANSSERIF"; element["columns"][1]["column"] = "name"; element["columns"][1]["value"] = name_buf; element["columns"][1]["font"] = "SANSSERIF"; element["columns"][2]["column"] = "owner"; element["columns"][2]["value"] = owner_buf; element["columns"][2]["font"] = "SANSSERIF"; element["columns"][3]["column"] = "location"; element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); element["columns"][3]["font"] = "SANSSERIF"; element["columns"][3]["column"] = "time"; element["columns"][3]["value"] = formatted_time((time_t)time_stamp); element["columns"][3]["font"] = "SANSSERIF"; if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS && have_extended_data) { element["columns"][4]["column"] = "Mono Time"; element["columns"][4]["value"] = llformat("%0.3f", mono_score); element["columns"][4]["font"] = "SANSSERIF"; } list->addElement(element); mObjectListData.append(element); mObjectListIDs.push_back(task_id); mtotalScore += score; } if (total_count == 0 && list->getItemCount() == 0) { LLSD element; element["id"] = LLUUID::null; element["columns"][0]["column"] = "name"; element["columns"][0]["value"] = getString("none_descriptor"); element["columns"][0]["font"] = "SANSSERIF"; list->addElement(element); } else { list->selectFirstItem(); } if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS) { setTitle(getString("top_scripts_title")); list->setColumnLabel("score", getString("scripts_score_label")); LLUIString format = getString("top_scripts_text"); format.setArg("[COUNT]", llformat("%d", total_count)); format.setArg("[TIME]", llformat("%0.1f", mtotalScore)); childSetValue("title_text", LLSD(format)); } else { setTitle(getString("top_colliders_title")); list->setColumnLabel("score", getString("colliders_score_label")); LLUIString format = getString("top_colliders_text"); format.setArg("[COUNT]", llformat("%d", total_count)); childSetValue("title_text", LLSD(format)); } }