From 2a8f55e99effd7bfaded2d49567b993e6a34e7df Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 14 Jan 2013 18:41:48 -0600 Subject: [PATCH] Updated gesture floater to use more modern (and actual working) method of adding list elements via xml. --- indra/llui/llscrolllistctrl.cpp | 27 ++++++++++++++----- .../xui/en-us/floater_preview_gesture.xml | 12 ++++----- .../xui/es/floater_preview_gesture.xml | 8 +++--- .../xui/fr/floater_preview_gesture.xml | 8 +++--- 4 files changed, 34 insertions(+), 21 deletions(-) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 0925bb785..38c9b67d7 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -3224,16 +3224,20 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) { - if (child->hasName("row")) + if (child->hasName("row") || child->hasName("rows")) { LLUUID id; - child->getAttributeUUID("id", id); - LLSD row; - - row["id"] = id; + std::string value; + child->getAttributeString("value",value); + bool id_found = child->getAttributeUUID("id", id); + if(id_found) + row["id"] = id; + else + row["id"] = value; S32 column_idx = 0; + bool explicit_column = false; LLXMLNodePtr row_child; for (row_child = child->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling()) { @@ -3255,15 +3259,24 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac row["columns"][column_idx]["font"] = font; row["columns"][column_idx]["font-style"] = font_style; column_idx++; + explicit_column = true; } } - scroll_list->addElement(row); + if(explicit_column) + scroll_list->addElement(row); + else + { + LLSD entry_id; + if(id_found) + entry_id = id; + scroll_list->addSimpleElement(value,ADD_BOTTOM,entry_id); + } } } std::string contents = node->getTextContents(); scroll_list->setCommentText(contents); - + return scroll_list; } diff --git a/indra/newview/skins/default/xui/en-us/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en-us/floater_preview_gesture.xml index c596107a5..c17398f9d 100644 --- a/indra/newview/skins/default/xui/en-us/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en-us/floater_preview_gesture.xml @@ -49,13 +49,13 @@ Steps: - - Animation -Sound -Chat -Wait - + + + + +