diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 29894db6c..61030a8f1 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -2381,6 +2381,25 @@ void LLView::registerEventListener(std::string name, LLSimpleListener* function) } +struct LLSignalListener : LLSimpleListener +{ + LLSignalListener(LLView::event_signal_t::slot_type &cb) + { + mSignal.connect(cb); + } + /*virtual*/ bool handleEvent(LLPointer event, const LLSD& userdata) + { + mSignal(event, userdata); + return true; + } + LLView::event_signal_t mSignal; +}; + +void LLView::registerEventListener(std::string name, event_signal_t::slot_type &cb) +{ + registerEventListener(name, new LLSignalListener(cb)); +} + void LLView::deregisterEventListener(std::string name) { dispatch_list_t::iterator itor = mDispatchList.find(name); diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 1ac357a1f..d69360515 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -446,6 +446,10 @@ public: LLSimpleListener* getListenerByName(const std::string& callback_name); void registerEventListener(std::string name, LLSimpleListener* function); void deregisterEventListener(std::string name); + + typedef boost::signals2::signal event, const LLSD& userdata)> event_signal_t; + void registerEventListener(std::string name, event_signal_t::slot_type &cb); + std::string findEventListener(LLSimpleListener *listener) const; void addListenerToControl(LLEventDispatcher *observer, const std::string& name, LLSD filter, LLSD userdata); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 4e75cb535..d6e26d94c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -298,7 +298,7 @@ set(viewer_SOURCE_FILES llinventorymodel.cpp llinventorymodelbackgroundfetch.cpp llinventoryobserver.cpp - llinventoryview.cpp + llinventorypanel.cpp lljoystickbutton.cpp lllandmarklist.cpp lllocalinventory.cpp @@ -357,6 +357,7 @@ set(viewer_SOURCE_FILES llpanellandobjects.cpp llpanellandoptions.cpp llpanellogin.cpp + llpanelmaininventory.cpp llpanelmorph.cpp llpanelmediahud.cpp llpanelmsgs.cpp @@ -776,7 +777,7 @@ set(viewer_HEADER_FILES llinventorymodel.h llinventorymodelbackgroundfetch.h llinventoryobserver.h - llinventoryview.h + llinventorypanel.h lljoystickbutton.h lllandmarklist.h lllightconstants.h @@ -837,6 +838,7 @@ set(viewer_HEADER_FILES llpanellandoptions.h llpanelLCD.h llpanellogin.h + llpanelmaininventory.h llpanelmorph.h llpanelmediahud.h llpanelmsgs.h diff --git a/indra/newview/floaterao.cpp b/indra/newview/floaterao.cpp index d15b20e92..cff0dbe23 100644 --- a/indra/newview/floaterao.cpp +++ b/indra/newview/floaterao.cpp @@ -13,7 +13,6 @@ #include "llvoavatarself.h" #include "llanimationstates.h" #include "lluictrlfactory.h" -#include "llinventoryview.h" #include "llstartup.h" #include "llpreviewnotecard.h" #include "llviewertexteditor.h" @@ -26,8 +25,8 @@ #include "llinventory.h" #include "llinventoryfunctions.h" +#include "llinventorypanel.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventoryview.h" #include "roles_constants.h" #include "llviewerregion.h" diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 01cb1d74a..1f9a69386 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -40,7 +40,8 @@ #include "llfolderview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" -#include "llinventoryview.h" +#include "llfloaterinventory.h" +#include "llinventorypanel.h" #include "llmd5.h" #include "llnotificationsutil.h" #include "lltexlayer.h" @@ -52,6 +53,7 @@ #include "cofmgr.h" #include "llfloatercustomize.h" + // [RLVa:KB] - Checked: 2010-09-27 (RLVa-1.1.3b) #include "rlvhandler.h" #include "rlvinventory.h" diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index ad7387f3c..72f97a2c8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -171,6 +171,7 @@ #include "llvovolume.h" #include "llflexibleobject.h" #include "llvosurfacepatch.h" +#include "llfloaterinventory.h" // includes for idle() idleShutdown() #include "floaterao.h" @@ -188,8 +189,6 @@ #include "llviewerthrottle.h" #include "llparcel.h" -#include "llinventoryview.h" - #include "llcommandlineparser.h" #include "llprogressview.h" diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 9dda0221a..757252286 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -47,7 +47,8 @@ #include "llfloaterbuycurrency.h" #include "llnotify.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" +#include "llpanelmaininventory.h" #include "llpermissionsflags.h" #include "llpreviewnotecard.h" #include "llpreviewscript.h" diff --git a/indra/newview/llbuildnewviewsscheduler.h b/indra/newview/llbuildnewviewsscheduler.h index 2f819288f..83169d925 100644 --- a/indra/newview/llbuildnewviewsscheduler.h +++ b/indra/newview/llbuildnewviewsscheduler.h @@ -1,5 +1,5 @@ // -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llinventory.h" #include "lleventtimer.h" class LLBuildNewViewsScheduler : public LLEventTimer diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index 7b41bf74b..c3ac0cfa8 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -39,7 +39,7 @@ #include "llbutton.h" #include "llfocusmgr.h" #include "llfoldervieweventlistener.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llinventorymodel.h" #include "llinventoryfunctions.h" #include "lllineeditor.h" diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index 38ed371f2..66a417dda 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -43,12 +43,10 @@ #include "llcachename.h" #include "llagent.h" // for agent id -#include "llalertdialog.h" #include "llcheckboxctrl.h" -#include "llinventorymodel.h" // for gInventory #include "llinventorydefines.h" -#include "llinventoryview.h" -#include "llinventoryicon.h" +#include "llinventoryfunctions.h" +#include "llinventorymodel.h" // for gInventory #include "llnotificationsutil.h" #include "llselectmgr.h" #include "llscrolllistctrl.h" @@ -284,7 +282,7 @@ void LLFloaterBuyContents::onClickBuy(void*) // We may want to wear this item if (sInstance->childGetValue("wear_check")) { - LLInventoryView::sWearNewClothing = TRUE; + LLInventoryState::sWearNewClothing = TRUE; } // Put the items where we put new folders. diff --git a/indra/newview/llfloatergesture.cpp b/indra/newview/llfloatergesture.cpp index 78d7a6b28..c2d7ac14b 100644 --- a/indra/newview/llfloatergesture.cpp +++ b/indra/newview/llfloatergesture.cpp @@ -43,8 +43,9 @@ #include "llbutton.h" #include "llcombobox.h" #include "llgesturemgr.h" +#include "llfloaterinventory.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llkeyboard.h" #include "lllineeditor.h" #include "llpreviewgesture.h" diff --git a/indra/newview/llfloaterinventory.h b/indra/newview/llfloaterinventory.h new file mode 100644 index 000000000..c2041303d --- /dev/null +++ b/indra/newview/llfloaterinventory.h @@ -0,0 +1,37 @@ +/** + * @file llfloaterinventory.h + * @brief LLFloaterInventory, LLInventoryFolder, and LLInventoryItem + * class definition + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERINVENTORY_H +#define LL_LLFLOATERINVENTORY_H + +#include "llpanelmaininventory.h" + + +#endif // LL_LLFLOATERINVENTORY_H + + + diff --git a/indra/newview/llfloaterlandmark.cpp b/indra/newview/llfloaterlandmark.cpp index b6dd5bd2a..42bbbe0d7 100644 --- a/indra/newview/llfloaterlandmark.cpp +++ b/indra/newview/llfloaterlandmark.cpp @@ -42,7 +42,7 @@ #include "llfoldervieweventlistener.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llviewerinventory.h" #include "llpermissions.h" #include "llsaleinfo.h" diff --git a/indra/newview/llfloateropenobject.cpp b/indra/newview/llfloateropenobject.cpp index 7465eb94d..102856d6e 100644 --- a/indra/newview/llfloateropenobject.cpp +++ b/indra/newview/llfloateropenobject.cpp @@ -46,9 +46,10 @@ #include "llagent.h" // for agent id #include "llalertdialog.h" +#include "llfloaterinventory.h" #include "llinventorybridge.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llpanelinventory.h" #include "llselectmgr.h" #include "lluiconstants.h" @@ -56,7 +57,6 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" - LLFloaterOpenObject* LLFloaterOpenObject::sInstance = NULL; LLFloaterOpenObject::LLFloaterOpenObject() diff --git a/indra/newview/llfloaterreporter.cpp b/indra/newview/llfloaterreporter.cpp index 9dec6b49f..dccb8ab89 100644 --- a/indra/newview/llfloaterreporter.cpp +++ b/indra/newview/llfloaterreporter.cpp @@ -55,7 +55,7 @@ #include "llagent.h" #include "llbutton.h" #include "llcheckboxctrl.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "lllineeditor.h" #include "lltexturectrl.h" #include "llscrolllistctrl.h" diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 5a6790b6d..bfe40f33c 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -35,12 +35,12 @@ #include "llfolderview.h" #include "llcallbacklist.h" +#include "llfloaterinventory.h" #include "llinventorybridge.h" #include "llinventoryclipboard.h" // *TODO: remove this once hack below gone. #include "llinventoryfilter.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventoryview.h" #include "llfoldertype.h" #include "llkeyboard.h" #include "lllineeditor.h" diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 115476183..1bed779ff 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -52,9 +52,9 @@ #include "llfloater.h" #include "llfloatergroupinfo.h" #include "llimview.h" +#include "llfloaterinventory.h" #include "llinventory.h" #include "llinventoryfunctions.h" -#include "llinventoryview.h" #include "llfloateractivespeakers.h" #include "llfloateravatarinfo.h" #include "llfloaterchat.h" diff --git a/indra/newview/llinventoryactions.cpp b/indra/newview/llinventoryactions.cpp index 27c9dc56e..5c081054d 100644 --- a/indra/newview/llinventoryactions.cpp +++ b/indra/newview/llinventoryactions.cpp @@ -34,7 +34,7 @@ #include // for std::pair<> -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llpanelinventory.h" #include "llinventorybridge.h" @@ -56,6 +56,7 @@ #include "llfloateravatarinfo.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" +#include "llfloaterinventory.h" #include "llfloaterproperties.h" #include "llfocusmgr.h" #include "llfolderview.h" @@ -257,14 +258,7 @@ class LLResetFilter : public inventory_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) { - LLInventoryViewFinder *finder = mPtr->getFinder(); - mPtr->getActivePanel()->getFilter()->resetDefault(); - if (finder) - { - finder->updateElementsFromFilter(); - } - - mPtr->setFilterTextFromFilter(); + mPtr->resetFilters(); return true; } }; diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 61418100f..ecdd0bc73 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -34,7 +34,7 @@ #include // for std::pair<> -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" @@ -60,6 +60,7 @@ #include "llfloateravatarinfo.h" #include "llfloaterchat.h" #include "llfloatercustomize.h" +#include "llfloaterinventory.h" #include "llfloaterproperties.h" #include "llfloaterworldmap.h" diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index c4546838d..d9c508e03 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -43,6 +43,7 @@ // newview includes #include "llappviewer.h" //#include "llfirstuse.h" +#include "llfloaterinventory.h" #include "llfocusmgr.h" #include "llfolderview.h" #include "llgesturemgr.h" @@ -51,7 +52,6 @@ #include "llinventorybridge.h" #include "llinventoryclipboard.h" #include "llinventorymodel.h" -#include "llinventoryview.h" #include "lllineeditor.h" #include "llmenugl.h" #include "llnotificationsutil.h" diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 5b4dab172..c85b6fa75 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -45,8 +45,9 @@ #include "llagent.h" #include "llfloater.h" +#include "llfloaterinventory.h" #include "llfocusmgr.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llviewerinventory.h" #include "llviewermessage.h" #include "llfoldertype.h" diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 5c67d5017..9be69dffb 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -30,7 +30,7 @@ #include "llagent.h" #include "llappviewer.h" #include "llcallbacklist.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llinventorymodel.h" #include "llviewercontrol.h" #include "llviewerinventory.h" diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp new file mode 100644 index 000000000..bc264cc1e --- /dev/null +++ b/indra/newview/llinventorypanel.cpp @@ -0,0 +1,775 @@ +/** + * @file llinventoryview.cpp + * @brief Implementation of the inventory view and associated stuff. + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" +#include "llinventorypanel.h" + +#include // for std::pair<> + +#include "llagent.h" +#include "llagentwearables.h" +#include "lluictrlfactory.h" +#include "llfloatercustomize.h" +#include "llfolderview.h" +#include "llimview.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llinventorymodelbackgroundfetch.h" +#include "llviewerfoldertype.h" +#include "llvoavatarself.h" +#include "llscrollcontainer.h" +#include "llviewerassettype.h" + +#include "llsdserialize.h" + +// [RLVa:KB] +#include "rlvhandler.h" +// [/RLVa:KB] + +static LLRegisterWidget r("inventory_panel"); + + + +///---------------------------------------------------------------------------- +/// Local function declarations, constants, enums, and typedefs +///---------------------------------------------------------------------------- + + + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryPanelObserver +// +// Bridge to support knowing when the inventory has changed. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +class LLInventoryPanelObserver : public LLInventoryObserver +{ +public: + LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} + virtual ~LLInventoryPanelObserver() {} + virtual void changed(U32 mask) + { + mIP->modelChanged(mask); + } +protected: + LLInventoryPanel* mIP; +}; + + + + + +const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder"); +const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder"); +const std::string LLInventoryPanel::WORNITEMS_SORT_ORDER = std::string("WornItemsSortOrder"); +const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); + +LLInventoryPanel::LLInventoryPanel(const std::string& name, + const std::string& sort_order_setting, + const LLRect& rect, + LLInventoryModel* inventory, + BOOL allow_multi_select, + LLView *parent_view) : + LLPanel(name, rect, TRUE), + mInventory(inventory), + mInventoryObserver(NULL), + mFolderRoot(NULL), + mScroller(NULL), + mAllowMultiSelect(allow_multi_select), + mSortOrderSetting(sort_order_setting) +{ + setBackgroundColor(gColors.getColor("InventoryBackgroundColor")); + setBackgroundVisible(TRUE); + setBackgroundOpaque(TRUE); +} + +BOOL LLInventoryPanel::postBuild() +{ + init_inventory_panel_actions(this); + + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + mFolderRoot = new LLFolderView(getName(), NULL, folder_rect, LLUUID::null, this); + mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); + + // scroller + LLRect scroller_view_rect = getRect(); + scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); + mScroller = new LLScrollableContainerView(std::string("Inventory Scroller"), + scroller_view_rect, + mFolderRoot); + mScroller->setFollowsAll(); + mScroller->setReserveScrollCorner(TRUE); + addChild(mScroller); + mFolderRoot->setScrollContainer(mScroller); + + // set up the callbacks from the inventory we're viewing, and then + // build everything. + mInventoryObserver = new LLInventoryPanelObserver(this); + mInventory->addObserver(mInventoryObserver); + rebuildViewsFor(LLUUID::null, LLInventoryObserver::ADD); + + // bit of a hack to make sure the inventory is open. + mFolderRoot->openFolder(std::string("My Inventory")); + + if (mSortOrderSetting != INHERIT_SORT_ORDER) + { + setSortOrder(gSavedSettings.getU32(mSortOrderSetting)); + } + else + { + setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); + } + mFolderRoot->setSortOrder(mFolderRoot->getFilter()->getSortOrder()); + + + return TRUE; +} + +LLInventoryPanel::~LLInventoryPanel() +{ + if (mFolderRoot) + { + U32 sort_order = mFolderRoot->getSortOrder(); + if (mSortOrderSetting != INHERIT_SORT_ORDER) + { + gSavedSettings.setU32(mSortOrderSetting, sort_order); + } + } + + // LLView destructor will take care of the sub-views. + mInventory->removeObserver(mInventoryObserver); + delete mInventoryObserver; + mScroller = NULL; +} + +// virtual +LLXMLNodePtr LLInventoryPanel::getXML(bool save_children) const +{ + LLXMLNodePtr node = LLPanel::getXML(false); // Do not print out children + + node->setName(LL_INVENTORY_PANEL_TAG); + + node->createChild("allow_multi_select", TRUE)->setBoolValue(mFolderRoot->getAllowMultiSelect()); + + return node; +} + +LLView* LLInventoryPanel::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) +{ + LLInventoryPanel* panel; + + std::string name("inventory_panel"); + node->getAttributeString("name", name); + + BOOL allow_multi_select = TRUE; + node->getAttributeBOOL("allow_multi_select", allow_multi_select); + + LLRect rect; + createRect(node, rect, parent, LLRect()); + + std::string sort_order(INHERIT_SORT_ORDER); + node->getAttributeString("sort_order", sort_order); + + panel = new LLInventoryPanel(name, sort_order, + rect, &gInventory, + allow_multi_select, parent); + + panel->initFromXML(node, parent); + + panel->postBuild(); + + return panel; +} + +void LLInventoryPanel::draw() +{ + // select the desired item (in case it wasn't loaded when the selection was requested) + if (mSelectThisID.notNull()) + { + setSelection(mSelectThisID, false); + } + LLPanel::draw(); +} + +LLInventoryFilter* LLInventoryPanel::getFilter() +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + +const LLInventoryFilter* LLInventoryPanel::getFilter() const +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + +void LLInventoryPanel::setFilterTypes(U32 filter_types) +{ + getFilter()->setFilterTypes(filter_types); +} + +U32 LLInventoryPanel::getFilterTypes() const +{ + return mFolderRoot->getFilterTypes(); +} + +U32 LLInventoryPanel::getFilterPermMask() const +{ + return mFolderRoot->getFilterPermissions(); +} + +void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) +{ + getFilter()->setFilterPermissions(filter_perm_mask); +} + +void LLInventoryPanel::setFilterWorn(bool worn) +{ + getFilter()->setFilterWorn(worn); +} + +void LLInventoryPanel::setFilterSubString(const std::string& string) +{ + getFilter()->setFilterSubString(string); +} + +const std::string LLInventoryPanel::getFilterSubString() +{ + return mFolderRoot->getFilterSubString(); +} + +void LLInventoryPanel::setSortOrder(U32 order) +{ + getFilter()->setSortOrder(order); + if (getFilter()->isModified()) + { + mFolderRoot->setSortOrder(order); + // try to keep selection onscreen, even if it wasn't to start with + mFolderRoot->scrollToShowSelection(); + } +} + +U32 LLInventoryPanel::getSortOrder() const +{ + return mFolderRoot->getSortOrder(); +} + +void LLInventoryPanel::setSinceLogoff(BOOL sl) +{ + getFilter()->setDateRangeLastLogoff(sl); +} + +void LLInventoryPanel::setHoursAgo(U32 hours) +{ + getFilter()->setHoursAgo(hours); +} + +void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show) +{ + getFilter()->setShowFolderState(show); +} + +LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() +{ + return getFilter()->getShowFolderState(); +} + +void LLInventoryPanel::modelChanged(U32 mask) +{ + static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); + LLFastTimer t2(FTM_REFRESH); + + bool handled = false; + + //if (!mViewsInitialized) return; + + const LLInventoryModel* model = getModel(); + if (!model) return; + + const LLInventoryModel::changed_items_t& changed_items = model->getChangedIDs(); + if (changed_items.empty()) return; + + for (LLInventoryModel::changed_items_t::const_iterator items_iter = changed_items.begin(); + items_iter != changed_items.end(); + ++items_iter) + { + const LLUUID& item_id = (*items_iter); + const LLInventoryObject* model_item = model->getObject(item_id); + LLFolderViewItem* view_item = mFolderRoot->getItemByID(item_id); + + // LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item + // to folder is the fast way to get a folder without searching through folders tree. + //LLFolderViewFolder* view_folder = dynamic_cast(view_item); + + ////////////////////////////// + // LABEL Operation + // Empty out the display name for relabel. + if (mask & LLInventoryObserver::LABEL) + { + handled = true; + if (view_item) + { + // Request refresh on this item (also flags for filtering) + LLInvFVBridge* bridge = (LLInvFVBridge*)view_item->getListener(); + if(bridge) + { // Clear the display name first, so it gets properly re-built during refresh() + bridge->clearDisplayName(); + + view_item->refresh(); + } + } + } + + ////////////////////////////// + // REBUILD Operation + // Destroy and regenerate the UI. + /*if (mask & LLInventoryObserver::REBUILD) + { + handled = true; + if (model_item && view_item) + { + view_item->destroyView(); + } + view_item = buildNewViews(item_id); + view_folder = dynamic_cast(view_item); + }*/ + + ////////////////////////////// + // INTERNAL Operation + // This could be anything. For now, just refresh the item. + if (mask & LLInventoryObserver::INTERNAL) + { + if (view_item) + { + view_item->refresh(); + } + } + + ////////////////////////////// + // SORT Operation + // Sort the folder. + /*if (mask & LLInventoryObserver::SORT) + { + if (view_folder) + { + view_folder->requestSort(); + } + }*/ + + // We don't typically care which of these masks the item is actually flagged with, since the masks + // may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into + // Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks + // panel). What's relevant is that the item and UI are probably out of sync and thus need to be + // resynchronized. + if (mask & (LLInventoryObserver::STRUCTURE | + LLInventoryObserver::ADD | + LLInventoryObserver::REMOVE)) + { + handled = true; + + ////////////////////////////// + // ADD Operation + // Item exists in memory but a UI element hasn't been created for it. + if (model_item && !view_item) + { + // Add the UI element for this item. + buildNewViews(item_id); + // Select any newly created object that has the auto rename at top of folder root set. + if(mFolderRoot->getRoot()->needsAutoRename()) + { + setSelection(item_id, FALSE); + } + } + + ////////////////////////////// + // STRUCTURE Operation + // This item already exists in both memory and UI. It was probably reparented. + else if (model_item && view_item) + { + // Don't process the item if it is the root + if (view_item->getRoot() != view_item) + { + LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); + // Item has been moved. + if (view_item->getParentFolder() != new_parent) + { + if (new_parent != NULL) + { + // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. + view_item->getParentFolder()->extractItem(view_item); + view_item->addToFolder(new_parent, mFolderRoot); + } + else + { + // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that + // doesn't include trash). Just remove the item's UI. + view_item->destroyView(); + } + } + } + } + + ////////////////////////////// + // REMOVE Operation + // This item has been removed from memory, but its associated UI element still exists. + else if (!model_item && view_item) + { + // Remove the item's UI. + view_item->destroyView(); + } + } + } +} + +LLFolderView* LLInventoryPanel::getRootFolder() +{ + return mFolderRoot; +} +const LLUUID& LLInventoryPanel::getRootFolderID() const +{ + return mFolderRoot->getListener()->getUUID(); +} +void LLInventoryPanel::rebuildViewsFor(const LLUUID& id, U32 mask) +{ + // Destroy the old view for this ID so we can rebuild it. + LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); + if (old_view && id.notNull()) + { + old_view->destroyView(); + } + + buildNewViews(id); +} + +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + return new LLFolderViewFolder( + bridge->getDisplayName(), + bridge->getIcon(), + mFolderRoot, + bridge); +} + +LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) +{ + return new LLFolderViewItem( + bridge->getDisplayName(), + bridge->getIcon(), + bridge->getCreationDate(), + mFolderRoot, + bridge); +} + +void LLInventoryPanel::buildNewViews(const LLUUID& id) +{ + LLInventoryObject* const objectp = gInventory.getObject(id); + LLFolderViewItem* itemp = NULL; + + + if (objectp) + { + const LLUUID &parent_id = objectp->getParentUUID(); + LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; + } + else if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) // build new view for category + { + LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + objectp->getUUID()); + + if (new_listener) + { + LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); + if (folderp) + { + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + } + itemp = folderp; + } + } + else // build new view for item + { + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = LLInvFVBridge::createBridge( + item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + item->getUUID(), + item->getFlags()); + if (new_listener) + { + itemp = createFolderViewItem(new_listener); + } + } + + + + if (itemp) + { + if (parent_folder) + { + itemp->addToFolder(parent_folder, mFolderRoot); + } + else + { + llwarns << "Couldn't find parent folder for child " << itemp->getLabel() << llendl; + delete itemp; + } + } + } + + // If this is a folder, add the children of the folder and recursively add any + // child folders. + if (id.isNull() + || (objectp + && objectp->getType() == LLAssetType::AT_CATEGORY)) + { + LLViewerInventoryCategory::cat_array_t* categories; + LLViewerInventoryItem::item_array_t* items; + mInventory->lockDirectDescendentArrays(id, categories, items); + + if(categories) + { + for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin(); + cat_iter != categories->end(); + ++cat_iter) + { + const LLViewerInventoryCategory* cat = (*cat_iter); + buildNewViews(cat->getUUID()); + } + } + + if(items) + { + for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); + item_iter != items->end(); + ++item_iter) + { + const LLViewerInventoryItem* item = (*item_iter); + buildNewViews(item->getUUID()); + } + } + mInventory->unlockDirectDescendentArrays(id); + } +} + +struct LLConfirmPurgeData +{ + LLUUID mID; + LLInventoryModel* mModel; +}; + +class LLIsNotWorn : public LLInventoryCollectFunctor +{ +public: + LLIsNotWorn() {} + virtual ~LLIsNotWorn() {} + virtual bool operator()(LLInventoryCategory* cat, + LLInventoryItem* item) + { + return !gAgentWearables.isWearingItem(item->getUUID()); + } +}; + +class LLOpenFolderByID : public LLFolderViewFunctor +{ +public: + LLOpenFolderByID(const LLUUID& id) : mID(id) {} + virtual ~LLOpenFolderByID() {} + virtual void doFolder(LLFolderViewFolder* folder) + { + if (folder->getListener() && folder->getListener()->getUUID() == mID) folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); + } + virtual void doItem(LLFolderViewItem* item) {} +protected: + const LLUUID& mID; +}; + + +void LLInventoryPanel::openSelected() +{ + LLFolderViewItem* folder_item = mFolderRoot->getCurSelectedItem(); + if(!folder_item) return; + LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener(); + if(!bridge) return; + bridge->openItem(); +} + +void LLInventoryPanel::unSelectAll() +{ + mFolderRoot->setSelection(NULL, FALSE, FALSE); +} + + +BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLView::handleHover(x, y, mask); + if(handled) + { + ECursorType cursor = getWindow()->getCursor(); + if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && cursor == UI_CURSOR_ARROW) + { + // replace arrow cursor with arrow and hourglass cursor + getWindow()->setCursor(UI_CURSOR_WORKING); + } + } + else + { + getWindow()->setCursor(UI_CURSOR_ARROW); + } + return TRUE; +} + +BOOL LLInventoryPanel::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) + { + mFolderRoot->setDragAndDropThisFrame(); + } + + return handled; +} + + +void LLInventoryPanel::openAllFolders() +{ + mFolderRoot->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); + mFolderRoot->arrangeAll(); +} + +void LLInventoryPanel::closeAllFolders() +{ + mFolderRoot->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); + mFolderRoot->arrangeAll(); +} + +void LLInventoryPanel::openDefaultFolderForType(LLAssetType::EType type) +{ + LLUUID category_id = mInventory->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(type)); + LLOpenFolderByID opener(category_id); + mFolderRoot->applyFunctorRecursively(opener); +} + +void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus) +{ + LLFolderViewItem* itemp = mFolderRoot->getItemByID(obj_id); + if(itemp && itemp->getListener()) + { + itemp->getListener()->arrangeAndSet(itemp, TRUE, take_keyboard_focus); + mSelectThisID.setNull(); + return; + } + else + { + // save the desired item to be selected later (if/when ready) + mSelectThisID = obj_id; + } +} +void LLInventoryPanel::setSelectCallback(LLFolderView::SelectCallback callback, void* user_data) +{ + if (mFolderRoot) + { + mFolderRoot->setSelectCallback(callback, user_data); + } +} +void LLInventoryPanel::clearSelection() +{ + mFolderRoot->clearSelection(); + mSelectThisID.setNull(); +} + +void LLInventoryPanel::createNewItem(const std::string& name, + const LLUUID& parent_id, + LLAssetType::EType asset_type, + LLInventoryType::EType inv_type, + U32 next_owner_perm) +{ + std::string desc; + LLViewerAssetType::generateDescriptionFor(asset_type, desc); + next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER; + + + if (inv_type == LLInventoryType::IT_GESTURE) + { + LLPointer cb = new CreateGestureCallback(); + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, + NOT_WEARABLE, next_owner_perm, cb); + } + else + { + LLPointer cb = NULL; + create_inventory_item(gAgent.getID(), gAgent.getSessionID(), + parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, + NOT_WEARABLE, next_owner_perm, cb); + } + +} + +BOOL LLInventoryPanel::getSinceLogoff() +{ + return getFilter()->isSinceLogoff(); +} + +// DEBUG ONLY +// static +void LLInventoryPanel::dumpSelectionInformation(void* user_data) +{ + LLInventoryPanel* iv = (LLInventoryPanel*)user_data; + iv->mFolderRoot->dumpSelectionInformation(); +} diff --git a/indra/newview/llinventoryview.h b/indra/newview/llinventorypanel.h similarity index 56% rename from indra/newview/llinventoryview.h rename to indra/newview/llinventorypanel.h index acba7d7f1..3a26926e4 100644 --- a/indra/newview/llinventoryview.h +++ b/indra/newview/llinventorypanel.h @@ -31,8 +31,8 @@ * $/LicenseInfo$ */ -#ifndef LL_LLINVENTORYVIEW_H -#define LL_LLINVENTORYVIEW_H +#ifndef LL_LLINVENTORYPANEL_H +#define LL_LLINVENTORYPANEL_H #include "llassetstorage.h" #include "lldarray.h" @@ -178,159 +178,8 @@ protected: class LLInventoryView; -class LLInventoryViewFinder : public LLFloater -{ -public: - LLInventoryViewFinder(const std::string& name, - const LLRect& rect, - LLInventoryView* inventory_view); - virtual void draw(); - virtual void onClose(bool app_quitting); - void changeFilter(LLInventoryFilter* filter); - void updateElementsFromFilter(); - BOOL getCheckShowEmpty(); - BOOL getCheckSinceLogoff(); - - static void onTimeAgo(LLUICtrl*, void *); - static void onCheckSinceLogoff(LLUICtrl*, void *); - static void onCloseBtn(void* user_data); - static void selectAllTypes(void* user_data); - static void selectNoTypes(void* user_data); - -protected: - LLInventoryView* mInventoryView; - LLSpinCtrl* mSpinSinceDays; - LLSpinCtrl* mSpinSinceHours; - LLInventoryFilter* mFilter; -}; - -class LLInventoryView : public LLFloater, LLInventoryObserver -{ -friend class LLInventoryViewFinder; - -public: - LLInventoryView(const std::string& name, const std::string& rect, - LLInventoryModel* inventory); - LLInventoryView(const std::string& name, const LLRect& rect, - LLInventoryModel* inventory); - ~LLInventoryView(); - - /*virtual*/ void changed(U32 mask); - - BOOL postBuild(); - - // - // Misc functions - // - void setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); } - void startSearch(); - // This method makes sure that an inventory view exists, is - // visible, and has focus. The view chosen is returned. - static LLInventoryView* showAgentInventory(BOOL take_keyboard_focus = FALSE); - - // Return the active inventory view if there is one. Active is - // defined as the inventory that is the closest to the front, and - // is visible. - static LLInventoryView* getActiveInventory(); - - // This method calls showAgentInventory() if no views are visible, - // or hides/destroyes them all if any are visible. - static void toggleVisibility(); - static void toggleVisibility(void*) { toggleVisibility(); } - -// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) - static void closeAll() - { - // If there are mulitple inventory floaters open then clicking the "Inventory" button will close - // them one by one (see LLToolBar::onClickInventory() => toggleVisibility() ) until we get to the - // last one which will just be hidden instead of closed/destroyed (see LLInventoryView::onClose) - // - // However the view isn't removed from sActiveViews until its destructor is called and since - // 'LLMortician::sDestroyImmediate == FALSE' while the viewer is running the destructor won't be - // called right away - // - // Result: we can't call close() on the last (sActiveViews.count() will still be > 1) because - // onClose() would take the wrong branch and destroy() it as well - // - // Workaround: "fix" onClose() to count only views that aren't marked as "dead" - - LLInventoryView* pView; U8 flagsSound; - for (S32 idx = sActiveViews.count() - 1; idx >= 0; idx--) - { - pView = sActiveViews.get(idx); - flagsSound = pView->getSoundFlags(); - pView->setSoundFlags(LLView::SILENT); // Suppress the window close sound - pView->close(); // onClose() protects against closing the last inventory floater - pView->setSoundFlags(flagsSound); // One view won't be destroy()'ed so it needs its sound flags restored - } - } -// [/RLVa:KB] - - // Final cleanup, destroy all open inventory views. - static void cleanup(); - - // LLView & LLFloater functionality - virtual void onClose(bool app_quitting); - virtual void setVisible(BOOL visible); - virtual void draw(); - virtual BOOL handleKeyHere(KEY key, MASK mask); - - BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, - EDragAndDropType cargo_type, - void* cargo_data, - EAcceptance* accept, - std::string& tooltip_msg); - LLInventoryPanel* getPanel() { return mActivePanel; } - LLInventoryPanel* getActivePanel() { return mActivePanel; } - - static BOOL filtersVisible(void* user_data); - static void onClearSearch(void* user_data); - static void onFoldersByName(void *user_data); - static BOOL checkFoldersByName(void *user_data); - static void onSearchEdit(const std::string& search_string, void* user_data ); - - static void onQuickFilterCommit(LLUICtrl* ctrl, void* user_data); - static void refreshQuickFilter(LLUICtrl* ctrl); - - static void onFilterSelected(void* userdata, bool from_click); - static void onResetAll(void* userdata); - static void onExpandAll(void* userdata); - static void onCollapseAll(void* userdata); - static void onSelectionChange(const std::deque &items, BOOL user_action, void* data); - - const std::string getFilterSubString() { return mActivePanel->getFilterSubString(); } - void setFilterSubString(const std::string& string) { mActivePanel->setFilterSubString(string); } - - // HACK: Until we can route this info through the instant message hierarchy - static BOOL sWearNewClothing; - static LLUUID sWearNewClothingTransactionID; // wear all clothing in this transaction - - void toggleFindOptions(); - void updateSortControls(); - - LLInventoryViewFinder* getFinder() { return (LLInventoryViewFinder*)mFinderHandle.get(); } - -protected: - // internal initialization code - void init(LLInventoryModel* inventory); - -protected: - LLSearchEditor* mSearchEditor; - LLComboBox* mQuickFilterCombo; - LLTabContainer* mFilterTabs; - LLHandle mFinderHandle; - LLInventoryPanel* mActivePanel; - LLSaveFolderState* mSavedFolderState; - - std::string mFilterText; - - - // This container is used to hold all active inventory views. This - // is here to support the inventory toggle show button. - static LLDynamicArray sActiveViews; -}; ///---------------------------------------------------------------------------- /// Function declarations, constants, enums, and typedefs @@ -358,7 +207,7 @@ void open_texture(const LLUUID& item_id, const std::string& title, BOOL show_kee const BOOL TAKE_FOCUS_YES = TRUE; const BOOL TAKE_FOCUS_NO = FALSE; -#endif // LL_LLINVENTORYVIEW_H +#endif // LL_LLINVENTORYPANEL_H diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 87867ddfd..acc23f599 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -49,10 +49,11 @@ #include "llfirstuse.h" #include "llfloaterchat.h" #include "llfloaterdirectory.h" +#include "llfloaterinventory.h" #include "llfloatermap.h" #include "llfloaterworldmap.h" #include "llgivemoney.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llnotify.h" #include "llstatusbar.h" #include "llimview.h" diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index d2b3c76cc..590d6da0a 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -53,11 +53,11 @@ #include "llfloaterfriends.h" #include "llfloatergroupinfo.h" #include "llfloatergroups.h" +#include "llfloaterinventory.h" #include "llfloaterworldmap.h" #include "llfloatermute.h" #include "llfloateravatarinfo.h" #include "lliconctrl.h" -#include "llinventoryview.h" #include "lllineeditor.h" #include "llnameeditor.h" #include "llmutelist.h" diff --git a/indra/newview/llinventoryview.cpp b/indra/newview/llpanelmaininventory.cpp similarity index 60% rename from indra/newview/llinventoryview.cpp rename to indra/newview/llpanelmaininventory.cpp index a373a4697..161b3da28 100644 --- a/indra/newview/llinventoryview.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1,433 +1,87 @@ /** - * @file llinventoryview.cpp - * @brief Implementation of the inventory view and associated stuff. + * @file llpanelmaininventory.cpp + * @brief Implementation of llpanelmaininventory. * - * $LicenseInfo:firstyear=2001&license=viewergpl$ - * - * Copyright (c) 2001-2009, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * Copyright (C) 2010, Linden Research, Inc. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at - * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ #include "llviewerprecompiledheaders.h" - -#include // for std::pair<> - -#include "llinventoryview.h" -#include "llinventorybridge.h" -#include "llinventorydefines.h" - -#include "message.h" +#include "llpanelmaininventory.h" #include "llagent.h" #include "llagentcamera.h" -#include "llcallingcard.h" -#include "llcheckboxctrl.h" // for radio buttons -#include "llradiogroup.h" -#include "llspinctrl.h" -#include "lltextbox.h" -#include "llui.h" - -#include "llfirstuse.h" -#include "llfloateravatarinfo.h" -#include "llfloaterchat.h" -#include "llfloatercustomize.h" -#include "llfocusmgr.h" -#include "llfolderview.h" -#include "llgesturemgr.h" -#include "lliconctrl.h" +#include "lleconomy.h" +#include "llinventorybridge.h" #include "llinventoryfunctions.h" -#include "llinventoryclipboard.h" #include "llinventorymodelbackgroundfetch.h" -#include "lllineeditor.h" -#include "llmenugl.h" -#include "llpreviewanim.h" -#include "llpreviewgesture.h" -#include "llpreviewlandmark.h" -#include "llpreviewnotecard.h" -#include "llpreviewscript.h" -#include "llpreviewsound.h" +#include "llinventorypanel.h" #include "llpreviewtexture.h" #include "llresmgr.h" #include "llscrollcontainer.h" -#include "llscrollbar.h" -#include "llimview.h" -#include "lltooldraganddrop.h" -#include "llviewertexturelist.h" -#include "llviewerinventory.h" -#include "llviewerassettype.h" -#include "llviewerobjectlist.h" -#include "llviewerwindow.h" -#include "llwearablelist.h" -#include "llappviewer.h" -#include "llviewermessage.h" -#include "llviewerregion.h" -#include "lltabcontainer.h" -#include "lluictrlfactory.h" -#include "llselectmgr.h" - #include "llsdserialize.h" +#include "llspinctrl.h" +#include "lltooldraganddrop.h" +#include "llviewermenu.h" +#include "llviewertexturelist.h" +#include "llpanelinventory.h" +#include "llappviewer.h" -// [RLVa:KB] #include "rlvhandler.h" -// [/RLVa:KB] -static LLRegisterWidget r("inventory_panel"); +const std::string FILTERS_FILENAME("filters.xml"); LLDynamicArray LLInventoryView::sActiveViews; - -//BOOL LLInventoryView::sOpenNextNewItem = FALSE; -BOOL LLInventoryView::sWearNewClothing = FALSE; -LLUUID LLInventoryView::sWearNewClothingTransactionID; - -///---------------------------------------------------------------------------- -/// Local function declarations, constants, enums, and typedefs -///---------------------------------------------------------------------------- - const S32 INV_MIN_WIDTH = 240; const S32 INV_MIN_HEIGHT = 150; const S32 INV_FINDER_WIDTH = 160; const S32 INV_FINDER_HEIGHT = 408; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLInventoryPanelObserver -// -// Bridge to support knowing when the inventory has changed. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLInventoryPanelObserver : public LLInventoryObserver +//BOOL LLInventoryView::sOpenNextNewItem = FALSE; +class LLInventoryViewFinder : public LLFloater { public: - LLInventoryPanelObserver(LLInventoryPanel* ip) : mIP(ip) {} - virtual ~LLInventoryPanelObserver() {} - virtual void changed(U32 mask) - { - mIP->modelChanged(mask); - } -protected: - LLInventoryPanel* mIP; -}; - -///---------------------------------------------------------------------------- -/// LLInventoryViewFinder -///---------------------------------------------------------------------------- - -LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, + LLInventoryViewFinder(const std::string& name, const LLRect& rect, - LLInventoryView* inventory_view) : - LLFloater(name, rect, std::string("Filters"), RESIZE_NO, - INV_FINDER_WIDTH, INV_FINDER_HEIGHT, DRAG_ON_TOP, - MINIMIZE_NO, CLOSE_YES), - mInventoryView(inventory_view), - mFilter(inventory_view->mActivePanel->getFilter()) -{ + LLInventoryView* inventory_view); + virtual void draw(); + /*virtual*/ BOOL postBuild(); + virtual void onClose(bool app_quitting); + void changeFilter(LLInventoryFilter* filter); + void updateElementsFromFilter(); + BOOL getCheckShowEmpty(); + BOOL getCheckSinceLogoff(); - LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); + static void onTimeAgo(LLUICtrl*, void *); + static void onCheckSinceLogoff(LLUICtrl*, void *); + static void onCloseBtn(void* user_data); + static void selectAllTypes(void* user_data); + static void selectNoTypes(void* user_data); - childSetAction("All", selectAllTypes, this); - childSetAction("None", selectNoTypes, this); - - mSpinSinceHours = getChild("spin_hours_ago"); - childSetCommitCallback("spin_hours_ago", onTimeAgo, this); - - mSpinSinceDays = getChild("spin_days_ago"); - childSetCommitCallback("spin_days_ago", onTimeAgo, this); - -// mCheckSinceLogoff = getChild("check_since_logoff"); - childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); - - childSetAction("Close", onCloseBtn, this); - - updateElementsFromFilter(); -} - - -void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) -{ - LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; - if (!self) return; - - bool since_logoff= self->childGetValue("check_since_logoff"); - - if (!since_logoff && - !( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) ) - { - self->mSpinSinceHours->set(1.0f); - } -} - -void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) -{ - LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; - if (!self) return; - - bool since_logoff=true; - if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) - { - since_logoff = false; - } - self->childSetValue("check_since_logoff", since_logoff); -} - -void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) -{ - mFilter = filter; - updateElementsFromFilter(); -} - -void LLInventoryViewFinder::updateElementsFromFilter() -{ - if (!mFilter) - return; - - // Get data needed for filter display - U32 filter_types = mFilter->getFilterTypes(); - std::string filter_string = mFilter->getFilterSubString(); - LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); - U32 hours = mFilter->getHoursAgo(); - - // update the ui elements - LLFloater::setTitle(mFilter->getName()); - childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); - - childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); - childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); - childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); - childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); - childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); - childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); - childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); - childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); - childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); - childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); - childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); - childSetValue("check_since_logoff", mFilter->isSinceLogoff()); - mSpinSinceHours->set((F32)(hours % 24)); - mSpinSinceDays->set((F32)(hours / 24)); -} - -void LLInventoryViewFinder::draw() -{ - U32 filter = 0xffffffff; - BOOL filtered_by_all_types = TRUE; - - if (!childGetValue("check_animation")) - { - filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); - filtered_by_all_types = FALSE; - } - - - if (!childGetValue("check_calling_card")) - { - filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_clothing")) - { - filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_gesture")) - { - filter &= ~(0x1 << LLInventoryType::IT_GESTURE); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_landmark")) - - - { - filter &= ~(0x1 << LLInventoryType::IT_LANDMARK); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_notecard")) - { - filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_object")) - { - filter &= ~(0x1 << LLInventoryType::IT_OBJECT); - filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_script")) - { - filter &= ~(0x1 << LLInventoryType::IT_LSL); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_sound")) - { - filter &= ~(0x1 << LLInventoryType::IT_SOUND); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_texture")) - { - filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); - filtered_by_all_types = FALSE; - } - - if (!childGetValue("check_snapshot")) - { - filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); - filtered_by_all_types = FALSE; - } - - if (!filtered_by_all_types) - { - // don't include folders in filter, unless I've selected everything - filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); - } - - // update the panel, panel will update the filter - mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? - LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryView->mActivePanel->setFilterTypes(filter); - if (getCheckSinceLogoff()) - { - mSpinSinceDays->set(0); - mSpinSinceHours->set(0); - } - U32 days = (U32)mSpinSinceDays->get(); - U32 hours = (U32)mSpinSinceHours->get(); - if (hours > 24) - { - days += hours / 24; - hours = (U32)hours % 24; - mSpinSinceDays->set((F32)days); - mSpinSinceHours->set((F32)hours); - } - hours += days * 24; - mInventoryView->mActivePanel->setHoursAgo(hours); - mInventoryView->mActivePanel->setSinceLogoff(getCheckSinceLogoff()); - mInventoryView->setFilterTextFromFilter(); - - LLFloater::draw(); -} - -void LLInventoryViewFinder::onClose(bool app_quitting) -{ - if (mInventoryView) mInventoryView->getControl("Inventory.ShowFilters")->setValue(FALSE); - // If you want to reset the filter on close, do it here. This functionality was - // hotly debated - Paulm -#if 0 - if (mInventoryView) - { - LLInventoryView::onResetFilter((void *)mInventoryView); - } -#endif - destroy(); -} - - -BOOL LLInventoryViewFinder::getCheckShowEmpty() -{ - return childGetValue("check_show_empty"); -} - -BOOL LLInventoryViewFinder::getCheckSinceLogoff() -{ - return childGetValue("check_since_logoff"); -} - -void LLInventoryViewFinder::onCloseBtn(void* user_data) -{ - LLInventoryViewFinder* finderp = (LLInventoryViewFinder*)user_data; - finderp->close(); -} - -// static -void LLInventoryViewFinder::selectAllTypes(void* user_data) -{ - LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; - if(!self) return; - - self->childSetValue("check_animation", TRUE); - self->childSetValue("check_calling_card", TRUE); - self->childSetValue("check_clothing", TRUE); - self->childSetValue("check_gesture", TRUE); - self->childSetValue("check_landmark", TRUE); - self->childSetValue("check_notecard", TRUE); - self->childSetValue("check_object", TRUE); - self->childSetValue("check_script", TRUE); - self->childSetValue("check_sound", TRUE); - self->childSetValue("check_texture", TRUE); - self->childSetValue("check_snapshot", TRUE); - -/* - self->mCheckCallingCard->set(TRUE); - self->mCheckClothing->set(TRUE); - self->mCheckGesture->set(TRUE); - self->mCheckLandmark->set(TRUE); - self->mCheckNotecard->set(TRUE); - self->mCheckObject->set(TRUE); - self->mCheckScript->set(TRUE); - self->mCheckSound->set(TRUE); - self->mCheckTexture->set(TRUE); - self->mCheckSnapshot->set(TRUE);*/ -} - -//static -void LLInventoryViewFinder::selectNoTypes(void* user_data) -{ - LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; - if(!self) return; - - /* - self->childSetValue("check_animation", FALSE); - self->mCheckCallingCard->set(FALSE); - self->mCheckClothing->set(FALSE); - self->mCheckGesture->set(FALSE); - self->mCheckLandmark->set(FALSE); - self->mCheckNotecard->set(FALSE); - self->mCheckObject->set(FALSE); - self->mCheckScript->set(FALSE); - self->mCheckSound->set(FALSE); - self->mCheckTexture->set(FALSE); - self->mCheckSnapshot->set(FALSE);*/ - - - self->childSetValue("check_animation", FALSE); - self->childSetValue("check_calling_card", FALSE); - self->childSetValue("check_clothing", FALSE); - self->childSetValue("check_gesture", FALSE); - self->childSetValue("check_landmark", FALSE); - self->childSetValue("check_notecard", FALSE); - self->childSetValue("check_object", FALSE); - self->childSetValue("check_script", FALSE); - self->childSetValue("check_sound", FALSE); - self->childSetValue("check_texture", FALSE); - self->childSetValue("check_snapshot", FALSE); -} +protected: + LLInventoryView* mInventoryView; + LLSpinCtrl* mSpinSinceDays; + LLSpinCtrl* mSpinSinceHours; + LLInventoryFilter* mFilter; +}; ///---------------------------------------------------------------------------- @@ -481,7 +135,12 @@ void LLInventoryView::init(LLInventoryModel* inventory) mSavedFolderState->setApply(FALSE); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory.xml", NULL); +} +BOOL LLInventoryView::postBuild() +{ + gInventory.addObserver(this); + mFilterTabs = (LLTabContainer*)getChild("inventory filter tabs"); // Set up the default inv. panel/filter settings. @@ -515,8 +174,8 @@ void LLInventoryView::init(LLInventoryModel* inventory) // Now load the stored settings from disk, if available. std::ostringstream filterSaveName; - filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "filters.xml"); - llinfos << "LLInventoryView::init: reading from " << filterSaveName << llendl; + filterSaveName << gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, FILTERS_FILENAME); + llinfos << "LLInventoryView::init: reading from " << filterSaveName.str() << llendl; llifstream file(filterSaveName.str()); LLSD savedFilterState; if (file.is_open()) @@ -554,11 +213,6 @@ void LLInventoryView::init(LLInventoryModel* inventory) sActiveViews.put(this); - gInventory.addObserver(this); -} - -BOOL LLInventoryView::postBuild() -{ childSetTabChangeCallback("inventory filter tabs", "All Items", onFilterSelected, this); childSetTabChangeCallback("inventory filter tabs", "Recent Items", onFilterSelected, this); childSetTabChangeCallback("inventory filter tabs", "Worn Items", onFilterSelected, this); @@ -580,27 +234,36 @@ LLInventoryView::~LLInventoryView( void ) if (all_items_panel) { LLInventoryFilter* filter = all_items_panel->getFilter(); - LLSD filterState; - filter->toLLSD(filterState); - filterRoot[filter->getName()] = filterState; + if (filter) + { + LLSD filterState; + filter->toLLSD(filterState); + filterRoot[filter->getName()] = filterState; + } } LLInventoryPanel* recent_items_panel = getChild("Recent Items"); if (recent_items_panel) { LLInventoryFilter* filter = recent_items_panel->getFilter(); - LLSD filterState; - filter->toLLSD(filterState); - filterRoot[filter->getName()] = filterState; + if (filter) + { + LLSD filterState; + filter->toLLSD(filterState); + filterRoot[filter->getName()] = filterState; + } } LLInventoryPanel* worn_items_panel = getChild("Worn Items"); if (worn_items_panel) { LLInventoryFilter* filter = worn_items_panel->getFilter(); - LLSD filterState; - filter->toLLSD(filterState); - filterRoot[filter->getName()] = filterState; + if (filter) + { + LLSD filterState; + filter->toLLSD(filterState); + filterRoot[filter->getName()] = filterState; + } } std::ostringstream filterSaveName; @@ -618,32 +281,6 @@ LLInventoryView::~LLInventoryView( void ) delete mSavedFolderState; } -void LLInventoryView::draw() -{ - if (LLInventoryModelBackgroundFetch::instance().isEverythingFetched()) - { - LLLocale locale(LLLocale::USER_LOCALE); - std::ostringstream title; - title << "Inventory"; - std::string item_count_string; - LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - title << " (" << item_count_string << " items)"; - title << mFilterText; - setTitle(title.str()); - } - if (mActivePanel && mSearchEditor) - { - mSearchEditor->setText(mActivePanel->getFilterSubString()); - } - - if (mActivePanel && mQuickFilterCombo) - { - refreshQuickFilter( mQuickFilterCombo ); - } - - LLFloater::draw(); -} - void LLInventoryView::startSearch() { // this forces focus to line editor portion of search editor @@ -726,21 +363,7 @@ BOOL LLInventoryView::handleKeyHere(KEY key, MASK mask) } -void LLInventoryView::changed(U32 mask) -{ - std::ostringstream title; - title << "Inventory"; - if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive()) - { - LLLocale locale(LLLocale::USER_LOCALE); - std::string item_count_string; - LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); - title << " (Fetched " << item_count_string << " items...)"; - } - title << mFilterText; - setTitle(title.str()); -} // static // *TODO: remove take_keyboard_focus param @@ -858,30 +481,6 @@ void LLInventoryView::cleanup() } } -void LLInventoryView::toggleFindOptions() -{ - LLFloater *floater = getFinder(); - if (!floater) - { - LLInventoryViewFinder * finder = new LLInventoryViewFinder(std::string("Inventory Finder"), - LLRect(getRect().mLeft - INV_FINDER_WIDTH, getRect().mTop, getRect().mLeft, getRect().mTop - INV_FINDER_HEIGHT), - this); - mFinderHandle = finder->getHandle(); - finder->open(); /*Flawfinder: ignore*/ - addDependentFloater(mFinderHandle); - - // start background fetch of folders - LLInventoryModelBackgroundFetch::instance().start(); - - mFloaterControls[std::string("Inventory.ShowFilters")]->setValue(TRUE); - } - else - { - floater->close(); - - mFloaterControls[std::string("Inventory.ShowFilters")]->setValue(FALSE); - } -} void LLInventoryView::updateSortControls() { @@ -896,6 +495,18 @@ void LLInventoryView::updateSortControls() getControl("Inventory.SystemFoldersToTop")->setValue(sys_folders_on_top); } +void LLInventoryView::resetFilters() +{ + LLInventoryViewFinder *finder = getFinder(); + getActivePanel()->getFilter()->resetDefault(); + if (finder) + { + finder->updateElementsFromFilter(); + } + + setFilterTextFromFilter(); +} + // static BOOL LLInventoryView::filtersVisible(void* user_data) { @@ -1323,6 +934,17 @@ void LLInventoryView::onSelectionChange(const std::deque &ite } } +const std::string LLInventoryView::getFilterSubString() +{ + return mActivePanel->getFilterSubString(); +} + +void LLInventoryView::setFilterSubString(const std::string& string) +{ + mActivePanel->setFilterSubString(string); +} + + BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, @@ -1345,685 +967,383 @@ BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, return handled; } -const std::string LLInventoryPanel::DEFAULT_SORT_ORDER = std::string("InventorySortOrder"); -const std::string LLInventoryPanel::RECENTITEMS_SORT_ORDER = std::string("RecentItemsSortOrder"); -const std::string LLInventoryPanel::WORNITEMS_SORT_ORDER = std::string("WornItemsSortOrder"); -const std::string LLInventoryPanel::INHERIT_SORT_ORDER = std::string(""); - -LLInventoryPanel::LLInventoryPanel(const std::string& name, - const std::string& sort_order_setting, - const LLRect& rect, - LLInventoryModel* inventory, - BOOL allow_multi_select, - LLView *parent_view) : - LLPanel(name, rect, TRUE), - mInventory(inventory), - mInventoryObserver(NULL), - mFolderRoot(NULL), - mScroller(NULL), - mAllowMultiSelect(allow_multi_select), - mSortOrderSetting(sort_order_setting) +void LLInventoryView::changed(U32 mask) { - setBackgroundColor(gColors.getColor("InventoryBackgroundColor")); - setBackgroundVisible(TRUE); - setBackgroundOpaque(TRUE); + std::ostringstream title; + title << "Inventory"; + if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive()) + { + LLLocale locale(LLLocale::USER_LOCALE); + std::string item_count_string; + LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); + title << " (Fetched " << item_count_string << " items...)"; + } + title << mFilterText; + setTitle(title.str()); + } -BOOL LLInventoryPanel::postBuild() +void LLInventoryView::draw() { - init_inventory_panel_actions(this); - - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - mFolderRoot = new LLFolderView(getName(), NULL, folder_rect, LLUUID::null, this); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); - - // scroller - LLRect scroller_view_rect = getRect(); - scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - mScroller = new LLScrollableContainerView(std::string("Inventory Scroller"), - scroller_view_rect, - mFolderRoot); - mScroller->setFollowsAll(); - mScroller->setReserveScrollCorner(TRUE); - addChild(mScroller); - mFolderRoot->setScrollContainer(mScroller); - - // set up the callbacks from the inventory we're viewing, and then - // build everything. - mInventoryObserver = new LLInventoryPanelObserver(this); - mInventory->addObserver(mInventoryObserver); - rebuildViewsFor(LLUUID::null, LLInventoryObserver::ADD); - - // bit of a hack to make sure the inventory is open. - mFolderRoot->openFolder(std::string("My Inventory")); - - if (mSortOrderSetting != INHERIT_SORT_ORDER) + if (LLInventoryModelBackgroundFetch::instance().isEverythingFetched()) { - setSortOrder(gSavedSettings.getU32(mSortOrderSetting)); + LLLocale locale(LLLocale::USER_LOCALE); + std::ostringstream title; + title << "Inventory"; + std::string item_count_string; + LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); + title << " (" << item_count_string << " items)"; + title << mFilterText; + setTitle(title.str()); + } + if (mActivePanel && mSearchEditor) + { + mSearchEditor->setText(mActivePanel->getFilterSubString()); + } + + if (mActivePanel && mQuickFilterCombo) + { + refreshQuickFilter( mQuickFilterCombo ); + } + + LLFloater::draw(); +} + +void LLInventoryView::setFilterTextFromFilter() +{ + mFilterText = mActivePanel->getFilter()->getFilterText(); +} + +void LLInventoryView::toggleFindOptions() +{ + LLFloater *floater = getFinder(); + if (!floater) + { + LLInventoryViewFinder * finder = new LLInventoryViewFinder(std::string("Inventory Finder"), + LLRect(getRect().mLeft - INV_FINDER_WIDTH, getRect().mTop, getRect().mLeft, getRect().mTop - INV_FINDER_HEIGHT), + this); + mFinderHandle = finder->getHandle(); + finder->open(); /*Flawfinder: ignore*/ + addDependentFloater(mFinderHandle); + + // start background fetch of folders + LLInventoryModelBackgroundFetch::instance().start(); + + mFloaterControls[std::string("Inventory.ShowFilters")]->setValue(TRUE); } else { - setSortOrder(gSavedSettings.getU32(DEFAULT_SORT_ORDER)); + floater->close(); + + mFloaterControls[std::string("Inventory.ShowFilters")]->setValue(FALSE); } - mFolderRoot->setSortOrder(mFolderRoot->getFilter()->getSortOrder()); +} +///---------------------------------------------------------------------------- +/// LLInventoryViewFinder +///---------------------------------------------------------------------------- +LLInventoryViewFinder* LLInventoryView::getFinder() +{ + return (LLInventoryViewFinder*)mFinderHandle.get(); +} +LLInventoryViewFinder::LLInventoryViewFinder(const std::string& name, + const LLRect& rect, + LLInventoryView* inventory_view) : + LLFloater(name, rect, std::string("Filters"), RESIZE_NO, + INV_FINDER_WIDTH, INV_FINDER_HEIGHT, DRAG_ON_TOP, + MINIMIZE_NO, CLOSE_YES), + mInventoryView(inventory_view), + mFilter(inventory_view->mActivePanel->getFilter()) +{ + + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_inventory_view_finder.xml"); + updateElementsFromFilter(); +} + +BOOL LLInventoryViewFinder::postBuild() +{ + childSetAction("All", selectAllTypes, this); + childSetAction("None", selectNoTypes, this); + + mSpinSinceHours = getChild("spin_hours_ago"); + childSetCommitCallback("spin_hours_ago", onTimeAgo, this); + + mSpinSinceDays = getChild("spin_days_ago"); + childSetCommitCallback("spin_days_ago", onTimeAgo, this); + +// mCheckSinceLogoff = getChild("check_since_logoff"); + childSetCommitCallback("check_since_logoff", onCheckSinceLogoff, this); + + childSetAction("Close", onCloseBtn, this); + + updateElementsFromFilter(); return TRUE; } -LLInventoryPanel::~LLInventoryPanel() + +void LLInventoryViewFinder::onCheckSinceLogoff(LLUICtrl *ctrl, void *user_data) { - if (mFolderRoot) - { - U32 sort_order = mFolderRoot->getSortOrder(); - if (mSortOrderSetting != INHERIT_SORT_ORDER) - { - gSavedSettings.setU32(mSortOrderSetting, sort_order); - } - } + LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; + if (!self) return; - // LLView destructor will take care of the sub-views. - mInventory->removeObserver(mInventoryObserver); - delete mInventoryObserver; - mScroller = NULL; -} - -// virtual -LLXMLNodePtr LLInventoryPanel::getXML(bool save_children) const -{ - LLXMLNodePtr node = LLPanel::getXML(false); // Do not print out children - - node->setName(LL_INVENTORY_PANEL_TAG); - - node->createChild("allow_multi_select", TRUE)->setBoolValue(mFolderRoot->getAllowMultiSelect()); - - return node; -} - -LLView* LLInventoryPanel::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFactory *factory) -{ - LLInventoryPanel* panel; - - std::string name("inventory_panel"); - node->getAttributeString("name", name); - - BOOL allow_multi_select = TRUE; - node->getAttributeBOOL("allow_multi_select", allow_multi_select); - - LLRect rect; - createRect(node, rect, parent, LLRect()); - - std::string sort_order(INHERIT_SORT_ORDER); - node->getAttributeString("sort_order", sort_order); - - panel = new LLInventoryPanel(name, sort_order, - rect, &gInventory, - allow_multi_select, parent); - - panel->initFromXML(node, parent); - - panel->postBuild(); - - return panel; -} - -void LLInventoryPanel::draw() -{ - // select the desired item (in case it wasn't loaded when the selection was requested) - if (mSelectThisID.notNull()) - { - setSelection(mSelectThisID, false); - } - LLPanel::draw(); -} - -LLInventoryFilter* LLInventoryPanel::getFilter() -{ - if (mFolderRoot) - { - return mFolderRoot->getFilter(); - } - return NULL; -} - -const LLInventoryFilter* LLInventoryPanel::getFilter() const -{ - if (mFolderRoot) - { - return mFolderRoot->getFilter(); - } - return NULL; -} - -void LLInventoryPanel::setFilterTypes(U32 filter_types) -{ - getFilter()->setFilterTypes(filter_types); -} - -U32 LLInventoryPanel::getFilterTypes() const -{ - return mFolderRoot->getFilterTypes(); -} - -U32 LLInventoryPanel::getFilterPermMask() const -{ - return mFolderRoot->getFilterPermissions(); -} - -void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) -{ - getFilter()->setFilterPermissions(filter_perm_mask); -} - -void LLInventoryPanel::setFilterWorn(bool worn) -{ - getFilter()->setFilterWorn(worn); -} - -void LLInventoryPanel::setFilterSubString(const std::string& string) -{ - getFilter()->setFilterSubString(string); -} - -const std::string LLInventoryPanel::getFilterSubString() -{ - return mFolderRoot->getFilterSubString(); -} - -void LLInventoryPanel::setSortOrder(U32 order) -{ - getFilter()->setSortOrder(order); - if (getFilter()->isModified()) - { - mFolderRoot->setSortOrder(order); - // try to keep selection onscreen, even if it wasn't to start with - mFolderRoot->scrollToShowSelection(); - } -} - -U32 LLInventoryPanel::getSortOrder() const -{ - return mFolderRoot->getSortOrder(); -} - -void LLInventoryPanel::setSinceLogoff(BOOL sl) -{ - getFilter()->setDateRangeLastLogoff(sl); -} - -void LLInventoryPanel::setHoursAgo(U32 hours) -{ - getFilter()->setHoursAgo(hours); -} - -void LLInventoryPanel::setShowFolderState(LLInventoryFilter::EFolderShow show) -{ - getFilter()->setShowFolderState(show); -} - -LLInventoryFilter::EFolderShow LLInventoryPanel::getShowFolderState() -{ - return getFilter()->getShowFolderState(); -} - -void LLInventoryPanel::modelChanged(U32 mask) -{ - static LLFastTimer::DeclareTimer FTM_REFRESH("Inventory Refresh"); - LLFastTimer t2(FTM_REFRESH); - - bool handled = false; - - //if (!mViewsInitialized) return; - - const LLInventoryModel* model = getModel(); - if (!model) return; - - const LLInventoryModel::changed_items_t& changed_items = model->getChangedIDs(); - if (changed_items.empty()) return; - - for (LLInventoryModel::changed_items_t::const_iterator items_iter = changed_items.begin(); - items_iter != changed_items.end(); - ++items_iter) - { - const LLUUID& item_id = (*items_iter); - const LLInventoryObject* model_item = model->getObject(item_id); - LLFolderViewItem* view_item = mFolderRoot->getItemByID(item_id); - - // LLFolderViewFolder is derived from LLFolderViewItem so dynamic_cast from item - // to folder is the fast way to get a folder without searching through folders tree. - //LLFolderViewFolder* view_folder = dynamic_cast(view_item); - - ////////////////////////////// - // LABEL Operation - // Empty out the display name for relabel. - if (mask & LLInventoryObserver::LABEL) - { - handled = true; - if (view_item) - { - // Request refresh on this item (also flags for filtering) - LLInvFVBridge* bridge = (LLInvFVBridge*)view_item->getListener(); - if(bridge) - { // Clear the display name first, so it gets properly re-built during refresh() - bridge->clearDisplayName(); - - view_item->refresh(); - } - } - } - - ////////////////////////////// - // REBUILD Operation - // Destroy and regenerate the UI. - /*if (mask & LLInventoryObserver::REBUILD) - { - handled = true; - if (model_item && view_item) - { - view_item->destroyView(); - } - view_item = buildNewViews(item_id); - view_folder = dynamic_cast(view_item); - }*/ - - ////////////////////////////// - // INTERNAL Operation - // This could be anything. For now, just refresh the item. - if (mask & LLInventoryObserver::INTERNAL) - { - if (view_item) - { - view_item->refresh(); - } - } - - ////////////////////////////// - // SORT Operation - // Sort the folder. - /*if (mask & LLInventoryObserver::SORT) - { - if (view_folder) - { - view_folder->requestSort(); - } - }*/ - - // We don't typically care which of these masks the item is actually flagged with, since the masks - // may not be accurate (e.g. in the main inventory panel, I move an item from My Inventory into - // Landmarks; this is a STRUCTURE change for that panel but is an ADD change for the Landmarks - // panel). What's relevant is that the item and UI are probably out of sync and thus need to be - // resynchronized. - if (mask & (LLInventoryObserver::STRUCTURE | - LLInventoryObserver::ADD | - LLInventoryObserver::REMOVE)) - { - handled = true; - - ////////////////////////////// - // ADD Operation - // Item exists in memory but a UI element hasn't been created for it. - if (model_item && !view_item) - { - // Add the UI element for this item. - buildNewViews(item_id); - // Select any newly created object that has the auto rename at top of folder root set. - if(mFolderRoot->getRoot()->needsAutoRename()) - { - setSelection(item_id, FALSE); - } - } - - ////////////////////////////// - // STRUCTURE Operation - // This item already exists in both memory and UI. It was probably reparented. - else if (model_item && view_item) - { - // Don't process the item if it is the root - if (view_item->getRoot() != view_item) - { - LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); - // Item has been moved. - if (view_item->getParentFolder() != new_parent) - { - if (new_parent != NULL) - { - // Item is to be moved and we found its new parent in the panel's directory, so move the item's UI. - view_item->getParentFolder()->extractItem(view_item); - view_item->addToFolder(new_parent, mFolderRoot); - } - else - { - // Item is to be moved outside the panel's directory (e.g. moved to trash for a panel that - // doesn't include trash). Just remove the item's UI. - view_item->destroyView(); - } - } - } - } - - ////////////////////////////// - // REMOVE Operation - // This item has been removed from memory, but its associated UI element still exists. - else if (!model_item && view_item) - { - // Remove the item's UI. - view_item->destroyView(); - } - } - } -} - -LLFolderView* LLInventoryPanel::getRootFolder() -{ - return mFolderRoot; -} -const LLUUID& LLInventoryPanel::getRootFolderID() const -{ - return mFolderRoot->getListener()->getUUID(); -} -void LLInventoryPanel::rebuildViewsFor(const LLUUID& id, U32 mask) -{ - // Destroy the old view for this ID so we can rebuild it. - LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && id.notNull()) - { - old_view->destroyView(); - } - - buildNewViews(id); -} - -LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) -{ - return new LLFolderViewFolder( - bridge->getDisplayName(), - bridge->getIcon(), - mFolderRoot, - bridge); -} - -LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) -{ - return new LLFolderViewItem( - bridge->getDisplayName(), - bridge->getIcon(), - bridge->getCreationDate(), - mFolderRoot, - bridge); -} - -void LLInventoryPanel::buildNewViews(const LLUUID& id) -{ - LLInventoryObject* const objectp = gInventory.getObject(id); - LLFolderViewItem* itemp = NULL; + bool since_logoff= self->childGetValue("check_since_logoff"); - - if (objectp) - { - const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << llendl; - } - else if ((objectp->getType() == LLAssetType::AT_CATEGORY) && - (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) // build new view for category - { - LLInvFVBridge* new_listener = LLInvFVBridge::createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - objectp->getUUID()); - - if (new_listener) - { - LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); - itemp = folderp; - } - } - else // build new view for item - { - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = LLInvFVBridge::createBridge( - item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - item->getUUID(), - item->getFlags()); - if (new_listener) - { - itemp = createFolderViewItem(new_listener); - } - } - - - - if (itemp) - { - if (parent_folder) - { - itemp->addToFolder(parent_folder, mFolderRoot); - } - else - { - llwarns << "Couldn't find parent folder for child " << itemp->getLabel() << llendl; - delete itemp; - } - } - } - - // If this is a folder, add the children of the folder and recursively add any - // child folders. - if (id.isNull() - || (objectp - && objectp->getType() == LLAssetType::AT_CATEGORY)) + if (!since_logoff && + !( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) ) { - LLViewerInventoryCategory::cat_array_t* categories; - LLViewerInventoryItem::item_array_t* items; - mInventory->lockDirectDescendentArrays(id, categories, items); - - if(categories) - { - for (LLViewerInventoryCategory::cat_array_t::const_iterator cat_iter = categories->begin(); - cat_iter != categories->end(); - ++cat_iter) - { - const LLViewerInventoryCategory* cat = (*cat_iter); - buildNewViews(cat->getUUID()); - } - } - - if(items) - { - for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); - item_iter != items->end(); - ++item_iter) - { - const LLViewerInventoryItem* item = (*item_iter); - buildNewViews(item->getUUID()); - } - } - mInventory->unlockDirectDescendentArrays(id); - } + self->mSpinSinceHours->set(1.0f); + } } -struct LLConfirmPurgeData +void LLInventoryViewFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) { - LLUUID mID; - LLInventoryModel* mModel; -}; - -class LLIsNotWorn : public LLInventoryCollectFunctor -{ -public: - LLIsNotWorn() {} - virtual ~LLIsNotWorn() {} - virtual bool operator()(LLInventoryCategory* cat, - LLInventoryItem* item) + LLInventoryViewFinder *self = (LLInventoryViewFinder *)user_data; + if (!self) return; + + bool since_logoff=true; + if ( self->mSpinSinceDays->get() || self->mSpinSinceHours->get() ) { - return !gAgentWearables.isWearingItem(item->getUUID()); + since_logoff = false; } -}; - -class LLOpenFolderByID : public LLFolderViewFunctor -{ -public: - LLOpenFolderByID(const LLUUID& id) : mID(id) {} - virtual ~LLOpenFolderByID() {} - virtual void doFolder(LLFolderViewFolder* folder) - { - if (folder->getListener() && folder->getListener()->getUUID() == mID) folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_UP); - } - virtual void doItem(LLFolderViewItem* item) {} -protected: - const LLUUID& mID; -}; - - -void LLInventoryPanel::openSelected() -{ - LLFolderViewItem* folder_item = mFolderRoot->getCurSelectedItem(); - if(!folder_item) return; - LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getListener(); - if(!bridge) return; - bridge->openItem(); + self->childSetValue("check_since_logoff", since_logoff); } -void LLInventoryPanel::unSelectAll() -{ - mFolderRoot->setSelection(NULL, FALSE, FALSE); +void LLInventoryViewFinder::changeFilter(LLInventoryFilter* filter) +{ + mFilter = filter; + updateElementsFromFilter(); } - -BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) +void LLInventoryViewFinder::updateElementsFromFilter() { - BOOL handled = LLView::handleHover(x, y, mask); - if(handled) - { - ECursorType cursor = getWindow()->getCursor(); - if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && cursor == UI_CURSOR_ARROW) - { - // replace arrow cursor with arrow and hourglass cursor - getWindow()->setCursor(UI_CURSOR_WORKING); - } - } - else - { - getWindow()->setCursor(UI_CURSOR_ARROW); - } - return TRUE; -} - -BOOL LLInventoryPanel::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) - { - mFolderRoot->setDragAndDropThisFrame(); - } - - return handled; -} - - -void LLInventoryPanel::openAllFolders() -{ - mFolderRoot->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); - mFolderRoot->arrangeAll(); -} - -void LLInventoryPanel::closeAllFolders() -{ - mFolderRoot->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); - mFolderRoot->arrangeAll(); -} - -void LLInventoryPanel::openDefaultFolderForType(LLAssetType::EType type) -{ - LLUUID category_id = mInventory->findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(type)); - LLOpenFolderByID opener(category_id); - mFolderRoot->applyFunctorRecursively(opener); -} - -void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus) -{ - LLFolderViewItem* itemp = mFolderRoot->getItemByID(obj_id); - if(itemp && itemp->getListener()) - { - itemp->getListener()->arrangeAndSet(itemp, TRUE, take_keyboard_focus); - mSelectThisID.setNull(); + if (!mFilter) return; - } - else - { - // save the desired item to be selected later (if/when ready) - mSelectThisID = obj_id; - } -} -void LLInventoryPanel::setSelectCallback(LLFolderView::SelectCallback callback, void* user_data) -{ - if (mFolderRoot) - { - mFolderRoot->setSelectCallback(callback, user_data); - } -} -void LLInventoryPanel::clearSelection() -{ - mFolderRoot->clearSelection(); - mSelectThisID.setNull(); + + // Get data needed for filter display + U32 filter_types = mFilter->getFilterTypes(); + std::string filter_string = mFilter->getFilterSubString(); + LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState(); + U32 hours = mFilter->getHoursAgo(); + + // update the ui elements + LLFloater::setTitle(mFilter->getName()); + childSetValue("check_animation", (S32) (filter_types & 0x1 << LLInventoryType::IT_ANIMATION)); + + childSetValue("check_calling_card", (S32) (filter_types & 0x1 << LLInventoryType::IT_CALLINGCARD)); + childSetValue("check_clothing", (S32) (filter_types & 0x1 << LLInventoryType::IT_WEARABLE)); + childSetValue("check_gesture", (S32) (filter_types & 0x1 << LLInventoryType::IT_GESTURE)); + childSetValue("check_landmark", (S32) (filter_types & 0x1 << LLInventoryType::IT_LANDMARK)); + childSetValue("check_notecard", (S32) (filter_types & 0x1 << LLInventoryType::IT_NOTECARD)); + childSetValue("check_object", (S32) (filter_types & 0x1 << LLInventoryType::IT_OBJECT)); + childSetValue("check_script", (S32) (filter_types & 0x1 << LLInventoryType::IT_LSL)); + childSetValue("check_sound", (S32) (filter_types & 0x1 << LLInventoryType::IT_SOUND)); + childSetValue("check_texture", (S32) (filter_types & 0x1 << LLInventoryType::IT_TEXTURE)); + childSetValue("check_snapshot", (S32) (filter_types & 0x1 << LLInventoryType::IT_SNAPSHOT)); + childSetValue("check_show_empty", show_folders == LLInventoryFilter::SHOW_ALL_FOLDERS); + childSetValue("check_since_logoff", mFilter->isSinceLogoff()); + mSpinSinceHours->set((F32)(hours % 24)); + mSpinSinceDays->set((F32)(hours / 24)); } -void LLInventoryPanel::createNewItem(const std::string& name, - const LLUUID& parent_id, - LLAssetType::EType asset_type, - LLInventoryType::EType inv_type, - U32 next_owner_perm) +void LLInventoryViewFinder::draw() { - std::string desc; - LLViewerAssetType::generateDescriptionFor(asset_type, desc); - next_owner_perm = (next_owner_perm) ? next_owner_perm : PERM_MOVE | PERM_TRANSFER; + U32 filter = 0xffffffff; + BOOL filtered_by_all_types = TRUE; - - if (inv_type == LLInventoryType::IT_GESTURE) + if (!childGetValue("check_animation")) { - LLPointer cb = new CreateGestureCallback(); - create_inventory_item(gAgent.getID(), gAgent.getSessionID(), - parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, - NOT_WEARABLE, next_owner_perm, cb); + filter &= ~(0x1 << LLInventoryType::IT_ANIMATION); + filtered_by_all_types = FALSE; } - else - { - LLPointer cb = NULL; - create_inventory_item(gAgent.getID(), gAgent.getSessionID(), - parent_id, LLTransactionID::tnull, name, desc, asset_type, inv_type, - NOT_WEARABLE, next_owner_perm, cb); - } - -} -BOOL LLInventoryPanel::getSinceLogoff() -{ - return getFilter()->isSinceLogoff(); + + if (!childGetValue("check_calling_card")) + { + filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_clothing")) + { + filter &= ~(0x1 << LLInventoryType::IT_WEARABLE); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_gesture")) + { + filter &= ~(0x1 << LLInventoryType::IT_GESTURE); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_landmark")) + + + { + filter &= ~(0x1 << LLInventoryType::IT_LANDMARK); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_notecard")) + { + filter &= ~(0x1 << LLInventoryType::IT_NOTECARD); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_object")) + { + filter &= ~(0x1 << LLInventoryType::IT_OBJECT); + filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_script")) + { + filter &= ~(0x1 << LLInventoryType::IT_LSL); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_sound")) + { + filter &= ~(0x1 << LLInventoryType::IT_SOUND); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_texture")) + { + filter &= ~(0x1 << LLInventoryType::IT_TEXTURE); + filtered_by_all_types = FALSE; + } + + if (!childGetValue("check_snapshot")) + { + filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT); + filtered_by_all_types = FALSE; + } + + if (!filtered_by_all_types) + { + // don't include folders in filter, unless I've selected everything + filter &= ~(0x1 << LLInventoryType::IT_CATEGORY); + } + + // update the panel, panel will update the filter + mInventoryView->mActivePanel->setShowFolderState(getCheckShowEmpty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); + mInventoryView->mActivePanel->setFilterTypes(filter); + if (getCheckSinceLogoff()) + { + mSpinSinceDays->set(0); + mSpinSinceHours->set(0); + } + U32 days = (U32)mSpinSinceDays->get(); + U32 hours = (U32)mSpinSinceHours->get(); + if (hours > 24) + { + days += hours / 24; + hours = (U32)hours % 24; + mSpinSinceDays->set((F32)days); + mSpinSinceHours->set((F32)hours); + } + hours += days * 24; + mInventoryView->mActivePanel->setHoursAgo(hours); + mInventoryView->mActivePanel->setSinceLogoff(getCheckSinceLogoff()); + mInventoryView->setFilterTextFromFilter(); + + LLFloater::draw(); } -// DEBUG ONLY -// static -void LLInventoryPanel::dumpSelectionInformation(void* user_data) +void LLInventoryViewFinder::onClose(bool app_quitting) { - LLInventoryPanel* iv = (LLInventoryPanel*)user_data; - iv->mFolderRoot->dumpSelectionInformation(); + if (mInventoryView) mInventoryView->getControl("Inventory.ShowFilters")->setValue(FALSE); + // If you want to reset the filter on close, do it here. This functionality was + // hotly debated - Paulm +#if 0 + if (mInventoryView) + { + LLInventoryView::onResetFilter((void *)mInventoryView); + } +#endif + destroy(); +} + + +BOOL LLInventoryViewFinder::getCheckShowEmpty() +{ + return childGetValue("check_show_empty"); +} + +BOOL LLInventoryViewFinder::getCheckSinceLogoff() +{ + return childGetValue("check_since_logoff"); +} + +void LLInventoryViewFinder::onCloseBtn(void* user_data) +{ + LLInventoryViewFinder* finderp = (LLInventoryViewFinder*)user_data; + finderp->close(); +} + +// static +void LLInventoryViewFinder::selectAllTypes(void* user_data) +{ + LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; + if(!self) return; + + self->childSetValue("check_animation", TRUE); + self->childSetValue("check_calling_card", TRUE); + self->childSetValue("check_clothing", TRUE); + self->childSetValue("check_gesture", TRUE); + self->childSetValue("check_landmark", TRUE); + self->childSetValue("check_notecard", TRUE); + self->childSetValue("check_object", TRUE); + self->childSetValue("check_script", TRUE); + self->childSetValue("check_sound", TRUE); + self->childSetValue("check_texture", TRUE); + self->childSetValue("check_snapshot", TRUE); + +/* + self->mCheckCallingCard->set(TRUE); + self->mCheckClothing->set(TRUE); + self->mCheckGesture->set(TRUE); + self->mCheckLandmark->set(TRUE); + self->mCheckNotecard->set(TRUE); + self->mCheckObject->set(TRUE); + self->mCheckScript->set(TRUE); + self->mCheckSound->set(TRUE); + self->mCheckTexture->set(TRUE); + self->mCheckSnapshot->set(TRUE);*/ +} + +//static +void LLInventoryViewFinder::selectNoTypes(void* user_data) +{ + LLInventoryViewFinder* self = (LLInventoryViewFinder*)user_data; + if(!self) return; + + /* + self->childSetValue("check_animation", FALSE); + self->mCheckCallingCard->set(FALSE); + self->mCheckClothing->set(FALSE); + self->mCheckGesture->set(FALSE); + self->mCheckLandmark->set(FALSE); + self->mCheckNotecard->set(FALSE); + self->mCheckObject->set(FALSE); + self->mCheckScript->set(FALSE); + self->mCheckSound->set(FALSE); + self->mCheckTexture->set(FALSE); + self->mCheckSnapshot->set(FALSE);*/ + + + self->childSetValue("check_animation", FALSE); + self->childSetValue("check_calling_card", FALSE); + self->childSetValue("check_clothing", FALSE); + self->childSetValue("check_gesture", FALSE); + self->childSetValue("check_landmark", FALSE); + self->childSetValue("check_notecard", FALSE); + self->childSetValue("check_object", FALSE); + self->childSetValue("check_script", FALSE); + self->childSetValue("check_sound", FALSE); + self->childSetValue("check_texture", FALSE); + self->childSetValue("check_snapshot", FALSE); } diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h new file mode 100644 index 000000000..cce2672d5 --- /dev/null +++ b/indra/newview/llpanelmaininventory.h @@ -0,0 +1,179 @@ +/** + * @file llpanelmaininventory.h + * @brief llpanelmaininventory.h + * class definition + * + * $LicenseInfo:firstyear=2001&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELMAININVENTORY_H +#define LL_LLPANELMAININVENTORY_H + +#include "llfloater.h" +#include "llinventoryobserver.h" + +#include "llfolderview.h" + +class LLFolderViewItem; +class LLInventoryPanel; +class LLSaveFolderState; +class LLFilterEditor; +class LLTabContainer; +class LLMenuButton; +class LLMenuGL; +class LLToggleableMenu; +class LLFloater; +class LLSearchEditor; +class LLComboBox; + +class LLInventoryView : public LLFloater, LLInventoryObserver +{ +friend class LLInventoryViewFinder; + +public: + LLInventoryView(const std::string& name, const std::string& rect, + LLInventoryModel* inventory); + LLInventoryView(const std::string& name, const LLRect& rect, + LLInventoryModel* inventory); + ~LLInventoryView(); + + BOOL postBuild(); + +//TODO: Move these statics. + static LLInventoryView* showAgentInventory(BOOL take_keyboard_focus=FALSE); + static LLInventoryView* getActiveInventory(); + static void toggleVisibility(); + static void toggleVisibility(void*) { toggleVisibility(); } + // Final cleanup, destroy all open inventory views. + static void cleanup(); + + + // LLView & LLFloater functionality + virtual void onClose(bool app_quitting); + virtual void setVisible(BOOL visible); + + virtual BOOL handleKeyHere(KEY key, MASK mask); + + // Inherited functionality + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, + EDragAndDropType cargo_type, + void* cargo_data, + EAcceptance* accept, + std::string& tooltip_msg); + /*virtual*/ void changed(U32 mask); + /*virtual*/ void draw(); + + + LLInventoryPanel* getPanel() { return mActivePanel; } + LLInventoryPanel* getActivePanel() { return mActivePanel; } + const LLInventoryPanel* getActivePanel() const { return mActivePanel; } + + const std::string& getFilterText() const { return mFilterText; } + static void onSearchEdit(const std::string& search_string, void* user_data ); + // + // Misc functions + // + void setFilterTextFromFilter(); + void startSearch(); + + void toggleFindOptions(); + static void onSelectionChange(const std::deque &items, BOOL user_action, void* data); + static BOOL filtersVisible(void* user_data); + static void onClearSearch(void* user_data); + static void onFoldersByName(void *user_data); + static BOOL checkFoldersByName(void *user_data); + + + static void onFilterSelected(void* userdata, bool from_click); + + const std::string getFilterSubString(); + void setFilterSubString(const std::string& string); + + + + static void onQuickFilterCommit(LLUICtrl* ctrl, void* user_data); + static void refreshQuickFilter(LLUICtrl* ctrl); + + static void onResetAll(void* userdata); + static void onExpandAll(void* userdata); + static void onCollapseAll(void* userdata); + + void updateSortControls(); + + void resetFilters(); + + +// [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) + static void closeAll() + { + // If there are mulitple inventory floaters open then clicking the "Inventory" button will close + // them one by one (see LLToolBar::onClickInventory() => toggleVisibility() ) until we get to the + // last one which will just be hidden instead of closed/destroyed (see LLInventoryView::onClose) + // + // However the view isn't removed from sActiveViews until its destructor is called and since + // 'LLMortician::sDestroyImmediate == FALSE' while the viewer is running the destructor won't be + // called right away + // + // Result: we can't call close() on the last (sActiveViews.count() will still be > 1) because + // onClose() would take the wrong branch and destroy() it as well + // + // Workaround: "fix" onClose() to count only views that aren't marked as "dead" + + LLInventoryView* pView; U8 flagsSound; + for (S32 idx = sActiveViews.count() - 1; idx >= 0; idx--) + { + pView = sActiveViews.get(idx); + flagsSound = pView->getSoundFlags(); + pView->setSoundFlags(LLView::SILENT); // Suppress the window close sound + pView->close(); // onClose() protects against closing the last inventory floater + pView->setSoundFlags(flagsSound); // One view won't be destroy()'ed so it needs its sound flags restored + } + } +// [/RLVa:KB] + + +protected: + // internal initialization code + void init(LLInventoryModel* inventory); + +protected: + LLInventoryViewFinder* getFinder(); + LLSearchEditor* mSearchEditor; + LLComboBox* mQuickFilterCombo; + LLTabContainer* mFilterTabs; + LLHandle mFinderHandle; + LLInventoryPanel* mActivePanel; + LLSaveFolderState* mSavedFolderState; + + std::string mFilterText; + + + // This container is used to hold all active inventory views. This + // is here to support the inventory toggle show button. + static LLDynamicArray sActiveViews; +}; + + +#endif // LL_LLPANELMAININVENTORY_H + + + diff --git a/indra/newview/llpreview.cpp b/indra/newview/llpreview.cpp index 5b2c9cfae..1ba07c364 100644 --- a/indra/newview/llpreview.cpp +++ b/indra/newview/llpreview.cpp @@ -34,6 +34,7 @@ #include "stdenums.h" #include "llpreview.h" +#include "llfloaterinventory.h" #include "lllineeditor.h" #include "llinventory.h" #include "llinventorydefines.h" @@ -53,7 +54,6 @@ #include "llagent.h" #include "llvoavatarself.h" #include "llselectmgr.h" -#include "llinventoryview.h" #include "llviewerinventory.h" #include "llviewerassettype.h" diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 803a76ba5..a4e8dfddd 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -34,9 +34,9 @@ #include "llpreviewanim.h" #include "llbutton.h" +#include "llfloaterinventory.h" #include "llresmgr.h" #include "llinventory.h" -#include "llinventoryview.h" #include "llvoavatarself.h" #include "llagent.h" // gAgent #include "llkeyframemotion.h" diff --git a/indra/newview/llpreviewlandmark.cpp b/indra/newview/llpreviewlandmark.cpp index 5d3411549..c67f7c13d 100644 --- a/indra/newview/llpreviewlandmark.cpp +++ b/indra/newview/llpreviewlandmark.cpp @@ -44,8 +44,8 @@ #include "llagent.h" #include "llbutton.h" #include "lleconomy.h" +#include "llfloaterinventory.h" #include "llfloaterworldmap.h" -#include "llinventoryview.h" #include "lliconctrl.h" #include "lllandmarklist.h" #include "lllineeditor.h" @@ -60,9 +60,6 @@ #include "lluictrlfactory.h" #include "lltexturectrl.h" - - - //////////////////////////////////////////////////////////////////////////// // LLPreviewLandmark diff --git a/indra/newview/llpreviewsound.cpp b/indra/newview/llpreviewsound.cpp index a537990fd..446647f9b 100644 --- a/indra/newview/llpreviewsound.cpp +++ b/indra/newview/llpreviewsound.cpp @@ -35,8 +35,8 @@ #include "llaudioengine.h" #include "llagent.h" // gAgent #include "llbutton.h" +#include "llfloaterinventory.h" #include "llinventory.h" -#include "llinventoryview.h" #include "lllineeditor.h" #include "llpreviewsound.h" #include "llresmgr.h" diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 338aa899e..d714b7444 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -38,8 +38,8 @@ #include "llbutton.h" #include "llcombobox.h" #include "statemachine/aifilepicker.h" +#include "llfloaterinventory.h" #include "llimagetga.h" -#include "llinventoryview.h" #include "llinventory.h" #include "llnotificationsutil.h" #include "llresmgr.h" @@ -52,7 +52,6 @@ #include "lllineeditor.h" #include "llfloateravatarinfo.h" - const S32 PREVIEW_TEXTURE_MIN_WIDTH = 300; const S32 PREVIEW_TEXTURE_MIN_HEIGHT = 120; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d678dc490..b5e02fe8f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -115,6 +115,7 @@ #include "llfloaterchat.h" #include "llfloatergesture.h" #include "llfloaterhud.h" +#include "llfloaterinventory.h" #include "llfloaterland.h" #include "llfloatertopobjects.h" #include "llfloatertos.h" @@ -130,7 +131,7 @@ #include "llimview.h" // for gIMMgr #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llkeyboard.h" #include "llloginhandler.h" // gLoginHandler, SLURL support #include "llpanellogin.h" @@ -206,7 +207,6 @@ #include "llsocks5.h" #include "jcfloaterareasearch.h" - // #include "llpanellogin.h" //#include "llfloateravatars.h" diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 34b83a1cf..6adecfeb4 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -42,12 +42,12 @@ #include "llfloaterbuycurrency.h" #include "llfloaterchat.h" #include "llfloaterdirectory.h" // to spawn search +#include "llfloaterinventory.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterscriptdebug.h" #include "llhudicon.h" -#include "llinventoryview.h" #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 267c838ec..a6ab683b4 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -48,7 +48,7 @@ #include "llinventory.h" #include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "lllineeditor.h" #include "llui.h" #include "llviewerinventory.h" diff --git a/indra/newview/lltoolbar.cpp b/indra/newview/lltoolbar.cpp index 06ab0428d..becb8baf4 100644 --- a/indra/newview/lltoolbar.cpp +++ b/indra/newview/lltoolbar.cpp @@ -50,9 +50,9 @@ #include "lluiconstants.h" #include "llvoavatar.h" #include "lltooldraganddrop.h" -#include "llinventoryview.h" #include "llfloaterchatterbox.h" #include "llfloaterfriends.h" +#include "llfloaterinventory.h" #include "llfloatersnapshot.h" #include "llfloateravatarlist.h" #include "lltoolmgr.h" diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index c4967c2e9..d25c4df77 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -45,6 +45,7 @@ #include "llviewercontrol.h" #include "llfirstuse.h" #include "llfloater.h" +#include "llfloaterinventory.h" #include "llfloatertools.h" #include "llfocusmgr.h" #include "llgesturemgr.h" @@ -55,7 +56,7 @@ #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llmutelist.h" #include "llnotify.h" #include "llpreviewnotecard.h" diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 417bbb234..60491e952 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -39,6 +39,7 @@ #include "llagent.h" #include "llagentcamera.h" +#include "llfloaterinventory.h" #include "llviewercontrol.h" #include "llconsole.h" #include "llinventorymodel.h" @@ -49,7 +50,7 @@ #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventorymodelbackgroundfetch.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a70806851..26e472617 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -130,6 +130,7 @@ #include "llfloaterhtmlsimple.h" #include "llfloaterhud.h" #include "llfloaterinspect.h" +#include "llfloaterinventory.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" #include "llfloaterlandholdings.h" @@ -171,7 +172,7 @@ #include "llimagetga.h" #include "llinventorydefines.h" #include "llinventoryfunctions.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llkeyboard.h" #include "llpanellogin.h" #include "llmenucommands.h" diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ef5efc2ac..13d5074e3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -82,6 +82,7 @@ #include "llfloaterchat.h" #include "llfloatergroupinfo.h" #include "llfloaterimagepreview.h" +#include "llfloaterinventory.h" #include "llfloaterland.h" #include "llfloaterregioninfo.h" #include "llfloaterlandholdings.h" @@ -98,7 +99,7 @@ #include "llimpanel.h" #include "llinventorydefines.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llmenugl.h" #include "llmutelist.h" #include "llnotify.h" diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 2ec7cf396..b7b4dbc27 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -38,7 +38,7 @@ #include "llinventory.h" #include "llinventorydefines.h" #include "llinventorymodel.h" -#include "llinventoryview.h" +#include "llinventorypanel.h" #include "llinventorybridge.h" // for landmark prefix string #include "llviewertexteditor.h" diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7c7dc6c99..5267c32e8 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -105,6 +105,7 @@ #include "llfloatereditui.h" // HACK JAMESDEBUG for ui editor #include "llfloaterland.h" #include "llfloaterinspect.h" +#include "llfloaterinventory.h" #include "llfloaternamedesc.h" #include "llfloaterpreference.h" #include "llfloatersnapshot.h" @@ -121,7 +122,6 @@ #include "llimagebmp.h" #include "llimagej2c.h" #include "llimageworker.h" -#include "llinventoryview.h" #include "llkeyboard.h" #include "lllineeditor.h" #include "llmenugl.h" diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index e1e846560..db9ae5cb6 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -54,12 +54,12 @@ #include "llfirstuse.h" #include "llfloaterchat.h" +#include "llfloaterinventory.h" #include "llheadrotmotion.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" #include "llinventorybridge.h" -#include "llinventoryview.h" #include "llinventoryfunctions.h" #include "llhudnametag.h" #include "llhudtext.h" // for mText/mDebugText diff --git a/indra/newview/rlvhandler.cpp b/indra/newview/rlvhandler.cpp index e3da0a79a..1fd9239ee 100644 --- a/indra/newview/rlvhandler.cpp +++ b/indra/newview/rlvhandler.cpp @@ -22,6 +22,7 @@ #include "llfloaterchat.h" #include "llfloaterdaycycle.h" #include "llfloaterenvsettings.h" +#include "llfloaterinventory.h" #include "llfloaterland.h" #include "llfloatermap.h" #include "llfloaterregioninfo.h" @@ -29,7 +30,6 @@ #include "llfloaterwater.h" #include "llfloaterwindlight.h" #include "llfloaterworldmap.h" -#include "llinventoryview.h" #include "llviewermenu.h" #include "llviewermessage.h" #include "llviewerobjectlist.h" diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index c27ee59ce..77c25b02b 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -16,9 +16,9 @@ #include "llviewerprecompiledheaders.h" #include "llattachmentsmgr.h" +#include "llfloaterinventory.h" #include "llfloaterwindlight.h" #include "llgesturemgr.h" -#include "llinventoryview.h" #include "llinventorybridge.h" #include "llnotificationsutil.h" #include "llviewerobject.h"