summaryrefslogtreecommitdiff
path: root/indra/newview/llbuycurrencyhtml.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-15 11:16:27 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2024-05-15 11:16:27 +0300
commitbccc10db9a90d365c353baebf443fde2030ce970 (patch)
tree2c2e1fd94b29667a809f8d7285d049f5ff5d424d /indra/newview/llbuycurrencyhtml.cpp
parent531cd34f670170ade57f8813fe48012b61a1d3c2 (diff)
parentbb3c36f5cbc0c3b542045fd27255eee24e03da22 (diff)
Merge branch 'main' into marchcat/x-b-merge
# Conflicts: # autobuild.xml # indra/cmake/ConfigurePkgConfig.cmake # indra/cmake/ICU4C.cmake # indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.cpp # indra/media_plugins/gstreamer010/llmediaimplgstreamer_syms.h # indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h # indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp # indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.h # indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp # indra/newview/llappviewerlinux_api.h # indra/newview/llappviewerlinux_api_dbus.cpp # indra/newview/llappviewerlinux_api_dbus.h # indra/newview/llfloateremojipicker.cpp # indra/newview/lloutfitslist.cpp
Diffstat (limited to 'indra/newview/llbuycurrencyhtml.cpp')
-rw-r--r--indra/newview/llbuycurrencyhtml.cpp204
1 files changed, 102 insertions, 102 deletions
diff --git a/indra/newview/llbuycurrencyhtml.cpp b/indra/newview/llbuycurrencyhtml.cpp
index 37de89a48b..115e68b396 100644
--- a/indra/newview/llbuycurrencyhtml.cpp
+++ b/indra/newview/llbuycurrencyhtml.cpp
@@ -1,25 +1,25 @@
-/**
+/**
* @file llbuycurrencyhtml.cpp
* @brief Manages Buy Currency HTML floater
*
* $LicenseInfo:firstyear=2010&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, Linden Research, Inc.
- *
+ *
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation;
* version 2.1 of the License only.
- *
+ *
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
- *
+ *
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
+ *
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$
*/
@@ -36,132 +36,132 @@
#include "llstatusbar.h"
// support for secondlife:///app/buycurrencyhtml/{ACTION}/{NEXT_ACTION}/{RETURN_CODE} SLapps
-class LLBuyCurrencyHTMLHandler :
- public LLCommandHandler
+class LLBuyCurrencyHTMLHandler :
+ public LLCommandHandler
{
public:
- // requests will be throttled from a non-trusted browser
- LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_THROTTLE) {}
-
- bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, 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();
- if ( result_code != 0 )
- {
- LL_WARNS("LLBuyCurrency") << "Received nonzero result code: " << result_code << LL_ENDL ;
- }
- };
-
- // 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;
- };
+ // requests will be throttled from a non-trusted browser
+ LLBuyCurrencyHTMLHandler() : LLCommandHandler( "buycurrencyhtml", UNTRUSTED_THROTTLE) {}
+
+ bool handle(const LLSD& params, const LLSD& query_map, const std::string& grid, 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();
+ if ( result_code != 0 )
+ {
+ LL_WARNS("LLBuyCurrency") << "Received nonzero result code: " << result_code << LL_ENDL ;
+ }
+ };
+
+ // 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
+// 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();
- };
+ 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
+// 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 );
- };
+ 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
- {
- LL_WARNS() << "Buy Currency (HTML) Floater not found" << LL_ENDL;
- };
+ 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
+ {
+ LL_WARNS() << "Buy Currency (HTML) Floater not found" << LL_ENDL;
+ };
}
////////////////////////////////////////////////////////////////////////////////
//
void LLBuyCurrencyHTML::closeDialog()
{
- LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >(LLFloaterReg::getInstance( "buy_currency_html" ) );
- if ( buy_currency_floater )
- {
- buy_currency_floater->closeFloater();
- };
-
- // Update L$ balance in the status bar in case L$ were purchased
- LLStatusBar::sendMoneyBalanceRequest();
+ LLFloaterBuyCurrencyHTML* buy_currency_floater = dynamic_cast< LLFloaterBuyCurrencyHTML* >(LLFloaterReg::getInstance( "buy_currency_html" ) );
+ if ( buy_currency_floater )
+ {
+ buy_currency_floater->closeFloater();
+ };
+
+ // Update L$ balance in the status bar in case L$ were purchased
+ LLStatusBar::sendMoneyBalanceRequest();
}