Giant VMM merge, still need to compile it and fix llfloatermarketplacelistings
Merge VMM up to change 187902d9c4afd2990acddeb964c928179a52d189 mAllowWear=>mAllowOpen (should probably just remove this altogether though inventory_panels now accept the "show_root_folder", "allow_drop_on_root", "allow_open", and "use_marketplace_folders" attributes. Other stuff in this commit: LLPanelInjector~ Sync lltooldraganddrop to alchemy Sync notifications up with alchemy Reorganize notifications some, to better merge with upstream Remove duplicate InventorySortOrder in settings map There's a bit of a weird folderview merge mixed into here, I wouldn't trust it, but this thing is so god damn tangled I can't go back now~ Wouldn't have been possible without help from Shyotl and music by Amanda Palmer
This commit is contained in:
committed by
Lirusaito
parent
167d336274
commit
f140b4f35c
@@ -441,8 +441,31 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLUICtrlFactory *fac
|
||||
std::string name("panel");
|
||||
node->getAttributeString("name", name);
|
||||
|
||||
LLPanel* panelp = factory->createFactoryPanel(name);
|
||||
std::string class_attr;
|
||||
node->getAttributeString("class", class_attr);
|
||||
|
||||
LLPanel* panelp = NULL;
|
||||
|
||||
{
|
||||
if(!class_attr.empty())
|
||||
{
|
||||
panelp = LLRegisterPanelClass::instance().createPanelClass(class_attr);
|
||||
}
|
||||
|
||||
if (!panelp)
|
||||
{
|
||||
panelp = factory->createFactoryPanel(name);
|
||||
/* Singu TODO: Future?
|
||||
llassert(panelp);
|
||||
|
||||
if (!panelp)
|
||||
{
|
||||
return NULL; // :(
|
||||
}*/
|
||||
}
|
||||
}
|
||||
LL_RECORD_BLOCK_TIME(FTM_PANEL_CONSTRUCTION);
|
||||
|
||||
// Fall back on a default panel, if there was no special factory.
|
||||
if (!panelp)
|
||||
{
|
||||
|
||||
@@ -39,8 +39,8 @@
|
||||
#include "lluictrl.h"
|
||||
#include "llbutton.h"
|
||||
#include "lllineeditor.h"
|
||||
#include "lluiimage.h"
|
||||
#include "llviewborder.h"
|
||||
#include "lluiimage.h"
|
||||
#include "lluistring.h"
|
||||
#include "v4color.h"
|
||||
#include <list>
|
||||
@@ -142,6 +142,7 @@ public:
|
||||
|
||||
CommitCallbackRegistry::ScopedRegistrar& getCommitCallbackRegistrar() { return mCommitCallbackRegistrar; }
|
||||
EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; }
|
||||
|
||||
virtual BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
void initChildrenXML(LLXMLNodePtr node, LLUICtrlFactory* factory);
|
||||
void setPanelParameters(LLXMLNodePtr node, LLView *parentp);
|
||||
@@ -151,6 +152,7 @@ public:
|
||||
std::string getString(const std::string& 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);
|
||||
@@ -196,7 +198,7 @@ public:
|
||||
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 childSetToolTipArg(const std::string& id, const std::string& key, const LLStringExplicit& text);
|
||||
|
||||
|
||||
// LLSlider / LLMultiSlider / LLSpinCtrl
|
||||
void childSetMinValue(const std::string& id, LLSD min_value);
|
||||
void childSetMaxValue(const std::string& id, LLSD max_value);
|
||||
@@ -228,6 +230,7 @@ public:
|
||||
static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory);
|
||||
|
||||
boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb );
|
||||
|
||||
protected:
|
||||
// Override to set not found list
|
||||
LLButton* getDefaultButton() { return mDefaultBtn; }
|
||||
@@ -262,4 +265,56 @@ private:
|
||||
|
||||
}; // end class LLPanel
|
||||
|
||||
typedef boost::function<LLPanel* (void)> LLPanelClassCreatorFunc;
|
||||
|
||||
// local static instance for registering a particular panel class
|
||||
|
||||
class LLRegisterPanelClass
|
||||
: public LLSingleton< LLRegisterPanelClass >
|
||||
{
|
||||
public:
|
||||
// reigister with either the provided builder, or the generic templated builder
|
||||
void addPanelClass(const std::string& tag,LLPanelClassCreatorFunc func)
|
||||
{
|
||||
mPanelClassesNames[tag] = func;
|
||||
}
|
||||
|
||||
LLPanel* createPanelClass(const std::string& tag)
|
||||
{
|
||||
param_name_map_t::iterator iT = mPanelClassesNames.find(tag);
|
||||
if(iT == mPanelClassesNames.end())
|
||||
return 0;
|
||||
return iT->second();
|
||||
}
|
||||
template<typename T>
|
||||
static T* defaultPanelClassBuilder()
|
||||
{
|
||||
T* pT = new T();
|
||||
return pT;
|
||||
}
|
||||
|
||||
private:
|
||||
typedef std::map< std::string, LLPanelClassCreatorFunc> param_name_map_t;
|
||||
|
||||
param_name_map_t mPanelClassesNames;
|
||||
};
|
||||
|
||||
|
||||
// local static instance for registering a particular panel class
|
||||
template<typename T>
|
||||
class LLPanelInjector
|
||||
{
|
||||
public:
|
||||
// register with either the provided builder, or the generic templated builder
|
||||
LLPanelInjector(const std::string& tag);
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
LLPanelInjector<T>::LLPanelInjector(const std::string& tag)
|
||||
{
|
||||
LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user