From a3a4a0c62c6dae6635fd6de7c46658ad5ab17e5f Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Mon, 21 Jun 2010 14:23:07 +0300 Subject: EXT-7821 ADDITIONAL FIX max_length was changed Inventory names should be limited to 63 characters Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/608/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_edit_wearable.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml index 3106ed34ff..00c5325039 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_wearable.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_wearable.xml @@ -230,7 +230,7 @@ left="0" height="23" layout="topleft" left="10" - max_length="300" + max_length="63" name="description" prevalidate_callback="ascii" text_color="black" -- cgit v1.2.3 From 5fcdff31253231c6a63fe05560be9a65fb0de575 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 21 Jun 2010 14:34:08 +0300 Subject: EXT-7797 FIXED Outfit Editor: Clicking fliter button should set focus in filter field - Set focus on filter field Reviewed by Mike Antipov and Neal Orman at https://codereview.productengine.com/secondlife/r/598/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 5fac7efb84..7a588193c8 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -452,6 +452,10 @@ void LLPanelOutfitEdit::showWearablesFilter() mSearchFilter->clear(); onSearchEdit(LLStringUtil::null); } + else + { + mSearchFilter->setFocus(TRUE); + } } void LLPanelOutfitEdit::showWearablesListView() -- cgit v1.2.3 From fc3c0cfcc88c11291512991d670ab848a2226887 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 21 Jun 2010 14:34:47 +0300 Subject: EXT-7878 FIXED Corrupted vertical scroll bar appears on 'Edit Outfit' panel if height of 'Add More' panel was changed - Increased width of layout panel and its accordion Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/621/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 1ed73e6c15..80fbb66ff4 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -168,7 +168,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap Date: Mon, 21 Jun 2010 15:14:42 +0300 Subject: EXT-7822 WIP changed the default plus button action from add to replace Reviewed by Neal Orman at https://codereview.productengine.com/secondlife/r/617 --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 7 ++++--- indra/newview/llpaneloutfitedit.h | 2 +- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 7a588193c8..6b5eb23a9b 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -371,7 +371,7 @@ BOOL LLPanelOutfitEdit::postBuild() childSetAction("show_add_wearables_btn", boost::bind(&LLPanelOutfitEdit::onAddMoreButtonClicked, this)); - childSetAction("add_to_outfit_btn", boost::bind(&LLPanelOutfitEdit::onAddToOutfitClicked, this)); + childSetAction("plus_btn", boost::bind(&LLPanelOutfitEdit::onPlusBtnClicked, this)); mEditWearableBtn = getChild("edit_wearable_btn"); mEditWearableBtn->setEnabled(FALSE); @@ -557,7 +557,7 @@ void LLPanelOutfitEdit::onSearchEdit(const std::string& string) } -void LLPanelOutfitEdit::onAddToOutfitClicked(void) +void LLPanelOutfitEdit::onPlusBtnClicked(void) { LLUUID selected_id; if (mInventoryItemsPanel->getVisible()) @@ -577,7 +577,8 @@ void LLPanelOutfitEdit::onAddToOutfitClicked(void) if (selected_id.isNull()) return; - LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id); + //replacing instead of adding the item + LLAppearanceMgr::getInstance()->wearItemOnAvatar(selected_id, true, true); } void LLPanelOutfitEdit::onAddWearableClicked(void) diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 484f3fcb9f..f449fbca27 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -146,7 +146,7 @@ public: void onListViewFilterCommitted(LLUICtrl* ctrl); void onSearchEdit(const std::string& string); void onInventorySelectionChange(const std::deque &items, BOOL user_action); - void onAddToOutfitClicked(void); + void onPlusBtnClicked(void); void applyFolderViewFilter(EFolderViewItemType type); void applyListViewFilter(EListViewItemType type); diff --git a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml index 80fbb66ff4..819ba7f878 100644 --- a/indra/newview/skins/default/xui/en/panel_outfit_edit.xml +++ b/indra/newview/skins/default/xui/en/panel_outfit_edit.xml @@ -459,7 +459,7 @@ It is calculated as border_size + 2*UIResizeBarOverlap label="" layout="topleft" left_pad="1" - name="add_to_outfit_btn" + name="plus_btn" top="1" width="31" /> Date: Sat, 19 Jun 2010 00:03:44 +0300 Subject: EXT-7609 FIXED item title font size. - Moved inventory list item panel to a separate file. - Added xui customizable styles for wearable list items. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/551/. --HG-- branch : product-engine --- indra/newview/CMakeLists.txt | 2 + indra/newview/llinventoryitemslist.cpp | 337 +----------------- indra/newview/llinventoryitemslist.h | 180 ---------- indra/newview/llinventorylistitem.cpp | 388 +++++++++++++++++++++ indra/newview/llinventorylistitem.h | 235 +++++++++++++ indra/newview/llwearableitemslist.cpp | 20 +- indra/newview/llwearableitemslist.h | 8 +- .../default/xui/en/widgets/inventory_list_item.xml | 18 + 8 files changed, 659 insertions(+), 529 deletions(-) create mode 100644 indra/newview/llinventorylistitem.cpp create mode 100644 indra/newview/llinventorylistitem.h create mode 100644 indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 24811db3cb..c1b2d680be 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -260,6 +260,7 @@ set(viewer_SOURCE_FILES llinventoryfunctions.cpp llinventoryicon.cpp llinventoryitemslist.cpp + llinventorylistitem.cpp llinventorymodel.cpp llinventorymodelbackgroundfetch.cpp llinventoryobserver.cpp @@ -783,6 +784,7 @@ set(viewer_HEADER_FILES llinventoryfunctions.h llinventoryicon.h llinventoryitemslist.h + llinventorylistitem.h llinventorymodel.h llinventorymodelbackgroundfetch.h llinventoryobserver.h diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 14de5442d6..fbb3774917 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -3,8 +3,6 @@ * @brief A list of inventory items represented by LLFlatListView. * * Class LLInventoryItemsList implements a flat list of inventory items. - * Class LLPanelInventoryListItem displays inventory item as an element - * of LLInventoryItemsList. * * $LicenseInfo:firstyear=2010&license=viewergpl$ * @@ -40,341 +38,12 @@ // llcommon #include "llcommonutils.h" -// llui -#include "lliconctrl.h" -#include "lltextutil.h" +#include "lltrans.h" #include "llcallbacklist.h" -#include "llinventoryfunctions.h" +#include "llinventorylistitem.h" #include "llinventorymodel.h" -#include "lltrans.h" - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// - -static const S32 WIDGET_SPACING = 3; - -LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) -{ - LLPanelInventoryListItemBase* list_item = NULL; - if (item) - { - list_item = new LLPanelInventoryListItemBase(item); - list_item->init(); - } - return list_item; -} - -void LLPanelInventoryListItemBase::draw() -{ - if (getNeedsRefresh()) - { - if (mItem) - { - updateItem(mItem->getName()); - } - setNeedsRefresh(false); - } - LLPanel::draw(); -} - -// virtual -void LLPanelInventoryListItemBase::updateItem(const std::string& name, - const LLStyle::Params& input_params) -{ - setIconImage(mIconImage); - setTitle(name, mHighlightedText, input_params); -} - -void LLPanelInventoryListItemBase::addWidgetToLeftSide(const std::string& name, bool show_widget/* = true*/) -{ - LLUICtrl* ctrl = findChild(name); - if(ctrl) - { - addWidgetToLeftSide(ctrl, show_widget); - } -} - -void LLPanelInventoryListItemBase::addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget/* = true*/) -{ - mLeftSideWidgets.push_back(ctrl); - setShowWidget(ctrl, show_widget); -} - -void LLPanelInventoryListItemBase::addWidgetToRightSide(const std::string& name, bool show_widget/* = true*/) -{ - LLUICtrl* ctrl = findChild(name); - if(ctrl) - { - addWidgetToRightSide(ctrl, show_widget); - } -} - -void LLPanelInventoryListItemBase::addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget/* = true*/) -{ - mRightSideWidgets.push_back(ctrl); - setShowWidget(ctrl, show_widget); -} - -void LLPanelInventoryListItemBase::setShowWidget(const std::string& name, bool show) -{ - LLUICtrl* widget = findChild(name); - if(widget) - { - setShowWidget(widget, show); - } -} - -void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show) -{ - // Enable state determines whether widget may become visible in setWidgetsVisible() - ctrl->setEnabled(show); -} - -BOOL LLPanelInventoryListItemBase::postBuild() -{ - setIconCtrl(getChild("item_icon")); - setTitleCtrl(getChild("item_name")); - - if (mItem) - { - mIconImage = LLInventoryIcon::getIcon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE); - updateItem(mItem->getName()); - } - - setNeedsRefresh(true); - - setWidgetsVisible(false); - reshapeWidgets(); - - return TRUE; -} - -void LLPanelInventoryListItemBase::setValue(const LLSD& value) -{ - if (!value.isMap()) return; - if (!value.has("selected")) return; - childSetVisible("selected_icon", value["selected"]); -} - -void LLPanelInventoryListItemBase::onMouseEnter(S32 x, S32 y, MASK mask) -{ - childSetVisible("hovered_icon", true); - LLPanel::onMouseEnter(x, y, mask); -} - -void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) -{ - childSetVisible("hovered_icon", false); - LLPanel::onMouseLeave(x, y, mask); -} - -const std::string& LLPanelInventoryListItemBase::getItemName() const -{ - if (!mItem) - { - return LLStringUtil::null; - } - return mItem->getName(); -} - -LLAssetType::EType LLPanelInventoryListItemBase::getType() const -{ - if (!mItem) - { - return LLAssetType::AT_NONE; - } - return mItem->getType(); -} - -LLWearableType::EType LLPanelInventoryListItemBase::getWearableType() const -{ - if (!mItem) - { - return LLWearableType::WT_NONE; - } - return mItem->getWearableType(); -} - -const std::string& LLPanelInventoryListItemBase::getDescription() const -{ - if (!mItem) - { - return LLStringUtil::null; - } - return mItem->getDescription(); -} - -S32 LLPanelInventoryListItemBase::notify(const LLSD& info) -{ - S32 rv = 0; - if(info.has("match_filter")) - { - mHighlightedText = info["match_filter"].asString(); - - std::string test(mTitleCtrl->getText()); - LLStringUtil::toUpper(test); - - if(mHighlightedText.empty() || std::string::npos != test.find(mHighlightedText)) - { - rv = 0; // substring is found - } - else - { - rv = -1; - } - - setNeedsRefresh(true); - } - else - { - rv = LLPanel::notify(info); - } - return rv; -} - -LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item) -: LLPanel() -, mItem(item) -, mIconCtrl(NULL) -, mTitleCtrl(NULL) -, mWidgetSpacing(WIDGET_SPACING) -, mLeftWidgetsWidth(0) -, mRightWidgetsWidth(0) -, mNeedsRefresh(false) -{ -} - -void LLPanelInventoryListItemBase::init() -{ - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory_item.xml"); -} - -class WidgetVisibilityChanger -{ -public: - WidgetVisibilityChanger(bool visible) : mVisible(visible){} - void operator()(LLUICtrl* widget) - { - // Disabled widgets never become visible. see LLPanelInventoryListItemBase::setShowWidget() - widget->setVisible(mVisible && widget->getEnabled()); - } -private: - bool mVisible; -}; - -void LLPanelInventoryListItemBase::setWidgetsVisible(bool visible) -{ - std::for_each(mLeftSideWidgets.begin(), mLeftSideWidgets.end(), WidgetVisibilityChanger(visible)); - std::for_each(mRightSideWidgets.begin(), mRightSideWidgets.end(), WidgetVisibilityChanger(visible)); -} - -void LLPanelInventoryListItemBase::reshapeWidgets() -{ - // disabled reshape left for now to reserve space for 'delete' button in LLPanelClothingListItem - /*reshapeLeftWidgets();*/ - reshapeRightWidgets(); - reshapeMiddleWidgets(); -} - -void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) -{ - if(image) - { - mIconImage = image; - mIconCtrl->setImage(mIconImage); - } -} - -void LLPanelInventoryListItemBase::setTitle(const std::string& title, - const std::string& highlit_text, - const LLStyle::Params& input_params) -{ - mTitleCtrl->setToolTip(title); - - LLTextUtil::textboxSetHighlightedVal( - mTitleCtrl, - input_params, - title, - highlit_text); -} - -BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask) -{ - LLRect text_box_rect = mTitleCtrl->getRect(); - if (text_box_rect.pointInRect(x, y) && - mTitleCtrl->getTextPixelWidth() <= text_box_rect.getWidth()) - { - return FALSE; - } - return LLPanel::handleToolTip(x, y, mask); -} - -void LLPanelInventoryListItemBase::reshapeLeftWidgets() -{ - S32 widget_left = 0; - mLeftWidgetsWidth = 0; - - widget_array_t::const_iterator it = mLeftSideWidgets.begin(); - const widget_array_t::const_iterator it_end = mLeftSideWidgets.end(); - for( ; it_end != it; ++it) - { - LLUICtrl* widget = *it; - if(!widget->getVisible()) - { - continue; - } - LLRect widget_rect(widget->getRect()); - widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight()); - widget->setShape(widget_rect); - - widget_left += widget_rect.getWidth() + getWidgetSpacing(); - mLeftWidgetsWidth = widget_rect.mRight; - } -} - -void LLPanelInventoryListItemBase::reshapeRightWidgets() -{ - S32 widget_right = getLocalRect().getWidth(); - S32 widget_left = widget_right; - - widget_array_t::const_reverse_iterator it = mRightSideWidgets.rbegin(); - const widget_array_t::const_reverse_iterator it_end = mRightSideWidgets.rend(); - for( ; it_end != it; ++it) - { - LLUICtrl* widget = *it; - if(!widget->getVisible()) - { - continue; - } - LLRect widget_rect(widget->getRect()); - widget_left = widget_right - widget_rect.getWidth(); - widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight()); - widget->setShape(widget_rect); - - widget_right = widget_left - getWidgetSpacing(); - } - mRightWidgetsWidth = getLocalRect().getWidth() - widget_left; -} - -void LLPanelInventoryListItemBase::reshapeMiddleWidgets() -{ - LLRect icon_rect(mIconCtrl->getRect()); - icon_rect.setLeftTopAndSize(mLeftWidgetsWidth + getWidgetSpacing(), icon_rect.mTop, - icon_rect.getWidth(), icon_rect.getHeight()); - mIconCtrl->setShape(icon_rect); - - S32 name_left = icon_rect.mRight + getWidgetSpacing(); - S32 name_right = getLocalRect().getWidth() - mRightWidgetsWidth - getWidgetSpacing(); - LLRect name_rect(mTitleCtrl->getRect()); - name_rect.set(name_left, name_rect.mTop, name_right, name_rect.mBottom); - mTitleCtrl->setShape(name_rect); -} - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// +#include "llviewerinventory.h" LLInventoryItemsList::Params::Params() {} diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 5dc0bfe3de..71c7b6a675 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -3,8 +3,6 @@ * @brief A list of inventory items represented by LLFlatListView. * * Class LLInventoryItemsList implements a flat list of inventory items. - * Class LLPanelInventoryListItem displays inventory item as an element - * of LLInventoryItemsList. * * $LicenseInfo:firstyear=2010&license=viewergpl$ * @@ -38,189 +36,11 @@ #include "lldarray.h" -#include "llpanel.h" - // newview #include "llflatlistview.h" -#include "llviewerinventory.h" -class LLIconCtrl; -class LLTextBox; class LLViewerInventoryItem; -/** - * @class LLPanelInventoryListItemBase - * - * Base class for Inventory flat list item. Panel consists of inventory icon - * and inventory item name. - * This class is able to display widgets(buttons) on left(before icon) and right(after text-box) sides - * of panel. - * - * How to use (see LLPanelClothingListItem for example): - * - implement init() to build panel from xml - * - create new xml file, fill it with widgets you want to dynamically show/hide/reshape on left/right sides - * - redefine postBuild()(call base implementation) and add needed widgets to needed sides, - * - */ -class LLPanelInventoryListItemBase : public LLPanel -{ -public: - static LLPanelInventoryListItemBase* create(LLViewerInventoryItem* item); - - virtual void draw(); - - /** - * Let item know it need to be refreshed in next draw() - */ - void setNeedsRefresh(bool needs_refresh){ mNeedsRefresh = needs_refresh; } - - bool getNeedsRefresh(){ return mNeedsRefresh; } - - /** - * Add widget to left side - */ - void addWidgetToLeftSide(const std::string& name, bool show_widget = true); - void addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget = true); - - /** - * Add widget to right side, widget is supposed to be child of calling panel - */ - void addWidgetToRightSide(const std::string& name, bool show_widget = true); - void addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget = true); - - /** - * Mark widgets as visible. Only visible widgets take part in reshaping children - */ - void setShowWidget(const std::string& name, bool show); - void setShowWidget(LLUICtrl* ctrl, bool show); - - /** - * Set spacing between widgets during reshape - */ - void setWidgetSpacing(S32 spacing) { mWidgetSpacing = spacing; } - - S32 getWidgetSpacing() { return mWidgetSpacing; } - - /** - * Inheritors need to call base implementation of postBuild() - */ - /*virtual*/ BOOL postBuild(); - - /** - * Handles item selection - */ - /*virtual*/ void setValue(const LLSD& value); - - /** - * Handles filter request - */ - /*virtual*/ S32 notify(const LLSD& info); - - /* Highlights item */ - /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); - /* Removes item highlight */ - /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - - /** Get the name of a corresponding inventory item */ - const std::string& getItemName() const; - - /** Get the asset type of a corresponding inventory item */ - LLAssetType::EType getType() const; - - /** Get the wearable type of a corresponding inventory item */ - LLWearableType::EType getWearableType() const; - - /** Get the description of a corresponding inventory item */ - const std::string& getDescription() const; - - /** Get the associated inventory item */ - LLViewerInventoryItem* getItem() const { return mItem; } - - virtual ~LLPanelInventoryListItemBase(){} - -protected: - - LLPanelInventoryListItemBase(LLViewerInventoryItem* item); - - typedef std::vector widget_array_t; - - /** - * Use it from a factory function to build panel, do not build panel in constructor - */ - virtual void init(); - - /** - * Called after inventory item was updated, update panel widgets to reflect inventory changes. - */ - virtual void updateItem(const std::string& name, - const LLStyle::Params& input_params = LLStyle::Params()); - - /** setter for mIconCtrl */ - void setIconCtrl(LLIconCtrl* icon) { mIconCtrl = icon; } - /** setter for MTitleCtrl */ - void setTitleCtrl(LLTextBox* tb) { mTitleCtrl = tb; } - - void setLeftWidgetsWidth(S32 width) { mLeftWidgetsWidth = width; } - void setRightWidgetsWidth(S32 width) { mRightWidgetsWidth = width; } - - /** - * Set all widgets from both side visible/invisible. Only enabled widgets - * (see setShowWidget()) can become visible - */ - virtual void setWidgetsVisible(bool visible); - - /** - * Reshape all child widgets - icon, text-box and side widgets - */ - virtual void reshapeWidgets(); - - /** set wearable type icon image */ - void setIconImage(const LLUIImagePtr& image); - - /** Set item title - inventory item name usually */ - virtual void setTitle(const std::string& title, - const std::string& highlit_text, - const LLStyle::Params& input_params = LLStyle::Params()); - - /** - * Show tool tip if item name text size > panel size - */ - virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); - - LLViewerInventoryItem* mItem; - -private: - - /** reshape left side widgets - * Deprecated for now. Disabled reshape left for now to reserve space for 'delete' - * button in LLPanelClothingListItem according to Neal's comment (https://codereview.productengine.com/secondlife/r/325/) - */ - void reshapeLeftWidgets(); - - /** reshape right side widgets */ - void reshapeRightWidgets(); - - /** reshape remaining widgets */ - void reshapeMiddleWidgets(); - - - LLIconCtrl* mIconCtrl; - LLTextBox* mTitleCtrl; - - LLUIImagePtr mIconImage; - std::string mHighlightedText; - - widget_array_t mLeftSideWidgets; - widget_array_t mRightSideWidgets; - S32 mWidgetSpacing; - - S32 mLeftWidgetsWidth; - S32 mRightWidgetsWidth; - bool mNeedsRefresh; -}; - -////////////////////////////////////////////////////////////////////////// - class LLInventoryItemsList : public LLFlatListViewEx { public: diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp new file mode 100644 index 0000000000..18b6de77e2 --- /dev/null +++ b/indra/newview/llinventorylistitem.cpp @@ -0,0 +1,388 @@ +/** + * @file llinventorylistitem.cpp + * @brief Inventory list item panel. + * + * Class LLPanelInventoryListItemBase displays inventory item as an element + * of LLInventoryItemsList. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llinventorylistitem.h" + +// llui +#include "lliconctrl.h" +#include "lltextbox.h" +#include "lltextutil.h" + +// newview +#include "llviewerinventory.h" + +static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelInventoryListItemBaseParams(&typeid(LLPanelInventoryListItemBase::Params), "inventory_list_item"); + +static const S32 WIDGET_SPACING = 3; + +LLPanelInventoryListItemBase::Params::Params() +: default_style("default_style"), + worn_style("worn_style") +{}; + +LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item) +{ + LLPanelInventoryListItemBase* list_item = NULL; + if (item) + { + list_item = new LLPanelInventoryListItemBase(item); + list_item->init(); + } + return list_item; +} + +void LLPanelInventoryListItemBase::draw() +{ + if (getNeedsRefresh()) + { + if (mItem) + { + updateItem(mItem->getName()); + } + setNeedsRefresh(false); + } + LLPanel::draw(); +} + +// virtual +void LLPanelInventoryListItemBase::updateItem(const std::string& name, + EItemState item_state) +{ + setIconImage(mIconImage); + setTitle(name, mHighlightedText, item_state); +} + +void LLPanelInventoryListItemBase::addWidgetToLeftSide(const std::string& name, bool show_widget/* = true*/) +{ + LLUICtrl* ctrl = findChild(name); + if(ctrl) + { + addWidgetToLeftSide(ctrl, show_widget); + } +} + +void LLPanelInventoryListItemBase::addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget/* = true*/) +{ + mLeftSideWidgets.push_back(ctrl); + setShowWidget(ctrl, show_widget); +} + +void LLPanelInventoryListItemBase::addWidgetToRightSide(const std::string& name, bool show_widget/* = true*/) +{ + LLUICtrl* ctrl = findChild(name); + if(ctrl) + { + addWidgetToRightSide(ctrl, show_widget); + } +} + +void LLPanelInventoryListItemBase::addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget/* = true*/) +{ + mRightSideWidgets.push_back(ctrl); + setShowWidget(ctrl, show_widget); +} + +void LLPanelInventoryListItemBase::setShowWidget(const std::string& name, bool show) +{ + LLUICtrl* widget = findChild(name); + if(widget) + { + setShowWidget(widget, show); + } +} + +void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show) +{ + // Enable state determines whether widget may become visible in setWidgetsVisible() + ctrl->setEnabled(show); +} + +BOOL LLPanelInventoryListItemBase::postBuild() +{ + setIconCtrl(getChild("item_icon")); + setTitleCtrl(getChild("item_name")); + + if (mItem) + { + mIconImage = LLInventoryIcon::getIcon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE); + updateItem(mItem->getName()); + } + + setNeedsRefresh(true); + + setWidgetsVisible(false); + reshapeWidgets(); + + return TRUE; +} + +void LLPanelInventoryListItemBase::setValue(const LLSD& value) +{ + if (!value.isMap()) return; + if (!value.has("selected")) return; + childSetVisible("selected_icon", value["selected"]); +} + +void LLPanelInventoryListItemBase::onMouseEnter(S32 x, S32 y, MASK mask) +{ + childSetVisible("hovered_icon", true); + LLPanel::onMouseEnter(x, y, mask); +} + +void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) +{ + childSetVisible("hovered_icon", false); + LLPanel::onMouseLeave(x, y, mask); +} + +const std::string& LLPanelInventoryListItemBase::getItemName() const +{ + if (!mItem) + { + return LLStringUtil::null; + } + return mItem->getName(); +} + +LLAssetType::EType LLPanelInventoryListItemBase::getType() const +{ + if (!mItem) + { + return LLAssetType::AT_NONE; + } + return mItem->getType(); +} + +LLWearableType::EType LLPanelInventoryListItemBase::getWearableType() const +{ + if (!mItem) + { + return LLWearableType::WT_NONE; + } + return mItem->getWearableType(); +} + +const std::string& LLPanelInventoryListItemBase::getDescription() const +{ + if (!mItem) + { + return LLStringUtil::null; + } + return mItem->getDescription(); +} + +S32 LLPanelInventoryListItemBase::notify(const LLSD& info) +{ + S32 rv = 0; + if(info.has("match_filter")) + { + mHighlightedText = info["match_filter"].asString(); + + std::string test(mTitleCtrl->getText()); + LLStringUtil::toUpper(test); + + if(mHighlightedText.empty() || std::string::npos != test.find(mHighlightedText)) + { + rv = 0; // substring is found + } + else + { + rv = -1; + } + + setNeedsRefresh(true); + } + else + { + rv = LLPanel::notify(info); + } + return rv; +} + +LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item) +: LLPanel() +, mItem(item) +, mIconCtrl(NULL) +, mTitleCtrl(NULL) +, mWidgetSpacing(WIDGET_SPACING) +, mLeftWidgetsWidth(0) +, mRightWidgetsWidth(0) +, mNeedsRefresh(false) +{ +} + +void LLPanelInventoryListItemBase::init() +{ + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory_item.xml"); +} + +class WidgetVisibilityChanger +{ +public: + WidgetVisibilityChanger(bool visible) : mVisible(visible){} + void operator()(LLUICtrl* widget) + { + // Disabled widgets never become visible. see LLPanelInventoryListItemBase::setShowWidget() + widget->setVisible(mVisible && widget->getEnabled()); + } +private: + bool mVisible; +}; + +void LLPanelInventoryListItemBase::setWidgetsVisible(bool visible) +{ + std::for_each(mLeftSideWidgets.begin(), mLeftSideWidgets.end(), WidgetVisibilityChanger(visible)); + std::for_each(mRightSideWidgets.begin(), mRightSideWidgets.end(), WidgetVisibilityChanger(visible)); +} + +void LLPanelInventoryListItemBase::reshapeWidgets() +{ + // disabled reshape left for now to reserve space for 'delete' button in LLPanelClothingListItem + /*reshapeLeftWidgets();*/ + reshapeRightWidgets(); + reshapeMiddleWidgets(); +} + +void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) +{ + if(image) + { + mIconImage = image; + mIconCtrl->setImage(mIconImage); + } +} + +void LLPanelInventoryListItemBase::setTitle(const std::string& title, + const std::string& highlit_text, + EItemState item_state) +{ + mTitleCtrl->setToolTip(title); + + LLStyle::Params style_params; + + const LLPanelInventoryListItemBase::Params& params = LLUICtrlFactory::getDefaultParams(); + + switch(item_state) + { + case IS_DEFAULT: + style_params = params.default_style(); + break; + case IS_WORN: + style_params = params.worn_style(); + break; + default:; + } + + LLTextUtil::textboxSetHighlightedVal( + mTitleCtrl, + style_params, + title, + highlit_text); +} + +BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask) +{ + LLRect text_box_rect = mTitleCtrl->getRect(); + if (text_box_rect.pointInRect(x, y) && + mTitleCtrl->getTextPixelWidth() <= text_box_rect.getWidth()) + { + return FALSE; + } + return LLPanel::handleToolTip(x, y, mask); +} + +void LLPanelInventoryListItemBase::reshapeLeftWidgets() +{ + S32 widget_left = 0; + mLeftWidgetsWidth = 0; + + widget_array_t::const_iterator it = mLeftSideWidgets.begin(); + const widget_array_t::const_iterator it_end = mLeftSideWidgets.end(); + for( ; it_end != it; ++it) + { + LLUICtrl* widget = *it; + if(!widget->getVisible()) + { + continue; + } + LLRect widget_rect(widget->getRect()); + widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight()); + widget->setShape(widget_rect); + + widget_left += widget_rect.getWidth() + getWidgetSpacing(); + mLeftWidgetsWidth = widget_rect.mRight; + } +} + +void LLPanelInventoryListItemBase::reshapeRightWidgets() +{ + S32 widget_right = getLocalRect().getWidth(); + S32 widget_left = widget_right; + + widget_array_t::const_reverse_iterator it = mRightSideWidgets.rbegin(); + const widget_array_t::const_reverse_iterator it_end = mRightSideWidgets.rend(); + for( ; it_end != it; ++it) + { + LLUICtrl* widget = *it; + if(!widget->getVisible()) + { + continue; + } + LLRect widget_rect(widget->getRect()); + widget_left = widget_right - widget_rect.getWidth(); + widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight()); + widget->setShape(widget_rect); + + widget_right = widget_left - getWidgetSpacing(); + } + mRightWidgetsWidth = getLocalRect().getWidth() - widget_left; +} + +void LLPanelInventoryListItemBase::reshapeMiddleWidgets() +{ + LLRect icon_rect(mIconCtrl->getRect()); + icon_rect.setLeftTopAndSize(mLeftWidgetsWidth + getWidgetSpacing(), icon_rect.mTop, + icon_rect.getWidth(), icon_rect.getHeight()); + mIconCtrl->setShape(icon_rect); + + S32 name_left = icon_rect.mRight + getWidgetSpacing(); + S32 name_right = getLocalRect().getWidth() - mRightWidgetsWidth - getWidgetSpacing(); + LLRect name_rect(mTitleCtrl->getRect()); + name_rect.set(name_left, name_rect.mTop, name_right, name_rect.mBottom); + mTitleCtrl->setShape(name_rect); +} + +// EOF diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h new file mode 100644 index 0000000000..599431af3f --- /dev/null +++ b/indra/newview/llinventorylistitem.h @@ -0,0 +1,235 @@ +/** + * @file llinventorylistitem.h + * @brief Inventory list item panel. + * + * Class LLPanelInventoryListItemBase displays inventory item as an element + * of LLInventoryItemsList. + * + * $LicenseInfo:firstyear=2010&license=viewergpl$ + * + * Copyright (c) 2010, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LL_LLINVENTORYLISTITEM_H +#define LL_LLINVENTORYLISTITEM_H + +// llcommon +#include "llassettype.h" + +// llui +#include "llpanel.h" +#include "llstyle.h" + +// newview +#include "llwearabletype.h" + +class LLIconCtrl; +class LLTextBox; +class LLViewerInventoryItem; + +/** + * @class LLPanelInventoryListItemBase + * + * Base class for Inventory flat list item. Panel consists of inventory icon + * and inventory item name. + * This class is able to display widgets(buttons) on left(before icon) and right(after text-box) sides + * of panel. + * + * How to use (see LLPanelClothingListItem for example): + * - implement init() to build panel from xml + * - create new xml file, fill it with widgets you want to dynamically show/hide/reshape on left/right sides + * - redefine postBuild()(call base implementation) and add needed widgets to needed sides, + * + */ +class LLPanelInventoryListItemBase : public LLPanel +{ +public: + struct Params : public LLInitParam::Block + { + Optional default_style, + worn_style; + Params(); + }; + + typedef enum e_item_state { + IS_DEFAULT, + IS_WORN, + } EItemState; + + static LLPanelInventoryListItemBase* create(LLViewerInventoryItem* item); + + virtual void draw(); + + /** + * Let item know it need to be refreshed in next draw() + */ + void setNeedsRefresh(bool needs_refresh){ mNeedsRefresh = needs_refresh; } + + bool getNeedsRefresh(){ return mNeedsRefresh; } + + /** + * Add widget to left side + */ + void addWidgetToLeftSide(const std::string& name, bool show_widget = true); + void addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget = true); + + /** + * Add widget to right side, widget is supposed to be child of calling panel + */ + void addWidgetToRightSide(const std::string& name, bool show_widget = true); + void addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget = true); + + /** + * Mark widgets as visible. Only visible widgets take part in reshaping children + */ + void setShowWidget(const std::string& name, bool show); + void setShowWidget(LLUICtrl* ctrl, bool show); + + /** + * Set spacing between widgets during reshape + */ + void setWidgetSpacing(S32 spacing) { mWidgetSpacing = spacing; } + + S32 getWidgetSpacing() { return mWidgetSpacing; } + + /** + * Inheritors need to call base implementation of postBuild() + */ + /*virtual*/ BOOL postBuild(); + + /** + * Handles item selection + */ + /*virtual*/ void setValue(const LLSD& value); + + /** + * Handles filter request + */ + /*virtual*/ S32 notify(const LLSD& info); + + /* Highlights item */ + /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask); + /* Removes item highlight */ + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); + + /** Get the name of a corresponding inventory item */ + const std::string& getItemName() const; + + /** Get the asset type of a corresponding inventory item */ + LLAssetType::EType getType() const; + + /** Get the wearable type of a corresponding inventory item */ + LLWearableType::EType getWearableType() const; + + /** Get the description of a corresponding inventory item */ + const std::string& getDescription() const; + + /** Get the associated inventory item */ + LLViewerInventoryItem* getItem() const { return mItem; } + + virtual ~LLPanelInventoryListItemBase(){} + +protected: + + LLPanelInventoryListItemBase(LLViewerInventoryItem* item); + + typedef std::vector widget_array_t; + + /** + * Use it from a factory function to build panel, do not build panel in constructor + */ + virtual void init(); + + /** + * Called after inventory item was updated, update panel widgets to reflect inventory changes. + */ + virtual void updateItem(const std::string& name, + EItemState item_state = IS_DEFAULT); + + /** setter for mIconCtrl */ + void setIconCtrl(LLIconCtrl* icon) { mIconCtrl = icon; } + /** setter for MTitleCtrl */ + void setTitleCtrl(LLTextBox* tb) { mTitleCtrl = tb; } + + void setLeftWidgetsWidth(S32 width) { mLeftWidgetsWidth = width; } + void setRightWidgetsWidth(S32 width) { mRightWidgetsWidth = width; } + + /** + * Set all widgets from both side visible/invisible. Only enabled widgets + * (see setShowWidget()) can become visible + */ + virtual void setWidgetsVisible(bool visible); + + /** + * Reshape all child widgets - icon, text-box and side widgets + */ + virtual void reshapeWidgets(); + + /** set wearable type icon image */ + void setIconImage(const LLUIImagePtr& image); + + /** Set item title - inventory item name usually */ + void setTitle(const std::string& title, + const std::string& highlit_text, + EItemState item_state = IS_DEFAULT); + + /** + * Show tool tip if item name text size > panel size + */ + virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); + + LLViewerInventoryItem* mItem; + +private: + + /** reshape left side widgets + * Deprecated for now. Disabled reshape left for now to reserve space for 'delete' + * button in LLPanelClothingListItem according to Neal's comment (https://codereview.productengine.com/secondlife/r/325/) + */ + void reshapeLeftWidgets(); + + /** reshape right side widgets */ + void reshapeRightWidgets(); + + /** reshape remaining widgets */ + void reshapeMiddleWidgets(); + + + LLIconCtrl* mIconCtrl; + LLTextBox* mTitleCtrl; + + LLUIImagePtr mIconImage; + std::string mHighlightedText; + + widget_array_t mLeftSideWidgets; + widget_array_t mRightSideWidgets; + S32 mWidgetSpacing; + + S32 mLeftWidgetsWidth; + S32 mRightWidgetsWidth; + bool mNeedsRefresh; +}; + +#endif //LL_LLINVENTORYLISTITEM_H diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 9c308359fa..427a0dc34d 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -34,11 +34,11 @@ #include "llwearableitemslist.h" #include "lliconctrl.h" +#include "llmenugl.h" // for LLContextMenu #include "llagentwearables.h" #include "llappearancemgr.h" #include "llinventoryfunctions.h" -#include "llmenugl.h" // for LLContextMenu #include "lltransutil.h" #include "llviewerattachmenu.h" #include "llvoavatarself.h" @@ -113,18 +113,17 @@ LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item // virtual void LLPanelWearableOutfitItem::updateItem(const std::string& name, - const LLStyle::Params& input_params) + EItemState item_state) { std::string search_label = name; - LLStyle::Params style_params = input_params; if (mItem && get_is_item_worn(mItem->getUUID())) { search_label += LLTrans::getString("worn"); - style_params.font.style("BOLD"); + item_state = IS_WORN; } - LLPanelInventoryListItemBase::updateItem(search_label, style_params); + LLPanelInventoryListItemBase::updateItem(search_label, item_state); } ////////////////////////////////////////////////////////////////////////// @@ -264,19 +263,18 @@ LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryIt return list_item; } -void LLPanelAttachmentListItem::setTitle(const std::string& title, - const std::string& highlit_text, - const LLStyle::Params& input_params) +void LLPanelAttachmentListItem::updateItem(const std::string& name, + EItemState item_state) { - std::string title_joint = title; + std::string title_joint; if (mItem && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(mItem->getLinkedUUID())) { std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(mItem->getLinkedUUID())); - title_joint = title + " (" + joint + ")"; + title_joint = name + " (" + joint + ")"; } - LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text, input_params); + LLPanelInventoryListItemBase::updateItem(title_joint, item_state); } ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 5dc06284c3..2bfb90e3ec 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -38,6 +38,7 @@ // newview #include "llinventoryitemslist.h" +#include "llinventorylistitem.h" #include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llwearabletype.h" @@ -87,7 +88,7 @@ public: * Updates item name and (worn) suffix. */ /*virtual*/ void updateItem(const std::string& name, - const LLStyle::Params& input_params = LLStyle::Params()); + EItemState item_state = IS_DEFAULT); protected: LLPanelWearableOutfitItem(LLViewerInventoryItem* item); @@ -124,9 +125,8 @@ public: virtual ~LLPanelAttachmentListItem() {}; /** Set item title. Joint name is added to the title in parenthesis */ - /*virtual*/ void setTitle(const std::string& title, - const std::string& highlit_text, - const LLStyle::Params& input_params = LLStyle::Params()); + /*virtual*/ void updateItem(const std::string& name, + EItemState item_state = IS_DEFAULT); protected: LLPanelAttachmentListItem(LLViewerInventoryItem* item) : LLPanelDeletableWearableListItem(item) {}; diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml new file mode 100644 index 0000000000..dbe1ea2874 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml @@ -0,0 +1,18 @@ + + + + + + + + -- cgit v1.2.3 From 525a56872f1e66651b578e59a776643352a3d523 Mon Sep 17 00:00:00 2001 From: Andrew Polunin Date: Mon, 21 Jun 2010 19:27:06 +0300 Subject: EXT-5808 ADDITIONAL FIX (Add coordinates and parcel settings to top menu bar when nav bar is hidden and flags are set) - fixed Mini-Location panel visibility in mouse look mode Added code to the LLAgent::endAnimationUpdateUI() which shows/hides Mini-Location panel depending on the mouse look mode and user preferences. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/623/ --HG-- branch : product-engine --- indra/newview/llagent.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 03efcadc98..217fb0f988 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -57,6 +57,7 @@ #include "llnavigationbar.h" // to show/hide navigation bar when changing mouse look state #include "llnearbychatbar.h" #include "llnotificationsutil.h" +#include "llpaneltopinfobar.h" #include "llparcel.h" #include "llrendersphere.h" #include "llsdutil.h" @@ -1693,6 +1694,11 @@ void LLAgent::endAnimationUpdateUI() LLNavigationBar::getInstance()->setVisible(TRUE); gStatusBar->setVisibleForMouselook(true); + if (gSavedSettings.getBOOL("ShowMiniLocationPanel")) + { + LLPanelTopInfoBar::getInstance()->setVisible(TRUE); + } + LLBottomTray::getInstance()->onMouselookModeOut(); LLSideTray::getInstance()->getButtonsPanel()->setVisible(TRUE); @@ -1791,6 +1797,8 @@ void LLAgent::endAnimationUpdateUI() LLNavigationBar::getInstance()->setVisible(FALSE); gStatusBar->setVisibleForMouselook(false); + LLPanelTopInfoBar::getInstance()->setVisible(FALSE); + LLBottomTray::getInstance()->onMouselookModeIn(); LLSideTray::getInstance()->getButtonsPanel()->setVisible(FALSE); -- cgit v1.2.3 From fe0d481541a14630d9b40bcb774971a9995efdbd Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 22 Jun 2010 10:35:26 +0300 Subject: EXT-7947 FIXED Added "language" parameter with LLUI::getLanguage() value into web site info. Reviewed by Richard Nelson at https://codereview.productengine.com/secondlife/r/627/ --HG-- branch : product-engine --- indra/newview/llfloaterbuyland.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 7ca7ace0fc..9379b3f5a8 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -668,6 +668,7 @@ void LLFloaterBuyLandUI::updateWebSiteInfo() keywordArgs.appendString( "secureSessionId", gAgent.getSecureSessionID().asString()); + keywordArgs.appendString("language", LLUI::getLanguage()); keywordArgs.appendInt("billableArea", mPreflightAskBillableArea); keywordArgs.appendInt("currencyBuy", mPreflightAskCurrencyBuy); -- cgit v1.2.3 From 632c287e9a03c3a447bdf1981a430cd4487b203b Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Tue, 22 Jun 2010 11:57:29 +0300 Subject: EXT-7928 FIXED replace member pointer to LLViewerInventoryItem with calling LLInventory::getItem() Reason: access to deleted pointer to LLViewerInventoryItem in LLWearableItemsList::updateChangedItems. Fix: replaced member pointer to LLViewerInventoryItem with its LLUUID. Also improved a bit logic of the updateChangedItems() to avoid redundant iterations. Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/613/ --HG-- branch : product-engine --- indra/newview/llinventorylistitem.cpp | 40 +++++++++++++++++++++++------------ indra/newview/llinventorylistitem.h | 4 ++-- indra/newview/llwearableitemslist.cpp | 11 +++++++--- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/indra/newview/llinventorylistitem.cpp b/indra/newview/llinventorylistitem.cpp index 18b6de77e2..c487aa10a7 100644 --- a/indra/newview/llinventorylistitem.cpp +++ b/indra/newview/llinventorylistitem.cpp @@ -42,6 +42,7 @@ #include "lltextutil.h" // newview +#include "llinventorymodel.h" #include "llviewerinventory.h" static LLWidgetNameRegistry::StaticRegistrar sRegisterPanelInventoryListItemBaseParams(&typeid(LLPanelInventoryListItemBase::Params), "inventory_list_item"); @@ -68,9 +69,10 @@ void LLPanelInventoryListItemBase::draw() { if (getNeedsRefresh()) { - if (mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (inv_item) { - updateItem(mItem->getName()); + updateItem(inv_item->getName()); } setNeedsRefresh(false); } @@ -135,10 +137,11 @@ BOOL LLPanelInventoryListItemBase::postBuild() setIconCtrl(getChild("item_icon")); setTitleCtrl(getChild("item_name")); - if (mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (inv_item) { - mIconImage = LLInventoryIcon::getIcon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE); - updateItem(mItem->getName()); + mIconImage = LLInventoryIcon::getIcon(inv_item->getType(), inv_item->getInventoryType(), inv_item->getFlags(), FALSE); + updateItem(inv_item->getName()); } setNeedsRefresh(true); @@ -170,38 +173,47 @@ void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask) const std::string& LLPanelInventoryListItemBase::getItemName() const { - if (!mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (NULL == inv_item) { return LLStringUtil::null; } - return mItem->getName(); + return inv_item->getName(); } LLAssetType::EType LLPanelInventoryListItemBase::getType() const { - if (!mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (NULL == inv_item) { return LLAssetType::AT_NONE; } - return mItem->getType(); + return inv_item->getType(); } LLWearableType::EType LLPanelInventoryListItemBase::getWearableType() const { - if (!mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (NULL == inv_item) { return LLWearableType::WT_NONE; } - return mItem->getWearableType(); + return inv_item->getWearableType(); } const std::string& LLPanelInventoryListItemBase::getDescription() const { - if (!mItem) + LLViewerInventoryItem* inv_item = getItem(); + if (NULL == inv_item) { return LLStringUtil::null; } - return mItem->getDescription(); + return inv_item->getDescription(); +} + +LLViewerInventoryItem* LLPanelInventoryListItemBase::getItem() const +{ + return gInventory.getItem(mInventoryItemUUID); } S32 LLPanelInventoryListItemBase::notify(const LLSD& info) @@ -234,7 +246,7 @@ S32 LLPanelInventoryListItemBase::notify(const LLSD& info) LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item) : LLPanel() -, mItem(item) +, mInventoryItemUUID(item ? item->getUUID() : LLUUID::null) , mIconCtrl(NULL) , mTitleCtrl(NULL) , mWidgetSpacing(WIDGET_SPACING) diff --git a/indra/newview/llinventorylistitem.h b/indra/newview/llinventorylistitem.h index 599431af3f..f29d92d51c 100644 --- a/indra/newview/llinventorylistitem.h +++ b/indra/newview/llinventorylistitem.h @@ -147,7 +147,7 @@ public: const std::string& getDescription() const; /** Get the associated inventory item */ - LLViewerInventoryItem* getItem() const { return mItem; } + LLViewerInventoryItem* getItem() const; virtual ~LLPanelInventoryListItemBase(){} @@ -200,7 +200,7 @@ protected: */ virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); - LLViewerInventoryItem* mItem; + const LLUUID mInventoryItemUUID; private: diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 427a0dc34d..832d4a2fe6 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -117,7 +117,7 @@ void LLPanelWearableOutfitItem::updateItem(const std::string& name, { std::string search_label = name; - if (mItem && get_is_item_worn(mItem->getUUID())) + if (get_is_item_worn(mInventoryItemUUID)) { search_label += LLTrans::getString("worn"); item_state = IS_WORN; @@ -268,9 +268,10 @@ void LLPanelAttachmentListItem::updateItem(const std::string& name, { std::string title_joint; - if (mItem && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(mItem->getLinkedUUID())) + LLViewerInventoryItem* inv_item = getItem(); + if (inv_item && isAgentAvatarValid() && gAgentAvatarp->isWearingAttachment(inv_item->getLinkedUUID())) { - std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(mItem->getLinkedUUID())); + std::string joint = LLTrans::getString(gAgentAvatarp->getAttachedPointName(inv_item->getLinkedUUID())); title_joint = name + " (" + joint + ")"; } @@ -501,6 +502,9 @@ void LLWearableItemsList::updateList(const LLUUID& category_id) void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_items_t& changed_items_uuids) { + // nothing to update + if (changed_items_uuids.empty()) return; + typedef std::vector item_panel_list_t; item_panel_list_t items; @@ -525,6 +529,7 @@ void LLWearableItemsList::updateChangedItems(const LLInventoryModel::changed_ite if (linked_uuid == *iter) { item->setNeedsRefresh(true); + break; } } } -- cgit v1.2.3 From b04ca1b069108292d79f47b5ce855028bb5394e0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 22 Jun 2010 10:49:22 +0100 Subject: fix java-esque build error in llstartup change. --- indra/newview/llstartup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 5aa46686e8..cf3c030f08 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -93,7 +93,7 @@ public: // Load default fonts not already loaded at start screen static void fontInit(); - static void LLStartUp::copyLibraryGestures(const std::string& same_gender_gestures); + static void copyLibraryGestures(const std::string& same_gender_gestures); // outfit_folder_name can be a folder anywhere in your inventory, // but the name must be a case-sensitive exact match. -- cgit v1.2.3 From fefe6448d726b331b5fded435c3713afd388b220 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 22 Jun 2010 10:53:56 +0100 Subject: EXT-4919 WIP Fix build breakage on Linux. --- indra/newview/llstartup.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index 5aa46686e8..cf3c030f08 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -93,7 +93,7 @@ public: // Load default fonts not already loaded at start screen static void fontInit(); - static void LLStartUp::copyLibraryGestures(const std::string& same_gender_gestures); + static void copyLibraryGestures(const std::string& same_gender_gestures); // outfit_folder_name can be a folder anywhere in your inventory, // but the name must be a case-sensitive exact match. -- cgit v1.2.3 From 7295e1ee034b3163b2f1c9f4aa11695beb7db8b0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 22 Jun 2010 11:07:35 +0100 Subject: EXT-7889 PARTIAL Linux fails to load splash screen and side panel home tab. Start to restore manual glib handling. Backed out changeset ff86a9f5b917 --- indra/llwindow/llwindowsdl.cpp | 2 +- indra/media_plugins/webkit/CMakeLists.txt | 11 +++++++++- indra/media_plugins/webkit/media_plugin_webkit.cpp | 24 ++++++++++++++++++---- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index bfdf1147a1..f9c3694459 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -1617,7 +1617,7 @@ void LLWindowSDL::processMiscNativeEvents() pump_timer.setTimerExpirySec(1.0f / 15.0f); do { // Always do at least one non-blocking pump - gtk_main_iteration_do(0); + gtk_main_iteration_do(FALSE); } while (gtk_events_pending() && !pump_timer.hasExpired()); diff --git a/indra/media_plugins/webkit/CMakeLists.txt b/indra/media_plugins/webkit/CMakeLists.txt index 5bccd589d8..812760a116 100644 --- a/indra/media_plugins/webkit/CMakeLists.txt +++ b/indra/media_plugins/webkit/CMakeLists.txt @@ -9,6 +9,7 @@ include(LLPlugin) include(LLMath) include(LLRender) include(LLWindow) +include(UI) include(Linking) include(PluginAPI) include(MediaPluginBase) @@ -38,7 +39,7 @@ add_library(media_plugin_webkit ${media_plugin_webkit_SOURCE_FILES} ) -target_link_libraries(media_plugin_webkit +set(media_plugin_webkit_LINK_LIBRARIES ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} ${LLCOMMON_LIBRARIES} @@ -46,6 +47,14 @@ target_link_libraries(media_plugin_webkit ${PLUGIN_API_WINDOWS_LIBRARIES} ) +if (LINUX) + list(APPEND media_plugin_webkit_LINK_LIBRARIES + ${UI_LIBRARIES} # for glib/GTK + ) +endif (LINUX) + +target_link_libraries(media_plugin_webkit ${media_plugin_webkit_LINK_LIBRARIES}) + add_dependencies(media_plugin_webkit ${LLPLUGIN_LIBRARIES} ${MEDIA_PLUGIN_BASE_LIBRARIES} diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 3c24b4ed22..b607d2f66a 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -43,15 +43,21 @@ #include "llpluginmessageclasses.h" #include "media_plugin_base.h" +#if LL_LINUX +extern "C" { +# include +} +#endif // LL_LINUX + #if LL_WINDOWS -#include +# include #else -#include -#include +# include +# include #endif #if LL_WINDOWS - // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below + // *NOTE:Mani - This captures the module handle for the dll. This is used below // to get the path to this dll for webkit initialization. // I don't know how/if this can be done with apr... namespace { HMODULE gModuleHandle;}; @@ -112,6 +118,16 @@ private: // void update(int milliseconds) { +#if LL_LINUX + // pump glib generously, as Linux browser plugins are on the + // glib main loop, even if the browser itself isn't - ugh + //*TODO: shouldn't this be transparent if Qt was compiled with + // glib mainloop integration? investigate. + GMainContext *mainc = g_main_context_default(); + while(g_main_context_iteration(mainc, FALSE)); +#endif // LL_LINUX + + // pump qt LLQtWebKit::getInstance()->pump( milliseconds ); checkEditState(); -- cgit v1.2.3 From 68c5a7f25cf92c896a6c6a3e431ab4917a14915d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 22 Jun 2010 12:20:45 +0100 Subject: EXT-7889 FIXED Linux fails to load splash screen and side panel home tab. --- indra/media_plugins/webkit/linux_volume_catcher.cpp | 5 +++++ indra/media_plugins/webkit/media_plugin_webkit.cpp | 17 +++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/indra/media_plugins/webkit/linux_volume_catcher.cpp b/indra/media_plugins/webkit/linux_volume_catcher.cpp index 2e7fda865e..5eaef0e1c3 100644 --- a/indra/media_plugins/webkit/linux_volume_catcher.cpp +++ b/indra/media_plugins/webkit/linux_volume_catcher.cpp @@ -47,6 +47,7 @@ extern "C" { #include +#include #include #include @@ -220,6 +221,10 @@ void VolumeCatcherImpl::init() mGotSyms = loadsyms("libpulse-mainloop-glib.so.0"); if (!mGotSyms) return; + // better make double-sure glib itself is initialized properly. + if (!g_thread_supported ()) g_thread_init (NULL); + g_type_init(); + mMainloop = llpa_glib_mainloop_new(g_main_context_default()); if (mMainloop) { diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index a9ff7bf752..3b00edec4e 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -48,6 +48,7 @@ # define LL_QTWEBKIT_USES_PIXMAPS 0 extern "C" { # include +# include } #else # define LL_QTWEBKIT_USES_PIXMAPS 0 @@ -132,14 +133,14 @@ private: // void update(int milliseconds) { -#if LL_LINUX +#if LL_QTLINUX_DOESNT_HAVE_GLIB // pump glib generously, as Linux browser plugins are on the // glib main loop, even if the browser itself isn't - ugh - //*TODO: shouldn't this be transparent if Qt was compiled with - // glib mainloop integration? investigate. + // This is NOT NEEDED if Qt itself was built with glib + // mainloop integration. GMainContext *mainc = g_main_context_default(); while(g_main_context_iteration(mainc, FALSE)); -#endif // LL_LINUX +#endif // LL_QTLINUX_DOESNT_HAVE_GLIB // pump qt LLQtWebKit::getInstance()->pump( milliseconds ); @@ -213,6 +214,14 @@ private: } std::string application_dir = std::string( cwd ); +#if LL_LINUX + // take care to initialize glib properly, because some + // versions of Qt don't, and we indirectly need it for (some + // versions of) Flash to not crash the browser. + if (!g_thread_supported ()) g_thread_init (NULL); + g_type_init(); +#endif + #if LL_DARWIN // When running under the Xcode debugger, there's a setting called "Break on Debugger()/DebugStr()" which defaults to being turned on. // This causes the environment variable USERBREAK to be set to 1, which causes these legacy calls to break into the debugger. -- cgit v1.2.3 From 4c31f60bba890e5c320c4bc6fd0ca1c5ce741830 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 22 Jun 2010 18:33:39 +0100 Subject: EXT-7926 FIXED Fixed crash opening About for non-English locales. Calling std::locale("fr_FR.UTF-8") crashes on Linux and Mac. Or rather, it throws an exception when it doesn't know the locale and we didn't handle the exception. I now catch the exception and output an error rather than crash. Note, this happened because of change 703f3bcf7069, which made us actually pass a real locale string instead of just "C". So, we were never actually supporting a locale for LLStringUtil::formatNumber(). There is therefore an open task of making formatNumber() actually respect the locale. I'll report a separate JIRA to capture that task. --- indra/llcommon/llstring.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f14d947734..f5eb552d99 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -994,7 +994,14 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) convertToS32 (decimals, intDecimals); if (!sLocale.empty()) { - strStream.imbue (std::locale(sLocale.c_str())); + // imbue() throws if the locale is unknown! (EXT-7926) + try + { + strStream.imbue(std::locale(sLocale.c_str())); + } catch (const std::exception &e) + { + LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL; + } } if (!intDecimals) -- cgit v1.2.3 From ccad528d5fb5889e9826ca045de5e7315be5942e Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Tue, 22 Jun 2010 18:55:04 +0100 Subject: EXT-7926 FIXED Minor typo correction. --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f5eb552d99..ffdac5d411 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -994,7 +994,7 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) convertToS32 (decimals, intDecimals); if (!sLocale.empty()) { - // imbue() throws if the locale is unknown! (EXT-7926) + // std::locale() throws if the locale is unknown! (EXT-7926) try { strStream.imbue(std::locale(sLocale.c_str())); -- cgit v1.2.3 From dfc20a824944d372c6978ca7b89289ec542554a9 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 22 Jun 2010 14:59:34 -0400 Subject: EXT-7926: Remove unreferenced catch-clause variable (MSVC error). --- indra/llcommon/llstring.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index ffdac5d411..1561bda201 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -998,7 +998,7 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) try { strStream.imbue(std::locale(sLocale.c_str())); - } catch (const std::exception &e) + } catch (const std::exception &) { LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL; } -- cgit v1.2.3 From f388efa49a75206223137c328f2a1fe0853d02a7 Mon Sep 17 00:00:00 2001 From: palange Date: Tue, 22 Jun 2010 13:03:56 -0700 Subject: EXT-7925 FIX Added NSTreatUnknownArgumentsAsOpen to setupCocoa() to prevent pop-ups --- indra/llwindow/llwindowmacosx-objc.mm | 5 ++++ indra/newview/Info-SecondLife.plist | 48 +++++++++++++++++------------------ 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/indra/llwindow/llwindowmacosx-objc.mm b/indra/llwindow/llwindowmacosx-objc.mm index 59b25e1726..3a822a93a6 100644 --- a/indra/llwindow/llwindowmacosx-objc.mm +++ b/indra/llwindow/llwindowmacosx-objc.mm @@ -49,6 +49,11 @@ void setupCocoa() { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + // The following prevents the Cocoa command line parser from trying to open 'unknown' arguements as documents. + // ie. running './secondlife -set Language fr' would cause a pop-up saying can't open document 'fr' + // when init'ing the Cocoa App window. + [[NSUserDefaults standardUserDefaults] setObject:@"NO" forKey:@"NSTreatUnknownArgumentsAsOpen"]; + // This is a bit of voodoo taken from the Apple sample code "CarbonCocoa_PictureCursor": // http://developer.apple.com/samplecode/CarbonCocoa_PictureCursor/index.html diff --git a/indra/newview/Info-SecondLife.plist b/indra/newview/Info-SecondLife.plist index 97e24a0bd5..9bc95f9b95 100644 --- a/indra/newview/Info-SecondLife.plist +++ b/indra/newview/Info-SecondLife.plist @@ -1,5 +1,5 @@ - + CFBundleDevelopmentRegion @@ -18,33 +18,33 @@ APPL CFBundleSignature ???? - CFBundleDocumentTypes - - - CFBundleTypeExtensions - - slurl - - CFBundleTypeIconFile - seconlife - CFBundleTypeMIMETypes - - application/x-grid-location-info - - CFBundleTypeName - Secondlife SLURL + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + slurl + + CFBundleTypeIconFile + seconlife + CFBundleTypeMIMETypes + + application/x-grid-location-info + + CFBundleTypeName + Secondlife SLURL CFBundleTypeOSTypes - SLRL + SLRL - CFBundleTypeRole - Viewer - LSTypeIsPackage + CFBundleTypeRole + Viewer + LSTypeIsPackage - NSDocumentClass - SecondLifeSLURL - - + NSDocumentClass + SecondLifeSLURL + + CFBundleURLTypes -- cgit v1.2.3 From 449de8e6085c1ddb7a4bd9dcd835aecbf45a7d11 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 22 Jun 2010 16:34:31 -0400 Subject: EXT-3616 FIX - avoid bailing out of outfit population too soon. --- indra/newview/llagentwearablesfetch.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/indra/newview/llagentwearablesfetch.cpp b/indra/newview/llagentwearablesfetch.cpp index 931aba1d41..0a2f0e9399 100644 --- a/indra/newview/llagentwearablesfetch.cpp +++ b/indra/newview/llagentwearablesfetch.cpp @@ -48,6 +48,12 @@ public: virtual ~LLOrderMyOutfitsOnDestroy() { + if (LLApp::isExiting()) + { + llwarns << "called during shutdown, skipping" << llendl; + return; + } + const LLUUID& my_outfits_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS); if (my_outfits_id.isNull()) return; @@ -241,6 +247,8 @@ LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const LLUUID& my_outfits_id) : mCurrFetchStep(LOFS_FOLDER), mOutfitsPopulated(false) { + llinfos << "created" << llendl; + mMyOutfitsID = LLUUID::null; mClothingID = LLUUID::null; mLibraryClothingID = LLUUID::null; @@ -250,10 +258,13 @@ LLLibraryOutfitsFetch::LLLibraryOutfitsFetch(const LLUUID& my_outfits_id) : LLLibraryOutfitsFetch::~LLLibraryOutfitsFetch() { + llinfos << "destroyed" << llendl; } void LLLibraryOutfitsFetch::done() { + llinfos << "start" << llendl; + // Delay this until idle() routine, since it's a heavy operation and // we also can't have it run within notifyObservers. doOnIdleOneTime(boost::bind(&LLLibraryOutfitsFetch::doneIdle,this)); @@ -262,6 +273,8 @@ void LLLibraryOutfitsFetch::done() void LLLibraryOutfitsFetch::doneIdle() { + llinfos << "start" << llendl; + gInventory.addObserver(this); // Add this back in since it was taken out during ::done() switch (mCurrFetchStep) @@ -302,6 +315,8 @@ void LLLibraryOutfitsFetch::doneIdle() void LLLibraryOutfitsFetch::folderDone() { + llinfos << "start" << llendl; + LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; gInventory.collectDescendents(mMyOutfitsID, cat_array, wearable_array, @@ -309,8 +324,7 @@ void LLLibraryOutfitsFetch::folderDone() // Early out if we already have items in My Outfits // except the case when My Outfits contains just initial outfit - if (cat_array.count() > 1 || - cat_array.count() == 1 && cat_array[0]->getUUID() != LLAppearanceMgr::getInstance()->getBaseOutfitUUID()) + if (cat_array.count() > 1) { mOutfitsPopulated = true; return; @@ -348,6 +362,8 @@ void LLLibraryOutfitsFetch::folderDone() void LLLibraryOutfitsFetch::outfitsDone() { + llinfos << "start" << llendl; + LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; uuid_vec_t folders; @@ -425,6 +441,8 @@ private: // Copy the clothing folders from the library into the imported clothing folder void LLLibraryOutfitsFetch::libraryDone() { + llinfos << "start" << llendl; + if (mImportedClothingID != LLUUID::null) { // Skip straight to fetching the contents of the imported folder @@ -480,6 +498,8 @@ void LLLibraryOutfitsFetch::libraryDone() void LLLibraryOutfitsFetch::importedFolderFetch() { + llinfos << "start" << llendl; + // Fetch the contents of the Imported Clothing Folder uuid_vec_t folders; folders.push_back(mImportedClothingID); @@ -495,6 +515,8 @@ void LLLibraryOutfitsFetch::importedFolderFetch() void LLLibraryOutfitsFetch::importedFolderDone() { + llinfos << "start" << llendl; + LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; uuid_vec_t folders; @@ -525,6 +547,8 @@ void LLLibraryOutfitsFetch::importedFolderDone() void LLLibraryOutfitsFetch::contentsDone() { + llinfos << "start" << llendl; + LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t wearable_array; -- cgit v1.2.3 From 056bd69be23f5d3aed9dc3e7fee5650f5309f349 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Tue, 22 Jun 2010 18:19:27 -0400 Subject: EXT-7781 FIX labels on wearable editor previews are unreadable. Changed text color to white as requested. Verified results are acceptable XUI reviewed by Erica --- indra/newview/skins/default/xui/en/panel_scrolling_param.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml index 78d64620a5..a8cd380f20 100644 --- a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml +++ b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml @@ -12,7 +12,7 @@ layout="topleft" left="12" name="min param text" - text_color="EmphasisColor" + text_color="White" font_shadow="hard" top="120" width="120" /> @@ -22,7 +22,7 @@ layout="topleft" left="155" name="max param text" - text_color="EmphasisColor" + text_color="White" font_shadow="hard" top_delta="0" width="120" /> -- cgit v1.2.3