Commits

Steven Bennetts  committed 00524ca

Merging revisions 2102-2104 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1609 EXT-1255 EXT-1299

  • Participants
  • Parent commits 00bed35

Comments (0)

Files changed (18)

File indra/llui/CMakeLists.txt

     lltextbox.cpp
     lltexteditor.cpp
     lltextparser.cpp
-    lltransientfloatermgr.cpp
     lltransutil.cpp
     lltoggleablemenu.cpp
     lltooltip.cpp
     lltextparser.h
     lltoggleablemenu.h
     lltooltip.h
-    lltransientfloatermgr.h
     lltransutil.h
     lluicolortable.h
     lluiconstants.h

File indra/llui/lldockablefloater.cpp

 	{
 		instance->setMinimized(FALSE);
 		instance->setVisible(TRUE);
-		instance->setFocus(TRUE);
+		gFloaterView->bringToFront(instance);
 	}
 }
 
 	LLFloater::setMinimized(minimize);
 }
 
+LLView * LLDockableFloater::getDockWidget()
+{
+	LLView * res = NULL;
+	if (getDockControl() != NULL) {
+		res = getDockControl()->getDock();
+	}
+
+	return res;
+}
+
 void LLDockableFloater::onDockHidden()
 {
 	setCanDock(FALSE);

File indra/llui/lldockablefloater.h

 	 */
 	/*virtual*/ void setMinimized(BOOL minimize);
 
+	LLView * getDockWidget();
+
 	virtual void onDockHidden();
 	virtual void onDockShown();
 

File indra/llui/lldockcontrol.h

 	void on();
 	void off();
 	void setDock(LLView* dockWidget);
+	LLView* getDock()
+	{
+		return mDockWidget;
+	}
 	void repositionDockable();
 	void drawToungue();
 	bool isDockVisible();

File indra/newview/CMakeLists.txt

     lltoolselectland.cpp
     lltoolselectrect.cpp
     lltracker.cpp
+    lltransientdockablefloater.cpp
+    lltransientfloatermgr.cpp
     lluploaddialog.cpp
     llurl.cpp
     llurldispatcher.cpp
     lltoolselectland.h
     lltoolselectrect.h
     lltracker.h
+    lltransientdockablefloater.h
+    lltransientfloatermgr.h
     lluiconstants.h
     lluploaddialog.h
     llurl.h

File indra/newview/llfloatercamera.cpp

 }
 
 LLFloaterCamera::LLFloaterCamera(const LLSD& val)
-:	LLDockableFloater(NULL, val),
+:	LLTransientDockableFloater(NULL, true, val),
 	mCurrMode(CAMERA_CTRL_MODE_ORBIT),
 	mPrevMode(CAMERA_CTRL_MODE_ORBIT)
 {
 //-------------LLFloaterCameraPresets------------------------
 
 LLFloaterCameraPresets::LLFloaterCameraPresets(const LLSD& key):
-LLDockableFloater(NULL, key)
+LLTransientDockableFloater(NULL, true, key)
 {}
 
 BOOL LLFloaterCameraPresets::postBuild()

File indra/newview/llfloatercamera.h

 #ifndef LLFLOATERCAMERA_H
 #define LLFLOATERCAMERA_H
 
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
 
 class LLJoystickCameraRotate;
 class LLJoystickCameraZoom;
 };
 
 class LLFloaterCamera
-	:	public LLDockableFloater
+	:	public LLTransientDockableFloater
 {
 	friend class LLFloaterReg;
 	
 
 };
 
-class LLFloaterCameraPresets : public LLDockableFloater 
+class LLFloaterCameraPresets : public LLTransientDockableFloater
 {
 	friend class LLFloaterReg;
 public:

File indra/newview/llimfloater.cpp

 
 
 LLIMFloater::LLIMFloater(const LLUUID& session_id)
-  : LLDockableFloater(NULL, session_id),
+  : LLTransientDockableFloater(NULL, true, session_id),
 	mControlPanel(NULL),
 	mSessionID(session_id),
 	mLastMessageIndex(-1),
 			mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this);
 		}
 	}
-
-	LLTransientFloaterMgr::getInstance()->registerTransientFloater(this);
 }
 
 // virtual
 
 LLIMFloater::~LLIMFloater()
 {
-	LLTransientFloaterMgr::getInstance()->unregisterTransientFloater(this);
 }
 
 //virtual
 		(LLNotificationsUI::LLChannelManager::getInstance()->
 											findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
 	
-	LLDockableFloater::setDocked(docked, pop_on_undock);
+	LLTransientDockableFloater::setDocked(docked, pop_on_undock);
 
 	// update notification channel state
 	if(channel)
 	LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
 		(LLNotificationsUI::LLChannelManager::getInstance()->
 											findChannelByID(LLUUID(gSavedSettings.getString("NotificationChannelUUID"))));
-	LLDockableFloater::setVisible(visible);
+	LLTransientDockableFloater::setVisible(visible);
 
 	// update notification channel state
 	if(channel)

File indra/newview/llimfloater.h

 #ifndef LL_IMFLOATER_H
 #define LL_IMFLOATER_H
 
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
 #include "lllogchat.h"
 
 class LLLineEditor;
  * Individual IM window that appears at the bottom of the screen,
  * optionally "docked" to the bottom tray.
  */
-class LLIMFloater : public LLDockableFloater
+class LLIMFloater : public LLTransientDockableFloater
 {
 public:
 	LLIMFloater(const LLUUID& session_id);

File indra/newview/llmoveview.cpp

 
 // protected
 LLFloaterMove::LLFloaterMove(const LLSD& key)
-:	LLDockableFloater(NULL, key),
+:	LLTransientDockableFloater(NULL, true, key),
 	mForwardButton(NULL),
 	mBackwardButton(NULL),
 	mTurnLeftButton(NULL), 
 	LLDockableFloater::setDocked(docked, pop_on_undock);
 	bool show_mode_buttons = isDocked() || !gAgent.getFlying();
 	updateHeight(show_mode_buttons);
+
+	LLTransientDockableFloater::setDocked(docked, pop_on_undock);
 }
 
 void LLFloaterMove::setModeButtonToggleState(const EMovementMode mode)

File indra/newview/llmoveview.h

 #define LL_LLMOVEVIEW_H
 
 // Library includes
-#include "lldockablefloater.h"
+#include "lltransientdockablefloater.h"
 
 class LLButton;
 class LLJoystickAgentTurn;
 // Classes
 //
 class LLFloaterMove
-:	public LLDockableFloater
+:	public LLTransientDockableFloater
 {
 	friend class LLFloaterReg;
 

File indra/newview/llpanellandmarks.cpp

 		root_folder->setupMenuHandle(LLInventoryType::IT_CATEGORY, mGearFolderMenu->getHandle());
 		root_folder->setupMenuHandle(LLInventoryType::IT_LANDMARK, mGearLandmarkMenu->getHandle());
 	}
+
+	// save initial folder state to avoid incorrect work while switching between Landmarks & Teleport History tabs
+	// See EXT-1609.
+	inventory_list->saveFolderState();
 }
 
 void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list)

File indra/newview/llrootview.h

 	LLRootView(const Params& p)
 	:	LLView(p)
 	{}
+
+	// added to provide possibility to handle mouse click event inside all application
+	// window without creating any floater
+	typedef boost::signals2::signal<void(S32 x, S32 y, MASK mask)>
+			mouse_signal_t;
+
+	private:
+		mouse_signal_t mMouseDownSignal;
+
+	public:
+	/*virtual*/
+	BOOL handleMouseDown(S32 x, S32 y, MASK mask)
+	{
+		mMouseDownSignal(x, y, mask);
+		return LLView::handleMouseDown(x, y, mask);
+	}
+
+	boost::signals2::connection addMouseDownCallback(
+			const mouse_signal_t::slot_type& cb)
+	{
+		return mMouseDownSignal.connect(cb);
+	}
 };
 #endif //LL_LLROOTVIEW_H

File indra/newview/llsyswellwindow.cpp

 
 	if(!getVisible() || isMinimized())
 	{
+		if(mChannel)
+		{
+			mChannel->removeAndStoreAllStorableToasts();
+		}
 		if(isWindowEmpty())
 		{
 			return;

File indra/newview/lltransientdockablefloater.cpp

+/** 
+ * @file lltransientdockablefloater.cpp
+ * @brief Creates a panel of a specific kind for a toast
+ *
+ * $LicenseInfo:firstyear=2000&license=viewergpl$
+ * 
+ * Copyright (c) 2000-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"
+
+#include "lltransientfloatermgr.h"
+#include "lltransientdockablefloater.h"
+#include "llfloaterreg.h"
+
+
+LLTransientDockableFloater::LLTransientDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+		const LLSD& key, const Params& params) :
+		LLDockableFloater(dockControl, uniqueDocking, key, params)
+{
+	LLTransientFloaterMgr::getInstance()->registerTransientFloater(this);
+}
+
+LLTransientDockableFloater::~LLTransientDockableFloater()
+{
+	LLTransientFloaterMgr::getInstance()->unregisterTransientFloater(this);
+}
+
+void LLTransientDockableFloater::setVisible(BOOL visible)
+{
+	LLView* dock = getDockWidget();
+	if(visible && isDocked())
+	{
+		LLTransientFloaterMgr::getInstance()->addControlView(this);
+		if (dock != NULL)
+		{
+			LLTransientFloaterMgr::getInstance()->addControlView(dock);
+		}
+	}
+	else
+	{
+		LLTransientFloaterMgr::getInstance()->removeControlView(this);
+		if (dock != NULL)
+		{
+			LLTransientFloaterMgr::getInstance()->removeControlView(dock);
+		}
+	}
+
+	LLDockableFloater::setVisible(visible);
+}
+
+void LLTransientDockableFloater::setDocked(bool docked, bool pop_on_undock)
+{
+	LLView* dock = getDockWidget();
+	if(docked)
+	{
+		LLTransientFloaterMgr::getInstance()->addControlView(this);
+		if (dock != NULL)
+		{
+			LLTransientFloaterMgr::getInstance()->addControlView(dock);
+		}
+	}
+	else
+	{
+		LLTransientFloaterMgr::getInstance()->removeControlView(this);
+		if (dock != NULL)
+		{
+			LLTransientFloaterMgr::getInstance()->removeControlView(dock);
+		}
+	}
+
+	LLDockableFloater::setDocked(docked, pop_on_undock);
+}

File indra/newview/lltransientdockablefloater.h

+/** 
+ * @file lltransientdockablefloater.h
+ * @brief Creates a panel of a specific kind for a toast.
+ *
+ * $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_TRANSIENTDOCKABLEFLOATER_H
+#define LL_TRANSIENTDOCKABLEFLOATER_H
+
+#include "llerror.h"
+#include "llfloater.h"
+#include "lldockcontrol.h"
+#include "lldockablefloater.h"
+
+/**
+ * Represents floater that can dock and managed by transient floater manager.
+ * Transient floaters should be hidden if user click anywhere except defined view list.
+ */
+class LLTransientDockableFloater : public LLDockableFloater
+{
+public:
+	LOG_CLASS(LLTransientDockableFloater);
+	LLTransientDockableFloater(LLDockControl* dockControl, bool uniqueDocking,
+			const LLSD& key, const Params& params = getDefaultParams());
+	virtual ~LLTransientDockableFloater();
+
+	/*virtual*/ void setVisible(BOOL visible);
+	/* virtual */void setDocked(bool docked, bool pop_on_undock = true);
+};
+
+#endif /* LL_TRANSIENTDOCKABLEFLOATER_H */

File indra/newview/lltransientfloatermgr.cpp

+/** 
+ * @file lltransientfloatermgr.cpp
+ * @brief LLFocusMgr base class
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ * 
+ * Copyright (c) 2002-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"
+
+#include "lltransientfloatermgr.h"
+#include "llfocusmgr.h"
+#include "llrootview.h"
+#include "llviewerwindow.h"
+#include "lldockablefloater.h"
+
+
+LLTransientFloaterMgr::LLTransientFloaterMgr()
+{
+	gViewerWindow->getRootView()->addMouseDownCallback(boost::bind(
+			&LLTransientFloaterMgr::leftMouseClickCallback, this, _1, _2, _3));
+}
+
+void LLTransientFloaterMgr::registerTransientFloater(LLFloater* floater)
+{
+	mTransSet.insert(floater);
+}
+
+void LLTransientFloaterMgr::unregisterTransientFloater(LLFloater* floater)
+{
+	mTransSet.erase(floater);
+}
+
+void LLTransientFloaterMgr::addControlView(LLView* view)
+{
+	mControlsSet.insert(view);
+}
+
+void LLTransientFloaterMgr::removeControlView(LLView* view)
+{
+	// we will still get focus lost callbacks on this view, but that's ok
+	// since we run sanity checking logic every time
+	mControlsSet.erase(view);
+}
+
+void LLTransientFloaterMgr::hideTransientFloaters()
+{
+	for (std::set<LLFloater*>::iterator it = mTransSet.begin(); it
+			!= mTransSet.end(); it++)
+	{
+		LLFloater* floater = *it;
+		if (floater->isDocked())
+		{
+			floater->setVisible(FALSE);
+		}
+	}
+}
+
+void LLTransientFloaterMgr::leftMouseClickCallback(S32 x, S32 y,
+		MASK mask)
+{
+	bool hide = true;
+	for (controls_set_t::iterator it = mControlsSet.begin(); it
+			!= mControlsSet.end(); it++)
+	{
+		LLView* control_view = *it;
+		if (!control_view->getVisible())
+		{
+			continue;
+		}
+
+		LLRect rect = control_view->calcScreenRect();
+		// if click inside view rect
+		if (rect.pointInRect(x, y))
+		{
+			hide = false;
+			break;
+		}
+	}
+
+	if (hide)
+	{
+		hideTransientFloaters();
+	}
+}
+

File indra/newview/lltransientfloatermgr.h

+/** 
+ * @file lltransientfloatermgr.h
+ * @brief LLFocusMgr base class
+ *
+ * $LicenseInfo:firstyear=2002&license=viewergpl$
+ * 
+ * Copyright (c) 2002-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_LLTRANSIENTFLOATERMGR_H
+#define LL_LLTRANSIENTFLOATERMGR_H
+
+#include "llui.h"
+#include "llsingleton.h"
+#include "llfloater.h"
+
+
+/**
+ * Provides functionality to hide transient floaters.
+ */
+class LLTransientFloaterMgr: public LLSingleton<LLTransientFloaterMgr>
+{
+public:
+	LLTransientFloaterMgr();
+	void registerTransientFloater(LLFloater* floater);
+	void unregisterTransientFloater(LLFloater* floater);
+	void addControlView(LLView* view);
+	void removeControlView(LLView* view);
+
+private:
+	void hideTransientFloaters();
+	void leftMouseClickCallback(S32 x, S32 y, MASK mask);
+
+private:
+	std::set<LLFloater*> mTransSet;
+	typedef std::set<LLView*> controls_set_t;
+	controls_set_t mControlsSet;
+};
+
+#endif  // LL_LLTRANSIENTFLOATERMGR_H