summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-05-22 09:04:42 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-05-22 09:04:42 +0100
commiteeba10255bf41dfe50b975ded16a9fe9c30e4025 (patch)
tree3f56f1e991aa007bd6a4f1d9784416fcbfb29fd7 /indra
parentc73bb0ae17538c0cb509bf6f0945a29c0ffd69dc (diff)
parent28d4fe68f8a44924df294473471b47ccb11a2eb1 (diff)
merge from viewer-public
Diffstat (limited to 'indra')
-rw-r--r--indra/llmessage/llcurl.cpp7
-rw-r--r--indra/media_plugins/webkit/media_plugin_webkit.cpp8
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/app_settings/low_graphics.xml2
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/featuretable.txt1
-rw-r--r--indra/newview/featuretable_linux.txt1
-rw-r--r--indra/newview/featuretable_mac.txt1
-rw-r--r--indra/newview/featuretable_solaris.txt1
-rw-r--r--indra/newview/llassetuploadresponders.cpp4
-rw-r--r--indra/newview/llbuycurrencyhtml.cpp165
-rw-r--r--indra/newview/llbuycurrencyhtml.h57
-rw-r--r--indra/newview/lldrawpooltree.cpp15
-rw-r--r--indra/newview/llfloaterbuycurrencyhtml.cpp119
-rw-r--r--indra/newview/llfloaterbuycurrencyhtml.h65
-rw-r--r--indra/newview/llfloaterhud.cpp3
-rw-r--r--indra/newview/llmediactrl.cpp106
-rw-r--r--indra/newview/llmediactrl.h9
-rw-r--r--indra/newview/llpanellogin.cpp16
-rw-r--r--indra/newview/llpanelobjectinventory.cpp4
-rw-r--r--indra/newview/llpanelplaceprofile.cpp4
-rw-r--r--indra/newview/llstatusbar.cpp5
-rw-r--r--indra/newview/lltexturefetch.cpp20
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewermedia.cpp61
-rw-r--r--indra/newview/llviewermedia.h2
-rw-r--r--indra/newview/llviewermenu.cpp9
-rw-r--r--indra/newview/llviewermenufile.cpp4
-rw-r--r--indra/newview/llviewermessage.cpp5
-rw-r--r--indra/newview/llvotree.cpp38
-rw-r--r--indra/newview/llvotree.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_buy_currency_html.xml27
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml40
33 files changed, 634 insertions, 183 deletions
diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp
index 91e11b8c0d..36874a5d48 100644
--- a/indra/llmessage/llcurl.cpp
+++ b/indra/llmessage/llcurl.cpp
@@ -365,6 +365,13 @@ U32 LLCurl::Easy::report(CURLcode code)
responseReason = strerror(code) + " : " + mErrorBuffer;
}
+ if(responseCode >= 300 && responseCode < 400) //redirect
+ {
+ char new_url[512] ;
+ curl_easy_getinfo(mCurlEasyHandle, CURLINFO_REDIRECT_URL, new_url);
+ responseReason = new_url ; //get the new URL.
+ }
+
if (mResponder)
{
mResponder->completedRaw(responseCode, responseReason, mChannels, mOutput);
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp
index 47766a24cb..0cd6e48d14 100644
--- a/indra/media_plugins/webkit/media_plugin_webkit.cpp
+++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp
@@ -297,11 +297,17 @@ private:
// append details to agent string
LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent );
+ // TODO: Remove this ifdef when the Linux version of llqtwebkit gets updated with the new WOB constant.
+#if !LL_LINUX
+ // Set up window open behavior
+ LLQtWebKit::getInstance()->setWindowOpenBehavior(mBrowserWindowId, LLQtWebKit::WOB_SIMULATE_BLANK_HREF_CLICK);
+#endif
+
#if !LL_QTWEBKIT_USES_PIXMAPS
// don't flip bitmap
LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );
#endif // !LL_QTWEBKIT_USES_PIXMAPS
-
+
// set background color
// convert background color channels from [0.0, 1.0] to [0, 255];
LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, int(mBackgroundR * 255.0f), int(mBackgroundG * 255.0f), int(mBackgroundB * 255.0f) );
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index d77d53f6af..28a5555ca2 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -91,6 +91,7 @@ set(viewer_SOURCE_FILES
llbottomtray.cpp
llbox.cpp
llbreadcrumbview.cpp
+ llbuycurrencyhtml.cpp
llcallbacklist.cpp
llcallfloater.cpp
llcallingcard.cpp
@@ -159,6 +160,7 @@ set(viewer_SOURCE_FILES
llfloaterbuy.cpp
llfloaterbuycontents.cpp
llfloaterbuycurrency.cpp
+ llfloaterbuycurrencyhtml.cpp
llfloaterbuyland.cpp
llfloatercamera.cpp
llfloatercolorpicker.cpp
@@ -604,6 +606,7 @@ set(viewer_HEADER_FILES
llbottomtray.h
llbox.h
llbreadcrumbview.h
+ llbuycurrencyhtml.h
llcallbacklist.h
llcallfloater.h
llcallingcard.h
@@ -674,6 +677,7 @@ set(viewer_HEADER_FILES
llfloaterbuy.h
llfloaterbuycontents.h
llfloaterbuycurrency.h
+ llfloaterbuycurrencyhtml.h
llfloaterbuyland.h
llfloatercamera.h
llfloatercolorpicker.h
diff --git a/indra/newview/app_settings/low_graphics.xml b/indra/newview/app_settings/low_graphics.xml
index a300c8646c..a5bbdfc1d0 100644
--- a/indra/newview/app_settings/low_graphics.xml
+++ b/indra/newview/app_settings/low_graphics.xml
@@ -4,6 +4,8 @@
<RenderAvatarCloth value="FALSE"/>
<!--Default for now-->
<RenderAvatarLODFactor value="0.5"/>
+ <!--Default for now-->
+ <RenderAvatarMaxVisible value="3"/>
<!--NO SHADERS-->
<RenderAvatarVP value="FALSE"/>
<!--Short Range-->
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 6195cdbc6f..5fb146db1c 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -6028,6 +6028,17 @@
<key>Value</key>
<integer>0</integer>
</map>
+ <key>QuickBuyCurrency</key>
+ <map>
+ <key>Comment</key>
+ <string>Toggle between HTML based currency purchase floater and legacy XUI version</string>
+ <key>Persist</key>
+ <integer>1</integer>
+ <key>Type</key>
+ <string>Boolean</string>
+ <key>Value</key>
+ <integer>0</integer>
+ </map>
<key>RegionTextureSize</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index d2c13a43be..21b8a9e39f 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -66,6 +66,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt
index 254b9c4ce4..12225536cd 100644
--- a/indra/newview/featuretable_linux.txt
+++ b/indra/newview/featuretable_linux.txt
@@ -65,6 +65,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index db0252d2e7..84e4ab6b65 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -65,6 +65,7 @@ list Low
RenderAnisotropic 1 0
RenderAvatarCloth 1 0
RenderAvatarLODFactor 1 0.5
+RenderAvatarMaxVisible 1 3
RenderAvatarVP 1 0
RenderFarClip 1 64
RenderFlexTimeFactor 1 0.5
diff --git a/indra/newview/featuretable_solaris.txt b/indra/newview/featuretable_solaris.txt
index f24cbde5e2..6edd280686 100644
--- a/indra/newview/featuretable_solaris.txt
+++ b/indra/newview/featuretable_solaris.txt
@@ -117,6 +117,7 @@ UseOcclusion 0 0
list low
RenderVBO 1 0
RenderAniso 1 0
+RenderAvatarMaxVisible 1 3
RenderLighting 1 0
list medium
diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp
index 2f90d652e4..27dcb9f1c7 100644
--- a/indra/newview/llassetuploadresponders.cpp
+++ b/indra/newview/llassetuploadresponders.cpp
@@ -37,7 +37,7 @@
// viewer includes
#include "llagent.h"
#include "llcompilequeue.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfilepicker.h"
#include "llinventorydefines.h"
#include "llinventoryobserver.h"
@@ -186,7 +186,7 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content)
S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload();
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", price);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), price);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("uploading_costs", args), price );
}
else
{
diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp
new file mode 100644
index 0000000000..163829a1ea
--- /dev/null
+++ b/indra/newview/llbuycurrencyhtml.cpp
@@ -0,0 +1,165 @@
+/**
+ * @file llbuycurrencyhtml.cpp
+ * @brief Manages Buy Currency HTML floater
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2006-2010, 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 "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
+#include "llfloaterbuycurrencyhtml.h"
+
+#include "llfloaterreg.h"
+#include "llcommandhandler.h"
+#include "llviewercontrol.h"
+
+// support for secondlife:///app/buycurrencyhtml/{ACTION}/{NEXT_ACTION}/{RETURN_CODE} SLapps
+class LLBuyCurrencyHTMLHandler :
+ public LLCommandHandler
+{
+public:
+ // requests will be throttled from a non-trusted browser
+ LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_ALLOW ) {}
+
+ bool handle(const LLSD& params, const LLSD& query_map, LLMediaCtrl* web)
+ {
+ std::string action( "" );
+ if ( params.size() >= 1 )
+ {
+ action = params[ 0 ].asString();
+ };
+
+ std::string next_action( "" );
+ if ( params.size() >= 2 )
+ {
+ next_action = params[ 1 ].asString();
+ };
+
+ int result_code = 0;
+ if ( params.size() >= 3 )
+ {
+ result_code = params[ 2 ].asInteger();
+ };
+
+ // open the legacy XUI based currency floater
+ if ( "open_legacy" == next_action )
+ {
+ LLFloaterBuyCurrency::buyCurrency();
+ };
+
+ // ask the Buy Currency floater to close
+ // note: this is the last thing we can do so make
+ // sure any other actions are processed before this.
+ if ( "close" == action )
+ {
+ LLBuyCurrencyHTML::closeDialog();
+ };
+
+ return true;
+ };
+};
+LLBuyCurrencyHTMLHandler gBuyCurrencyHTMLHandler;
+
+////////////////////////////////////////////////////////////////////////////////
+// static
+// Opens the legacy XUI based floater or new HTML based one based on
+// the QuickBuyCurrency value in settings.xml - this overload is for
+// the case where the amount is not requested.
+void LLBuyCurrencyHTML::openCurrencyFloater()
+{
+ if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) )
+ {
+ // HTML version
+ LLBuyCurrencyHTML::showDialog( false, "", 0 );
+ }
+ else
+ {
+ // legacy version
+ LLFloaterBuyCurrency::buyCurrency();
+ };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// static
+// Opens the legacy XUI based floater or new HTML based one based on
+// the QuickBuyCurrency value in settings.xml - this overload is for
+// the case where the amount and a string to display are requested.
+void LLBuyCurrencyHTML::openCurrencyFloater( const std::string& message, S32 sum )
+{
+ if ( gSavedSettings.getBOOL( "QuickBuyCurrency" ) )
+ {
+ // HTML version
+ LLBuyCurrencyHTML::showDialog( true, message, sum );
+ }
+ else
+ {
+ // legacy version
+ LLFloaterBuyCurrency::buyCurrency( message, sum );
+ };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+// static
+void LLBuyCurrencyHTML::showDialog( bool specific_sum_requested, const std::string& message, S32 sum )
+{
+ LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >( LLFloaterReg::getInstance( "buy_currency_html" ) );
+ if ( buy_currency_floater )
+ {
+ // pass on flag indicating if we want to buy specific amount and if so, how much
+ buy_currency_floater->setParams( specific_sum_requested, message, sum );
+
+ // force navigate to new URL
+ buy_currency_floater->navigateToFinalURL();
+
+ // make it visible and raise to front
+ BOOL visible = TRUE;
+ buy_currency_floater->setVisible( visible );
+ BOOL take_focus = TRUE;
+ buy_currency_floater->setFrontmost( take_focus );
+
+ // spec calls for floater to be centered on client window
+ buy_currency_floater->center();
+ }
+ else
+ {
+ llwarns << "Buy Currency (HTML) Floater not found" << llendl;
+ };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLBuyCurrencyHTML::closeDialog()
+{
+ LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >(LLFloaterReg::getInstance( "buy_currency_html" ) );
+ if ( buy_currency_floater )
+ {
+ buy_currency_floater->closeFloater();
+ };
+}
diff --git a/indra/newview/llbuycurrencyhtml.h b/indra/newview/llbuycurrencyhtml.h
new file mode 100644
index 0000000000..3435bb0451
--- /dev/null
+++ b/indra/newview/llbuycurrencyhtml.h
@@ -0,0 +1,57 @@
+/**
+ * @file llbuycurrencyhtml.h
+ * @brief Manages Buy Currency HTML floater
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2006-2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLBUYCURRENCYHTML_H
+#define LL_LLBUYCURRENCYHTML_H
+
+#include "llsingleton.h"
+
+class LLFloaterBuyCurrencyHTML;
+
+class LLBuyCurrencyHTML
+{
+ public:
+ // choke point for opening a legacy or new currency floater - this overload is when the L$ sum is not required
+ static void openCurrencyFloater();
+
+ // choke point for opening a legacy or new currency floater - this overload is when the L$ sum is required
+ static void openCurrencyFloater( const std::string& message, S32 sum );
+
+ // show and give focus to actual currency floater - this is used for both cases
+ // where the sum is required and where it is not
+ static void showDialog( bool specific_sum_requested, const std::string& message, S32 sum );
+
+ // close (and destroy) the currency floater
+ static void closeDialog();
+};
+
+#endif // LL_LLBUYCURRENCYHTML_H
diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp
index 1a5d55d793..1571415e63 100644
--- a/indra/newview/lldrawpooltree.cpp
+++ b/indra/newview/lldrawpooltree.cpp
@@ -113,9 +113,12 @@ void LLDrawPoolTree::render(S32 pass)
iter != mDrawFace.end(); iter++)
{
LLFace *face = *iter;
- face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
- face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
- gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ if(face->mVertexBuffer.notNull())
+ {
+ face->mVertexBuffer->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
+ face->mVertexBuffer->drawRange(LLRender::TRIANGLES, 0, face->mVertexBuffer->getRequestedVerts()-1, face->mVertexBuffer->getRequestedIndices(), 0);
+ gPipeline.addTrianglesDrawn(face->mVertexBuffer->getRequestedIndices());
+ }
}
}
}
@@ -333,7 +336,7 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
S32 stop_depth = 0;
F32 app_angle = treep->getAppAngle()*LLVOTree::sTreeFactor;
F32 alpha = 1.0;
- S32 trunk_LOD = 0;
+ S32 trunk_LOD = LLVOTree::sMAX_NUM_TREE_LOD_LEVELS;
for (S32 j = 0; j < 4; j++)
{
@@ -344,6 +347,10 @@ void LLDrawPoolTree::renderTree(BOOL selecting)
break;
}
}
+ if(trunk_LOD >= LLVOTree::sMAX_NUM_TREE_LOD_LEVELS)
+ {
+ continue ; //do not render.
+ }
if (app_angle < (THRESH_ANGLE_FOR_BILLBOARD - BLEND_RANGE_FOR_BILLBOARD))
{
diff --git a/indra/newview/llfloaterbuycurrencyhtml.cpp b/indra/newview/llfloaterbuycurrencyhtml.cpp
new file mode 100644
index 0000000000..5815df36d1
--- /dev/null
+++ b/indra/newview/llfloaterbuycurrencyhtml.cpp
@@ -0,0 +1,119 @@
+/**
+ * @file llfloaterbuycurrencyhtml.cpp
+ * @brief buy currency implemented in HTML floater - uses embedded media browser control
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2006-2010, 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 "llfloaterbuycurrencyhtml.h"
+#include "llstatusbar.h"
+
+////////////////////////////////////////////////////////////////////////////////
+//
+LLFloaterBuyCurrencyHTML::LLFloaterBuyCurrencyHTML( const LLSD& key ):
+ LLFloater( key ),
+ mSpecificSumRequested( false ),
+ mMessage( "" ),
+ mSum( 0 )
+{
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+BOOL LLFloaterBuyCurrencyHTML::postBuild()
+{
+ // observer media events
+ mBrowser = getChild<LLMediaCtrl>( "browser" );
+ mBrowser->addObserver( this );
+
+ return TRUE;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFloaterBuyCurrencyHTML::navigateToFinalURL()
+{
+ // URL for actual currency buy contents is in XUI file
+ std::string buy_currency_url = getString( "buy_currency_url" );
+
+ // replace [LANGUAGE] meta-tag with view language
+ LLStringUtil::format_map_t replace;
+
+ // viewer language
+ replace[ "[LANGUAGE]" ] = LLUI::getLanguage();
+
+ // flag that specific amount requested
+ replace[ "[SPECIFIC_AMOUNT]" ] = ( mSpecificSumRequested ? "y":"n" );
+
+ // amount requested
+ std::ostringstream codec( "" );
+ codec << mSum;
+ replace[ "[SUM]" ] = codec.str();
+
+ // users' current balance
+ codec.clear();
+ codec.str( "" );
+ codec << gStatusBar->getBalance();
+ replace[ "[BAL]" ] = codec.str();
+
+ // message - "This cost L$x,xxx for example
+ replace[ "[MSG]" ] = LLURI::escape( mMessage );
+ LLStringUtil::format( buy_currency_url, replace );
+
+ // kick off the navigation
+ mBrowser->navigateTo( buy_currency_url );
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFloaterBuyCurrencyHTML::handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event )
+{
+ // placeholder for now - just in case we want to catch media events
+ if ( LLPluginClassMediaOwner::MEDIA_EVENT_NAVIGATE_COMPLETE == event )
+ {
+ };
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFloaterBuyCurrencyHTML::onClose( bool app_quitting )
+{
+ destroy();
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+void LLFloaterBuyCurrencyHTML::setParams( bool specific_sum_requested, const std::string& message, S32 sum )
+{
+ // save these away - used to construct URL later
+ mSpecificSumRequested = specific_sum_requested;
+ mMessage = message;
+ mSum = sum;
+}
diff --git a/indra/newview/llfloaterbuycurrencyhtml.h b/indra/newview/llfloaterbuycurrencyhtml.h
new file mode 100644
index 0000000000..be7a4d3dd6
--- /dev/null
+++ b/indra/newview/llfloaterbuycurrencyhtml.h
@@ -0,0 +1,65 @@
+/**
+ * @file llfloaterbuycurrencyhtml.h
+ * @brief buy currency implemented in HTML floater - uses embedded media browser control
+ *
+ * $LicenseInfo:firstyear=2010&license=viewergpl$
+ *
+ * Copyright (c) 2006-2010, Linden Research, Inc.
+ *
+ * Second Life Viewer Source Code
+ * The source code in this file ("Source Code") is provided by Linden Lab
+ * to you under the terms of the GNU General Public License, version 2.0
+ * ("GPL"), unless you have obtained a separate licensing agreement
+ * ("Other License"), formally executed by you and Linden Lab. Terms of
+ * the GPL can be found in doc/GPL-license.txt in this distribution, or
+ * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
+ *
+ * There are special exceptions to the terms and conditions of the GPL as
+ * it is applied to this Source Code. View the full text of the exception
+ * in the file doc/FLOSS-exception.txt in this software distribution, or
+ * online at
+ * http://secondlifegrid.net/programs/open_source/licensing/flossexception
+ *
+ * By copying, modifying or distributing this software, you acknowledge
+ * that you have read and understood your obligations described above,
+ * and agree to abide by those obligations.
+ *
+ * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
+ * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
+ * COMPLETENESS OR PERFORMANCE.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERBUYCURRENCYHTML_H
+#define LL_LLFLOATERBUYCURRENCYHTML_H
+
+#include "llfloater.h"
+#include "llmediactrl.h"
+
+class LLFloaterBuyCurrencyHTML :
+ public LLFloater,
+ public LLViewerMediaObserver
+{
+ public:
+ LLFloaterBuyCurrencyHTML( const LLSD& key );
+
+ /*virtual*/ BOOL postBuild();
+ /*virtual*/ void onClose( bool app_quitting );
+
+ // inherited from LLViewerMediaObserver
+ /*virtual*/ void handleMediaEvent( LLPluginClassMedia* self, EMediaEvent event );
+
+ // allow our controlling parent to tell us paramters
+ void setParams( bool specific_sum_requested, const std::string& message, S32 sum );
+
+ // parse and construct URL and set browser to navigate there.
+ void navigateToFinalURL();
+
+ private:
+ LLMediaCtrl* mBrowser;
+ bool mSpecificSumRequested;
+ std::string mMessage;
+ S32 mSum;
+};
+
+#endif // LL_LLFLOATERBUYCURRENCYHTML_H
diff --git a/indra/newview/llfloaterhud.cpp b/indra/newview/llfloaterhud.cpp
index d2ee3e44c5..930bbe9e6b 100644
--- a/indra/newview/llfloaterhud.cpp
+++ b/indra/newview/llfloaterhud.cpp
@@ -79,9 +79,6 @@ BOOL LLFloaterHUD::postBuild()
mWebBrowser = getChild<LLMediaCtrl>("floater_hud_browser" );
if (mWebBrowser)
{
- // Open links in internal browser
- mWebBrowser->setOpenInExternalBrowser(false);
-
// This is a "chrome" floater, so we don't want anything to
// take focus (as the user needs to be able to walk with
// arrow keys during tutorial).
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 05cb6ddc4a..7a4ed74c4c 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -78,8 +78,6 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) :
mBorder(NULL),
mFrequentUpdates( true ),
mForceUpdate( false ),
- mOpenLinksInExternalBrowser( false ),
- mOpenLinksInInternalBrowser( false ),
mHomePageUrl( "" ),
mTrusted(false),
mIgnoreUIScale( true ),
@@ -167,20 +165,6 @@ void LLMediaCtrl::setTakeFocusOnClick( bool take_focus )
}
////////////////////////////////////////////////////////////////////////////////
-// set flag that forces the embedded browser to open links in the external system browser
-void LLMediaCtrl::setOpenInExternalBrowser( bool valIn )
-{
- mOpenLinksInExternalBrowser = valIn;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-// set flag that forces the embedded browser to open links in the internal browser floater
-void LLMediaCtrl::setOpenInInternalBrowser( bool valIn )
-{
- mOpenLinksInInternalBrowser = valIn;
-};
-
-////////////////////////////////////////////////////////////////////////////////
void LLMediaCtrl::setTrusted( bool valIn )
{
if(mMediaSource)
@@ -944,7 +928,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
case MEDIA_EVENT_CLICK_LINK_HREF:
{
LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << self->getClickTarget() << "\", uri is " << self->getClickURL() << LL_ENDL;
- onClickLinkHref(self);
};
break;
@@ -979,95 +962,6 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
////////////////////////////////////////////////////////////////////////////////
//
-void LLMediaCtrl::onClickLinkHref( LLPluginClassMedia* self )
-{
- // retrieve the event parameters
- std::string url = self->getClickURL();
- U32 target_type = self->getClickTargetType();
-
- // is there is a target specified for the link?
- if (target_type == LLPluginClassMedia::TARGET_EXTERNAL ||
- target_type == LLPluginClassMedia::TARGET_BLANK )
- {
- if (gSavedSettings.getBOOL("UseExternalBrowser"))
- {
- LLSD payload;
- payload["url"] = url;
- payload["target_type"] = LLSD::Integer(target_type);
- LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
- }
- else
- {
- clickLinkWithTarget(url, target_type);
- }
- }
- else {
- const std::string protocol1( "http://" );
- const std::string protocol2( "https://" );
- if( mOpenLinksInExternalBrowser )
- {
- if ( !url.empty() )
- {
- if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
- LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
- {
- LLWeb::loadURLExternal( url );
- }
- }
- }
- else
- if( mOpenLinksInInternalBrowser )
- {
- if ( !url.empty() )
- {
- if ( LLStringUtil::compareInsensitive( url.substr( 0, protocol1.length() ), protocol1 ) == 0 ||
- LLStringUtil::compareInsensitive( url.substr( 0, protocol2.length() ), protocol2 ) == 0 )
- {
- llwarns << "Dead, unimplemented path that we used to send to the built-in browser long ago." << llendl;
- }
- }
- }
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-// static
-bool LLMediaCtrl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if ( 0 == option )
- {
- LLSD payload = notification["payload"];
- std::string url = payload["url"].asString();
- S32 target_type = payload["target_type"].asInteger();
- clickLinkWithTarget(url, target_type);
- }
- return false;
-}
-
-
-////////////////////////////////////////////////////////////////////////////////
-// static
-void LLMediaCtrl::clickLinkWithTarget(const std::string& url, const S32& target_type )
-{
- if (target_type == LLPluginClassMedia::TARGET_EXTERNAL)
- {
- // load target in an external browser
- LLWeb::loadURLExternal(url);
- }
- else if (target_type == LLPluginClassMedia::TARGET_BLANK)
- {
- // load target in the user's preferred browser
- LLWeb::loadURL(url);
- }
- else {
- // unsupported link target - shouldn't happen
- LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL;
- }
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//
std::string LLMediaCtrl::getCurrentNavUrl()
{
return mCurrentNavUrl;
diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h
index e55d2f7cd0..310492fe02 100644
--- a/indra/newview/llmediactrl.h
+++ b/indra/newview/llmediactrl.h
@@ -99,8 +99,6 @@ public:
void navigateToLocalPage( const std::string& subdir, const std::string& filename_in );
bool canNavigateBack();
bool canNavigateForward();
- void setOpenInExternalBrowser( bool valIn );
- void setOpenInInternalBrowser( bool valIn );
std::string getCurrentNavUrl();
// By default, we do not handle "secondlife:///app/" SLURLs, because
@@ -162,24 +160,17 @@ public:
// Incoming media event dispatcher
virtual void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
- // handlers for individual events (could be done inside the switch in handleMediaEvent, they're just individual functions for clarity)
- void onClickLinkHref( LLPluginClassMedia* self );
-
protected:
void convertInputCoords(S32& x, S32& y);
private:
void onVisibilityChange ( const LLSD& new_visibility );
- static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
- static void clickLinkWithTarget(const std::string& url, const S32& target_type );
const S32 mTextureDepthBytes;
LLUUID mMediaTextureID;
LLViewBorder* mBorder;
bool mFrequentUpdates;
bool mForceUpdate;
- bool mOpenLinksInExternalBrowser;
- bool mOpenLinksInInternalBrowser;
bool mTrusted;
std::string mHomePageUrl;
std::string mCurrentNavUrl;
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 508a58e74f..0009f7203a 100644
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -270,20 +270,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
web_browser->setTabStop(FALSE);
// web_browser->navigateToLocalPage( "loading", "loading.html" );
- if (gSavedSettings.getBOOL("RegInClient"))
- {
- // need to follow links in the internal browser
- web_browser->setOpenInExternalBrowser( false );
-
- getChild<LLView>("login_widgets")->setVisible(false);
- }
- else
- {
- // make links open in external browser
- web_browser->setOpenInExternalBrowser( true );
-
- reshapeBrowser();
- }
+ reshapeBrowser();
// kick off a request to grab the url manually
gResponsePtr = LLIamHereLogin::build( this );
@@ -487,7 +474,6 @@ void LLPanelLogin::showLoginWidgets()
{
sInstance->childSetVisible("login_widgets", true);
LLMediaCtrl* web_browser = sInstance->getChild<LLMediaCtrl>("login_html");
- web_browser->setOpenInExternalBrowser( true );
sInstance->reshapeBrowser();
// *TODO: Append all the usual login parameters, like first_login=Y etc.
std::string splash_screen_url = sInstance->getString("real_url");
diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp
index de16f9d343..39ade40967 100644
--- a/indra/newview/llpanelobjectinventory.cpp
+++ b/indra/newview/llpanelobjectinventory.cpp
@@ -48,7 +48,7 @@
#include "llagent.h"
#include "llavataractions.h"
#include "llcallbacklist.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloaterreg.h"
#include "llinventorybridge.h"
#include "llinventorydefines.h"
@@ -616,7 +616,7 @@ void LLTaskInvFVBridge::performAction(LLInventoryModel* model, std::string actio
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", price);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs", args), price);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("this_costs", args), price );
}
else
{
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp
index 1a1650c38b..c8abcc83c4 100644
--- a/indra/newview/llpanelplaceprofile.cpp
+++ b/indra/newview/llpanelplaceprofile.cpp
@@ -50,7 +50,7 @@
#include "llagentui.h"
#include "llappviewer.h"
#include "llcallbacklist.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llstatusbar.h"
#include "llviewercontrol.h"
#include "llviewerparcelmgr.h"
@@ -573,7 +573,7 @@ void LLPanelPlaceProfile::onForSaleBannerClick()
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", price);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land", args), price);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("buying_selected_land", args), price );
}
else
{
diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp
index b660a2b8ea..5628205dd4 100644
--- a/indra/newview/llstatusbar.cpp
+++ b/indra/newview/llstatusbar.cpp
@@ -41,6 +41,7 @@
#include "llcommandhandler.h"
#include "llviewercontrol.h"
#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloaterlagmeter.h"
#include "llpanelnearbymedia.h"
#include "llpanelvolumepulldown.h"
@@ -509,7 +510,9 @@ S32 LLStatusBar::getSquareMetersLeft() const
void LLStatusBar::onClickBuyCurrency()
{
- LLFloaterBuyCurrency::buyCurrency();
+ // open a currency floater - actual one open depends on
+ // value specified in settings.xml
+ LLBuyCurrencyHTML::openCurrencyFloater();
}
static void onClickHealth(void* )
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 7fa04ce574..913a0b92c2 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -328,11 +328,7 @@ public:
partial = true;
}
}
- else
- {
- worker->setGetStatus(status, reason);
-// llwarns << status << ": " << reason << llendl;
- }
+
if (!success)
{
worker->setGetStatus(status, reason);
@@ -904,7 +900,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
if (mGetStatus == HTTP_NOT_FOUND)
{
mHTTPFailCount = max_attempts = 1; // Don't retry
- //llinfos << "Texture missing from server (404): " << mUrl << llendl;
+ llwarns << "Texture missing from server (404): " << mUrl << llendl;
//roll back to try UDP
mState = INIT ;
@@ -921,6 +917,17 @@ bool LLTextureFetchWorker::doWork(S32 param)
max_attempts = mHTTPFailCount+1; // Keep retrying
LL_INFOS_ONCE("Texture") << "Texture server busy (503): " << mUrl << LL_ENDL;
}
+ else if(mGetStatus >= HTTP_MULTIPLE_CHOICES && mGetStatus < HTTP_BAD_REQUEST) //http re-direct
+ {
+ ++mHTTPFailCount;
+ max_attempts = 5 ; //try at most 5 times to avoid infinite redirection loop.
+
+ llwarns << "HTTP GET failed because of redirection: " << mUrl
+ << " Status: " << mGetStatus << " Reason: '" << mGetReason << llendl ;
+
+ //assign to the new url
+ mUrl = mGetReason ;
+ }
else
{
const S32 HTTP_MAX_RETRY_COUNT = 3;
@@ -930,6 +937,7 @@ bool LLTextureFetchWorker::doWork(S32 param)
<< " Status: " << mGetStatus << " Reason: '" << mGetReason << "'"
<< " Attempt:" << mHTTPFailCount+1 << "/" << max_attempts << llendl;
}
+
if (mHTTPFailCount >= max_attempts)
{
if (cur_size > 0)
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 506cebfe73..49ea0348f9 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -49,6 +49,7 @@
#include "llfloaterbuy.h"
#include "llfloaterbuycontents.h"
#include "llfloaterbuycurrency.h"
+#include "llfloaterbuycurrencyhtml.h"
#include "llfloaterbuyland.h"
#include "llfloaterbulkpermission.h"
#include "llfloaterbump.h"
@@ -141,6 +142,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("beacons", "floater_beacons.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBeacons>);
LLFloaterReg::add("bulk_perms", "floater_bulk_perms.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBulkPermission>);
LLFloaterReg::add("buy_currency", "floater_buy_currency.xml", &LLFloaterBuyCurrency::buildFloater);
+ LLFloaterReg::add("buy_currency_html", "floater_buy_currency_html.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyCurrencyHTML>);
LLFloaterReg::add("buy_land", "floater_buy_land.xml", &LLFloaterBuyLand::buildFloater);
LLFloaterReg::add("buy_object", "floater_buy_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuy>);
LLFloaterReg::add("buy_object_contents", "floater_buy_contents.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyContents>);
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index 4db05e8a98..7429a49ccf 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -2795,6 +2795,42 @@ bool LLViewerMediaImpl::isPlayable() const
return false;
}
+////////////////////////////////////////////////////////////////////////////////
+// static
+bool LLViewerMediaImpl::onClickLinkExternalTarget(const LLSD& notification, const LLSD& response )
+{
+ S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
+ if ( 0 == option )
+ {
+ LLSD payload = notification["payload"];
+ std::string url = payload["url"].asString();
+ S32 target_type = payload["target_type"].asInteger();
+ clickLinkWithTarget(url, target_type);
+ }
+ return false;
+}
+
+
+////////////////////////////////////////////////////////////////////////////////
+// static
+void LLViewerMediaImpl::clickLinkWithTarget(const std::string& url, const S32& target_type )
+{
+ if (target_type == LLPluginClassMedia::TARGET_EXTERNAL)
+ {
+ // load target in an external browser
+ LLWeb::loadURLExternal(url);
+ }
+ else if (target_type == LLPluginClassMedia::TARGET_BLANK)
+ {
+ // load target in the user's preferred browser
+ LLWeb::loadURL(url);
+ }
+ else {
+ // unsupported link target - shouldn't happen
+ LL_WARNS("LinkTarget") << "Unsupported link target type" << LL_ENDL;
+ }
+}
+
//////////////////////////////////////////////////////////////////////////////////////////
void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event)
{
@@ -2808,6 +2844,31 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla
}
break;
+ case MEDIA_EVENT_CLICK_LINK_HREF:
+ {
+ LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_CLICK_LINK_HREF, target is \"" << plugin->getClickTarget() << "\", uri is " << plugin->getClickURL() << LL_ENDL;
+ // retrieve the event parameters
+ std::string url = plugin->getClickURL();
+ U32 target_type = plugin->getClickTargetType();
+
+ // is there is a target specified for the link?
+ if (target_type == LLPluginClassMedia::TARGET_EXTERNAL ||
+ target_type == LLPluginClassMedia::TARGET_BLANK )
+ {
+ if (gSavedSettings.getBOOL("UseExternalBrowser"))
+ {
+ LLSD payload;
+ payload["url"] = url;
+ payload["target_type"] = LLSD::Integer(target_type);
+ LLNotificationsUtil::add( "WebLaunchExternalTarget", LLSD(), payload, onClickLinkExternalTarget);
+ }
+ else
+ {
+ clickLinkWithTarget(url, target_type);
+ }
+ }
+ };
+ break;
case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH:
{
// The plugin failed to load properly. Make sure the timer doesn't retry.
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 8626f4469e..754d0851c3 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -391,6 +391,8 @@ private:
bool shouldShowBasedOnClass() const;
static bool isObjectAttachedToAnotherAvatar(LLVOVolume *obj);
static bool isObjectInAgentParcel(LLVOVolume *obj);
+ static bool onClickLinkExternalTarget( const LLSD&, const LLSD& );
+ static void clickLinkWithTarget(const std::string& url, const S32& target_type );
private:
// a single media url with some data and an impl.
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 4bfb87343c..10ceab2656 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -53,7 +53,7 @@
//#include "llfirstuse.h"
#include "llfloaterbuy.h"
#include "llfloaterbuycontents.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloatercustomize.h"
#include "llfloatergodtools.h"
#include "llfloaterinventory.h"
@@ -3288,7 +3288,7 @@ void handle_buy_object(LLSaleInfo sale_info)
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", price);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs", args), price);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("this_object_costs", args), price );
return;
}
@@ -4430,8 +4430,7 @@ void handle_buy_or_take()
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", total_price);
- LLFloaterBuyCurrency::buyCurrency(
- LLTrans::getString("BuyingCosts", args), total_price);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString( "BuyingCosts", args ), total_price );
}
}
else
@@ -5631,7 +5630,7 @@ void handle_report_abuse()
void handle_buy_currency()
{
- LLFloaterBuyCurrency::buyCurrency();
+ LLBuyCurrencyHTML::openCurrencyFloater();
}
class LLFloaterVisible : public view_listener_t
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index c415d89e9c..5570fe5fec 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -39,7 +39,7 @@
#include "llagentcamera.h"
#include "llfilepicker.h"
#include "llfloaterreg.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloatersnapshot.h"
#include "llimage.h"
#include "llimagebmp.h"
@@ -811,7 +811,7 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt
LLStringUtil::format_map_t args;
args["NAME"] = data->mAssetInfo.getName();
args["AMOUNT"] = llformat("%d", expected_upload_cost);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("UploadingCosts", args), expected_upload_cost);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("UploadingCosts", args), expected_upload_cost );
is_balance_sufficient = FALSE;
}
else if(region)
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 91b1a421ff..abac3d26bf 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -55,8 +55,7 @@
#include "llagent.h"
#include "llagentcamera.h"
#include "llcallingcard.h"
-//#include "llfirstuse.h"
-#include "llfloaterbuycurrency.h"
+#include "llbuycurrencyhtml.h"
#include "llfloaterbuyland.h"
#include "llfloaterland.h"
#include "llfloaterregioninfo.h"
@@ -283,7 +282,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_
{
LLStringUtil::format_map_t args;
args["AMOUNT"] = llformat("%d", amount);
- LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving", args), amount);
+ LLBuyCurrencyHTML::openCurrencyFloater( LLTrans::getString("giving", args), amount );
}
}
diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp
index b89c0cd638..eb5b6c6618 100644
--- a/indra/newview/llvotree.cpp
+++ b/indra/newview/llvotree.cpp
@@ -66,12 +66,14 @@ const F32 LEAF_TOP = 1.0f;
const F32 LEAF_BOTTOM = 0.52f;
const F32 LEAF_WIDTH = 1.f;
-S32 LLVOTree::sLODVertexOffset[4];
-S32 LLVOTree::sLODVertexCount[4];
-S32 LLVOTree::sLODIndexOffset[4];
-S32 LLVOTree::sLODIndexCount[4];
-S32 LLVOTree::sLODSlices[4] = {10, 5, 4, 3};
-F32 LLVOTree::sLODAngles[4] = {30.f, 20.f, 15.f, 0.f};
+const S32 LLVOTree::sMAX_NUM_TREE_LOD_LEVELS = 4 ;
+
+S32 LLVOTree::sLODVertexOffset[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODVertexCount[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODIndexOffset[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODIndexCount[sMAX_NUM_TREE_LOD_LEVELS];
+S32 LLVOTree::sLODSlices[sMAX_NUM_TREE_LOD_LEVELS] = {10, 5, 4, 3};
+F32 LLVOTree::sLODAngles[sMAX_NUM_TREE_LOD_LEVELS] = {30.f, 20.f, 15.f, 0.00001f};
F32 LLVOTree::sTreeFactor = 1.f;
@@ -373,12 +375,11 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
}
}
- S32 trunk_LOD = 0;
+ S32 trunk_LOD = sMAX_NUM_TREE_LOD_LEVELS ;
F32 app_angle = getAppAngle()*LLVOTree::sTreeFactor;
- for (S32 j = 0; j < 4; j++)
+ for (S32 j = 0; j < sMAX_NUM_TREE_LOD_LEVELS; j++)
{
-
if (app_angle > LLVOTree::sLODAngles[j])
{
trunk_LOD = j;
@@ -445,16 +446,15 @@ void LLVOTree::setPixelAreaAndAngle(LLAgent &agent)
// This should be the camera's center, as soon as we move to all region-local.
LLVector3 relative_position = getPositionAgent() - gAgentCamera.getCameraPositionAgent();
- F32 range = relative_position.length(); // ugh, square root
+ F32 range_squared = relative_position.lengthSquared() ;
F32 max_scale = mBillboardScale * getMaxScale();
F32 area = max_scale * (max_scale*mBillboardRatio);
// Compute pixels per meter at the given range
- F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() /
- (tan(LLViewerCamera::getInstance()->getView()) * range);
+ F32 pixels_per_meter = LLViewerCamera::getInstance()->getViewHeightInPixels() / tan(LLViewerCamera::getInstance()->getView());
- mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area;
+ mPixelArea = (pixels_per_meter) * (pixels_per_meter) * area / range_squared;
#if 0
// mAppAngle is a bit of voodoo;
// use the one calculated LLViewerObject::setPixelAreaAndAngle above
@@ -506,6 +506,13 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
{
LLFastTimer ftm(FTM_UPDATE_TREE);
+ if(mTrunkLOD >= sMAX_NUM_TREE_LOD_LEVELS) //do not display the tree.
+ {
+ mReferenceBuffer = NULL ;
+ mDrawable->getFace(0)->mVertexBuffer = NULL ;
+ return TRUE ;
+ }
+
if (mReferenceBuffer.isNull() || mDrawable->getFace(0)->mVertexBuffer.isNull())
{
const F32 SRR3 = 0.577350269f; // sqrt(1/3)
@@ -523,7 +530,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
face->mCenterAgent = getPositionAgent();
face->mCenterLocal = face->mCenterAgent;
- for (lod = 0; lod < 4; lod++)
+ for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++)
{
slices = sLODSlices[lod];
sLODVertexOffset[lod] = max_vertices;
@@ -700,7 +707,7 @@ BOOL LLVOTree::updateGeometry(LLDrawable *drawable)
// Generate the vertices
// Generate the indices
- for (lod = 0; lod < 4; lod++)
+ for (lod = 0; lod < sMAX_NUM_TREE_LOD_LEVELS; lod++)
{
slices = sLODSlices[lod];
F32 base_radius = 0.65f;
@@ -892,7 +899,6 @@ void LLVOTree::updateMesh()
S32 stop_depth = 0;
F32 alpha = 1.0;
-
U32 vert_count = 0;
U32 index_count = 0;
diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h
index feac9e0675..036ad692b1 100644
--- a/indra/newview/llvotree.h
+++ b/indra/newview/llvotree.h
@@ -152,6 +152,7 @@ public:
};
static F32 sTreeFactor; // Tree level of detail factor
+ static const S32 sMAX_NUM_TREE_LOD_LEVELS ;
friend class LLDrawPoolTree;
protected:
diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml
new file mode 100644
index 0000000000..ab44082070
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_buy_currency_html.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ can_resize="false"
+ height="240"
+ layout="topleft"
+ min_height="240"
+ min_width="420"
+ name="floater_buy_currency_html"
+ help_topic="floater_buy_currency_html"
+ save_rect="true"
+ single_instance="true"
+ title="BUY CURRENCY"
+ width="422">
+ <floater.string
+ name="buy_currency_url" translate="false">
+ http://user.lindenlab.com/~callum/ez/index.php?lang=[LANGUAGE]&amp;sa=[SPECIFIC_AMOUNT]&amp;sum=[SUM]&amp;msg=[MSG]&amp;bal=[BAL]
+</floater.string>
+ <web_browser
+ bottom="238"
+ follows="left|right|top|bottom"
+ layout="topleft"
+ left="2"
+ name="browser"
+ top="18"
+ width="420" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
index 68a0db3b89..1881f85e8c 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml
@@ -160,7 +160,7 @@
layout="topleft"
left="5"
name="CustomGraphics Panel"
- top="101"
+ top="76"
width="485">
<text
type="string"
@@ -343,7 +343,7 @@
top_delta="0"
width="128">
m
- </text>
+ </text>
<slider
control_name="RenderMaxPartCount"
decimal_digits="0"
@@ -359,6 +359,34 @@
name="MaxParticleCount"
top_pad="7"
width="303" />
+ <slider
+ control_name="RenderAvatarMaxVisible"
+ decimal_digits="0"
+ follows="left|top"
+ height="16"
+ increment="2"
+ initial_value="35"
+ label="Max. avatar draw distance:"
+ label_width="185"
+ layout="topleft"
+ left_delta="0"
+ max_val="65"
+ min_val="1"
+ name="MaxAvatarDrawDistance"
+ top_pad="4"
+ width="290" />
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="12"
+ layout="topleft"
+ left_delta="291"
+ name="DrawDistanceMeterText2"
+ top_delta="0"
+ width="128">
+ m
+ </text>
<slider
control_name="RenderGlowResolutionPow"
decimal_digits="0"
@@ -369,7 +397,7 @@
label="Post process quality:"
label_width="185"
layout="topleft"
- left_delta="0"
+ left="200"
max_val="9"
min_val="8"
name="RenderPostProcess"
@@ -514,7 +542,7 @@
layout="topleft"
left="469"
name="PostProcessText"
- top="328"
+ top="60"
width="128">
Low
</text>
@@ -599,7 +627,7 @@
layout="topleft"
left_delta="-260"
name="AvatarRenderingText"
- top_pad="8"
+ top_pad="18"
width="128">
Avatar rendering:
</text>
@@ -645,7 +673,7 @@
left="358"
left_pad="-30"
name="TerrainDetailText"
- top="488"
+ top="226"
width="155">
Terrain detail:
</text>