From d11fc1133a890651c51a2b94ec72407b1681e9a4 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 29 Jul 2010 13:35:54 +0300 Subject: EXT-7565 FIXED RECOVER FROM BAD MERGE (Would be nice to preserve selection while switching between folder/list view modes) Added missed (during bad merge 14077:5b5cc4a8642d) code to the llpanloutfitedit(.h/.cpp): recover LLPanelOutfitEdit::updateWearablesPanelVerbButtons() and LLPanelOutfitEdit::saveListSelection() methods Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/817/ --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 70 +++++++++++++++++++++++++++++++++---- indra/newview/llpaneloutfitedit.h | 7 ++++ 2 files changed, 71 insertions(+), 6 deletions(-) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index b56cf5c3ce..126830e05d 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -42,6 +42,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" +#include "llfolderviewitem.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" @@ -328,7 +329,9 @@ BOOL LLPanelOutfitEdit::postBuild() childSetCommitCallback("filter_button", boost::bind(&LLPanelOutfitEdit::showWearablesFilter, this), NULL); childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesFolderView, this), NULL); + childSetCommitCallback("folder_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::showWearablesListView, this), NULL); + childSetCommitCallback("list_view_btn", boost::bind(&LLPanelOutfitEdit::saveListSelection, this), NULL); childSetCommitCallback("wearables_gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("gear_menu_btn", boost::bind(&LLPanelOutfitEdit::onGearButtonClick, this, _1), NULL); childSetCommitCallback("shop_btn_1", boost::bind(&LLPanelOutfitEdit::onShopButtonClicked, this), NULL); @@ -489,9 +492,7 @@ void LLPanelOutfitEdit::showWearablesListView() { if(switchPanels(mInventoryItemsPanel, mWearablesListViewPanel)) { - mFolderViewBtn->setToggleState(FALSE); - mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); - mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mListViewBtn->setToggleState(TRUE); @@ -501,9 +502,7 @@ void LLPanelOutfitEdit::showWearablesFolderView() { if(switchPanels(mWearablesListViewPanel, mInventoryItemsPanel)) { - mListViewBtn->setToggleState(FALSE); - mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); - mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + updateWearablesPanelVerbButtons(); updateFiltersVisibility(); } mFolderViewBtn->setToggleState(TRUE); @@ -1155,5 +1154,64 @@ void LLPanelOutfitEdit::onCOFChanged() update(); } +void LLPanelOutfitEdit::updateWearablesPanelVerbButtons() +{ + if(mWearablesListViewPanel->getVisible()) + { + mFolderViewBtn->setToggleState(FALSE); + mFolderViewBtn->setImageOverlay(getString("folder_view_off"), mFolderViewBtn->getImageOverlayHAlign()); + mListViewBtn->setImageOverlay(getString("list_view_on"), mListViewBtn->getImageOverlayHAlign()); + } + else if(mInventoryItemsPanel->getVisible()) + { + mListViewBtn->setToggleState(FALSE); + mListViewBtn->setImageOverlay(getString("list_view_off"), mListViewBtn->getImageOverlayHAlign()); + mFolderViewBtn->setImageOverlay(getString("folder_view_on"), mFolderViewBtn->getImageOverlayHAlign()); + } +} + +void LLPanelOutfitEdit::saveListSelection() +{ + if(mWearablesListViewPanel->getVisible()) + { + std::set selected_ids = mInventoryItemsPanel->getRootFolder()->getSelectionList(); + + if(!selected_ids.size()) return; + + mWearableItemsList->resetSelection(); + + for (std::set::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + mWearableItemsList->selectItemByUUID(*item_id, true); + } + mWearableItemsList->scrollToShowFirstSelectedItem(); + } + else if(mInventoryItemsPanel->getVisible()) + { + std::vector selected_ids; + mWearableItemsList->getSelectedUUIDs(selected_ids); + + if(!selected_ids.size()) return; + + mInventoryItemsPanel->clearSelection(); + LLFolderView* root = mInventoryItemsPanel->getRootFolder(); + + if(!root) return; + + for(std::vector::const_iterator item_id = selected_ids.begin(); item_id != selected_ids.end(); ++item_id) + { + LLFolderViewItem* item = root->getItemByID(*item_id); + if (!item) continue; + + LLFolderViewFolder* parent = item->getParentFolder(); + if(parent) + { + parent->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); + } + mInventoryItemsPanel->getRootFolder()->changeSelection(item, TRUE); + } + mInventoryItemsPanel->getRootFolder()->scrollToShowSelection(); + } +} // EOF diff --git a/indra/newview/llpaneloutfitedit.h b/indra/newview/llpaneloutfitedit.h index 13ceda98a6..b3394e45a3 100644 --- a/indra/newview/llpaneloutfitedit.h +++ b/indra/newview/llpaneloutfitedit.h @@ -201,6 +201,13 @@ private: void getCurrentItemUUID(LLUUID& selected_id); void onCOFChanged(); + /** + * Method preserves selection while switching between folder/list view modes + */ + void saveListSelection(); + + void updateWearablesPanelVerbButtons(); + typedef std::pair selection_info_t; LLWearableType::EType getCOFWearablesSelectionType() const; -- cgit v1.2.3 From 90353be438268c71300a5dfaac0a5fb79c71551c Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Thu, 29 Jul 2010 13:37:29 +0300 Subject: EXT-8179 FIXED (Group profile: 'Save' button remains disabled if state of check-boxes was changed during refreshing of 'General' accordion) Disable accordion while refreshing group properties so the user could not change properties during refresh Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/815/ --HG-- branch : product-engine --- indra/newview/llpanelgroup.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 2fc74e138b..c383d04940 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -545,6 +545,7 @@ void LLPanelGroup::draw() { mRefreshTimer.stop(); childEnable("btn_refresh"); + childEnable("groups_accordion"); } LLButton* button_apply = findChild("btn_apply"); @@ -573,6 +574,8 @@ void LLPanelGroup::refreshData() // 5 second timeout childDisable("btn_refresh"); + childDisable("groups_accordion"); + mRefreshTimer.start(); mRefreshTimer.setTimerExpirySec(5); } -- cgit v1.2.3 From 92afbfaf88764e9be75458c5e2b2514e59a0deed Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 29 Jul 2010 15:52:36 +0300 Subject: EXT-7706 FIXED Implemented delayed friends cards synchronization and filling People/Friends tab with data until it is visible to user first time. * Moved location of synchronization of the Friends/All inventory folder with friends list from startup to first requesting of data. * Also updated "update Friends list" logic to be really trigged only when Friends tab is visible to user. NOTE: * Friends List/All is filled with some delay on first opening. TODO: refactoring is needed to switch code of updating People/nearby list to use the same approach as for Friends. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/805/ --HG-- branch : product-engine --- indra/newview/llfriendcard.cpp | 11 +++++++++++ indra/newview/llpanelpeople.cpp | 32 +++++++++++++++++++++++++++----- indra/newview/llstartup.cpp | 7 ------- 3 files changed, 38 insertions(+), 12 deletions(-) diff --git a/indra/newview/llfriendcard.cpp b/indra/newview/llfriendcard.cpp index 7f28e09933..2f4dae0af8 100644 --- a/indra/newview/llfriendcard.cpp +++ b/indra/newview/llfriendcard.cpp @@ -299,6 +299,17 @@ void LLFriendCardsManager::collectFriendsLists(folderid_buddies_map_t& folderBud { folderBuddiesMap.clear(); + static bool syncronize_friends_folders = true; + if (syncronize_friends_folders) + { + // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, + // fetches their contents if needed and synchronizes it with buddies list. + // If the folders are not found they are created. + LLFriendCardsManager::instance().syncFriendCardsFolders(); + syncronize_friends_folders = false; + } + + LLInventoryModel::cat_array_t* listFolders; LLInventoryModel::item_array_t* items; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 6dd800c0c6..3140fe8de1 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -272,6 +272,7 @@ public: friend class LLInventoryFriendCardObserver; LLFriendListUpdater(callback_t cb) : LLAvatarListUpdater(cb, FRIEND_LIST_UPDATE_TIMEOUT) + , mIsActive(false) { LLAvatarTracker::instance().addObserver(this); @@ -290,9 +291,12 @@ public: /*virtual*/ void changed(U32 mask) { - // events can arrive quickly in bulk - we need not process EVERY one of them - - // so we wait a short while to let others pile-in, and process them in aggregate. - mEventTimer.start(); + if (mIsActive) + { + // events can arrive quickly in bulk - we need not process EVERY one of them - + // so we wait a short while to let others pile-in, and process them in aggregate. + mEventTimer.start(); + } // save-up all the mask-bits which have come-in mMask |= mask; @@ -301,8 +305,12 @@ public: /*virtual*/ BOOL tick() { + if (!mIsActive) return FALSE; + if (mMask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) + { updateList(); + } // Stop updates. mEventTimer.stop(); @@ -311,9 +319,20 @@ public: return FALSE; } + // virtual + void setActive(bool active) + { + mIsActive = active; + if (active) + { + tick(); + } + } + private: U32 mMask; LLInventoryFriendCardObserver* mInvObserver; + bool mIsActive; /** * This class is intended for updating Friend List when Inventory Friend Card is added/removed. @@ -504,8 +523,11 @@ BOOL LLPanelPeople::postBuild() mTabContainer = getChild("tabs"); mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2)); - mOnlineFriendList = getChild(FRIENDS_TAB_NAME)->getChild("avatars_online"); - mAllFriendList = getChild(FRIENDS_TAB_NAME)->getChild("avatars_all"); + LLPanel* friends_tab = getChild(FRIENDS_TAB_NAME); + // updater is active only if panel is visible to user. + friends_tab->setVisibleCallback(boost::bind(&Updater::setActive, mFriendListUpdater, _2)); + mOnlineFriendList = friends_tab->getChild("avatars_online"); + mAllFriendList = friends_tab->getChild("avatars_all"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mAllFriendList->setNoItemsCommentText(getString("no_friends")); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 1ee73034f6..2475870b17 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -118,7 +118,6 @@ #include "llinventorybridge.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" -#include "llfriendcard.h" #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "lllogininstance.h" // Host the login module. @@ -1645,12 +1644,6 @@ bool idle_startup() //all categories loaded. lets create "My Favorites" category gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true); - // Checks whether "Friends" and "Friends/All" folders exist in "Calling Cards" folder, - // fetches their contents if needed and synchronizes it with buddies list. - // If the folders are not found they are created. - LLFriendCardsManager::instance().syncFriendCardsFolders(); - - // set up callbacks llinfos << "Registering Callbacks" << llendl; LLMessageSystem* msg = gMessageSystem; -- cgit v1.2.3 From 0a32095830703bf5d266f0e75cbe1b1447f70296 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 29 Jul 2010 17:12:37 +0300 Subject: EXT-7406 RE FIXED Replaced inventory collector for objects to exclude links from the Edit Outfit->Add More panel. Restored fix that was previosly committed in 76bd52803506 and then somewhy reverted in 5b5cc4a8642d. --HG-- branch : product-engine --- indra/newview/llpaneloutfitedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 126830e05d..8f065aa711 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -304,7 +304,7 @@ BOOL LLPanelOutfitEdit::postBuild() mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.All"), new LLFindNonLinksByMask(ALL_ITEMS_MASK))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Clothing"), new LLIsTypeActual(LLAssetType::AT_CLOTHING))); mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Bodyparts"), new LLIsTypeActual(LLAssetType::AT_BODYPART))); - mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindByMask(ATTACHMENT_MASK)));; + mListViewItemTypes.push_back(new LLFilterItem(getString("Filter.Objects"), new LLFindNonLinksByMask(ATTACHMENT_MASK)));; mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("shape"), new LLFindActualWearablesOfType(LLWearableType::WT_SHAPE))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("skin"), new LLFindActualWearablesOfType(LLWearableType::WT_SKIN))); mListViewItemTypes.push_back(new LLFilterItem(LLTrans::getString("hair"), new LLFindActualWearablesOfType(LLWearableType::WT_HAIR))); -- cgit v1.2.3 From 2c0632792101ebe5caedc3335fd9f28824cf1da9 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Thu, 29 Jul 2010 20:05:53 +0300 Subject: EXT-8043 FIXED Fixed wrong position of notifications when 'Move' or 'View' floaters are open and docked. Bug was caused by LLDockableFloater's mOverlapsScreenChannel to false only in one of it's constructors. So some floaters got initial value of mOverlapsScreenChannel depending on system- that's why bug reproduced on Windows and didn't reproduce on Linux. - Moved setting mOverlapsScreenChannel to false into LLDockableFloater's init() which is called by all of it's constructors. Reviewed by Alexei Arabadji at https://codereview.productengine.com/secondlife/r/818 --HG-- branch : product-engine --- indra/llui/lldockablefloater.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llui/lldockablefloater.cpp b/indra/llui/lldockablefloater.cpp index 3d8670fef2..4f5fcddbf4 100644 --- a/indra/llui/lldockablefloater.cpp +++ b/indra/llui/lldockablefloater.cpp @@ -49,12 +49,12 @@ void LLDockableFloater::init(LLDockableFloater* thiz) thiz->setCanClose(TRUE); thiz->setCanDock(true); thiz->setCanMinimize(TRUE); + thiz->setOverlapsScreenChannel(false); } LLDockableFloater::LLDockableFloater(LLDockControl* dockControl, const LLSD& key, const Params& params) : LLFloater(key, params), mDockControl(dockControl), mUniqueDocking(true) - , mOverlapsScreenChannel(false) { init(this); mUseTongue = true; -- cgit v1.2.3 From 7fcca83169287b5011b5b5a0193456e9a789619c Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Fri, 30 Jul 2010 10:02:09 +0300 Subject: EXT-8522 FIXED (Code improvements: Update a way in which Nearby people list is controlled depend on its visibility to user) 1. Removed special processing of Nearby People List Updater when: * tabs in People panel are changed; * People panel change its visibility. 2. Subscribed Nearby People List Updater's setActive() method directly to Nearby list Panel's onVisibleChange callback. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/825/ --HG-- branch : product-engine --- indra/newview/llpanelpeople.cpp | 31 +++---------------------------- indra/newview/llpanelpeople.h | 4 ---- 2 files changed, 3 insertions(+), 32 deletions(-) diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 3140fe8de1..3f5191ca12 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -515,8 +515,6 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL BOOL LLPanelPeople::postBuild() { - setVisibleCallback(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2)); - mFilterEditor = getChild("filter_input"); mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2)); @@ -533,7 +531,9 @@ BOOL LLPanelPeople::postBuild() mAllFriendList->setNoItemsCommentText(getString("no_friends")); mAllFriendList->setShowIcons("FriendsListShowIcons"); - mNearbyList = getChild(NEARBY_TAB_NAME)->getChild("avatar_list"); + LLPanel* nearby_tab = getChild(NEARBY_TAB_NAME); + nearby_tab->setVisibleCallback(boost::bind(&Updater::setActive, mNearbyListUpdater, _2)); + mNearbyList = nearby_tab->getChild("avatar_list"); mNearbyList->setNoItemsCommentText(getString("no_one_near")); mNearbyList->setNoItemsMsg(getString("no_one_near")); mNearbyList->setNoFilteredItemsMsg(getString("no_one_filtered_near")); @@ -977,28 +977,6 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save } } -void LLPanelPeople::onVisibilityChange(const LLSD& new_visibility) -{ - if (new_visibility.asBoolean() == FALSE) - { - // Don't update anything while we're invisible. - mNearbyListUpdater->setActive(FALSE); - } - else - { - reSelectedCurrentTab(); - } -} - -// Make the tab-container re-select current tab -// for onTabSelected() callback to get called. -// (currently this is needed to reactivate nearby list updates -// when we get visible) -void LLPanelPeople::reSelectedCurrentTab() -{ - mTabContainer->selectTab(mTabContainer->getCurrentPanelIndex()); -} - bool LLPanelPeople::isRealGroup() { return getCurrentItemID() != LLUUID::null; @@ -1046,7 +1024,6 @@ void LLPanelPeople::onFilterEdit(const std::string& search_string) void LLPanelPeople::onTabSelected(const LLSD& param) { std::string tab_name = getChild(param.asString())->getName(); - mNearbyListUpdater->setActive(tab_name == NEARBY_TAB_NAME); updateButtons(); showFriendsAccordionsIfNeeded(); @@ -1410,8 +1387,6 @@ void LLPanelPeople::onOpen(const LLSD& key) if (!tab_name.empty()) mTabContainer->selectTabByName(tab_name); - else - reSelectedCurrentTab(); } bool LLPanelPeople::notifyChildren(const LLSD& info) diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 17c45a034b..ff8df5c7a8 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -91,10 +91,6 @@ private: void showGroupMenu(LLMenuGL* menu); void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true); - void onVisibilityChange( const LLSD& new_visibility); - - void reSelectedCurrentTab(); - // UI callbacks void onFilterEdit(const std::string& search_string); void onTabSelected(const LLSD& param); -- cgit v1.2.3