Пример #1
0
void LLPanelGroupNotices::onClickSendMessage(void* data)
{
	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
	
	if (self->mCreateSubject->getText().empty())
	{
		// Must supply a subject
		LLNotificationsUtil::add("MustSpecifyGroupNoticeSubject");
		return;
	}
	send_group_notice(
			self->mGroupID,
			self->mCreateSubject->getText(),
			self->mCreateMessage->getText(),
			self->mInventoryItem);


	//instantly add new notice. actual notice will be added after ferreshNotices call
	LLUUID id = LLUUID::generateNewID();
	std::string subj = self->mCreateSubject->getText();
	std::string name ;
	LLAgentUI::buildFullname(name);
	U32 timestamp = 0;

	LLSD row;
	row["id"] = id;
	
	row["columns"][0]["column"] = "icon";

	row["columns"][1]["column"] = "subject";
	row["columns"][1]["value"] = subj;

	row["columns"][2]["column"] = "from";
	row["columns"][2]["value"] = name;

	row["columns"][3]["column"] = "date";
	row["columns"][3]["value"] = build_notice_date(timestamp);

	row["columns"][4]["column"] = "sort";
	row["columns"][4]["value"] = llformat( "%u", timestamp);

	self->mNoticesList->addElement(row, ADD_BOTTOM);

	self->mCreateMessage->clear();
	self->mCreateSubject->clear();
	onClickRemoveAttachment(data);

	self->arrangeNoticeView(VIEW_PAST_NOTICE);
}
//static 
void LLPanelGroupNotices::onClickNewMessage(void* data)
{
	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;

	self->arrangeNoticeView(CREATE_NEW_NOTICE);

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

	self->mCreateSubject->clear();
	self->mCreateMessage->clear();
	if (self->mInventoryItem) onClickRemoveAttachment(self);
	self->mNoticesList->deselectAllItems(TRUE); // TRUE == don't commit on chnage
}
void LLPanelGroupNotices::onClickSendMessage(void* data)
{
	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
	
	if (self->mCreateSubject->getText().empty())
	{
		// Must supply a subject
		LLNotifications::instance().add("MustSpecifyGroupNoticeSubject");
		return;
	}
	send_group_notice(
			self->mGroupID,
			self->mCreateSubject->getText(),
			self->mCreateMessage->getText(),
			self->mInventoryItem);

	self->mCreateMessage->clear();
	self->mCreateSubject->clear();
	onClickRemoveAttachment(data);

	self->arrangeNoticeView(VIEW_PAST_NOTICE);
	onClickRefreshNotices(self);

}