diff options
| author | Alexei Arabadji <aarabadji@productengine.com> | 2010-01-13 17:40:47 +0200 | 
|---|---|---|
| committer | Alexei Arabadji <aarabadji@productengine.com> | 2010-01-13 17:40:47 +0200 | 
| commit | 33af1ba1e5beb452a9916c99411f72cc5d33fe46 (patch) | |
| tree | a249c20a0fff97cb63ac18baf7a286abc37edd01 | |
| parent | d40c4f9b8e6ce320dfee39c2ee9b5cbfdfda1392 (diff) | |
implemented EXT-4001 “Notification Well window interaction”,
made notification that restored from notification well window shows as inspector;
--HG--
branch : product-engine
| -rw-r--r-- | indra/newview/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/newview/llinspecttoast.cpp | 119 | ||||
| -rw-r--r-- | indra/newview/llinspecttoast.h | 41 | ||||
| -rw-r--r-- | indra/newview/llscreenchannel.cpp | 10 | ||||
| -rw-r--r-- | indra/newview/llscreenchannel.h | 2 | ||||
| -rw-r--r-- | indra/newview/llsyswellitem.cpp | 3 | ||||
| -rw-r--r-- | indra/newview/llsyswellwindow.cpp | 7 | ||||
| -rw-r--r-- | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/inspect_toast.xml | 19 | 
9 files changed, 198 insertions, 7 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6f8ccb3d11..f56be4004a 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -250,6 +250,7 @@ set(viewer_SOURCE_FILES      llinspectgroup.cpp      llinspectobject.cpp      llinspectremoteobject.cpp +    llinspecttoast.cpp      llinventorybridge.cpp      llinventoryclipboard.cpp      llinventoryfilter.cpp @@ -755,6 +756,7 @@ set(viewer_HEADER_FILES      llinspectgroup.h      llinspectobject.h      llinspectremoteobject.h +    llinspecttoast.h      llinventorybridge.h      llinventoryclipboard.h      llinventoryfilter.h diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp new file mode 100644 index 0000000000..0139d76f93 --- /dev/null +++ b/indra/newview/llinspecttoast.cpp @@ -0,0 +1,119 @@ +/**  + * @file lltoast.h + * @brief This class implements a placeholder for any notification panel. + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + *  + * Copyright (c) 2003-2009, Linden Research, Inc. + *  + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab.  Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + *  + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + *  + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + *  + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" // must be first include + +#include "llinspecttoast.h" +#include "llinspect.h" +#include "llfloaterreg.h" +#include "llscreenchannel.h" +#include "llchannelmanager.h" + +using namespace LLNotificationsUI; + +/** + * Represents inspectable toast . + */ +class LLInspectToast: public LLInspect +{ +public: + +	LLInspectToast(const LLSD& notification_idl); +	virtual ~LLInspectToast(); + +	/*virtual*/ void onOpen(const LLSD& notification_id); +private: +	void onToastDestroy(LLToast * toast); + +private: +	LLPanel* mPanel; +	LLScreenChannel* mScreenChannel; +}; + +LLInspectToast::LLInspectToast(const LLSD& notification_id) : +	LLInspect(LLSD()), mPanel(NULL) +{ +	LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID( +																LLUUID(gSavedSettings.getString("NotificationChannelUUID"))); +	mScreenChannel = dynamic_cast<LLScreenChannel*>(channel); +	if(NULL == mScreenChannel) +	{ +		llwarns << "Could not get requested screen channel." << llendl; +		return; +	} +} +LLInspectToast::~LLInspectToast() +{ + +} + +void LLInspectToast::onOpen(const LLSD& notification_id) +{ +	LLInspect::onOpen(notification_id); +	LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id); +	if (toast == NULL) +	{ +		llwarns << "Could not get requested toast  from screen channel." << llendl; +		return; +	} +	toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1)); + +	LLPanel * panel = toast->getPanel(); +	panel->setVisible(TRUE); +	panel->setMouseOpaque(FALSE); +	if(mPanel != NULL && mPanel->getParent() == this) +	{ +		removeChild(mPanel); +	} +	addChild(panel); +	panel->setFocus(TRUE); +	mPanel = panel; + + +	LLRect panel_rect; +	panel_rect = panel->getRect(); +	reshape(panel_rect.getWidth(), panel_rect.getHeight()); + +	LLUI::positionViewNearMouse(this); +} + +void LLInspectToast::onToastDestroy(LLToast * toast) +{ +	closeFloater(false); +} + +void LLNotificationsUI::registerFloater() +{ +	LLFloaterReg::add("inspect_toast", "inspect_toast.xml", +			&LLFloaterReg::build<LLInspectToast>); +} + diff --git a/indra/newview/llinspecttoast.h b/indra/newview/llinspecttoast.h new file mode 100644 index 0000000000..c4403d6196 --- /dev/null +++ b/indra/newview/llinspecttoast.h @@ -0,0 +1,41 @@ +/**  + * @file lltoast.h + * @brief This class implements a placeholder for any notification panel. + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + *  + * Copyright (c) 2003-2009, Linden Research, Inc. + *  + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab.  Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + *  + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + *  + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + *  + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINSPECTTOAST_H +#define LL_LLINSPECTTOAST_H + +namespace LLNotificationsUI +{ +void registerFloater(); +} + +#endif diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index d0b537cdfc..d0a0dd877f 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -908,3 +908,13 @@ void LLScreenChannel::updateShowToastsState()  //-------------------------------------------------------------------------- +LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id) +{ +	std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(), +			mStoredToastList.end(), id); + +	if (it == mStoredToastList.end()) +		return NULL; + +	return it->toast; +} diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index 661b9e4e60..054f92096c 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -216,6 +216,8 @@ public:  	// update number of notifications in the StartUp Toast  	void	updateStartUpString(S32 num); +	LLToast* getToastByNotificationID(LLUUID id); +  	// Channel's signals  	// signal on storing of faded toasts event  	typedef boost::function<void (LLPanel* info_panel, const LLUUID id)> store_tost_callback_t; diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index eef8435006..0cfcfdc634 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -77,10 +77,11 @@ void LLSysWellItem::onClickCloseBtn()  //---------------------------------------------------------------------------------  BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask)  { +	BOOL res = LLPanel::handleMouseDown(x, y, mask);  	if(!mCloseBtn->getRect().pointInRect(x, y))  		mOnItemClick(this); -	return LLPanel::handleMouseDown(x, y, mask); +	return res;  }  //--------------------------------------------------------------------------------- diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index b5884e8364..ba15053381 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -700,12 +700,7 @@ void LLNotificationWellWindow::connectListUpdaterToSignal(std::string notificati  void LLNotificationWellWindow::onItemClick(LLSysWellItem* item)  {  	LLUUID id = item->getID(); -	if(mChannel) -	{ -		mChannel->hideToast(mLoadedToastId); -		mChannel->loadStoredToastByNotificationIDToChannel(id); -		mLoadedToastId = id; -	} +	LLFloaterReg::showInstance("inspect_toast", id);  }  void LLNotificationWellWindow::onItemClose(LLSysWellItem* item) diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 23bdbc7381..256bf38a41 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -117,6 +117,7 @@  #include "llinspectgroup.h"  #include "llinspectobject.h"  #include "llinspectremoteobject.h" +#include "llinspecttoast.h"  #include "llmediaremotectrl.h"  #include "llmoveview.h"  #include "llnearbychat.h" @@ -185,6 +186,7 @@ void LLViewerFloaterReg::registerFloaters()  	LLInspectGroupUtil::registerFloater();  	LLInspectObjectUtil::registerFloater();  	LLInspectRemoteObjectUtil::registerFloater(); +	LLNotificationsUI::registerFloater();  	LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>);  	LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); diff --git a/indra/newview/skins/default/xui/en/inspect_toast.xml b/indra/newview/skins/default/xui/en/inspect_toast.xml new file mode 100644 index 0000000000..0221397a8c --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspect_toast.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- +  Not can_close / no title to avoid window chrome +  Single instance - only have one at a time, recycle it each spawn +--> +<floater + legacy_header_height="25" + bevel_style="in" + bg_opaque_image="Inspector_Background" + can_close="false" + can_minimize="false" + height="148" + layout="topleft" + name="inspect_toast" + single_instance="true" + sound_flags="0" + visible="true" + width="228"> +</floater> | 
