summaryrefslogtreecommitdiff
path: root/indra/newview/llcurrencyuimanager.cpp
AgeCommit message (Collapse)Author
2020-03-25SL-11216: Convert LLVersionInfo to an LLSingleton.Nat Goodspeed
This changeset is meant to exemplify how to convert a "namespace" class whose methods are static -- and whose data are module-static -- to an LLSingleton. LLVersionInfo has no initClass() or cleanupClass() methods, but the general idea is the same. * Derive the class from LLSingleton<T>: class LLSomeSingleton: public LLSingleton<LLSomeSingleton> { ... }; * Add LLSINGLETON(LLSomeSingleton); in the private section of the class. This usage implies a separate LLSomeSingleton::LLSomeSingleton() definition, as described in indra/llcommon/llsingleton.h. * Move module-scope data in the .cpp file to non-static class members. Change any sVariableName to mVariableName to avoid being outright misleading. * Make static class methods non-static. Remove '//static' comments from method definitions as needed. * For LLVersionInfo specifically, the 'const std::string&' return type was replaced with 'std::string'. Returning a reference to a static or a member, const or otherwise, is an anti-pattern: the interface constrains the implementation, prohibiting possibly later returning a temporary (an expression). * For LLVersionInfo specifically, 'const S32' return type was replaced with simple 'S32'. 'const' is just noise in that usage. * Simple member initialization (e.g. the original initializer expressions for static variables) can be done with member{ value } initializers (no examples here though). * Delete initClass() method. * LLSingleton's forté is of course lazy initialization. It might work to simply delete any calls to initClass(). But if there are side effects that must happen at that moment, replace LLSomeSingleton::initClass() with (void)LLSomeSingleton::instance(); * Most initClass() initialization can be done in the constructor, as would normally be the case. * Initialization that might cause a circular LLSingleton reference should be moved to initSingleton(). Override 'void initSingleton();' should be private. * For LLVersionInfo specifically, certain initialization that used to be lazily performed was made unconditional, due to its low cost. * For LLVersionInfo specifically, certain initialization involved calling methods that have become non-static. This was moved to initSingleton() because, in a constructor body, 'this' does not yet point to the enclosing class. * Delete cleanupClass() method. * There is already a generic LLSingletonBase::deleteAll() call in LLAppViewer::cleanup(). It might work to let this new LLSingleton be cleaned up with all the rest. But if there are side effects that must happen at that moment, replace LLSomeSingleton::cleanupClass() with LLSomeSingleton::deleteSingleton(). That said, much of the benefit of converting to LLSingleton is deleteAll()'s guarantee that cross-LLSingleton dependencies will be properly honored: we're trying to migrate the code base away from the present fragile manual cleanup sequence. * Most cleanupClass() cleanup can be done in the destructor, as would normally be the case. * Cleanup that might throw an exception should be moved to cleanupSingleton(). Override 'void cleanupSingleton();' should be private. * Within LLSomeSingleton methods, remove any existing LLSomeSingleton::methodName() qualification: simple methodName() is better. * In the rest of the code base, convert most LLSomeSingleton::methodName() references to LLSomeSingleton::instance().methodName(). (Prefer instance() to getInstance() because a reference does not admit the possibility of NULL.) * Of course, LLSomeSingleton::ENUM_VALUE can remain unchanged. In general, for many successive references to an LLSingleton instance, it can be useful to capture the instance() as in: auto& versionInfo{LLVersionInfo::instance()}; // ... versionInfo.getVersion() ... We did not do that here only to simplify the code review. The STRINGIZE(expression) macro encapsulates: std::ostringstream out; out << expression; return out.str(); We used that in a couple places. For LLVersionInfo specifically, lllogininstance_test.cpp used to dummy out a couple specific static methods. It's harder to dummy out LLSingleton::instance() references, so we add the real class to that test.
2015-11-10remove execute permission from many files that should not have itOz Linden
2013-03-29Update Mac and Windows breakpad builds to latestGraham Madarasz
2010-11-01VWR-23666 Removed setting VersionChannelName. LLVersionInfo::resetChannel() ↵Mark Palange (Mani)
and unit tests. Reviewed by brad.
2010-08-31VWR-22280 FIXED Add "language" parameter to all XMLRPC call (Buy L$ and Buy ↵Vadim Savchuk
Land).
2010-08-24Backed out changeset c3d41f18ce2bTofu Linden
back-out the back-out for this branch. yay.
2010-08-24Backed out changeset a62bf7c0af21Tofu Linden
Backing out this merge that I pushed (prematurely) to the wrong place.
2010-08-24merge heads. whew.Tofu Linden
2010-08-13Change license from GPL to LGPL (version 2.1)Oz Linden
2010-07-30deprecated LLPanel::child*() methodsRichard Nelson
2010-07-14EXT-8310 FIXED Incorrect currency format in the Buy L$ floater.Vadim Savchuk
Changes in the Buy L$ floater: * Set system locale before formatting currency. * Made money format configurable (via strings.xml). * Placed the "L$" label to the right of the line editor in FR locale. Details: Actually, the proper way to fix this and similar number formatting bugs would be to set the system locale at startup, but: 1. That triggers assertions when parsing locale-agnostic XML files like avatar_skeleton.xml. 2. I'm wary of making such global changes so close to the 2.1 release. Therefore I just temporarily override current locale before formatting a number and restore the previous locale afterwards. Reviewed by Tofu at https://codereview.productengine.com/secondlife/r/751/ --HG-- branch : product-engine
2010-04-07Re-insert backed out SLE checkin so we can fix itRoxie Linden
2010-04-07Backed out changeset 63b699f90efdTofu Linden
2010-02-26automated mergeRoxie Linden
2010-02-05EXT-5025 - Tooltips block mouse clicksrichard
EXT-4547 [BSI] it is possible to highlight multiple layers of chat EXT-3844 Mouse wheel camera zoom is not reflected on View popup slider EXT-3103 Add an option to restrict entering non-ascii symbols in text editor. reviewed by Leyla
2009-12-08DEV-43439: Created new LLVersionInfo API.Lynx Linden
Renamed llviewerversion to llversioninfo, to avoid confusion with llversionviewer in llcommon (llversion is already used by llwindow). Created new LLVersionInfo class with the following methods: static S32 getMajor(); static S32 getMinor(); static S32 getPatch(); static S32 getBuild(); static const std::string &getVersion(); static const std::string &getShortVersion(); static const std::string &getChannel(); All viewer code has been updated to use this API. Viewer code no longer directly includes llversionviewer.h from llcommon.
2009-12-01EXT-332: Hide international billing features until enabled.Lynx Linden
The international billing links and labels in the Buy L$ floater are now hidden by default. They will only be displayed once we get an estimate from the server that includes an "estimatedLocalCost" token, i.e., we are connected to a server that has the international billing functionality enabled. This is done so that the new functionality in Viewer 2.0 is not exposed to the user until the international billing features are live (which is scheduled to happen after the Viewer 2.0 release date).
2009-11-08EXT-332: Added support for local currency estimates to the Buy L$Lynx Linden
and Buy Land floaters. We now check for a new estimatedLocalCost key from the XML-RPC server, which provides the estimated cost in the user's local currency, e.g., "US$ 10.00" or "10.00 Euros". Note: the server is not currently sending this information. The previous codepath still exists and should be unaffected. That is, we will continue to check for an estimatedCost key from the server with a value specified in US cents. We give precedence to estimatedLocalCost though and may want to remove this code once the international billing server changes go live. <lynx@lindenlab.com> HG: branch 'default' HG: changed indra/newview/llcurrencyuimanager.cpp HG: changed indra/newview/llcurrencyuimanager.h HG: changed indra/newview/llfloaterbuyland.cpp HG: changed indra/newview/skins/default/xui/en/floater_buy_land.xml
2009-11-02DEV-40744 EXT-332: include viewer version information in the Buy L$Lynx Linden
requests to the XML-RPC server, including the channel name and the major, minor, patch, and build version numbers. This information is needed by the international billing guys to determine whether an international customer is trying to use a 1.23 viewer to buy L$.
2009-10-01EXT-332: Updated the visual style of the Buy L$ floater based onMartin Reddy
Erica's design. Now any errors during the L$ purchase process will give you a nice prompt to visit the SL website. Replaced all user-visible references to the illegal term "currency" with the term "L$". Also fixed an outstanding bug with this floater: if you clicked the Buy button but then cancelled the confirmation dialog, then the Buy button would remain disabled. Now the Buy button is only disabled during periods when you actually cannot buy. Added initial support for local currencies, with the use of a new [LOCALAMOUNT] field in the XUI files. When the XML-RPC server can actually return local currency details, we can hook this up by just changing llcurrencyuimanager.cpp. Discussed XML-RPC interaction with Morpheus. Thanks to Erica for the images and first cut at the XUI.
2010-02-01Merge giab-viewer-trunk 2497, general merge of moreRoxie Linden
secapi stuff as well as certificate handling stuff. Grid manager as well
2009-06-21merge -r 122421-124917 viewer-2.0.0-2 -> viewer-2.0.0-3Steven Bennetts
ignore-dead-branch
2009-05-22svn merge -r121194:121210Adam Moss
svn+ssh://svn.lindenlab.com/svn/linden/branches/viewer/viewer-1.23.onetwo-merge-1 QAR-1531 viewer 1.23rc1+1.23rc2 merge to trunk
2009-01-08Result of svn merge -r107256:107258 ↵Aaron Brashears
svn+ssh://svn/svn/user/phoenix/license_2009_merge into trunk. QAR-1165
2008-06-26QAR-628 merge string-cleanup-5 -r 90476:90508 -> releaseSteven Bennetts
dataserver-is-deprecated
2008-06-06QAR-650 - Viewer RC 9 merge -> release (post cmake)Steven Bennetts
merge release@88802 Branch_1-20-Viewer-2-merge-1@89178 -> release
2008-05-19EFFECTIVE MERGES:Don Kjer
svn merge -r 79616:82632 svn+ssh://svn/svn/linden/branches/maintenance/maintenance-7 into release svn merge -r 83211:87215 svn+ssh://svn/svn/linden/branches/php-framework-3 into release ACTUAL MERGE: svn merge -r 87631:87698 svn+ssh://svn/svn/linden/qa/combo-merge-maintenance-7-php-framework-3 into release dataserver-is-deprecated
2008-05-07Back out QAR-520 maintenance-7 merge -- svn merge -r 86947:86946 ↵Brian McGroarty
svn+ssh://svn.lindenlab.com/svn/linden/release dataserver-is-deprecated
2008-05-07QAR-520 maintenance-7 merge -- svn merge -r 84923:86093 ↵Brian McGroarty
svn+ssh://svn.lindenlab.com/svn/linden/qa/maintenance-7-sandbox-84884 -- dataserver-is-deprecated
2008-04-01merge release@83343 skinning-1-merge@83714 -> releaseSteven Bennetts
QAR-424
2008-03-04svn merge -r 81304:81392 ↵Josh Bell
svn+ssh://svn.lindenlab.com/svn/linden/branches/maint-ui-8-merge QAR-343 - merge maint-ui-7 and maint-ui-8 to release
2007-11-07merge svn+ssh://steve@svn/svn/linden/branches/viewer-cleanup-3 -r 73026:73079Steven Bennetts
2007-10-10svn merge -r71238:71367 svn+ssh://svn/svn/linden/branches/maint-ui-qa3Christian Goetze
2007-10-04Result of svn merge -r71162:71205 ↵Aaron Brashears
svn+ssh://svn/svn/linden/branches/new-license into release. only changes files which are not deployed or the comments section of code.
2007-02-09Result of svn merge -r57350:57790 ↵Aaron Brashears
svn+ssh://svn/svn/linden/branches/os-patches.001 into release.
2007-01-02Print done when done.James Cook