PageRenderTime 72ms CodeModel.GetById 2ms app.highlight 63ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/newview/llpanelgroupnotices.cpp

https://bitbucket.org/lindenlab/viewer-beta/
C++ | 678 lines | 469 code | 125 blank | 84 comment | 33 complexity | 6daa9ee7567ccb6d4f2da3121329eb5a MD5 | raw file
  1/** 
  2 * @file llpanelgroupnotices.cpp
  3 * @brief A panel to display group notices.
  4 *
  5 * $LicenseInfo:firstyear=2006&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#include "llviewerprecompiledheaders.h"
 28
 29#include "llpanelgroupnotices.h"
 30
 31#include "llview.h"
 32
 33#include "llavatarnamecache.h"
 34#include "llinventory.h"
 35#include "llviewerinventory.h"
 36#include "llinventorydefines.h"
 37#include "llinventoryfunctions.h"
 38#include "llinventorymodel.h"
 39#include "llfloaterinventory.h"
 40#include "llagent.h"
 41#include "llagentui.h"
 42
 43#include "lllineeditor.h"
 44#include "lltexteditor.h"
 45#include "llbutton.h"
 46#include "lliconctrl.h"
 47#include "llcheckboxctrl.h"
 48#include "llscrolllistctrl.h"
 49#include "llscrolllistitem.h"
 50#include "lltextbox.h"
 51#include "lltrans.h"
 52
 53#include "roles_constants.h"
 54#include "llviewerwindow.h"
 55#include "llviewermessage.h"
 56#include "llnotificationsutil.h"
 57#include "llgiveinventory.h"
 58
 59static LLRegisterPanelClassWrapper<LLPanelGroupNotices> t_panel_group_notices("panel_group_notices");
 60
 61
 62/////////////////////////
 63// LLPanelGroupNotices //
 64/////////////////////////
 65//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 66// Class LLDropTarget
 67//
 68// This handy class is a simple way to drop something on another
 69// view. It handles drop events, always setting itself to the size of
 70// its parent.
 71//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 72class LLGroupDropTarget : public LLView
 73{
 74public:
 75	struct Params : public LLInitParam::Block<Params, LLView::Params>
 76	{
 77		// *NOTE: These parameters logically Mandatory, but are not
 78		// specified in XML files, hence Optional
 79		Optional<LLPanelGroupNotices*> panel;
 80		Optional<LLUUID>	group_id;
 81		Params()
 82		:	panel("panel"),
 83			group_id("group_id")
 84		{
 85			changeDefault(mouse_opaque, false);
 86			changeDefault(follows.flags, FOLLOWS_ALL);
 87		}
 88	};
 89	LLGroupDropTarget(const Params&);
 90	~LLGroupDropTarget() {};
 91
 92	void doDrop(EDragAndDropType cargo_type, void* cargo_data);
 93
 94	//
 95	// LLView functionality
 96	virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
 97								   EDragAndDropType cargo_type,
 98								   void* cargo_data,
 99								   EAcceptance* accept,
100								   std::string& tooltip_msg);
101	void setPanel (LLPanelGroupNotices* panel) {mGroupNoticesPanel = panel;};
102	void setGroup (LLUUID group) {mGroupID = group;};
103
104protected:
105	LLPanelGroupNotices* mGroupNoticesPanel;
106	LLUUID	mGroupID;
107};
108
109static LLDefaultChildRegistry::Register<LLGroupDropTarget> r("group_drop_target");
110
111LLGroupDropTarget::LLGroupDropTarget(const LLGroupDropTarget::Params& p) 
112:	LLView(p),
113	mGroupNoticesPanel(p.panel),
114	mGroupID(p.group_id)
115{}
116
117void LLGroupDropTarget::doDrop(EDragAndDropType cargo_type, void* cargo_data)
118{
119	llinfos << "LLGroupDropTarget::doDrop()" << llendl;
120}
121
122BOOL LLGroupDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
123									 EDragAndDropType cargo_type,
124									 void* cargo_data,
125									 EAcceptance* accept,
126									 std::string& tooltip_msg)
127{
128	BOOL handled = FALSE;
129
130	if (!gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND))
131	{
132		*accept = ACCEPT_NO;
133		return TRUE;
134	}
135
136	if(getParent())
137	{
138		// check if inside
139		//LLRect parent_rect = mParentView->getRect();
140		//getRect().set(0, parent_rect.getHeight(), parent_rect.getWidth(), 0);
141		handled = TRUE;
142
143		// check the type
144		switch(cargo_type)
145		{
146		case DAD_TEXTURE:
147		case DAD_SOUND:
148		case DAD_LANDMARK:
149		case DAD_SCRIPT:
150		case DAD_OBJECT:
151		case DAD_NOTECARD:
152		case DAD_CLOTHING:
153		case DAD_BODYPART:
154		case DAD_ANIMATION:
155		case DAD_GESTURE:
156		case DAD_CALLINGCARD:
157		case DAD_MESH:
158		{
159			LLViewerInventoryItem* inv_item = (LLViewerInventoryItem*)cargo_data;
160			if(gInventory.getItem(inv_item->getUUID())
161				&& LLGiveInventory::isInventoryGroupGiveAcceptable(inv_item))
162			{
163				// *TODO: get multiple object transfers working
164				*accept = ACCEPT_YES_COPY_SINGLE;
165				if(drop)
166				{
167					mGroupNoticesPanel->setItem(inv_item);
168				}
169			}
170			else
171			{
172				// It's not in the user's inventory (it's probably
173				// in an object's contents), so disallow dragging
174				// it here.  You can't give something you don't
175				// yet have.
176				*accept = ACCEPT_NO;
177			}
178			break;
179		}
180		case DAD_CATEGORY:
181		default:
182			*accept = ACCEPT_NO;
183			break;
184		}
185	}
186	return handled;
187}
188
189//-----------------------------------------------------------------------------
190// LLPanelGroupNotices
191//-----------------------------------------------------------------------------
192std::string build_notice_date(const U32& the_time)
193{
194	// ISO 8601 date format
195
196	time_t t = (time_t)the_time;
197	
198	if (!t)
199	{
200		time(&t);
201	}
202	
203	std::string dateStr = "["+LLTrans::getString("LTimeMthNum")+"]/["
204								+LLTrans::getString("LTimeDay")+"]/["
205								+LLTrans::getString("LTimeYear")+"]";
206	LLSD substitution;
207	substitution["datetime"] = (S32) t;
208	LLStringUtil::format (dateStr, substitution);
209	return dateStr;
210}
211
212LLPanelGroupNotices::LLPanelGroupNotices() :
213	LLPanelGroupTab(),
214	mInventoryItem(NULL),
215	mInventoryOffer(NULL)
216{
217	
218	
219}
220
221LLPanelGroupNotices::~LLPanelGroupNotices()
222{
223	sInstances.erase(mGroupID);
224
225	if (mInventoryOffer)
226	{
227		// Cancel the inventory offer.
228		mInventoryOffer->forceResponse(IOR_DECLINE);
229
230		mInventoryOffer = NULL;
231	}
232}
233
234
235BOOL LLPanelGroupNotices::isVisibleByAgent(LLAgent* agentp)
236{
237	return mAllowEdit &&
238		agentp->hasPowerInGroup(mGroupID, GP_NOTICES_SEND | GP_NOTICES_RECEIVE);
239}
240
241BOOL LLPanelGroupNotices::postBuild()
242{
243	bool recurse = true;
244
245	mNoticesList = getChild<LLScrollListCtrl>("notice_list",recurse);
246	mNoticesList->setCommitOnSelectionChange(TRUE);
247	mNoticesList->setCommitCallback(onSelectNotice, this);
248
249	mBtnNewMessage = getChild<LLButton>("create_new_notice",recurse);
250	mBtnNewMessage->setClickedCallback(onClickNewMessage, this);
251	mBtnNewMessage->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_NOTICES_SEND));
252
253	mBtnGetPastNotices = getChild<LLButton>("refresh_notices",recurse);
254	mBtnGetPastNotices->setClickedCallback(onClickRefreshNotices, this);
255
256	// Create
257	mCreateSubject = getChild<LLLineEditor>("create_subject",recurse);
258	mCreateMessage = getChild<LLTextEditor>("create_message",recurse);
259
260	mCreateInventoryName =  getChild<LLLineEditor>("create_inventory_name",recurse);
261	mCreateInventoryName->setTabStop(FALSE);
262	mCreateInventoryName->setEnabled(FALSE);
263
264	mCreateInventoryIcon = getChild<LLIconCtrl>("create_inv_icon",recurse);
265	mCreateInventoryIcon->setVisible(FALSE);
266
267	mBtnSendMessage = getChild<LLButton>("send_notice",recurse);
268	mBtnSendMessage->setClickedCallback(onClickSendMessage, this);
269
270	mBtnRemoveAttachment = getChild<LLButton>("remove_attachment",recurse);
271	mBtnRemoveAttachment->setClickedCallback(onClickRemoveAttachment, this);
272	mBtnRemoveAttachment->setEnabled(FALSE);
273
274	// View
275	mViewSubject = getChild<LLLineEditor>("view_subject",recurse);
276	mViewMessage = getChild<LLTextEditor>("view_message",recurse);
277
278	mViewInventoryName =  getChild<LLLineEditor>("view_inventory_name",recurse);
279	mViewInventoryName->setTabStop(FALSE);
280	mViewInventoryName->setEnabled(FALSE);
281
282	mViewInventoryIcon = getChild<LLIconCtrl>("view_inv_icon",recurse);
283	mViewInventoryIcon->setVisible(FALSE);
284
285	mBtnOpenAttachment = getChild<LLButton>("open_attachment",recurse);
286	mBtnOpenAttachment->setClickedCallback(onClickOpenAttachment, this);
287
288	mNoNoticesStr = getString("no_notices_text");
289
290	mPanelCreateNotice = getChild<LLPanel>("panel_create_new_notice",recurse);
291	mPanelViewNotice = getChild<LLPanel>("panel_view_past_notice",recurse);
292
293	LLGroupDropTarget* target = getChild<LLGroupDropTarget> ("drop_target");
294	target->setPanel (this);
295	target->setGroup (mGroupID);
296
297	arrangeNoticeView(VIEW_PAST_NOTICE);
298
299	return LLPanelGroupTab::postBuild();
300}
301
302void LLPanelGroupNotices::activate()
303{
304	if(mNoticesList)
305		mNoticesList->deleteAllItems();
306	
307	BOOL can_send = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_SEND);
308	BOOL can_receive = gAgent.hasPowerInGroup(mGroupID,GP_NOTICES_RECEIVE);
309
310	mPanelViewNotice->setEnabled(can_receive);
311	mPanelCreateNotice->setEnabled(can_send);
312
313	// Always disabled to stop direct editing of attachment names
314	mCreateInventoryName->setEnabled(FALSE);
315	mViewInventoryName->setEnabled(FALSE);
316
317	// If we can receive notices, grab them right away.
318	if (can_receive)
319	{
320		onClickRefreshNotices(this);
321	}
322}
323
324void LLPanelGroupNotices::setItem(LLPointer<LLInventoryItem> inv_item)
325{
326	mInventoryItem = inv_item;
327
328	BOOL item_is_multi = FALSE;
329	if ( inv_item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS )
330	{
331		item_is_multi = TRUE;
332	};
333
334	std::string icon_name = LLInventoryIcon::getIconName(inv_item->getType(),
335										inv_item->getInventoryType(),
336										inv_item->getFlags(),
337										item_is_multi );
338
339	mCreateInventoryIcon->setValue(icon_name);
340	mCreateInventoryIcon->setVisible(TRUE);
341
342	std::stringstream ss;
343	ss << "        " << mInventoryItem->getName();
344
345	mCreateInventoryName->setText(ss.str());
346	mBtnRemoveAttachment->setEnabled(TRUE);
347}
348
349void LLPanelGroupNotices::onClickRemoveAttachment(void* data)
350{
351	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
352	self->mInventoryItem = NULL;
353	self->mCreateInventoryName->clear();
354	self->mCreateInventoryIcon->setVisible(FALSE);
355	self->mBtnRemoveAttachment->setEnabled(FALSE);
356}
357
358//static 
359void LLPanelGroupNotices::onClickOpenAttachment(void* data)
360{
361	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
362
363	self->mInventoryOffer->forceResponse(IOR_ACCEPT);
364	self->mInventoryOffer = NULL;
365	self->mBtnOpenAttachment->setEnabled(FALSE);
366}
367
368void LLPanelGroupNotices::onClickSendMessage(void* data)
369{
370	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
371	
372	if (self->mCreateSubject->getText().empty())
373	{
374		// Must supply a subject
375		LLNotificationsUtil::add("MustSpecifyGroupNoticeSubject");
376		return;
377	}
378	send_group_notice(
379			self->mGroupID,
380			self->mCreateSubject->getText(),
381			self->mCreateMessage->getText(),
382			self->mInventoryItem);
383
384
385	//instantly add new notice. actual notice will be added after ferreshNotices call
386	LLUUID id = LLUUID::generateNewID();
387	std::string subj = self->mCreateSubject->getText();
388	std::string name ;
389	LLAgentUI::buildFullname(name);
390	U32 timestamp = 0;
391
392	LLSD row;
393	row["id"] = id;
394	
395	row["columns"][0]["column"] = "icon";
396
397	row["columns"][1]["column"] = "subject";
398	row["columns"][1]["value"] = subj;
399
400	row["columns"][2]["column"] = "from";
401	row["columns"][2]["value"] = name;
402
403	row["columns"][3]["column"] = "date";
404	row["columns"][3]["value"] = build_notice_date(timestamp);
405
406	row["columns"][4]["column"] = "sort";
407	row["columns"][4]["value"] = llformat( "%u", timestamp);
408
409	self->mNoticesList->addElement(row, ADD_BOTTOM);
410
411	self->mCreateMessage->clear();
412	self->mCreateSubject->clear();
413	onClickRemoveAttachment(data);
414
415	self->arrangeNoticeView(VIEW_PAST_NOTICE);
416}
417
418//static 
419void LLPanelGroupNotices::onClickNewMessage(void* data)
420{
421	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
422
423	self->arrangeNoticeView(CREATE_NEW_NOTICE);
424
425	if (self->mInventoryOffer)
426	{
427		self->mInventoryOffer->forceResponse(IOR_DECLINE);
428		self->mInventoryOffer = NULL;
429	}
430
431	self->mCreateSubject->clear();
432	self->mCreateMessage->clear();
433	if (self->mInventoryItem) onClickRemoveAttachment(self);
434	self->mNoticesList->deselectAllItems(TRUE); // TRUE == don't commit on chnage
435}
436
437void LLPanelGroupNotices::refreshNotices()
438{
439	onClickRefreshNotices(this);
440	/*
441	lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl;
442	
443	mNoticesList->deleteAllItems();
444
445	LLMessageSystem* msg = gMessageSystem;
446	msg->newMessage("GroupNoticesListRequest");
447	msg->nextBlock("AgentData");
448	msg->addUUID("AgentID",gAgent.getID());
449	msg->addUUID("SessionID",gAgent.getSessionID());
450	msg->nextBlock("Data");
451	msg->addUUID("GroupID",self->mGroupID);
452	gAgent.sendReliableMessage();
453	*/
454	
455}
456
457void LLPanelGroupNotices::onClickRefreshNotices(void* data)
458{
459	lldebugs << "LLPanelGroupNotices::onClickGetPastNotices" << llendl;
460	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
461	
462	self->mNoticesList->deleteAllItems();
463
464	LLMessageSystem* msg = gMessageSystem;
465	msg->newMessage("GroupNoticesListRequest");
466	msg->nextBlock("AgentData");
467	msg->addUUID("AgentID",gAgent.getID());
468	msg->addUUID("SessionID",gAgent.getSessionID());
469	msg->nextBlock("Data");
470	msg->addUUID("GroupID",self->mGroupID);
471	gAgent.sendReliableMessage();
472}
473
474//static
475std::map<LLUUID,LLPanelGroupNotices*> LLPanelGroupNotices::sInstances;
476
477// static
478void LLPanelGroupNotices::processGroupNoticesListReply(LLMessageSystem* msg, void** data)
479{
480	LLUUID group_id;
481	msg->getUUID("AgentData", "GroupID", group_id);
482
483	std::map<LLUUID,LLPanelGroupNotices*>::iterator it = sInstances.find(group_id);
484	if (it == sInstances.end())
485	{
486		llinfos << "Group Panel Notices " << group_id << " no longer in existence."
487				<< llendl;
488		return;
489	}
490	
491	LLPanelGroupNotices* selfp = it->second;
492	if(!selfp)
493	{
494		llinfos << "Group Panel Notices " << group_id << " no longer in existence."
495				<< llendl;
496		return;
497	}
498
499	selfp->processNotices(msg);
500}
501
502void LLPanelGroupNotices::processNotices(LLMessageSystem* msg)
503{
504	LLUUID id;
505	std::string subj;
506	std::string name;
507	U32 timestamp;
508	BOOL has_attachment;
509	U8 asset_type;
510
511	S32 i=0;
512	S32 count = msg->getNumberOfBlocks("Data");
513
514	mNoticesList->setEnabled(TRUE);
515
516	//save sort state and set unsorted state to prevent unnecessary 
517	//sorting while adding notices
518	bool save_sort = mNoticesList->isSorted();
519	mNoticesList->setNeedsSort(false);
520
521	for (;i<count;++i)
522	{
523		msg->getUUID("Data","NoticeID",id,i);
524		if (1 == count && id.isNull())
525		{
526			// Only one entry, the dummy entry.
527			mNoticesList->setCommentText(mNoNoticesStr);
528			mNoticesList->setEnabled(FALSE);
529			return;
530		}
531
532		//with some network delays we can receive notice list more then once...
533		//so add only unique notices
534		S32 pos = mNoticesList->getItemIndex(id);
535
536		if(pos!=-1)//if items with this ID already in the list - skip it
537			continue;
538			
539		msg->getString("Data","Subject",subj,i);
540		msg->getString("Data","FromName",name,i);
541		msg->getBOOL("Data","HasAttachment",has_attachment,i);
542		msg->getU8("Data","AssetType",asset_type,i);
543		msg->getU32("Data","Timestamp",timestamp,i);
544
545		// we only have the legacy name here, convert it to a username
546		if (LLAvatarNameCache::useDisplayNames())
547		{
548			name = LLCacheName::buildUsername(name);
549		}
550
551		LLSD row;
552		row["id"] = id;
553		
554		row["columns"][0]["column"] = "icon";
555		if (has_attachment)
556		{
557			std::string icon_name = LLInventoryIcon::getIconName(
558									(LLAssetType::EType)asset_type,
559									LLInventoryType::IT_NONE);
560			row["columns"][0]["type"] = "icon";
561			row["columns"][0]["value"] = icon_name;
562		}
563
564		row["columns"][1]["column"] = "subject";
565		row["columns"][1]["value"] = subj;
566
567		row["columns"][2]["column"] = "from";
568		row["columns"][2]["value"] = name;
569
570		row["columns"][3]["column"] = "date";
571		row["columns"][3]["value"] = build_notice_date(timestamp);
572
573		row["columns"][4]["column"] = "sort";
574		row["columns"][4]["value"] = llformat( "%u", timestamp);
575
576		mNoticesList->addElement(row, ADD_BOTTOM);
577	}
578
579	mNoticesList->setNeedsSort(save_sort);
580	mNoticesList->updateSort();
581}
582
583void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data)
584{
585	LLPanelGroupNotices* self = (LLPanelGroupNotices*)data;
586
587	if(!self) return;
588	LLScrollListItem* item = self->mNoticesList->getFirstSelected();
589	if (!item) return;
590	
591	LLMessageSystem* msg = gMessageSystem;
592	msg->newMessage("GroupNoticeRequest");
593	msg->nextBlock("AgentData");
594	msg->addUUID("AgentID",gAgent.getID());
595	msg->addUUID("SessionID",gAgent.getSessionID());
596	msg->nextBlock("Data");
597	msg->addUUID("GroupNoticeID",item->getUUID());
598	gAgent.sendReliableMessage();
599
600	lldebugs << "Item " << item->getUUID() << " selected." << llendl;
601}
602
603void LLPanelGroupNotices::showNotice(const std::string& subject,
604									 const std::string& message,
605									 const bool& has_inventory,
606									 const std::string& inventory_name,
607									 LLOfferInfo* inventory_offer)
608{
609	arrangeNoticeView(VIEW_PAST_NOTICE);
610
611	if(mViewSubject) mViewSubject->setText(subject);
612	if(mViewMessage) mViewMessage->setText(message);
613	
614	if (mInventoryOffer)
615	{
616		// Cancel the inventory offer for the previously viewed notice
617		mInventoryOffer->forceResponse(IOR_DECLINE); 
618		mInventoryOffer = NULL;
619	}
620
621	if (inventory_offer)
622	{
623		mInventoryOffer = inventory_offer;
624
625		std::string icon_name = LLInventoryIcon::getIconName(mInventoryOffer->mType,
626												LLInventoryType::IT_TEXTURE);
627
628		mViewInventoryIcon->setValue(icon_name);
629		mViewInventoryIcon->setVisible(TRUE);
630
631		std::stringstream ss;
632		ss << "        " << inventory_name;
633
634		mViewInventoryName->setText(ss.str());
635		mBtnOpenAttachment->setEnabled(TRUE);
636	}
637	else
638	{
639		mViewInventoryName->clear();
640		mViewInventoryIcon->setVisible(FALSE);
641		mBtnOpenAttachment->setEnabled(FALSE);
642	}
643}
644
645void LLPanelGroupNotices::arrangeNoticeView(ENoticeView view_type)
646{
647	if (CREATE_NEW_NOTICE == view_type)
648	{
649        mPanelCreateNotice->setVisible(TRUE);
650		mPanelViewNotice->setVisible(FALSE);
651	}
652	else
653	{
654		mPanelCreateNotice->setVisible(FALSE);
655		mPanelViewNotice->setVisible(TRUE);
656		mBtnOpenAttachment->setEnabled(FALSE);
657	}
658}
659void LLPanelGroupNotices::setGroupID(const LLUUID& id)
660{
661	sInstances.erase(mGroupID);
662	LLPanelGroupTab::setGroupID(id);
663	sInstances[mGroupID] = this;
664
665	mBtnNewMessage->setEnabled(gAgent.hasPowerInGroup(mGroupID, GP_NOTICES_SEND));
666
667	LLGroupDropTarget* target = getChild<LLGroupDropTarget> ("drop_target");
668	target->setPanel (this);
669	target->setGroup (mGroupID);
670
671	if(mViewMessage) 
672		mViewMessage->clear();
673
674	if(mViewInventoryName)
675		mViewInventoryName->clear();
676	
677	activate();
678}