void LLPanelMarketplaceListings::setSortOrder(U32 sort_order) { mSortOrder = sort_order; gSavedSettings.setU32("MarketplaceListingsSortOrder", sort_order); // Set each panel with that sort order LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); panel->setSortOrder(mSortOrder); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); panel->setSortOrder(mSortOrder); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); panel->setSortOrder(mSortOrder); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); panel->setSortOrder(mSortOrder); }
// static void LLInventoryPanel::onIdle(void *userdata) { if (!gInventory.isInventoryUsable()) return; LLInventoryPanel *self = (LLInventoryPanel*)userdata; // Inventory just initialized, do complete build if (!self->mViewsInitialized) { self->initializeViews(); } if (self->mViewsInitialized) { gIdleCallbacks.deleteFunction(onIdle, (void*)self); } }
void LLFloaterTexturePicker::onFilterEdit(const std::string& search_string ) { if (!mInventoryPanel) { return; } // set new filter string // Internally handles saving/restoring folder states. mInventoryPanel->setFilterSubString(search_string); }
void LLPanelOutfitsInventory::onTabSelectionChange(LLInventoryPanel* tab_panel, const std::deque<LLFolderViewItem*> &items, BOOL user_action) { if (user_action && items.size() > 0) { for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); iter != mTabPanels.end(); ++iter) { LLInventoryPanel *panel = (*iter); if (panel == tab_panel) { mActivePanel = panel; } else { panel->getRootFolder()->clearSelection(); } } } onSelectionChange(items, user_action); }
BOOL LLInventoryView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void* cargo_data, EAcceptance* accept, std::string& tooltip_msg) { // Check to see if we are auto scrolling from the last frame LLInventoryPanel* panel = (LLInventoryPanel*)this->getActivePanel(); BOOL needsToScroll = panel->getScrollableContainer()->needsToScroll(x, y, LLScrollableContainerView::VERTICAL); if(mFilterTabs) { if(needsToScroll) { mFilterTabs->startDragAndDropDelayTimer(); } } BOOL handled = LLFloater::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); return handled; }
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); std::string start_folder; node->getAttributeString("start_folder", start_folder); if(name == "Recent Items") panel = new LLInventoryRecentItemsPanel(name, sort_order, start_folder, rect, &gInventory, allow_multi_select, parent); else if(name == "panel_outbox_inventory") panel = new LLOutboxInventoryPanel(name, sort_order, start_folder, rect, &gInventory, allow_multi_select, parent); else panel = new LLInventoryPanel(name, sort_order, start_folder, rect, &gInventory, allow_multi_select, parent); panel->initFromXML(node, parent); panel->postBuild(); return panel; }
void LLPanelOutfitsInventory::initTabPanels() { LLInventoryPanel *cof_panel = getChild<LLInventoryPanel>(COF_TAB_NAME); cof_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mTabPanels.push_back(cof_panel); LLInventoryPanel *myoutfits_panel = getChild<LLInventoryPanel>(OUTFITS_TAB_NAME); myoutfits_panel->setFilterTypes(1LL << LLFolderType::FT_OUTFIT, LLInventoryFilter::FILTERTYPE_CATEGORY); myoutfits_panel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mTabPanels.push_back(myoutfits_panel); for (tabpanels_vec_t::iterator iter = mTabPanels.begin(); iter != mTabPanels.end(); ++iter) { LLInventoryPanel *panel = (*iter); panel->setSelectCallback(boost::bind(&LLPanelOutfitsInventory::onTabSelectionChange, this, panel, _1, _2)); } mAppearanceTabs = getChild<LLTabContainer>("appearance_tabs"); mAppearanceTabs->setCommitCallback(boost::bind(&LLPanelOutfitsInventory::onTabChange, this)); mActivePanel = (LLInventoryPanel*)mAppearanceTabs->getCurrentPanel(); }
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); }
void LLPanelMarketplaceListings::onViewSortMenuItemClicked(const LLSD& userdata) { std::string chosen_item = userdata.asString(); // Sort options if ((chosen_item == "sort_by_stock_amount") || (chosen_item == "sort_by_name") || (chosen_item == "sort_by_recent")) { // We're making sort options exclusive, default is SO_FOLDERS_BY_NAME if (chosen_item == "sort_by_stock_amount") { setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_WEIGHT); } else if (chosen_item == "sort_by_name") { setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME); } else if (chosen_item == "sort_by_recent") { setSortOrder(LLInventoryFilter::SO_DATE); } } // Filter option else if (chosen_item == "show_only_listing_folders") { mFilterListingFoldersOnly = !mFilterListingFoldersOnly; // Set each panel with that filter flag LLTabContainer* tabs_panel = getChild<LLTabContainer>("marketplace_filter_tabs"); LLInventoryPanel* panel = (LLInventoryPanel*)tabs_panel->getPanelByName("All Items"); panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Active Items"); panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Inactive Items"); panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); panel = (LLInventoryPanel*)tabs_panel->getPanelByName("Unassociated Items"); panel->getFilter().setFilterMarketplaceListingFolders(mFilterListingFoldersOnly); } }
// virtual BOOL LLFloaterTexturePicker::postBuild() { LLFloater::postBuild(); // <dogmode> /** LLInventoryItem* itemp = gInventory.getItem(mImageAssetID); if (itemp && (itemp->getPermissions().getMaskOwner() & PERM_ALL)) childSetValue("texture_uuid", mImageAssetID); else childSetValue("texture_uuid", LLUUID::null.asString()); **/ if (!mLabel.empty()) { std::string pick = getString("pick title"); setTitle(pick + mLabel); } mTentativeLabel = getChild<LLTextBox>("Multiple"); mResolutionLabel = getChild<LLTextBox>("unknown"); childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); childSetAction("Alpha", LLFloaterTexturePicker::onBtnAlpha,this); childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); childSetAction("Invisible", LLFloaterTexturePicker::onBtnInvisible,this); // tag: vaa emerald local_asset_browser [begin] // childSetAction("Local", LLFloaterTexturePicker::onBtnLocal, this); // childSetAction("Server", LLFloaterTexturePicker::onBtnServer, this); childSetAction("Add", LLFloaterTexturePicker::onBtnAdd, this); childSetAction("Remove", LLFloaterTexturePicker::onBtnRemove, this); childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this); mLocalScrollCtrl = getChild<LLScrollListCtrl>("local_name_list"); mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this)); LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl ); // tag: vaa emerald local_asset_browser [end] childSetCommitCallback("show_folders_check", onShowFolders, this); getChildView("show_folders_check")->setVisible( FALSE); mFilterEdit = getChild<LLFilterEditor>("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); if(mInventoryPanel) { U32 filter_types = 0x0; filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; mInventoryPanel->setFilterTypes(filter_types); //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mInventoryPanel->setAllowMultiSelect(FALSE); // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); // Commented out to scroll to currently selected texture. See EXT-5403. // // store this filter as the default one // mInventoryPanel->getRootFolder()->getFilter()->markDefault(); // Commented out to stop opening all folders with textures // mInventoryPanel->openDefaultFolderForType(LLAssetType::AT_TEXTURE); // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); } mNoCopyTextureSelected = FALSE; getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); if (!mCanApplyImmediately) { getChildView("show_folders_check")->setEnabled(FALSE); } getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); childSetAction("ApplyUUID", LLFloaterTexturePicker::onBtnUUID,this); childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); mFilterEdit->setFocus(true); // update permission filter once UI is fully initialized updateFilterPermMask(); LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); return TRUE; }
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { LLInventoryPanel *panel = mPtr; LLInventoryModel* model = panel->getModel(); if(!model) return true; std::set<LLUUID> selected_items; panel->getRootFolder()->getSelectionList(selected_items); std::string name; static int session_num = 1; LLDynamicArray<LLUUID> members; EInstantMessage type = IM_SESSION_CONFERENCE_START; std::set<LLUUID>::const_iterator iter; for (iter = selected_items.begin(); iter != selected_items.end(); iter++) { LLUUID item = *iter; LLFolderViewItem* folder_item = panel->getRootFolder()->getItemByID(item); if(folder_item) { LLFolderViewEventListener* fve_listener = folder_item->getListener(); if (fve_listener && (fve_listener->getInventoryType() == LLInventoryType::IT_CATEGORY)) { LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getListener(); if(!bridge) return true; LLViewerInventoryCategory* cat = bridge->getCategory(); if(!cat) return true; name = cat->getName(); LLUniqueBuddyCollector is_buddy; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; model->collectDescendentsIf(bridge->getUUID(), cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, is_buddy); S32 count = item_array.count(); if(count > 0) { // create the session gIMMgr->setFloaterOpen(TRUE); S32 i; LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id; for(i = 0; i < count; ++i) { id = item_array.get(i)->getCreatorUUID(); if(at.isBuddyOnline(id)) { members.put(id); } } } } else { LLFolderViewItem* folder_item = panel->getRootFolder()->getItemByID(item); if(!folder_item) return true; LLInvFVBridge* listenerp = (LLInvFVBridge*)folder_item->getListener(); if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD) { LLInventoryItem* inv_item = gInventory.getItem(listenerp->getUUID()); if (inv_item) { LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id = inv_item->getCreatorUUID(); if(at.isBuddyOnline(id)) { members.put(id); } } } //if IT_CALLINGCARD } //if !IT_CATEGORY } } //for selected_items // the session_id is randomly generated UUID which will be replaced later // with a server side generated number if (name.empty()) { name = llformat("Session %d", session_num++); } gIMMgr->addSession( name, type, members[0], members); return true; }
bool LLPanelMarketplaceListings::allowDropOnRoot() { LLInventoryPanel* panel = (LLInventoryPanel*)getChild<LLTabContainer>("marketplace_filter_tabs")->getCurrentPanel(); return (panel ? panel->getAllowDropOnRoot() : false); }
bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) { LLInventoryPanel *panel = mPtr; LLInventoryModel* model = panel->getModel(); if(!model) return true; std::set<LLUUID> selected_items = panel->getRootFolder()->getSelectionList(); std::string name; static int session_num = 1; std::vector<LLUUID> members; EInstantMessage type = IM_SESSION_CONFERENCE_START; // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) bool fRlvCanStartIM = true; // [/RLVa:KB] for (std::set<LLUUID>::const_iterator iter = selected_items.begin(); iter != selected_items.end(); iter++) { LLUUID item = *iter; LLFolderViewItem* folder_item = panel->getRootFolder()->getItemByID(item); if(folder_item) { LLFolderViewEventListener* fve_listener = folder_item->getListener(); if (fve_listener && (fve_listener->getInventoryType() == LLInventoryType::IT_CATEGORY)) { LLFolderBridge* bridge = (LLFolderBridge*)folder_item->getListener(); if(!bridge) return true; LLViewerInventoryCategory* cat = bridge->getCategory(); if(!cat) return true; name = cat->getName(); LLUniqueBuddyCollector is_buddy; LLInventoryModel::cat_array_t cat_array; LLInventoryModel::item_array_t item_array; model->collectDescendentsIf(bridge->getUUID(), cat_array, item_array, LLInventoryModel::EXCLUDE_TRASH, is_buddy); S32 count = item_array.size(); if(count > 0) { // create the session gIMMgr->setFloaterOpen(TRUE); LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id; for(S32 i = 0; i < count; ++i) { id = item_array.at(i)->getCreatorUUID(); if(at.isBuddyOnline(id)) { // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) fRlvCanStartIM &= RlvActions::canStartIM(id); // [RLVa:KB] members.push_back(id); } } } } else { LLFolderViewItem* folder_item = panel->getRootFolder()->getItemByID(item); if(!folder_item) return true; LLInvFVBridge* listenerp = (LLInvFVBridge*)folder_item->getListener(); if (listenerp->getInventoryType() == LLInventoryType::IT_CALLINGCARD) { LLInventoryItem* inv_item = gInventory.getItem(listenerp->getUUID()); if (inv_item) { LLAvatarTracker& at = LLAvatarTracker::instance(); LLUUID id = inv_item->getCreatorUUID(); if(at.isBuddyOnline(id)) { // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) fRlvCanStartIM &= RlvActions::canStartIM(id); // [RLVa:KB] members.push_back(id); } } } //if IT_CALLINGCARD } //if !IT_CATEGORY } } //for selected_items // the session_id is randomly generated UUID which will be replaced later // with a server side generated number // [RLVa:KB] - Checked: 2013-05-08 (RLVa-1.4.9) if (!fRlvCanStartIM) { make_ui_sound("UISndIvalidOp"); RlvUtil::notifyBlocked(RLV_STRING_BLOCKED_STARTCONF); return true; } // [/RLVa:KB] if (name.empty()) { name = llformat("Session %d", session_num++); } gIMMgr->addSession( name, type, members[0], members); return true; }
void on_new_single_inventory_upload_complete( LLAssetType::EType asset_type, LLInventoryType::EType inventory_type, const std::string inventory_type_string, const LLUUID& item_folder_id, const std::string& item_name, const std::string& item_description, const LLSD& server_response, S32 upload_price) { bool success = false; if ( upload_price > 0 ) { // this upload costed us L$, update our balance // and display something saying that it cost L$ LLStatusBar::sendMoneyBalanceRequest(); std::string type_currency = LLGridManager::getInstance()->getCurrency(); LLSD args; args["AMOUNT"] = llformat("%d", upload_price); args["CUR"] = type_currency; LLNotificationsUtil::add("UploadPayment", args); } if( item_folder_id.notNull() ) { U32 everyone_perms = PERM_NONE; U32 group_perms = PERM_NONE; U32 next_owner_perms = PERM_ALL; if( server_response.has("new_next_owner_mask") ) { // The server provided creation perms so use them. // Do not assume we got the perms we asked for in // since the server may not have granted them all. everyone_perms = server_response["new_everyone_mask"].asInteger(); group_perms = server_response["new_group_mask"].asInteger(); next_owner_perms = server_response["new_next_owner_mask"].asInteger(); } else { // The server doesn't provide creation perms // so use old assumption-based perms. if( inventory_type_string != "snapshot") { next_owner_perms = PERM_MOVE | PERM_TRANSFER; } } LLPermissions new_perms; new_perms.init( gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); new_perms.initMasks( PERM_ALL, PERM_ALL, everyone_perms, group_perms, next_owner_perms); U32 inventory_item_flags = 0; if (server_response.has("inventory_flags")) { inventory_item_flags = (U32) server_response["inventory_flags"].asInteger(); if (inventory_item_flags != 0) { llinfos << "inventory_item_flags " << inventory_item_flags << llendl; } } S32 creation_date_now = time_corrected(); LLPointer<LLViewerInventoryItem> item = new LLViewerInventoryItem( server_response["new_inventory_item"].asUUID(), item_folder_id, new_perms, server_response["new_asset"].asUUID(), asset_type, inventory_type, item_name, item_description, LLSaleInfo::DEFAULT, inventory_item_flags, creation_date_now); gInventory.updateItem(item); gInventory.notifyObservers(); success = true; // Show the preview panel for textures and sounds to let // user know that the image (or snapshot) arrived intact. LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(); if ( panel ) { LLFocusableElement* focus = gFocusMgr.getKeyboardFocus(); panel->setSelection( server_response["new_inventory_item"].asUUID(), TAKE_FOCUS_NO); // restore keyboard focus gFocusMgr.setKeyboardFocus(focus); } } else { llwarns << "Can't find a folder to put it in" << llendl; } // remove the "Uploading..." message LLUploadDialog::modalUploadFinished(); // Let the Snapshot floater know we have finished uploading a snapshot to inventory. LLFloater* floater_snapshot = LLFloaterReg::findInstance("snapshot"); if (asset_type == LLAssetType::AT_TEXTURE && floater_snapshot) { floater_snapshot->notify(LLSD().with("set-finished", LLSD().with("ok", success).with("msg", "inventory"))); } }
// virtual void LLFloaterTexturePicker::draw() { S32 floater_header_size = getHeaderHeight(); if (mOwner) { // draw cone of context pointing back to texture swatch LLRect owner_rect; mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); LLRect local_rect = getLocalRect(); if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); gGL.begin(LLRender::QUADS); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.vertex2i(local_rect.mRight, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); } gGL.end(); } } if (gFocusMgr.childHasMouseCapture(getDragHandle())) { mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); getChildView("Select")->setEnabled(mActive); getChildView("Pipette")->setEnabled(mActive); getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //BOOL allow_copy = FALSE; if( mOwner ) { mTexturep = NULL; if(mImageAssetID.notNull()) { mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES); mTexturep->setBoostLevel(LLViewerTexture::BOOST_PREVIEW); } if (mTentativeLabel) { mTentativeLabel->setVisible( FALSE ); } getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID ); getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); LLFloater::draw(); if( isMinimized() ) { return; } // Border LLRect border( BORDER_PAD, getRect().getHeight() - floater_header_size - BORDER_PAD, ((getMinWidth() / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD, BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - getMinHeight())); gl_rect_2d( border, LLColor4::black, FALSE ); // Interior LLRect interior = border; interior.stretch( -1 ); // If the floater is focused, don't apply its alpha to the texture (STORM-677). const F32 alpha = getTransparencyType() == TT_ACTIVE ? 1.0f : getCurrentTransparency(); if( mTexturep ) { if( mTexturep->getComponents() == 4 ) { gl_rect_2d_checkerboard( interior, alpha ); } gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep, UI_VERTEX_COLOR % alpha ); // Pump the priority mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); } else if (!mFallbackImage.isNull()) { mFallbackImage->draw(interior, UI_VERTEX_COLOR % alpha); } else { gl_rect_2d( interior, LLColor4::grey % alpha, TRUE ); // Draw X gl_draw_x(interior, LLColor4::black ); } // Draw Tentative Label over the image if( mOwner->getTentative() && !mViewModel->isDirty() ) { mTentativeLabel->setVisible( TRUE ); drawChild(mTentativeLabel); } if (mSelectedItemPinned) return; LLFolderView* folder_view = mInventoryPanel->getRootFolder(); if (!folder_view) return; LLInventoryFilter* filter = folder_view->getFilter(); if (!filter) return; bool is_filter_active = folder_view->getCompletedFilterGeneration() < filter->getCurrentGeneration() && filter->isNotDefault(); // After inventory panel filter is applied we have to update // constraint rect for the selected item because of folder view // AutoSelectOverride set to TRUE. We force PinningSelectedItem // flag to FALSE state and setting filter "dirty" to update // scroll container to show selected item (see LLFolderView::doIdle()). if (!is_filter_active && !mSelectedItemPinned) { folder_view->setPinningSelectedItem(mSelectedItemPinned); folder_view->dirtyFilter(); folder_view->arrangeFromRoot(); mSelectedItemPinned = TRUE; } } }
// virtual BOOL LLFloaterTexturePicker::postBuild() { LLFloater::postBuild(); if (!mLabel.empty()) { std::string pick = getString("pick title"); setTitle(pick + mLabel); } mTentativeLabel = getChild<LLTextBox>("Multiple"); mResolutionLabel = getChild<LLTextBox>("unknown"); childSetAction("Default",LLFloaterTexturePicker::onBtnSetToDefault,this); childSetAction("None", LLFloaterTexturePicker::onBtnNone,this); childSetAction("Blank", LLFloaterTexturePicker::onBtnWhite,this); childSetCommitCallback("show_folders_check", onShowFolders, this); getChildView("show_folders_check")->setVisible( FALSE); mFilterEdit = getChild<LLFilterEditor>("inventory search editor"); mFilterEdit->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onFilterEdit, this, _2)); mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); if(mInventoryPanel) { U32 filter_types = 0x0; filter_types |= 0x1 << LLInventoryType::IT_TEXTURE; filter_types |= 0x1 << LLInventoryType::IT_SNAPSHOT; mInventoryPanel->setFilterTypes(filter_types); //mInventoryPanel->setFilterPermMask(getFilterPermMask()); //Commented out due to no-copy texture loss. mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); // Commented out to scroll to currently selected texture. See EXT-5403. // // store this filter as the default one // mInventoryPanel->getRootFolder()->getFilter()->markDefault(); // Commented out to stop opening all folders with textures // mInventoryPanel->openDefaultFolderForType(LLFolderType::FT_TEXTURE); // don't put keyboard focus on selected item, because the selection callback // will assume that this was user input mInventoryPanel->setSelection(findItemID(mImageAssetID, FALSE), TAKE_FOCUS_NO); } mNoCopyTextureSelected = FALSE; getChild<LLUICtrl>("apply_immediate_check")->setValue(gSavedSettings.getBOOL("ApplyTextureImmediately")); childSetCommitCallback("apply_immediate_check", onApplyImmediateCheck, this); if (!mCanApplyImmediately) { getChildView("show_folders_check")->setEnabled(FALSE); } getChild<LLUICtrl>("Pipette")->setCommitCallback( boost::bind(&LLFloaterTexturePicker::onBtnPipette, this)); childSetAction("Cancel", LLFloaterTexturePicker::onBtnCancel,this); childSetAction("Select", LLFloaterTexturePicker::onBtnSelect,this); // update permission filter once UI is fully initialized updateFilterPermMask(); mSavedFolderState.setApply(FALSE); LLToolPipette::getInstance()->setToolSelectCallback(boost::bind(&LLFloaterTexturePicker::onTextureSelect, this, _1)); return TRUE; }
// virtual void LLFloaterTexturePicker::draw() { if (mOwner) { // draw cone of context pointing back to texture swatch LLRect owner_rect; mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); LLRect local_rect = getLocalRect(); if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); gGL.begin(LLRender::QUADS); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.vertex2i(local_rect.mRight, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); } gGL.end(); } } if (gFocusMgr.childHasMouseCapture(getDragHandle())) { mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } else { mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLCriticalDamp::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox childSetEnabled("show_folders_check", mActive && mCanApplyImmediately && !mNoCopyTextureSelected); childSetEnabled("Select", mActive); childSetEnabled("Pipette", mActive); childSetValue("Pipette", LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //RN: reset search bar to reflect actual search query (all caps, for example) mSearchEdit->setText(mInventoryPanel->getFilterSubString()); //BOOL allow_copy = FALSE; if( mOwner ) { mTexturep = NULL; if(mImageAssetID.notNull()) { mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, MIPMAP_YES, LLViewerTexture::BOOST_PREVIEW); } else if (!mFallbackImageName.empty()) { mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, MIPMAP_YES, LLViewerTexture::BOOST_PREVIEW); } if (mTentativeLabel) { mTentativeLabel->setVisible( FALSE ); } childSetEnabled("Default", mImageAssetID != mOwner->getDefaultImageAssetID()); childSetEnabled("Blank", mImageAssetID != mWhiteImageAssetID ); childSetEnabled("Invisible", mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID ); childSetEnabled("Alpha", mImageAssetID != mAlphaImageAssetID ); LLFloater::draw(); if( isMinimized() ) { return; } // Border LLRect border( BORDER_PAD, getRect().getHeight() - LLFLOATER_HEADER_SIZE - BORDER_PAD, ((TEX_PICKER_MIN_WIDTH / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD, BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - TEX_PICKER_MIN_HEIGHT)); gl_rect_2d( border, LLColor4::black, FALSE ); // Interior LLRect interior = border; interior.stretch( -1 ); if( mTexturep ) { if( mTexturep->getComponents() == 4 ) { gl_rect_2d_checkerboard( interior ); } gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep ); // Pump the priority mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); // Draw Tentative Label over the image if( mOwner->getTentative() && !mIsDirty ) { mTentativeLabel->setVisible( TRUE ); drawChild(mTentativeLabel); } } else { gl_rect_2d( interior, LLColor4::grey, TRUE ); // Draw X gl_draw_x(interior, LLColor4::black ); } } }
void LLFloaterOutbox::updateView() { //updateView() is called twice the first time. updateFolderCount(); LLInventoryPanel* panel = mOutboxInventoryPanel.get(); if (mOutboxItemCount > 0) { panel->setVisible(TRUE); mInventoryPlaceholder->setVisible(FALSE); mOutboxTopLevelDropZone->setVisible(TRUE); } else { if (panel) { panel->setVisible(FALSE); } // Show the drop zone if there is an outbox folder mOutboxTopLevelDropZone->setVisible(mOutboxId.notNull()); mInventoryPlaceholder->setVisible(TRUE); std::string outbox_text; std::string outbox_text2; std::string outbox_title; std::string outbox_tooltip; const LLSD& subs = getMarketplaceStringSubstitutions(); U32 mkt_status = LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus(); // Text styles for marketplace hyperlinks std::string subs_link; std::string subs_text; if (mOutboxId.notNull()) { // Does the outbox needs recreation? if ((mOutboxInventoryPanel.get() == NULL) || !gInventory.getCategory(mOutboxId)) { setupOutbox(); } // "Outbox is empty!" message strings outbox_text = LLTrans::getString("InventoryOutboxNoItems"); subs_link = "[MARKETPLACE_DASHBOARD_URL]"; subs_text = " " + LLTrans::getString("InventoryOutboxNoItemsSubs"); outbox_text2 = LLTrans::getString("InventoryOutboxNoItems2"); outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip"); } else if (mkt_status <= MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING) { // "Initializing!" message strings outbox_text = LLTrans::getString("InventoryOutboxInitializing"); subs_link = "[MARKETPLACE_CREATE_STORE_URL]"; subs_text = " " + LLTrans::getString("InventoryOutboxInitializingSubs"); outbox_text2 = LLTrans::getString("InventoryOutboxInitializing2"); outbox_title = LLTrans::getString("InventoryOutboxInitializingTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxInitializingTooltip"); } else if (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT) { // "Not a merchant!" message strings outbox_text = LLTrans::getString("InventoryOutboxNotMerchant"); subs_link = "[MARKETPLACE_CREATE_STORE_URL]"; subs_text = " " + LLTrans::getString("InventoryOutboxNotMerchantSubs"); outbox_text2 = LLTrans::getString("InventoryOutboxNotMerchant2"); outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip"); } else { // "Errors!" message strings outbox_text = LLTrans::getString("InventoryOutboxError"); subs_link = "[MARKETPLACE_CREATE_STORE_URL]"; subs_text = " " + LLTrans::getString("InventoryOutboxErrorSubs"); outbox_text2 = " " + LLTrans::getString("InventoryOutboxError2"); outbox_title = LLTrans::getString("InventoryOutboxErrorTitle"); outbox_tooltip = LLTrans::getString("InventoryOutboxErrorTooltip"); } mInventoryText->clear(); const LLColor4 color = gColors.getColor("TextFgReadOnlyColor"); mInventoryText->appendColoredText(outbox_text, false, false, color); LLStringUtil::format(subs_link, subs); LLStyleSP subs_link_style(new LLStyle); subs_link_style->setLinkHREF(subs_link); subs_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor")); mInventoryText->appendStyledText(subs_text, false, false, subs_link_style); mInventoryText->appendColoredText(outbox_text2, false, false, color); mInventoryTitle->setValue(outbox_title); mInventoryPlaceholder->getParent()->setToolTip(outbox_tooltip); } }
// virtual void LLFloaterTexturePicker::draw() { if (mOwner) { // draw cone of context pointing back to texture swatch LLRect owner_rect; mOwner->localRectToOtherView(mOwner->getLocalRect(), &owner_rect, this); LLRect local_rect = getLocalRect(); if (gFocusMgr.childHasKeyboardFocus(this) && mOwner->isInVisibleChain() && mContextConeOpacity > 0.001f) { gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); LLGLEnable(GL_CULL_FACE); gGL.begin(LLRender::TRIANGLE_STRIP); { gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mRight, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mRight, owner_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mBottom); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_OUT_ALPHA * mContextConeOpacity); gGL.vertex2i(local_rect.mLeft, local_rect.mTop); gGL.color4f(0.f, 0.f, 0.f, CONTEXT_CONE_IN_ALPHA * mContextConeOpacity); gGL.vertex2i(owner_rect.mLeft, owner_rect.mTop); } gGL.end(); } } if (gFocusMgr.childHasMouseCapture(getDragHandle())) { mContextConeOpacity = lerp(mContextConeOpacity, gSavedSettings.getF32("PickerContextOpacity"), LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } else { mContextConeOpacity = lerp(mContextConeOpacity, 0.f, LLSmoothInterpolation::getInterpolant(CONTEXT_FADE_TIME)); } updateImageStats(); // if we're inactive, gray out "apply immediate" checkbox getChildView("show_folders_check")->setEnabled(mActive && mCanApplyImmediately && !mNoCopyTextureSelected); getChildView("Select")->setEnabled(mActive && mCanApply); getChildView("Pipette")->setEnabled(mActive); getChild<LLUICtrl>("Pipette")->setValue(LLToolMgr::getInstance()->getCurrentTool() == LLToolPipette::getInstance()); //RN: reset search bar to reflect actual search query (all caps, for example) mFilterEdit->setText(mInventoryPanel->getFilterSubString()); //BOOL allow_copy = FALSE; if( mOwner ) { mTexturep = NULL; if(mImageAssetID.notNull()) { mTexturep = LLViewerTextureManager::getFetchedTexture(mImageAssetID, FTT_DEFAULT, MIPMAP_YES, LLGLTexture::BOOST_PREVIEW); } else if (!mFallbackImageName.empty()) { mTexturep = LLViewerTextureManager::getFetchedTextureFromFile(mFallbackImageName, FTT_LOCAL_FILE, MIPMAP_YES, LLGLTexture::BOOST_PREVIEW); } if (mTentativeLabel) { mTentativeLabel->setVisible( FALSE ); } getChildView("Default")->setEnabled(mImageAssetID != mOwner->getDefaultImageAssetID()); getChildView("Blank")->setEnabled(mImageAssetID != mWhiteImageAssetID); getChildView("None")->setEnabled(mOwner->getAllowNoTexture() && !mImageAssetID.isNull() ); getChildView("Invisible")->setEnabled(mOwner->getAllowInvisibleTexture() && mImageAssetID != mInvisibleImageAssetID); getChildView("Alpha")->setEnabled(mImageAssetID != mAlphaImageAssetID); LLFloater::draw(); if( isMinimized() ) { return; } // Border LLRect border( BORDER_PAD, getRect().getHeight() - LLFLOATER_HEADER_SIZE - BORDER_PAD, ((TEX_PICKER_MIN_WIDTH / 2) - TEXTURE_INVENTORY_PADDING - HPAD) - BORDER_PAD, BORDER_PAD + FOOTER_HEIGHT + (getRect().getHeight() - TEX_PICKER_MIN_HEIGHT)); gl_rect_2d( border, LLColor4::black, FALSE ); // Interior LLRect interior = border; interior.stretch( -1 ); if( mTexturep ) { if( mTexturep->getComponents() == 4 ) { gl_rect_2d_checkerboard( calcScreenRect(), interior ); } gl_draw_scaled_image( interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep ); // Pump the priority mTexturep->addTextureStats( (F32)(interior.getWidth() * interior.getHeight()) ); // Draw Tentative Label over the image if( mOwner->getTentative() && !mIsDirty ) { mTentativeLabel->setVisible( TRUE ); drawChild(mTentativeLabel); } } else { gl_rect_2d( interior, LLColor4::grey, TRUE ); // Draw X gl_draw_x(interior, LLColor4::black ); } if (mSelectedItemPinned) return; LLFolderView* folder_view = mInventoryPanel->getRootFolder(); if (!folder_view) return; LLInventoryFilter* filter = folder_view->getFilter(); if (!filter) return; bool is_filter_active = folder_view->getCompletedFilterGeneration() < filter->getCurrentGeneration() && filter->isNotDefault(); // After inventory panel filter is applied we have to update // constraint rect for the selected item because of folder view // AutoSelectOverride set to TRUE. We force PinningSelectedItem // flag to FALSE state and setting filter "dirty" to update // scroll container to show selected item (see LLFolderView::doIdle()). if (!is_filter_active && !mSelectedItemPinned) { folder_view->setPinningSelectedItem(mSelectedItemPinned); folder_view->dirtyFilter(); folder_view->arrangeFromRoot(); mSelectedItemPinned = TRUE; } } }