From d97f87b05fc39aeae2a4f7a5e9aadb9d92095c27 Mon Sep 17 00:00:00 2001 From: Siana Gearz Date: Fri, 11 Feb 2011 19:56:30 +0100 Subject: [PATCH] Grid currency, partial --- indra/llinventory/lltransactionflags.cpp | 8 +- indra/llui/llnotifications.cpp | 11 +- indra/llvfs/lldir.cpp | 10 +- indra/llvfs/lldir.h | 2 +- indra/newview/app_settings/settings.xml | 25 + indra/newview/hippogridmanager.cpp | 692 ++++++++++++++---- indra/newview/hippogridmanager.h | 149 ++-- indra/newview/hippopanelgrids.cpp | 2 +- indra/newview/llappviewer.cpp | 15 +- indra/newview/llassetuploadresponders.cpp | 3 + indra/newview/llcurrencyuimanager.cpp | 5 + indra/newview/llfirstuse.cpp | 5 + indra/newview/llfloaterabout.cpp | 4 + indra/newview/llfloateranimpreview.cpp | 4 +- indra/newview/llfloaterbuy.cpp | 3 + indra/newview/llfloaterbuycontents.cpp | 3 + indra/newview/llfloaterbuycurrency.cpp | 7 + indra/newview/llfloaterbuyland.cpp | 12 +- indra/newview/llfloatergodtools.cpp | 4 + indra/newview/llfloaterimagepreview.cpp | 4 +- indra/newview/llfloaterland.cpp | 6 +- indra/newview/llfloaternamedesc.cpp | 3 + indra/newview/llfloaterpostcard.cpp | 9 +- indra/newview/llfloaterproperties.cpp | 4 + indra/newview/llfloatersellland.cpp | 4 + indra/newview/llfloatersnapshot.cpp | 5 + indra/newview/llgivemoney.cpp | 25 +- indra/newview/llhoverview.cpp | 6 +- indra/newview/llnotify.cpp | 7 +- indra/newview/llpanelaudioprefs.cpp | 4 + indra/newview/llpanelclassified.cpp | 5 + indra/newview/llpaneldirfind.cpp | 192 +++-- indra/newview/llpaneldirfind.h | 4 +- indra/newview/llpaneldirgroups.cpp | 2 +- indra/newview/llpaneldirland.cpp | 17 + indra/newview/llpanelgroupgeneral.cpp | 13 +- indra/newview/llpanelgrouplandmoney.cpp | 29 +- indra/newview/llpanelinventory.cpp | 7 +- indra/newview/llpanelland.cpp | 3 + indra/newview/llpanelpermissions.cpp | 24 +- indra/newview/llpanelplace.cpp | 3 + indra/newview/llprefsim.cpp | 15 +- indra/newview/llstartup.cpp | 2 - indra/newview/llstatusbar.cpp | 13 +- indra/newview/llviewermenu.cpp | 16 +- indra/newview/llviewermessage.cpp | 22 +- indra/newview/llworldmap.cpp | 7 +- indra/newview/llxmlrpctransaction.cpp | 16 +- .../default/xui/en-us/floater_about_land.xml | 6 +- .../xui/en-us/floater_animation_preview.xml | 2 +- .../xui/en-us/floater_buy_contents.xml | 2 +- .../xui/en-us/floater_buy_currency.xml | 14 +- .../default/xui/en-us/floater_buy_land.xml | 20 +- .../default/xui/en-us/floater_buy_object.xml | 2 +- .../xui/en-us/floater_chat_history.xml | 2 +- .../default/xui/en-us/floater_directory.xml | 8 +- .../default/xui/en-us/floater_god_tools.xml | 2 +- .../default/xui/en-us/floater_group_info.xml | 657 ----------------- .../xui/en-us/floater_image_preview.xml | 2 +- .../default/xui/en-us/floater_import.xml | 2 +- .../floater_inventory_item_properties.xml | 2 +- .../xui/en-us/floater_name_description.xml | 2 +- .../default/xui/en-us/floater_postcard.xml | 4 +- .../xui/en-us/floater_price_for_listing.xml | 2 +- .../default/xui/en-us/floater_sell_land.xml | 4 +- .../default/xui/en-us/floater_snapshot.xml | 4 +- .../xui/en-us/floater_sound_preview.xml | 2 +- .../skins/default/xui/en-us/floater_tools.xml | 10 +- .../xui/en-us/floater_upload_browser.xml | 2 +- .../skins/default/xui/en-us/menu_viewer.xml | 10 +- .../skins/default/xui/en-us/notifications.xml | 54 +- .../xui/en-us/panel_avatar_classified.xml | 2 +- .../default/xui/en-us/panel_classified.xml | 2 +- .../skins/default/xui/en-us/panel_friends.xml | 2 +- .../default/xui/en-us/panel_group_general.xml | 8 +- .../xui/en-us/panel_group_land_money.xml | 4 +- .../skins/default/xui/en-us/panel_place.xml | 4 +- .../default/xui/en-us/panel_place_small.xml | 4 +- .../xui/en-us/panel_preferences_audio.xml | 4 +- .../xui/en-us/panel_preferences_general.xml | 2 +- .../default/xui/en-us/panel_status_bar.xml | 10 +- .../skins/default/xui/en-us/strings.xml | 6 +- 82 files changed, 1164 insertions(+), 1130 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en-us/floater_group_info.xml diff --git a/indra/llinventory/lltransactionflags.cpp b/indra/llinventory/lltransactionflags.cpp index e0f87aa7d..41b3dc84d 100644 --- a/indra/llinventory/lltransactionflags.cpp +++ b/indra/llinventory/lltransactionflags.cpp @@ -36,6 +36,8 @@ #include "lluuid.h" #include "lltransactionflags.h" #include "lltransactiontypes.h" + +#include "../newview/hippogridmanager.h" const U8 TRANSACTION_FLAGS_NONE = 0; const U8 TRANSACTION_FLAG_SOURCE_GROUP = 1; @@ -114,7 +116,7 @@ std::string build_transfer_message_to_source( std::ostringstream ostr; if(dest_id.isNull()) { - ostr << "You paid L$" << amount; + ostr << "You paid " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << amount; switch(transaction_type) { case TRANS_GROUP_CREATE: @@ -132,7 +134,7 @@ std::string build_transfer_message_to_source( } else { - ostr << "You paid " << dest_name << " L$" << amount; + ostr << "You paid " << dest_name << ' ' << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << amount; append_reason(ostr, transaction_type, description); } ostr << "."; @@ -160,7 +162,7 @@ std::string build_transfer_message_to_destination( return description; } std::ostringstream ostr; - ostr << source_name << " paid you L$" << amount; + ostr << source_name << " paid you " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << amount; append_reason(ostr, transaction_type, description); ostr << "."; return ostr.str(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index ef0de48cd..dbae679ff 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -37,6 +37,8 @@ #include "llnotifications.h" +#include "../newview/hippogridmanager.h" + #include #if LL_MSVC #pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" @@ -605,7 +607,14 @@ void LLNotification::init(const std::string& template_name, const LLSD& form_ele // add default substitutions // TODO: change this to read from the translatable strings file! - mSubstitutions["SECOND_LIFE"] = "Second Life"; + mSubstitutions["[SECOND_LIFE]"] = "Second Life"; + mSubstitutions["[VIEWER_NAME]"] = LLNotifications::instance().getGlobalString("VIEWER_NAME"); + mSubstitutions["[VIEWER_SITE]"] = LLNotifications::instance().getGlobalString("VIEWER_SITE"); + + mSubstitutions["[GRID_NAME]"] = gHippoGridManager->getConnectedGrid()->getGridName(); + mSubstitutions["[GRID_SITE]"] = gHippoGridManager->getConnectedGrid()->getWebSite(); + mSubstitutions["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + mSubstitutions["_URL"] = getURL(); mSubstitutions["_NAME"] = template_name; // TODO: something like this so that a missing alert is sensible: diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 8af709311..3f8b48b64 100644 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -579,7 +579,7 @@ void LLDir::setChatLogsDir(const std::string &path) } } -void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string &last) +void LLDir::setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last) { // if both first and last aren't set, assume we're grabbing the cached dir if (!first.empty() && !last.empty()) @@ -595,6 +595,14 @@ void LLDir::setPerAccountChatLogsDir(const std::string &first, const std::string mPerAccountChatLogsDir += firstlower; mPerAccountChatLogsDir += "_"; mPerAccountChatLogsDir += lastlower; + + if (!grid.empty()) + { + std::string gridlower(grid); + LLStringUtil::toLower(gridlower); + mPerAccountChatLogsDir += "@"; + mPerAccountChatLogsDir += gridlower; + } } else { diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 9945fada6..99179567a 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -130,7 +130,7 @@ class LLDir static std::string getForbiddenFileChars(); virtual void setChatLogsDir(const std::string &path); // Set the chat logs dir to this user's dir - virtual void setPerAccountChatLogsDir(const std::string &first, const std::string &last); // Set the per user chat log directory. + virtual void setPerAccountChatLogsDir(const std::string &grid, const std::string &first, const std::string &last); // Set the per user chat log directory. virtual void setLindenUserDir(const std::string &first, const std::string &last); // Set the linden user dir to this user's dir virtual void setSkinFolder(const std::string &skin_folder); virtual bool setCacheDir(const std::string &path); diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3f2a9b750..4d1c1d76e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8,6 +8,18 @@ settings_sh.xml settings_rlv.xml + + LastSelectedGrid + + Comment + Last grid selected from the grid pulldown + Persist + 1 + Type + String + Value + + CheckForGridUpdates @@ -10007,6 +10019,19 @@ Value http://search.secondlife.com/client_search.php? + SearchURLDefaultOpenSim + + Comment + URL to load for empty OpenSim searches + Persist + 1 + HideFromEditor + 0 + Type + String + Value + http://webi.metaverseink.com/opensim/results.jsp? + SearchURLQuery Comment diff --git a/indra/newview/hippogridmanager.cpp b/indra/newview/hippogridmanager.cpp index c681c1822..8bd04972a 100644 --- a/indra/newview/hippogridmanager.cpp +++ b/indra/newview/hippogridmanager.cpp @@ -1,19 +1,19 @@ +// Ported to Imprudence from the Hippo OpenSim Viewer by Jacek Antonelli + #include "llviewerprecompiledheaders.h" #include "hippogridmanager.h" #include -#include -#include -#include #include -#include "lldir.h" -#include "lleconomy.h" -#include "llerror.h" -#include "llfile.h" -#include "llhttpclient.h" -#include "llsdserialize.h" +#include +#include +#include +#include +#include +#include +#include "lltrans.h" #include "llviewercontrol.h" #include "llweb.h" @@ -23,7 +23,7 @@ // ******************************************************************** // Global Variables -HippoGridManager *gHippoGridManager = 0; +HippoGridManager* gHippoGridManager = 0; HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); @@ -39,82 +39,352 @@ HippoGridInfo HippoGridInfo::FALLBACK_GRIDINFO(""); // ******************************************************************** // Initialize -HippoGridInfo::HippoGridInfo(const std::string &gridNick) : - mPlatform(PLATFORM_OTHER), +HippoGridInfo::HippoGridInfo(const std::string& gridNick) : + mPlatform(PLATFORM_OPENSIM), mGridNick(gridNick), + mGridName(LLStringUtil::null), + mLoginUri(LLStringUtil::null), + mLoginPage(LLStringUtil::null), + mHelperUri(LLStringUtil::null), + mWebSite(LLStringUtil::null), + mSupportUrl(LLStringUtil::null), + mRegisterUrl(LLStringUtil::null), + mPasswordUrl(LLStringUtil::null), + mSearchUrl(LLStringUtil::null), + mFirstName(LLStringUtil::null), + mLastName(LLStringUtil::null), + mAvatarPassword(LLStringUtil::null), + mXmlState(XML_VOID), mVoiceConnector("SLVoice"), mRenderCompat(true), mMaxAgentGroups(-1), - mVersion(0), mCurrencySymbol("OS$"), mRealCurrencySymbol("US$"), mDirectoryFee(30) { - cleanUpGridNick(mGridNick); + std::string nick = gridNick; + mGridNick = sanitizeGridNick( nick ); } +// ******************************************************************** +// Getters + +HippoGridInfo::Platform HippoGridInfo::getPlatform() +{ + return mPlatform; +} + +bool HippoGridInfo::isOpenSimulator() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_OPENSIM); +} + +bool HippoGridInfo::isSecondLife() const +{ + return (mPlatform == HippoGridInfo::PLATFORM_SECONDLIFE); +} + +const std::string& HippoGridInfo::getGridNick() const +{ + return mGridNick; +} + +const std::string& HippoGridInfo::getGridName() const +{ + return mGridName; +} + +const std::string& HippoGridInfo::getLoginUri() const +{ + return mLoginUri; +} + +const std::string& HippoGridInfo::getLoginPage() const +{ + return mLoginPage; +} + +const std::string& HippoGridInfo::getHelperUri() const +{ + return mHelperUri; +} + +const std::string& HippoGridInfo::getWebSite() const +{ + return mWebSite; +} + +const std::string& HippoGridInfo::getSupportUrl() const +{ + return mSupportUrl; +} + +const std::string& HippoGridInfo::getRegisterUrl() const +{ + return mRegisterUrl; +} + +const std::string& HippoGridInfo::getPasswordUrl() const +{ + return mPasswordUrl; +} + +const std::string& HippoGridInfo::getSearchUrl() const +{ + return mSearchUrl; +} + +const std::string& HippoGridInfo::getFirstName() const +{ + return mFirstName; +} + +const std::string& HippoGridInfo::getLastName() const +{ + return mLastName; +} + +const std::string& HippoGridInfo::getAvatarPassword() const +{ + return mAvatarPassword; +} + +bool HippoGridInfo::isRenderCompat() const +{ + return mRenderCompat; +} + +const std::string& HippoGridInfo::getCurrencySymbol() const +{ + return mCurrencySymbol; +} + +const std::string& HippoGridInfo::getRealCurrencySymbol() const +{ + return mRealCurrencySymbol; +} + + + +// ******************************************************************** +// Setters + void HippoGridInfo::setPlatform(Platform platform) { mPlatform = platform; - if (mPlatform == PLATFORM_SECONDLIFE) mCurrencySymbol = "L$"; + if (mPlatform == PLATFORM_SECONDLIFE) + { + mCurrencySymbol = "L$"; + } } -void HippoGridInfo::setPlatform(const std::string &platform) +void HippoGridInfo::setPlatform(const std::string& platform) { std::string tmp = platform; for (unsigned i=0; imXmlState = XML_GRIDNICK; else if (strcasecmp(name, "gridname") == 0) @@ -135,48 +405,57 @@ void HippoGridInfo::onXmlElementStart(void *userData, const XML_Char *name, cons self->mXmlState = XML_REGISTER; else if (strcasecmp(name, "password") == 0) self->mXmlState = XML_PASSWORD; - //else if (strcasecmp(name, "search") == 0) - //self->mXmlState = XML_SEARCH; + else if (strcasecmp(name, "search") == 0) + self->mXmlState = XML_SEARCH; } //static -void HippoGridInfo::onXmlElementEnd(void *userData, const XML_Char *name) +void HippoGridInfo::onXmlElementEnd(void* userData, const XML_Char* name) { - HippoGridInfo *self = (HippoGridInfo*)userData; + HippoGridInfo* self = (HippoGridInfo*)userData; self->mXmlState = XML_VOID; } //static -void HippoGridInfo::onXmlCharacterData(void *userData, const XML_Char *s, int len) +void HippoGridInfo::onXmlCharacterData(void* userData, const XML_Char* s, int len) { - HippoGridInfo *self = (HippoGridInfo*)userData; - switch (self->mXmlState) { - - case XML_GRIDNICK: + HippoGridInfo* self = (HippoGridInfo*)userData; + switch (self->mXmlState) + { + case XML_GRIDNICK: + { if (self->mGridNick == "") self->mGridNick.assign(s, len); - cleanUpGridNick(self->mGridNick); - break; - - case XML_PLATFORM: { - std::string platform(s, len); - self->setPlatform(platform); + self->mGridNick = sanitizeGridNick(self->mGridNick); break; } - case XML_LOGINURI: - self->mLoginUri.assign(s, len); - cleanUpUri(self->mLoginUri); + case XML_PLATFORM: + { + std::string platform(s, len); + self->setPlatform(platform); break; + } - case XML_HELPERURI: - self->mHelperUri.assign(s, len); - cleanUpUri(self->mHelperUri); + case XML_LOGINURI: + { + std::string loginuri(s, len); + self->mLoginUri = sanitizeUri( loginuri ); break; + } - case XML_SEARCH: - //self->mSearchUrl.assign(s, len); - //cleanUpQueryUrl(mSearchUrl); + case XML_HELPERURI: + { + std::string helperuri(s, len); + self->mHelperUri = sanitizeUri( helperuri ); break; + } + + case XML_SEARCH: + { + self->mSearchUrl.assign(s, len); + //sanitizeQueryUrl(mSearchUrl); + break; + } case XML_GRIDNAME: self->mGridName.assign(s, len); break; case XML_LOGINPAGE: self->mLoginPage.assign(s, len); break; @@ -212,7 +491,8 @@ bool HippoGridInfo::retrieveGridInfo() XML_SetElementHandler(parser, onXmlElementStart, onXmlElementEnd); XML_SetCharacterDataHandler(parser, onXmlCharacterData); mXmlState = XML_VOID; - if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) { + if (!XML_Parse(parser, reply.data(), reply.size(), TRUE)) + { llwarns << "XML Parse Error: " << XML_ErrorString(XML_GetErrorCode(parser)) << llendl; success = false; } @@ -240,15 +520,18 @@ std::string HippoGridInfo::getDirectoryFee() const { std::string fee; formatFee(fee, mDirectoryFee, true); - if (fee != "free") fee += "/week"; + if (fee != LLTrans::getString("hippo_label_free")) fee += "/" + LLTrans::getString("hippo_label_week"); return fee; } void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const { - if (showFree && (cost == 0)) { - fee = "free"; - } else { + if (showFree && (cost == 0)) + { + fee = LLTrans::getString("hippo_label_free"); + } + else + { fee = llformat("%s%d", getCurrencySymbol().c_str(), cost); } } @@ -258,9 +541,10 @@ void HippoGridInfo::formatFee(std::string &fee, int cost, bool showFree) const // Static Helpers // static -const char *HippoGridInfo::getPlatformString(Platform platform) +const char* HippoGridInfo::getPlatformString(Platform platform) { - static const char *platformStrings[PLATFORM_LAST] = { + static const char* platformStrings[PLATFORM_LAST] = + { "Other", "OpenSim", "SecondLife" }; @@ -271,39 +555,49 @@ const char *HippoGridInfo::getPlatformString(Platform platform) // static -void HippoGridInfo::cleanUpGridNick(std::string &gridnick) +std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) { std::string tmp; int size = gridnick.size(); - for (int i=0; i::iterator it, end = mGridInfo.end(); - for (it=mGridInfo.begin(); it != end; ++it) { + for (it=mGridInfo.begin(); it != end; ++it) + { delete it->second; } mGridInfo.clear(); @@ -351,42 +649,82 @@ void HippoGridManager::init() } +void HippoGridManager::discardAndReload() +{ + cleanup(); + loadFromFile(); +} + + // ******************************************************************** // Public Access -HippoGridInfo *HippoGridManager::getGrid(const std::string &grid) const +HippoGridInfo* HippoGridManager::getGrid(const std::string& grid) const { std::map::const_iterator it; it = mGridInfo.find(grid); - if (it != mGridInfo.end()) { + if (it != mGridInfo.end()) + { return it->second; - } else { + } + else + { return 0; } } -HippoGridInfo *HippoGridManager::getCurrentGrid() const +HippoGridInfo* HippoGridManager::getConnectedGrid() const { - HippoGridInfo *grid = getGrid(mCurrentGrid); - if (grid) { + return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); +} + + +HippoGridInfo* HippoGridManager::getCurrentGrid() const +{ + HippoGridInfo* grid = getGrid(mCurrentGrid); + if (grid) + { return grid; - } else { + } + else + { return &HippoGridInfo::FALLBACK_GRIDINFO; } } +const std::string& HippoGridManager::getDefaultGridNick() const +{ + return mDefaultGrid; +} -void HippoGridManager::addGrid(HippoGridInfo *grid) +const std::string& HippoGridManager::getCurrentGridNick() const +{ + if (mCurrentGrid.empty()) + { + return mDefaultGrid; + } + return mCurrentGrid; +} + +void HippoGridManager::setCurrentGridAsConnected() +{ + mConnectedGrid = getCurrentGrid(); +} + + +void HippoGridManager::addGrid(HippoGridInfo* grid) { if (!grid) return; - const std::string &nick = grid->getGridNick(); - if (nick == "") { + const std::string& nick = grid->getGridNick(); + if (nick == "") + { llwarns << "Ignoring to try adding grid with empty nick." << llendl; delete grid; return; } - if (mGridInfo.find(nick) != mGridInfo.end()) { + if (mGridInfo.find(nick) != mGridInfo.end()) + { llwarns << "Ignoring to try adding existing grid " << nick << '.' << llendl; delete grid; return; @@ -395,7 +733,7 @@ void HippoGridManager::addGrid(HippoGridInfo *grid) } -void HippoGridManager::deleteGrid(const std::string &grid) +void HippoGridManager::deleteGrid(const std::string& grid) { GridIterator it = mGridInfo.find(grid); if (it == mGridInfo.end()) { @@ -406,35 +744,45 @@ void HippoGridManager::deleteGrid(const std::string &grid) llinfos << "Number of grids now: " << mGridInfo.size() << llendl; if (mGridInfo.empty()) llinfos << "Grid info map is empty." << llendl; if (grid == mDefaultGrid) - setDefaultGrid(""); // sets first grid, if map not empty + setDefaultGrid(LLStringUtil::null); // sets first grid, if map not empty if (grid == mCurrentGrid) mCurrentGrid = mDefaultGrid; } -void HippoGridManager::setDefaultGrid(const std::string &grid) +void HippoGridManager::setDefaultGrid(const std::string& grid) { GridIterator it = mGridInfo.find(grid); - if (it != mGridInfo.end()) { + if (it != mGridInfo.end()) + { mDefaultGrid = grid; - } else if (mGridInfo.find("secondlife") != mGridInfo.end()) { + } + else if (mGridInfo.find("secondlife") != mGridInfo.end()) + { mDefaultGrid = "secondlife"; - } else if (!mGridInfo.empty()) { - mDefaultGrid = mGridInfo.begin()->first; - } else { + } + else if (!mGridInfo.empty()) + { + mDefaultGrid = mGridInfo.begin()->first; + } + else + { mDefaultGrid = ""; } } -void HippoGridManager::setCurrentGrid(const std::string &grid) +void HippoGridManager::setCurrentGrid(const std::string& grid) { GridIterator it = mGridInfo.find(grid); - if (it != mGridInfo.end()) { + if (it != mGridInfo.end()) + { mCurrentGrid = grid; - } else if (!mGridInfo.empty()) { + } + else if (!mGridInfo.empty()) + { llwarns << "Unknown grid '" << grid << "'. Setting to default grid." << llendl; - mCurrentGrid = mDefaultGrid; + mCurrentGrid = mDefaultGrid; } } @@ -444,20 +792,23 @@ void HippoGridManager::setCurrentGrid(const std::string &grid) void HippoGridManager::loadFromFile() { + mDefaultGridsVersion = 0; // load user grid info parseFile(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"), false); // merge default grid info, if newer. Force load, if list of grids is empty. parseFile(gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "default_grids.xml"), !mGridInfo.empty()); // merge grid info from web site, if newer. Force load, if list of grids is empty. if (gSavedSettings.getBOOL("CheckForGridUpdates")) - parseUrl("http://opensim-viewer.sourceforge.net/db/grids.php", !mGridInfo.empty()); + parseUrl(gSavedSettings.getString("GridUpdateList"), !mGridInfo.empty()); - setDefaultGrid(gSavedSettings.getString("DefaultGrid")); - setCurrentGrid(gSavedSettings.getString("CmdLineGridChoice")); + std::string last_grid = gSavedSettings.getString("LastSelectedGrid"); + if (last_grid.empty()) last_grid = gSavedSettings.getString("DefaultGrid"); + setDefaultGrid(last_grid); + setCurrentGrid(last_grid); } -void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer) +void HippoGridManager::parseUrl(const std::string url, bool mergeIfNewer) { llinfos << "Loading grid info from '" << url << "'." << llendl; @@ -467,7 +818,8 @@ void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer) // check response, return on error S32 status = response["status"].asInteger(); - if ((status != 200) || !response["body"].isArray()) { + if ((status != 200) || !response["body"].isArray()) + { llinfos << "GridInfo Update failed (" << status << "): " << (response["body"].isString()? response["body"].asString(): "") << llendl; @@ -478,18 +830,20 @@ void HippoGridManager::parseUrl(const char *url, bool mergeIfNewer) parseData(gridInfo, mergeIfNewer); } -void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer) +void HippoGridManager::parseFile(const std::string& fileName, bool mergeIfNewer) { llifstream infile; infile.open(fileName.c_str()); - if(!infile.is_open()) { + if (!infile.is_open()) + { llwarns << "Cannot find grid info file " << fileName << " to load." << llendl; return; } LLSD gridInfo; - if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) { - llwarns << "Unable to parse grid info file " << fileName << '.' << llendl; + if (LLSDSerialize::fromXML(gridInfo, infile) <= 0) + { + llwarns << "Unable to parse grid info file " << fileName << '.' << llendl; return; } @@ -500,46 +854,66 @@ void HippoGridManager::parseFile(const std::string &fileName, bool mergeIfNewer) void HippoGridManager::parseData(LLSD &gridInfo, bool mergeIfNewer) { + if (mergeIfNewer) + { + LLSD::array_const_iterator it, end = gridInfo.endArray(); + for (it = gridInfo.beginArray(); it != end; ++it) + { + LLSD gridMap = *it; + if (gridMap.has("default_grids_version")) + { + int version = gridMap["default_grids_version"]; + if (version <= mDefaultGridsVersion) return; + else break; + } + } + if (it == end) + { + llwarns << "Grid data has no version number." << llendl; + return; + } + } + + llinfos << "Loading grid data." << llendl; + LLSD::array_const_iterator it, end = gridInfo.endArray(); - for (it = gridInfo.beginArray(); it != end; ++it) { + for (it = gridInfo.beginArray(); it != end; ++it) + { LLSD gridMap = *it; - if (gridMap.has("gridnick") && gridMap.has("loginuri")) { + if (gridMap.has("default_grids_version")) + { + mDefaultGridsVersion = gridMap["default_grids_version"]; + } + else if (gridMap.has("gridnick") && gridMap.has("loginuri")) + { std::string gridnick = gridMap["gridnick"]; - HippoGridInfo *grid; + HippoGridInfo* grid; GridIterator it = mGridInfo.find(gridnick); bool newGrid = (it == mGridInfo.end()); - if (gridMap.has("version")) { - int version = gridMap["version"]; - if (version == -1) { - // delete grid - if (!newGrid) mGridInfo.erase(it); - continue; - } else if (mergeIfNewer && !newGrid && (version <= it->second->getVersion())) { - // don't update if version is not newer - continue; - } - } - if (newGrid) { + if (newGrid) + { // create new grid info grid = new HippoGridInfo(gridnick); - } else { + } + else + { // update existing grid info grid = it->second; } grid->setLoginUri(gridMap["loginuri"]); if (gridMap.has("platform")) grid->setPlatform(gridMap["platform"]); if (gridMap.has("gridname")) grid->setGridName(gridMap["gridname"]); - if (gridMap.has("lastlogin_fname")) grid->setLastFName(gridMap["lastlogin_fname"]); - if (gridMap.has("lastlogin_lname")) grid->setLastLName(gridMap["lastlogin_lname"]); if (gridMap.has("loginpage")) grid->setLoginPage(gridMap["loginpage"]); if (gridMap.has("helperuri")) grid->setHelperUri(gridMap["helperuri"]); if (gridMap.has("website")) grid->setWebSite(gridMap["website"]); if (gridMap.has("support")) grid->setSupportUrl(gridMap["support"]); if (gridMap.has("register")) grid->setRegisterUrl(gridMap["register"]); if (gridMap.has("password")) grid->setPasswordUrl(gridMap["password"]); - //if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]); + if (gridMap.has("search")) grid->setSearchUrl(gridMap["search"]); if (gridMap.has("render_compat")) grid->setRenderCompat(gridMap["render_compat"]); - if (gridMap.has("version")) grid->setVersion(gridMap["version"]); + // if (gridMap.has("firstname")) grid->setFirstName(gridMap["firstname"]); + // if (gridMap.has("lastname")) grid->setLastName(gridMap["lastname"]); + // if (gridMap.has("avatarpassword")) grid->setAvatarPassword(gridMap["avatarpassword"]); if (newGrid) addGrid(grid); } } @@ -553,15 +927,17 @@ void HippoGridManager::saveFile() // build LLSD LLSD gridInfo; - S32 i = 0; + gridInfo[0]["default_grids_version"] = mDefaultGridsVersion; + + // add grids + S32 i = 1; GridIterator it, end = mGridInfo.end(); - for (it = mGridInfo.begin(); it != end; ++it, i++) { - HippoGridInfo *grid = it->second; + for (it = mGridInfo.begin(); it != end; ++it, i++) + { + HippoGridInfo* grid = it->second; gridInfo[i]["gridnick"] = grid->getGridNick(); gridInfo[i]["platform"] = HippoGridInfo::getPlatformString(grid->getPlatform()); gridInfo[i]["gridname"] = grid->getGridName(); - if (!grid->getLastFName().empty()) gridInfo[i]["lastlogin_fname"] = grid->getLastFName(); - if (!grid->getLastLName().empty()) gridInfo[i]["lastlogin_lname"] = grid->getLastLName(); gridInfo[i]["loginuri"] = grid->getLoginUri(); gridInfo[i]["loginpage"] = grid->getLoginPage(); gridInfo[i]["helperuri"] = grid->getHelperUri(); @@ -569,20 +945,26 @@ void HippoGridManager::saveFile() gridInfo[i]["support"] = grid->getSupportUrl(); gridInfo[i]["register"] = grid->getRegisterUrl(); gridInfo[i]["password"] = grid->getPasswordUrl(); - //gridInfo[i]["search"] = grid->getSearchUrl(); + // gridInfo[i]["firstname"] = grid->getFirstName(); + // gridInfo[i]["lastname"] = grid->getLastName(); + // gridInfo[i]["avatarpassword"] = grid->getAvatarPassword(); + + gridInfo[i]["search"] = grid->getSearchUrl(); gridInfo[i]["render_compat"] = grid->isRenderCompat(); - gridInfo[i]["version"] = grid->getVersion(); } // write client grid info file - std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grids_sg1.xml"); + std::string fileName = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "grid_info.xml"); llofstream file; file.open(fileName.c_str()); - if (file.is_open()) { + if (file.is_open()) + { LLSDSerialize::toPrettyXML(gridInfo, file); file.close(); llinfos << "Saved grids to " << fileName << llendl; - } else { + } + else + { llerrs << "Unable to open grid info file: " << fileName << llendl; } } diff --git a/indra/newview/hippogridmanager.h b/indra/newview/hippogridmanager.h index c19a8b8d4..8429dbaf6 100644 --- a/indra/newview/hippogridmanager.h +++ b/indra/newview/hippogridmanager.h @@ -8,10 +8,11 @@ #ifndef XML_STATIC #define XML_STATIC #endif + #ifdef LL_STANDALONE -# include "expat.h" +#include #else -# include +#include "expat/expat.h" #endif class LLSD; @@ -19,7 +20,6 @@ class LLSD; class HippoGridInfo { - LOG_CLASS(HippoGridInfo); public: enum Platform { PLATFORM_OTHER = 0, @@ -33,62 +33,63 @@ public: SEARCH_ALL_TEMPLATE }; - explicit HippoGridInfo(const std::string &gridNick); + explicit HippoGridInfo(const std::string& gridNick); - Platform getPlatform() const { return mPlatform; } - const std::string &getGridNick() const { return mGridNick; } - const std::string &getGridName() const { return mGridName; } - const std::string &getLastFName() const { return mLastFName; } - const std::string &getLastLName() const { return mLastLName; } - const std::string &getLoginUri() const { return mLoginUri; } - const std::string &getLoginPage() const { return mLoginPage; } - const std::string &getHelperUri() const { return mHelperUri; } - const std::string &getWebSite() const { return mWebSite; } - const std::string &getSupportUrl() const { return mSupportUrl; } - const std::string &getRegisterUrl() const { return mRegisterUrl; } - const std::string &getPasswordUrl() const { return mPasswordUrl; } - const std::string &getSearchUrl() const { return mSearchUrl; } - const std::string &getVoiceConnector() const { return mVoiceConnector; } - std::string getSearchUrl(SearchType ty) const; - bool isRenderCompat() const { return mRenderCompat; } + Platform getPlatform(); + bool isOpenSimulator() const; + bool isSecondLife() const; + const std::string& getGridNick() const; + const std::string& getGridName() const; + const std::string& getLoginUri() const; + const std::string& getLoginPage() const; + const std::string& getHelperUri() const; + const std::string& getWebSite() const; + const std::string& getSupportUrl() const; + const std::string& getRegisterUrl() const; + const std::string& getPasswordUrl() const; + // Returns the url base used for the Web Search tab + const std::string& getSearchUrl() const; + const std::string& getFirstName() const; + const std::string& getLastName() const; + const std::string& getAvatarPassword() const; + const std::string& getVoiceConnector() const { return mVoiceConnector; } + std::string getSearchUrl(SearchType ty, bool is_web) const; + bool isRenderCompat() const; int getMaxAgentGroups() const { return mMaxAgentGroups; } - int getVersion() const { return mVersion; } - const std::string &getCurrencySymbol() const { return mCurrencySymbol; } - const std::string &getRealCurrencySymbol() const { return mRealCurrencySymbol; } - std::string getUploadFee() const; - std::string getGroupCreationFee() const; - std::string getDirectoryFee() const; + const std::string& getCurrencySymbol() const; + const std::string& getRealCurrencySymbol() const; + std::string getUploadFee() const; + std::string getGroupCreationFee() const; + std::string getDirectoryFee() const; - bool isOpenSimulator() const { return (mPlatform == PLATFORM_OPENSIM ); } - bool isSecondLife() const { return (mPlatform == PLATFORM_SECONDLIFE); } - - void setPlatform (const std::string &platform); - void setPlatform (Platform platform); - void setGridName (const std::string &gridName) { mGridName = gridName; } - void setLastFName (const std::string &firstName) { mLastFName = firstName; } - void setLastLName (const std::string &lastName) { mLastLName = lastName; } - void setLoginUri (const std::string &loginUri) { mLoginUri = loginUri; cleanUpUri(mLoginUri); } - void setLoginPage (const std::string &loginPage) { mLoginPage = loginPage; } - void setHelperUri (const std::string &helperUri) { mHelperUri = helperUri; cleanUpUri(mHelperUri); } - void setWebSite (const std::string &website) { mWebSite = website; } - void setSupportUrl (const std::string &url) { mSupportUrl = url; } - void setRegisterUrl(const std::string &url) { mRegisterUrl = url; } - void setPasswordUrl(const std::string &url) { mPasswordUrl = url; } - void setSearchUrl (const std::string &url) { mSearchUrl = url; } - void setRenderCompat(bool compat) { mRenderCompat = compat; } + void setPlatform (const std::string& platform); + void setPlatform (Platform platform); + void setGridName (const std::string& gridName); + void setLoginUri (const std::string& loginUri); + void setLoginPage(const std::string& loginPage); + void setHelperUri(const std::string& helperUri); + void setWebSite (const std::string& website); + void setSupportUrl(const std::string& url); + void setRegisterUrl(const std::string& url); + void setPasswordUrl(const std::string& url); + // sets the url base used for the Web Search tab + void setSearchUrl(const std::string& url); + void setRenderCompat(bool compat); void setMaxAgentGroups(int max) { mMaxAgentGroups = max; } - void setVersion(int version) { mVersion = version; } - void setVoiceConnector(const std::string &vc) { mVoiceConnector = vc; } + void setFirstName(const std::string& firstName); + void setLastName(const std::string& lastName); + void setAvatarPassword(const std::string& avatarPassword); + void setVoiceConnector(const std::string& vc) { mVoiceConnector = vc; } - void setCurrencySymbol(const std::string &sym) { mCurrencySymbol = sym.substr(0, 3); } - void setRealCurrencySymbol(const std::string &sym) { mRealCurrencySymbol = sym.substr(0, 3); } - void setDirectoryFee(int fee) { mDirectoryFee = fee; } + void setCurrencySymbol(const std::string& sym); + void setRealCurrencySymbol(const std::string& sym); + void setDirectoryFee(int fee); bool retrieveGridInfo(); - static const char *getPlatformString(Platform platform); - static void cleanUpGridNick(std::string &gridnick); + static const char* getPlatformString(Platform platform); + static std::string sanitizeGridNick(std::string &gridnick); static HippoGridInfo FALLBACK_GRIDINFO; static void initFallback(); @@ -97,8 +98,6 @@ private: Platform mPlatform; std::string mGridNick; std::string mGridName; - std::string mLastFName; - std::string mLastLName; std::string mLoginUri; std::string mLoginPage; std::string mHelperUri; @@ -108,53 +107,56 @@ private: std::string mPasswordUrl; std::string mSearchUrl; std::string mVoiceConnector; + std::string mFirstName; + std::string mLastName; + std::string mAvatarPassword; bool mRenderCompat; int mMaxAgentGroups; - int mVersion; std::string mCurrencySymbol; std::string mRealCurrencySymbol; int mDirectoryFee; // for parsing grid info XML - enum XmlState { + enum XmlState + { XML_VOID, XML_GRIDNICK, XML_PLATFORM, XML_GRIDNAME, XML_LOGINURI, XML_LOGINPAGE, XML_HELPERURI, XML_WEBSITE, XML_SUPPORT, XML_REGISTER, XML_PASSWORD, XML_SEARCH }; XmlState mXmlState; - static void cleanUpUri(std::string &uri); + static std::string sanitizeUri(std::string &uri); void formatFee(std::string &fee, int cost, bool showFree) const; - static void onXmlElementStart(void *userData, const XML_Char *name, const XML_Char **atts); - static void onXmlElementEnd(void *userData, const XML_Char *name); - static void onXmlCharacterData(void *userData, const XML_Char *s, int len); + static void onXmlElementStart(void* userData, const XML_Char* name, const XML_Char** atts); + static void onXmlElementEnd(void* userData, const XML_Char* name); + static void onXmlCharacterData(void* userData, const XML_Char* s, int len); }; class HippoGridManager { - LOG_CLASS(HippoGridManager); public: HippoGridManager(); ~HippoGridManager(); void init(); void saveFile(); + void discardAndReload(); - HippoGridInfo *getGrid(const std::string &grid) const; - HippoGridInfo *getConnectedGrid() const { return (mConnectedGrid)? mConnectedGrid: getCurrentGrid(); } - HippoGridInfo *getCurrentGrid() const; - const std::string &getDefaultGridNick() const { return mDefaultGrid; } - const std::string &getCurrentGridNick() const { return mCurrentGrid; } + HippoGridInfo* getGrid(const std::string& grid) const; + HippoGridInfo* getConnectedGrid() const; + HippoGridInfo* getCurrentGrid() const; + const std::string& getDefaultGridNick() const; + const std::string& getCurrentGridNick() const; - void setDefaultGrid(const std::string &grid); - void setCurrentGrid(const std::string &grid); - void setCurrentGridAsConnected() { mConnectedGrid = getCurrentGrid(); } + void setDefaultGrid(const std::string& grid); + void setCurrentGrid(const std::string& grid); + void setCurrentGridAsConnected(); - void addGrid(HippoGridInfo *grid); - void deleteGrid(const std::string &grid); + void addGrid(HippoGridInfo* grid); + void deleteGrid(const std::string& grid); typedef std::map::iterator GridIterator; GridIterator beginGrid() { return mGridInfo.begin(); } @@ -164,17 +166,18 @@ private: std::map mGridInfo; std::string mDefaultGrid; std::string mCurrentGrid; - HippoGridInfo *mConnectedGrid; + HippoGridInfo* mConnectedGrid; + int mDefaultGridsVersion; void cleanup(); void loadFromFile(); - void parseFile(const std::string &fileName, bool mergeIfNewer); - void parseUrl(const char *url, bool mergeIfNewer); + void parseFile(const std::string& fileName, bool mergeIfNewer); + void parseUrl(const std::string url, bool mergeIfNewer); void parseData(LLSD &gridInfo, bool mergeIfNewer); }; -extern HippoGridManager *gHippoGridManager; +extern HippoGridManager* gHippoGridManager; #endif diff --git a/indra/newview/hippopanelgrids.cpp b/indra/newview/hippopanelgrids.cpp index 87e1fb151..e0c40731c 100644 --- a/indra/newview/hippopanelgrids.cpp +++ b/indra/newview/hippopanelgrids.cpp @@ -304,7 +304,7 @@ bool HippoPanelGridsImpl::saveCurGrid() // check nickname std::string gridnick = childGetValue("gridnick"); if (gridnick == "") gridnick = ""; - HippoGridInfo::cleanUpGridNick(gridnick); + HippoGridInfo::sanitizeGridNick(gridnick); childSetValue("gridnick", (gridnick != "")? gridnick: ""); if (gridnick == "") { LLNotifications::instance().add("GridsNoNick"); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index a89ed15ec..8ebb51e26 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -3133,9 +3133,6 @@ void LLAppViewer::badNetworkHandler() // Flush all of our caches on exit in the case of disconnect due to // invalid packets. - // - if(1) return; - // mPurgeOnExit = TRUE; @@ -3146,17 +3143,23 @@ void LLAppViewer::badNetworkHandler() LLAppViewer::handleSyncViewerCrash(); LLAppViewer::handleViewerCrash(); + std::string grid_support_msg = ""; + if (!gHippoGridManager->getCurrentGrid()->getSupportUrl().empty()) + { + grid_support_msg = "\n\nOr visit the gird support page at: \n " + + gHippoGridManager->getCurrentGrid()->getSupportUrl(); + } std::ostringstream message; message << "The viewer has detected mangled network data indicative\n" "of a bad upstream network connection or an incomplete\n" - "local installation of " << LLAppViewer::instance()->getSecondLifeTitle() << ". \n" + "local installation of " << gSecondLife << ". \n" " \n" "Try uninstalling and reinstalling to see if this resolves \n" "the issue. \n" " \n" - "If the problem continues, see the Tech Support FAQ at: \n" - "www.secondlife.com/support"; + "If the problem continues, please report the issue at: \n" + "http://www.singularityviewer.org" << grid_support_msg; forceDisconnect(message.str()); } diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 6437fa8a3..9bd12c618 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -63,6 +63,8 @@ #include "llscrolllistctrl.h" #include "llsdserialize.h" +#include "hippogridmanager.h" + // When uploading multiple files, don't display any of them when uploading more than this number. static const S32 FILE_COUNT_DISPLAY_THRESHOLD = 5; @@ -228,6 +230,7 @@ void LLNewAgentInventoryResponder::uploadComplete(const LLSD& content) LLSD args; args["AMOUNT"] = llformat("%d", expected_upload_cost); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotifications::instance().add("UploadPayment", args); } diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 86821249a..6b72cc922 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -47,6 +47,8 @@ #include "llxmlrpctransaction.h" #include "llviewernetwork.h" +#include "hippogridmanager.h" + const F64 CURRENCY_ESTIMATE_FREQUENCY = 2.0; // how long of a pause in typing a currency buy amount before an @@ -372,6 +374,7 @@ void LLCurrencyUIManager::Impl::updateUI() } mPanel.childShow("currency_action"); + mPanel.childSetTextArg("currency_action", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); LLLineEditor* lindenAmount = mPanel.getChild("currency_amt"); if (lindenAmount) @@ -478,7 +481,9 @@ void LLCurrencyUIManager::buy(const std::string& buy_msg) LLUIString msg = buy_msg; msg.setArg("[LINDENS]", llformat("%d", impl.mUserCurrencyBuy)); + msg.setArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); msg.setArg("[USD]", llformat("%#.2f", impl.mSiteCurrencyEstimatedCost / 100.0)); + msg.setArg("[REALCURRENCY]", gHippoGridManager->getConnectedGrid()->getRealCurrencySymbol()); LLConfirmationManager::confirm(impl.mSiteConfirm, msg, impl, diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index 0c7837ded..a0e43b404 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -47,6 +47,9 @@ #include "floatervoicelicense.h" #include "llstartup.h" +#include "hippogridmanager.h" + + // static std::set LLFirstUse::sConfigVariables; @@ -90,6 +93,7 @@ void LLFirstUse::useBalanceIncrease(S32 delta) LLSD args; args["AMOUNT"] = llformat("%d",delta); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotifications::instance().add("FirstBalanceIncrease", args); } } @@ -104,6 +108,7 @@ void LLFirstUse::useBalanceDecrease(S32 delta) LLSD args; args["AMOUNT"] = llformat("%d",-delta); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotifications::instance().add("FirstBalanceDecrease", args); } } diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 4b2047cfd..597a60fd1 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -60,6 +60,8 @@ #include "llglheaders.h" #include "llwindow.h" +#include "hippogridmanager.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -133,6 +135,8 @@ LLFloaterAbout::LLFloaterAbout() std::string support; support.append("\n\n"); + support.append("Grid: " + gHippoGridManager->getConnectedGrid()->getGridName() + + " (" + gHippoGridManager->getConnectedGrid()->getGridNick() + ")\n\n"); #if LL_MSVC support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER)); diff --git a/indra/newview/llfloateranimpreview.cpp b/indra/newview/llfloateranimpreview.cpp index e00cbd958..c8c259413 100644 --- a/indra/newview/llfloateranimpreview.cpp +++ b/indra/newview/llfloateranimpreview.cpp @@ -68,6 +68,8 @@ #include "lluictrlfactory.h" #include "llviewercontrol.h" +#include "hippogridmanager.h" + // #include "llinventorymodel.h" // gInventoryModel // @@ -194,7 +196,7 @@ BOOL LLFloaterAnimPreview::postBuild() childSetMaxValue("priority", 7); } - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); + childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn(); diff --git a/indra/newview/llfloaterbuy.cpp b/indra/newview/llfloaterbuy.cpp index a33cabc74..99c9fed5d 100644 --- a/indra/newview/llfloaterbuy.cpp +++ b/indra/newview/llfloaterbuy.cpp @@ -50,6 +50,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "hippogridmanager.h" + LLFloaterBuy* LLFloaterBuy::sInstance = NULL; LLFloaterBuy::LLFloaterBuy() @@ -184,6 +186,7 @@ void LLFloaterBuy::show(const LLSaleInfo& sale_info) // Add after columns added so appropriate heights are correct. object_list->addElement(row); + sInstance->childSetTextArg("buy_text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); sInstance->childSetTextArg("buy_text", "[NAME]", owner_name); diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 95a8caac5..e16f98dff 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -54,6 +54,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "hippogridmanager.h" + LLFloaterBuyContents* LLFloaterBuyContents::sInstance = NULL; LLFloaterBuyContents::LLFloaterBuyContents() @@ -129,6 +131,7 @@ void LLFloaterBuyContents::show(const LLSaleInfo& sale_info) } sInstance->childSetTextArg("contains_text", "[NAME]", node->mName); + sInstance->childSetTextArg("buy_text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); sInstance->childSetTextArg("buy_text", "[AMOUNT]", llformat("%d", sale_info.getSalePrice())); sInstance->childSetTextArg("buy_text", "[NAME]", owner_name); diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index cfbc5da76..5a6ea24cb 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -46,6 +46,8 @@ #include "llwindow.h" #include "llappviewer.h" +#include "hippogridmanager.h" + static const S32 STANDARD_BUY_AMOUNT = 2000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; @@ -263,9 +265,11 @@ void LLFloaterBuyCurrencyUI::updateUI() childSetVisible("buy_action", true); childSetTextArg("buy_action", "[NAME]", mTargetName); childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice)); + childSetTextArg("buy_action", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); } else { + childSetTextArg("buy_action_unknown", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetVisible("buy_action_unknown", true); } } @@ -274,16 +278,19 @@ void LLFloaterBuyCurrencyUI::updateUI() childShow("balance_label"); childShow("balance_amount"); childSetTextArg("balance_amount", "[AMT]", llformat("%d", balance)); + childSetTextArg("balance_amount", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); S32 buying = mManager.getAmount(); childShow("buying_label"); childShow("buying_amount"); childSetTextArg("buying_amount", "[AMT]", llformat("%d", buying)); + childSetTextArg("buying_amount", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); S32 total = balance + buying; childShow("total_label"); childShow("total_amount"); childSetTextArg("total_amount", "[AMT]", llformat("%d", total)); + childSetTextArg("total_amount", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetVisible("purchase_warning_repurchase", false); childSetVisible("purchase_warning_notenough", false); diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 29506e21d..8288c581c 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -66,6 +66,8 @@ #include "llviewernetwork.h" #include "roles_constants.h" +#include "hippogridmanager.h" + // NOTE: This is duplicated in lldatamoney.cpp ... const F32 GROUP_LAND_BONUS_FACTOR = 1.1f; const F64 CURRENCY_ESTIMATE_FREQUENCY = 0.5; @@ -1024,6 +1026,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelActualArea); string_args["[AMOUNT2]"] = llformat("%d", mParcelSupportedObjects); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); childSetText("info_size", getString("meters_supports_object", string_args)); @@ -1227,7 +1230,8 @@ void LLFloaterBuyLandUI::refreshUI() childSetText("purchase_action", llformat( - "Pay L$ %d to %s for this land", + "Pay %s %d to %s for this land", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), mParcelPrice, mParcelSellerName.c_str() )); @@ -1239,6 +1243,7 @@ void LLFloaterBuyLandUI::refreshUI() { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); childSetText("currency_reason", getString("have_enough_lindens", string_args)); } @@ -1247,6 +1252,7 @@ void LLFloaterBuyLandUI::refreshUI() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mAgentCashBalance); string_args["[AMOUNT2]"] = llformat("%d", mParcelPrice - mAgentCashBalance); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); childSetText("currency_reason", getString("not_enough_lindens", string_args)); @@ -1257,6 +1263,7 @@ void LLFloaterBuyLandUI::refreshUI() { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", finalBalance); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); childSetText("currency_balance", getString("balance_left", string_args)); @@ -1265,6 +1272,7 @@ void LLFloaterBuyLandUI::refreshUI() { LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice - mAgentCashBalance); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); childSetText("currency_balance", getString("balance_needed", string_args)); @@ -1331,6 +1339,7 @@ void LLFloaterBuyLandUI::startBuyPreConfirm() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mCurrency.getAmount()); string_args["[AMOUNT2]"] = llformat("%#.2f", mCurrency.getEstimate() / 100.0); + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); action += getString("buy_for_US", string_args); } @@ -1338,6 +1347,7 @@ void LLFloaterBuyLandUI::startBuyPreConfirm() LLStringUtil::format_map_t string_args; string_args["[AMOUNT]"] = llformat("%d", mParcelPrice); string_args["[SELLER]"] = mParcelSellerName; + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); action += getString("pay_to_for_land", string_args); diff --git a/indra/newview/llfloatergodtools.cpp b/indra/newview/llfloatergodtools.cpp index b3ac37474..f918e8a46 100644 --- a/indra/newview/llfloatergodtools.cpp +++ b/indra/newview/llfloatergodtools.cpp @@ -77,6 +77,8 @@ #include "lltransfertargetfile.h" #include "lltransfersourcefile.h" +#include "hippogridmanager.h" + const F32 SECONDS_BETWEEN_UPDATE_REQUESTS = 5.0f; static LLFloaterGodTools* sGodTools = NULL; @@ -135,6 +137,8 @@ LLFloaterGodTools::LLFloaterGodTools() sendRegionInfoRequest(); childShowTab("GodTools Tabs", "region"); + + childSetTextArg("land cost text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); } // static diff --git a/indra/newview/llfloaterimagepreview.cpp b/indra/newview/llfloaterimagepreview.cpp index ec8405978..bca92a006 100644 --- a/indra/newview/llfloaterimagepreview.cpp +++ b/indra/newview/llfloaterimagepreview.cpp @@ -62,6 +62,8 @@ #include "llviewercontrol.h" // +#include "hippogridmanager.h" + //static S32 LLFloaterImagePreview::sUploadAmount = 10; @@ -107,7 +109,7 @@ BOOL LLFloaterImagePreview::postBuild() return FALSE; } - childSetLabelArg("ok_btn", "[AMOUNT]", llformat("%d",sUploadAmount)); + childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); LLCtrlSelectionInterface* iface = childGetSelectionInterface("clothing_type_combo"); if (iface) diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 05ab79d2e..78b9e0b1f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -79,7 +79,7 @@ #include "roles_constants.h" #include "llworld.h" - +#include "hippogridmanager.h" @@ -668,6 +668,7 @@ void LLPanelLandGeneral::refresh() mSaleInfoForSaleNoObjects->setVisible(TRUE); } mSaleInfoNotForSale->setVisible(FALSE); + mSaleInfoForSale1->setTextArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); F32 cost_per_sqm = 0.0f; if (area > 0) @@ -926,6 +927,7 @@ void LLPanelLandGeneral::onClickBuyPass(void* data) LLSD args; args["COST"] = cost; + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); args["PARCEL_NAME"] = parcel_name; args["TIME"] = time; @@ -2124,6 +2126,7 @@ void LLPanelLandOptions::refreshSearch() } BOOL show_directory = parcel->getParcelFlag(PF_SHOW_DIRECTORY); mCheckShowDirectory ->set(show_directory); + mCheckShowDirectory->setLabelArg("[DIRECTORYFEE]", gHippoGridManager->getConnectedGrid()->getDirectoryFee()); // Set by string in case the order in UI doesn't match the order by index. // *TODO:Translate @@ -2491,6 +2494,7 @@ void LLPanelLandAccess::refresh() S32 pass_price = parcel->getPassPrice(); childSetValue( "PriceSpin", (F32)pass_price ); + childSetLabelArg("PriceSpin", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); F32 pass_hours = parcel->getPassHours(); childSetValue( "HoursSpin", pass_hours ); diff --git a/indra/newview/llfloaternamedesc.cpp b/indra/newview/llfloaternamedesc.cpp index 0e7a4403a..07105da6a 100644 --- a/indra/newview/llfloaternamedesc.cpp +++ b/indra/newview/llfloaternamedesc.cpp @@ -55,6 +55,8 @@ #include "llassetstorage.h" #include "llinventorytype.h" +#include "hippogridmanager.h" + const S32 PREVIEW_LINE_HEIGHT = 19; const S32 PREVIEW_CLOSE_BOX_SIZE = 16; const S32 PREVIEW_BORDER_WIDTH = 2; @@ -154,6 +156,7 @@ BOOL LLFloaterNameDesc::postBuild() childSetAction("cancel_btn", onBtnCancel, this); // OK button + childSetLabelArg("ok_btn", "[UPLOADFEE]", gHippoGridManager->getConnectedGrid()->getUploadFee()); childSetAction("ok_btn", onBtnOK, this); setDefaultBtn("ok_btn"); diff --git a/indra/newview/llfloaterpostcard.cpp b/indra/newview/llfloaterpostcard.cpp index 4400a1071..54c422e48 100644 --- a/indra/newview/llfloaterpostcard.cpp +++ b/indra/newview/llfloaterpostcard.cpp @@ -64,6 +64,8 @@ #include "llassetuploadresponders.h" +#include "hippogridmanager.h" + #if LL_MSVC #pragma warning( disable : 4265 ) // "class has virtual functions, but destructor is not virtual" #endif @@ -358,7 +360,12 @@ bool LLFloaterPostcard::missingSubjMsgAlertCallback(const LLSD& notification, co if((childGetValue("subject_form").asString()).empty()) { // Stuff the subject back into the form. - childSetValue("subject_form", getString("default_subject")); + LLStringUtil::format_map_t targs; + targs["[GRID_NAME]"] = gHippoGridManager->getConnectedGrid()->getGridName(); + std::string subj = getString("default_subject"); + LLStringUtil::format(subj, targs); + + childSetValue("subject_form", subj); } if(!mHasFirstMsgFocus) diff --git a/indra/newview/llfloaterproperties.cpp b/indra/newview/llfloaterproperties.cpp index db714ed05..c87bb4812 100644 --- a/indra/newview/llfloaterproperties.cpp +++ b/indra/newview/llfloaterproperties.cpp @@ -59,6 +59,8 @@ #include "lluictrlfactory.h" +#include "hippogridmanager.h" + // #include "llclipboard.h" // @@ -175,6 +177,8 @@ LLFloaterProperties::LLFloaterProperties(const std::string& name, const LLRect& } sPropertiesObserverCount++; + childSetTextArg("TextPrice", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + // add the object to the static structure LLUUID key = mItemID ^ mObjectID; sInstances.insert(instance_map::value_type(key, this)); diff --git a/indra/newview/llfloatersellland.cpp b/indra/newview/llfloatersellland.cpp index b66f40109..3c5b9cfa9 100755 --- a/indra/newview/llfloatersellland.cpp +++ b/indra/newview/llfloatersellland.cpp @@ -46,6 +46,8 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "hippogridmanager.h" + // defined in llfloaterland.cpp void send_parcel_select_objects(S32 parcel_local_id, U32 return_type, uuid_list_t* return_ids = NULL); @@ -284,6 +286,8 @@ void LLFloaterSellLandUI::refreshUI() childSetText("info_parcel", parcelp->getName()); childSetTextArg("info_size", "[AREA]", llformat("%d", mParcelActualArea)); + childSetTextArg("price_ld", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + std::string price_str = childGetValue("price").asString(); bool valid_price = false; valid_price = (price_str != "") && LLLineEditor::prevalidateNonNegativeS32(utf8str_to_wstring(price_str)); diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 51d23f76d..99ab752f2 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -77,6 +77,8 @@ #include "llvfile.h" #include "llvfs.h" +#include "hippogridmanager.h" + ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- @@ -1232,6 +1234,9 @@ void LLFloaterSnapshot::Impl::updateLayout(LLFloaterSnapshot* floaterp) // static void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshot* floater) { + std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee(); + floater->childSetLabelArg("upload_btn", "[UPLOADFEE]", fee); + LLRadioGroup* snapshot_type_radio = floater->getChild("snapshot_type_radio"); snapshot_type_radio->setSelectedIndex(gSavedSettings.getS32("LastSnapshotType")); LLSnapshotLivePreview::ESnapshotType shot_type = getTypeIndex(floater); diff --git a/indra/newview/llgivemoney.cpp b/indra/newview/llgivemoney.cpp index dd28bdad0..efdaf8c79 100644 --- a/indra/newview/llgivemoney.cpp +++ b/indra/newview/llgivemoney.cpp @@ -52,6 +52,8 @@ #include "lltransactiontypes.h" #include "lluictrlfactory.h" +#include "hippogridmanager.h" + ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- @@ -111,6 +113,8 @@ LLFloaterPay::LLFloaterPay(const std::string& name, childSetAction("fastpay 1",&LLFloaterPay::onGive,info); childSetVisible("fastpay 1", FALSE); + childSetLabelArg("fastpay 1", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + mQuickPayButton[i] = getChild("fastpay 1"); mQuickPayInfo[i] = info; @@ -121,6 +125,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, childSetAction("fastpay 5",&LLFloaterPay::onGive,info); childSetVisible("fastpay 5", FALSE); + childSetLabelArg("fastpay 5", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); mQuickPayButton[i] = getChild("fastpay 5"); mQuickPayInfo[i] = info; @@ -131,6 +136,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, childSetAction("fastpay 10",&LLFloaterPay::onGive,info); childSetVisible("fastpay 10", FALSE); + childSetLabelArg("fastpay 10", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); mQuickPayButton[i] = getChild("fastpay 10"); mQuickPayInfo[i] = info; @@ -141,6 +147,7 @@ LLFloaterPay::LLFloaterPay(const std::string& name, childSetAction("fastpay 20",&LLFloaterPay::onGive,info); childSetVisible("fastpay 20", FALSE); + childSetLabelArg("fastpay 20", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); mQuickPayButton[i] = getChild("fastpay 20"); mQuickPayInfo[i] = info; @@ -148,6 +155,8 @@ LLFloaterPay::LLFloaterPay(const std::string& name, childSetVisible("amount text", FALSE); + childSetVisible("currency text", FALSE); + childSetTextArg("currency text", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); std::string last_amount; if(sLastAmount > 0) @@ -207,12 +216,14 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->childSetVisible("amount", FALSE); self->childSetVisible("pay btn", FALSE); self->childSetVisible("amount text", FALSE); + self->childSetVisible("currency text", FALSE); } else if (PAY_PRICE_DEFAULT == price) { self->childSetVisible("amount", TRUE); self->childSetVisible("pay btn", TRUE); self->childSetVisible("amount text", TRUE); + self->childSetVisible("currency text", TRUE); } else { @@ -223,6 +234,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) self->childSetVisible("pay btn", TRUE); self->childSetEnabled("pay btn", TRUE); self->childSetVisible("amount text", TRUE); + self->childSetVisible("currency text", TRUE); self->childSetText("amount", llformat("%d", llabs(price))); } @@ -240,7 +252,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) msg->getS32Fast(_PREHASH_ButtonData,_PREHASH_PayButton,pay_button,i); if (pay_button > 0) { - std::string button_str = "L$"; + std::string button_str = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); button_str += LLResMgr::getInstance()->getMonetaryString( pay_button ); self->mQuickPayButton[i]->setLabelSelected(button_str); @@ -261,7 +273,7 @@ void LLFloaterPay::processPayPriceReply(LLMessageSystem* msg, void **userdata) } // build a string containing the maximum value and calc nerw button width from it. - std::string balance_str = "L$"; + std::string balance_str = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); balance_str += LLResMgr::getInstance()->getMonetaryString( max_pay_amount ); const LLFontGL* font = LLResMgr::getInstance()->getRes(LLFONT_SANSSERIF); S32 new_button_width = font->getWidth( std::string(balance_str)); @@ -323,7 +335,9 @@ void LLFloaterPay::payViaObject(money_callback callback, const LLUUID& object_id LLViewerObject* object = gObjectList.findObject(object_id); if (!object) return; - LLFloaterPay *floater = new LLFloaterPay("Give L$", callback, object_id, TRUE); + LLFloaterPay *floater = new LLFloaterPay( + "Give " + gHippoGridManager->getConnectedGrid()->getCurrencySymbol(), + callback, object_id, TRUE); if (!floater) return; LLSelectNode* node = floater->mObjectSelection->getFirstRootNode(); @@ -356,12 +370,15 @@ void LLFloaterPay::payDirectly(money_callback callback, const LLUUID& target_id, BOOL is_group) { - LLFloaterPay *floater = new LLFloaterPay("Give L$", callback, target_id, FALSE); + LLFloaterPay *floater = new LLFloaterPay( + "Give " + gHippoGridManager->getConnectedGrid()->getCurrencySymbol(), + callback, target_id, FALSE); if (!floater) return; floater->childSetVisible("amount", TRUE); floater->childSetVisible("pay btn", TRUE); floater->childSetVisible("amount text", TRUE); + floater->childSetVisible("currency text", TRUE); floater->childSetVisible("fastpay text",TRUE); for(S32 i=0;iflagTakesMoney() || (parent && parent->flagTakesMoney()) ) { - line.append(LLTrans::getString("TooltipFlagL$") + " "); + line.append(gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + " "); suppressObjectHoverDisplay = FALSE; // Show tip } @@ -479,6 +481,7 @@ void LLHoverView::updateText() else if (for_sale) { LLStringUtil::format_map_t args; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); args["[AMOUNT]"] = llformat("%d", nodep->mSaleInfo.getSalePrice()); line.append(LLTrans::getString("TooltipForSaleL$", args)); suppressObjectHoverDisplay = FALSE; // Show tip @@ -661,6 +664,7 @@ void LLHoverView::updateText() if (hover_parcel && hover_parcel->getParcelFlag(PF_FOR_SALE)) { LLStringUtil::format_map_t args; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); args["[AMOUNT]"] = llformat("%d", hover_parcel->getSalePrice()); line = LLTrans::getString("TooltipForSaleL$", args); mText.push_back(line); diff --git a/indra/newview/llnotify.cpp b/indra/newview/llnotify.cpp index b80c840fe..fca29c90b 100644 --- a/indra/newview/llnotify.cpp +++ b/indra/newview/llnotify.cpp @@ -55,6 +55,8 @@ #include "lloverlaybar.h" // for gOverlayBar #include "lluictrlfactory.h" +#include "hippogridmanager.h" + // [RLVa:KB] - Version: 1.23.4 #include "rlvhandler.h" // [/RLVa:KB] @@ -579,7 +581,10 @@ void LLNotifyBox::format(std::string& msg, const LLStringUtil::format_map_t& arg { // XUI:translate! LLStringUtil::format_map_t targs = args; - targs["[SECOND_LIFE]"] = "Second Life"; + targs["[SECOND_LIFE]"] = gHippoGridManager->getConnectedGrid()->getGridName(); + targs["[GRID_NAME]"] = gHippoGridManager->getConnectedGrid()->getGridName(); + targs["[GRID_SITE]"] = gHippoGridManager->getConnectedGrid()->getWebSite(); + targs["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); targs["[VIEWER_NAME]"] = "Singularity Viewer"; LLStringUtil::format(msg, targs); } diff --git a/indra/newview/llpanelaudioprefs.cpp b/indra/newview/llpanelaudioprefs.cpp index a692853cf..0d78a44ae 100644 --- a/indra/newview/llpanelaudioprefs.cpp +++ b/indra/newview/llpanelaudioprefs.cpp @@ -62,6 +62,8 @@ #include "llviewerwindow.h" #include "llviewercontrol.h" +#include "hippogridmanager.h" + // // Static functions // @@ -88,6 +90,8 @@ LLPanelAudioPrefs::~LLPanelAudioPrefs() BOOL LLPanelAudioPrefs::postBuild() { refreshValues(); // initialize member data from saved settings + childSetLabelArg("currency_change_threshold", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + return TRUE; } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 2a3fb7450..7f67853fa 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -71,6 +71,8 @@ #include "llviewerwindow.h" // for window width, height #include "llappviewer.h" // abortQuit() +#include "hippogridmanager.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -682,6 +684,7 @@ void LLPanelClassified::processClassifiedInfoReply(LLMessageSystem *msg, void ** timeStructToFormattedString(now, gSavedSettings.getString("ShortDateFormat"), datestr); LLStringUtil::format_map_t string_args; string_args["[DATE]"] = datestr; + string_args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); string_args["[AMT]"] = llformat("%d", price_for_listing); self->childSetText("classified_info_text", self->getString("ad_placed_paid", string_args)); @@ -878,6 +881,7 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, LLSD args; std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); args["MIN_PRICE"] = price_text; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotifications::instance().add("MinClassifiedPrice", args); return; @@ -889,6 +893,7 @@ void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, LLSD args; args["AMOUNT"] = llformat("%d", price_for_listing); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotifications::instance().add("PublishClassified", args, LLSD(), boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); } diff --git a/indra/newview/llpaneldirfind.cpp b/indra/newview/llpaneldirfind.cpp index d1588594b..9695fbdb3 100644 --- a/indra/newview/llpaneldirfind.cpp +++ b/indra/newview/llpaneldirfind.cpp @@ -63,6 +63,8 @@ #include "llfloaterdirectory.h" #include "llpaneldirbrowser.h" +#include "hippogridmanager.h" + #if LL_MSVC // disable boost::lexical_cast warning #pragma warning (disable:4702) @@ -220,8 +222,20 @@ void LLPanelDirFindAll::search(const std::string& search_text) if (!search_text.empty()) { + // Check whether or not we're on the old or web search All -- MC + bool is_web = false; + LLPanel* tabs_panel = mFloaterDirectory->getChild("Directory Tabs")->getCurrentPanel(); + if (tabs_panel) + { + is_web = tabs_panel->getName() == "find_all_panel"; + } + else + { + llwarns << "search panel not found! How can this be?!" << llendl; + } + std::string selected_collection = childGetValue( "Category" ).asString(); - std::string url = buildSearchURL(search_text, selected_collection, inc_pg, inc_mature, inc_adult); + std::string url = buildSearchURL(search_text, selected_collection, inc_pg, inc_mature, inc_adult, is_web); if (mWebBrowser) { mWebBrowser->navigateTo(url); @@ -243,20 +257,48 @@ void LLPanelDirFind::focus() void LLPanelDirFind::navigateToDefaultPage() { - std::string start_url = getString("default_search_page"); - BOOL inc_pg = childGetValue("incpg").asBoolean(); - BOOL inc_mature = childGetValue("incmature").asBoolean(); - BOOL inc_adult = childGetValue("incadult").asBoolean(); - if (!(inc_pg || inc_mature || inc_adult)) + std::string start_url = ""; + // Note: we use the web panel in OpenSim as well as Second Life -- MC + if (gHippoGridManager->getConnectedGrid()->getSearchUrl().empty() && + !gHippoGridManager->getConnectedGrid()->isSecondLife()) { - // if nothing's checked, just go for pg; we don't notify in - // this case because it's a default page. - inc_pg = true; + // OS-based but doesn't have its own web search url -- MC + start_url = gSavedSettings.getString("SearchURLDefaultOpenSim"); } - - start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult); + else + { + if (gHippoGridManager->getConnectedGrid()->isSecondLife()) + { + if (mBrowserName == "showcase_browser") + { + // note that the showcase URL in floater_directory.xml is no longer used + start_url = gSavedSettings.getString("ShowcaseURLDefault"); + } + else + { + start_url = gSavedSettings.getString("SearchURLDefault"); + } + } + else + { + // OS-based but has its own web search url -- MC + start_url = gHippoGridManager->getConnectedGrid()->getSearchUrl(); + } - llinfos << "default url: " << start_url << llendl; + BOOL inc_pg = childGetValue("incpg").asBoolean(); + BOOL inc_mature = childGetValue("incmature").asBoolean(); + BOOL inc_adult = childGetValue("incadult").asBoolean(); + if (!(inc_pg || inc_mature || inc_adult)) + { + // if nothing's checked, just go for pg; we don't notify in + // this case because it's a default page. + inc_pg = true; + } + + start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true); + } + + llinfos << "default web search url: " << start_url << llendl; if (mWebBrowser) { @@ -265,10 +307,14 @@ void LLPanelDirFind::navigateToDefaultPage() } // static std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const std::string& collection, - bool inc_pg, bool inc_mature, bool inc_adult) + bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) { - std::string url = gSavedSettings.getString("SearchURLDefault"); - if (!search_text.empty()) + std::string url; + if (search_text.empty()) + { + url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_EMPTY, is_web); + } + else { // Replace spaces with "+" for use by Google search appliance // Yes, this actually works for double-spaces @@ -291,7 +337,7 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const "-._~$+!*'()"; std::string query = LLURI::escape(search_text_with_plus, allowed); - url = gSavedSettings.getString("SearchURLQuery"); + url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_QUERY, is_web); std::string substring = "[QUERY]"; std::string::size_type where = url.find(substring); if (where != std::string::npos) @@ -309,66 +355,74 @@ std::string LLPanelDirFind::buildSearchURL(const std::string& search_text, const } } - url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult); - llinfos << "search url " << url << llendl; + url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, is_web); + llinfos << "web search url " << url << llendl; return url; } // static -std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult) +std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web) { - std::string url = gSavedSettings.getString("SearchURLSuffix2"); + std::string url = gHippoGridManager->getConnectedGrid()->getSearchUrl(HippoGridInfo::SEARCH_ALL_TEMPLATE, is_web); - // if the mature checkbox is unchecked, modify query to remove - // terms with given phrase from the result set - // This builds a value from 1-7 by or-ing together the flags, and then converts - // it to a string. - std::string substring="[MATURITY]"; - S32 maturityFlag = - (inc_pg ? SEARCH_PG : SEARCH_NONE) | - (inc_mature ? SEARCH_MATURE : SEARCH_NONE) | - (inc_adult ? SEARCH_ADULT : SEARCH_NONE); - url.replace(url.find(substring), substring.length(), boost::lexical_cast(maturityFlag)); - - // Include region and x/y position, not for the GSA, but - // just to get logs on the web server for search_proxy.php - // showing where people were standing when they searched. - std::string region_name; - LLViewerRegion* region = gAgent.getRegion(); - if (region) + if (!url.empty()) { - region_name = region->getName(); + // Note: opensim's default template (SearchURLSuffixOpenSim) is currently empty -- MC + if (gHippoGridManager->getConnectedGrid()->isSecondLife() || + !gHippoGridManager->getConnectedGrid()->getSearchUrl().empty()) + { + // if the mature checkbox is unchecked, modify query to remove + // terms with given phrase from the result set + // This builds a value from 1-7 by or-ing together the flags, and then converts + // it to a string. + std::string substring="[MATURITY]"; + S32 maturityFlag = + (inc_pg ? SEARCH_PG : SEARCH_NONE) | + (inc_mature ? SEARCH_MATURE : SEARCH_NONE) | + (inc_adult ? SEARCH_ADULT : SEARCH_NONE); + url.replace(url.find(substring), substring.length(), boost::lexical_cast(maturityFlag)); + + // Include region and x/y position, not for the GSA, but + // just to get logs on the web server for search_proxy.php + // showing where people were standing when they searched. + std::string region_name; + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + region_name = region->getName(); + } + // take care of spaces in names + region_name = LLURI::escape(region_name); + substring = "[REGION]"; + url.replace(url.find(substring), substring.length(), region_name); + + LLVector3 pos_region = gAgent.getPositionAgent(); + + std::string x = llformat("%.0f", pos_region.mV[VX]); + substring = "[X]"; + url.replace(url.find(substring), substring.length(), x); + std::string y = llformat("%.0f", pos_region.mV[VY]); + substring = "[Y]"; + url.replace(url.find(substring), substring.length(), y); + std::string z = llformat("%.0f", pos_region.mV[VZ]); + substring = "[Z]"; + url.replace(url.find(substring), substring.length(), z); + + LLUUID session_id = gAgent.getSessionID(); + std::string session_string = session_id.getString(); + substring = "[SESSION]"; + url.replace(url.find(substring), substring.length(), session_string); + + // set the currently selected language by asking the pref setting + std::string language_string = LLUI::getLanguage(); + std::string language_tag = "[LANG]"; + url.replace( url.find( language_tag ), language_tag.length(), language_string ); + + // and set the flag for the teen grid + std::string teen_string = gAgent.isTeen() ? "y" : "n"; + std::string teen_tag = "[TEEN]"; + url.replace( url.find( teen_tag ), teen_tag.length(), teen_string ); + } } - // take care of spaces in names - region_name = LLURI::escape(region_name); - substring = "[REGION]"; - url.replace(url.find(substring), substring.length(), region_name); - - LLVector3 pos_region = gAgent.getPositionAgent(); - - std::string x = llformat("%.0f", pos_region.mV[VX]); - substring = "[X]"; - url.replace(url.find(substring), substring.length(), x); - std::string y = llformat("%.0f", pos_region.mV[VY]); - substring = "[Y]"; - url.replace(url.find(substring), substring.length(), y); - std::string z = llformat("%.0f", pos_region.mV[VZ]); - substring = "[Z]"; - url.replace(url.find(substring), substring.length(), z); - - LLUUID session_id = gAgent.getSessionID(); - std::string session_string = session_id.getString(); - substring = "[SESSION]"; - url.replace(url.find(substring), substring.length(), session_string); - - // set the currently selected language by asking the pref setting - std::string language_string = LLUI::getLanguage(); - std::string language_tag = "[LANG]"; - url.replace( url.find( language_tag ), language_tag.length(), language_string ); - - // and set the flag for the teen grid - std::string teen_string = gAgent.isTeen() ? "y" : "n"; - std::string teen_tag = "[TEEN]"; - url.replace( url.find( teen_tag ), teen_tag.length(), teen_string ); return url; } diff --git a/indra/newview/llpaneldirfind.h b/indra/newview/llpaneldirfind.h index bab13182a..9f4fe813a 100644 --- a/indra/newview/llpaneldirfind.h +++ b/indra/newview/llpaneldirfind.h @@ -61,8 +61,8 @@ public: virtual void navigateToDefaultPage(); void focus(); - static std::string buildSearchURL(const std::string& search_text, const std::string& collection, bool inc_pg, bool inc_mature, bool inc_adult); - static std::string getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult); + static std::string buildSearchURL(const std::string& search_text, const std::string& collection, bool inc_pg, bool inc_mature, bool inc_adult, bool is_web); + static std::string getSearchURLSuffix(bool inc_pg, bool inc_mature, bool inc_adult, bool is_web); private: static void onClickBack( void* data ); diff --git a/indra/newview/llpaneldirgroups.cpp b/indra/newview/llpaneldirgroups.cpp index 8a910a42e..84ec36c5e 100644 --- a/indra/newview/llpaneldirgroups.cpp +++ b/indra/newview/llpaneldirgroups.cpp @@ -57,7 +57,7 @@ void LLPanelDirGroups::search(const std::string& search_text) } std::string selected_collection = "Groups"; - std::string url = buildSearchURL(search_text, selected_collection, inc_pg, inc_mature, inc_adult); + std::string url = buildSearchURL(search_text, selected_collection, inc_pg, inc_mature, inc_adult, true); if (mWebBrowser) { mWebBrowser->navigateTo(url); diff --git a/indra/newview/llpaneldirland.cpp b/indra/newview/llpaneldirland.cpp index 8f4aa9fdf..98b65f98f 100644 --- a/indra/newview/llpaneldirland.cpp +++ b/indra/newview/llpaneldirland.cpp @@ -52,6 +52,9 @@ #include "llviewercontrol.h" #include "llviewermessage.h" #include "llnotify.h" + +#include "hippogridmanager.h" + //----------------------------------------------------------------------------- // Constants //----------------------------------------------------------------------------- @@ -99,6 +102,10 @@ BOOL LLPanelDirLand::postBuild() childSetAction("Search", onClickSearchCore, this); setDefaultBtn("Search"); + childSetTextArg("land", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + childSetLabelArg("pricecheck", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + mCurrentSortColumn = "per_meter"; LLScrollListCtrl* results = getChild("results"); @@ -106,6 +113,16 @@ BOOL LLPanelDirLand::postBuild() { results->setSortChangedCallback(onClickSort); results->sortByColumn(mCurrentSortColumn,mCurrentSortAscending); + + LLStringUtil::format_map_t args; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + int n = results->getNumColumns(); + for (int i=0; igetColumn(i); + std::string label = col->mLabel; + LLStringUtil::format(label, args); + results->setColumnLabel(col->mName, label); + } } return TRUE; diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 6655bc7da..c19011014 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -57,6 +57,8 @@ #include "llviewercontrol.h" #include "llviewerwindow.h" +#include "hippogridmanager.h" + // consts const S32 MATURE_CONTENT = 1; const S32 NON_MATURE_CONTENT = 2; @@ -187,6 +189,7 @@ BOOL LLPanelGroupGeneral::postBuild() mCtrlEnrollmentFee = getChild("check_enrollment_fee", recurse); if (mCtrlEnrollmentFee) { + mCtrlEnrollmentFee->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); mCtrlEnrollmentFee->setCommitCallback(onCommitEnrollment); mCtrlEnrollmentFee->setCallbackUserData(this); } @@ -237,6 +240,8 @@ BOOL LLPanelGroupGeneral::postBuild() mComboActiveTitle->resetDirty(); } + LLStringUtil::format_map_t args; + args["[GROUPCREATEFEE]"] = gHippoGridManager->getConnectedGrid()->getGroupCreationFee(); mIncompleteMemberDataStr = getString("incomplete_member_data_str"); mConfirmGroupCreateStr = getString("confirm_group_create_str"); @@ -257,9 +262,6 @@ BOOL LLPanelGroupGeneral::postBuild() mGroupName->setVisible(FALSE); } - - - return LLPanelGroupTab::postBuild(); } @@ -356,6 +358,7 @@ void LLPanelGroupGeneral::onClickJoin(void *userdata) S32 cost = gdatap->mMembershipFee; LLSD args; args["COST"] = llformat("%d", cost); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLSD payload; payload["group_id"] = self->mGroupID; @@ -735,7 +738,9 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if ( visible ) { - fee_buff = llformat( "Join (L$%d)", gdatap->mMembershipFee); + fee_buff = llformat( "Join (%s%d)", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), + gdatap->mMembershipFee); mBtnJoinGroup->setLabelSelected(fee_buff); mBtnJoinGroup->setLabelUnselected(fee_buff); } diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index f69ea9f16..4ef930a41 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -55,6 +55,8 @@ #include "llfloaterworldmap.h" #include "llviewermessage.h" +#include "hippogridmanager.h" + //////////////////////////////////////////////////////////////////////////// class LLGroupMoneyTabEventHandler @@ -527,6 +529,9 @@ void LLPanelGroupLandMoney::activate() tabp->selectFirstTab(); mImplementationp->mBeenActivated = true; } + + setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + childSetTextArg("group_money_heading", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); //fill in the max contribution @@ -779,7 +784,9 @@ void LLPanelGroupLandMoney::processPlacesReply(LLMessageSystem* msg, void**) LLPanelGroupLandMoney* selfp = sGroupIDs.getIfThere(group_id); if(!selfp) { - llinfos << "Group Panel Land L$ " << group_id << " no longer in existence." + llinfos << "Group Panel Land " + << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + << ' ' << group_id << " no longer in existence." << llendl; return; } @@ -1116,7 +1123,9 @@ void LLPanelGroupLandMoney::processGroupAccountDetailsReply(LLMessageSystem* msg msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" << llendl; + llwarns << "Got group " + << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + << " history reply for another agent!" << llendl; return; } @@ -1287,7 +1296,9 @@ void LLPanelGroupLandMoney::processGroupAccountTransactionsReply(LLMessageSystem msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" << llendl; + llwarns << "Got group " + << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + << " history reply for another agent!" << llendl; return; } @@ -1428,7 +1439,9 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, text.append("The next stipend day is "); text.append(next_stipend_date); text.append("\n\n"); - text.append(llformat("%-24sL$%6d\n", "Balance", balance )); + text.append(llformat("%-24s%s%6d\n", "Balance", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), + balance)); text.append(1, '\n'); } @@ -1458,7 +1471,9 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id ); if (gAgent.getID() != agent_id) { - llwarns << "Got group L$ history reply for another agent!" << llendl; + llwarns << "Got group " + << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + << " history reply for another agent!" << llendl; return; } @@ -1470,7 +1485,9 @@ void LLPanelGroupLandMoney::processGroupAccountSummaryReply(LLMessageSystem* msg self = LLGroupMoneyTabEventHandler::sInstanceIDs.getIfThere(request_id); if (!self) { - llwarns << "GroupAccountSummary recieved for non-existent group L$ planning tab." << llendl; + llwarns << "GroupAccountSummary recieved for non-existent group " + << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + << " planning tab." << llendl; return; } diff --git a/indra/newview/llpanelinventory.cpp b/indra/newview/llpanelinventory.cpp index 8821ecf0c..573c7e27e 100644 --- a/indra/newview/llpanelinventory.cpp +++ b/indra/newview/llpanelinventory.cpp @@ -85,6 +85,8 @@ #include "rlvhandler.h" // [/RLVa:KB] +#include "hippogridmanager.h" + ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- @@ -237,6 +239,7 @@ void LLTaskInvFVBridge::buyItem() { LLSD args; args["PRICE"] = llformat("%d",sale_info.getSalePrice()); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); args["OWNER"] = owner_name; if (sale_info.getSaleType() != LLSaleInfo::FS_CONTENTS) { @@ -730,7 +733,7 @@ void LLTaskInvFVBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for L$" << price; + info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } @@ -1120,7 +1123,7 @@ void LLTaskSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { std::ostringstream info; - info << "Buy for L$" << price; + info << "Buy for " << gHippoGridManager->getConnectedGrid()->getCurrencySymbol() << price; label.assign(info.str()); } diff --git a/indra/newview/llpanelland.cpp b/indra/newview/llpanelland.cpp index 31f1c6118..d1eee80b3 100644 --- a/indra/newview/llpanelland.cpp +++ b/indra/newview/llpanelland.cpp @@ -49,6 +49,8 @@ #include "lluictrlfactory.h" +#include "hippogridmanager.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -217,6 +219,7 @@ void LLPanelLandInfo::refresh() &dwell); if(is_public || (is_for_sale && LLViewerParcelMgr::getInstance()->getParcelSelection()->getWholeParcelSelected())) { + childSetTextArg("label_area_price","[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); childSetTextArg("label_area_price","[PRICE]", llformat("%d",claim_price)); childSetTextArg("label_area_price","[AREA]", llformat("%d",area)); childSetVisible("label_area_price",true); diff --git a/indra/newview/llpanelpermissions.cpp b/indra/newview/llpanelpermissions.cpp index 258edd315..50a48db57 100644 --- a/indra/newview/llpanelpermissions.cpp +++ b/indra/newview/llpanelpermissions.cpp @@ -65,7 +65,7 @@ #include "lluictrlfactory.h" #include "roles_constants.h" - +#include "hippogridmanager.h" @@ -145,6 +145,10 @@ LLPanelPermissions::~LLPanelPermissions() void LLPanelPermissions::refresh() { + + LLStringUtil::format_map_t argsCurrency; + argsCurrency["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + LLButton* BtnDeedToGroup = getChild("button deed"); if(BtnDeedToGroup) { @@ -246,7 +250,7 @@ void LLPanelPermissions::refresh() } childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default", argsCurrency)); childSetText("Edit Cost",LLStringUtil::null); childSetEnabled("Edit Cost",false); @@ -464,11 +468,11 @@ void LLPanelPermissions::refresh() // If there are multiple items for sale then set text to PRICE PER UNIT. if (num_for_sale > 1) { - childSetText("Cost",getString("Cost Per Unit")); + childSetText("Cost",getString("Cost Per Unit", argsCurrency)); } else { - childSetText("Cost",getString("Cost Default")); + childSetText("Cost",getString("Cost Default", argsCurrency)); } LLLineEditor *editPrice = getChild("Edit Cost"); @@ -509,15 +513,15 @@ void LLPanelPermissions::refresh() // If multiple items are for sale, set text to TOTAL PRICE. if (num_for_sale > 1) - childSetText("Cost",getString("Cost Total")); + childSetText("Cost", getString("Cost Total", argsCurrency)); else - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default", argsCurrency)); } // This is a public object. else { childSetEnabled("Cost",false); - childSetText("Cost",getString("Cost Default")); + childSetText("Cost", getString("Cost Default", argsCurrency)); childSetText("Edit Cost",LLStringUtil::null); childSetEnabled("Edit Cost",false); @@ -1091,6 +1095,9 @@ void LLPanelPermissions::setAllSaleInfo() { llinfos << "LLPanelPermissions::setAllSaleInfo()" << llendl; LLSaleInfo::EForSale sale_type = LLSaleInfo::FS_NOT; + + LLStringUtil::format_map_t argsCurrency; + argsCurrency["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLCheckBoxCtrl *checkPurchase = getChild("checkbox for sale"); @@ -1125,7 +1132,8 @@ void LLPanelPermissions::setAllSaleInfo() { // Don't extract the price if it's labeled as MIXED or is empty. const std::string& editPriceString = editPrice->getText(); - if (editPriceString != getString("Cost Mixed") && editPriceString != getString("Sale Mixed") && + if (editPriceString != getString("Cost Mixed", argsCurrency) && + editPriceString != getString("Sale Mixed", argsCurrency) && !editPriceString.empty()) { price = atoi(editPriceString.c_str()); diff --git a/indra/newview/llpanelplace.cpp b/indra/newview/llpanelplace.cpp index 7ca362263..c72677761 100644 --- a/indra/newview/llpanelplace.cpp +++ b/indra/newview/llpanelplace.cpp @@ -58,6 +58,8 @@ #include "llweb.h" #include "llsdutil.h" +#include "hippogridmanager.h" + //static std::list LLPanelPlace::sAllPanels; @@ -311,6 +313,7 @@ void LLPanelPlace::processParcelInfoReply(LLMessageSystem *msg, void **) if (flags & DFQ_FOR_SALE) { LLUIString forsale = self->getString("forsale_text"); + forsale.setArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); forsale.setArg("[PRICE]", llformat("%d", sale_price)); info_text += forsale; } diff --git a/indra/newview/llprefsim.cpp b/indra/newview/llprefsim.cpp index d480d0436..8c1f71b4b 100644 --- a/indra/newview/llprefsim.cpp +++ b/indra/newview/llprefsim.cpp @@ -47,6 +47,8 @@ #include "lldirpicker.h" +#include "hippogridmanager.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -186,9 +188,16 @@ void LLPrefsIMImpl::apply() gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); - gDirUtilp->setPerAccountChatLogsDir(gSavedSettings.getString("FirstName"), - gSavedSettings.getString("LastName") ); - LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); + if (gHippoGridManager->getCurrentGrid()->isSecondLife()) + { + gDirUtilp->setPerAccountChatLogsDir(LLStringUtil::null, + gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") ); + } + else + { + gDirUtilp->setPerAccountChatLogsDir(gHippoGridManager->getCurrentGridNick(), + gSavedSettings.getString("FirstName"), gSavedSettings.getString("LastName") ); + } bool new_im_via_email = childGetValue("send_im_to_email").asBoolean(); bool new_hide_online = childGetValue("online_visibility").asBoolean(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 7a130f8fb..d293f32c5 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1005,8 +1005,6 @@ bool idle_startup() gDirUtilp->setChatLogsDir(gSavedPerAccountSettings.getString("InstantMessageLogPath")); } - gDirUtilp->setPerAccountChatLogsDir(firstname, lastname); - LLFile::mkdir(gDirUtilp->getChatLogsDir()); LLFile::mkdir(gDirUtilp->getPerAccountChatLogsDir()); diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index cd4d95c72..50c8940a2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -86,6 +86,8 @@ // system includes #include +#include "hippogridmanager.h" + // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] @@ -178,6 +180,11 @@ mSquareMetersCommitted(0) childSetActionTextbox("ParcelNameText", onClickParcelInfo ); childSetActionTextbox("BalanceText", onClickBalance ); + // TODO: Disable buying currency when connected to non-SL grids + // that don't support currency yet -- MC + LLButton* buybtn = getChild("buycurrency"); + buybtn->setLabelArg("[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + // Adding Net Stat Graph S32 x = getRect().getWidth() - 2; S32 y = 0; @@ -663,10 +670,8 @@ void LLStatusBar::creditBalance(S32 credit) void LLStatusBar::setBalance(S32 balance) { - std::string money_str = LLResMgr::getInstance()->getMonetaryString( balance ); - std::string balance_str = "L$"; - balance_str += money_str; - mTextBalance->setText( balance_str ); + mTextBalance->setText(gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str() + + LLResMgr::getInstance()->getMonetaryString(balance)); if (mBalance && (fabs((F32)(mBalance - balance)) > gSavedSettings.getF32("UISndMoneyChangeThreshold"))) { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6615a6100..266757039 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -253,6 +253,8 @@ #include "llfloaterdisplayname.h" #include "llavatarnamecache.h" +#include "hippogridmanager.h" + using namespace LLVOAvatarDefines; void init_client_menu(LLMenuGL* menu); void init_server_menu(LLMenuGL* menu); @@ -740,10 +742,16 @@ void init_menus() // Assume L$10 for now, the server will tell us the real cost at login const std::string upload_cost("10"); - gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost); - gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); - gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); - gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); + std::string fee = gHippoGridManager->getConnectedGrid()->getCurrencySymbol() + "10"; + gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Upload Sound", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Upload Animation", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Bulk Upload", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("ImportUpload", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Buy and Sell L$...", "[CURRENCY]", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); + gMenuHolder->childSetLabelArg("Reload Balance", "[CURRENCY]", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); gAFKMenu = gMenuBarView->getChild("Set Away", TRUE); gBusyMenu = gMenuBarView->getChild("Set Busy", TRUE); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index f4bc1b9ed..49121fe63 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -695,6 +695,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) delete_context_data = FALSE; LLSD args; args["COST"] = llformat("%d", fee); + args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); // Set the fee for next time to 0, so that we don't keep // asking about a fee. LLSD next_payload = notification["payload"]; @@ -5448,10 +5449,14 @@ void process_economy_data(LLMessageSystem *msg, void** /*user_data*/) LLFloaterImagePreview::setUploadAmount(upload_cost); LLFloaterAnimPreview::setUploadAmount(upload_cost); - gMenuHolder->childSetLabelArg("Upload Image", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", llformat("%d", upload_cost)); - gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", llformat("%d", upload_cost)); + std::string fee = gHippoGridManager->getConnectedGrid()->getUploadFee(); + gMenuHolder->childSetLabelArg("Upload Image", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Upload Sound", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Upload Animation", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Bulk Upload", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("ImportUpload", "[UPLOADFEE]", fee); + gMenuHolder->childSetLabelArg("Buy and Sell L$...", "[CURRENCY]", + gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); } void notify_cautioned_script_question(const LLSD& notification, const LLSD& response, S32 orig_questions, BOOL granted) @@ -5525,7 +5530,9 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp perms.append(", "); } - perms.append(LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i])); + LLStringUtil::format_map_t args; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + perms.append(LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i], args)); } } @@ -5686,8 +5693,11 @@ void process_script_question(LLMessageSystem *msg, void **user_data) { if (questions & LSCRIPTRunTimePermissionBits[i]) { + LLStringUtil::format_map_t args; + args["[CURRENCY]"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); + count++; - script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i]) + "\n"; + script_question += " " + LLFloaterChat::getInstance()->getString(SCRIPT_QUESTIONS[i], args) + "\n"; // check whether permission question should cause special caution dialog caution |= (SCRIPT_QUESTION_IS_CAUTION[i]); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index d1d1359ab..9e238ada9 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -42,6 +42,8 @@ #include "llviewerimage.h" #include "llviewerimagelist.h" +#include "hippogridmanager.h" + // Timers to temporise database requests const F32 AGENTS_UPDATE_TIMER = 60.0; // Seconds between 2 agent requests for a region const F32 REQUEST_ITEMS_TIMER = 10.f * 60.f; // Seconds before we consider re-requesting item data for the grid @@ -525,7 +527,10 @@ bool LLWorldMap::insertItem(U32 x_world, U32 y_world, std::string& name, LLUUID& case MAP_ITEM_LAND_FOR_SALE: // land for sale case MAP_ITEM_LAND_FOR_SALE_ADULT: // adult land for sale { - std::string tooltip = llformat("%d sq. m. L$%d", extra, extra2); + std::string tooltip = llformat("%d sq. m. %s%d", + extra, + gHippoGridManager->getConnectedGrid()->getCurrencySymbol().c_str(), + extra2); new_item.setTooltip(tooltip); if (type == MAP_ITEM_LAND_FOR_SALE) { diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index dcf0b8f1a..c9254d740 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -42,6 +42,8 @@ #include "llappviewer.h" +#include "hippogridmanager.h" + LLXMLRPCValue LLXMLRPCValue::operator[](const char* id) const { return LLXMLRPCValue(XMLRPC_VectorGetValueWithID(mV, id)); @@ -422,13 +424,15 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status, default: // Usually this means that there's a problem with the login server, // not with the client. Direct user to status page. + // NOTE: these should really be gHippoGridManager->getCurrentGrid()->getGridName() + // but apparently that's broken as of 1.3 b2 -- MC mStatusMessage = "Despite our best efforts, something unexpected has gone wrong. \n" " \n" - "Please check secondlife.com/status \n" + "Please check " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s status \n" "to see if there is a known problem with the service."; - mStatusURI = "http://secondlife.com/status/"; + //mStatusURI = "http://secondlife.com/status/"; } } } @@ -436,14 +440,14 @@ void LLXMLRPCTransaction::Impl::setStatus(Status status, void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) { std::string message; - std::string uri = "http://secondlife.com/community/support.php"; + std::string uri = gHippoGridManager->getCurrentGrid()->getSupportUrl(); switch (code) { case CURLE_COULDNT_RESOLVE_HOST: message = "DNS could not resolve the host name.\n" - "Please verify that you can connect to the www.secondlife.com\n" + "Please verify that you can connect to " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s\n" "web site. If you can, but continue to receive this error,\n" "please go to the support section and report this problem."; break; @@ -452,7 +456,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) message = "The login server couldn't verify itself via SSL.\n" "If you continue to receive this error, please go\n" - "to the Support section of the SecondLife.com web site\n" + "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s web site\n" "and report the problem."; break; @@ -464,7 +468,7 @@ void LLXMLRPCTransaction::Impl::setCurlStatus(CURLcode code) "are set correctly.\n" "\n" "If you continue to receive this error, please go\n" - "to the Support section of the SecondLife.com web site\n" + "to the Support section of " + gHippoGridManager->getCurrentGrid()->getGridNick() + "'s web site\n" "and report the problem."; break; diff --git a/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/indra/newview/skins/default/xui/en-us/floater_about_land.xml index 6db25321b..9da335451 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about_land.xml @@ -121,7 +121,7 @@ bottom="-220" drop_shadow_visible="true" enabled="true" follows="left|top" font="SansSerifSmall" h_pad="0" halign="left" height="16" left="96" mouse_opaque="true" name="For Sale: Price L$[PRICE]." v_pad="0" width="226"> - Price: L$[PRICE] (L$[PRICE_PER_SQM]/sq.m.). + Price: [CURRENCY][PRICE] ([CURRENCY][PRICE_PER_SQM]/sq.m.). About Land or select another parcel to show its details. width="119" /> @@ -1484,7 +1484,7 @@ Select the thumbnail to choose a different texture.