diff options
| author | James Cook <james@lindenlab.com> | 2009-10-03 23:40:28 +0000 | 
|---|---|---|
| committer | James Cook <james@lindenlab.com> | 2009-10-03 23:40:28 +0000 | 
| commit | ada0f4fa221f2c7070fb02a2b7ff903bdde11c45 (patch) | |
| tree | 0ede83511c304110138c01d16da2fff55162ef31 /indra/newview | |
| parent | b1a280841e1823a19658923a8eefeb67d1d70735 (diff) | |
Merge inspectors UI project, gooey-4, into viewer-2 trunk.  Added new tooltips to 3D avatars, 2D avatar names, and 3D objects.  Refactors tooltips and text boxes, line editors, and text editors.  Breaks LLExpandableTextBox, but a fix is coming.
Resolved conflicts in lltexteditor.cpp, llchatitemscontainerctrl.cpp, llchatmsgbox.cpp, llfloaterbuycurrency.cpp, llnearbychat.cpp, floater_buy_currency.xml, and ru/strings.xml
Merging revisions 134925-135157 of svn+ssh://svn.lindenlab.com/svn/linden/branches/gooey/gooey-4 into C:\source\viewer-2.0.0-3, respecting ancestry
Diffstat (limited to 'indra/newview')
154 files changed, 2978 insertions, 1529 deletions
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index b217a5b781..14a37981a6 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -106,6 +106,7 @@ set(viewer_SOURCE_FILES      llconfirmationmanager.cpp      llcurrencyuimanager.cpp      llcylinder.cpp +    lldateutil.cpp      lldebugmessagebox.cpp      lldebugview.cpp      lldelayedgestureerror.cpp @@ -241,6 +242,7 @@ set(viewer_SOURCE_FILES      llimview.cpp      llimcontrolpanel.cpp      llinspectavatar.cpp +    llinspectobject.cpp      llinventorybridge.cpp      llinventoryclipboard.cpp      llinventoryfilter.cpp @@ -395,7 +397,6 @@ set(viewer_SOURCE_FILES      lltoastimpanel.cpp      lltoastnotifypanel.cpp      lltoastpanel.cpp -    lltoggleablemenu.cpp      lltoolbar.cpp      lltoolbrush.cpp      lltoolcomp.cpp @@ -576,6 +577,7 @@ set(viewer_HEADER_FILES      llconfirmationmanager.h      llcurrencyuimanager.h      llcylinder.h +    lldateutil.h      lldebugmessagebox.h      lldebugview.h      lldelayedgestureerror.h @@ -711,6 +713,7 @@ set(viewer_HEADER_FILES      llimview.h      llimcontrolpanel.h      llinspectavatar.h +    llinspectobject.h      llinventorybridge.h      llinventoryclipboard.h      llinventoryfilter.h @@ -865,7 +868,6 @@ set(viewer_HEADER_FILES      lltoastimpanel.h      lltoastnotifypanel.h      lltoastpanel.h -    lltoggleablemenu.h      lltool.h      lltoolbar.h      lltoolbrush.h @@ -1538,9 +1540,12 @@ if (INSTALL)    include(${CMAKE_CURRENT_SOURCE_DIR}/ViewerInstall.cmake)  endif (INSTALL) +# To add a viewer unit test, just add the test .cpp file below +# This creates a separate test project per file listed.  include(LLAddBuildTest)  SET(viewer_TEST_SOURCE_FILES    llagentaccess.cpp +  lldateutil.cpp    llviewerhelputil.cpp    )  set_source_files_properties( diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 99b662a63f..94a5f5c52b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3673,7 +3673,7 @@        <key>Type</key>        <string>F32</string>        <key>Value</key> -      <string>0.1</string> +      <real>0.15</real>      </map>       <key>InstallLanguage</key>      <map> @@ -7585,7 +7585,7 @@        <key>Type</key>        <string>Boolean</string>        <key>Value</key> -      <integer>1</integer> +      <integer>0</integer>      </map>          <key>ShowCameraButton</key>                      <map> @@ -8456,18 +8456,40 @@        <key>Value</key>        <real>0.2</real>      </map> -  <key>ToolTipVisibleTime</key> -  <map> -    <key>Comment</key> -    <string>Fade tooltip after mouse is idle for this long</string> -    <key>Persist</key> -    <integer>1</integer> -    <key>Type</key> -    <string>F32</string> -    <key>Value</key> -    <real>10.0</real> -  </map> -  <key>ToolboxAutoMove</key> +    <key>ToolTipVisibleTimeFar</key> +    <map> +      <key>Comment</key> +      <string>Fade tooltip after after time passes (seconds) while mouse not near tooltip</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>F32</string> +      <key>Value</key> +      <real>1.0</real> +    </map> +    <key>ToolTipVisibleTimeNear</key> +    <map> +      <key>Comment</key> +      <string>Fade tooltip after after time passes (seconds) while mouse near tooltip</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>F32</string> +      <key>Value</key> +      <real>5.0</real> +    </map> +    <key>ToolTipVisibleTimeOver</key> +    <map> +      <key>Comment</key> +      <string>Fade tooltip after after time passes (seconds) while mouse over tooltip</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>F32</string> +      <key>Value</key> +      <real>1000.0</real> +    </map> +    <key>ToolboxAutoMove</key>      <map>        <key>Comment</key>        <string>[NOT USED]</string> @@ -9655,39 +9677,6 @@        <key>Value</key>        <integer>15</integer>      </map> -    <key>UITextEditorBorder</key> -    <map> -      <key>Comment</key> -      <string>UI Text Editor Border</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>S32</string> -      <key>Value</key> -      <integer>1</integer> -    </map> -    <key>UITextEditorHPad</key> -    <map> -      <key>Comment</key> -      <string>UI Text Horizontal Pad</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>S32</string> -      <key>Value</key> -      <integer>4</integer> -    </map> -    <key>UITextEditorVPadTop</key> -    <map> -      <key>Comment</key> -      <string>UI Text Vertical Pad Top</string> -      <key>Persist</key> -      <integer>1</integer> -      <key>Type</key> -      <string>S32</string> -      <key>Value</key> -      <integer>4</integer> -    </map>  	<key>UploadBakedTexOld</key>      <map>        <key>Comment</key> diff --git a/indra/newview/installers/windows/installer_template.nsi b/indra/newview/installers/windows/installer_template.nsi index 73a548cdc6..a7322749ca 100644 --- a/indra/newview/installers/windows/installer_template.nsi +++ b/indra/newview/installers/windows/installer_template.nsi @@ -758,7 +758,7 @@ CreateShortCut	"$SMPROGRAMS\$INSTSHORTCUT\$INSTSHORTCUT.lnk" \  WriteINIStr		"$SMPROGRAMS\$INSTSHORTCUT\SL Create Account.url" \  				"InternetShortcut" "URL" \ -				"http://www.secondlife.com/registration/" +				"http://join.secondlife.com/"  WriteINIStr		"$SMPROGRAMS\$INSTSHORTCUT\SL Your Account.url" \  				"InternetShortcut" "URL" \  				"http://www.secondlife.com/account/" diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 30e0a5770c..41cbc21fe9 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -696,9 +696,6 @@ bool LLAppViewer::init()  	// Let code in llui access the viewer help floater  	LLUI::sHelpImpl = LLViewerHelp::getInstance(); -	// Set the link color for any Urls in text fields -	LLTextBase::setLinkColor( LLUIColorTable::instance().getColor("HTMLLinkColor") ); -  	// Load translations for tooltips  	LLFloater::initClass(); @@ -1424,6 +1421,9 @@ bool LLAppViewer::cleanup()  		gDirUtilp->deleteFilesInDir(gDirUtilp->getExpandedFilename(LL_PATH_CACHE,""),mask);  	} +	// Turn off Space Navigator and similar devices +	LLViewerJoystick::getInstance()->terminate(); +  	removeMarkerFile(); // Any crashes from here on we'll just have to ignore  	writeDebugInfo(); @@ -2379,7 +2379,6 @@ void LLAppViewer::cleanupSavedSettings()  	}  	gSavedSettings.setF32("MapScale", gMapScale ); -	gSavedSettings.setBOOL("ShowHoverTips", gToolTipView->getVisible());  	// Some things are cached in LLAgent.  	if (gAgent.mInitialized) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1676bb1d44..92b2768f39 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -39,16 +39,22 @@  #include "lldarray.h"  #include "llnotifications.h" +#include "roles_constants.h"    // for GP_MEMBER_INVITE +  #include "llagent.h"  #include "llappviewer.h"		// for gLastVersionChannel  #include "llcachename.h"  #include "llcallingcard.h"		// for LLAvatarTracker -#include "llgivemoney.h"		// foe LLFloaterPay +#include "llfloatergroupinvite.h" +#include "llfloatergroups.h" +#include "llfloaterreg.h" +#include "llgivemoney.h"  #include "llinventorymodel.h"	// for gInventory.findCategoryUUIDForType  #include "llimview.h"			// for gIMMgr  #include "llmutelist.h"  #include "llrecentpeople.h"  #include "llsidetray.h" +#include "llviewerobjectlist.h"  #include "llviewermessage.h"	// for handle_lure  #include "llviewerregion.h" @@ -244,6 +250,17 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)  	}  } +void LLAvatarActions::inviteToGroup(const LLUUID& id) +{ +	LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(id)); +	if (widget) +	{ +		widget->center(); +		widget->setPowersMask(GP_MEMBER_INVITE); +		widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, id)); +	} +} +  //== private methods ========================================================================================  // static @@ -294,6 +311,16 @@ bool LLAvatarActions::handlePay(const LLSD& notification, const LLSD& response,  }  // static +void LLAvatarActions::callback_invite_to_group(LLUUID group_id, LLUUID id) +{ +	std::vector<LLUUID> agent_ids; +	agent_ids.push_back(id); +	 +	LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); +} + + +// static  bool LLAvatarActions::callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response)  {  	S32 option = LLNotification::getSelectedOption(notification, response); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index e911715c70..512f673b43 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -96,11 +96,17 @@ public:  	 */  	static bool isBlocked(const LLUUID& id); +	/** +	 * Invite avatar to a group. +	 */	 +	static void inviteToGroup(const LLUUID& id); +	  private:  	static bool callbackAddFriend(const LLSD& notification, const LLSD& response);  	static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);  	static bool handleRemove(const LLSD& notification, const LLSD& response);  	static bool handlePay(const LLSD& notification, const LLSD& response, LLUUID avatar_id); +	static void callback_invite_to_group(LLUUID group_id, LLUUID id);  	// Just request friendship, no dialog.  	static void requestFriendship(const LLUUID& target_id, const std::string& target_name, const std::string& message); diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 665dffc8c6..51545bcc07 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -148,7 +148,7 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id)  void LLAvatarListItem::onInfoBtnClick()  { -	LLFloaterReg::showInstance("inspect_avatar", mAvatarId); +	LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarId));  	/* TODO fix positioning of inspector  	localPointToScreen(mXPos, mYPos, &mXPos, &mYPos); diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index e568b9c526..5c68ac8cdb 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -42,12 +42,18 @@  #include "llavatarconstants.h"	// AVATAR_TRANSACTED, etc.  #include "lldate.h"  #include "lltrans.h" +#include "llui.h"				// LLUI::getLanguage()  #include "message.h"  LLAvatarPropertiesProcessor::LLAvatarPropertiesProcessor()  {  } +LLAvatarPropertiesProcessor::~LLAvatarPropertiesProcessor() +{ +	llinfos << "JAMESDEBUG cleanup avatar properties processor" << llendl; +} +  void LLAvatarPropertiesProcessor::addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer)  {  	// Check if that observer is already in mObservers for that avatar_id @@ -172,103 +178,6 @@ void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData*  	gAgent.sendReliableMessage();  } -//static -std::string LLAvatarPropertiesProcessor::ageFromDate(const std::string& date_string) -{ -	// Convert string date to malleable representation -	S32 month, day, year; -	S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &month, &day, &year); -	if (matched != 3) return "???"; - -	// Create ISO-8601 date string -	std::string iso8601_date_string = -		llformat("%04d-%02d-%02dT00:00:00Z", year, month, day); -	LLDate date(iso8601_date_string); - -	// Correct for the fact that account creation dates are in Pacific time, -	// == UTC - 8 -	F64 date_secs_since_epoch = date.secondsSinceEpoch(); -	date_secs_since_epoch += 8.0 * 60.0 * 60.0; - -	// Convert seconds from epoch to seconds from now -	F64 now_secs_since_epoch = LLDate::now().secondsSinceEpoch(); -	F64 age_secs = now_secs_since_epoch - date_secs_since_epoch; - -	// We don't care about sub-day times -	const F64 SEC_PER_DAY = 24.0 * 60.0 * 60.0; -	S32 age_days = lltrunc(age_secs / SEC_PER_DAY); - -	// Assume most values won't be used to fill in the format string: -	// "[AGEYEARS][AGEMONTHS][AGEWEEKS][AGEDAYS]old" -	LLStringUtil::format_map_t final_args; -	final_args["[AGEYEARS]"] = ""; -	final_args["[AGEMONTHS]"] = ""; -	final_args["[AGEWEEKS]"] = ""; -	final_args["[AGEDAYS]"] = ""; - -	// Try for age in round number of years -	LLStringUtil::format_map_t args; -	S32 age_years = age_days / 365; -	age_days = age_days % 365; -	if (age_years > 1) -	{ -		args["[YEARS]"] = llformat("%d", age_years); -		final_args["[AGEYEARS]"] = LLTrans::getString("AgeYears", args); -	} -	else if (age_years == 1) -	{ -		final_args["[AGEYEARS]"] = LLTrans::getString("Age1Year"); -	} -	// fall through because we show years + months for ages > 1 year - -	S32 age_months = age_days / 30; -	age_days = age_days % 30; -	if (age_months > 1) -	{ -		args["[MONTHS]"] = llformat("%d", age_months); -		final_args["[AGEMONTHS]"] = LLTrans::getString("AgeMonths", args); -		// Either N years M months, or just M months, -		// so we can exit. -		return LLTrans::getString("YearsMonthsOld", final_args); -	} -	else if (age_months == 1) -	{ -		final_args["[AGEMONTHS]"] = LLTrans::getString("Age1Month"); -		return LLTrans::getString("YearsMonthsOld", final_args); -	} - -	// Now for age in weeks -	S32 age_weeks = age_days / 7; -	age_days = age_days % 7; -	if (age_weeks > 1) -	{ -		args["[WEEKS]"] = llformat("%d", age_weeks); -		final_args["[AGEWEEKS]"] = LLTrans::getString("AgeWeeks", args); -		return LLTrans::getString("WeeksOld", final_args); -	} -	else if (age_weeks == 1) -	{ -		final_args["[AGEWEEKS]"] = LLTrans::getString("Age1Week"); -		return LLTrans::getString("WeeksOld", final_args); -	} - -	// Down to days now -	if (age_days > 1) -	{ -		args["[DAYS]"] = llformat("%d", age_days); -		final_args["[AGEDAYS]"] = LLTrans::getString("AgeDays", args); -		return LLTrans::getString("DaysOld", final_args); -	} -	else if (age_days == 1) -	{ -		final_args["[AGEDAYS]"] = LLTrans::getString("Age1Day"); -		return LLTrans::getString("DaysOld", final_args); -	} -	else -	{ -		return LLTrans::getString("TodayOld"); -	} -}  //static diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index 79d109f1db..ea80c3d4f8 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -36,6 +36,7 @@  #include "lluuid.h"  #include "llsingleton.h"  #include "v3dmath.h"	// LLVector3d +#include <list>  #include <map>  /* @@ -147,8 +148,7 @@ class LLAvatarPropertiesProcessor  public:  	LLAvatarPropertiesProcessor(); -	virtual ~LLAvatarPropertiesProcessor() -	{} +	virtual ~LLAvatarPropertiesProcessor();  	void addObserver(const LLUUID& avatar_id, LLAvatarPropertiesObserver* observer); @@ -174,11 +174,6 @@ public:  	void sendPickDelete(const LLUUID& pick_id); -	// Convert a date provided by the server (MM/DD/YYYY) into a localized, -	// human-readable age (1 year, 2 months) using translation strings from  -	// the XML file. -	static std::string ageFromDate(const std::string& date_string); -  	// Returns translated, human readable string for account type, such  	// as "Resident" or "Linden Employee".  Used for profiles, inspectors.  	static std::string accountType(const LLAvatarData* avatar_data); diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index c2d7e0d935..25620c2aed 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -236,7 +236,7 @@ BOOL	LLNearbyChatToastPanel::handleMouseDown	(S32 x, S32 y, MASK mask)  	S32 local_y = y - msg_inspector->getRect().mBottom - caption->getRect().mBottom;  	if(msg_inspector->pointInView(local_x, local_y))  	{ -		LLFloaterReg::showInstance("inspect_avatar", mFromID); +		LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mFromID));  	}  	else  	{ @@ -262,7 +262,7 @@ bool	LLNearbyChatToastPanel::canAddText	()  	LLChatMsgBox* msg_text = findChild<LLChatMsgBox>("msg_text");  	if(!msg_text)  		return false; -	return msg_text->getTextLinesNum()<10; +	return msg_text->getLineCount()<10;  }  BOOL	LLNearbyChatToastPanel::handleRightMouseDown(S32 x, S32 y, MASK mask) diff --git a/indra/newview/llchatmsgbox.cpp b/indra/newview/llchatmsgbox.cpp index bd0c36b44a..6eaafc9059 100644 --- a/indra/newview/llchatmsgbox.cpp +++ b/indra/newview/llchatmsgbox.cpp @@ -39,88 +39,60 @@  static LLDefaultChildRegistry::Register<LLChatMsgBox> r("text_chat"); -LLChatMsgBox::Params::Params() : -	block_spacing("block_spacing", 10) +class ChatSeparator : public LLTextSegment  { -	line_spacing = 4; -} +public: +	ChatSeparator(S32 start, S32 end) +	:	LLTextSegment(start, end), +		mEditor(NULL) +	{} -LLChatMsgBox::LLChatMsgBox(const Params& p) : -	LLTextBox(p), -	mBlockSpacing(p.block_spacing) -{} +	/*virtual*/ void linkToDocument(class LLTextBase* editor) +	{ +		mEditor = editor; +	} -void LLChatMsgBox::addText( const LLStringExplicit& text ) -{ -	LLWString t = mText.getWString(); -	if (! t.empty()) +	/*virtual*/ void unlinkFromDocument(class LLTextBase* editor)  	{ -		t += '\n'; +		mEditor = NULL;  	} -	t += getWrappedText(text); -	LLTextBox::setText(wstring_to_utf8str(t)); -	mSeparatorOffset.push_back(getLength()); -} -void LLChatMsgBox::setText(const LLStringExplicit& text) -{ -	mSeparatorOffset.clear(); -	mText.clear(); -	addText(text); -} +	/*virtual*/ S32 getWidth(S32 first_char, S32 num_chars) const +	{ +		return mEditor->getDocumentPanel()->getRect().getWidth(); +	} -void LLChatMsgBox::setValue(const LLSD& value ) -{  -	setText(value.asString()); -} +	/*virtual*/ F32	draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) +	{ +		gl_line_2d(draw_rect.mLeft + 5, draw_rect.getCenterY(), draw_rect.mRight - 5, draw_rect.getCenterY(), LLColor4::grey); +		return draw_rect.getWidth(); +	} + +private: +	LLTextBase* mEditor; +}; -S32 LLChatMsgBox::getTextPixelHeight() -{ -	S32 num_blocks = mSeparatorOffset.size(); -	S32 num_lines = getTextLinesNum(); -	return (S32)(num_lines * mDefaultFont->getLineHeight() + \ -				 (num_lines-1) * mLineSpacing + \ -				 (num_blocks-1) * mBlockSpacing + \ -				 2 * mLineSpacing); -} -S32 LLChatMsgBox::getTextLinesNum() +LLChatMsgBox::Params::Params() : +	block_spacing("block_spacing", 10)  { -	S32 num_lines = getLineCount(); -	if (num_lines < 1) -	{ -		num_lines = 1; -	} -	 -	return num_lines; +	line_spacing.pixels = 4;  } -void LLChatMsgBox::drawText(S32 x, S32 y, const LLWString &text, const LLColor4 &color) -{ -	S32 start = 0; -	S32 width = getRect().getWidth()-10; +LLChatMsgBox::LLChatMsgBox(const Params& p) : +	LLTextBox(p), +	mBlockSpacing(p.block_spacing) +{} -	// iterate through each block of text that has been added -	y -= mLineSpacing; -	for (std::vector<S32>::iterator it = mSeparatorOffset.begin(); it != mSeparatorOffset.end() ;) +void LLChatMsgBox::addText( const LLStringExplicit& text ) +{ +	S32 length = getLength(); +	// if there is existing text, add a separator +	if (length > 0)  	{ -		// display the text for this block -		S32 num_chars = *it - start; -		LLWString text = mDisplayText.substr(start, num_chars); -		LLTextBox::drawText(x, y, text, color); -		 -		// exit the loop if this is the last text block -		start += num_chars + 1;  // skip the newline -		if (++it == mSeparatorOffset.end()) -		{ -			break; -		} - -		// output a separator line between blocks -		S32 num_lines = std::count(text.begin(), text.end(), '\n') + 1; -		y -= num_lines * (llfloor(mDefaultFont->getLineHeight()) + mLineSpacing); -		S32 sep_y = y - mBlockSpacing/2 + mLineSpacing/2; -		gl_line_2d(5, sep_y, width, sep_y, LLColor4::grey); -		y -= mBlockSpacing; +		// chat separator exists right before the null terminator +		insertSegment(new ChatSeparator(length - 1, length - 1));  	} +	// prepend newline only if there is some existing text +	appendText(text, length > 0);  } diff --git a/indra/newview/llchatmsgbox.h b/indra/newview/llchatmsgbox.h index b81b740bdc..df29db58c3 100644 --- a/indra/newview/llchatmsgbox.h +++ b/indra/newview/llchatmsgbox.h @@ -61,18 +61,10 @@ protected:  	friend class LLUICtrlFactory;  public: -	void				setText(const LLStringExplicit &text);  	void				addText(const LLStringExplicit &text); -	S32					getTextPixelHeight(); -	S32					getTextLinesNum(); - -	/*virtual*/ void	setValue(const LLSD &value); -	/*virtual*/ void	drawText(S32 x, S32 y, const LLWString &text, const LLColor4 &color); -  private:  	S32					mBlockSpacing; -	std::vector<S32>	mSeparatorOffset;  };  #endif diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 98e492cada..23664fa6d6 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1305,7 +1305,7 @@ void LLChicletNotificationCounterCtrl::setCounter(S32 counter)  LLRect LLChicletNotificationCounterCtrl::getRequiredRect()  {  	LLRect rc; -	S32 text_width = getFont()->getWidth(getText()); +	S32 text_width = getContentsRect().getWidth();  	rc.mRight = rc.mLeft + llmax(text_width, mInitialWidth); diff --git a/indra/newview/llcolorswatch.cpp b/indra/newview/llcolorswatch.cpp index 113f4c2c54..7b75c77a1e 100644 --- a/indra/newview/llcolorswatch.cpp +++ b/indra/newview/llcolorswatch.cpp @@ -87,7 +87,7 @@ LLColorSwatchCtrl::LLColorSwatchCtrl(const Params& p)  		tp.rect(LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 ));  	} -	tp.text(p.label); +	tp.initial_value(p.label());  	mCaption = LLUICtrlFactory::create<LLTextBox>(tp);  	addChild( mCaption ); diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp new file mode 100644 index 0000000000..040fad3c4a --- /dev/null +++ b/indra/newview/lldateutil.cpp @@ -0,0 +1,140 @@ +/**  +* @file lldateutil.cpp +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +*  +* Copyright (c) 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 "lldateutil.h" + +// Linden libraries +#include "lltrans.h" +#include "llui.h" + +static S32 age_days_from_date(const std::string& date_string, +							  const LLDate& now) +{ +	// Convert string date to malleable representation +	S32 month, day, year; +	S32 matched = sscanf(date_string.c_str(), "%d/%d/%d", &month, &day, &year); +	if (matched != 3) return S32_MIN; + +	// Create ISO-8601 date string +	std::string iso8601_date_string = +		llformat("%04d-%02d-%02dT00:00:00Z", year, month, day); +	LLDate date(iso8601_date_string); + +	// Correct for the fact that account creation dates are in Pacific time, +	// == UTC - 8 +	F64 date_secs_since_epoch = date.secondsSinceEpoch(); +	date_secs_since_epoch += 8.0 * 60.0 * 60.0; + +	// Convert seconds from epoch to seconds from now +	F64 now_secs_since_epoch = now.secondsSinceEpoch(); +	F64 age_secs = now_secs_since_epoch - date_secs_since_epoch; + +	// We don't care about sub-day times +	const F64 SEC_PER_DAY = 24.0 * 60.0 * 60.0; +	S32 age_days = lltrunc(age_secs / SEC_PER_DAY); + +	return age_days; +} + +std::string LLDateUtil::ageFromDate(const std::string& date_string, +									const LLDate& now) +{ +	S32 age_days = age_days_from_date(date_string, now); +	if (age_days == S32_MIN) return "???"; + +	// Noun pluralization depends on language +	std::string lang = LLUI::getLanguage(); + +	// Try for age in round number of years +	LLStringUtil::format_map_t args; +	S32 age_years = age_days / 365; +	age_days = age_days % 365; +	// *NOTE: This is wrong.  Not all months have 30 days, but we don't have a library +	// for relative date arithmetic. :-(  JC +	S32 age_months = age_days / 30; +	age_days = age_days % 30; + +	if (age_months > 0 || age_years > 0) +	{ +		args["[AGEYEARS]"] = +			LLTrans::getCountString(lang, "AgeYears", age_years); +		args["[AGEMONTHS]"] = +			LLTrans::getCountString(lang, "AgeMonths", age_months); + +		// We want to display times like: +		// 2 year 2 months +		// 2 years (implicitly 0 months) +		// 11 months +		if (age_years > 0) +		{ +			if (age_months > 0) +			{ +				return LLTrans::getString("YearsMonthsOld", args); +			} +			else +			{ +				return LLTrans::getString("YearsOld", args); +			} +		} +		else // age_years == 0 +		{ +			return LLTrans::getString("MonthsOld", args); +		} +	} +	// you're 0 months old, display in weeks or days + +	// Now for age in weeks +	S32 age_weeks = age_days / 7; +	age_days = age_days % 7; +	if (age_weeks > 0) +	{ +		args["[AGEWEEKS]"] =  +			LLTrans::getCountString(lang, "AgeWeeks", age_weeks); +		return LLTrans::getString("WeeksOld", args); +	} + +	// Down to days now +	if (age_days > 0) +	{ +		args["[AGEDAYS]"] = +			LLTrans::getCountString(lang, "AgeDays", age_days); +		return LLTrans::getString("DaysOld", args); +	} + +	return LLTrans::getString("TodayOld"); +} + +std::string LLDateUtil::ageFromDate(const std::string& date_string) +{ +	return ageFromDate(date_string, LLDate::now()); +} diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h new file mode 100644 index 0000000000..041be07f12 --- /dev/null +++ b/indra/newview/lldateutil.h @@ -0,0 +1,49 @@ +/**  +* @file lldateutil.h +* +* $LicenseInfo:firstyear=2009&license=viewergpl$ +*  +* Copyright (c) 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 LLDATEUTIL_H +#define LLDATEUTIL_H + +class LLDate; + +namespace LLDateUtil +{ +	// Convert a date provided by the server (MM/DD/YYYY) into a localized, +	// human-readable age (1 year, 2 months) using translation strings. +	// Pass LLDate::now() for now. +	// Used for avatar inspectors and profiles. +	std::string ageFromDate(const std::string& date_string, const LLDate& now); + +	// Calls the above with LLDate::now() +	std::string ageFromDate(const std::string& date_string); +} + +#endif diff --git a/indra/newview/lldebugmessagebox.cpp b/indra/newview/lldebugmessagebox.cpp index 786473eb9b..29e375c9fa 100644 --- a/indra/newview/lldebugmessagebox.cpp +++ b/indra/newview/lldebugmessagebox.cpp @@ -131,7 +131,7 @@ LLDebugVarMessageBox::LLDebugVarMessageBox(const std::string& title, EDebugVarTy  	LLTextBox::Params params;  	params.name("value"); -	params.text(params.name); +	params.initial_value(params.name());  	params.rect(LLRect(20,20,190,0));  	mText = LLUICtrlFactory::create<LLTextBox> (params);  	addChild(mText); diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 131f9ceaf0..f8f5db9d7e 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -78,6 +78,9 @@ void LLExpandableTextBox::LLTextBoxEx::draw()  	LLUICtrl::draw();  } +/* LLTextBox has been rewritten, the variables referenced in this code +no longer exist. +  void LLExpandableTextBox::LLTextBoxEx::drawText( S32 x, S32 y, const LLWString &text, const LLColor4& color )  {  	// *NOTE:dzaporozhan: @@ -141,6 +144,7 @@ void LLExpandableTextBox::LLTextBoxEx::drawText( S32 x, S32 y, const LLWString &  		}  	}  } +*/  void LLExpandableTextBox::LLTextBoxEx::showExpandText(S32 y)  { @@ -161,8 +165,14 @@ S32 LLExpandableTextBox::LLTextBoxEx::getCropTextWidth()  	return mExpandTextBox->getRect().mLeft - getHPad() * 2;   } +/* +// *NOTE:James: +// LLTextBox::drawText() has been completely rewritten, as it now handles +// arbitrarily styled segments of text.  This needs to be rebuilt. +  void LLExpandableTextBox::LLTextBoxEx::drawTextSegments(S32 init_x, S32 init_y, const LLWString &text)  { +  	// *NOTE:dzaporozhan:  	// Copy/paste from LLTextBox::drawTextSegments in order to modify last   	// line width if needed and who "More" link @@ -270,6 +280,7 @@ void LLExpandableTextBox::LLTextBoxEx::drawTextSegments(S32 init_x, S32 init_y,  		}  	}  } +*/  S32 LLExpandableTextBox::LLTextBoxEx::getVerticalTextDelta()  { @@ -422,8 +433,11 @@ void LLExpandableTextBox::expandTextBox()  		// disable horizontal scrollbar  		text_box_rect.mRight -= scrollbar_size; +  		// text box size has changed - redo text wrap -		mTextBox->setWrappedText(mText, text_box_rect.getWidth()); +		// Should be handled automatically in reshape() below. JC +		//mTextBox->setWrappedText(mText, text_box_rect.getWidth()); +  		// recalculate text delta since text wrap changed text height  		text_delta = mTextBox->getVerticalTextDelta() + mTextBox->getVPad() * 2;  	} @@ -460,7 +474,8 @@ void LLExpandableTextBox::collapseTextBox()  	updateTextBoxRect(); -	mTextBox->setWrappedText(mText); +	// Should be handled automatically in reshape above. JC +	//mTextBox->setWrappedText(mText);  	if(gFocusMgr.getTopCtrl() == this)  	{  		gFocusMgr.setTopCtrl(NULL); diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index 0a5a4c8b75..0b9c3f7258 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -64,17 +64,17 @@ protected:  		 */  		/*virtual*/ void draw(); -		/** -		 * Draws simple text(no urls) line by line, will show or hide "More" link -		 * if needed. -		 */ -		/*virtual*/ void drawText( S32 x, S32 y, const LLWString &text, const LLColor4& color ); - -		/** -		 * Draws segmented text(with urls) line by line. Will show or hide "More" link  -		 * if needed -		 */ -		void drawTextSegments(S32 x, S32 y, const LLWString &text); +//		/** +//		 * Draws simple text(no urls) line by line, will show or hide "More" link +//		 * if needed. +//		 */ +//		/*virtual*/ void drawText( S32 x, S32 y, const LLWString &text, const LLColor4& color ); +// +//		/** +//		 * Draws segmented text(with urls) line by line. Will show or hide "More" link  +//		 * if needed +//		 */ +//		void drawTextSegments(S32 x, S32 y, const LLWString &text);  		/**  		 * Returns difference between text box height and text height. diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 8af3a8b539..0bd4389b50 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -244,7 +244,7 @@ BOOL LLFastTimerView::handleHover(S32 x, S32 y, MASK mask)  } -BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) +BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, MASK mask)  {  	if(LLFastTimer::sPauseHistory && mBarRect.pointInRect(x, y))  	{ @@ -254,7 +254,7 @@ BOOL LLFastTimerView::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& stic  			LLRect screen_rect;  			localRectToScreen(mToolTipRect, &screen_rect); -			LLToolTipMgr::instance().show(LLToolTipParams() +			LLToolTipMgr::instance().show(LLToolTip::Params()  				.message(mHoverTimer->getToolTip(LLFastTimer::NamedTimer::HISTORY_NUM - mScrollIndex - mHoverBarIndex))  				.sticky_rect(screen_rect)); diff --git a/indra/newview/llfasttimerview.h b/indra/newview/llfasttimerview.h index 97e4e94460..2bb023ab14 100644 --- a/indra/newview/llfasttimerview.h +++ b/indra/newview/llfasttimerview.h @@ -57,7 +57,7 @@ public:  	virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);  	virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);  	virtual BOOL handleHover(S32 x, S32 y, MASK mask); -	virtual BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); +	virtual BOOL handleToolTip(S32 x, S32 y, MASK mask);  	virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks);  	virtual void draw(); diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index ea947a5565..48fcb6b6de 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -123,7 +123,7 @@ class LLFavoriteLandmarkButton : public LLButton  {  public: -	BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect) +	BOOL handleToolTip(S32 x, S32 y, MASK mask)  	{  		LLToolTipMgr::instance().show(mUrlGetter.getSLURL());  		return TRUE; @@ -201,7 +201,7 @@ private:  class LLFavoriteLandmarkMenuItem : public LLMenuItemCallGL  {  public: -	BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect) +	BOOL handleToolTip(S32 x, S32 y, MASK mask)  	{  		LLToolTipMgr::instance().show(mUrlGetter.getSLURL());  		return TRUE; diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index e28d223a10..a4c38d03aa 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -115,9 +115,6 @@ BOOL LLFloaterAbout::postBuild()  	getChild<LLUICtrl>("copy_btn")->setCommitCallback(  		boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this)); -	// make sure that we handle hyperlinks in the About text -	support_widget->setParseHTML(TRUE); -  	// Version string  	std::string version = LLTrans::getString("APP_NAME")  		+ llformat(" %d.%d.%d (%d) %s %s (%s)\n", @@ -241,7 +238,11 @@ BOOL LLFloaterAbout::postBuild()  		support.append(getString ("PacketsLost", args) + "\n");  	} -	support_widget->appendColoredText(support, FALSE, FALSE, LLUIColorTable::instance().getColor("TextFgReadOnlyColor")); +	support_widget->appendText(support,  +								FALSE,  +								LLStyle::Params() +									.color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor"))); +	support_widget->blockUndo();  	// Fix views  	support_widget->setCursorPos(0); diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index a7aaf71ef6..473d5ce827 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -73,6 +73,8 @@ BOOL LLFloaterBuy::postBuild()  	// This also avoids problems where the user resizes the application window  	// mid-session and the saved rect is off-center.  	center(); + +	mCloseSignal.connect(boost::bind(&LLFloaterBuy::onClose, this));  	return TRUE;  } @@ -307,3 +309,8 @@ void LLFloaterBuy::onClickCancel()  {  	closeFloater();  } + +void LLFloaterBuy::onClose() +{ +	mObjectSelection.clear(); +} diff --git a/indra/newview/llfloaterbuy.h b/indra/newview/llfloaterbuy.h index ee54303267..2ec66136b2 100644 --- a/indra/newview/llfloaterbuy.h +++ b/indra/newview/llfloaterbuy.h @@ -70,6 +70,7 @@ protected:  	void onClickBuy();  	void onClickCancel(); +	void onClose();  private:  	LLSafeHandle<LLObjectSelection>	mObjectSelection; diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 7075719299..2c2a5107f5 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -50,6 +50,7 @@  #include "lllineeditor.h"  #include "llnotify.h"  #include "llparcel.h" +#include "llslurl.h"  #include "llstatusbar.h"  #include "lltextbox.h"  #include "lltexturectrl.h" @@ -71,7 +72,7 @@  const F32 GROUP_LAND_BONUS_FACTOR = 1.1f;  const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5;  	// how long of a pause in typing a currency buy amount before an -	// esimate is fetched from the server +	// estimate is fetched from the server  class LLFloaterBuyLandUI  :	public LLFloater @@ -177,6 +178,11 @@ public:  	void sendBuyLand();  	void updateNames(); +	// Name cache callback +	void updateGroupName(const LLUUID& id, +						 const std::string& first_name, +						 const std::string& last_name, +						 BOOL is_group);  	void refreshUI(); @@ -201,16 +207,6 @@ public:  }; -static void cacheNameUpdateRefreshesBuyLand(const LLUUID&, -	const std::string&, const std::string&, BOOL) -{ -	LLFloaterBuyLandUI* ui = LLFloaterReg::findTypedInstance<LLFloaterBuyLandUI>("buy_land"); -	if (ui) -	{ -		ui->updateNames(); -	} -} -  // static  void LLFloaterBuyLand::buyLand(  	LLViewerRegion* region, LLParcelSelectionHandle parcel, bool is_for_group) @@ -296,13 +292,6 @@ LLFloaterBuyLandUI::LLFloaterBuyLandUI(const LLSD& key)  	mChildren(*this), mCurrency(*this), mTransaction(0),  	mParcelBuyInfo(0)  { -	static bool observingCacheName = false; -	if (!observingCacheName) -	{ -		gCacheName->addObserver(&cacheNameUpdateRefreshesBuyLand); -		observingCacheName = true; -	} -	  	LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver);  // 	LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_buy_land.xml"); @@ -788,14 +777,30 @@ void LLFloaterBuyLandUI::updateNames()  	}  	else if (parcelp->getIsGroupOwned())  	{ -		gCacheName->getGroupName(parcelp->getGroupID(), mParcelSellerName); +		gCacheName->get(parcelp->getGroupID(), TRUE, +			boost::bind(&LLFloaterBuyLandUI::updateGroupName, this, +				_1, _2, _3, _4));  	}  	else  	{ -		gCacheName->getFullName(parcelp->getOwnerID(), mParcelSellerName); +		mParcelSellerName = +			LLSLURL::buildCommand("agent", parcelp->getOwnerID(), "inspect");  	}  } +void LLFloaterBuyLandUI::updateGroupName(const LLUUID& id, +						 const std::string& first_name, +						 const std::string& last_name, +						 BOOL is_group) +{ +	LLParcel* parcelp = mParcel->getParcel(); +	if (parcelp +		&& parcelp->getGroupID() == id) +	{ +		// request is current +		mParcelSellerName = first_name; +	} +}  void LLFloaterBuyLandUI::startTransaction(TransactionType type, const LLXMLRPCValue& params)  { @@ -1036,9 +1041,7 @@ void LLFloaterBuyLandUI::refreshUI()  		if (message)  		{  			message->setVisible(true); -			message->setWrappedText( -				!mCanBuy ? mCannotBuyReason : "(waiting for data)" -				); +			message->setValue(LLSD(!mCanBuy ? mCannotBuyReason : "(waiting for data)"));  		}  		childSetVisible("error_web",  @@ -1148,7 +1151,7 @@ void LLFloaterBuyLandUI::refreshUI()  			}  		} -		childSetWrappedText("land_use_reason", message); +		childSetValue("land_use_reason", message);  		childShow("step_2");  		childShow("land_use_action"); diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index ca43f41d05..6d2e959352 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -56,6 +56,7 @@  #include "llchatbar.h"  #include "llrecentpeople.h"  #include "llpanelblockedlist.h" +#include "llslurl.h"  #include "llstatusbar.h"  #include "llviewertexteditor.h"  #include "llviewergesture.h"			// for triggering gestures @@ -162,7 +163,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&  	if (chat.mSourceType == CHAT_SOURCE_AGENT &&  		chat.mFromID != LLUUID::null)  	{ -		chat.mURL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); +		chat.mURL = LLSLURL::buildCommand("agent", chat.mFromID, "inspect");  	}  	// If the chat line has an associated url, link it up to the name. @@ -171,10 +172,12 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4&  	{  		std::string start_line = line.substr(0, chat.mFromName.length() + 1);  		line = line.substr(chat.mFromName.length() + 1); -		edit->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL)); +		edit->appendText(start_line, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL)); +		edit->blockUndo();  		prepend_newline = false;  	} -	edit->appendColoredText(line, false, prepend_newline, color); +	edit->appendText(line, prepend_newline, LLStyle::Params().color(color)); +	edit->blockUndo();  }  void log_chat_text(const LLChat& chat) @@ -216,12 +219,6 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)  	LLViewerTextEditor*	history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");  	LLViewerTextEditor*	history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute"); -	history_editor->setParseHTML(TRUE); -	history_editor_with_mute->setParseHTML(TRUE); -	 -	history_editor->setParseHighlights(TRUE); -	history_editor_with_mute->setParseHighlights(TRUE); -	  	if (!chat.mMuted)  	{  		add_timestamped_line(history_editor, chat, color); diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index 0c77d88efb..2c66ab502d 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -237,7 +237,7 @@ BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)  	LLSD& friend_column = element["columns"][LIST_FRIEND_NAME];  	friend_column["column"] = "friend_name";  	friend_column["value"] = fullname; -	friend_column["font"] = "SANSSERIF"; +	friend_column["font"]["name"] = "SANSSERIF";  	friend_column["font"]["style"] = "NORMAL";	  	LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS]; @@ -614,7 +614,7 @@ void LLPanelFriends::onClickPay(void* user_data)  	std::vector<LLUUID> ids = panelp->getSelectedIDs();  	if(ids.size() == 1)  	{	 -		handle_pay_by_id(ids[0]); +		LLAvatarActions::pay(ids[0]);  	}  } diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 431bc09d86..e0fe87f9ae 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -205,7 +205,7 @@ void LLFloaterGesture::buildGestureList()  			element["columns"][0]["column"] = "trigger";  			element["columns"][0]["value"] = gesture->mTrigger; -			element["columns"][0]["font"] = "SANSSERIF"; +			element["columns"][0]["font"]["name"] = "SANSSERIF";  			element["columns"][0]["font"]["style"] = font_style;  			std::string key_string = LLKeyboard::stringFromKey(gesture->mKey); @@ -232,13 +232,13 @@ void LLFloaterGesture::buildGestureList()  			}  			element["columns"][1]["column"] = "shortcut";  			element["columns"][1]["value"] = buffer; -			element["columns"][1]["font"] = "SANSSERIF"; +			element["columns"][1]["font"]["name"] = "SANSSERIF";  			element["columns"][1]["font"]["style"] = font_style;  			// hidden column for sorting  			element["columns"][2]["column"] = "key";  			element["columns"][2]["value"] = key_string; -			element["columns"][2]["font"] = "SANSSERIF"; +			element["columns"][2]["font"]["name"] = "SANSSERIF";  			element["columns"][2]["font"]["style"] = font_style;  			// Only add "playing" if we've got the name, less confusing. JC @@ -248,26 +248,26 @@ void LLFloaterGesture::buildGestureList()  			}  			element["columns"][3]["column"] = "name";  			element["columns"][3]["value"] = item_name; -			element["columns"][3]["font"] = "SANSSERIF"; +			element["columns"][3]["font"]["name"] = "SANSSERIF";  			element["columns"][3]["font"]["style"] = font_style;  		}  		else  		{  			element["columns"][0]["column"] = "trigger";  			element["columns"][0]["value"] = ""; -			element["columns"][0]["font"] = "SANSSERIF"; +			element["columns"][0]["font"]["name"] = "SANSSERIF";  			element["columns"][0]["font"]["style"] = font_style;  			element["columns"][0]["column"] = "trigger";  			element["columns"][0]["value"] = "---"; -			element["columns"][0]["font"] = "SANSSERIF"; +			element["columns"][0]["font"]["name"] = "SANSSERIF";  			element["columns"][0]["font"]["style"] = font_style;  			element["columns"][2]["column"] = "key";  			element["columns"][2]["value"] = "~~~"; -			element["columns"][2]["font"] = "SANSSERIF"; +			element["columns"][2]["font"]["name"] = "SANSSERIF";  			element["columns"][2]["font"]["style"] = font_style;  			element["columns"][3]["column"] = "name";  			element["columns"][3]["value"] = item_name; -			element["columns"][3]["font"] = "SANSSERIF"; +			element["columns"][3]["font"]["name"] = "SANSSERIF";  			element["columns"][3]["font"]["style"] = font_style;  		}  		list->addElement(element, ADD_BOTTOM); diff --git a/indra/newview/llfloatergroups.cpp b/indra/newview/llfloatergroups.cpp index b1f40d9d1d..3648898f28 100644 --- a/indra/newview/llfloatergroups.cpp +++ b/indra/newview/llfloatergroups.cpp @@ -372,7 +372,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow  			element["id"] = id;  			element["columns"][0]["column"] = "name";  			element["columns"][0]["value"] = group_datap->mName; -			element["columns"][0]["font"] = "SANSSERIF"; +			element["columns"][0]["font"]["name"] = "SANSSERIF";  			element["columns"][0]["font"]["style"] = style;  			group_list->addElement(element, ADD_SORTED); @@ -390,7 +390,7 @@ void init_group_list(LLScrollListCtrl* ctrl, const LLUUID& highlight_id, U64 pow  		element["id"] = LLUUID::null;  		element["columns"][0]["column"] = "name";  		element["columns"][0]["value"] = LLTrans::getString("GroupsNone"); -		element["columns"][0]["font"] = "SANSSERIF"; +		element["columns"][0]["font"]["name"] = "SANSSERIF";  		element["columns"][0]["font"]["style"] = style;  		group_list->addElement(element, ADD_TOP); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 3fe7d8d9da..a378a511b5 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -62,6 +62,7 @@  #include "llscrolllistitem.h"  #include "llscrolllistcell.h"  #include "llselectmgr.h" +#include "llslurl.h"  #include "llspinctrl.h"  #include "lltabcontainer.h"  #include "lltextbox.h" @@ -754,7 +755,7 @@ void LLPanelLandGeneral::refreshNames()  	else  	{  		// Figure out the owner's name -		gCacheName->getFullName(parcel->getOwnerID(), owner); +		owner = LLSLURL::buildCommand("agent", parcel->getOwnerID(), "inspect");  	}  	if(LLParcel::OS_LEASE_PENDING == parcel->getOwnershipStatus()) @@ -763,18 +764,11 @@ void LLPanelLandGeneral::refreshNames()  	}  	mTextOwner->setText(owner); -	std::string group; -	if(!parcel->getGroupID().isNull()) -	{ -		gCacheName->getGroupName(parcel->getGroupID(), group); -	} -	mTextGroup->setText(group); -  	const LLUUID& auth_buyer_id = parcel->getAuthorizedBuyerID();  	if(auth_buyer_id.notNull())  	{  		std::string name; -		gCacheName->getFullName(auth_buyer_id, name); +		name = LLSLURL::buildCommand("agent", auth_buyer_id, "inspect");  		mSaleInfoForSale2->setTextArg("[BUYER]", name);  	}  	else @@ -787,7 +781,20 @@ void LLPanelLandGeneral::refreshNames()  // virtual  void LLPanelLandGeneral::draw()  { -	refreshNames(); +	LLParcel *parcel = mParcel->getParcel(); +	if (parcel) +	{ +		std::string group; +		if (!parcel->getGroupID().isNull()) +		{ +			// *TODO: Change to "inspect" when we have group inspectors and +			// move into refreshNames() above +			// group = LLSLURL::buildCommand("group", parcel->getGroupID(), "inspect"); +			gCacheName->getGroupName(parcel->getGroupID(), group); +		} +		mTextGroup->setText(group); +	} +  	LLPanel::draw();  } diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 10276ba36d..0330a8c692 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -37,7 +37,6 @@  #include <algorithm>  #include <functional> -#include "llcachename.h"  #include "lldir.h"  #include "lldispatcher.h"  #include "llglheaders.h" @@ -67,6 +66,7 @@  #include "llnamelistctrl.h"  #include "llscrolllistitem.h"  #include "llsliderctrl.h" +#include "llslurl.h"  #include "llspinctrl.h"  #include "lltabcontainer.h"  #include "lltextbox.h" @@ -2560,30 +2560,6 @@ void LLPanelEstateInfo::setAccessAllowedEnabled(bool enable_agent,  	}  } -// static -void LLPanelEstateInfo::callbackCacheName( -	const LLUUID& id, -	const std::string& first, -	const std::string& last, -	BOOL is_group) -{ -	LLPanelEstateInfo* self = LLFloaterRegionInfo::getPanelEstate(); -	if (!self) return; - -	std::string name; -	 -	if (id.isNull()) -	{ -		name = "(none)"; -	} -	else -	{ -		name = first + " " + last; -	} - -	self->setOwnerName(name); -} -  void LLPanelEstateInfo::clearAccessLists()   {  	LLNameListCtrl* name_list = getChild<LLNameListCtrl>("allowed_avatar_name_list"); @@ -2960,7 +2936,7 @@ BOOL LLPanelEstateCovenant::sendUpdate()  	return TRUE;  } -const std::string& LLPanelEstateCovenant::getEstateName() const +std::string LLPanelEstateCovenant::getEstateName() const  {  	return mEstateNameText->getText();  } @@ -3011,7 +2987,7 @@ void LLPanelEstateCovenant::updateEstateOwnerName(const std::string& name)  	}  } -const std::string& LLPanelEstateCovenant::getOwnerName() const +std::string LLPanelEstateCovenant::getOwnerName() const  {  	return mEstateOwnerText->getText();  } @@ -3069,8 +3045,9 @@ bool LLDispatchEstateUpdateInfo::operator()(  	LLUUID owner_id(strings[1]);  	regionp->setOwner(owner_id);  	// Update estate owner name in UI -	const BOOL is_group = FALSE; -	gCacheName->get(owner_id, is_group, &LLPanelEstateInfo::callbackCacheName); +	std::string owner_name = +		LLSLURL::buildCommand("agent", owner_id, "inspect"); +	panel->setOwnerName(owner_name);  	U32 estate_id = strtoul(strings[2].c_str(), NULL, 10);  	panel->setEstateID(estate_id); diff --git a/indra/newview/llfloaterregioninfo.h b/indra/newview/llfloaterregioninfo.h index be4becf7e7..68ed4e0c89 100644 --- a/indra/newview/llfloaterregioninfo.h +++ b/indra/newview/llfloaterregioninfo.h @@ -338,14 +338,6 @@ public:  	// are ignored, so must disable UI.  	void setAccessAllowedEnabled(bool enable_agent, bool enable_group, bool enable_ban); -	// this must have the same function signature as -	// llmessage/llcachename.h:LLCacheNameCallback -	static void callbackCacheName( -		const LLUUID& id, -		const std::string& first, -		const std::string& last, -		BOOL is_group); -  protected:  	virtual BOOL sendUpdate();  	// confirmation dialog callback @@ -400,9 +392,9 @@ public:  	const LLUUID& getCovenantID() const { return mCovenantID; }  	void setCovenantID(const LLUUID& id) { mCovenantID = id; } -	const std::string& getEstateName() const; +	std::string getEstateName() const;  	void setEstateName(const std::string& name); -	const std::string& getOwnerName() const; +	std::string getOwnerName() const;  	void setOwnerName(const std::string& name);  	void setCovenantTextEditor(const std::string& text); diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 3dcdc2f56e..1ec869da73 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -32,14 +32,13 @@  #include "llviewerprecompiledheaders.h" -#include <sstream> -  // self include  #include "llfloaterreporter.h" +#include <sstream> +  // linden library includes  #include "llassetstorage.h" -#include "llcachename.h"  #include "llfontgl.h"  #include "llgl.h"			// for renderer  #include "llinventory.h" @@ -48,18 +47,14 @@  #include "llversionviewer.h"  #include "message.h"  #include "v3math.h" -#include "lltexteditor.h"  // viewer project includes  #include "llagent.h"  #include "llbutton.h" -#include "llcheckboxctrl.h"  #include "llfloaterreg.h" -#include "lllineeditor.h"  #include "lltexturectrl.h"  #include "llscrolllistctrl.h"  #include "llimview.h" -#include "lltextbox.h"  #include "lldispatcher.h"  #include "llviewerobject.h"  #include "llviewerregion.h" @@ -72,6 +67,7 @@  #include "lltoolobjpicker.h"  #include "lltoolmgr.h"  #include "llresourcedata.h"		// for LLResourceData +#include "llslurl.h"  #include "llviewerwindow.h"  #include "llviewertexturelist.h"  #include "llworldmap.h" @@ -103,6 +99,7 @@ LLFloaterReporter::LLFloaterReporter(const LLSD& key)  	mObjectID(),  	mScreenID(),  	mAbuserID(), +	mOwnerName(),  	mDeselectOnClose( FALSE ),  	mPicking( FALSE),   	mPosition(), @@ -158,6 +155,7 @@ BOOL LLFloaterReporter::postBuild()  	// Default text to be blank  	childSetText("object_name", LLStringUtil::null);  	childSetText("owner_name", LLStringUtil::null); +	mOwnerName = LLStringUtil::null;  	childSetFocus("summary_edit"); @@ -174,8 +172,8 @@ BOOL LLFloaterReporter::postBuild()  	// abuser name is selected from a list -	LLLineEditor* le = getChild<LLLineEditor>("abuser_name_edit"); -	le->setEnabled( FALSE ); +	LLUICtrl* le = getChild<LLUICtrl>("abuser_name_edit"); +	le->setEnabled( false );  	setPosBox((LLVector3d)mPosition.getValue());  	LLButton* pick_btn = getChild<LLButton>("pick_btn"); @@ -299,9 +297,12 @@ void LLFloaterReporter::getObjectInfo(const LLUUID& object_id)  					object_owner.append("Unknown");  				}  				childSetText("object_name", object_owner); -				childSetText("owner_name", object_owner); +				std::string owner_link = +					LLSLURL::buildCommand("agent", mObjectID, "inspect"); +				childSetText("owner_name", owner_link);  				childSetText("abuser_name_edit", object_owner);  				mAbuserID = object_id; +				mOwnerName = object_owner;  			}  			else  			{ @@ -445,6 +446,7 @@ void LLFloaterReporter::onClickObjPicker(void *userdata)  	self->mPicking = TRUE;  	self->childSetText("object_name", LLStringUtil::null);  	self->childSetText("owner_name", LLStringUtil::null); +	self->mOwnerName = LLStringUtil::null;  	LLButton* pick_btn = self->getChild<LLButton>("pick_btn");  	if (pick_btn) pick_btn->setToggleState(TRUE);  } @@ -505,9 +507,12 @@ void LLFloaterReporter::showFromObject(const LLUUID& object_id)  void LLFloaterReporter::setPickedObjectProperties(const std::string& object_name, const std::string& owner_name, const LLUUID owner_id)  {  	childSetText("object_name", object_name); -	childSetText("owner_name", owner_name); +	std::string owner_link = +		LLSLURL::buildCommand("agent", owner_id, "inspect"); +	childSetText("owner_name", owner_link);  	childSetText("abuser_name_edit", owner_name);  	mAbuserID = owner_id; +	mOwnerName = owner_name;  } @@ -608,11 +613,10 @@ LLSD LLFloaterReporter::gatherReport()  		<< LL_VIEWER_BUILD << std::endl << std::endl;  	std::string object_name = childGetText("object_name"); -	std::string owner_name = childGetText("owner_name"); -	if (!object_name.empty() && !owner_name.empty()) +	if (!object_name.empty() && !mOwnerName.empty())  	{  		details << "Object: " << object_name << "\n"; -		details << "Owner: " << owner_name << "\n"; +		details << "Owner: " << mOwnerName << "\n";  	} diff --git a/indra/newview/llfloaterreporter.h b/indra/newview/llfloaterreporter.h index 7e8f05e3fc..917f513641 100644 --- a/indra/newview/llfloaterreporter.h +++ b/indra/newview/llfloaterreporter.h @@ -128,6 +128,8 @@ private:  	LLUUID 			mObjectID;  	LLUUID			mScreenID;  	LLUUID			mAbuserID; +	// Store the real name, not the link, for upstream reporting +	std::string		mOwnerName;  	BOOL			mDeselectOnClose;  	BOOL 			mPicking;  	LLVector3		mPosition; diff --git a/indra/newview/llfloaterscriptdebug.cpp b/indra/newview/llfloaterscriptdebug.cpp index 328fb6450e..3bf1848efb 100644 --- a/indra/newview/llfloaterscriptdebug.cpp +++ b/indra/newview/llfloaterscriptdebug.cpp @@ -167,6 +167,7 @@ void LLFloaterScriptDebugOutput::addLine(const std::string &utf8mesg, const std:  		setShortTitle(user_name);  	} -	mHistoryEditor->appendColoredText(utf8mesg, false, true, color); +	mHistoryEditor->appendText(utf8mesg, true, LLStyle::Params().color(color)); +	mHistoryEditor->blockUndo();  } diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index fe98c84301..9e203c4269 100644 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -131,7 +131,6 @@ LLFloaterSellLandUI::LLFloaterSellLandUI(const LLSD& key)  	mRegion(0)  {  	LLViewerParcelMgr::getInstance()->addObserver(&mParcelSelectionObserver); -// 	LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_sell_land.xml");  	mCloseSignal.connect(boost::bind(&LLFloaterSellLandUI::onClose, this));  } @@ -153,7 +152,7 @@ void LLFloaterSellLandUI::SelectionObserver::changed()  	{  		mFloater->closeFloater();  	} -	else +	else if (mFloater->getVisible()) // only update selection if sell land ui in use  	{  		mFloater->setParcel(LLViewerParcelMgr::getInstance()->getSelectionRegion(),  							LLViewerParcelMgr::getInstance()->getParcelSelection()); @@ -176,7 +175,7 @@ BOOL LLFloaterSellLandUI::postBuild()  bool LLFloaterSellLandUI::setParcel(LLViewerRegion* region, LLParcelSelectionHandle parcel)  { -	if (!parcel->getParcel()) // || !can_agent_modify_parcel(parcel)) // can_agent_modify_parcel was deprecated by GROUPS +	if (!parcel->getParcel())  	{  		return false;  	} diff --git a/indra/newview/llfloatertestinspectors.cpp b/indra/newview/llfloatertestinspectors.cpp index c56586cb95..8af011c17a 100644 --- a/indra/newview/llfloatertestinspectors.cpp +++ b/indra/newview/llfloatertestinspectors.cpp @@ -44,6 +44,8 @@ LLFloaterTestInspectors::LLFloaterTestInspectors(const LLSD& seed)  {  	mCommitCallbackRegistrar.add("ShowAvatarInspector",  		boost::bind(&LLFloaterTestInspectors::showAvatarInspector, this, _1, _2)); +	mCommitCallbackRegistrar.add("ShowObjectInspector", +		boost::bind(&LLFloaterTestInspectors::showObjectInspector, this, _1, _2));  }  LLFloaterTestInspectors::~LLFloaterTestInspectors() @@ -77,7 +79,12 @@ void LLFloaterTestInspectors::showAvatarInspector(LLUICtrl*, const LLSD& avatar_  		id = avatar_id.asUUID();  	}  	// spawns off mouse position automatically -	LLFloaterReg::showInstance("inspect_avatar", id); +	LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", id)); +} + +void LLFloaterTestInspectors::showObjectInspector(LLUICtrl*, const LLSD& object_id) +{ +	LLFloaterReg::showInstance("inspect_object", LLSD().insert("object_id", object_id));  }  void LLFloaterTestInspectors::onClickAvatar2D() diff --git a/indra/newview/llfloatertestinspectors.h b/indra/newview/llfloatertestinspectors.h index d2dc2248bb..6555aad4e8 100644 --- a/indra/newview/llfloatertestinspectors.h +++ b/indra/newview/llfloatertestinspectors.h @@ -50,6 +50,7 @@ private:  	// Button callback to show  	void showAvatarInspector(LLUICtrl*, const LLSD& avatar_id); +	void showObjectInspector(LLUICtrl*, const LLSD& avatar_id);  	// Debug function hookups for buttons  	void onClickAvatar2D(); diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 7dc29379e4..c08996cc26 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -36,7 +36,7 @@  #include "llfontgl.h"  #include "llcoord.h" -#include "llgl.h" +//#include "llgl.h"  #include "llagent.h"  #include "llbutton.h" diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 2eb4e7580e..266252efea 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -500,6 +500,14 @@ void LLFloaterUIPreview::refreshList()  		}  	}  	found = TRUE; +	while(found)				// for every inspector file that matches the pattern +	{ +		if((found = gDirUtilp->getNextFileInDir(getLocalizedDirectory(), "inspect_*.xml", name, FALSE)))	// get next file matching pattern +		{ +			addFloaterEntry(name.c_str());	// and add it to the list (file name only; localization code takes care of rest of path) +		} +	} +	found = TRUE;  	while(found)				// for every menu file that matches the pattern  	{  		if((found = gDirUtilp->getNextFileInDir(getLocalizedDirectory(), "menu_*.xml", name, FALSE)))	// get next file matching pattern @@ -596,20 +604,12 @@ void LLFloaterUIPreview::addFloaterEntry(const std::string& path)  void LLFloaterUIPreview::onClickDisplayFloater(S32 caller_id)  {  	displayFloater(TRUE, caller_id); -	if(caller_id == PRIMARY_FLOATER) -	{ -		mDisplayedFloater->center();	// move displayed floater to the center of the screen -	}  }  // Saves the current floater/panel  void LLFloaterUIPreview::onClickSaveFloater(S32 caller_id)  {  	displayFloater(TRUE, caller_id, true); -	if(caller_id == PRIMARY_FLOATER) -	{ -		mDisplayedFloater->center();	// move displayed floater to the center of the screen -	}  }  // Saves all floater/panels @@ -672,7 +672,8 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)  	*floaterp = new LLPreviewedFloater(this); -	if(!strncmp(path.c_str(),"floater_",8))								// if it's a floater +	if(!strncmp(path.c_str(),"floater_",8) +		|| !strncmp(path.c_str(), "inspect_", 8))		// if it's a floater  	{  		if (save)  		{ @@ -774,13 +775,6 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)  		mCloseOtherButton_2->setEnabled(TRUE);  	} -	// *TODO: Make the secondary floater pop up next to the primary one.  Doesn't seem to always work if secondary was up first... -	if((mDisplayedFloater && ID == 2) || (mDisplayedFloater_2 && ID == 1)) -	{ -		mDisplayedFloater_2->setSnapTarget(mDisplayedFloater->getHandle()); -		mDisplayedFloater->addDependentFloater(mDisplayedFloater_2); -	} -  	// Add localization to title so user knows whether it's localized or defaulted to en  	std::string full_path = getLocalizedDirectory() + path;  	std::string floater_lang = "EN"; @@ -793,6 +787,9 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)  						(ID == 1 ? " - Primary" : " - Secondary") + std::string("]");  	(*floaterp)->setTitle(new_title); +	(*floaterp)->center(); +	addDependentFloater(*floaterp); +  	if(click && ID == 1 && !save)  	{  		// set up live file to track it diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 490929e5a6..ef54ee7d4a 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -563,7 +563,7 @@ const std::string& LLFolderViewItem::getSearchableLabel() const  	return mSearchableLabel;  } -const std::string& LLFolderViewItem::getName( void ) const +std::string LLFolderViewItem::getName( void ) const  {  	if(mListener)  	{ @@ -947,18 +947,6 @@ void LLFolderViewItem::draw()  			}  		}  	} - -	if( sDebugRects ) -	{ -		drawDebugRect(); -	} - -	//// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) -	//std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); -	//if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) -	//{ -	//	drawDebugRect(); -	//}  } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index eec885fd29..32134670c8 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -255,7 +255,7 @@ public:  	// This method returns the actual name of the thing being  	// viewed. This method will ask the viewed object itself. -	const std::string& getName( void ) const; +	std::string getName( void ) const;  	const std::string& getSearchableLabel( void ) const; diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 905857f393..4caef8e000 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -301,13 +301,22 @@ void LLGroupListItem::setGroupIconVisible(bool visible)  void LLGroupListItem::setActive(bool active)  {  	// Active group should be bold. -	LLFontDescriptor new_desc(mGroupNameBox->getFont()->getFontDesc()); +	LLFontDescriptor new_desc(mGroupNameBox->getDefaultFont()->getFontDesc());  	// *NOTE dzaporozhan  	// On Windows LLFontGL::NORMAL will not remove LLFontGL::BOLD if font   	// is predefined as bold (SansSerifSmallBold, for example)  	new_desc.setStyle(active ? LLFontGL::BOLD : LLFontGL::NORMAL); -	mGroupNameBox->setFont(LLFontGL::getFont(new_desc)); +	LLFontGL* new_font = LLFontGL::getFont(new_desc); +	LLStyle::Params style_params; +	style_params.font = new_font; + +	// *NOTE: You cannot set the style on a text box anymore, you must +	// rebuild the text.  This will cause problems if the text contains +	// hyperlinks, as their styles will be wrong. +	std::string text = mGroupNameBox->getText(); +	mGroupNameBox->clear(); +	mGroupNameBox->appendText(text, false, style_params);  }  void LLGroupListItem::onInfoBtnClick() diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index d0be581f6d..dde36ac25b 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -200,7 +200,6 @@ BOOL LLIMFloater::postBuild()  	childSetCommitCallback("chat_editor", onSendMsg, this);  	mHistoryEditor = getChild<LLViewerTextEditor>("im_text"); -	mHistoryEditor->setParseHTML(TRUE);  	setTitle(LLIMModel::instance().getName(mSessionID));  	setDocked(true); @@ -361,19 +360,21 @@ void LLIMFloater::updateMessages()  			if (mLastFromName != from)  			{  				message << from << " ----- " << msg["time"].asString(); -				mHistoryEditor->appendColoredText(message.str(), false, -					prepend_newline, divider_color); +				mHistoryEditor->appendText(message.str(), +					prepend_newline, LLStyle::Params().color(divider_color) );  				message.str("");  				mLastFromName = from;  			}  			message << msg["message"].asString();  -			mHistoryEditor->appendColoredText(message.str(), false, -				prepend_newline, chat_color); +			mHistoryEditor->appendText(message.str(), +				prepend_newline,  +				LLStyle::Params().color(chat_color) );  			message.str("");  			mLastMessageIndex = msg["index"].asInteger();  		} +		mHistoryEditor->blockUndo();  		mHistoryEditor->setCursorAndScrollToEnd();  	} diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index abd3cd4def..89a885090c 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -1078,8 +1078,6 @@ BOOL LLFloaterIMPanel::postBuild()  	//close_btn->setClickedCallback(&LLFloaterIMPanel::onClickClose, this);  	mHistoryEditor = getChild<LLViewerTextEditor>("im_history"); -	mHistoryEditor->setParseHTML(TRUE); -	mHistoryEditor->setParseHighlights(TRUE);  	if ( IM_SESSION_GROUP_START == mDialog )  	{ @@ -1334,16 +1332,18 @@ void LLFloaterIMPanel::addHistoryLine(const std::string &utf8msg, const LLColor4  		// Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text.  		if (name == SYSTEM_FROM)  		{ -			mHistoryEditor->appendColoredText(name + separator_string, false, prepend_newline, color); +			mHistoryEditor->appendText(name + separator_string, prepend_newline, LLStyle::Params().color(color));  		}  		else  		{  			// Convert the name to a hotlink and add to message. -			mHistoryEditor->appendStyledText(name + separator_string, false, prepend_newline, LLStyleMap::instance().lookupAgent(source)); +			mHistoryEditor->appendText(name + separator_string, prepend_newline, LLStyleMap::instance().lookupAgent(source));  		}  		prepend_newline = false;  	} -	mHistoryEditor->appendColoredText(utf8msg, false, prepend_newline, color); +	mHistoryEditor->appendText(utf8msg, prepend_newline, LLStyle::Params().color(color)); +	mHistoryEditor->blockUndo(); +  	S32 im_log_option =  gSavedPerAccountSettings.getS32("IMLogOptions");  	if (log_to_file && (im_log_option!=LOG_CHAT))  	{ @@ -1859,7 +1859,8 @@ void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string  	}  	//self->addHistoryLine(line, LLColor4::grey, FALSE); -	self->mHistoryEditor->appendColoredText(message, false, true, LLUIColorTable::instance().getColor("ChatHistoryTextColor")); +	self->mHistoryEditor->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor"))); +	self->mHistoryEditor->blockUndo();  }  void LLFloaterIMPanel::showSessionStartError( @@ -1934,4 +1935,3 @@ bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const  	}  	return false;  } - diff --git a/indra/newview/llinspectavatar.cpp b/indra/newview/llinspectavatar.cpp index 72f89d2e72..a08d9e1163 100644 --- a/indra/newview/llinspectavatar.cpp +++ b/indra/newview/llinspectavatar.cpp @@ -34,15 +34,106 @@  #include "llinspectavatar.h"  // viewer files +#include "llagent.h"  #include "llagentdata.h"  #include "llavataractions.h"  #include "llavatarpropertiesprocessor.h"  #include "llcallingcard.h" - -// linden libraries +#include "lldateutil.h"		// ageFromDate() +#include "llfloaterreporter.h" +#include "llfloaterworldmap.h" +#include "llmutelist.h" +#include "llpanelblockedlist.h" +#include "llviewermenu.h" +#include "llvoiceclient.h" + +// Linden libraries +#include "llcontrol.h"	// LLCachedControl +#include "llfloater.h" +#include "llfloaterreg.h"  #include "lltooltip.h"	// positionViewNearMouse()  #include "lluictrl.h" +class LLFetchAvatarData; + + +////////////////////////////////////////////////////////////////////////////// +// LLInspectAvatar +////////////////////////////////////////////////////////////////////////////// + +// Avatar Inspector, a small information window used when clicking +// on avatar names in the 2D UI and in the ambient inspector widget for +// the 3D world. +class LLInspectAvatar : public LLFloater +{ +	friend class LLFloaterReg; +	 +public: +	// avatar_id - Avatar ID for which to show information +	// Inspector will be positioned relative to current mouse position +	LLInspectAvatar(const LLSD& avatar_id); +	virtual ~LLInspectAvatar(); +	 +	/*virtual*/ BOOL postBuild(void); +	/*virtual*/ void draw(); +	 +	// Because floater is single instance, need to re-parse data on each spawn +	// (for example, inspector about same avatar but in different position) +	/*virtual*/ void onOpen(const LLSD& avatar_id); +	 +	// Inspectors close themselves when they lose focus +	/*virtual*/ void onFocusLost(); +	 +	// Update view based on information from avatar properties processor +	void processAvatarData(LLAvatarData* data); +	 +private: +	// Make network requests for all the data to display in this view. +	// Used on construction and if avatar id changes. +	void requestUpdate(); +	 +	// Set the volume slider to this user's current client-side volume setting, +	// hiding/disabling if the user is not nearby. +	void updateVolumeSlider(); +	 +	// Button callbacks +	void onClickAddFriend(); +	void onClickViewProfile(); +	void onClickIM(); +	void onClickTeleport(); +	void onClickInviteToGroup(); +	void onClickPay(); +	void onClickBlock(); +	void onClickReport(); +	bool onVisibleFindOnMap(); +	bool onVisibleGodMode(); +	void onClickMuteVolume(); +	void onFindOnMap(); +	void onVolumeChange(const LLSD& data); +	 +	// Callback for gCacheName to look up avatar name +	void nameUpdatedCallback( +							 const LLUUID& id, +							 const std::string& first, +							 const std::string& last, +							 BOOL is_group); +	 +private: +	LLUUID				mAvatarID; +	// Need avatar name information to spawn friend add request +	std::string			mAvatarName; +	LLUUID				mPartnerID; +	// an in-flight request for avatar properties from LLAvatarPropertiesProcessor +	// is represented by this object +	LLFetchAvatarData*	mPropertiesRequest; +	LLFrameTimer		mCloseTimer; +	LLFrameTimer		mOpenTimer; +}; + +////////////////////////////////////////////////////////////////////////////// +// LLFetchAvatarData +////////////////////////////////////////////////////////////////////////////// +  // This object represents a pending request for avatar properties information  class LLFetchAvatarData : public LLAvatarPropertiesObserver  { @@ -50,8 +141,8 @@ public:  	// If the inspector closes it will delete the pending request object, so the  	// inspector pointer will be valid for the lifetime of this object  	LLFetchAvatarData(const LLUUID& avatar_id, LLInspectAvatar* inspector) -		:	mAvatarID(avatar_id), -			mInspector(inspector) +	:	mAvatarID(avatar_id), +		mInspector(inspector)  	{  		LLAvatarPropertiesProcessor* processor =   			LLAvatarPropertiesProcessor::getInstance(); @@ -61,14 +152,14 @@ public:  		// properties processor)  		processor->sendAvatarPropertiesRequest(mAvatarID);  	} - +	  	~LLFetchAvatarData()  	{  		// remove ourselves as an observer  		LLAvatarPropertiesProcessor::getInstance()-> -			removeObserver(mAvatarID, this); +		removeObserver(mAvatarID, this);  	} - +	  	void processProperties(void* data, EAvatarProcessorType type)  	{  		// route the data to the inspector @@ -79,7 +170,7 @@ public:  			mInspector->processAvatarData(avatar_data);  		}  	} - +	  	// Store avatar ID so we can un-register the observer on destruction  	LLUUID mAvatarID;  	LLInspectAvatar* mInspector; @@ -88,10 +179,24 @@ public:  LLInspectAvatar::LLInspectAvatar(const LLSD& sd)  :	LLFloater( LLSD() ),	// single_instance, doesn't really need key  	mAvatarID(),			// set in onOpen() -	mFirstName(), -	mLastName(), -	mPropertiesRequest(NULL) +	mPartnerID(), +	mAvatarName(), +	mPropertiesRequest(NULL), +	mCloseTimer()  { +	mCommitCallbackRegistrar.add("InspectAvatar.ViewProfile",	boost::bind(&LLInspectAvatar::onClickViewProfile, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.AddFriend",	boost::bind(&LLInspectAvatar::onClickAddFriend, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.IM",	boost::bind(&LLInspectAvatar::onClickIM, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.Teleport",	boost::bind(&LLInspectAvatar::onClickTeleport, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.InviteToGroup",	boost::bind(&LLInspectAvatar::onClickInviteToGroup, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.Pay",	boost::bind(&LLInspectAvatar::onClickPay, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.Block",	boost::bind(&LLInspectAvatar::onClickBlock, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.Report",	boost::bind(&LLInspectAvatar::onClickReport, this));	 +	mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap",	boost::bind(&LLInspectAvatar::onFindOnMap, this));	 +	mVisibleCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap",	boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this));	 +	mVisibleCallbackRegistrar.add("InspectAvatar.VisibleGodMode",	boost::bind(&LLInspectAvatar::onVisibleGodMode, this));	 + +  	// can't make the properties request until the widgets are constructed  	// as it might return immediately, so do it in postBuild.  } @@ -100,6 +205,7 @@ LLInspectAvatar::~LLInspectAvatar()  {  	// clean up any pending requests so they don't call back into a deleted  	// view +	llinfos << "JAMESDEBUG cleanup inspect avatar" << llendl;  	delete mPropertiesRequest;  	mPropertiesRequest = NULL;  } @@ -113,18 +219,35 @@ BOOL LLInspectAvatar::postBuild(void)  	getChild<LLUICtrl>("view_profile_btn")->setCommitCallback(  		boost::bind(&LLInspectAvatar::onClickViewProfile, this) ); +	getChild<LLUICtrl>("mute_btn")->setCommitCallback( +		boost::bind(&LLInspectAvatar::onClickMuteVolume, this) ); + +	getChild<LLUICtrl>("volume_slider")->setCommitCallback( +		boost::bind(&LLInspectAvatar::onVolumeChange, this, _2)); +  	return TRUE;  }  void LLInspectAvatar::draw()  { -	static LLCachedControl<F32> FADE_OUT_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); -	if (mCloseTimer.getStarted()) +	static LLCachedControl<F32> FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); +	if (mOpenTimer.getStarted())  	{ -		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_OUT_TIME, 1.f, 0.f); +		F32 alpha = clamp_rescale(mOpenTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 0.f, 1.f);  		LLViewDrawContext context(alpha);  		LLFloater::draw(); -		if (mCloseTimer.getElapsedTimeF32() > FADE_OUT_TIME) +		if (alpha == 1.f) +		{ +			mOpenTimer.stop(); +		} + +	} +	else if (mCloseTimer.getStarted()) +	{ +		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 1.f, 0.f); +		LLViewDrawContext context(alpha); +		LLFloater::draw(); +		if (mCloseTimer.getElapsedTimeF32() > FADE_TIME)  		{  			closeFloater(false);  		} @@ -142,9 +265,11 @@ void LLInspectAvatar::draw()  void LLInspectAvatar::onOpen(const LLSD& data)  {  	mCloseTimer.stop(); +	mOpenTimer.start();  	// Extract appropriate avatar id -	mAvatarID = data.isUUID() ? data : data["avatar_id"]; +	mAvatarID = data["avatar_id"]; +	mPartnerID = LLUUID::null;  	// Position the inspector relative to the mouse cursor  	// Similar to how tooltips are positioned @@ -160,6 +285,8 @@ void LLInspectAvatar::onOpen(const LLSD& data)  	// can't call from constructor as widgets are not built yet  	requestUpdate(); + +	updateVolumeSlider();  }  //virtual @@ -167,6 +294,7 @@ void LLInspectAvatar::onFocusLost()  {  	// Start closing when we lose focus  	mCloseTimer.start(); +	mOpenTimer.stop();  }  void LLInspectAvatar::requestUpdate() @@ -178,7 +306,9 @@ void LLInspectAvatar::requestUpdate()  		getChild<LLUICtrl>("user_subtitle")->  			setValue("Test subtitle");  		getChild<LLUICtrl>("user_details")-> -			setValue("Test details\nTest line 2"); +			setValue("Test details"); +		getChild<LLUICtrl>("user_partner")-> +			setValue("Test partner");  		return;  	} @@ -186,6 +316,7 @@ void LLInspectAvatar::requestUpdate()  	getChild<LLUICtrl>("user_name")->setValue("");  	getChild<LLUICtrl>("user_subtitle")->setValue("");  	getChild<LLUICtrl>("user_details")->setValue(""); +	getChild<LLUICtrl>("user_partner")->setValue("");  	// Make a new request for properties  	delete mPropertiesRequest; @@ -212,49 +343,187 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data)  {  	LLStringUtil::format_map_t args;  	args["[BORN_ON]"] = data->born_on; -	args["[AGE]"] = LLAvatarPropertiesProcessor::ageFromDate(data->born_on); +	args["[AGE]"] = LLDateUtil::ageFromDate(data->born_on);  	args["[SL_PROFILE]"] = data->about_text;  	args["[RW_PROFILE"] = data->fl_about_text;  	args["[ACCTTYPE]"] = LLAvatarPropertiesProcessor::accountType(data); -	args["[PAYMENTINFO]"] = LLAvatarPropertiesProcessor::paymentInfo(data); +	std::string payment_info = LLAvatarPropertiesProcessor::paymentInfo(data); +	args["[PAYMENTINFO]"] = payment_info; +	args["[COMMA]"] = (payment_info.empty() ? "" : ",");  	std::string subtitle = getString("Subtitle", args);  	getChild<LLUICtrl>("user_subtitle")->setValue( LLSD(subtitle) );  	std::string details = getString("Details", args);  	getChild<LLUICtrl>("user_details")->setValue( LLSD(details) ); +	// Look up partner name, if there is one +	mPartnerID = data->partner_id; +	if (mPartnerID.notNull()) +	{ +		gCacheName->get(mPartnerID, FALSE, +			boost::bind(&LLInspectAvatar::nameUpdatedCallback, +			this, _1, _2, _3, _4)); +	} +  	// Delete the request object as it has been satisfied  	delete mPropertiesRequest;  	mPropertiesRequest = NULL;  } +void LLInspectAvatar::updateVolumeSlider() +{ +	// By convention, we only display and toggle voice mutes, not all mutes +	bool is_muted = LLMuteList::getInstance()-> +						isMuted(mAvatarID, LLMute::flagVoiceChat); +	bool voice_enabled = gVoiceClient->getVoiceEnabled(mAvatarID); + +	LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn"); +	mute_btn->setEnabled( voice_enabled ); +	mute_btn->setValue( is_muted ); + +	LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider"); +	volume_slider->setEnabled( voice_enabled && !is_muted ); +	const F32 DEFAULT_VOLUME = 0.5f; +	F32 volume; +	if (is_muted) +	{ +		// it's clearer to display their volume as zero +		volume = 0.f; +	} +	else if (!voice_enabled) +	{ +		// use nominal value rather than 0 +		volume = DEFAULT_VOLUME; +	} +	else +	{ +		// actual volume +		volume = gVoiceClient->getUserVolume(mAvatarID); + +		// *HACK: Voice client doesn't have any data until user actually +		// says something. +		if (volume == 0.f) +		{ +			volume = DEFAULT_VOLUME; +		} +	} +	volume_slider->setValue( (F64)volume ); +} + +void LLInspectAvatar::onClickMuteVolume() +{ +	// By convention, we only display and toggle voice mutes, not all mutes +	LLMuteList* mute_list = LLMuteList::getInstance(); +	bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); + +	LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); +	if (!is_muted) +	{ +		mute_list->add(mute, LLMute::flagVoiceChat); +	} +	else +	{ +		mute_list->remove(mute, LLMute::flagVoiceChat); +	} + +	updateVolumeSlider(); +} + +void LLInspectAvatar::onVolumeChange(const LLSD& data) +{ +	F32 volume = (F32)data.asReal(); +	gVoiceClient->setUserVolume(mAvatarID, volume); +} +  void LLInspectAvatar::nameUpdatedCallback(  	const LLUUID& id,  	const std::string& first,  	const std::string& last,  	BOOL is_group)  { -	// Possibly a request for an older inspector -	if (id != mAvatarID) return; - -	mFirstName = first; -	mLastName = last; -	std::string name = first + " " + last; - -	childSetValue("user_name", LLSD(name) ); +	if (id == mAvatarID) +	{ +		mAvatarName = first + " " + last; +		childSetValue("user_name", LLSD(mAvatarName) ); +	} +	 +	if (id == mPartnerID) +	{ +		LLStringUtil::format_map_t args; +		args["[PARTNER]"] = first + " " + last; +		std::string partner = getString("Partner", args); +		getChild<LLUICtrl>("user_partner")->setValue(partner); +	} +	// Otherwise possibly a request for an older inspector, ignore it  }  void LLInspectAvatar::onClickAddFriend()  { -	std::string name; -	name.assign(mFirstName); -	name.append(" "); -	name.append(mLastName); - -	LLAvatarActions::requestFriendshipDialog(mAvatarID, name); +	LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName);  }  void LLInspectAvatar::onClickViewProfile()  { +	// hide inspector when showing profile +	setFocus(FALSE);  	LLAvatarActions::showProfile(mAvatarID); + +} + +bool LLInspectAvatar::onVisibleFindOnMap() +{ +	return gAgent.isGodlike() || is_agent_mappable(mAvatarID); +} + +bool LLInspectAvatar::onVisibleGodMode() +{ +	return gAgent.isGodlike(); +} + +void LLInspectAvatar::onClickIM() +{  +	LLAvatarActions::startIM(mAvatarID); +} + +void LLInspectAvatar::onClickTeleport() +{ +	LLAvatarActions::offerTeleport(mAvatarID); +} + +void LLInspectAvatar::onClickInviteToGroup() +{ +	LLAvatarActions::inviteToGroup(mAvatarID); +} + +void LLInspectAvatar::onClickPay() +{ +	LLAvatarActions::pay(mAvatarID); +} + +void LLInspectAvatar::onClickBlock() +{ +	LLMute mute(mAvatarID, mAvatarName, LLMute::AGENT); +	LLMuteList::getInstance()->add(mute); +	LLPanelBlockedList::showPanelAndSelect(mute.mID); +} + +void LLInspectAvatar::onClickReport() +{ +	LLFloaterReporter::showFromObject(mAvatarID); +} + + +void LLInspectAvatar::onFindOnMap() +{ +	gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName); +	LLFloaterReg::showInstance("world_map"); +} + +////////////////////////////////////////////////////////////////////////////// +// LLInspectAvatarUtil +////////////////////////////////////////////////////////////////////////////// +void LLInspectAvatarUtil::registerFloater() +{ +	LLFloaterReg::add("inspect_avatar", "inspect_avatar.xml", +					  &LLFloaterReg::build<LLInspectAvatar>);  } diff --git a/indra/newview/llinspectavatar.h b/indra/newview/llinspectavatar.h index 8d490382d2..179ad1ffe1 100644 --- a/indra/newview/llinspectavatar.h +++ b/indra/newview/llinspectavatar.h @@ -32,63 +32,10 @@  #ifndef LLINSPECTAVATAR_H  #define LLINSPECTAVATAR_H -#include "llfloater.h" - -struct LLAvatarData; -class LLFetchAvatarData; - -// Avatar Inspector, a small information window used when clicking -// on avatar names in the 2D UI and in the ambient inspector widget for -// the 3D world. -class LLInspectAvatar : public LLFloater +namespace LLInspectAvatarUtil  { -	friend class LLFloaterReg; - -public: -	// avatar_id - Avatar ID for which to show information -	// Inspector will be positioned relative to current mouse position -	LLInspectAvatar(const LLSD& avatar_id); -	virtual ~LLInspectAvatar(); - -	/*virtual*/ BOOL postBuild(void); -	/*virtual*/ void draw(); - -	// Because floater is single instance, need to re-parse data on each spawn -	// (for example, inspector about same avatar but in different position) -	/*virtual*/ void onOpen(const LLSD& avatar_id); - -	// Inspectors close themselves when they lose focus -	/*virtual*/ void onFocusLost(); - -	// Update view based on information from avatar properties processor -	void processAvatarData(LLAvatarData* data); - -private: -	// Make network requests for all the data to display in this view. -	// Used on construction and if avatar id changes. -	void requestUpdate(); - -	// Button callbacks -	void onClickAddFriend(); -	void onClickViewProfile(); - -	// Callback for gCacheName to look up avatar name -	void nameUpdatedCallback( -		const LLUUID& id, -		const std::string& first, -		const std::string& last, -		BOOL is_group); - -private: -	LLUUID				mAvatarID; -	// Need avatar name information to spawn friend add request -	std::string			mFirstName; -	std::string			mLastName; -	// an in-flight request for avatar properties from LLAvatarPropertiesProcessor -	// is represented by this object -	LLFetchAvatarData*	mPropertiesRequest; -	LLFrameTimer		mCloseTimer; -}; - +	// Register with LLFloaterReg +	void registerFloater(); +}  #endif diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp new file mode 100644 index 0000000000..b0e6273c41 --- /dev/null +++ b/indra/newview/llinspectobject.cpp @@ -0,0 +1,563 @@ +/**  + * @file llinspectobject.cpp + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + *  + * Copyright (c) 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 "llinspectobject.h" + +// Viewer +#include "llnotifications.h"	// *TODO: Eliminate, add LLNotificationsUtil wrapper +#include "llselectmgr.h" +#include "llslurl.h" +#include "llviewermenu.h"		// handle_object_touch(), handle_buy() +#include "llviewerobjectlist.h"	// to select the requested object + +// Linden libraries +#include "llbutton.h"			// setLabel(), not virtual! +#include "llclickaction.h" +#include "llcontrol.h"			// LLCachedControl +#include "llfloater.h" +#include "llfloaterreg.h" +#include "llresmgr.h"			// getMonetaryString +#include "llsafehandle.h" +#include "lltextbox.h"			// for description truncation +#include "lltrans.h" +#include "llui.h"				// positionViewNearMouse() +#include "lluictrl.h" + +class LLViewerObject; + +// *TODO: Abstract out base class for LLInspectObject and LLInspectObject + +////////////////////////////////////////////////////////////////////////////// +// LLInspectObject +////////////////////////////////////////////////////////////////////////////// + +// Object Inspector, a small information window used when clicking +// in the ambient inspector widget for objects in the 3D world. +class LLInspectObject : public LLFloater +{ +	friend class LLFloaterReg; +	 +public: +	// object_id - Root object ID for which to show information +	// Inspector will be positioned relative to current mouse position +	LLInspectObject(const LLSD& object_id); +	virtual ~LLInspectObject(); +	 +	/*virtual*/ BOOL postBuild(void); +	/*virtual*/ void draw(); +	 +	// Because floater is single instance, need to re-parse data on each spawn +	// (for example, inspector about same avatar but in different position) +	/*virtual*/ void onOpen(const LLSD& avatar_id); +	 +	// Release the selection and do other cleanup +	void onClose(); +	 +	// Inspectors close themselves when they lose focus +	/*virtual*/ void onFocusLost(); +	 +private: +	// Refresh displayed data with information from selection manager +	void update(); + +	void hideButtons(); +	void updateButtons(LLSelectNode* nodep); +	void updateSitLabel(LLSelectNode* nodep); +	void updateTouchLabel(LLSelectNode* nodep); + +	void updateName(LLSelectNode* nodep); +	void updateDescription(LLSelectNode* nodep); +	void updatePrice(LLSelectNode* nodep); +	 +	void updateCreator(LLSelectNode* nodep); +		 +	void onClickBuy(); +	void onClickPay(); +	void onClickTakeFreeCopy(); +	void onClickTouch(); +	void onClickSit(); +	void onClickOpen(); +	void onClickMoreInfo(); +	 +private: +	LLUUID				mObjectID; +	LLFrameTimer		mOpenTimer; +	LLFrameTimer		mCloseTimer; +	LLSafeHandle<LLObjectSelection> mObjectSelection; +}; + +LLInspectObject::LLInspectObject(const LLSD& sd) +:	LLFloater( LLSD() ),	// single_instance, doesn't really need key +	mObjectID(),			// set in onOpen() +	mCloseTimer(), +	mOpenTimer() +{ +	// can't make the properties request until the widgets are constructed +	// as it might return immediately, so do it in postBuild. +	mCommitCallbackRegistrar.add("InspectObject.Buy",	boost::bind(&LLInspectObject::onClickBuy, this));	 +	mCommitCallbackRegistrar.add("InspectObject.Pay",	boost::bind(&LLInspectObject::onClickPay, this));	 +	mCommitCallbackRegistrar.add("InspectObject.TakeFreeCopy",	boost::bind(&LLInspectObject::onClickTakeFreeCopy, this));	 +	mCommitCallbackRegistrar.add("InspectObject.Touch",	boost::bind(&LLInspectObject::onClickTouch, this));	 +	mCommitCallbackRegistrar.add("InspectObject.Sit",	boost::bind(&LLInspectObject::onClickSit, this));	 +	mCommitCallbackRegistrar.add("InspectObject.Open",	boost::bind(&LLInspectObject::onClickOpen, this));	 +	mCommitCallbackRegistrar.add("InspectObject.MoreInfo",	boost::bind(&LLInspectObject::onClickMoreInfo, this));	 +} + + +LLInspectObject::~LLInspectObject() +{ +} + +/*virtual*/ +BOOL LLInspectObject::postBuild(void) +{ +	// The XML file has sample data in it.  Clear that out so we don't +	// flicker when data arrives off network. +	getChild<LLUICtrl>("object_name")->setValue(""); +	getChild<LLUICtrl>("object_creator")->setValue(""); +	getChild<LLUICtrl>("object_description")->setValue(""); + +	// Set buttons invisible until we know what this object can do +	hideButtons(); + +	// Hide floater when name links clicked +	LLTextBox* textbox = getChild<LLTextBox>("object_creator"); +	textbox->mURLClickSignal.connect( +		boost::bind(&LLInspectObject::closeFloater, this, false) ); + +	// Hook up functionality +	getChild<LLUICtrl>("buy_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickBuy, this)); +	getChild<LLUICtrl>("pay_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickPay, this)); +	getChild<LLUICtrl>("take_free_copy_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickTakeFreeCopy, this)); +	getChild<LLUICtrl>("touch_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickTouch, this)); +	getChild<LLUICtrl>("sit_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickSit, this)); +	getChild<LLUICtrl>("open_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickOpen, this)); +	getChild<LLUICtrl>("more_info_btn")->setCommitCallback( +		boost::bind(&LLInspectObject::onClickMoreInfo, this)); + +	// Watch for updates to selection properties off the network +	LLSelectMgr::getInstance()->mUpdateSignal.connect( +		boost::bind(&LLInspectObject::update, this) ); + +	mCloseSignal.connect( boost::bind(&LLInspectObject::onClose, this) ); + +	return TRUE; +} + +void LLInspectObject::draw() +{ +	static LLCachedControl<F32> FADE_OUT_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f); +	if (mOpenTimer.getStarted()) +	{ +		F32 alpha = clamp_rescale(mOpenTimer.getElapsedTimeF32(), 0.f, FADE_OUT_TIME, 0.f, 1.f); +		LLViewDrawContext context(alpha); +		LLFloater::draw(); +	} +	else if (mCloseTimer.getStarted()) +	{ +		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_OUT_TIME, 1.f, 0.f); +		LLViewDrawContext context(alpha); +		LLFloater::draw(); +		if (mCloseTimer.getElapsedTimeF32() > FADE_OUT_TIME) +		{ +			closeFloater(false); +		} +	} +	else +	{ +		LLFloater::draw(); +	} +} + + +// Multiple calls to showInstance("inspect_avatar", foo) will provide different +// LLSD for foo, which we will catch here. +//virtual +void LLInspectObject::onOpen(const LLSD& data) +{ +	mCloseTimer.stop(); +	mOpenTimer.start(); + +	// Extract appropriate avatar id +	mObjectID = data["object_id"]; + +	// Position the inspector relative to the mouse cursor +	// Similar to how tooltips are positioned +	// See LLToolTipMgr::createToolTip +	if (data.has("pos")) +	{ +		LLUI::positionViewNearMouse(this, data["pos"]["x"].asInteger(), data["pos"]["y"].asInteger()); +	} +	else +	{ +		LLUI::positionViewNearMouse(this); +	} + +	// Promote hovered object to a complete selection, which will also force +	// a request for selected object data off the network +	LLViewerObject* obj = gObjectList.findObject( mObjectID ); +	if (obj) +	{ +		LLSelectMgr::instance().deselectAll(); +		mObjectSelection = LLSelectMgr::instance().selectObjectAndFamily(obj); + +		// Mark this as a transient selection +		struct SetTransient : public LLSelectedNodeFunctor +		{ +			bool apply(LLSelectNode* node) +			{ +				node->setTransient(TRUE); +				return true; +			} +		} functor; +		mObjectSelection->applyToNodes(&functor); +	} +} + +void LLInspectObject::onClose() +{ +	// Release selection to deselect +	mObjectSelection = NULL; +} + +//virtual +void LLInspectObject::onFocusLost() +{ +	// Start closing when we lose focus +	mCloseTimer.start(); +	mOpenTimer.stop(); +} + + +void LLInspectObject::update() +{ +	// Performance optimization, because we listen to updates from select mgr +	// but we're never destroyed. +	if (!getVisible()) return; + +	LLObjectSelection* selection = LLSelectMgr::getInstance()->getSelection(); +	if (!selection) return; + +	LLSelectNode* nodep = selection->getFirstRootNode(); +	if (!nodep) return; + +	updateButtons(nodep); +	updateName(nodep); +	updateDescription(nodep); +	updateCreator(nodep); +	updatePrice(nodep); +} + +void LLInspectObject::hideButtons() +{ +	getChild<LLUICtrl>("buy_btn")->setVisible(false); +	getChild<LLUICtrl>("pay_btn")->setVisible(false); +	getChild<LLUICtrl>("take_free_copy_btn")->setVisible(false); +	getChild<LLUICtrl>("touch_btn")->setVisible(false); +	getChild<LLUICtrl>("sit_btn")->setVisible(false); +	getChild<LLUICtrl>("open_btn")->setVisible(false); +} + +// *TODO: Extract this method from lltoolpie.cpp and put somewhere shared +extern U8 final_click_action(LLViewerObject*); + +// Choose the "most relevant" operation for this object, and show a button for +// that operation as the left-most button in the inspector. +void LLInspectObject::updateButtons(LLSelectNode* nodep) +{ +	// We'll start with everyone hidden and show the ones we need +	hideButtons(); +	 +	LLViewerObject* object = nodep->getObject(); +	LLViewerObject *parent = (LLViewerObject*)object->getParent(); +	bool for_copy = anyone_copy_selection(nodep); +	bool for_sale = enable_buy_object(); +	S32 price = nodep->mSaleInfo.getSalePrice(); +	U8 click_action = final_click_action(object); + +	if (for_copy +		|| (for_sale && price == 0)) +	{ +		// Free copies have priority over other operations +		getChild<LLUICtrl>("take_free_copy_btn")->setVisible(true); +	} +	else if (for_sale) +	{ +		getChild<LLUICtrl>("buy_btn")->setVisible(true); +	} +	else if ( enable_pay_object() ) +	{ +		getChild<LLUICtrl>("pay_btn")->setVisible(true); +	} +	else if (click_action == CLICK_ACTION_SIT) +	{ +		// Click-action sit must come before "open" because many objects on +		// which you can sit have scripts, and hence can be opened +		getChild<LLUICtrl>("sit_btn")->setVisible(true); +		updateSitLabel(nodep); +	} +	else if (object->flagHandleTouch() +		|| (parent && parent->flagHandleTouch())) +	{ +		getChild<LLUICtrl>("touch_btn")->setVisible(true); +		updateTouchLabel(nodep); +	} +	else if ( enable_object_open() ) +	{ +		// Open is last because anything with a script in it can be opened +		getChild<LLUICtrl>("open_btn")->setVisible(true); +	} +	else +	{ +		// By default, we can sit on anything +		getChild<LLUICtrl>("sit_btn")->setVisible(true); +		updateSitLabel(nodep); +	} + +	// No flash +	focusFirstItem(FALSE, FALSE); +} + +void LLInspectObject::updateSitLabel(LLSelectNode* nodep) +{ +	LLButton* sit_btn = getChild<LLButton>("sit_btn"); +	if (!nodep->mSitName.empty()) +	{ +		sit_btn->setLabel( nodep->mSitName ); +	} +	else +	{ +		sit_btn->setLabel( getString("Sit") ); +	} +} + +void LLInspectObject::updateTouchLabel(LLSelectNode* nodep) +{ +	LLButton* sit_btn = getChild<LLButton>("touch_btn"); +	if (!nodep->mTouchName.empty()) +	{ +		sit_btn->setLabel( nodep->mTouchName ); +	} +	else +	{ +		sit_btn->setLabel( getString("Touch") ); +	} +} + +void LLInspectObject::updateName(LLSelectNode* nodep) +{ +	std::string name; +	if (!nodep->mName.empty()) +	{ +		name = nodep->mName; +	} +	else +	{ +		name = LLTrans::getString("TooltipNoName"); +	} +	getChild<LLUICtrl>("object_name")->setValue(name); +} + +void LLInspectObject::updateDescription(LLSelectNode* nodep) +{ +	const char* const DEFAULT_DESC = "(No Description)"; +	std::string desc; +	if (!nodep->mDescription.empty() +		&& nodep->mDescription != DEFAULT_DESC) +	{ +		desc = nodep->mDescription; +	} + +	LLTextBox* textbox = getChild<LLTextBox>("object_description"); +	textbox->setValue(desc); + +	// Truncate description text to fit in widget +	// *HACK: OMG, use lower-left corner to truncate text +	// Don't round the position, we want the left of the character +	S32 corner_index = textbox->getDocIndexFromLocalCoord( 0, 0, FALSE); +	LLWString desc_wide = textbox->getWText(); +	// index == length if position is past last character +	if (corner_index < (S32)desc_wide.length()) +	{ +		desc_wide = desc_wide.substr(0, corner_index); +		textbox->setWText(desc_wide); +	} +} + +void LLInspectObject::updateCreator(LLSelectNode* nodep) +{ +	// final information for display +	LLStringUtil::format_map_t args; +	std::string text; +	 +	// Leave text blank until data loaded +	if (nodep->mValid) +	{ +		// Utilize automatic translation of SLURL into name to display  +		// a clickable link		 +		// Objects cannot be created by a group, so use agent URL format +		LLUUID creator_id = nodep->mPermissions->getCreator(); +		std::string creator_url = +			LLSLURL::buildCommand("agent", creator_id, "about"); +		args["[CREATOR]"] = creator_url; +				 +		// created by one user but owned by another +		std::string owner_url; +		LLUUID owner_id; +		bool group_owned = nodep->mPermissions->isGroupOwned(); +		if (group_owned) +		{ +			owner_id = nodep->mPermissions->getGroup(); +			owner_url =	LLSLURL::buildCommand("group", owner_id, "about"); +		} +		else +		{ +			owner_id = nodep->mPermissions->getOwner(); +			owner_url =	LLSLURL::buildCommand("agent", owner_id, "about"); +		} +		args["[OWNER]"] = owner_url; +		 +		if (creator_id == owner_id) +		{ +			// common case, created and owned by one user +			text = getString("Creator", args); +		} +		else +		{ +			text = getString("CreatorAndOwner", args); +		} +	} +	getChild<LLUICtrl>("object_creator")->setValue(text); +} + +void LLInspectObject::updatePrice(LLSelectNode* nodep) +{ +	// *TODO: Only look these up once and use for both updateButtons and here +	bool for_copy = anyone_copy_selection(nodep); +	bool for_sale = enable_buy_object(); +	S32 price = nodep->mSaleInfo.getSalePrice(); +	 +	bool show_price_icon = false; +	std::string line; +	if (for_copy +		|| (for_sale && price == 0)) +	{ +		line = getString("PriceFree"); +		show_price_icon = true; +	} +	else if (for_sale) +	{ +		LLStringUtil::format_map_t args; +		args["[AMOUNT]"] = LLResMgr::getInstance()->getMonetaryString(price); +		line = getString("Price", args); +		show_price_icon = true; +	} +	getChild<LLUICtrl>("price_text")->setValue(line); +	getChild<LLUICtrl>("price_icon")->setVisible(show_price_icon); +} + +void LLInspectObject::onClickBuy() +{ +	handle_buy(); +	closeFloater(); +} + +void LLInspectObject::onClickPay() +{ +	handle_give_money_dialog(); +	closeFloater(); +} + +void LLInspectObject::onClickTakeFreeCopy() +{ +	LLObjectSelection* selection = LLSelectMgr::getInstance()->getSelection(); +	if (!selection) return; + +	LLSelectNode* nodep = selection->getFirstRootNode(); +	if (!nodep) return; + +	// Figure out if this is a "free buy" or a "take copy" +	bool for_copy = anyone_copy_selection(nodep); +	// Prefer to just take a free copy +	if (for_copy) +	{ +		handle_take_copy(); +	} +	else +	{ +		// Buy for free (confusing, but that's how it is) +		handle_buy(); +	} +	closeFloater(); +} + +void LLInspectObject::onClickTouch() +{ +	handle_object_touch(); +	closeFloater(); +} + +void LLInspectObject::onClickSit() +{ +	handle_object_sit_or_stand(); +	closeFloater(); +} + +void LLInspectObject::onClickOpen() +{ +	LLFloaterReg::showInstance("openobject"); +	closeFloater(); +} + +void LLInspectObject::onClickMoreInfo() +{ +	// *TODO: Show object info side panel, once that is implemented. +	LLNotifications::instance().add("ClickUnimplemented"); +	closeFloater(); +} + +////////////////////////////////////////////////////////////////////////////// +// LLInspectObjectUtil +////////////////////////////////////////////////////////////////////////////// +void LLInspectObjectUtil::registerFloater() +{ +	LLFloaterReg::add("inspect_object", "inspect_object.xml", +					  &LLFloaterReg::build<LLInspectObject>); +} + diff --git a/indra/newview/llinspectobject.h b/indra/newview/llinspectobject.h new file mode 100644 index 0000000000..aa45f401c0 --- /dev/null +++ b/indra/newview/llinspectobject.h @@ -0,0 +1,40 @@ +/**  + * @file llinspectobject.h + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + *  + * Copyright (c) 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 LLINSPECTOBJECT_H +#define LLINSPECTOBJECT_H + +namespace LLInspectObjectUtil +{ +	void registerFloater(); +} + +#endif diff --git a/indra/newview/lljoystickbutton.cpp b/indra/newview/lljoystickbutton.cpp index efc03b3d88..4fd3b7bddc 100644 --- a/indra/newview/lljoystickbutton.cpp +++ b/indra/newview/lljoystickbutton.cpp @@ -537,18 +537,6 @@ void LLJoystickCameraRotate::draw()  	{  		drawRotatedImage( getImageSelected()->getImage(), 3 );  	} - -	if (sDebugRects) -	{ -		drawDebugRect(); -	} - -	//// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) -	//std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); -	//if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) -	//{ -	//	drawDebugRect(); -	//}  }  // Draws image rotated by multiples of 90 degrees @@ -723,18 +711,6 @@ void LLJoystickCameraZoom::draw()  	{  		getImageUnselected()->draw( 0, 0 );  	} - -	if (sDebugRects) -	{ -		drawDebugRect(); -	} - -	//// *HACK: also draw debug rectangles around currently-being-edited LLView, and any elements that are being highlighted by GUI preview code (see LLFloaterUIPreview) -	//std::set<LLView*>::iterator iter = std::find(sPreviewHighlightedElements.begin(), sPreviewHighlightedElements.end(), this); -	//if ((sEditingUI && this == sEditingUIView) || (iter != sPreviewHighlightedElements.end() && sDrawPreviewHighlights)) -	//{ -	//	drawDebugRect(); -	//}  }  void LLJoystickCameraZoom::updateSlop() diff --git a/indra/newview/lllistview.cpp b/indra/newview/lllistview.cpp index 3019d5d3d5..f4f3b1df78 100644 --- a/indra/newview/lllistview.cpp +++ b/indra/newview/lllistview.cpp @@ -57,7 +57,7 @@ LLListView::LLListView(const Params& p)  	LLRect label_rect(0, 20, 300, 0);  	LLTextBox::Params text_box_params;  	text_box_params.rect(label_rect); -	text_box_params.text("This is a list-view"); +	text_box_params.initial_value("This is a list-view");  	mLabel = LLUICtrlFactory::create<LLTextBox>(text_box_params);  	addChild(mLabel);  } diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 68dc3854db..16a10dc502 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -290,10 +290,10 @@ void LLLocationInputCtrl::hideList()  		focusTextEntry();  } -BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) +BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, MASK mask)  {  	// Let the buttons show their tooltips. -	if (LLUICtrl::handleToolTip(x, y, msg, sticky_rect_screen) && !msg.empty()) +	if (LLUICtrl::handleToolTip(x, y, mask))  	{  		if (mList->getRect().pointInRect(x, y))   		{ diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 6edae9a9e2..c74a294ca3 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -71,7 +71,7 @@ public:  	// LLView interface  	/*virtual*/ void		setEnabled(BOOL enabled); -	/*virtual*/ BOOL		handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect); +	/*virtual*/ BOOL		handleToolTip(S32 x, S32 y, MASK mask);  	/*virtual*/ BOOL		handleKeyHere(KEY key, MASK mask);  	/*virtual*/ void		onFocusReceived();  	/*virtual*/ void		onFocusLost(); diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 1666ec1336..f61177d581 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -49,7 +49,6 @@  #include "llfloaterchat.h"  #include "llfloaterdirectory.h"  #include "llfloaterworldmap.h" -#include "llgivemoney.h"  #include "lllineeditor.h"  #include "llnotify.h"  #include "llstatusbar.h" @@ -68,11 +67,6 @@  #include "llfocusmgr.h"  #include "llnearbychatbar.h" -void handle_pay_by_id(const LLUUID& agent_id) -{ -	const BOOL is_group = FALSE; -	LLFloaterPay::payDirectly(&give_money, agent_id, is_group); -}  void handle_mouselook(void*)  { diff --git a/indra/newview/llmenucommands.h b/indra/newview/llmenucommands.h index 368c6fe752..a3611ef6d1 100644 --- a/indra/newview/llmenucommands.h +++ b/indra/newview/llmenucommands.h @@ -35,7 +35,6 @@  class LLUUID; -void handle_pay_by_id(const LLUUID& agent_id);  void handle_mouselook(void*);  void handle_chat(void*);  void handle_return_key(void*); diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 8ef6b25c50..541db0ca6e 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -32,16 +32,18 @@  #include "llviewerprecompiledheaders.h" -#include <boost/tokenizer.hpp> -  #include "llnamelistctrl.h" +#include <boost/tokenizer.hpp> +  #include "llcachename.h" +#include "llfloaterreg.h"  #include "llinventory.h"  #include "llscrolllistitem.h"  #include "llscrolllistcell.h"  #include "llscrolllistcolumn.h"  #include "llsdparam.h" +#include "lltooltip.h"  static LLDefaultChildRegistry::Register<LLNameListCtrl> r("name_list"); @@ -128,6 +130,60 @@ BOOL LLNameListCtrl::handleDragAndDrop(  	return handled;  } +void LLNameListCtrl::showAvatarInspector(const LLUUID& avatar_id) +{ +	LLSD key; +	key["avatar_id"] = avatar_id; +	LLFloaterReg::showInstance("inspect_avatar", key); +} + +//virtual +BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) +{ +	BOOL handled = FALSE; +	S32 column_index = getColumnIndexFromOffset(x); +	LLScrollListItem* hit_item = hitItem(x, y); +	if (hit_item) +	{ +		if (column_index == mNameColumnIndex) +		{ +			// ...this is the column with the avatar name +			LLScrollListCell* hit_cell = hit_item->getColumn(column_index); +			if (hit_cell) +			{ +				S32 row_index = getItemIndex(hit_item); +				LLRect cell_rect = getCellRect(row_index, column_index); +				// Convert rect local to screen coordinates +				LLRect sticky_rect; +				localRectToScreen(cell_rect, &sticky_rect); + +				// Spawn at right side of cell +				LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop ); +				LLPointer<LLUIImage> icon = LLUI::getUIImage("Info_Small"); +				LLUUID avatar_id = hit_item->getValue().asUUID(); + +				LLToolTip::Params params; +				params.background_visible( false ); +				params.click_callback( boost::bind(&LLNameListCtrl::showAvatarInspector, this, avatar_id) ); +				params.delay_time(0.0f);		// spawn instantly on hover +				params.image( icon ); +				params.message(""); +				params.padding(0); +				params.pos(pos); +				params.sticky_rect(sticky_rect); + +				LLToolTipMgr::getInstance()->show(params); +				handled = TRUE; +			} +		} +	} +	if (!handled) +	{ +		handled = LLScrollListCtrl::handleToolTip(x, y, mask); +	} +	return handled; +} +  // public  void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos,  									  BOOL enabled) diff --git a/indra/newview/llnamelistctrl.h b/indra/newview/llnamelistctrl.h index 070b6c4f4f..d0f0ec4d21 100644 --- a/indra/newview/llnamelistctrl.h +++ b/indra/newview/llnamelistctrl.h @@ -110,15 +110,20 @@ public:  	static void refreshAll(const LLUUID& id, const std::string& firstname,  						   const std::string& lastname, BOOL is_group); -	virtual BOOL	handleDragAndDrop(S32 x, S32 y, MASK mask, +	// LLView interface +	/*virtual*/ BOOL	handleDragAndDrop(S32 x, S32 y, MASK mask,  									  BOOL drop, EDragAndDropType cargo_type, void *cargo_data,  									  EAcceptance *accept,  									  std::string& tooltip_msg); +	/*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask);  	void setAllowCallingCardDrop(BOOL b) { mAllowCallingCardDrop = b; }  	/*virtual*/ void updateColumns();  private: +	void showAvatarInspector(const LLUUID& avatar_id); + +private:  	S32    			mNameColumnIndex;  	std::string		mNameColumn;  	BOOL			mAllowCallingCardDrop; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 8430937933..cc5f37b903 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -51,6 +51,7 @@  //for LLViewerTextEditor support  #include "llagent.h" 			// gAgent  #include "llfloaterscriptdebug.h" +#include "llslurl.h"  #include "llviewertexteditor.h"  #include "llstylemap.h" @@ -207,7 +208,7 @@ void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& colo  	if (chat.mSourceType == CHAT_SOURCE_AGENT &&  		chat.mFromID != LLUUID::null)  	{ -		str_URL = llformat("secondlife:///app/agent/%s/about",chat.mFromID.asString().c_str()); +		str_URL = LLSLURL::buildCommand("agent", chat.mFromID, "inspect");  	}  	// If the chat line has an associated url, link it up to the name. @@ -216,20 +217,31 @@ void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& colo  	{  		std::string start_line = line.substr(0, chat.mFromName.length() + 1);  		line = line.substr(chat.mFromName.length() + 1); -		mChatHistoryEditor->appendStyledText(start_line, false, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,str_URL)); +		mChatHistoryEditor->appendText(start_line, prepend_newline,  +			LLStyleMap::instance().lookup(chat.mFromID,str_URL)); +		mChatHistoryEditor->blockUndo();  		prepend_newline = false;  	}  	S32 font_size = gSavedSettings.getS32("ChatFontSize"); -	std::string font_name = ""; - -	if (0 == font_size) -		font_name = "small"; -	else if (2 == font_size) -		font_name = "sansserifbig"; +	const LLFontGL* fontp = NULL; +	switch(font_size) +	{ +	case 0: +		fontp = LLFontGL::getFontSansSerifSmall(); +		break; +	default: +	case 1: +		fontp = LLFontGL::getFontSansSerif(); +		break; +	case 2: +		fontp = LLFontGL::getFontSansSerifBig(); +		break; +	} -	mChatHistoryEditor->appendColoredText(line, false, prepend_newline, color, font_name); +	mChatHistoryEditor->appendText(line, prepend_newline, LLStyle::Params().color(color).font(fontp)); +	mChatHistoryEditor->blockUndo();  }  void	LLNearbyChat::addMessage(const LLChat& chat) @@ -250,11 +262,6 @@ void	LLNearbyChat::addMessage(const LLChat& chat)  	}  	// could flash the chat button in the status bar here. JC - - -	mChatHistoryEditor->setParseHTML(TRUE); -	mChatHistoryEditor->setParseHighlights(TRUE); -	  	if (!chat.mMuted)  		add_timestamped_line(chat, color);  } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index 5e65f2244d..bd6e6cd0cb 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -500,7 +500,7 @@ BOOL LLNetMap::handleScrollWheel(S32 x, S32 y, S32 clicks)  	return TRUE;  } -BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ) +BOOL LLNetMap::handleToolTip( S32 x, S32 y, MASK mask )  {  	if (gDisconnected)  	{ @@ -530,7 +530,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rec  		args["[REGION]"] = "";  	} -	msg = mToolTipMsg; +	std::string msg = mToolTipMsg;  	LLStringUtil::format(msg, args);  	LLRect sticky_rect; @@ -545,7 +545,7 @@ BOOL LLNetMap::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rec  		sticky_rect.mTop = sticky_rect.mBottom + 2 * SLOP;  	} -	LLToolTipMgr::instance().show(LLToolTipParams() +	LLToolTipMgr::instance().show(LLToolTip::Params()  		.message(msg)  		.sticky_rect(sticky_rect)); diff --git a/indra/newview/llnetmap.h b/indra/newview/llnetmap.h index 7598154480..821c348835 100644 --- a/indra/newview/llnetmap.h +++ b/indra/newview/llnetmap.h @@ -67,7 +67,7 @@ public:  	/*virtual*/ void	draw();  	/*virtual*/ BOOL	handleScrollWheel(S32 x, S32 y, S32 clicks); -	/*virtual*/ BOOL	handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ); +	/*virtual*/ BOOL	handleToolTip( S32 x, S32 y, MASK mask);  	void			setScale( F32 scale );  	void			setRotateMap( BOOL b ) { mRotateMap = b; } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 7ccff73080..c543f85f22 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -38,6 +38,7 @@  #include "llavatarconstants.h"	// AVATAR_ONLINE  #include "llcallingcard.h"  #include "llcombobox.h" +#include "lldateutil.h"  #include "llimview.h"  #include "lltexteditor.h"  #include "lltexturectrl.h" @@ -447,7 +448,7 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g  void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)  { -	childSetValue("register_date", LLAvatarPropertiesProcessor::ageFromDate(avatar_data->born_on)); +	childSetValue("register_date", LLDateUtil::ageFromDate(avatar_data->born_on));  	childSetValue("sl_description_edit", avatar_data->about_text);  	childSetValue("fl_description_edit",avatar_data->fl_about_text);  	childSetValue("2nd_life_pic", avatar_data->image_id); diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp index e66c36287b..03ad19f911 100644 --- a/indra/newview/llpanelavatartag.cpp +++ b/indra/newview/llpanelavatartag.cpp @@ -64,29 +64,7 @@ BOOL LLPanelAvatarTag::postBuild()  void LLPanelAvatarTag::draw()  { -	 -	///TODO: ANGELA do something similar to fade the panel out -/*	// HACK: assuming tooltip background is in ToolTipBGColor, perform fade out -	LLColor4 bg_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); -	if (tooltip_vis) -	{ -		mToolTipFadeTimer.stop(); -		mToolTip->setBackgroundColor(bg_color); -	} -	else  -	{ -		if (!mToolTipFadeTimer.getStarted()) -		{ -			mToolTipFadeTimer.start(); -		} -		F32 tool_tip_fade_time = gSavedSettings.getF32("ToolTipFadeTime"); -		bg_color.mV[VALPHA] = clamp_rescale(mToolTipFadeTimer.getElapsedTimeF32(), 0.f, tool_tip_fade_time, bg_color.mV[VALPHA], 0.f); -		mToolTip->setBackgroundColor(bg_color); -	} -	 -	// above interpolation of bg_color alpha is guaranteed to reach 0.f exactly -	mToolTip->setVisible( bg_color.mV[VALPHA] != 0.f ); - */ +  }  void LLPanelAvatarTag::setName(const std::string& name)  { diff --git a/indra/newview/llpanelblockedlist.h b/indra/newview/llpanelblockedlist.h index 52b74a184b..0993f46f79 100644 --- a/indra/newview/llpanelblockedlist.h +++ b/indra/newview/llpanelblockedlist.h @@ -35,6 +35,7 @@  #include "llpanel.h"  #include "llmutelist.h" +#include "llfloater.h"  // #include <vector>  // class LLButton; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 2e1d971995..0331fad60c 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -721,15 +721,18 @@ void LLPanelGroupGeneral::updateMembers()  		row["id"] = member->getID();  		row["columns"][0]["column"] = "name"; +		row["columns"][0]["font"]["name"] = "SANSSERIF_SMALL";  		row["columns"][0]["font"]["style"] = style;  		// value is filled in by name list control  		row["columns"][1]["column"] = "title";  		row["columns"][1]["value"] = member->getTitle(); +		row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL";  		row["columns"][1]["font"]["style"] = style;  		row["columns"][2]["column"] = "online";  		row["columns"][2]["value"] = member->getOnlineStatus(); +		row["columns"][2]["font"]["name"] = "SANSSERIF_SMALL";  		row["columns"][2]["font"]["style"] = style;  		sSDTime += sd_timer.getElapsedTimeF32(); diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index 99bb760b61..1521c1113a 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -634,6 +634,7 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,  		row["columns"][1]["column"] = "action";  		row["columns"][1]["value"] = action_set->mActionSetData->mName; +		row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL";  		row["columns"][1]["font"]["style"] = "BOLD";  		LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData); diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index a7f66f3293..24e76e2c6e 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -178,10 +178,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,  	if (LLPanelLogin::sInstance)  	{  		llwarns << "Duplicate instance of login view deleted" << llendl; -		delete LLPanelLogin::sInstance; -  		// Don't leave bad pointer in gFocusMgr  		gFocusMgr.setDefaultKeyboardFocus(NULL); + +		delete LLPanelLogin::sInstance;  	}  	LLPanelLogin::sInstance = this; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index b2a0a01005..c94c38983d 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -621,7 +621,7 @@ void LLPanelPeople::updateButtons()  	buttonSetEnabled("chat_btn",			item_selected);  } -const std::string& LLPanelPeople::getActiveTabName() const +std::string LLPanelPeople::getActiveTabName() const  {  	return mTabContainer->getCurrentPanel()->getName();  } diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index de27814388..03802015ce 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -63,7 +63,7 @@ private:  	void					updateRecentList();  	void					updateButtons(); -	const std::string&		getActiveTabName() const; +	std::string				getActiveTabName() const;  	LLUUID					getCurrentItemID() const;  	void					buttonSetVisible(std::string btn_name, BOOL visible);  	void					buttonSetEnabled(const std::string& btn_name, bool enabled); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 42f9906409..2d3f901370 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -85,9 +85,6 @@ BOOL LLPanelPermissions::postBuild()  	childSetPrevalidate("Object Description",LLLineEditor::prevalidatePrintableNotPipe); -	childSetAction("button owner profile",LLPanelPermissions::onClickOwner,this); -	childSetAction("button creator profile",LLPanelPermissions::onClickCreator,this); -  	getChild<LLUICtrl>("button set group")->setCommitCallback(boost::bind(&LLPanelPermissions::onClickGroup,this));  	childSetCommitCallback("checkbox share with group",LLPanelPermissions::onCommitGroupShare,this); @@ -162,12 +159,10 @@ void LLPanelPermissions::refresh()  		childSetEnabled("Creator:",false);  		childSetText("Creator Name",LLStringUtil::null);  		childSetEnabled("Creator Name",false); -		childSetEnabled("button creator profile",false);  		childSetEnabled("Owner:",false);  		childSetText("Owner Name",LLStringUtil::null);  		childSetEnabled("Owner Name",false); -		childSetEnabled("button owner profile",false);  		childSetEnabled("Group:",false);  		childSetText("Group Name",LLStringUtil::null); @@ -275,7 +270,6 @@ void LLPanelPermissions::refresh()  	childSetText("Creator Name",creator_name);  	childSetEnabled("Creator Name",TRUE); -	childSetEnabled("button creator profile", creators_identical && mCreatorID.notNull() );  	// Update owner text field  	childSetEnabled("Owner:",true); @@ -310,7 +304,6 @@ void LLPanelPermissions::refresh()  	childSetText("Owner Name",owner_name);  	childSetEnabled("Owner Name",TRUE); -	childSetEnabled("button owner profile",owners_identical && (mOwnerID.notNull() || LLSelectMgr::getInstance()->selectIsGroupOwned()));  	// update group text field  	childSetEnabled("Group:",true); @@ -803,31 +796,6 @@ void LLPanelPermissions::onClickRelease(void*)  	LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null);  } -// static -void LLPanelPermissions::onClickCreator(void *data) -{ -	LLPanelPermissions *self = (LLPanelPermissions *)data; - -	LLAvatarActions::showProfile(self->mCreatorID); -} - -// static -void LLPanelPermissions::onClickOwner(void *data) -{ -	LLPanelPermissions *self = (LLPanelPermissions *)data; - -	if (LLSelectMgr::getInstance()->selectIsGroupOwned()) -	{ -		LLUUID group_id; -		LLSelectMgr::getInstance()->selectGetGroup(group_id); -		LLGroupActions::show(group_id); -	} -	else -	{ -		LLAvatarActions::showProfile(self->mOwnerID); -	} -} -  void LLPanelPermissions::onClickGroup()  {  	LLUUID owner_id; diff --git a/indra/newview/llpanelpermissions.h b/indra/newview/llpanelpermissions.h index 481efe178e..805a4dbe97 100644 --- a/indra/newview/llpanelpermissions.h +++ b/indra/newview/llpanelpermissions.h @@ -42,12 +42,6 @@  // Panel for permissions of an object.  //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLCheckBoxCtrl; -class LLTextBox; -class LLButton; -class LLLineEditor; -class LLRadioGroup; -class LLComboBox;  class LLNameBox;  class LLPanelPermissions : public LLPanel @@ -56,31 +50,24 @@ public:  	LLPanelPermissions();  	virtual ~LLPanelPermissions(); -	virtual	BOOL	postBuild(); +	/*virtual*/	BOOL	postBuild(); -	// MANIPULATORS  	void refresh();							// refresh all labels as needed  protected:  	// statics  	static void onClickClaim(void*);  	static void onClickRelease(void*); -	static void onClickCreator(void*); -	static void onClickOwner(void*);  		   void onClickGroup();  		   void cbGroupID(LLUUID group_id);  	static void onClickDeedToGroup(void*);  	static void onCommitPerm(LLUICtrl *ctrl, void *data, U8 field, U32 perm); -//	static void onCommitGroupMove(LLUICtrl *ctrl, void *data); -//	static void onCommitGroupCopy(LLUICtrl *ctrl, void *data); -//	static void onCommitGroupModify(LLUICtrl *ctrl, void *data);  	static void onCommitGroupShare(LLUICtrl *ctrl, void *data);  	static void onCommitEveryoneMove(LLUICtrl *ctrl, void *data);  	static void onCommitEveryoneCopy(LLUICtrl *ctrl, void *data); -	//static void onCommitEveryoneModify(LLUICtrl *ctrl, void *data);  	static void onCommitNextOwnerModify(LLUICtrl* ctrl, void* data);  	static void onCommitNextOwnerCopy(LLUICtrl* ctrl, void* data); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 5df3d4f1d6..424e453a2f 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -356,14 +356,7 @@ std::string LLPanelPick::createLocationText(const std::string& owner_name, const  void LLPanelPick::setPickName(std::string name)  { -	if (mEditMode) -	{ -		childSetValue(XML_NAME, name); -	} -	else -	{ -		childSetWrappedText(XML_NAME, name); -	} +	childSetValue(XML_NAME, name);  	//preserving non-wrapped text for info/edit modes switching  	mName = name; @@ -371,14 +364,7 @@ void LLPanelPick::setPickName(std::string name)  void LLPanelPick::setPickDesc(std::string desc)  { -	if (mEditMode) -	{ -		childSetValue(XML_DESC, desc); -	} -	else -	{ -		childSetWrappedText(XML_DESC, desc); -	} +	childSetValue(XML_DESC, desc);  	//preserving non-wrapped text for info/edit modes switching  	mDesc = desc; @@ -386,7 +372,7 @@ void LLPanelPick::setPickDesc(std::string desc)  void LLPanelPick::setPickLocation(const std::string& location)  { -	childSetWrappedText(XML_LOCATION, location); +	childSetValue(XML_LOCATION, location);  	//preserving non-wrapped text for info/edit modes switching  	mLocation = location; diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index be28129451..3bd2645be3 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -35,6 +35,7 @@  #include "llagent.h"  #include "llavataractions.h" +#include "llfloaterreg.h"  #include "llcommandhandler.h"  #include "llpanelpicks.h"  #include "lltabcontainer.h" @@ -52,15 +53,21 @@ public:  		LLMediaCtrl* web)  	{  		if (params.size() < 2) return false; -		LLUUID agent_id; -		if (!agent_id.set(params[0], FALSE)) +		LLUUID avatar_id; +		if (!avatar_id.set(params[0], FALSE))  		{  			return false;  		}  		if (params[1].asString() == "about")  		{ -			LLAvatarActions::showProfile(agent_id); +			LLAvatarActions::showProfile(avatar_id); +			return true; +		} + +		if (params[1].asString() == "inspect") +		{ +			LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", avatar_id));  			return true;  		}  		return false; diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 04827e3a78..faca950963 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -421,9 +421,7 @@ BOOL LLPreviewGesture::postBuild()  	mStepList = list;  	// Options -	text = getChild<LLTextBox>("options_text"); -	text->setBorderVisible(TRUE); -	mOptionsText = text; +	mOptionsText = getChild<LLTextBox>("options_text");  	combo = getChild<LLComboBox>( "animation_list");  	combo->setVisible(FALSE); diff --git a/indra/newview/llpreviewnotecard.cpp b/indra/newview/llpreviewnotecard.cpp index 29320522d9..ab9cfbf850 100644 --- a/indra/newview/llpreviewnotecard.cpp +++ b/indra/newview/llpreviewnotecard.cpp @@ -85,12 +85,8 @@ LLPreviewNotecard::~LLPreviewNotecard()  BOOL LLPreviewNotecard::postBuild()  {  	LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor"); -	if (ed) -	{ -		ed->setParseHTML(TRUE); -		ed->setNotecardInfo(mItemUUID, mObjectID, getKey()); -		ed->makePristine(); -	} +	ed->setNotecardInfo(mItemUUID, mObjectID, getKey()); +	ed->makePristine();  	childSetAction("Save", onClickSave, this);  	childSetVisible("lock", FALSE);	 diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 3c6645f116..5f6b210767 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -196,7 +196,7 @@ void LLProgressView::draw()  void LLProgressView::setText(const std::string& text)  { -	getChild<LLTextBox>("progress_text")->setWrappedText(LLStringExplicit(text)); +	getChild<LLUICtrl>("progress_text")->setValue(text);  }  void LLProgressView::setPercent(const F32 percent) @@ -207,7 +207,7 @@ void LLProgressView::setPercent(const F32 percent)  void LLProgressView::setMessage(const std::string& msg)  {  	mMessage = msg; -	getChild<LLTextBox>("message_text")->setWrappedText(LLStringExplicit(mMessage)); +	getChild<LLUICtrl>("message_text")->setValue(mMessage);  }  void LLProgressView::setCancelButtonVisible(BOOL b, const std::string& label) diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index ae8c9f770b..d163ceb30e 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -43,6 +43,7 @@  #include "llrender.h"  #include "llpermissions.h"  #include "llpermissionsflags.h" +#include "lltrans.h"  #include "llundo.h"  #include "lluuid.h"  #include "llvolume.h" @@ -66,6 +67,7 @@  #include "llinventorymodel.h"  #include "llmenugl.h"  #include "llmutelist.h" +#include "llslurl.h"  #include "llstatusbar.h"  #include "llsurface.h"  #include "lltool.h" @@ -805,11 +807,13 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32  	// NOTE: there is only ever one linked set in mHoverObjects  	if (mHoverObjects->getFirstRootObject() != objectp)   	{ +  		// Collect all of the objects  		std::vector<LLViewerObject*> objects;  		objectp = objectp->getRootEdit();  		objectp->addThisAndNonJointChildren(objects); +		mHoverObjects->deleteAllNodes();  		for (std::vector<LLViewerObject*>::iterator iter = objects.begin();  			 iter != objects.end(); ++iter)  		{ @@ -818,7 +822,7 @@ LLObjectSelectionHandle LLSelectMgr::setHoverObject(LLViewerObject *objectp, S32  			nodep->selectTE(face, TRUE);  			mHoverObjects->addNodeAtEnd(nodep);  		} -		 +  		requestObjectPropertiesFamily(objectp);  	} @@ -2389,6 +2393,7 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name)  	}  	if (first_id.isNull())  	{ +		name = LLTrans::getString("AvatarNameNobody");  		return FALSE;  	} @@ -2396,11 +2401,11 @@ BOOL LLSelectMgr::selectGetCreator(LLUUID& result_id, std::string& name)  	if (identical)  	{ -		gCacheName->getFullName(first_id, name); +		name = LLSLURL::buildCommand("agent", first_id, "inspect");  	}  	else  	{ -		name.assign( "(multiple)" ); +		name = LLTrans::getString("AvatarNameMultiple");  	}  	return identical; @@ -2455,20 +2460,21 @@ BOOL LLSelectMgr::selectGetOwner(LLUUID& result_id, std::string& name)  		BOOL public_owner = (first_id.isNull() && !first_group_owned);  		if (first_group_owned)  		{ -			name.assign( "(Group Owned)"); +			// *TODO: We don't have group inspectors yet +			name = LLSLURL::buildCommand("group", first_id, "about");  		}  		else if(!public_owner)  		{ -			gCacheName->getFullName(first_id, name); +			name = LLSLURL::buildCommand("agent", first_id, "inspect");  		}  		else  		{ -			name.assign("Public"); +			name = LLTrans::getString("AvatarNameNobody");  		}  	}  	else  	{ -		name.assign( "(multiple)" ); +		name = LLTrans::getString("AvatarNameMultiple");  	}  	return identical; @@ -2519,7 +2525,7 @@ BOOL LLSelectMgr::selectGetLastOwner(LLUUID& result_id, std::string& name)  		BOOL public_owner = (first_id.isNull());  		if(!public_owner)  		{ -			gCacheName->getFullName(first_id, name); +			name = LLSLURL::buildCommand("agent", first_id, "inspect");  		}  		else  		{ @@ -5449,15 +5455,17 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)  // Utility Functions  // -// Update everyone who cares about the selection list +// *DEPRECATED: See header comment.  void dialog_refresh_all()  { -	if (gNoRender) -	{ -		return; -	} +	// This is the easiest place to fire the update signal, as it will +	// make cleaning up the functions below easier.  Also, sometimes entities +	// outside the selection manager change properties of selected objects +	// and call into this function.  Yuck. +	LLSelectMgr::getInstance()->mUpdateSignal(); -	//could refresh selected object info in toolbar here +	// *TODO: Eliminate all calls into outside classes below, make those +	// objects register with the update signal.  	gFloaterTools->dirty(); @@ -5853,6 +5861,27 @@ void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom)  	gAgent.mHUDCurZoom = current_zoom;  } +///////////////////////////////////////////////////////////////////////////// +// Object selection iterator helpers +///////////////////////////////////////////////////////////////////////////// +bool LLObjectSelection::is_root::operator()(LLSelectNode *node) +{ +	LLViewerObject* object = node->getObject(); +	return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); +} + +bool LLObjectSelection::is_valid_root::operator()(LLSelectNode *node) +{ +	LLViewerObject* object = node->getObject(); +	return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); +} + +bool LLObjectSelection::is_root_object::operator()(LLSelectNode *node) +{ +	LLViewerObject* object = node->getObject(); +	return (object != NULL) && (object->isRootEdit() || object->isJointChild()); +} +  LLObjectSelection::LLObjectSelection() :   	LLRefCount(),  	mSelectType(SELECT_TYPE_WORLD) diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index 9e02170d74..26ac95060f 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -35,7 +35,6 @@  #include "llcharacter.h"  #include "lleditmenuhandler.h" -#include "llstring.h"  #include "llundo.h"  #include "lluuid.h"  #include "llpointer.h" @@ -48,14 +47,15 @@  #include "llframetimer.h"  #include "llbbox.h"  #include "llpermissions.h" -#include "llviewerobject.h"  #include "llcontrol.h" +#include "llviewerobject.h"	// LLObjectSelection::getSelectedTEValue template +  #include <deque> -#include "boost/iterator/filter_iterator.hpp" +#include <boost/iterator/filter_iterator.hpp> +#include <boost/signals2.hpp>  class LLMessageSystem;  class LLViewerTexture; -class LLViewerObject;  class LLColor4;  class LLVector3;  class LLSelectNode; @@ -203,13 +203,9 @@ class LLObjectSelection : public LLRefCount  protected:  	~LLObjectSelection(); -	// List  public:  	typedef std::list<LLSelectNode*> list_t; -private: -	list_t mList; -public:  	// Iterators  	struct is_non_null  	{ @@ -235,11 +231,7 @@ public:  	struct is_root  	{ -		bool operator()(LLSelectNode* node) -		{ -			LLViewerObject* object = node->getObject(); -			return (object != NULL) && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); -		} +		bool operator()(LLSelectNode* node);  	};  	typedef boost::filter_iterator<is_root, list_t::iterator > root_iterator;  	root_iterator root_begin() { return root_iterator(mList.begin(), mList.end()); } @@ -247,11 +239,7 @@ public:  	struct is_valid_root  	{ -		bool operator()(LLSelectNode* node) -		{ -			LLViewerObject* object = node->getObject(); -			return (object != NULL) && node->mValid && !node->mIndividualSelection && (object->isRootEdit() || object->isJointChild()); -		} +		bool operator()(LLSelectNode* node);  	};  	typedef boost::filter_iterator<is_root, list_t::iterator > valid_root_iterator;  	valid_root_iterator valid_root_begin() { return valid_root_iterator(mList.begin(), mList.end()); } @@ -259,11 +247,7 @@ public:  	struct is_root_object  	{ -		bool operator()(LLSelectNode* node) -		{ -			LLViewerObject* object = node->getObject(); -			return (object != NULL) && (object->isRootEdit() || object->isJointChild()); -		} +		bool operator()(LLSelectNode* node);  	};  	typedef boost::filter_iterator<is_root_object, list_t::iterator > root_object_iterator;  	root_object_iterator root_object_begin() { return root_object_iterator(mList.begin(), mList.end()); } @@ -326,6 +310,7 @@ public:  	ESelectType getSelectType() const { return mSelectType; }  private: +	list_t mList;  	const LLObjectSelection &operator=(const LLObjectSelection &);  	LLPointer<LLViewerObject> mPrimaryObject; @@ -398,13 +383,16 @@ public:  	// Add  	//////////////////////////////////////////////////////////////// -	// For when you want just a child object. -	LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES); -  	// This method is meant to select an object, and then select all -	// of the ancestors and descendents. This should be the normal behavior. +	// of the ancestors and descendants. This should be the normal behavior. +	// +	// *NOTE: You must hold on to the object selection handle, otherwise +	// the objects will be automatically deselected in 1 frame.  	LLObjectSelectionHandle selectObjectAndFamily(LLViewerObject* object, BOOL add_to_end = FALSE); +	// For when you want just a child object. +	LLObjectSelectionHandle selectObjectOnly(LLViewerObject* object, S32 face = SELECT_ALL_TES); +  	// Same as above, but takes a list of objects.  Used by rectangle select.  	LLObjectSelectionHandle selectObjectAndFamily(const std::vector<LLViewerObject*>& object_list, BOOL send_to_sim = TRUE); @@ -691,7 +679,13 @@ private:  	static void packPermissionsHead(void* user_data);  	static void packGodlikeHead(void* user_data);  	static bool confirmDelete(const LLSD& notification, const LLSD& response, LLObjectSelectionHandle handle); -	 + +public: +	// Observer/callback support for when object selection changes or +	// properties are received/updated +	typedef boost::signals2::signal< void ()> update_signal_t; +	update_signal_t mUpdateSignal; +  private:  	LLPointer<LLViewerTexture>				mSilhouetteImagep;  	LLObjectSelectionHandle					mSelectedObjects; @@ -723,8 +717,10 @@ private:  	LLAnimPauseRequest		mPauseRequest;  }; -// Utilities -void dialog_refresh_all();		// Update subscribers to the selection list +// *DEPRECATED: For callbacks or observers, use +// LLSelectMgr::getInstance()->mUpdateSignal.connect( callback ) +// Update subscribers to the selection list +void dialog_refresh_all();		  // Templates  //----------------------------------------------------------------------------- diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 836fe9729d..37e268ad34 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -106,6 +106,14 @@ std::string LLSLURL::buildSLURL(const std::string& regionname, S32 x, S32 y, S32  }  // static +std::string LLSLURL::buildCommand(const char* noun, const LLUUID& id, const char* verb) +{ +	std::string slurl = llformat("secondlife:///app/%s/%s/%s", +		noun, id.asString().c_str(), verb); +	return slurl; +} + +// static  std::string LLSLURL::buildUnescapedSLURL(const std::string& regionname, S32 x, S32 y, S32 z)  {  	std::string unescapedslurl = PREFIX_SLURL + regionname + llformat("/%d/%d/%d",x,y,z); diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index 8af2bdfb83..05b0143e72 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -73,6 +73,9 @@ public:  	 */  	static std::string buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z); +	/// Build a SLURL like secondlife:///app/agent/<uuid>/inspect +	static std::string buildCommand(const char* noun, const LLUUID& id, const char* verb); +  	/**  	 * builds: http://slurl.com/secondlife/Region Name/x/y/z/ without escaping result url.  	 */ diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 053b863b6d..62435c6288 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -195,6 +195,10 @@  #include "lldxhardware.h"  #endif +#if (LL_LINUX || LL_SOLARIS) && LL_GTK +#include <glib/gspawn.h> +#endif +  //  // exported globals  // @@ -1824,9 +1828,9 @@ bool idle_startup()  		{  			gCacheName = new LLCacheName(gMessageSystem);  			gCacheName->addObserver(&callback_cache_name); -			gCacheName->LocalizeCacheName("waiting", LLTrans::getString("CacheWaiting")); -			gCacheName->LocalizeCacheName("nobody", LLTrans::getString("CacheNobody")); -			gCacheName->LocalizeCacheName("none", LLTrans::getString("CacheNone")); +			gCacheName->LocalizeCacheName("waiting", LLTrans::getString("AvatarNameWaiting")); +			gCacheName->LocalizeCacheName("nobody", LLTrans::getString("AvatarNameNobody")); +			gCacheName->LocalizeCacheName("none", LLTrans::getString("GroupNameNone"));  			// Load stored cache if possible              LLAppViewer::instance()->loadNameCache();  		} diff --git a/indra/newview/llstylemap.cpp b/indra/newview/llstylemap.cpp index fc125dcf9c..2485563cbc 100644 --- a/indra/newview/llstylemap.cpp +++ b/indra/newview/llstylemap.cpp @@ -33,8 +33,10 @@  #include "llviewerprecompiledheaders.h"  #include "llstylemap.h" +  #include "llstring.h"  #include "llui.h" +#include "llslurl.h"  #include "llviewercontrol.h"  #include "llagent.h" @@ -47,7 +49,8 @@ const LLStyle::Params &LLStyleMap::lookupAgent(const LLUUID &source)  		if (source != LLUUID::null && source != gAgent.getID() )  		{  			style_params.color.control = "HTMLLinkColor"; -			style_params.link_href = llformat("secondlife:///app/agent/%s/about",source.asString().c_str()); +			style_params.link_href =  +					LLSLURL::buildCommand("agent", source, "inspect");  		}  		else  		{ @@ -55,7 +58,7 @@ const LLStyle::Params &LLStyleMap::lookupAgent(const LLUUID &source)  			style_params.color = LLColor4::white;  		} -		mMap[source] = LLStyle::Params(); +		mMap[source] = style_params;  	}  	return mMap[source];  } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1b47fa43c7..9fc91e2971 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -882,7 +882,7 @@ LLTextureCtrl::LLTextureCtrl(const LLTextureCtrl::Params& p)  	LLTextBox::Params params(p.caption_text);  	params.name(p.label);  	params.rect(LLRect( 0, BTN_HEIGHT_SMALL, getRect().getWidth(), 0 )); -	params.text(p.label); +	params.initial_value(p.label());  	params.follows.flags(FOLLOWS_LEFT | FOLLOWS_RIGHT | FOLLOWS_BOTTOM);  	mCaption = LLUICtrlFactory::create<LLTextBox> (params);  	addChild( mCaption ); diff --git a/indra/newview/lltoastalertpanel.cpp b/indra/newview/lltoastalertpanel.cpp index 4309f56710..d9be6b172c 100644 --- a/indra/newview/lltoastalertpanel.cpp +++ b/indra/newview/lltoastalertpanel.cpp @@ -168,6 +168,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal  	params.name("Alert message");  	params.font(font);  	params.tab_stop(false); +	params.wrap(true);  	params.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP);  	LLTextBox * msg_box = LLUICtrlFactory::create<LLTextBox> (params); @@ -178,7 +179,7 @@ LLToastAlertPanel::LLToastAlertPanel( LLNotificationPtr notification, bool modal  			- LINE_HEIGHT			// title bar  			- 3*VPAD - BTN_HEIGHT;  	msg_box->reshape( MAX_ALLOWED_MSG_WIDTH, max_allowed_msg_height ); -	msg_box->setWrappedText(msg, (F32)MAX_ALLOWED_MSG_WIDTH); +	msg_box->setValue(msg);  	msg_box->reshapeToFitText();  	const LLRect& text_rect = msg_box->getRect(); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 9761a45d83..86b162247a 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -144,10 +144,11 @@ LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification) : LLToas  		params.mouse_opaque(false);  		params.font.style("BOLD");  		params.text_color(LLUIColorTable::instance().getColor("NotifyCautionWarnColor")); -		params.background_color(LLUIColorTable::instance().getColor("NotifyCautionBoxColor")); +		params.bg_readonly_color(LLUIColorTable::instance().getColor("NotifyCautionBoxColor"));  		params.border_visible(false); +		params.wrap(true);  		caution_box = LLUICtrlFactory::create<LLTextBox> (params); -		caution_box->setWrappedText(notification->getMessage()); +		caution_box->setValue(notification->getMessage());  		addChild(caution_box); @@ -175,13 +176,13 @@ LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification) : LLToas  		params.default_text(mMessage);  		params.font(sFont);  		params.embedded_items(false); -		params.word_wrap(true); +		params.wrap(true);  		params.tab_stop(false);  		params.mouse_opaque(false);  		params.bg_readonly_color(LLColor4::transparent);  		params.text_readonly_color(LLUIColorTable::instance().getColor("NotifyTextColor"));  		params.enabled(false); -		params.hide_border(true); +		params.border_visible(false);  		text = LLUICtrlFactory::create<LLTextEditor> (params);  		addChild(text);  	} diff --git a/indra/newview/lltoastpanel.cpp b/indra/newview/lltoastpanel.cpp index e884d89ce4..68ad043129 100644 --- a/indra/newview/lltoastpanel.cpp +++ b/indra/newview/lltoastpanel.cpp @@ -56,7 +56,7 @@ void LLToastPanel::snapToMessageHeight(LLTextBox* message, S32 maxLineCount)  	if (message->getVisible())  	{  		S32 heightDelta = 0; -		S32 maxTextHeight = (S32)(message->getFont()->getLineHeight() * maxLineCount); +		S32 maxTextHeight = (S32)(message->getDefaultFont()->getLineHeight() * maxLineCount);  		LLRect messageRect = message->getRect();  		S32 oldTextHeight = messageRect.getHeight(); diff --git a/indra/newview/lltool.cpp b/indra/newview/lltool.cpp index 880d5d5e12..669a62a238 100644 --- a/indra/newview/lltool.cpp +++ b/indra/newview/lltool.cpp @@ -155,7 +155,7 @@ BOOL LLTool::handleMiddleMouseUp(S32 x, S32 y, MASK mask)  	return FALSE;  } -BOOL LLTool::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) +BOOL LLTool::handleToolTip(S32 x, S32 y, MASK mask)  {  	// by default, didn't handle it  	// llinfos << "LLTool::handleToolTip" << llendl; diff --git a/indra/newview/lltool.h b/indra/newview/lltool.h index bef4a2e1fd..c3573cd38c 100644 --- a/indra/newview/lltool.h +++ b/indra/newview/lltool.h @@ -66,7 +66,7 @@ public:  	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask);  	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);  	virtual BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask); -	virtual BOOL	handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); +	virtual BOOL	handleToolTip(S32 x, S32 y, MASK mask);  		// Return FALSE to allow context menu to be shown.  	virtual void	screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const @@ -74,7 +74,7 @@ public:  	virtual void	localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const  							{ *screen_x = local_x; *screen_y = local_y;	} -	virtual const std::string& getName() const	{ return mName; } +	virtual std::string getName() const	{ return mName; }  	// New virtual functions  	virtual LLViewerObject*	getEditingObject()		{ return NULL; } diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index c7c9f07504..0572f9a698 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -271,6 +271,7 @@ void LLToolBar::updateCommunicateList()  	contact_sd["columns"][0]["value"] = LLFloaterMyFriends::getInstance()->getShortTitle();   	if (LLFloaterMyFriends::getInstance() == frontmost_floater)  	{ +		contact_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL";   		contact_sd["columns"][0]["font"]["style"] = "BOLD";   		// make sure current tab is selected in list  		if (selected.isUndefined()) @@ -286,6 +287,7 @@ void LLToolBar::updateCommunicateList()  	if (LLFloaterChat::getInstance() == frontmost_floater)  	{ +		communicate_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL";  		communicate_sd["columns"][0]["font"]["style"] = "BOLD";  		if (selected.isUndefined())  		{ @@ -318,6 +320,7 @@ void LLToolBar::updateCommunicateList()  			im_sd["columns"][0]["value"] = floater_title;  			if (im_floaterp  == frontmost_floater)  			{ +				im_sd["columns"][0]["font"]["name"] = "SANSSERIF_SMALL";  				im_sd["columns"][0]["font"]["style"] = "BOLD";  				if (selected.isUndefined())  				{ diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index c3064ffa43..bc0a654eb9 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -762,11 +762,11 @@ BOOL LLToolDragAndDrop::handleKey(KEY key, MASK mask)  	return FALSE;  } -BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) +BOOL LLToolDragAndDrop::handleToolTip(S32 x, S32 y, MASK mask)  {  	if (!mToolTipMsg.empty())  	{ -		LLToolTipMgr::instance().show(LLToolTipParams() +		LLToolTipMgr::instance().show(LLToolTip::Params()  			.message(mToolTipMsg)  			.delay_time(gSavedSettings.getF32( "DragAndDropToolTipDelay" )));  		return TRUE; diff --git a/indra/newview/lltooldraganddrop.h b/indra/newview/lltooldraganddrop.h index acf01869e7..e1536acf75 100644 --- a/indra/newview/lltooldraganddrop.h +++ b/indra/newview/lltooldraganddrop.h @@ -59,7 +59,7 @@ public:  	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);  	virtual BOOL	handleHover(S32 x, S32 y, MASK mask);  	virtual BOOL	handleKey(KEY key, MASK mask); -	virtual BOOL	handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); +	virtual BOOL	handleToolTip(S32 x, S32 y, MASK mask);  	virtual void	onMouseCaptureLost();  	virtual void	handleDeselect(); diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index d5db224143..5525c359fc 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -70,9 +70,6 @@  #include "llworld.h"  #include "llui.h"  #include "llweb.h" -#include "llinspectavatar.h" - -extern void handle_buy(void*);  extern BOOL gDebugClicks; @@ -212,7 +209,7 @@ BOOL LLToolPie::pickLeftMouseDownCallback()  		case CLICK_ACTION_SIT:  			if ((gAgent.getAvatarObject() != NULL) && (!gAgent.getAvatarObject()->isSitting())) // agent not already sitting  			{ -				handle_sit_or_stand(); +				handle_object_sit_or_stand();  				// put focus in world when sitting on an object  				gFocusMgr.setKeyboardFocus(NULL);  				return TRUE; @@ -456,7 +453,7 @@ void LLToolPie::selectionPropertiesReceived()  			switch (click_action)  			{  			case CLICK_ACTION_BUY: -				handle_buy(NULL); +				handle_buy();  				break;  			case CLICK_ACTION_PAY:  				handle_give_money_dialog(); @@ -586,10 +583,39 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask)  	return FALSE;  } -//FIXME - RN: get this in LLToolSelectLand too or share some other way? -const char* DEFAULT_DESC = "(No Description)"; +static bool needs_tooltip(LLSelectNode* nodep) +{ +	LLViewerObject* object = nodep->getObject(); +	LLViewerObject *parent = (LLViewerObject *)object->getParent(); +	if (object->flagHandleTouch() +		|| (parent && parent->flagHandleTouch()) +		|| object->flagTakesMoney() +		|| (parent && parent->flagTakesMoney()) +		|| object->flagAllowInventoryAdd() +		) +	{ +		return true; +	} + +	U8 click_action = final_click_action(object); +	if (click_action != 0) +	{ +		return true; +	} + +	if (nodep->mValid) +	{ +		bool anyone_copy = anyone_copy_selection(nodep); +		bool for_sale = for_sale_selection(nodep); +		if (anyone_copy || for_sale) +		{ +			return true; +		} +	} +	return false; +} -BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect& sticky_rect_screen) +BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask)  {  	if (!LLUI::sSettingGroups["config"]->getBOOL("ShowHoverTips")) return TRUE;  	if (!mHoverPick.isValid()) return TRUE; @@ -636,8 +662,11 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect  		line.clear();  		if (hover_object->isAvatar())  		{ -			// only show tooltip if inspector not already open -			if (!LLFloaterReg::instanceVisible("inspect_avatar")) +			// only show tooltip if same inspector not already open +			LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_avatar"); +			if (!existing_inspector  +				|| !existing_inspector->getVisible() +				|| existing_inspector->getKey()["avatar_id"].asUUID() != hover_object->getID())  			{  				std::string avatar_name;  				LLNameValue* firstname = hover_object->getNVPair("FirstName"); @@ -650,12 +679,15 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect  				{  					avatar_name = LLTrans::getString("TooltipPerson");  				} -				LLToolTipParams params; -				params.message(avatar_name); -				params.image.name("Info"); -				params.sticky_rect(gViewerWindow->getVirtualWorldViewRect()); -				params.click_callback(boost::bind(showAvatarInspector, hover_object->getID())); -				LLToolTipMgr::instance().show(params); + +				// *HACK: We may select this object, so pretend it was clicked +				mPick = mHoverPick; +				LLToolTipMgr::instance().show(LLToolTip::Params() +					.message(avatar_name) +					.image(LLUI::getUIImage("Info")) +					.click_callback(boost::bind(showAvatarInspector, hover_object->getID())) +					.visible_time_near(6.f) +					.visible_time_far(3.f));  			}  		}  		else @@ -667,177 +699,38 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect  			//  			//  Default prefs will suppress display unless the object is interactive  			// -			BOOL suppressObjectHoverDisplay = !gSavedSettings.getBOOL("ShowAllObjectHoverTip");			 -			 +			bool show_all_object_tips = +				(bool)gSavedSettings.getBOOL("ShowAllObjectHoverTip");			  			LLSelectNode *nodep = LLSelectMgr::getInstance()->getHoverNode(); -			if (nodep) +			 +			// only show tooltip if same inspector not already open +			LLFloater* existing_inspector = LLFloaterReg::findInstance("inspect_object"); +			if (nodep && +				(!existing_inspector  +					|| !existing_inspector->getVisible() +					|| existing_inspector->getKey()["object_id"].asUUID() != hover_object->getID()))  			{ -				line.clear();  				if (nodep->mName.empty())  				{ -					line.append(LLTrans::getString("TooltipNoName")); -				} -				else -				{ -					line.append( nodep->mName ); -				} -				tooltip_msg.append(line); -				tooltip_msg.push_back('\n'); - -				if (!nodep->mDescription.empty() -					&& nodep->mDescription != DEFAULT_DESC) -				{ -					tooltip_msg.append( nodep->mDescription ); -					tooltip_msg.push_back('\n'); -				} - -				// Line: "Owner: James Linden" -				line.clear(); -				line.append(LLTrans::getString("TooltipOwner") + " "); - -				if (nodep->mValid) -				{ -					LLUUID owner; -					std::string name; -					if (!nodep->mPermissions->isGroupOwned()) -					{ -						owner = nodep->mPermissions->getOwner(); -						if (LLUUID::null == owner) -						{ -							line.append(LLTrans::getString("TooltipPublic")); -						} -						else if(gCacheName->getFullName(owner, name)) -						{ -							line.append(name); -						} -						else -						{ -							line.append(LLTrans::getString("RetrievingData")); -						} -					} -					else -					{ -						std::string name; -						owner = nodep->mPermissions->getGroup(); -						if (gCacheName->getGroupName(owner, name)) -						{ -							line.append(name); -							line.append(LLTrans::getString("TooltipIsGroup")); -						} -						else -						{ -							line.append(LLTrans::getString("RetrievingData")); -						} -					} +					tooltip_msg.append(LLTrans::getString("TooltipNoName"));  				}  				else  				{ -					line.append(LLTrans::getString("RetrievingData")); +					tooltip_msg.append( nodep->mName );  				} -				tooltip_msg.append(line); -				tooltip_msg.push_back('\n'); -				// Build a line describing any special properties of this object. -				LLViewerObject *object = hover_object; -				LLViewerObject *parent = (LLViewerObject *)object->getParent(); - -				if (object && -					(object->usePhysics() || -					 object->flagScripted() ||  -					 object->flagHandleTouch() || (parent && parent->flagHandleTouch()) || -					 object->flagTakesMoney() || (parent && parent->flagTakesMoney()) || -					 object->flagAllowInventoryAdd() || -					 object->flagTemporary() || -					 object->flagPhantom()) ) -				{ -					line.clear(); -					if (object->flagScripted()) -					{ -						line.append(LLTrans::getString("TooltipFlagScript") + " "); -					} - -					if (object->usePhysics()) -					{ -						line.append(LLTrans::getString("TooltipFlagPhysics") + " "); -					} - -					if (object->flagHandleTouch() || (parent && parent->flagHandleTouch()) ) -					{ -						line.append(LLTrans::getString("TooltipFlagTouch") + " "); -						suppressObjectHoverDisplay = FALSE;		//  Show tip -					} - -					if (object->flagTakesMoney() || (parent && parent->flagTakesMoney()) ) -					{ -						line.append(LLTrans::getString("TooltipFlagL$") + " "); -						suppressObjectHoverDisplay = FALSE;		//  Show tip -					} - -					if (object->flagAllowInventoryAdd()) -					{ -						line.append(LLTrans::getString("TooltipFlagDropInventory") + " "); -						suppressObjectHoverDisplay = FALSE;		//  Show tip -					} - -					if (object->flagPhantom()) -					{ -						line.append(LLTrans::getString("TooltipFlagPhantom") + " "); -					} - -					if (object->flagTemporary()) -					{ -						line.append(LLTrans::getString("TooltipFlagTemporary") + " "); -					} - -					if (object->usePhysics() ||  -						object->flagHandleTouch() || -						(parent && parent->flagHandleTouch()) ) -					{ -						line.append(LLTrans::getString("TooltipFlagRightClickMenu") + " "); -					} -					tooltip_msg.append(line); -					tooltip_msg.push_back('\n'); -				} - -				// Free to copy / For Sale: L$ -				line.clear(); -				if (nodep->mValid) -				{ -					BOOL for_copy = nodep->mPermissions->getMaskEveryone() & PERM_COPY && object->permCopy(); -					BOOL for_sale = nodep->mSaleInfo.isForSale() && -									nodep->mPermissions->getMaskOwner() & PERM_TRANSFER && -									(nodep->mPermissions->getMaskOwner() & PERM_COPY || -									 nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY); -					if (for_copy) -					{ -						line.append(LLTrans::getString("TooltipFreeToCopy")); -						suppressObjectHoverDisplay = FALSE;		//  Show tip -					} -					else if (for_sale) -					{ -						LLStringUtil::format_map_t args; -						args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice()); -						line.append(LLTrans::getString("TooltipForSaleL$", args)); -						suppressObjectHoverDisplay = FALSE;		//  Show tip -					} -					else -					{ -						// Nothing if not for sale -						// line.append("Not for sale"); -					} -				} -				else -				{ -					LLStringUtil::format_map_t args; -					args["[MESSAGE]"] = LLTrans::getString("RetrievingData"); -					line.append(LLTrans::getString("TooltipForSaleMsg", args)); -				} -				tooltip_msg.append(line); -				tooltip_msg.push_back('\n'); +				bool needs_tip = needs_tooltip(nodep); -				if (!suppressObjectHoverDisplay) +				if (show_all_object_tips || needs_tip)  				{ -					LLToolTipMgr::instance().show(tooltip_msg); +					// We may select this object, so pretend it was clicked +					mPick = mHoverPick; +					LLToolTipMgr::instance().show(LLToolTip::Params() +						.message(tooltip_msg) +						.image(LLUI::getUIImage("Info")) +						.click_callback(boost::bind(showObjectInspector, hover_object->getID())) +						.visible_time_near(6.f) +						.visible_time_far(3.f));  				}  			}  		} @@ -990,18 +883,23 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, std::string& msg, LLRect  			tooltip_msg.append(line);  			tooltip_msg.push_back('\n');  		} -		LLToolTipMgr::instance().show(tooltip_msg); + +		// trim last newlines +		if (!tooltip_msg.empty()) +		{ +			tooltip_msg.erase(tooltip_msg.size() - 1); +			LLToolTipMgr::instance().show(tooltip_msg); +		}  	}  	return TRUE;  } -// static -void LLToolPie::showAvatarInspector(const LLUUID& avatar_id) +static void show_inspector(const char* inspector, const char* param, const LLUUID& source_id)  {  	LLSD params; -	params["avatar_id"] = avatar_id; +	params[param] = source_id;  	if (LLToolTipMgr::instance().toolTipVisible())  	{  		LLRect rect = LLToolTipMgr::instance().getToolTipRect(); @@ -1009,7 +907,19 @@ void LLToolPie::showAvatarInspector(const LLUUID& avatar_id)  		params["pos"]["y"] = rect.mTop;  	} -	LLFloaterReg::showInstance("inspect_avatar", params); +	LLFloaterReg::showInstance(inspector, params); +} + +// static +void LLToolPie::showAvatarInspector(const LLUUID& avatar_id) +{ +	show_inspector("inspect_avatar", "avatar_id", avatar_id); +} + +// static +void LLToolPie::showObjectInspector(const LLUUID& object_id) +{ +	show_inspector("inspect_object", "object_id", object_id);  }  void LLToolPie::handleDeselect() diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index f6a67c13b1..5faedbec5a 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -55,7 +55,7 @@ public:  	virtual BOOL		handleHover(S32 x, S32 y, MASK mask);  	virtual BOOL		handleDoubleClick(S32 x, S32 y, MASK mask);  	virtual BOOL		handleScrollWheel(S32 x, S32 y, S32 clicks); -	virtual BOOL		handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); +	virtual BOOL		handleToolTip(S32 x, S32 y, MASK mask);  	virtual void		render(); @@ -76,7 +76,8 @@ public:  	static void			selectionPropertiesReceived(); -	static void			showAvatarInspector(const LLUUID& id); +	static void			showAvatarInspector(const LLUUID& avatar_id); +	static void			showObjectInspector(const LLUUID& object_id);  private:  	BOOL outsideSlop		(S32 x, S32 y, S32 start_x, S32 start_y);  	BOOL pickLeftMouseDownCallback(); diff --git a/indra/newview/lltoolpipette.cpp b/indra/newview/lltoolpipette.cpp index 9a92f2ae3f..beebb47537 100644 --- a/indra/newview/lltoolpipette.cpp +++ b/indra/newview/lltoolpipette.cpp @@ -93,7 +93,7 @@ BOOL LLToolPipette::handleHover(S32 x, S32 y, MASK mask)  	return FALSE;  } -BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect &sticky_rect_screen) +BOOL LLToolPipette::handleToolTip(S32 x, S32 y, MASK mask)  {  	if (mTooltipMsg.empty())  	{ @@ -102,7 +102,7 @@ BOOL LLToolPipette::handleToolTip(S32 x, S32 y, std::string& msg, LLRect &sticky  	LLRect sticky_rect;  	sticky_rect.setCenterAndSize(x, y, 20, 20); -	LLToolTipMgr::instance().show(LLToolTipParams() +	LLToolTipMgr::instance().show(LLToolTip::Params()  		.message(mTooltipMsg)  		.sticky_rect(sticky_rect)); diff --git a/indra/newview/lltoolpipette.h b/indra/newview/lltoolpipette.h index cce5b6ce54..f86939cfeb 100644 --- a/indra/newview/lltoolpipette.h +++ b/indra/newview/lltoolpipette.h @@ -56,7 +56,7 @@ public:  	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);  	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);  	virtual BOOL	handleHover(S32 x, S32 y, MASK mask); -	virtual BOOL	handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen); +	virtual BOOL	handleToolTip(S32 x, S32 y, MASK mask);  	// Note: Don't return connection; use boost::bind + boost::signals2::trackable to disconnect slots  	typedef boost::signals2::signal<void (const LLTextureEntry& te)> signal_t; diff --git a/indra/newview/lluploaddialog.cpp b/indra/newview/lluploaddialog.cpp index 153e3e7382..577b5952e5 100644 --- a/indra/newview/lluploaddialog.cpp +++ b/indra/newview/lluploaddialog.cpp @@ -82,7 +82,7 @@ LLUploadDialog::LLUploadDialog( const std::string& msg)  		LLTextBox::Params params;  		params.name("Filename");  		params.rect(msg_rect); -		params.text("Filename"); +		params.initial_value("Filename");  		params.font(font);  		mLabelBox[line_num] = LLUICtrlFactory::create<LLTextBox> (params);  		addChild(mLabelBox[line_num]); diff --git a/indra/newview/llviewchildren.cpp b/indra/newview/llviewchildren.cpp index 842ffc7f9a..41eafa871d 100644 --- a/indra/newview/llviewchildren.cpp +++ b/indra/newview/llviewchildren.cpp @@ -74,17 +74,6 @@ void LLViewChildren::setText(  	}  } -void LLViewChildren::setWrappedText( -	const std::string& id, const std::string& text, bool visible) -{ -	LLTextBox* child = mParent.getChild<LLTextBox>(id); -	if (child) -	{ -		child->setVisible(visible); -		child->setWrappedText(text); -	} -} -  void LLViewChildren::setBadge(const std::string& id, Badge badge, bool visible)  {  	LLIconCtrl* child = mParent.getChild<LLIconCtrl>(id); diff --git a/indra/newview/llviewchildren.h b/indra/newview/llviewchildren.h index 9263d77bdc..6cfa535a94 100644 --- a/indra/newview/llviewchildren.h +++ b/indra/newview/llviewchildren.h @@ -53,8 +53,6 @@ public:  	// LLTextBox  	void setText(const std::string& id,  		const std::string& text, bool visible = true); -	void setWrappedText(const std::string& id, -		const std::string& text, bool visible = true);  	// LLIconCtrl  	enum Badge { BADGE_OK, BADGE_NOTE, BADGE_WARN, BADGE_ERROR }; diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 2f656479f6..0b21f3565d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -110,6 +110,7 @@  #include "llfloaterwindlight.h"  #include "llfloaterworldmap.h"  #include "llinspectavatar.h" +#include "llinspectobject.h"  #include "llmediaremotectrl.h"  #include "llmoveview.h"  #include "llnearbychat.h" @@ -172,8 +173,8 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("impanel", "floater_im_session.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIMFloater>);  	LLFloaterReg::add("inventory", "floater_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventory>);  	LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); -	LLFloaterReg::add("inspect_avatar", "inspect_avatar.xml", -		&LLFloaterReg::build<LLInspectAvatar>); +	LLInspectAvatarUtil::registerFloater(); +	LLInspectObjectUtil::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/llviewerjoystick.cpp b/indra/newview/llviewerjoystick.cpp index 9f7e4d338b..b919e3d1c1 100644 --- a/indra/newview/llviewerjoystick.cpp +++ b/indra/newview/llviewerjoystick.cpp @@ -282,7 +282,7 @@ void LLViewerJoystick::terminate()  	ndof_libcleanup();  	llinfos << "Terminated connection with NDOF device." << llendl; - +	mDriverState = JDS_UNINITIALIZED;  #endif  } diff --git a/indra/newview/llviewerjoystick.h b/indra/newview/llviewerjoystick.h index 6be9db3313..b565ed5696 100644 --- a/indra/newview/llviewerjoystick.h +++ b/indra/newview/llviewerjoystick.h @@ -56,6 +56,8 @@ public:  	virtual ~LLViewerJoystick();  	void init(bool autoenable); +	void terminate(); +  	void updateStatus();  	void scanJoystick();  	void moveObjects(bool reset = false); @@ -76,7 +78,6 @@ public:  protected:  	void updateEnabled(bool autoenable); -	void terminate();  	void handleRun(F32 inc);  	void agentSlide(F32 inc);  	void agentPush(F32 inc); diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 775f72d56f..c9ba5841e9 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -193,12 +193,11 @@ public:  	/*virtual*/ BOOL	handleDoubleClick(S32 x, S32 y, MASK mask) { return FALSE; };  	/*virtual*/ BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };  	/*virtual*/ BOOL	handleRightMouseUp(S32 x, S32 y, MASK mask) { return FALSE; }; -	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen) { return FALSE; }; +	/*virtual*/ BOOL	handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; };  	/*virtual*/ BOOL	handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; };  	/*virtual*/ BOOL	handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; }; -	/*virtual*/ const std::string& getName() const { return LLStringUtil::null; }; +	/*virtual*/ std::string getName() const { return LLStringUtil::null; }; -	/*virtual*/ BOOL isView() const { return FALSE; };  	/*virtual*/ void	screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {};  	/*virtual*/ void	localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {};  	/*virtual*/ BOOL hasMouseCapture() { return gFocusMgr.getMouseCapture() == this; }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 12253455a3..d95992412f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -80,6 +80,7 @@  #include "lldrawpoolalpha.h"  #include "lldrawpooltree.h"  #include "llface.h" +#include "llfilepicker.h"  #include "llfirstuse.h"  #include "llfirsttimetipmanager.h"  #include "llfloater.h" @@ -295,8 +296,7 @@ S32 selection_price();  BOOL enable_take();  void handle_take();  bool confirm_take(const LLSD& notification, const LLSD& response); -BOOL enable_buy(void*);  -void handle_buy(void *); +  void handle_buy_object(LLSaleInfo sale_info);  void handle_buy_contents(LLSaleInfo sale_info); @@ -2490,12 +2490,10 @@ class LLObjectEnableReportAbuse : public view_listener_t  	}  }; -class LLObjectTouch : public view_listener_t +void handle_object_touch()  { -	bool handleEvent(const LLSD& userdata) -	{  		LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -		if (!object) return true; +		if (!object) return;  		LLPickInfo pick = LLToolPie::getInstance()->getPick(); @@ -2534,19 +2532,20 @@ class LLObjectTouch : public view_listener_t  		msg->addVector3("Normal", pick.mNormal);  		msg->addVector3("Binormal", pick.mBinormal);  		msg->sendMessage(object->getRegion()->getHost()); +} -		return true; -	} -}; - +bool enable_object_touch() +{ +	LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +	return obj && obj->flagHandleTouch(); +}  // One object must have touch sensor  class LLObjectEnableTouch : public view_listener_t  {  	bool handleEvent(const LLSD& userdata)  	{ -		LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -		bool new_value = obj && obj->flagHandleTouch(); +		bool new_value = enable_object_touch();  		// Update label based on the node touch name if available.  		std::string touch_text; @@ -2596,23 +2595,18 @@ class LLObjectOpen : public view_listener_t  	}  };  */ -class LLObjectEnableOpen : public view_listener_t +bool enable_object_open()  { -	bool handleEvent(const LLSD& userdata) -	{ -		// Look for contents in root object, which is all the LLFloaterOpenObject -		// understands. -		LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -		bool new_value = (obj != NULL); -		if (new_value) -		{ -			LLViewerObject* root = obj->getRootEdit(); -			if (!root) new_value = false; -			else new_value = root->allowOpen(); -		} -		return new_value; -	} -}; +	// Look for contents in root object, which is all the LLFloaterOpenObject +	// understands. +	LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +	if (!obj) return false; + +	LLViewerObject* root = obj->getRootEdit(); +	if (!root) return false; + +	return root->allowOpen(); +}  class LLViewJoystickFlycam : public view_listener_t @@ -2666,52 +2660,50 @@ class LLObjectBuild : public view_listener_t  	}  }; -class LLObjectEdit : public view_listener_t + +void handle_object_edit()  { -	bool handleEvent(const LLSD& userdata) +	LLViewerParcelMgr::getInstance()->deselectLand(); + +	if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit())  	{ -		LLViewerParcelMgr::getInstance()->deselectLand(); +		LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); -		if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit()) +		if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement"))  		{ -			LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); - -			if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) -			{ -				// always freeze camera in space, even if camera doesn't move -				// so, for example, follow cam scripts can't affect you when in build mode -				gAgent.setFocusGlobal(gAgent.calcFocusPositionTargetGlobal(), LLUUID::null); -				gAgent.setFocusOnAvatar(FALSE, ANIMATE); -			} -			else +			// always freeze camera in space, even if camera doesn't move +			// so, for example, follow cam scripts can't affect you when in build mode +			gAgent.setFocusGlobal(gAgent.calcFocusPositionTargetGlobal(), LLUUID::null); +			gAgent.setFocusOnAvatar(FALSE, ANIMATE); +		} +		else +		{ +			gAgent.setFocusOnAvatar(FALSE, ANIMATE); +			LLViewerObject* selected_objectp = selection->getFirstRootObject(); +			if (selected_objectp)  			{ -				gAgent.setFocusOnAvatar(FALSE, ANIMATE); -				LLViewerObject* selected_objectp = selection->getFirstRootObject(); -				if (selected_objectp) -				{ -				// zoom in on object center instead of where we clicked, as we need to see the manipulator handles -					gAgent.setFocusGlobal(selected_objectp->getPositionGlobal(), selected_objectp->getID()); -				gAgent.cameraZoomIn(0.666f); -				gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); -				gViewerWindow->moveCursorToCenter(); +			  // zoom in on object center instead of where we clicked, as we need to see the manipulator handles +			  gAgent.setFocusGlobal(selected_objectp->getPositionGlobal(), selected_objectp->getID()); +			  gAgent.cameraZoomIn(0.666f); +			  gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); +			  gViewerWindow->moveCursorToCenter();  			}  		} -		} - -		LLFloaterReg::showInstance("build"); -	 -		LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); -		gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); - -		LLViewerJoystick::getInstance()->moveObjects(true); -		LLViewerJoystick::getInstance()->setNeedsReset(true); - -		// Could be first use -		LLFirstUse::useBuild(); -		return true;  	} -}; - +	 +	LLFloaterReg::showInstance("build"); +	 +	LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); +	gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() ); +	 +	LLViewerJoystick::getInstance()->moveObjects(true); +	LLViewerJoystick::getInstance()->setNeedsReset(true); +	 +	// Could be first use +	LLFirstUse::useBuild(); +	return; +	 +}  //---------------------------------------------------------------------------  // Land pie menu  //--------------------------------------------------------------------------- @@ -2795,24 +2787,21 @@ BOOL enable_object_build(void*)  	return can_build;  } -class LLEnableEdit : public view_listener_t +bool enable_object_edit()  { -	bool handleEvent(const LLSD& userdata) +	// *HACK:  The new "prelude" Help Islands have a build sandbox area, +	// so users need the Edit and Create pie menu options when they are +	// there.  Eventually this needs to be replaced with code that only  +	// lets you edit objects if you have permission to do so (edit perms, +	// group edit, god).  See also lltoolbar.cpp.  JC +	bool enable = true; +	if (gAgent.inPrelude())  	{ -		// *HACK:  The new "prelude" Help Islands have a build sandbox area, -		// so users need the Edit and Create pie menu options when they are -		// there.  Eventually this needs to be replaced with code that only  -		// lets you edit objects if you have permission to do so (edit perms, -		// group edit, god).  See also lltoolbar.cpp.  JC -		bool enable = true; -		if (gAgent.inPrelude()) -		{ -			enable = LLViewerParcelMgr::getInstance()->agentCanBuild() -				|| LLSelectMgr::getInstance()->getSelection()->isAttachment(); -		} -		return enable; +		enable = LLViewerParcelMgr::getInstance()->agentCanBuild() +			|| LLSelectMgr::getInstance()->getSelection()->isAttachment();  	} -}; +	return enable; +}  class LLSelfRemoveAllAttachments : public view_listener_t  { @@ -2866,27 +2855,24 @@ BOOL enable_has_attachments(void*)  //	}  //} -class LLObjectEnableMute : public view_listener_t +bool enable_object_mute()  { -	bool handleEvent(const LLSD& userdata) +	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +	bool new_value = (object != NULL); +	if (new_value)  	{ -		LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -		bool new_value = (object != NULL); -		if (new_value) +		LLVOAvatar* avatar = find_avatar_from_object(object);  +		if (avatar)  		{ -			LLVOAvatar* avatar = find_avatar_from_object(object);  -			if (avatar) -			{ -				// It's an avatar -				LLNameValue *lastname = avatar->getNVPair("LastName"); -				BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); -				BOOL is_self = avatar->isSelf(); -				new_value = !is_linden && !is_self; -			} +			// It's an avatar +			LLNameValue *lastname = avatar->getNVPair("LastName"); +			BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); +			BOOL is_self = avatar->isSelf(); +			new_value = !is_linden && !is_self;  		} -		return new_value;  	} -}; +	return new_value; +}  class LLObjectMute : public view_listener_t  { @@ -3345,36 +3331,29 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm  	string.append(buffer);  } -BOOL enable_buy(void*) +bool enable_buy_object()  {      // In order to buy, there must only be 1 purchaseable object in      // the selection manger. -	if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return FALSE; +	if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false;      LLViewerObject* obj = NULL;      LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();  	if(node)      {          obj = node->getObject(); -        if(!obj) return FALSE; +        if(!obj) return false; -		if(node->mSaleInfo.isForSale() && node->mPermissions->getMaskOwner() & PERM_TRANSFER && -			(node->mPermissions->getMaskOwner() & PERM_COPY || node->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY)) +		if( for_sale_selection(node) )  		{ -			if(obj->permAnyOwner()) return TRUE; +			// *NOTE: Is this needed?  This checks to see if anyone owns the +			// object, dating back to when we had "public" objects owned by +			// no one.  JC +			if(obj->permAnyOwner()) return true;  		}      } -	return FALSE; +	return false;  } -class LLObjectEnableBuy : public view_listener_t -{ -	bool handleEvent(const LLSD& userdata) -	{ -		bool new_value = enable_buy(NULL); -		return new_value; -	} -}; -  // Note: This will only work if the selected object's data has been  // received by the viewer and cached in the selection manager.  void handle_buy_object(LLSaleInfo sale_info) @@ -3717,20 +3696,35 @@ class LLEditEnableCustomizeAvatar : public view_listener_t  	}  }; +bool enable_sit_object() +{ +	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); + +	if (object && object->getPCode() == LL_PCODE_VOLUME) +	{ +		return true; +	} +	else +	{ +		return false; +	} +} + +  // only works on pie menu -bool handle_sit_or_stand() +void handle_object_sit_or_stand()  {  	LLPickInfo pick = LLToolPie::getInstance()->getPick();  	LLViewerObject *object = pick.getObject();;  	if (!object || pick.mPickType == LLPickInfo::PICK_FLORA)  	{ -		return true; +		return;  	}  	if (sitting_on_selection())  	{  		gAgent.standUp(); -		return true; +		return;  	}  	// get object selection offset  @@ -3748,17 +3742,8 @@ bool handle_sit_or_stand()  		object->getRegion()->sendReliableMessage();  	} -	return true;  } -class LLObjectSitOrStand : public view_listener_t -{ -	bool handleEvent(const LLSD& userdata) -	{ -		return handle_sit_or_stand(); -	} -}; -  void near_sit_down_point(BOOL success, void *)  {  	if (success) @@ -4228,18 +4213,14 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)  	}  } -class LLToolsTakeCopy : public view_listener_t +void handle_take_copy()  { -	bool handleEvent(const LLSD& userdata) -	{ -		if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true; - -		const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); -		derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); +	if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; -		return true; -	} -}; +	LLUUID category_id = +		gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); +	derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); +}  // You can return an object to its owner if it is on your land. @@ -4485,43 +4466,50 @@ BOOL enable_take()  	return FALSE;  } -class LLToolsBuyOrTake : public view_listener_t + +void handle_buy_or_take()  { -	bool handleEvent(const LLSD& userdata) +	if (LLSelectMgr::getInstance()->getSelection()->isEmpty())  	{ -		if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) -		{ -			return true; -		} +		return; +	} -		if (is_selection_buy_not_take()) -		{ -			S32 total_price = selection_price(); +	if (is_selection_buy_not_take()) +	{ +		S32 total_price = selection_price(); -			if (total_price <= gStatusBar->getBalance() || total_price == 0) -			{ -				handle_buy(NULL); -			} -			else -			{ -				LLFloaterBuyCurrency::buyCurrency( -					"Buying this costs", total_price); -			} +		if (total_price <= gStatusBar->getBalance() || total_price == 0) +		{ +			handle_buy();  		}  		else  		{ -			handle_take(); +			LLFloaterBuyCurrency::buyCurrency( +				"Buying this costs", total_price);  		} -		return true;  	} -}; +	else +	{ +		handle_take(); +	} +} + +bool visible_buy_object() +{ +	return is_selection_buy_not_take() && enable_buy_object(); +} + +bool visible_take_object() +{ +	return !is_selection_buy_not_take() && enable_take(); +}  class LLToolsEnableBuyOrTake : public view_listener_t  {  	bool handleEvent(const LLSD& userdata)  	{  		bool is_buy = is_selection_buy_not_take(); -		bool new_value = is_buy ? enable_buy(NULL) : enable_take(); +		bool new_value = is_buy ? enable_buy_object() : enable_take();  		// Update label  		std::string label; @@ -4632,7 +4620,7 @@ void show_buy_currency(const char* extra)  	LLNotifications::instance().add("PromptGoToCurrencyPage", args);//, LLSD(), callback_show_buy_currency);  } -void handle_buy(void*) +void handle_buy()  {  	if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return; @@ -4650,14 +4638,20 @@ void handle_buy(void*)  	}  } -class LLObjectBuy : public view_listener_t +bool anyone_copy_selection(LLSelectNode* nodep)  { -	bool handleEvent(const LLSD& userdata) -	{ -		handle_buy(NULL); -		return true; -	} -}; +	bool perm_copy = (bool)(nodep->getObject()->permCopy()); +	bool all_copy = (bool)(nodep->mPermissions->getMaskEveryone() & PERM_COPY); +	return perm_copy && all_copy; +} + +bool for_sale_selection(LLSelectNode* nodep) +{ +	return nodep->mSaleInfo.isForSale() +		&& nodep->mPermissions->getMaskOwner() & PERM_TRANSFER +		&& (nodep->mPermissions->getMaskOwner() & PERM_COPY +			|| nodep->mSaleInfo.getSaleType() != LLSaleInfo::FS_COPY); +}  BOOL sitting_on_selection()  { @@ -4985,28 +4979,24 @@ class LLEditDelete : public view_listener_t  	}  }; -class LLObjectEnableDelete : public view_listener_t +bool enable_object_delete()  { -	bool handleEvent(const LLSD& userdata) -	{ -		bool new_value =  +	bool new_value =   #ifdef HACKED_GODLIKE_VIEWER -			TRUE; +	TRUE;  #else  # ifdef TOGGLE_HACKED_GODLIKE_VIEWER -			(!LLViewerLogin::getInstance()->isInProductionGrid() -             && gAgent.isGodlike()) || +	(!LLViewerLogin::getInstance()->isInProductionGrid() +     && gAgent.isGodlike()) ||  # endif -			LLSelectMgr::getInstance()->canDoDelete(); +	LLSelectMgr::getInstance()->canDoDelete();  #endif -		return new_value; -	} -}; +	return new_value; +} -class LLObjectDelete : public view_listener_t +void handle_object_delete()  { -	bool handleEvent(const LLSD& userdata) -	{ +  		if (LLSelectMgr::getInstance())  		{  			LLSelectMgr::getInstance()->doDelete(); @@ -5018,9 +5008,8 @@ class LLObjectDelete : public view_listener_t  		// When deleting an object we may not actually be done  		// Keep selection so we know what to delete when confirmation is needed about the delete  		gPieObject->hide(); -		return true; -	} -}; +		return; +}  void handle_force_delete(void*)  { @@ -5377,29 +5366,6 @@ class LLToolsLookAtSelection : public view_listener_t  	}  }; -void callback_invite_to_group(LLUUID group_id, LLUUID dest_id) -{ -	std::vector<LLUUID> agent_ids; -	agent_ids.push_back(dest_id); -	 -	LLFloaterGroupInvite::showForGroup(group_id, &agent_ids); -} - -void invite_to_group(const LLUUID& dest_id) -{ -	LLViewerObject* dest = gObjectList.findObject(dest_id); -	if(dest && dest->isAvatar()) -	{ -		LLFloaterGroupPicker* widget = LLFloaterReg::showTypedInstance<LLFloaterGroupPicker>("group_picker", LLSD(gAgent.getID())); -		if (widget) -		{ -			widget->center(); -			widget->setPowersMask(GP_MEMBER_INVITE); -			widget->setSelectGroupCallback(boost::bind(callback_invite_to_group, _1, dest_id)); -		} -	} -} -  class LLAvatarInviteToGroup : public view_listener_t  {  	bool handleEvent(const LLSD& userdata) @@ -5407,7 +5373,7 @@ class LLAvatarInviteToGroup : public view_listener_t  		LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getPrimaryObject() );  		if(avatar)  		{ -			invite_to_group(avatar->getID()); +			LLAvatarActions::inviteToGroup(avatar->getID());  		}  		return true;  	} @@ -5475,7 +5441,7 @@ bool complete_give_money(const LLSD& notification, const LLSD& response, LLObjec  	return false;  } -bool handle_give_money_dialog() +void handle_give_money_dialog()  {  	LLNotification::Params params("BusyModePay");  	params.functor.function(boost::bind(complete_give_money, _1, _2, LLSelectMgr::getInstance()->getSelection())); @@ -5489,38 +5455,28 @@ bool handle_give_money_dialog()  	{  		LLNotifications::instance().forceResponse(params, 1);  	} -	return true;  } -class LLPayObject : public view_listener_t +bool enable_pay_avatar()  { -	bool handleEvent(const LLSD& userdata) -	{ -		return handle_give_money_dialog(); -	} -}; +	LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +	LLVOAvatar* avatar = find_avatar_from_object(obj); +	return (avatar != NULL); +} -class LLEnablePayObject : public view_listener_t +bool enable_pay_object()  { -	bool handleEvent(const LLSD& userdata) +	LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); +	if( object )  	{ -		LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); -		bool new_value = (avatar != NULL); -		if (!new_value) +		LLViewerObject *parent = (LLViewerObject *)object->getParent(); +		if((object->flagTakesMoney()) || (parent && parent->flagTakesMoney()))  		{ -			LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getPrimaryObject(); -			if( object ) -			{ -				LLViewerObject *parent = (LLViewerObject *)object->getParent(); -				if((object->flagTakesMoney()) || (parent && parent->flagTakesMoney())) -				{ -					new_value = true; -				} -			} +			return true;  		} -		return new_value;  	} -}; +	return false; +}  class LLObjectEnableSitOrStand : public view_listener_t  { @@ -6157,7 +6113,7 @@ class LLAttachmentEnableDetach : public view_listener_t  };  // Used to tell if the selected object can be attached to your avatar. -BOOL object_selected_and_point_valid(const LLSD&) +BOOL object_selected_and_point_valid()  {  	LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();  	for (LLObjectSelection::root_iterator iter = selection->root_begin(); @@ -6187,7 +6143,7 @@ BOOL object_selected_and_point_valid(const LLSD&)  BOOL object_is_wearable()  { -	if (!object_selected_and_point_valid(LLSD())) +	if (!object_selected_and_point_valid())  	{  		return FALSE;  	} @@ -6209,15 +6165,6 @@ BOOL object_is_wearable()  } -// Also for seeing if object can be attached.  See above. -class LLObjectEnableWear : public view_listener_t -{ -	bool handleEvent(const LLSD& userdata) -	{ -		return object_selected_and_point_valid(LLSD()); -	} -}; -  class LLAttachmentPointFilled : public view_listener_t  {  	bool handleEvent(const LLSD& user_data) @@ -6564,40 +6511,37 @@ class LLEditableSelectedMono : public view_listener_t  	}  }; -class LLToolsEnableTakeCopy : public view_listener_t +bool enable_object_take_copy()  { -	bool handleEvent(const LLSD& userdata) +	bool all_valid = false; +	if (LLSelectMgr::getInstance())  	{ -		bool all_valid = false; -		if (LLSelectMgr::getInstance()) +		if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())  		{ -			if (!LLSelectMgr::getInstance()->getSelection()->isEmpty()) -			{ -			all_valid = true; +		all_valid = true;  #ifndef HACKED_GODLIKE_VIEWER  # ifdef TOGGLE_HACKED_GODLIKE_VIEWER -			if (LLViewerLogin::getInstance()->isInProductionGrid() -                || !gAgent.isGodlike()) +		if (LLViewerLogin::getInstance()->isInProductionGrid() +            || !gAgent.isGodlike())  # endif +		{ +			struct f : public LLSelectedObjectFunctor  			{ -				struct f : public LLSelectedObjectFunctor +				virtual bool apply(LLViewerObject* obj)  				{ -					virtual bool apply(LLViewerObject* obj) -					{ -						return (!obj->permCopy() || obj->isAttachment()); -					} -				} func; -				const bool firstonly = true; -				bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); -				all_valid = !any_invalid; -			} -#endif // HACKED_GODLIKE_VIEWER +					return (!obj->permCopy() || obj->isAttachment()); +				} +			} func; +			const bool firstonly = true; +			bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly); +			all_valid = !any_invalid;  		} +#endif // HACKED_GODLIKE_VIEWER  		} - -		return all_valid;  	} -}; + +	return all_valid; +}  class LLHasAsset : public LLInventoryCollectFunctor @@ -7701,13 +7645,14 @@ void initialize_menus()  	LLUICtrl::EnableCallbackRegistry::Registrar& enable = LLUICtrl::EnableCallbackRegistry::currentRegistrar();  	LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar(); +	LLUICtrl::VisibleCallbackRegistry::Registrar& visible = LLUICtrl::VisibleCallbackRegistry::currentRegistrar();  	// Enable God Mode  	view_listener_t::addMenu(new LLEnableGodCustomerService(), "EnableGodCustomerService");  	// Agent  	commit.add("Agent.toggleFlying", boost::bind(&LLAgent::toggleFlying)); -	enable.add("Agent.emableFlying", boost::bind(&LLAgent::enableFlying)); +	enable.add("Agent.enableFlying", boost::bind(&LLAgent::enableFlying));  	// File menu  	init_menu_file(); @@ -7801,8 +7746,8 @@ void initialize_menus()  	view_listener_t::addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys");  	view_listener_t::addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys");  	view_listener_t::addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); -	view_listener_t::addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); -	view_listener_t::addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); +	commit.add("Tools.BuyOrTake", boost::bind(&handle_buy_or_take)); +	commit.add("Tools.TakeCopy", boost::bind(&handle_take_copy));  	view_listener_t::addMenu(new LLToolsSaveToInventory(), "Tools.SaveToInventory");  	view_listener_t::addMenu(new LLToolsSaveToObjectInventory(), "Tools.SaveToObjectInventory");  	view_listener_t::addMenu(new LLToolsSelectedScriptAction(), "Tools.SelectedScriptAction"); @@ -7811,7 +7756,8 @@ void initialize_menus()  	view_listener_t::addMenu(new LLToolsEnableLink(), "Tools.EnableLink");  	view_listener_t::addMenu(new LLToolsEnableUnlink(), "Tools.EnableUnlink");  	view_listener_t::addMenu(new LLToolsEnableBuyOrTake(), "Tools.EnableBuyOrTake"); -	view_listener_t::addMenu(new LLToolsEnableTakeCopy(), "Tools.EnableTakeCopy"); +	visible.add("Tools.VisibleTakeCopy", boost::bind(&enable_object_take_copy)); +	enable.add("Tools.EnableTakeCopy", boost::bind(&enable_object_take_copy));  	view_listener_t::addMenu(new LLToolsEnableSaveToInventory(), "Tools.EnableSaveToInventory");  	view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); @@ -8012,31 +7958,51 @@ void initialize_menus()  	view_listener_t::addMenu(new LLAvatarSendIM(), "Avatar.SendIM");  	view_listener_t::addMenu(new LLAvatarReportAbuse(), "Avatar.ReportAbuse"); -	view_listener_t::addMenu(new LLObjectEnableMute(), "Avatar.EnableMute");  	view_listener_t::addMenu(new LLAvatarEnableAddFriend(), "Avatar.EnableAddFriend");  	view_listener_t::addMenu(new LLAvatarEnableFreezeEject(), "Avatar.EnableFreezeEject");  	// Object pie menu  	view_listener_t::addMenu(new LLObjectBuild(), "Object.Build"); -	view_listener_t::addMenu(new LLObjectTouch(), "Object.Touch"); -	view_listener_t::addMenu(new LLObjectSitOrStand(), "Object.SitOrStand"); -	view_listener_t::addMenu(new LLObjectDelete(), "Object.Delete"); +	commit.add("Object.Touch", boost::bind(&handle_object_touch)); +	commit.add("Object.SitOrStand", boost::bind(&handle_object_sit_or_stand)); +	visible.add("Object.EnableSit", boost::bind(&enable_sit_object)); +	commit.add("Object.Delete", boost::bind(&handle_object_delete));  	view_listener_t::addMenu(new LLObjectAttachToAvatar(), "Object.AttachToAvatar");  	view_listener_t::addMenu(new LLObjectReturn(), "Object.Return");  	view_listener_t::addMenu(new LLObjectReportAbuse(), "Object.ReportAbuse");  	view_listener_t::addMenu(new LLObjectMute(), "Object.Mute"); -	view_listener_t::addMenu(new LLObjectBuy(), "Object.Buy"); -	view_listener_t::addMenu(new LLObjectEdit(), "Object.Edit"); -	view_listener_t::addMenu(new LLObjectEnableOpen(), "Object.EnableOpen"); +	visible.add("Object.VisibleTake", boost::bind(&visible_take_object)); +	visible.add("Object.VisibleBuy", boost::bind(&visible_buy_object)); + +	commit.add("Object.Buy", boost::bind(&handle_buy)); +	commit.add("Object.Edit", boost::bind(&handle_object_edit)); +	 +	commit.add("Object.Take", boost::bind(&handle_take)); + +	enable.add("Object.EnableOpen", boost::bind(&enable_object_open)); +	visible.add("Object.VisibleOpen", boost::bind(&enable_object_open)); + +	enable.add("Object.EnableTouch", boost::bind(&enable_object_touch)); +	visible.add("Object.VisibleTouch", boost::bind(&enable_object_touch)); +  	view_listener_t::addMenu(new LLObjectEnableTouch(), "Object.EnableTouch");  	view_listener_t::addMenu(new LLObjectEnableSitOrStand(), "Object.EnableSitOrStand"); -	view_listener_t::addMenu(new LLObjectEnableDelete(), "Object.EnableDelete"); -	view_listener_t::addMenu(new LLObjectEnableWear(), "Object.EnableWear"); +	 +	enable.add("Object.EnableDelete", boost::bind(&enable_object_delete)); +	visible.add("Object.VisibleDelete", boost::bind(&enable_object_delete)); + +	enable.add("Object.EnableWear", boost::bind(&object_selected_and_point_valid)); +	visible.add("Object.VisibleWear", boost::bind(&object_selected_and_point_valid)); +  	view_listener_t::addMenu(new LLObjectEnableReturn(), "Object.EnableReturn");  	view_listener_t::addMenu(new LLObjectEnableReportAbuse(), "Object.EnableReportAbuse"); -	view_listener_t::addMenu(new LLObjectEnableMute(), "Object.EnableMute"); -	view_listener_t::addMenu(new LLObjectEnableBuy(), "Object.EnableBuy"); + +	enable.add("Avatar.EnableMute", boost::bind(&enable_object_mute)); +	enable.add("Object.EnableMute", boost::bind(&enable_object_mute)); +	visible.add("Object.VisibleMute", boost::bind(&enable_object_mute)); + +	enable.add("Object.EnableBuy", boost::bind(&enable_buy_object));  	/*view_listener_t::addMenu(new LLObjectVisibleTouch(), "Object.VisibleTouch");  	view_listener_t::addMenu(new LLObjectVisibleCustomTouch(), "Object.VisibleCustomTouch"); @@ -8068,10 +8034,13 @@ void initialize_menus()  	view_listener_t::addMenu(new LLToggleControl(), "ToggleControl");  	view_listener_t::addMenu(new LLCheckControl(), "CheckControl");  	view_listener_t::addMenu(new LLGoToObject(), "GoToObject"); -	view_listener_t::addMenu(new LLPayObject(), "PayObject"); +	commit.add("PayObject", boost::bind(&handle_give_money_dialog)); -	view_listener_t::addMenu(new LLEnablePayObject(), "EnablePayObject"); -	view_listener_t::addMenu(new LLEnableEdit(), "EnableEdit"); +	enable.add("EnablePayObject", boost::bind(&enable_pay_object)); +	visible.add("VisiblePayObject", boost::bind(&enable_pay_object)); +	enable.add("EnablePayAvatar", boost::bind(&enable_pay_avatar)); +	enable.add("EnableEdit", boost::bind(&enable_object_edit)); +	visible.add("Object.VisibleEdit", boost::bind(&enable_object_edit));  	view_listener_t::addMenu(new LLFloaterVisible(), "FloaterVisible");  	view_listener_t::addMenu(new LLSomethingSelected(), "SomethingSelected"); diff --git a/indra/newview/llviewermenu.h b/indra/newview/llviewermenu.h index dd6aac2dd3..75f4f08bde 100644 --- a/indra/newview/llviewermenu.h +++ b/indra/newview/llviewermenu.h @@ -36,14 +36,12 @@  #include "llmenugl.h"  #include "llsafehandle.h" -//newview includes -#include "llfilepicker.h" - +class LLSD;  class LLUICtrl;  class LLView;  class LLParcelSelection;  class LLObjectSelection; - +class LLSelectNode;  void init_menus();  void cleanup_menus(); @@ -83,7 +81,6 @@ void confirm_replace_attachment(S32 option, void* user_data);  void handle_detach_from_avatar(const LLSD& user_data);  void attach_label(std::string& label, const LLSD&);  void detach_label(std::string& label, const LLSD&); -BOOL object_selected_and_point_valid(const LLSD&);  void handle_detach(void*);  BOOL enable_god_full(void* user_data);  BOOL enable_god_liaison(void* user_data); @@ -96,21 +93,34 @@ void exchange_callingcard(const LLUUID& dest_id);  void handle_gestures(void*);  void handle_sit_down(void*);  void handle_object_build(void*); +void handle_object_touch(); +bool enable_object_open(); + +// Buy either contents or object itself +void handle_buy(); + +void handle_take_copy(); + +// Can anyone take a free copy of the object? +// *TODO: Move to separate file +bool anyone_copy_selection(LLSelectNode* nodep); + +// Is this selected object for sale? +// *TODO: Move to separate file +bool for_sale_selection(LLSelectNode* nodep); +  void handle_save_snapshot(void *);  void handle_toggle_flycam(); -bool handle_sit_or_stand(); -bool handle_give_money_dialog(); +void handle_object_sit_or_stand(); +void handle_give_money_dialog(); +bool enable_pay_object(); +bool enable_buy_object();  bool handle_go_to();  // Export to XML or Collada  void handle_export_selected( void * ); -// Pass in an empty string and this function will build a string that -// describes buyer permissions. -class LLSaleInfo; -class LLPermissions; -  class LLViewerMenuHolderGL : public LLMenuHolderGL  {  public: diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 390e1fe032..2e8580907e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -103,6 +103,7 @@  #include "llsidetray.h"  #include "llstartup.h"  #include "llsky.h" +#include "llslurl.h"  #include "llstatenums.h"  #include "llstatusbar.h"  #include "llimview.h" @@ -168,9 +169,6 @@ extern BOOL gDebugClicks;  // function prototypes  void open_offer(const std::vector<LLUUID>& items, const std::string& from_name);  bool check_offer_throttle(const std::string& from_name, bool check_only); -void callbackCacheEstateOwnerName(const LLUUID& id, -								  const std::string& first, const std::string& last, -								  BOOL is_group);  //inventory offer throttle globals  LLFrameTimer gThrottleTimer; @@ -5576,10 +5574,17 @@ void process_covenant_reply(LLMessageSystem* msg, void**)  	LLPanelLandCovenant::updateEstateName(estate_name);  	LLFloaterBuyLand::updateEstateName(estate_name); +	std::string owner_name = +		LLSLURL::buildCommand("agent", estate_owner_id, "inspect"); +	LLPanelEstateCovenant::updateEstateOwnerName(owner_name); +	LLPanelLandCovenant::updateEstateOwnerName(owner_name); +	LLFloaterBuyLand::updateEstateOwnerName(owner_name); +  	LLPanelPlaceInfo* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceInfo>("panel_place_info");  	if (panel)  	{  		panel->updateEstateName(estate_name); +		panel->updateEstateOwnerName(owner_name);  	}  	// standard message, not from system @@ -5607,8 +5612,6 @@ void process_covenant_reply(LLMessageSystem* msg, void**)  	LLPanelLandCovenant::updateLastModified(last_modified);  	LLFloaterBuyLand::updateLastModified(last_modified); -	gCacheName->get(estate_owner_id, false, &callbackCacheEstateOwnerName); -	  	// load the actual covenant asset data  	const BOOL high_priority = TRUE;  	if (covenant_id.notNull()) @@ -5638,32 +5641,10 @@ void process_covenant_reply(LLMessageSystem* msg, void**)  		LLPanelEstateCovenant::updateCovenantText(covenant_text, covenant_id);  		LLPanelLandCovenant::updateCovenantText(covenant_text);  		LLFloaterBuyLand::updateCovenantText(covenant_text, covenant_id); -		panel->updateCovenantText(covenant_text); -	} -} - -void callbackCacheEstateOwnerName(const LLUUID& id, -								  const std::string& first, const std::string& last, -								  BOOL is_group) -{ -	std::string name; -	 -	if (id.isNull()) -	{ -		name = LLTrans::getString("none_text"); -	} -	else -	{ -		name = first + " " + last; -	} -	LLPanelEstateCovenant::updateEstateOwnerName(name); -	LLPanelLandCovenant::updateEstateOwnerName(name); -	LLFloaterBuyLand::updateEstateOwnerName(name); - -	LLPanelPlaceInfo* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceInfo>("panel_place_info"); -	if (panel) -	{ -		panel->updateEstateOwnerName(name); +		if (panel) +		{ +			panel->updateCovenantText(covenant_text); +		}  	}  } diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h index 275c79fd3b..3964a56bf6 100644 --- a/indra/newview/llviewerparcelmgr.h +++ b/indra/newview/llviewerparcelmgr.h @@ -71,6 +71,9 @@ const F32 PARCEL_POST_HEIGHT = 0.666f;  // Base class for people who want to "observe" changes in the viewer  // parcel selection. + +//FIXME: this should be done by grabbing a floating parcel selection and observing changes on it, not the parcel mgr +//--RN  class LLParcelObserver  {  public: diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index ceb2698223..b853bcb46e 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -32,37 +32,37 @@  #include "llviewerprecompiledheaders.h" +#include "llviewertexteditor.h" + +#include "llagent.h" +#include "llaudioengine.h" +#include "llavataractions.h" +#include "llfloaterchat.h"  #include "llfloaterreg.h" +#include "llfloaterworldmap.h"  #include "llfocusmgr.h" -#include "llaudioengine.h" -#include "llagent.h"  #include "llinventory.h"  #include "llinventorybridge.h"  #include "llinventorymodel.h" - -#include "llviewertexteditor.h" - -#include "llfloaterchat.h" -#include "llfloaterworldmap.h" +#include "llmemorystream.h" +#include "llmenugl.h" +#include "llnotecard.h"  #include "llnotify.h"  #include "llpanelplaces.h"  #include "llpreview.h" -#include "llpreviewtexture.h"  #include "llpreviewnotecard.h" +#include "llpreviewtexture.h"  #include "llscrollbar.h" +#include "llscrollcontainer.h"  #include "llsidetray.h"  #include "lltooldraganddrop.h" +#include "lltooltip.h"  #include "lltrans.h" +#include "lluictrlfactory.h"  #include "llviewercontrol.h" +#include "llviewerinventory.h"  #include "llviewertexturelist.h"  #include "llviewerwindow.h" -#include "llviewerinventory.h" -#include "lluictrlfactory.h" -#include "llnotecard.h" -#include "llmemorystream.h" -#include "llmenugl.h" -#include "llscrollcontainer.h" -#include "llavataractions.h"  #include "llappviewer.h" // for gPacificDaylightTime @@ -142,8 +142,6 @@ public:  		}  	} -	//virtual S32					getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const; -	//virtual void				updateLayout(const class LLTextEditor& editor);  	/*virtual*/ S32				getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const   	{ @@ -167,7 +165,7 @@ public:  		}  		F32 right_x; -		mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mBottom, color, LLFontGL::LEFT, LLFontGL::BOTTOM, mHasMouseHover ? LLFontGL::UNDERLINE : 0, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x); +		mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mBottom, color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x);  		return right_x;  	} @@ -176,20 +174,21 @@ public:  		return llmax(mImage->getHeight(), llceil(mStyle->getFont()->getLineHeight()));  	}  	/*virtual*/ bool			canEdit() const { return false; } -	//virtual void				unlinkFromDocument(class LLTextEditor* editor); -	//virtual void				linkToDocument(class LLTextEditor* editor); -	virtual void				setHasMouseHover(bool hover)  + +	/*virtual*/ BOOL			handleHover(S32 x, S32 y, MASK mask)  	{ -		mHasMouseHover = hover;  +		LLUI::getWindow()->setCursor(UI_CURSOR_HAND); +		return TRUE;  	} -	//virtual const LLColor4&	getColor() const; -	//virtual void 				setColor(const LLColor4 &color); -	//virtual void 				setStyle(const LLStyleSP &style); -	virtual BOOL				getToolTip( std::string& msg ) const  +	virtual BOOL				handleToolTip(S32 x, S32 y, MASK mask )  	{  -		msg = mToolTip;  -		return TRUE;  +		if (!mToolTip.empty()) +		{ +			LLToolTipMgr::instance().show(mToolTip); +			return TRUE; +		} +		return FALSE;   	}  	/*virtual*/ const LLStyleSP		getStyle() const { return mStyle; } @@ -562,17 +561,17 @@ void LLEmbeddedItems::markSaved()  /////////////////////////////////////////////////////////////////// -class LLViewerTextEditor::LLTextCmdInsertEmbeddedItem : public LLTextEditor::LLTextCmd +class LLViewerTextEditor::TextCmdInsertEmbeddedItem : public LLTextBase::TextCmd  {  public: -	LLTextCmdInsertEmbeddedItem( S32 pos, LLInventoryItem* item ) -		: LLTextCmd(pos, FALSE),  +	TextCmdInsertEmbeddedItem( S32 pos, LLInventoryItem* item ) +		: TextCmd(pos, FALSE),   		  mExtCharValue(0)  	{  		mItem = item;  	} -	virtual BOOL execute( LLTextEditor* editor, S32* delta ) +	virtual BOOL execute( LLTextBase* editor, S32* delta )  	{  		LLViewerTextEditor* viewer_editor = (LLViewerTextEditor*)editor;  		// Take this opportunity to remove any unused embedded items from this editor @@ -587,13 +586,13 @@ public:  		return FALSE;  	} -	virtual S32 undo( LLTextEditor* editor ) +	virtual S32 undo( LLTextBase* editor )  	{  		remove(editor, getPosition(), 1);  		return getPosition();   	} -	virtual S32 redo( LLTextEditor* editor ) +	virtual S32 redo( LLTextBase* editor )  	{   		LLWString ws;  		ws += mExtCharValue; @@ -635,7 +634,6 @@ LLViewerTextEditor::LLViewerTextEditor(const LLViewerTextEditor::Params& p)  	mDragItemSaved(FALSE),  	mInventoryCallback(new LLEmbeddedNotecardOpener)  { -	mParseHTML = p.allow_html;  	mEmbeddedItemList = new LLEmbeddedItems(this);  	mInventoryCallback->setEditor(this);  } @@ -673,7 +671,7 @@ BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask)  			llwchar wc = 0;  			if (mCursorPos < getLength())  			{ -				wc = getWChar(mCursorPos); +				wc = getWText()[mCursorPos];  			}  			LLInventoryItem* item_at_pos = LLEmbeddedItems::getEmbeddedItem(wc);  			if (item_at_pos) @@ -773,22 +771,6 @@ BOOL LLViewerTextEditor::handleMouseUp(S32 x, S32 y, MASK mask)  	return handled;  } -BOOL LLViewerTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ -	// pop up a context menu for any Url under the cursor -	if (handleRightMouseDownOverUrl(this, x, y)) -	{ -		return TRUE; -	} - -	if (childrenHandleRightMouseDown(x, y, mask) != NULL) -	{ -		return TRUE; -	} - -	return FALSE; -} -  BOOL LLViewerTextEditor::handleDoubleClick(S32 x, S32 y, MASK mask)  {  	BOOL	handled = FALSE; @@ -955,7 +937,7 @@ std::string LLViewerTextEditor::getEmbeddedText()  	LLWString outtextw;  	for (S32 i=0; i<(S32)getWText().size(); i++)  	{ -		llwchar wch = getWChar(i); +		llwchar wch = getWText()[i];  		if( wch >= FIRST_EMBEDDED_CHAR && wch <= LAST_EMBEDDED_CHAR )  		{  			S32 index = mEmbeddedItemList->getIndexFromEmbeddedChar(wch); @@ -998,7 +980,8 @@ std::string LLViewerTextEditor::appendTime(bool prepend_newline)  	substitution["datetime"] = (S32) utc_time;  	LLStringUtil::format (timeStr, substitution); -	appendColoredText(timeStr, false, prepend_newline, LLColor4::grey); +	appendText(timeStr, prepend_newline, LLStyle::Params().color(LLColor4::grey)); +	blockUndo();  	return timeStr;  } @@ -1057,7 +1040,7 @@ BOOL LLViewerTextEditor::openEmbeddedItemAtPos(S32 pos)  {  	if( pos < getLength())  	{ -		llwchar wc = getWChar(pos); +		llwchar wc = getWText()[pos];  		LLInventoryItem* item = LLEmbeddedItems::getEmbeddedItem( wc );  		if( item )  		{ @@ -1227,7 +1210,7 @@ bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD&  // Returns change in number of characters in mWText  S32 LLViewerTextEditor::insertEmbeddedItem( S32 pos, LLInventoryItem* item )  { -	return execute( new LLTextCmdInsertEmbeddedItem( pos, item ) ); +	return execute( new TextCmdInsertEmbeddedItem( pos, item ) );  }  bool LLViewerTextEditor::importStream(std::istream& str) diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 100fa343af..ba0c40cb2e 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -43,10 +43,7 @@ class LLViewerTextEditor : public LLTextEditor  public:  	struct Params : public LLInitParam::Block<Params, LLTextEditor::Params>  	{ -		Optional<bool>	allow_html; -  		Params() -		:	allow_html("allow_html", false)  		{  			name = "text_editor";  		} @@ -64,7 +61,6 @@ public:  	// mousehandler overrides  	virtual BOOL	handleMouseDown(S32 x, S32 y, MASK mask);  	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask); -	virtual BOOL	handleRightMouseDown(S32 x, S32 y, MASK mask);  	virtual BOOL	handleHover(S32 x, S32 y, MASK mask);  	virtual BOOL	handleDoubleClick(S32 x, S32 y, MASK mask ); @@ -139,7 +135,7 @@ private:  	// Inner classes  	// -	class LLTextCmdInsertEmbeddedItem; +	class TextCmdInsertEmbeddedItem;  };  #endif  // LL_VIEWERTEXTEDITOR_H diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4a0efbaddc..24d00cba16 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -835,9 +835,13 @@ void LLViewerWindow::handleMouseMove(LLWindow *window,  LLCoordGL pos, MASK mask  	// Save mouse point for access during idle() and display()  	LLCoordGL mouse_point(x, y); -	saveLastMouse(mouse_point); -	LLUI::resetMouseIdleTimer(); +	if (mouse_point != mCurrentMousePoint) +	{ +		LLUI::resetMouseIdleTimer(); +	} + +	saveLastMouse(mouse_point);  	mWindow->showCursorFromMouseMove(); @@ -1866,7 +1870,6 @@ void LLViewerWindow::setMenuBackgroundColor(bool god_mode, bool dev_grid)      if(gStatusBar)      {          gStatusBar->setBackgroundColor( new_bg_color ); -		gStatusBar->getChild<LLTextBox>("HealthText")->setBackgroundColor(new_bg_color);      }  } @@ -2022,7 +2025,7 @@ BOOL LLViewerWindow::handleKey(KEY key, MASK mask)  	}  	// hide tooltips on keypress -	LLToolTipMgr::instance().hideToolTips(); +	LLToolTipMgr::instance().blockToolTips();  	// Explicit hack for debug menu.  	if ((MASK_ALT & mask) && @@ -2609,16 +2612,16 @@ void LLViewerWindow::updateUI()  			append_xui_tooltip(tooltip_view, tool_tip_msg);  			screen_sticky_rect.intersectWith(tooltip_view->calcScreenRect()); -			LLToolTipMgr::instance().show(LLToolTipParams() +			LLToolTipMgr::instance().show(LLToolTip::Params()  				.message(tool_tip_msg)  				.sticky_rect(screen_sticky_rect) -				.width(400)); +				.max_width(400));  		}  		// if there is a mouse captor, nothing else gets a tooltip  		else if (mouse_captor)  		{  			mouse_captor->screenPointToLocal(x, y, &local_x, &local_y); -			tool_tip_handled = mouse_captor->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); +			tool_tip_handled = mouse_captor->handleToolTip(local_x, local_y, mask);  		}  		else   		{ @@ -2626,20 +2629,20 @@ void LLViewerWindow::updateUI()  			if (!tool_tip_handled && top_ctrl)  			{  				top_ctrl->screenPointToLocal(x, y, &local_x, &local_y); -				tool_tip_handled = top_ctrl->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); +				tool_tip_handled = top_ctrl->handleToolTip(local_x, local_y, mask );  			}  			if (!tool_tip_handled)  			{  				local_x = x; local_y = y; -				tool_tip_handled = mRootView->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); +				tool_tip_handled = mRootView->handleToolTip(local_x, local_y, mask );  			}  			LLTool* current_tool = LLToolMgr::getInstance()->getCurrentTool();  			if (!tool_tip_handled && current_tool)  			{  				current_tool->screenPointToLocal(x, y, &local_x, &local_y); -				tool_tip_handled = current_tool->handleToolTip(local_x, local_y, tool_tip_msg, screen_sticky_rect ); +				tool_tip_handled = current_tool->handleToolTip(local_x, local_y, mask );  			}  		}  	}		 @@ -2687,7 +2690,7 @@ void LLViewerWindow::updateLayout()  				&& !suppress_toolbox									// not override in third person  				&& LLToolMgr::getInstance()->getCurrentToolset() != gFaceEditToolset	// not special mode  				&& LLToolMgr::getInstance()->getCurrentToolset() != gMouselookToolset -				&& (!captor || captor->isView())))						// not dragging +				&& (!captor || dynamic_cast<LLView*>(captor) != NULL)))						// not dragging  		{  			// Force floater tools to be visible (unless minimized)  			if (!gFloaterTools->getVisible()) @@ -2787,6 +2790,14 @@ void LLViewerWindow::updateKeyboardFocus()  				}  				parent = parent->getParentUICtrl();  			} + +			// if we didn't find a better place to put focus, just release it +			// hasFocus() will return true if and only if we didn't touch focus since we +			// are only moving focus higher in the hierarchy +			if (cur_focus->hasFocus()) +			{ +				cur_focus->setFocus(FALSE); +			}  		}  		else if (cur_focus->isFocusRoot())  		{ diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 79308f7e16..30736b1e03 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1181,7 +1181,7 @@ LLVector3d LLWorldMapView::viewPosToGlobal( S32 x, S32 y )  } -BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ) +BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, MASK mask )  {  	LLVector3d pos_global = viewPosToGlobal(x, y); @@ -1236,9 +1236,10 @@ BOOL LLWorldMapView::handleToolTip( S32 x, S32 y, std::string& msg, LLRect& stic  		S32 screen_x, screen_y;  		localPointToScreen(x, y, &screen_x, &screen_y); +		LLRect sticky_rect_screen;  		sticky_rect_screen.setCenterAndSize(screen_x, screen_y, SLOP, SLOP); -		LLToolTipMgr::instance().show(LLToolTipParams() +		LLToolTipMgr::instance().show(LLToolTip::Params()  			.message(tooltip_msg)  			.sticky_rect(sticky_rect_screen));  	} diff --git a/indra/newview/llworldmapview.h b/indra/newview/llworldmapview.h index 8349d5399f..66793f0101 100644 --- a/indra/newview/llworldmapview.h +++ b/indra/newview/llworldmapview.h @@ -72,7 +72,7 @@ public:  	virtual BOOL	handleMouseUp(S32 x, S32 y, MASK mask);  	virtual BOOL	handleDoubleClick( S32 x, S32 y, MASK mask );  	virtual BOOL	handleHover( S32 x, S32 y, MASK mask ); -	virtual BOOL	handleToolTip( S32 x, S32 y, std::string& msg, LLRect& sticky_rect_screen ); +	virtual BOOL	handleToolTip( S32 x, S32 y, MASK mask);  	bool			checkItemHit(S32 x, S32 y, LLItemInfo& item, LLUUID* id, bool track);  	void			handleClick(S32 x, S32 y, MASK mask, S32* hit_type, LLUUID* id); diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 7e22e17188..eb62c442db 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -2,7 +2,6 @@  <colors>  	<!-- Named Colors --> -  	<color  	 name="EmphasisColor"  	 value="0.38 0.694 0.573 1" /> @@ -90,6 +89,9 @@       name="AlertCautionTextColor"       reference="Black" />      <color +     name="AgentLinkColor" +     reference="White" /> +    <color       name="AlertTextColor"       value="0.58 0.66 0.84 1" />      <color diff --git a/indra/newview/skins/default/textures/icons/Info_Small.png b/indra/newview/skins/default/textures/icons/Info_Small.png Binary files differnew file mode 100644 index 0000000000..81078c32dc --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Info_Small.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 8a6e9486a2..f106796cd9 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -137,6 +137,7 @@    <texture name="Icon_Undock_Press" file_name="windows/Icon_Undock_Press.png" preload="false" />    <texture name="Info" file_name="icons/Info.png" preload="false" /> +  <texture name="Info_Small" file_name="icons/Info_Small.png" preload="false" />    <texture name="Info_Off" file_name="navbar/Info_Off.png" preload="false" />    <texture name="Info_Press" file_name="navbar/Info_Press.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index c9e143bf95..dc6af79db5 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -80,6 +80,7 @@        label="Support"        name="support_panel">        <text_editor +        allow_html="true"          follows="top|left"         font="SansSerif"         height="350" @@ -127,7 +128,7 @@ Thank you to the following residents for helping to ensure that this is the best  It is a rare mind indeed that can render the hitherto non-existent blindingly obvious. The cry 'I could have thought of that' is a very popular and misleading one, for the fact is that they didn't, and a very significant and revealing fact it is too. --- Douglas Adams + -- Douglas Adams        </text_editor>      </panel>      <panel diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 5a285cdcb0..524495d83d 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -132,9 +132,6 @@ Go to World menu > About Land or select another parcel to show its details.                  Description:              </text>              <text_editor -             bevel_style="in" -             border_style="line" -             border_thickness="1"               follows="left|top|right"               height="52"               layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index bd0dac5ca1..62d40bc45f 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -483,7 +483,8 @@ sold with objects       name="error_message"       right="435"       top="208" -     width="215"> +     width="215" +     word_wrap="true">          Something ain't right.      </text>      <button @@ -583,7 +584,8 @@ sold with objects       left="72"       name="land_use_reason"       right="435" -     width="215"> +     width="215" +     word_wrap="true">          You hold 1309 m² of land.      This parcel is 512 m² of land.      </text> diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index be1278e8cc..a233f7f0fa 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -56,6 +56,8 @@         layout="topleft"         max_length="2147483647"         name="im_text" +       parse_highlights="true" +       allow_html="true"          track_bottom="true"          width="195"         word_wrap="true"> diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 8b271eb41e..bdce8fa4fc 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -33,7 +33,7 @@      <text_editor       font="SansSerif"       height="64" -     hide_border="true" +     border_visible="false"       hide_scrollbar="true"       layout="topleft"       left="77" diff --git a/indra/newview/skins/default/xui/en/floater_inspect.xml b/indra/newview/skins/default/xui/en/floater_inspect.xml index 00b9f850ad..339604e658 100644 --- a/indra/newview/skins/default/xui/en/floater_inspect.xml +++ b/indra/newview/skins/default/xui/en/floater_inspect.xml @@ -55,7 +55,7 @@       top_pad="5"       width="150">  		<button.commit_callback -		function="Inspect.OwnerProfilet" /> +		function="Inspect.OwnerProfile" />  	</button>      <button       follows="left|bottom" diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml index 70f9c19658..dc6a02efe1 100644 --- a/indra/newview/skins/default/xui/en/floater_map.xml +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -81,7 +81,6 @@       left="0"       name="floater_map_east"       right="10" -     text="E"       text_color="1 1 1 0.7"       top="215">          E @@ -95,7 +94,6 @@       left="0"       name="floater_map_west"       right="11" -     text="W"       text_color="1 1 1 0.7"       top="215">          W @@ -109,7 +107,6 @@       left="0"       name="floater_map_south"       right="10" -     text="S"       text_color="1 1 1 0.7"       top="215">          S @@ -123,7 +120,6 @@       left="0"       name="floater_map_southeast"       right="20" -     text="SE"       text_color="1 1 1 0.7"       top="215">          SE @@ -137,7 +133,6 @@       left="0"       name="floater_map_northeast"       right="20" -     text="NE"       text_color="1 1 1 0.7"       top="215">          NE @@ -151,7 +146,6 @@       left="0"       name="floater_map_southwest"       right="20" -     text="SW"       text_color="1 1 1 0.7"       top="215">          SW @@ -165,7 +159,6 @@       left="0"       name="floater_map_northwest"       right="20" -     text="NW"       text_color="1 1 1 0.7"       top="215">          NW diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index 78f795b0e2..e851710ad8 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -39,6 +39,7 @@  			 height="320"               max_length="2147483647"               name="Chat History Editor" +             parse_highlights="true"                read_only="true"               text_color="ChatHistoryTextColor"               text_readonly_color="ChatHistoryTextColor" diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index 1d7b7adca2..f90f2a81cf 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -74,6 +74,7 @@       left="4"       max_length="65536"       name="Notecard Editor" +     allow_html="true"        handle_edit_keys_directly="true"       tab_group="1"       top="46" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index c7f5a1170f..abde4ba5fa 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -33,6 +33,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"       font.style="BOLD"       layout="topleft"       left="10" @@ -58,6 +59,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left="10" @@ -83,6 +85,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left="10" @@ -130,6 +133,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left="48" @@ -155,6 +159,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left="48" @@ -345,6 +350,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left_delta="0" @@ -389,6 +395,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left="10" @@ -413,6 +420,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left_delta="0" @@ -437,6 +445,7 @@       length="1"       follows="left|top"       height="16" +     font.name="SansSerif"        font.style="BOLD"       layout="topleft"       left_delta="0" @@ -473,6 +482,7 @@       height="50"       layout="topleft"       left="10" +     font.name="SansSerif"        font.style="BOLD"       name="incomplete_title"       top_pad="5" diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml index c8b8c34f85..2085b74a55 100644 --- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml +++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml @@ -16,6 +16,7 @@       layout="topleft"       max_length="10000"       name="Chat History Editor" +     parse_highlights="true"        width="420"       word_wrap="true" />  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_telehub.xml b/indra/newview/skins/default/xui/en/floater_telehub.xml index b703b49b8b..95de27e0ea 100644 --- a/indra/newview/skins/default/xui/en/floater_telehub.xml +++ b/indra/newview/skins/default/xui/en/floater_telehub.xml @@ -88,7 +88,6 @@      </text>      <scroll_list       follows="left|top" -     font="SansSerifSmall"       height="60"       layout="topleft"       left_delta="0" diff --git a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml index a1a271d0eb..2011f57d8b 100644 --- a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml +++ b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml @@ -1,6 +1,6 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <floater - can_resize="true" + can_resize="false"   height="400"   layout="topleft"   name="floater_test_inspectors" @@ -15,7 +15,6 @@     width="300">      Click to spawn an inspector:    </text> -  <!-- James Tester, 4 years old -->    <button      name="avatar_2d_btn1"      label="Avatar 2D" @@ -25,7 +24,7 @@      width="100"  	commit_callback.function="ShowAvatarInspector"  	commit_callback.parameter="22df1dcb-810a-4975-aab9-0159958fe155" /> -	<!-- DonkeyPuncher 2008-10-1 --> +	<!-- InspectorA Tester -->    <button      name="avatar_2d_btn5"      label="Avatar 2D" @@ -34,8 +33,8 @@      height="20"      width="100"  	commit_callback.function="ShowAvatarInspector" -	commit_callback.parameter="d5330e4e-391a-4f00-9352-b797ed2f9a97" /> -	<!-- DonkeyPuncher 2009-01-15 --> +	commit_callback.parameter="927e68e0-e52d-4bb8-b1a9-add97a57c86a" /> +	<!-- InspectorB Tester -->    <button      name="avatar_2d_btn2"      label="Avatar 2D" @@ -44,8 +43,8 @@      height="20"      width="100"  	commit_callback.function="ShowAvatarInspector" -	commit_callback.parameter="05511655-a58a-48b6-b645-966f69fc17a7" /> -	<!-- 2009-06-14 --> +	commit_callback.parameter="9a2300ca-e251-45dd-bb61-e33139f6e4eb" /> +	<!-- InspectorC Tester -->    <button      name="avatar_2d_btn3"      label="Avatar 2D" @@ -54,7 +53,7 @@      height="20"      width="100"  	commit_callback.function="ShowAvatarInspector" -	commit_callback.parameter="6a164b3d-7c2c-43eb-880a-0ebc0687b3ec" /> +	commit_callback.parameter="8024f082-34cc-48a3-a42e-c42f345efd74" />  	<!-- jarvtest Bombastic 2009-10-3 -->    <button      name="avatar_2d_btn4" @@ -85,7 +84,9 @@      top_pad="10"      left_delta="0"      height="20" -    width="100"/> +    width="100" +	  commit_callback.function="ShowObjectInspector" +	  commit_callback.parameter="" />    <button      name="group_btn"      label="Group" @@ -107,5 +108,17 @@      left_delta="0"      height="20"      width="100"/> +  <text +  follows="left|top" +  font="SansSerif" +  height="20" +  layout="topleft" +  left="0" +  max_length="65536" +  name="slurl" +  top_pad="4" +  width="100"> +    secondlife:///app/agent/00000000-0000-0000-0000-000000000000/inspect +  </text>  </floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 88c001b714..8305452c85 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -122,7 +122,6 @@       left="10"       name="floater_map_north"       right="30" -     text="N"       text_color="1 1 1 0.7"       top="370">          N diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml index 6ddaa63c1d..5a29c6a319 100644 --- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -19,6 +19,8 @@   can_resize="true"   title="Test Floater"   height="500" + min_width="850"  + min_height="500"    layout="topleft"   name="floater_test_widgets"   help_topic="floater_test_widgets" @@ -39,6 +41,7 @@    <menu_bar     height="18"     layout="topleft" +   follows="top|left"      tool_tip="menu"      left="2"     name="test_menu_bar" @@ -74,7 +77,9 @@    <text     bottom="55"     layout="topleft" -   left="10"> +   follows="top|left" +   left="10" +   height="16">      For widget list see https://wiki.lindenlab.com/wiki/Viewer:UI/Widgets    </text> @@ -82,6 +87,7 @@    <button     height="20" +   follows="top|left"      label="Button"     layout="topleft"     left_delta="0" @@ -91,7 +97,7 @@     width="100" />      <!-- "flyout_button" is a button that can spawn a menu -->    <flyout_button -   follows="right|bottom" +   follows="top|left"      height="20"     label="Flyout"     layout="topleft" @@ -121,6 +127,7 @@         provide input that is not a list item. -->    <combo_box     bottom_delta="35" +   follows="top|left"      height="16"     width="150"     label="Combobox" @@ -150,6 +157,7 @@          the text. -->    <line_editor     height="20" +   follows="top|left"      layout="topleft"     left_delta="0"     name="test_line_editor" @@ -161,7 +169,7 @@    <!-- "filter_editor" is a specialized line_editor that shows read-only         help text until the user clicks in the widget. -->    <filter_editor -   follows="left|top|right" +   follows="left|top"     height="20"     label="Type here to search"     layout="topleft" @@ -173,6 +181,7 @@    <!-- "progress_bar" percent completed gets set in C++ code -->    <progress_bar     height="16" +   follows="top|left"      layout="topleft"     left_delta="0"     name="test_progress_bar" @@ -227,6 +236,7 @@    <!-- "scroll_list" is a scrolling list of columnar data. -->    <scroll_list     bottom_delta="100" +   follows="top|left"      height="80"     draw_heading="true"     tool_tip="scroll list"  @@ -239,10 +249,19 @@       dynamic_width="true"       name="second_column"       label="Column B"/> +    <row> +      <column column="first_column">short text</column> +      <column column="second_column">more short text</column> +    </row> +    <row> +      <column column="first_column">this is some longer text</column> +      <column column="second_column">and here is some more long text</column> +    </row>    </scroll_list>    <!-- "slider" is a horizontal input widget for numerical data. -->    <slider     bottom_delta="45" +   follows="top|left"      layout="topleft"     min_val="0"     max_val="100" @@ -255,22 +274,36 @@         change the value. -->    <spinner     bottom_delta="35" +   follows="top|left"      label="Spinner"     layout="topleft"     name="test_spinner"      tool_tip="spinner"/>    <text     bottom_delta="50" +   follows="top|left"  +   font.name="SansSerifSmall"      font.style = "UNDERLINE"     layout="topleft"     name="test_text"     tool_tip="text">      Text (underlined)    </text> +  <text +   top_pad="10" +   follows="top|left"  +   layout="topleft" +   width="60"  +   use_ellipses="true"  +   name="test_text" +   tool_tip="text"> +    Truncated text here +  </text>    <!-- "text_editor" is a multi-line text input widget, similar to          textarea in HTML. -->    <text_editor -   height="80" +   height="40" +   follows="top|left|bottom"      layout="topleft"     left_delta="0"     name="test_text_editor" @@ -279,7 +312,18 @@     width="200">      Text Editor    </text_editor> -   +  <text +   height="40" +   follows="top|left|bottom" +   layout="topleft" +   name="test_text_editor" +   tool_tip="text box" +   top_pad="5" +   width="200"> +      Text box +with +multiple lines +  </text>    <!-- And a third column -->    <!-- "tab_container" is a holder for multiple panels of UI widgets. @@ -309,7 +353,6 @@         color="0.3 0.6 0.9 1"         follows="left|top"         height="90" -       border="true"         layout="topleft"         left="10"         label="Color Swatch 1" @@ -333,7 +376,7 @@      </panel>      <!-- panels can also refer to other floaters or panels -->      <panel -	 border="true" +	  border="true"       filename="floater_test_checkbox.xml"       height="225"       label="Tab 2 - Checkbox" diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml index 9a3d5aa183..4ed6787f53 100644 --- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -17,7 +17,7 @@       left="0"       mouse_opaque="false"       name="main_panel" -     right="650" +     right="750"       top="0">          <text           type="string" diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index 2042ffedbc..b44acebbcf 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -1,102 +1,142 @@ -<?xml version="1.0" encoding="utf-8" standalone="yes"?> -<!-- All our XML is utf-8 encoded. --> - +<?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 -  background_opaque="false" -  background_visible="true" -  bevel_style="in" -  bg_alpha_color="PanelDefaultBackgroundColor" -  can_close="false"  -  can_minimize="false"  -	name="inspect_avatar" -	help_topic="inspect_avatar" -  single_instance="true"  -  sound_flags="0"  -	title="" -  visible="true" -	width="300" -	height="200" -  left="0" -  top="200" -  > + bevel_style="in" + bg_alpha_color="PanelDefaultBackgroundColor" + can_close="false" + can_minimize="false" + height="190" + layout="topleft" + name="inspect_avatar" + single_instance="true" + sound_flags="0" + visible="true" + width="300">    <!-- Allowed fields include:  	[BORN_ON] ("12/3/2008")  	[SL_PROFILE] (Second Life profile), -    [RW_PROFILE] (real world profile), +  [RW_PROFILE] (real world profile),  	[ACCTTYPE] ("Resident"),  	[PAYMENTINFO] ("Payment Info on File"), -	[AGE] ("1 year 2 months") --> -  <string name="Subtitle"> +	[AGE] ("1 year 2 months") +   --> +  <string +   name="Subtitle">  [AGE]    </string> -  <string name="Details"> -[ACCTTYPE], [PAYMENTINFO] -Profile: [SL_PROFILE] +  <string +     name="Details"> +[ACCTTYPE][COMMA] [PAYMENTINFO] +    </string> +  <string +     name="Partner"> +    Partner: [PARTNER]    </string>    <text -      top="180" left="10" width="280" height="70" follows="left|top|right|bottom" -      use_ellipses="true"  word_wrap="true" -      font="SansSerifHugeBold" text_color="white" -      mouse_opaque="true" name="user_name" > -    Test Name -  </text> -  <!-- General purpose subtitle area, not sure yet what goes here --> -  <text -    top="155" left="10" width="150" height="20" follows="left|top|right|bottom" -    font="SansSerifBig" -    text_color="white" -    mouse_opaque="true" -    name="user_subtitle" /> -  <!-- Leave text fields blank so it doesn't flash when data arrives off the network --> -  <text -      top="115" left="10" width="290" height="50" follows="left|top|right|bottom" -      font="SansSerifSmall" text_color="white" word_wrap="true" -      mouse_opaque="true" name="user_details" /> -  <avatar_icon -      top="185" left="230" width="60" height="60" follows="left|top|right|bottom" -      color="1 1 1 1" enabled="true" mouse_opaque="true" name="avatar_icon" -  /> -  <slider  -    bottom="35" left="45" width="250" height="30" follows="top|left" -    name="volume_slider" -    tool_tip="Voice Volume"  -    increment="0.05" initial_value="0.75" max_val="1" min_val="0" -    show_text="false" -  /> -  <button -    bottom="40" left="10" width="32" height="16" follows="left|top|right|bottom" -    name="mute_btn" -    label="" -    image_unselected="icn_speaker_dark.tga" -    image_disabled="icn_speaker_dark.tga" -    image_selected="icn_speaker-muted_dark.tga" -    image_hover_selected="icn_speaker-muted_dark.tga" -    image_disabled_selected="icn_speaker-muted_dark.tga" -    halign="center" -    toggle="true" -  /> -  <button -		bottom="10" left="10" width="110" height="20" follows="top|left"		 -    name="add_friend_btn" -    label="Add Friend" -		font="SansSerif" -	/> -  <button -		bottom="10" left="120" width="110" height="20" follows="top|left" -    name="view_profile_btn" -    label="View Profile" -		font="SansSerif" -	/> -  <button -		bottom="10" left="230" width="60" height="20" follows="top|left"  -    name="gear_btn" -    label="" -    image_overlay="Icon_Gear_Foreground" -    image_overlay_alignment="center" -    scale_image="true" -	/> -</floater>  +     follows="left|top|right|bottom" +     font="SansSerifHugeBold" +     height="70" +     left="10" +     name="user_name" +     text_color="white" +     top="20" +     use_ellipses="true" +     value="Test Name" +     width="280" +     word_wrap="true" /> +    <text +     follows="left|top|right|bottom" +     font="SansSerifBig" +     height="20" +     left="10" +     name="user_subtitle" +     text_color="white" +     top="45" +     width="150" /> +    <!-- Leave text fields blank so it doesn't flash when data arrives off the network --> +    <text +     follows="left|top|right|bottom" +     height="20" +     left="10" +     name="user_details" +     text_color="white" +     top="85" +     width="290" +     word_wrap="true" /> +    <text +     follows="left|top|right|bottom" +     height="20" +     left="10" +     name="user_partner" +     text_color="white" +     top="105" +     width="290" +     word_wrap="true" /> +    <avatar_icon +     follows="left|top|right|bottom" +     height="60" +     left="230" +     mouse_opaque="true" +     name="avatar_icon"  +     top="15" +     width="60" /> +    <slider +     follows="top|left" +     height="30" +     increment="0.05" +     left="20" +     max_val="0.95" +     min_val="0.05" +     name="volume_slider" +     show_text="false" +     tool_tip="Voice Volume" +     top="125" +     value="0.5" +     width="240" /> +    <button +     follows="left|top|right|bottom" +     height="16" +     image_disabled="icn_speaker_dark.tga" +     image_disabled_selected="icn_speaker-muted_dark.tga" +     image_hover_selected="icn_speaker-muted_dark.tga" +     image_selected="icn_speaker-muted_dark.tga" +     image_unselected="icn_speaker_dark.tga" +     is_toggle="true" +     left="265" +     name="mute_btn" +     picture_style="true" +     top="132" +     width="32" /> +    <button +     follows="top|left" +     font="SansSerif" +     height="20" +     label="Add Friend" +     left="10" +     name="add_friend_btn" +     top_pad="10" +     width="105" /> +    <button +     follows="top|left" +     font="SansSerif" +     height="20" +     label="View Profile" +     left_delta="110" +     name="view_profile_btn" +     top_delta="0" +     width="105" /> +    <menu_button +     follows="top|left" +     height="20" +     image_overlay="windows\Icon_Gear_Foreground.png" +     image_overlay_alignment="center" +     menu_filename="menu_inspect_avatar_gear.xml" +     name="gear_btn" +     picture_style="true" +     top_delta="0" +     left_delta="110" +     width="60"/> +</floater> diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml new file mode 100644 index 0000000000..cc56f630b0 --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -0,0 +1,162 @@ +<?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 + bevel_style="in" + bg_opaque_color="MouseGray" + can_close="false" + can_minimize="false" + height="145" + layout="topleft" + name="inspect_object" + single_instance="true" + sound_flags="0" + visible="true" + width="300"> +  <string name="Creator">By [CREATOR]</string> +  <string name="CreatorAndOwner"> +By [CREATOR] +Owned by [OWNER] +  </string> +  <!-- *TODO: Might need to change to [AMOUNT] if icon contains "L$" --> +  <string name="Price">L$[AMOUNT]</string> +  <string name="PriceFree">Free!</string> +  <string name="Touch">Touch</string> +  <string name="Sit">Sit</string> +  <text +     follows="all" +     font="SansSerifLargeBold" +     height="20" +     left="8" +     name="object_name" +     text_color="white" +     top="8" +     use_ellipses="true" +     value="Test Object Name That Is Really Long" +     width="268" /> +  <text +   follows="all" +   font="SansSerif" +   height="30" +   left="10" +   name="object_creator" +   top_pad="0" +   width="280"> +By Longavatarname Johnsonlongstonnammer +Owned by James Linden +  </text> +  <text +   follows="all" +   height="45" +   left="100" +   name="object_description" +   top_pad="4" +   width="200" +   word_wrap="true"> +This is a really long description for an object being as how it is at least 80 characters in length and maybe more like 120 at this point. Who knows, really? +  </text> +  <!-- *TODO: Replace this icon --> +  <icon +  name="price_icon" +  image_name="Favorite_Star_Active" +  left="5" +  width="16" +  height="16" +  top="79" +  follows="left|top" +  /> +  <text +   follows="all" +   font="SansSerifSmallBold" +   height="45" +   left="22" +   name="price_text" +   text_color="white" +   top="80" +   font_shadow="none" +   width="80"> +L$300,000 +  </text> +  <!-- Overlapping buttons for all default actions.  Show "Buy" if +  for sale, "Sit" if can sit, etc. --> +  <button +     follows="top|left" +     font="SansSerif" +     height="23" +     label="Buy" +     left="10" +     name="buy_btn" +     top="116" +     width="100" /> +  <button +   follows="top|left" +   font="SansSerif" +   height="23" +   label="Pay" +   left_delta="0" +   name="pay_btn" +   top_delta="0" +   width="100" /> +  <button +   follows="top|left" +   font="SansSerif" +   height="23" +   label="Take Copy" +   left_delta="0" +   name="take_free_copy_btn" +   top_delta="0" +   width="100" /> +  <button +   follows="top|left" +   font="SansSerifSmall" +   height="23" +   label="Touch" +   left_delta="0" +   name="touch_btn" +   top_delta="0" +   width="100" /> +  <button +   follows="top|left" +   font="SansSerif" +   height="23" +   label="Sit" +   left_delta="0" +   name="sit_btn" +   top_delta="0" +   width="100" /> +  <button +   follows="top|left" +   font="SansSerifSmall" +   height="23" +   label="Open" +   left_delta="0" +   name="open_btn" +   top_delta="0" +   width="100" /> +  <!-- non-overlapping buttons here --> +  <menu_button +     follows="top|left" +     height="23" +     image_overlay="Icon_Gear_Foreground" +     image_overlay_alignment="center" +   right="-8" +     menu_filename="menu_inspect_object_gear.xml"  +     name="gear_btn" +     picture_style="true" +   top_delta="0" +     width="30" /> +    <button +     follows="top|left" +     height="22" +     image_overlay="TabIcon_Close_Off" +     layout="topleft" +     name="more_info_btn" +     picture_style="true" +     right="-8" +     top="7" +     left_delta="110" +     tab_stop="false" +     width="20" /> +</floater> diff --git a/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml new file mode 100644 index 0000000000..9f5b7f3813 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_inspect_avatar_gear.xml @@ -0,0 +1,114 @@ +<?xml version="1.0" encoding="utf-8"?>
 +<menu
 +         create_jump_keys="true"
 +         layout="topleft"
 +         mouse_opaque="false"
 +         visible="false"
 +         name="Gear Menu">
 +  <menu_item_call
 +   label="View Profile"
 +   layout="topleft"
 +   enabled="true" 
 +   name="view_profile">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.ViewProfile"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Add Friend"
 +   layout="topleft"
 +   name="add_friend">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.AddFriend"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="IM"
 +   layout="topleft"
 +   name="im">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.IM"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Call"
 +   layout="topleft"
 +   enabled="true"
 +   name="call">
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Teleport"
 +   layout="topleft"
 +   name="teleport">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Teleport"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Invite to Group"
 +   layout="topleft"
 +   name="invite_to_group">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.InviteToGroup"/>
 +  </menu_item_call>
 +  <menu_item_separator layout="topleft" />
 +  <menu_item_call
 +   label="Block"
 +   layout="topleft"
 +   name="block">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Block"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Report"
 +   layout="topleft"
 +   name="report">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Report"/>
 +  </menu_item_call>  
 +  <menu_item_call
 +   label="Freeze"
 +   layout="topleft"
 +   name="freeze">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Freeze"/>
 +    <menu_item_call.on_visible
 +     function="InspectAvatar.VisibleGodMode"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Eject"
 +   layout="topleft"
 +   name="eject">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Eject"/>
 +    <menu_item_call.on_visible
 +     function="InspectAvatar.VisibleGodMode"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Debug"
 +   layout="topleft"
 +   name="debug">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Debug"/>
 +    <menu_item_call.on_visible
 +     function="InspectAvatar.VisibleGodMode"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   label="Find On Map"
 +   layout="topleft"
 +   name="find_on_map">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.FindOnMap"/>
 +    <menu_item_call.on_visible
 +     function="InspectAvatar.VisibleFindOnMap"/>
 +  </menu_item_call>
 +  <menu_item_call
 +   enabled="false" 
 +   label="Zoom In"
 +   layout="topleft"
 +   name="zoom_in">
 +  </menu_item_call>  
 +  <menu_item_call
 +   label="Pay"
 +   layout="topleft"
 +   name="pay">
 +    <menu_item_call.on_click
 +     function="InspectAvatar.Pay"/>
 +  </menu_item_call>
 +</menu>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml new file mode 100644 index 0000000000..1bba8eb264 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_inspect_object_gear.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="utf-8"?> +<menu +   create_jump_keys="true" +   layout="topleft" +   mouse_opaque="false" +   visible="false" +   name="Gear Menu"> +  <menu_item_call +   label="Touch" +   layout="topleft" +   enabled="true" +   name="touch">     +    <menu_item_call.on_click +     function="InspectObject.Touch"/> +    <menu_item_call.on_visible +     function="Object.VisibleTouch" /> +  </menu_item_call> +  <menu_item_call +  label="Sit" +  layout="topleft" +  name="sit"> +    <menu_item_call.on_click +     function="InspectObject.Sit"/> +    <menu_item_call.on_visible +     function="Object.EnableSit" /> +  </menu_item_call> +  <menu_item_call +   label="Pay" +   layout="topleft" +   name="pay"> +    <menu_item_call.on_click +     function="InspectObject.Pay"/> +    <menu_item_call.on_visible +     function="VisiblePayObject" /> +  </menu_item_call> +  <menu_item_call +   label="Buy" +   layout="topleft" +   enabled="true"  +   name="buy"> +    <menu_item_call.on_click +     function="InspectObject.Buy"/> +    <menu_item_call.on_visible +     function="Object.VisibleBuy" /> +  </menu_item_call> +  <menu_item_call +   label="Take" +   layout="topleft" +   name="take"> +    <menu_item_call.on_click +     function="Object.Take" /> +    <menu_item_call.on_enable +     function="Object.VisibleTake"/> +  </menu_item_call> +  <menu_item_call +   label="Take Copy" +   layout="topleft" +   name="take_copy"> +    <menu_item_call.on_click +     function="InspectObject.TakeFreeCopy"/> +    <menu_item_call.on_visible +      function="Tools.VisibleTakeCopy"/> +  </menu_item_call> +  <menu_item_call +   label="Open" +   layout="topleft" +   name="open"> +    <menu_item_call.on_click +     function="InspectObject.Open"/> +    <menu_item_call.on_visible +     function="Object.VisibleOpen" /> +  </menu_item_call> +  <menu_item_call +   label="Edit" +   layout="topleft" +   name="report"> +        <menu_item_call.on_click +         function="Object.Edit" /> +        <menu_item_call.on_enable +         function="Object.VisibleEdit"/> +  </menu_item_call>   +  <menu_item_call +   label="Wear" +   layout="topleft" +   name="wear"> +    <menu_item_call.on_click +     function="Object.AttachToAvatar" /> +    <menu_item_call.on_visible +     function="Object.VisibleWear" /> +  </menu_item_call>   +  <menu_item_call +   label="Report" +   layout="topleft" +   name="report"> +    <menu_item_call.on_click +     function="Object.ReportAbuse" /> +  </menu_item_call> +  <menu_item_call +   label="Block" +   layout="topleft" +   name="block"> +    <menu_item_call.on_click +     function="Object.Mute" /> +    <menu_item_call.on_visible +     function="Object.VisibleMute" /> +  </menu_item_call> +  <menu_item_call +    enabled="false"  +    label="Zoom In" +    layout="topleft" +   name="zoom_in"> +  </menu_item_call>     +  <menu_item_call +   label="Remove" +   layout="topleft" +   name="remove"> +      <menu_item_call.on_click +       function="Object.Delete" /> +      <menu_item_call.on_visible +       function="Object.VisibleDelete" /> +  </menu_item_call> +  <menu_item_call +   label="More Info" +   layout="topleft" +   name="more_info"> +    <menu_item_call.on_click +     function="InspectObject.MoreInfo"/> +  </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index fe088b43be..829c2e02d8 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -447,7 +447,7 @@ Your default permissions may not work in older regions.      icon="alertmodal.tga"      name="ClickUnimplemented"      type="alertmodal"> -This feature is yet to be implemented.  +Sorry, not implemented yet.    </notification>    <notification @@ -761,7 +761,7 @@ You need an account to enter [SECOND_LIFE]. Would you like to create one now?  	name="url"  	openexternally = "1"> -			http://secondlife.com/registration/ +			http://join/secondlife.com/      </url>      <usetemplate       name="okcancelbuttons" diff --git a/indra/newview/skins/default/xui/en/panel_audio_device.xml b/indra/newview/skins/default/xui/en/panel_audio_device.xml index 5f495ef8ce..4329982209 100644 --- a/indra/newview/skins/default/xui/en/panel_audio_device.xml +++ b/indra/newview/skins/default/xui/en/panel_audio_device.xml @@ -80,7 +80,7 @@       bg_readonly_color="0 0 0 0"       enabled="false"       height="60" -     hide_border="true" +     border_visible="false"       hide_scrollbar="true"       layout="topleft"       left_delta="10" diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index d5ed0c986d..c3ae2d953a 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -62,7 +62,6 @@       auto_update="true"       follows="right"       draw_border="false" -     halign="left"       height="16"       layout="topleft"       left_pad="3" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index 0d6d8ba97d..b13058f40a 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -201,7 +201,7 @@           type="string"           follows="left|top"           font="SansSerifSmall" -	 font.style="BOLD" +	      font.style="BOLD"           height="15"           layout="topleft"           left="10" @@ -272,7 +272,7 @@        <text           follows="left|top"           font="SansSerifSmall" -	 font.style="BOLD" +	       font.style="BOLD"           height="15"           layout="topleft"           left="10" @@ -305,7 +305,7 @@          <text           follows="left|top"           font="SansSerifSmall" -	 font.style="BOLD" +      	 font.style="BOLD"           height="15"           layout="topleft"           left="10" @@ -391,6 +391,7 @@         follows="left|top"         height="10"         layout="topleft" +       font="SansSerifSmall"          font.style="BOLD"         left="12"         mouse_opaque="false" diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 069cf1d7bd..999aa814b1 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -55,7 +55,6 @@      <scroll_list       draw_heading="true"       follows="top" -     font="SansSerifSmall"       heading_height="14"       height="100"       layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index c96c296057..aeeb884036 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -9,7 +9,7 @@   width="800">      <panel.string       name="create_account_url"> -        http://secondlife.com/registration/ +        http://join.secondlife.com/      </panel.string>      <panel.string       name="real_url"> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 02d179d503..b4212aaa34 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -17,6 +17,10 @@          http://www.secondlife.com/account/billing.php?lang=en      </string>      <string +     name="partner_edit_link_url"> +        http://www.secondlife.com/account/partners.php?lang=en +    </string> +    <string       name="my_account_link_url"       value="http://secondlife.com/account" />      <string diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 9b2461db7c..9abaf29f57 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -82,7 +82,8 @@                       name="progress_text"                       text_color="LoginProgressBoxTextColor"                       top_pad="5" -                     width="593" /> +                     width="593" +                     word_wrap="true"/>                      <progress_bar                       bottom="115"                       color_bar="1 1 1 0.96" @@ -100,11 +101,12 @@                       height="100"                       layout="topleft"                       left="45" -                     line_spacing="2" +                     line_spacing.pixels="2"                       name="message_text"                       text_color="LoginProgressBoxTextColor"                       top="145" -                     width="550" /> +                     width="550" +                     word_wrap="true"/>                  </layout_panel>                  <layout_panel                   height="200" diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index a3c714ce72..765e2ae623 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -32,8 +32,6 @@      <text_editor       type="string"       length="1" -     bevel_style="none" -     border_style="line"       bottom="393"       follows="left|top|right|bottom"       font="Monospace" diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 418b88b7b5..d172154d49 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -21,7 +21,6 @@          filename="panel_sidetray_home_tab.xml"          label="home"          border="true" -        font="SansSerifBold"        />    </sidetray_tab> @@ -44,14 +43,12 @@          name="panel_people"          filename="panel_people.xml"          border="true" -        font="SansSerifBold"        />        <panel          class="panel_profile_view"          name="panel_profile_view"          filename="panel_profile_view.xml"          border="true" -        font="SansSerifBold"        />        <panel          class="panel_group_info_sidetray" @@ -107,7 +104,6 @@          filename="panel_me_profile.xml"          label="Me"          border="true" -        font="SansSerifBold"        />    </sidetray_tab> diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index f6ffd2e4ee..07f0806ccb 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -58,7 +58,7 @@      <text       type="string"       length="1" -     disabled_color="TimeTextColor" +     text_readonly_color="TimeTextColor"       follows="right|bottom"       halign="right"       height="16" @@ -100,9 +100,8 @@       visible="false"       width="16" />      <text -     type="string" -     length="1" -     disabled_color="HealthTextColor" +      bg_visible="false" +     text_readonly_color="HealthTextColor"       follows="rsight|bottom"       font_shadow="hard"       height="16" diff --git a/indra/newview/skins/default/xui/en/panel_world_map.xml b/indra/newview/skins/default/xui/en/panel_world_map.xml index ee355fa95c..9f08d3a817 100644 --- a/indra/newview/skins/default/xui/en/panel_world_map.xml +++ b/indra/newview/skins/default/xui/en/panel_world_map.xml @@ -51,7 +51,6 @@       label="N"       layout="topleft"       name="floater_map_north" -     text="N"       text_color="1 1 1 0.7">          N      </text> @@ -61,7 +60,6 @@       label="E"       layout="topleft"       name="floater_map_east" -     text="E"       text_color="1 1 1 0.7">          E      </text> @@ -71,7 +69,6 @@       label="W"       layout="topleft"       name="floater_map_west" -     text="W"       text_color="1 1 1 0.7">          W      </text> @@ -81,7 +78,6 @@       label="S"       layout="topleft"       name="floater_map_south" -     text="S"       text_color="1 1 1 0.7">          S      </text> @@ -91,7 +87,6 @@       label="SE"       layout="topleft"       name="floater_map_southeast" -     text="SE"       text_color="1 1 1 0.7">          SE      </text> @@ -101,7 +96,6 @@       label="NE"       layout="topleft"       name="floater_map_northeast" -     text="NE"       text_color="1 1 1 0.7">          NE      </text> @@ -111,7 +105,6 @@       label="SW"       layout="topleft"       name="floater_map_southwest" -     text="SW"       text_color="1 1 1 0.7">          SW      </text> @@ -121,7 +114,6 @@       label="NW"       layout="topleft"       name="floater_map_northwest" -     text="NW"       text_color="1 1 1 0.7">          NW      </text> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index f398cc33b5..3a5347fe12 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -15,9 +15,6 @@  	<string name="StartupDetectingHardware">Detecting hardware...</string>  	<string name="StartupLoading">Loading</string>  	<string name="Fullbright">Fullbright (Legacy)</string>	 -	<string name="CacheWaiting">(Loading...)</string> -	<string name="CacheNobody">(nobody)</string> -	<string name="CacheNone">(none)</string>	  	<!-- Login -->  	<string name="LoginInProgress">Logging in. [APP_NAME] may appear frozen.  Please wait.</string>  	<string name="LoginInProgressNoFrozen">Logging in...</string> @@ -40,13 +37,14 @@  	<string name="LoginDownloadingClothing">Downloading clothing...</string>  	<string name="LoginFailedNoNetwork">Network Error: Could not establish connection, please check your network connection.</string>  	<string name="Quit">Quit</string> -	<string name="create_account_url">http://secondlife.com/registration/</string> +	<string name="create_account_url">http://join.secondlife.com/</string>  	<!-- Disconnection -->  	<string name="AgentLostConnection">This region may be experiencing trouble.  Please check your connection to the Internet.</string>  	<!-- Tooltip, lltooltipview.cpp --> +	<!-- *TODO: Most of these are now unused, eliminate them -->  	<string name="TooltipPerson">Person</string><!-- Object under mouse pointer is an avatar -->  	<string name="TooltipNoName">(no name)</string> <!-- No name on an object -->  	<string name="TooltipOwner">Owner:</string> <!-- Owner name follows --> @@ -118,7 +116,10 @@  	<!-- Avatar name: text shown while fetching name -->  	<string name="AvatarNameWaiting">(waiting)</string> -	<!-- Avatar name: text shown as an alternative to AvatarNameFetching, easter egg. --> +  <!-- Avatar name: More than one avatar is selected/used here --> +  <string name="AvatarNameMultiple">(multiple)</string> +   +  <!-- Avatar name: text shown as an alternative to AvatarNameFetching, easter egg. -->  	<string name="AvatarNameHippos">(hippos)</string>  	<!-- Group name: text shown for LLUUID::null --> @@ -1931,21 +1932,24 @@ this texture in your inventory  	<string name="Left Pec">Left Pec</string>  	<string name="Right Pec">Right Pec</string>	 -  <!-- Avatar age computation, see LLAvatarPropertiesProcessor::ageFromDate --> -  <string name="YearsMonthsOld">[AGEYEARS][AGEMONTHS]old</string> -  <string name="WeeksOld">[AGEWEEKS]old</string> -  <string name="DaysOld">[AGEDAYS]old</string> +  <!-- Avatar age computation, see LLDateUtil::ageFromDate --> +  <string name="YearsMonthsOld">[AGEYEARS] [AGEMONTHS] old</string> +  <string name="YearsOld">[AGEYEARS] old</string> +  <string name="MonthsOld">[AGEMONTHS] old</string> +  <string name="WeeksOld">[AGEWEEKS] old</string> +  <string name="DaysOld">[AGEDAYS] old</string>    <string name="TodayOld">Joined today</string> -  <!-- Use value="" because of trailing spaces --> -  <string name="AgeYears"  value="[YEARS] years " /> -  <string name="Age1Year"  value="1 year "/> -  <string name="AgeMonths" value="[MONTHS] months "/> -  <string name="Age1Month" value="1 month "/> -  <string name="AgeWeeks"  value="[WEEKS] weeks "/> -  <string name="Age1Week"  value="1 week "/> -  <string name="AgeDays"   value="[DAYS] days "/> -  <string name="Age1Day"   value="1 day "/> +  <!-- AgeYearsA = singular, AgeYearsB = plural, see logic in +      LLTrans::getCountString() --> +  <string name="AgeYearsA">[COUNT] year</string> +  <string name="AgeYearsB">[COUNT] years</string> +  <string name="AgeMonthsA">[COUNT] month</string> +  <string name="AgeMonthsB">[COUNT] months</string> +  <string name="AgeWeeksA">[COUNT] week</string> +  <string name="AgeWeeksB">[COUNT] weeks</string> +  <string name="AgeDaysA">[COUNT] day</string> +  <string name="AgeDaysB">[COUNT] days</string>    <!-- Account types, see LLAvatarPropertiesProcessor -->    <string name="AcctTypeResident">Resident</string> @@ -1995,8 +1999,8 @@ this texture in your inventory  	<!-- groups -->  	<string name="GroupsNone">none</string> -	<string name="Group" value=" (group)" /> -	<string name="Unknown">(Unknown)</string> +  <string name="Group" value=" (group)" /> +  <string name="Unknown">(Unknown)</string>  	<string name="SummaryForTheWeek"    value="Summary for this week, beginning on " />  	<string name="NextStipendDay"       value="The next stipend day is " />  	<string name="GroupIndividualShare" value="                      Group       Individual Share" /> diff --git a/indra/newview/skins/default/xui/en/widgets/line_editor.xml b/indra/newview/skins/default/xui/en/widgets/line_editor.xml index 8b4126952e..546fbd9b47 100644 --- a/indra/newview/skins/default/xui/en/widgets/line_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/line_editor.xml @@ -1,8 +1,7 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<line_editor -  background_image="TextField_Off" -  background_image_disabled="TextField_Disabled" -  background_image_focused="TextField_Active" +<line_editor background_image="TextField_Off" +             background_image_disabled="TextField_Disabled" +             background_image_focused="TextField_Active"               select_on_focus="false"               handle_edit_keys_directly="false"               commit_on_focus_lost="true" diff --git a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml index 4f2261c953..8ace7b96bc 100644 --- a/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/simple_text_editor.xml @@ -1,22 +1,26 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <simple_text_editor +  allow_html="false"     mouse_opaque="true"    font="SansSerifSmall"    max_length="255"     embedded_items="false"     hide_scrollbar="false" -  hide_border="true" +  border_visible="false"    word_wrap="false"     ignore_tab="true" +  line_spacing.pixels="1"     track_bottom="false"     cursor_color="TextCursorColor"    default_color="TextDefaultColor"    text_color="TextFgColor"    text_readonly_color="TextFgReadOnlyColor" +  h_pad="5"  +  v_pad="3" +  bg_visible="true"    bg_readonly_color="TextBgReadOnlyColor"    bg_writeable_color="TextBgWriteableColor" -  bg_focus_color="TextBgFocusColor" -  link_color="HTMLLinkColor"> +  bg_focus_color="TextBgFocusColor">    <simple_text_editor.border      bevel_style="in"      follows="all" /> diff --git a/indra/newview/skins/default/xui/en/widgets/text.xml b/indra/newview/skins/default/xui/en/widgets/text.xml index 3d98cd66f9..7d78a8fa20 100644 --- a/indra/newview/skins/default/xui/en/widgets/text.xml +++ b/indra/newview/skins/default/xui/en/widgets/text.xml @@ -1,16 +1,20 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<text name="text_box"  +<text allow_html="true" +      clip_to_rect="false" +      name="text_box"         font="SansSerifSmall"        font_shadow="soft"         tab_stop="false"         halign="left"         hover_color="LabelSelectedColor"  -      disabled_color="LabelDisabledColor"  -      background_color="FloaterDefaultBackgroundColor"  +      h_pad="-1"  +      hide_scrollbar="true" +      text_readonly_color="LabelDisabledColor" +      bg_writeable_color="FloaterDefaultBackgroundColor"         border_color="DefaultHighlightLight"        use_ellipses="false"        bg_visible="false"  -      border_drop_shadow_visible="false"         border_visible="false"         hover="false"  -      text_color="LabelTextColor"/> +      text_color="LabelTextColor" +      v_pad="-1"/> diff --git a/indra/newview/skins/default/xui/en/widgets/text_editor.xml b/indra/newview/skins/default/xui/en/widgets/text_editor.xml index deaade04f8..23ca8ea338 100644 --- a/indra/newview/skins/default/xui/en/widgets/text_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/text_editor.xml @@ -1,4 +1,4 @@  <?xml version="1.0" encoding="utf-8" standalone="yes" ?>  <!-- Core parameters are in simple_text_editor.xml -->  <text_editor -  allow_html="false" /> +  allow_html="false"/> diff --git a/indra/newview/skins/default/xui/en/widgets/textbase.xml b/indra/newview/skins/default/xui/en/widgets/textbase.xml new file mode 100644 index 0000000000..c352abca3b --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/textbase.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<textbase clip_to_rect="true" +          h_pad="4" +          v_pad="4"/> diff --git a/indra/newview/skins/default/xui/nl/floater_telehub.xml b/indra/newview/skins/default/xui/nl/floater_telehub.xml index 5a8abc208a..8fe8e06c03 100644 --- a/indra/newview/skins/default/xui/nl/floater_telehub.xml +++ b/indra/newview/skins/default/xui/nl/floater_telehub.xml @@ -17,7 +17,7 @@  	<text name="spawn_points_text">  		Spawnpunten (posities, niet objecten):  	</text> -	<scroll_list bottom_delta="-44" draw_border="true" follows="left|top" font="SansSerifSmall" +	<scroll_list bottom_delta="-44" draw_border="true" follows="left|top"  	     height="40" left="10" multi_select="false" name="spawn_points_list"  	     width="230" /> diff --git a/indra/newview/tests/lldateutil_test.cpp b/indra/newview/tests/lldateutil_test.cpp new file mode 100644 index 0000000000..30e39a3bcf --- /dev/null +++ b/indra/newview/tests/lldateutil_test.cpp @@ -0,0 +1,159 @@ +/**  + * @file lldateutil_test.cpp + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + *  + * Copyright (c) 2001-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 "../test/lltut.h" + +#include "../lldateutil.h" + +#include "lldate.h" +#include "llstring.h"	// LLStringUtil::format() +#include "lltrans.h" +#include "llui.h" + +#include <map> + + +// Baked-in return values for getString() +std::map< std::string, std::string > gString; + +// Baked-in return values for getCountString() +// map of pairs of input xml_desc and integer count +typedef std::pair< std::string, int > count_string_t; +std::map< count_string_t, std::string > gCountString; + +std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args) +{ +	std::string text = gString[xml_desc]; +	LLStringUtil::format(text, args); +	return text; +} + +std::string LLTrans::getCountString(const std::string& language, const std::string& xml_desc, S32 count) +{ +	return gCountString[ count_string_t(xml_desc, count) ]; +} + +std::string LLUI::getLanguage() +{ +	return "en"; +} + +namespace tut +{ +    struct dateutil +    { +		// Hard-code a "now" date so unit test doesn't change with +		// current time.  Because server strings are in Pacific time +		// roll this forward 8 hours to compensate.  This represents +		// 2009-12-31T00:00:00Z UTC. +		dateutil() +			:	mNow(std::string("2009-12-31T08:00:00Z")) +		{ +			// copied from strings.xml +			gString["YearsMonthsOld"] = "[AGEYEARS] [AGEMONTHS] old"; +			gString["YearsOld"] = "[AGEYEARS] old"; +			gString["MonthsOld"] = "[AGEMONTHS] old"; +			gString["WeeksOld"] = "[AGEWEEKS] old"; +			gString["DaysOld"] = "[AGEDAYS] old"; +			gString["TodayOld"] = "Joined today"; + +			gCountString[ count_string_t("AgeYears", 1) ]  = "1 year"; +			gCountString[ count_string_t("AgeYears", 2) ]  = "2 years"; +			gCountString[ count_string_t("AgeMonths", 1) ] = "1 month"; +			gCountString[ count_string_t("AgeMonths", 2) ] = "2 months"; +			gCountString[ count_string_t("AgeWeeks", 1) ]  = "1 week"; +			gCountString[ count_string_t("AgeWeeks", 2) ]  = "2 weeks"; +			gCountString[ count_string_t("AgeDays", 1) ]   = "1 day"; +			gCountString[ count_string_t("AgeDays", 2) ]   = "2 days"; +		} +		LLDate mNow; +    }; +     +	typedef test_group<dateutil> dateutil_t; +	typedef dateutil_t::object dateutil_object_t; +	tut::dateutil_t tut_dateutil("dateutil"); + +	template<> template<> +	void dateutil_object_t::test<1>() +	{ +		set_test_name("Years"); +		ensure_equals("years + months", +			LLDateUtil::ageFromDate("10/30/2007", mNow), +			"2 years 2 months old" ); +		ensure_equals("years", +			LLDateUtil::ageFromDate("12/31/2007", mNow), +			"2 years old" ); +		ensure_equals("single year", +			LLDateUtil::ageFromDate("12/31/2008", mNow), +			"1 year old" ); +		ensure_equals("single year + a bit", +			LLDateUtil::ageFromDate("12/12/2008", mNow), +			"1 year old" ); +    } + +	template<> template<> +	void dateutil_object_t::test<2>() +	{ +		set_test_name("Months"); +		ensure_equals("months", +			LLDateUtil::ageFromDate("10/30/2009", mNow), +			"2 months old" ); +		ensure_equals("single month", +			LLDateUtil::ageFromDate("11/30/2009", mNow), +			"1 month old" ); +	} + +	template<> template<> +	void dateutil_object_t::test<3>() +	{ +		set_test_name("Weeks"); +		ensure_equals("weeks", +			LLDateUtil::ageFromDate("12/17/2009", mNow), +			"2 weeks old" ); +		ensure_equals("single week", +			LLDateUtil::ageFromDate("12/24/2009", mNow), +			"1 week old" ); +	} + +	template<> template<> +	void dateutil_object_t::test<4>() +	{ +		set_test_name("Days"); +		ensure_equals("days", +			LLDateUtil::ageFromDate("12/29/2009", mNow), +			"2 days old" ); +		ensure_equals("single day", +			LLDateUtil::ageFromDate("12/30/2009", mNow), +			"1 day old" ); +		ensure_equals("today", +			LLDateUtil::ageFromDate("12/31/2009", mNow), +			"Joined today" ); +	} +}  | 
