[XP Tools] Initial merge Cherry Pick Also modernize llfloaterauction internally, but leave the ui the same for now. Breaks out script_question_mute() in llviewermessage.cpp to better sync with upstream Adds support for UnknownScriptQuestion notification (translators need to translate this one~) RLVa note: Rewrote RLVa permissions handling block just a bit. Added 13 new capabilities from the XP Tools, I doubt all of them really exist. Minor update to LLComboBox, decided against implementing LLIconsComboBox for now. Modified LLExperienceLog::notify to lookup names and display them along with the slurls since our editors don't do that automatically. Experience tweak: Changed a few notify's to notifytips so that we can click the links to experience profiles from chat instead of via hacked in buttons Migrated LLFloaterCompileQueue to a proper Instance Tracker so we can call getKey Modernized LLSD, gives us reverse iterators and the new debugging impl. We needed the reverse iterators. Experience tweak: Added virtual destructors to responders. Updated llhandle.h to allow calling getDerivedHandle in public. Updated LLScrollContainer and LLScrollBar to be more modern. Added LLFlatListView/flat_list_view from upstream - these don't seem work though? Added some newer login/logout strings to strings.xml Thanks for the default timeout policies, Aleric~ To avoid needing to scroll through tabs, about land tabs now are as big as they need to be to display their labels, same on groups Group Members and Roles has been renamed to just Members because this allows the new Experiences tab enough room to display. Thanks to Henri Beauchamp (Cool VL Viewer) for the setupList augmentation. (without it, I'd still be stuck) Thanks to Shyotl for the helpsies~ Added the LSL constants, events, and functions that LL neglected to put in. Added click callbacks and name lookups for profile linky texts~ Merge is up to 22b4cdc Old TODO: Get the uis looking nice (profiles? Experiences... floater) - done Old TODO: Make sure flatlistviews look okay... - Not using Old TODO: Fix LLFloaterExperiencePicker, right now the panel does not show. - unsure Old TODO: Remove the llfloaterabout.cpp change. - done Merges llexperiencecache with upstream and unstable Introduces LLCoroResponder, TODO: Make everything use this. Updates Reporter floater to the latest, supports the new cap thingy Also adds these commits/changes: [XPTools] Double clicking experiences in namelists should open the profile Add List.CopyNames support for Experiences [XP Tools] Some UI work, I'll do more later [XPTools] More UI Stuff, Later is now! Allow getSLURL for experiences WIP Experience list menu Also make EXPERIENCE > OBJECT, because mainline started OBJECT already [XPTools] Add Experience support to Name UI [XPTools] Fix experience profile UI 9c3067e843265587e91c659200a8d783acf2d9b2 [XPTools] Fix experience location showing "last" and getting set to "last" [XPTools] Move Experiences floater from view menu to world menu [XPTools] Fix up more UI [XPTools] Fix experiences panels [XPTools] Hide pieces of the Experiences menu when they're not usable [XPTools] More UI work, mostly to get the menus working [XPTools] The events list is for events, not experiences, remove menu # Conflicts: # indra/llcommon/llsd.cpp - merge with unstable branch # indra/llmessage/message_prehash.cpp # indra/llmessage/message_prehash.h # indra/llui/llscrollbar.cpp # indra/llui/llscrollcontainer.cpp # indra/llui/llurlentry.cpp # indra/llui/llurlregistry.cpp # indra/newview/app_settings/keywords.ini # indra/newview/app_settings/settings.xml # indra/newview/llappviewer.cpp # indra/newview/llappviewer.h # indra/newview/llassetuploadresponders.cpp # indra/newview/llcompilequeue.* - merge stable # indra/newview/llfloaterabout.cpp # indra/newview/llfloaterland.* - merge unstable # indra/newview/llfloaterproperties.cpp # indra/newview/llfloaterregioninfo.* - merge unstable # indra/newview/llmenucommands.cpp - merge unstable # indra/newview/llpreviewscript.cpp - merge unstable # indra/newview/llviewermessage.cpp - merge unstable # indra/newview/llviewerregion.cpp - merge unstable # indra/newview/skins/default/textures/textures.xml - merge unstable # indra/newview/skins/default/xui/en-us/strings.xml - merge unstable
296 lines
14 KiB
C++
296 lines
14 KiB
C++
/**
|
|
* @file llmenucommands.cpp
|
|
* @brief Implementations of menu commands.
|
|
*
|
|
* $LicenseInfo:firstyear=2003&license=viewergpl$
|
|
*
|
|
* Copyright (c) 2003-2009, Linden Research, Inc.
|
|
*
|
|
* 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://secondlifegrid.net/programs/open_source/licensing/gplv2
|
|
*
|
|
* 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://secondlifegrid.net/programs/open_source/licensing/flossexception
|
|
*
|
|
* 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.
|
|
*
|
|
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
|
|
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
|
|
* COMPLETENESS OR PERFORMANCE.
|
|
* $/LicenseInfo$
|
|
*/
|
|
|
|
#include "llviewerprecompiledheaders.h"
|
|
|
|
#include "llmenucommands.h"
|
|
|
|
#include "aihttpview.h"
|
|
#include "alfloaterregiontracker.h"
|
|
#include "floaterao.h"
|
|
#include "floaterlocalassetbrowse.h"
|
|
#include "hbfloatergrouptitles.h"
|
|
#include "jcfloaterareasearch.h"
|
|
#include "llagentcamera.h"
|
|
#include "llchatbar.h"
|
|
#include "llconsole.h"
|
|
#include "lldebugview.h"
|
|
#include "llfasttimerview.h"
|
|
#include "llfloaterabout.h"
|
|
#include "llfloateractivespeakers.h"
|
|
#include "llfloaterautoreplacesettings.h"
|
|
#include "llfloateravatar.h"
|
|
#include "llfloateravatarlist.h"
|
|
#include "llfloaterbeacons.h"
|
|
#include "llfloaterblacklist.h"
|
|
#include "llfloaterbuildoptions.h"
|
|
#include "llfloaterbump.h"
|
|
#include "llfloaterbuycurrency.h"
|
|
#include "llfloatercamera.h"
|
|
#include "llfloaterchat.h"
|
|
#include "llfloaterchatterbox.h"
|
|
#include "llfloatercustomize.h"
|
|
#include "llfloaterdaycycle.h"
|
|
#include "llfloaterdestinations.h"
|
|
#include "llfloaterdisplayname.h"
|
|
#include "llfloatereditui.h"
|
|
#include "llfloaterenvsettings.h"
|
|
#include "llfloaterexperiences.h"
|
|
#include "llfloaterexploreanimations.h"
|
|
#include "llfloaterexploresounds.h"
|
|
#include "llfloaterfonttest.h"
|
|
#include "llfloatergesture.h"
|
|
#include "llfloatergodtools.h"
|
|
#include "llfloaterhud.h"
|
|
#include "llfloaterinspect.h"
|
|
#include "llfloaterinventory.h"
|
|
#include "llfloaterjoystick.h"
|
|
#include "llfloaterland.h"
|
|
#include "llfloaterlandholdings.h"
|
|
#include "llfloatermap.h"
|
|
#include "llfloatermarketplacelistings.h"
|
|
#include "llfloatermediafilter.h"
|
|
#include "llfloatermemleak.h"
|
|
#include "llfloatermessagelog.h"
|
|
#include "llfloatermute.h"
|
|
#include "llfloaternotificationsconsole.h"
|
|
#include "llfloaterpathfindingcharacters.h"
|
|
#include "llfloaterpathfindinglinksets.h"
|
|
#include "llfloaterperms.h"
|
|
#include "llfloaterpostprocess.h"
|
|
#include "llfloaterpreference.h"
|
|
#include "llfloaterregiondebugconsole.h"
|
|
#include "llfloaterregioninfo.h"
|
|
#include "llfloaterreporter.h"
|
|
#include "llfloaterscriptdebug.h"
|
|
#include "llfloaterscriptlimits.h"
|
|
#include "llfloatersettingsdebug.h"
|
|
#include "llfloatersnapshot.h"
|
|
#include "llfloaterstats.h"
|
|
#include "llfloaterteleporthistory.h"
|
|
#include "llfloatertest.h"
|
|
#include "llfloatervoiceeffect.h"
|
|
#include "llfloaterwater.h"
|
|
#include "llfloaterwebcontent.h"
|
|
#include "llfloaterwindlight.h"
|
|
#include "llfloaterworldmap.h"
|
|
#include "llframestatview.h"
|
|
#include "llmakeoutfitdialog.h"
|
|
#include "llmoveview.h" // LLFloaterMove
|
|
#include "lltextureview.h"
|
|
#include "lltoolgrab.h"
|
|
#include "lltoolmgr.h"
|
|
#include "lluictrlfactory.h"
|
|
#include "llvelocitybar.h"
|
|
#include "llviewerparcelmgr.h"
|
|
// [RLVa:LF]
|
|
#include "rlvfloaters.h"
|
|
// [/RLVa:LF]
|
|
#include "shfloatermediaticker.h"
|
|
|
|
void handle_debug_avatar_textures(void*);
|
|
template<typename T> void handle_singleton_toggle(void*);
|
|
void show_outfit_dialog() { new LLMakeOutfitDialog(false); }
|
|
class LLFloaterExperiencePicker* show_xp_picker(const LLSD& key);
|
|
void toggle_build() { LLToolMgr::getInstance()->toggleBuildMode(); }
|
|
void toggle_control(const std::string& name) { if (LLControlVariable* control = gSavedSettings.getControl(name)) control->set(!control->get()); }
|
|
void toggle_search_floater();
|
|
void toggle_always_run() { gAgent.getAlwaysRun() ? gAgent.clearAlwaysRun() : gAgent.setAlwaysRun(); }
|
|
void toggle_sit();
|
|
void toggle_mouselook() { gAgentCamera.cameraMouselook() ? gAgentCamera.changeCameraToDefault() : gAgentCamera.changeCameraToMouselook(); }
|
|
|
|
bool is_visible_view(std::function<LLView* ()> get)
|
|
{
|
|
if (LLView* v = get())
|
|
return v->getVisible();
|
|
return false;
|
|
}
|
|
|
|
struct CommWrapper
|
|
{
|
|
static bool only_comm()
|
|
{
|
|
static const LLCachedControl<bool> only("CommunicateSpecificShortcut");
|
|
return only || LLFloaterChatterBox::getInstance()->getFloaterCount();
|
|
}
|
|
static bool instanceVisible(const LLSD& key) { return only_comm() ? LLFloaterChatterBox::instanceVisible(key) : LLFloaterMyFriends::instanceVisible(key); }
|
|
static void toggleInstance(const LLSD& key) { only_comm() ? LLFloaterChatterBox::toggleInstance(key) : LLFloaterMyFriends::toggleInstance(key); }
|
|
};
|
|
|
|
struct MenuFloaterDict : public LLSingleton<MenuFloaterDict>
|
|
{
|
|
typedef std::map<const std::string, std::pair<std::function<void ()>, std::function<bool ()> > > menu_floater_map_t;
|
|
menu_floater_map_t mEntries;
|
|
|
|
MenuFloaterDict()
|
|
{
|
|
registerConsole("debug console", gDebugView->mDebugConsolep);
|
|
registerConsole("fast timers", gDebugView->mFastTimerView);
|
|
registerConsole("frame console", gDebugView->mFrameStatView);
|
|
registerConsole("http console", gHttpView);
|
|
registerConsole("texture console", gTextureView);
|
|
if (gAuditTexture)
|
|
{
|
|
registerConsole("texture category console", gTextureCategoryView);
|
|
registerConsole("texture size console", gTextureSizeView);
|
|
}
|
|
registerConsole("velocity", gVelocityBar);
|
|
registerFloater("about", boost::bind(&LLFloaterAbout::show,nullptr));
|
|
registerFloater("always run", boost::bind(toggle_always_run), boost::bind(&LLAgent::getAlwaysRun, &gAgent));
|
|
registerFloater("anims_explorer", boost::bind(LLFloaterExploreAnimations::show));
|
|
registerFloater("appearance", boost::bind(LLFloaterCustomize::show));
|
|
registerFloater("asset_blacklist", boost::bind(LLFloaterBlacklist::toggle), boost::bind(LLFloaterBlacklist::visible));
|
|
registerFloater("build", boost::bind(toggle_build));
|
|
registerFloater("buy currency", boost::bind(LLFloaterBuyCurrency::buyCurrency));
|
|
registerFloater("buy land", boost::bind(&LLViewerParcelMgr::startBuyLand, boost::bind(LLViewerParcelMgr::getInstance), false));
|
|
registerFloater("complaint reporter", boost::bind(LLFloaterReporter::showFromMenu, COMPLAINT_REPORT));
|
|
registerFloater("DayCycle", boost::bind(LLFloaterDayCycle::show), boost::bind(LLFloaterDayCycle::isOpen));
|
|
registerFloater("debug avatar", boost::bind(handle_debug_avatar_textures, nullptr));
|
|
registerFloater("debug settings", boost::bind(handle_singleton_toggle<LLFloaterSettingsDebug>, nullptr));
|
|
registerFloater("edit ui", boost::bind(LLFloaterEditUI::show, nullptr));
|
|
registerFloater("EnvSettings", boost::bind(LLFloaterEnvSettings::show), boost::bind(LLFloaterEnvSettings::isOpen));
|
|
registerFloater("experience_search", boost::bind(show_xp_picker, LLSD()));
|
|
registerFloater("fly", boost::bind(LLAgent::toggleFlying));
|
|
registerFloater("font test", boost::bind(LLFloaterFontTest::show, nullptr));
|
|
registerFloater("god tools", boost::bind(LLFloaterGodTools::show, nullptr));
|
|
registerFloater("grid options", boost::bind(LLFloaterBuildOptions::show, nullptr));
|
|
registerFloater("group titles", boost::bind(HBFloaterGroupTitles::toggle));
|
|
//Singu TODO: Re-implement f1 help.
|
|
//registerFloater("help f1", boost::bind(/*gViewerHtmlHelp.show*/));
|
|
registerFloater("help tutorial", boost::bind(LLFloaterHUD::showHUD));
|
|
registerFloater("inventory", boost::bind(LLPanelMainInventory::toggleVisibility, nullptr), boost::bind(is_visible_view, static_cast<std::function<LLView* ()> >(LLPanelMainInventory::getActiveInventory)));
|
|
registerFloater("local assets", boost::bind(FloaterLocalAssetBrowser::show, (void*)0));
|
|
registerFloater("mean events", boost::bind(LLFloaterBump::show, nullptr));
|
|
registerFloater("media ticker", boost::bind(handle_ticker_toggle, nullptr), boost::bind(SHFloaterMediaTicker::instanceExists));
|
|
registerFloater("memleak", boost::bind(LLFloaterMemLeak::show, nullptr));
|
|
registerFloater("messagelog", boost::bind(LLFloaterMessageLog::show));
|
|
registerFloater("mouselook", boost::bind(toggle_mouselook));
|
|
registerFloater("my land", boost::bind(LLFloaterLandHoldings::show, nullptr));
|
|
registerFloater("outfit", boost::bind(show_outfit_dialog));
|
|
registerFloater("preferences", boost::bind(LLFloaterPreference::show, nullptr));
|
|
registerFloater("quit", boost::bind(&LLAppViewer::userQuit, LLAppViewer::instance()));
|
|
registerFloater("RegionDebugConsole", boost::bind(handle_singleton_toggle<LLFloaterRegionDebugConsole>, nullptr), boost::bind(LLFloaterRegionDebugConsole::instanceExists));
|
|
registerFloater("script errors", boost::bind(LLFloaterScriptDebug::show, LLUUID::null));
|
|
registerFloater("search", boost::bind(toggle_search_floater));
|
|
registerFloater("show inspect", boost::bind(LLFloaterInspect::showInstance, LLSD()));
|
|
registerFloater("sit", boost::bind(toggle_sit));
|
|
registerFloater("snapshot", boost::bind(LLFloaterSnapshot::show, nullptr));
|
|
registerFloater("sound_explorer", boost::bind(LLFloaterExploreSounds::toggle), boost::bind(LLFloaterExploreSounds::visible));
|
|
registerFloater("test", boost::bind(LLFloaterTest::show, nullptr));
|
|
// Phoenix: Wolfspirit: Enabled Show Floater out of viewer menu
|
|
registerFloater("WaterSettings", boost::bind(LLFloaterWater::show), boost::bind(LLFloaterWater::isOpen));
|
|
registerFloater("Windlight", boost::bind(LLFloaterWindLight::show), boost::bind(LLFloaterWindLight::isOpen));
|
|
registerFloater("world map", boost::bind(LLFloaterWorldMap::toggle));
|
|
registerFloater<LLFloaterLand> ("about land");
|
|
registerFloater<LLFloaterRegionInfo> ("about region");
|
|
registerFloater<LLFloaterActiveSpeakers> ("active speakers");
|
|
registerFloater<LLFloaterAO> ("ao");
|
|
registerFloater<JCFloaterAreaSearch> ("areasearch");
|
|
registerFloater<LLFloaterAutoReplaceSettings> ("autoreplace");
|
|
registerFloater<LLFloaterAvatar> ("avatar");
|
|
registerFloater<LLFloaterBeacons> ("beacons");
|
|
registerFloater<LLFloaterCamera> ("camera controls");
|
|
registerFloater<LLFloaterChat> ("chat history");
|
|
registerFloater<LLFloaterChatterBox> ("communicate");
|
|
registerFloater<LLFloaterDestinations> ("destinations");
|
|
registerFloater<LLFloaterDisplayName> ("displayname");
|
|
registerFloater<LLFloaterExperiences> ("experiences");
|
|
registerFloater<LLFloaterMyFriends> ("friends", 0);
|
|
registerFloater<LLFloaterGesture> ("gestures");
|
|
registerFloater<LLFloaterMyFriends> ("groups", 1);
|
|
registerFloater<CommWrapper> ("im");
|
|
registerFloater<LLFloaterInspect> ("inspect");
|
|
registerFloater<LLFloaterJoystick> ("joystick");
|
|
registerFloater<LLFloaterMediaFilter> ("media filter");
|
|
registerFloater<LLFloaterMap> ("mini map");
|
|
registerFloater<LLFloaterMarketplaceListings> ("marketplace_listings");
|
|
registerFloater<LLFloaterMove> ("movement controls");
|
|
registerFloater<LLFloaterMute> ("mute list");
|
|
registerFloater<LLFloaterNotificationConsole> ("notifications console");
|
|
registerFloater<LLFloaterPathfindingCharacters> ("pathfinding_characters");
|
|
registerFloater<LLFloaterPathfindingLinksets> ("pathfinding_linksets");
|
|
registerFloater<LLFloaterPermsDefault> ("perm prefs");
|
|
registerFloater<LLFloaterPostProcess> ("PostProcess");
|
|
registerFloater<LLFloaterAvatarList> ("radar");
|
|
registerFloater<ALFloaterRegionTracker> ("region_tracker");
|
|
registerFloater<LLFloaterScriptLimits> ("script info");
|
|
registerFloater<LLFloaterStats> ("stat bar");
|
|
registerFloater<LLFloaterTeleportHistory> ("teleport history");
|
|
registerFloater<LLFloaterVoiceEffect> ("voice effect");
|
|
// [RLVa:LF]
|
|
registerFloater<RlvFloaterBehaviours>("rlv restrictions");
|
|
registerFloater<RlvFloaterLocks>("rlv locks");
|
|
registerFloater<RlvFloaterStrings>("rlv strings");
|
|
// [/RLVa:LF]
|
|
}
|
|
public:
|
|
template <typename T>
|
|
void registerConsole(const std::string& name, T* console)
|
|
{
|
|
registerFloater(name, boost::bind(&T::setVisible, console, !boost::bind(&T::getVisible, console)), boost::bind(&T::getVisible, console));
|
|
}
|
|
void registerFloater(const std::string& name, std::function<void ()> show, std::function<bool ()> visible = nullptr)
|
|
{
|
|
mEntries.insert( std::make_pair( name, std::make_pair( show, visible ) ) );
|
|
}
|
|
template <typename T>
|
|
void registerFloater(const std::string& name, const LLSD& key = LLSD())
|
|
{
|
|
registerFloater(name, boost::bind(&T::toggleInstance,key), boost::bind(&T::instanceVisible,key));
|
|
}
|
|
};
|
|
|
|
void show_floater(const std::string& floater_name)
|
|
{
|
|
if (floater_name.empty()) return;
|
|
|
|
MenuFloaterDict::menu_floater_map_t::iterator it = MenuFloaterDict::instance().mEntries.find(floater_name);
|
|
if (it == MenuFloaterDict::instance().mEntries.end()) // Simple codeless floater
|
|
{
|
|
if (LLFloater* floater = LLUICtrlFactory::getInstance()->getBuiltFloater(floater_name))
|
|
floater->isFrontmost() ? floater->close() : gFloaterView->bringToFront(floater);
|
|
else
|
|
LLUICtrlFactory::getInstance()->buildFloater(new LLFloater(), floater_name);
|
|
}
|
|
else if (it->second.first)
|
|
{
|
|
it->second.first();
|
|
}
|
|
}
|
|
|
|
// Singu TODO: It'd be reallllly nice if we could use this as a control for buttons too.
|
|
bool floater_visible(const std::string& floater_name)
|
|
{
|
|
MenuFloaterDict::menu_floater_map_t::iterator it = MenuFloaterDict::instance().mEntries.find(floater_name);
|
|
return it != MenuFloaterDict::instance().mEntries.end() && it->second.second && it->second.second();
|
|
}
|