From 9c66ac87fd46db3987e60ae50989b2497099480b Mon Sep 17 00:00:00 2001 From: Kitty Barnett Date: Fri, 20 Jan 2012 18:06:32 +0100 Subject: STORM-276 Basic spellchecking framework --- indra/newview/llviewermenu.cpp | 86 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 86 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 0104d35e53..2a11f3cc16 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -81,6 +81,7 @@ #include "llrootview.h" #include "llsceneview.h" #include "llselectmgr.h" +#include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" #include "lltoolcomp.h" @@ -4984,6 +4985,78 @@ class LLEditDelete : public view_listener_t } }; +void handle_spellcheck_replace_with_suggestion(const LLUICtrl* ctrl, const LLSD& param) +{ + const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + if ( (!spellcheck_handler) || (!spellcheck_handler->getSpellCheck()) ) + { + return; + } + + U32 index = 0; + if ( (!LLStringUtil::convertToU32(param.asString(), index)) || (index >= spellcheck_handler->getSuggestionCount()) ) + { + return; + } + + spellcheck_handler->replaceWithSuggestion(index); +} + +bool visible_spellcheck_suggestion(LLUICtrl* ctrl, const LLSD& param) +{ + LLMenuItemGL* item = dynamic_cast(ctrl); + const LLContextMenu* menu = (item) ? dynamic_cast(item->getParent()) : NULL; + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + if ( (!spellcheck_handler) || (!spellcheck_handler->getSpellCheck()) ) + { + return false; + } + + U32 index = 0; + if ( (!LLStringUtil::convertToU32(param.asString(), index)) || (index >= spellcheck_handler->getSuggestionCount()) ) + { + return false; + } + + item->setLabel(spellcheck_handler->getSuggestion(index)); + return true; +} + +void handle_spellcheck_add_to_dictionary(const LLUICtrl* ctrl) +{ + const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + if ( (spellcheck_handler) && (spellcheck_handler->canAddToDictionary()) ) + { + spellcheck_handler->addToDictionary(); + } +} + +bool enable_spellcheck_add_to_dictionary(const LLUICtrl* ctrl) +{ + const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + return (spellcheck_handler) && (spellcheck_handler->canAddToDictionary()); +} + +void handle_spellcheck_add_to_ignore(const LLUICtrl* ctrl) +{ + const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); + LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + if ( (spellcheck_handler) && (spellcheck_handler->canAddToIgnore()) ) + { + spellcheck_handler->addToIgnore(); + } +} + +bool enable_spellcheck_add_to_ignore(const LLUICtrl* ctrl) +{ + const LLContextMenu* menu = dynamic_cast(ctrl->getParent()); + const LLSpellCheckMenuHandler* spellcheck_handler = (menu) ? dynamic_cast(menu->getSpawningView()) : NULL; + return (spellcheck_handler) && (spellcheck_handler->canAddToIgnore()); +} + bool enable_object_delete() { bool new_value = @@ -7933,6 +8006,19 @@ void initialize_edit_menu() } +void initialize_spellcheck_menu() +{ + LLUICtrl::CommitCallbackRegistry::Registrar& commit = LLUICtrl::CommitCallbackRegistry::currentRegistrar(); + LLUICtrl::EnableCallbackRegistry::Registrar& enable = LLUICtrl::EnableCallbackRegistry::currentRegistrar(); + + commit.add("SpellCheck.ReplaceWithSuggestion", boost::bind(&handle_spellcheck_replace_with_suggestion, _1, _2)); + enable.add("SpellCheck.VisibleSuggestion", boost::bind(&visible_spellcheck_suggestion, _1, _2)); + commit.add("SpellCheck.AddToDictionary", boost::bind(&handle_spellcheck_add_to_dictionary, _1)); + enable.add("SpellCheck.EnableAddToDictionary", boost::bind(&enable_spellcheck_add_to_dictionary, _1)); + commit.add("SpellCheck.AddToIgnore", boost::bind(&handle_spellcheck_add_to_ignore, _1)); + enable.add("SpellCheck.EnableAddToIgnore", boost::bind(&enable_spellcheck_add_to_ignore, _1)); +} + void initialize_menus() { // A parameterized event handler used as ctrl-8/9/0 zoom controls below. -- cgit v1.3 From e1fa05d8be51febec618d5ba124dbbab350ab747 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 11 Feb 2012 15:31:31 -0500 Subject: STORM-1738 Enable floater --- indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/llviewermenu.cpp | 9 + .../skins/default/xui/en/floater_autocorrect.xml | 381 +++++++++++++++++---- indra/newview/skins/default/xui/en/menu_viewer.xml | 5 + 4 files changed, 323 insertions(+), 74 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index fc71160b2d..116076d789 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -170,7 +170,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("about_land", "floater_about_land.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("appearance", "floater_my_appearance.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("auction", "floater_auction.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("autocorrect", "floater_autocorrect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("settings_autocorrect", "floater_autocorrect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar", "floater_avatar.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_picker", "floater_avatar_picker.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("avatar_textures", "floater_avatar_textures.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 67f6150dbe..b6a20becb2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1973,6 +1973,14 @@ class LLAdvancedCompressImage : public view_listener_t }; +class LLAdvancedShowAutocorrectSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLFloaterReg::showInstance("settings_autocorrect", userdata); + return true; + } +}; ///////////////////////// // SHOW DEBUG SETTINGS // @@ -8235,6 +8243,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); + view_listener_t::addMenu(new LLAdvancedShowAutocorrectSettings(), "Advanced.ShowAutocorrectSettings"); view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions"); diff --git a/indra/newview/skins/default/xui/en/floater_autocorrect.xml b/indra/newview/skins/default/xui/en/floater_autocorrect.xml index b67b2e7ec0..05683c9907 100644 --- a/indra/newview/skins/default/xui/en/floater_autocorrect.xml +++ b/indra/newview/skins/default/xui/en/floater_autocorrect.xml @@ -1,79 +1,314 @@ - - - -- cgit v1.3 From fb44dbb164b08b61c7ac4ab6e0565c972ee0e66b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Fri, 11 May 2012 14:45:31 -0400 Subject: move preferences from Advanced menu to Chat tab of preferences floater --- indra/newview/llfloaterpreference.cpp | 5 ++--- indra/newview/llviewermenu.cpp | 10 ---------- indra/newview/skins/default/xui/en/menu_viewer.xml | 5 ----- indra/newview/skins/default/xui/en/panel_preferences_chat.xml | 2 +- 4 files changed, 3 insertions(+), 19 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 362904f0f8..7ef8125896 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -346,7 +346,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.BlockList", boost::bind(&LLFloaterPreference::onClickBlockList, this)); mCommitCallbackRegistrar.add("Pref.Proxy", boost::bind(&LLFloaterPreference::onClickProxySettings, this)); mCommitCallbackRegistrar.add("Pref.TranslationSettings", boost::bind(&LLFloaterPreference::onClickTranslationSettings, this)); - + mCommitCallbackRegistrar.add("Pref.AutoReplace.", boost::bind(&AutoReplaceFloater::showFloater, this)); + sSkin = gSavedSettings.getString("SkinCurrent"); mCommitCallbackRegistrar.add("Pref.ClickActionChange", boost::bind(&LLFloaterPreference::onClickActionChange, this)); @@ -355,8 +356,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) gSavedSettings.getControl("NameTagShowFriends")->getCommitSignal()->connect(boost::bind(&handleNameTagOptionChanged, _2)); gSavedSettings.getControl("UseDisplayNames")->getCommitSignal()->connect(boost::bind(&handleDisplayNamesOptionChanged, _2)); - mCommitCallbackRegistrar.add("Pref.ShowAC", boost::bind(&AutoReplaceFloater::showFloater)); - LLAvatarPropertiesProcessor::getInstance()->addObserver( gAgent.getID(), this ); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index af3189f1b7..714bf6b7e7 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1982,15 +1982,6 @@ class LLAdvancedCompressImage : public view_listener_t }; -class LLAdvancedShowAutoreplaceSettings : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - LLFloaterReg::showInstance("settings_autoreplace", userdata); - return true; - } -}; - ///////////////////////// // SHOW DEBUG SETTINGS // ///////////////////////// @@ -8291,7 +8282,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleShowObjectUpdates(), "Advanced.ToggleShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCheckShowObjectUpdates(), "Advanced.CheckShowObjectUpdates"); view_listener_t::addMenu(new LLAdvancedCompressImage(), "Advanced.CompressImage"); - view_listener_t::addMenu(new LLAdvancedShowAutoreplaceSettings(), "Advanced.ShowAutoreplaceSettings"); view_listener_t::addMenu(new LLAdvancedShowDebugSettings(), "Advanced.ShowDebugSettings"); view_listener_t::addMenu(new LLAdvancedEnableViewAdminOptions(), "Advanced.EnableViewAdminOptions"); view_listener_t::addMenu(new LLAdvancedToggleViewAdminOptions(), "Advanced.ToggleViewAdminOptions"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 26abc754db..5ba566b175 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1835,11 +1835,6 @@ - - - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 12bf6c5296..33a9a8e632 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -223,7 +223,7 @@ top_pad="-23" left_pad="5" name="ac_showgui" - commit_callback.function="Pref.ShowAC" + commit_callback.function="Pref.AutoReplace label="AutoReplace Settings" width="150"> -- cgit v1.3 From 061da28f58b29954d06f7a6699474b12bb9f4c63 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 21 May 2012 14:01:31 -0700 Subject: EXP-1941: Adding in debug setting to force enable purchase flow disregarding other checks including maturity. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llfloaterbuycontents.cpp | 11 +++++++++++ indra/newview/llfloaterbuycurrency.cpp | 7 +++++++ indra/newview/llfloaterbuyland.cpp | 4 ++++ indra/newview/llsidepaneltaskinfo.cpp | 4 ++++ indra/newview/llviewermenu.cpp | 19 +++++++++++++++++++ 6 files changed, 56 insertions(+) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ee8c15752b..12e2ff71fd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13494,5 +13494,16 @@ Value 0 + AdultCheckEnablePurchse + + Comment + Hack to allow QA testing of purchasing land regardless of maturity rating. + Persist + 0 + Type + Boolean + Value + 0 + diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index a7388d21a3..9bbbbb9867 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -51,6 +51,9 @@ #include "llviewerregion.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK LLFloaterBuyContents::LLFloaterBuyContents(const LLSD& key) : LLFloater(key) @@ -64,7 +67,11 @@ BOOL LLFloaterBuyContents::postBuild() getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); getChildView("item_list")->setEnabled(FALSE); +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK getChildView("wear_check")->setEnabled(FALSE); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) @@ -163,7 +170,11 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } // default to turning off the buy button. +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK LLUUID owner_id; BOOL is_group_owned; diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index e21a8594bc..3e7d265cdf 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -41,6 +41,9 @@ #include "llweb.h" #include "llwindow.h" #include "llappviewer.h" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK static const S32 STANDARD_BUY_AMOUNT = 2000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; @@ -156,7 +159,11 @@ void LLFloaterBuyCurrencyUI::draw() } // disable the Buy button when we are not able to buy +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || mManager.canBuy()); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mManager.canBuy()); +#endif // STINSON_ADULT_CHECK_HACK LLFloater::draw(); } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 8223e89b64..6333238c26 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -1305,7 +1305,11 @@ void LLFloaterBuyLandUI::refreshUI() agrees_to_covenant = check->get(); } +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || (mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant)); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); +#endif // STINSON_ADULT_CHECK_HACK } void LLFloaterBuyLandUI::startBuyPreConfirm() diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 24cb559fd0..13a2a395e9 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -251,7 +251,11 @@ void LLSidepanelTaskInfo::disableAll() mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); +#ifndef STINSON_ADULT_CHECK_HACK + mBuyBtn->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK mBuyBtn->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK } void LLSidepanelTaskInfo::refresh() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 12aed8f448..a5effe4f09 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -111,6 +111,9 @@ #include "lltoolgrab.h" #include "llwindow.h" #include "boost/unordered_map.hpp" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK using namespace LLVOAvatarDefines; @@ -335,7 +338,11 @@ void LLMenuParcelObserver::changed() { gMenuHolder->childSetEnabled("Land Buy Pass", LLPanelLandGeneral::enableBuyPass(NULL)); +#ifndef STINSON_ADULT_CHECK_HACK + BOOL buyable = gSavedSettings.getBOOL("AdultCheckEnablePurchse") || enable_buy_land(NULL); +#else // STINSON_ADULT_CHECK_HACK BOOL buyable = enable_buy_land(NULL); +#endif // STINSON_ADULT_CHECK_HACK gMenuHolder->childSetEnabled("Land Buy", buyable); gMenuHolder->childSetEnabled("Buy Land...", buyable); } @@ -3241,6 +3248,12 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm bool enable_buy_object() { +#ifndef STINSON_ADULT_CHECK_HACK + if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) + { + return true; + } +#endif // STINSON_ADULT_CHECK_HACK // In order to buy, there must only be 1 purchaseable object in // the selection manger. if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false; @@ -5928,6 +5941,12 @@ class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(const LLSD& userdata) { +#ifndef STINSON_ADULT_CHECK_HACK + if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) + { + return true; + } +#endif // STINSON_ADULT_CHECK_HACK bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->selectionEmpty() ? LLViewerParcelMgr::getInstance()->getAgentParcel() -- cgit v1.3 From 7fc6d3d79b0e28a450b097c923387de133cc4545 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Wed, 23 May 2012 19:29:17 -0700 Subject: Removing some code that allowed the viewer to toggle the user's maturity access level. But only toggling it in the viewer leads to some really bad discontinuities with the server's actual access level for the user. --- indra/newview/llagent.cpp | 5 ---- indra/newview/llagent.h | 1 - indra/newview/llagentaccess.cpp | 12 --------- indra/newview/llagentaccess.h | 1 - indra/newview/llviewermenu.cpp | 28 -------------------- indra/newview/skins/default/xui/en/menu_viewer.xml | 6 ----- indra/newview/tests/llagentaccess_test.cpp | 30 +++++++--------------- 7 files changed, 9 insertions(+), 74 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 23a2908ce6..07a439e696 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -2481,11 +2481,6 @@ bool LLAgent::isAdult() const return mAgentAccess->isAdult(); } -void LLAgent::setTeen(bool teen) -{ - mAgentAccess->setTeen(teen); -} - //static int LLAgent::convertTextToMaturity(char text) { diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index dcb26efe41..1ca12f14b7 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -688,7 +688,6 @@ public: bool isTeen() const; bool isMature() const; bool isAdult() const; - void setTeen(bool teen); void setMaturity(char text); static int convertTextToMaturity(char text); diff --git a/indra/newview/llagentaccess.cpp b/indra/newview/llagentaccess.cpp index bf2a78e7f5..c4ee321e04 100644 --- a/indra/newview/llagentaccess.cpp +++ b/indra/newview/llagentaccess.cpp @@ -132,18 +132,6 @@ bool LLAgentAccess::isAdult() const return mAccess >= SIM_ACCESS_ADULT; } -void LLAgentAccess::setTeen(bool teen) -{ - if (teen) - { - mAccess = SIM_ACCESS_PG; - } - else - { - mAccess = SIM_ACCESS_MATURE; - } -} - //static int LLAgentAccess::convertTextToMaturity(char text) { diff --git a/indra/newview/llagentaccess.h b/indra/newview/llagentaccess.h index 90023d7575..4e851b0aa0 100644 --- a/indra/newview/llagentaccess.h +++ b/indra/newview/llagentaccess.h @@ -59,7 +59,6 @@ public: bool isMature() const; bool isAdult() const; - void setTeen(bool teen); void setMaturity(char text); static int convertTextToMaturity(char text); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a5effe4f09..4da45ca29c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -297,7 +297,6 @@ BOOL enable_buy_land(void*); void handle_test_male(void *); void handle_test_female(void *); -void handle_toggle_pg(void*); void handle_dump_attachments(void *); void handle_dump_avatar_local_textures(void*); void handle_debug_avatar_textures(void*); @@ -1588,23 +1587,6 @@ class LLAdvancedTestFemale : public view_listener_t } }; - - -/////////////// -// TOGGLE PG // -/////////////// - - -class LLAdvancedTogglePG : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - handle_toggle_pg(NULL); - return true; - } -}; - - class LLAdvancedForceParamsToDefault : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -6639,15 +6621,6 @@ void handle_test_female(void*) //gGestureList.requestResetFromServer( FALSE ); } -void handle_toggle_pg(void*) -{ - gAgent.setTeen( !gAgent.isTeen() ); - - LLFloaterWorldMap::reloadIcons(NULL); - - llinfos << "PG status set to " << (S32)gAgent.isTeen() << llendl; -} - void handle_dump_attachments(void*) { if(!isAgentAvatarValid()) return; @@ -8208,7 +8181,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedTestMale(), "Advanced.TestMale"); view_listener_t::addMenu(new LLAdvancedTestFemale(), "Advanced.TestFemale"); - view_listener_t::addMenu(new LLAdvancedTogglePG(), "Advanced.TogglePG"); // Advanced > Character (toplevel) view_listener_t::addMenu(new LLAdvancedForceParamsToDefault(), "Advanced.ForceParamsToDefault"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 1d11abcf73..938702775f 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3098,12 +3098,6 @@ - - - diff --git a/indra/newview/tests/llagentaccess_test.cpp b/indra/newview/tests/llagentaccess_test.cpp index fbd2c7328b..0141a219c5 100644 --- a/indra/newview/tests/llagentaccess_test.cpp +++ b/indra/newview/tests/llagentaccess_test.cpp @@ -111,18 +111,6 @@ namespace tut ensure("1 isMature", !aa.isMature()); ensure("1 isAdult", !aa.isAdult()); - // this is kinda bad -- setting this forces maturity to MATURE but !teen != Mature anymore - aa.setTeen(false); - ensure("2 isTeen", !aa.isTeen()); - ensure("2 isMature", aa.isMature()); - ensure("2 isAdult", !aa.isAdult()); - - // have to flip it back and make sure it still works - aa.setTeen(true); - ensure("3 isTeen", aa.isTeen()); - ensure("3 isMature", !aa.isMature()); - ensure("3 isAdult", !aa.isAdult()); - // check the conversion routine ensure_equals("1 conversion", SIM_ACCESS_PG, aa.convertTextToMaturity('P')); ensure_equals("2 conversion", SIM_ACCESS_MATURE, aa.convertTextToMaturity('M')); @@ -131,21 +119,21 @@ namespace tut // now try the other method of setting it - PG aa.setMaturity('P'); - ensure("4 isTeen", aa.isTeen()); - ensure("4 isMature", !aa.isMature()); - ensure("4 isAdult", !aa.isAdult()); + ensure("2 isTeen", aa.isTeen()); + ensure("2 isMature", !aa.isMature()); + ensure("2 isAdult", !aa.isAdult()); // Mature aa.setMaturity('M'); - ensure("5 isTeen", !aa.isTeen()); - ensure("5 isMature", aa.isMature()); - ensure("5 isAdult", !aa.isAdult()); + ensure("3 isTeen", !aa.isTeen()); + ensure("3 isMature", aa.isMature()); + ensure("3 isAdult", !aa.isAdult()); // Adult aa.setMaturity('A'); - ensure("6 isTeen", !aa.isTeen()); - ensure("6 isMature", aa.isMature()); - ensure("6 isAdult", aa.isAdult()); + ensure("4 isTeen", !aa.isTeen()); + ensure("4 isMature", aa.isMature()); + ensure("4 isAdult", aa.isAdult()); } -- cgit v1.3 From d42d78a58a6b3bd40029629fbaa6b5925623efd3 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Tue, 12 Jun 2012 18:27:05 -0700 Subject: EXP-1941: Backed out changeset: 2f6546ac7e5e --- indra/newview/app_settings/settings.xml | 11 ----------- indra/newview/llfloaterbuycontents.cpp | 11 ----------- indra/newview/llfloaterbuycurrency.cpp | 7 ------- indra/newview/llfloaterbuyland.cpp | 4 ---- indra/newview/llsidepaneltaskinfo.cpp | 4 ---- indra/newview/llviewermenu.cpp | 19 ------------------- 6 files changed, 56 deletions(-) (limited to 'indra/newview/llviewermenu.cpp') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7771bcb1cf..55bc6ba36d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13505,16 +13505,5 @@ Value 0 - AdultCheckEnablePurchse - - Comment - Hack to allow QA testing of purchasing land regardless of maturity rating. - Persist - 0 - Type - Boolean - Value - 0 - diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 0e6442fff6..bca4b5e447 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -51,9 +51,6 @@ #include "llviewerregion.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" -#ifndef STINSON_ADULT_CHECK_HACK -#include "llviewercontrol.h" -#endif // STINSON_ADULT_CHECK_HACK LLFloaterBuyContents::LLFloaterBuyContents(const LLSD& key) : LLFloater(key) @@ -67,11 +64,7 @@ BOOL LLFloaterBuyContents::postBuild() getChild("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); getChildView("item_list")->setEnabled(FALSE); -#ifndef STINSON_ADULT_CHECK_HACK - getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); -#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); -#endif // STINSON_ADULT_CHECK_HACK getChildView("wear_check")->setEnabled(FALSE); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) @@ -170,11 +163,7 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } // default to turning off the buy button. -#ifndef STINSON_ADULT_CHECK_HACK - getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); -#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); -#endif // STINSON_ADULT_CHECK_HACK LLUUID owner_id; BOOL is_group_owned; diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 3e7d265cdf..e21a8594bc 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -41,9 +41,6 @@ #include "llweb.h" #include "llwindow.h" #include "llappviewer.h" -#ifndef STINSON_ADULT_CHECK_HACK -#include "llviewercontrol.h" -#endif // STINSON_ADULT_CHECK_HACK static const S32 STANDARD_BUY_AMOUNT = 2000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; @@ -159,11 +156,7 @@ void LLFloaterBuyCurrencyUI::draw() } // disable the Buy button when we are not able to buy -#ifndef STINSON_ADULT_CHECK_HACK - getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || mManager.canBuy()); -#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mManager.canBuy()); -#endif // STINSON_ADULT_CHECK_HACK LLFloater::draw(); } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 6333238c26..8223e89b64 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -1305,11 +1305,7 @@ void LLFloaterBuyLandUI::refreshUI() agrees_to_covenant = check->get(); } -#ifndef STINSON_ADULT_CHECK_HACK - getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || (mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant)); -#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); -#endif // STINSON_ADULT_CHECK_HACK } void LLFloaterBuyLandUI::startBuyPreConfirm() diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 13a2a395e9..24cb559fd0 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -251,11 +251,7 @@ void LLSidepanelTaskInfo::disableAll() mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); -#ifndef STINSON_ADULT_CHECK_HACK - mBuyBtn->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); -#else // STINSON_ADULT_CHECK_HACK mBuyBtn->setEnabled(FALSE); -#endif // STINSON_ADULT_CHECK_HACK } void LLSidepanelTaskInfo::refresh() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5b4d8dcf2c..602d0770b2 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -116,9 +116,6 @@ #include "lltoolgrab.h" #include "llwindow.h" #include "boost/unordered_map.hpp" -#ifndef STINSON_ADULT_CHECK_HACK -#include "llviewercontrol.h" -#endif // STINSON_ADULT_CHECK_HACK using namespace LLVOAvatarDefines; @@ -342,11 +339,7 @@ void LLMenuParcelObserver::changed() { gMenuHolder->childSetEnabled("Land Buy Pass", LLPanelLandGeneral::enableBuyPass(NULL)); -#ifndef STINSON_ADULT_CHECK_HACK - BOOL buyable = gSavedSettings.getBOOL("AdultCheckEnablePurchse") || enable_buy_land(NULL); -#else // STINSON_ADULT_CHECK_HACK BOOL buyable = enable_buy_land(NULL); -#endif // STINSON_ADULT_CHECK_HACK gMenuHolder->childSetEnabled("Land Buy", buyable); gMenuHolder->childSetEnabled("Buy Land...", buyable); } @@ -3244,12 +3237,6 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm bool enable_buy_object() { -#ifndef STINSON_ADULT_CHECK_HACK - if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) - { - return true; - } -#endif // STINSON_ADULT_CHECK_HACK // In order to buy, there must only be 1 purchaseable object in // the selection manger. if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false; @@ -5966,12 +5953,6 @@ class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(const LLSD& userdata) { -#ifndef STINSON_ADULT_CHECK_HACK - if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) - { - return true; - } -#endif // STINSON_ADULT_CHECK_HACK bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->selectionEmpty() ? LLViewerParcelMgr::getInstance()->getAgentParcel() -- cgit v1.3