From b73beb6715011ca81d8d9febb8d6f109aa9f2e4c Mon Sep 17 00:00:00 2001 From: Mm Alder Date: Sun, 3 Jan 2010 14:33:06 -0500 Subject: VWR-14475 Load from XML is broken --- linden/indra/llui/lluictrlfactory.cpp | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index 983cc53..0074494 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp @@ -163,20 +163,24 @@ bool LLUICtrlFactory::getLayeredXMLNode(const std::string &xui_filename, LLXMLNo std::string full_filename = gDirUtilp->findSkinnedFilename(sXUIPaths.front(), xui_filename); if (full_filename.empty()) { - llwarns << "Couldn't find UI description file: " << sXUIPaths.front() + gDirUtilp->getDirDelimiter() + xui_filename << llendl; - return false; - } - - if (!LLXMLNode::parseFile(full_filename, root, NULL)) - { // try filename as passed in since sometimes we load an xml file from a user-supplied path - if (!LLXMLNode::parseFile(xui_filename, root, NULL)) + if (gDirUtilp->fileExists(xui_filename)) { - llwarns << "Problem reading UI description file: " << xui_filename << llendl; + full_filename = xui_filename; + } + else + { + llwarns << "Couldn't find UI description file: " << sXUIPaths.front() + gDirUtilp->getDirDelimiter() + xui_filename << llendl; return false; } } + if (!LLXMLNode::parseFile(full_filename, root, NULL)) + { + llwarns << "Problem reading UI description file: " << full_filename << llendl; + return false; + } + LLXMLNodePtr updateRoot; std::vector<std::string>::const_iterator itor; -- cgit v1.1 From c17d74a59f10ad1fb9f9a7da2811688ff2944afa Mon Sep 17 00:00:00 2001 From: Mm Alder Date: Sun, 3 Jan 2010 14:40:37 -0500 Subject: VWR-15310 Save to XML doesn't set proper XML tags --- linden/indra/llui/llbutton.cpp | 2 + linden/indra/llui/llcheckboxctrl.cpp | 3 +- linden/indra/llui/llcombobox.cpp | 29 ++++++++++ linden/indra/llui/llcombobox.h | 1 + linden/indra/llui/llfloater.cpp | 11 ++++ linden/indra/llui/llfloater.h | 1 + linden/indra/llui/lliconctrl.cpp | 2 + linden/indra/llui/lllineeditor.cpp | 12 +++++ linden/indra/llui/lllineeditor.h | 1 + linden/indra/llui/llmenugl.cpp | 82 +++++++++++++++++++++++++++-- linden/indra/llui/llmenugl.h | 5 ++ linden/indra/llui/llmultislider.cpp | 2 + linden/indra/llui/llmultisliderctrl.cpp | 2 + linden/indra/llui/llpanel.cpp | 45 +++++++++++++++- linden/indra/llui/llprogressbar.cpp | 10 ++++ linden/indra/llui/llprogressbar.h | 1 + linden/indra/llui/llradiogroup.cpp | 17 ++++-- linden/indra/llui/llradiogroup.h | 1 + linden/indra/llui/llscrollcontainer.cpp | 4 +- linden/indra/llui/llscrollingpanellist.cpp | 10 ++++ linden/indra/llui/llscrollingpanellist.h | 3 +- linden/indra/llui/llscrolllistctrl.cpp | 2 + linden/indra/llui/llslider.cpp | 9 ++++ linden/indra/llui/llsliderctrl.cpp | 2 + linden/indra/llui/llspinctrl.cpp | 2 + linden/indra/llui/lltabcontainer.cpp | 3 ++ linden/indra/llui/lltextbox.cpp | 2 + linden/indra/llui/lltexteditor.cpp | 2 + linden/indra/llui/lluictrlfactory.cpp | 9 ++++ linden/indra/llui/lluixmltags.h | 7 ++- linden/indra/llui/llview.cpp | 4 +- linden/indra/llui/llviewborder.cpp | 10 ++++ linden/indra/llui/llviewborder.h | 1 + linden/indra/newview/llcolorswatch.cpp | 2 + linden/indra/newview/llinventoryview.cpp | 2 + linden/indra/newview/lljoystickbutton.cpp | 26 ++++++--- linden/indra/newview/lljoystickbutton.h | 2 + linden/indra/newview/llnameeditor.cpp | 10 ++++ linden/indra/newview/llnameeditor.h | 1 + linden/indra/newview/llnamelistctrl.cpp | 2 + linden/indra/newview/lltexturectrl.cpp | 2 + linden/indra/newview/llviewertexteditor.cpp | 10 ++++ linden/indra/newview/llviewertexteditor.h | 1 + linden/indra/newview/llwebbrowserctrl.cpp | 10 ++++ linden/indra/newview/llwebbrowserctrl.h | 1 + 45 files changed, 345 insertions(+), 21 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/llui/llbutton.cpp b/linden/indra/llui/llbutton.cpp index 2c2c1c2..1a6c705 100644 --- a/linden/indra/llui/llbutton.cpp +++ b/linden/indra/llui/llbutton.cpp @@ -980,6 +980,8 @@ LLXMLNodePtr LLButton::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_BUTTON_TAG); + node->createChild("label", TRUE)->setStringValue(getLabelUnselected()); node->createChild("label_selected", TRUE)->setStringValue(getLabelSelected()); node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); diff --git a/linden/indra/llui/llcheckboxctrl.cpp b/linden/indra/llui/llcheckboxctrl.cpp index eda9467..c1daee7 100644 --- a/linden/indra/llui/llcheckboxctrl.cpp +++ b/linden/indra/llui/llcheckboxctrl.cpp @@ -298,12 +298,13 @@ void LLCheckBoxCtrl::resetDirty() } - // virtual LLXMLNodePtr LLCheckBoxCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_CHECK_BOX_CTRL_TAG); + node->createChild("label", TRUE)->setStringValue(mLabel->getText()); std::string control_name = mButton->getControlName(); diff --git a/linden/indra/llui/llcombobox.cpp b/linden/indra/llui/llcombobox.cpp index cbc67fe..ce75f03 100644 --- a/linden/indra/llui/llcombobox.cpp +++ b/linden/indra/llui/llcombobox.cpp @@ -120,6 +120,8 @@ LLXMLNodePtr LLComboBox::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_COMBO_BOX_TAG); + // Attributes node->createChild("allow_text_entry", TRUE)->setBoolValue(mAllowTextEntry); @@ -1172,6 +1174,33 @@ LLFlyoutButton::LLFlyoutButton( updateLayout(); } +// virtual +LLXMLNodePtr LLFlyoutButton::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLComboBox::getXML(); + + node->setName(LL_FLYOUT_BUTTON_TAG); + + LLXMLNodePtr child; + + for (child = node->getFirstChild(); child.notNull();) + { + if (child->hasName("combo_item")) + { + child->setName(LL_FLYOUT_BUTTON_ITEM_TAG); + + //setName does a delete and add, so we have to start over + child = node->getFirstChild(); + } + else + { + child = child->getNextSibling(); + } + } + + return node; +} + //static LLView* LLFlyoutButton::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/llui/llcombobox.h b/linden/indra/llui/llcombobox.h index 33e1baa..95ad17a 100644 --- a/linden/indra/llui/llcombobox.h +++ b/linden/indra/llui/llcombobox.h @@ -217,6 +217,7 @@ public: void setToggleState(BOOL state); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); static void onActionButtonClick(void *userdata); static void onSelectAction(LLUICtrl* ctrl, void *userdata); diff --git a/linden/indra/llui/llfloater.cpp b/linden/indra/llui/llfloater.cpp index defe200..8a03300 100644 --- a/linden/indra/llui/llfloater.cpp +++ b/linden/indra/llui/llfloater.cpp @@ -2513,6 +2513,15 @@ LLMultiFloater::LLMultiFloater( } +// virtual +LLXMLNodePtr LLMultiFloater::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLFloater::getXML(); + + node->setName(LL_MULTI_FLOATER_TAG); + + return node; +} void LLMultiFloater::open() /* Flawfinder: ignore */ { @@ -2936,6 +2945,8 @@ LLXMLNodePtr LLFloater::getXML(bool save_children) const { LLXMLNodePtr node = LLPanel::getXML(); + node->setName(LL_FLOATER_TAG); + node->createChild("title", TRUE)->setStringValue(getCurrentTitle()); node->createChild("can_resize", TRUE)->setBoolValue(isResizable()); diff --git a/linden/indra/llui/llfloater.h b/linden/indra/llui/llfloater.h index 0e3d148..12f878d 100644 --- a/linden/indra/llui/llfloater.h +++ b/linden/indra/llui/llfloater.h @@ -398,6 +398,7 @@ public: virtual ~LLMultiFloater() {}; virtual BOOL postBuild(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; /*virtual*/ void open(); /* Flawfinder: ignore */ /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void draw(); diff --git a/linden/indra/llui/lliconctrl.cpp b/linden/indra/llui/lliconctrl.cpp index cb3b2a3..e73c8fe 100644 --- a/linden/indra/llui/lliconctrl.cpp +++ b/linden/indra/llui/lliconctrl.cpp @@ -137,6 +137,8 @@ LLXMLNodePtr LLIconCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_ICON_CTRL_TAG); + if (mImageName != "") { node->createChild("image_name", TRUE)->setStringValue(mImageName); diff --git a/linden/indra/llui/lllineeditor.cpp b/linden/indra/llui/lllineeditor.cpp index fc33dcf..62759e6 100644 --- a/linden/indra/llui/lllineeditor.cpp +++ b/linden/indra/llui/lllineeditor.cpp @@ -2202,6 +2202,8 @@ LLXMLNodePtr LLLineEditor::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_LINE_EDITOR_TAG); + node->createChild("max_length", TRUE)->setIntValue(mMaxLengthBytes); node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mGLFont)); @@ -2791,6 +2793,16 @@ void LLSearchEditor::onClearSearch(void* user_data) } } +// virtual +LLXMLNodePtr LLSearchEditor::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_SEARCH_EDITOR_TAG); + + return node; +} + // static LLView* LLSearchEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/llui/lllineeditor.h b/linden/indra/llui/lllineeditor.h index a670b21..e488165 100644 --- a/linden/indra/llui/lllineeditor.h +++ b/linden/indra/llui/lllineeditor.h @@ -385,6 +385,7 @@ public: /*virtual*/ void draw(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setText(const LLStringExplicit &new_text) { mSearchEdit->setText(new_text); } diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 175bf07..b70f98b 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp @@ -154,6 +154,8 @@ LLXMLNodePtr LLMenuItemGL::getXML(bool save_children) const { LLXMLNodePtr node = LLView::getXML(); + node->setName(LL_MENU_ITEM_TAG); + node->createChild("type", TRUE)->setStringValue(getType()); node->createChild("label", TRUE)->setStringValue(mLabel); @@ -526,6 +528,8 @@ class LLMenuItemSeparatorGL : public LLMenuItemGL public: LLMenuItemSeparatorGL( const std::string &name = SEPARATOR_NAME ); + virtual LLXMLNodePtr getXML(bool save_children = true) const; + virtual std::string getType() const { return "separator"; } // doIt() - do the primary funcationality of the menu item. @@ -544,6 +548,16 @@ LLMenuItemSeparatorGL::LLMenuItemSeparatorGL( const std::string &name ) : { } + +LLXMLNodePtr LLMenuItemSeparatorGL::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLMenuItemGL::getXML(); + + node->setName(LL_MENU_ITEM_SEPARATOR_GL_TAG); + + return node; +} + void LLMenuItemSeparatorGL::draw( void ) { gGL.color4fv( getDisabledColor().mV ); @@ -624,6 +638,15 @@ LLMenuItemTearOffGL::LLMenuItemTearOffGL(LLHandle<LLFloater> parent_floater_hand } +LLXMLNodePtr LLMenuItemTearOffGL::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLMenuItemGL::getXML(); + + node->setName(LL_MENU_ITEM_TEAR_OFF_GL_TAG); + + return node; +} + void LLMenuItemTearOffGL::doIt() { if (getMenu()->getTornOff()) @@ -821,6 +844,8 @@ LLXMLNodePtr LLMenuItemCallGL::getXML(bool save_children) const { LLXMLNodePtr node = LLMenuItemGL::getXML(); + node->setName(LL_MENU_ITEM_CALL_GL_TAG); + // Contents std::vector<LLListenerEntry> listeners = mDispatcher->getListeners(); @@ -830,6 +855,9 @@ LLXMLNodePtr LLMenuItemCallGL::getXML(bool save_children) const std::string listener_name = findEventListener((LLSimpleListener*)itor->listener); if (!listener_name.empty()) { + // *FIX: It's not always on_click. It could be on_check, on_enable or on_visible, + // but there's no way to get that from the data that is stored. + LLXMLNodePtr child_node = node->createChild("on_click", FALSE); child_node->createChild("function", TRUE)->setStringValue(listener_name); child_node->createChild("filter", TRUE)->setStringValue(itor->filter.asString()); @@ -971,6 +999,9 @@ void LLMenuItemCheckGL::setCheckedControl(std::string checked_control, LLView *c LLXMLNodePtr LLMenuItemCheckGL::getXML(bool save_children) const { LLXMLNodePtr node = LLMenuItemCallGL::getXML(); + + node->setName(LL_MENU_ITEM_CHECK_GL_TAG); + return node; } @@ -1734,6 +1765,8 @@ LLXMLNodePtr LLMenuGL::getXML(bool save_children) const { LLXMLNodePtr node = LLView::getXML(); + node->setName(LL_MENU_GL_TAG); + // Attributes node->createChild("opaque", TRUE)->setBoolValue(mBgVisible); @@ -1904,7 +1937,11 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory LLSimpleListener* callback = parent->getListenerByName(callback_name); - if (!callback) continue; + if (!callback) + { + lldebugs << "Ignoring \"on_check\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + continue; + } new_item->addListener(callback, "on_build", userdata); } @@ -1945,7 +1982,11 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory LLSimpleListener* callback = parent->getListenerByName(callback_name); - if (!callback) continue; + if (!callback) + { + lldebugs << "Ignoring \"on_click\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + continue; + } new_item->addListener(callback, "on_click", callback_data); } @@ -1975,7 +2016,11 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory LLSimpleListener* callback = parent->getListenerByName(callback_name); - if (!callback) continue; + if (!callback) + { + lldebugs << "Ignoring \"on_enable\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + continue; + } new_item->addListener(callback, "on_build", userdata); } @@ -2015,7 +2060,11 @@ void LLMenuGL::parseChildXML(LLXMLNodePtr child, LLView *parent, LLUICtrlFactory LLSimpleListener* callback = parent->getListenerByName(callback_name); - if (!callback) continue; + if (!callback) + { + lldebugs << "Ignoring \"on_visible\" \"" << item_name << "\" because \"" << callback_name << "\" is not registered" << llendl; + continue; + } new_item->addListener(callback, "on_build", userdata); } @@ -3033,6 +3082,8 @@ class LLPieMenuBranch : public LLMenuItemGL public: LLPieMenuBranch(const std::string& name, const std::string& label, LLPieMenu* branch); + virtual LLXMLNodePtr getXML(bool save_children = true) const; + // called to rebuild the draw label virtual void buildDrawLabel( void ); @@ -3055,6 +3106,17 @@ LLPieMenuBranch::LLPieMenuBranch(const std::string& name, mBranch->setParentMenuItem(this); } +// virtual +LLXMLNodePtr LLPieMenuBranch::getXML(bool save_children) const +{ + if (mBranch) + { + return mBranch->getXML(); + } + + return LLMenuItemGL::getXML(); +} + // called to rebuild the draw label void LLPieMenuBranch::buildDrawLabel( void ) { @@ -3136,6 +3198,16 @@ LLPieMenu::LLPieMenu(const std::string& name) } +// virtual +LLXMLNodePtr LLPieMenu::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLMenuGL::getXML(); + + node->setName(LL_PIE_MENU_TAG); + + return node; +} + void LLPieMenu::initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory) { LLXMLNodePtr child; @@ -3837,6 +3909,8 @@ LLXMLNodePtr LLMenuBarGL::getXML(bool save_children) const LLXMLNodePtr node = LLMenuGL::getXML(); + node->setName(LL_MENU_BAR_GL_TAG); + for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { LLMenuItemGL* child = *item_iter; diff --git a/linden/indra/llui/llmenugl.h b/linden/indra/llui/llmenugl.h index 030b81b..26fc294 100644 --- a/linden/indra/llui/llmenugl.h +++ b/linden/indra/llui/llmenugl.h @@ -368,6 +368,9 @@ public: BOOL* toggle, KEY key = KEY_NONE, MASK mask = MASK_NONE ); + // there is no getXML() because we cannot reference the toggled global variable by XML + // use LLMenuItemCheckGL instead. + virtual std::string getType() const { return "toggle"; } // called to rebuild the draw label @@ -636,6 +639,7 @@ public: LLPieMenu(const std::string& name); virtual ~LLPieMenu() {} + virtual LLXMLNodePtr getXML(bool save_children = true) const; void initXML(LLXMLNodePtr node, LLView *context, LLUICtrlFactory *factory); // LLView Functionality @@ -800,6 +804,7 @@ class LLMenuItemTearOffGL : public LLMenuItemGL public: LLMenuItemTearOffGL( LLHandle<LLFloater> parent_floater_handle = LLHandle<LLFloater>()); + virtual LLXMLNodePtr getXML(bool save_children = true) const; virtual std::string getType() const { return "tearoff_menu"; } virtual void doIt(void); diff --git a/linden/indra/llui/llmultislider.cpp b/linden/indra/llui/llmultislider.cpp index c1487be..a0da4e2 100644 --- a/linden/indra/llui/llmultislider.cpp +++ b/linden/indra/llui/llmultislider.cpp @@ -571,6 +571,8 @@ LLXMLNodePtr LLMultiSlider::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_MULTI_SLIDER_TAG); + node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue()); node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); diff --git a/linden/indra/llui/llmultisliderctrl.cpp b/linden/indra/llui/llmultisliderctrl.cpp index 8bcf9f9..d871947 100644 --- a/linden/indra/llui/llmultisliderctrl.cpp +++ b/linden/indra/llui/llmultisliderctrl.cpp @@ -501,6 +501,8 @@ LLXMLNodePtr LLMultiSliderCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_MULTI_SLIDER_CTRL_TAG); + node->createChild("show_text", TRUE)->setBoolValue(mShowText); node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText); diff --git a/linden/indra/llui/llpanel.cpp b/linden/indra/llui/llpanel.cpp index 28780c7..709342b 100644 --- a/linden/indra/llui/llpanel.cpp +++ b/linden/indra/llui/llpanel.cpp @@ -402,7 +402,9 @@ void LLPanel::setBorderVisible(BOOL b) // virtual LLXMLNodePtr LLPanel::getXML(bool save_children) const { - LLXMLNodePtr node = LLView::getXML(); + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_PANEL_TAG); if (mBorder && mBorder->getVisible()) { @@ -418,6 +420,15 @@ LLXMLNodePtr LLPanel::getXML(bool save_children) const { node->createChild("label", TRUE)->setStringValue(mLabel); } + + ui_string_map_t::const_iterator i = mUIStrings.begin(); + ui_string_map_t::const_iterator end = mUIStrings.end(); + for (; i != end; ++i) + { + LLXMLNodePtr child_node = node->createChild("string", FALSE); + child_node->setStringValue(i->second); + child_node->createChild("name", TRUE)->setStringValue(i->first); + } if (save_children) { @@ -1171,6 +1182,38 @@ void LLLayoutStack::removeCtrl(LLUICtrl* ctrl) LLXMLNodePtr LLLayoutStack::getXML(bool save_children) const { LLXMLNodePtr node = LLView::getXML(); + node->setName(LL_LAYOUT_STACK_TAG); + + if (mOrientation == HORIZONTAL) + { + node->createChild("orientation", TRUE)->setStringValue("horizontal"); + } + else + { + node->createChild("orientation", TRUE)->setStringValue("vertical"); + } + + if (save_children) + { + LLView::child_list_const_reverse_iter_t rit; + for (rit = getChildList()->rbegin(); rit != getChildList()->rend(); ++rit) + { + LLView* childp = *rit; + + if (childp->getSaveToXML()) + { + LLXMLNodePtr xml_node = childp->getXML(); + + if (xml_node->hasName(LL_PANEL_TAG)) + { + xml_node->setName(LL_LAYOUT_PANEL_TAG); + } + + node->addChild(xml_node); + } + } + } + return node; } diff --git a/linden/indra/llui/llprogressbar.cpp b/linden/indra/llui/llprogressbar.cpp index 8833494..d148733 100644 --- a/linden/indra/llui/llprogressbar.cpp +++ b/linden/indra/llui/llprogressbar.cpp @@ -124,6 +124,16 @@ void LLProgressBar::setColorBackground(const LLColor4 &c) } +// virtual +LLXMLNodePtr LLProgressBar::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLView::getXML(); + + node->setName(LL_PROGRESS_BAR_TAG); + + return node; +} + // static LLView* LLProgressBar::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/llui/llprogressbar.h b/linden/indra/llui/llprogressbar.h index 00ad61d..5e02c3b 100644 --- a/linden/indra/llui/llprogressbar.h +++ b/linden/indra/llui/llprogressbar.h @@ -53,6 +53,7 @@ public: void setColorShadow(const LLColor4 &c); void setColorBackground(const LLColor4 &c); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); /*virtual*/ void draw(); diff --git a/linden/indra/llui/llradiogroup.cpp b/linden/indra/llui/llradiogroup.cpp index 33b9398..ad8922d 100644 --- a/linden/indra/llui/llradiogroup.cpp +++ b/linden/indra/llui/llradiogroup.cpp @@ -345,6 +345,8 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_RADIO_GROUP_TAG); + // Attributes node->createChild("draw_border", TRUE)->setBoolValue(mHasBorder); @@ -356,9 +358,7 @@ LLXMLNodePtr LLRadioGroup::getXML(bool save_children) const { LLRadioCtrl* radio = *iter; - LLXMLNodePtr child_node = radio->LLView::getXML(); - child_node->setStringValue(radio->getLabel()); - child_node->setName(std::string("radio_item")); + LLXMLNodePtr child_node = radio->getXML(); node->addChild(child_node); } @@ -515,3 +515,14 @@ void LLRadioCtrl::setValue(const LLSD& value) mButton->setTabStop(value.asBoolean()); } +// virtual +LLXMLNodePtr LLRadioCtrl::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLCheckBoxCtrl::getXML(); + + node->setName(LL_RADIO_ITEM_TAG); + + node->setStringValue(getLabel()); + + return node; +} diff --git a/linden/indra/llui/llradiogroup.h b/linden/indra/llui/llradiogroup.h index 3410b74..b4f65e7 100644 --- a/linden/indra/llui/llradiogroup.h +++ b/linden/indra/llui/llradiogroup.h @@ -52,6 +52,7 @@ public: } /*virtual*/ ~LLRadioCtrl(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; /*virtual*/ void setValue(const LLSD& value); }; diff --git a/linden/indra/llui/llscrollcontainer.cpp b/linden/indra/llui/llscrollcontainer.cpp index cf03259..6f037e2 100644 --- a/linden/indra/llui/llscrollcontainer.cpp +++ b/linden/indra/llui/llscrollcontainer.cpp @@ -679,7 +679,9 @@ S32 LLScrollableContainerView::getBorderWidth() const // virtual LLXMLNodePtr LLScrollableContainerView::getXML(bool save_children) const { - LLXMLNodePtr node = LLView::getXML(); + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_SCROLLABLE_CONTAINER_VIEW_TAG); // Attributes diff --git a/linden/indra/llui/llscrollingpanellist.cpp b/linden/indra/llui/llscrollingpanellist.cpp index 05d0c6f..c2afb78 100644 --- a/linden/indra/llui/llscrollingpanellist.cpp +++ b/linden/indra/llui/llscrollingpanellist.cpp @@ -139,6 +139,16 @@ void LLScrollingPanelList::draw() } +// virtual +LLXMLNodePtr LLScrollingPanelList::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_SCROLLING_PANEL_LIST_TAG); + + return node; +} + // static LLView* LLScrollingPanelList::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/llui/llscrollingpanellist.h b/linden/indra/llui/llscrollingpanellist.h index b9d7309..9660427 100644 --- a/linden/indra/llui/llscrollingpanellist.h +++ b/linden/indra/llui/llscrollingpanellist.h @@ -58,14 +58,13 @@ public: virtual void setValue(const LLSD& value) {}; - virtual LLXMLNodePtr getXML(bool save_children) const { return LLUICtrl::getXML(); } - virtual void draw(); void clearPanels(); void addPanel( LLScrollingPanel* panel ); void updatePanels(BOOL allow_modify); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); private: diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 460b29f..3c2293f 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp @@ -2713,6 +2713,8 @@ LLXMLNodePtr LLScrollListCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_SCROLL_LIST_CTRL_TAG); + // Attributes node->createChild("multi_select", TRUE)->setBoolValue(mAllowMultipleSelection); diff --git a/linden/indra/llui/llslider.cpp b/linden/indra/llui/llslider.cpp index 4dfc904..7b4da9b 100644 --- a/linden/indra/llui/llslider.cpp +++ b/linden/indra/llui/llslider.cpp @@ -291,6 +291,15 @@ LLXMLNodePtr LLSlider::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + if (mVolumeSlider) + { + node->setName(LL_VOLUME_SLIDER_CTRL_TAG); + } + else + { + node->setName(LL_SLIDER_TAG); + } + node->createChild("initial_val", TRUE)->setFloatValue(getInitialValue()); node->createChild("min_val", TRUE)->setFloatValue(getMinValue()); node->createChild("max_val", TRUE)->setFloatValue(getMaxValue()); diff --git a/linden/indra/llui/llsliderctrl.cpp b/linden/indra/llui/llsliderctrl.cpp index 31baddd..8a13ed4 100644 --- a/linden/indra/llui/llsliderctrl.cpp +++ b/linden/indra/llui/llsliderctrl.cpp @@ -419,6 +419,8 @@ LLXMLNodePtr LLSliderCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_SLIDER_CTRL_TAG); + node->createChild("show_text", TRUE)->setBoolValue(mShowText); node->createChild("can_edit_text", TRUE)->setBoolValue(mCanEditText); diff --git a/linden/indra/llui/llspinctrl.cpp b/linden/indra/llui/llspinctrl.cpp index 2f531a2..2992f98 100644 --- a/linden/indra/llui/llspinctrl.cpp +++ b/linden/indra/llui/llspinctrl.cpp @@ -483,6 +483,8 @@ LLXMLNodePtr LLSpinCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_SPIN_CTRL_TAG); + node->createChild("decimal_digits", TRUE)->setIntValue(mPrecision); if (mLabelBox) diff --git a/linden/indra/llui/lltabcontainer.cpp b/linden/indra/llui/lltabcontainer.cpp index f416948..1f94191 100644 --- a/linden/indra/llui/lltabcontainer.cpp +++ b/linden/indra/llui/lltabcontainer.cpp @@ -620,6 +620,9 @@ BOOL LLTabContainer::handleKeyHere(KEY key, MASK mask) LLXMLNodePtr LLTabContainer::getXML(bool save_children) const { LLXMLNodePtr node = LLPanel::getXML(); + + node->setName(LL_TAB_CONTAINER_COMMON_TAG); + node->createChild("tab_position", TRUE)->setStringValue((getTabPosition() == TOP ? "top" : "bottom")); return node; } diff --git a/linden/indra/llui/lltextbox.cpp b/linden/indra/llui/lltextbox.cpp index 89893bc..e45716f 100644 --- a/linden/indra/llui/lltextbox.cpp +++ b/linden/indra/llui/lltextbox.cpp @@ -386,6 +386,8 @@ LLXMLNodePtr LLTextBox::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_TEXT_BOX_TAG); + // Attributes node->createChild("font", TRUE)->setStringValue(LLFontGL::nameFromFont(mFontGL)); node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(mHAlign)); diff --git a/linden/indra/llui/lltexteditor.cpp b/linden/indra/llui/lltexteditor.cpp index 32106f1..7c05239 100644 --- a/linden/indra/llui/lltexteditor.cpp +++ b/linden/indra/llui/lltexteditor.cpp @@ -4296,6 +4296,8 @@ LLXMLNodePtr LLTextEditor::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_SIMPLE_TEXT_EDITOR_TAG); + // Attributes node->createChild("max_length", TRUE)->setIntValue(getMaxLength()); diff --git a/linden/indra/llui/lluictrlfactory.cpp b/linden/indra/llui/lluictrlfactory.cpp index 0074494..07eb39b 100644 --- a/linden/indra/llui/lluictrlfactory.cpp +++ b/linden/indra/llui/lluictrlfactory.cpp @@ -86,6 +86,15 @@ public: LLUICtrlLocate() : LLUICtrl(std::string("locate"), LLRect(0,0,0,0), FALSE, NULL, NULL) { setTabStop(FALSE); } virtual void draw() { } + virtual LLXMLNodePtr getXML(bool save_children = true) const + { + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_UI_CTRL_LOCATE_TAG); + + return node; + } + static LLView *fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("pad"); diff --git a/linden/indra/llui/lluixmltags.h b/linden/indra/llui/lluixmltags.h index 0456666..4166131 100644 --- a/linden/indra/llui/lluixmltags.h +++ b/linden/indra/llui/lluixmltags.h @@ -122,5 +122,10 @@ const std::string LL_JOYSTICK_TURN("joystick_turn"), LL_GROUP_DROP_TARGET_TAG("group_drop_target"), LL_LAYOUT_STACK_TAG("layout_stack"), - LL_FLYOUT_BUTTON_TAG("flyout_button"); + LL_LAYOUT_PANEL_TAG("layout_panel"), + LL_FLYOUT_BUTTON_TAG("flyout_button"), + LL_FLYOUT_BUTTON_ITEM_TAG("flyout_button_item"), + LL_SIMPLE_TEXT_EDITOR_TAG("simple_text_editor"), + LL_RADIO_ITEM_TAG("radio_item"), + LL_PROGRESS_BAR_TAG("progress_bar"); #endif diff --git a/linden/indra/llui/llview.cpp b/linden/indra/llui/llview.cpp index 36bc850..8de376f 100644 --- a/linden/indra/llui/llview.cpp +++ b/linden/indra/llui/llview.cpp @@ -1943,7 +1943,7 @@ BOOL LLView::localRectToOtherView( const LLRect& local, LLRect* other, LLView* o // virtual LLXMLNodePtr LLView::getXML(bool save_children) const { - //FIXME: need to provide actual derived type tag, probably outside this method + //If called from a derived class, the derived class will override the node name LLXMLNodePtr node = new LLXMLNode("view", FALSE); node->createChild("name", TRUE)->setStringValue(getName()); @@ -2353,6 +2353,8 @@ LLView* LLView::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESna void LLView::registerEventListener(std::string name, LLSimpleListener* function) { mDispatchList.insert(std::pair<std::string, LLSimpleListener*>(name, function)); + lldebugs << getName() << " registered " << name << llendl; + } void LLView::deregisterEventListener(std::string name) diff --git a/linden/indra/llui/llviewborder.cpp b/linden/indra/llui/llviewborder.cpp index d4a9e9d..47323e2 100644 --- a/linden/indra/llui/llviewborder.cpp +++ b/linden/indra/llui/llviewborder.cpp @@ -303,6 +303,16 @@ BOOL LLViewBorder::getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel } +// virtual +LLXMLNodePtr LLViewBorder::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLView::getXML(); + + node->setName(LL_VIEW_BORDER_TAG); + + return node; +} + // static LLView* LLViewBorder::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/llui/llviewborder.h b/linden/indra/llui/llviewborder.h index a40e653..1d80b6b 100644 --- a/linden/indra/llui/llviewborder.h +++ b/linden/indra/llui/llviewborder.h @@ -51,6 +51,7 @@ public: // llview functionality virtual void draw(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, class LLUICtrlFactory *factory); static BOOL getBevelFromAttribute(LLXMLNodePtr node, LLViewBorder::EBevel& bevel_style); diff --git a/linden/indra/newview/llcolorswatch.cpp b/linden/indra/newview/llcolorswatch.cpp index 5f8d9ed..3222c0d 100644 --- a/linden/indra/newview/llcolorswatch.cpp +++ b/linden/indra/newview/llcolorswatch.cpp @@ -348,6 +348,8 @@ LLXMLNodePtr LLColorSwatchCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_COLOR_SWATCH_CTRL_TAG); + node->createChild("color", TRUE)->setFloatValue(4, mColor.mV); node->createChild("border_color", TRUE)->setFloatValue(4, mBorderColor.mV); diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index f0bfa00..97df7a3 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp @@ -1654,6 +1654,8 @@ LLXMLNodePtr LLInventoryPanel::getXML(bool save_children) const { LLXMLNodePtr node = LLPanel::getXML(false); // Do not print out children + node->setName(LL_INVENTORY_PANEL_TAG); + node->createChild("allow_multi_select", TRUE)->setBoolValue(mFolders->getAllowMultiSelect()); return node; diff --git a/linden/indra/newview/lljoystickbutton.cpp b/linden/indra/newview/lljoystickbutton.cpp index 326c511..05c5e41 100644 --- a/linden/indra/newview/lljoystickbutton.cpp +++ b/linden/indra/newview/lljoystickbutton.cpp @@ -248,16 +248,10 @@ EJoystickQuadrant LLJoystick::quadrantFromName(const std::string& sQuadrant) LLXMLNodePtr LLJoystick::getXML(bool save_children) const { - LLXMLNodePtr node = LLUICtrl::getXML(); + LLXMLNodePtr node = LLButton::getXML(); - node->createChild("halign", TRUE)->setStringValue(LLFontGL::nameFromHAlign(getHAlign())); node->createChild("quadrant", TRUE)->setStringValue(nameFromQuadrant(mInitialQuadrant)); - - addImageAttributeToXML(node,getImageUnselectedName(),getImageUnselectedID(),std::string("image_unselected")); - addImageAttributeToXML(node,getImageSelectedName(),getImageSelectedID(),std::string("image_selected")); - node->createChild("scale_image", TRUE)->setBoolValue(getScaleImage()); - return node; } @@ -327,6 +321,15 @@ void LLJoystickAgentTurn::onHeldDown() } } +LLXMLNodePtr LLJoystickAgentTurn::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLJoystick::getXML(); + + node->setName(LL_JOYSTICK_TURN); + + return node; +} + LLView* LLJoystickAgentTurn::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("button"); @@ -435,6 +438,15 @@ void LLJoystickAgentSlide::onHeldDown() } +LLXMLNodePtr LLJoystickAgentSlide::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLJoystick::getXML(); + + node->setName(LL_JOYSTICK_SLIDE); + + return node; +} + // static LLView* LLJoystickAgentSlide::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { diff --git a/linden/indra/newview/lljoystickbutton.h b/linden/indra/newview/lljoystickbutton.h index 076a506..b26851f 100644 --- a/linden/indra/newview/lljoystickbutton.h +++ b/linden/indra/newview/lljoystickbutton.h @@ -97,6 +97,7 @@ public: virtual void onHeldDown(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); }; @@ -114,6 +115,7 @@ public: virtual void onHeldDown(); virtual void onMouseUp(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); }; diff --git a/linden/indra/newview/llnameeditor.cpp b/linden/indra/newview/llnameeditor.cpp index e4a6573..5997369 100644 --- a/linden/indra/newview/llnameeditor.cpp +++ b/linden/indra/newview/llnameeditor.cpp @@ -141,6 +141,16 @@ LLSD LLNameEditor::getValue() const return LLSD(mNameID); } +// virtual +LLXMLNodePtr LLNameEditor::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLLineEditor::getXML(); + + node->setName(LL_NAME_EDITOR_TAG); + + return node; +} + LLView* LLNameEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("name_editor"); diff --git a/linden/indra/newview/llnameeditor.h b/linden/indra/newview/llnameeditor.h index bc5a678..964682c 100644 --- a/linden/indra/newview/llnameeditor.h +++ b/linden/indra/newview/llnameeditor.h @@ -62,6 +62,7 @@ public: virtual ~LLNameEditor(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); void setNameID(const LLUUID& name_id, BOOL is_group); diff --git a/linden/indra/newview/llnamelistctrl.cpp b/linden/indra/newview/llnamelistctrl.cpp index baf0656..453cf7f 100644 --- a/linden/indra/newview/llnamelistctrl.cpp +++ b/linden/indra/newview/llnamelistctrl.cpp @@ -288,6 +288,8 @@ LLXMLNodePtr LLNameListCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLScrollListCtrl::getXML(); + node->setName(LL_NAME_LIST_CTRL_TAG); + node->createChild("allow_calling_card_drop", TRUE)->setBoolValue(mAllowCallingCardDrop); if (mNameColumnIndex != 0) diff --git a/linden/indra/newview/lltexturectrl.cpp b/linden/indra/newview/lltexturectrl.cpp index c4ea71e..5500973 100644 --- a/linden/indra/newview/lltexturectrl.cpp +++ b/linden/indra/newview/lltexturectrl.cpp @@ -969,6 +969,8 @@ LLXMLNodePtr LLTextureCtrl::getXML(bool save_children) const { LLXMLNodePtr node = LLUICtrl::getXML(); + node->setName(LL_TEXTURE_CTRL_TAG); + node->createChild("label", TRUE)->setStringValue(getLabel()); node->createChild("default_image_name", TRUE)->setStringValue(getDefaultImageName()); diff --git a/linden/indra/newview/llviewertexteditor.cpp b/linden/indra/newview/llviewertexteditor.cpp index 296c540..e5e2cd6 100644 --- a/linden/indra/newview/llviewertexteditor.cpp +++ b/linden/indra/newview/llviewertexteditor.cpp @@ -1555,6 +1555,16 @@ BOOL LLViewerTextEditor::exportBuffer( std::string& buffer ) return TRUE; } +// virtual +LLXMLNodePtr LLViewerTextEditor::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLTextEditor::getXML(); + + node->setName(LL_TEXT_EDITOR_TAG); + + return node; +} + LLView* LLViewerTextEditor::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("text_editor"); diff --git a/linden/indra/newview/llviewertexteditor.h b/linden/indra/newview/llviewertexteditor.h index f29caee..c69b3f0 100644 --- a/linden/indra/newview/llviewertexteditor.h +++ b/linden/indra/newview/llviewertexteditor.h @@ -54,6 +54,7 @@ public: virtual void makePristine(); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); // mousehandler overrides diff --git a/linden/indra/newview/llwebbrowserctrl.cpp b/linden/indra/newview/llwebbrowserctrl.cpp index 89cb62b..453b9d2 100644 --- a/linden/indra/newview/llwebbrowserctrl.cpp +++ b/linden/indra/newview/llwebbrowserctrl.cpp @@ -1012,6 +1012,16 @@ void LLWebBrowserTexture::resize( S32 new_width, S32 new_height ) mLastBrowserDepth = media_depth; } +// virtual +LLXMLNodePtr LLWebBrowserCtrl::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLUICtrl::getXML(); + + node->setName(LL_WEB_BROWSER_CTRL_TAG); + + return node; +} + LLView* LLWebBrowserCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) { std::string name("web_browser"); diff --git a/linden/indra/newview/llwebbrowserctrl.h b/linden/indra/newview/llwebbrowserctrl.h index 0f46aa1..0100807 100644 --- a/linden/indra/newview/llwebbrowserctrl.h +++ b/linden/indra/newview/llwebbrowserctrl.h @@ -191,6 +191,7 @@ class LLWebBrowserCtrl : // Defaults to true. void setTakeFocusOnClick( bool take_focus ); + virtual LLXMLNodePtr getXML(bool save_children = true) const; static LLView* fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory); // handle mouse related methods -- cgit v1.1 From efbba781aaf126e91b3239c0c985b5906a09127a Mon Sep 17 00:00:00 2001 From: Mm Alder Date: Sun, 3 Jan 2010 14:44:13 -0500 Subject: VWR-4232 Some particles don't disappear when UI is hidden --- linden/indra/newview/llhudeffectbeam.cpp | 5 +++++ linden/indra/newview/llhudeffectbeam.h | 1 + linden/indra/newview/llhudeffecttrail.cpp | 5 +++++ linden/indra/newview/llhudeffecttrail.h | 1 + linden/indra/newview/llhudobject.cpp | 21 +++++++++++++++++++++ linden/indra/newview/llhudobject.h | 2 ++ linden/indra/newview/pipeline.cpp | 23 ++++++++++++++++++----- 7 files changed, 53 insertions(+), 5 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llhudeffectbeam.cpp b/linden/indra/newview/llhudeffectbeam.cpp index 6cb3bef..a7c1214 100644 --- a/linden/indra/newview/llhudeffectbeam.cpp +++ b/linden/indra/newview/llhudeffectbeam.cpp @@ -312,6 +312,11 @@ void LLHUDEffectBeam::render() } } +void LLHUDEffectBeam::renderForTimer() +{ + render(); +} + void LLHUDEffectBeam::setupParticle(const S32 i) { LLVector3d start_pos_global; diff --git a/linden/indra/newview/llhudeffectbeam.h b/linden/indra/newview/llhudeffectbeam.h index 7365894..69e2b51 100644 --- a/linden/indra/newview/llhudeffectbeam.h +++ b/linden/indra/newview/llhudeffectbeam.h @@ -58,6 +58,7 @@ protected: ~LLHUDEffectBeam(); /*virtual*/ void render(); + /*virtual*/ void renderForTimer(); /*virtual*/ void packData(LLMessageSystem *mesgsys); /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); private: diff --git a/linden/indra/newview/llhudeffecttrail.cpp b/linden/indra/newview/llhudeffecttrail.cpp index 32b52f8..08f4c78 100644 --- a/linden/indra/newview/llhudeffecttrail.cpp +++ b/linden/indra/newview/llhudeffecttrail.cpp @@ -287,3 +287,8 @@ void LLHUDEffectSpiral::render() return; } } + +void LLHUDEffectSpiral::renderForTimer() +{ + render(); +} diff --git a/linden/indra/newview/llhudeffecttrail.h b/linden/indra/newview/llhudeffecttrail.h index 60836c2..033fbeb 100644 --- a/linden/indra/newview/llhudeffecttrail.h +++ b/linden/indra/newview/llhudeffecttrail.h @@ -68,6 +68,7 @@ protected: ~LLHUDEffectSpiral(); /*virtual*/ void render(); + /*virtual*/ void renderForTimer(); /*virtual*/ void packData(LLMessageSystem *mesgsys); /*virtual*/ void unpackData(LLMessageSystem *mesgsys, S32 blocknum); private: diff --git a/linden/indra/newview/llhudobject.cpp b/linden/indra/newview/llhudobject.cpp index bdff492..ea6e0bf 100644 --- a/linden/indra/newview/llhudobject.cpp +++ b/linden/indra/newview/llhudobject.cpp @@ -308,6 +308,27 @@ void LLHUDObject::renderAllForSelect() } // static +void LLHUDObject::renderAllForTimer() +{ + LLHUDObject *hud_objp; + + hud_object_list_t::iterator object_it; + for (object_it = sHUDObjects.begin(); object_it != sHUDObjects.end(); ) + { + hud_object_list_t::iterator cur_it = object_it++; + hud_objp = (*cur_it); + if (hud_objp->getNumRefs() == 1) + { + sHUDObjects.erase(cur_it); + } + else if (hud_objp->isVisible()) + { + hud_objp->renderForTimer(); + } + } +} + +// static void LLHUDObject::sortObjects() { sHUDObjects.sort(hud_object_further_away()); diff --git a/linden/indra/newview/llhudobject.h b/linden/indra/newview/llhudobject.h index 2cd8abf..84c2f84 100644 --- a/linden/indra/newview/llhudobject.h +++ b/linden/indra/newview/llhudobject.h @@ -75,6 +75,7 @@ public: static void updateAll(); static void renderAll(); static void renderAllForSelect(); + static void renderAllForTimer(); static void cleanupHUDObjects(); @@ -106,6 +107,7 @@ protected: virtual void render() = 0; virtual void renderForSelect() {}; + virtual void renderForTimer() {}; protected: U8 mType; diff --git a/linden/indra/newview/pipeline.cpp b/linden/indra/newview/pipeline.cpp index 4ea9e41..d3ee8b6 100644 --- a/linden/indra/newview/pipeline.cpp +++ b/linden/indra/newview/pipeline.cpp @@ -2724,12 +2724,20 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); - if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + if (!LLPipeline::sReflectionRender && !LLPipeline::sRenderDeferred) { - // Render debugging beacons. - gObjectList.renderObjectBeacons(); - LLHUDObject::renderAll(); - gObjectList.resetObjectBeacons(); + if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) + { + // Render debugging beacons. + gObjectList.renderObjectBeacons(); + LLHUDObject::renderAll(); + gObjectList.resetObjectBeacons(); + } + else + { + // Make sure particle effects disappear + LLHUDObject::renderAllForTimer(); + } } LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderGeomEnd"); @@ -2954,6 +2962,11 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) LLHUDObject::renderAll(); gObjectList.resetObjectBeacons(); } + else + { + // Make sure particle effects disappear + LLHUDObject::renderAllForTimer(); + } if (occlude) { -- cgit v1.1 From 1c28af54addf5673f06cb2e992ccbe1173a0509b Mon Sep 17 00:00:00 2001 From: Mm Alder Date: Sun, 3 Jan 2010 15:00:06 -0500 Subject: SNOW-376 Clean up handling of the maximum length of chat messages --- linden/indra/newview/llchatbar.cpp | 8 ++++++-- linden/indra/newview/llimpanel.cpp | 2 +- linden/indra/newview/llvoavatar.cpp | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'linden/indra') diff --git a/linden/indra/newview/llchatbar.cpp b/linden/indra/newview/llchatbar.cpp index 44d1ad1..1146c44 100644 --- a/linden/indra/newview/llchatbar.cpp +++ b/linden/indra/newview/llchatbar.cpp @@ -154,7 +154,7 @@ BOOL LLChatBar::postBuild() mInputEditor->setPassDelete(TRUE); mInputEditor->setReplaceNewlinesWithSpaces(FALSE); - mInputEditor->setMaxTextLength(1023); + mInputEditor->setMaxTextLength(DB_CHAT_MSG_STR_LEN); mInputEditor->setEnableLineHistory(TRUE); } @@ -624,8 +624,12 @@ void LLChatBar::sendChatFromViewer(const LLWString &wtext, EChatType type, BOOL LLWString out_text = stripChannelNumber(wtext, &channel); std::string utf8_out_text = wstring_to_utf8str(out_text); - std::string utf8_text = wstring_to_utf8str(wtext); + if (!utf8_out_text.empty()) + { + utf8_out_text = utf8str_truncate(utf8_out_text, MAX_MSG_STR_LEN); + } + std::string utf8_text = wstring_to_utf8str(wtext); utf8_text = utf8str_trim(utf8_text); if (!utf8_text.empty()) { diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index a5950ce..326694a 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp @@ -1197,7 +1197,7 @@ void LLFloaterIMPanel::init(const std::string& session_label) setTitle(mSessionLabel); - mInputEditor->setMaxTextLength(1023); + mInputEditor->setMaxTextLength(DB_IM_MSG_STR_LEN); // enable line history support for instant message bar mInputEditor->setEnableLineHistory(TRUE); diff --git a/linden/indra/newview/llvoavatar.cpp b/linden/indra/newview/llvoavatar.cpp index 7e1c6ca..afee0a1 100644 --- a/linden/indra/newview/llvoavatar.cpp +++ b/linden/indra/newview/llvoavatar.cpp @@ -169,7 +169,7 @@ const F32 TIME_BEFORE_MESH_CLEANUP = 5.f; // seconds const S32 AVATAR_RELEASE_THRESHOLD = 10; // number of avatar instances before releasing memory const F32 FOOT_GROUND_COLLISION_TOLERANCE = 0.25f; const F32 AVATAR_LOD_TWEAK_RANGE = 0.7f; -const S32 MAX_BUBBLE_CHAT_LENGTH = 1023; +const S32 MAX_BUBBLE_CHAT_LENGTH = DB_CHAT_MSG_STR_LEN; const S32 MAX_BUBBLE_CHAT_UTTERANCES = 12; const F32 CHAT_FADE_TIME = 8.0; const F32 BUBBLE_CHAT_TIME = CHAT_FADE_TIME * 3.f; -- cgit v1.1 From 9cbad86ad87780232b14e1d0bd0b6da81665e6de Mon Sep 17 00:00:00 2001 From: Mm Alder Date: Sun, 3 Jan 2010 15:02:59 -0500 Subject: SNOW-413 Potential null pointer exception in multi-slider control --- linden/indra/llui/llmultisliderctrl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linden/indra') diff --git a/linden/indra/llui/llmultisliderctrl.cpp b/linden/indra/llui/llmultisliderctrl.cpp index d871947..b76c2f6 100644 --- a/linden/indra/llui/llmultisliderctrl.cpp +++ b/linden/indra/llui/llmultisliderctrl.cpp @@ -132,7 +132,7 @@ LLMultiSliderCtrl::LLMultiSliderCtrl(const std::string& name, const LLRect& rect &LLLineEditor::prevalidateFloat ); mEditor->setFollowsLeft(); mEditor->setFollowsBottom(); - mEditor->setFocusReceivedCallback( &LLMultiSliderCtrl::onEditorGainFocus ); + mEditor->setFocusReceivedCallback( &LLMultiSliderCtrl::onEditorGainFocus, this ); mEditor->setIgnoreTab(TRUE); // don't do this, as selecting the entire text is single clicking in some cases // and double clicking in others -- cgit v1.1