diff options
Diffstat (limited to 'indra')
58 files changed, 187 insertions, 176 deletions
diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp index abd8f7dbde..8383066e46 100644 --- a/indra/integration_tests/llui_libtest/llui_libtest.cpp +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -191,10 +191,9 @@ void export_test_floaters() // Build a floater and output new attributes LLXMLNodePtr output_node = new LLXMLNode(); LLFloater* floater = new LLFloater(LLSD()); - LLUICtrlFactory::getInstance()->buildFloater(floater, - filename, - // FALSE, // don't open floater - output_node); + floater->buildFromFile( filename, + // FALSE, // don't open floater + output_node); std::string out_filename = xui_dir + filename; std::string::size_type extension_pos = out_filename.rfind(".xml"); out_filename.resize(extension_pos); diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 9337626c8e..5ce52185e3 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -89,7 +89,7 @@ LLAccordionCtrl::LLAccordionCtrl() : LLPanel() mSingleExpansion = false; mFitParent = false; - buildPanel(this, "accordion_parent.xml"); + buildFromFile( "accordion_parent.xml"); } //--------------------------------------------------------------------------------- diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index d66b3c1707..0cd692b4a4 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2887,8 +2887,7 @@ bool LLFloater::isVisible(const LLFloater* floater) static LLFastTimer::DeclareTimer FTM_BUILD_FLOATERS("Build Floaters"); -/* static */ -bool LLFloater::buildFloater(LLFloater* floaterp, const std::string& filename, LLXMLNodePtr output_node) +bool LLFloater::buildFromFile(const std::string& filename, LLXMLNodePtr output_node) { LLFastTimer timer(FTM_BUILD_FLOATERS); LLXMLNodePtr root; @@ -2921,23 +2920,23 @@ bool LLFloater::buildFloater(LLFloater* floaterp, const std::string& filename, L lldebugs << "Building floater " << filename << llendl; LLUICtrlFactory::instance().pushFileName(filename); { - if (!floaterp->getFactoryMap().empty()) + if (!getFactoryMap().empty()) { - LLPanel::sFactoryStack.push_front(&floaterp->getFactoryMap()); + LLPanel::sFactoryStack.push_front(&getFactoryMap()); } // for local registry callbacks; define in constructor, referenced in XUI or postBuild - floaterp->getCommitCallbackRegistrar().pushScope(); - floaterp->getEnableCallbackRegistrar().pushScope(); + getCommitCallbackRegistrar().pushScope(); + getEnableCallbackRegistrar().pushScope(); - res = floaterp->initFloaterXML(root, floaterp->getParent(), filename, output_node); + res = initFloaterXML(root, getParent(), filename, output_node); - floaterp->setXMLFilename(filename); + setXMLFilename(filename); - floaterp->getCommitCallbackRegistrar().popScope(); - floaterp->getEnableCallbackRegistrar().popScope(); + getCommitCallbackRegistrar().popScope(); + getEnableCallbackRegistrar().popScope(); - if (!floaterp->getFactoryMap().empty()) + if (!getFactoryMap().empty()) { LLPanel::sFactoryStack.pop_front(); } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 69762c7723..750cf23c7d 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -147,7 +147,7 @@ public: // Don't export top/left for rect, only height/width static void setupParamsForExport(Params& p, LLView* parent); - static bool buildFloater(LLFloater* floaterp, const std::string &filename, LLXMLNodePtr output_node); + bool buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL); void initFromParams(const LLFloater::Params& p); bool initFloaterXML(LLXMLNodePtr node, LLView *parent, const std::string& filename, LLXMLNodePtr output_node = NULL); diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 2c31854011..39a67ee57b 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -127,7 +127,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res = build_func(key); - bool success = LLFloater::buildFloater(res, xui_file, NULL); + bool success = res->buildFromFile(xui_file, NULL); if (!success) { llwarns << "Failed to build floater type: '" << name << "'." << llendl; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f79429e0f6..51c8f6c743 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -972,7 +972,7 @@ 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) +BOOL LLPanel::buildFromFile(const std::string& filename, LLXMLNodePtr output_node, const LLPanel::Params& default_params) { LLFastTimer timer(FTM_BUILD_PANELS); BOOL didPost = FALSE; @@ -1005,23 +1005,23 @@ BOOL LLPanel::buildPanel(LLPanel* panelp, const std::string& filename, LLXMLNode LLUICtrlFactory::instance().pushFileName(filename); { - if (!panelp->getFactoryMap().empty()) + if (!getFactoryMap().empty()) { - sFactoryStack.push_back(&panelp->getFactoryMap()); + sFactoryStack.push_back(&getFactoryMap()); } // for local registry callbacks; define in constructor, referenced in XUI or postBuild - panelp->getCommitCallbackRegistrar().pushScope(); - panelp->getEnableCallbackRegistrar().pushScope(); + getCommitCallbackRegistrar().pushScope(); + getEnableCallbackRegistrar().pushScope(); - didPost = panelp->initPanelXML(root, NULL, output_node, default_params); + didPost = initPanelXML(root, NULL, output_node, default_params); - panelp->getCommitCallbackRegistrar().popScope(); - panelp->getEnableCallbackRegistrar().popScope(); + getCommitCallbackRegistrar().popScope(); + getEnableCallbackRegistrar().popScope(); - panelp->setXMLFilename(filename); + setXMLFilename(filename); - if (!panelp->getFactoryMap().empty()) + if (!getFactoryMap().empty()) { sFactoryStack.pop_back(); } diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index de16d28e27..cacd1fdcf0 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -110,7 +110,7 @@ protected: LLPanel(const LLPanel::Params& params = getDefaultParams()); public: - static BOOL buildPanel(LLPanel* panelp, const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams()); + BOOL buildFromFile(const std::string &filename, LLXMLNodePtr output_node = NULL, const LLPanel::Params&default_params = getDefaultParams()); static LLPanel* createFactoryPanel(const std::string& name); diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index 16fb618c88..82076335d7 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -156,37 +156,11 @@ public: void popFileName(); template<typename T> - static T* createWidget(const typename T::Params& params, LLView* parent = NULL) - { - T* widget = NULL; - - if (!params.validateBlock()) - { - llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; - //return NULL; - } - - { LLFastTimer _(FTM_WIDGET_CONSTRUCTION); - widget = new T(params); - } - { LLFastTimer _(FTM_INIT_FROM_PARAMS); - widget->initFromParams(params); - } - - if (parent) - { - S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX; - setCtrlParent(widget, parent, tab_group); - } - return widget; - } - - template<typename T> static T* create(typename T::Params& params, LLView* parent = NULL) { params.fillFrom(ParamDefaults<typename T::Params, 0>::instance().get()); - T* widget = createWidget<T>(params, parent); + T* widget = createWidgetImpl<T>(params, parent); if (widget) { widget->postBuild(); @@ -249,8 +223,47 @@ fail: return create<T>(widget_params); } + static void createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t&, LLXMLNodePtr output_node = NULL); + + static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root); + static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root); + +private: + template <typename T> friend class LLChildRegistry; + static void copyName(LLXMLNodePtr src, LLXMLNodePtr dest); + // 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, const std::string& tag); + + static void loadWidgetTemplate(const std::string& widget_tag, LLInitParam::BaseBlock& block); + + template<typename T> + static T* createWidgetImpl(const typename T::Params& params, LLView* parent = NULL) + { + T* widget = NULL; + + if (!params.validateBlock()) + { + llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl; + //return NULL; + } + + { LLFastTimer _(FTM_WIDGET_CONSTRUCTION); + widget = new T(params); + } + { LLFastTimer _(FTM_INIT_FROM_PARAMS); + widget->initFromParams(params); + } + + if (parent) + { + S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : S32_MAX; + setCtrlParent(widget, parent, tab_group); + } + return widget; + } + template<typename T> static T* defaultBuilder(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr output_node) { @@ -275,7 +288,7 @@ fail: // Apply layout transformations, usually munging rect params.from_xui = true; T::applyXUILayout(params, parent); - T* widget = createWidget<T>(params, parent); + T* widget = createWidgetImpl<T>(params, parent); typedef typename T::child_registry_t registry_t; @@ -290,18 +303,7 @@ fail: return widget; } - static void createChildren(LLView* viewp, LLXMLNodePtr node, const widget_registry_t&, LLXMLNodePtr output_node = NULL); - - static bool getLayeredXMLNode(const std::string &filename, LLXMLNodePtr& root); - - static bool getLocalizedXMLNode(const std::string &xui_filename, LLXMLNodePtr& root); - - 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, const std::string& tag); - -private: static const std::string* getWidgetTag(const std::type_info* widget_type); // this exists to get around dependency on llview diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index f448816f76..95ced5067d 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -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. - buildPanel(this, "panel_avatar_list_item.xml"); + buildFromFile( "panel_avatar_list_item.xml"); } BOOL LLAvalineListItem::postBuild() diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index 18a5d74527..81c9b64c12 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -75,7 +75,7 @@ LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/) { if (not_from_ui_factory) { - buildPanel(this, "panel_avatar_list_item.xml"); + buildFromFile("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 diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 310b406bfd..c4eda5f107 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -112,7 +112,7 @@ public: mGesturePanel(NULL) { mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); - buildPanel(this, "panel_bottomtray_lite.xml"); + buildFromFile("panel_bottomtray_lite.xml"); // Necessary for focus movement among child controls setFocusRoot(TRUE); } @@ -163,7 +163,7 @@ LLBottomTray::LLBottomTray(const LLSD&) mFactoryMap["chat_bar"] = LLCallbackMap(LLBottomTray::createNearbyChatBar, NULL); - buildPanel(this,"panel_bottomtray.xml"); + buildFromFile("panel_bottomtray.xml"); LLUICtrl::CommitCallbackRegistry::defaultRegistrar().add("CameraPresets.ChangeView", boost::bind(&LLFloaterCamera::onClickCameraItem, _2)); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index b6788b7739..e1e425fa8c 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -107,7 +107,7 @@ public: static LLChatHistoryHeader* createInstance(const std::string& file_name) { LLChatHistoryHeader* pInstance = new LLChatHistoryHeader; - buildPanel(pInstance, file_name); + pInstance->buildFromFile(file_name); return pInstance; } diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index ed4803f87a..b1c878ed76 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -57,7 +57,7 @@ static const S32 msg_height_pad = 5; LLNearbyChatToastPanel* LLNearbyChatToastPanel::createInstance() { LLNearbyChatToastPanel* item = new LLNearbyChatToastPanel(); - buildPanel(item, "panel_chat_item.xml"); + item->buildFromFile("panel_chat_item.xml"); item->setFollows(FOLLOWS_NONE); return item; } diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 6b7a257a4b..b8776d0af2 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -667,16 +667,22 @@ void LLFavoritesBarCtrl::draw() } } -LLXMLNodePtr LLFavoritesBarCtrl::getButtonXMLNode() +const LLButton::Params& LLFavoritesBarCtrl::getButtonParams() { - LLXMLNodePtr buttonXMLNode = NULL; - bool success = LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", buttonXMLNode); - if (!success) + static LLButton::Params button_params; + static bool params_initialized = false; + + if (!params_initialized) { - llwarns << "Failed to create Favorites Bar button from favorites_bar_button.xml" << llendl; - buttonXMLNode = NULL; + LLXMLNodePtr button_xml_node; + if(LLUICtrlFactory::getLayeredXMLNode("favorites_bar_button.xml", button_xml_node)) + { + LLXUIParser::instance().readXUI(button_xml_node, button_params, "favorites_bar_button.xml"); + } + params_initialized = true; } - return buttonXMLNode; + + return button_params; } void LLFavoritesBarCtrl::updateButtons() @@ -688,11 +694,8 @@ void LLFavoritesBarCtrl::updateButtons() return; } - static LLXMLNodePtr buttonXMLNode = getButtonXMLNode(); - if (buttonXMLNode.isNull()) - { - return; - } + const LLButton::Params& button_params = getButtonParams(); + if(mItems.empty()) { mBarLabel->setVisible(TRUE); @@ -768,7 +771,7 @@ void LLFavoritesBarCtrl::updateButtons() int j = first_changed_item_index; for (; j < mItems.count(); j++) { - last_new_button = createButton(mItems[j], buttonXMLNode, last_right_edge); + last_new_button = createButton(mItems[j], button_params, last_right_edge); if (!last_new_button) { break; @@ -786,8 +789,7 @@ void LLFavoritesBarCtrl::updateButtons() //or there are some new favorites, or width had been changed // so if we need to display chevron button, we must update dropdown items too. mUpdateDropDownItems = true; - S32 buttonHGap = 2; // default value - buttonXMLNode->getAttributeS32("left", buttonHGap); + S32 buttonHGap = button_params.rect.left; // default value LLRect rect; // Chevron button should stay right aligned rect.setOriginAndSize(getRect().mRight - mChevronButton->getRect().getWidth() - buttonHGap, 0, @@ -814,12 +816,10 @@ void LLFavoritesBarCtrl::updateButtons() } } -LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem> item, LLXMLNodePtr &buttonXMLNode, S32 x_offset) +LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem> item, const LLButton::Params& button_params, S32 x_offset) { - S32 def_button_width = 120; - buttonXMLNode->getAttributeS32("width", def_button_width); - S32 button_x_delta = 2; // default value - buttonXMLNode->getAttributeS32("left", button_x_delta); + S32 def_button_width = button_params.rect.width; + S32 button_x_delta = button_params.rect.left; // default value S32 curr_x = x_offset; /** @@ -837,13 +837,16 @@ LLButton* LLFavoritesBarCtrl::createButton(const LLPointer<LLViewerInventoryItem { return NULL; } - fav_btn = LLUICtrlFactory::defaultBuilder<LLFavoriteLandmarkButton>(buttonXMLNode, this, NULL); + LLButton::Params fav_btn_params(button_params); + fav_btn = LLUICtrlFactory::create<LLFavoriteLandmarkButton>(fav_btn_params); if (NULL == fav_btn) { llwarns << "Unable to create LLFavoriteLandmarkButton widget: " << item->getName() << llendl; return NULL; } + addChild(fav_btn); + LLRect butt_rect (fav_btn->getRect()); fav_btn->setLandmarkID(item->getUUID()); butt_rect.setOriginAndSize(curr_x + button_x_delta, fav_btn->getRect().mBottom, width, fav_btn->getRect().getHeight()); diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 2c6d8d1580..62f2825bbe 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -77,8 +77,8 @@ public: protected: void updateButtons(); - LLButton* createButton(const LLPointer<LLViewerInventoryItem> item, LLXMLNodePtr &root, S32 x_offset ); - LLXMLNodePtr getButtonXMLNode(); + LLButton* createButton(const LLPointer<LLViewerInventoryItem> item, const LLButton::Params& button_params, S32 x_offset ); + const LLButton::Params& getButtonParams(); BOOL collectFavoriteItems(LLInventoryModel::item_array_t &items); void onButtonClick(LLUUID id); diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index b7bca5c6cd..3d37c878ad 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -65,7 +65,7 @@ LLNotificationChannelPanel::LLNotificationChannelPanel(const std::string& channe mChannelRejectsPtr = LLNotificationChannelPtr( LLNotificationChannel::buildChannel(channel_name + "rejects", mChannelPtr->getParentChannelName(), !boost::bind(mChannelPtr->getFilter(), _1))); - buildPanel(this, "panel_notifications_channel.xml"); + buildFromFile( "panel_notifications_channel.xml"); } BOOL LLNotificationChannelPanel::postBuild() diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index b61d90043e..8c552d0c06 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -179,32 +179,32 @@ BOOL LLFloaterRegionInfo::postBuild() mInfoPanels.push_back(panel); panel->getCommitCallbackRegistrar().add("RegionInfo.ManageTelehub", boost::bind(&LLPanelRegionInfo::onClickManageTelehub, panel)); - buildPanel(panel, "panel_region_general.xml"); + panel->buildFromFile("panel_region_general.xml"); mTab->addTabPanel(LLTabContainer::TabPanelParams().panel(panel).select_tab(true)); panel = new LLPanelRegionDebugInfo; mInfoPanels.push_back(panel); - buildPanel(panel, "panel_region_debug.xml"); + panel->buildFromFile("panel_region_debug.xml"); mTab->addTabPanel(panel); panel = new LLPanelRegionTextureInfo; mInfoPanels.push_back(panel); - buildPanel(panel, "panel_region_texture.xml"); + panel->buildFromFile("panel_region_texture.xml"); mTab->addTabPanel(panel); panel = new LLPanelRegionTerrainInfo; mInfoPanels.push_back(panel); - buildPanel(panel, "panel_region_terrain.xml"); + panel->buildFromFile("panel_region_terrain.xml"); mTab->addTabPanel(panel); panel = new LLPanelEstateInfo; mInfoPanels.push_back(panel); - buildPanel(panel, "panel_region_estate.xml"); + panel->buildFromFile("panel_region_estate.xml"); mTab->addTabPanel(panel); panel = new LLPanelEstateCovenant; mInfoPanels.push_back(panel); - buildPanel(panel, "panel_region_covenant.xml"); + panel->buildFromFile("panel_region_covenant.xml"); mTab->addTabPanel(panel); gMessageSystem->setHandlerFunc( diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp index a6f3acd18d..6a20998245 100644 --- a/indra/newview/llfloaterscriptlimits.cpp +++ b/indra/newview/llfloaterscriptlimits.cpp @@ -121,7 +121,7 @@ BOOL LLFloaterScriptLimits::postBuild() LLPanelScriptLimitsRegionMemory* panel_memory; panel_memory = new LLPanelScriptLimitsRegionMemory; mInfoPanels.push_back(panel_memory); - buildPanel(panel_memory, "panel_script_limits_region_memory.xml"); + panel_memory->buildFromFile( "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); - buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml"); + panel_attachments->buildFromFile("panel_script_limits_my_avatar.xml"); mTab->addTabPanel(panel_attachments); } diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 7c2a449343..19790c8868 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -837,7 +837,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if (save) { LLXMLNodePtr floater_write = new LLXMLNode(); - buildFloater(*floaterp, path, floater_write); // just build it + *floaterp->buildFromFile(path, floater_write); // just build it if (!floater_write->isNull()) { @@ -851,7 +851,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } else { - buildFloater(*floaterp, path, NULL); // just build it + (*floaterp)->buildFromFile(path); // just build it (*floaterp)->openFloater((*floaterp)->getKey()); (*floaterp)->setCanResize((*floaterp)->isResizable()); } @@ -890,7 +890,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) if (save) { LLXMLNodePtr panel_write = new LLXMLNode(); - buildPanel(panel, path, panel_write); // build it + panel->buildFromFile(path, panel_write); // build it if (!panel_write->isNull()) { @@ -904,7 +904,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } else { - buildPanel(panel, path); // build it + panel->buildFromFile(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 diff --git a/indra/newview/llfloaterurlentry.cpp b/indra/newview/llfloaterurlentry.cpp index a192cfda3d..639b664920 100644 --- a/indra/newview/llfloaterurlentry.cpp +++ b/indra/newview/llfloaterurlentry.cpp @@ -88,7 +88,7 @@ LLFloaterURLEntry::LLFloaterURLEntry(LLHandle<LLPanel> parent) : LLFloater(LLSD()), mPanelLandMediaHandle(parent) { - buildFloater(this, "floater_url_entry.xml", NULL); + buildFromFile("floater_url_entry.xml"); } //----------------------------------------------------------------------------- diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index af931810a2..f2ca6ea5d1 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -289,7 +289,7 @@ mGroupNameBox(NULL), mInfoBtn(NULL), mGroupID(LLUUID::null) { - buildPanel(this, "panel_group_list_item.xml"); + buildFromFile( "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. diff --git a/indra/newview/llhints.cpp b/indra/newview/llhints.cpp index c4cea86a31..e0ced5caeb 100644 --- a/indra/newview/llhints.cpp +++ b/indra/newview/llhints.cpp @@ -137,9 +137,8 @@ static LLDefaultChildRegistry::Register<LLHintPopup> r("hint_popup"); LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) : mNotification(p.notification), - mDirection(p.target_params.direction), + mDirection(TOP), mDistance(p.distance), - mTarget(p.target_params.target), mArrowLeft(p.left_arrow), mArrowUp(p.up_arrow), mArrowRight(p.right_arrow), @@ -153,7 +152,12 @@ LLHintPopup::LLHintPopup(const LLHintPopup::Params& p) mFadeOutTime(p.fade_out_time), LLPanel(p) { - buildPanel(this, "panel_hint.xml", NULL, p); + if (p.target_params.isProvided()) + { + mDirection = p.target_params.direction; + mTarget = p.target_params.target; + } + buildFromFile( "panel_hint.xml", NULL, p); } BOOL LLHintPopup::postBuild() diff --git a/indra/newview/llhudview.cpp b/indra/newview/llhudview.cpp index beb3b4340a..ae3204e35c 100644 --- a/indra/newview/llhudview.cpp +++ b/indra/newview/llhudview.cpp @@ -56,7 +56,7 @@ const S32 HUD_ARROW_SIZE = 32; LLHUDView::LLHUDView(const LLRect& r) { - buildPanel(this, "panel_hud.xml"); + buildFromFile( "panel_hud.xml"); setShape(r, true); } diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 680f937e83..f0fd7e1b7c 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -703,7 +703,7 @@ void LLPanelStandStopFlying::reparent(LLFloaterMove* move_view) LLPanelStandStopFlying* LLPanelStandStopFlying::getStandStopFlyingPanel() { LLPanelStandStopFlying* panel = new LLPanelStandStopFlying(); - buildPanel(panel, "panel_stand_stop_flying.xml"); + panel->buildFromFile("panel_stand_stop_flying.xml"); panel->setVisible(FALSE); //LLUI::getRootView()->addChild(panel); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index e53103237c..32b7a70204 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -278,7 +278,7 @@ LLNavigationBar::LLNavigationBar() mPurgeTPHistoryItems(false), mSaveToLocationHistory(false) { - buildPanel(this, "panel_navigation_bar.xml"); + buildFromFile( "panel_navigation_bar.xml"); // set a listener function for LoginComplete event LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLNavigationBar::handleLoginComplete, this)); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index f2207e5c00..d35739d436 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -68,6 +68,29 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL return name1 < name2; } +const LLAccordionCtrlTab::Params& get_accordion_tab_params() +{ + static LLAccordionCtrlTab::Params tab_params; + static bool initialized = false; + if (!initialized) + { + initialized = true; + + LLXMLNodePtr xmlNode; + if (LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode)) + { + LLXUIParser::instance().readXUI(xmlNode, tab_params, "outfit_accordion_tab.xml"); + } + else + { + llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl; + } + } + + return tab_params; +} + + ////////////////////////////////////////////////////////////////////////// class LLOutfitListGearMenu @@ -442,8 +465,8 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) std::string name = cat->getName(); - static LLXMLNodePtr accordionXmlNode = getAccordionTabXMLNode(); - LLAccordionCtrlTab* tab = LLUICtrlFactory::defaultBuilder<LLAccordionCtrlTab>(accordionXmlNode, NULL, NULL); + LLAccordionCtrlTab::Params tab_params(get_accordion_tab_params()); + LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params); tab->setName(name); tab->setTitle(name); @@ -736,19 +759,6 @@ bool LLOutfitsList::hasItemSelected() ////////////////////////////////////////////////////////////////////////// // Private methods ////////////////////////////////////////////////////////////////////////// -LLXMLNodePtr LLOutfitsList::getAccordionTabXMLNode() -{ - LLXMLNodePtr xmlNode = NULL; - bool success = LLUICtrlFactory::getLayeredXMLNode("outfit_accordion_tab.xml", xmlNode); - if (!success) - { - llwarns << "Failed to read xml of Outfit's Accordion Tab from outfit_accordion_tab.xml" << llendl; - return NULL; - } - - return xmlNode; -} - void LLOutfitsList::computeDifference( const LLInventoryModel::cat_array_t& vcats, uuid_vec_t& vadded, diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 206854b232..b3bc35dcda 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -116,12 +116,6 @@ public: bool hasItemSelected(); private: - /** - * Reads xml with accordion tab and Flat list from xml file. - * - * @return LLPointer to XMLNode with accordion tab and flat list. - */ - LLXMLNodePtr getAccordionTabXMLNode(); /** * Wrapper for LLCommonUtils::computeDifference. @see LLCommonUtils::computeDifference diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp index 0ffb10b18b..489222fb2a 100644 --- a/indra/newview/llpanelavatartag.cpp +++ b/indra/newview/llpanelavatartag.cpp @@ -43,7 +43,7 @@ LLPanelAvatarTag::LLPanelAvatarTag(const LLUUID& key, const std::string im_time) , mAvatarId(LLUUID::null) // , mFadeTimer() { - buildPanel(this, "panel_avatar_tag.xml"); + buildFromFile( "panel_avatar_tag.xml"); setLeftButtonClickCallback(boost::bind(&LLPanelAvatarTag::onClick, this)); setAvatarId(key); setTime(im_time); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 4d3d54ed15..8e0ebfa406 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -144,7 +144,7 @@ LLPanelClassifiedInfo::~LLPanelClassifiedInfo() LLPanelClassifiedInfo* LLPanelClassifiedInfo::create() { LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo(); - buildPanel(panel, "panel_classified_info.xml"); + panel->buildFromFile("panel_classified_info.xml"); return panel; } @@ -617,7 +617,7 @@ LLPanelClassifiedEdit::~LLPanelClassifiedEdit() LLPanelClassifiedEdit* LLPanelClassifiedEdit::create() { LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit(); - buildPanel(panel, "panel_edit_classified.xml"); + panel->buildFromFile("panel_edit_classified.xml"); return panel; } diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index 709ed33ed1..7a05a2b8e7 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -42,7 +42,7 @@ LLPanelGenericTip::LLPanelGenericTip( const LLNotificationPtr& notification) : LLPanelTipToast(notification) { - buildPanel(this, "panel_generic_tip.xml"); + buildFromFile( "panel_generic_tip.xml"); getChild<LLUICtrl>("message")->setValue(notification->getMessage()); diff --git a/indra/newview/llpanelgroupinvite.cpp b/indra/newview/llpanelgroupinvite.cpp index b610fa9899..5d70e8bb30 100644 --- a/indra/newview/llpanelgroupinvite.cpp +++ b/indra/newview/llpanelgroupinvite.cpp @@ -375,7 +375,7 @@ LLPanelGroupInvite::LLPanelGroupInvite(const LLUUID& group_id) mPendingUpdate(FALSE) { // Pass on construction of this panel to the control factory. - buildPanel(this, "panel_group_invite.xml"); + buildFromFile( "panel_group_invite.xml"); } LLPanelGroupInvite::~LLPanelGroupInvite() diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 9ad39d568c..038944802e 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -202,7 +202,7 @@ LLLandmarksPanel::LLLandmarksPanel() mInventoryObserver = new LLLandmarksPanelObserver(this); gInventory.addObserver(mInventoryObserver); - buildPanel(this, "panel_landmarks.xml"); + buildFromFile( "panel_landmarks.xml"); } LLLandmarksPanel::~LLLandmarksPanel() diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 6b71e37337..637a4968b0 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -193,7 +193,7 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, // Logo mLogoImage = LLUI::getUIImage("startup_logo"); - buildPanel(this, "panel_login.xml"); + buildFromFile( "panel_login.xml"); #if USE_VIEWER_AUTH //leave room for the login menu bar diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index 389fe8edbf..ca62a676ce 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -168,7 +168,7 @@ void LLPanelMe::onCancelClicked() LLPanelMyProfileEdit::LLPanelMyProfileEdit() : LLPanelMyProfile() { - buildPanel(this, "panel_edit_profile.xml"); + buildFromFile( "panel_edit_profile.xml"); setAvatarId(gAgent.getID()); } diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index 54703d3cdc..b0ee4e92ad 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -80,7 +80,7 @@ LLPanelMediaSettingsGeneral::LLPanelMediaSettingsGeneral() : mMediaEditable(false) { // build dialog from XML - buildPanel(this, "panel_media_settings_general.xml"); + buildFromFile( "panel_media_settings_general.xml"); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmediasettingspermissions.cpp b/indra/newview/llpanelmediasettingspermissions.cpp index 389003dc45..eebfd6bc77 100644 --- a/indra/newview/llpanelmediasettingspermissions.cpp +++ b/indra/newview/llpanelmediasettingspermissions.cpp @@ -65,7 +65,7 @@ LLPanelMediaSettingsPermissions::LLPanelMediaSettingsPermissions() : mPermsWorldControl( 0 ) { // build dialog from XML - buildPanel(this, "panel_media_settings_permissions.xml"); + buildFromFile( "panel_media_settings_permissions.xml"); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelmediasettingssecurity.cpp b/indra/newview/llpanelmediasettingssecurity.cpp index 502ba179d3..75f29f1002 100644 --- a/indra/newview/llpanelmediasettingssecurity.cpp +++ b/indra/newview/llpanelmediasettingssecurity.cpp @@ -59,7 +59,7 @@ LLPanelMediaSettingsSecurity::LLPanelMediaSettingsSecurity() : mCommitCallbackRegistrar.add("Media.whitelistDelete", boost::bind(&LLPanelMediaSettingsSecurity::onBtnDel, this)); // build dialog from XML - buildPanel(this, "panel_media_settings_security.xml"); + buildFromFile( "panel_media_settings_security.xml"); } //////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index e477d71712..49567b2ed8 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -102,7 +102,7 @@ LLPanelNearByMedia::LLPanelNearByMedia() mCommitCallbackRegistrar.add("SelectedMediaCtrl.Zoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaZoom, this)); mCommitCallbackRegistrar.add("SelectedMediaCtrl.Unzoom", boost::bind(&LLPanelNearByMedia::onClickSelectedMediaUnzoom, this)); - buildPanel(this, "panel_nearby_media.xml"); + buildFromFile( "panel_nearby_media.xml"); } LLPanelNearByMedia::~LLPanelNearByMedia() diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp index 43c3ed782d..e77df757a5 100644 --- a/indra/newview/llpanelonlinestatus.cpp +++ b/indra/newview/llpanelonlinestatus.cpp @@ -41,7 +41,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus( LLPanelTipToast(notification) { - buildPanel(this, + buildFromFile( "panel_online_status_toast.xml"); diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index 0417c65f7a..2e87a8eecb 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -80,7 +80,7 @@ LLPanelPickInfo* LLPanelPickInfo::create() { LLPanelPickInfo* panel = new LLPanelPickInfo(); - buildPanel(panel, XML_PANEL_PICK_INFO); + panel->buildFromFile(XML_PANEL_PICK_INFO); return panel; } @@ -350,7 +350,7 @@ void LLPanelPickInfo::onClickBack() LLPanelPickEdit* LLPanelPickEdit::create() { LLPanelPickEdit* panel = new LLPanelPickEdit(); - buildPanel(panel, XML_PANEL_EDIT_PICK); + panel->buildFromFile(XML_PANEL_EDIT_PICK); return panel; } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 653f3726a9..2efb664f2e 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -1045,7 +1045,7 @@ LLPickItem::LLPickItem() , mSnapshotID(LLUUID::null) , mNeedData(true) { - buildPanel(this,"panel_pick_list_item.xml"); + buildFromFile("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) { - buildPanel(this,"panel_classifieds_list_item.xml"); + buildFromFile("panel_classifieds_list_item.xml"); LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 83e674ee92..e7af7e480d 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -252,7 +252,7 @@ LLPanelPlaces::LLPanelPlaces() LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback( boost::bind(&LLPanelPlaces::updateVerbs, this)); - //buildPanel(this, "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() + //buildFromFile( "panel_places.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLPanelPlaces::~LLPanelPlaces() diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp index 68522ffac3..6552a296b6 100644 --- a/indra/newview/llpanelprimmediacontrols.cpp +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -119,7 +119,7 @@ LLPanelPrimMediaControls::LLPanelPrimMediaControls() : mCommitCallbackRegistrar.add("MediaCtrl.SkipBack", boost::bind(&LLPanelPrimMediaControls::onClickSkipBack, this)); mCommitCallbackRegistrar.add("MediaCtrl.SkipForward", boost::bind(&LLPanelPrimMediaControls::onClickSkipForward, this)); - buildPanel(this, "panel_prim_media_controls.xml"); + buildFromFile( "panel_prim_media_controls.xml"); mInactivityTimer.reset(); mFadeTimer.stop(); mCurrentZoom = ZOOM_NONE; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index b398d75feb..7e0bd2f8e6 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -131,7 +131,7 @@ LLTeleportHistoryFlatItem::LLTeleportHistoryFlatItem(S32 index, LLTeleportHistor mRegionName(region_name), mHighlight(hl) { - buildPanel(this, "panel_teleport_history_item.xml"); + buildFromFile( "panel_teleport_history_item.xml"); } LLTeleportHistoryFlatItem::~LLTeleportHistoryFlatItem() @@ -382,7 +382,7 @@ LLTeleportHistoryPanel::LLTeleportHistoryPanel() mLastSelectedFlatlList(NULL), mLastSelectedItemIndex(-1) { - buildPanel(this, "panel_teleport_history.xml"); + buildFromFile( "panel_teleport_history.xml"); } LLTeleportHistoryPanel::~LLTeleportHistoryPanel() diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 6e69e6d44c..1ee143b42e 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -72,7 +72,7 @@ LLPanelTopInfoBar::LLPanelTopInfoBar(): mParcelChangedObserver(0) LLUICtrl::CommitCallbackRegistry::currentRegistrar() .add("TopInfoBar.Action", boost::bind(&LLPanelTopInfoBar::onContextMenuItemClicked, this, _2)); - buildPanel(this, "panel_topinfo_bar.xml"); + buildFromFile( "panel_topinfo_bar.xml"); } LLPanelTopInfoBar::~LLPanelTopInfoBar() diff --git a/indra/newview/llpanelvolumepulldown.cpp b/indra/newview/llpanelvolumepulldown.cpp index a038badb01..9d997f23d7 100644 --- a/indra/newview/llpanelvolumepulldown.cpp +++ b/indra/newview/llpanelvolumepulldown.cpp @@ -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)); - buildPanel(this, "panel_volume_pulldown.xml"); + buildFromFile( "panel_volume_pulldown.xml"); } BOOL LLPanelVolumePulldown::postBuild() diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index ce465927bb..31ea69a889 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -157,7 +157,7 @@ LLFloaterScriptSearch::LLFloaterScriptSearch(LLScriptEdCore* editor_core) : LLFloater(LLSD()), mEditorCore(editor_core) { - buildFloater(this,"floater_script_search.xml", NULL); + buildFromFile("floater_script_search.xml"); sInstance = this; @@ -660,7 +660,7 @@ void LLScriptEdCore::onBtnDynamicHelp() if (!live_help_floater) { live_help_floater = new LLFloater(LLSD()); - LLFloater::buildFloater(live_help_floater, "floater_lsl_guide.xml", NULL); + live_help_floater->buildFromFile("floater_lsl_guide.xml", NULL); LLFloater* parent = dynamic_cast<LLFloater*>(getParent()); llassert(parent); if (parent) diff --git a/indra/newview/llscrollingpanelparam.cpp b/indra/newview/llscrollingpanelparam.cpp index 4c2469909b..3ca6d62d93 100644 --- a/indra/newview/llscrollingpanelparam.cpp +++ b/indra/newview/llscrollingpanelparam.cpp @@ -62,7 +62,7 @@ LLScrollingPanelParam::LLScrollingPanelParam( const LLPanel::Params& panel_param mAllowModify(allow_modify), mWearable(wearable) { - buildPanel(this, "panel_scrolling_param.xml"); + buildFromFile( "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"); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index aa29f6cb26..cdd2761024 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -56,7 +56,7 @@ LLSidepanelInventory::LLSidepanelInventory() mPanelMainInventory(NULL) { - //buildPanel(this, "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() + //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLSidepanelInventory::~LLSidepanelInventory() diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 8d61bb94e1..63e54fdeb2 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -142,7 +142,7 @@ LLStatusBar::LLStatusBar(const LLRect& rect) mBalanceTimer = new LLFrameTimer(); mHealthTimer = new LLFrameTimer(); - buildPanel(this,"panel_status_bar.xml"); + buildFromFile("panel_status_bar.xml"); } LLStatusBar::~LLStatusBar() diff --git a/indra/newview/llsyswellitem.cpp b/indra/newview/llsyswellitem.cpp index 79b053da24..794d413867 100644 --- a/indra/newview/llsyswellitem.cpp +++ b/indra/newview/llsyswellitem.cpp @@ -44,7 +44,7 @@ LLSysWellItem::LLSysWellItem(const Params& p) : LLPanel(p), mTitle(NULL), mCloseBtn(NULL) { - buildPanel(this, "panel_sys_well_item.xml"); + buildFromFile( "panel_sys_well_item.xml"); mTitle = getChild<LLTextBox>("title"); mCloseBtn = getChild<LLButton>("close_btn"); diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 89fd22a2a0..d971318f21 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -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) { - buildPanel(this, "panel_activeim_row.xml", NULL); + buildFromFile( "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) { - buildPanel(this, "panel_active_object_row.xml", NULL); + buildFromFile( "panel_active_object_row.xml", NULL); initChiclet(notification_id); diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 06c95b5e9c..5fdc6765a8 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -83,7 +83,7 @@ LLToast::LLToast(const LLToast::Params& p) { mTimer.reset(new LLToastLifeTimer(this, p.lifetime_secs)); - buildFloater(this, "panel_toast.xml", NULL); + buildFromFile("panel_toast.xml", NULL); setCanDrag(FALSE); diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 7c2e68f942..f76c9adb78 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -60,7 +60,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification : LLToastPanel(notification), mInventoryOffer(NULL) { - buildPanel(this, "panel_group_notify.xml"); + buildFromFile( "panel_group_notify.xml"); const LLSD& payload = notification->getPayload(); LLGroupData groupData; if (!gAgent.getGroupData(payload["group_id"].asUUID(),groupData)) diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index fc01b7f0d5..ffe6c80f32 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -51,7 +51,7 @@ LLToastIMPanel::LLToastIMPanel(LLToastIMPanel::Params &p) : LLToastPanel(p.notif mAvatarIcon(NULL), mAvatarName(NULL), mTime(NULL), mMessage(NULL), mGroupIcon(NULL) { - buildPanel(this, "panel_instant_message.xml"); + buildFromFile( "panel_instant_message.xml"); mGroupIcon = getChild<LLGroupIconCtrl>("group_icon"); mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 32e12035ee..0f22cb7778 100644 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -67,7 +67,7 @@ mNumButtons(0), mAddedDefaultBtn(false), mCloseNotificationOnDestroy(true) { - buildPanel(this, "panel_notification.xml"); + buildFromFile( "panel_notification.xml"); if(rect != LLRect::null) { this->setShape(rect); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 141d7d6b86..602e641fe8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7255,7 +7255,7 @@ void handle_load_from_xml(void*) { std::string filename = picker.getFirstFile(); LLFloater* floater = new LLFloater(LLSD()); - LLFloater::buildFloater(floater, filename, NULL); + floater->buildFromFile(filename); } } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c5dee710cb..ac45daf810 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -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(); - LLPanel::buildPanel(main_view, "main_view.xml"); + main_view->buildFromFile("main_view.xml"); main_view->setShape(full_window); getRootView()->addChild(main_view); |