From 641ec3da61221ffd13cb7d1777c28505a54e2d58 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Jun 2010 14:50:48 -0700 Subject: EXT-7701 language change --- indra/newview/skins/default/xui/en/widgets/flat_list_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml index a71b293f31..e05ddf9815 100644 --- a/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml +++ b/indra/newview/skins/default/xui/en/widgets/flat_list_view.xml @@ -11,6 +11,6 @@ name="no_items_msg" v_pad="10" h_pad="10" - value="There are no any items in the list" + value="No matches found" wrap="true" /> \ No newline at end of file -- cgit v1.2.3 From 9669923a7c370d43136cfc04b34247689aad1d3a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Jun 2010 14:59:24 -0700 Subject: EXT-7239 - Double-click on outfit title should wear outfit, Double-click on item should wear item decision was to remove double click behavior --- indra/newview/lloutfitslist.cpp | 15 --------------- indra/newview/lloutfitslist.h | 1 - indra/newview/llwearableitemslist.h | 7 ------- 3 files changed, 23 deletions(-) diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index e20b2e26be..caa29db9d3 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -266,9 +266,6 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) tab->setRightMouseDownCallback(boost::bind(&LLOutfitsList::onAccordionTabRightClick, this, _1, _2, _3, cat_id)); - tab->setDoubleClickCallback(boost::bind(&LLOutfitsList::onAccordionTabDoubleClick, this, - _1, _2, _3, cat_id)); - // Setting tab focus callback to monitor currently selected outfit. tab->setFocusReceivedCallback(boost::bind(&LLOutfitsList::changeOutfitSelection, this, list, cat_id)); @@ -610,18 +607,6 @@ void LLOutfitsList::onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const } } -void LLOutfitsList::onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id) -{ - LLAccordionCtrlTab* tab = dynamic_cast(ctrl); - if(is_tab_header_clicked(tab, y) && cat_id.notNull()) - { - LLViewerInventoryCategory* cat = gInventory.getCategory(cat_id); - if (!cat) return; - - LLAppearanceMgr::instance().wearInventoryCategory( cat, FALSE, FALSE ); - } -} - void LLOutfitsList::onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y) { LLWearableItemsList* list = dynamic_cast(ctrl); diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index bb516446d2..3f4a65a6e6 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -121,7 +121,6 @@ private: void applyFilter(const std::string& new_filter_substring); void onAccordionTabRightClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); - void onAccordionTabDoubleClick(LLUICtrl* ctrl, S32 x, S32 y, const LLUUID& cat_id); void onWearableItemsListRightClick(LLUICtrl* ctrl, S32 x, S32 y); void onSelectionChange(LLUICtrl* ctrl); diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index f03336186c..73a176d061 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -83,14 +83,7 @@ class LLPanelWearableOutfitItem : public LLPanelInventoryListItemBase public: static LLPanelWearableOutfitItem* create(LLViewerInventoryItem* item); - /** - * Puts item on if it is not worn by agent - * otherwise takes it off on double click. - */ - /*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask); - protected: - LLPanelWearableOutfitItem(LLViewerInventoryItem* item); }; -- cgit v1.2.3 From 512cd85e09db1b7103458bd5828c6f21b3e5bf83 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Jun 2010 15:22:37 -0700 Subject: EXT-7239 FIX Double-click on outfit title should wear outfit, Double-click on item should wear item decision was to remove double click behavior --- indra/newview/llwearableitemslist.cpp | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index d56a331000..58a0ea8ef5 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -107,26 +107,6 @@ LLPanelWearableOutfitItem* LLPanelWearableOutfitItem::create(LLViewerInventoryIt return list_item; } -BOOL LLPanelWearableOutfitItem::handleDoubleClick(S32 x, S32 y, MASK mask) -{ - LLViewerInventoryItem* item = getItem(); - if (item) - { - LLUUID id = item->getUUID(); - - if (get_is_item_worn(id)) - { - LLAppearanceMgr::getInstance()->removeItemFromAvatar(id); - } - else - { - LLAppearanceMgr::getInstance()->wearItemOnAvatar(id, true, false); - } - } - - return LLUICtrl::handleDoubleClick(x, y, mask); -} - LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item) : LLPanelInventoryListItemBase(item) { -- cgit v1.2.3 From 92768103af4e90dd3e0017cf2048c4a8641391b7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Thu, 10 Jun 2010 15:30:32 -0700 Subject: EXT-7781 WIP Editing Shape: Labels on the previews are unreadable --- indra/newview/skins/default/xui/en/panel_scrolling_param.xml | 2 ++ 1 file changed, 2 insertions(+) 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 19eb4bb0d6..9aa0ff1ea1 100644 --- a/indra/newview/skins/default/xui/en/panel_scrolling_param.xml +++ b/indra/newview/skins/default/xui/en/panel_scrolling_param.xml @@ -12,6 +12,7 @@ layout="topleft" left="12" name="min param text" + text_color="EmphasisColor" top="120" width="120" /> Date: Thu, 10 Jun 2010 17:07:45 -0700 Subject: EXT-7750 - Wearing list does not need to be bold or show link or worn --- indra/newview/llfolderview.cpp | 1 + indra/newview/llfolderview.h | 3 +++ indra/newview/llfolderviewitem.cpp | 7 +++++-- indra/newview/llinventorypanel.cpp | 5 ++--- indra/newview/llinventorypanel.h | 7 ++++--- indra/newview/skins/default/xui/en/panel_outfits_inventory.xml | 1 + 6 files changed, 16 insertions(+), 8 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index a87f7288fa..5682e691cd 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -181,6 +181,7 @@ LLFolderView::LLFolderView(const Params& p) mRenameItem( NULL ), mNeedsScroll( FALSE ), mEnableScroll( true ), + mUseLabelSuffix(p.use_label_suffix), mPinningSelectedItem(FALSE), mNeedsAutoSelect( FALSE ), mAutoSelectOverride(FALSE), diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 0dfdbd364b..55eb543f5f 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -96,6 +96,7 @@ public: Mandatory parent_panel; Optional task_id; Optional title; + Optional use_label_suffix; }; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -273,6 +274,7 @@ public: virtual S32 notify(const LLSD& info) ; void setEnableScroll(bool enable_scroll) { mEnableScroll = enable_scroll; } + bool useLabelSuffix() { return mUseLabelSuffix; } private: void updateRenamerPosition(); @@ -309,6 +311,7 @@ protected: BOOL mNeedsAutoSelect; BOOL mAutoSelectOverride; BOOL mNeedsAutoRename; + bool mUseLabelSuffix; BOOL mDebugFilters; U32 mSortOrder; diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 0c437cf035..50b35bfc69 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -289,8 +289,11 @@ void LLFolderViewItem::refreshFromListener() mCreationDate = mListener->getCreationDate(); dirtyFilter(); } - mLabelStyle = mListener->getLabelStyle(); - mLabelSuffix = mListener->getLabelSuffix(); + if (mRoot->useLabelSuffix()) + { + mLabelStyle = mListener->getLabelStyle(); + mLabelSuffix = mListener->getLabelSuffix(); + } } } diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 7d81cf18aa..a20bf366c5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -110,7 +110,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : } } -BOOL LLInventoryPanel::postBuild() +void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { LLMemType mt(LLMemType::MTYPE_INVENTORY_POST_BUILD); @@ -128,6 +128,7 @@ BOOL LLInventoryPanel::postBuild() p.rect = folder_rect; p.parent_panel = this; p.tool_tip = p.name; + p.use_label_suffix = params.use_label_suffix; mFolderRoot = LLUICtrlFactory::create(p); mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); } @@ -174,8 +175,6 @@ BOOL LLInventoryPanel::postBuild() setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); - - return TRUE; } LLInventoryPanel::~LLInventoryPanel() diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 67c8904868..ad17227d56 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -87,6 +87,7 @@ public: Optional show_item_link_overlays; Optional filter; Optional start_folder; + Optional use_label_suffix; Params() : sort_order_setting("sort_order_setting"), @@ -94,7 +95,8 @@ public: allow_multi_select("allow_multi_select", true), show_item_link_overlays("show_item_link_overlays", false), filter("filter"), - start_folder("start_folder") + start_folder("start_folder"), + use_label_suffix("use_label_suffix", true) {} }; @@ -103,6 +105,7 @@ public: //-------------------------------------------------------------------- protected: LLInventoryPanel(const Params&); + void initFromParams(const Params&); friend class LLUICtrlFactory; public: virtual ~LLInventoryPanel(); @@ -110,8 +113,6 @@ public: public: LLInventoryModel* getModel() { return mInventory; } - BOOL postBuild(); - // LLView methods void draw(); BOOL handleHover(S32 x, S32 y, MASK mask); diff --git a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml index de1f2cf31b..7a7f910171 100644 --- a/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outfits_inventory.xml @@ -48,6 +48,7 @@ mouse_opaque="true" name="cof_tab" start_folder="Current Outfit" + use_label_suffix="false" width="315" /> Date: Thu, 10 Jun 2010 17:08:45 -0700 Subject: EXT-7781 FIX Editing Shape: Labels on the previews are unreadable --- indra/newview/skins/default/xui/en/panel_scrolling_param.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 9aa0ff1ea1..78d64620a5 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,8 @@ layout="topleft" left="12" name="min param text" - text_color="EmphasisColor" + text_color="EmphasisColor" + font_shadow="hard" top="120" width="120" /> Date: Fri, 11 Jun 2010 08:26:18 -0400 Subject: EXT-6571 WIP - adding ability to handle late-arriving assets --- indra/newview/app_settings/settings.xml | 22 ++++++ indra/newview/llappearancemgr.cpp | 131 +++++++++++++++++++++++++------- 2 files changed, 127 insertions(+), 26 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 864a79c38a..eb443e0e70 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3534,6 +3534,28 @@ Value 9.0 + ForceAssetFail + + Comment + Force wearable fetches to fail for this asset type. + Persist + 1 + Type + U32 + Value + 255 + + MaxWearableWaitTime + + Comment + Max seconds to wait for wearable assets to fetch. + Persist + 1 + Type + F32 + Value + 60.0 + ForceShowGrid Comment diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a899926938..28a0ba8817 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -223,8 +223,16 @@ public: void onWearableAssetFetch(LLWearable *wearable); void onAllComplete(); - + typedef std::list found_list_t; + found_list_t& getFoundList(); + void eraseTypeToLink(LLWearableType::EType type); + void eraseTypeToRecover(LLWearableType::EType type); + void setObjItems(const LLInventoryModel::item_array_t& items); + void setGestItems(const LLInventoryModel::item_array_t& items); + bool isValid(); + +private: found_list_t mFoundList; LLInventoryModel::item_array_t mObjItems; LLInventoryModel::item_array_t mGestItems; @@ -234,34 +242,89 @@ public: S32 mResolved; LLTimer mWaitTime; bool mFired; + typedef std::set type_set_hp; + static type_set_hp sActiveHoldingPatterns; + bool mIsValid; }; +LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPatterns; + LLWearableHoldingPattern::LLWearableHoldingPattern(): mResolved(0), - mFired(false) + mFired(false), + mIsValid(true) { + if (sActiveHoldingPatterns.size()>0) + { + llinfos << "Creating LLWearableHoldingPattern when " + << sActiveHoldingPatterns.size() + << " other attempts are active." + << " Flagging others as invalid." + << llendl; + for (type_set_hp::iterator it = sActiveHoldingPatterns.begin(); + it != sActiveHoldingPatterns.end(); + ++it) + { + (*it)->mIsValid = false; + } + + } + sActiveHoldingPatterns.insert(this); } LLWearableHoldingPattern::~LLWearableHoldingPattern() { + sActiveHoldingPatterns.erase(this); +} + +bool LLWearableHoldingPattern::isValid() +{ + return mIsValid; +} + +LLWearableHoldingPattern::found_list_t& LLWearableHoldingPattern::getFoundList() +{ + return mFoundList; +} + +void LLWearableHoldingPattern::eraseTypeToLink(LLWearableType::EType type) +{ + mTypesToLink.erase(type); +} + +void LLWearableHoldingPattern::eraseTypeToRecover(LLWearableType::EType type) +{ + mTypesToRecover.erase(type); +} + +void LLWearableHoldingPattern::setObjItems(const LLInventoryModel::item_array_t& items) +{ + mObjItems = items; +} + +void LLWearableHoldingPattern::setGestItems(const LLInventoryModel::item_array_t& items) +{ + mGestItems = items; } bool LLWearableHoldingPattern::isFetchCompleted() { - return (mResolved >= (S32)mFoundList.size()); // have everything we were waiting for? + return (mResolved >= (S32)getFoundList().size()); // have everything we were waiting for? } bool LLWearableHoldingPattern::isTimedOut() { - static F32 max_wait_time = 60.0; // give up if wearable fetches haven't completed in max_wait_time seconds. + F32 max_wait_time = gSavedSettings.getF32("MaxWearableWaitTime"); // give up if wearable fetches haven't completed in max_wait_time seconds. return mWaitTime.getElapsedTimeF32() > max_wait_time; } void LLWearableHoldingPattern::checkMissingWearables() { + llassert(isValid()); // TODO: handle not valid case + std::vector found_by_type(LLWearableType::WT_COUNT,0); std::vector requested_by_type(LLWearableType::WT_COUNT,0); - for (found_list_t::iterator it = mFoundList.begin(); it != mFoundList.end(); ++it) + for (found_list_t::iterator it = getFoundList().begin(); it != getFoundList().end(); ++it) { LLFoundData &data = *it; if (data.mWearableType < LLWearableType::WT_COUNT) @@ -301,6 +364,8 @@ void LLWearableHoldingPattern::checkMissingWearables() void LLWearableHoldingPattern::onAllComplete() { + llassert(isValid()); // TODO: handle not valid case + // Activate all gestures in this folder if (mGestItems.count() > 0) { @@ -340,12 +405,16 @@ void LLWearableHoldingPattern::onAllComplete() void LLWearableHoldingPattern::onFetchCompletion() { + llassert(isValid()); // TODO: handle not valid case + checkMissingWearables(); } // Runs as an idle callback until all wearables are fetched (or we time out). bool LLWearableHoldingPattern::pollFetchCompletion() { + llassert(isValid()); // TODO: handle not valid case + bool completed = isFetchCompleted(); bool timed_out = isTimedOut(); bool done = completed || timed_out; @@ -378,8 +447,10 @@ public: } void fire(const LLUUID& item_id) { + llassert(mHolder->isValid()); // TODO: handle not valid case + llinfos << "Recovered item link for type " << mType << llendl; - mHolder->mTypesToLink.erase(mType); + mHolder->eraseTypeToLink(mType); // Add wearable to FoundData for actual wearing LLViewerInventoryItem *item = gInventory.getItem(item_id); LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; @@ -397,7 +468,7 @@ public: linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID ); found.mWearable = mWearable; - mHolder->mFoundList.push_front(found); + mHolder->getFoundList().push_front(found); } else { @@ -426,11 +497,13 @@ public: } void fire(const LLUUID& item_id) { + llassert(mHolder->isValid()); // TODO: handle not valid case + llinfos << "Recovered item for type " << mType << llendl; LLViewerInventoryItem *itemp = gInventory.getItem(item_id); mWearable->setItemID(item_id); LLPointer cb = new RecoveredItemLinkCB(mType,mWearable,mHolder); - mHolder->mTypesToRecover.erase(mType); + mHolder->eraseTypeToRecover(mType); llassert(itemp); if (itemp) { @@ -451,6 +524,8 @@ private: void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type) { + llassert(isValid()); // TODO: handle not valid case + // Try to recover by replacing missing wearable with a new one. LLNotificationsUtil::add("ReplacedMissingWearable"); lldebugs << "Wearable " << LLWearableType::getTypeLabel(type) @@ -481,7 +556,7 @@ bool LLWearableHoldingPattern::isMissingCompleted() void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() { - for (found_list_t::iterator it = mFoundList.begin(); it != mFoundList.end(); ++it) + for (found_list_t::iterator it = getFoundList().begin(); it != getFoundList().end(); ++it) { LLFoundData &data = *it; if ((data.mWearableType < LLWearableType::WT_COUNT) && (!data.mWearable)) @@ -495,6 +570,8 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() bool LLWearableHoldingPattern::pollMissingWearables() { + llassert(isValid()); // TODO: handle not valid case + bool timed_out = isTimedOut(); bool missing_completed = isMissingCompleted(); bool done = timed_out || missing_completed; @@ -516,8 +593,10 @@ bool LLWearableHoldingPattern::pollMissingWearables() void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) { + llassert(isValid()); // TODO: handle not valid case + mResolved += 1; // just counting callbacks, not successes. - llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << mFoundList.size() << llendl; + llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << getFoundList().size() << llendl; if (wearable) { llinfos << "wearable found, type " << wearable->getType() << " asset " << wearable->getAssetID() << llendl; @@ -538,8 +617,8 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) return; } - for (LLWearableHoldingPattern::found_list_t::iterator iter = mFoundList.begin(); - iter != mFoundList.end(); ++iter) + for (LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin(); + iter != getFoundList().end(); ++iter) { LLFoundData& data = *iter; if(wearable->getAssetID() == data.mAssetID) @@ -1143,8 +1222,8 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo // that we recursed through. for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) { - for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); - iter != holder->mFoundList.end(); ++iter) + for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->getFoundList().begin(); + iter != holder->getFoundList().end(); ++iter) { LLFoundData& data = *iter; LLWearable* wearable = data.mWearable; @@ -1236,8 +1315,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF() LLWearableHoldingPattern* holder = new LLWearableHoldingPattern; - holder->mObjItems = obj_items; - holder->mGestItems = gest_items; + holder->setObjItems(obj_items); + holder->setGestItems(gest_items); // Note: can't do normal iteration, because if all the // wearables can be resolved immediately, then the @@ -1248,6 +1327,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF() { LLViewerInventoryItem *item = wear_items.get(i); LLViewerInventoryItem *linked_item = item ? item->getLinkedItem() : NULL; + + // Fault injection: use debug setting to test asset + // fetch failures (should be replaced by new defaults in + // lost&found). + U32 skip_type = gSavedSettings.getU32("ForceAssetFail"); + if (item && item->getIsLinkType() && linked_item) { LLFoundData found(linked_item->getUUID(), @@ -1257,18 +1342,12 @@ void LLAppearanceMgr::updateAppearanceFromCOF() linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID ); -#if 0 - // Fault injection: uncomment this block to test asset - // fetch failures (should be replaced by new defaults in - // lost&found). - if (found.mWearableType == LLWearableType::WT_SHAPE || found.mWearableType == LLWearableType::WT_JACKET) + if (skip_type != LLWearableType::WT_INVALID && found.mWearableType == skip_type) { found.mAssetID.generate(); // Replace with new UUID, guaranteed not to exist in DB - } -#endif //pushing back, not front, to preserve order of wearables for LLAgentWearables - holder->mFoundList.push_back(found); + holder->getFoundList().push_back(found); } else { @@ -1283,8 +1362,8 @@ void LLAppearanceMgr::updateAppearanceFromCOF() } } - for (LLWearableHoldingPattern::found_list_t::iterator it = holder->mFoundList.begin(); - it != holder->mFoundList.end(); ++it) + for (LLWearableHoldingPattern::found_list_t::iterator it = holder->getFoundList().begin(); + it != holder->getFoundList().end(); ++it) { LLFoundData& found = *it; -- cgit v1.2.3 From 5777824df41956fbb1c4592c08ce693f28182fdc Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Fri, 11 Jun 2010 18:08:59 -0400 Subject: EXT-6571 WIP - partial handling of late arriving assets --- indra/newview/llappearancemgr.cpp | 128 +++++++++++++++++++++++++++++++++----- 1 file changed, 111 insertions(+), 17 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1c2bdf07df..c19b3b50c1 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -261,6 +261,7 @@ public: void setObjItems(const LLInventoryModel::item_array_t& items); void setGestItems(const LLInventoryModel::item_array_t& items); bool isValid(); + void handleLateArrivals(); private: found_list_t mFoundList; @@ -275,6 +276,8 @@ private: typedef std::set type_set_hp; static type_set_hp sActiveHoldingPatterns; bool mIsValid; + std::set mLateArrivals; + bool mIsAllComplete; }; LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPatterns; @@ -282,7 +285,8 @@ LLWearableHoldingPattern::type_set_hp LLWearableHoldingPattern::sActiveHoldingPa LLWearableHoldingPattern::LLWearableHoldingPattern(): mResolved(0), mFired(false), - mIsValid(true) + mIsValid(true), + mIsAllComplete(false) { if (sActiveHoldingPatterns.size()>0) { @@ -350,7 +354,10 @@ bool LLWearableHoldingPattern::isTimedOut() void LLWearableHoldingPattern::checkMissingWearables() { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } std::vector found_by_type(LLWearableType::WT_COUNT,0); std::vector requested_by_type(LLWearableType::WT_COUNT,0); @@ -394,7 +401,10 @@ void LLWearableHoldingPattern::checkMissingWearables() void LLWearableHoldingPattern::onAllComplete() { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } // Activate all gestures in this folder if (mGestItems.count() > 0) @@ -431,11 +441,19 @@ void LLWearableHoldingPattern::onAllComplete() // Only safe to delete if all wearable callbacks and all missing wearables completed. delete this; } + else + { + mIsAllComplete = true; + handleLateArrivals(); + } } void LLWearableHoldingPattern::onFetchCompletion() { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } checkMissingWearables(); } @@ -443,7 +461,10 @@ void LLWearableHoldingPattern::onFetchCompletion() // Runs as an idle callback until all wearables are fetched (or we time out). bool LLWearableHoldingPattern::pollFetchCompletion() { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } bool completed = isFetchCompleted(); bool timed_out = isTimedOut(); @@ -477,7 +498,10 @@ public: } void fire(const LLUUID& item_id) { - llassert(mHolder->isValid()); // TODO: handle not valid case + if (!mHolder->isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } llinfos << "Recovered item link for type " << mType << llendl; mHolder->eraseTypeToLink(mType); @@ -492,11 +516,11 @@ public: if (item) { LLFoundData found(linked_item->getUUID(), - linked_item->getAssetUUID(), - linked_item->getName(), - linked_item->getType(), - linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID - ); + linked_item->getAssetUUID(), + linked_item->getName(), + linked_item->getType(), + linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID + ); found.mWearable = mWearable; mHolder->getFoundList().push_front(found); } @@ -527,7 +551,10 @@ public: } void fire(const LLUUID& item_id) { - llassert(mHolder->isValid()); // TODO: handle not valid case + if (!mHolder->isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } llinfos << "Recovered item for type " << mType << llendl; LLViewerInventoryItem *itemp = gInventory.getItem(item_id); @@ -554,7 +581,10 @@ private: void LLWearableHoldingPattern::recoverMissingWearable(LLWearableType::EType type) { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } // Try to recover by replacing missing wearable with a new one. LLNotificationsUtil::add("ReplacedMissingWearable"); @@ -600,7 +630,10 @@ void LLWearableHoldingPattern::clearCOFLinksForMissingWearables() bool LLWearableHoldingPattern::pollMissingWearables() { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } bool timed_out = isTimedOut(); bool missing_completed = isMissingCompleted(); @@ -621,9 +654,63 @@ bool LLWearableHoldingPattern::pollMissingWearables() return done; } +// Handle wearables that arrived after the timeout period expired. +void LLWearableHoldingPattern::handleLateArrivals() +{ + // Only safe to run if we have previously finished the missing + // wearables and other processing - otherwise we could be in some + // intermediate state - but have not been superceded by a later + // outfit change request. + if (mLateArrivals.size() == 0) + { + // Nothing to process. + return; + } + if (!isValid()) + { + llwarns << "Late arrivals not handled - outfit change no longer valid" << llendl; + } + if (!mIsAllComplete) + { + llwarns << "Late arrivals not handled - in middle of missing wearables processing" << llendl; + } + + llinfos << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl; + + // Update mFoundList using late-arriving wearables. + for (LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin(); + iter != getFoundList().end(); ++iter) + { + LLFoundData& data = *iter; + for (std::set::iterator wear_it = mLateArrivals.begin(); + wear_it != mLateArrivals.end(); + ++wear_it) + { + LLWearable *wearable = *wear_it; + + if(wearable->getAssetID() == data.mAssetID) + { + data.mWearable = wearable; + // BAP failing this means inventory or asset server + // are corrupted in a way we don't handle. + llassert((data.mWearableType < LLWearableType::WT_COUNT) && (wearable->getType() == data.mWearableType)); + break; + } + } + } + + // TODO: handle corresponding default wearable links? + + // Update appearance based on mFoundList + LLAppearanceMgr::instance().updateAgentWearables(this, false); +} + void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) { - llassert(isValid()); // TODO: handle not valid case + if (!isValid()) + { + llwarns << "skipping because LLWearableHolding pattern is invalid (superceded by later outfit request)" << llendl; + } mResolved += 1; // just counting callbacks, not successes. llinfos << "onWearableAssetFetch, resolved count " << mResolved << " of requested " << getFoundList().size() << llendl; @@ -639,6 +726,14 @@ void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) if (mFired) { llwarns << "called after holder fired" << llendl; + if (wearable) + { + mLateArrivals.insert(wearable); + if (mIsAllComplete) + { + handleLateArrivals(); + } + } return; } @@ -1269,8 +1364,7 @@ void LLAppearanceMgr::updateAgentWearables(LLWearableHoldingPattern* holder, boo LLInventoryItem::item_array_t items; LLDynamicArray< LLWearable* > wearables; - // For each wearable type, find the first instance in the category - // that we recursed through. + // For each wearable type, find the wearables of that type. for( S32 i = 0; i < LLWearableType::WT_COUNT; i++ ) { for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->getFoundList().begin(); -- cgit v1.2.3 From 8364708595a87e426bf348826698e674976b9e00 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 14 Jun 2010 13:15:58 -0400 Subject: EXT-6571 WIP - basic handling of late arriving assets --- indra/newview/llappearancemgr.cpp | 43 +++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index c19b3b50c1..a164cfeaa1 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -216,13 +216,15 @@ struct LLFoundData const LLUUID& asset_id, const std::string& name, const LLAssetType::EType& asset_type, - const LLWearableType::EType& wearable_type + const LLWearableType::EType& wearable_type, + const bool is_replacement = false ) : mItemID(item_id), mAssetID(asset_id), mName(name), mAssetType(asset_type), mWearableType(wearable_type), + mIsReplacement(is_replacement), mWearable( NULL ) {} LLUUID mItemID; @@ -231,6 +233,7 @@ struct LLFoundData LLAssetType::EType mAssetType; LLWearableType::EType mWearableType; LLWearable* mWearable; + bool mIsReplacement; }; @@ -519,7 +522,8 @@ public: linked_item->getAssetUUID(), linked_item->getName(), linked_item->getType(), - linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID + linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID, + true // is replacement ); found.mWearable = mWearable; mHolder->getFoundList().push_front(found); @@ -678,6 +682,7 @@ void LLWearableHoldingPattern::handleLateArrivals() llinfos << "Need to handle " << mLateArrivals.size() << " late arriving wearables" << llendl; // Update mFoundList using late-arriving wearables. + std::set replaced_types; for (LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin(); iter != getFoundList().end(); ++iter) { @@ -687,10 +692,15 @@ void LLWearableHoldingPattern::handleLateArrivals() ++wear_it) { LLWearable *wearable = *wear_it; - + if(wearable->getAssetID() == data.mAssetID) { data.mWearable = wearable; + + replaced_types.insert(data.mWearableType); + + LLAppearanceMgr::instance().addCOFItemLink(data.mItemID,false); + // BAP failing this means inventory or asset server // are corrupted in a way we don't handle. llassert((data.mWearableType < LLWearableType::WT_COUNT) && (wearable->getType() == data.mWearableType)); @@ -699,7 +709,32 @@ void LLWearableHoldingPattern::handleLateArrivals() } } - // TODO: handle corresponding default wearable links? + // Remove COF links for any default wearables previously used to replace the late arrivals. + // All this pussyfooting around with a while loop and explicit + // iterator incrementing is to allow removing items from the list + // without clobbering the iterator we're using to navigate. + LLWearableHoldingPattern::found_list_t::iterator iter = getFoundList().begin(); + while (iter != getFoundList().end()) + { + LLFoundData& data = *iter; + + // If an item of this type has recently shown up, removed the corresponding replacement wearable from COF. + if (data.mWearable && data.mIsReplacement && + replaced_types.find(data.mWearableType) != replaced_types.end()) + { + LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID); + std::list::iterator clobber_ator = iter; + ++iter; + getFoundList().erase(clobber_ator); + } + else + { + ++iter; + } + } + + // Clear contents of late arrivals. + mLateArrivals.clear(); // Update appearance based on mFoundList LLAppearanceMgr::instance().updateAgentWearables(this, false); -- cgit v1.2.3 From 961656863a5e50e5f80e1e316811b884dd8a949f Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Mon, 14 Jun 2010 17:19:40 -0400 Subject: EXT-6571 WIP - fixes for handling of late arriving assets --- indra/newview/app_settings/settings.xml | 22 +++++++++++----------- indra/newview/llappearancemgr.cpp | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index f5e3656dc6..97d9e9f43a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3556,17 +3556,6 @@ Value 255 - MaxWearableWaitTime - - Comment - Max seconds to wait for wearable assets to fetch. - Persist - 1 - Type - F32 - Value - 60.0 - ForceShowGrid Comment @@ -4712,6 +4701,17 @@ Value 64.0 + MaxWearableWaitTime + + Comment + Max seconds to wait for wearable assets to fetch. + Persist + 1 + Type + F32 + Value + 60.0 + MeanCollisionBump Comment diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index a164cfeaa1..e54b9fe2ea 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -265,6 +265,7 @@ public: void setGestItems(const LLInventoryModel::item_array_t& items); bool isValid(); void handleLateArrivals(); + void resetTime(F32 timeout); private: found_list_t mFoundList; @@ -351,8 +352,7 @@ bool LLWearableHoldingPattern::isFetchCompleted() bool LLWearableHoldingPattern::isTimedOut() { - F32 max_wait_time = gSavedSettings.getF32("MaxWearableWaitTime"); // give up if wearable fetches haven't completed in max_wait_time seconds. - return mWaitTime.getElapsedTimeF32() > max_wait_time; + return mWaitTime.hasExpired(); } void LLWearableHoldingPattern::checkMissingWearables() @@ -395,7 +395,7 @@ void LLWearableHoldingPattern::checkMissingWearables() } } - mWaitTime.reset(); + resetTime(60.0F); if (!pollMissingWearables()) { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollMissingWearables,this)); @@ -722,7 +722,7 @@ void LLWearableHoldingPattern::handleLateArrivals() if (data.mWearable && data.mIsReplacement && replaced_types.find(data.mWearableType) != replaced_types.end()) { - LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID); + LLAppearanceMgr::instance().removeCOFItemLinks(data.mItemID,false); std::list::iterator clobber_ator = iter; ++iter; getFoundList().erase(clobber_ator); @@ -740,6 +740,12 @@ void LLWearableHoldingPattern::handleLateArrivals() LLAppearanceMgr::instance().updateAgentWearables(this, false); } +void LLWearableHoldingPattern::resetTime(F32 timeout) +{ + mWaitTime.reset(); + mWaitTime.setTimerExpirySec(timeout); +} + void LLWearableHoldingPattern::onWearableAssetFetch(LLWearable *wearable) { if (!isValid()) @@ -1522,7 +1528,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF() linked_item->isWearableType() ? linked_item->getWearableType() : LLWearableType::WT_INVALID ); - if (skip_type != LLWearableType::WT_INVALID && found.mWearableType == skip_type) + if (skip_type != LLWearableType::WT_INVALID && skip_type == found.mWearableType) { found.mAssetID.generate(); // Replace with new UUID, guaranteed not to exist in DB } @@ -1558,6 +1564,7 @@ void LLAppearanceMgr::updateAppearanceFromCOF() } + holder->resetTime(gSavedSettings.getF32("MaxWearableWaitTime")); if (!holder->pollFetchCompletion()) { doOnIdleRepeating(boost::bind(&LLWearableHoldingPattern::pollFetchCompletion,holder)); -- cgit v1.2.3 From c21c192d0c65e0e9b506e08a918d700a1e400725 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 13:01:11 +0100 Subject: EXT-7348 Can't open Advanced Menu in Linux Client Added a new, preferred shortcut for Show Advanced Menu, that isn't eaten by the desktop on Linux. The old shortcut also works. --- indra/newview/skins/default/xui/en/menu_viewer.xml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 2641ce4ee4..3557318705 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -927,7 +927,7 @@ + shortcut="control|alt|shift|D"> @@ -1477,6 +1477,18 @@ + + + + + - - \ No newline at end of file + -- cgit v1.2.3 From 2fc77b8ee8184fe10c9f4da6ad79d80e89dc8a6b Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 13:13:24 +0100 Subject: VWR-19683 llmediaimplgstreamervidplug gcc 4.4 build errors --- doc/contributions.txt | 2 ++ indra/media_plugins/gstreamer010/CMakeLists.txt | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index a74cf32afa..8c6bd5e0fe 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -185,6 +185,8 @@ Dale Glass VWR-2502 VWR-1358 VWR-2041 +Drew Dri + VWR-19683 Drewan Keats VWR-28 VWR-248 diff --git a/indra/media_plugins/gstreamer010/CMakeLists.txt b/indra/media_plugins/gstreamer010/CMakeLists.txt index 3b73e04786..9f0ff654fc 100644 --- a/indra/media_plugins/gstreamer010/CMakeLists.txt +++ b/indra/media_plugins/gstreamer010/CMakeLists.txt @@ -42,12 +42,12 @@ set(media_plugin_gstreamer010_HEADER_FILES llmediaimplgstreamertriviallogging.h ) -if (${CXX_VERSION_NUMBER} MATCHES "4[23].") +if (${CXX_VERSION_NUMBER} MATCHES "4[23456789].") # Work around a bad interaction between broken gstreamer headers and - # g++ 4.3's increased strictness. + # g++ >= 4.2's increased strictness. set_source_files_properties(llmediaimplgstreamervidplug.cpp PROPERTIES COMPILE_FLAGS -Wno-write-strings) -endif (${CXX_VERSION_NUMBER} MATCHES "4[23].") +endif (${CXX_VERSION_NUMBER} MATCHES "4[23456789].") add_library(media_plugin_gstreamer010 SHARED -- cgit v1.2.3 From fce2653f6b5e8ca3509d13e3449b1fdd2f5ff826 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 13:26:40 +0100 Subject: SNOW-620 PARTIAL Infinite loop in LLSphere::getBoundingSphere Neither the test nor the code being tested are good - the unit test can hang. Skipping test for now, passing over to the sim maint backlog. --- indra/llmath/tests/mathmisc_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/llmath/tests/mathmisc_test.cpp b/indra/llmath/tests/mathmisc_test.cpp index ea42f6e001..68d9ddc0fe 100644 --- a/indra/llmath/tests/mathmisc_test.cpp +++ b/indra/llmath/tests/mathmisc_test.cpp @@ -334,6 +334,8 @@ namespace tut template<> template<> void sphere_object::test<2>() { + skip("See SNOW-620. Neither the test nor the code being tested seem good. Also sim-only."); + // test LLSphere::getBoundingSphere() S32 number_of_tests = 100; S32 number_of_spheres = 10; -- cgit v1.2.3 From 10c722604a0c52f5dc23b9d8c52703aad024daa2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 14:35:21 +0100 Subject: Backed out changeset 6d51a12cb2d8 --- indra/llcommon/lldate.cpp | 23 +---------- indra/newview/llfloatersnapshot.cpp | 79 ++++++++++++++++++------------------- 2 files changed, 41 insertions(+), 61 deletions(-) diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp index a7ef28b431..de7f2ead74 100644 --- a/indra/llcommon/lldate.cpp +++ b/indra/llcommon/lldate.cpp @@ -248,27 +248,8 @@ bool LLDate::fromStream(std::istream& s) s >> fractional; seconds_since_epoch += fractional; } - - c = s.peek(); // check for offset - if (c == '+' || c == '-') - { - S32 offset_sign = (c == '+') ? 1 : -1; - S32 offset_hours = 0; - S32 offset_minutes = 0; - S32 offset_in_seconds = 0; - - s >> offset_hours; - - c = s.get(); // skip the colon a get the minutes if there are any - if (c == ':') - { - s >> offset_minutes; - } - - offset_in_seconds = (offset_hours * 60 + offset_sign * offset_minutes) * 60; - seconds_since_epoch -= offset_in_seconds; - } - else if (c != 'Z') { return false; } // skip the Z + c = s.get(); // skip the Z + if (c != 'Z') { return false; } mSecondsSinceEpoch = seconds_since_epoch; return true; diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 129dd55e48..00981d3c25 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -164,6 +164,8 @@ public: void setSnapshotBufferType(LLViewerWindow::ESnapshotType type) { mSnapshotBufferType = type; } void updateSnapshot(BOOL new_snapshot, BOOL new_thumbnail = FALSE, F32 delay = 0.f); LLFloaterPostcard* savePostcard(); + void confirmSavingTexture(bool set_as_profile_pic = false); + bool onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic); void saveTexture(bool set_as_profile_pic = false); BOOL saveLocal(); void saveWeb(std::string url); @@ -979,6 +981,27 @@ void profile_pic_upload_callback(const LLUUID& uuid) floater->setAsProfilePic(uuid); } +void LLSnapshotLivePreview::confirmSavingTexture(bool set_as_profile_pic) +{ + LLSD args; + args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), + boost::bind(&LLSnapshotLivePreview::onSavingTextureConfirmed, this, _1, _2, set_as_profile_pic)); +} + +bool LLSnapshotLivePreview::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, bool set_as_profile_pic) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + + if (option == 0) + { + saveTexture(set_as_profile_pic); + } + + return false; +} + + void LLSnapshotLivePreview::saveTexture(bool set_as_profile_pic) { // gen a new uuid for this asset @@ -1157,9 +1180,6 @@ public: static void onCommitSnapshotFormat(LLUICtrl* ctrl, void* data); static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type); - static void confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic = false); - static void onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic); - static void checkCloseOnKeep(LLFloaterSnapshot* view); static void onCommitProfilePic(LLFloaterSnapshot* view); static void showAdvanced(LLFloaterSnapshot* view, const BOOL visible); static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; @@ -1699,7 +1719,13 @@ public: void LLFloaterSnapshot::Impl::onCommitProfilePic(LLFloaterSnapshot* view) { - confirmSavingTexture(view, true); + //first save to harddrive + LLSnapshotLivePreview* previewp = getPreviewView(view); + + if(previewp) + { + previewp->confirmSavingTexture(true); + } } void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type) @@ -1713,17 +1739,14 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh if (type == LLSnapshotLivePreview::SNAPSHOT_WEB) { previewp->saveWeb(view->getString("share_to_web_url")); - checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_LOCAL) { previewp->saveLocal(); - checkCloseOnKeep(view); } else if (type == LLSnapshotLivePreview::SNAPSHOT_TEXTURE) { - // uploads and then calls checkCloseOnKeep() on confirmation from user - confirmSavingTexture(view); + previewp->confirmSavingTexture(); } else if (type == LLSnapshotLivePreview::SNAPSHOT_POSTCARD) { @@ -1736,40 +1759,16 @@ void LLFloaterSnapshot::Impl::onCommitSnapshot(LLFloaterSnapshot* view, LLSnapsh gSnapshotFloaterView->addChild(floater); view->addDependentFloater(floater, FALSE); } - checkCloseOnKeep(view); } - } -} - -void LLFloaterSnapshot::Impl::confirmSavingTexture(LLFloaterSnapshot* view, bool set_as_profile_pic) -{ - LLSD args; - args["AMOUNT"] = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); - LLNotificationsUtil::add("UploadConfirmation", args, LLSD(), - boost::bind(&onSavingTextureConfirmed, _1, _2, view, set_as_profile_pic)); -} - -void LLFloaterSnapshot::Impl::onSavingTextureConfirmed(const LLSD& notification, const LLSD& response, LLFloaterSnapshot* view, bool set_as_profile_pic) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - - if (option == 0) - { - LLSnapshotLivePreview* previewp = getPreviewView(view); - previewp->saveTexture(set_as_profile_pic); - checkCloseOnKeep(view); - } -} -void LLFloaterSnapshot::Impl::checkCloseOnKeep(LLFloaterSnapshot* view) -{ - if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) - { - view->closeFloater(); - } - else - { - checkAutoSnapshot(getPreviewView(view)); + if (gSavedSettings.getBOOL("CloseSnapshotOnKeep")) + { + view->closeFloater(); + } + else + { + checkAutoSnapshot(previewp); + } } } -- cgit v1.2.3 From c8dea8b6e5db483b9f72dfeaa566b43560bfd349 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 14:39:10 +0100 Subject: Backed out changeset 2f4b18cc2bbf --- indra/newview/llfloatersnapshot.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index 00981d3c25..fa2a9873fc 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -1181,7 +1181,7 @@ public: static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type); static void onCommitProfilePic(LLFloaterSnapshot* view); - static void showAdvanced(LLFloaterSnapshot* view, const BOOL visible); + static void showAdvanced(LLFloaterSnapshot* view, const bool visible); static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value); @@ -1649,7 +1649,7 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data) } //static -void LLFloaterSnapshot::Impl::showAdvanced(LLFloaterSnapshot* view, const BOOL visible) +void LLFloaterSnapshot::Impl::showAdvanced(LLFloaterSnapshot* view, const bool visible) { LLPanel* advanced_panel = view->getChild("snapshot_advanced"); -- cgit v1.2.3 From 0effcd8a9f0a6ab3dd84506e0aa3333d5ebee8c2 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Tue, 15 Jun 2010 14:39:37 +0100 Subject: Backed out changeset fb6c9a1cebfc --- indra/newview/llfloatersnapshot.cpp | 118 +++++++++---- indra/newview/llfloatersnapshot.h | 9 +- .../skins/default/xui/en/floater_snapshot.xml | 192 +++++++++------------ 3 files changed, 169 insertions(+), 150 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index fa2a9873fc..5bea3325a8 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -91,6 +91,10 @@ ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs ///---------------------------------------------------------------------------- +S32 LLFloaterSnapshot::sUIWinHeightLong = 526 ; +S32 LLFloaterSnapshot::sUIWinHeightShort = LLFloaterSnapshot::sUIWinHeightLong - 230 ; +S32 LLFloaterSnapshot::sUIWinWidth = 215 ; + LLSnapshotFloaterView* gSnapshotFloaterView = NULL; const F32 AUTO_SNAPSHOT_TIME_DELAY = 1.f; @@ -1168,6 +1172,9 @@ public: } static void onClickNewSnapshot(void* data); static void onClickAutoSnap(LLUICtrl *ctrl, void* data); + //static void onClickAdvanceSnap(LLUICtrl *ctrl, void* data); + static void onClickLess(void* data) ; + static void onClickMore(void* data) ; static void onClickUICheck(LLUICtrl *ctrl, void* data); static void onClickHUDCheck(LLUICtrl *ctrl, void* data); static void onClickKeepOpenCheck(LLUICtrl *ctrl, void* data); @@ -1181,7 +1188,7 @@ public: static void onCommitCustomResolution(LLUICtrl *ctrl, void* data); static void onCommitSnapshot(LLFloaterSnapshot* view, LLSnapshotLivePreview::ESnapshotType type); static void onCommitProfilePic(LLFloaterSnapshot* view); - static void showAdvanced(LLFloaterSnapshot* view, const bool visible); + static void onToggleAdvanced(LLUICtrl *ctrl, void* data); static void resetSnapshotSizeOnUI(LLFloaterSnapshot *view, S32 width, S32 height) ; static BOOL checkImageSize(LLSnapshotLivePreview* previewp, S32& width, S32& height, BOOL isWidthChanged, S32 max_value); @@ -1392,6 +1399,41 @@ void LLFloaterSnapshot::Impl::onClickAutoSnap(LLUICtrl *ctrl, void* data) } } +void LLFloaterSnapshot::Impl::onClickMore(void* data) +{ + gSavedSettings.setBOOL( "AdvanceSnapshot", TRUE ); + + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + if (view) + { + view->translate( 0, view->getUIWinHeightShort() - view->getUIWinHeightLong() ); + view->reshape(view->getRect().getWidth(), view->getUIWinHeightLong()); + updateControls(view) ; + updateLayout(view) ; + if(getPreviewView(view)) + { + getPreviewView(view)->setThumbnailImageSize() ; + } + } +} +void LLFloaterSnapshot::Impl::onClickLess(void* data) +{ + gSavedSettings.setBOOL( "AdvanceSnapshot", FALSE ); + + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + if (view) + { + view->translate( 0, view->getUIWinHeightLong() - view->getUIWinHeightShort() ); + view->reshape(view->getRect().getWidth(), view->getUIWinHeightShort()); + updateControls(view) ; + updateLayout(view) ; + if(getPreviewView(view)) + { + getPreviewView(view)->setThumbnailImageSize() ; + } + } +} + // static void LLFloaterSnapshot::Impl::onClickUICheck(LLUICtrl *ctrl, void* data) { @@ -1649,28 +1691,30 @@ void LLFloaterSnapshot::Impl::onCommitLayerTypes(LLUICtrl* ctrl, void*data) } //static -void LLFloaterSnapshot::Impl::showAdvanced(LLFloaterSnapshot* view, const bool visible) +void LLFloaterSnapshot::Impl::onToggleAdvanced(LLUICtrl* ctrl, void* data) { + LLFloaterSnapshot *view = (LLFloaterSnapshot *)data; + LLPanel* advanced_panel = view->getChild("snapshot_advanced"); - if (advanced_panel->getVisible() != visible) + if (advanced_panel->getVisible()) { - gSavedSettings.setBOOL("AdvanceSnapshot", visible); + advanced_panel->setVisible(false); - advanced_panel->setVisible(visible); - view->getChild("hide_advanced")->setVisible(visible); - view->getChild("show_advanced")->setVisible(!visible); + // shrink floater back to original size + view->reshape(view->getRect().getWidth() - advanced_panel->getRect().getWidth(), view->getRect().getHeight()); - if (visible) - { - // stretch the floater so it can accommodate the advanced panel - view->reshape(view->getRect().getWidth() + advanced_panel->getRect().getWidth(), view->getRect().getHeight()); - } - else - { - // shrink floater back to original size - view->reshape(view->getRect().getWidth() - advanced_panel->getRect().getWidth(), view->getRect().getHeight()); - } + view->getChild("hide_advanced")->setVisible(false); + view->getChild("show_advanced")->setVisible(true); + } + else + { + advanced_panel->setVisible(true); + // stretch the floater so it can accommodate the advanced panel + view->reshape(view->getRect().getWidth() + advanced_panel->getRect().getWidth(), view->getRect().getHeight()); + + view->getChild("hide_advanced")->setVisible(true); + view->getChild("show_advanced")->setVisible(false); } } @@ -1958,11 +2002,6 @@ LLFloaterSnapshot::LLFloaterSnapshot(const LLSD& key) impl (*(new Impl)) { //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_snapshot.xml", FALSE); - - mCommitCallbackRegistrar.add("Snapshot.ShowButtons", boost::bind(&LLFloaterSnapshot::updateButtons, this, _2)); - mCommitCallbackRegistrar.add("Snapshot.ShowAdvanced", boost::bind(&Impl::showAdvanced, this, true)); - mCommitCallbackRegistrar.add("Snapshot.HideAdvanced", boost::bind(&Impl::showAdvanced, this, false)); - mCommitCallbackRegistrar.add("Snapshot.Refresh", boost::bind(&Impl::onClickNewSnapshot, this)); } // Destroys the object @@ -1984,14 +2023,27 @@ LLFloaterSnapshot::~LLFloaterSnapshot() BOOL LLFloaterSnapshot::postBuild() { + + getChild("share")->setCommitCallback(boost::bind(&LLFloaterSnapshot::updateButtons, this, SNAPSHOT_SHARE)); + getChild("save")->setCommitCallback(boost::bind(&LLFloaterSnapshot::updateButtons, this, SNAPSHOT_SAVE)); + getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterSnapshot::updateButtons, this, SNAPSHOT_MAIN)); + getChild("share_to_web")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_WEB)); getChild("share_to_email")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_POSTCARD)); getChild("save_to_inventory")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_TEXTURE)); getChild("save_to_computer")->setCommitCallback(boost::bind(&Impl::onCommitSnapshot, this, LLSnapshotLivePreview::SNAPSHOT_LOCAL)); getChild("set_profile_pic")->setCommitCallback(boost::bind(&Impl::onCommitProfilePic, this)); + childSetCommitCallback("show_advanced", Impl::onToggleAdvanced, this); + childSetCommitCallback("hide_advanced", Impl::onToggleAdvanced, this); + childSetCommitCallback("local_format_combo", Impl::onCommitSnapshotFormat, this); + childSetAction("new_snapshot_btn", Impl::onClickNewSnapshot, this); + + childSetAction("more_btn", Impl::onClickMore, this); + childSetAction("less_btn", Impl::onClickLess, this); + childSetCommitCallback("image_quality_slider", Impl::onCommitQuality, this); childSetValue("image_quality_slider", gSavedSettings.getS32("SnapshotQuality")); @@ -2043,13 +2095,12 @@ BOOL LLFloaterSnapshot::postBuild() impl.mPreviewHandle = previewp->getHandle(); impl.updateControls(this); impl.updateLayout(this); - impl.showAdvanced(this, gSavedSettings.getBOOL("AdvanceSnapshot")); //save off the refresh button's rectangle so we can apply offsets with thumbnail resize mRefreshBtnRect = getChild("new_snapshot_btn")->getRect(); // make sure we share/hide the general buttons - updateButtons(LLSD("main")); + updateButtons(SNAPSHOT_MAIN); return LLDockableFloater::postBuild(); } @@ -2139,20 +2190,19 @@ void LLFloaterSnapshot::update() } } -bool LLFloaterSnapshot::updateButtons(const LLSD& mode) +bool LLFloaterSnapshot::updateButtons(ESnapshotMode mode) { - std::string button_mode = mode.asString(); + childSetVisible("share", mode == SNAPSHOT_MAIN); + childSetVisible("save", mode == SNAPSHOT_MAIN); + childSetVisible("set_profile_pic", mode == SNAPSHOT_MAIN); - bool mode_main("main" == button_mode); - bool mode_share("share" == button_mode); - bool mode_save("save" == button_mode); +// childSetVisible("share_to_web", mode == SNAPSHOT_SHARE); + childSetVisible("share_to_email", mode == SNAPSHOT_SHARE); - // Default to a known state if mode is invalid. - if (!mode_main && !mode_share && !mode_save) mode_main = true; + childSetVisible("save_to_inventory", mode == SNAPSHOT_SAVE); + childSetVisible("save_to_computer", mode == SNAPSHOT_SAVE); - childSetVisible("panel_snapshot_main", mode_main); - childSetVisible("panel_snapshot_share", mode_share); - childSetVisible("panel_snapshot_save", mode_save); + childSetVisible("cancel", mode != SNAPSHOT_MAIN); return true; } diff --git a/indra/newview/llfloatersnapshot.h b/indra/newview/llfloatersnapshot.h index 8c4373c35c..931d355748 100644 --- a/indra/newview/llfloatersnapshot.h +++ b/indra/newview/llfloatersnapshot.h @@ -47,6 +47,13 @@ public: SNAPSHOT_FORMAT_BMP } ESnapshotFormat; + enum ESnapshotMode + { + SNAPSHOT_SHARE, + SNAPSHOT_SAVE, + SNAPSHOT_MAIN + }; + LLFloaterSnapshot(const LLSD& key); virtual ~LLFloaterSnapshot(); @@ -59,7 +66,7 @@ public: void setAsProfilePic(const LLUUID& image_id); - bool updateButtons(const LLSD& mode); + bool updateButtons(ESnapshotMode mode); static S32 getUIWinHeightLong() {return sUIWinHeightLong ;} static S32 getUIWinHeightShort() {return sUIWinHeightShort ;} diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 7d81c3e551..f3d297c303 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -38,129 +38,91 @@ left="20" top_pad="-30" name="new_snapshot_btn" - width="23" - commit_callback.function="Snapshot.Refresh"/> + width="23" /> - -