From 347e88961c06b9febfedeb7dc35f2b12546b5118 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 17 Jun 2010 17:37:28 -0400 Subject: EXT-4919 WIP - populating new users with more gestures, and activating appropriate ones --- indra/newview/llgesturemgr.cpp | 2 ++ indra/newview/llstartup.cpp | 66 +++++++++++++++++++++---------------- indra/newview/llviewerinventory.cpp | 5 +++ 3 files changed, 44 insertions(+), 29 deletions(-) (limited to 'indra') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 0996d09e25..6ffd534a53 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -139,6 +139,8 @@ void LLGestureMgr::activateGesture(const LLUUID& item_id) { LLViewerInventoryItem* item = gInventory.getItem(item_id); if (!item) return; + if (item->getType() != LLAssetType::AT_GESTURE) + return; LLUUID asset_id = item->getAssetUUID(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index df5be34e39..5bd97efce6 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2375,6 +2375,8 @@ void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S3 const std::string COMMON_GESTURES_FOLDER = "Common Gestures"; const std::string MALE_GESTURES_FOLDER = "Male Gestures"; const std::string FEMALE_GESTURES_FOLDER = "Female Gestures"; +const std::string SPEECH_GESTURES_FOLDER = "Speech Gestures"; +const std::string OTHER_GESTURES_FOLDER = "Other Gestures"; const S32 OPT_CLOSED_WINDOW = -1; const S32 OPT_MALE = 0; const S32 OPT_FEMALE = 1; @@ -2403,7 +2405,6 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } - void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -2415,16 +2416,16 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); S32 gender = 0; - std::string gestures; + std::string same_gender_gestures; if (gender_name == "male") { gender = OPT_MALE; - gestures = MALE_GESTURES_FOLDER; + same_gender_gestures = MALE_GESTURES_FOLDER; } else { gender = OPT_FEMALE; - gestures = FEMALE_GESTURES_FOLDER; + same_gender_gestures = FEMALE_GESTURES_FOLDER; } // try to find the outfit - if not there, create some default @@ -2448,35 +2449,42 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, // Copy gestures LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE); - LLPointer cb(NULL); LLAppearanceMgr *app_mgr = &(LLAppearanceMgr::instance()); - // - Copy gender-specific gestures. - LLUUID gestures_cat_id = findDescendentCategoryIDByName( - gInventory.getLibraryRootFolderID(), - gestures); - if (gestures_cat_id.notNull()) + std::vector gesture_folders_to_copy; + gesture_folders_to_copy.push_back(MALE_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(FEMALE_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(COMMON_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(SPEECH_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(OTHER_GESTURES_FOLDER); + + for(std::vector::iterator it = gesture_folders_to_copy.begin(); + it != gesture_folders_to_copy.end(); + ++it) { - callAfterCategoryFetch(gestures_cat_id, - boost::bind(&LLAppearanceMgr::shallowCopyCategory, - app_mgr, - gestures_cat_id, - dst_id, - cb)); - } + std::string& folder_name = *it; - // - Copy common gestures. - LLUUID common_gestures_cat_id = findDescendentCategoryIDByName( - gInventory.getLibraryRootFolderID(), - COMMON_GESTURES_FOLDER); - if (common_gestures_cat_id.notNull()) - { - callAfterCategoryFetch(common_gestures_cat_id, - boost::bind(&LLAppearanceMgr::shallowCopyCategory, - app_mgr, - common_gestures_cat_id, - dst_id, - cb)); + LLPointer cb(NULL); + if (folder_name == same_gender_gestures || + folder_name == COMMON_GESTURES_FOLDER || + folder_name == OTHER_GESTURES_FOLDER) + { + cb = new ActivateGestureCallback; + } + + // - Copy gender-specific gestures. + LLUUID cat_id = findDescendentCategoryIDByName( + gInventory.getLibraryRootFolderID(), + folder_name); + if (cat_id.notNull()) + { + callAfterCategoryFetch(cat_id, + boost::bind(&LLAppearanceMgr::shallowCopyCategory, + app_mgr, + cat_id, + dst_id, + cb)); + } } // This is really misnamed -- it means we have started loading diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 40f15fe86a..3430f265ae 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -922,6 +922,11 @@ void ActivateGestureCallback::fire(const LLUUID& inv_item) { if (inv_item.isNull()) return; + LLViewerInventoryItem* item = gInventory.getItem(inv_item); + if (!item) + return; + if (item->getType() != LLAssetType::AT_GESTURE) + return; LLGestureMgr::instance().activateGesture(inv_item); } -- cgit v1.2.3 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(-) (limited to 'indra') 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(+) (limited to 'indra') 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(-) (limited to 'indra') 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(-) (limited to 'indra') 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 (limited to 'indra') 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 477fb26c1ef458b6b552c7ac42bd0f18a483770f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 18 Jun 2010 17:38:21 -0400 Subject: Centralize LD_LIBRARY_PATH logic with new SET_TEST_PATH macro. Add ${SHARED_LIB_STAGING_DIR_RELEASE} to LD_LIBRARY_PATH for executing tests: otherwise Debug-build tests can't find (e.g.) the aprutil DLL, for which we don't build/package a debug variant. Leverage discovery that a CMake macro can accept a target variable name argument for LL_TEST_COMMAND macro. --- indra/cmake/LLAddBuildTest.cmake | 56 ++++++++++++++++++++++++++-------------- indra/cmake/LLSharedLibs.cmake | 7 ++--- indra/cmake/LLTestCommand.cmake | 11 ++++---- indra/test/CMakeLists.txt | 14 +++------- 4 files changed, 51 insertions(+), 37 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index bf4d9b72a9..e0c0ae2246 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -141,17 +141,9 @@ INCLUDE(GoogleMock) IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd = ${TEST_CMD}") ENDIF(LL_TEST_VERBOSE) - - IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) - ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) - ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) - ENDIF(WINDOWS) - LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${TEST_CMD}) - SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) + SET_TEST_PATH(LD_LIBRARY_PATH) + LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${TEST_CMD}) IF(LL_TEST_VERBOSE) MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script = ${TEST_SCRIPT_CMD}") ENDIF(LL_TEST_VERBOSE) @@ -233,16 +225,9 @@ FUNCTION(LL_ADD_INTEGRATION_TEST LIST(INSERT test_command test_exe_pos "${TEST_EXE}") ENDIF (test_exe_pos LESS 0) - IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) - ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) - ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) - ENDIF(WINDOWS) + SET_TEST_PATH(LD_LIBRARY_PATH) - LL_TEST_COMMAND("${LD_LIBRARY_PATH}" ${test_command}) - SET(TEST_SCRIPT_CMD ${LL_TEST_COMMAND_value}) + LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command}) if(TEST_DEBUG) message(STATUS "TEST_SCRIPT_CMD: ${TEST_SCRIPT_CMD}") @@ -258,3 +243,36 @@ FUNCTION(LL_ADD_INTEGRATION_TEST # ADD_TEST(INTEGRATION_TEST_RUNNER_${testname} ${TEST_SCRIPT_CMD}) ENDFUNCTION(LL_ADD_INTEGRATION_TEST) + +MACRO(SET_TEST_LIST LISTVAR) + IF(WINDOWS) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR} ${SHARED_LIB_STAGING_DIR}/Release) + ELSEIF(DARWIN) + # We typically build/package only Release variants of third-party + # libraries, so append the Release staging dir in case the library being + # sought doesn't have a debug variant. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources ${SHARED_LIB_STAGING_DIR}/Release/Resources /usr/lib) + ELSE(WINDOWS) + # Linux uses a single staging directory anyway. + set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) + ENDIF(WINDOWS) +ENDMACRO(SET_TEST_LIST) + +MACRO(SET_TEST_PATH PATHVAR) + set_test_list(test_list) + IF(WINDOWS) + set(sep "\;") + ELSE(WINDOWS) + set(sep ":") + ENDIF(WINDOWS) + set(path "") + set(optsep "") + foreach(dir ${test_list}) + set(path "${path}${optsep}${dir}") + set(optsep "${sep}") + endforeach(dir) + set(${PATHVAR} "${path}") +ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index 6f602680f4..b32a46b736 100644 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -5,7 +5,7 @@ macro(ll_deploy_sharedlibs_command target_exe) get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH) if(DARWIN) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources") + SET_TEST_LIST(SEARCH_DIRS) get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) if(IS_BUNDLE) # If its a bundle the exe is not in the target location, this should find it. @@ -15,9 +15,10 @@ macro(ll_deploy_sharedlibs_command target_exe) set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) endif(IS_BUNDLE) elseif(WINDOWS) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}" "$ENV{SystemRoot}/system32") + SET_TEST_LIST(SEARCH_DIRS) + LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32") elseif(LINUX) - set(SEARCH_DIRS "${SHARED_LIB_STAGING_DIR}") + SET_TEST_LIST(SEARCH_DIRS) set(OUTPUT_PATH ${OUTPUT_PATH}/lib) endif(DARWIN) diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake index fae5640493..3002720754 100644 --- a/indra/cmake/LLTestCommand.cmake +++ b/indra/cmake/LLTestCommand.cmake @@ -1,13 +1,14 @@ -MACRO(LL_TEST_COMMAND LD_LIBRARY_PATH) +MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH) # nat wonders how Kitware can use the term 'function' for a construct that # cannot return a value. And yet, variables you set inside a FUNCTION are # local. Try a MACRO instead. - SET(LL_TEST_COMMAND_value + SET(value ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py") IF(LD_LIBRARY_PATH) - LIST(APPEND LL_TEST_COMMAND_value "-l${LD_LIBRARY_PATH}") + LIST(APPEND value "-l${LD_LIBRARY_PATH}") ENDIF(LD_LIBRARY_PATH) - LIST(APPEND LL_TEST_COMMAND_value ${ARGN}) -##MESSAGE(STATUS "Will run: ${LL_TEST_COMMAND_value}") + LIST(APPEND value ${ARGN}) + SET(${OUTVAR} ${value}) +##MESSAGE(STATUS "Will run: ${value}") ENDMACRO(LL_TEST_COMMAND) diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt index c1360987a5..955c77c041 100644 --- a/indra/test/CMakeLists.txt +++ b/indra/test/CMakeLists.txt @@ -13,6 +13,7 @@ include(LLXML) include(LScript) include(Linking) include(Tut) +include(LLAddBuildTest) include(GoogleMock) @@ -117,19 +118,12 @@ endif (WINDOWS) get_target_property(TEST_EXE test LOCATION) -IF(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}) -ELSEIF(DARWIN) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources:/usr/lib) -ELSE(WINDOWS) - set(LD_LIBRARY_PATH ${SHARED_LIB_STAGING_DIR}:/usr/lib) -ENDIF(WINDOWS) - -LL_TEST_COMMAND("${LD_LIBRARY_PATH}" +SET_TEST_PATH(LD_LIBRARY_PATH) +LL_TEST_COMMAND(command "${LD_LIBRARY_PATH}" "${TEST_EXE}" "--output=${CMAKE_CURRENT_BINARY_DIR}/cpp_test_results.txt" "--touch=${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt") ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cpp_tests_ok.txt - COMMAND ${LL_TEST_COMMAND_value} + COMMAND ${command} DEPENDS test WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "C++ unit tests" -- cgit v1.2.3 From d34d8e491be478fddcece1f7590fbe9e07261480 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 18 Jun 2010 17:43:30 -0400 Subject: Make run_command() use subprocess.Popen() rather than os.popen(). This lets us capture the command's stderr as well as stdout. I've been perplexed recently by errors from Mac SetFile commands that didn't report stderr. --- indra/lib/python/indra/util/llmanifest.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/lib/python/indra/util/llmanifest.py b/indra/lib/python/indra/util/llmanifest.py index 7e5b86c53f..c33a03034a 100644 --- a/indra/lib/python/indra/util/llmanifest.py +++ b/indra/lib/python/indra/util/llmanifest.py @@ -39,6 +39,7 @@ import shutil import sys import tarfile import errno +import subprocess def path_ancestors(path): drive, path = os.path.splitdrive(os.path.normpath(path)) @@ -366,20 +367,23 @@ class LLManifest(object): def run_command(self, command): """ Runs an external command, and returns the output. Raises - an exception if the command reurns a nonzero status code. For - debugging/informational purpoases, prints out the command's + an exception if the command returns a nonzero status code. For + debugging/informational purposes, prints out the command's output as it is received.""" print "Running command:", command - fd = os.popen(command, 'r') + sys.stdout.flush() + child = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, + shell=True) lines = [] while True: - lines.append(fd.readline()) + lines.append(child.stdout.readline()) if lines[-1] == '': break else: print lines[-1], output = ''.join(lines) - status = fd.close() + child.stdout.close() + status = child.wait() if status: raise RuntimeError( "Command %s returned non-zero status (%s) \noutput:\n%s" -- cgit v1.2.3 From c2b1bf6a0d7fbcadc81ef375fd8f2a9944758e64 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 18 Jun 2010 17:50:01 -0400 Subject: Unmount Mac .sparseimage in case of errors while mounted. DarwinManifest.package_finish() creates and mounts a .sparseimage file, populating it with the desired package contents before creating a .dmg from it. However, errors while it's mounted would formerly bypass the 'hdiutil detach' command that unmounts it, leaving the host in a confused state that seemed to prevent subsequent retry attempts from succeeding. Also add code to try to diagnose/bypass mysterious SetFile -a V filename errors, so far without much luck. --- indra/newview/viewer_manifest.py | 112 +++++++++++++++++++++++---------------- 1 file changed, 65 insertions(+), 47 deletions(-) (limited to 'indra') diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index 0fd3cf5b3b..0b30128ff3 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -34,6 +34,7 @@ import sys import os.path import re import tarfile +import time viewer_dir = os.path.dirname(__file__) # add llmanifest library to our path so we don't have to muck with PYTHONPATH sys.path.append(os.path.join(viewer_dir, '../lib/python/indra/util')) @@ -737,55 +738,72 @@ class DarwinManifest(ViewerManifest): # mount the image and get the name of the mount point and device node hdi_output = self.run_command('hdiutil attach -private %r' % sparsename) - devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip() - volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip() + try: + devfile = re.search("/dev/disk([0-9]+)[^s]", hdi_output).group(0).strip() + volpath = re.search('HFS\s+(.+)', hdi_output).group(1).strip() - # Copy everything in to the mounted .dmg + # Copy everything in to the mounted .dmg - if self.default_channel() and not self.default_grid(): - app_name = "Second Life " + self.args['grid'] - else: - app_name = channel_standin.strip() - - # Hack: - # Because there is no easy way to coerce the Finder into positioning - # the app bundle in the same place with different app names, we are - # adding multiple .DS_Store files to svn. There is one for release, - # one for release candidate and one for first look. Any other channels - # will use the release .DS_Store, and will look broken. - # - Ambroff 2008-08-20 - dmg_template = os.path.join( - 'installers', - 'darwin', - '%s-dmg' % "".join(self.channel_unique().split()).lower()) - - if not os.path.exists (self.src_path_of(dmg_template)): - dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') - - for s,d in {self.get_dst_prefix():app_name + ".app", - os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns", - os.path.join(dmg_template, "background.jpg"): "background.jpg", - os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items(): - print "Copying to dmg", s, d - self.copy_action(self.src_path_of(s), os.path.join(volpath, d)) - - # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit) - for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store": - self.run_command('SetFile -a V %r' % os.path.join(volpath, f)) - - # Create the alias file (which is a resource file) from the .r - self.run_command('rez %r -o %r' % - (self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"), - os.path.join(volpath, "Applications"))) - - # Set the alias file's alias and custom icon bits - self.run_command('SetFile -a AC %r' % os.path.join(volpath, "Applications")) - - # Set the disk image root's custom icon bit - self.run_command('SetFile -a C %r' % volpath) - - # Unmount the image - self.run_command('hdiutil detach -force %r' % devfile) + if self.default_channel() and not self.default_grid(): + app_name = "Second Life " + self.args['grid'] + else: + app_name = channel_standin.strip() + + # Hack: + # Because there is no easy way to coerce the Finder into positioning + # the app bundle in the same place with different app names, we are + # adding multiple .DS_Store files to svn. There is one for release, + # one for release candidate and one for first look. Any other channels + # will use the release .DS_Store, and will look broken. + # - Ambroff 2008-08-20 + dmg_template = os.path.join( + 'installers', + 'darwin', + '%s-dmg' % "".join(self.channel_unique().split()).lower()) + + if not os.path.exists (self.src_path_of(dmg_template)): + dmg_template = os.path.join ('installers', 'darwin', 'release-dmg') + + for s,d in {self.get_dst_prefix():app_name + ".app", + os.path.join(dmg_template, "_VolumeIcon.icns"): ".VolumeIcon.icns", + os.path.join(dmg_template, "background.jpg"): "background.jpg", + os.path.join(dmg_template, "_DS_Store"): ".DS_Store"}.items(): + print "Copying to dmg", s, d + self.copy_action(self.src_path_of(s), os.path.join(volpath, d)) + + # Hide the background image, DS_Store file, and volume icon file (set their "visible" bit) + for f in ".VolumeIcon.icns", "background.jpg", ".DS_Store": + pathname = os.path.join(volpath, f) + # We've observed mysterious "no such file" failures of the SetFile + # command, especially on the first file listed above -- yet + # subsequent inspection of the target directory confirms it's + # there. Timing problem with copy command? Try to handle. + for x in xrange(3): + if os.path.exists(pathname): + print "Confirmed existence: %r" % pathname + break + print "Waiting for %s copy command to complete (%s)..." % (f, x+1) + sys.stdout.flush() + time.sleep(1) + # If we fall out of the loop above without a successful break, oh + # well, possibly we've mistaken the nature of the problem. In any + # case, don't hang up the whole build looping indefinitely, let + # the original problem manifest by executing the desired command. + self.run_command('SetFile -a V %r' % pathname) + + # Create the alias file (which is a resource file) from the .r + self.run_command('rez %r -o %r' % + (self.src_path_of("installers/darwin/release-dmg/Applications-alias.r"), + os.path.join(volpath, "Applications"))) + + # Set the alias file's alias and custom icon bits + self.run_command('SetFile -a AC %r' % os.path.join(volpath, "Applications")) + + # Set the disk image root's custom icon bit + self.run_command('SetFile -a C %r' % volpath) + finally: + # Unmount the image even if exceptions from any of the above + self.run_command('hdiutil detach -force %r' % devfile) print "Converting temp disk image to final disk image" self.run_command('hdiutil convert %(sparse)r -format UDZO -imagekey zlib-level=9 -o %(final)r' % {'sparse':sparsename, 'final':finalname}) -- cgit v1.2.3 From 8aef04f33c7df2d96c3a2a74b777b5950196b98e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 21 Jun 2010 11:56:59 -0400 Subject: EXT-4919 WIP - fixed problems with inventory fetch failing to time out, added copying/activation of more gesture folders --- indra/newview/llappearancemgr.cpp | 3 ++ indra/newview/llappearancemgr.h | 4 ++ indra/newview/llinventoryobserver.cpp | 64 ++++++++++------------- indra/newview/llinventoryobserver.h | 13 +---- indra/newview/llstartup.cpp | 97 +++++++++++++++++++++-------------- indra/newview/llstartup.h | 2 + 6 files changed, 94 insertions(+), 89 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 52a5587a16..7deaaf1593 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1083,6 +1083,7 @@ void LLAppearanceMgr::shallowCopyCategory(const LLUUID& src_id, const LLUUID& ds llwarns << "folder not found for src " << src_id.asString() << llendl; return; } + llinfos << "starting, src_id " << src_id << " name " << src_cat->getName() << " dst_id " << dst_id << llendl; LLUUID parent_id = dst_id; if(parent_id.isNull()) { @@ -1103,6 +1104,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; gInventory.getDirectDescendentsOf(src_id, cats, items); + llinfos << "copying " << items->count() << " items" << llendl; for (LLInventoryModel::item_array_t::const_iterator iter = items->begin(); iter != items->end(); ++iter) @@ -1142,6 +1144,7 @@ void LLAppearanceMgr::shallowCopyCategoryContents(const LLUUID& src_id, const LL case LLAssetType::AT_BODYPART: case LLAssetType::AT_GESTURE: { + llinfos << "copying inventory item " << item->getName() << llendl; copy_inventory_item(gAgent.getID(), item->getPermissions().getOwner(), item->getUUID(), diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index e42f9f7d6f..0896f1a5cb 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -313,6 +313,9 @@ public: } virtual void done() { + llinfos << this << " done with incomplete " << mIncomplete.size() + << " complete " << mComplete.size() << " calling callable" << llendl; + gInventory.removeObserver(this); doOnIdleOneTime(mCallable); delete this; @@ -355,6 +358,7 @@ public: return; } + llinfos << "stage1 got " << item_array.count() << " items, passing to stage2 " << llendl; uuid_vec_t ids; for(S32 i = 0; i < count; ++i) { diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 0ac8fbcb15..fbc79d5a02 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -62,8 +62,7 @@ #include "llsdutil.h" #include -const U32 LLInventoryFetchItemsObserver::MAX_NUM_ATTEMPTS_TO_PROCESS = 10; -const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 10.0f; +const F32 LLInventoryFetchItemsObserver::FETCH_TIMER_EXPIRY = 60.0f; LLInventoryObserver::LLInventoryObserver() @@ -143,52 +142,47 @@ void LLInventoryCompletionObserver::watchItem(const LLUUID& id) } LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const LLUUID& item_id) : - LLInventoryFetchObserver(item_id), - - mNumTries(MAX_NUM_ATTEMPTS_TO_PROCESS) + LLInventoryFetchObserver(item_id) { mIDs.clear(); mIDs.push_back(item_id); } LLInventoryFetchItemsObserver::LLInventoryFetchItemsObserver(const uuid_vec_t& item_ids) : - LLInventoryFetchObserver(item_ids), - - mNumTries(MAX_NUM_ATTEMPTS_TO_PROCESS) + LLInventoryFetchObserver(item_ids) { } void LLInventoryFetchItemsObserver::changed(U32 mask) { + llinfos << this << " remaining incomplete " << mIncomplete.size() + << " complete " << mComplete.size() + << " wait period " << mFetchingPeriod.getRemainingTimeF32() + << llendl; + // scan through the incomplete items and move or erase them as // appropriate. if (!mIncomplete.empty()) { - // if period of an attempt expired... - if (mFetchingPeriod.hasExpired()) - { - // ...reset timer and reduce count of attempts - mFetchingPeriod.reset(); - mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); - --mNumTries; - - LL_INFOS("InventoryFetch") << "LLInventoryFetchItemsObserver: " << this << ", attempt(s) left: " << (S32)mNumTries << LL_ENDL; - } - - // do we still have any attempts? - bool timeout_expired = mNumTries <= 0; + // Have we exceeded max wait time? + bool timeout_expired = mFetchingPeriod.hasExpired(); for (uuid_vec_t::iterator it = mIncomplete.begin(); it < mIncomplete.end(); ) { const LLUUID& item_id = (*it); LLViewerInventoryItem* item = gInventory.getItem(item_id); - if (!item) + if (item && item->isFinished()) + { + mComplete.push_back(item_id); + it = mIncomplete.erase(it); + } + else { if (timeout_expired) { // Just concede that this item hasn't arrived in reasonable time and continue on. - LL_WARNS("InventoryFetch") << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL; + llwarns << "Fetcher timed out when fetching inventory item UUID: " << item_id << LL_ENDL; it = mIncomplete.erase(it); } else @@ -196,22 +190,16 @@ void LLInventoryFetchItemsObserver::changed(U32 mask) // Keep trying. ++it; } - continue; - } - if (item->isFinished()) - { - mComplete.push_back(item_id); - it = mIncomplete.erase(it); - continue; } - ++it; } - if (mIncomplete.empty()) - { - mNumTries = MAX_NUM_ATTEMPTS_TO_PROCESS; - done(); - } + } + + if (mIncomplete.empty()) + { + llinfos << this << " done at remaining incomplete " + << mIncomplete.size() << " complete " << mComplete.size() << llendl; + done(); } //llinfos << "LLInventoryFetchItemsObserver::changed() mComplete size " << mComplete.size() << llendl; //llinfos << "LLInventoryFetchItemsObserver::changed() mIncomplete size " << mIncomplete.size() << llendl; @@ -329,8 +317,8 @@ void LLInventoryFetchItemsObserver::startFetch() items_llsd.append(item_entry); } - mFetchingPeriod.resetWithExpiry(FETCH_TIMER_EXPIRY); - mNumTries = MAX_NUM_ATTEMPTS_TO_PROCESS; + mFetchingPeriod.reset(); + mFetchingPeriod.setTimerExpirySec(FETCH_TIMER_EXPIRY); fetch_items_from_llsd(items_llsd); } diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 72c13f55c6..4a88a65bf8 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -109,18 +109,7 @@ public: /*virtual*/ void startFetch(); /*virtual*/ void changed(U32 mask); private: - S8 mNumTries; // Number of times changed() was called without success - LLFrameTimer mFetchingPeriod; - - /** - * If the viewer gets a notification, your observer assumes - * that that notification is for itself and then tries to process - * the results. The notification could be for something else (e.g. - * you're fetching an item and a notification gets triggered because - * you renamed some other item). This counter is to specify how many - * periods of time to wait for before giving up. - */ - static const U32 MAX_NUM_ATTEMPTS_TO_PROCESS; + LLTimer mFetchingPeriod; /** * Period of waiting a notification when requested items get added into inventory. diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 5bd97efce6..d64e3aac14 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2372,6 +2372,7 @@ void asset_callback_nothing(LLVFS*, const LLUUID&, LLAssetType::EType, void*, S3 } // *HACK: Must match name in Library or agent inventory +const std::string ROOT_GESTURES_FOLDER = "Gestures"; const std::string COMMON_GESTURES_FOLDER = "Common Gestures"; const std::string MALE_GESTURES_FOLDER = "Male Gestures"; const std::string FEMALE_GESTURES_FOLDER = "Female Gestures"; @@ -2405,6 +2406,61 @@ bool callback_choose_gender(const LLSD& notification, const LLSD& response) return false; } +void LLStartUp::copyLibraryGestures(const std::string& same_gender_gestures) +{ + llinfos << "Copying library gestures" << llendl; + + // Copy gestures + LLUUID lib_gesture_cat_id = + gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE,false,true); + if (lib_gesture_cat_id.isNull()) + { + llwarns << "Unable to copy gestures, source category not found" << llendl; + } + LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE); + + std::vector gesture_folders_to_copy; + gesture_folders_to_copy.push_back(MALE_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(FEMALE_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(COMMON_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(SPEECH_GESTURES_FOLDER); + gesture_folders_to_copy.push_back(OTHER_GESTURES_FOLDER); + + for(std::vector::iterator it = gesture_folders_to_copy.begin(); + it != gesture_folders_to_copy.end(); + ++it) + { + std::string& folder_name = *it; + + LLPointer cb(NULL); + + if (folder_name == same_gender_gestures || + folder_name == COMMON_GESTURES_FOLDER || + folder_name == OTHER_GESTURES_FOLDER) + { + cb = new ActivateGestureCallback; + } + + + LLUUID cat_id = findDescendentCategoryIDByName(lib_gesture_cat_id,folder_name); + if (cat_id.isNull()) + { + llwarns << "failed to find gesture folder for " << folder_name << llendl; + } + else + { + llinfos << "initiating fetch and copy for " << folder_name << " cat_id " << cat_id << llendl; + LLAppearanceMgr* app_mgr = LLAppearanceMgr::getInstance(); + callAfterCategoryFetch(cat_id, + boost::bind(&LLAppearanceMgr::shallowCopyCategory, + app_mgr, + cat_id, + dst_id, + cb)); + } + } +} + void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, const std::string& gender_name ) { @@ -2448,45 +2504,8 @@ void LLStartUp::loadInitialOutfit( const std::string& outfit_folder_name, } // Copy gestures - LLUUID dst_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_GESTURE); - LLAppearanceMgr *app_mgr = &(LLAppearanceMgr::instance()); - - std::vector gesture_folders_to_copy; - gesture_folders_to_copy.push_back(MALE_GESTURES_FOLDER); - gesture_folders_to_copy.push_back(FEMALE_GESTURES_FOLDER); - gesture_folders_to_copy.push_back(COMMON_GESTURES_FOLDER); - gesture_folders_to_copy.push_back(SPEECH_GESTURES_FOLDER); - gesture_folders_to_copy.push_back(OTHER_GESTURES_FOLDER); - - for(std::vector::iterator it = gesture_folders_to_copy.begin(); - it != gesture_folders_to_copy.end(); - ++it) - { - std::string& folder_name = *it; - - LLPointer cb(NULL); - if (folder_name == same_gender_gestures || - folder_name == COMMON_GESTURES_FOLDER || - folder_name == OTHER_GESTURES_FOLDER) - { - cb = new ActivateGestureCallback; - } - - // - Copy gender-specific gestures. - LLUUID cat_id = findDescendentCategoryIDByName( - gInventory.getLibraryRootFolderID(), - folder_name); - if (cat_id.notNull()) - { - callAfterCategoryFetch(cat_id, - boost::bind(&LLAppearanceMgr::shallowCopyCategory, - app_mgr, - cat_id, - dst_id, - cb)); - } - } - + copyLibraryGestures(same_gender_gestures); + // This is really misnamed -- it means we have started loading // an outfit/shape that will give the avatar a gender eventually. JC gAgent.setGenderChosen(TRUE); diff --git a/indra/newview/llstartup.h b/indra/newview/llstartup.h index e1e108ca6a..661ed29fc7 100644 --- a/indra/newview/llstartup.h +++ b/indra/newview/llstartup.h @@ -96,6 +96,8 @@ public: // Load default fonts not already loaded at start screen static void fontInit(); + static void LLStartUp::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. // gender_name is either "male" or "female" -- cgit v1.2.3 From 4e538adca41d486125c3b887ce694c457bcab157 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 21 Jun 2010 12:18:16 -0400 Subject: EXT-7926: fix broken LD_LIBRARY_PATH handling on Windows. Recent checkins introduced two different CMake macros SET_TEST_LIST (which returned a CMake list of PATH directory strings) and SET_TEST_PATH (which returned a single platform-appropriate PATH string). On Windows, whose path-separator character is ';', SET_TEST_PATH interacted badly with CMake: in CMake, a single string containing ';' characters is indistinguishable from a list of strings. Eliminate the return-single-string form, redirecting the name SET_TEST_PATH to the macro that returns a CMake list. Make LL_TEST_COMMAND expect a list value, prepending each directory string with run_build_test.py's -l switch. --- indra/cmake/LLAddBuildTest.cmake | 19 +------------------ indra/cmake/LLSharedLibs.cmake | 8 ++++---- indra/cmake/LLTestCommand.cmake | 10 ++++++---- 3 files changed, 11 insertions(+), 26 deletions(-) (limited to 'indra') diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake index e0c0ae2246..dd49caaf20 100644 --- a/indra/cmake/LLAddBuildTest.cmake +++ b/indra/cmake/LLAddBuildTest.cmake @@ -226,7 +226,6 @@ FUNCTION(LL_ADD_INTEGRATION_TEST ENDIF (test_exe_pos LESS 0) SET_TEST_PATH(LD_LIBRARY_PATH) - LL_TEST_COMMAND(TEST_SCRIPT_CMD "${LD_LIBRARY_PATH}" ${test_command}) if(TEST_DEBUG) @@ -244,7 +243,7 @@ FUNCTION(LL_ADD_INTEGRATION_TEST ENDFUNCTION(LL_ADD_INTEGRATION_TEST) -MACRO(SET_TEST_LIST LISTVAR) +MACRO(SET_TEST_PATH LISTVAR) IF(WINDOWS) # We typically build/package only Release variants of third-party # libraries, so append the Release staging dir in case the library being @@ -259,20 +258,4 @@ MACRO(SET_TEST_LIST LISTVAR) # Linux uses a single staging directory anyway. set(${LISTVAR} ${SHARED_LIB_STAGING_DIR} /usr/lib) ENDIF(WINDOWS) -ENDMACRO(SET_TEST_LIST) - -MACRO(SET_TEST_PATH PATHVAR) - set_test_list(test_list) - IF(WINDOWS) - set(sep "\;") - ELSE(WINDOWS) - set(sep ":") - ENDIF(WINDOWS) - set(path "") - set(optsep "") - foreach(dir ${test_list}) - set(path "${path}${optsep}${dir}") - set(optsep "${sep}") - endforeach(dir) - set(${PATHVAR} "${path}") ENDMACRO(SET_TEST_PATH) diff --git a/indra/cmake/LLSharedLibs.cmake b/indra/cmake/LLSharedLibs.cmake index b32a46b736..009eeae781 100644 --- a/indra/cmake/LLSharedLibs.cmake +++ b/indra/cmake/LLSharedLibs.cmake @@ -5,7 +5,7 @@ macro(ll_deploy_sharedlibs_command target_exe) get_filename_component(OUTPUT_PATH ${TARGET_LOCATION} PATH) if(DARWIN) - SET_TEST_LIST(SEARCH_DIRS) + SET_TEST_PATH(SEARCH_DIRS) get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) if(IS_BUNDLE) # If its a bundle the exe is not in the target location, this should find it. @@ -15,10 +15,10 @@ macro(ll_deploy_sharedlibs_command target_exe) set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) endif(IS_BUNDLE) elseif(WINDOWS) - SET_TEST_LIST(SEARCH_DIRS) + SET_TEST_PATH(SEARCH_DIRS) LIST(APPEND SEARCH_DIRS "$ENV{SystemRoot}/system32") elseif(LINUX) - SET_TEST_LIST(SEARCH_DIRS) + SET_TEST_PATH(SEARCH_DIRS) set(OUTPUT_PATH ${OUTPUT_PATH}/lib) endif(DARWIN) @@ -72,4 +72,4 @@ macro(ll_stage_sharedlib DSO_TARGET) ) endif(DARWIN) -endmacro(ll_stage_sharedlib) \ No newline at end of file +endmacro(ll_stage_sharedlib) diff --git a/indra/cmake/LLTestCommand.cmake b/indra/cmake/LLTestCommand.cmake index 3002720754..554559edbd 100644 --- a/indra/cmake/LLTestCommand.cmake +++ b/indra/cmake/LLTestCommand.cmake @@ -5,10 +5,12 @@ MACRO(LL_TEST_COMMAND OUTVAR LD_LIBRARY_PATH) SET(value ${PYTHON_EXECUTABLE} "${CMAKE_SOURCE_DIR}/cmake/run_build_test.py") - IF(LD_LIBRARY_PATH) - LIST(APPEND value "-l${LD_LIBRARY_PATH}") - ENDIF(LD_LIBRARY_PATH) + FOREACH(dir ${LD_LIBRARY_PATH}) + LIST(APPEND value "-l${dir}") + ENDFOREACH(dir) LIST(APPEND value ${ARGN}) SET(${OUTVAR} ${value}) -##MESSAGE(STATUS "Will run: ${value}") +##IF(LL_TEST_VERBOSE) +## MESSAGE(STATUS "LL_TEST_COMMAND: ${value}") +##ENDIF(LL_TEST_VERBOSE) ENDMACRO(LL_TEST_COMMAND) -- 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(+) (limited to 'indra') 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 9634d542fe9552eaf6740fa6451eb451d98cf68e Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Mon, 21 Jun 2010 11:24:29 -0700 Subject: ND-46735 WIP JA and ES translation for set 12 --- .../skins/default/xui/es/floater_camera.xml | 27 +++---- .../skins/default/xui/es/floater_incoming_call.xml | 8 +- .../skins/default/xui/es/floater_snapshot.xml | 23 ++++-- .../default/xui/es/floater_voice_controls.xml | 8 +- .../skins/default/xui/es/inspect_object.xml | 11 ++- .../skins/default/xui/es/menu_hide_navbar.xml | 1 + .../skins/default/xui/es/menu_inventory.xml | 1 + .../skins/default/xui/es/menu_save_outfit.xml | 2 +- indra/newview/skins/default/xui/es/menu_viewer.xml | 17 ++-- .../newview/skins/default/xui/es/notifications.xml | 88 ++++++++++++++++++-- .../skins/default/xui/es/panel_edit_shape.xml | 13 ++- .../skins/default/xui/es/panel_edit_wearable.xml | 7 +- .../skins/default/xui/es/panel_outfit_edit.xml | 18 ++--- .../default/xui/es/panel_outfits_inventory.xml | 3 +- .../newview/skins/default/xui/es/panel_places.xml | 4 +- .../default/xui/es/panel_preferences_advanced.xml | 2 +- .../skins/default/xui/es/panel_status_bar.xml | 6 +- .../skins/default/xui/es/sidepanel_inventory.xml | 10 +-- indra/newview/skins/default/xui/es/strings.xml | 50 ++++++++++-- .../skins/default/xui/ja/floater_camera.xml | 27 +++---- .../skins/default/xui/ja/floater_incoming_call.xml | 8 +- .../skins/default/xui/ja/floater_snapshot.xml | 23 ++++-- .../default/xui/ja/floater_voice_controls.xml | 8 +- .../skins/default/xui/ja/inspect_object.xml | 10 +-- .../skins/default/xui/ja/menu_hide_navbar.xml | 1 + .../skins/default/xui/ja/menu_inventory.xml | 1 + .../skins/default/xui/ja/menu_save_outfit.xml | 2 +- indra/newview/skins/default/xui/ja/menu_viewer.xml | 17 ++-- .../newview/skins/default/xui/ja/notifications.xml | 93 +++++++++++++++++++--- .../skins/default/xui/ja/panel_edit_shape.xml | 13 ++- .../skins/default/xui/ja/panel_edit_wearable.xml | 7 +- .../skins/default/xui/ja/panel_outfit_edit.xml | 18 ++--- .../default/xui/ja/panel_outfits_inventory.xml | 3 +- .../newview/skins/default/xui/ja/panel_places.xml | 4 +- .../default/xui/ja/panel_preferences_advanced.xml | 2 +- .../skins/default/xui/ja/panel_status_bar.xml | 6 +- .../skins/default/xui/ja/sidepanel_inventory.xml | 10 +-- indra/newview/skins/default/xui/ja/strings.xml | 60 +++++++++++--- 38 files changed, 438 insertions(+), 174 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/es/floater_camera.xml b/indra/newview/skins/default/xui/es/floater_camera.xml index 787c37e12c..c625407ba2 100644 --- a/indra/newview/skins/default/xui/es/floater_camera.xml +++ b/indra/newview/skins/default/xui/es/floater_camera.xml @@ -9,35 +9,28 @@ Mover la cámara arriba y abajo, izquierda y derecha - - Orbital + + Modos de cámara - Panorámica + Orbital - Zoom - Panóramica - - Posición de tu cámara + + Vistas predefinidas Centrar el objeto - + - - - -