cleaned up LLUICtrlFactory...
removed redundant functionality moved buildPanel to LLPanelmaster
parent
94e406157d
commit
c20bd2dfee
|
|
@ -89,7 +89,7 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel()
|
|||
|
||||
mSingleExpansion = false;
|
||||
mFitParent = false;
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "accordion_parent.xml");
|
||||
buildPanel(this, "accordion_parent.xml");
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@
|
|||
#include "llfontgl.h"
|
||||
#include "llrect.h"
|
||||
#include "llerror.h"
|
||||
#include "lldir.h"
|
||||
#include "lltimer.h"
|
||||
|
||||
#include "llaccordionctrltab.h"
|
||||
|
|
@ -58,6 +59,8 @@
|
|||
#include "lltabcontainer.h"
|
||||
|
||||
static LLDefaultChildRegistry::Register<LLPanel> r1("panel", &LLPanel::fromXML);
|
||||
LLPanel::factory_stack_t LLPanel::sFactoryStack;
|
||||
|
||||
|
||||
// Compiler optimization, generate extern template
|
||||
template class LLPanel* LLView::getChild<class LLPanel>(
|
||||
|
|
@ -400,7 +403,7 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
|
|||
|
||||
if (!panelp)
|
||||
{
|
||||
panelp = LLUICtrlFactory::getInstance()->createFactoryPanel(name);
|
||||
panelp = createFactoryPanel(name);
|
||||
llassert(panelp);
|
||||
|
||||
if (!panelp)
|
||||
|
|
@ -413,20 +416,20 @@ LLView* LLPanel::fromXML(LLXMLNodePtr node, LLView* parent, LLXMLNodePtr output_
|
|||
// factory panels may have registered their own factory maps
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
LLUICtrlFactory::instance().pushFactoryFunctions(&panelp->getFactoryMap());
|
||||
sFactoryStack.push_back(&panelp->getFactoryMap());
|
||||
}
|
||||
// for local registry callbacks; define in constructor, referenced in XUI or postBuild
|
||||
panelp->mCommitCallbackRegistrar.pushScope();
|
||||
panelp->mEnableCallbackRegistrar.pushScope();
|
||||
|
||||
panelp->initPanelXML(node, parent, output_node);
|
||||
panelp->initPanelXML(node, parent, output_node, LLUICtrlFactory::getDefaultParams<LLPanel>());
|
||||
|
||||
panelp->mCommitCallbackRegistrar.popScope();
|
||||
panelp->mEnableCallbackRegistrar.popScope();
|
||||
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
LLUICtrlFactory::instance().popFactoryFunctions();
|
||||
sFactoryStack.pop_back();
|
||||
}
|
||||
|
||||
return panelp;
|
||||
|
|
@ -493,11 +496,9 @@ static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup");
|
|||
static LLFastTimer::DeclareTimer FTM_EXTERNAL_PANEL_LOAD("Load Extern Panel Reference");
|
||||
static LLFastTimer::DeclareTimer FTM_PANEL_POSTBUILD("Panel PostBuild");
|
||||
|
||||
BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node)
|
||||
BOOL LLPanel::initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
|
||||
{
|
||||
const LLPanel::Params& default_params(LLUICtrlFactory::getDefaultParams<LLPanel>());
|
||||
Params params(default_params);
|
||||
|
||||
{
|
||||
LLFastTimer timer(FTM_PANEL_SETUP);
|
||||
|
||||
|
|
@ -965,3 +966,89 @@ boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::
|
|||
|
||||
return mVisibleSignal->connect(cb);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildPanel()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLPanel::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node, const LLPanel::Params& default_params)
|
||||
{
|
||||
LLFastTimer timer(FTM_BUILD_PANELS);
|
||||
BOOL didPost = FALSE;
|
||||
LLXMLNodePtr root;
|
||||
|
||||
//if exporting, only load the language being exported,
|
||||
//instead of layering localized version on top of english
|
||||
if (output_node)
|
||||
{
|
||||
if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
|
||||
{
|
||||
llwarns << "Couldn't parse panel from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
}
|
||||
else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
|
||||
{
|
||||
llwarns << "Couldn't parse panel from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
|
||||
// root must be called panel
|
||||
if( !root->hasName("panel" ) )
|
||||
{
|
||||
llwarns << "Root node should be named panel in : " << filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
|
||||
lldebugs << "Building panel " << filename << llendl;
|
||||
|
||||
LLUICtrlFactory::instance().pushFileName(filename);
|
||||
{
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
sFactoryStack.push_back(&panelp->getFactoryMap());
|
||||
}
|
||||
|
||||
// for local registry callbacks; define in constructor, referenced in XUI or postBuild
|
||||
panelp->getCommitCallbackRegistrar().pushScope();
|
||||
panelp->getEnableCallbackRegistrar().pushScope();
|
||||
|
||||
didPost = panelp->initPanelXML(root, NULL, output_node, default_params);
|
||||
|
||||
panelp->getCommitCallbackRegistrar().popScope();
|
||||
panelp->getEnableCallbackRegistrar().popScope();
|
||||
|
||||
panelp->setXMLFilename(filename);
|
||||
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
sFactoryStack.pop_back();
|
||||
}
|
||||
}
|
||||
LLUICtrlFactory::instance().popFileName();
|
||||
return didPost;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// createFactoryPanel()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPanel* LLPanel::createFactoryPanel(const std::string& name)
|
||||
{
|
||||
std::deque<const LLCallbackMap::map_t*>::iterator itor;
|
||||
for (itor = sFactoryStack.begin(); itor != sFactoryStack.end(); ++itor)
|
||||
{
|
||||
const LLCallbackMap::map_t* factory_map = *itor;
|
||||
|
||||
// Look up this panel's name in the map.
|
||||
LLCallbackMap::map_const_iter_t iter = factory_map->find( name );
|
||||
if (iter != factory_map->end())
|
||||
{
|
||||
// Use the factory to create the panel, instead of using a default LLPanel.
|
||||
LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData );
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
LLPanel::Params panel_p;
|
||||
return LLUICtrlFactory::create<LLPanel>(panel_p);
|
||||
}
|
||||
|
|
@ -110,7 +110,10 @@ protected:
|
|||
LLPanel(const LLPanel::Params& params = getDefaultParams());
|
||||
|
||||
public:
|
||||
// LLPanel(const std::string& name, const LLRect& rect = LLRect(), BOOL bordered = TRUE);
|
||||
static BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams());
|
||||
|
||||
static LLPanel* createFactoryPanel(const std::string& name);
|
||||
|
||||
/*virtual*/ ~LLPanel();
|
||||
|
||||
// LLView interface
|
||||
|
|
@ -163,7 +166,7 @@ public:
|
|||
EnableCallbackRegistry::ScopedRegistrar& getEnableCallbackRegistrar() { return mEnableCallbackRegistrar; }
|
||||
|
||||
void initFromParams(const Params& p);
|
||||
BOOL initPanelXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node = NULL);
|
||||
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;
|
||||
|
|
@ -283,6 +286,8 @@ private:
|
|||
// for setting the xml filename when building panel in context dependent cases
|
||||
std::string mXMLFilename;
|
||||
|
||||
typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
|
||||
static factory_stack_t sFactoryStack;
|
||||
}; // end class LLPanel
|
||||
|
||||
// Build time optimization, generate once in .cpp file
|
||||
|
|
@ -291,4 +296,57 @@ extern template class LLPanel* LLView::getChild<class LLPanel>(
|
|||
const std::string& name, BOOL recurse) const;
|
||||
#endif
|
||||
|
||||
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 LLRegisterPanelClassWrapper
|
||||
: public LLRegisterPanelClass
|
||||
{
|
||||
public:
|
||||
// reigister with either the provided builder, or the generic templated builder
|
||||
LLRegisterPanelClassWrapper(const std::string& tag);
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag)
|
||||
{
|
||||
LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ class LLTextBase
|
|||
public:
|
||||
friend class LLTextSegment;
|
||||
friend class LLNormalTextSegment;
|
||||
friend class LLUICtrlFactory;
|
||||
|
||||
struct LineSpacingParams : public LLInitParam::Choice<LineSpacingParams>
|
||||
{
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen
|
|||
{
|
||||
if (!floaterp->getFactoryMap().empty())
|
||||
{
|
||||
mFactoryStack.push_front(&floaterp->getFactoryMap());
|
||||
LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap());
|
||||
}
|
||||
|
||||
// for local registry callbacks; define in constructor, referenced in XUI or postBuild
|
||||
|
|
@ -234,7 +234,7 @@ bool LLUICtrlFactory::buildFloater(LLFloater* floaterp, const std::string& filen
|
|||
|
||||
if (!floaterp->getFactoryMap().empty())
|
||||
{
|
||||
mFactoryStack.pop_front();
|
||||
LLPanel::sFactoryStack.pop_front();
|
||||
}
|
||||
}
|
||||
popFileName();
|
||||
|
|
@ -250,69 +250,6 @@ S32 LLUICtrlFactory::saveToXML(LLView* viewp, const std::string& filename)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_BUILD_PANELS("Build Panels");
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// buildPanel()
|
||||
//-----------------------------------------------------------------------------
|
||||
BOOL LLUICtrlFactory::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNodePtr output_node)
|
||||
{
|
||||
LLFastTimer timer(FTM_BUILD_PANELS);
|
||||
BOOL didPost = FALSE;
|
||||
LLXMLNodePtr root;
|
||||
|
||||
//if exporting, only load the language being exported,
|
||||
//instead of layering localized version on top of english
|
||||
if (output_node)
|
||||
{
|
||||
if (!LLUICtrlFactory::getLocalizedXMLNode(filename, root))
|
||||
{
|
||||
llwarns << "Couldn't parse panel from: " << LLUI::getLocalizedSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
}
|
||||
else if (!LLUICtrlFactory::getLayeredXMLNode(filename, root))
|
||||
{
|
||||
llwarns << "Couldn't parse panel from: " << LLUI::getSkinPath() + gDirUtilp->getDirDelimiter() + filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
|
||||
// root must be called panel
|
||||
if( !root->hasName("panel" ) )
|
||||
{
|
||||
llwarns << "Root node should be named panel in : " << filename << llendl;
|
||||
return didPost;
|
||||
}
|
||||
|
||||
lldebugs << "Building panel " << filename << llendl;
|
||||
|
||||
pushFileName(filename);
|
||||
{
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
mFactoryStack.push_front(&panelp->getFactoryMap());
|
||||
}
|
||||
|
||||
// for local registry callbacks; define in constructor, referenced in XUI or postBuild
|
||||
panelp->getCommitCallbackRegistrar().pushScope();
|
||||
panelp->getEnableCallbackRegistrar().pushScope();
|
||||
|
||||
didPost = panelp->initPanelXML(root, NULL, output_node);
|
||||
|
||||
panelp->getCommitCallbackRegistrar().popScope();
|
||||
panelp->getEnableCallbackRegistrar().popScope();
|
||||
|
||||
panelp->setXMLFilename(filename);
|
||||
|
||||
if (!panelp->getFactoryMap().empty())
|
||||
{
|
||||
mFactoryStack.pop_front();
|
||||
}
|
||||
}
|
||||
popFileName();
|
||||
return didPost;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
|
|
@ -344,29 +281,6 @@ LLView *LLUICtrlFactory::createFromXML(LLXMLNodePtr node, LLView* parent, const
|
|||
return view;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// createFactoryPanel()
|
||||
//-----------------------------------------------------------------------------
|
||||
LLPanel* LLUICtrlFactory::createFactoryPanel(const std::string& name)
|
||||
{
|
||||
std::deque<const LLCallbackMap::map_t*>::iterator itor;
|
||||
for (itor = mFactoryStack.begin(); itor != mFactoryStack.end(); ++itor)
|
||||
{
|
||||
const LLCallbackMap::map_t* factory_map = *itor;
|
||||
|
||||
// Look up this panel's name in the map.
|
||||
LLCallbackMap::map_const_iter_t iter = factory_map->find( name );
|
||||
if (iter != factory_map->end())
|
||||
{
|
||||
// Use the factory to create the panel, instead of using a default LLPanel.
|
||||
LLPanel *ret = (LLPanel*) iter->second.mCallback( iter->second.mData );
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
LLPanel::Params panel_p;
|
||||
return create<LLPanel>(panel_p);
|
||||
}
|
||||
|
||||
std::string LLUICtrlFactory::getCurFileName()
|
||||
{
|
||||
return mFileNames.empty() ? "" : gDirUtilp->getWorkingDir() + gDirUtilp->getDirDelimiter() + mFileNames.back();
|
||||
|
|
@ -383,36 +297,6 @@ void LLUICtrlFactory::popFileName()
|
|||
mFileNames.pop_back();
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
//static
|
||||
BOOL LLUICtrlFactory::getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color)
|
||||
{
|
||||
std::string colorstring;
|
||||
BOOL res = node->getAttributeString(name.c_str(), colorstring);
|
||||
if (res)
|
||||
{
|
||||
if (LLUIColorTable::instance().colorExists(colorstring))
|
||||
{
|
||||
color.setVec(LLUIColorTable::instance().getColor(colorstring));
|
||||
}
|
||||
else
|
||||
{
|
||||
res = FALSE;
|
||||
}
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
res = LLColor4::parseColor(colorstring, &color);
|
||||
}
|
||||
if (!res)
|
||||
{
|
||||
res = node->getAttributeColor(name.c_str(), color);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
//static
|
||||
void LLUICtrlFactory::setCtrlParent(LLView* view, LLView* parent, S32 tab_group)
|
||||
{
|
||||
|
|
@ -428,28 +312,22 @@ std::string LLUICtrlFactory::findSkinnedFilename(const std::string& filename)
|
|||
return gDirUtilp->findSkinnedFilename(LLUI::getSkinPath(), filename);
|
||||
}
|
||||
|
||||
void LLUICtrlFactory::pushFactoryFunctions(const LLCallbackMap::map_t* map)
|
||||
{
|
||||
mFactoryStack.push_back(map);
|
||||
}
|
||||
|
||||
void LLUICtrlFactory::popFactoryFunctions()
|
||||
{
|
||||
if (!mFactoryStack.empty())
|
||||
{
|
||||
mFactoryStack.pop_back();
|
||||
}
|
||||
}
|
||||
|
||||
//static
|
||||
void LLUICtrlFactory::copyName(LLXMLNodePtr src, LLXMLNodePtr dest)
|
||||
{
|
||||
dest->setName(src->getName()->mString);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
const LLInitParam::BaseBlock& get_empty_param_block()
|
||||
{
|
||||
static typename T::Params params;
|
||||
return params;
|
||||
}
|
||||
|
||||
// adds a widget and its param block to various registries
|
||||
//static
|
||||
void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, dummy_widget_creator_func_t creator_func, const std::string& tag)
|
||||
void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag)
|
||||
{
|
||||
// associate parameter block type with template .xml file
|
||||
std::string* existing_tag = LLWidgetNameRegistry::instance().getValue(param_block_type);
|
||||
|
|
@ -469,17 +347,9 @@ void LLUICtrlFactory::registerWidget(const std::type_info* widget_type, const st
|
|||
}
|
||||
}
|
||||
LLWidgetNameRegistry::instance().defaultRegistrar().add(param_block_type, tag);
|
||||
// associate widget type with factory function
|
||||
LLDefaultWidgetRegistry::instance().defaultRegistrar().add(widget_type, creator_func);
|
||||
//FIXME: comment this in when working on schema generation
|
||||
//LLWidgetTypeRegistry::instance().defaultRegistrar().add(tag, widget_type);
|
||||
//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &getEmptyParamBlock<T>);
|
||||
}
|
||||
|
||||
//static
|
||||
dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::type_info* widget_type)
|
||||
{
|
||||
return LLDefaultWidgetRegistry::instance().getValue(widget_type);
|
||||
//LLDefaultParamBlockRegistry::instance().defaultRegistrar().add(widget_type, &get_empty_param_block<T>);
|
||||
}
|
||||
|
||||
//static
|
||||
|
|
|
|||
|
|
@ -33,24 +33,14 @@
|
|||
#ifndef LLUICTRLFACTORY_H
|
||||
#define LLUICTRLFACTORY_H
|
||||
|
||||
#include "llcallbackmap.h"
|
||||
#include "llfasttimer.h"
|
||||
#include "llinitparam.h"
|
||||
#include "llregistry.h"
|
||||
#include "v4color.h"
|
||||
#include "llfasttimer.h"
|
||||
|
||||
#include "llxuiparser.h"
|
||||
|
||||
#include <boost/function.hpp>
|
||||
#include <iosfwd>
|
||||
#include <stack>
|
||||
#include <set>
|
||||
|
||||
class LLPanel;
|
||||
class LLFloater;
|
||||
class LLView;
|
||||
|
||||
|
||||
// sort functor for typeid maps
|
||||
struct LLCompareTypeID
|
||||
{
|
||||
|
|
@ -91,12 +81,6 @@ class LLWidgetNameRegistry
|
|||
: public LLRegistrySingleton<const std::type_info*, std::string, LLWidgetNameRegistry , LLCompareTypeID>
|
||||
{};
|
||||
|
||||
// lookup factory functions for default widget instances by widget type
|
||||
typedef LLView* (*dummy_widget_creator_func_t)(const std::string&);
|
||||
class LLDefaultWidgetRegistry
|
||||
: public LLRegistrySingleton<const std::type_info*, dummy_widget_creator_func_t, LLDefaultWidgetRegistry, LLCompareTypeID>
|
||||
{};
|
||||
|
||||
// lookup function for generating empty param block by widget type
|
||||
// this is used for schema generation
|
||||
//typedef const LLInitParam::BaseBlock& (*empty_param_block_func_t)();
|
||||
|
|
@ -164,23 +148,16 @@ public:
|
|||
}
|
||||
|
||||
bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node);
|
||||
BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL);
|
||||
|
||||
// Does what you want for LLFloaters and LLPanels
|
||||
// Returns 0 on success
|
||||
S32 saveToXML(LLView* viewp, const std::string& filename);
|
||||
|
||||
// filename tracking for debugging info
|
||||
std::string getCurFileName();
|
||||
void pushFileName(const std::string& name);
|
||||
void popFileName();
|
||||
|
||||
static BOOL getAttributeColor(LLXMLNodePtr node, const std::string& name, LLColor4& color);
|
||||
|
||||
LLPanel* createFactoryPanel(const std::string& name);
|
||||
|
||||
void pushFactoryFunctions(const LLCallbackMap::map_t* map);
|
||||
void popFactoryFunctions();
|
||||
|
||||
template<typename T>
|
||||
static T* createWidget(const typename T::Params& params, LLView* parent = NULL)
|
||||
{
|
||||
|
|
@ -192,12 +169,10 @@ public:
|
|||
//return NULL;
|
||||
}
|
||||
|
||||
{
|
||||
LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
|
||||
{ LLFastTimer _(FTM_WIDGET_CONSTRUCTION);
|
||||
widget = new T(params);
|
||||
}
|
||||
{
|
||||
LLFastTimer timer(FTM_INIT_FROM_PARAMS);
|
||||
{ LLFastTimer _(FTM_INIT_FROM_PARAMS);
|
||||
widget->initFromParams(params);
|
||||
}
|
||||
|
||||
|
|
@ -272,17 +247,9 @@ fail:
|
|||
template<class T>
|
||||
static T* getDefaultWidget(const std::string& name)
|
||||
{
|
||||
dummy_widget_creator_func_t* dummy_func = getDefaultWidgetFunc(&typeid(T));
|
||||
return dummy_func ? dynamic_cast<T*>((*dummy_func)(name)) : NULL;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static LLView* createDefaultWidget(const std::string& name)
|
||||
{
|
||||
typename T::Params params;
|
||||
params.name(name);
|
||||
|
||||
return create<T>(params);
|
||||
T::Params widget_params;
|
||||
widget_params.name = name;
|
||||
return create<T>(widget_params);
|
||||
}
|
||||
|
||||
static void copyName(LLXMLNodePtr src, LLXMLNodePtr dest);
|
||||
|
|
@ -335,12 +302,9 @@ fail:
|
|||
static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block);
|
||||
|
||||
// helper function for adding widget type info to various registries
|
||||
static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, dummy_widget_creator_func_t creator_func, const std::string& tag);
|
||||
static void registerWidget(const std::type_info* widget_type, const std::type_info* param_block_type, const std::string& tag);
|
||||
|
||||
private:
|
||||
// return default widget instance factory func for a given type
|
||||
static dummy_widget_creator_func_t* getDefaultWidgetFunc(const std::type_info* widget_type);
|
||||
|
||||
static const std::string* getWidgetTag(const std::type_info* widget_type);
|
||||
|
||||
// this exists to get around dependency on llview
|
||||
|
|
@ -349,20 +313,10 @@ private:
|
|||
// Avoid directly using LLUI and LLDir in the template code
|
||||
static std::string findSkinnedFilename(const std::string& filename);
|
||||
|
||||
typedef std::deque<const LLCallbackMap::map_t*> factory_stack_t;
|
||||
factory_stack_t mFactoryStack;
|
||||
|
||||
LLPanel* mDummyPanel;
|
||||
class LLPanel* mDummyPanel;
|
||||
std::vector<std::string> mFileNames;
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
const LLInitParam::BaseBlock& getEmptyParamBlock()
|
||||
{
|
||||
static typename T::Params params;
|
||||
return params;
|
||||
}
|
||||
|
||||
// this is here to make gcc happy with reference to LLUICtrlFactory
|
||||
template<typename DERIVED>
|
||||
template<typename T>
|
||||
|
|
@ -370,7 +324,7 @@ LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator
|
|||
: LLChildRegistry<DERIVED>::StaticRegistrar(tag, func.empty() ? (LLWidgetCreatorFunc)&LLUICtrlFactory::defaultBuilder<T> : func)
|
||||
{
|
||||
// add this widget to various registries
|
||||
LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), &LLUICtrlFactory::createDefaultWidget<T>, tag);
|
||||
LLUICtrlFactory::instance().registerWidget(&typeid(T), &typeid(typename T::Params), tag);
|
||||
|
||||
// since registry_t depends on T, do this in line here
|
||||
// TODO: uncomment this for schema generation
|
||||
|
|
@ -378,58 +332,4 @@ LLChildRegistry<DERIVED>::Register<T>::Register(const char* tag, LLWidgetCreator
|
|||
//LLChildRegistryRegistry::instance().defaultRegistrar().add(&typeid(T), registry_t::instance());
|
||||
}
|
||||
|
||||
|
||||
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 LLRegisterPanelClassWrapper
|
||||
: public LLRegisterPanelClass
|
||||
{
|
||||
public:
|
||||
// reigister with either the provided builder, or the generic templated builder
|
||||
LLRegisterPanelClassWrapper(const std::string& tag);
|
||||
};
|
||||
|
||||
|
||||
template<typename T>
|
||||
LLRegisterPanelClassWrapper<T>::LLRegisterPanelClassWrapper(const std::string& tag)
|
||||
{
|
||||
LLRegisterPanelClass::instance().addPanelClass(tag,&LLRegisterPanelClass::defaultPanelClassBuilder<T>);
|
||||
}
|
||||
|
||||
|
||||
#endif //LLUICTRLFACTORY_H
|
||||
|
|
|
|||
|
|
@ -1698,7 +1698,9 @@ LLView* LLView::getChildView(const std::string& name, BOOL recurse) const
|
|||
child = getDefaultWidget<LLView>(name);
|
||||
if (!child)
|
||||
{
|
||||
child = LLUICtrlFactory::createDefaultWidget<LLView>(name);
|
||||
LLView::Params view_params;
|
||||
view_params.name = name;
|
||||
child = LLUICtrlFactory::create<LLView>(view_params);
|
||||
}
|
||||
}
|
||||
return child;
|
||||
|
|
|
|||
|
|
@ -200,8 +200,6 @@ LLAgent::LLAgent() :
|
|||
mbFlagsDirty(FALSE),
|
||||
mbFlagsNeedReset(FALSE),
|
||||
|
||||
mbJump(FALSE),
|
||||
|
||||
mAutoPilot(FALSE),
|
||||
mAutoPilotFlyOnStop(FALSE),
|
||||
mAutoPilotTargetGlobal(),
|
||||
|
|
@ -561,6 +559,9 @@ void LLAgent::toggleFlying()
|
|||
{
|
||||
BOOL fly = !gAgent.getFlying();
|
||||
|
||||
gAgent.mMoveTimer.reset();
|
||||
LLFirstUse::notMoving(false);
|
||||
|
||||
gAgent.setFlying( fly );
|
||||
gAgentCamera.resetView();
|
||||
}
|
||||
|
|
@ -2987,12 +2988,6 @@ void LLAgent::processScriptControlChange(LLMessageSystem *msg, void **)
|
|||
total_count++;
|
||||
}
|
||||
}
|
||||
|
||||
// Any control taken? If so, might be first time.
|
||||
//if (total_count > 0)
|
||||
//{
|
||||
//LLFirstUse::useOverrideKeys();
|
||||
//}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -363,14 +363,6 @@ public:
|
|||
private:
|
||||
BOOL mIsBusy;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Jump
|
||||
//--------------------------------------------------------------------
|
||||
public:
|
||||
BOOL getJump() const { return mbJump; }
|
||||
private:
|
||||
BOOL mbJump;
|
||||
|
||||
//--------------------------------------------------------------------
|
||||
// Grab
|
||||
//--------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -367,19 +367,19 @@ bool create_text_segment_icon_from_url_match(LLUrlMatch* match,LLTextBase* base)
|
|||
|
||||
if(gAgent.isInGroup(match_id, TRUE))
|
||||
{
|
||||
LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>();
|
||||
LLGroupIconCtrl::Params icon_params;
|
||||
icon_params.group_id = match_id;
|
||||
icon_params.rect = LLRect(0, 16, 16, 0);
|
||||
icon_params.visible = true;
|
||||
icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params);
|
||||
icon = LLUICtrlFactory::instance().create<LLGroupIconCtrl>(icon_params);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>();
|
||||
LLAvatarIconCtrl::Params icon_params;
|
||||
icon_params.avatar_id = match_id;
|
||||
icon_params.rect = LLRect(0, 16, 16, 0);
|
||||
icon_params.visible = true;
|
||||
icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params);
|
||||
icon = LLUICtrlFactory::instance().create<LLAvatarIconCtrl>(icon_params);
|
||||
}
|
||||
|
||||
LLInlineViewSegment::Params params;
|
||||
|
|
|
|||
|
|
@ -498,7 +498,7 @@ LLAvalineListItem::LLAvalineListItem(bool hide_number/* = true*/) : LLAvatarList
|
|||
, mIsHideNumber(hide_number)
|
||||
{
|
||||
// should not use buildPanel from the base class to ensure LLAvalineListItem::postBuild is called.
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
|
||||
buildPanel(this, "panel_avatar_list_item.xml");
|
||||
}
|
||||
|
||||
BOOL LLAvalineListItem::postBuild()
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
|
|||
{
|
||||
if (not_from_ui_factory)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml");
|
||||
buildPanel(this, "panel_avatar_list_item.xml");
|
||||
}
|
||||
// *NOTE: mantipov: do not use any member here. They can be uninitialized here in case instance
|
||||
// is created from the UICtrlFactory
|
||||
|
|
|
|||
|
|
@ -112,14 +112,14 @@ public:
|
|||
mGesturePanel(NULL)
|
||||
{
|
||||
mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_bottomtray_lite.xml");
|
||||
buildPanel(this, "panel_bottomtray_lite.xml");
|
||||
// Necessary for focus movement among child controls
|
||||
setFocusRoot(TRUE);
|
||||
}
|
||||
|
||||
BOOL postBuild()
|
||||
{
|
||||
mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
|
||||
mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
|
||||
mGesturePanel = getChild<LLPanel>("gesture_panel");
|
||||
|
||||
// Hide "show_nearby_chat" button
|
||||
|
|
@ -163,7 +163,7 @@ LLBottomTray::LLBottomTray(const LLSD&)
|
|||
|
||||
mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL);
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_bottomtray.xml");
|
||||
buildPanel(this,"panel_bottomtray.xml");
|
||||
|
||||
LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2));
|
||||
|
||||
|
|
@ -471,8 +471,7 @@ BOOL LLBottomTray::postBuild()
|
|||
mBottomTrayContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_bottomtray.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
gMenuHolder->addChild(mBottomTrayContextMenu);
|
||||
|
||||
mNearbyChatBar = getChild<LLNearbyChatBar>("chat_bar");
|
||||
LLHints::registerHintTarget("nearby_chat_bar", mNearbyChatBar->LLView::getHandle());
|
||||
mNearbyChatBar = findChild<LLNearbyChatBar>("chat_bar");
|
||||
|
||||
mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
|
||||
mMovementButton = getChild<LLButton>("movement_btn");
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ BOOL LLCallFloater::postBuild()
|
|||
|
||||
childSetAction("leave_call_btn", boost::bind(&LLCallFloater::leaveCall, this));
|
||||
|
||||
mNonAvatarCaller = getChild<LLNonAvatarCaller>("non_avatar_caller");
|
||||
mNonAvatarCaller = findChild<LLNonAvatarCaller>("non_avatar_caller");
|
||||
mNonAvatarCaller->setVisible(FALSE);
|
||||
|
||||
LLView *anchor_panel = LLBottomTray::getInstance()->getChild<LLView>("speak_flyout_btn");
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ public:
|
|||
static LLChatHistoryHeader* createInstance(const std::string& file_name)
|
||||
{
|
||||
LLChatHistoryHeader* pInstance = new LLChatHistoryHeader;
|
||||
LLUICtrlFactory::getInstance()->buildPanel(pInstance, file_name);
|
||||
buildPanel(pInstance, file_name);
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
|
|
@ -402,7 +402,7 @@ protected:
|
|||
return;
|
||||
}
|
||||
|
||||
LLTextBase* name = getChild<LLTextBase>("user_name");
|
||||
LLTextBox* name = getChild<LLTextBox>("user_name");
|
||||
LLRect sticky_rect = name->getRect();
|
||||
S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3);
|
||||
sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ;
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ static const S32 msg_height_pad = 5;
|
|||
LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance()
|
||||
{
|
||||
LLNearbyChatToastPanel* item = new LLNearbyChatToastPanel();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(item, "panel_chat_item.xml");
|
||||
buildPanel(item, "panel_chat_item.xml");
|
||||
item->setFollows(FOLLOWS_NONE);
|
||||
return item;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -351,7 +351,7 @@ BOOL LLFloaterCamera::postBuild()
|
|||
setTitleVisible(TRUE); // restore title visibility after chrome applying
|
||||
|
||||
mRotate = getChild<LLJoystickCameraRotate>(ORBIT);
|
||||
mZoom = getChild<LLPanelCameraZoom>(ZOOM);
|
||||
mZoom = findChild<LLPanelCameraZoom>(ZOOM);
|
||||
mTrack = getChild<LLJoystickCameraTrack>(PAN);
|
||||
|
||||
assignButton2Mode(CAMERA_CTRL_MODE_MODES, "avatarview_btn");
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ LLFloaterInventory::~LLFloaterInventory()
|
|||
|
||||
BOOL LLFloaterInventory::postBuild()
|
||||
{
|
||||
mPanelMainInventory = getChild<LLPanelMainInventory>("Inventory Panel");
|
||||
mPanelMainInventory = findChild<LLPanelMainInventory>("Inventory Panel");
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channe
|
|||
mChannelRejectsPtr = LLNotificationChannelPtr(
|
||||
LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(),
|
||||
!boost::bind(mChannelPtr->getFilter(), _1)));
|
||||
LLUICtrlFactory::instance().buildPanel(this, "panel_notifications_channel.xml");
|
||||
buildPanel(this, "panel_notifications_channel.xml");
|
||||
}
|
||||
|
||||
BOOL LLNotificationChannelPanel::postBuild()
|
||||
|
|
|
|||
|
|
@ -180,32 +180,32 @@ BOOL LLFloaterRegionInfo::postBuild()
|
|||
mInfoPanels.push_back(panel);
|
||||
panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel));
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_general.xml");
|
||||
buildPanel(panel, "panel_region_general.xml");
|
||||
mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true));
|
||||
|
||||
panel = new LLPanelRegionDebugInfo;
|
||||
mInfoPanels.push_back(panel);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_debug.xml");
|
||||
buildPanel(panel, "panel_region_debug.xml");
|
||||
mTab->addTabPanel(panel);
|
||||
|
||||
panel = new LLPanelRegionTextureInfo;
|
||||
mInfoPanels.push_back(panel);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_texture.xml");
|
||||
buildPanel(panel, "panel_region_texture.xml");
|
||||
mTab->addTabPanel(panel);
|
||||
|
||||
panel = new LLPanelRegionTerrainInfo;
|
||||
mInfoPanels.push_back(panel);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_terrain.xml");
|
||||
buildPanel(panel, "panel_region_terrain.xml");
|
||||
mTab->addTabPanel(panel);
|
||||
|
||||
panel = new LLPanelEstateInfo;
|
||||
mInfoPanels.push_back(panel);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_estate.xml");
|
||||
buildPanel(panel, "panel_region_estate.xml");
|
||||
mTab->addTabPanel(panel);
|
||||
|
||||
panel = new LLPanelEstateCovenant;
|
||||
mInfoPanels.push_back(panel);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_region_covenant.xml");
|
||||
buildPanel(panel, "panel_region_covenant.xml");
|
||||
mTab->addTabPanel(panel);
|
||||
|
||||
gMessageSystem->setHandlerFunc(
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ BOOL LLFloaterScriptLimits::postBuild()
|
|||
LLPanelScriptLimitsRegionMemory* panel_memory;
|
||||
panel_memory = new LLPanelScriptLimitsRegionMemory;
|
||||
mInfoPanels.push_back(panel_memory);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
|
||||
buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
|
||||
mTab->addTabPanel(panel_memory);
|
||||
}
|
||||
|
||||
|
|
@ -130,7 +130,7 @@ BOOL LLFloaterScriptLimits::postBuild()
|
|||
{
|
||||
LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment;
|
||||
mInfoPanels.push_back(panel_attachments);
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
|
||||
buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
|
||||
mTab->addTabPanel(panel_attachments);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -891,7 +891,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
|
|||
if (save)
|
||||
{
|
||||
LLXMLNodePtr panel_write = new LLXMLNode();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, path, panel_write); // build it
|
||||
buildPanel(panel, path, panel_write); // build it
|
||||
|
||||
if (!panel_write->isNull())
|
||||
{
|
||||
|
|
@ -905,7 +905,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save)
|
|||
}
|
||||
else
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, path); // build it
|
||||
buildPanel(panel, path); // build it
|
||||
LLRect new_size = panel->getRect(); // get its rectangle
|
||||
panel->setOrigin(0,0); // reset its origin point so it's not offset by -left or other XUI attributes
|
||||
(*floaterp)->setTitle(path); // use the file name as its title, since panels have no guaranteed meaningful name attribute
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ mGroupNameBox(NULL),
|
|||
mInfoBtn(NULL),
|
||||
mGroupID(LLUUID::null)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_list_item.xml");
|
||||
buildPanel(this, "panel_group_list_item.xml");
|
||||
|
||||
// Remember group icon width including its padding from the name text box,
|
||||
// so that we can hide and show the icon again later.
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ const S32 HUD_ARROW_SIZE = 32;
|
|||
|
||||
LLHUDView::LLHUDView(const LLRect& r)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_hud.xml");
|
||||
buildPanel(this, "panel_hud.xml");
|
||||
setShape(r, true);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,9 +100,9 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
|
|||
|
||||
if(gAgent.isInGroup(session_id, TRUE))
|
||||
{
|
||||
LLGroupIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLGroupIconCtrl>();
|
||||
LLGroupIconCtrl::Params icon_params;
|
||||
icon_params.group_id = session_id;
|
||||
icon = LLUICtrlFactory::instance().createWidget<LLGroupIconCtrl>(icon_params);
|
||||
icon = LLUICtrlFactory::instance().create<LLGroupIconCtrl>(icon_params);
|
||||
|
||||
mSessions[session_id] = floaterp;
|
||||
floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
|
||||
|
|
@ -111,9 +111,9 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
|
|||
{
|
||||
LLUUID avatar_id = LLIMModel::getInstance()->getOtherParticipantID(session_id);
|
||||
|
||||
LLAvatarIconCtrl::Params icon_params = LLUICtrlFactory::instance().getDefaultParams<LLAvatarIconCtrl>();
|
||||
LLAvatarIconCtrl::Params icon_params;
|
||||
icon_params.avatar_id = avatar_id;
|
||||
icon = LLUICtrlFactory::instance().createWidget<LLAvatarIconCtrl>(icon_params);
|
||||
icon = LLUICtrlFactory::instance().create<LLAvatarIconCtrl>(icon_params);
|
||||
|
||||
mSessions[session_id] = floaterp;
|
||||
floaterp->mCloseSignal.connect(boost::bind(&LLIMFloaterContainer::onCloseFloater, this, session_id));
|
||||
|
|
|
|||
|
|
@ -307,7 +307,9 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
|
|||
}
|
||||
else
|
||||
{
|
||||
mIconCtrl = dynamic_cast<LLIconCtrl*>(LLUICtrlFactory::createDefaultWidget<LLIconCtrl>("item_icon"));
|
||||
LLIconCtrl::Params icon_params;
|
||||
icon_params.name = "item_icon";
|
||||
mIconCtrl = LLUICtrlFactory::create<LLIconCtrl>(icon_params);
|
||||
}
|
||||
|
||||
LLTextBox::Params text_params(params.item_name);
|
||||
|
|
@ -320,7 +322,9 @@ LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem
|
|||
}
|
||||
else
|
||||
{
|
||||
mTitleCtrl = dynamic_cast<LLTextBox*>(LLUICtrlFactory::createDefaultWidget<LLTextBox>("item_title"));
|
||||
LLTextBox::Params text_aprams;
|
||||
text_params.name = "item_title";
|
||||
mTitleCtrl = LLUICtrlFactory::create<LLTextBox>(text_params);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -703,7 +703,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view)
|
|||
LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
|
||||
{
|
||||
LLPanelStandStopFlying* panel = new LLPanelStandStopFlying();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_stand_stop_flying.xml");
|
||||
buildPanel(panel, "panel_stand_stop_flying.xml");
|
||||
|
||||
panel->setVisible(FALSE);
|
||||
//LLUI::getRootView()->addChild(panel);
|
||||
|
|
@ -716,6 +716,8 @@ LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel()
|
|||
|
||||
void LLPanelStandStopFlying::onStandButtonClick()
|
||||
{
|
||||
LLFirstUse::sit(false);
|
||||
|
||||
LLSelectMgr::getInstance()->deselectAllForStandingUp();
|
||||
gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
|
||||
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ LLNavigationBar::LLNavigationBar()
|
|||
mPurgeTPHistoryItems(false),
|
||||
mSaveToLocationHistory(false)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_navigation_bar.xml");
|
||||
buildPanel(this, "panel_navigation_bar.xml");
|
||||
|
||||
// set a listener function for LoginComplete event
|
||||
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this));
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
#include "llchatitemscontainerctrl.h"
|
||||
#include "llfirstuse.h"
|
||||
#include "llfloaterscriptdebug.h"
|
||||
#include "llhints.h"
|
||||
#include "llnearbychat.h"
|
||||
#include "llrecentpeople.h"
|
||||
|
||||
|
|
@ -62,7 +63,13 @@ LLToastPanelBase* createToastPanel()
|
|||
class LLNearbyChatScreenChannel: public LLScreenChannelBase
|
||||
{
|
||||
public:
|
||||
LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id) { mStopProcessing = false;};
|
||||
typedef std::vector<LLHandle<LLToast> > toast_vec_t;
|
||||
typedef std::list<LLHandle<LLToast> > toast_list_t;
|
||||
|
||||
LLNearbyChatScreenChannel(const LLUUID& id):LLScreenChannelBase(id)
|
||||
{
|
||||
mStopProcessing = false;
|
||||
}
|
||||
|
||||
void addNotification (LLSD& notification);
|
||||
void arrangeToasts ();
|
||||
|
|
@ -82,15 +89,12 @@ public:
|
|||
}
|
||||
|
||||
// hide all toasts from screen, but not remove them from a channel
|
||||
virtual void hideToastsFromScreen()
|
||||
{
|
||||
};
|
||||
// removes all toasts from a channel
|
||||
virtual void removeToastsFromChannel()
|
||||
{
|
||||
for(std::vector<LLToast*>::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
|
||||
for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
|
||||
{
|
||||
addToToastPool((*it));
|
||||
addToToastPool(it->get());
|
||||
}
|
||||
m_active_toasts.clear();
|
||||
};
|
||||
|
|
@ -105,10 +109,11 @@ public:
|
|||
protected:
|
||||
void addToToastPool(LLToast* toast)
|
||||
{
|
||||
if (!toast) return;
|
||||
toast->setVisible(FALSE);
|
||||
toast->stopTimer();
|
||||
toast->setIsHidden(true);
|
||||
m_toast_pool.push_back(toast);
|
||||
m_toast_pool.push_back(toast->getHandle());
|
||||
}
|
||||
|
||||
void createOverflowToast(S32 bottom, F32 timer);
|
||||
|
|
@ -117,8 +122,8 @@ protected:
|
|||
|
||||
bool createPoolToast();
|
||||
|
||||
std::vector<LLToast*> m_active_toasts;
|
||||
std::list<LLToast*> m_toast_pool;
|
||||
toast_vec_t m_active_toasts;
|
||||
toast_list_t m_toast_pool;
|
||||
|
||||
bool mStopProcessing;
|
||||
};
|
||||
|
|
@ -139,7 +144,7 @@ void LLNearbyChatScreenChannel::onToastFade(LLToast* toast)
|
|||
if(!toast)
|
||||
return;
|
||||
|
||||
std::vector<LLToast*>::iterator pos = std::find(m_active_toasts.begin(),m_active_toasts.end(),toast);
|
||||
toast_vec_t::iterator pos = std::find(m_active_toasts.begin(),m_active_toasts.end(),toast->getHandle());
|
||||
if(pos!=m_active_toasts.end())
|
||||
m_active_toasts.erase(pos);
|
||||
|
||||
|
|
@ -166,7 +171,7 @@ bool LLNearbyChatScreenChannel::createPoolToast()
|
|||
toast->setOnFadeCallback(boost::bind(&LLNearbyChatScreenChannel::onToastFade, this, _1));
|
||||
toast->setOnToastDestroyedCallback(boost::bind(&LLNearbyChatScreenChannel::onToastDestroyed, this, _1));
|
||||
|
||||
m_toast_pool.push_back(toast);
|
||||
m_toast_pool.push_back(toast->getHandle());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -184,17 +189,20 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
|
|||
{
|
||||
LLUUID fromID = notification["from_id"].asUUID(); // agent id or object id
|
||||
std::string from = notification["from"].asString();
|
||||
LLToast* toast = m_active_toasts[0];
|
||||
LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel());
|
||||
|
||||
if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
|
||||
LLToast* toast = m_active_toasts[0].get();
|
||||
if (toast)
|
||||
{
|
||||
panel->addMessage(notification);
|
||||
toast->reshapeToPanel();
|
||||
toast->resetTimer();
|
||||
|
||||
arrangeToasts();
|
||||
return;
|
||||
LLNearbyChatToastPanel* panel = dynamic_cast<LLNearbyChatToastPanel*>(toast->getPanel());
|
||||
|
||||
if(panel && panel->messageID() == fromID && panel->getFromName() == from && panel->canAddText())
|
||||
{
|
||||
panel->addMessage(notification);
|
||||
toast->reshapeToPanel();
|
||||
toast->resetTimer();
|
||||
|
||||
arrangeToasts();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -222,7 +230,7 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
|
|||
|
||||
//take 1st element from pool, (re)initialize it, put it in active toasts
|
||||
|
||||
LLToast* toast = m_toast_pool.back();
|
||||
LLToast* toast = m_toast_pool.back().get();
|
||||
|
||||
m_toast_pool.pop_back();
|
||||
|
||||
|
|
@ -235,25 +243,36 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification)
|
|||
toast->reshapeToPanel();
|
||||
toast->resetTimer();
|
||||
|
||||
m_active_toasts.push_back(toast);
|
||||
m_active_toasts.push_back(toast->getHandle());
|
||||
|
||||
arrangeToasts();
|
||||
}
|
||||
|
||||
void LLNearbyChatScreenChannel::arrangeToasts()
|
||||
{
|
||||
if(m_active_toasts.size() == 0 || isHovering())
|
||||
return;
|
||||
if(!isHovering())
|
||||
{
|
||||
showToastsBottom();
|
||||
}
|
||||
|
||||
hideToastsFromScreen();
|
||||
|
||||
showToastsBottom();
|
||||
if (m_active_toasts.empty())
|
||||
{
|
||||
LLHints::registerHintTarget("incoming_chat", LLHandle<LLView>());
|
||||
}
|
||||
else
|
||||
{
|
||||
LLToast* toast = m_active_toasts.front().get();
|
||||
if (toast)
|
||||
{
|
||||
LLHints::registerHintTarget("incoming_chat", m_active_toasts.front().get()->LLView::getHandle());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int sort_toasts_predicate(LLToast* first,LLToast* second)
|
||||
int sort_toasts_predicate(LLHandle<LLToast> first, LLHandle<LLToast> second)
|
||||
{
|
||||
F32 v1 = first->getTimer()->getEventTimer().getElapsedTimeF32();
|
||||
F32 v2 = second->getTimer()->getEventTimer().getElapsedTimeF32();
|
||||
F32 v1 = first.get()->getTimer()->getEventTimer().getElapsedTimeF32();
|
||||
F32 v2 = second.get()->getTimer()->getEventTimer().getElapsedTimeF32();
|
||||
return v1 < v2;
|
||||
}
|
||||
|
||||
|
|
@ -271,20 +290,22 @@ void LLNearbyChatScreenChannel::showToastsBottom()
|
|||
|
||||
//calc max visible item and hide other toasts.
|
||||
|
||||
for(std::vector<LLToast*>::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
|
||||
for(toast_vec_t::iterator it = m_active_toasts.begin(); it != m_active_toasts.end(); ++it)
|
||||
{
|
||||
S32 toast_top = bottom + (*it)->getRect().getHeight() + margin;
|
||||
LLToast* toast = it->get();
|
||||
if (!toast) continue;
|
||||
|
||||
S32 toast_top = bottom + toast->getRect().getHeight() + margin;
|
||||
|
||||
if(toast_top > gFloaterView->getRect().getHeight())
|
||||
{
|
||||
while(it!=m_active_toasts.end())
|
||||
{
|
||||
addToToastPool((*it));
|
||||
addToToastPool(it->get());
|
||||
it=m_active_toasts.erase(it);
|
||||
}
|
||||
break;
|
||||
}
|
||||
LLToast* toast = (*it);
|
||||
|
||||
toast_rect = toast->getRect();
|
||||
toast_rect.setLeftTopAndSize(getRect().mLeft , bottom + toast_rect.getHeight(), toast_rect.getWidth() ,toast_rect.getHeight());
|
||||
|
|
@ -295,13 +316,16 @@ void LLNearbyChatScreenChannel::showToastsBottom()
|
|||
|
||||
// use reverse order to provide correct z-order and avoid toast blinking
|
||||
|
||||
for(std::vector<LLToast*>::reverse_iterator it = m_active_toasts.rbegin(); it != m_active_toasts.rend(); ++it)
|
||||
for(toast_vec_t::reverse_iterator it = m_active_toasts.rbegin(); it != m_active_toasts.rend(); ++it)
|
||||
{
|
||||
LLToast* toast = (*it);
|
||||
toast->setIsHidden(false);
|
||||
toast->setVisible(TRUE);
|
||||
|
||||
LLToast* toast = it->get();
|
||||
if (toast)
|
||||
{
|
||||
toast->setIsHidden(false);
|
||||
toast->setVisible(TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LLNearbyChatScreenChannel::reshape (S32 width, S32 height, BOOL called_from_parent)
|
||||
|
|
@ -347,14 +371,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
|
|||
{
|
||||
if(chat_msg.mMuted == TRUE)
|
||||
return;
|
||||
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT && chat_msg.mFromID.notNull())
|
||||
{
|
||||
LLRecentPeople::instance().add(chat_msg.mFromID);
|
||||
if (chat_msg.mFromID != gAgentID)
|
||||
{
|
||||
LLFirstUse::otherAvatarChatFirst();
|
||||
}
|
||||
}
|
||||
|
||||
if(chat_msg.mText.empty())
|
||||
return;//don't process empty messages
|
||||
|
|
@ -457,7 +473,13 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg, const LLSD &args)
|
|||
notification["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
|
||||
channel->addNotification(notification);
|
||||
}
|
||||
|
||||
|
||||
if(chat_msg.mSourceType == CHAT_SOURCE_AGENT
|
||||
&& chat_msg.mFromID.notNull()
|
||||
&& chat_msg.mFromID != gAgentID)
|
||||
{
|
||||
LLFirstUse::otherAvatarChatFirst();
|
||||
}
|
||||
}
|
||||
|
||||
void LLNearbyChatHandler::onDeleteToast(LLToast* toast)
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time)
|
|||
, mAvatarId(LLUUID::null)
|
||||
// , mFadeTimer()
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_tag.xml");
|
||||
buildPanel(this, "panel_avatar_tag.xml");
|
||||
setLeftButtonClickCallback(boost::bind(&LLPanelAvatarTag::onClick, this));
|
||||
setAvatarId(key);
|
||||
setTime(im_time);
|
||||
|
|
|
|||
|
|
@ -144,7 +144,7 @@ LLPanelClassifiedInfo::~LLPanelClassifiedInfo()
|
|||
LLPanelClassifiedInfo* LLPanelClassifiedInfo::create()
|
||||
{
|
||||
LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_classified_info.xml");
|
||||
buildPanel(panel, "panel_classified_info.xml");
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
|
@ -617,7 +617,7 @@ LLPanelClassifiedEdit::~LLPanelClassifiedEdit()
|
|||
LLPanelClassifiedEdit* LLPanelClassifiedEdit::create()
|
||||
{
|
||||
LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_edit_classified.xml");
|
||||
buildPanel(panel, "panel_edit_classified.xml");
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ LLPanelGenericTip::LLPanelGenericTip(
|
|||
const LLNotificationPtr& notification) :
|
||||
LLPanelTipToast(notification)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_generic_tip.xml");
|
||||
buildPanel(this, "panel_generic_tip.xml");
|
||||
|
||||
getChild<LLUICtrl>("message")->setValue(notification->getMessage());
|
||||
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id)
|
|||
mPendingUpdate(FALSE)
|
||||
{
|
||||
// Pass on construction of this panel to the control factory.
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_invite.xml");
|
||||
buildPanel(this, "panel_group_invite.xml");
|
||||
}
|
||||
|
||||
LLPanelGroupInvite::~LLPanelGroupInvite()
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ LLLandmarksPanel::LLLandmarksPanel()
|
|||
mInventoryObserver = new LLLandmarksPanelObserver(this);
|
||||
gInventory.addObserver(mInventoryObserver);
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml");
|
||||
buildPanel(this, "panel_landmarks.xml");
|
||||
}
|
||||
|
||||
LLLandmarksPanel::~LLLandmarksPanel()
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect,
|
|||
// Logo
|
||||
mLogoImage = LLUI::getUIImage("startup_logo");
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_login.xml");
|
||||
buildPanel(this, "panel_login.xml");
|
||||
|
||||
#if USE_VIEWER_AUTH
|
||||
//leave room for the login menu bar
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ void LLPanelMe::onCancelClicked()
|
|||
LLPanelMyProfileEdit::LLPanelMyProfileEdit()
|
||||
: LLPanelMyProfile()
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_edit_profile.xml");
|
||||
buildPanel(this, "panel_edit_profile.xml");
|
||||
|
||||
setAvatarId(gAgent.getID());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() :
|
|||
mMediaEditable(false)
|
||||
{
|
||||
// build dialog from XML
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_general.xml");
|
||||
buildPanel(this, "panel_media_settings_general.xml");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() :
|
|||
mPermsWorldControl( 0 )
|
||||
{
|
||||
// build dialog from XML
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_permissions.xml");
|
||||
buildPanel(this, "panel_media_settings_permissions.xml");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() :
|
|||
mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this));
|
||||
|
||||
// build dialog from XML
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_media_settings_security.xml");
|
||||
buildPanel(this, "panel_media_settings_security.xml");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ LLPanelNearByMedia::LLPanelNearByMedia()
|
|||
mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this));
|
||||
mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this));
|
||||
|
||||
LLUICtrlFactory::instance().buildPanel(this, "panel_nearby_media.xml");
|
||||
buildPanel(this, "panel_nearby_media.xml");
|
||||
}
|
||||
|
||||
LLPanelNearByMedia::~LLPanelNearByMedia()
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus(
|
|||
LLPanelTipToast(notification)
|
||||
{
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this,
|
||||
buildPanel(this,
|
||||
"panel_online_status_toast.xml");
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -491,7 +491,7 @@ BOOL LLPanelOutfitEdit::postBuild()
|
|||
|
||||
setVisibleCallback(boost::bind(&LLPanelOutfitEdit::onVisibilityChange, this, _2));
|
||||
|
||||
mCOFWearables = getChild<LLCOFWearables>("cof_wearables_list");
|
||||
mCOFWearables = findChild<LLCOFWearables>("cof_wearables_list");
|
||||
mCOFWearables->setCommitCallback(boost::bind(&LLPanelOutfitEdit::filterWearablesBySelectedItem, this));
|
||||
|
||||
mCOFWearables->getCOFCallbacks().mAddWearable = boost::bind(&LLPanelOutfitEdit::onAddWearableClicked, this);
|
||||
|
|
|
|||
|
|
@ -307,10 +307,10 @@ bool LLPanelOutfitsInventory::isActionEnabled(const LLSD& userdata)
|
|||
|
||||
void LLPanelOutfitsInventory::initTabPanels()
|
||||
{
|
||||
mCurrentOutfitPanel = getChild<LLPanelWearing>(COF_TAB_NAME);
|
||||
mCurrentOutfitPanel = findChild<LLPanelWearing>(COF_TAB_NAME);
|
||||
mCurrentOutfitPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
|
||||
|
||||
mMyOutfitsPanel = getChild<LLOutfitsList>(OUTFITS_TAB_NAME);
|
||||
mMyOutfitsPanel = findChild<LLOutfitsList>(OUTFITS_TAB_NAME);
|
||||
mMyOutfitsPanel->setSelectionChangeCallback(boost::bind(&LLPanelOutfitsInventory::updateVerbs, this));
|
||||
|
||||
mAppearanceTabs = getChild<LLTabContainer>("appearance_tabs");
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@
|
|||
LLPanelPickInfo* LLPanelPickInfo::create()
|
||||
{
|
||||
LLPanelPickInfo* panel = new LLPanelPickInfo();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, XML_PANEL_PICK_INFO);
|
||||
buildPanel(panel, XML_PANEL_PICK_INFO);
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
|
@ -350,7 +350,7 @@ void LLPanelPickInfo::onClickBack()
|
|||
LLPanelPickEdit* LLPanelPickEdit::create()
|
||||
{
|
||||
LLPanelPickEdit* panel = new LLPanelPickEdit();
|
||||
LLUICtrlFactory::getInstance()->buildPanel(panel, XML_PANEL_EDIT_PICK);
|
||||
buildPanel(panel, XML_PANEL_EDIT_PICK);
|
||||
return panel;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1045,7 +1045,7 @@ LLPickItem::LLPickItem()
|
|||
, mSnapshotID(LLUUID::null)
|
||||
, mNeedData(true)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_pick_list_item.xml");
|
||||
buildPanel(this,"panel_pick_list_item.xml");
|
||||
}
|
||||
|
||||
LLPickItem::~LLPickItem()
|
||||
|
|
@ -1175,7 +1175,7 @@ LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classi
|
|||
, mAvatarId(avatar_id)
|
||||
, mClassifiedId(classified_id)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_classifieds_list_item.xml");
|
||||
buildPanel(this,"panel_classifieds_list_item.xml");
|
||||
|
||||
LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this);
|
||||
LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId());
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ LLPanelPlaces::LLPanelPlaces()
|
|||
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(
|
||||
boost::bind(&LLPanelPlaces::updateVerbs, this));
|
||||
|
||||
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
|
||||
//buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
|
||||
}
|
||||
|
||||
LLPanelPlaces::~LLPanelPlaces()
|
||||
|
|
@ -327,8 +327,8 @@ BOOL LLPanelPlaces::postBuild()
|
|||
mFilterEditor->setCommitCallback(boost::bind(&LLPanelPlaces::onFilterEdit, this, _2, false));
|
||||
}
|
||||
|
||||
mPlaceProfile = getChild<LLPanelPlaceProfile>("panel_place_profile");
|
||||
mLandmarkInfo = getChild<LLPanelLandmarkInfo>("panel_landmark_info");
|
||||
mPlaceProfile = findChild<LLPanelPlaceProfile>("panel_place_profile");
|
||||
mLandmarkInfo = findChild<LLPanelLandmarkInfo>("panel_landmark_info");
|
||||
if (!mPlaceProfile || !mLandmarkInfo)
|
||||
return FALSE;
|
||||
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() :
|
|||
mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this));
|
||||
mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this));
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_prim_media_controls.xml");
|
||||
buildPanel(this, "panel_prim_media_controls.xml");
|
||||
mInactivityTimer.reset();
|
||||
mFadeTimer.stop();
|
||||
mCurrentZoom = ZOOM_NONE;
|
||||
|
|
|
|||
|
|
@ -133,11 +133,11 @@ BOOL LLPanelProfile::postBuild()
|
|||
|
||||
getTabCtrl()->setCommitCallback(boost::bind(&LLPanelProfile::onTabSelected, this, _2));
|
||||
|
||||
LLPanelPicks* panel_picks = getChild<LLPanelPicks>(PANEL_PICKS);
|
||||
LLPanelPicks* panel_picks = findChild<LLPanelPicks>(PANEL_PICKS);
|
||||
panel_picks->setProfilePanel(this);
|
||||
|
||||
getTabContainer()[PANEL_PICKS] = panel_picks;
|
||||
getTabContainer()[PANEL_PROFILE] = getChild<LLPanelAvatarProfile>(PANEL_PROFILE);
|
||||
getTabContainer()[PANEL_PROFILE] = findChild<LLPanelAvatarProfile>(PANEL_PROFILE);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ BOOL LLPanelProfileView::postBuild()
|
|||
{
|
||||
LLPanelProfile::postBuild();
|
||||
|
||||
getTabContainer()[PANEL_NOTES] = getChild<LLPanelAvatarNotes>(PANEL_NOTES);
|
||||
getTabContainer()[PANEL_NOTES] = findChild<LLPanelAvatarNotes>(PANEL_NOTES);
|
||||
|
||||
//*TODO remove this, according to style guide we don't use status combobox
|
||||
getTabContainer()[PANEL_PROFILE]->getChildView("online_me_status_text")->setVisible( FALSE);
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor
|
|||
mRegionName(region_name),
|
||||
mHighlight(hl)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history_item.xml");
|
||||
buildPanel(this, "panel_teleport_history_item.xml");
|
||||
}
|
||||
|
||||
LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem()
|
||||
|
|
@ -382,7 +382,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel()
|
|||
mLastSelectedFlatlList(NULL),
|
||||
mLastSelectedItemIndex(-1)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_teleport_history.xml");
|
||||
buildPanel(this, "panel_teleport_history.xml");
|
||||
}
|
||||
|
||||
LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0)
|
|||
LLUICtrl::CommitCallbackRegistry::currentRegistrar()
|
||||
.add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2));
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_topinfo_bar.xml");
|
||||
buildPanel(this, "panel_topinfo_bar.xml");
|
||||
}
|
||||
|
||||
LLPanelTopInfoBar::~LLPanelTopInfoBar()
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ LLPanelVolumePulldown::LLPanelVolumePulldown()
|
|||
|
||||
mCommitCallbackRegistrar.add("Vol.setControlFalse", boost::bind(&LLPanelVolumePulldown::setControlFalse, this, _2));
|
||||
mCommitCallbackRegistrar.add("Vol.GoAudioPrefs", boost::bind(&LLPanelVolumePulldown::onAdvancedButtonClick, this, _2));
|
||||
LLUICtrlFactory::instance().buildPanel(this, "panel_volume_pulldown.xml");
|
||||
buildPanel(this, "panel_volume_pulldown.xml");
|
||||
}
|
||||
|
||||
BOOL LLPanelVolumePulldown::postBuild()
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param
|
|||
mAllowModify(allow_modify),
|
||||
mWearable(wearable)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_scrolling_param.xml");
|
||||
buildPanel(this, "panel_scrolling_param.xml");
|
||||
|
||||
// *HACK To avoid hard coding texture position, lets use border's position for texture.
|
||||
LLViewBorder* left_border = getChild<LLViewBorder>("left_border");
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ LLSidepanelInventory::LLSidepanelInventory()
|
|||
mPanelMainInventory(NULL)
|
||||
{
|
||||
|
||||
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
|
||||
//buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
|
||||
}
|
||||
|
||||
LLSidepanelInventory::~LLSidepanelInventory()
|
||||
|
|
@ -90,7 +90,7 @@ BOOL LLSidepanelInventory::postBuild()
|
|||
mOverflowBtn = mInventoryPanel->getChild<LLButton>("overflow_btn");
|
||||
mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this));
|
||||
|
||||
mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
mPanelMainInventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2));
|
||||
LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs");
|
||||
tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this));
|
||||
|
|
@ -108,7 +108,7 @@ BOOL LLSidepanelInventory::postBuild()
|
|||
|
||||
// UI elements from item panel
|
||||
{
|
||||
mItemPanel = getChild<LLSidepanelItemInfo>("sidepanel__item_panel");
|
||||
mItemPanel = findChild<LLSidepanelItemInfo>("sidepanel__item_panel");
|
||||
|
||||
LLButton* back_btn = mItemPanel->getChild<LLButton>("back_btn");
|
||||
back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this));
|
||||
|
|
@ -116,7 +116,7 @@ BOOL LLSidepanelInventory::postBuild()
|
|||
|
||||
// UI elements from task panel
|
||||
{
|
||||
mTaskPanel = getChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
|
||||
mTaskPanel = findChild<LLSidepanelTaskInfo>("sidepanel__task_panel");
|
||||
if (mTaskPanel)
|
||||
{
|
||||
LLButton* back_btn = mTaskPanel->getChild<LLButton>("back_btn");
|
||||
|
|
@ -176,7 +176,7 @@ void LLSidepanelInventory::onShopButtonClicked()
|
|||
|
||||
void LLSidepanelInventory::performActionOnSelection(const std::string &action)
|
||||
{
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
|
||||
if (!current_item)
|
||||
{
|
||||
|
|
@ -314,7 +314,7 @@ void LLSidepanelInventory::updateVerbs()
|
|||
bool LLSidepanelInventory::canShare()
|
||||
{
|
||||
LLPanelMainInventory* panel_main_inventory =
|
||||
mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
|
||||
LLFolderView* root_folder =
|
||||
panel_main_inventory->getActivePanel()->getRootFolder();
|
||||
|
|
@ -332,7 +332,7 @@ bool LLSidepanelInventory::canShare()
|
|||
|
||||
LLInventoryItem *LLSidepanelInventory::getSelectedItem()
|
||||
{
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem();
|
||||
if (!current_item)
|
||||
{
|
||||
|
|
@ -345,7 +345,7 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem()
|
|||
|
||||
U32 LLSidepanelInventory::getSelectedCount()
|
||||
{
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory");
|
||||
std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList();
|
||||
return selection_list.size();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect)
|
|||
mBalanceTimer = new LLFrameTimer();
|
||||
mHealthTimer = new LLFrameTimer();
|
||||
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this,"panel_status_bar.xml");
|
||||
buildPanel(this,"panel_status_bar.xml");
|
||||
}
|
||||
|
||||
LLStatusBar::~LLStatusBar()
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p),
|
|||
mTitle(NULL),
|
||||
mCloseBtn(NULL)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_sys_well_item.xml");
|
||||
buildPanel(this, "panel_sys_well_item.xml");
|
||||
|
||||
mTitle = getChild<LLTextBox>("title");
|
||||
mCloseBtn = getChild<LLButton>("close_btn");
|
||||
|
|
|
|||
|
|
@ -255,7 +255,7 @@ LLIMWellWindow::RowPanel::RowPanel(const LLSysWellWindow* parent, const LLUUID&
|
|||
S32 chicletCounter, const std::string& name, const LLUUID& otherParticipantId) :
|
||||
LLPanel(LLPanel::Params()), mChiclet(NULL), mParent(parent)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_activeim_row.xml", NULL);
|
||||
buildPanel(this, "panel_activeim_row.xml", NULL);
|
||||
|
||||
// Choose which of the pre-created chiclets (IM/group) to use.
|
||||
// The other one gets hidden.
|
||||
|
|
@ -352,7 +352,7 @@ LLIMWellWindow::ObjectRowPanel::ObjectRowPanel(const LLUUID& notification_id, bo
|
|||
: LLPanel()
|
||||
, mChiclet(NULL)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_active_object_row.xml", NULL);
|
||||
buildPanel(this, "panel_active_object_row.xml", NULL);
|
||||
|
||||
initChiclet(notification_id);
|
||||
|
||||
|
|
|
|||
|
|
@ -194,6 +194,8 @@ public:
|
|||
|
||||
virtual S32 notifyParent(const LLSD& info);
|
||||
|
||||
LLHandle<LLToast> getHandle() { mHandle.bind(this); return mHandle; }
|
||||
|
||||
private:
|
||||
|
||||
void onToastMouseEnter();
|
||||
|
|
@ -206,6 +208,8 @@ private:
|
|||
LLUUID mSessionID;
|
||||
LLNotificationPtr mNotification;
|
||||
|
||||
LLRootHandle<LLToast> mHandle;
|
||||
|
||||
LLPanel* mWrapperPanel;
|
||||
|
||||
// timer counts a lifetime of a toast
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification
|
|||
: LLToastPanel(notification),
|
||||
mInventoryOffer(NULL)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_group_notify.xml");
|
||||
buildPanel(this, "panel_group_notify.xml");
|
||||
const LLSD& payload = notification->getPayload();
|
||||
LLGroupData groupData;
|
||||
if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData))
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif
|
|||
mAvatarIcon(NULL), mAvatarName(NULL),
|
||||
mTime(NULL), mMessage(NULL), mGroupIcon(NULL)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_instant_message.xml");
|
||||
buildPanel(this, "panel_instant_message.xml");
|
||||
|
||||
mGroupIcon = getChild<LLGroupIconCtrl>("group_icon");
|
||||
mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon");
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ mNumButtons(0),
|
|||
mAddedDefaultBtn(false),
|
||||
mCloseNotificationOnDestroy(true)
|
||||
{
|
||||
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_notification.xml");
|
||||
buildPanel(this, "panel_notification.xml");
|
||||
if(rect != LLRect::null)
|
||||
{
|
||||
this->setShape(rect);
|
||||
|
|
|
|||
|
|
@ -1521,7 +1521,7 @@ void LLViewerWindow::initBase()
|
|||
// (But wait to add it as a child of the root view so that it will be in front of the
|
||||
// other views.)
|
||||
MainPanel* main_view = new MainPanel();
|
||||
LLUICtrlFactory::instance().buildPanel(main_view, "main_view.xml");
|
||||
LLPanel::buildPanel(main_view, "main_view.xml");
|
||||
main_view->setShape(full_window);
|
||||
getRootView()->addChild(main_view);
|
||||
|
||||
|
|
@ -1529,7 +1529,7 @@ void LLViewerWindow::initBase()
|
|||
mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle();
|
||||
mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle();
|
||||
mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle();
|
||||
mPopupView = main_view->getChild<LLPopupView>("popup_holder");
|
||||
mPopupView = main_view->findChild<LLPopupView>("popup_holder");
|
||||
mHintHolder = main_view->getChild<LLView>("hint_holder")->getHandle();
|
||||
|
||||
// Constrain floaters to inside the menu and status bar regions.
|
||||
|
|
@ -1568,7 +1568,7 @@ void LLViewerWindow::initBase()
|
|||
LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLFloaterPreference::initBusyResponse));
|
||||
|
||||
// Add the progress bar view (startup view), which overrides everything
|
||||
mProgressView = getRootView()->getChild<LLProgressView>("progress_view");
|
||||
mProgressView = getRootView()->findChild<LLProgressView>("progress_view");
|
||||
setShowProgress(FALSE);
|
||||
setProgressCancelButtonVisible(FALSE);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue