From 75452dd7a8f9f51bf3fbcb871976168f80e0cae0 Mon Sep 17 00:00:00 2001 From: leyla_linden Date: Sat, 23 Jul 2011 08:59:27 -0700 Subject: fixing outbox folder --- indra/newview/llinventorypanel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d5d40ca65d..c3545efeaf 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -185,7 +185,7 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) } } // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type - else if (preferred_type == LLFolderType::FT_OUTBOX) + /*else if (preferred_type == LLFolderType::FT_OUTBOX) { LLInventoryModel::cat_array_t* cats; LLInventoryModel::item_array_t* items; @@ -204,7 +204,7 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) } } } - } + }*/ // leslie -- end temporary HACK else { @@ -281,6 +281,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // hide inbox getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_OUTBOX)); // Initialize base class params. LLPanel::initFromParams(params); -- cgit v1.2.3 From ed02d0c1fccbfd25ed54f6be5b051736834d2e27 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 29 Jul 2011 17:01:24 -0700 Subject: EXP-843 Enable drag and drop to and from the outbox, with conditional warnings based on permissions EXP-1034 Add confirmation dialog for moving no-copy items to outbox --- indra/newview/llinventorybridge.cpp | 158 ++++++++++++++++++++- indra/newview/llinventorybridge.h | 4 + indra/newview/llpanelmarketplaceoutbox.cpp | 27 +++- indra/newview/llpanelmarketplaceoutbox.h | 6 + .../newview/skins/default/xui/en/notifications.xml | 16 ++- 5 files changed, 204 insertions(+), 7 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index ff328fd071..8eacb5a719 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -573,7 +573,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } // Don't allow items to be pasted directly into the COF or the inbox - if (!isCOFFolder() && !isInboxFolder()) + if (!isCOFFolder() && !isInboxFolder() && !isOutboxFolder()) { items.push_back(std::string("Paste")); } @@ -794,6 +794,20 @@ BOOL LLInvFVBridge::isInboxFolder() const return gInventory.isObjectDescendentOf(mUUID, inbox_id); } + +BOOL LLInvFVBridge::isOutboxFolder() const +{ + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false, false); + + if (outbox_id.isNull()) + { + return FALSE; + } + + return gInventory.isObjectDescendentOf(mUUID, outbox_id); +} + + BOOL LLInvFVBridge::isItemPermissive() const { return FALSE; @@ -1648,6 +1662,55 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const } +static BOOL can_move_to_outbox(LLInventoryItem* inv_item) +{ + return inv_item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); +} + + +void LLFolderBridge::dropFolderToOutbox(LLInventoryCategory* inv_cat) +{ + LLUUID dest_folder_id = gInventory.createNewCategory(mUUID, LLFolderType::FT_NONE, inv_cat->getName()); + + LLInventoryModel::cat_array_t* cat_array; + LLInventoryModel::item_array_t* item_array; + gInventory.getDirectDescendentsOf(inv_cat->getUUID(),cat_array,item_array); + + for (LLInventoryModel::item_array_t::iterator iter = item_array->begin(); iter != item_array->end(); iter++) + { + LLInventoryItem* item = *iter; + if (item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + //LLPointer cb = new OutboxMoveCallback(); + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + dest_folder_id, + item->getName(), + LLPointer(NULL)); + + } + else + { + LLSD args; + args["ITEM_NAME"] = item->getName(); + LLSD payload; + payload["item_id"] = item->getUUID(); + payload["dest_folder_id"] = dest_folder_id; + LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&LLFolderBridge::moveToOutbox, this, _1, _2)); + } + + } + /* + // we need to also drill down recursively + for (LLInventoryModel::cat_array_t::iterator iter = cat_array->begin(); iter != cat_array->end(); iter++) + { + LLViewerInventoryCategory* category = gInventory.getCategory(dest_folder_id); + } + */ +} + BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop) { @@ -1674,10 +1737,12 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, const LLUUID &cat_id = inv_cat->getUUID(); const LLUUID &trash_id = model->findCategoryUUIDForType(LLFolderType::FT_TRASH, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); - + const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); + const BOOL move_is_into_trash = (mUUID == trash_id) || model->isObjectDescendentOf(mUUID, trash_id); const BOOL move_is_into_outfit = getCategory() && (getCategory()->getPreferredType() == LLFolderType::FT_OUTFIT); const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); + const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); //-------------------------------------------------------------------------------- // Determine if folder can be moved. @@ -1730,6 +1795,18 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } } + if (move_is_into_outbox) + { + for (S32 i=0; i < descendent_items.count(); ++i) + { + LLInventoryItem* item = descendent_items[i]; + if (!can_move_to_outbox(item)) + { + is_movable = FALSE; + break; + } + } + } // //-------------------------------------------------------------------------------- @@ -1797,6 +1874,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, #endif } } + if (move_is_into_outbox) + { + dropFolderToOutbox(inv_cat); + } else { if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) @@ -2635,7 +2716,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // Not sure what the right thing is to do here. if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { - if (!isInboxFolder()) // don't allow creation in inbox + if (!isInboxFolder() && !isOutboxFolder()) // don't allow creation in inbox { // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) @@ -3003,6 +3084,67 @@ static BOOL can_move_to_landmarks(LLInventoryItem* inv_item) return LLAssetType::AT_LANDMARK == inv_item->getType(); } +void LLFolderBridge::dropToOutbox(LLInventoryItem* inv_item) +{ + if (inv_item->getPermissions().allowOperationBy(PERM_COPY, gAgent.getID(), gAgent.getGroupID())) + { + LLUUID dest_folder_id = mUUID; + + // when moving item directly into outbox create folder with that name + if (mUUID == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) + { + dest_folder_id = gInventory.createNewCategory(mUUID, LLFolderType::FT_NONE, inv_item->getName()); + } + + copy_inventory_item( + gAgent.getID(), + inv_item->getPermissions().getOwner(), + inv_item->getUUID(), + dest_folder_id, + inv_item->getName(), + LLPointer(NULL)); + + } + else + { + LLSD args; + args["ITEM_NAME"] = inv_item->getName(); + LLSD payload; + payload["item_id"] = inv_item->getUUID(); + payload["dest_folder_id"] = mUUID; + LLNotificationsUtil::add("ConfirmNoCopyToOutbox", args, payload, boost::bind(&LLFolderBridge::moveToOutbox, this, _1, _2)); + } +} + + +void LLFolderBridge::moveToOutbox(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + if (option != 0) return; // canceled + + + LLInventoryModel* model = getInventoryModel(); + LLViewerInventoryItem * viitem = gInventory.getItem(notification["payload"]["item_id"].asUUID()); + LLUUID dest_folder_id = notification["payload"]["dest_folder_id"].asUUID(); + + if (viitem) + { + + // when moving item directly into outbox create folder with that name + if (dest_folder_id == gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false)) + { + dest_folder_id = gInventory.createNewCategory(mUUID, LLFolderType::FT_NONE, viitem->getName()); + } + + LLInvFVBridge::changeItemParent( + model, + viitem, + dest_folder_id, + false); + } + +} + void LLFolderBridge::dropToFavorites(LLInventoryItem* inv_item) { // use callback to rearrange favorite landmarks after adding @@ -3060,11 +3202,13 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, const LLUUID ¤t_outfit_id = model->findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, false); const LLUUID &favorites_id = model->findCategoryUUIDForType(LLFolderType::FT_FAVORITE, false); const LLUUID &landmarks_id = model->findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false); + const LLUUID &outbox_id = model->findCategoryUUIDForType(LLFolderType::FT_OUTBOX, false); const BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); const BOOL move_is_into_favorites = (mUUID == favorites_id); const BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLFolderType::FT_OUTFIT); const BOOL move_is_into_landmarks = (mUUID == landmarks_id) || model->isObjectDescendentOf(mUUID, landmarks_id); + const BOOL move_is_into_outbox = model->isObjectDescendentOf(mUUID, outbox_id); //(mUUID == outbox_id); LLToolDragAndDrop::ESource source = LLToolDragAndDrop::getInstance()->getSource(); BOOL accept = FALSE; @@ -3130,6 +3274,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { accept = can_move_to_landmarks(inv_item); } + else if (move_is_into_outbox) + { + accept = can_move_to_outbox(inv_item); + } if(accept && drop) { @@ -3180,6 +3328,10 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, { dropToOutfit(inv_item, move_is_into_current_outfit); } + else if (move_is_into_outbox) + { + dropToOutbox(inv_item); + } // NORMAL or TRASH folder // (move the item, restamp if into trash) else diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 15629c0c75..262f4ffdcf 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -140,6 +140,7 @@ protected: BOOL isAgentInventory() const; // false if lost or in the inventory library BOOL isCOFFolder() const; // true if COF or descendent of BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox + BOOL isOutboxFolder() const; // true if COF or descendent of marketplace inbox virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, @@ -299,6 +300,9 @@ protected: void dropToFavorites(LLInventoryItem* inv_item); void dropToOutfit(LLInventoryItem* inv_item, BOOL move_is_into_current_outfit); + void dropToOutbox(LLInventoryItem* inv_item); + void moveToOutbox(const LLSD& notification, const LLSD& response); + void dropFolderToOutbox(LLInventoryCategory* inv_cat); //-------------------------------------------------------------------- // Messy hacks for handling folder options diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 74d0de3b30..9e1b28f168 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -38,7 +38,7 @@ #include "llsidepanelinventory.h" #include "llsidetray.h" #include "lltimer.h" - +#include "llfolderview.h" static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); @@ -136,6 +136,27 @@ void LLPanelMarketplaceOutbox::setupInventoryPanel() outbox_inventory_placeholder->setVisible(FALSE); } +BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg) +{ + BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + + if (!handled && mInventoryPanel->getRootFolder()) + { + handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); + } + + if (handled && mInventoryPanel->getRootFolder()) + { + mInventoryPanel->getRootFolder()->setDragAndDropThisFrame(); + } + + return handled; +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox @@ -170,9 +191,9 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) } void LLPanelMarketplaceOutbox::onSyncButtonClicked() -{ +{ // TODO: Actually trigger sync to marketplace - + mSyncInProgress = true; updateSyncButtonStatus(); diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 1b502127ef..d5671edad6 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -61,6 +61,12 @@ public: void onSyncComplete(); + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + protected: void onSyncButtonClicked(); void updateSyncButtonStatus(); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1bc377126e..5c600265c2 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -199,7 +199,21 @@ Save changes to current clothing/body part? yestext="Save"/> - + You don't have permission to copy this item to the Marketplace Outbox. Are you sure you want to move the following item? + [ITEM_NAME] + + + + + + -- cgit v1.2.3 From adf39dd1473039a8ab9624fa67f3a927fe22b8fe Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 29 Jul 2011 17:02:19 -0700 Subject: fixing outbox handledraganddrop --- indra/newview/llpanelmarketplaceoutbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 9e1b28f168..c96fb22862 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -147,11 +147,11 @@ BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL d if (!handled && mInventoryPanel->getRootFolder()) { handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); - } - if (handled && mInventoryPanel->getRootFolder()) - { - mInventoryPanel->getRootFolder()->setDragAndDropThisFrame(); + if (handled) + { + mInventoryPanel->getRootFolder()->setDragAndDropThisFrame(); + } } return handled; -- cgit v1.2.3 From 5cf4d63a82e2b6c2546a2bb5ef13ef142fc07cb9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Fri, 29 Jul 2011 17:06:40 -0700 Subject: attempting to do the outbox import --- indra/newview/llpanelmarketplaceoutbox.cpp | 43 ++++++++++++++++++++++++++++-- indra/newview/llviewermedia.cpp | 11 ++++++++ indra/newview/llviewermedia.h | 2 ++ 3 files changed, 54 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index c96fb22862..074fea546d 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -38,6 +38,9 @@ #include "llsidepanelinventory.h" #include "llsidetray.h" #include "lltimer.h" +#include "llviewernetwork.h" +#include "llagent.h" +#include "llviewermedia.h" #include "llfolderview.h" static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); @@ -190,10 +193,46 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) gTimeDelayDebugFunc = ""; } + +class LLInventorySyncResponder : public LLHTTPClient::Responder +{ +public: + LLInventorySyncResponder() + : LLCurl::Responder() + { + } + + void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + // Complete success + llinfos << "sync complete" << llendl; + } + else + { + llwarns << "sync failed" << llendl; + } + } +}; + void LLPanelMarketplaceOutbox::onSyncButtonClicked() { - // TODO: Actually trigger sync to marketplace - + std::string url = "http://pdp24.lindenlab.com/3000"; /*"https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + } + */ + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/inventory_import"; + + LLHTTPClient::get(url, new LLInventorySyncResponder(), LLViewerMedia::getHeaders()); + + mSyncInProgress = true; updateSyncButtonStatus(); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 384f7cd61d..d5a8772461 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1394,6 +1394,17 @@ public: } }; + +LLSD LLViewerMedia::getHeaders() +{ + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = sOpenIDCookie; + headers["User-Agent"] = getCurrentUserAgent(); + + return headers; +} + ///////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::setOpenIDCookie() diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index aeac6ba29a..0b69b8f0c1 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -162,6 +162,8 @@ public: static LLPluginClassMedia* getSpareBrowserMediaSource(); static void setOnlyAudibleMediaTextureID(const LLUUID& texture_id); + + static LLSD getHeaders(); private: static void setOpenIDCookie(); -- cgit v1.2.3 From 9778824b8c8ac3a0b6b373bbaac24f436fb23130 Mon Sep 17 00:00:00 2001 From: "leslie@leslie-HPz600.lindenlab.com" Date: Mon, 1 Aug 2011 15:48:26 -0700 Subject: Badge location in inventory window FIX * New badge attributes allow the specification of a horizontal or vertical offset that will be applied to a parent scroll container if there is one. * Turned freshness tag back on by default. Reviewed by Merov. --- indra/llui/llbadge.cpp | 112 +++++++++++++++++++-- indra/llui/llbadge.h | 9 +- indra/newview/llpanelmarketplaceinboxinventory.h | 2 +- .../xui/en/widgets/inbox_folder_view_folder.xml | 4 +- 4 files changed, 112 insertions(+), 15 deletions(-) (limited to 'indra') diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index fde3c53a65..ceeeb4d1f6 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -27,11 +27,14 @@ #define LLBADGE_CPP #include "llbadge.h" +#include "llscrollcontainer.h" #include "lluictrlfactory.h" static LLDefaultChildRegistry::Register r("badge"); +static const S32 BADGE_OFFSET_NOT_SPECIFIED = 0x7FFFFFFF; + // Compiler optimization, generate extern template template class LLBadge* LLView::getChild(const std::string& name, BOOL recurse) const; @@ -46,6 +49,8 @@ LLBadge::Params::Params() , label_offset_horiz("label_offset_horiz") , label_offset_vert("label_offset_vert") , location("location", LLRelPos::TOP_LEFT) + , location_offset_hcenter("location_offset_hcenter") + , location_offset_vcenter("location_offset_vcenter") , location_percent_hcenter("location_percent_hcenter") , location_percent_vcenter("location_percent_vcenter") , padding_horiz("padding_horiz") @@ -70,6 +75,8 @@ bool LLBadge::Params::equals(const Params& a) const comp &= (label_offset_horiz() == a.label_offset_horiz()); comp &= (label_offset_vert() == a.label_offset_vert()); comp &= (location() == a.location()); + comp &= (location_offset_hcenter() == a.location_offset_hcenter()); + comp &= (location_offset_vcenter() == a.location_offset_vcenter()); comp &= (location_percent_hcenter() == a.location_percent_hcenter()); comp &= (location_percent_vcenter() == a.location_percent_vcenter()); comp &= (padding_horiz() == a.padding_horiz()); @@ -91,16 +98,29 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mLabelOffsetHoriz(p.label_offset_horiz) , mLabelOffsetVert(p.label_offset_vert) , mLocation(p.location) + , mLocationOffsetHCenter(BADGE_OFFSET_NOT_SPECIFIED) + , mLocationOffsetVCenter(BADGE_OFFSET_NOT_SPECIFIED) , mLocationPercentHCenter(0.5f) , mLocationPercentVCenter(0.5f) , mPaddingHoriz(p.padding_horiz) , mPaddingVert(p.padding_vert) + , mParentScroller(NULL) { if (mImage.isNull()) { llwarns << "Badge: " << getName() << " with no image!" << llendl; } + if (p.location_offset_hcenter.isProvided()) + { + mLocationOffsetHCenter = p.location_offset_hcenter(); + } + + if (p.location_offset_vcenter.isProvided()) + { + mLocationOffsetVCenter = p.location_offset_vcenter(); + } + // // The following logic is to set the mLocationPercentHCenter and mLocationPercentVCenter // based on the Location enum and our horizontal and vertical location percentages. The @@ -144,6 +164,15 @@ bool LLBadge::addToView(LLView * view) if (child_added) { setShape(view->getLocalRect()); + + // Find a parent scroll container, if there is one in case we need it for positioning + + LLView * parent = mOwner.get(); + + while ((parent != NULL) && ((mParentScroller = dynamic_cast(parent)) == NULL)) + { + parent = parent->getParent(); + } } return child_added; @@ -200,22 +229,12 @@ void LLBadge::draw() if (owner_view) { - // - // Calculate badge position based on owner - // - - LLRect owner_rect; - owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this); - - F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter; - F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; - // // Calculate badge size based on label text // LLWString badge_label_wstring = mLabel; - + S32 badge_label_begin_offset = 0; S32 badge_char_length = S32_MAX; S32 badge_pixel_length = S32_MAX; @@ -227,6 +246,77 @@ void LLBadge::draw() F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight(); + // + // Calculate badge position based on owner + // + + LLRect owner_rect; + owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this); + + S32 location_offset_horiz = mLocationOffsetHCenter; + S32 location_offset_vert = mLocationOffsetVCenter; + + // If we're in a scroll container, do some math to keep us in the same place on screen if applicable + if (mParentScroller != NULL) + { + LLRect visibleRect = mParentScroller->getVisibleContentRect(); + + if (mLocationOffsetHCenter != BADGE_OFFSET_NOT_SPECIFIED) + { + if (LLRelPos::IsRight(mLocation)) + { + location_offset_horiz += visibleRect.mRight; + } + else if (LLRelPos::IsLeft(mLocation)) + { + location_offset_horiz += visibleRect.mLeft; + } + else // center + { + location_offset_horiz += (visibleRect.mLeft + visibleRect.mRight) / 2; + } + } + + if (mLocationOffsetVCenter != BADGE_OFFSET_NOT_SPECIFIED) + { + if (LLRelPos::IsTop(mLocation)) + { + location_offset_vert += visibleRect.mTop; + } + else if (LLRelPos::IsBottom(mLocation)) + { + location_offset_vert += visibleRect.mBottom; + } + else // center + { + location_offset_vert += (visibleRect.mBottom + visibleRect.mTop) / 2; + } + } + } + + F32 badge_center_x; + F32 badge_center_y; + + // Compute x position + if (mLocationOffsetHCenter == BADGE_OFFSET_NOT_SPECIFIED) + { + badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter; + } + else + { + badge_center_x = location_offset_horiz; + } + + // Compute y position + if (mLocationOffsetVCenter == BADGE_OFFSET_NOT_SPECIFIED) + { + badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; + } + else + { + badge_center_y = location_offset_vert; + } + // // Draw button image, if available. // Otherwise draw basic rectangular button. diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index f81ccdf0cd..4b21a71aaa 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -39,8 +39,9 @@ // Declarations // -class LLUICtrlFactory; class LLFontGL; +class LLScrollContainer; +class LLUICtrlFactory; // // Relative Position Alignment @@ -108,6 +109,8 @@ public: Optional< S32 > label_offset_vert; Optional< LLRelPos::Location > location; + Optional< S32 > location_offset_hcenter; + Optional< S32 > location_offset_vcenter; Optional< U32 > location_percent_hcenter; Optional< U32 > location_percent_vcenter; @@ -150,6 +153,8 @@ private: S32 mLabelOffsetVert; LLRelPos::Location mLocation; + S32 mLocationOffsetHCenter; + S32 mLocationOffsetVCenter; F32 mLocationPercentHCenter; F32 mLocationPercentVCenter; @@ -157,6 +162,8 @@ private: F32 mPaddingHoriz; F32 mPaddingVert; + + LLScrollContainer* mParentScroller; }; // Build time optimization, generate once in .cpp file diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 8946b9dc98..d2d42e11f4 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -33,7 +33,7 @@ #include "llfolderviewitem.h" -#define SUPPORTING_FRESH_ITEM_COUNT 0 +#define SUPPORTING_FRESH_ITEM_COUNT 1 diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml index 95f5cf2ecd..0d1120a182 100644 --- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -11,8 +11,8 @@ label_offset_horiz="-1" location="right" padding_horiz="4" - padding_vert="1" - location_percent_hcenter="70" + padding_vert="1" + location_offset_hcenter="-15" border_image="" image="Badge_Background_New" /> -- cgit v1.2.3 From 45bf1debaa805b64ce30e3c0670a2e9f24d43e08 Mon Sep 17 00:00:00 2001 From: "leslie@leslie-HPz600.lindenlab.com" Date: Tue, 2 Aug 2011 13:12:39 -0700 Subject: * Fixed up outbox UI alignment to match inbox * Added outbox item count to outbox button title * Updated sync loading indicator to keep moving until http request complete * Updated outbox panel display to use user_status http get response * Removed inbox/outbox folder name hack from LLInventoryPanel --- indra/newview/llinventorypanel.cpp | 43 ------------ indra/newview/llpanelmarketplaceoutbox.cpp | 76 ++++++++++++++++++---- indra/newview/llpanelmarketplaceoutbox.h | 4 ++ indra/newview/llsidepanelinventory.cpp | 3 +- indra/newview/llviewermedia.cpp | 46 ++++++++----- .../skins/default/xui/en/panel_inbox_inventory.xml | 2 +- .../default/xui/en/panel_outbox_inventory.xml | 2 +- .../skins/default/xui/en/sidepanel_inventory.xml | 40 ++++++------ 8 files changed, 118 insertions(+), 98 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index c3545efeaf..503c67d01b 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -163,49 +163,6 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { root_id = gInventory.getLibraryRootFolderID(); } - // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type - else if (preferred_type == LLFolderType::FT_INBOX) - { - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); - - if (cats) - { - for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) - { - LLInventoryCategory* cat = *cat_it; - - if (cat->getName() == "Received Items") - { - root_id = cat->getUUID(); - } - } - } - } - // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type - /*else if (preferred_type == LLFolderType::FT_OUTBOX) - { - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); - - if (cats) - { - for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) - { - LLInventoryCategory* cat = *cat_it; - - if (cat->getName() == "Merchant Outbox") - { - root_id = cat->getUUID(); - } - } - } - }*/ - // leslie -- end temporary HACK else { root_id = (preferred_type != LLFolderType::FT_NONE) diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 074fea546d..90c7f9728b 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -147,7 +147,7 @@ BOOL LLPanelMarketplaceOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL d { BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); - if (!handled && mInventoryPanel->getRootFolder()) + if (!handled && mInventoryPanel && mInventoryPanel->getRootFolder()) { handled = mInventoryPanel->getRootFolder()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg); @@ -197,54 +197,65 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) class LLInventorySyncResponder : public LLHTTPClient::Responder { public: - LLInventorySyncResponder() + LLInventorySyncResponder(LLPanelMarketplaceOutbox * outboxPanel) : LLCurl::Responder() + , mOutboxPanel(outboxPanel) { } void completed(U32 status, const std::string& reason, const LLSD& content) { + llinfos << "inventory_import complete status: " << status << llendl; + if (isGoodStatus(status)) { // Complete success - llinfos << "sync complete" << llendl; + llinfos << "success" << llendl; } else { - llwarns << "sync failed" << llendl; + llwarns << "failed" << llendl; } + + mOutboxPanel->onSyncComplete(); } + +private: + LLPanelMarketplaceOutbox * mOutboxPanel; }; void LLPanelMarketplaceOutbox::onSyncButtonClicked() { - std::string url = "http://pdp24.lindenlab.com/3000"; /*"https://marketplace.secondlife.com/"; + // Get the sync animation going + mSyncInProgress = true; + updateSyncButtonStatus(); + + // Make the url for the inventory import request + std::string url = "https://marketplace.secondlife.com/"; if (!LLGridManager::getInstance()->isInProductionGrid()) { std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + + // TEMP for Jim's pdp + //url = "http://pdp24.lindenlab.com:3000/"; } - */ + url += "api/1/users/"; url += gAgent.getID().getString(); url += "/inventory_import"; - LLHTTPClient::get(url, new LLInventorySyncResponder(), LLViewerMedia::getHeaders()); - - - mSyncInProgress = true; - updateSyncButtonStatus(); + llinfos << "http get: " << url << llendl; + LLHTTPClient::get(url, new LLInventorySyncResponder(this), LLViewerMedia::getHeaders()); // Set a timer (for testing only) - - gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this)); + //gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this)); } void LLPanelMarketplaceOutbox::onSyncComplete() { mSyncInProgress = false; - updateSyncButtonStatus(); } @@ -267,3 +278,40 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus() mSyncButton->setEnabled(!isOutboxEmpty()); } } + +U32 LLPanelMarketplaceOutbox::getTotalItemCount() const +{ + U32 item_count = 0; + + if (mInventoryPanel) + { + const LLFolderViewFolder * outbox_folder = mInventoryPanel->getRootFolder(); + + if (outbox_folder) + { + item_count += outbox_folder->getFoldersCount(); + } + } + + return item_count; +} + +void LLPanelMarketplaceOutbox::draw() +{ + U32 item_count = getTotalItemCount(); + + if (item_count > 0) + { + std::string item_count_str = llformat("%d", item_count); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + getChild("outbox_btn")->setLabel(getString("OutboxLabelWithArg", args)); + } + else + { + getChild("outbox_btn")->setLabel(getString("OutboxLabelNoArg")); + } + + LLPanel::draw(); +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index d5671edad6..b5ee3f72cc 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -54,8 +54,12 @@ public: /*virtual*/ BOOL postBuild(); + /*virtual*/ void draw(); + void setupInventoryPanel(); + U32 getTotalItemCount() const; + bool isOutboxEmpty() const; bool isSyncInProgress() const; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 6f809ba3ca..41a0b57f2d 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -301,8 +301,7 @@ void LLSidepanelInventory::handleLoginComplete() observeOutboxModifications(outbox_id); // Enable the display of the outbox if it exists - //enableOutbox(true); - // leslie NOTE: Disabling outbox until we support it officially. + enableOutbox(true); } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index d5a8772461..fc71e19a7d 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1378,13 +1378,18 @@ public: { if (isGoodStatus(status)) { + std::string merchantStatus = content[gAgent.getID().getString()].asString(); + llinfos << "Marketplace merchant status: " << merchantStatus << llendl; + // Complete success gSavedSettings.setBOOL("InventoryDisplayInbox", true); + gSavedSettings.setBOOL("InventoryDisplayOutbox", (merchantStatus == "merchant")); } else if (status == 401) { // API is available for use but OpenID authorization failed gSavedSettings.setBOOL("InventoryDisplayInbox", true); + //gSavedSettings.setBOOL("InventoryDisplayOutbox", true); } else { @@ -1395,6 +1400,28 @@ public: }; +void doOnetimeEarlyHTTPRequests() +{ + std::string url = "https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + + // TEMP for Jim's pdp + //url = "http://pdp24.lindenlab.com:3000/"; + } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; + + llinfos << "http get: " << url << llendl; + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), LLViewerMedia::getHeaders()); +} + + LLSD LLViewerMedia::getHeaders() { LLSD headers = LLSD::emptyMap(); @@ -1452,24 +1479,7 @@ void LLViewerMedia::setOpenIDCookie() new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); - std::string url = "https://marketplace.secondlife.com/"; - - if (!LLGridManager::getInstance()->isInProductionGrid()) - { - std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); - url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); - } - - url += "api/1/users/"; - url += gAgent.getID().getString(); - url += "/user_status"; - - headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = sOpenIDCookie; - headers["User-Agent"] = getCurrentUserAgent(); - - LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), headers); + doOnetimeEarlyHTTPRequests(); } } diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml index d06190ec54..383e637ace 100644 --- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml @@ -4,7 +4,7 @@ start_folder="Received Items" follows="all" layout="topleft" top="0" left="0" height="165" width="308" - top_pad="0" + top_pad="0" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" background_visible="true" diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml index af32056428..396d5cf2f5 100644 --- a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml @@ -4,7 +4,7 @@ start_folder="Outbox" follows="all" layout="topleft" top="0" left="0" height="165" width="308" - top_pad="0" + top_pad="0" bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" background_visible="true" diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 79a0ec7c72..1d1d4ca01e 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -129,41 +129,43 @@ + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + name="outbox_layout_panel" + visible="false" + min_dim="35" + max_dim="200" + expanded_min_dim="90" + height="200"> + width="330"> + Merchant Outbox ([NUM]) + Merchant Outbox diff --git a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml index 48b987d7e8..ab3de1eaab 100644 --- a/indra/newview/skins/default/xui/en/widgets/color_swatch.xml +++ b/indra/newview/skins/default/xui/en/widgets/color_swatch.xml @@ -1,7 +1,7 @@ + name="colorswatch"> diff --git a/indra/newview/skins/default/xui/en/widgets/layout_stack.xml b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml new file mode 100644 index 0000000000..48bcb46533 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/layout_stack.xml @@ -0,0 +1,4 @@ + + + + diff --git a/indra/newview/skins/default/xui/en/widgets/menu_bar.xml b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml new file mode 100644 index 0000000000..ee3ef0cd7a --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/menu_bar.xml @@ -0,0 +1,7 @@ + + diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml index e5cea476da..7452d685eb 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_separator.xml @@ -1,6 +1,8 @@ + name="separator" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor" + label="-----------"> diff --git a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml index 185ed6ee3e..72af3924c1 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu_item_tear_off.xml @@ -1,7 +1,8 @@  - + name="tear_off" + label = "~~~~~~~~~~~" + disabled_color="MenuItemDisabledColor" + highlight_bg_color="MenuItemHighlightBgColor" + highlight_fg_color="MenuItemHighlightFgColor"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml index e0900b48f3..90b0625982 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider.xml @@ -1,6 +1,7 @@ + mouse_opaque="true" + text_disabled_color="LabelDisabledColor" + draw_track="true" + use_triangle="false" + font="SansSerifSmall"/> diff --git a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml index 04a2cd635c..bbcb008df4 100644 --- a/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml +++ b/indra/newview/skins/default/xui/en/widgets/multi_slider_bar.xml @@ -1,5 +1,6 @@ - + thumb_width="8" + mouse_opaque="true" + follows="left|top"/> diff --git a/indra/newview/skins/default/xui/en/widgets/name_list.xml b/indra/newview/skins/default/xui/en/widgets/name_list.xml new file mode 100644 index 0000000000..3ae0f68227 --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/name_list.xml @@ -0,0 +1,3 @@ + + diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 47a210d9b7..b36f723831 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -4,7 +4,8 @@ bg_opaque_image - image name for "in-front" panel look bg_alpha_image - image name for "in-back" or transparent panel look --> - + thickness="15" + tab_stop="false"> - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml index 86356ff563..70f2e88d13 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_container.xml @@ -1,5 +1,8 @@ - diff --git a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml index dd93675807..e43989c6c7 100644 --- a/indra/newview/skins/default/xui/en/widgets/scroll_list.xml +++ b/indra/newview/skins/default/xui/en/widgets/scroll_list.xml @@ -1,5 +1,6 @@ - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/search_editor.xml b/indra/newview/skins/default/xui/en/widgets/search_editor.xml index 32e443a058..faa0404b35 100644 --- a/indra/newview/skins/default/xui/en/widgets/search_editor.xml +++ b/indra/newview/skins/default/xui/en/widgets/search_editor.xml @@ -1,5 +1,6 @@ - - diff --git a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml index 757f0f49d1..ba2fdf4f1f 100644 --- a/indra/newview/skins/default/xui/en/widgets/texture_picker.xml +++ b/indra/newview/skins/default/xui/en/widgets/texture_picker.xml @@ -1,5 +1,9 @@ - + - \ No newline at end of file + bevel_style="out" + mouse_opaque="false" + follows="all"/> \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/web_browser.xml b/indra/newview/skins/default/xui/en/widgets/web_browser.xml index 118d63bbf0..676fafd828 100644 --- a/indra/newview/skins/default/xui/en/widgets/web_browser.xml +++ b/indra/newview/skins/default/xui/en/widgets/web_browser.xml @@ -1,2 +1,4 @@ - + -- cgit v1.2.3 From 12832768e122ba76a12b3b673526f7d36f896618 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 6 Sep 2011 14:45:37 -0700 Subject: EXP-1196 FIX Fix param block template ordering forgot to set menu name in menu.xml reviewed by Leslie --- indra/newview/skins/default/xui/en/widgets/menu.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/widgets/menu.xml b/indra/newview/skins/default/xui/en/widgets/menu.xml index 58543338f6..13ac84beb2 100644 --- a/indra/newview/skins/default/xui/en/widgets/menu.xml +++ b/indra/newview/skins/default/xui/en/widgets/menu.xml @@ -1,5 +1,6 @@ - Date: Tue, 6 Sep 2011 16:05:03 -0700 Subject: build fix --- indra/llui/llview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 6a9384367d..0616c2a0c0 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2549,7 +2549,7 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent) if (p.left_pad.isProvided()) { // left_pad is based on prior widget's right edge - p.left_delta.set(p.left_pad + last_rect.getWidth(), false); + p.left_delta.set(p.left_pad + default_rect.getWidth(), false); } default_rect.translate(p.left_delta, p.bottom_delta); -- cgit v1.2.3 From 6bb2b2cb99740a00498f5441b8a48b0bf5a04985 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 7 Sep 2011 12:45:50 -0700 Subject: EXP-1194 FIX -- Update New tag behavior to update Newness timestamp when Received Items panel is open and do not auto open Received Items panel * Updated inbox freshness time setting name to "LastInventoryInboxActivity" * New time stamp reflects time of last activity performed on the inbox by the user * Selection and opening items in the inbox both count as activity on the inbox * Focus going to the inbox panel counts as activity on the inbox * Creation date of folders now computed based on date of items being added to them * Creation date of folders no longer relies on queries for creation date, as is done during sorting * Folders are assumed to be "new" if no inbox freshness time setting is saved --- .../newview/app_settings/settings_per_account.xml | 4 +- indra/newview/llfolderviewitem.cpp | 62 ++++++++-------------- indra/newview/llfolderviewitem.h | 4 +- indra/newview/llinventorypanel.cpp | 5 +- indra/newview/llinventorypanel.h | 2 + indra/newview/llpanelmarketplaceinbox.cpp | 6 ++- indra/newview/llpanelmarketplaceinboxinventory.cpp | 44 +++++++++------ indra/newview/llpanelmarketplaceinboxinventory.h | 8 +-- .../newview/llpanelmarketplaceoutboxinventory.cpp | 5 -- indra/newview/llpanelmarketplaceoutboxinventory.h | 2 - indra/newview/llsidepanelinventory.cpp | 4 +- 11 files changed, 71 insertions(+), 75 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings_per_account.xml b/indra/newview/app_settings/settings_per_account.xml index 49f8a11e3e..c7140283f1 100644 --- a/indra/newview/app_settings/settings_per_account.xml +++ b/indra/newview/app_settings/settings_per_account.xml @@ -33,10 +33,10 @@ Value - LastInventoryInboxExpansion + LastInventoryInboxActivity Comment - The last time the received items inbox was expanded for view. + The last time the received items inbox was poked by the user. Persist 1 Type diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 72e2294196..00bc63326b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2057,23 +2057,42 @@ BOOL LLFolderViewFolder::isRemovable() BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) { mItems.push_back(item); + if (item->isSelected()) { recursiveIncrementNumDescendantsSelected(1); } + item->setRect(LLRect(0, 0, getRect().getWidth(), 0)); item->setVisible(FALSE); - addChild( item ); + + addChild(item); + item->dirtyFilter(); + + // Update the folder creation date if the child is newer than our current date + setCreationDate(llmax(mCreationDate, item->getCreationDate())); + + // Handle sorting requestArrange(); requestSort(); + + // Traverse parent folders and update creation date and resort, if necessary LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && parentp->mSortFunction.isByDate()) + while (parentp) { - // parent folder doesn't have a time stamp yet, so get it from us - parentp->requestSort(); + // Update the folder creation date if the child is newer than our current date + parentp->setCreationDate(llmax(parentp->mCreationDate, item->getCreationDate())); + + if (parentp->mSortFunction.isByDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + } + parentp = parentp->getParentFolder(); } + return TRUE; } @@ -2437,41 +2456,6 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { - // folders have no creation date try to create one from an item somewhere in our folder hierarchy - if (!mCreationDate) - { - for (items_t::const_iterator iit = mItems.begin(); - iit != mItems.end(); ++iit) - { - LLFolderViewItem* itemp = (*iit); - - const time_t item_creation_date = itemp->getCreationDate(); - - if (item_creation_date) - { - setCreationDate(item_creation_date); - break; - } - } - - if (!mCreationDate) - { - for (folders_t::const_iterator fit = mFolders.begin(); - fit != mFolders.end(); ++fit) - { - LLFolderViewFolder* folderp = (*fit); - - const time_t folder_creation_date = folderp->getCreationDate(); - - if (folder_creation_date) - { - setCreationDate(folder_creation_date); - break; - } - } - } - } - return llmax(mCreationDate, mSubtreeCreationDate); } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index ce936b4991..676eaf825d 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -136,7 +136,7 @@ protected: std::string mSearchableLabel; S32 mLabelWidth; bool mLabelWidthDirty; - mutable time_t mCreationDate; + time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsCurSelection; @@ -174,7 +174,7 @@ protected: static LLFontGL* getLabelFontForStyle(U8 style); - virtual void setCreationDate(time_t creation_date_utc) const { mCreationDate = creation_date_utc; } + virtual void setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; } public: BOOL postBuild(); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5f033cf517..173e5c6ae6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -234,7 +234,6 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); } - mFolderRoot->setSortOrder(getFilter()->getSortOrder()); // hide inbox getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); @@ -347,6 +346,10 @@ U32 LLInventoryPanel::getSortOrder() const return mFolderRoot->getSortOrder(); } +void LLInventoryPanel::requestSort() +{ + mFolderRoot->requestSort(); +} void LLInventoryPanel::setSinceLogoff(BOOL sl) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 7676bbb6d7..cfb84bf4b7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -208,6 +208,8 @@ public: void setSortOrder(U32 order); U32 getSortOrder() const; + void requestSort(); + private: std::string mSortOrderSetting; diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 9f17c34dfb..8d0712a328 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -95,8 +95,10 @@ LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel() LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect(); mInventoryPanel->setShape(inventory_placeholder_rect); - // Set the sort order newest to oldest, and a selection change callback + // Set the sort order newest to oldest mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + // Set selection callback for proper update of inventory status buttons mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); // Set up the note to display when the inbox is empty @@ -113,6 +115,8 @@ void LLPanelMarketplaceInbox::onFocusReceived() LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); sidepanel_inventory->clearSelections(true, false, true); + + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index e5b0db92f3..47f34434db 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -37,6 +37,8 @@ #include "llviewerfoldertype.h" +#define DEBUGGING_FRESHNESS 0 + // // statics // @@ -188,49 +190,57 @@ void LLInboxFolderViewFolder::draw() LLFolderViewFolder::draw(); } -BOOL LLInboxFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) -{ - BOOL retval = LLFolderViewFolder::addToFolder(folder, root); - - // Only mark top-level inbox folders as fresh - mFresh = (mParentFolder == mRoot); - - return retval; -} - -void LLInboxFolderViewFolder::updateFlag() const +void LLInboxFolderViewFolder::computeFreshness() { - const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxExpansion"); + const std::string& last_expansion = gSavedPerAccountSettings.getString("LastInventoryInboxActivity"); if (!last_expansion.empty()) { LLDate saved_freshness_date = LLDate(last_expansion); mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); + +#if DEBUGGING_FRESHNESS + if (mFresh) + { + llinfos << "Item is fresh! -- creation " << mCreationDate << ", saved_freshness_date " << saved_freshness_date.secondsSinceEpoch() << llendl; + } +#endif + } + else + { + mFresh = true; } } +void LLInboxFolderViewFolder::deFreshify() +{ + mFresh = false; + + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); +} + void LLInboxFolderViewFolder::selectItem() { LLFolderViewFolder::selectItem(); - mFresh = false; + deFreshify(); } void LLInboxFolderViewFolder::toggleOpen() { LLFolderViewFolder::toggleOpen(); - mFresh = false; + deFreshify(); } -void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const +void LLInboxFolderViewFolder::setCreationDate(time_t creation_date_utc) { mCreationDate = creation_date_utc; - if (mFresh) + if (mParentFolder == mRoot) { - updateFlag(); + computeFreshness(); } } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 06706539a0..089facf80c 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -75,18 +75,18 @@ public: void draw(); - BOOL addToFolder(LLFolderViewFolder* folder, LLFolderView* root); + void computeFreshness(); + void deFreshify(); - void updateFlag() const; void selectItem(); void toggleOpen(); bool isFresh() const { return mFresh; } protected: - void setCreationDate(time_t creation_date_utc) const; + void setCreationDate(time_t creation_date_utc); - mutable bool mFresh; + bool mFresh; }; diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.cpp b/indra/newview/llpanelmarketplaceoutboxinventory.cpp index 14b6ee9e0a..ed1206aec8 100644 --- a/indra/newview/llpanelmarketplaceoutboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceoutboxinventory.cpp @@ -259,11 +259,6 @@ void LLOutboxFolderViewFolder::setError(S32 errorCode) } } -void LLOutboxFolderViewFolder::setCreationDate(time_t creation_date_utc) const -{ - mCreationDate = creation_date_utc; -} - // // LLOutboxFolderViewItem Implementation // diff --git a/indra/newview/llpanelmarketplaceoutboxinventory.h b/indra/newview/llpanelmarketplaceoutboxinventory.h index ec55b7eb2e..346680a79d 100644 --- a/indra/newview/llpanelmarketplaceoutboxinventory.h +++ b/indra/newview/llpanelmarketplaceoutboxinventory.h @@ -77,8 +77,6 @@ public: bool hasError() const { return (mError != 0); } protected: - void setCreationDate(time_t creation_date_utc) const; - S32 mError; }; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 522de30467..858639215c 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -539,7 +539,7 @@ void LLSidepanelInventory::onToggleInboxBtn() if (inbox_expanded && inboxPanel->isInVisibleChain()) { - gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } } @@ -568,7 +568,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) #else if (mInboxEnabled && getChild(INBOX_BUTTON_NAME)->getToggleState()) { - gSavedPerAccountSettings.setString("LastInventoryInboxExpansion", LLDate::now().asString()); + gSavedPerAccountSettings.setString("LastInventoryInboxActivity", LLDate::now().asString()); } #endif -- cgit v1.2.3 From c64bd7d5cb28fc221716e866ff9c9a28c22e69ce Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 7 Sep 2011 12:46:37 -0700 Subject: Reduced text spam on exit by not trying to set all objects to a NULL region. Reviewed by Richard. --- indra/newview/llviewerobjectlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index db5684665b..153a91e7d8 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1254,7 +1254,8 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep) BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) { // Don't ever kill gAgentAvatarp, just force it to the agent's region - if (objectp == gAgentAvatarp) + // unless region is NULL which is assumed to mean you are logging out. + if ((objectp == gAgentAvatarp) && gAgent.getRegion()) { objectp->setRegion(gAgent.getRegion()); return FALSE; @@ -1277,6 +1278,7 @@ BOOL LLViewerObjectList::killObject(LLViewerObject *objectp) return TRUE; } + return FALSE; } -- cgit v1.2.3