summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelmaininventory.cpp
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
committerNat Goodspeed <nat@lindenlab.com>2024-08-13 15:32:47 -0400
commit23f2631d598b6e07450a96ed1ec00670c8867cdd (patch)
tree20195c1688ad8cb7e8631c97fa5920624f10972c /indra/newview/llpanelmaininventory.cpp
parent54334ff6e377e35c97df3a0fe2a859795ec07b21 (diff)
parent8ce3323269d95f54e2b768c4c5aa154d4afbbb6b (diff)
Merge branch 'develop' into nat/edu-channel
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r--indra/newview/llpanelmaininventory.cpp252
1 files changed, 126 insertions, 126 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index 5111241e92..fd7085c452 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -56,6 +56,7 @@
#include "lltrans.h"
#include "llviewermenu.h"
#include "llviewertexturelist.h"
+#include "llviewerinventory.h"
#include "llsidepanelinventory.h"
#include "llfolderview.h"
#include "llradiogroup.h"
@@ -79,11 +80,11 @@ class LLFloaterInventoryFinder : public LLFloater
public:
LLFloaterInventoryFinder( LLPanelMainInventory* inventory_view);
virtual void draw();
- /*virtual*/ BOOL postBuild();
+ /*virtual*/ bool postBuild();
void changeFilter(LLInventoryFilter* filter);
void updateElementsFromFilter();
- BOOL getCheckShowEmpty();
- BOOL getCheckSinceLogoff();
+ bool getCheckShowEmpty();
+ bool getCheckSinceLogoff();
U32 getDateSearchDirection();
void onCreatorSelfFilterCommit();
@@ -138,10 +139,10 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p)
mSavedFolderState = new LLSaveFolderState();
- mSavedFolderState->setApply(FALSE);
+ mSavedFolderState->setApply(false);
}
-BOOL LLPanelMainInventory::postBuild()
+bool LLPanelMainInventory::postBuild()
{
gInventory.addObserver(this);
@@ -153,28 +154,30 @@ BOOL LLPanelMainInventory::postBuild()
//panel->getFilter().markDefault();
// Set up the default inv. panel/filter settings.
- mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS);
- if (mActivePanel)
+ mAllItemsPanel = getChild<LLInventoryPanel>(ALL_ITEMS);
+ if (mAllItemsPanel)
{
// "All Items" is the previous only view, so it gets the InventorySortOrder
- mActivePanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
- mActivePanel->getFilter().markDefault();
- mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
- mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2));
+ mAllItemsPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::DEFAULT_SORT_ORDER));
+ mAllItemsPanel->getFilter().markDefault();
+ mAllItemsPanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
+ mAllItemsPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mAllItemsPanel, _1, _2));
mResortActivePanel = true;
}
- LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS);
- if (recent_items_panel)
+ mActivePanel = mAllItemsPanel;
+
+ mRecentPanel = getChild<LLInventoryPanel>(RECENT_ITEMS);
+ if (mRecentPanel)
{
// assign default values until we will be sure that we have setting to restore
- recent_items_panel->setSinceLogoff(TRUE);
- recent_items_panel->setSortOrder(LLInventoryFilter::SO_DATE);
- recent_items_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
- LLInventoryFilter& recent_filter = recent_items_panel->getFilter();
+ mRecentPanel->setSinceLogoff(true);
+ mRecentPanel->setSortOrder(LLInventoryFilter::SO_DATE);
+ mRecentPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ LLInventoryFilter& recent_filter = mRecentPanel->getFilter();
recent_filter.setFilterObjectTypes(recent_filter.getFilterObjectTypes() & ~(0x1 << LLInventoryType::IT_CATEGORY));
recent_filter.setEmptyLookupMessage("InventoryNoMatchingRecentItems");
recent_filter.markDefault();
- recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
+ mRecentPanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mRecentPanel, _1, _2));
}
mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS);
@@ -210,17 +213,17 @@ BOOL LLPanelMainInventory::postBuild()
// Load the persistent "Recent Items" settings.
// Note that the "All Items" settings do not persist.
- if(recent_items_panel)
+ if(mRecentPanel)
{
- if(savedFilterState.has(recent_items_panel->getFilter().getName()))
+ if(savedFilterState.has(mRecentPanel->getFilter().getName()))
{
LLSD recent_items = savedFilterState.get(
- recent_items_panel->getFilter().getName());
+ mRecentPanel->getFilter().getName());
LLInventoryFilter::Params p;
LLParamSDParser parser;
parser.readSD(recent_items, p);
- recent_items_panel->getFilter().fromParams(p);
- recent_items_panel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
+ mRecentPanel->getFilter().fromParams(p);
+ mRecentPanel->setSortOrder(gSavedSettings.getU32(LLInventoryPanel::RECENTITEMS_SORT_ORDER));
}
}
if(mActivePanel)
@@ -289,7 +292,7 @@ BOOL LLPanelMainInventory::postBuild()
// Trigger callback for focus received so we can deselect items in inbox/outbox
LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this));
- return TRUE;
+ return true;
}
// Destroys the object
@@ -361,7 +364,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel()
{
- return getChild<LLInventoryPanel>(ALL_ITEMS);
+ return mAllItemsPanel;
}
void LLPanelMainInventory::selectAllItemsPanel()
@@ -371,7 +374,7 @@ void LLPanelMainInventory::selectAllItemsPanel()
bool LLPanelMainInventory::isRecentItemsPanelSelected()
{
- return (RECENT_ITEMS == getActivePanel()->getName());
+ return (mRecentPanel == getActivePanel());
}
void LLPanelMainInventory::startSearch()
@@ -379,11 +382,11 @@ void LLPanelMainInventory::startSearch()
// this forces focus to line editor portion of search editor
if (mFilterEditor)
{
- mFilterEditor->focusFirstItem(TRUE);
+ mFilterEditor->focusFirstItem(true);
}
}
-BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask)
+bool LLPanelMainInventory::handleKeyHere(KEY key, MASK mask)
{
LLFolderView* root_folder = mActivePanel ? mActivePanel->getRootFolder() : NULL;
if (root_folder)
@@ -396,9 +399,9 @@ BOOL LLPanelMainInventory::handleKeyHere(KEY key, MASK mask)
&& mask == MASK_NONE)
{
// move focus to inventory proper
- mActivePanel->setFocus(TRUE);
+ mActivePanel->setFocus(true);
root_folder->scrollToShowSelection();
- return TRUE;
+ return true;
}
if (mActivePanel->hasFocus() && key == KEY_UP)
@@ -595,7 +598,7 @@ void LLPanelMainInventory::findLinks(const LLUUID& item_id, const std::string& i
filter.setFindAllLinksMode(item_name, item_id);
mFilterEditor->setText(item_name);
- mFilterEditor->setFocus(TRUE);
+ mFilterEditor->setFocus(true);
}
void LLPanelMainInventory::setSortBy(const LLSD& userdata)
@@ -722,17 +725,17 @@ void LLPanelMainInventory::updateSearchTypeCombo()
}
// static
-BOOL LLPanelMainInventory::filtersVisible(void* user_data)
+bool LLPanelMainInventory::filtersVisible(void* user_data)
{
LLPanelMainInventory* self = (LLPanelMainInventory*)user_data;
- if(!self) return FALSE;
+ if(!self) return false;
return self->getFinder() != NULL;
}
void LLPanelMainInventory::onClearSearch()
{
- BOOL initially_active = FALSE;
+ bool initially_active = false;
LLFloater *finder = getFinder();
if (mActivePanel && (getActivePanel() != mWornItemsPanel))
{
@@ -750,7 +753,7 @@ void LLPanelMainInventory::onClearSearch()
// re-open folders that were initially open in case filter was active
if (mActivePanel && (mFilterSubString.size() || initially_active) && !mSingleFolderMode)
{
- mSavedFolderState->setApply(TRUE);
+ mSavedFolderState->setApply(true);
mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
LLOpenFoldersWithSelection opener;
mActivePanel->getRootFolder()->applyFunctorRecursively(opener);
@@ -808,7 +811,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
// save current folder open state if no filter currently applied
if (!mActivePanel->getFilter().isNotDefault())
{
- mSavedFolderState->setApply(FALSE);
+ mSavedFolderState->setApply(false);
mActivePanel->getRootFolder()->applyFunctorRecursively(*mSavedFolderState);
}
@@ -828,7 +831,7 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
//static
- BOOL LLPanelMainInventory::incrementalFind(LLFolderViewItem* first_item, const char *find_text, BOOL backward)
+ bool LLPanelMainInventory::incrementalFind(LLFolderViewItem* first_item, const char *find_text, bool backward)
{
LLPanelMainInventory* active_view = NULL;
@@ -848,23 +851,23 @@ void LLPanelMainInventory::onFilterEdit(const std::string& search_string )
if (!active_view)
{
- return FALSE;
+ return false;
}
std::string search_string(find_text);
if (search_string.empty())
{
- return FALSE;
+ return false;
}
if (active_view->getPanel() &&
active_view->getPanel()->getRootFolder()->search(first_item, search_string, backward))
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
void LLPanelMainInventory::onFilterSelected()
@@ -911,7 +914,7 @@ void LLPanelMainInventory::setFilterSubString(const std::string& string)
mActivePanel->setFilterSubString(string);
}
-BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+bool LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, bool drop,
EDragAndDropType cargo_type,
void* cargo_data,
EAcceptance* accept,
@@ -919,7 +922,7 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
{
// Check to see if we are auto scrolling from the last frame
LLInventoryPanel* panel = (LLInventoryPanel*)this->getActivePanel();
- BOOL needsToScroll = panel->getScrollableContainer()->canAutoScroll(x, y);
+ bool needsToScroll = panel->getScrollableContainer()->canAutoScroll(x, y);
if(mFilterTabs)
{
if(needsToScroll)
@@ -928,7 +931,7 @@ BOOL LLPanelMainInventory::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
}
}
- BOOL handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
+ bool handled = LLPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
return handled;
}
@@ -1076,11 +1079,11 @@ void LLPanelMainInventory::toggleFindOptions()
void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_type& cb)
{
- getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb);
- getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb);
+ mAllItemsPanel->setSelectCallback(cb);
+ mRecentPanel->setSelectCallback(cb);
}
-void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action)
+void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, bool user_action)
{
updateListCommands();
panel->onSelectionChange(items, user_action);
@@ -1105,7 +1108,7 @@ LLFloaterInventoryFinder::LLFloaterInventoryFinder(LLPanelMainInventory* invento
updateElementsFromFilter();
}
-BOOL LLFloaterInventoryFinder::postBuild()
+bool LLFloaterInventoryFinder::postBuild()
{
const LLRect& viewrect = mPanelMainInventory->getRect();
setRect(LLRect(viewrect.mLeft - getRect().getWidth(), viewrect.mTop, viewrect.mLeft, viewrect.mTop - getRect().getHeight()));
@@ -1127,7 +1130,7 @@ BOOL LLFloaterInventoryFinder::postBuild()
childSetAction("Close", onCloseBtn, this);
updateElementsFromFilter();
- return TRUE;
+ return true;
}
void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data)
{
@@ -1176,7 +1179,7 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
return;
// Get data needed for filter display
- U32 filter_types = mFilter->getFilterObjectTypes();
+ U32 filter_types = (U32)mFilter->getFilterObjectTypes();
LLInventoryFilter::EFolderShow show_folders = mFilter->getShowFolderState();
U32 hours = mFilter->getHoursAgo();
U32 date_search_direction = mFilter->getDateSearchDirection();
@@ -1216,31 +1219,31 @@ void LLFloaterInventoryFinder::updateElementsFromFilter()
void LLFloaterInventoryFinder::draw()
{
U64 filter = 0xffffffffffffffffULL;
- BOOL filtered_by_all_types = TRUE;
+ bool filtered_by_all_types = true;
if (!getChild<LLUICtrl>("check_animation")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_ANIMATION);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_calling_card")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_CALLINGCARD);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_clothing")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_WEARABLE);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_gesture")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_GESTURE);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_landmark")->getValue())
@@ -1248,56 +1251,56 @@ void LLFloaterInventoryFinder::draw()
{
filter &= ~(0x1 << LLInventoryType::IT_LANDMARK);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_material")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_MATERIAL);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_notecard")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_NOTECARD);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_object")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_OBJECT);
filter &= ~(0x1 << LLInventoryType::IT_ATTACHMENT);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_script")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_LSL);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_sound")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SOUND);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_texture")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_TEXTURE);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_snapshot")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SNAPSHOT);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!getChild<LLUICtrl>("check_settings")->getValue())
{
filter &= ~(0x1 << LLInventoryType::IT_SETTINGS);
- filtered_by_all_types = FALSE;
+ filtered_by_all_types = false;
}
if (!filtered_by_all_types || (mPanelMainInventory->getPanel()->getFilter().getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE))
@@ -1388,7 +1391,7 @@ void LLFloaterInventoryFinder::onCreatorSelfFilterCommit()
else if(!show_creator_self || !show_creator_other)
{
mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_OTHERS);
- mCreatorOthers->set(TRUE);
+ mCreatorOthers->set(true);
}
}
@@ -1408,16 +1411,16 @@ void LLFloaterInventoryFinder::onCreatorOtherFilterCommit()
else if(!show_creator_other || !show_creator_self)
{
mPanelMainInventory->getCurrentFilter().setFilterCreator(LLInventoryFilter::FILTERCREATOR_SELF);
- mCreatorSelf->set(TRUE);
+ mCreatorSelf->set(true);
}
}
-BOOL LLFloaterInventoryFinder::getCheckShowEmpty()
+bool LLFloaterInventoryFinder::getCheckShowEmpty()
{
return getChild<LLUICtrl>("check_show_empty")->getValue();
}
-BOOL LLFloaterInventoryFinder::getCheckSinceLogoff()
+bool LLFloaterInventoryFinder::getCheckSinceLogoff()
{
return getChild<LLUICtrl>("check_since_logoff")->getValue();
}
@@ -1439,19 +1442,19 @@ void LLFloaterInventoryFinder::selectAllTypes(void* user_data)
LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
if(!self) return;
- self->getChild<LLUICtrl>("check_animation")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_calling_card")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_clothing")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_gesture")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_landmark")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_material")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_notecard")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_object")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_script")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_sound")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_texture")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_snapshot")->setValue(TRUE);
- self->getChild<LLUICtrl>("check_settings")->setValue(TRUE);
+ self->getChild<LLUICtrl>("check_animation")->setValue(true);
+ self->getChild<LLUICtrl>("check_calling_card")->setValue(true);
+ self->getChild<LLUICtrl>("check_clothing")->setValue(true);
+ self->getChild<LLUICtrl>("check_gesture")->setValue(true);
+ self->getChild<LLUICtrl>("check_landmark")->setValue(true);
+ self->getChild<LLUICtrl>("check_material")->setValue(true);
+ self->getChild<LLUICtrl>("check_notecard")->setValue(true);
+ self->getChild<LLUICtrl>("check_object")->setValue(true);
+ self->getChild<LLUICtrl>("check_script")->setValue(true);
+ self->getChild<LLUICtrl>("check_sound")->setValue(true);
+ self->getChild<LLUICtrl>("check_texture")->setValue(true);
+ self->getChild<LLUICtrl>("check_snapshot")->setValue(true);
+ self->getChild<LLUICtrl>("check_settings")->setValue(true);
}
//static
@@ -1460,19 +1463,19 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
LLFloaterInventoryFinder* self = (LLFloaterInventoryFinder*)user_data;
if(!self) return;
- self->getChild<LLUICtrl>("check_animation")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_calling_card")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_clothing")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_gesture")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_landmark")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_material")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_notecard")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_object")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_script")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_sound")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_texture")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_snapshot")->setValue(FALSE);
- self->getChild<LLUICtrl>("check_settings")->setValue(FALSE);
+ self->getChild<LLUICtrl>("check_animation")->setValue(false);
+ self->getChild<LLUICtrl>("check_calling_card")->setValue(false);
+ self->getChild<LLUICtrl>("check_clothing")->setValue(false);
+ self->getChild<LLUICtrl>("check_gesture")->setValue(false);
+ self->getChild<LLUICtrl>("check_landmark")->setValue(false);
+ self->getChild<LLUICtrl>("check_material")->setValue(false);
+ self->getChild<LLUICtrl>("check_notecard")->setValue(false);
+ self->getChild<LLUICtrl>("check_object")->setValue(false);
+ self->getChild<LLUICtrl>("check_script")->setValue(false);
+ self->getChild<LLUICtrl>("check_sound")->setValue(false);
+ self->getChild<LLUICtrl>("check_texture")->setValue(false);
+ self->getChild<LLUICtrl>("check_snapshot")->setValue(false);
+ self->getChild<LLUICtrl>("check_settings")->setValue(false);
}
//////////////////////////////////////////////////////////////////////////////////
@@ -1481,10 +1484,10 @@ void LLFloaterInventoryFinder::selectNoTypes(void* user_data)
void LLPanelMainInventory::initListCommandsHandlers()
{
childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this));
- childSetAction("view_mode_btn", boost::bind(&LLPanelMainInventory::onViewModeClick, this));
- childSetAction("up_btn", boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
- childSetAction("back_btn", boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
- childSetAction("forward_btn", boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
+ mViewModeBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onViewModeClick, this));
+ mUpBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onUpFolderClicked, this));
+ mBackBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onBackFolderClicked, this));
+ mForwardBtn->setCommitCallback(boost::bind(&LLPanelMainInventory::onForwardFolderClicked, this));
mCommitCallbackRegistrar.add("Inventory.GearDefault.Custom.Action", boost::bind(&LLPanelMainInventory::onCustomAction, this, _2));
mEnableCallbackRegistrar.add("Inventory.GearDefault.Check", boost::bind(&LLPanelMainInventory::isActionChecked, this, _2));
@@ -1549,12 +1552,9 @@ void LLPanelMainInventory::initSingleFolderRoot(const LLUUID& start_folder_id)
void LLPanelMainInventory::initInventoryViews()
{
- LLInventoryPanel* all_item = getChild<LLInventoryPanel>(ALL_ITEMS);
- all_item->initializeViewBuilding();
- LLInventoryPanel* recent_item = getChild<LLInventoryPanel>(RECENT_ITEMS);
- recent_item->initializeViewBuilding();
- LLInventoryPanel* worn_item = getChild<LLInventoryPanel>(WORN_ITEMS);
- worn_item->initializeViewBuilding();
+ mAllItemsPanel->initializeViewBuilding();
+ mRecentPanel->initializeViewBuilding();
+ mWornItemsPanel->initializeViewBuilding();
}
void LLPanelMainInventory::toggleViewMode()
@@ -1999,14 +1999,14 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
}
}
-void LLPanelMainInventory::onVisibilityChange( BOOL new_visibility )
+void LLPanelMainInventory::onVisibilityChange( bool new_visibility )
{
if(!new_visibility)
{
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if (menu)
{
- menu->setVisible(FALSE);
+ menu->setVisible(false);
}
getActivePanel()->getRootFolder()->finishRenamingItem();
}
@@ -2037,12 +2037,12 @@ bool LLPanelMainInventory::isSaveTextureEnabled(const LLSD& userdata)
return false;
}
-BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
+bool LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
{
const std::string command_name = userdata.asString();
if (command_name == "not_empty")
{
- BOOL status = FALSE;
+ bool status = false;
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
if (current_item)
{
@@ -2071,15 +2071,15 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
}
else{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
- if (!current_item) return FALSE;
+ if (!current_item) return false;
item_id = static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getUUID();
}
const LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item && item->getIsLinkType() && !item->getIsBrokenLink())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
if (command_name == "find_links")
@@ -2092,30 +2092,30 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
else{
LLFolderView* root = getActivePanel()->getRootFolder();
std::set<LLFolderViewItem*> selection_set = root->getSelectionList();
- if (selection_set.size() != 1) return FALSE;
+ if (selection_set.size() != 1) return false;
LLFolderViewItem* current_item = root->getCurSelectedItem();
- if (!current_item) return FALSE;
+ if (!current_item) return false;
item_id = static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getUUID();
}
const LLInventoryObject *obj = gInventory.getObject(item_id);
if (obj && !obj->getIsLinkType() && LLAssetType::lookupCanLink(obj->getType()))
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// This doesn't currently work, since the viewer can't change an assetID an item.
if (command_name == "regenerate_link")
{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
- if (!current_item) return FALSE;
+ if (!current_item) return false;
const LLUUID& item_id = static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->getUUID();
const LLViewerInventoryItem *item = gInventory.getItem(item_id);
if (item && item->getIsBrokenLink())
{
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
if (command_name == "share")
@@ -2126,9 +2126,9 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
}
else{
LLFolderViewItem* current_item = getActivePanel()->getRootFolder()->getCurSelectedItem();
- if (!current_item) return FALSE;
+ if (!current_item) return false;
LLSidepanelInventory* parent = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
- return parent ? parent->canShare() : FALSE;
+ return parent ? parent->canShare() : false;
}
}
if (command_name == "empty_trash")
@@ -2144,7 +2144,7 @@ BOOL LLPanelMainInventory::isActionEnabled(const LLSD& userdata)
return children != LLInventoryModel::CHILDREN_NO && gInventory.isCategoryComplete(trash_id);
}
- return TRUE;
+ return true;
}
bool LLPanelMainInventory::isActionVisible(const LLSD& userdata)
@@ -2162,7 +2162,7 @@ bool LLPanelMainInventory::isActionVisible(const LLSD& userdata)
return true;
}
-BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
+bool LLPanelMainInventory::isActionChecked(const LLSD& userdata)
{
U32 sort_order_mask = (mSingleFolderMode && isGalleryViewMode()) ? mCombinationGalleryPanel->getSortOrder() : getActivePanel()->getSortOrder();
const std::string command_name = userdata.asString();
@@ -2219,7 +2219,7 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata)
return isCombinationViewMode();
}
- return FALSE;
+ return false;
}
void LLPanelMainInventory::setUploadCostIfNeeded()
@@ -2338,7 +2338,7 @@ void LLPanelMainInventory::onCombinationGallerySelectionChanged(const LLUUID& ca
{
}
-void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, BOOL user_action)
+void LLPanelMainInventory::onCombinationInventorySelectionChanged(const std::deque<LLFolderViewItem*>& items, bool user_action)
{
onSelectionChange(mCombinationInventoryPanel, items, user_action);
}
@@ -2470,9 +2470,9 @@ void LLPanelMainInventory::updateCombinationVisibility()
&& mCombInvUUIDNeedsRename.notNull()
&& mCombinationInventoryPanel->areViewsInitialized())
{
- mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, TRUE);
+ mCombinationInventoryPanel->setSelectionByID(mCombInvUUIDNeedsRename, true);
mCombinationInventoryPanel->getRootFolder()->scrollToShowSelection();
- mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(TRUE);
+ mCombinationInventoryPanel->getRootFolder()->setNeedsAutoRename(true);
mCombInvUUIDNeedsRename.setNull();
}
}