diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 05ec070b12b6c7dab7c385e1b9703da9d3bb910e..98129bc27366f2c43601ef56aa1657f24b600b8e 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -3,14 +3,16 @@ <key>RLVaLoginLastLocation</key> <map> <key>Comment</key> - <string>Determines whether the next login will be forced to the last logoff location (set by the viewer)</string> + <string>Determines whether the next login will be forced to the last logoff location (set by RLVa)</string> <key>Persist</key> <integer>1</integer> + <key>HideFromEditor</key> + <integer>1</integer> <key>Type</key> - <string>Boolean</string> + <string>Boolean</string> <key>Value</key> - <boolean>1</boolean> - </map> + <boolean>1</boolean> + </map> <key>AvatarHoverOffsetZ</key> <map> <key>Comment</key> diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 178118e4bf699ff11e41d8d3558d3ba32942bd6e..019d69a454382c6e5284e1ae49671d332dbc7d94 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -187,8 +187,7 @@ #include "llavatariconctrl.h" #include "llvoicechannel.h" #include "llpathfindingmanager.h" - -// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) +// [RLVa:KB] - Checked: RLVa-1.2.0 #include "rlvhandler.h" // [/RLVa:KB] @@ -376,13 +375,6 @@ bool idle_startup() std::string lastGPU = gSavedSettings.getString("LastGPUString"); std::string thisGPU = LLFeatureManager::getInstance()->getGPUString(); -// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-0.2.1d - if ( (gSavedSettings.controlExists(RLV_SETTING_MAIN)) && (gSavedSettings.getBOOL(RLV_SETTING_MAIN)) ) - { - rlv_handler_t::setEnabled(TRUE); - } -// [/RLVa:KB] - if (LLFeatureManager::getInstance()->isSafe()) { LLNotificationsUtil::add("DisplaySetToSafe"); @@ -845,6 +837,13 @@ bool idle_startup() return FALSE; } +// [RLVa:KB] - Checked: RLVa-0.2.1 + if (gSavedSettings.getBOOL(RLV_SETTING_MAIN)) + { + RlvHandler::setEnabled(true); + } +// [/RLVa:KB] + // reset the values that could have come in from a slurl // DEV-42215: Make sure they're not empty -- gUserCredential // might already have been set from gSavedSettings, and it's too bad @@ -968,8 +967,8 @@ bool idle_startup() // their last location, or some URL "-url //sim/x/y[/z]" // All accounts have both a home and a last location, and we don't support // more locations than that. Choose the appropriate one. JC -// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-0.2.1d - if ( (rlv_handler_t::isEnabled()) && (RlvSettings::getLoginLastLocation()) ) +// [RLVa:KB] - Checked: RLVa-0.2.1 + if ( (RlvHandler::isEnabled()) && (RlvSettings::getLoginLastLocation()) ) { // Force login at the last location LLStartUp::setStartSLURL(LLSLURL(LLSLURL::SIM_LOCATION_LAST)); @@ -1804,8 +1803,8 @@ bool idle_startup() LLFloaterReg::getInstance("inventory"); display_startup(); -// [RLVa:KB] - Checked: 2010-02-27 (RLVa-1.2.0a) | Added: RLVa-1.1.0f - if (rlv_handler_t::isEnabled()) +// [RLVa:KB] - Checked: RLVa-1.1.0 + if (RlvHandler::isEnabled()) { // Regularly process a select subset of retained commands during logon gIdleCallbacks.addFunction(RlvHandler::onIdleStartup, new LLTimer()); diff --git a/indra/newview/rlvcommon.cpp b/indra/newview/rlvcommon.cpp index 88fde865d24e97901862ffc2ed73cf3eda8d8fca..f93216e5ca86a00866a99508818ac44942ad62b4 100644 --- a/indra/newview/rlvcommon.cpp +++ b/indra/newview/rlvcommon.cpp @@ -152,17 +152,14 @@ bool RlvSettings::onChangedSettingBOOL(const LLSD& sdValue, bool* pfSetting) return true; } -// Checked: 2015-05-25 (RLVa-1.5.0) void RlvSettings::onChangedSettingMain(const LLSD& sdValue) { - if (sdValue.asBoolean() != (bool)rlv_handler_t::isEnabled()) - { - LLNotificationsUtil::add( - "GenericAlert", - LLSD().with("MESSAGE", llformat(LLTrans::getString("RLVaToggleMessage").c_str(), - (sdValue.asBoolean()) ? LLTrans::getString("RLVaToggleEnabled").c_str() - : LLTrans::getString("RLVaToggleDisabled").c_str()))); - } + LLStringUtil::format_map_t args; + args["[STATE]"] = LLTrans::getString( (sdValue.asBoolean()) ? "RLVaToggleEnabled" : "RLVaToggleDisabled"); + + // As long as RLVa hasn't been enabled but >can< be enabled all toggles are instant (everything else will require a restart) + bool fQuickToggle = (!RlvHandler::isEnabled()) && (RlvHandler::canEnable()); + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", LLTrans::getString((fQuickToggle) ? "RLVaToggleMessageLogin" : "RLVaToggleMessageRestart", args))); } void RlvSettings::initCompatibilityMode(std::string strCompatList) @@ -629,7 +626,7 @@ bool rlvMenuMainToggleVisible(LLUICtrl* pMenuCtrl) if (pMenuItem) { static std::string strLabel = pMenuItem->getLabel(); - if (gSavedSettings.getBOOL(RLV_SETTING_MAIN) == rlv_handler_t::isEnabled()) + if ((bool)gSavedSettings.getBOOL(RLV_SETTING_MAIN) == rlv_handler_t::isEnabled()) pMenuItem->setLabel(strLabel); else pMenuItem->setLabel(strLabel + " " + LLTrans::getString("RLVaPendingRestart")); diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index e944a732ec28e6f1ae68caebe029af742eb8f040..4395cdb7d9c6173367b5c30cbc5f45095330871f 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -64,7 +64,7 @@ // Static variable initialization // -BOOL RlvHandler::m_fEnabled = FALSE; +bool RlvHandler::m_fEnabled = false; rlv_handler_t gRlvHandler; @@ -1044,17 +1044,20 @@ bool RlvHandler::redirectChatOrEmote(const std::string& strUTF8Text) const // Initialization helper functions // -// Checked: 2010-02-27 (RLVa-1.2.0a) | Modified: RLVa-1.2.0a -BOOL RlvHandler::setEnabled(BOOL fEnable) +bool RlvHandler::canEnable() +{ + return LLStartUp::getStartupState() <= STATE_LOGIN_CLEANUP; +} + +bool RlvHandler::setEnabled(bool fEnable) { - // TODO-RLVa: [RLVa-1.2.1] Allow toggling at runtime if we haven't seen any llOwnerSay("@...."); if (m_fEnabled == fEnable) return fEnable; - if (fEnable) + if ( (fEnable) && (canEnable()) ) { RLV_INFOS << "Enabling Restrained Love API support - " << RlvStrings::getVersionAbout() << RLV_ENDL; - m_fEnabled = TRUE; + m_fEnabled = true; // Initialize static classes RlvSettings::initClass(); @@ -1079,51 +1082,6 @@ BOOL RlvHandler::setEnabled(BOOL fEnable) return m_fEnabled; } -BOOL RlvHandler::canDisable() -{ - return FALSE; -} - -void RlvHandler::clearState() -{ -/* - // TODO-RLVa: should restore all RLV controlled debug variables to their defaults - - // Issue @clear on behalf of every object that has a currently active RLV restriction (even if it's just an exception) - LLUUID idObj; LLViewerObject* pObj; bool fDetachable; - while (m_Objects.size()) - { - idObj = m_Objects.begin()->first; // Need a copy since after @clear the data it points to will no longer exist - fDetachable = ((pObj = gObjectList.findObject(idObj)) != NULL) ? isLockedAttachment(pObj, RLV_LOCK_REMOVE) : true; - - processCommand(idObj, "clear", false); - if (!fDetachable) - processCommand(idObj, "detachme=force", false); - } - - // Sanity check - these should all be empty after we issue @clear on the last object - if ( (!m_Objects.empty()) || !(m_Exceptions.empty()) || (!m_AttachAdd.empty()) || (!m_AttachRem.empty()) ) - { - RLV_ERRS << "Object, exception or attachment map not empty after clearing state!" << LL_ENDL; - m_Objects.clear(); - m_Exceptions.clear(); - m_AttachAdd.clear(); - m_AttachRem.clear(); - } - - // These all need manual clearing - memset(m_LayersAdd, 0, sizeof(S16) * WT_COUNT); - memset(m_LayersRem, 0, sizeof(S16) * WT_COUNT); - memset(m_Behaviours, 0, sizeof(S16) * RLV_BHVR_COUNT); - m_Retained.clear(); - clearCommandHandlers(); // <- calls delete on all registered command handlers - - // Clear dynamically allocated memory - delete m_pGCTimer; - m_pGCTimer = NULL; -*/ -} - // ============================================================================ // Command handlers (RLV_TYPE_ADD and RLV_TYPE_REMOVE) // diff --git a/indra/newview/rlvhandler.h b/indra/newview/rlvhandler.h index 030bfb9588f2378cff5026d703d90d3253d5ef13..4960c92d933c0786e431972c05c3765d09b28577 100644 --- a/indra/newview/rlvhandler.h +++ b/indra/newview/rlvhandler.h @@ -114,11 +114,10 @@ public: const LLUUID& getCurrentObject() const { return (!m_CurObjectStack.empty()) ? m_CurObjectStack.top() : LLUUID::null; } // Initialization - static BOOL canDisable(); - static BOOL isEnabled() { return m_fEnabled; } - static BOOL setEnabled(BOOL fEnable); + static bool canEnable(); + static bool isEnabled() { return m_fEnabled; } + static bool setEnabled(bool fEnable); protected: - void clearState(); // -------------------------------- @@ -202,7 +201,7 @@ protected: rlv_command_signal_t m_OnCommand; mutable std::list<RlvExtCommandHandler*> m_CommandHandlers; - static BOOL m_fEnabled; // Use setEnabled() to toggle this + static bool m_fEnabled; // Use setEnabled() to toggle this bool m_fCanCancelTp; // @accepttp=n and @tpto=force mutable LLVector3d m_posSitSource; // @standtp=n (mutable because onForceXXX handles are all declared as const) diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 061925ff209eaaa052a9eed3e9f094052930d081..bd6aaa5ff085840263867b4e82476cd9244e9e9c 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4102,8 +4102,9 @@ Try enclosing path to the editor with double quotes. <string name="UserDictionary">[User]</string> <!-- RLVa --> - <string name="RLVaPendingRestart"> (pending restart)</string> - <string name="RLVaToggleMessage">RestrainedLove Support will be %s after you restart</string> + <string name="RLVaPendingRestart">(pending restart)</string> + <string name="RLVaToggleMessageLogin">RLVa has been [STATE] (no restart required)</string> + <string name="RLVaToggleMessageRestart">RLVa will be [STATE] after you restart</string> <string name="RLVaToggleEnabled">enabled</string> <string name="RLVaToggleDisabled">disabled</string>