diff options
-rw-r--r-- | indra/newview/llfolderview.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfolderviewitem.cpp | 27 | ||||
-rw-r--r-- | indra/newview/llfolderviewitem.h | 13 | ||||
-rw-r--r-- | indra/newview/llinventorybridge.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llinventoryfilter.cpp | 32 | ||||
-rw-r--r-- | indra/newview/llpanellandmarks.cpp | 19 | ||||
-rw-r--r-- | indra/newview/llsidepaneliteminfo.cpp | 25 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/sidepanel_item_info.xml | 18 |
8 files changed, 83 insertions, 69 deletions
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 1c5d7ae9b9..321982ceb6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -411,7 +411,12 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } - if (folderp->getVisible()) + + // Need to call arrange regardless of visibility, since children's visibility + // might need to be changed too (e.g. even though a folder is invisible, its + // children also need to be set invisible for state-tracking purposes, e.g. + // llfolderviewitem::filter). + // if (folderp->getVisible()) { S32 child_height = 0; S32 child_width = 0; @@ -479,13 +484,13 @@ void LLFolderView::filter( LLInventoryFilter& filter ) if (getCompletedFilterGeneration() < filter.getCurrentGeneration()) { - mFiltered = FALSE; + mPassedFilter = FALSE; mMinWidth = 0; LLFolderViewFolder::filter(filter); } else { - mFiltered = TRUE; + mPassedFilter = TRUE; } } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index fe793fbcb8..135821f662 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -122,7 +122,7 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p) mHasVisibleChildren(FALSE), mIndentation(0), mNumDescendantsSelected(0), - mFiltered(FALSE), + mPassedFilter(FALSE), mLastFilterGeneration(-1), mStringMatchOffset(std::string::npos), mControlLabelRotation(0.f), @@ -224,17 +224,17 @@ BOOL LLFolderViewItem::potentiallyVisible() BOOL LLFolderViewItem::getFiltered() { - return mFiltered && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); + return mPassedFilter && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); } BOOL LLFolderViewItem::getFiltered(S32 filter_generation) { - return mFiltered && mLastFilterGeneration >= filter_generation; + return mPassedFilter && mLastFilterGeneration >= filter_generation; } void LLFolderViewItem::setFiltered(BOOL filtered, S32 filter_generation) { - mFiltered = filtered; + mPassedFilter = filtered; mLastFilterGeneration = filter_generation; } @@ -424,19 +424,20 @@ S32 LLFolderViewItem::getItemHeight() void LLFolderViewItem::filter( LLInventoryFilter& filter) { - BOOL filtered = mListener && filter.check(this); + const BOOL previous_passed_filter = mPassedFilter; + const BOOL passed_filter = mListener && filter.check(this); - // if our visibility will change as a result of this filter, then + // If our visibility will change as a result of this filter, then // we need to be rearranged in our parent folder - if (getVisible() != filtered) + if (mParentFolder) { - if (mParentFolder) - { + if (getVisible() != passed_filter) + mParentFolder->requestArrange(); + if (passed_filter != previous_passed_filter) mParentFolder->requestArrange(); - } } - setFiltered(filtered, filter.getCurrentGeneration()); + setFiltered(passed_filter, filter.getCurrentGeneration()); mStringMatchOffset = filter.getStringMatchOffset(); filter.decrementFilterCount(); @@ -1243,7 +1244,7 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) if (getLastFilterGeneration() < filter_generation) { if (getLastFilterGeneration() >= must_pass_generation && // folder has been compared to a valid precursor filter - !mFiltered) // and did not pass the filter + !mPassedFilter) // and did not pass the filter { // go ahead and flag this folder as done mLastFilterGeneration = filter_generation; @@ -1381,7 +1382,7 @@ void LLFolderViewFolder::setFiltered(BOOL filtered, S32 filter_generation) { // if this folder is now filtered, but wasn't before // (it just passed) - if (filtered && !mFiltered) + if (filtered && !mPassedFilter) { // reset current height, because last time we drew it // it might have had more visible items than now diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 43a5fd8de5..620aa070b9 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -121,6 +121,9 @@ public: static const F32 FOLDER_CLOSE_TIME_CONSTANT; static const F32 FOLDER_OPEN_TIME_CONSTANT; + // Mostly for debugging printout purposes. + const std::string& getSearchableLabel() { return mSearchableLabel; } + protected: friend class LLUICtrlFactory; friend class LLFolderViewEventListener; @@ -149,7 +152,7 @@ protected: BOOL mHasVisibleChildren; S32 mIndentation; S32 mNumDescendantsSelected; - BOOL mFiltered; + BOOL mPassedFilter; S32 mLastFilterGeneration; std::string::size_type mStringMatchOffset; F32 mControlLabelRotation; @@ -157,8 +160,8 @@ protected: BOOL mDragAndDropTarget; LLUIImagePtr mArrowImage; LLUIImagePtr mBoxImage; - BOOL mIsLoading; - LLTimer mTimeSinceRequestStart; + BOOL mIsLoading; + LLTimer mTimeSinceRequestStart; bool mDontShowInHierarchy; // helper function to change the selection from the root. @@ -203,7 +206,7 @@ public: virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); virtual S32 getItemHeight(); void setDontShowInHierarchy(bool dont_show) { mDontShowInHierarchy = dont_show; } - bool getDontShowInHierarchy() { return mDontShowInHierarchy; } + bool getDontShowInHierarchy() const { return mDontShowInHierarchy; } // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); @@ -332,7 +335,7 @@ public: EAcceptance* accept, std::string& tooltip_msg); - private: +private: static std::map<U8, LLFontGL*> sFonts; // map of styles to fonts }; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 26a8a707b8..a503b7775a 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1471,13 +1471,14 @@ BOOL LLFolderBridge::isItemRemovable() { return FALSE; } + // Allow protected types to be removed, but issue a warning. - /* - if(LLFolderType::lookupIsProtectedType(category->getPreferredType())) + // Restrict to god mode so users don't inadvertently mess up their inventory. + if(LLFolderType::lookupIsProtectedType(category->getPreferredType()) && + !gAgent.isGodlike()) { return FALSE; } - */ LLInventoryPanel* panel = dynamic_cast<LLInventoryPanel*>(mInventoryPanel.get()); LLFolderViewFolder* folderp = dynamic_cast<LLFolderViewFolder*>(panel ? panel->getRootFolder()->getItemByID(mUUID) : NULL); diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 81b10f5a62..522edd0cb5 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -40,6 +40,7 @@ #include "llinventorymodel.h" // gInventory.backgroundFetchActive() #include "llviewercontrol.h" #include "llviewerinventory.h" +#include "llfolderview.h" // linden library includes #include "lltrans.h" @@ -329,7 +330,6 @@ void LLInventoryFilter::setFilterSubString(const std::string& string) mFilterSubString = string; LLStringUtil::toUpper(mFilterSubString); LLStringUtil::trimHead(mFilterSubString); - if (less_restrictive) { setModified(FILTER_LESS_RESTRICTIVE); @@ -512,21 +512,21 @@ void LLInventoryFilter::setModified(EFilterBehavior behavior) // if not keeping current filter results, update last valid as well switch(mFilterBehavior) { - case FILTER_RESTART: - mMustPassGeneration = mFilterGeneration; - mMinRequiredGeneration = mFilterGeneration; - break; - case FILTER_LESS_RESTRICTIVE: - mMustPassGeneration = mFilterGeneration; - break; - case FILTER_MORE_RESTRICTIVE: - mMinRequiredGeneration = mFilterGeneration; - // must have passed either current filter generation (meaningless, as it hasn't been run yet) - // or some older generation, so keep the value - mMustPassGeneration = llmin(mMustPassGeneration, mFilterGeneration); - break; - default: - llerrs << "Bad filter behavior specified" << llendl; + case FILTER_RESTART: + mMustPassGeneration = mFilterGeneration; + mMinRequiredGeneration = mFilterGeneration; + break; + case FILTER_LESS_RESTRICTIVE: + mMustPassGeneration = mFilterGeneration; + break; + case FILTER_MORE_RESTRICTIVE: + mMinRequiredGeneration = mFilterGeneration; + // must have passed either current filter generation (meaningless, as it hasn't been run yet) + // or some older generation, so keep the value + mMustPassGeneration = llmin(mMustPassGeneration, mFilterGeneration); + break; + default: + llerrs << "Bad filter behavior specified" << llendl; } } else diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 32c9faa688..e56ed00dcb 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -367,6 +367,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() initLandmarksPanel(mFavoritesInventoryPanel); mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); + initAccordion("tab_favorites", mFavoritesInventoryPanel); } @@ -428,6 +429,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis } root_folder->setParentLandmarksPanel(this); + inventory_list->saveFolderState(); } void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list) @@ -1030,21 +1032,30 @@ void LLLandmarksPanel::doCreatePick(LLLandmark* landmark) ////////////////////////////////////////////////////////////////////////// static void filter_list(LLInventorySubTreePanel* inventory_list, const std::string& string) { - // Open the immediate children of the root folder, since those - // are invisible in the UI and thus must always be open. - inventory_list->getRootFolder()->openTopLevelFolders(); - + // When search is cleared, restore the old folder state. if (string == "") { inventory_list->setFilterSubString(LLStringUtil::null); + // Re-open folders that were open before + inventory_list->restoreFolderState(); } + // Open the immediate children of the root folder, since those + // are invisible in the UI and thus must always be open. + inventory_list->getRootFolder()->openTopLevelFolders(); + if (inventory_list->getFilterSubString().empty() && string.empty()) { // current filter and new filter empty, do nothing return; } + // save current folder open state if no filter currently applied + if (inventory_list->getRootFolder()->getFilterSubString().empty()) + { + inventory_list->saveFolderState(); + } + // Set new filter string inventory_list->setFilterSubString(string); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index 449bdefb8f..25518d87d6 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -109,19 +109,30 @@ BOOL LLSidepanelItemInfo::postBuild() { LLSidepanelInventorySubpanel::postBuild(); - // build the UI - // item name & description childSetPrevalidate("LabelItemName",&LLLineEditor::prevalidateASCIIPrintableNoPipe); - //getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); + getChild<LLUICtrl>("LabelItemName")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitName,this)); childSetPrevalidate("LabelItemDesc",&LLLineEditor::prevalidateASCIIPrintableNoPipe); - //getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); - + getChild<LLUICtrl>("LabelItemDesc")->setCommitCallback(boost::bind(&LLSidepanelItemInfo:: onCommitDescription, this)); // Creator information getChild<LLUICtrl>("BtnCreator")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickCreator,this)); - // owner information getChild<LLUICtrl>("BtnOwner")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onClickOwner,this)); - + // acquired date + // owner permissions + // Permissions debug text + // group permissions + getChild<LLUICtrl>("CheckShareWithGroup")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); + // everyone permissions + getChild<LLUICtrl>("CheckEveryoneCopy")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); + // next owner permissions + getChild<LLUICtrl>("CheckNextOwnerModify")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); + getChild<LLUICtrl>("CheckNextOwnerCopy")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); + getChild<LLUICtrl>("CheckNextOwnerTransfer")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitPermissions, this)); + // Mark for sale or not, and sale info + getChild<LLUICtrl>("CheckPurchase")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this)); + getChild<LLUICtrl>("RadioSaleType")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleType, this)); + // "Price" label for edit + getChild<LLUICtrl>("Edit Cost")->setCommitCallback(boost::bind(&LLSidepanelItemInfo::onCommitSaleInfo, this)); refresh(); return TRUE; } diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index 7b0b4b0bde..3cddbed2d4 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -510,22 +510,4 @@ top_pad="10" Price: L$ </text--> </panel> - <panel - height="25" - layout="bottomright" - help_topic="button_tab" - name="button_panel" - left="5" - bottom="5" - width="313"> - <button - follows="bottom|right" - height="25" - label="Cancel" - layout="topleft" - name="cancel_btn" - right="-1" - left_pad="10" - width="100" /> - </panel> </panel> |