diff options
Diffstat (limited to 'indra/newview/llfirstuse.cpp')
-rw-r--r-- | indra/newview/llfirstuse.cpp | 195 |
1 files changed, 105 insertions, 90 deletions
diff --git a/indra/newview/llfirstuse.cpp b/indra/newview/llfirstuse.cpp index c07319e224..4d5b08243a 100644 --- a/indra/newview/llfirstuse.cpp +++ b/indra/newview/llfirstuse.cpp @@ -2,30 +2,25 @@ * @file llfirstuse.cpp * @brief Methods that spawn "first-use" dialogs * - * $LicenseInfo:firstyear=2003&license=viewergpl$ - * - * Copyright (c) 2003-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2003&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -35,21 +30,22 @@ // library includes #include "indra_constants.h" +#include "llnotificationsutil.h" // viewer includes -#include "llnotify.h" +#include "llagent.h" // for gAgent.inPrelude() #include "llviewercontrol.h" #include "llui.h" #include "llappviewer.h" +#include "lltracker.h" +/* // static -std::set<LLString> LLFirstUse::sConfigVariables; +std::set<std::string> LLFirstUse::sConfigVariables; // static -void LLFirstUse::addConfigVariable(const LLString& var) +void LLFirstUse::addConfigVariable(const std::string& var) { - //Don't add the warning, now that we're storing the default in the settings_default.xml file - //gSavedSettings.addWarning(var); sConfigVariables.insert(var); } @@ -57,10 +53,10 @@ void LLFirstUse::addConfigVariable(const LLString& var) void LLFirstUse::disableFirstUse() { // Set all first-use warnings to disabled - for (std::set<LLString>::iterator iter = sConfigVariables.begin(); + for (std::set<std::string>::iterator iter = sConfigVariables.begin(); iter != sConfigVariables.end(); ++iter) { - gSavedSettings.setWarning(*iter, FALSE); + gWarningSettings.setBOOL(*iter, FALSE); } } @@ -68,24 +64,25 @@ void LLFirstUse::disableFirstUse() void LLFirstUse::resetFirstUse() { // Set all first-use warnings to disabled - for (std::set<LLString>::iterator iter = sConfigVariables.begin(); + for (std::set<std::string>::iterator iter = sConfigVariables.begin(); iter != sConfigVariables.end(); ++iter) { - gSavedSettings.setWarning(*iter, TRUE); + gWarningSettings.setBOOL(*iter, TRUE); } } - +*/ +/* // Called whenever the viewer detects that your balance went up void LLFirstUse::useBalanceIncrease(S32 delta) { - if (gSavedSettings.getWarning("FirstBalanceIncrease")) + if (gWarningSettings.getBOOL("FirstBalanceIncrease")) { - gSavedSettings.setWarning("FirstBalanceIncrease", FALSE); + gWarningSettings.setBOOL("FirstBalanceIncrease", FALSE); - LLString::format_map_t args; - args["[AMOUNT]"] = llformat("%d",delta); - LLNotifyBox::showXml("FirstBalanceIncrease", args); + LLSD args; + args["AMOUNT"] = llformat("%d",delta); + LLNotificationsUtil::add("FirstBalanceIncrease", args); } } @@ -93,13 +90,13 @@ void LLFirstUse::useBalanceIncrease(S32 delta) // Called whenever the viewer detects your balance went down void LLFirstUse::useBalanceDecrease(S32 delta) { - if (gSavedSettings.getWarning("FirstBalanceDecrease")) + if (gWarningSettings.getBOOL("FirstBalanceDecrease")) { - gSavedSettings.setWarning("FirstBalanceDecrease", FALSE); + gWarningSettings.setBOOL("FirstBalanceDecrease", FALSE); - LLString::format_map_t args; - args["[AMOUNT]"] = llformat("%d",-delta); - LLNotifyBox::showXml("FirstBalanceDecrease", args); + LLSD args; + args["AMOUNT"] = llformat("%d",-delta); + LLNotificationsUtil::add("FirstBalanceDecrease", args); } } @@ -107,22 +104,24 @@ void LLFirstUse::useBalanceDecrease(S32 delta) // static void LLFirstUse::useSit() { - if (gSavedSettings.getWarning("FirstSit")) - { - gSavedSettings.setWarning("FirstSit", FALSE); - - LLNotifyBox::showXml("FirstSit"); - } + // Our orientation island uses sitting to teach vehicle driving + // so just never show this message. JC + //if (gWarningSettings.getBOOL("FirstSit")) + //{ + // gWarningSettings.setBOOL("FirstSit", FALSE); + // + // LLNotificationsUtil::add("FirstSit"); + //} } // static void LLFirstUse::useMap() { - if (gSavedSettings.getWarning("FirstMap")) + if (gWarningSettings.getBOOL("FirstMap")) { - gSavedSettings.setWarning("FirstMap", FALSE); + gWarningSettings.setBOOL("FirstMap", FALSE); - LLNotifyBox::showXml("FirstMap"); + LLNotificationsUtil::add("FirstMap"); } } @@ -135,47 +134,59 @@ void LLFirstUse::useGoTo() // static void LLFirstUse::useBuild() { - if (gSavedSettings.getWarning("FirstBuild")) + if (gWarningSettings.getBOOL("FirstBuild")) { - gSavedSettings.setWarning("FirstBuild", FALSE); + gWarningSettings.setBOOL("FirstBuild", FALSE); - LLNotifyBox::showXml("FirstBuild"); + LLNotificationsUtil::add("FirstBuild"); } } - + + */ +/* // static void LLFirstUse::useLeftClickNoHit() { - if (gSavedSettings.getWarning("FirstLeftClickNoHit")) + if (gWarningSettings.getBOOL("FirstLeftClickNoHit")) { - gSavedSettings.setWarning("FirstLeftClickNoHit", FALSE); + gWarningSettings.setBOOL("FirstLeftClickNoHit", FALSE); - LLNotifyBox::showXml("FirstLeftClickNoHit"); + LLNotificationsUtil::add("FirstLeftClickNoHit"); } } - +*/ +/* // static void LLFirstUse::useTeleport() { - if (gSavedSettings.getWarning("FirstTeleport")) + if (gWarningSettings.getBOOL("FirstTeleport")) { - gSavedSettings.setWarning("FirstTeleport", FALSE); + LLVector3d teleportDestination = LLTracker::getTrackedPositionGlobal(); + if(teleportDestination != LLVector3d::zero) + { + gWarningSettings.setBOOL("FirstTeleport", FALSE); - LLNotifyBox::showXml("FirstTeleport"); + LLNotificationsUtil::add("FirstTeleport"); + } } } - +*/ // static void LLFirstUse::useOverrideKeys() { - if (gSavedSettings.getWarning("FirstOverrideKeys")) + // Our orientation island uses key overrides to teach vehicle driving + // so don't show this message until you get off OI. JC + if (!gAgent.inPrelude()) { - gSavedSettings.setWarning("FirstOverrideKeys", FALSE); + if (gWarningSettings.getBOOL("FirstOverrideKeys")) + { + gWarningSettings.setBOOL("FirstOverrideKeys", FALSE); - LLNotifyBox::showXml("FirstOverrideKeys"); + LLNotificationsUtil::add("FirstOverrideKeys"); + } } } - +/* // static void LLFirstUse::useAttach() { @@ -185,70 +196,71 @@ void LLFirstUse::useAttach() // static void LLFirstUse::useAppearance() { - if (gSavedSettings.getWarning("FirstAppearance")) + if (gWarningSettings.getBOOL("FirstAppearance")) { - gSavedSettings.setWarning("FirstAppearance", FALSE); + gWarningSettings.setBOOL("FirstAppearance", FALSE); - LLNotifyBox::showXml("FirstAppearance"); + LLNotificationsUtil::add("FirstAppearance"); } } // static void LLFirstUse::useInventory() { - if (gSavedSettings.getWarning("FirstInventory")) + if (gWarningSettings.getBOOL("FirstInventory")) { - gSavedSettings.setWarning("FirstInventory", FALSE); + gWarningSettings.setBOOL("FirstInventory", FALSE); - LLNotifyBox::showXml("FirstInventory"); + LLNotificationsUtil::add("FirstInventory"); } } +*/ // static void LLFirstUse::useSandbox() { - if (gSavedSettings.getWarning("FirstSandbox")) + if (gWarningSettings.getBOOL("FirstSandbox")) { - gSavedSettings.setWarning("FirstSandbox", FALSE); + gWarningSettings.setBOOL("FirstSandbox", FALSE); - LLString::format_map_t args; - args["[HOURS]"] = llformat("%d",SANDBOX_CLEAN_FREQ); - args["[TIME]"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR); - LLNotifyBox::showXml("FirstSandbox", args); + LLSD args; + args["HOURS"] = llformat("%d",SANDBOX_CLEAN_FREQ); + args["TIME"] = llformat("%d",SANDBOX_FIRST_CLEAN_HOUR); + LLNotificationsUtil::add("FirstSandbox", args); } } - +/* // static void LLFirstUse::useFlexible() { - if (gSavedSettings.getWarning("FirstFlexible")) + if (gWarningSettings.getBOOL("FirstFlexible")) { - gSavedSettings.setWarning("FirstFlexible", FALSE); + gWarningSettings.setBOOL("FirstFlexible", FALSE); - LLNotifyBox::showXml("FirstFlexible"); + LLNotificationsUtil::add("FirstFlexible"); } } // static void LLFirstUse::useDebugMenus() { - if (gSavedSettings.getWarning("FirstDebugMenus")) + if (gWarningSettings.getBOOL("FirstDebugMenus")) { - gSavedSettings.setWarning("FirstDebugMenus", FALSE); + gWarningSettings.setBOOL("FirstDebugMenus", FALSE); - LLNotifyBox::showXml("FirstDebugMenus"); + LLNotificationsUtil::add("FirstDebugMenus"); } } // static void LLFirstUse::useSculptedPrim() { - if (gSavedSettings.getWarning("FirstSculptedPrim")) + if (gWarningSettings.getBOOL("FirstSculptedPrim")) { - gSavedSettings.setWarning("FirstSculptedPrim", FALSE); + gWarningSettings.setBOOL("FirstSculptedPrim", FALSE); - LLNotifyBox::showXml("FirstSculptedPrim"); + LLNotificationsUtil::add("FirstSculptedPrim"); } } @@ -256,10 +268,13 @@ void LLFirstUse::useSculptedPrim() // static void LLFirstUse::useMedia() { - if (gSavedSettings.getWarning("FirstMedia")) + if (gWarningSettings.getBOOL("FirstMedia")) { - gSavedSettings.setWarning("FirstMedia", FALSE); + gWarningSettings.setBOOL("FirstMedia", FALSE); - LLNotifyBox::showXml("FirstMedia"); + // Popup removed as a short-term fix for EXT-1643. + // Ultimately, the plan is to kill all First Use dialogs + //LLNotificationsUtil::add("FirstMedia"); } } +*/ |