Example #1
0
//static
void LLFloaterAO::onClickAnimRemove(void* user_data)
{
	LLFloaterAO* floater = (LLFloaterAO*)user_data;
	std::vector<LLScrollListItem*> items = floater->mAnimationList->getAllSelected();
	for (std::vector<LLScrollListItem*>::iterator iter = items.begin(); iter != items.end(); ++iter)
	{
		LLScrollListItem* item = *iter;
		if (item->getValue().asString() != "")
		{
			std::string anim_name = item->getValue().asString();
			FLLua::callCommand(llformat("AO:RemoveOverride(\"%s\",\"%s\")",floater->mCurrentAnimType,anim_name));
		}
	}
	onCommitAnim(NULL,user_data);
}
Example #2
0
// virtual
LLXMLNodePtr LLComboBox::getXML(bool save_children) const
{
	LLXMLNodePtr node = LLUICtrl::getXML();

	node->setName(LL_COMBO_BOX_TAG);

	// Attributes

	node->createChild("allow_text_entry", TRUE)->setBoolValue(mAllowTextEntry);

	node->createChild("max_chars", TRUE)->setIntValue(mMaxChars);

	// Contents

	std::vector<LLScrollListItem*> data_list = mList->getAllData();
	std::vector<LLScrollListItem*>::iterator data_itor;
	for (data_itor = data_list.begin(); data_itor != data_list.end(); ++data_itor)
	{
		LLScrollListItem* item = *data_itor;
		LLScrollListCell* cell = item->getColumn(0);
		if (cell)
		{
			LLXMLNodePtr item_node = node->createChild("combo_item", FALSE);
			LLSD value = item->getValue();
			item_node->createChild("value", TRUE)->setStringValue(value.asString());
			item_node->createChild("enabled", TRUE)->setBoolValue(item->getEnabled());
			item_node->setStringValue(cell->getValue().asString());
		}
	}

	return node;
}
BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, MASK mask)
{

	if(mAddLandmarkBtn->parentPointInView(x,y))
	{
		updateAddLandmarkTooltip();
	}
	// Let the buttons show their tooltips.
	if (LLUICtrl::handleToolTip(x, y, mask))
	{
		if (mList->getRect().pointInRect(x, y)) 
		{
			S32 loc_x, loc_y;
			//x,y - contain coordinates related to the location input control, but without taking the expanded list into account
			//So we have to convert it again into local coordinates of mList
			localPointToOtherView(x,y,&loc_x,&loc_y,mList);
			
			LLScrollListItem* item =  mList->hitItem(loc_x,loc_y);
			if (item)
			{
				LLSD value = item->getValue();
				if (value.has("tooltip"))
				{
					LLToolTipMgr::instance().show(value["tooltip"]);
				}
			}
		}

		return TRUE;
	}

	return FALSE;
}
// static
void LLPanelLandMedia::onClickRemoveURLFilter(void *data)
{
	LLPanelLandMedia* panelp = (LLPanelLandMedia*)data;
	if (panelp && panelp->mURLFilterList)
	{
		LLParcel* parcel = panelp->mParcel->getParcel();
		if (parcel)
		{
			LLSD list = parcel->getMediaURLFilterList();
			
			std::vector<LLScrollListItem*> domains = panelp->mURLFilterList->getAllSelected();
			for (std::vector<LLScrollListItem*>::iterator iter = domains.begin(); iter != domains.end(); iter++)
			{
				LLScrollListItem* item = *iter;
				const std::string domain = item->getValue().asString();

				for(S32 i = 0; i < list.size(); i++)
				{
					if (list[i].asString() == domain)
					{
						list.erase(i);
						break;
					}
				}
			}
			
			parcel->setMediaURLFilterList(list);
			LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel );

			panelp->refresh();
		}
	}
	
}
void LLFloaterExploreAnimations::RevokeSelected(void *userdata )
{
	LLFloaterExploreAnimations *self = (LLFloaterExploreAnimations*)userdata;
	LLDynamicArray<LLUUID> ids;
	std::vector< LLScrollListItem * > items = self->getChild<LLScrollListCtrl>("anim_list")->getAllSelected();

	for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
	{
		LLScrollListItem *item = *itr;
		const LLUUID &id = item->getValue().asUUID();
		if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
		{
			ids.put(id);
		}
	}
	if( !ids.empty() )
	{
		for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
		{
			LLUUID id = *itr;
			LLMessageSystem* msg = gMessageSystem;
			msg->newMessageFast(_PREHASH_RevokePermissions);
			msg->nextBlockFast(_PREHASH_AgentData);
			msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
			msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
			msg->nextBlockFast(_PREHASH_Data);
			msg->addUUIDFast(_PREHASH_ObjectID, id);
			msg->addU32Fast(_PREHASH_ObjectPermissions, U32_MAX);
			gAgent.sendReliableMessage();
		}
	}
}
LLSD LLGestureComboList::getValue() const
{
	LLScrollListItem* item = mList->getFirstSelected();
	if( item )
	{
		return item->getValue();
	}
	else
	{
		return LLSD();
	}
}
Example #7
0
// virtual
LLSD LLComboBox::getValue() const
{
	LLScrollListItem* item = mList->getFirstSelected();
	if( item )
	{
		return item->getValue();
	}
	else if (mAllowTextEntry)
	{
		return mTextEntry->getValue();
	}
	else
	{
		return LLSD();
	}
}
void LLFloaterExploreAnimations::StopSelected(void *userdata )
{
	LLFloaterExploreAnimations *self = (LLFloaterExploreAnimations*)userdata;
	LLDynamicArray<LLUUID> ids;
	std::vector< LLScrollListItem * > items = self->getChild<LLScrollListCtrl>("anim_list")->getAllSelected();

	for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
	{
		LLScrollListItem *item = *itr;
		const LLUUID &id = item->getValue().asUUID();
		if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
		{
			ids.put(id);
		}
	}
	gAgent.sendAnimationRequests(ids,ANIM_REQUEST_STOP);
}
void LLPanelGroups::onGroupList()
{
	enableButtons();

	LLScrollListCtrl *group_list = getChild<LLScrollListCtrl>("group list");
	if(!group_list)
		return;

	LLScrollListItem *item = group_list->getFirstSelected();
	if(!item)
		return;

	const LLUUID group_id = item->getValue().asUUID();
	if(group_id.isNull())
		return;

	LLGroupData group_data;
	if(!gAgent.getGroupData(group_id,group_data))
		return;

	bool list_in_profile = item->getColumn(1)->getValue().asBoolean();
	bool receive_chat = item->getColumn(2)->getValue().asBoolean();
	bool recieve_notify = item->getColumn(3)->getValue().asBoolean();
	bool update_floaters = false;
	if(gIMMgr->getIgnoreGroup(group_id) == receive_chat)
	{
		gIMMgr->updateIgnoreGroup(group_id, !receive_chat);
		update_floaters = true;
	}
	if(	(bool)group_data.mListInProfile != list_in_profile ||
		(bool)group_data.mAcceptNotices != recieve_notify )
	{
		gAgent.setUserGroupFlags(group_id, recieve_notify, list_in_profile);
	}
	else if(update_floaters) //gAgent.setUserGroupFlags already calls update_group_floaters
		update_group_floaters(group_id);
}
Example #10
0
void LLToolBar::updateCommunicateList()
{
    LLFlyoutButton* communicate_button = getChild<LLFlyoutButton>("communicate_btn");
    LLSD selected = communicate_button->getValue();

    communicate_button->removeall();

    LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater();
    LLScrollListItem* itemp = NULL;

    itemp = communicate_button->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP);
    if (LLFloaterMyFriends::getInstance() == frontmost_floater)
    {
        ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
        // make sure current tab is selected in list
        if (selected.isUndefined())
        {
            selected = itemp->getValue();
        }
    }
    itemp = communicate_button->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP);
    if (LLFloaterChat::getInstance() == frontmost_floater)
    {
        ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
        if (selected.isUndefined())
        {
            selected = itemp->getValue();
        }
    }
    communicate_button->addSeparator(ADD_TOP);
    communicate_button->add(getString("Redock Windows"), LLSD("redock"), ADD_TOP);
    communicate_button->addSeparator(ADD_TOP);
    communicate_button->add(LLFloaterMute::getInstance()->getShortTitle(), LLSD("mute list"), ADD_TOP);

    std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it;

    if (gIMMgr->getIMFloaterHandles().size() > 0)
    {
        communicate_button->addSeparator(ADD_TOP);
    }

    for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it)
    {
        LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get();
        if (im_floaterp)
        {
            std::string floater_title = im_floaterp->getNumUnreadMessages() > 0 ? "*" : "";
            floater_title.append(im_floaterp->getShortTitle());
            itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP);
            if (im_floaterp  == frontmost_floater)
            {
                ((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
                if (selected.isUndefined())
                {
                    selected = itemp->getValue();
                }
            }
        }
    }

    communicate_button->setToggleState(gSavedSettings.getBOOL("ShowCommunicate"));
    communicate_button->setValue(selected);
}
void LLToolBar::updateCommunicateList()
{
	LLFlyoutButton* communicate_button = mCommunicateBtn;
	LLSD selected = communicate_button->getValue();

	communicate_button->removeall();

	LLFloater* frontmost_floater = LLFloaterChatterBox::getInstance()->getActiveFloater();
	LLScrollListItem* itemp = NULL;

	itemp = communicate_button->add(LLFloaterMyFriends::getInstance()->getShortTitle(), LLSD("contacts"), ADD_TOP);
	if (LLFloaterMyFriends::getInstance() == frontmost_floater)
	{
		((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
		// make sure current tab is selected in list
		if (selected.isUndefined())
		{
			selected = itemp->getValue();
		}
	}
	itemp = communicate_button->add(LLFloaterChat::getInstance()->getShortTitle(), LLSD("local chat"), ADD_TOP);
	if (LLFloaterChat::getInstance() == frontmost_floater)
	{
		((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
		if (selected.isUndefined())
		{
			selected = itemp->getValue();
		}
	}
	communicate_button->addSeparator(ADD_TOP);
	communicate_button->add(getString("Redock Windows"), LLSD("redock"), ADD_TOP);
	communicate_button->addSeparator(ADD_TOP);
	communicate_button->add(LLFloaterMute::getInstance()->getShortTitle(), LLSD("mute list"), ADD_TOP);
	
	std::set<LLHandle<LLFloater> >::const_iterator floater_handle_it;

	if (gIMMgr->getIMFloaterHandles().size() > 0)
	{
		communicate_button->addSeparator(ADD_TOP);
	}

	for(floater_handle_it = gIMMgr->getIMFloaterHandles().begin(); floater_handle_it != gIMMgr->getIMFloaterHandles().end(); ++floater_handle_it)
	{
		LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)floater_handle_it->get();
		if (im_floaterp)
		{
			static LLCachedControl<bool> show_counts("ShowUnreadIMsCounts", true);
			S32 count = im_floaterp->getNumUnreadMessages();
			std::string floater_title;
			if (count > 0) floater_title = "*";
			floater_title.append(im_floaterp->getShortTitle());
			if (show_counts && count > 0)
			{
				floater_title += " - ";
				if (count > 1)
				{
					LLStringUtil::format_map_t args;
					args["COUNT"] = llformat("%d", count);
					floater_title += getString("IMs", args);
				}
				else
				{
					floater_title += getString("IM");
				}
			}

			itemp = communicate_button->add(floater_title, im_floaterp->getSessionID(), ADD_TOP);
			if (im_floaterp  == frontmost_floater)
			{
				((LLScrollListText*)itemp->getColumn(0))->setFontStyle(LLFontGL::BOLD);
				if (selected.isUndefined())
				{
					selected = itemp->getValue();
				}
			}
		}
	}

	communicate_button->setToggleState(gSavedSettings.getBOOL("ShowCommunicate"));
	communicate_button->setValue(selected);
}