# Conflicts:
#	indra/llui/llfloaterreg.cpp
#	indra/llui/llnotifications.cpp
#	indra/llui/llpanel.cpp
#	indra/llui/llui.cpp
#	indra/llui/lluicolortable.cpp
#	indra/llui/lluicolortable.h
#	indra/newview/llappviewer.h
#	indra/newview/llfloatersidepanelcontainer.cpp
#	indra/newview/llfloatersidepanelcontainer.h
#	indra/newview/llpanelpeoplemenus.cpp
#	indra/newview/llviewermenufile.cpp
#	indra/newview/llviewertexturelist.cpp
#	indra/newview/skins/default/xui/en/notifications.xml
master
Ansariel 2024-07-03 01:11:47 +02:00
commit 3d9414c1f2
92 changed files with 959 additions and 603 deletions

View File

@ -201,11 +201,11 @@ void delete_and_clear_array(T*& ptr)
// foo[2] = "hello";
// const char* bar = get_ptr_in_map(foo, 2); // bar -> "hello"
// const char* baz = get_ptr_in_map(foo, 3); // baz == NULL
template <typename K, typename T>
inline T* get_ptr_in_map(const std::map<K,T*>& inmap, const K& key)
template <typename T>
inline typename T::mapped_type get_ptr_in_map(const T& inmap, typename T::key_type const& key)
{
// Typedef here avoids warnings because of new c++ naming rules.
typedef typename std::map<K,T*>::const_iterator map_iter;
typedef typename T::const_iterator map_iter;
map_iter iter = inmap.find(key);
if(iter == inmap.end())
{

View File

@ -36,7 +36,7 @@ static LLDefaultChildRegistry::Register<LLBadge> r("badge");
static const S32 BADGE_OFFSET_NOT_SPECIFIED = 0x7FFFFFFF;
// Compiler optimization, generate extern template
template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, bool recurse) const;
template class LLBadge* LLView::getChild<class LLBadge>(std::string_view name, bool recurse) const;
LLBadge::Params::Params()

View File

@ -171,7 +171,7 @@ private:
// Build time optimization, generate once in .cpp file
#ifndef LLBADGE_CPP
extern template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, bool recurse) const;
extern template class LLBadge* LLView::getChild<class LLBadge>(std::string_view name, bool recurse) const;
#endif
#endif // LL_LLBADGE_H

View File

@ -58,7 +58,7 @@ static LLDefaultChildRegistry::Register<LLButton> r("button");
// Compiler optimization, generate extern template
template class LLButton* LLView::getChild<class LLButton>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
// globals
S32 LLBUTTON_H_PAD = 4;
@ -1348,7 +1348,7 @@ void LLButton::setFloaterToggle(LLUICtrl* ctrl, const LLSD& sdname)
// Set the button control value (toggle state) to the floater visibility control (Sets the value as well)
button->setControlVariable(LLFloater::getControlGroup()->getControl(vis_control_name));
// Set the clicked callback to toggle the floater
button->setClickedCallback(boost::bind(&LLFloaterReg::toggleInstance, sdname, LLSD()));
button->setClickedCallback([=](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(sdname.asString(), LLSD()); });
}
// static

View File

@ -422,7 +422,7 @@ protected:
// Build time optimization, generate once in .cpp file
#ifndef LLBUTTON_CPP
extern template class LLButton* LLView::getChild<class LLButton>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif // LL_LLBUTTON_H

View File

@ -45,7 +45,7 @@ static LLDefaultChildRegistry::Register<LLCheckBoxCtrl> r("check_box");
// Compiler optimization, generate extern template
template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
void LLCheckBoxCtrl::WordWrap::declareValues()
{

View File

@ -167,7 +167,7 @@ protected:
// Build time optimization, generate once in .cpp file
#ifndef LLCHECKBOXCTRL_CPP
extern template class LLCheckBoxCtrl* LLView::getChild<class LLCheckBoxCtrl>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif // LL_LLCHECKBOXCTRL_H

View File

@ -41,9 +41,9 @@
LLFloaterReg::instance_list_t LLFloaterReg::sNullInstanceList;
LLFloaterReg::instance_map_t LLFloaterReg::sInstanceMap;
LLFloaterReg::build_map_t LLFloaterReg::sBuildMap;
std::map<std::string,std::string> LLFloaterReg::sGroupMap;
std::map<std::string, std::string, std::less<>> LLFloaterReg::sGroupMap;
bool LLFloaterReg::sBlockShowFloaters = false;
std::set<std::string> LLFloaterReg::sAlwaysShowableList;
std::set<std::string, std::less<>> LLFloaterReg::sAlwaysShowableList;
static LLFloaterRegListener sFloaterRegListener;
@ -62,34 +62,25 @@ void LLFloaterReg::add(const std::string& name, const std::string& filename, con
sGroupMap[groupname] = groupname; // for referencing directly by group name
}
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g
//static
void LLFloaterReg::addWithFileCallback(const std::string& name, const LLFloaterFileFunc& fileFunc,
const LLFloaterBuildFunc& func, const std::string& groupname)
{
sBuildMap[name].mFunc = func;
sBuildMap[name].mFileFunc = fileFunc;
sGroupMap[name] = groupname.empty() ? name : groupname;
sGroupMap[groupname] = groupname; // for referencing directly by group name
}
// [/SL:KB]
//static
bool LLFloaterReg::isRegistered(const std::string& name)
bool LLFloaterReg::isRegistered(std::string_view name)
{
return sBuildMap.find(name) != sBuildMap.end();
}
//static
LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name)
LLFloater* LLFloaterReg::getLastFloaterInGroup(std::string_view name)
{
const std::string& groupname = sGroupMap[name];
auto it = sGroupMap.find(name);
if (it != sGroupMap.end())
{
const std::string& groupname = it->second;
if (!groupname.empty())
{
instance_list_t& list = sInstanceMap[groupname];
if (!list.empty())
{
for (instance_list_t::reverse_iterator iter = list.rbegin(); iter != list.rend(); ++iter)
for (instance_list_t::reverse_iterator iter = list.rbegin(), end = list.rend(); iter != end; ++iter)
{
LLFloater* inst = *iter;
@ -100,6 +91,7 @@ LLFloater* LLFloaterReg::getLastFloaterInGroup(const std::string& name)
}
}
}
}
return NULL;
}
@ -147,10 +139,8 @@ LLFloater* LLFloaterReg::getLastFloaterCascading()
instance_list_t& instances = sInstanceMap[group_name];
for (instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); ++iter)
for (LLFloater* inst : instances)
{
LLFloater* inst = *iter;
if (inst->getVisible()
&& (inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADING)
|| inst->isPositioning(LLFloaterEnums::POSITIONING_CASCADE_GROUP)))
@ -168,16 +158,18 @@ LLFloater* LLFloaterReg::getLastFloaterCascading()
}
//static
LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key)
LLFloater* LLFloaterReg::findInstance(std::string_view name, const LLSD& key)
{
LLFloater* res = NULL;
const std::string& groupname = sGroupMap[name];
auto it = sGroupMap.find(name);
if (it != sGroupMap.end())
{
const std::string& groupname = it->second;
if (!groupname.empty())
{
instance_list_t& list = sInstanceMap[groupname];
for (instance_list_t::iterator iter = list.begin(); iter != list.end(); ++iter)
for (LLFloater* inst : list)
{
LLFloater* inst = *iter;
if (inst->matchesKey(key))
{
res = inst;
@ -185,23 +177,27 @@ LLFloater* LLFloaterReg::findInstance(const std::string& name, const LLSD& key)
}
}
}
}
return res;
}
//static
LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
LLFloater* LLFloaterReg::getInstance(std::string_view name, const LLSD& key)
{
LLFloater* res = findInstance(name, key);
if (!res)
{
const LLFloaterBuildFunc& build_func = sBuildMap[name].mFunc;
// const std::string& xui_file = sBuildMap[name].mFile;
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.5.0a
const std::string& xui_file = (!sBuildMap[name].mFileFunc) ? sBuildMap[name].mFile : sBuildMap[name].mFileFunc();
// [/SL:KB]
auto it = sBuildMap.find(name);
if (it != sBuildMap.end())
{
const LLFloaterBuildFunc& build_func = it->second.mFunc;
const std::string& xui_file = it->second.mFile;
if (build_func)
{
const std::string& groupname = sGroupMap[name];
auto it = sGroupMap.find(name);
if (it != sGroupMap.end())
{
const std::string& groupname = it->second;
if (!groupname.empty())
{
instance_list_t& list = sInstanceMap[groupname];
@ -224,7 +220,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
{
res->mKey = key;
}
res->setInstanceName(name);
res->setInstanceName(std::string(name));
LLFloater* last_floater = (list.empty() ? NULL : list.back());
@ -235,6 +231,8 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
list.push_back(res);
}
}
}
}
if (!res)
{
LL_WARNS() << "Floater type: '" << name << "' not registered." << LL_ENDL;
@ -244,10 +242,13 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key)
}
//static
LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key)
LLFloater* LLFloaterReg::removeInstance(std::string_view name, const LLSD& key)
{
LLFloater* res = NULL;
const std::string& groupname = sGroupMap[name];
auto it = sGroupMap.find(name);
if (it != sGroupMap.end())
{
const std::string& groupname = it->second;
if (!groupname.empty())
{
instance_list_t& list = sInstanceMap[groupname];
@ -262,12 +263,13 @@ LLFloater* LLFloaterReg::removeInstance(const std::string& name, const LLSD& key
}
}
}
}
return res;
}
//static
// returns true if the instance existed
bool LLFloaterReg::destroyInstance(const std::string& name, const LLSD& key)
bool LLFloaterReg::destroyInstance(std::string_view name, const LLSD& key)
{
LLFloater* inst = removeInstance(name, key);
if (inst)
@ -283,7 +285,7 @@ bool LLFloaterReg::destroyInstance(const std::string& name, const LLSD& key)
// Iterators
//static
LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::string& name)
LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(std::string_view name)
{
instance_map_t::iterator iter = sInstanceMap.find(name);
if (iter != sInstanceMap.end())
@ -300,14 +302,14 @@ LLFloaterReg::const_instance_list_t& LLFloaterReg::getFloaterList(const std::str
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
//static
bool LLFloaterReg::canShowInstance(const std::string& name, const LLSD& key)
bool LLFloaterReg::canShowInstance(std::string_view name, const LLSD& key)
{
return mValidateSignal(name, key);
}
// [/RLVa:KB]
//static
LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, bool focus)
LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bool focus)
{
// if( sBlockShowFloaters
// // see EXT-7090
@ -329,7 +331,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key,
//static
// returns true if the instance exists
bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key)
bool LLFloaterReg::hideInstance(std::string_view name, const LLSD& key)
{
LLFloater* instance = findInstance(name, key);
if (instance)
@ -341,7 +343,7 @@ bool LLFloaterReg::hideInstance(const std::string& name, const LLSD& key)
//static
// returns true if the instance is visible when completed
bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
bool LLFloaterReg::toggleInstance(std::string_view name, const LLSD& key)
{
LLFloater* instance = findInstance(name, key);
if (instance && instance->isShown())
@ -357,7 +359,7 @@ bool LLFloaterReg::toggleInstance(const std::string& name, const LLSD& key)
//static
// returns true if the instance exists and is visible (doesnt matter minimized or not)
bool LLFloaterReg::instanceVisible(const std::string& name, const LLSD& key)
bool LLFloaterReg::instanceVisible(std::string_view name, const LLSD& key)
{
LLFloater* instance = findInstance(name, key);
return LLFloater::isVisible(instance);

View File

@ -58,7 +58,7 @@ public:
// 2) We can change the key of a floater without altering the list.
typedef std::list<LLFloater*> instance_list_t;
typedef const instance_list_t const_instance_list_t;
typedef std::map<std::string, instance_list_t> instance_map_t;
typedef std::map<std::string, instance_list_t, std::less<>> instance_map_t;
struct BuildData
{
@ -68,24 +68,24 @@ public:
// [/SL:KB]
std::string mFile;
};
typedef std::map<std::string, BuildData> build_map_t;
typedef std::map<std::string, BuildData, std::less<>> build_map_t;
private:
friend class LLFloaterRegListener;
static instance_list_t sNullInstanceList;
static instance_map_t sInstanceMap;
static build_map_t sBuildMap;
static std::map<std::string,std::string> sGroupMap;
static std::map<std::string, std::string, std::less<>> sGroupMap;
static bool sBlockShowFloaters;
/**
* Defines list of floater names that can be shown despite state of sBlockShowFloaters.
*/
static std::set<std::string> sAlwaysShowableList;
static std::set<std::string, std::less<>> sAlwaysShowableList;
// [RLVa:KB] - Checked: 2010-02-28 (RLVa-1.4.0a) | Modified: RLVa-1.2.0a
// Used to determine whether a floater can be shown
public:
typedef boost::signals2::signal<bool(const std::string&, const LLSD&), boost_boolean_combiner> validate_signal_t;
typedef boost::signals2::signal<bool(std::string_view, const LLSD&), boost_boolean_combiner> validate_signal_t;
static boost::signals2::connection setValidateCallback(const validate_signal_t::slot_type& cb) { return mValidateSignal.connect(cb); }
private:
static validate_signal_t mValidateSignal;
@ -104,40 +104,35 @@ public:
static void add(const std::string& name, const std::string& file, const LLFloaterBuildFunc& func,
const std::string& groupname = LLStringUtil::null);
static bool isRegistered(const std::string& name);
// [SL:KB] - Patch: UI-Base | Checked: 2010-12-01 (Catznip-3.0.0a) | Added: Catznip-2.4.0g
static void addWithFileCallback(const std::string& name, const LLFloaterFileFunc& fileFunc, const LLFloaterBuildFunc& func,
const std::string& groupname = LLStringUtil::null);
// [/SL:KB]
static bool isRegistered(std::string_view name);
// Helpers
static LLFloater* getLastFloaterInGroup(const std::string& name);
static LLFloater* getLastFloaterInGroup(std::string_view name);
static LLFloater* getLastFloaterCascading();
static instance_list_t getAllFloatersInGroup(LLFloater* floater); // <FS:Ansariel> FIRE-24125: Add option to close all floaters of a group
// Find / get (create) / remove / destroy
static LLFloater* findInstance(const std::string& name, const LLSD& key = LLSD());
static LLFloater* getInstance(const std::string& name, const LLSD& key = LLSD());
static LLFloater* removeInstance(const std::string& name, const LLSD& key = LLSD());
static bool destroyInstance(const std::string& name, const LLSD& key = LLSD());
static LLFloater* findInstance(std::string_view name, const LLSD& key = LLSD());
static LLFloater* getInstance(std::string_view name, const LLSD& key = LLSD());
static LLFloater* removeInstance(std::string_view name, const LLSD& key = LLSD());
static bool destroyInstance(std::string_view name, const LLSD& key = LLSD());
// Iterators
static const_instance_list_t& getFloaterList(const std::string& name);
static const_instance_list_t& getFloaterList(std::string_view name);
// Visibility Management
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
// return false if floater can not be shown (=doesn't pass the validation filter)
static bool canShowInstance(const std::string& name, const LLSD& key = LLSD());
static bool canShowInstance(std::string_view name, const LLSD& key = LLSD());
// [/RLVa:KB]
// return NULL if instance not found or can't create instance (no builder)
static LLFloater* showInstance(const std::string& name, const LLSD& key = LLSD(), bool focus = false);
static LLFloater* showInstance(std::string_view name, const LLSD& key = LLSD(), bool focus = false);
// Close a floater (may destroy or set invisible)
// return false if can't find instance
static bool hideInstance(const std::string& name, const LLSD& key = LLSD());
static bool hideInstance(std::string_view name, const LLSD& key = LLSD());
// return true if instance is visible:
static bool toggleInstance(const std::string& name, const LLSD& key = LLSD());
static bool instanceVisible(const std::string& name, const LLSD& key = LLSD());
static bool toggleInstance(std::string_view name, const LLSD& key = LLSD());
static bool instanceVisible(std::string_view name, const LLSD& key = LLSD());
static void showInitialVisibleInstances();
static void hideVisibleInstances(const std::set<std::string>& exceptions = std::set<std::string>());
@ -162,19 +157,19 @@ public:
// Typed find / get / show
template <class T>
static T* findTypedInstance(const std::string& name, const LLSD& key = LLSD())
static T* findTypedInstance(std::string_view name, const LLSD& key = LLSD())
{
return dynamic_cast<T*>(findInstance(name, key));
}
template <class T>
static T* getTypedInstance(const std::string& name, const LLSD& key = LLSD())
static T* getTypedInstance(std::string_view name, const LLSD& key = LLSD())
{
return dynamic_cast<T*>(getInstance(name, key));
}
template <class T>
static T* showTypedInstance(const std::string& name, const LLSD& key = LLSD(), bool focus = false)
static T* showTypedInstance(std::string_view name, const LLSD& key = LLSD(), bool focus = false)
{
return dynamic_cast<T*>(showInstance(name, key, focus));
}

View File

@ -94,22 +94,22 @@ void LLFloaterRegListener::getBuildMap(const LLSD& event) const
void LLFloaterRegListener::showInstance(const LLSD& event) const
{
LLFloaterReg::showInstance(event["name"], event["key"], event["focus"]);
LLFloaterReg::showInstance(event["name"].asString(), event["key"], event["focus"]);
}
void LLFloaterRegListener::hideInstance(const LLSD& event) const
{
LLFloaterReg::hideInstance(event["name"], event["key"]);
LLFloaterReg::hideInstance(event["name"].asString(), event["key"]);
}
void LLFloaterRegListener::toggleInstance(const LLSD& event) const
{
LLFloaterReg::toggleInstance(event["name"], event["key"]);
LLFloaterReg::toggleInstance(event["name"].asString(), event["key"]);
}
void LLFloaterRegListener::instanceVisible(const LLSD& event) const
{
sendReply(LLSDMap("visible", LLFloaterReg::instanceVisible(event["name"], event["key"])),
sendReply(LLSDMap("visible", LLFloaterReg::instanceVisible(event["name"].asString(), event["key"])),
event);
}
@ -119,7 +119,7 @@ void LLFloaterRegListener::clickButton(const LLSD& event) const
LLReqID reqID(event);
LLSD reply(reqID.makeResponse());
LLFloater* floater = LLFloaterReg::findInstance(event["name"], event["key"]);
LLFloater* floater = LLFloaterReg::findInstance(event["name"].asString(), event["key"]);
if (! LLFloater::isShown(floater))
{
reply["type"] = "LLFloater";
@ -131,7 +131,7 @@ void LLFloaterRegListener::clickButton(const LLSD& event) const
{
// Here 'floater' points to an LLFloater instance with the specified
// name and key which isShown().
LLButton* button = floater->findChild<LLButton>(event["button"]);
LLButton* button = floater->findChild<LLButton>(event["button"].asString());
if (! LLButton::isAvailable(button))
{
reply["type"] = "LLButton";

View File

@ -164,13 +164,13 @@ std::string LLKeywords::getArguments(LLSD& arguments)
return argString;
}
std::string LLKeywords::getAttribute(const std::string& key)
std::string LLKeywords::getAttribute(std::string_view key)
{
attribute_iterator_t it = mAttributes.find(key);
return (it != mAttributes.end()) ? it->second : "";
}
LLColor4 LLKeywords::getColorGroup(const std::string& key_in)
LLColor4 LLKeywords::getColorGroup(std::string_view key_in)
{
std::string color_group = "ScriptText";
if (key_in == "functions")
@ -284,7 +284,7 @@ void LLKeywords::processTokens()
LL_INFOS("SyntaxLSL") << "Finished processing tokens." << LL_ENDL;
}
void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group)
void LLKeywords::processTokensGroup(const LLSD& tokens, std::string_view group)
{
LLColor4 color;
LLColor4 color_group;
@ -356,7 +356,7 @@ void LLKeywords::processTokensGroup(const LLSD& tokens, const std::string& group
case LLKeywordToken::TT_CONSTANT:
if (getAttribute("type").length() > 0)
{
color_group = getColorGroup(group + "-" + getAttribute("type"));
color_group = getColorGroup(std::string(group) + "-" + getAttribute("type"));
}
else
{

View File

@ -115,7 +115,7 @@ public:
~LLKeywords();
void clearLoaded() { mLoaded = false; }
LLColor4 getColorGroup(const std::string& key_in);
LLColor4 getColorGroup(std::string_view key_in);
bool isLoaded() const { return mLoaded; }
// <FS:Ansariel> Re-add support for Cinder's legacy file format
bool loadFromLegacyFile(const std::string& filename);
@ -176,7 +176,7 @@ public:
#endif
protected:
void processTokensGroup(const LLSD& Tokens, const std::string& Group);
void processTokensGroup(const LLSD& Tokens, std::string_view Group);
void insertSegment(std::vector<LLTextSegmentPtr>& seg_list,
LLTextSegmentPtr new_segment,
S32 text_len,
@ -200,10 +200,10 @@ protected:
token_list_t mLineTokenList;
token_list_t mDelimiterTokenList;
typedef std::map<std::string, std::string> element_attributes_t;
typedef std::map<std::string, std::string, std::less<>> element_attributes_t;
typedef element_attributes_t::const_iterator attribute_iterator_t;
element_attributes_t mAttributes;
std::string getAttribute(const std::string& key);
std::string getAttribute(std::string_view key);
std::string getArguments(LLSD& arguments);

View File

@ -616,7 +616,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
return NULL;
}
LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) const
LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(std::string_view name) const
{
LLLayoutPanel* result = NULL;

View File

@ -119,7 +119,7 @@ private:
e_panel_list_t mPanels;
LLLayoutPanel* findEmbeddedPanel(LLPanel* panelp) const;
LLLayoutPanel* findEmbeddedPanelByName(const std::string& name) const;
LLLayoutPanel* findEmbeddedPanelByName(std::string_view name) const;
void updateFractionalSizes();
void normalizeFractionalSizes();
void updatePanelRect( LLLayoutPanel* param1, const LLRect& new_rect );

View File

@ -74,7 +74,7 @@ static LLDefaultChildRegistry::Register<LLLineEditor> r1("line_editor");
// Compiler optimization, generate extern template
template class LLLineEditor* LLView::getChild<class LLLineEditor>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
//
// Member functions

View File

@ -483,7 +483,7 @@ private:
// Build time optimization, generate once in .cpp file
#ifndef LLLINEEDITOR_CPP
extern template class LLLineEditor* LLView::getChild<class LLLineEditor>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif // LL_LINEEDITOR_

View File

@ -1009,7 +1009,7 @@ LLMenuItemBranchGL::~LLMenuItemBranchGL()
// virtual
LLView* LLMenuItemBranchGL::getChildView(const std::string& name, bool recurse) const
LLView* LLMenuItemBranchGL::getChildView(std::string_view name, bool recurse) const
{
LLMenuGL* branch = getBranch();
if (branch)
@ -1026,7 +1026,7 @@ LLView* LLMenuItemBranchGL::getChildView(const std::string& name, bool recurse)
return LLView::getChildView(name, recurse);
}
LLView* LLMenuItemBranchGL::findChildView(const std::string& name, bool recurse) const
LLView* LLMenuItemBranchGL::findChildView(std::string_view name, bool recurse) const
{
LLMenuGL* branch = getBranch();
if (branch)
@ -2781,7 +2781,7 @@ void LLMenuGL::setEnabledSubMenus(bool enable)
// setItemEnabled() - pass the label and the enable flag for a menu
// item. true will make sure it's enabled, false will disable it.
void LLMenuGL::setItemEnabled( const std::string& name, bool enable )
void LLMenuGL::setItemEnabled(std::string_view name, bool enable )
{
item_list_t::iterator item_iter;
for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter)
@ -2795,7 +2795,7 @@ void LLMenuGL::setItemEnabled( const std::string& name, bool enable )
}
}
void LLMenuGL::setItemVisible( const std::string& name, bool visible )
void LLMenuGL::setItemVisible(std::string_view name, bool visible )
{
item_list_t::iterator item_iter;
for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter)
@ -3306,7 +3306,7 @@ void LLMenuGL::setVisible(bool visible)
}
}
LLMenuGL* LLMenuGL::findChildMenuByName(const std::string& name, bool recurse) const
LLMenuGL* LLMenuGL::findChildMenuByName(std::string_view name, bool recurse) const
{
LLView* view = findChildView(name, recurse);
if (view)

View File

@ -457,7 +457,7 @@ public:
virtual bool hasAccelerator(const KEY &key, const MASK &mask) const;
virtual bool handleAcceleratorKey(KEY key, MASK mask);
LLMenuGL* findChildMenuByName(const std::string& name, bool recurse) const;
LLMenuGL* findChildMenuByName(std::string_view name, bool recurse) const;
bool clearHoverItem();
@ -480,12 +480,12 @@ public:
// setItemEnabled() - pass the name and the enable flag for a
// menu item. true will make sure it's enabled, false will disable
// it.
void setItemEnabled( const std::string& name, bool enable );
void setItemEnabled(std::string_view name, bool enable );
// propagate message to submenus
void setEnabledSubMenus(bool enable);
void setItemVisible( const std::string& name, bool visible);
void setItemVisible(std::string_view name, bool visible);
void setItemLabel(const std::string &name, const std::string &label);
@ -692,8 +692,8 @@ public:
virtual void openMenu();
virtual LLView* getChildView(const std::string& name, bool recurse = true) const;
virtual LLView* findChildView(const std::string& name, bool recurse = true) const;
virtual LLView* getChildView(std::string_view name, bool recurse = true) const;
virtual LLView* findChildView(std::string_view name, bool recurse = true) const;
private:
LLHandle<LLView> mBranchHandle;

View File

@ -267,7 +267,7 @@ LLSD LLNotificationForm::asLLSD() const
return mFormData;
}
LLSD LLNotificationForm::getElement(const std::string& element_name)
LLSD LLNotificationForm::getElement(std::string_view element_name)
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@ -279,7 +279,7 @@ LLSD LLNotificationForm::getElement(const std::string& element_name)
}
bool LLNotificationForm::hasElement(const std::string& element_name) const
bool LLNotificationForm::hasElement(std::string_view element_name) const
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@ -302,7 +302,7 @@ void LLNotificationForm::getElements(LLSD& elements, S32 offset)
}
}
bool LLNotificationForm::getElementEnabled(const std::string& element_name) const
bool LLNotificationForm::getElementEnabled(std::string_view element_name) const
{
for (LLSD::array_const_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@ -317,7 +317,7 @@ bool LLNotificationForm::getElementEnabled(const std::string& element_name) cons
return false;
}
void LLNotificationForm::setElementEnabled(const std::string& element_name, bool enabled)
void LLNotificationForm::setElementEnabled(std::string_view element_name, bool enabled)
{
for (LLSD::array_iterator it = mFormData.beginArray();
it != mFormData.endArray();
@ -440,7 +440,7 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
mSoundName("")
{
if (p.sound.isProvided() && LLUI::getInstance()->mSettingGroups["config"]
&& LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound))
&& LLUI::getInstance()->mSettingGroups["config"]->controlExists(p.sound()))
{
mSoundName = p.sound;
}
@ -770,7 +770,7 @@ bool LLNotification::hasUniquenessConstraints() const
return (mTemplatep ? mTemplatep->mUnique : false);
}
bool LLNotification::matchesTag(const std::string& tag)
bool LLNotification::matchesTag(std::string_view tag)
{
bool result = false;
@ -1464,11 +1464,12 @@ void LLNotifications::createDefaultChannels()
}
LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
LLNotificationTemplatePtr LLNotifications::getTemplate(std::string_view name)
{
if (mTemplates.count(name))
auto it = mTemplates.find(name);
if (it != mTemplates.end())
{
return mTemplates[name];
return it->second;
}
else
{
@ -1476,7 +1477,7 @@ LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
}
}
bool LLNotifications::templateExists(const std::string& name)
bool LLNotifications::templateExists(std::string_view name)
{
return (mTemplates.count(name) != 0);
}
@ -1762,7 +1763,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif)
}
}
void LLNotifications::cancelByName(const std::string& name)
void LLNotifications::cancelByName(std::string_view name)
{
LLMutexLock lock(&mItemsMutex);
std::vector<LLNotificationPtr> notifs_to_cancel;
@ -1837,7 +1838,7 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid)
}
}
std::string LLNotifications::getGlobalString(const std::string& key) const
std::string LLNotifications::getGlobalString(std::string_view key) const
{
GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
if (it != mGlobalStrings.end())
@ -1848,7 +1849,7 @@ std::string LLNotifications::getGlobalString(const std::string& key) const
{
// if we don't have the key as a global, return the key itself so that the error
// is self-diagnosing.
return key;
return std::string(key);
}
}
@ -1861,13 +1862,13 @@ bool LLNotifications::getIgnoreAllNotifications()
return mIgnoreAllNotifications;
}
void LLNotifications::setIgnored(const std::string& name, bool ignored)
void LLNotifications::setIgnored(std::string_view name, bool ignored)
{
LLNotificationTemplatePtr templatep = getTemplate(name);
templatep->mForm->setIgnored(ignored);
}
bool LLNotifications::getIgnored(const std::string& name)
bool LLNotifications::getIgnored(std::string_view name)
{
LLNotificationTemplatePtr templatep = getTemplate(name);
return (mIgnoreAllNotifications) || ( (templatep->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO) && (templatep->mForm->getIgnored()) );

View File

@ -252,11 +252,11 @@ public:
S32 getNumElements() { return static_cast<S32>(mFormData.size()); }
LLSD getElement(S32 index) { return mFormData.get(index); }
LLSD getElement(const std::string& element_name);
LLSD getElement(std::string_view element_name);
void getElements(LLSD& elements, S32 offset = 0);
bool hasElement(const std::string& element_name) const;
bool getElementEnabled(const std::string& element_name) const;
void setElementEnabled(const std::string& element_name, bool enabled);
bool hasElement(std::string_view element_name) const;
bool getElementEnabled(std::string_view element_name) const;
void setElementEnabled(std::string_view element_name, bool enabled);
void addElement(const std::string& type, const std::string& name, const LLSD& value = LLSD(), bool enabled = true);
void formatElements(const LLSD& substitutions);
// appends form elements from another form serialized as LLSD
@ -646,7 +646,7 @@ public:
bool hasUniquenessConstraints() const;
bool matchesTag(const std::string& tag);
bool matchesTag(std::string_view tag);
virtual ~LLNotification() {}
};
@ -931,7 +931,7 @@ public:
void add(const LLNotificationPtr pNotif);
void load(const LLNotificationPtr pNotif);
void cancel(LLNotificationPtr pNotif);
void cancelByName(const std::string& name);
void cancelByName(std::string_view name);
void cancelByOwner(const LLUUID ownerId);
void update(const LLNotificationPtr pNotif);
@ -939,19 +939,19 @@ public:
// This is all stuff for managing the templates
// take your template out
LLNotificationTemplatePtr getTemplate(const std::string& name);
LLNotificationTemplatePtr getTemplate(std::string_view name);
// get the whole collection
typedef std::vector<std::string> TemplateNames;
TemplateNames getTemplateNames() const; // returns a list of notification names
typedef std::map<std::string, LLNotificationTemplatePtr> TemplateMap;
typedef std::map<std::string, LLNotificationTemplatePtr, std::less<>> TemplateMap;
TemplateMap::const_iterator templatesBegin() { return mTemplates.begin(); }
TemplateMap::const_iterator templatesEnd() { return mTemplates.end(); }
// test for existence
bool templateExists(const std::string& name);
bool templateExists(std::string_view name);
typedef std::list<LLNotificationVisibilityRulePtr> VisibilityRuleList;
@ -961,13 +961,13 @@ public:
LLNotificationChannelPtr getChannel(const std::string& channelName);
std::string getGlobalString(const std::string& key) const;
std::string getGlobalString(std::string_view key) const;
void setIgnoreAllNotifications(bool ignore);
bool getIgnoreAllNotifications();
void setIgnored(const std::string& name, bool ignored);
bool getIgnored(const std::string& name);
void setIgnored(std::string_view name, bool ignored);
bool getIgnored(std::string_view name);
bool isVisibleByRules(LLNotificationPtr pNotification);
@ -993,7 +993,7 @@ private:
LLNotificationMap mUniqueNotifications;
typedef std::map<std::string, std::string> GlobalStringMap;
typedef std::map<std::string, std::string, std::less<>> GlobalStringMap;
GlobalStringMap mGlobalStrings;
bool mIgnoreAllNotifications;

View File

@ -191,7 +191,7 @@ void LLNotificationsListener::ignore(const LLSD& params) const
if (params["name"].isDefined())
{
// ["name"] was passed: ignore just that notification
LLNotificationTemplatePtr templatep = mNotifications.getTemplate(params["name"]);
LLNotificationTemplatePtr templatep = mNotifications.getTemplate(params["name"].asStringRef());
if (templatep)
{
templatep->mForm->setIgnored(ignore);

View File

@ -55,7 +55,7 @@ LLPanel::factory_stack_t LLPanel::sFactoryStack;
// Compiler optimization, generate extern template
template class LLPanel* LLView::getChild<class LLPanel>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
LLPanel::LocalizedString::LocalizedString()
: name("name"),
@ -277,7 +277,7 @@ void LLPanel::setDefaultBtn(LLButton* btn)
}
}
void LLPanel::setDefaultBtn(const std::string& id)
void LLPanel::setDefaultBtn(std::string_view id)
{
LLButton *button = getChild<LLButton>(id);
if (button)
@ -593,12 +593,12 @@ bool LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr outpu
return true;
}
bool LLPanel::hasString(const std::string& name)
bool LLPanel::hasString(std::string_view name)
{
return mUIStrings.find(name) != mUIStrings.end();
}
std::string LLPanel::getString(const std::string& name, const LLStringUtil::format_map_t& args) const
std::string LLPanel::getString(std::string_view name, const LLStringUtil::format_map_t& args) const
{
ui_string_map_t::const_iterator found_it = mUIStrings.find(name);
if (found_it != mUIStrings.end())
@ -608,7 +608,7 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form
formatted_string.setArgList(args);
return formatted_string.getString();
}
std::string err_str("Failed to find string " + name + " in panel " + getName() + " loaded from file " + mXMLFilename); //*TODO: Translate
std::string err_str("Failed to find string " + std::string(name) + " in panel " + getName() + " loaded from file " + mXMLFilename); //*TODO: Translate
if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode"))
{
LL_ERRS() << err_str << LL_ENDL;
@ -620,14 +620,14 @@ std::string LLPanel::getString(const std::string& name, const LLStringUtil::form
return LLStringUtil::null;
}
std::string LLPanel::getString(const std::string& name) const
std::string LLPanel::getString(std::string_view name) const
{
ui_string_map_t::const_iterator found_it = mUIStrings.find(name);
if (found_it != mUIStrings.end())
{
return found_it->second;
}
std::string err_str("Failed to find string " + name + " in panel " + getName() + " loaded from file " + mXMLFilename); //*TODO: Translate
std::string err_str("Failed to find string " + std::string(name) + " in panel " + getName() + " loaded from file " + mXMLFilename); //*TODO: Translate
if(LLUI::getInstance()->mSettingGroups["config"]->getBOOL("QAMode"))
{
LL_ERRS() << err_str << LL_ENDL;
@ -640,7 +640,7 @@ std::string LLPanel::getString(const std::string& name) const
}
void LLPanel::childSetVisible(const std::string& id, bool visible)
void LLPanel::childSetVisible(std::string_view id, bool visible)
{
LLView* child = findChild<LLView>(id);
if (child)
@ -649,7 +649,7 @@ void LLPanel::childSetVisible(const std::string& id, bool visible)
}
}
void LLPanel::childSetEnabled(const std::string& id, bool enabled)
void LLPanel::childSetEnabled(std::string_view id, bool enabled)
{
LLView* child = findChild<LLView>(id);
if (child)
@ -658,7 +658,7 @@ void LLPanel::childSetEnabled(const std::string& id, bool enabled)
}
}
void LLPanel::childSetFocus(const std::string& id, bool focus)
void LLPanel::childSetFocus(std::string_view id, bool focus)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -667,7 +667,7 @@ void LLPanel::childSetFocus(const std::string& id, bool focus)
}
}
bool LLPanel::childHasFocus(const std::string& id)
bool LLPanel::childHasFocus(std::string_view id)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -684,7 +684,7 @@ bool LLPanel::childHasFocus(const std::string& id)
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data)
void LLPanel::childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -693,7 +693,7 @@ void LLPanel::childSetCommitCallback(const std::string& id, boost::function<void
}
}
void LLPanel::childSetColor(const std::string& id, const LLColor4& color)
void LLPanel::childSetColor(std::string_view id, const LLColor4& color)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -702,7 +702,7 @@ void LLPanel::childSetColor(const std::string& id, const LLColor4& color)
}
}
LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string& id) const
LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(std::string_view id) const
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -712,7 +712,7 @@ LLCtrlSelectionInterface* LLPanel::childGetSelectionInterface(const std::string&
return NULL;
}
LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const
LLCtrlListInterface* LLPanel::childGetListInterface(std::string_view id) const
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -722,7 +722,7 @@ LLCtrlListInterface* LLPanel::childGetListInterface(const std::string& id) const
return NULL;
}
LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) const
LLCtrlScrollInterface* LLPanel::childGetScrollInterface(std::string_view id) const
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -732,7 +732,7 @@ LLCtrlScrollInterface* LLPanel::childGetScrollInterface(const std::string& id) c
return NULL;
}
void LLPanel::childSetValue(const std::string& id, LLSD value)
void LLPanel::childSetValue(std::string_view id, LLSD value)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -741,7 +741,7 @@ void LLPanel::childSetValue(const std::string& id, LLSD value)
}
}
LLSD LLPanel::childGetValue(const std::string& id) const
LLSD LLPanel::childGetValue(std::string_view id) const
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -752,7 +752,7 @@ LLSD LLPanel::childGetValue(const std::string& id) const
return LLSD();
}
bool LLPanel::childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text)
bool LLPanel::childSetTextArg(std::string_view id, const std::string& key, const LLStringExplicit& text)
{
LLUICtrl* child = findChild<LLUICtrl>(id);
if (child)
@ -762,7 +762,7 @@ bool LLPanel::childSetTextArg(const std::string& id, const std::string& key, con
return false;
}
bool LLPanel::childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text)
bool LLPanel::childSetLabelArg(std::string_view id, const std::string& key, const LLStringExplicit& text)
{
LLView* child = findChild<LLView>(id);
if (child)
@ -772,7 +772,7 @@ bool LLPanel::childSetLabelArg(const std::string& id, const std::string& key, co
return false;
}
void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_type& function)
void LLPanel::childSetAction(std::string_view id, const commit_signal_t::slot_type& function)
{
LLButton* button = findChild<LLButton>(id);
if (button)
@ -781,7 +781,7 @@ void LLPanel::childSetAction(const std::string& id, const commit_signal_t::slot_
}
}
void LLPanel::childSetAction(const std::string& id, boost::function<void(void*)> function, void* value)
void LLPanel::childSetAction(std::string_view id, boost::function<void(void*)> function, void* value)
{
LLButton* button = findChild<LLButton>(id);
if (button)

View File

@ -149,7 +149,7 @@ public:
void setBackgroundOpaque(bool b) { mBgOpaque = b; }
bool isBackgroundOpaque() const { return mBgOpaque; }
void setDefaultBtn(LLButton* btn = NULL);
void setDefaultBtn(const std::string& id);
void setDefaultBtn(std::string_view id);
void updateDefaultBtn();
void setLabel(const LLStringExplicit& label) { mLabel = label; }
std::string getLabel() const { return mLabel; }
@ -169,47 +169,47 @@ public:
void initFromParams(const Params& p);
bool initPanelXML( LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params);
bool hasString(const std::string& name);
std::string getString(const std::string& name, const LLStringUtil::format_map_t& args) const;
std::string getString(const std::string& name) const;
bool hasString(std::string_view name);
std::string getString(std::string_view name, const LLStringUtil::format_map_t& args) const;
std::string getString(std::string_view name) const;
// ** Wrappers for setting child properties by name ** -TomY
// WARNING: These are deprecated, please use getChild<T>("name")->doStuff() idiom instead
// LLView
void childSetVisible(const std::string& name, bool visible);
void childSetVisible(std::string_view name, bool visible);
void childSetEnabled(const std::string& name, bool enabled);
void childEnable(const std::string& name) { childSetEnabled(name, true); }
void childDisable(const std::string& name) { childSetEnabled(name, false); };
void childSetEnabled(std::string_view name, bool enabled);
void childEnable(std::string_view name) { childSetEnabled(name, true); }
void childDisable(std::string_view name) { childSetEnabled(name, false); };
// LLUICtrl
void childSetFocus(const std::string& id, bool focus = true);
bool childHasFocus(const std::string& id);
void childSetFocus(std::string_view id, bool focus = true);
bool childHasFocus(std::string_view id);
// *TODO: Deprecate; for backwards compatability only:
// Prefer getChild<LLUICtrl>("foo")->setCommitCallback(boost:bind(...)),
// which takes a generic slot. Or use mCommitCallbackRegistrar.add() with
// a named callback and reference it in XML.
void childSetCommitCallback(const std::string& id, boost::function<void (LLUICtrl*,void*)> cb, void* data);
void childSetColor(const std::string& id, const LLColor4& color);
void childSetCommitCallback(std::string_view id, boost::function<void (LLUICtrl*,void*)> cb, void* data);
void childSetColor(std::string_view id, const LLColor4& color);
LLCtrlSelectionInterface* childGetSelectionInterface(const std::string& id) const;
LLCtrlListInterface* childGetListInterface(const std::string& id) const;
LLCtrlScrollInterface* childGetScrollInterface(const std::string& id) const;
LLCtrlSelectionInterface* childGetSelectionInterface(std::string_view id) const;
LLCtrlListInterface* childGetListInterface(std::string_view id) const;
LLCtrlScrollInterface* childGetScrollInterface(std::string_view id) const;
// This is the magic bullet for data-driven UI
void childSetValue(const std::string& id, LLSD value);
LLSD childGetValue(const std::string& id) const;
void childSetValue(std::string_view id, LLSD value);
LLSD childGetValue(std::string_view id) const;
// For setting text / label replacement params, e.g. "Hello [NAME]"
// Not implemented for all types, defaults to noop, returns false if not applicaple
bool childSetTextArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
bool childSetLabelArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
bool childSetTextArg(std::string_view id, const std::string& key, const LLStringExplicit& text);
bool childSetLabelArg(std::string_view id, const std::string& key, const LLStringExplicit& text);
// LLButton
void childSetAction(const std::string& id, boost::function<void(void*)> function, void* value);
void childSetAction(const std::string& id, const commit_signal_t::slot_type& function);
void childSetAction(std::string_view id, boost::function<void(void*)> function, void* value);
void childSetAction(std::string_view id, const commit_signal_t::slot_type& function);
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
@ -250,7 +250,7 @@ private:
LLButton* mDefaultBtn;
LLUIString mLabel;
typedef std::map<std::string, std::string> ui_string_map_t;
typedef std::map<std::string, std::string, std::less<>> ui_string_map_t;
ui_string_map_t mUIStrings;
@ -259,7 +259,7 @@ private:
// Build time optimization, generate once in .cpp file
#ifndef LLPANEL_CPP
extern template class LLPanel* LLView::getChild<class LLPanel>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc;
@ -277,7 +277,7 @@ public:
mPanelClassesNames[tag] = func;
}
LLPanel* createPanelClass(const std::string& tag)
LLPanel* createPanelClass(std::string_view tag)
{
param_name_map_t::iterator iT = mPanelClassesNames.find(tag);
if(iT == mPanelClassesNames.end())
@ -292,7 +292,7 @@ public:
}
private:
typedef std::map< std::string, LLPanelClassCreatorFunc> param_name_map_t;
typedef std::map< std::string, LLPanelClassCreatorFunc, std::less<>> param_name_map_t;
param_name_map_t mPanelClassesNames;
};

View File

@ -344,7 +344,7 @@ void LLTabContainer::reshape(S32 width, S32 height, bool called_from_parent)
}
//virtual
LLView* LLTabContainer::getChildView(const std::string& name, bool recurse) const
LLView* LLTabContainer::getChildView(std::string_view name, bool recurse) const
{
tuple_list_t::const_iterator itor;
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
@ -372,7 +372,7 @@ LLView* LLTabContainer::getChildView(const std::string& name, bool recurse) cons
}
//virtual
LLView* LLTabContainer::findChildView(const std::string& name, bool recurse) const
LLView* LLTabContainer::findChildView(std::string_view name, bool recurse) const
{
tuple_list_t::const_iterator itor;
for (itor = mTabList.begin(); itor != mTabList.end(); ++itor)
@ -1542,7 +1542,7 @@ S32 LLTabContainer::getIndexForPanel(LLPanel* panel)
return -1;
}
S32 LLTabContainer::getPanelIndexByTitle(const std::string& title)
S32 LLTabContainer::getPanelIndexByTitle(std::string_view title)
{
for (S32 index = 0 ; index < (S32)mTabList.size(); index++)
{
@ -1554,7 +1554,7 @@ S32 LLTabContainer::getPanelIndexByTitle(const std::string& title)
return -1;
}
LLPanel* LLTabContainer::getPanelByName(const std::string& name)
LLPanel* LLTabContainer::getPanelByName(std::string_view name)
{
for (S32 index = 0 ; index < (S32)mTabList.size(); index++)
{
@ -1783,7 +1783,7 @@ bool LLTabContainer::setTab(S32 which)
return is_visible;
}
bool LLTabContainer::selectTabByName(const std::string& name)
bool LLTabContainer::selectTabByName(std::string_view name)
{
LLPanel* panel = getPanelByName(name);
if (!panel)

View File

@ -166,8 +166,8 @@ public:
/*virtual*/ bool handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType type, void* cargo_data,
EAcceptance* accept, std::string& tooltip);
/*virtual*/ LLView* getChildView(const std::string& name, bool recurse = true) const;
/*virtual*/ LLView* findChildView(const std::string& name, bool recurse = true) const;
/*virtual*/ LLView* getChildView(std::string_view name, bool recurse = true) const;
/*virtual*/ LLView* findChildView(std::string_view name, bool recurse = true) const;
/*virtual*/ void initFromParams(const LLPanel::Params& p);
/*virtual*/ bool addChild(LLView* view, S32 tab_group = 0);
/*virtual*/ bool postBuild();
@ -207,8 +207,8 @@ public:
S32 getTabCount();
LLPanel* getPanelByIndex(S32 index);
S32 getIndexForPanel(LLPanel* panel);
S32 getPanelIndexByTitle(const std::string& title);
LLPanel* getPanelByName(const std::string& name);
S32 getPanelIndexByTitle(std::string_view title);
LLPanel* getPanelByName(std::string_view name);
S32 getTotalTabWidth() const;
void setCurrentTabName(const std::string& name);
@ -218,7 +218,7 @@ public:
void selectPrevTab();
bool selectTabPanel( LLPanel* child );
bool selectTab(S32 which);
bool selectTabByName(const std::string& title);
bool selectTabByName(std::string_view title);
void setCurrentPanelIndex(S32 index) { mCurrentTabIdx = index; }
bool getTabPanelFlashing(LLPanel* child);

View File

@ -41,7 +41,7 @@ static LLDefaultChildRegistry::Register<LLTextBox> r("text");
// Compiler optimization, generate extern template
template class LLTextBox* LLView::getChild<class LLTextBox>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
LLTextBox::LLTextBox(const LLTextBox::Params& p)
: LLTextBase(p),

View File

@ -93,7 +93,7 @@ protected:
// Build time optimization, generate once in .cpp file
#ifndef LLTEXTBOX_CPP
extern template class LLTextBox* LLView::getChild<class LLTextBox>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif

View File

@ -71,7 +71,7 @@ static LLDefaultChildRegistry::Register<LLTextEditor> r("simple_text_editor");
// Compiler optimization, generate extern template
template class LLTextEditor* LLView::getChild<class LLTextEditor>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
//
// Constants

View File

@ -361,7 +361,7 @@ private:
// Build time optimization, generate once in .cpp file
#ifndef LLTEXTEDITOR_CPP
extern template class LLTextEditor* LLView::getChild<class LLTextEditor>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif // LL_TEXTEDITOR_H

View File

@ -65,7 +65,7 @@ bool LLTrans::parseStrings(LLXMLNodePtr &root, const std::set<std::string>& defa
if (!root->hasName("strings"))
{
LL_ERRS() << "Invalid root node name in " << xml_filename
<< ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL;
<< ": was " << root->getName()->mString << ", expected \"strings\"" << LL_ENDL;
}
StringTable string_table;
@ -113,7 +113,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
if (!root->hasName("strings"))
{
LL_ERRS() << "Invalid root node name in " << xml_filename
<< ": was " << root->getName() << ", expected \"strings\"" << LL_ENDL;
<< ": was " << root->getName()->mString << ", expected \"strings\"" << LL_ENDL;
}
StringTable string_table;
@ -143,7 +143,7 @@ bool LLTrans::parseLanguageStrings(LLXMLNodePtr &root)
static LLTrace::BlockTimerStatHandle FTM_GET_TRANS("Translate string");
//static
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args, bool def_string)
std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& msg_args, bool def_string)
{
// Don't care about time as much as call count. Make sure we're not
// calling LLTrans::getString() in an inner loop. JC
@ -167,12 +167,12 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::
else
{
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
return "MissingString("+xml_desc+")";
return "MissingString(" + std::string(xml_desc) + ")";
}
}
//static
std::string LLTrans::getDefString(const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
std::string LLTrans::getDefString(std::string_view xml_desc, const LLStringUtil::format_map_t& msg_args)
{
template_map_t::iterator iter = sDefaultStringTemplates.find(xml_desc);
if (iter != sDefaultStringTemplates.end())
@ -187,12 +187,12 @@ std::string LLTrans::getDefString(const std::string &xml_desc, const LLStringUti
else
{
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
return "MissingString(" + xml_desc + ")";
return "MissingString(" + std::string(xml_desc) + ")";
}
}
//static
std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args, bool def_string)
std::string LLTrans::getString(std::string_view xml_desc, const LLSD& msg_args, bool def_string)
{
// Don't care about time as much as call count. Make sure we're not
// calling LLTrans::getString() in an inner loop. JC
@ -213,12 +213,12 @@ std::string LLTrans::getString(const std::string &xml_desc, const LLSD& msg_args
else
{
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
return "MissingString("+xml_desc+")";
return "MissingString(" + std::string(xml_desc) + ")";
}
}
//static
std::string LLTrans::getDefString(const std::string &xml_desc, const LLSD& msg_args)
std::string LLTrans::getDefString(std::string_view xml_desc, const LLSD& msg_args)
{
template_map_t::iterator iter = sDefaultStringTemplates.find(xml_desc);
if (iter != sDefaultStringTemplates.end())
@ -230,12 +230,12 @@ std::string LLTrans::getDefString(const std::string &xml_desc, const LLSD& msg_a
else
{
LL_WARNS_ONCE("configuration") << "Missing String in strings.xml: [" << xml_desc << "]" << LL_ENDL;
return "MissingString(" + xml_desc + ")";
return "MissingString(" + std::string(xml_desc) + ")";
}
}
//static
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& msg_args)
bool LLTrans::findString(std::string &result, std::string_view xml_desc, const LLStringUtil::format_map_t& msg_args)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
@ -257,7 +257,7 @@ bool LLTrans::findString(std::string &result, const std::string &xml_desc, const
}
//static
bool LLTrans::findString(std::string &result, const std::string &xml_desc, const LLSD& msg_args)
bool LLTrans::findString(std::string &result, std::string_view xml_desc, const LLSD& msg_args)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;

View File

@ -76,12 +76,12 @@ public:
* @param args A list of substrings to replace in the string
* @returns Translated string
*/
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
static std::string getDefString(const std::string &xml_desc, const LLStringUtil::format_map_t& args);
static std::string getString(const std::string &xml_desc, const LLSD& args, bool def_string = false);
static std::string getDefString(const std::string &xml_desc, const LLSD& args);
static bool findString(std::string &result, const std::string &xml_desc, const LLStringUtil::format_map_t& args);
static bool findString(std::string &result, const std::string &xml_desc, const LLSD& args);
static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
static std::string getDefString(std::string_view xml_desc, const LLStringUtil::format_map_t& args);
static std::string getString(std::string_view xml_desc, const LLSD& args, bool def_string = false);
static std::string getDefString(std::string_view xml_desc, const LLSD& args);
static bool findString(std::string &result, std::string_view xml_desc, const LLStringUtil::format_map_t& args);
static bool findString(std::string &result, std::string_view xml_desc, const LLSD& args);
// Returns translated string with [COUNT] replaced with a number, following
// special per-language logic for plural nouns. For example, some languages
@ -94,23 +94,22 @@ public:
* @param xml_desc String's description
* @returns Translated string
*/
static std::string getString(const std::string &xml_desc, bool def_string = false)
static std::string getString(std::string_view xml_desc, bool def_string = false)
{
LLStringUtil::format_map_t empty;
return getString(xml_desc, empty);
}
static bool findString(std::string &result, const std::string &xml_desc)
static bool findString(std::string &result, std::string_view xml_desc)
{
LLStringUtil::format_map_t empty;
return findString(result, xml_desc, empty);
}
static std::string getKeyboardString(const char* keystring)
static std::string getKeyboardString(const std::string_view keystring)
{
std::string key_str(keystring);
std::string trans_str;
return findString(trans_str, key_str) ? trans_str : key_str;
return findString(trans_str, keystring) ? trans_str : std::string(keystring);
}
// get the default args
@ -128,7 +127,7 @@ public:
}
private:
typedef std::map<std::string, LLTransTemplate > template_map_t;
typedef std::map<std::string, LLTransTemplate, std::less<>> template_map_t;
static template_map_t sStringTemplates;
static template_map_t sDefaultStringTemplates;
static LLStringUtil::format_map_t sDefaultArgs;

View File

@ -194,11 +194,11 @@ mHelpImpl(NULL)
LLUICtrl::CommitCallbackRegistry::Registrar& reg = LLUICtrl::CommitCallbackRegistry::defaultRegistrar();
// Callbacks for associating controls with floater visibility:
reg.add("Floater.Toggle", boost::bind(&LLFloaterReg::toggleInstance, _2, LLSD()));
reg.add("Floater.ToggleOrBringToFront", boost::bind(&LLFloaterReg::toggleInstanceOrBringToFront, _2, LLSD()));
reg.add("Floater.Show", boost::bind(&LLFloaterReg::showInstance, _2, LLSD(), false));
reg.add("Floater.ShowOrBringToFront", boost::bind(&LLFloaterReg::showInstanceOrBringToFront, _2, LLSD()));
reg.add("Floater.Hide", boost::bind(&LLFloaterReg::hideInstance, _2, LLSD()));
reg.add("Floater.Toggle", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstance(param.asStringRef()); });
reg.add("Floater.ToggleOrBringToFront", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::toggleInstanceOrBringToFront(param.asStringRef()); });
reg.add("Floater.Show", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::showInstance(param.asStringRef(), LLSD(), false); });
reg.add("Floater.ShowOrBringToFront", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::showInstanceOrBringToFront(param.asStringRef(), LLSD()); });
reg.add("Floater.Hide", [](LLUICtrl* ctrl, const LLSD& param) -> void { LLFloaterReg::hideInstance(param.asStringRef()); });
// Button initialization callback for toggle buttons
reg.add("Button.SetFloaterToggle", boost::bind(&LLButton::setFloaterToggle, _1, _2));
@ -213,10 +213,10 @@ mHelpImpl(NULL)
reg.add("Button.ToggleFloater", boost::bind(&LLButton::toggleFloaterAndSetToggleState, _1, _2));
// Used by menus along with Floater.Toggle to display visibility as a check-mark
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", boost::bind(&LLFloaterReg::instanceVisible, _2, LLSD()));
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.Visible", [](LLUICtrl* ctrl, const LLSD& param) -> bool { return LLFloaterReg::instanceVisible(param.asStringRef(), LLSD()); });
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.IsOpen", [](LLUICtrl* ctrl, const LLSD& param) -> bool { return LLFloaterReg::instanceVisible(param.asStringRef(), LLSD()); });
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.CanShow", boost::bind(&LLFloaterReg::canShowInstance, _2, LLSD()));
LLUICtrl::EnableCallbackRegistry::defaultRegistrar().add("Floater.CanShow", [](LLUICtrl* ctrl, const LLSD& param) -> bool { return LLFloaterReg::canShowInstance(param.asStringRef(), LLSD()); });
// [/RLVa:KB]
// Parse the master list of commands
@ -421,7 +421,7 @@ void LLUI::glRectToScreen(const LLRect& gl, LLRect *screen)
}
LLControlGroup& LLUI::getControlControlGroup (const std::string& controlname)
LLControlGroup& LLUI::getControlControlGroup (std::string_view controlname)
{
for (settings_map_t::iterator itor = mSettingGroups.begin();
itor != mSettingGroups.end(); ++itor)
@ -596,7 +596,7 @@ namespace LLInitParam
{
if (control.isProvided() && !control().empty())
{
updateValue(LLUIColorTable::instance().getColor(control));
updateValue(LLUIColorTable::instance().getColor(control()));
}
else
{

View File

@ -121,7 +121,7 @@ typedef void (*LLUIAudioCallback)(const LLUUID& uuid);
class LLUI : public LLParamSingleton<LLUI>
{
public:
typedef std::map<std::string, LLControlGroup*> settings_map_t;
typedef std::map<std::string, LLControlGroup*, std::less<> > settings_map_t;
private:
LLSINGLETON(LLUI , const settings_map_t &settings,
@ -304,7 +304,7 @@ public:
void screenRectToGL(const LLRect& screen, LLRect *gl);
void glRectToScreen(const LLRect& gl, LLRect *screen);
// Returns the control group containing the control name, or the default group
LLControlGroup& getControlControlGroup (const std::string& controlname);
LLControlGroup& getControlControlGroup (std::string_view controlname);
F32 getMouseIdleTime() { return mMouseIdleTimer.getElapsedTimeF32(); }
void resetMouseIdleTimer() { mMouseIdleTimer.reset(); }
LLWindow* getWindow() { return mWindow; }

View File

@ -63,7 +63,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
ColorEntryParams color_entry = *it;
if(color_entry.color.value.isChosen())
{
setColor(color_entry.name, color_entry.color.value, table);
setColor(color_entry.name(), color_entry.color.value, table);
}
else
{
@ -131,14 +131,7 @@ void LLUIColorTable::insertFromParams(const Params& p, string_color_map_t& table
{
// since this reference does not refer to another reference it must refer to an
// actual color, lets find it...
// string_color_map_t::iterator color_value = mLoadedColors.find(previous->second);
ColorName oName{};
oName.nLen = previous->second.size();
oName.pName = const_cast<char*>(previous->second.c_str()); // That's ok, I won't hurt you.
string_color_map_t::iterator color_value = mLoadedColors.find(oName);
string_color_map_t::iterator color_value = mLoadedColors.find(previous->second);
if(color_value != mLoadedColors.end())
{
@ -183,31 +176,16 @@ void LLUIColorTable::clear()
clearTable(mUserSetColors);
}
LLUIColor LLUIColorTable::getColor(const std::string& name, const LLColor4& default_color) const
LLUIColor LLUIColorTable::getColor(std::string_view name, const LLColor4& default_color) const
{
return getColor( name.c_str(), default_color );
}
LLUIColor LLUIColorTable::getColor( char const *name, const LLColor4& default_color) const // <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
{
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// string_color_map_t::const_iterator iter = mUserSetColors.find(name);
ColorName oName{};
oName.nLen = strlen(name);
oName.pName = const_cast<char*>(name);
string_color_map_t::const_iterator iter = mUserSetColors.find(oName);
// </FS:ND>
string_color_map_t::const_iterator iter = mUserSetColors.find(name);
if(iter != mUserSetColors.end())
{
return LLUIColor(&iter->second);
}
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// iter = mLoadedColors.find(name);
iter = mLoadedColors.find(oName);
// </FS:ND>
iter = mLoadedColors.find(name);
if(iter != mLoadedColors.end())
{
@ -218,7 +196,7 @@ LLUIColor LLUIColorTable::getColor( char const *name, const LLColor4& default_co
}
// update user color, loaded colors are parsed on initialization
void LLUIColorTable::setColor(const std::string& name, const LLColor4& color)
void LLUIColorTable::setColor(std::string_view name, const LLColor4& color)
{
setColor(name, color, mUserSetColors);
}
@ -255,10 +233,7 @@ void LLUIColorTable::saveUserSettings() const
continue;
ColorEntryParams color_entry;
// color_entry.name = it->first;
color_entry.name = it->first.pName;
color_entry.name = it->first;
color_entry.color.value = it->second;
params.color_entries.add(color_entry);
@ -287,20 +262,13 @@ void LLUIColorTable::saveUserSettingsPaletteOnly() const
{
Params params;
for(string_color_map_t::const_iterator it = mUserSetColors.begin();
it != mUserSetColors.end();
++it)
for (const auto& [name, value] : mUserSetColors)
{
ColorEntryParams color_entry;
color_entry.name = name;
color_entry.color.value = value;
// color_entry.name = it->first;
color_entry.name = it->first.pName;
color_entry.color.value = it->second;
if (((std::string)color_entry.name).compare(0,17,"ColorPaletteEntry") == 0)
if (color_entry.name().compare(0, 17, "ColorPaletteEntry") == 0)
params.color_entries.add(color_entry);
}
@ -313,7 +281,7 @@ void LLUIColorTable::saveUserSettingsPaletteOnly() const
const std::string& filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "colors.xml");
LLFILE* fp = LLFile::fopen(filename, "w");
if(fp != NULL)
if (fp)
{
LLXMLNode::writeHeaderToFile(fp);
output_node->writeToFile(fp);
@ -323,19 +291,10 @@ void LLUIColorTable::saveUserSettingsPaletteOnly() const
}
}
// bool LLUIColorTable::colorExists(const std::string& color_name) const
bool LLUIColorTable::colorExists( char const *name ) const
bool LLUIColorTable::colorExists(std::string_view color_name) const
{
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// return ((mLoadedColors.find(color_name) != mLoadedColors.end())
// || (mUserSetColors.find(color_name) != mUserSetColors.end()));
ColorName oName{};
oName.nLen = strlen(name);
oName.pName = const_cast<char*>(name);
return ((mLoadedColors.find(oName) != mLoadedColors.end())
|| (mUserSetColors.find(oName) != mUserSetColors.end()));
// </FS:ND>
return ((mLoadedColors.find(color_name) != mLoadedColors.end())
|| (mUserSetColors.find(color_name) != mUserSetColors.end()));
}
void LLUIColorTable::clearTable(string_color_map_t& table)
@ -350,27 +309,17 @@ void LLUIColorTable::clearTable(string_color_map_t& table)
// this method inserts a color into the table if it does not exist
// if the color already exists it changes the color
void LLUIColorTable::setColor(const std::string& name, const LLColor4& color, string_color_map_t& table)
void LLUIColorTable::setColor(std::string_view name, const LLColor4& color, string_color_map_t& table)
{
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// string_color_map_t::iterator it = table.lower_bound(name);
ColorName oName{};
oName.nLen = name.size();
oName.pName = const_cast<char*>(name.c_str());
string_color_map_t::iterator it = table.find(oName);
// if(it != table.end() && !(table.key_comp()(name, it->first)))
if (it != table.end())
// </FS:ND>
string_color_map_t::iterator it = table.lower_bound(name);
if(it != table.end()
&& !(table.key_comp()(name, it->first)))
{
it->second = color;
}
else
{
oName.pName = strdup(oName.pName);
table.insert(string_color_map_t::value_type(oName, color));
table.insert(it, string_color_map_t::value_type(name, color));
}
}

View File

@ -42,27 +42,7 @@ class LLUIColorTable : public LLSingleton<LLUIColorTable>
LOG_CLASS(LLUIColorTable);
// consider using sorted vector, can be much faster
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// typedef std::map<std::string, LLUIColor> string_color_map_t;
struct ColorName
{
char* pName;
size_t nLen;
bool operator<(ColorName const &aRHS) const
{
if (nLen == aRHS.nLen)
return strcmp(pName, aRHS.pName) < 0;
return nLen < aRHS.nLen;
}
};
typedef std::map<ColorName, LLUIColor> string_color_map_t;
// </FS:ND>
typedef std::map<std::string, LLUIColor, std::less<>> string_color_map_t;
public:
struct ColorParams : LLInitParam::ChoiceBlock<ColorParams>
@ -95,24 +75,13 @@ public:
void clear();
// color lookup
LLUIColor getColor(const std::string& name, const LLColor4& default_color = LLColor4::magenta) const;
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
LLUIColor getColor(char const *name, const LLColor4& default_color = LLColor4::magenta) const;
// </FS:ND>
LLUIColor getColor(std::string_view name, const LLColor4& default_color = LLColor4::magenta) const;
// if the color is in the table, it's value is changed, otherwise it is added
void setColor(const std::string& name, const LLColor4& color);
void setColor(std::string_view name, const LLColor4& color);
// returns true if color_name exists in the table
// <FS:ND> Change from std::string to char*, avoind lots of unecessary string constructions
// bool colorExists(const std::string& color_name) const;
bool colorExists(char const *name) const;
// </FS:ND>
bool colorExists(std::string_view color_name) const;
// loads colors from settings files
bool loadFromSettings();
@ -127,7 +96,7 @@ private:
void insertFromParams(const Params& p, string_color_map_t& table);
void clearTable(string_color_map_t& table);
void setColor(const std::string& name, const LLColor4& color, string_color_map_t& table);
void setColor(std::string_view name, const LLColor4& color, string_color_map_t& table);
string_color_map_t mLoadedColors;
string_color_map_t mUserSetColors;

View File

@ -44,7 +44,7 @@ F32 LLUICtrl::sInactiveControlTransparency = 1.0f;
// Compiler optimization, generate extern template
template class LLUICtrl* LLView::getChild<class LLUICtrl>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
LLUICtrl::CallbackParam::CallbackParam()
: name("name"),
@ -135,7 +135,7 @@ void LLUICtrl::initFromParams(const Params& p)
{
if (p.enabled_controls.enabled.isChosen())
{
LLControlVariable* control = findControl(p.enabled_controls.enabled);
LLControlVariable* control = findControl(p.enabled_controls.enabled());
if (control)
{
setEnabledControlVariable(control);
@ -149,7 +149,7 @@ void LLUICtrl::initFromParams(const Params& p)
}
else if(p.enabled_controls.disabled.isChosen())
{
LLControlVariable* control = findControl(p.enabled_controls.disabled);
LLControlVariable* control = findControl(p.enabled_controls.disabled());
if (control)
{
setDisabledControlVariable(control);
@ -169,7 +169,7 @@ void LLUICtrl::initFromParams(const Params& p)
if (p.controls_visibility.visible.isProvided())
// </FS:Zi>
{
LLControlVariable* control = findControl(p.controls_visibility.visible);
LLControlVariable* control = findControl(p.controls_visibility.visible());
if (control)
{
setMakeVisibleControlVariable(control);
@ -186,7 +186,7 @@ void LLUICtrl::initFromParams(const Params& p)
if (p.controls_visibility.invisible.isProvided())
// </FS:Zi>
{
LLControlVariable* control = findControl(p.controls_visibility.invisible);
LLControlVariable* control = findControl(p.controls_visibility.invisible());
if (control)
{
setMakeInvisibleControlVariable(control);

View File

@ -354,7 +354,7 @@ private:
// Build time optimization, generate once in .cpp file
#ifndef LLUICTRL_CPP
extern template class LLUICtrl* LLView::getChild<class LLUICtrl>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif // LL_LLUICTRL_H

View File

@ -182,10 +182,10 @@ fail:
}
template<class T>
static T* getDefaultWidget(const std::string& name)
static T* getDefaultWidget(std::string_view name)
{
typename T::Params widget_params;
widget_params.name = name;
widget_params.name = std::string(name);
return create<T>(widget_params);
}

View File

@ -85,7 +85,7 @@ bool LLView::sIsDrawing = false;
// Compiler optimization, generate extern template
template class LLView* LLView::getChild<class LLView>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
static LLDefaultChildRegistry::Register<LLView> r("view");
@ -774,7 +774,7 @@ void LLView::logMouseEvent()
}
template <typename METHOD, typename CHARTYPE>
LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& method,
LLView* LLView::childrenHandleCharEvent(std::string_view desc, const METHOD& method,
CHARTYPE c, MASK mask)
{
if ( getVisible() && getEnabled() )
@ -1681,7 +1681,7 @@ bool LLView::hasAncestor(const LLView* parentp) const
//-----------------------------------------------------------------------------
bool LLView::childHasKeyboardFocus( const std::string& childname ) const
bool LLView::childHasKeyboardFocus(std::string_view childname) const
{
LLView *focus = dynamic_cast<LLView *>(gFocusMgr.getKeyboardFocus());
@ -1700,7 +1700,7 @@ bool LLView::childHasKeyboardFocus( const std::string& childname ) const
//-----------------------------------------------------------------------------
bool LLView::hasChild(const std::string& childname, bool recurse) const
bool LLView::hasChild(std::string_view childname, bool recurse) const
{
return findChildView(childname, recurse) != NULL;
}
@ -1708,12 +1708,12 @@ bool LLView::hasChild(const std::string& childname, bool recurse) const
//-----------------------------------------------------------------------------
// getChildView()
//-----------------------------------------------------------------------------
LLView* LLView::getChildView(const std::string& name, bool recurse) const
LLView* LLView::getChildView(std::string_view name, bool recurse) const
{
return getChild<LLView>(name, recurse);
}
LLView* LLView::findChildView(const std::string& name, bool recurse) const
LLView* LLView::findChildView(std::string_view name, bool recurse) const
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_UI;
@ -2380,18 +2380,20 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna
//-----------------------------------------------------------------------------
LLControlVariable *LLView::findControl(const std::string& name)
LLControlVariable *LLView::findControl(std::string_view name)
{
auto uiInst = LLUI::getInstance();
// parse the name to locate which group it belongs to
std::size_t key_pos= name.find(".");
if(key_pos!= std::string::npos )
if(key_pos != std::string_view::npos )
{
std::string control_group_key = name.substr(0, key_pos);
std::string_view control_group_key = name.substr(0, key_pos);
LLControlVariable* control;
// check if it's in the control group that name indicated
if(LLUI::getInstance()->mSettingGroups[control_group_key])
auto it = uiInst->mSettingGroups.find(control_group_key);
if(it != uiInst->mSettingGroups.end() && it->second)
{
control = LLUI::getInstance()->mSettingGroups[control_group_key]->getControl(name);
control = it->second->getControl(name);
if (control)
{
return control;
@ -2399,7 +2401,7 @@ LLControlVariable *LLView::findControl(const std::string& name)
}
}
LLControlGroup& control_group = LLUI::getInstance()->getControlControlGroup(name);
LLControlGroup& control_group = uiInst->getControlControlGroup(name);
return control_group.getControl(name);
}

View File

@ -341,8 +341,8 @@ public:
S32 getChildCount() const { return (S32)mChildList.size(); }
template<class _Pr3> void sortChildren(_Pr3 _Pred) { mChildList.sort(_Pred); }
bool hasAncestor(const LLView* parentp) const;
bool hasChild(const std::string& childname, bool recurse = false) const;
bool childHasKeyboardFocus( const std::string& childname ) const;
bool hasChild(std::string_view childname, bool recurse = false) const;
bool childHasKeyboardFocus( std::string_view childname ) const;
// these iterators are used for collapsing various tree traversals into for loops
typedef LLTreeDFSIter<LLView, child_list_const_iter_t> tree_iterator_t;
@ -416,7 +416,7 @@ public:
void screenRectToLocal( const LLRect& screen, LLRect* local ) const;
void localRectToScreen( const LLRect& local, LLRect* screen ) const;
LLControlVariable *findControl(const std::string& name);
LLControlVariable *findControl(std::string_view name);
const child_list_t* getChildList() const { return &mChildList; }
child_list_const_iter_t beginChild() const { return mChildList.begin(); }
@ -452,24 +452,24 @@ public:
// static method handles NULL pointer too
static std::string getPathname(const LLView*);
template <class T> T* findChild(const std::string& name, bool recurse = true) const
template <class T> T* findChild(std::string_view name, bool recurse = true) const
{
LLView* child = findChildView(name, recurse);
T* result = dynamic_cast<T*>(child);
return result;
}
template <class T> T* getChild(const std::string& name, bool recurse = true) const;
template <class T> T* getChild(std::string_view name, bool recurse = true) const;
template <class T> T& getChildRef(const std::string& name, bool recurse = true) const
template <class T> T& getChildRef(std::string_view name, bool recurse = true) const
{
return *getChild<T>(name, recurse);
}
virtual LLView* getChildView(const std::string& name, bool recurse = true) const;
virtual LLView* findChildView(const std::string& name, bool recurse = true) const;
virtual LLView* getChildView(std::string_view name, bool recurse = true) const;
virtual LLView* findChildView(std::string_view name, bool recurse = true) const;
template <class T> T* getDefaultWidget(const std::string& name) const
template <class T> T* getDefaultWidget(std::string_view name) const
{
LLView* widgetp = getDefaultWidgetContainer().findChildView(name);
return dynamic_cast<T*>(widgetp);
@ -576,7 +576,7 @@ private:
LLView* childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block = true);
template <typename METHOD, typename CHARTYPE>
LLView* childrenHandleCharEvent(const std::string& desc, const METHOD& method,
LLView* childrenHandleCharEvent(std::string_view desc, const METHOD& method,
CHARTYPE c, MASK mask);
// adapter to blur distinction between handleKey() and handleUnicodeChar()
@ -704,7 +704,7 @@ struct TypeValues<LLView::EOrientation> : public LLInitParam::TypeValuesHelper<L
};
}
template <class T> T* LLView::getChild(const std::string& name, bool recurse) const
template <class T> T* LLView::getChild(std::string_view name, bool recurse) const
{
LLView* child = findChildView(name, recurse);
T* result = dynamic_cast<T*>(child);
@ -739,7 +739,7 @@ template <class T> T* LLView::getChild(const std::string& name, bool recurse) co
// require explicit specialization. See llbutton.cpp for an example.
#ifndef LLVIEW_CPP
extern template class LLView* LLView::getChild<class LLView>(
const std::string& name, bool recurse) const;
std::string_view name, bool recurse) const;
#endif
#endif //LL_LLVIEW_H

View File

@ -360,7 +360,7 @@ std::string LLKeyboard::stringFromKey(KEY key, bool translate)
LLKeyStringTranslatorFunc *trans = gKeyboard->mStringTranslator;
if (trans != NULL)
{
res = trans(res.c_str());
res = trans(res);
}
}
@ -400,7 +400,7 @@ std::string LLKeyboard::stringFromMouse(EMouseClickType click, bool translate)
LLKeyStringTranslatorFunc* trans = gKeyboard->mStringTranslator;
if (trans != NULL)
{
res = trans(res.c_str());
res = trans(res);
}
}
return res;

View File

@ -42,7 +42,7 @@ enum EKeystate
};
typedef boost::function<bool(EKeystate keystate)> LLKeyFunc;
typedef std::string (LLKeyStringTranslatorFunc)(const char *label);
typedef std::string (LLKeyStringTranslatorFunc)(std::string_view);
enum EKeyboardInsertMode
{

View File

@ -419,7 +419,7 @@ LLPointer<LLControlVariable> LLControlGroup::getControl(std::string_view name)
incrCount(name);
}
ctrl_name_table_t::iterator iter = mNameTable.find(name.data());
ctrl_name_table_t::iterator iter = mNameTable.find(name);
return iter == mNameTable.end() ? LLPointer<LLControlVariable>() : iter->second;
}
@ -759,7 +759,7 @@ LLSD LLControlGroup::asLLSD(bool diffs_only)
return result;
}
bool LLControlGroup::controlExists(const std::string& name)
bool LLControlGroup::controlExists(std::string_view name)
{
ctrl_name_table_t::iterator iter = mNameTable.find(name);
return iter != mNameTable.end();

View File

@ -226,7 +226,7 @@ class LLControlGroup : public LLInstanceTracker<LLControlGroup, std::string>
LOG_CLASS(LLControlGroup);
protected:
typedef std::map<std::string, LLControlVariablePtr > ctrl_name_table_t;
typedef std::map<std::string, LLControlVariablePtr, std::less<> > ctrl_name_table_t;
ctrl_name_table_t mNameTable;
static const std::string mTypeString[TYPE_COUNT];
static const std::string mSanityTypeString[SANITY_TYPE_COUNT];
@ -339,7 +339,7 @@ public:
}
}
bool controlExists(const std::string& name);
bool controlExists(std::string_view name);
// Returns number of controls loaded, 0 if failed
// If require_declaration is false, will auto-declare controls it finds

View File

@ -301,6 +301,7 @@ set(viewer_SOURCE_FILES
llfloaterbigpreview.cpp
llfloaterbuildoptions.cpp
llfloaterbulkpermission.cpp
llfloaterbulkupload.cpp
llfloaterbump.cpp
llfloaterbuy.cpp
llfloaterbuycontents.cpp
@ -1106,6 +1107,7 @@ set(viewer_HEADER_FILES
llfloaterbigpreview.h
llfloaterbuildoptions.h
llfloaterbulkpermission.h
llfloaterbulkupload.h
llfloaterbump.h
llfloaterbuy.h
llfloaterbuycontents.h

View File

@ -2711,6 +2711,17 @@
<key>Value</key>
<integer>0</integer>
</map>
<key>BulkUpload2KTextures</key>
<map>
<key>Comment</key>
<string>Bulk upload scales textures to 2K if true, to 1K if false</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>1</integer>
</map>
<key>EnableButtonFlashing</key>
<map>
<key>Comment</key>
@ -15027,6 +15038,19 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Backup</key>
<integer>0</integer>
</map>
<key>TextureBiasUnimportantFactor</key>
<map>
<key>Comment</key>
<string>When biasing textures to lower resolution due to lack of vram, the importance threshold below which is considered unimportant and getting an extra bias.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>F32</string>
<key>Value</key>
<real>0.25</real>
<key>Backup</key>
<integer>0</integer>
</map>
<key>TextureDecodeDisabled</key>
<map>
<key>Comment</key>

View File

@ -64,14 +64,14 @@ float getBumpValue(vec2 texcoord)
void main()
{
float c = getBumpValue(vary_texcoord0).r;
float c = getBumpValue(vary_texcoord0);
float scaler = 512.0;
vec3 right = vec3(norm_scale, 0, (getBumpValue(vary_texcoord0+vec2(stepX, 0)).r-c)*scaler);
vec3 left = vec3(-norm_scale, 0, (getBumpValue(vary_texcoord0-vec2(stepX, 0)).r-c)*scaler);
vec3 up = vec3(0, -norm_scale, (getBumpValue(vary_texcoord0-vec2(0, stepY)).r-c)*scaler);
vec3 down = vec3(0, norm_scale, (getBumpValue(vary_texcoord0+vec2(0, stepY)).r-c)*scaler);
vec3 right = vec3(norm_scale, 0, (getBumpValue(vary_texcoord0+vec2(stepX, 0))-c)*scaler);
vec3 left = vec3(-norm_scale, 0, (getBumpValue(vary_texcoord0-vec2(stepX, 0))-c)*scaler);
vec3 up = vec3(0, -norm_scale, (getBumpValue(vary_texcoord0-vec2(0, stepY))-c)*scaler);
vec3 down = vec3(0, norm_scale, (getBumpValue(vary_texcoord0+vec2(0, stepY))-c)*scaler);
vec3 norm = cross(right, down) + cross(down, left) + cross(left,up) + cross(up, right);

View File

@ -111,7 +111,7 @@ void FSFloaterPoseStand::loadPoses()
LLUUID anim_id(p_itr->first);
if (anim_id.notNull())
{
mComboPose->add(LLTrans::getString(p_itr->second["name"]), anim_id);
mComboPose->add(LLTrans::getString(p_itr->second["name"].asStringRef()), anim_id);
}
}
}

View File

@ -2818,7 +2818,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
std::string full_settings_path;
if (file.file_name_setting.isProvided()
&& gSavedSettings.controlExists(file.file_name_setting))
&& gSavedSettings.controlExists(file.file_name_setting()))
{
// try to find filename stored in file_name_setting control
full_settings_path = gSavedSettings.getString(file.file_name_setting());

View File

@ -372,7 +372,7 @@ private:
};
// consts from viewer.h
const S32 AGENT_UPDATES_PER_SECOND = 125; // <FS:Beq/> FIRE-34171 - Directional Input Delays with latest PBR-Capable Viewers
const S32 AGENT_UPDATES_PER_SECOND = 125; // Value derived experimentally to avoid Input Delays with latest PBR-Capable Viewers when viewer FPS is highly volatile.
const S32 AGENT_FORCE_UPDATES_PER_SECOND = 1;
// Globals with external linkage. From viewer.h

View File

@ -0,0 +1,136 @@
/**
* @file llfloaterbulkupload.cpp
* @author Andrey Kleshchev
* @brief LLFloaterBulkUpload class implementation
*
* $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2024, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#include "llviewerprecompiledheaders.h"
#include "llfloaterbulkupload.h"
#include "lltextbox.h"
#include "llviewercontrol.h"
#include "llviewermenufile.h"
constexpr S32 MAX_HEIGH = 211;
LLFloaterBulkUpload::LLFloaterBulkUpload(const LLSD& key)
: LLModalDialog(key, true)
{
mUploadCost = key["upload_cost"].asInteger();
mUploadCount = key["upload_count"].asInteger();
mHas2kTextures = key["has_2k_textures"].asBoolean();
if (key["files"].isArray())
{
const LLSD& files = key["files"];
for (LLSD::array_const_iterator it = files.beginArray();
it != files.endArray();
++it)
{
mFiles.push_back(it->asString());
}
}
}
LLFloaterBulkUpload::~LLFloaterBulkUpload()
{
}
bool LLFloaterBulkUpload::postBuild()
{
childSetAction("upload_btn", [this](void*) { onClickUpload(); }, this);
childSetAction("cancel_btn", [this](void*) { onClickCancel(); }, this);
mCountLabel = getChild<LLTextBox>("number_of_items", true);
mCostLabel = getChild<LLTextBox>("upload_cost", true);
mCheckboxPanel = getChild<LLPanel>("checkbox_panel", true);
mLinkPanel = getChild<LLPanel>("link_panel", true);
mWarningPanel = getChild<LLPanel>("warning_panel", true);
mCheckboxUpload2K = getChild<LLUICtrl>("upload_2k");
mCheckboxUpload2K->setCommitCallback([this](LLUICtrl* ctrl, const LLSD& data) { onUpload2KCheckBox(); });
mAllow2kTextures = gSavedSettings.getBOOL("BulkUpload2KTextures");
mCheckboxUpload2K->setValue(!mAllow2kTextures);
if (!mAllow2kTextures && mHas2kTextures)
{
// provided cost is for 2K textures, recalculate cost
S32 bvh_count;
S32 textures_2k_count;
get_bulk_upload_expected_cost(mFiles, mAllow2kTextures, mUploadCost, mUploadCount, bvh_count, textures_2k_count);
update();
}
update();
return LLModalDialog::postBuild();
}
void LLFloaterBulkUpload::update()
{
mCountLabel->setTextArg("[COUNT]", llformat("%d", mUploadCount));
mCostLabel->setTextArg("[COST]", llformat("%d", mUploadCost));
mCheckboxPanel->setVisible(mHas2kTextures);
mLinkPanel->setVisible(mHas2kTextures);
mWarningPanel->setVisible(mHas2kTextures);
S32 new_height = MAX_HEIGH;
if (!mHas2kTextures)
{
new_height -= mCheckboxPanel->getRect().getHeight();
new_height -= mLinkPanel->getRect().getHeight();
new_height -= mWarningPanel->getRect().getHeight();
}
reshape(getRect().getWidth(), new_height, false);
}
void LLFloaterBulkUpload::onUpload2KCheckBox()
{
mAllow2kTextures = !mCheckboxUpload2K->getValue().asBoolean();
gSavedSettings.setBOOL("BulkUpload2KTextures", mAllow2kTextures);
S32 bvh_count;
S32 textures_2k_count;
get_bulk_upload_expected_cost(mFiles, mAllow2kTextures, mUploadCost, mUploadCount, bvh_count, textures_2k_count);
// keep old value of mHas2kTextures to show checkbox
update();
}
void LLFloaterBulkUpload::onClickUpload()
{
do_bulk_upload(mFiles, mAllow2kTextures);
closeFloater();
}
void LLFloaterBulkUpload::onClickCancel()
{
closeFloater();
}

View File

@ -0,0 +1,66 @@
/**
* @file llfloaterbulkupload.h
* @author Andrey Kleshchev
* @brief LLFloaterBulkUpload class definition
*
* $LicenseInfo:firstyear=2024&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2024, Linden Research, Inc.
*
* 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.
*
* 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.
*
* 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$
*/
#ifndef LL_LLFLOATERBULKUPLOAD_H
#define LL_LLFLOATERBULKUPLOAD_H
#include "llmodaldialog.h"
class LLTextBox;
class LLFloaterBulkUpload : public LLModalDialog
{
public:
LLFloaterBulkUpload(const LLSD& key);
~LLFloaterBulkUpload();
bool postBuild() override;
void update();
protected:
void onUpload2KCheckBox();
void onClickUpload();
void onClickCancel();
private:
LLUICtrl* mCheckboxUpload2K = nullptr;
LLTextBox* mCountLabel = nullptr;
LLTextBox* mCostLabel = nullptr;
LLPanel* mCheckboxPanel = nullptr;
LLPanel* mLinkPanel = nullptr;
LLPanel* mWarningPanel = nullptr;
std::vector<std::string> mFiles;
bool mAllow2kTextures = true;
bool mHas2kTextures = false;
S32 mUploadCost = 0;
S32 mUploadCount = 0;
};
#endif

View File

@ -3160,7 +3160,7 @@ void LLFloaterPreference::setSoundCacheLocation(const LLStringExplicit& location
void LLFloaterPreference::selectPanel(const LLSD& name)
{
LLTabContainer * tab_containerp = getChild<LLTabContainer>("pref core");
LLPanel * panel = tab_containerp->getPanelByName(name);
LLPanel * panel = tab_containerp->getPanelByName(name.asStringRef());
if (NULL != panel)
{
tab_containerp->selectTabPanel(panel);

View File

@ -1747,7 +1747,7 @@ bool LLPanelRegionTerrainInfo::postBuild()
{
mTextureDetailCtrl[i]->setBakeTextureEnabled(false);
}
initAndSetCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i));
initMaterialCtrl(mMaterialDetailCtrl[i], llformat("material_detail_%d", i), i);
initAndSetCtrl(mMaterialScaleUCtrl[i], llformat("terrain%dScaleU", i));
initAndSetCtrl(mMaterialScaleVCtrl[i], llformat("terrain%dScaleV", i));
@ -2153,6 +2153,31 @@ bool LLPanelRegionTerrainInfo::sendUpdate()
return true;
}
void LLPanelRegionTerrainInfo::initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index)
{
ctrl = findChild<LLTextureCtrl>(name, true);
if (!ctrl) return;
// consume cancel events, otherwise they will trigger commit callbacks
ctrl->setOnCancelCallback([](LLUICtrl* ctrl, const LLSD& param) {});
ctrl->setCommitCallback(
[this, index](LLUICtrl* ctrl, const LLSD& param)
{
if (!mMaterialScaleUCtrl[index]
|| !mMaterialScaleVCtrl[index]
|| !mMaterialRotationCtrl[index]
|| !mMaterialOffsetUCtrl[index]
|| !mMaterialOffsetVCtrl[index]) return;
mMaterialScaleUCtrl[index]->setValue(1.f);
mMaterialScaleVCtrl[index]->setValue(1.f);
mMaterialRotationCtrl[index]->setValue(0.f);
mMaterialOffsetUCtrl[index]->setValue(0.f);
mMaterialOffsetVCtrl[index]->setValue(0.f);
onChangeAnything();
});
}
bool LLPanelRegionTerrainInfo::callbackTextureHeights(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);

View File

@ -303,6 +303,8 @@ public:
protected:
bool sendUpdate() override;
void initMaterialCtrl(LLTextureCtrl*& ctrl, const std::string& name, S32 index);
private:
bool mConfirmedTextureHeights;
bool mAskedTextureHeights;

View File

@ -130,7 +130,7 @@ LLFloater* LLFloaterSidePanelContainer::getTopmostInventoryFloater()
return topmost_floater;
}
LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_name, const LLSD& params)
LLPanel* LLFloaterSidePanelContainer::openChildPanel(std::string_view panel_name, const LLSD& params)
{
LLView* view = findChildView(panel_name, true);
if (!view)
@ -162,18 +162,18 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
}
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const LLSD& key)
bool LLFloaterSidePanelContainer::canShowPanel(std::string_view floater_name, const LLSD& key)
{
return mValidateSignal(floater_name, sMainPanelName, key);
}
bool LLFloaterSidePanelContainer::canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key)
bool LLFloaterSidePanelContainer::canShowPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key)
{
return mValidateSignal(floater_name, panel_name, key);
}
// [/RLVa:KB]
void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const LLSD& key)
void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, const LLSD& key)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);
// if (floaterp)
@ -185,7 +185,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con
}
}
void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key)
void LLFloaterSidePanelContainer::showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);
// if (floaterp)
@ -197,7 +197,7 @@ void LLFloaterSidePanelContainer::showPanel(const std::string& floater_name, con
}
}
LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name, const std::string& panel_name)
LLPanel* LLFloaterSidePanelContainer::getPanel(std::string_view floater_name, std::string_view panel_name)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::getTypedInstance<LLFloaterSidePanelContainer>(floater_name);
@ -209,7 +209,7 @@ LLPanel* LLFloaterSidePanelContainer::getPanel(const std::string& floater_name,
return NULL;
}
LLPanel* LLFloaterSidePanelContainer::findPanel(const std::string& floater_name, const std::string& panel_name)
LLPanel* LLFloaterSidePanelContainer::findPanel(std::string_view floater_name, std::string_view panel_name)
{
LLFloaterSidePanelContainer* floaterp = LLFloaterReg::findTypedInstance<LLFloaterSidePanelContainer>(floater_name);

View File

@ -55,22 +55,22 @@ public:
void cleanup() { destroy(); }
LLPanel* openChildPanel(const std::string& panel_name, const LLSD& params);
LLPanel* openChildPanel(std::string_view panel_name, const LLSD& params);
static LLFloater* getTopmostInventoryFloater();
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
static bool canShowPanel(const std::string& floater_name, const LLSD& key);
static bool canShowPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key);
static bool canShowPanel(std::string_view floater_name, const LLSD& key);
static bool canShowPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key);
// [/RLVa:KB]
static void showPanel(const std::string& floater_name, const LLSD& key);
static void showPanel(std::string_view floater_name, const LLSD& key);
static void showPanel(const std::string& floater_name, const std::string& panel_name, const LLSD& key);
static void showPanel(std::string_view floater_name, std::string_view panel_name, const LLSD& key);
static LLPanel* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName);
static LLPanel* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName);
static LLPanel* findPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName);
static LLPanel* findPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName);
/**
* Gets the panel of given type T (doesn't show it or do anything else with it).
@ -80,7 +80,7 @@ public:
* @returns a pointer to the panel of given type T.
*/
template <typename T>
static T* getPanel(const std::string& floater_name, const std::string& panel_name = sMainPanelName)
static T* getPanel(std::string_view floater_name, std::string_view panel_name = sMainPanelName)
{
T* panel = dynamic_cast<T*>(getPanel(floater_name, panel_name));
if (!panel)
@ -111,7 +111,7 @@ public:
// [RLVa:KB] - Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
// Used to determine whether a sidepanel can be shown
public:
typedef boost::signals2::signal<bool(const std::string&, const std::string&, const LLSD&), boost_boolean_combiner> validate_signal_t;
typedef boost::signals2::signal<bool(std::string_view, std::string_view, const LLSD&), boost_boolean_combiner> validate_signal_t;
static boost::signals2::connection setValidateCallback(const validate_signal_t::slot_type& cb) { return mValidateSignal.connect(cb); }
private:
static validate_signal_t mValidateSignal;

View File

@ -226,7 +226,7 @@ void LLFloaterWebContent::preCreate(LLFloaterWebContent::Params& p)
// showInstance will open a new window. Figure out how many web browsers are already open,
// and close the least recently opened one if this will put us over the limit.
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class);
LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList(p.window_class());
if(instances.size() >= (size_t)browser_window_limit)
{

View File

@ -463,7 +463,7 @@ void LLLoginInstance::handleLoginFailure(const LLSD& event)
gViewerWindow->setShowProgress(false, false);
}
showMFAChallange(LLTrans::getString(response["message_id"]));
showMFAChallange(LLTrans::getString(response["message_id"].asString()));
}
else if( reason_response == "key"
|| reason_response == "presence"

View File

@ -2433,14 +2433,14 @@ void LLMaterialEditor::onSaveObjectsMaterialAsMsgCallback(const LLSD& notificati
createInventoryItem(str.str(), new_name, std::string(), permissions);
}
const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type);
const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k);
void LLMaterialEditor::loadMaterial(const tinygltf::Model &model_in, const std::string &filename, S32 index, bool open_floater)
{
if (index == model_in.materials.size())
{
// bulk upload all the things
upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL);
upload_bulk({ filename }, LLFilePicker::FFLOAD_MATERIAL, true);
return;
}

View File

@ -296,11 +296,14 @@ bool PeopleContextMenu::enableContextMenuItem(const LLSD& userdata)
return RlvActions::canPayAvatar(mUUIDs.front());
}
// [/RLVa:KB]
else if (item == std::string("can_im") || item == std::string("can_invite") ||
item == std::string("can_share") || item == std::string("can_pay"))
else if (item == std::string("can_im") || item == std::string("can_invite"))
{
return true;
}
else if (item == std::string("can_share") || item == std::string("can_pay"))
{
return mUUIDs.size() == 1;
}
return false;
}

View File

@ -62,10 +62,10 @@ void LLSideTrayPanelContainer::onOpen(const LLSD& key)
getCurrentPanel()->onOpen(key);
}
void LLSideTrayPanelContainer::openPanel(const std::string& panel_name, const LLSD& key)
void LLSideTrayPanelContainer::openPanel(std::string_view panel_name, const LLSD& key)
{
LLSD combined_key = key;
combined_key[PARAM_SUB_PANEL_NAME] = panel_name;
combined_key[PARAM_SUB_PANEL_NAME] = std::string(panel_name);
onOpen(combined_key);
}

View File

@ -59,7 +59,7 @@ public:
/**
* Opens given subpanel.
*/
void openPanel(const std::string& panel_name, const LLSD& key = LLSD::emptyMap());
void openPanel(std::string_view panel_name, const LLSD& key = LLSD::emptyMap());
/**
* Opens previous panel from panel navigation history.

View File

@ -385,7 +385,8 @@ LLNewFileResourceUploadInfo::LLNewFileResourceUploadInfo(
LLResourceUploadInfo(name, description, compressionInfo,
destinationType, inventoryType,
nextOWnerPerms, groupPerms, everyonePerms, expectedCost, show_inventory),
mFileName(fileName)
mFileName(fileName),
mMaxImageSize(LLViewerFetchedTexture::MAX_IMAGE_SIZE_DEFAULT)
{
}
@ -439,7 +440,7 @@ LLSD LLNewFileResourceUploadInfo::exportTempFile()
else if (assetType == LLAssetType::AT_TEXTURE)
{
// It's an image file, the upload procedure is the same for all
if (!LLViewerTextureList::createUploadFile(getFileName(), filename, codec))
if (!LLViewerTextureList::createUploadFile(getFileName(), filename, codec, mMaxImageSize))
{
// <FS:Ansariel> Duplicate error message output
//errorMessage = llformat("Problem with file %s:\n\n%s\n",

View File

@ -161,13 +161,15 @@ public:
std::string getFileName() const { return mFileName; };
void setMaxImageSize(U32 maxUploadSize) { mMaxImageSize = maxUploadSize; }
protected:
virtual LLSD exportTempFile();
private:
std::string mFileName;
S32 mMaxImageSize;
};
//-------------------------------------------------------------------------

View File

@ -47,6 +47,7 @@
#include "llfloaterbeacons.h"
#include "llfloaterbuildoptions.h"
#include "llfloaterbulkpermission.h"
#include "llfloaterbulkupload.h"
#include "llfloaterbump.h"
#include "llfloaterbuy.h"
#include "llfloaterbuycontents.h"
@ -264,6 +265,7 @@ public:
"camera_presets",
"delete_pref_preset",
"forget_username",
"gltf_asset_editor",
"god_tools",
"group_picker",
"hud",
@ -280,7 +282,8 @@ public:
"upload_image",
"upload_model",
"upload_script",
"upload_sound"
"upload_sound",
"bulk_upload"
};
return std::find(blacklist_clicked.begin(), blacklist_clicked.end(), fl_name) == blacklist_clicked.end();
}
@ -304,6 +307,7 @@ public:
"env_edit_extdaycycle",
"font_test",
"forget_username",
"gltf_asset_editor",
"god_tools",
"group_picker",
"hud",
@ -329,7 +333,8 @@ public:
"upload_image",
"upload_model",
"upload_script",
"upload_sound"
"upload_sound",
"bulk_upload"
};
return std::find(blacklist_untrusted.begin(), blacklist_untrusted.end(), fl_name) == blacklist_untrusted.end();
}
@ -404,6 +409,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("buy_object_contents", "floater_buy_contents.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuyContents>);
LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>);
LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>);
LLFloaterReg::add("bulk_upload", "floater_bulk_upload.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBulkUpload>);
LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>);
LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>);

View File

@ -538,15 +538,8 @@ const void upload_single_file(const std::vector<std::string>& filenames, LLFileP
return;
}
void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification, const LLSD& response)
void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option != 0)
{
// Cancel upload
return;
}
for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter)
{
std::string filename = (*in_iter);
@ -566,7 +559,7 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification
if (LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(ext, asset_type, codec))
{
bool resource_upload = false;
if (asset_type == LLAssetType::AT_TEXTURE)
if (asset_type == LLAssetType::AT_TEXTURE && allow_2k)
{
LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec);
if (gDirUtilp->fileExists(filename) && image_frmted->load(filename))
@ -582,7 +575,7 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification
if (resource_upload)
{
LLResourceUploadInfo::ptr_t uploadInfo(new LLNewFileResourceUploadInfo(
LLNewFileResourceUploadInfo* info_p = new LLNewFileResourceUploadInfo(
filename,
asset_name,
asset_name, 0,
@ -590,7 +583,13 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification
LLFloaterPerms::getNextOwnerPerms("Uploads"),
LLFloaterPerms::getGroupPerms("Uploads"),
LLFloaterPerms::getEveryonePerms("Uploads"),
expected_upload_cost));
expected_upload_cost);
if (!allow_2k)
{
info_p->setMaxImageSize(1024);
}
LLResourceUploadInfo::ptr_t uploadInfo(info_p);
upload_new_resource(uploadInfo);
}
@ -616,11 +615,30 @@ void do_bulk_upload(std::vector<std::string> filenames, const LLSD& notification
}
}
bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S32& total_cost, S32& file_count, S32& bvh_count)
void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k, const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option != 0)
{
// Cancel upload
return;
}
do_bulk_upload(filenames, allow_2k);
}
bool get_bulk_upload_expected_cost(
const std::vector<std::string>& filenames,
bool allow_2k,
S32& total_cost,
S32& file_count,
S32& bvh_count,
S32& textures_2k_count)
{
total_cost = 0;
file_count = 0;
bvh_count = 0;
textures_2k_count = 0;
for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter)
{
std::string filename = (*in_iter);
@ -637,12 +655,20 @@ bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S3
if (LLResourceUploadInfo::findAssetTypeAndCodecOfExtension(ext, asset_type, codec))
{
if (asset_type == LLAssetType::AT_TEXTURE)
if (asset_type == LLAssetType::AT_TEXTURE && allow_2k)
{
LLPointer<LLImageFormatted> image_frmted = LLImageFormatted::createFromType(codec);
if (gDirUtilp->fileExists(filename) && image_frmted->load(filename))
{
total_cost += LLAgentBenefitsMgr::current().getTextureUploadCost(image_frmted);
if (image_frmted)
{
S32 area = image_frmted->getHeight() * image_frmted->getWidth();
if (area >= LLAgentBenefits::MIN_2K_TEXTURE_AREA)
{
textures_2k_count++;
}
}
file_count++;
}
}
@ -697,47 +723,40 @@ bool get_bulk_upload_expected_cost(const std::vector<std::string>& filenames, S3
return file_count > 0;
}
const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type)
const void upload_bulk(const std::vector<std::string>& filtered_filenames, bool allow_2k)
{
// TODO:
// Check user balance for entire cost
// Charge user entire cost
// Loop, uploading
// If an upload fails, refund the user for that one
//
// Also fix single upload to charge first, then refund
// FIXME PREMIUM what about known types that can't be bulk uploaded
// (bvh)? These will fail in the item by item upload but won't be
// mentioned in the notification.
std::vector<std::string> filtered_filenames;
for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter)
{
const std::string& filename = *in_iter;
if (check_file_extension(filename, type))
{
filtered_filenames.push_back(filename);
}
}
S32 expected_upload_cost;
S32 expected_upload_count;
S32 bvh_count;
if (get_bulk_upload_expected_cost(filtered_filenames, expected_upload_cost, expected_upload_count, bvh_count))
S32 textures_2k_count;
if (get_bulk_upload_expected_cost(filtered_filenames, allow_2k, expected_upload_cost, expected_upload_count, bvh_count, textures_2k_count))
{
LLSD args;
args["COST"] = expected_upload_cost;
args["COUNT"] = expected_upload_count;
LLSD key;
key["upload_cost"] = expected_upload_cost;
key["upload_count"] = expected_upload_count;
key["has_2k_textures"] = (textures_2k_count > 0);
// <FS:Ansariel> Check balance before trying to upload
S32 current_balance = gStatusBar->getBalance();
if (expected_upload_cost > current_balance)
{
LLSD args;
args["COST"] = expected_upload_cost;
args["COUNT"] = expected_upload_count;
args["BALANCE"] = current_balance;
LLNotificationsUtil::add("NotEnoughMoneyForBulkUpload", args);
return;
}
// </FS:Ansariel>
LLNotificationsUtil::add("BulkUploadCostConfirmation", args, LLSD(), boost::bind(do_bulk_upload, filtered_filenames, _1, _2));
LLSD array;
for (const std::string& str : filtered_filenames)
{
array.append(str);
}
key["files"] = array;
LLFloaterReg::showInstance("bulk_upload", key);
if (filtered_filenames.size() > expected_upload_count)
{
@ -762,6 +781,31 @@ const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::
}
const void upload_bulk(const std::vector<std::string>& filenames, LLFilePicker::ELoadFilter type, bool allow_2k)
{
// TODO:
// Check user balance for entire cost
// Charge user entire cost
// Loop, uploading
// If an upload fails, refund the user for that one
//
// Also fix single upload to charge first, then refund
// FIXME PREMIUM what about known types that can't be bulk uploaded
// (bvh)? These will fail in the item by item upload but won't be
// mentioned in the notification.
std::vector<std::string> filtered_filenames;
for (std::vector<std::string>::const_iterator in_iter = filenames.begin(); in_iter != filenames.end(); ++in_iter)
{
const std::string& filename = *in_iter;
if (check_file_extension(filename, type))
{
filtered_filenames.push_back(filename);
}
}
upload_bulk(filtered_filenames, allow_2k);
}
class LLFileUploadImage : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -827,7 +871,7 @@ class LLFileUploadBulk : public view_listener_t
{
gAgentCamera.changeCameraToDefault();
}
LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2), LLFilePicker::FFLOAD_ALL, true);
LLFilePickerReplyThread::startPicker(boost::bind(&upload_bulk, _1, _2, true), LLFilePicker::FFLOAD_ALL, true);
return true;
}
};

View File

@ -65,13 +65,15 @@ void upload_new_resource(
LLAssetStorage::LLStoreAssetCallback callback = LLAssetStorage::LLStoreAssetCallback(),
void *userdata = NULL);
bool get_bulk_upload_expected_cost(
const std::vector<std::string>& filenames,
bool allow_2k,
S32& total_cost,
S32& file_count,
S32& bvh_count,
S32& textures_2k_count);
void assign_defaults_and_show_upload_message(
LLAssetType::EType asset_type,
LLInventoryType::EType& inventory_type,
std::string& name,
const std::string& display_name,
std::string& description);
void do_bulk_upload(std::vector<std::string> filenames, bool allow_2k);
//consider moving all file pickers below to more suitable place
class LLFilePickerThread : public LLThread

View File

@ -944,12 +944,10 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
if (face && face->getViewerObject() && face->getTextureEntry())
{
// <FS:Beq> Fix Blurry textures and use importance weight
F32 radius;
F32 cos_angle_to_view_dir;
bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
static LLCachedControl<F32> bias_unimportant_threshold(gSavedSettings, "TextureBiasUnimportantFactor", 0.25f);
// </FS:Beq>
F32 vsize = face->getPixelArea();
// Scale desired texture resolution higher or lower depending on texture scale
@ -963,15 +961,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag
min_scale = llclamp(min_scale*min_scale, texture_scale_min(), texture_scale_max());
vsize /= min_scale;
// <FS:Beq> Fix Blurry textures and use importance weight
// vsize /= LLViewerTexture::sDesiredDiscardBias;
// vsize /= llmax(1.f, (LLViewerTexture::sDesiredDiscardBias-1.f) * (1.f + face->getDrawable()->mDistanceWRTCamera * bias_distance_scale));
// F32 radius;
// F32 cos_angle_to_view_dir;
// bool in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius);
// if (!in_frustum || !face->getDrawable()->isVisible())
// </FS:Beq>
if (!in_frustum || !face->getDrawable()->isVisible() || face->getImportanceToCamera() < bias_unimportant_threshold)
{ // further reduce by discard bias when off screen or occluded
vsize /= LLViewerTexture::sDesiredDiscardBias;

View File

@ -844,9 +844,11 @@ bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples)
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
if (mRT == &mMainRT)
{ // hacky -- allocate auxillary buffer
gCubeSnapshot = TRUE;
if (sReflectionProbesEnabled)
{
gCubeSnapshot = true;
mReflectionMapManager.initReflectionMaps();
}

View File

@ -744,7 +744,7 @@ void FloaterQuickPrefs::loadSavedSettingsFromFile(const std::string& settings_pa
if (xml_entry.translation_id.isProvided())
{
// replace label with translated version, if available
LLTrans::findString(label, xml_entry.translation_id);
LLTrans::findString(label, xml_entry.translation_id());
}
// Convert old RenderAvatarMaxVisible setting to IndirectMaxNonImpostors

View File

@ -336,7 +336,7 @@ bool RlvUIEnabler::removeGenericFloaterFilter(const std::string& strFloaterName)
return true;
}
bool RlvUIEnabler::filterFloaterGeneric(const std::string& strFloaterName, const LLSD&)
bool RlvUIEnabler::filterFloaterGeneric(std::string_view strFloaterName, const LLSD&)
{
auto itFloater = m_FilteredFloaterMap.find(strFloaterName);
if (m_FilteredFloaterMap.end() != itFloater)
@ -350,7 +350,7 @@ bool RlvUIEnabler::filterFloaterGeneric(const std::string& strFloaterName, const
}
// Checked: 2010-04-22 (RLVa-1.4.5) | Added: RLVa-1.2.0
bool RlvUIEnabler::filterFloaterShowLoc(const std::string& strName, const LLSD&)
bool RlvUIEnabler::filterFloaterShowLoc(std::string_view strName, const LLSD&)
{
if ("about_land" == strName)
return canViewParcelProperties();
@ -362,7 +362,7 @@ bool RlvUIEnabler::filterFloaterShowLoc(const std::string& strName, const LLSD&)
}
// Checked: 2012-02-07 (RLVa-1.4.5) | Added: RLVa-1.4.5
bool RlvUIEnabler::filterPanelShowLoc(const std::string& strFloater, const std::string&, const LLSD& sdKey)
bool RlvUIEnabler::filterPanelShowLoc(std::string_view strFloater, std::string_view, const LLSD& sdKey)
{
if ("places" == strFloater)
{
@ -376,7 +376,7 @@ bool RlvUIEnabler::filterPanelShowLoc(const std::string& strFloater, const std::
}
// Checked: 2010-03-01 (RLVa-1.2.0b) | Added: RLVa-1.2.0a
bool RlvUIEnabler::filterFloaterViewXXX(const std::string& strName, const LLSD&)
bool RlvUIEnabler::filterFloaterViewXXX(std::string_view strName, const LLSD&)
{
if ( (gRlvHandler.hasBehaviour(RLV_BHVR_VIEWNOTE)) && ("preview_notecard" == strName) )
{

View File

@ -66,14 +66,14 @@ public:
bool removeGenericFloaterFilter(const std::string& strFloaterName);
protected:
bool filterFloaterGeneric(const std::string&, const LLSD&);
bool filterFloaterGeneric(std::string_view, const LLSD&);
boost::signals2::connection m_ConnFloaterGeneric;
bool filterFloaterShowLoc(const std::string&, const LLSD& );
bool filterFloaterShowLoc(std::string_view, const LLSD& );
boost::signals2::connection m_ConnFloaterShowLoc; // showloc
bool filterFloaterViewXXX(const std::string&, const LLSD&);
bool filterFloaterViewXXX(std::string_view, const LLSD&);
boost::signals2::connection m_ConnFloaterViewXXX; // viewnote, viewscript, viewtexture
bool filterPanelShowLoc(const std::string&, const std::string&, const LLSD& );
bool filterPanelShowLoc(std::string_view, std::string_view, const LLSD& );
boost::signals2::connection m_ConnPanelShowLoc; // showloc
/*
@ -93,7 +93,7 @@ protected:
typedef std::multimap<ERlvBehaviour, behaviour_handler_t> behaviour_handler_map_t;
behaviour_handler_map_t m_Handlers;
std::map<std::string, std::function<void()>> m_FilteredFloaterMap;
std::map<std::string, std::function<void()>, std::less<>> m_FilteredFloaterMap;
};
// ============================================================================

View File

@ -3575,10 +3575,6 @@ Təhlükəsizliyiniz üçün onlar bir neçə saniyə bloklanacaqlar.
<notification name="FailedToGetBenefits">
Təəssüf ki, bu sessiya üçün hesab faydaları haqqında məlumat əldə edə bilmədik. Bu normal iş mühitində baş verməməlidir. Zəhmət olmasa dəstək ilə əlaqə saxlayın. Bu seans normal işləməyəcək və biz sizə proqramın yenidən başlamağınızı tövsiyə edirik.
<usetemplate name="okbutton" yestext="Bəli"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Bu, ümumi dəyəri L$[COST] olan [COUNT] elementi yükləyəcək. Yükləməyə davam etmək istədiyinizə əminsiniz?
<usetemplate ignoretext="Toplu yükləməni təsdiqləyin" name="okcancelignore" notext="Ləğv et" yestext="Yüklə"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
Cari L$[BALANCE] balansınız ümumi dəyəri L$[COST] olan [COUNT] element yükləmək üçün kifayət deyil.

View File

@ -0,0 +1,33 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="bulk_upload">
<layout_stack name="maint_layout">
<layout_panel name="count_panel">
<text name="number_of_items">
Anzahl an hochzuladenden Objekten: [COUNT]
</text>
</layout_panel>
<layout_panel name="warning_panel">
<text name="textures_2k_warning">
Standardmäßig werden eine oder mehrere ausgewählte Texturen auf 2048px skaliert.
</text>
</layout_panel>
<layout_panel name="checkbox_panel">
<check_box label="Texturen maximal bis 1024px skalieren" name="upload_2k" />
</layout_panel>
<layout_panel name="cost_panel">
<text name="upload_cost">
Kosten fürs Hochladen: L$[COST]
</text>
</layout_panel>
<layout_panel name="buttoms_panel">
<button label="Hochladen" name="upload_btn"/>
<button label="Abbrechen" name="cancel_btn"/>
</layout_panel>
<layout_panel name="link_panel">
<text name="new_folder_textbox">
Wie Texturen beim Hochladen skaliert werden:
https://wiki.secondlife.com/wiki/Limits#All_Viewers
</text>
</layout_panel>
</layout_stack>
</floater>

View File

@ -3708,10 +3708,6 @@ Voreinstellung überschreiben oder einen anderen Namen wählen
Leider konnten wir für diese Sitzung keine Informationen zu den Leistungen erhalten. Dies sollte in einer normalen Produktionsumgebung nicht passieren. Kontaktiere bitte den Support. Diese Sitzung wird nicht normal laufen, und wir empfehlen, die Sitzung neu zu starten.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Dadurch werden [COUNT] Artikel zu einem Gesamtpreis von [COST] $ hochgeladen. Möchtest du mit dem Hochladen fortfahren?
<usetemplate name="okcancelignore" notext="Abbrechen" yestext="Hochladen" ignoretext="Mehrfach-Uploads bestätigen"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
Ihr aktueller Kontostand von [BALANCE] L$ reicht nicht aus, um [COUNT] Gegenstände für insgesamt [COST] L$ hochzuladen.
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -0,0 +1,144 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater
can_resize="false"
show_title="false"
can_minimize="false"
can_close="false"
header_height="10"
bg_opaque_image="Window_NoTitle_Foreground"
bg_alpha_image="Window_NoTitle_Background"
height="207"
layout="topleft"
name="bulk_upload"
width="430">
<layout_stack
follows="all"
height="203"
layout="topleft"
left="8"
animate="false"
top="1"
orientation="vertical"
name="maint_layout"
width="421">
<layout_panel
follows="all"
height="27"
layout="topleft"
auto_resize="false"
visible="true"
name="count_panel">
<text
follows="left|top"
layout="topleft"
top="6"
left="20"
name="number_of_items"
height="20"
wrap="true">
Number of items to upload: [COUNT]
</text>
</layout_panel>
<layout_panel
follows="all"
height="37"
layout="topleft"
auto_resize="false"
visible="true"
name="warning_panel">
<text
name="textures_2k_warning"
follows="left|top"
layout="topleft"
top="6"
left="20"
height="30"
right="-20"
wrap="true">
By default, one or more selected textures will be scaled to 2048px.
</text>
</layout_panel>
<layout_panel
follows="all"
height="23"
layout="topleft"
auto_resize="false"
visible="true"
name="checkbox_panel">
<check_box
height="16"
left="20"
label="Scale textures to a maximum of 1024px"
layout="topleft"
name="upload_2k" />
</layout_panel>
<layout_panel
follows="all"
height="27"
layout="topleft"
auto_resize="false"
visible="true"
name="cost_panel">
<text
name="upload_cost"
follows="left|top"
layout="topleft"
font.style="BOLD"
top="6"
left="20"
height="20"
wrap="true">
Upload cost: L$[COST]
</text>
</layout_panel>
<layout_panel
follows="all"
height="29"
layout="topleft"
auto_resize="false"
visible="true"
name="buttoms_panel">
<button
follows="bottom|left|right"
height="23"
label="Upload"
layout="topleft"
mouse_opaque="false"
name="upload_btn"
top="1"
left="84"
width="120" />
<button
follows="bottom|left|right"
height="23"
label="Cancel"
layout="topleft"
left_pad="12"
top_delta="0"
mouse_opaque="false"
name="cancel_btn"
width="120" />
</layout_panel>
<layout_panel
follows="all"
height="40"
layout="topleft"
auto_resize="false"
visible="true"
name="link_panel">
<text
follows="left|top"
layout="topleft"
top="6"
left="20"
name="new_folder_textbox"
height="39"
parse_urls="true"
skip_link_underline="true"
wrap="true">
How textures are scaled during upload:
https://wiki.secondlife.com/wiki/Limits#All_Viewers
</text>
</layout_panel>
</layout_stack>
</floater>

View File

@ -55,6 +55,9 @@
name="share">
<on_click
function="Avatar.Share" />
<on_enable
function="Avatar.EnableItem"
parameter="can_share" />
</menu_item_call>
<menu_item_call
enabled="false"
@ -63,6 +66,9 @@
name="pay">
<on_click
function="Avatar.Pay" />
<on_enable
function="Avatar.EnableItem"
parameter="can_pay" />
</menu_item_call>
<menu_item_call
label="Offer Teleport"

View File

@ -9718,18 +9718,6 @@ Your voice has been muted by a moderator.
yestext="OK"/>
</notification>
<notification
icon="alertmodal.tga"
name="BulkUploadCostConfirmation"
type="alertmodal">
This will upload [COUNT] items at a total cost of L$[COST]. Do you wish to continue with the upload?
<usetemplate
ignoretext="Confirm bulk uploads"
name="okcancelignore"
notext="Cancel"
yestext="Upload"/>
</notification>
<notification
icon="alertmodal.tga"
name="NotEnoughMoneyForBulkUpload"

View File

@ -3474,10 +3474,6 @@ Por tu seguridad, serán bloqueadas durante unos segundos.
Desafortunadamente no fuimos capaces de obtener información sobre los beneficios para esta sesión. Esto no debería suceder en un espacio de producción normal. Por favor contacte con soporte. Esta sesión no funcionara normalmente y recomendamos reiniciar.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Esto subirá [COUNT] objetos por un costo total de L$[COST]. ¿Deseas continuar con la subida?
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Subir"/>
</notification>
<notification name="BulkUploadNoCompatibleFiles">
Los archivos seleccionados no pueden ser subidos en grupo.
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -3739,10 +3739,6 @@ ce préréglage ou choisir un autre nom.
Malheureusement, nous n'avons pas pu obtenir d'informations sur les avantages pour cette session. Cela ne devrait pas se produire dans un environnement de production normal. Veuillez contacter le service d'assistance. Cette session ne fonctionnera pas normalement et nous vous recommandons de recommencer.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Ceci permettra de charger [COUNT] éléments pour un coût total de L$[COST]. Souhaitez-vous poursuivre le téléchargement ?
<usetemplate name="okcancelbuttons" notext="Annuler" yestext="Charger"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
Votre solde actuel de [BALANCE]L$ n'est pas suffisant pour télécharger [COUNT] articles pour un coût total de L$[COST].
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -3507,10 +3507,6 @@ Per sicurezza, verranno bloccati per alcuni secondi.
Purtroppo non siamo stati in grado di ottenere informazioni utili per questa sessione. Questo non dovrebbe accadere in un normale ambiente di produzione. Si prega di contattare il supporto. Questa sessione non funzionerà correttamente, si consiglia di riavviare.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Questo caricherà [COUNT] oggetti ad un costo totale di [COST]L$. Vuoi continuare con il caricamento?
<usetemplate name="okcancelignore" ignoretext="Conferma i caricamenti in blocco" notext="Annulla" yestext="Carica"/>
</notification>
<notification name="BulkUploadNoCompatibleFiles">
I file selezionati non possono essere caricati.
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -3748,11 +3748,6 @@ M キーを押して変更します。
申し訳ありませんが、このセッションで利益情報を取得することができませんでした。通常の本番環境では起こるはずのない事象ですので、サポートに連絡してみて下さい。このセッションは通常通りに機能していないと思われ、再起動することをお勧めします。
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
[COUNT] 個のアイテムをアップロードすることにより、合計 L$[COST] のコストがかかります。アップロードを続けますか?
<usetemplate ignoretext="一括アップロードを確認" name="okcancelignore" notext="取り消し" yestext="アップロード"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
現在の残高 L$[BALANCE] では [COUNT] 個のアイテムをアップロードするのに必要な合計 L$[COST] に足りません。
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -3596,10 +3596,6 @@ to ustawienie lub wybrać inną nazwę.
<notification name="FailedToGetBenefits">
Niestety nie udało nam się uzyskać informacji o korzyściach dla tej sesji. Nie powinno się to zdarzyć w normalnym środowisku produkcyjnym. Skontaktuj się z pomocą techniczną. Ta sesja nie będzie działać normalnie i zalecamy restart.
</notification>
<notification name="BulkUploadCostConfirmation">
Spowoduje to przesłanie [COUNT] elementów o łącznym koszcie [COST]L$. Czy chcesz kontynuować przesyłanie?
<usetemplate name="okcancelignore" ignoretext="Potwierdź przesyłanie zbioru wielu plików" notext="Anuluj" yestext="Prześlij"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
Twój obecny stan konta ([BALANCE]L$) nie wystarczy do przesłania [COUNT] elementów - łączny koszt to [COST]L$.
</notification>

View File

@ -3265,10 +3265,6 @@ Para sua segurança, os SLurls serão bloqueados por alguns instantes.
Infelizmente, não conseguimos obter as informações de benefícios para esta sessão. Isto não deveria ocorrer em um ambiente de produção normal. Por favor, contate o suporte. Esta sessão não funcionará normalmente e recomendamos que você reinicie.
<usetemplate name="okbutton" yestext="OK"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Será feito o upload de [COUNT] itens, com um custo total de L$[COST]. Você deseja prosseguir com o upload?
<usetemplate name="okcancelbuttons" notext="Cancelar" yestext="Carregar"/>
</notification>
<notification name="BulkUploadNoCompatibleFiles">
Não é possível fazer o upload dos arquivos selecionados de uma vez só.
<usetemplate name="okbutton" yestext="OK"/>

View File

@ -3719,10 +3719,6 @@ URL: [AUDIOURL]
<notification name="FailedToGetBenefits">
К сожалению, в этой сессии мы не смогли получить информацию о преимуществах аккаунта. Такое не должно происходить в нормально работающей среде. Пожалуйста, свяжитесь со службой поддержки. Эта сессия работает некорректно, поэтому мы рекомендуем вам перезапустить программу.
<usetemplate name="okbutton" yestext="Да"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Этим действием загружается [COUNT] предметов на общую стоимость L$[COST]. Вы хотите продолжить загрузку?
<usetemplate ignoretext="Подтвердите массовую загрузку" name="okcancelignore" notext="Отмена" yestext="Загрузить"/>
</notification>
<notification name="NotEnoughMoneyForBulkUpload">
Текущий баланс [BALANCE] L$ недостаточен для загрузки [COUNT] элементов общей стоимостью [COST] L$.

View File

@ -3371,10 +3371,6 @@ Güvenliğiniz için birkaç saniye engellenecek.
Maalesef, bu oturumun avantajlarıyla ilgili bilgilere ulaşamıyoruz. Normal prodüksiyon ortamında yaşanmaması gereken bir durumdur. Lütfen destek ekibiyle iletişime geçin. Bu oturum normal bir şekilde çalışmayacaktır, yeniden başlatmanızı öneririz.
<usetemplate name="okbutton" yestext="Tamam"/>
</notification>
<notification name="BulkUploadCostConfirmation">
Bu, toplam tutarı L$[COST] olan [COUNT] nesne yükleyecektir. Bu yüklemeye devam etmek istiyor musunuz?
<usetemplate name="okcancelbuttons" notext="İptal" yestext="Karşıya Yükle"/>
</notification>
<notification name="BulkUploadNoCompatibleFiles">
Seçili dosyalar aynı anda yüklenemez.
<usetemplate name="okbutton" yestext="Tamam"/>

View File

@ -38,19 +38,24 @@
// Baked-in return values for getString()
std::map< std::string, std::string > gString;
std::map< std::string, std::string, std::less<>> gString;
// Baked-in return values for getCountString()
// map of pairs of input xml_desc and integer count
typedef std::pair< std::string, int > count_string_t;
std::map< count_string_t, std::string > gCountString;
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
std::string LLTrans::getString(const std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
{
std::string text = gString[xml_desc];
auto it = gString.find(xml_desc);
if (it != gString.end())
{
std::string text = it->second;
LLStringUtil::format(text, args);
return text;
}
return {};
}
std::string LLTrans::getCountString(const std::string& language, const std::string& xml_desc, S32 count)
{

View File

@ -79,7 +79,7 @@ LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; }
LLViewerWindow* gViewerWindow;
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
{
return std::string("test_trans");
}
@ -257,7 +257,7 @@ static LLEventPump * gTOSReplyPump = NULL;
LLPointer<LLSecAPIHandler> gSecAPIHandler;
//static
LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, bool focus)
LLFloater* LLFloaterReg::showInstance(std::string_view name, const LLSD& key, bool focus)
{
gTOSType = name;
gTOSReplyPump = &LLEventPumps::instance().obtain(key["reply_pump"]);

View File

@ -46,10 +46,10 @@ static const char * const TEST_FILENAME("llslurl_test.xml");
class LLTrans
{
public:
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
};
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
{
return std::string();
}

View File

@ -45,10 +45,10 @@ static const char * const TEST_FILENAME("llviewernetwork_test.xml");
class LLTrans
{
public:
static std::string getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
static std::string getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string = false);
};
std::string LLTrans::getString(const std::string &xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
std::string LLTrans::getString(std::string_view xml_desc, const LLStringUtil::format_map_t& args, bool def_string)
{
std::string grid_label = std::string();
if(xml_desc == "AgniGridLabel")

View File

@ -66,7 +66,7 @@ void LLWorldMipmap::equalizeBoostLevels() { }
LLPointer<LLViewerFetchedTexture> LLWorldMipmap::getObjectsTile(U32 grid_x, U32 grid_y, S32 level, bool load) { return NULL; }
// Stub other stuff
std::string LLTrans::getString(const std::string &, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); }
std::string LLTrans::getString(std::string_view, const LLStringUtil::format_map_t&, bool def_string) { return std::string("test_trans"); }
void LLUIString::updateResult() const { }
void LLUIString::setArg(const std::string& , const std::string& ) { }
void LLUIString::assign(const std::string& ) { }