From aeb6d0c93c1122c1320f99c1a652a5e2f1d60d52 Mon Sep 17 00:00:00 2001
From: Josh Bell <josh@lindenlab.com>
Date: Mon, 15 Jan 2007 18:49:02 +0000
Subject: [PATCH] svn merge -r 56599:56738
 svn+ssh://svn.lindenlab.com/svn/linden/branches/maintenance

---
 indra/llmessage/message.h                     |  2 +-
 indra/llrender/llimagegl.h                    |  2 +-
 indra/llui/llfloater.h                        |  4 ++--
 indra/llui/llmenugl.cpp                       |  9 ++++----
 indra/llui/llmenugl.h                         |  2 +-
 .../lscript_library/lscript_library.cpp       |  2 +-
 indra/newview/gpu_table.txt                   |  1 +
 indra/newview/llchatbar.cpp                   |  9 ++++++--
 indra/newview/lldynamictexture.h              |  2 +-
 indra/newview/llfolderview.cpp                | 22 ++++++++++---------
 indra/newview/llinventorybridge.cpp           |  1 +
 indra/newview/lljoystickbutton.h              |  4 ++--
 indra/newview/llpanelcontents.h               |  2 +-
 indra/newview/llpreview.cpp                   |  7 +-----
 indra/newview/llpreviewtexture.cpp            |  9 +++++---
 indra/newview/llselectmgr.cpp                 |  9 ++++++++
 indra/newview/llviewermenu.cpp                |  2 +-
 indra/newview/llviewertexteditor.cpp          |  2 +-
 indra/newview/llviewerwindow.cpp              |  9 ++++++--
 indra/newview/llwearable.h                    |  4 ++--
 20 files changed, 63 insertions(+), 41 deletions(-)

diff --git a/indra/llmessage/message.h b/indra/llmessage/message.h
index 6f6bff6bf6f..ec76e1f755b 100644
--- a/indra/llmessage/message.h
+++ b/indra/llmessage/message.h
@@ -731,7 +731,7 @@ class LLMessageSystem
 	static F32 mTimeDecodesSpamThreshold;  // If mTimeDecodes is on, all this many seconds for each msg decode before spamming
 	static BOOL mTimeDecodes;  // Measure time for all message decodes if TRUE;
 
-	void LLMessageSystem::init(); // ctor shared initialisation.
+	void init(); // ctor shared initialisation.
 };
 
 
diff --git a/indra/llrender/llimagegl.h b/indra/llrender/llimagegl.h
index f8c6a008eb2..4f6a11c2d94 100644
--- a/indra/llrender/llimagegl.h
+++ b/indra/llrender/llimagegl.h
@@ -150,7 +150,7 @@ class LLImageGL : public LLThreadSafeRefCount
 
 	// STATICS
 public:	
-	static std::set<LLImageGL*> LLImageGL::sImageList;
+	static std::set<LLImageGL*> sImageList;
 	static S32 sCount;
 	
 	static F32 sLastFrameTime;
diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h
index d682c7a36a5..c9ebd64c282 100644
--- a/indra/llui/llfloater.h
+++ b/indra/llui/llfloater.h
@@ -288,8 +288,8 @@ class LLFloaterView : public LLUICtrl
 	void			getMinimizePosition( S32 *left, S32 *bottom);
 	void			restoreAll();		// un-minimize all floaters
 	typedef std::set<LLView*> skip_list_t;
-	void LLFloaterView::pushVisibleAll(BOOL visible, const skip_list_t& skip_list = skip_list_t());
-	void LLFloaterView::popVisibleAll(const skip_list_t& skip_list = skip_list_t());
+	void pushVisibleAll(BOOL visible, const skip_list_t& skip_list = skip_list_t());
+	void popVisibleAll(const skip_list_t& skip_list = skip_list_t());
 
 	void			setCycleMode(BOOL mode);
 	BOOL			getCycleMode();
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 650596c7f74..8607d1d7525 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -528,8 +528,8 @@ void LLMenuItemGL::draw( void )
 		}
 	}
 
-	// underline "jump" key
-	if (getMenu()->jumpKeysActive())
+	// underline "jump" key only when keyboard navigation has been initiated
+	if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode())
 	{
 		LLString upper_case_label = mLabel.getString();
 		LLString::toUpper(upper_case_label);
@@ -1792,8 +1792,8 @@ void LLMenuItemBranchDownGL::draw( void )
 				   LLFontGL::HCENTER, LLFontGL::BOTTOM, font_style );
 
 
-	// underline navigation key
-	if (getMenu()->jumpKeysActive())
+	// underline navigation key only when keyboard navigation has been initiated
+	if (getMenu()->jumpKeysActive() && LLMenuGL::getKeyboardMode())
 	{
 		LLString upper_case_label = mLabel.getString();
 		LLString::toUpper(upper_case_label);
@@ -4281,6 +4281,7 @@ BOOL LLMenuBarGL::handleHover( S32 x, S32 y, MASK mask )
 					((LLMenuItemGL*)viewp)->doIt();
 					LLMenuGL::setKeyboardMode(FALSE);
 				}
+				LLMenuGL::setKeyboardMode(FALSE);
 			}
 		}
 
diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h
index 0dca8f2550f..c15f417e657 100644
--- a/indra/llui/llmenugl.h
+++ b/indra/llui/llmenugl.h
@@ -410,7 +410,7 @@ class LLMenuGL
 	virtual void drawBackground(LLMenuItemGL* itemp, LLColor4& color);
 	virtual void setVisible(BOOL visible);
 
-	virtual BOOL LLMenuGL::handleAcceleratorKey(KEY key, MASK mask);
+	virtual BOOL handleAcceleratorKey(KEY key, MASK mask);
 
 	LLMenuGL* getChildMenuByName(const LLString& name, BOOL recurse) const;
 	
diff --git a/indra/lscript/lscript_library/lscript_library.cpp b/indra/lscript/lscript_library/lscript_library.cpp
index 62183d079f1..2c2cdbabdc7 100644
--- a/indra/lscript/lscript_library/lscript_library.cpp
+++ b/indra/lscript/lscript_library/lscript_library.cpp
@@ -208,7 +208,7 @@ void LLScriptLibrary::init()
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llCollisionSprite", NULL, "s", "llCollisionSprite(string impact_sprite)\nSuppress default collision sprites, replace default impact sprite with impact_sprite (empty string to just suppress)"));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetAnimation", "s", "k", "string llGetAnimation(key id)\nGet the currently playing locomotion animation for avatar id"));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llResetScript", NULL, NULL, "llResetScript()\nResets the script"));
-	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llMessageLinked", NULL, "iisk", "llMessageLinked(integer linknum, integer num, string str, key id)\nSends num, str, and id to members of the link set(LINK_SET sends to all tasks,\nLINK_ALL_OTHERS to all other tasks,\nLINK_ALL_CHILDREN to all children"));
+	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llMessageLinked", NULL, "iisk", "llMessageLinked(integer linknum, integer num, string str, key id)\nSends num, str, and id to members of the link set (LINK_ROOT sends to root task in a linked set,\nLINK_SET sends to all tasks,\nLINK_ALL_OTHERS to all other tasks,\nLINK_ALL_CHILDREN to all children,\nLINK_THIS to the task the script it is in)"));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llPushObject", NULL, "kvvi", "llPushObject(key id, vector impulse, vector ang_impulse, integer local)\nApplies impulse and ang_impulse to object id"));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llPassCollisions", NULL, "i", "llPassCollisions(integer pass)\nif pass == TRUE, collisions are passed from children on to parents (default is FALSE)"));
 	addFunction(new LLScriptLibraryFunction(10.f, 0.f, dummy_func, "llGetScriptName", "s", NULL, "llGetScriptName()\nReturns the script name"));
diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt
index 1af40f89327..fae089486e1 100644
--- a/indra/newview/gpu_table.txt
+++ b/indra/newview/gpu_table.txt
@@ -75,6 +75,7 @@ NVIDIA GeForce 7300				.*NVIDIA.*GeForce 73.*					3
 NVIDIA GeForce 7600				.*NVIDIA.*GeForce 76.*					3
 NVIDIA GeForce 7800				.*NVIDIA.*GeForce 78.*					3
 NVIDIA GeForce 7900				.*NVIDIA.*GeForce 79.*					3
+NVIDIA GeForce 8800				.*NVIDIA.*GeForce 88.*					3
 NVIDIA GeForce FX 5100			.*NVIDIA.*GeForce FX 51.*				1
 NVIDIA GeForce FX 5200			.*NVIDIA.*GeForce FX 52.*				1
 NVIDIA GeForce FX 5500			.*NVIDIA.*GeForce FX 55.*				1
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index e958bd21520..34c178f5098 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -132,6 +132,11 @@ BOOL LLChatBar::postBuild()
 	childSetAction("Say", onClickSay, this);
 	childSetAction("Shout", onClickShout, this);
 	childSetCommitCallback("Gesture", onCommitGesture, this);
+	LLButton * sayp = static_cast<LLButton*>(getChildByName("Say"));
+	if(sayp)
+	{
+		setDefaultBtn(sayp);
+	}
 
 	return TRUE;
 }
@@ -271,8 +276,8 @@ void LLChatBar::refresh()
 		gAgent.stopTyping();
 	}
 
-	childSetEnabled("Say", mInputEditor->getText().size());
-	childSetEnabled("Shout", mInputEditor->getText().size());
+	childSetEnabled("Say", mInputEditor->getText().size() > 0);
+	childSetEnabled("Shout", mInputEditor->getText().size() > 0);
 
 }
 
diff --git a/indra/newview/lldynamictexture.h b/indra/newview/lldynamictexture.h
index 6ff457e9a98..75a37aaa297 100644
--- a/indra/newview/lldynamictexture.h
+++ b/indra/newview/lldynamictexture.h
@@ -60,7 +60,7 @@ class LLDynamicTexture
 	LLCoordGL mOrigin;
 
 	LLCamera mCamera;
-	static LLLinkedList<LLDynamicTexture> LLDynamicTexture::sInstances[ LLDynamicTexture::ORDER_COUNT ];
+	static LLLinkedList<LLDynamicTexture> sInstances[ LLDynamicTexture::ORDER_COUNT ];
 	static S32 sNumRenders;
 };
 
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 3c0ba7ae28d..cf041c4bfbd 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -3242,18 +3242,20 @@ void LLFolderView::removeSelectedItems( void )
 			{
 				new_selection = item_to_delete->getPreviousOpenNode(FALSE);
 			}
-			if (new_selection)
-			{
-				setSelectionFromRoot(new_selection, new_selection->isOpen(), gViewerWindow->childHasKeyboardFocus(this));
-			}
-			else
-			{
-				setSelectionFromRoot(NULL, gViewerWindow->childHasKeyboardFocus(this));
-			}
-
 			if(parent)
 			{
-				parent->removeItem(item_to_delete);
+				if (parent->removeItem(item_to_delete))
+				{
+					// change selection on successful delete
+					if (new_selection)
+					{
+						setSelectionFromRoot(new_selection, new_selection->isOpen(), gViewerWindow->childHasKeyboardFocus(this));
+					}
+					else
+					{
+						setSelectionFromRoot(NULL, gViewerWindow->childHasKeyboardFocus(this));
+					}
+				}
 			}
 			arrangeAll();
 		}
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 47ab6e6b87b..a0f098790f2 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -676,6 +676,7 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model,
 		LLInventoryObject* obj = model->getObject(mUUID);
 		if(!obj) return;
 		obj->removeFromServer();
+		LLPreview::hide(mUUID);
 		model->deleteObject(mUUID);
 		model->notifyObservers();
 	}
diff --git a/indra/newview/lljoystickbutton.h b/indra/newview/lljoystickbutton.h
index a9a8acdfafb..8b0a5665d42 100644
--- a/indra/newview/lljoystickbutton.h
+++ b/indra/newview/lljoystickbutton.h
@@ -75,7 +75,7 @@ class LLJoystickAgentTurn
 
 	virtual void	onHeldDown();
 
-	static LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
+	static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
 
 };
 
@@ -96,7 +96,7 @@ class LLJoystickAgentSlide
 	virtual void	onHeldDown();
 	virtual void	onMouseUp();
 
-	static LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
+	static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
 };
 
 
diff --git a/indra/newview/llpanelcontents.h b/indra/newview/llpanelcontents.h
index 273ab20bc71..7701a2a5f2e 100644
--- a/indra/newview/llpanelcontents.h
+++ b/indra/newview/llpanelcontents.h
@@ -21,7 +21,7 @@ class LLSpinCtrl;
 class LLPanelContents : public LLPanel
 {
 public:
-	virtual	BOOL LLPanelContents::postBuild();
+	virtual	BOOL postBuild();
 	LLPanelContents(const std::string& name);
 	virtual ~LLPanelContents();
 
diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp
index 82974da634f..23f5b381ca8 100644
--- a/indra/newview/llpreview.cpp
+++ b/indra/newview/llpreview.cpp
@@ -286,12 +286,7 @@ void LLPreview::hide(const LLUUID& item_uuid)
 	if(found_it != LLPreview::sInstances.end())
 	{
 		LLPreview* instance = found_it->second;
-		if( instance->getParent() )
-		{
-			instance->getParent()->removeChild( instance );
-		}
-
-		delete instance;
+		instance->close();
 	}
 }
 
diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp
index a50ded3b53b..d1817c8cdae 100644
--- a/indra/newview/llpreviewtexture.cpp
+++ b/indra/newview/llpreviewtexture.cpp
@@ -157,9 +157,12 @@ void LLPreviewTexture::init()
 	{
 		LLInventoryItem* item = getItem();
 		
-		childSetCommitCallback("desc", LLPreview::onText, this);
-		childSetText("desc", item->getDescription());
-		childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
+		if (item)
+		{
+			childSetCommitCallback("desc", LLPreview::onText, this);
+			childSetText("desc", item->getDescription());
+			childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
+		}
 	}
 }
 
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index a2698763f07..8f4df36f590 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -3899,6 +3899,7 @@ void LLSelectMgr::sendAttach(U8 attachment_point)
 		return;
 	}
 
+	BOOL build_mode = gToolMgr->inEdit();
 	// Special case: Attach to default location for this object.
 	if (0 == attachment_point)
 	{
@@ -3908,6 +3909,10 @@ void LLSelectMgr::sendAttach(U8 attachment_point)
 			packObjectIDAndRotation, 
 			&attachment_point, 
 			SEND_ONLY_ROOTS );
+		if (!build_mode)
+		{
+			deselectAll();
+		}
 	}
 	else
 	{
@@ -3945,6 +3950,10 @@ void LLSelectMgr::sendAttach(U8 attachment_point)
 				packObjectIDAndRotation,
 				&attachment_point,
 				SEND_ONLY_ROOTS );
+			if (!build_mode)
+			{
+				deselectAll();
+			}
 		}
 	}
 }
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8ab2b52a50d..a305c1cfa44 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -6828,7 +6828,6 @@ void near_attach_object(BOOL success, void *user_data)
 	}
 	
 	gSelectMgr->sendAttach(attachment_id);
-	gSelectMgr->deselectTransient();
 }
 
 class LLObjectAttachToAvatar : public view_listener_t
@@ -6866,6 +6865,7 @@ void confirm_replace_attachment(S32 option, void* user_data)
 {
 	if (option == 0/*YES*/)
 	{
+		gSelectMgr->convertTransient();
 		LLViewerObject* selectedObject = gSelectMgr->getFirstRootObject();
 		if (selectedObject)
 		{
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 16ba5d29ea4..7d04f04528b 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -386,7 +386,7 @@ void LLEmbeddedItems::markSaved()
 class LLTextCmdInsertEmbeddedItem : public LLTextCmd
 {
 public:
-	LLTextCmdInsertEmbeddedItem::LLTextCmdInsertEmbeddedItem( S32 pos, LLInventoryItem* item )
+	LLTextCmdInsertEmbeddedItem( S32 pos, LLInventoryItem* item )
 		: LLTextCmd(pos, FALSE), 
 		  mExtCharValue(0)
 	{
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index df396c93be3..74a239e827d 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -899,6 +899,12 @@ void LLViewerWindow::handleFocusLost(LLWindow *window)
 	}
 	gFocusMgr.setMouseCapture( NULL, NULL );
 
+	if (gMenuBarView)
+	{
+		// stop ALT-key access to menu
+		gMenuBarView->resetMenuTrigger();
+	}
+
 	// restore mouse cursor
 	gViewerWindow->showCursor();
 	gViewerWindow->getWindow()->setMouseClipping(FALSE);
@@ -2671,8 +2677,7 @@ BOOL LLViewerWindow::handlePerFrameHover()
 	if (gParcelMgr
 		&& !LLFloaterLand::floaterVisible()
 		&& !LLFloaterBuyLand::isOpen()
-		&& (!gFloaterTools || !gFloaterTools->getVisible())
-		&& !gToolMgr)
+		&& (!gFloaterTools || !gFloaterTools->getVisible()))
 	{
 		gParcelMgr->deselectLand();
 	}
diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h
index d2dcd764d5d..22572981a34 100644
--- a/indra/newview/llwearable.h
+++ b/indra/newview/llwearable.h
@@ -112,8 +112,8 @@ class LLWearable
 	LLPtrSkipMap<S32, F32*>	mVisualParamMap;	// maps visual param id to weight
 	LLPtrSkipMap<S32, LLUUID*>	mTEMap;				// maps TE to Image ID
 
-	static const char* LLWearable::sTypeName[ WT_COUNT ];
-	static const char* LLWearable::sTypeLabel[ WT_COUNT ];
+	static const char* sTypeName[ WT_COUNT ];
+	static const char* sTypeLabel[ WT_COUNT ];
 };
 
 #endif  // LL_LLWEARABLE_H
-- 
GitLab