Exemplo n.º 1
0
// static 
void LLFloaterWorldMap::onAvatarComboPrearrange( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap* self = gFloaterWorldMap;
	if( !self || self->mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = self->childGetListInterface("friend combo");
	if (!list) return;

	LLUUID current_choice;

	if( LLAvatarTracker::instance().haveTrackingInfo() )
	{
		current_choice = LLAvatarTracker::instance().getAvatarID();
	}

	self->buildAvatarIDList();

	if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
	{
		LLTracker::stopTracking(NULL);
	}
}
Exemplo n.º 2
0
// 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();
}
Exemplo n.º 3
0
// 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();
}
Exemplo n.º 4
0
// 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);
	}
}
Exemplo n.º 5
0
void LLPanelDirBrowser::newClassified()
{
	LLCtrlListInterface *list = childGetListInterface("results");
	if (!list) return;

	if (mFloaterDirectory->mPanelClassifiedp)
	{
		// Clear the panel on the right
		mFloaterDirectory->mPanelClassifiedp->reset();

		// Set up the classified with the info we've created
		// and a sane default position.
		mFloaterDirectory->mPanelClassifiedp->initNewClassified();

		// We need the ID to select in the list.
		LLUUID classified_id = mFloaterDirectory->mPanelClassifiedp->getClassifiedID();

		// Put it in the list on the left
		addClassified(list, classified_id, mFloaterDirectory->mPanelClassifiedp->getClassifiedName(),0,0);

		// Select it.
		list->setCurrentByID(classified_id);

		// Make the right panel visible (should already be)
		mFloaterDirectory->mPanelClassifiedp->setVisible(TRUE);
	}
}
Exemplo n.º 6
0
// static 
void LLFloaterWorldMap::onLandmarkComboCommit( LLUICtrl* ctrl, void* userdata )
{
	LLFloaterWorldMap* self = gFloaterWorldMap;

	if( !self || self->mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("landmark combo");
	if (!list) return;

	LLUUID asset_id;
	LLUUID item_id = list->getCurrentID();

	LLTracker::stopTracking(NULL);

	//RN: stopTracking() clears current combobox selection, need to reassert it here
	list->setCurrentByID(item_id);

	if( item_id.isNull() )
	{
	}
	else if( item_id == sHomeID )
	{
		asset_id = sHomeID;
	}
	else
	{
		LLInventoryItem* item = gInventory.getItem( item_id );
		if( item )
		{
			asset_id = item->getAssetUUID();
		}
		else
		{
			// Something went wrong, so revert to a safe value.
			item_id.setNull();
		}
	}
	
	self->trackLandmark( item_id);
	onShowTargetBtn(self);

	// Reset to user postion if nothing is tracked
	self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING );
}
Exemplo n.º 7
0
void LLPanelDirBrowser::selectByUUID(const LLUUID& id)
{
	LLCtrlListInterface *list = childGetListInterface("results");
	if (!list) return;
	BOOL found = list->setCurrentByID(id);
	if (found)
	{
		// we got it, don't wait for network
		// Don't bother looking for this in the draw loop.
		mWantSelectID.setNull();
		// Make sure UI updates.
		onCommitList(NULL, this);
	}
	else
	{
		// waiting for this item from the network
		mWantSelectID = id;
	}
}
Exemplo n.º 8
0
void LLFloaterWorldMap::onLandmarkComboPrearrange( )
{
	if( mIsClosing )
	{
		return;
	}

	LLCtrlListInterface *list = childGetListInterface("landmark combo");
	if (!list) return;

	LLUUID current_choice = list->getCurrentID();

	buildLandmarkIDLists();

	if( current_choice.isNull() || !list->setCurrentByID( current_choice ) )
	{
		LLTracker::stopTracking(NULL);
	}

}
Exemplo n.º 9
0
// static 
void LLFloaterWorldMap::onLandmarkComboPrearrange(LLUICtrl* ctrl, void* userdata)
{
	LLFloaterWorldMap* self = gFloaterWorldMap;
	if (!self || self->mIsClosing)
	{
		return;
	}

	LLCtrlListInterface *list = self->childGetListInterface("landmark combo");
	if (!list) return;

	LLUUID current_choice = list->getCurrentID();

	gFloaterWorldMap->buildLandmarkIDLists();

	if (current_choice.isNull() || !list->setCurrentByID(current_choice))
	{
		LLTracker::stopTracking(NULL);
	}
}
Exemplo n.º 10
0
// 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);
		}
	}
}
Exemplo n.º 11
0
// static 
void LLFloaterWorldMap::onAvatarComboPrearrange( )
{
	if( mIsClosing )
	{
		return;
	}
	
	LLCtrlListInterface *list = mListFriendCombo;
	if (!list) return;
	
	LLUUID current_choice;
	
	if( LLAvatarTracker::instance().haveTrackingInfo() )
	{
		current_choice = LLAvatarTracker::instance().getAvatarID();
	}
	
	buildAvatarIDList();
	
	if( !list->setCurrentByID( current_choice ) || current_choice.isNull() )
	{
		LLTracker::stopTracking(NULL);
	}
}