Exemplo n.º 1
0
// static 
void LLFloaterGroupInfo::showNotice(const std::string& subject,
									const std::string& message,
									const LLUUID& group_id,
									const bool& has_inventory,
									const std::string& inventory_name,
									LLOfferInfo* inventory_offer)
{
	llinfos << "LLFloaterGroupInfo::showNotice : " << subject << llendl;

	if (group_id.isNull())
	{
		// We need to clean up that inventory offer.
		if (inventory_offer)
		{
			inventory_offer_callback( IOR_DECLINE , inventory_offer); 
		}
		return;
	}

	// If we don't have a floater for this group, drop this packet on the floor.
	LLFloaterGroupInfo *fgi = get_if_there(sInstances, group_id, (LLFloaterGroupInfo*)NULL);
	if (!fgi)
	{
		// We need to clean up that inventory offer.
		if (inventory_offer)
		{
			inventory_offer_callback( IOR_DECLINE , inventory_offer); 
		}
		return;
	}
	
	fgi->mPanelGroupp->showNotice(subject,message,has_inventory,inventory_name,inventory_offer);
}
Exemplo n.º 2
0
//static 
void LLPanelGroupNotices::onClickOpenAttachment(void* data)
{
	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;

	inventory_offer_callback( IOR_ACCEPT , self->mInventoryOffer);
	self->mInventoryOffer = NULL;
	self->mBtnOpenAttachment->setEnabled(FALSE);
}
Exemplo n.º 3
0
void LLGroupNotifyBox::onClickSaveInventory(void* data)
{
	LLGroupNotifyBox* self = (LLGroupNotifyBox*)data;

	inventory_offer_callback( IOR_ACCEPT , self->mInventoryOffer); 

	// inventory_offer_callback will delete the offer, so make sure we aren't still pointing to it.
	self->mInventoryOffer = NULL;
	// Each item can only be received once, so disable the button.
	self->mSaveInventoryBtn->setEnabled(FALSE);
}
Exemplo n.º 4
0
LLPanelGroupNotices::~LLPanelGroupNotices()
{
	sInstances.erase(mGroupID);

	if (mInventoryOffer)
	{
		// Cancel the inventory offer.
		inventory_offer_callback( IOR_DECLINE , mInventoryOffer); 
		mInventoryOffer = NULL;
	}
}
Exemplo n.º 5
0
void LLGroupNotifyBox::close()
{
	// The group notice dialog may be an inventory offer.
	// If it has an inventory save button and that button is still enabled
	// Then we need to send the inventory declined message
	if(mHasInventory)
	{
		inventory_offer_callback(IOR_DECLINE , mInventoryOffer); 
	}
	gNotifyBoxView->removeChild(this);

	die();
}
Exemplo n.º 6
0
//static 
void LLPanelGroupNotices::onClickNewMessage(void* data)
{
	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;

	self->arrangeNoticeView(CREATE_NEW_NOTICE);

	if (self->mInventoryOffer)
	{
		inventory_offer_callback( IOR_DECLINE , self->mInventoryOffer);
		self->mInventoryOffer = NULL;
	}

	self->mCreateSubject->clear();
	self->mCreateMessage->clear();
	if (self->mInventoryItem) onClickRemoveAttachment(self);
	self->mNoticesList->deselectAllItems(TRUE); // TRUE == don't commit on chnage
}
Exemplo n.º 7
0
void LLPanelGroupNotices::showNotice(const std::string& subject,
									 const std::string& message,
									 const bool& has_inventory,
									 const std::string& inventory_name,
									 LLOfferInfo* inventory_offer)
{
	arrangeNoticeView(VIEW_PAST_NOTICE);

	if(mViewSubject) mViewSubject->setText(subject);
	if(mViewMessage) mViewMessage->setText(message);
	
	if (mInventoryOffer)
	{
		// Cancel the inventory offer for the previously viewed notice
		inventory_offer_callback( IOR_DECLINE , mInventoryOffer); 
		mInventoryOffer = NULL;
	}

	if (inventory_offer)
	{
		mInventoryOffer = inventory_offer;

		std::string icon_name = get_item_icon_name(mInventoryOffer->mType,
												LLInventoryType::IT_TEXTURE,
												0, FALSE);

		mViewInventoryIcon->setImage(icon_name);
		mViewInventoryIcon->setVisible(TRUE);

		std::stringstream ss;
		ss << "        " << inventory_name;

		mViewInventoryName->setText(ss.str());
		mBtnOpenAttachment->setEnabled(TRUE);
	}
	else
	{
		mViewInventoryName->clear();
		mViewInventoryIcon->setVisible(FALSE);
		mBtnOpenAttachment->setEnabled(FALSE);
	}
}
Exemplo n.º 8
0
void LLPanelGroup::showNotice(const std::string& subject,
							  const std::string& message,
							  const bool& has_inventory,
							  const std::string& inventory_name,
							  LLOfferInfo* inventory_offer)
{
	if (mCurrentTab->getName() != "notices_tab")
	{
		// We need to clean up that inventory offer.
		if (inventory_offer)
		{
			inventory_offer_callback( IOR_DECLINE , inventory_offer); 
		}
		return;
	}

	LLPanelGroupNotices* notices = static_cast<LLPanelGroupNotices*>(mCurrentTab);

	notices->showNotice(subject,message,has_inventory,inventory_name,inventory_offer);
}