From f5886bfaff0385acf0a55bc1b8678330ae89442a Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 8 Aug 2011 14:37:36 -0700 Subject: EXP-1065 FIX Inventory has slowed to a crawl. Clicking between items has an average one second delay. Same with switching between tabs. disable traversal of inventory contents for findView family of functions --- indra/newview/llfolderview.cpp | 12 ++---------- indra/newview/llfolderview.h | 1 - indra/newview/llfolderviewitem.h | 2 ++ indra/newview/llinventorypanel.cpp | 4 +--- 4 files changed, 5 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 7581fa91c5..02be477e0d 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -369,16 +369,6 @@ void LLFolderView::closeAllFolders() arrangeAll(); } -void LLFolderView::openFolder(const std::string& foldername) -{ - LLFolderViewFolder* inv = findChild(foldername); - if (inv) - { - setSelection(inv, FALSE, FALSE); - inv->setOpen(TRUE); - } -} - void LLFolderView::openTopLevelFolders() { for (folders_t::iterator iter = mFolders.begin(); @@ -720,8 +710,10 @@ void LLFolderView::extendSelection(LLFolderViewItem* selection, LLFolderViewItem mSignalSelectCallback = SIGNAL_KEYBOARD_FOCUS; } +static LLFastTimer::DeclareTimer FTM_SANITIZE_SELECTION("Sanitize Selection"); void LLFolderView::sanitizeSelection() { + LLFastTimer _(FTM_SANITIZE_SELECTION); // store off current item in case it is automatically deselected // and we want to preserve context LLFolderViewItem* original_selected_item = getCurSelectedItem(); diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 0b92548fd0..705a76a7b4 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -108,7 +108,6 @@ public: // Close all folders in the view void closeAllFolders(); - void openFolder(const std::string& foldername); void openTopLevelFolders(); virtual void toggleOpen() {}; diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index f70e63ecdf..dac0c3032c 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -328,6 +328,8 @@ public: virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); + virtual LLView* findChildView(const std::string& name, BOOL recurse) const { return NULL; } + // virtual void handleDropped(); virtual void draw(); virtual BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d5d40ca65d..1aa402802e 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -812,9 +812,7 @@ void LLInventoryPanel::openStartFolderOrMyInventory() && fchild->getListener() && fchild->getListener()->getUUID() == gInventory.getRootFolderID()) { - const std::string& child_name = child->getName(); - mFolderRoot->openFolder(child_name); - mFolderRoot->clearSelection(); // No need to keep it selected though! + fchild->setOpen(TRUE); break; } } -- cgit v1.2.3 From b6685b5872a4afe976f39d201868b8d656044e84 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 8 Aug 2011 15:13:53 -0700 Subject: EXP-1065 FIX -- Inventory has slowed to a crawl. Clicking between items has an average one second delay. Same with switching between tabs. * Removed numerous places in the code that called findChild across the inventory panel unnecessarily. * Conglomerated uses of inbox and outbox inventory panels to the sidepanel class so the pointers can be cached and functionality like selection handling can be done more efficiently. * Optimized LLView::childHasKeyboardFocus() to work backwards up from the focus object rather than searching for children that may or may not turn out to have focus. Reviewed by Richard. --- indra/newview/llavataractions.cpp | 8 +-- indra/newview/llfloaterworldmap.cpp | 46 ++++++++------- indra/newview/llfloaterworldmap.h | 5 ++ indra/newview/llpanelmaininventory.cpp | 20 ++----- indra/newview/llpanelmarketplaceinbox.cpp | 23 ++------ indra/newview/llpanelmarketplaceinbox.h | 2 +- indra/newview/llpanelmarketplaceoutbox.cpp | 25 ++------ indra/newview/llpanelmarketplaceoutbox.h | 2 +- indra/newview/llsidepanelinventory.cpp | 92 ++++++++++++++++++++++-------- indra/newview/llsidepanelinventory.h | 5 ++ 10 files changed, 121 insertions(+), 107 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index f22b02093f..48edecc89c 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -697,12 +697,8 @@ std::set LLAvatarActions::getInventorySelectedUUIDs() if (inventory_selected_uuids.empty()) { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); - LLInventoryPanel * inbox = sidepanel_inventory->findChild("inventory_inbox"); - if (inbox) - { - inventory_selected_uuids = inbox->getRootFolder()->getSelectionList(); - } - + + inventory_selected_uuids = sidepanel_inventory->getInboxOrOutboxSelectionList(); } return inventory_selected_uuids; diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index d5f0648f3b..8e11d71048 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -237,16 +237,19 @@ const LLUUID LLFloaterWorldMap::sHomeID( "10000000-0000-0000-0000-000000000001" LLFloaterWorldMap::LLFloaterWorldMap(const LLSD& key) : LLFloater(key), -mInventory(NULL), -mInventoryObserver(NULL), -mFriendObserver(NULL), -mCompletingRegionName(), -mCompletingRegionPos(), -mWaitingForTracker(FALSE), -mIsClosing(FALSE), -mSetToUserPosition(TRUE), -mTrackedLocation(0,0,0), -mTrackedStatus(LLTracker::TRACKING_NOTHING) + mInventory(NULL), + mInventoryObserver(NULL), + mFriendObserver(NULL), + mCompletingRegionName(), + mCompletingRegionPos(), + mWaitingForTracker(FALSE), + mIsClosing(FALSE), + mSetToUserPosition(TRUE), + mTrackedLocation(0,0,0), + mTrackedStatus(LLTracker::TRACKING_NOTHING), + mListFriendCombo(NULL), + mListLandmarkCombo(NULL), + mListSearchResults(NULL) { gFloaterWorldMap = this; @@ -281,17 +284,20 @@ BOOL LLFloaterWorldMap::postBuild() avatar_combo->selectFirstItem(); avatar_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onAvatarComboPrearrange, this) ); avatar_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); + mListFriendCombo = dynamic_cast(avatar_combo); LLSearchEditor *location_editor = getChild("location"); location_editor->setFocusChangedCallback(boost::bind(&LLFloaterWorldMap::onLocationFocusChanged, this, _1)); location_editor->setKeystrokeCallback( boost::bind(&LLFloaterWorldMap::onSearchTextEntry, this)); getChild("search_results")->setDoubleClickCallback( boost::bind(&LLFloaterWorldMap::onClickTeleportBtn, this)); + mListSearchResults = childGetListInterface("search_results"); LLComboBox *landmark_combo = getChild( "landmark combo"); landmark_combo->selectFirstItem(); landmark_combo->setPrearrangeCallback( boost::bind(&LLFloaterWorldMap::onLandmarkComboPrearrange, this) ); landmark_combo->setTextEntryCallback( boost::bind(&LLFloaterWorldMap::onComboTextEntry, this) ); + mListLandmarkCombo = dynamic_cast(landmark_combo); mCurZoomVal = log(LLWorldMapView::sMapScale)/log(2.f); getChild("zoom slider")->setValue(LLWorldMapView::sMapScale); @@ -864,7 +870,7 @@ void LLFloaterWorldMap::friendsChanged() // No longer really builds a list. Instead, just updates mAvatarCombo. void LLFloaterWorldMap::buildAvatarIDList() { - LLCtrlListInterface *list = childGetListInterface("friend combo"); + LLCtrlListInterface *list = mListFriendCombo; if (!list) return; // Delete all but the "None" entry @@ -894,7 +900,7 @@ void LLFloaterWorldMap::buildAvatarIDList() void LLFloaterWorldMap::buildLandmarkIDLists() { - LLCtrlListInterface *list = childGetListInterface("landmark combo"); + LLCtrlListInterface *list = mListLandmarkCombo; if (!list) return; // Delete all but the "None" entry @@ -955,7 +961,7 @@ F32 LLFloaterWorldMap::getDistanceToDestination(const LLVector3d &destination, void LLFloaterWorldMap::clearLocationSelection(BOOL clear_ui) { - LLCtrlListInterface *list = childGetListInterface("search_results"); + LLCtrlListInterface *list = mListSearchResults; if (list) { list->operateOnAll(LLCtrlListInterface::OP_DELETE); @@ -969,7 +975,7 @@ void LLFloaterWorldMap::clearLandmarkSelection(BOOL clear_ui) { if (clear_ui || !childHasKeyboardFocus("landmark combo")) { - LLCtrlListInterface *list = childGetListInterface("landmark combo"); + LLCtrlListInterface *list = mListLandmarkCombo; if (list) { list->selectByValue( "None" ); @@ -983,7 +989,7 @@ void LLFloaterWorldMap::clearAvatarSelection(BOOL clear_ui) if (clear_ui || !childHasKeyboardFocus("friend combo")) { mTrackedStatus = LLTracker::TRACKING_NOTHING; - LLCtrlListInterface *list = childGetListInterface("friend combo"); + LLCtrlListInterface *list = mListFriendCombo; if (list) { list->selectByValue( "None" ); @@ -1051,7 +1057,7 @@ void LLFloaterWorldMap::onLandmarkComboPrearrange( ) return; } - LLCtrlListInterface *list = childGetListInterface("landmark combo"); + LLCtrlListInterface *list = mListLandmarkCombo; if (!list) return; LLUUID current_choice = list->getCurrentID(); @@ -1087,7 +1093,7 @@ void LLFloaterWorldMap::onLandmarkComboCommit() return; } - LLCtrlListInterface *list = childGetListInterface("landmark combo"); + LLCtrlListInterface *list = mListLandmarkCombo; if (!list) return; LLUUID asset_id; @@ -1134,7 +1140,7 @@ void LLFloaterWorldMap::onAvatarComboPrearrange( ) return; } - LLCtrlListInterface *list = childGetListInterface("friend combo"); + LLCtrlListInterface *list = mListFriendCombo; if (!list) return; LLUUID current_choice; @@ -1159,7 +1165,7 @@ void LLFloaterWorldMap::onAvatarComboCommit() return; } - LLCtrlListInterface *list = childGetListInterface("friend combo"); + LLCtrlListInterface *list = mListFriendCombo; if (!list) return; const LLUUID& new_avatar_id = list->getCurrentID(); @@ -1553,7 +1559,7 @@ void LLFloaterWorldMap::updateSims(bool found_null_sim) void LLFloaterWorldMap::onCommitSearchResult() { - LLCtrlListInterface *list = childGetListInterface("search_results"); + LLCtrlListInterface *list = mListSearchResults; if (!list) return; LLSD selected_value = list->getSelectedValue(); diff --git a/indra/newview/llfloaterworldmap.h b/indra/newview/llfloaterworldmap.h index 783d9f4819..e3b83b2579 100644 --- a/indra/newview/llfloaterworldmap.h +++ b/indra/newview/llfloaterworldmap.h @@ -39,6 +39,7 @@ #include "lltracker.h" #include "llslurl.h" +class LLCtrlListInterface; class LLFriendObserver; class LLInventoryModel; class LLInventoryObserver; @@ -190,6 +191,10 @@ private: std::string mTrackedSimName; std::string mTrackedAvatarName; LLSLURL mSLURL; + + LLCtrlListInterface * mListFriendCombo; + LLCtrlListInterface * mListLandmarkCombo; + LLCtrlListInterface * mListSearchResults; }; extern LLFloaterWorldMap* gFloaterWorldMap; diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 1920cc2940..858f5cf575 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -572,28 +572,16 @@ void LLPanelMainInventory::updateItemcountText() { text = getString("ItemcountUnknown"); } + + // *TODO: Cache the LLUICtrl* for the ItemcountText control getChild("ItemcountText")->setValue(text); } void LLPanelMainInventory::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); - - LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild("inventory_inbox"); - - if (inbox_panel) - { - inbox_panel->clearSelection(); - } - - LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); - - if (outbox_panel) - { - outbox_panel->clearSelection(); - } - - sidepanel_inventory->updateVerbs(); + + sidepanel_inventory->clearSelections(false, true, true); } void LLPanelMainInventory::setFilterTextFromFilter() diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index c505ad85a3..141e29fcec 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -83,7 +83,7 @@ void LLPanelMarketplaceInbox::handleLoginComplete() LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); } -void LLPanelMarketplaceInbox::setupInventoryPanel() +LLInventoryPanel * LLPanelMarketplaceInbox::setupInventoryPanel() { LLView * inbox_inventory_placeholder = getChild("inbox_inventory_placeholder"); LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent(); @@ -106,30 +106,15 @@ void LLPanelMarketplaceInbox::setupInventoryPanel() // Hide the placeholder text inbox_inventory_placeholder->setVisible(FALSE); + + return mInventoryPanel; } void LLPanelMarketplaceInbox::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); - - if (sidepanel_inventory) - { - LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); - - if (inv_panel) - { - inv_panel->clearSelection(); - } - LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); - - if (outbox_panel) - { - outbox_panel->clearSelection(); - } - - sidepanel_inventory->updateVerbs(); - } + sidepanel_inventory->clearSelections(true, false, true); } 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/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 4ecea29304..7b4ed137db 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -55,7 +55,7 @@ public: /*virtual*/ void draw(); - void setupInventoryPanel(); + LLInventoryPanel * setupInventoryPanel(); U32 getFreshItemCount() const; U32 getTotalItemCount() const; diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 74d0de3b30..d51a0d78fe 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -83,25 +83,8 @@ void LLPanelMarketplaceOutbox::handleLoginComplete() void LLPanelMarketplaceOutbox::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); - - if (sidepanel_inventory) - { - LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); - - if (inv_panel) - { - inv_panel->clearSelection(); - } - - LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild("inventory_inbox"); - - if (inbox_panel) - { - inbox_panel->clearSelection(); - } - - sidepanel_inventory->updateVerbs(); - } + + sidepanel_inventory->clearSelections(true, true, false); } void LLPanelMarketplaceOutbox::onSelectionChange() @@ -111,7 +94,7 @@ void LLPanelMarketplaceOutbox::onSelectionChange() sidepanel_inventory->updateVerbs(); } -void LLPanelMarketplaceOutbox::setupInventoryPanel() +LLInventoryPanel * LLPanelMarketplaceOutbox::setupInventoryPanel() { LLView * outbox_inventory_placeholder = getChild("outbox_inventory_placeholder"); LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent(); @@ -134,6 +117,8 @@ void LLPanelMarketplaceOutbox::setupInventoryPanel() // Hide the placeholder text outbox_inventory_placeholder->setVisible(FALSE); + + return mInventoryPanel; } bool LLPanelMarketplaceOutbox::isOutboxEmpty() const diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 1b502127ef..8e2c35914d 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -54,7 +54,7 @@ public: /*virtual*/ BOOL postBuild(); - void setupInventoryPanel(); + LLInventoryPanel * setupInventoryPanel(); bool isOutboxEmpty() const; bool isSyncInProgress() const; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 6f809ba3ca..54198cc577 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -132,6 +132,8 @@ private: LLSidepanelInventory::LLSidepanelInventory() : LLPanel() , mItemPanel(NULL) + , mInventoryPanelInbox(NULL) + , mInventoryPanelOutbox(NULL) , mPanelMainInventory(NULL) , mInboxEnabled(false) , mOutboxEnabled(false) @@ -351,7 +353,7 @@ void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) // LLPanelMarketplaceInbox * inbox = getChild(MARKETPLACE_INBOX_PANEL); - inbox->setupInventoryPanel(); + mInventoryPanelInbox = inbox->setupInventoryPanel(); } @@ -380,7 +382,7 @@ void LLSidepanelInventory::observeOutboxModifications(const LLUUID& outboxID) // LLPanelMarketplaceOutbox * outbox = getChild(MARKETPLACE_OUTBOX_PANEL); - outbox->setupInventoryPanel(); + mInventoryPanelOutbox = outbox->setupInventoryPanel(); } void LLSidepanelInventory::enableInbox(bool enabled) @@ -529,14 +531,12 @@ void LLSidepanelInventory::onShopButtonClicked() void LLSidepanelInventory::performActionOnSelection(const std::string &action) { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); - LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - LLInventoryPanel* inbox = findChild("inventory_inbox"); - if (inbox) + if (mInventoryPanelInbox) { - current_item = inbox->getRootFolder()->getCurSelectedItem(); + current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem(); } if (!current_item) @@ -545,7 +545,7 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) } } - current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action); + current_item->getListener()->performAction(mPanelMainInventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() @@ -687,19 +687,16 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { - LLPanelMainInventory* panel_main_inventory = - mInventoryPanel->findChild("panel_main_inventory"); - - LLInventoryPanel* inbox = findChild("inventory_inbox"); + LLInventoryPanel* inbox = mInventoryPanelInbox; // Avoid flicker in the Recent tab while inventory is being loaded. if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty()) - && (panel_main_inventory && !panel_main_inventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) ) + && (mPanelMainInventory && !mPanelMainInventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) ) { return false; } - return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false) + return ( (mPanelMainInventory ? LLAvatarActions::canShareSelectedItems(mPanelMainInventory->getActivePanel()) : false) || (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) ); } @@ -724,14 +721,13 @@ bool LLSidepanelInventory::canWearSelected() LLInventoryItem *LLSidepanelInventory::getSelectedItem() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); - LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + LLFolderViewItem* current_item = mPanelMainInventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); + if (!current_item) { - LLInventoryPanel* inbox = findChild("inventory_inbox"); - if (inbox) + if (mInventoryPanelInbox) { - current_item = inbox->getRootFolder()->getCurSelectedItem(); + current_item = mInventoryPanelInbox->getRootFolder()->getCurSelectedItem(); } if (!current_item) @@ -748,14 +744,20 @@ U32 LLSidepanelInventory::getSelectedCount() { int count = 0; - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild("panel_main_inventory"); - std::set selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); + std::set selection_list = mPanelMainInventory->getActivePanel()->getRootFolder()->getSelectionList(); count += selection_list.size(); - LLInventoryPanel* inbox = findChild("inventory_inbox"); - if (inbox) + if ((count == 0) && mInboxEnabled && (mInventoryPanelInbox != NULL)) { - selection_list = inbox->getRootFolder()->getSelectionList(); + selection_list = mInventoryPanelInbox->getRootFolder()->getSelectionList(); + + count += selection_list.size(); + } + + if ((count == 0) && mOutboxEnabled && (mInventoryPanelOutbox != NULL)) + { + selection_list = mInventoryPanelOutbox->getRootFolder()->getSelectionList(); + count += selection_list.size(); } @@ -779,3 +781,45 @@ BOOL LLSidepanelInventory::isMainInventoryPanelActive() const { return mInventoryPanel->getVisible(); } + +void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox, bool clearOutbox) +{ + if (clearMain) + { + LLInventoryPanel * inv_panel = getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + } + + if (clearInbox && mInboxEnabled && (mInventoryPanelInbox != NULL)) + { + mInventoryPanelInbox->clearSelection(); + } + + if (clearOutbox && mOutboxEnabled && (mInventoryPanelOutbox != NULL)) + { + mInventoryPanelOutbox->clearSelection(); + } + + updateVerbs(); +} + +std::set LLSidepanelInventory::getInboxOrOutboxSelectionList() +{ + std::set inventory_selected_uuids; + + if (mInboxEnabled && (mInventoryPanelInbox != NULL)) + { + inventory_selected_uuids = mInventoryPanelInbox->getRootFolder()->getSelectionList(); + } + + if (inventory_selected_uuids.empty() && mOutboxEnabled && (mInventoryPanelOutbox != NULL)) + { + inventory_selected_uuids = mInventoryPanelOutbox->getRootFolder()->getSelectionList(); + } + + return inventory_selected_uuids; +} diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 9117e3bf27..f80a3a9dd3 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -58,6 +58,9 @@ public: LLInventoryPanel* getActivePanel(); // Returns an active inventory panel, if any. LLPanelMainInventory* getMainInventoryPanel() const { return mPanelMainInventory; } BOOL isMainInventoryPanelActive() const; + + void clearSelections(bool clearMain, bool clearInbox, bool clearOutbox); + std::set getInboxOrOutboxSelectionList(); void showItemInfoPanel(); void showTaskInfoPanel(); @@ -95,6 +98,8 @@ protected: // private: LLPanel* mInventoryPanel; // Main inventory view + LLInventoryPanel* mInventoryPanelInbox; + LLInventoryPanel* mInventoryPanelOutbox; LLSidepanelItemInfo* mItemPanel; // Individual item view LLSidepanelTaskInfo* mTaskPanel; // Individual in-world object view LLPanelMainInventory* mPanelMainInventory; -- cgit v1.2.3 From 11005a9d917dde208fc0917bb84701d09e1a395e Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 10 Aug 2011 10:52:56 -0700 Subject: added fast timers to profile inventory LLSD deserialization --- indra/newview/llfolderview.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 02be477e0d..f471caa65c 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2040,8 +2040,10 @@ void LLFolderView::removeItemID(const LLUUID& id) mItemMap.erase(id); } +LLFastTimer::DeclareTimer FTM_GET_ITEM_BY_ID("Get FolderViewItem by ID"); LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) { + LLFastTimer _(FTM_GET_ITEM_BY_ID); if (id == getListener()->getUUID()) { return this; -- cgit v1.2.3 From dfcd11e51e68922b5158ef4076721f7c66a3d637 Mon Sep 17 00:00:00 2001 From: Aaron Stone Date: Wed, 10 Aug 2011 11:55:05 -0700 Subject: CHOP-757 Ask for the inventory-basic login option and dump its return id to llinfo. --- indra/newview/lllogininstance.cpp | 1 + indra/newview/llstartup.cpp | 6 ++++++ 2 files changed, 7 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 00de6a86e1..b20f89aa7c 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -568,6 +568,7 @@ void LLLoginInstance::constructAuthParams(LLPointer user_credentia else { requested_options.append("basic-mode"); + requested_options.append("inventory-basic"); } #endif diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b390c933f7..1cbf99dbe7 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1543,6 +1543,12 @@ bool idle_startup() } } + LLSD inv_basic = response["inventory-basic"]; + if(inv_basic.isDefined()) + { + llinfos << "Basic inventory root folder id is " << inv_basic["folder_id"] << llendl; + } + LLSD buddy_list = response["buddy-list"]; if(buddy_list.isDefined()) { -- cgit v1.2.3 From e630e98253ab226a9af00da75ba8d91c82326aac Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 10 Aug 2011 14:15:15 -0700 Subject: EXP-1028 FIX Move mode switching to logged in UI added mode switching button to status bars for advanced and basic mode, changed login combo box to use menu instead --- indra/newview/llpanellogin.cpp | 30 --------- indra/newview/llpanellogin.h | 2 - indra/newview/llstartup.cpp | 21 +++---- indra/newview/llviewermenu.cpp | 73 +++++++++++++++++++--- indra/newview/skins/default/xui/en/panel_login.xml | 33 +++------- .../skins/default/xui/en/panel_status_bar.xml | 13 +++- indra/newview/skins/minimal/xui/en/main_view.xml | 4 +- indra/newview/skins/minimal/xui/en/panel_login.xml | 37 +++-------- .../skins/minimal/xui/en/panel_navigation_bar.xml | 2 +- .../skins/minimal/xui/en/panel_status_bar.xml | 15 ++++- 10 files changed, 116 insertions(+), 114 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index 27f341b4f6..bef809f3a7 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -154,10 +154,6 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } updateLocationCombo(false); - LLUICtrl& mode_combo = getChildRef("mode_combo"); - mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile")); - mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild("mode_combo")->getValue(), _2)); - LLComboBox* server_choice_combo = sInstance->getChild("server_combo"); server_choice_combo->setCommitCallback(onSelectServer, NULL); server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1)); @@ -1025,32 +1021,6 @@ void LLPanelLogin::updateLoginPanelLinks() sInstance->getChildView("forgot_password_text")->setVisible( system_grid); } -void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value) -{ - if (original_value.asString() != new_value.asString()) - { - LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2)); - } -} - -void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response) -{ - S32 option = LLNotificationsUtil::getSelectedOption(notification, response); - switch (option) - { - case 0: - gSavedSettings.getControl("SessionSettingsFile")->set(new_value); - LLAppViewer::instance()->forceQuit(); - break; - case 1: - // revert to original value - getChild("mode_combo")->setValue(original_value); - break; - default: - break; - } -} - std::string canonicalize_username(const std::string& name) { std::string cname = name; diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index 11273453ba..b29b3af7ca 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -97,8 +97,6 @@ private: static void onServerComboLostFocus(LLFocusableElement*); static void updateServerCombo(); static void updateStartSLURL(); - void onModeChange(const LLSD& original_value, const LLSD& new_value); - void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response); static void updateLoginPanelLinks(); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index b390c933f7..aa908d8cfd 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -720,7 +720,13 @@ bool idle_startup() timeout_count = 0; - initialize_edit_menu(); + // Login screen needs menus for preferences, but we can enter + // this startup phase more than once. + if (gLoginMenuBarView == NULL) + { + initialize_edit_menu(); + init_menus(); + } if (show_connect_box) { @@ -755,19 +761,6 @@ bool idle_startup() LLStartUp::setStartupState( STATE_LOGIN_CLEANUP ); } - // *NOTE: This is where LLViewerParcelMgr::getInstance() used to get allocated before becoming LLViewerParcelMgr::getInstance(). - - // *NOTE: This is where gHUDManager used to bet allocated before becoming LLHUDManager::getInstance(). - - // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). - - // Login screen needs menus for preferences, but we can enter - // this startup phase more than once. - if (gLoginMenuBarView == NULL) - { - init_menus(); - } - gViewerWindow->setNormalControlsVisible( FALSE ); gLoginMenuBarView->setVisible( TRUE ); gLoginMenuBarView->setEnabled( TRUE ); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f74bcafc5c..e5dfa51e7f 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -831,7 +831,8 @@ U32 feature_from_string(std::string feature) }; -class LLAdvancedToggleFeature : public view_listener_t{ +class LLAdvancedToggleFeature : public view_listener_t +{ bool handleEvent(const LLSD& userdata) { U32 feature = feature_from_string( userdata.asString() ); @@ -844,18 +845,19 @@ class LLAdvancedToggleFeature : public view_listener_t{ }; class LLAdvancedCheckFeature : public view_listener_t -{bool handleEvent(const LLSD& userdata) { - U32 feature = feature_from_string( userdata.asString() ); - bool new_value = false; - - if ( feature != 0 ) + bool handleEvent(const LLSD& userdata) { - new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); - } + U32 feature = feature_from_string( userdata.asString() ); + bool new_value = false; - return new_value; -} + if ( feature != 0 ) + { + new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); + } + + return new_value; + } }; void toggle_destination_and_avatar_picker(const LLSD& show) @@ -7774,6 +7776,55 @@ class LLToggleUIHints : public view_listener_t } }; +class LLCheckSessionsSettings : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string expected = userdata.asString(); + return gSavedSettings.getString("SessionSettingsFile") == expected; + } +}; + +class LLChangeMode : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string mode = userdata.asString(); + if (mode == "basic") + { + if (gSavedSettings.getString("SessionSettingsFile") != "settings_minimal.xml") + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "settings_minimal.xml", _1, _2)); + } + return true; + } + else if (mode == "advanced") + { + if (gSavedSettings.getString("SessionSettingsFile") != "") + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(onModeChangeConfirm, "", _1, _2)); + } + return true; + } + return false; + } + + static void onModeChangeConfirm(const std::string& new_session_settings_file, const LLSD& notification, const LLSD& response) + { + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + switch (option) + { + case 0: + gSavedSettings.getControl("SessionSettingsFile")->set(new_session_settings_file); + LLAppViewer::instance()->forceQuit(); + break; + case 1: + default: + break; + } + } +}; + void LLUploadCostCalculator::calculateCost() { S32 upload_cost = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); @@ -8263,6 +8314,8 @@ void initialize_menus() view_listener_t::addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); view_listener_t::addMenu(new LLToggleUIHints(), "ToggleUIHints"); + view_listener_t::addMenu(new LLCheckSessionsSettings(), "CheckSessionSettings"); + view_listener_t::addMenu(new LLChangeMode(), "ChangeMode"); commit.add("Destination.show", boost::bind(&toggle_destination_and_avatar_picker, 0)); commit.add("Avatar.show", boost::bind(&toggle_destination_and_avatar_picker, 1)); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 8d0f1437e6..079fb958ec 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -117,33 +117,16 @@ label="Remember password" name="connect_btn" top="35" width="90" /> - - Mode: - - - - - + menu_filename="menu_mode_change.xml" + /> + + width="70"> 24:00 AM PST