void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); // <FS:Ansariel> FIRE-8298: Apply now checkbox has no effect setCanApply(true, true); // </FS:Ansariel> setImageID(te.getID()); mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } else { childSetValue("texture_uuid", inventory_item_id.asString()); } commitIfImmediateSet(); } else { LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); } }
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { //<edit> //LLUUID inventory_item_id = findItemID(te.getID(), TRUE); //if (inventory_item_id.notNull()) //{ LLToolPipette::getInstance()->setResult(TRUE, ""); setImageID(te.getID()); mNoCopyTextureSelected = FALSE; getChild<LLUICtrl>("texture_uuid")->setValue(te.getID().asString()); /* LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } */ commitIfImmediateSet(); // } // else // { // LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); // } //</edit> }
// virtual BOOL LLFloaterTexturePicker::handleDragAndDrop( S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { BOOL handled = FALSE; bool is_mesh = cargo_type == DAD_MESH; if ((cargo_type == DAD_TEXTURE) || is_mesh) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; if (copy) item_perm_mask |= PERM_COPY; if (mod) item_perm_mask |= PERM_MODIFY; if (xfer) item_perm_mask |= PERM_TRANSFER; //PermissionMask filter_perm_mask = getFilterPermMask(); Commented out due to no-copy texture loss. PermissionMask filter_perm_mask = mDnDFilterPermMask; if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) { if (drop) { // <FS:Ansariel> FIRE-8298: Apply now checkbox has no effect setCanApply(true, true); // </FS:Ansariel> setImageID( item->getAssetUUID() ); commitIfImmediateSet(); } *accept = ACCEPT_YES_SINGLE; } else { *accept = ACCEPT_NO; } } else { *accept = ACCEPT_NO; } handled = TRUE; lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << llendl; return handled; }
// virtual BOOL LLFloaterTexturePicker::handleDragAndDrop( S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { BOOL handled = FALSE; if (cargo_type == DAD_TEXTURE) { LLInventoryItem *item = (LLInventoryItem *)cargo_data; BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); BOOL xfer = item->getPermissions().allowOperationBy(PERM_TRANSFER, gAgent.getID()); PermissionMask item_perm_mask = 0; if (copy) item_perm_mask |= PERM_COPY; if (mod) item_perm_mask |= PERM_MODIFY; if (xfer) item_perm_mask |= PERM_TRANSFER; // <edit> //PermissionMask filter_perm_mask = mImmediateFilterPermMask; //if ( (item_perm_mask & filter_perm_mask) == filter_perm_mask ) // </edit> { if (drop) { setImageID( item->getAssetUUID() ); commitIfImmediateSet(); } *accept = ACCEPT_YES_SINGLE; } // <edit> /*else { *accept = ACCEPT_NO; }*/ // </edit> } else { *accept = ACCEPT_NO; } handled = TRUE; lldebugst(LLERR_USER_INPUT) << "dragAndDrop handled by LLFloaterTexturePicker " << getName() << llendl; return handled; }
void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) { if (items.size()) { LLFolderViewItem* first_item = items.front(); LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID()); mNoCopyTextureSelected = FALSE; if (itemp) { if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) { mNoCopyTextureSelected = TRUE; } mImageAssetID = itemp->getAssetUUID(); mViewModel->setDirty(); // *TODO: shouldn't we be using setValue() here? if (user_action) { // only commit intentional selections, not implicit ones commitIfImmediateSet(); } } } }
BOOL LLFloaterTexturePicker::handleKeyHere(KEY key, MASK mask) { LLFolderView* root_folder = mInventoryPanel->getRootFolder(); if (root_folder && mFilterEdit) { if (mFilterEdit->hasFocus() && (key == KEY_RETURN || key == KEY_DOWN) && mask == MASK_NONE) { if (!root_folder->getCurSelectedItem()) { LLFolderViewItem* itemp = root_folder->getItemByID(gInventory.getRootFolderID()); if (itemp) { root_folder->setSelection(itemp, FALSE, FALSE); } } root_folder->scrollToShowSelection(); // move focus to inventory proper mInventoryPanel->setFocus(TRUE); // treat this as a user selection of the first filtered result commitIfImmediateSet(); return TRUE; } if (mInventoryPanel->hasFocus() && key == KEY_UP) { mFilterEdit->focusFirstItem(TRUE); } } return LLFloater::handleKeyHere(key, mask); }
// static void LLFloaterTexturePicker::onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action) { if (items.size()) { LLFolderViewItem* first_item = items.front(); LLInventoryItem* itemp = gInventory.getItem(first_item->getListener()->getUUID()); mNoCopyTextureSelected = FALSE; if (itemp) { if (!mTextureSelectedCallback.empty()) { mTextureSelectedCallback(itemp); } // <dogmode> if (itemp->getPermissions().getMaskOwner() & PERM_ALL) childSetValue("texture_uuid", mImageAssetID); else childSetValue("texture_uuid", LLUUID::null.asString()); // </dogmode> if (!itemp->getPermissions().allowCopyBy(gAgent.getID())) { mNoCopyTextureSelected = TRUE; } // <FS:Ansariel> FIRE-8298: Apply now checkbox has no effect setCanApply(true, true); // </FS:Ansariel> mImageAssetID = itemp->getAssetUUID(); mIsDirty = TRUE; if (user_action && mCanPreview) { // only commit intentional selections, not implicit ones commitIfImmediateSet(); } } } }
void LLFloaterTexturePicker::onTextureSelect( const LLTextureEntry& te ) { LLUUID inventory_item_id = findItemID(te.getID(), TRUE); if (inventory_item_id.notNull()) { LLToolPipette::getInstance()->setResult(TRUE, ""); setImageID(te.getID()); mNoCopyTextureSelected = FALSE; LLInventoryItem* itemp = gInventory.getItem(inventory_item_id); if (itemp && !itemp->getPermissions().allowCopyBy(gAgent.getID())) { // no copy texture mNoCopyTextureSelected = TRUE; } commitIfImmediateSet(); } else { LLToolPipette::getInstance()->setResult(FALSE, LLTrans::getString("InventoryNoTexture")); } }