diff options
Diffstat (limited to 'indra/newview/llpanelmaininventory.cpp')
-rw-r--r-- | indra/newview/llpanelmaininventory.cpp | 189 |
1 files changed, 95 insertions, 94 deletions
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 5111241e92..ba52da0760 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); @@ -167,7 +168,7 @@ BOOL LLPanelMainInventory::postBuild() if (recent_items_panel) { // assign default values until we will be sure that we have setting to restore - recent_items_panel->setSinceLogoff(TRUE); + 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(); @@ -289,7 +290,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 @@ -379,11 +380,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 +397,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 +596,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 +723,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 +751,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 +809,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 +829,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 +849,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 +912,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 +920,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 +929,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; } @@ -1080,7 +1081,7 @@ void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_ getChild<LLInventoryPanel>(RECENT_ITEMS)->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 +1106,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 +1128,7 @@ BOOL LLFloaterInventoryFinder::postBuild() childSetAction("Close", onCloseBtn, this); updateElementsFromFilter(); - return TRUE; + return true; } void LLFloaterInventoryFinder::onTimeAgo(LLUICtrl *ctrl, void *user_data) { @@ -1216,31 +1217,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 +1249,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 +1389,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 +1409,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 +1440,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 +1461,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); } ////////////////////////////////////////////////////////////////////////////////// @@ -1999,14 +2000,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 +2038,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 +2072,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 +2093,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 +2127,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 +2145,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 +2163,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 +2220,7 @@ BOOL LLPanelMainInventory::isActionChecked(const LLSD& userdata) return isCombinationViewMode(); } - return FALSE; + return false; } void LLPanelMainInventory::setUploadCostIfNeeded() @@ -2338,7 +2339,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 +2471,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(); } } |