diff options
| author | Oz Linden <oz@lindenlab.com> | 2011-01-06 14:32:01 -0500 | 
|---|---|---|
| committer | Oz Linden <oz@lindenlab.com> | 2011-01-06 14:32:01 -0500 | 
| commit | 94fbf99ac2e325a75a016e2f4c3b12cf8c82fc7c (patch) | |
| tree | 0f1aa2cbd03f47adf17f39e6bca8e7d5e4ac165c /indra/newview | |
| parent | f1fd558dddf43277e024cb918c371d94d0764910 (diff) | |
| parent | a9686db3e606ec45d23265fd34a1a35498f39857 (diff) | |
merge changes for storm-714
Diffstat (limited to 'indra/newview')
33 files changed, 414 insertions, 326 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8eb350da34..ce22a52460 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1891,6 +1891,8 @@ if (LL_TESTS)      llremoteparcelrequest.cpp      llviewerhelputil.cpp      llversioninfo.cpp +    llworldmap.cpp +    llworldmipmap.cpp    )    ################################################## @@ -1978,8 +1980,6 @@ if (LL_TESTS)    #ADD_VIEWER_BUILD_TEST(llmemoryview viewer)    #ADD_VIEWER_BUILD_TEST(llagentaccess viewer) -  #ADD_VIEWER_BUILD_TEST(llworldmap viewer) -  #ADD_VIEWER_BUILD_TEST(llworldmipmap viewer)    #ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)    #ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)    #ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index b3324ea6c6..ea7ac6beda 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4780,6 +4780,17 @@        <key>Value</key>        <string>http://map.secondlife.com.s3.amazonaws.com/</string>      </map> +    <key>CurrentMapServerURL</key> +    <map> +      <key>Comment</key> +      <string>Current Session World map URL</string> +      <key>Persist</key> +      <integer>0</integer> +      <key>Type</key> +      <string>String</string> +      <key>Value</key> +      <string></string> +    </map>      <key>MapShowEvents</key>      <map>        <key>Comment</key> @@ -12423,5 +12434,16 @@        <key>Value</key>        <string>name</string>      </map> +    <key>ReleaseNotesURL</key> +    <map> +      <key>Comment</key> +      <string>Release notes URL template</string> +      <key>Persist</key> +      <integer>1</integer> +      <key>Type</key> +      <string>String</string> +      <key>Value</key> +      <string>http://secondlife.com/app/releasenotes/?channel=[CHANNEL]&version=[VERSION]</string> +    </map>  </map>  </llsd> diff --git a/indra/newview/app_settings/shaders/shader_heirarchy.txt b/indra/newview/app_settings/shaders/shader_hierarchy.txt index d8bbf69b38..d8bbf69b38 100644 --- a/indra/newview/app_settings/shaders/shader_heirarchy.txt +++ b/indra/newview/app_settings/shaders/shader_hierarchy.txt diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index a95abd7dd1..a82c3da4c5 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -135,7 +135,7 @@ RenderFlexTimeFactor		1	1.0  RenderGlowResolutionPow		1	9  RenderMaxPartCount			1	4096  RenderObjectBump			1	1 -RenderReflectionDetail		1	2 +RenderReflectionDetail		1	0  RenderTerrainDetail			1	1  RenderTerrainLODFactor		1	2.0  RenderTransparentWater		1	1 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index a52b32355d..a2cd4b834c 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -134,7 +134,7 @@ RenderFlexTimeFactor		1	1.0  RenderGlowResolutionPow		1	9  RenderMaxPartCount			1	4096  RenderObjectBump			1	1 -RenderReflectionDetail		1	2 +RenderReflectionDetail		1	0  RenderTerrainDetail			1	1  RenderTerrainLODFactor		1	2.0  RenderTransparentWater		1	1 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 6dabef53a8..3ad7f4e892 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -133,7 +133,7 @@ RenderGlowResolutionPow		1	9  RenderLightingDetail		1	1  RenderMaxPartCount			1	4096  RenderObjectBump			1	1 -RenderReflectionDetail		1	2 +RenderReflectionDetail		1	0  RenderTerrainDetail			1	1  RenderTerrainLODFactor		1	2.0  RenderTransparentWater		1	1 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index a09ba17c62..38e6bb1e5e 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -135,7 +135,7 @@ RenderFlexTimeFactor		1	1.0  RenderGlowResolutionPow		1	9  RenderMaxPartCount			1	4096  RenderObjectBump			1	1 -RenderReflectionDetail		1	2 +RenderReflectionDetail		1	0  RenderTerrainDetail			1	1  RenderTerrainLODFactor		1	2.0  RenderTransparentWater		1	1 diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 351b9ac5da..1b94d8cbcd 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -83,7 +83,6 @@ LLFloaterMap::~LLFloaterMap()  BOOL LLFloaterMap::postBuild()  {  	mMap = getChild<LLNetMap>("Net Map"); -	mMap->setScale(gSavedSettings.getF32("MiniMapScale"));  	mMap->setToolTipMsg(getString("ToolTipMsg"));	  	sendChildToBack(mMap); @@ -288,7 +287,16 @@ void LLFloaterMap::handleZoom(const LLSD& userdata)  	std::string level = userdata.asString();  	F32 scale = 0.0f; -	if (level == std::string("close")) +	if (level == std::string("default")) +	{ +		LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale"); +		if(pvar) +		{ +			pvar->resetToDefault(); +			scale = gSavedSettings.getF32("MiniMapScale"); +		} +	} +	else if (level == std::string("close"))  		scale = LLNetMap::MAP_SCALE_MAX;  	else if (level == std::string("medium"))  		scale = LLNetMap::MAP_SCALE_MID; @@ -296,7 +304,6 @@ void LLFloaterMap::handleZoom(const LLSD& userdata)  		scale = LLNetMap::MAP_SCALE_MIN;  	if (scale != 0.0f)  	{ -		gSavedSettings.setF32("MiniMapScale", scale );  		mMap->setScale(scale);  	}  } diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index bdc0dfa7e2..f74ae92a7b 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -470,7 +470,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)  }  //static -bool LLIMFloater::resetAllowedRectPadding(const LLSD& newvalue) +bool LLIMFloater::resetAllowedRectPadding()  {  	//reset allowed rect right padding if "SidebarCameraMovement" option   	//or sidebar state changed @@ -482,10 +482,10 @@ void LLIMFloater::getAllowedRect(LLRect& rect)  {  	if (sAllowedRectRightPadding == RECT_PADDING_NOT_INIT) //wasn't initialized  	{ -		gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2)); +		gSavedSettings.getControl("SidebarCameraMovement")->getSignal()->connect(boost::bind(&LLIMFloater::resetAllowedRectPadding));  		LLSideTray*	side_bar = LLSideTray::getInstance(); -		side_bar->getCollapseSignal().connect(boost::bind(&LLIMFloater::resetAllowedRectPadding, _2)); +		side_bar->setVisibleWidthChangeCallback(boost::bind(&LLIMFloater::resetAllowedRectPadding));  		sAllowedRectRightPadding = RECT_PADDING_NEED_RECALC;  	} @@ -500,10 +500,7 @@ void LLIMFloater::getAllowedRect(LLRect& rect)  		if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE)  		{ -			LLSideTray*	side_bar = LLSideTray::getInstance(); - -			if (side_bar->getVisible() && !side_bar->getCollapsed()) -				sAllowedRectRightPadding += side_bar->getRect().getWidth(); +			sAllowedRectRightPadding += LLSideTray::getInstance()->getVisibleWidth();  		}  	}  	rect.mRight -= sAllowedRectRightPadding; diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index e80e45e64a..5158f6c1f7 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -156,7 +156,7 @@ private:  	static void closeHiddenIMToasts(); -	static bool resetAllowedRectPadding(const LLSD& newvalue); +	static bool resetAllowedRectPadding();  	//need to keep this static for performance issues  	static S32 sAllowedRectRightPadding; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ab0acbae50..5108f68592 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -5344,11 +5344,6 @@ void LLRecentItemsFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags)  	menuentry_vec_t disabled_items, items = getMenuItems(); -	items.erase(std::remove(items.begin(), items.end(), std::string("New Body Parts")), items.end()); -	items.erase(std::remove(items.begin(), items.end(), std::string("New Clothes")), items.end()); -	items.erase(std::remove(items.begin(), items.end(), std::string("New Note")), items.end()); -	items.erase(std::remove(items.begin(), items.end(), std::string("New Gesture")), items.end()); -	items.erase(std::remove(items.begin(), items.end(), std::string("New Script")), items.end());  	items.erase(std::remove(items.begin(), items.end(), std::string("New Folder")), items.end());  	hide_context_entries(menu, items, disabled_items); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0870b5b8dd..5a9d1524f3 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -921,6 +921,8 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)  {  	S32 z_min = S32_MAX;  	LLInventoryPanel* res = NULL; +	LLFloater* active_inv_floaterp = NULL; +  	// A. If the inventory side panel is open, use that preferably.  	if (is_inventorysp_active())  	{ @@ -941,6 +943,7 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)  		{  			res = inventorySP->getActivePanel();  			z_min = gFloaterView->getZOrder(inv_floater); +			active_inv_floaterp = inv_floater;  		}  		else  		{ @@ -960,10 +963,19 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open)  			{  				res = iv->getPanel();  				z_min = z_order; +				active_inv_floaterp = iv;  			}  		}  	} -	if (res) return res; + +	if (res) +	{ +		// Make sure the floater is not minimized (STORM-438). +		if (active_inv_floaterp && active_inv_floaterp->isMinimized()) +			active_inv_floaterp->setMinimized(FALSE); + +		return res; +	}  	// C. If no panels are open and we don't want to force open a panel, then just abort out.  	if (!auto_open) return NULL; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index cebfac86e7..de5439e4e0 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -527,7 +527,8 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)  	if( nearby_chat->getVisible()  		|| ( chat_msg.mSourceType == CHAT_SOURCE_AGENT -			&& gSavedSettings.getBOOL("UseChatBubbles") ) ) +			&& gSavedSettings.getBOOL("UseChatBubbles") ) +		|| !mChannel->getShowToasts() ) // to prevent toasts in Busy mode  		return;//no need in toast if chat is visible or if bubble chat is enabled  	// Handle irc styled messages for toast panel diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f084002385..1a8ec4991d 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -94,10 +94,12 @@ LLNetMap::LLNetMap (const Params & p)  	mToolTipMsg()  {  	mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); +	setScale(gSavedSettings.getF32("MiniMapScale"));  }  LLNetMap::~LLNetMap()  { +	gSavedSettings.setF32("MiniMapScale", mScale);  }  void LLNetMap::setScale( F32 scale ) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 17433a557b..c83176d980 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -506,9 +506,6 @@ void LLPanelMainInventory::onFilterSelected()  		return;  	} -	BOOL recent_active = ("Recent Items" == mActivePanel->getName()); -	getChildView("add_btn_panel")->setVisible( !recent_active); -  	setFilterSubString(mFilterSubString);  	LLInventoryFilter* filter = mActivePanel->getFilter();  	LLFloaterInventoryFinder *finder = getFinder(); @@ -944,6 +941,11 @@ void LLPanelMainInventory::updateListCommands()  void LLPanelMainInventory::onAddButtonClick()  { +// Gray out the "New Folder" option when the Recent tab is active as new folders will not be displayed +// unless "Always show folders" is checked in the filter options. +	bool recent_active = ("Recent Items" == mActivePanel->getName()); +	mMenuAdd->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active); +  	setUploadCostIfNeeded();  	showActionMenu(mMenuAdd,"add_btn"); diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index d0ebf047e8..22ff362b5a 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -123,7 +123,9 @@ static bool have_script_upload_cap(LLUUID& object_id)  class LLLiveLSLFile : public LLLiveFile  {  public: -	LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent); +	typedef boost::function<bool (const std::string& filename)> change_callback_t; + +	LLLiveLSLFile(std::string file_path, change_callback_t change_cb);  	~LLLiveLSLFile();  	void ignoreNextUpdate() { mIgnoreNextUpdate = true; } @@ -131,15 +133,16 @@ public:  protected:  	/*virtual*/ bool loadFile(); -	LLLiveLSLEditor*	mParent; +	change_callback_t	mOnChangeCallback;  	bool				mIgnoreNextUpdate;  }; -LLLiveLSLFile::LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent) -:	mParent(parent) +LLLiveLSLFile::LLLiveLSLFile(std::string file_path, change_callback_t change_cb) +:	mOnChangeCallback(change_cb)  ,	mIgnoreNextUpdate(false)  ,	LLLiveFile(file_path, 1.0)  { +	llassert(mOnChangeCallback);  }  LLLiveLSLFile::~LLLiveLSLFile() @@ -155,14 +158,7 @@ bool LLLiveLSLFile::loadFile()  		return true;  	} -	if (!mParent->loadScriptText(filename())) -	{ -		return false; -	} - -	// Disable sync to avoid recursive load->save->load calls. -	mParent->saveIfNeeded(false); -	return true; +	return mOnChangeCallback(filename());  }  /// --------------------------------------------------------------------------- @@ -327,11 +323,11 @@ struct LLSECKeywordCompare  };  LLScriptEdCore::LLScriptEdCore( +	LLScriptEdContainer* container,  	const std::string& sample,  	const LLHandle<LLFloater>& floater_handle,  	void (*load_callback)(void*),  	void (*save_callback)(void*, BOOL), -	void (*edit_callback)(void*),  	void (*search_replace_callback) (void* userdata),  	void* userdata,  	S32 bottom_pad) @@ -341,19 +337,21 @@ LLScriptEdCore::LLScriptEdCore(  	mEditor( NULL ),  	mLoadCallback( load_callback ),  	mSaveCallback( save_callback ), -	mEditCallback( edit_callback ),  	mSearchReplaceCallback( search_replace_callback ),  	mUserdata( userdata ),  	mForceClose( FALSE ),  	mLastHelpToken(NULL),  	mLiveHelpHistorySize(0),  	mEnableSave(FALSE), +	mLiveFile(NULL), +	mContainer(container),  	mHasScriptData(FALSE)  {  	setFollowsAll();  	setBorderVisible(FALSE);  	setXMLFilename("panel_script_ed.xml"); +	llassert_always(mContainer != NULL);  }  LLScriptEdCore::~LLScriptEdCore() @@ -367,6 +365,8 @@ LLScriptEdCore::~LLScriptEdCore()  		script_search->closeFloater();  		delete script_search;  	} + +	delete mLiveFile;  }  BOOL LLScriptEdCore::postBuild() @@ -381,7 +381,7 @@ BOOL LLScriptEdCore::postBuild()  	childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this);  	childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE)); -	childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::onEditButtonClick, this)); +	childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::openInExternalEditor, this));  	initMenu(); @@ -514,6 +514,79 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid)  	}  } +bool LLScriptEdCore::loadScriptText(const std::string& filename) +{ +	if (filename.empty()) +	{ +		llwarns << "Empty file name" << llendl; +		return false; +	} + +	LLFILE* file = LLFile::fopen(filename, "rb");		/*Flawfinder: ignore*/ +	if (!file) +	{ +		llwarns << "Error opening " << filename << llendl; +		return false; +	} + +	// read in the whole file +	fseek(file, 0L, SEEK_END); +	size_t file_length = (size_t) ftell(file); +	fseek(file, 0L, SEEK_SET); +	char* buffer = new char[file_length+1]; +	size_t nread = fread(buffer, 1, file_length, file); +	if (nread < file_length) +	{ +		llwarns << "Short read" << llendl; +	} +	buffer[nread] = '\0'; +	fclose(file); + +	mEditor->setText(LLStringExplicit(buffer)); +	delete[] buffer; + +	return true; +} + +bool LLScriptEdCore::writeToFile(const std::string& filename) +{ +	LLFILE* fp = LLFile::fopen(filename, "wb"); +	if (!fp) +	{ +		llwarns << "Unable to write to " << filename << llendl; + +		LLSD row; +		row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; +		row["columns"][0]["font"] = "SANSSERIF_SMALL"; +		mErrorList->addElement(row); +		return false; +	} + +	std::string utf8text = mEditor->getText(); + +	// Special case for a completely empty script - stuff in one space so it can store properly.  See SL-46889 +	if (utf8text.size() == 0) +	{ +		utf8text = " "; +	} + +	fputs(utf8text.c_str(), fp); +	fclose(fp); +	return true; +} + +void LLScriptEdCore::sync() +{ +	// Sync with external editor. +	std::string tmp_file = mContainer->getTmpFileName(); +	llstat s; +	if (LLFile::stat(tmp_file, &s) == 0) // file exists +	{ +		if (mLiveFile) mLiveFile->ignoreNextUpdate(); +		writeToFile(tmp_file); +	} +} +  bool LLScriptEdCore::hasChanged()  {  	if (!mEditor) return false; @@ -690,6 +763,12 @@ BOOL LLScriptEdCore::canClose()  	}  } +void LLScriptEdCore::setEnableEditing(bool enable) +{ +	mEditor->setEnabled(enable); +	getChildView("Edit_btn")->setEnabled(enable); +} +  bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response )  {  	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -862,11 +941,31 @@ void LLScriptEdCore::doSave( BOOL close_after_save )  	}  } -void LLScriptEdCore::onEditButtonClick() +void LLScriptEdCore::openInExternalEditor()  { -	if (mEditCallback) +	delete mLiveFile; // deletes file + +	// Save the script to a temporary file. +	std::string filename = mContainer->getTmpFileName(); +	writeToFile(filename); + +	// Start watching file changes. +	mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); +	mLiveFile->addToEventTimer(); + +	// Open it in external editor.  	{ -		mEditCallback(mUserdata); +		LLExternalEditor ed; + +		if (!ed.setCommand("LL_SCRIPT_EDITOR")) +		{ +			std::string msg = "Select an editor by setting the environment variable LL_SCRIPT_EDITOR " +				"or the ExternalEditor setting"; // *TODO: localize +			LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); +			return; +		} + +		ed.run(filename);  	}  } @@ -983,6 +1082,43 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask)  }  /// --------------------------------------------------------------------------- +/// LLScriptEdContainer +/// --------------------------------------------------------------------------- + +LLScriptEdContainer::LLScriptEdContainer(const LLSD& key) +:	LLPreview(key) +,	mScriptEd(NULL) +{ +} + +std::string LLScriptEdContainer::getTmpFileName() +{ +	// Take script inventory item id (within the object inventory) +	// to consideration so that it's possible to edit multiple scripts +	// in the same object inventory simultaneously (STORM-781). +	std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); + +	// Use MD5 sum to make the file name shorter and not exceed maximum path length. +	char script_id_hash_str[33];               /* Flawfinder: ignore */ +	LLMD5 script_id_hash((const U8 *)script_id.c_str()); +	script_id_hash.hex_digest(script_id_hash_str); + +	return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; +} + +bool LLScriptEdContainer::onExternalChange(const std::string& filename) +{ +	if (!mScriptEd->loadScriptText(filename)) +	{ +		return false; +	} + +	// Disable sync to avoid recursive load->save->load calls. +	saveIfNeeded(false); +	return true; +} + +/// ---------------------------------------------------------------------------  /// LLPreviewLSL  /// --------------------------------------------------------------------------- @@ -1005,11 +1141,11 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata)  	LLPreviewLSL *self = (LLPreviewLSL*)userdata;  	self->mScriptEd =  new LLScriptEdCore( +								   self,  								   HELLO_LSL,  								   self->getHandle(),  								   LLPreviewLSL::onLoad,  								   LLPreviewLSL::onSave, -								   NULL, // no edit callback  								   LLPreviewLSL::onSearchReplace,  								   self,  								   0); @@ -1019,7 +1155,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata)  LLPreviewLSL::LLPreviewLSL(const LLSD& key ) -  : LLPreview( key ), +:	LLScriptEdContainer(key),  	mPendingUploads(0)  {  	mFactoryMap["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this); @@ -1110,7 +1246,6 @@ void LLPreviewLSL::loadAsset()  		{  			mScriptEd->setScriptText(mScriptEd->getString("can_not_view"), FALSE);  			mScriptEd->mEditor->makePristine(); -			mScriptEd->mEditor->setEnabled(FALSE);  			mScriptEd->mFunctions->setEnabled(FALSE);  			mAssetStatus = PREVIEW_ASSET_LOADED;  		} @@ -1120,6 +1255,7 @@ void LLPreviewLSL::loadAsset()  	else  	{  		mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE); +		mScriptEd->setEnableEditing(TRUE);  		mAssetStatus = PREVIEW_ASSET_LOADED;  	}  } @@ -1166,7 +1302,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save)  // Save needs to compile the text in the buffer. If the compile  // succeeds, then save both assets out to the database. If the compile  // fails, go ahead and save the text anyway. -void LLPreviewLSL::saveIfNeeded() +void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/)  {  	// llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl;  	if(!mScriptEd->hasChanged()) @@ -1185,23 +1321,13 @@ void LLPreviewLSL::saveIfNeeded()  	std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString());  	std::string filename = filepath + ".lsl"; -	LLFILE* fp = LLFile::fopen(filename, "wb"); -	if(!fp) -	{ -		llwarns << "Unable to write to " << filename << llendl; +	mScriptEd->writeToFile(filename); -		LLSD row; -		row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; -		row["columns"][0]["font"] = "SANSSERIF_SMALL"; -		mScriptEd->mErrorList->addElement(row); -		return; +	if (sync) +	{ +		mScriptEd->sync();  	} -	std::string utf8text = mScriptEd->mEditor->getText(); -	fputs(utf8text.c_str(), fp); -	fclose(fp); -	fp = NULL; -  	const LLInventoryItem *inv_item = getItem();  	// save it out to asset server  	std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); @@ -1433,7 +1559,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset  			{  				is_modifiable = TRUE;		  			} -			preview->mScriptEd->mEditor->setEnabled(is_modifiable); +			preview->mScriptEd->setEnableEditing(is_modifiable);  			preview->mAssetStatus = PREVIEW_ASSET_LOADED;  		}  		else @@ -1474,11 +1600,11 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)  	LLLiveLSLEditor *self = (LLLiveLSLEditor*)userdata;  	self->mScriptEd =  new LLScriptEdCore( +								   self,  								   HELLO_LSL,  								   self->getHandle(),  								   &LLLiveLSLEditor::onLoad,  								   &LLLiveLSLEditor::onSave, -								   &LLLiveLSLEditor::onEdit,  								   &LLLiveLSLEditor::onSearchReplace,  								   self,  								   0); @@ -1488,14 +1614,12 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata)  LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : -	LLPreview(key), -	mScriptEd(NULL), +	LLScriptEdContainer(key),  	mAskedForRunningInfo(FALSE),  	mHaveRunningInfo(FALSE),  	mCloseAfterSave(FALSE),  	mPendingUploads(0),  	mIsModifiable(FALSE), -	mLiveFile(NULL),  	mIsNew(false)  {  	mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); @@ -1519,11 +1643,6 @@ BOOL LLLiveLSLEditor::postBuild()  	return LLPreview::postBuild();  } -LLLiveLSLEditor::~LLLiveLSLEditor() -{ -	delete mLiveFile; -} -  // virtual  void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id,  												  const LLUUID& item_id, @@ -1580,7 +1699,6 @@ void LLLiveLSLEditor::loadAsset()  				mItem = new LLViewerInventoryItem(item);  				mScriptEd->setScriptText(getString("not_allowed"), FALSE);  				mScriptEd->mEditor->makePristine(); -				mScriptEd->mEditor->setEnabled(FALSE);  				mScriptEd->enableSave(FALSE);  				mAssetStatus = PREVIEW_ASSET_LOADED;  			} @@ -1618,10 +1736,6 @@ void LLLiveLSLEditor::loadAsset()  			mIsModifiable = item && gAgent.allowOperation(PERM_MODIFY,   										item->getPermissions(),  				   						GP_OBJECT_MANIPULATE); -			if(!mIsModifiable) -			{ -				mScriptEd->mEditor->setEnabled(FALSE); -			}  			// This is commented out, because we don't completely  			// handle script exports yet. @@ -1677,6 +1791,7 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,  		if( LL_ERR_NOERR == status )  		{  			instance->loadScriptText(vfs, asset_id, type); +			instance->mScriptEd->setEnableEditing(TRUE);  			instance->mAssetStatus = PREVIEW_ASSET_LOADED;  		}  		else @@ -1703,40 +1818,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id,  	delete xored_id;  } - bool LLLiveLSLEditor::loadScriptText(const std::string& filename) - { - 	if (filename.empty()) - 	{ - 		llwarns << "Empty file name" << llendl; - 		return false; - 	} - - 	LLFILE* file = LLFile::fopen(filename, "rb");		/*Flawfinder: ignore*/ - 	if (!file) - 	{ - 		llwarns << "Error opening " << filename << llendl; - 		return false; - 	} - - 	// read in the whole file -	fseek(file, 0L, SEEK_END); -	size_t file_length = (size_t) ftell(file); -	fseek(file, 0L, SEEK_SET); -	char* buffer = new char[file_length+1]; -	size_t nread = fread(buffer, 1, file_length, file); -	if (nread < file_length) -	{ -		llwarns << "Short read" << llendl; -	} -	buffer[nread] = '\0'; -	fclose(file); -	mScriptEd->mEditor->setText(LLStringExplicit(buffer)); -	//mScriptEd->mEditor->makePristine(); -	delete[] buffer; - -	return true; - } -  void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type)  {  	LLVFile file(vfs, uuid, type); @@ -1890,7 +1971,8 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id,  	mItem = new LLViewerInventoryItem(item);  } -void LLLiveLSLEditor::saveIfNeeded(bool sync) +// virtual +void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/)  {  	LLViewerObject* object = gObjectList.findObject(mObjectUUID);  	if(!object) @@ -1941,18 +2023,11 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync)  	mItem->setAssetUUID(asset_id);  	mItem->setTransactionID(tid); -	writeToFile(filename); +	mScriptEd->writeToFile(filename);  	if (sync)  	{ -		// Sync with external ed2itor. -		std::string tmp_file = getTmpFileName(); -		llstat s; -		if (LLFile::stat(tmp_file, &s) == 0) // file exists -		{ -			if (mLiveFile) mLiveFile->ignoreNextUpdate(); -			writeToFile(tmp_file); -		} +		mScriptEd->sync();  	}  	// save it out to asset server @@ -1970,83 +2045,6 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync)  	}  } -void LLLiveLSLEditor::openExternalEditor() -{ -	LLViewerObject* object = gObjectList.findObject(mObjectUUID); -	if(!object) -	{ -		LLNotificationsUtil::add("SaveScriptFailObjectNotFound"); -		return; -	} - -	delete mLiveFile; // deletes file - -	// Save the script to a temporary file. -	std::string filename = getTmpFileName(); -	writeToFile(filename); - -	// Start watching file changes. -	mLiveFile = new LLLiveLSLFile(filename, this); -	mLiveFile->addToEventTimer(); - -	// Open it in external editor. -	{ -		LLExternalEditor ed; - -		if (!ed.setCommand("LL_SCRIPT_EDITOR")) -		{ -			std::string msg = "Select an editor by setting the environment variable LL_SCRIPT_EDITOR " -				"or the ExternalEditor setting"; // *TODO: localize -			LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); -			return; -		} - -		ed.run(filename); -	} -} - -bool LLLiveLSLEditor::writeToFile(const std::string& filename) -{ -	LLFILE* fp = LLFile::fopen(filename, "wb"); -	if (!fp) -	{ -		llwarns << "Unable to write to " << filename << llendl; - -		LLSD row; -		row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; -		row["columns"][0]["font"] = "SANSSERIF_SMALL"; -		mScriptEd->mErrorList->addElement(row); -		return false; -	} - -	std::string utf8text = mScriptEd->mEditor->getText(); - -	// Special case for a completely empty script - stuff in one space so it can store properly.  See SL-46889 -	if (utf8text.size() == 0) -	{ -		utf8text = " "; -	} - -	fputs(utf8text.c_str(), fp); -	fclose(fp); -	return true; -} - -std::string LLLiveLSLEditor::getTmpFileName() -{ -	// Take script inventory item id (within the object inventory) -	// to consideration so that it's possible to edit multiple scripts -	// in the same object inventory simultaneously (STORM-781). -	std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); - -	// Use MD5 sum to make the file name shorter and not exceed maximum path length. -	char script_id_hash_str[33];               /* Flawfinder: ignore */ -	LLMD5 script_id_hash((const U8 *)script_id.c_str()); -	script_id_hash.hex_digest(script_id_hash_str); - -	return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; -} -  void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url,  										 const std::string& filename,  										 const LLUUID& task_id, @@ -2271,13 +2269,6 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save)  // static -void LLLiveLSLEditor::onEdit(void* userdata) -{ -	LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; -	self->openExternalEditor(); -} - -// static  void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**)  {  	LLUUID item_id; diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index d35c6b8528..f86be615c4 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -48,6 +48,7 @@ class LLFloaterScriptSearch;  class LLKeywordToken;  class LLVFS;  class LLViewerInventoryItem; +class LLScriptEdContainer;  // Inner, implementation class.  LLPreviewScript and LLLiveLSLEditor each own one of these.  class LLScriptEdCore : public LLPanel @@ -56,17 +57,20 @@ class LLScriptEdCore : public LLPanel  	friend class LLPreviewLSL;  	friend class LLLiveLSLEditor;  	friend class LLFloaterScriptSearch; +	friend class LLScriptEdContainer; -public: +protected: +	// Supposed to be invoked only by the container.  	LLScriptEdCore( +		LLScriptEdContainer* container,  		const std::string& sample,  		const LLHandle<LLFloater>& floater_handle,  		void (*load_callback)(void* userdata),  		void (*save_callback)(void* userdata, BOOL close_after_save), -		void (*edit_callback)(void*),  		void (*search_replace_callback)(void* userdata),  		void* userdata,  		S32 bottom_pad = 0);	// pad below bottom row of buttons +public:  	~LLScriptEdCore();  	void			initMenu(); @@ -74,15 +78,19 @@ public:  	virtual void	draw();  	/*virtual*/	BOOL	postBuild();  	BOOL			canClose(); +	void			setEnableEditing(bool enable);  	void            setScriptText(const std::string& text, BOOL is_valid); +	bool			loadScriptText(const std::string& filename); +	bool			writeToFile(const std::string& filename); +	void			sync();  	void			doSave( BOOL close_after_save );  	bool			handleSaveChangesDialog(const LLSD& notification, const LLSD& response);  	bool			handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); -	void			onEditButtonClick(); +	void			openInExternalEditor();  	static void		onCheckLock(LLUICtrl*, void*);  	static void		onHelpComboCommit(LLUICtrl* ctrl, void* userdata); @@ -118,7 +126,6 @@ private:  	LLTextEditor*	mEditor;  	void			(*mLoadCallback)(void* userdata);  	void			(*mSaveCallback)(void* userdata, BOOL close_after_save); -	void			(*mEditCallback)(void* userdata);  	void			(*mSearchReplaceCallback) (void* userdata);  	void*			mUserdata;  	LLComboBox		*mFunctions; @@ -132,11 +139,28 @@ private:  	S32				mLiveHelpHistorySize;  	BOOL			mEnableSave;  	BOOL			mHasScriptData; +	LLLiveLSLFile*	mLiveFile; + +	LLScriptEdContainer* mContainer; // parent view  }; +class LLScriptEdContainer : public LLPreview +{ +	friend class LLScriptEdCore; + +public: +	LLScriptEdContainer(const LLSD& key); + +protected: +	std::string		getTmpFileName(); +	bool			onExternalChange(const std::string& filename); +	virtual void	saveIfNeeded(bool sync = true) = 0; + +	LLScriptEdCore*		mScriptEd; +};  // Used to view and edit a LSL from your inventory. -class LLPreviewLSL : public LLPreview +class LLPreviewLSL : public LLScriptEdContainer  {  public:  	LLPreviewLSL(const LLSD& key ); @@ -150,7 +174,7 @@ protected:  	void closeIfNeeded();  	virtual void loadAsset(); -	void saveIfNeeded(); +	/*virtual*/ void saveIfNeeded(bool sync = true);  	void uploadAssetViaCaps(const std::string& url,  							const std::string& filename,   							const LLUUID& item_id); @@ -174,7 +198,6 @@ protected:  protected: -	LLScriptEdCore* mScriptEd;  	// Can safely close only after both text and bytecode are uploaded  	S32 mPendingUploads; @@ -182,12 +205,11 @@ protected:  // Used to view and edit an LSL that is attached to an object. -class LLLiveLSLEditor : public LLPreview +class LLLiveLSLEditor : public LLScriptEdContainer  {  	friend class LLLiveLSLFile;  public:   	LLLiveLSLEditor(const LLSD& key); -	~LLLiveLSLEditor();  	static void processScriptRunningReply(LLMessageSystem* msg, void**); @@ -208,10 +230,7 @@ private:  	virtual void loadAsset();  	void loadAsset(BOOL is_new); -	void saveIfNeeded(bool sync = true); -	void openExternalEditor(); -	std::string getTmpFileName(); -	bool writeToFile(const std::string& filename); +	/*virtual*/ void saveIfNeeded(bool sync = true);  	void uploadAssetViaCaps(const std::string& url,  							const std::string& filename,   							const LLUUID& task_id, @@ -227,7 +246,6 @@ private:  	static void onSearchReplace(void* userdata);  	static void onLoad(void* userdata);  	static void onSave(void* userdata, BOOL close_after_save); -	static void onEdit(void* userdata);  	static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid,  							   LLAssetType::EType type, @@ -237,7 +255,6 @@ private:  	static void onRunningCheckboxClicked(LLUICtrl*, void* userdata);  	static void onReset(void* userdata); - 	bool loadScriptText(const std::string& filename);  	void loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type);  	static void onErrorList(LLUICtrl*, void* user_data); @@ -248,7 +265,6 @@ private:  private:  	bool				mIsNew; -	LLScriptEdCore*		mScriptEd;  	//LLUUID mTransmitID;  	LLCheckBoxCtrl*		mRunningCheckbox;  	BOOL				mAskedForRunningInfo; @@ -263,7 +279,6 @@ private:  	LLCheckBoxCtrl*	mMonoCheckbox;  	BOOL mIsModifiable; -	LLLiveLSLFile*		mLiveFile;  };  #endif  // LL_LLPREVIEWSCRIPT_H diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 80c78a50c9..e3bc67a414 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -83,11 +83,10 @@ bool  LLScreenChannelBase::isHovering()  	return mHoveredToast->isHovered();  } -bool LLScreenChannelBase::resetPositionAndSize(const LLSD& newvalue) +void LLScreenChannelBase::resetPositionAndSize()  {  	LLRect rc = gViewerWindow->getWorldViewRectScaled();  	updatePositionAndSize(rc, rc); -	return true;  }  void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect) @@ -99,10 +98,7 @@ void LLScreenChannelBase::updatePositionAndSize(LLRect old_world_rect, LLRect ne  	if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE  		&& LLSideTray::instanceCreated	())  	{ -		LLSideTray*	side_bar = LLSideTray::getInstance(); - -		if (side_bar->getVisible() && !side_bar->getCollapsed()) -			world_rect_padding += side_bar->getRect().getWidth(); +		world_rect_padding += LLSideTray::getInstance()->getVisibleWidth();  	} @@ -133,7 +129,7 @@ void LLScreenChannelBase::init(S32 channel_left, S32 channel_right)  	if(LLSideTray::instanceCreated())  	{  		LLSideTray*	side_bar = LLSideTray::getInstance(); -		side_bar->getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this, _2)); +		side_bar->setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, this));  	}  	// top and bottom set by updateBottom() @@ -214,10 +210,7 @@ void LLScreenChannel::updatePositionAndSize(LLRect old_world_rect, LLRect new_wo  	if (gSavedSettings.getBOOL("SidebarCameraMovement") == FALSE   		&& LLSideTray::instanceCreated	())  	{ -		LLSideTray*	side_bar = LLSideTray::getInstance(); - -		if (side_bar->getVisible() && !side_bar->getCollapsed()) -			world_rect_padding += side_bar->getRect().getWidth(); +		world_rect_padding += LLSideTray::getInstance()->getVisibleWidth();  	} diff --git a/indra/newview/llscreenchannel.h b/indra/newview/llscreenchannel.h index c536a21779..d207d13981 100644 --- a/indra/newview/llscreenchannel.h +++ b/indra/newview/llscreenchannel.h @@ -59,8 +59,8 @@ public:  	// Channel's outfit-functions  	// update channel's size and position in the World View  	virtual void		updatePositionAndSize(LLRect old_world_rect, LLRect new_world_rect); +	void				resetPositionAndSize(); -	bool resetPositionAndSize(const LLSD& newvalue);  	// initialization of channel's shape and position  	virtual void		init(S32 channel_left, S32 channel_right); diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 3bc3959e0b..aef665a35c 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -561,7 +561,7 @@ BOOL LLSideTray::postBuild()  	{  		if ((*it).channel)  		{ -			getCollapseSignal().connect(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel, _2)); +			setVisibleWidthChangeCallback(boost::bind(&LLScreenChannelBase::resetPositionAndSize, (*it).channel));  		}  	} @@ -980,9 +980,6 @@ void LLSideTray::reflectCollapseChange()  	}  	gFloaterView->refresh(); -	 -	LLSD new_value = mCollapsed; -	mCollapseSignal(this,new_value);  }  void LLSideTray::arrange() @@ -1262,9 +1259,29 @@ bool		LLSideTray::isPanelActive(const std::string& panel_name)  void	LLSideTray::updateSidetrayVisibility()  {  	// set visibility of parent container based on collapsed state -	if (getParent()) +	LLView* parent = getParent(); +	if (parent)  	{ -		getParent()->setVisible(!mCollapsed && !gAgentCamera.cameraMouselook()); +		bool old_visibility = parent->getVisible(); +		bool new_visibility = !mCollapsed && !gAgentCamera.cameraMouselook(); + +		if (old_visibility != new_visibility) +		{ +			parent->setVisible(new_visibility); + +			// Signal change of visible width. +			llinfos << "Visible: " << new_visibility << llendl; +			mVisibleWidthChangeSignal(this, new_visibility); +		}  	}  } +S32 LLSideTray::getVisibleWidth() +{ +	return (isInVisibleChain() && !mCollapsed) ? getRect().getWidth() : 0; +} + +void LLSideTray::setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb) +{ +	mVisibleWidthChangeSignal.connect(cb); +} diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 3c572dde95..184d78845f 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -165,9 +165,18 @@ public:  	void		reshape			(S32 width, S32 height, BOOL called_from_parent = TRUE); -	void		updateSidetrayVisibility(); +	/** +	 * @return side tray width if it's visible and expanded, 0 otherwise. +	 * +	 * Not that width of the tab buttons is not included. +	 * +	 * @see setVisibleWidthChangeCallback() +	 */ +	S32			getVisibleWidth(); + +	void		setVisibleWidthChangeCallback(const commit_signal_t::slot_type& cb); -	commit_signal_t& getCollapseSignal() { return mCollapseSignal; } +	void		updateSidetrayVisibility();  	void		handleLoginComplete(); @@ -216,7 +225,7 @@ private:  	tab_order_vector_t				mOriginalTabOrder;  	LLSideTrayTab*					mActiveTab;	 -	commit_signal_t					mCollapseSignal; +	commit_signal_t					mVisibleWidthChangeSignal;  	LLButton*						mCollapseButton;  	bool							mCollapsed; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d945af0776..611f9de2e6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3095,7 +3095,16 @@ bool process_login_success_response()  	std::string map_server_url = response["map-server-url"];  	if(!map_server_url.empty())  	{ -		gSavedSettings.setString("MapServerURL", map_server_url);  +		// We got an answer from the grid -> use that for map for the current session +		gSavedSettings.setString("CurrentMapServerURL", map_server_url);  +		LL_INFOS("LLStartup") << "map-server-url : we got an answer from the grid : " << map_server_url << LL_ENDL; +	} +	else +	{ +		// No answer from the grid -> use the default setting for current session  +		map_server_url = gSavedSettings.getString("MapServerURL");  +		gSavedSettings.setString("CurrentMapServerURL", map_server_url);  +		LL_INFOS("LLStartup") << "map-server-url : no map-server-url answer, we use the default setting for the map : " << map_server_url << LL_ENDL;  	}  	// Default male and female avatars allowing the user to choose their avatar on first login. diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 7313463f1b..7dc5d96689 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -171,6 +171,31 @@ const BOOL SCRIPT_QUESTION_IS_CAUTION[SCRIPT_PERMISSION_EOF] =  	FALSE	// ControlYourCamera  }; +// Extract channel and version from a string like "SL Web Viewer Beta 10.11.29.215604". +// (channel: "SL Web Viewer Beta", version: "10.11.29.215604") +static bool parse_version_info(const std::string& version_info, std::string& channel, std::string& ver) +{ +	size_t last_space = version_info.rfind(" "); +	channel = version_info; + +	if (last_space != std::string::npos) +	{ +		try +		{ +			ver = version_info.substr(last_space + 1); +			channel.replace(last_space, ver.length() + 1, ""); // strip version +		} +		catch (std::out_of_range) +		{ +			return false; +		} + +		return true; +	} + +	return false; +} +  bool friendship_offer_callback(const LLSD& notification, const LLSD& response)  {  	S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -3825,28 +3850,22 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)  	if (!gLastVersionChannel.empty())  	{ -		// work out the URL for this server's Release Notes -		std::string url ="http://wiki.secondlife.com/wiki/Release_Notes/"; -		std::string server_version = version_channel; -		std::vector<std::string> s_vect; -		boost::algorithm::split(s_vect, server_version, isspace); -		for(U32 i = 0; i < s_vect.size(); i++) +		std::string url = regionp->getCapability("ServerReleaseNotes"); +		if (url.empty())  		{ -			if (i != (s_vect.size() - 1)) -			{ -				if(i != (s_vect.size() - 2)) -				{ -				   url += s_vect[i] + "_"; -				} -				else -				{ -					url += s_vect[i] + "/"; -				} -			} -			else +			// The capability hasn't arrived yet or is not supported, +			// fall back to parsing server version channel. +			std::string channel, ver; +			if (!parse_version_info(version_channel, channel, ver))  			{ -				url += s_vect[i].substr(0,4); +				llwarns << "Failed to parse server version channel (" << version_channel << ")" << llendl;  			} + +			url = gSavedSettings.getString("ReleaseNotesURL"); +			LLSD args; +			args["CHANNEL"] = LLWeb::escapeURL(channel); +			args["VERSION"] = LLWeb::escapeURL(ver); +			LLStringUtil::format(url, args);  		}  		LLSD args; diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index b8fd944321..5eeb02b080 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -186,11 +186,6 @@ public:  	/*virtual*/ std::string translateString(const char* tag,  					const std::map<std::string, std::string>& args); -	// signal on bottom tray width changed -	typedef boost::function<void (void)> bottom_tray_callback_t; -	typedef boost::signals2::signal<void (void)> bottom_tray_signal_t; -	bottom_tray_signal_t mOnBottomTrayWidthChanged; -	boost::signals2::connection setOnBottomTrayWidthChanged(bottom_tray_callback_t cb) { return mOnBottomTrayWidthChanged.connect(cb); }  	// signal on update of WorldView rect  	typedef boost::function<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_callback_t;  	typedef boost::signals2::signal<void (LLRect old_world_rect, LLRect new_world_rect)> world_rect_signal_t; diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index be8298daab..74ed844376 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -181,8 +181,7 @@ LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32  LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level)  {  	// Get the grid coordinates -	std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); - +	std::string imageurl = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y);  	// DO NOT COMMIT!! DEBUG ONLY!!!  	// Use a local jpeg for every tile to test map speed without S3 access diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index eb2e7ea788..8d14c974b4 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -76,13 +76,24 @@ L$30,000    </text>    <!-- Overlapping buttons for all default actions.  Show "Buy" if    for sale, "Sit" if can sit, etc. --> +  <icon +   name="secure_browsing" +   image_name="Lock" +   left="0" +   visible="false" +   width="18" +   height="18" +   top="103" +   tool_tip="Secure Browsing" +   follows="left|top" />     <text     follows="all"     font="SansSerifSmall"     height="13"     name="object_media_url" -   width="220" -   top_pad="0" +   width="207" +   left_pad="2" +   top_delta="0"     max_length = "50"     use_ellipses="true">     http://www.superdupertest.com @@ -135,16 +146,6 @@ L$30,000     name="open_btn"     top_delta="0"     width="80" /> -  <icon -   name="secure_browsing" -   image_name="Lock" -   left_delta="80" -   visible="false" -   width="18" -   height="18" -   top_delta="0" -   tool_tip="Secure Browsing" -   follows="left|top" />   <!--  non-overlapping buttons here -->       <button @@ -153,7 +154,7 @@ L$30,000       label="More"       layout="topleft"       name="more_info_btn" -     left_delta="10" +     left_pad="10"       top_delta="0"       tab_stop="false"       width="80" /> diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index 8fe89d3934..ea263d05ce 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -8,7 +8,7 @@   top="724"   visible="false"   width="128"> -    <menu_item_call +	<menu_item_call       label="Zoom Close"       name="Zoom Close">          <menu_item_call.on_click @@ -29,7 +29,14 @@           function="Minimap.Zoom"           parameter="far" />      </menu_item_call> -    <menu_item_separator /> +	<menu_item_call +     label="Zoom Default" +     name="Zoom Default"> +		<menu_item_call.on_click +         function="Minimap.Zoom" +         parameter="default" /> +	</menu_item_call> +	<menu_item_separator />      <menu_item_check         label="Rotate Map"         name="Rotate Map"> diff --git a/indra/newview/skins/default/xui/en/panel_group_invite.xml b/indra/newview/skins/default/xui/en/panel_group_invite.xml index 15a3191bdf..cd834b61ce 100644 --- a/indra/newview/skins/default/xui/en/panel_group_invite.xml +++ b/indra/newview/skins/default/xui/en/panel_group_invite.xml @@ -94,7 +94,7 @@       left_pad="2"       name="cancel_button"       top_delta="0" -     width="70" /> +     width="65" />  	 <string   	 name="GroupInvitation">  	 Group Invitation 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 1270a21710..61d6cbb2d0 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 @@ -117,7 +117,7 @@       name="map_button"       top_delta="-4"       left_pad="0" -     width="60" +     width="57"       enabled="false" />      <text       type="string" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index da366f30ae..f0ce8b849a 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -296,6 +296,7 @@  	<check_box  		name="media_auto_play_btn"  		control_name="ParcelMediaAutoPlayEnable" +		enabled_control="AudioStreamingMedia"  		value="true"  		follows="left|bottom|right"  		height="15" 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 a041c9b229..627b12cfe1 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -180,6 +180,7 @@       name="Save_btn"       width="81" />      <button +     enabled="false"       follows="right|bottom"       height="23"       label="Edit..." diff --git a/indra/newview/tests/llworldmap_test.cpp b/indra/newview/tests/llworldmap_test.cpp index b976ac5ea9..acc6e814bc 100644 --- a/indra/newview/tests/llworldmap_test.cpp +++ b/indra/newview/tests/llworldmap_test.cpp @@ -25,13 +25,16 @@   * $/LicenseInfo$   */ -// Precompiled header: almost always required for newview cpp files -#include "../llviewerprecompiledheaders.h" -// Class to test -#include "../llworldmap.h"  // Dependencies -#include "../llviewerimagelist.h" +#include "linden_common.h" +#include "llapr.h" +#include "llsingleton.h" +#include "lltrans.h" +#include "lluistring.h" +#include "../llviewertexture.h"  #include "../llworldmapmessage.h" +// Class to test +#include "../llworldmap.h"  // Tut header  #include "../test/lltut.h" @@ -44,34 +47,29 @@  // * A simulator for a class can be implemented here. Please comment and document thoroughly.  // Stub image calls -LLViewerImageList::LLViewerImageList() { } -LLViewerImageList::~LLViewerImageList() { } -LLViewerImageList gImageList; -LLViewerImage* LLViewerImageList::getImage(const LLUUID &image_id, -												   BOOL usemipmaps, -												   BOOL level_immediate, -												   LLGLint internal_format, -												   LLGLenum primary_format, -												   LLHost request_from_host) -{ return NULL; } -void LLViewerImage::setBoostLevel(S32 level) { } -void LLImageGL::setAddressMode(LLTexUnit::eTextureAddressMode mode) { } +void LLViewerTexture::setBoostLevel(S32 ) { } +void LLViewerTexture::setAddressMode(LLTexUnit::eTextureAddressMode ) { } +LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTexture(const LLUUID&, BOOL, LLViewerTexture::EBoostLevel, S8, +																  LLGLint, LLGLenum, LLHost ) { return NULL; }  // Stub related map calls  LLWorldMapMessage::LLWorldMapMessage() { }  LLWorldMapMessage::~LLWorldMapMessage() { }  void LLWorldMapMessage::sendItemRequest(U32 type, U64 handle) { }  void LLWorldMapMessage::sendMapBlockRequest(U16 min_x, U16 min_y, U16 max_x, U16 max_y, bool return_nonexistent) { } +  LLWorldMipmap::LLWorldMipmap() { }  LLWorldMipmap::~LLWorldMipmap() { }  void LLWorldMipmap::reset() { }  void LLWorldMipmap::dropBoostLevels() { }  void LLWorldMipmap::equalizeBoostLevels() { } -LLPointer<LLViewerImage> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) -{ return NULL; } +LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return NULL; }  // Stub other stuff -BOOL gPacificDaylightTime; +std::string LLTrans::getString(const std::string &, const LLStringUtil::format_map_t& ) { return std::string("test_trans"); } +void LLUIString::updateResult() const { } +void LLUIString::setArg(const std::string& , const std::string& ) { } +void LLUIString::assign(const std::string& ) { }  // End Stubbing  // ------------------------------------------------------------------------------------------- @@ -237,7 +235,7 @@ namespace tut  		// Test 9 : setLandForSaleImage() / getLandForSaleImage()  		LLUUID id;  		mSim->setLandForSaleImage(id); -		LLPointer<LLViewerImage> image = mSim->getLandForSaleImage(); +		LLPointer<LLViewerFetchedTexture> image = mSim->getLandForSaleImage();  		ensure("LLSimInfo::getLandForSaleImage() test failed", image.isNull());  		// Test 10 : isPG()  		mSim->setAccess(SIM_ACCESS_PG); @@ -370,7 +368,7 @@ namespace tut   		}  		// Test 7 : getObjectsTile()  		try { -			LLPointer<LLViewerImage> image = mWorld->getObjectsTile((U32)(X_WORLD_TEST/REGION_WIDTH_METERS), (U32)(Y_WORLD_TEST/REGION_WIDTH_METERS), 1); +			LLPointer<LLViewerFetchedTexture> image = mWorld->getObjectsTile((U32)(X_WORLD_TEST/REGION_WIDTH_METERS), (U32)(Y_WORLD_TEST/REGION_WIDTH_METERS), 1);  			ensure("LLWorldMap::getObjectsTile() failed", image.isNull());  		} catch (...) {  			fail("LLWorldMap::getObjectsTile() test failed with exception"); diff --git a/indra/newview/tests/llworldmipmap_test.cpp b/indra/newview/tests/llworldmipmap_test.cpp index 54887ae219..4c0959d1a9 100644 --- a/indra/newview/tests/llworldmipmap_test.cpp +++ b/indra/newview/tests/llworldmipmap_test.cpp @@ -25,12 +25,12 @@   * $/LicenseInfo$   */ -// Precompiled header: almost always required for newview cpp files -#include "../llviewerprecompiledheaders.h" +// Dependencies +#include "linden_common.h" +#include "../llviewertexture.h" +#include "../llviewercontrol.h"  // Class to test  #include "../llworldmipmap.h" -// Dependencies -#include "../llviewerimagelist.h"  // Tut header  #include "../test/lltut.h" @@ -42,19 +42,14 @@  // * Do not make any assumption as to how those classes or methods work (i.e. don't copy/paste code)  // * A simulator for a class can be implemented here. Please comment and document thoroughly. -LLViewerImageList::LLViewerImageList() { } -LLViewerImageList::~LLViewerImageList() { } - -LLViewerImageList gImageList; +void LLViewerTexture::setBoostLevel(S32 ) { } +LLViewerFetchedTexture* LLViewerTextureManager::getFetchedTextureFromUrl(const std::string&, BOOL, LLViewerTexture::EBoostLevel, S8,  +																		 LLGLint, LLGLenum, const LLUUID& ) { return NULL; } -LLViewerImage* LLViewerImageList::getImageFromUrl(const std::string& url, -												   BOOL usemipmaps, -												   BOOL level_immediate, -												   LLGLint internal_format, -												   LLGLenum primary_format,  -												   const LLUUID& force_id) -{ return NULL; } -void LLViewerImage::setBoostLevel(S32 level) { } +LLControlGroup::LLControlGroup(const std::string& name) : LLInstanceTracker<LLControlGroup, std::string>(name) { } +LLControlGroup::~LLControlGroup() { } +std::string LLControlGroup::getString(const std::string& ) { return std::string("test_url"); } +LLControlGroup gSavedSettings("test_settings");  // End Stubbing  // ------------------------------------------------------------------------------------------- | 
