void LLFloaterAuction::initialize() { mParcelUpdateCapUrl.clear(); mParcelp = LLViewerParcelMgr::getInstance()->getParcelSelection(); LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); LLParcel* parcelp = mParcelp->getParcel(); if(parcelp && region && !parcelp->getForSale()) { mParcelHost = region->getHost(); mParcelID = parcelp->getLocalID(); mParcelUpdateCapUrl = region->getCapability("ParcelPropertiesUpdate"); getChild<LLUICtrl>("parcel_text")->setValue(parcelp->getName()); getChildView("snapshot_btn")->setEnabled(TRUE); getChildView("reset_parcel_btn")->setEnabled(TRUE); getChildView("start_auction_btn")->setEnabled(TRUE); U32 estate_id = LLEstateInfoModel::instance().getID(); // Only enable "Sell to Anyone" on Teen grid or if we don't know the ID yet getChildView("sell_to_anyone_btn")->setEnabled(estate_id == ESTATE_TEEN || estate_id == 0); } else { mParcelHost.invalidate(); if(parcelp && parcelp->getForSale()) { getChild<LLUICtrl>("parcel_text")->setValue(getString("already for sale")); } else { getChild<LLUICtrl>("parcel_text")->setValue(LLStringUtil::null); } mParcelID = -1; getChildView("snapshot_btn")->setEnabled(false); getChildView("reset_parcel_btn")->setEnabled(false); getChildView("sell_to_anyone_btn")->setEnabled(false); getChildView("start_auction_btn")->setEnabled(false); } mImageID.setNull(); mImage = NULL; }
//private void LLPanelOutfitEdit::updateVerbs() { bool outfit_is_dirty = LLAppearanceMgr::getInstance()->isOutfitDirty(); bool outfit_locked = LLAppearanceMgr::getInstance()->isOutfitLocked(); bool has_baseoutfit = LLAppearanceMgr::getInstance()->getBaseOutfitUUID().notNull(); mSaveComboBtn->setSaveBtnEnabled(!outfit_locked && outfit_is_dirty); getChildView(REVERT_BTN)->setEnabled(outfit_is_dirty && has_baseoutfit); mSaveComboBtn->setMenuItemEnabled("save_outfit", !outfit_locked && outfit_is_dirty); mStatus->setText(outfit_is_dirty ? getString("unsaved_changes") : getString("now_editing")); updateCurrentOutfitName(); //updating state of "Wear Item" button previously known as "Plus" button updatePlusButton(); }
void LLPreview::refreshFromItem() { const LLInventoryItem* item = getItem(); if (!item) { return; } if (hasString("Title")) { LLStringUtil::format_map_t args; args["[NAME]"] = item->getName(); LLUIString title = getString("Title", args); setTitle(title.getString()); } getChild<LLUICtrl>("desc")->setValue(item->getDescription()); getChildView("desc")->setEnabled(canModify(mObjectUUID, item)); }
void LLChatBar::refresh() { // HACK: Leave the name of the gesture in place for a few seconds. const F32 SHOW_GESTURE_NAME_TIME = 2.f; if (mGestureLabelTimer.getStarted() && mGestureLabelTimer.getElapsedTimeF32() > SHOW_GESTURE_NAME_TIME) { LLCtrlListInterface* gestures = mGestureCombo ? mGestureCombo->getListInterface() : NULL; if (gestures) gestures->selectFirstItem(); mGestureLabelTimer.stop(); } if ((gAgent.getTypingTime() > AGENT_TYPING_TIMEOUT) && (gAgent.getRenderState() & AGENT_STATE_TYPING)) { gAgent.stopTyping(); } getChildView("Say")->setEnabled(mInputEditor->getText().size() > 0); }
void LLPreview::refreshFromItem() { const LLInventoryItem* item = getItem(); if (!item) { return; } if (hasString("Title")) { LLStringUtil::format_map_t args; args["[NAME]"] = item->getName(); LLUIString title = getString("Title", args); setTitle(title.getString()); } getChild<LLUICtrl>("desc")->setValue(item->getDescription()); BOOL can_agent_manipulate = item->getPermissions().allowModifyBy(gAgent.getID()); getChildView("desc")->setEnabled(can_agent_manipulate); }
// virtual void LLPreviewTexture::reshape(S32 width, S32 height, BOOL called_from_parent) { LLPreview::reshape(width, height, called_from_parent); LLRect dim_rect(getChildView("dimensions")->getRect()); S32 horiz_pad = 2 * (LLPANEL_BORDER_WIDTH + PREVIEW_PAD) + PREVIEW_RESIZE_HANDLE_SIZE; // add space for dimensions and aspect ratio S32 info_height = dim_rect.mTop + CLIENT_RECT_VPAD; LLRect client_rect(horiz_pad, getRect().getHeight(), getRect().getWidth() - horiz_pad, 0); client_rect.mTop -= (PREVIEW_HEADER_SIZE + CLIENT_RECT_VPAD); client_rect.mBottom += PREVIEW_BORDER + CLIENT_RECT_VPAD + info_height ; S32 client_width = client_rect.getWidth(); S32 client_height = client_rect.getHeight(); if (mAspectRatio > 0.f) { if(mAspectRatio > 1.f) { client_height = llceil((F32)client_width / mAspectRatio); if(client_height > client_rect.getHeight()) { client_height = client_rect.getHeight(); client_width = llceil((F32)client_height * mAspectRatio); } } else//mAspectRatio < 1.f { client_width = llceil((F32)client_height * mAspectRatio); if(client_width > client_rect.getWidth()) { client_width = client_rect.getWidth(); client_height = llceil((F32)client_width / mAspectRatio); } } } mClientRect.setLeftTopAndSize(client_rect.getCenterX() - (client_width / 2), client_rect.getCenterY() + (client_height / 2), client_width, client_height); }
void LLFloaterBuyCurrencyUI::draw() { if (mManager.process()) { if (mManager.bought()) { LLNotificationsUtil::add("BuyLindenDollarSuccess"); closeFloater(); return; } updateUI(); } // disable the Buy button when we are not able to buy getChildView("buy_btn")->setEnabled(mManager.canBuy()); LLFloater::draw(); }
void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type) { if(APT_CLASSIFIED_INFO == type) { LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); if(c_info && getClassifiedId() == c_info->classified_id) { // see LLPanelClassifiedEdit::sendUpdate() for notes mIsNewWithErrors = false; // for just created classified - panel will probably be closed when we get here. if(!getVisible()) { return; } enableEditing(true); setClassifiedName(c_info->name); setDescription(c_info->description); setSnapshotId(c_info->snapshot_id); setPosGlobal(c_info->pos_global); setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); // *HACK see LLPanelClassifiedEdit::sendUpdate() setCategory(c_info->category - 1); bool mature = is_cf_mature(c_info->flags); bool auto_renew = is_cf_auto_renew(c_info->flags); setContentType(mature ? CB_ITEM_MATURE : CB_ITEM_PG); getChild<LLUICtrl>("auto_renew")->setValue(auto_renew); getChild<LLUICtrl>("price_for_listing")->setValue(c_info->price_for_listing); getChildView("price_for_listing")->setEnabled(isNew()); resetDirty(); setInfoLoaded(true); enableVerbs(false); // for just created classified - in case user opened edit panel before processProperties() callback getChild<LLUICtrl>("save_changes_btn")->setLabelArg("[LABEL]", getString("save_label")); } } }
void LLFloaterAvatarPicker::onList() { getChildView("ok_btn")->setEnabled(isSelectBtnEnabled()); // [RLVa:KB] - Checked: 2010-06-05 (RLVa-1.2.2a) | Modified: RLVa-1.2.0d if (rlv_handler_t::isEnabled()) { LLTabContainer* pTabs = getChild<LLTabContainer>("ResidentChooserTabs"); LLPanel* pNearMePanel = getChild<LLPanel>("NearMePanel"); RLV_ASSERT( (pTabs) && (pNearMePanel) ); if ( (pTabs) && (pNearMePanel) ) { bool fRlvEnable = !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES); pTabs->enableTabButton(pTabs->getIndexForPanel(pNearMePanel), fRlvEnable); if ( (!fRlvEnable) && (pTabs->getCurrentPanel() == pNearMePanel) ) pTabs->selectTabByName("SearchPanel"); } } // [/RLVa:KB] }
void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { getChildView("hovered_icon")->setVisible( true); // AO, removed on-hover visibility. Don't do this. instead flip info buttons on full-time in postbuild. // mInfoBtn->setVisible(mShowInfoBtn); // mProfileBtn->setVisible(mShowProfileBtn); // [RLVa:KB] - Checked: 2010-04-05 (RLVa-1.2.2a) | Added: RLVa-1.2.0d //mInfoBtn->setVisible( (mShowInfoBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); //mProfileBtn->setVisible( (mShowProfileBtn) && ((!mRlvCheckShowNames) || (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES))) ); // [/RLVa:KB] mHovered = true; LLPanel::onMouseEnter(x, y, mask); // AO don't update these on-hover, because we want to give users instant feedback when they change a permission state, even if the // process takes n-seconds to complete. Hover-reprocessing can confuse the user if it takes place before the async permissions change // goes through, appearing to mysteriously erase the user's choice. // showPermissions(mShowPermissions && gSavedSettings.getBOOL("FriendsListShowPermissions")); updateChildren(); }
void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { LLPanelChatControlPanel::setSessionId(session_id); LLIMModel& im_model = LLIMModel::instance(); LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); mAvatarID = im_model.getOtherParticipantID(session_id); LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline if(LLAvatarActions::isFriend(mAvatarID)) { getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); } getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(mAvatarID); // Disable most profile buttons if the participant is // not really an SL avatar (e.g., an Avaline caller). LLIMModel::LLIMSession* im_session = im_model.findIMSession(session_id); if( im_session && !im_session->mOtherParticipantIsAvatar ) { getChildView("view_profile_btn")->setEnabled(FALSE); getChildView("add_friend_btn")->setEnabled(FALSE); getChildView("share_btn")->setEnabled(FALSE); getChildView("teleport_btn")->setEnabled(FALSE); getChildView("pay_btn")->setEnabled(FALSE); getChild<LLTextBox>("avatar_name")->setValue(im_session->mName); getChild<LLTextBox>("avatar_name")->setToolTip(im_session->mName); } else { // If the participant is an avatar, fetch the currect name gCacheName->get(mAvatarID, false, boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3)); } }
void LLPanelVoiceDeviceSettings::draw() { refresh(); // let user know that volume indicator is not yet available bool is_in_tuning_mode = LLVoiceClient::getInstance()->inTuningMode(); getChildView("wait_text")->setVisible( !is_in_tuning_mode && mUseTuningMode); LLPanel::draw(); if (is_in_tuning_mode) { const S32 num_bars = 5; F32 voice_power = LLVoiceClient::getInstance()->tuningGetEnergy() / LLVoiceClient::OVERDRIVEN_POWER_LEVEL; S32 discrete_power = llmin(num_bars, llfloor(voice_power * (F32)num_bars + 0.1f)); for(S32 power_bar_idx = 0; power_bar_idx < num_bars; power_bar_idx++) { std::string view_name = llformat("%s%d", "bar", power_bar_idx); LLView* bar_view = getChild<LLView>(view_name); if (bar_view) { gl_rect_2d(bar_view->getRect(), LLColor4::grey, TRUE); LLColor4 color; if (power_bar_idx < discrete_power) { color = (power_bar_idx >= 3) ? gSavedSettings.getColor4("OverdrivenColor") : gSavedSettings.getColor4("SpeakingColor"); } else { color = LLUI::sColorsGroup->getColor("FocusBackgroundColor"); } LLRect color_rect = bar_view->getRect(); color_rect.stretch(-1); gl_rect_2d(color_rect, color, TRUE); } } } }
BOOL LLPanelIMControlPanel::postBuild() { childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this)); childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this)); childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); childSetAction("mute_btn", boost::bind(&LLPanelIMControlPanel::onClickMuteVolume, this)); childSetAction("block_btn", boost::bind(&LLPanelIMControlPanel::onClickBlock, this)); childSetAction("unblock_btn", boost::bind(&LLPanelIMControlPanel::onClickUnblock, this)); getChild<LLUICtrl>("volume_slider")->setCommitCallback(boost::bind(&LLPanelIMControlPanel::onVolumeChange, this, _2)); getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); return LLPanelChatControlPanel::postBuild(); }
BOOL LLFloaterPostcard::postBuild() { // pick up the user's up-to-date email address gAgent.sendAgentUserInfoRequest(); childSetAction("cancel_btn", onClickCancel, this); childSetAction("send_btn", onClickSend, this); getChildView("from_form")->setEnabled(FALSE); std::string name_string; LLAgentUI::buildFullname(name_string); getChild<LLUICtrl>("name_form")->setValue(LLSD(name_string)); // For the first time a user focusess to .the msg box, all text will be selected. getChild<LLUICtrl>("msg_form")->setFocusChangedCallback(boost::bind(onMsgFormFocusRecieved, _1, this)); getChild<LLUICtrl>("to_form")->setFocus(TRUE); return TRUE; }
void LLOverlayBar::layoutButtons() { LLView* state_buttons_panel = getChildView("state_management_buttons_container"); if (state_buttons_panel->getVisible()) { U32 button_count = 0; const child_list_t& view_list = *(state_buttons_panel->getChildList()); BOOST_FOREACH(LLView* viewp, view_list) { if(!viewp->getEnabled()) continue; ++button_count; } const S32 MAX_BAR_WIDTH = 600; S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH); // calculate button widths const S32 MAX_BUTTON_WIDTH = 150; static LLCachedControl<S32> status_bar_pad("StatusBarPad",10); S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_count), 0, MAX_BUTTON_WIDTH); S32 btn_width = segment_width - status_bar_pad; // Evenly space all buttons, starting from left S32 left = 0; S32 bottom = 1; BOOST_REVERSE_FOREACH(LLView* viewp, view_list) { if(!viewp->getEnabled()) continue; LLRect r = viewp->getRect(); //if(dynamic_cast<LLButton*>(viewp)) // new_width = llclamp(new_width,0,MAX_BUTTON_WIDTH); r.setOriginAndSize(left, bottom, btn_width, r.getHeight()); viewp->setRect(r); left += segment_width; } }
BOOL LLFloaterURLEntry::postBuild() { mMediaURLEdit = getChild<LLComboBox>("media_entry"); // Cancel button childSetAction("cancel_btn", onBtnCancel, this); // Cancel button childSetAction("clear_btn", onBtnClear, this); // clear media list button LLSD parcel_history = LLURLHistory::getURLHistory("parcel"); bool enable_clear_button = parcel_history.size() > 0 ? true : false; getChildView("clear_btn")->setEnabled(enable_clear_button ); // OK button childSetAction("ok_btn", onBtnOK, this); setDefaultBtn("ok_btn"); buildURLHistory(); return TRUE; }
// virtual void LLFloaterEditSky::onOpen(const LLSD& key) { bool new_preset = isNewPreset(); std::string param = key.asString(); std::string floater_title = getString(std::string("title_") + param); std::string hint = getString(std::string("hint_" + param)); // Update floater title. setTitle(floater_title); // Update the hint at the top. getChild<LLUICtrl>("hint")->setValue(hint); // Hide the hint to the right of the combo if we're invoked to create a new preset. getChildView("note")->setVisible(!new_preset); // Switch between the sky presets combobox and preset name input field. mSkyPresetCombo->setVisible(!new_preset); mSkyPresetNameEditor->setVisible(new_preset); reset(); }
void LLPanelMyProfileEdit::processProfileProperties(const LLAvatarData* avatar_data) { fillCommonData(avatar_data); // 'Home page' was hidden in LLPanelAvatarProfile::fillCommonData() to fix EXT-4734 // Show 'Home page' in Edit My Profile (EXT-4873) getChildView("homepage_edit")->setVisible( true); fillPartnerData(avatar_data); fillAccountStatus(avatar_data); getChild<LLUICtrl>("show_in_search_checkbox")->setValue((BOOL)(avatar_data->flags & AVATAR_ALLOW_PUBLISH)); std::string first, last; BOOL found = gCacheName->getName(avatar_data->avatar_id, first, last); if (found) { getChild<LLUICtrl>("name_text")->setTextArg("[FIRST]", first); getChild<LLUICtrl>("name_text")->setTextArg("[LAST]", last); } }
void LLFloaterBuyCurrencyUI::draw() { if (mManager.process()) { if (mManager.bought()) { std::string type_currency = LLGridManager::getInstance()->getCurrency(); LLSD args; args["CUR"] = type_currency; LLNotificationsUtil::add("BuyLindenDollarSuccess", args); closeFloater(); return; } updateUI(); } // disable the Buy button when we are not able to buy getChildView("buy_btn")->setEnabled(mManager.canBuy()); LLFloater::draw(); }
void LLCallFloater::reset(const LLVoiceChannel::EState& new_state) { // lets forget states from the previous session // for timers... resetVoiceRemoveTimers(); // ...and for speaker state mSpeakerStateMap.clear(); delete mParticipants; mParticipants = NULL; mAvatarList->clear(); // These ifs were added instead of simply showing "loading" to make VCP work correctly in parcels // with disabled voice (EXT-4648 and EXT-4649) if (!LLViewerParcelMgr::getInstance()->allowAgentVoice() && LLVoiceChannel::STATE_HUNG_UP == new_state) { // hides "Leave Call" when call is ended in parcel with disabled voice- hiding usually happens in // updateSession() which won't be called here because connect to nearby voice never happens getChildView("leave_call_btn_panel")->setVisible( false); // setting title to nearby chat an "no one near..." text- because in region with disabled // voice we won't have chance to really connect to nearby, so VCP is changed here manually setTitle(getString("title_nearby")); mAvatarList->setNoItemsCommentText(getString("no_one_near")); } // "loading" is shown only when state is "ringing" to avoid showing it in nearby chat vcp // of parcels with disabled voice all the time- "no_one_near" is now shown there (EXT-4648) else if (new_state == LLVoiceChannel::STATE_RINGING) { // update floater to show Loading while waiting for data. mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData")); } mAvatarList->setVisible(TRUE); mNonAvatarCaller->setVisible(FALSE); mSpeakerManager = NULL; }
void LLPanelPicks::onOpen(const LLSD& key) { const LLUUID id(key.asUUID()); BOOL self = (gAgent.getID() == id); // only agent can edit her picks getChildView("edit_panel")->setEnabled(self); getChildView("edit_panel")->setVisible( self); // Disable buttons when viewing profile for first time if(getAvatarId() != id) { getChildView(XML_BTN_INFO)->setEnabled(FALSE); getChildView(XML_BTN_TELEPORT)->setEnabled(FALSE); getChildView(XML_BTN_SHOW_ON_MAP)->setEnabled(FALSE); } // and see a special title - set as invisible by default in xml file if (self) { getChildView("pick_title")->setVisible( !self); getChildView("pick_title_agent")->setVisible( self); mPopupMenu->setItemVisible("pick_delete", TRUE); mPopupMenu->setItemVisible("pick_edit", TRUE); mPopupMenu->setItemVisible("pick_separator", TRUE); } if(getAvatarId() != id) { showAccordion("tab_picks", false); showAccordion("tab_classifieds", false); mPicksList->goToTop(); // Set dummy value to make panel dirty and make it reload picks setValue(LLSD()); } LLPanelProfileTab::onOpen(key); }
bool LLFloaterURLEntry::callback_clear_url_list(const LLSD& notification, const LLSD& response) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if ( option == 0 ) // YES { // clear saved list LLCtrlListInterface* url_list = childGetListInterface("media_entry"); if ( url_list ) { url_list->operateOnAll( LLCtrlListInterface::OP_DELETE ); } // clear current contents of combo box mMediaURLEdit->clear(); // clear stored version of list LLURLHistory::clear("parcel"); // cleared the list so disable Clear button getChildView("clear_btn")->setEnabled(false ); } return false; }
BOOL FSFloaterTeleportHistory::postBuild() { mHistoryPanel = new LLTeleportHistoryPanel; if (mHistoryPanel) { mHistoryPanel->setIsStandAlone(true); mHistoryPanel->mTeleportBtn = getChild<LLButton>("teleport_btn"); mHistoryPanel->mShowOnMapBtn = getChild<LLButton>("map_btn"); mHistoryPanel->mShowProfile = getChild<LLButton>("profile_btn"); mHistoryPanel->mTeleportBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onTeleport, mHistoryPanel)); mHistoryPanel->mShowProfile->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowProfile, mHistoryPanel)); mHistoryPanel->mShowOnMapBtn->setClickedCallback(boost::bind(&LLTeleportHistoryPanel::onShowOnMap, mHistoryPanel)); mFilterEditor = getChild<LLFilterEditor>("Filter"); if (mFilterEditor) { //when list item is being clicked the filter editor looses focus //committing on focus lost leads to detaching list items //BUT a detached list item cannot be made selected and must not be clicked onto mFilterEditor->setCommitOnFocusLost(false); mFilterEditor->setCommitCallback(boost::bind(&FSFloaterTeleportHistory::onFilterEdit, this, _2, false)); } getChildView("history_placeholder")->addChild(mHistoryPanel); mHistoryPanel->onSearchEdit(""); } else { return FALSE; } return TRUE; }
void LLFloaterObjectIMInfo::update(const LLSD& data) { // Extract appropriate object information from input LLSD // (Eventually, it might be nice to query server for details // rather than require caller to pass in the information.) mName = data["name"].asString(); mOwnerID = data["owner_id"].asUUID(); mGroupOwned = data["group_owned"].asBoolean(); mSLurl = data["slurl"].asString(); // When talking to an old region we won't have a slurl. // The object id isn't really the object id either but we don't use it so who cares. //bool have_slurl = !slurl.empty(); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-04 (RLVa-1.0.0a) | Added: RLVa-0.2.0g bool have_slurl = (!mSLurl.empty()) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa:KB] childSetVisible("Unknown_Slurl",!have_slurl); childSetVisible("Slurl",have_slurl); childSetText("ObjectName",mName); std::string slurl(mSLurl); std::string::size_type i = slurl.rfind("?owner_not_object"); if (i != std::string::npos) slurl.erase(i) += getString("owner"); childSetText("Slurl", slurl); childSetText("OwnerName", LLStringUtil::null); getChildView("ObjectID")->setValue(data["object_id"].asUUID()); // bool my_object = (owner_id == gAgentID); // [RLVa:KB] - Version: 1.23.4 | Checked: 2009-07-08 (RLVa-1.0.0e) | Added: RLVa-0.2.0g bool my_object = (mOwnerID == gAgentID) || ((gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) && (RlvUtil::isNearbyAgent(mOwnerID))); // [/RLVa:KB] childSetEnabled("Mute",!my_object); if (gCacheName) gCacheName->get(mOwnerID, mGroupOwned, boost::bind(&LLFloaterObjectIMInfo::nameCallback, this, _2)); }
//virtual BOOL LLNearbyChatBar::postBuild() { mChatBox = getChild<LLLineEditor>("chat_box"); mChatBox->setCommitCallback(boost::bind(&LLNearbyChatBar::onChatBoxCommit, this)); mChatBox->setKeystrokeCallback(&onChatBoxKeystroke, this); mChatBox->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this)); mChatBox->setFocusReceivedCallback(boost::bind(&LLNearbyChatBar::onChatBoxFocusReceived, this)); mChatBox->setIgnoreArrowKeys( FALSE ); mChatBox->setCommitOnFocusLost( FALSE ); mChatBox->setRevertOnEsc( FALSE ); mChatBox->setIgnoreTab(TRUE); mChatBox->setPassDelete(TRUE); mChatBox->setReplaceNewlinesWithSpaces(FALSE); mChatBox->setEnableLineHistory(TRUE); mChatBox->setFont(LLViewerChat::getChatFont()); mNearbyChat = getChildView("nearby_chat"); LLUICtrl* show_btn = getChild<LLUICtrl>("show_nearby_chat"); show_btn->setCommitCallback(boost::bind(&LLNearbyChatBar::onToggleNearbyChatPanel, this)); mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); gSavedSettings.declareBOOL("nearbychat_history_visibility", mNearbyChat->getVisible(), "Visibility state of nearby chat history", TRUE); mNearbyChat->setVisible(gSavedSettings.getBOOL("nearbychat_history_visibility")); // Register for font change notifications LLViewerChat::setFontChangedCallback(boost::bind(&LLNearbyChatBar::onChatFontChange, this, _1)); enableResizeCtrls(true, true, false); return TRUE; }
void LLFloaterURLEntry::headerFetchComplete(U32 status, const std::string& mime_type) { LLPanelLandMedia* panel_media = dynamic_cast<LLPanelLandMedia*>(mPanelLandMediaHandle.get()); if (panel_media) { // status is ignored for now -- error = "none/none" panel_media->setMediaType(mime_type); panel_media->setMediaURL(mMediaURLEdit->getValue().asString()); } else { LLPanelFace* panel_face = dynamic_cast<LLPanelFace*>(mPanelLandMediaHandle.get()); if(panel_face) { panel_face->setMediaType(mime_type); panel_face->setMediaURL(mMediaURLEdit->getValue().asString()); } } // Decrement the cursor getWindow()->decBusyCount(); getChildView("loading_label")->setVisible( false); close(); }
void LLPanelMarketplaceInbox::draw() { U32 item_count = getTotalItemCount(); LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); if (item_count > 0) { std::string item_count_str = llformat("%d", item_count); LLStringUtil::format_map_t args; args["[NUM]"] = item_count_str; getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); #if SUPPORTING_FRESH_ITEM_COUNT // set green text to fresh item count U32 fresh_item_count = getFreshItemCount(); fresh_new_count_view->setVisible((fresh_item_count > 0)); if (fresh_item_count > 0) { getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); } #else fresh_new_count_view->setVisible(FALSE); #endif } else { getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); fresh_new_count_view->setVisible(FALSE); } LLPanel::draw(); }
void LLOverlayBar::layoutButtons() { LLView* state_buttons_panel = getChildView("state_buttons"); if (state_buttons_panel->getVisible()) { LLViewQuery query; LLWidgetTypeFilter<LLButton> widget_filter; query.addPreFilter(LLEnabledFilter::getInstance()); query.addPreFilter(&widget_filter); child_list_t button_list = query(state_buttons_panel); const S32 MAX_BAR_WIDTH = 600; S32 bar_width = llclamp(state_buttons_panel->getRect().getWidth(), 0, MAX_BAR_WIDTH); // calculate button widths const S32 MAX_BUTTON_WIDTH = 150; S32 segment_width = llclamp(lltrunc((F32)(bar_width) / (F32)button_list.size()), 0, MAX_BUTTON_WIDTH); S32 btn_width = segment_width - gSavedSettings.getS32("StatusBarPad"); // Evenly space all buttons, starting from left S32 left = 0; S32 bottom = 1; for (child_list_reverse_iter_t child_iter = button_list.rbegin(); child_iter != button_list.rend(); ++child_iter) { LLView *view = *child_iter; LLRect r = view->getRect(); r.setOriginAndSize(left, bottom, btn_width, r.getHeight()); view->setRect(r); left += segment_width; } } }
void LLFloaterWorldMap::onChangeMaturity() { bool can_access_mature = gAgent.canAccessMature(); bool can_access_adult = gAgent.canAccessAdult(); getChildView("events_mature_icon")->setVisible( can_access_mature); getChildView("events_mature_label")->setVisible( can_access_mature); getChildView("events_mature_chk")->setVisible( can_access_mature); getChildView("events_adult_icon")->setVisible( can_access_adult); getChildView("events_adult_label")->setVisible( can_access_adult); getChildView("events_adult_chk")->setVisible( can_access_adult); // disable mature / adult events. if (!can_access_mature) { gSavedSettings.setBOOL("ShowMatureEvents", FALSE); } if (!can_access_adult) { gSavedSettings.setBOOL("ShowAdultEvents", FALSE); } }
void LLPanelFace::getState() { LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); if( objectp && objectp->getPCode() == LL_PCODE_VOLUME && objectp->permModify()) { BOOL editable = objectp->permModify() && !objectp->isPermanentEnforced(); // only turn on auto-adjust button if there is a media renderer and the media is loaded getChildView("textbox autofix")->setEnabled(editable); getChildView("button align")->setEnabled(editable); //if ( LLMediaEngine::getInstance()->getMediaRenderer () ) // if ( LLMediaEngine::getInstance()->getMediaRenderer ()->isLoaded () ) // { // // //mLabelTexAutoFix->setEnabled ( editable ); // // //mBtnAutoFix->setEnabled ( editable ); // } S32 selected_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); BOOL single_volume = (LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME )) && (selected_count == 1); getChildView("copytextures")->setEnabled(single_volume && editable); getChildView("pastetextures")->setEnabled(editable); getChildView("textbox params")->setEnabled(single_volume && editable); getChildView("button apply")->setEnabled(editable); bool identical; LLTextureCtrl* texture_ctrl = getChild<LLTextureCtrl>("texture control"); // Texture { LLUUID id; struct f1 : public LLSelectedTEGetFunctor<LLUUID> { LLUUID get(LLViewerObject* object, S32 te_index) { LLUUID id; LLViewerTexture* image = object->getTEImage(te_index); if (image) id = image->getID(); if (!id.isNull() && LLViewerMedia::textureHasMedia(id)) { LLTextureEntry *te = object->getTE(te_index); if (te) { LLViewerTexture* tex = te->getID().notNull() ? gTextureList.findImage(te->getID()) : NULL ; if(!tex) { tex = LLViewerFetchedTexture::sDefaultImagep; } if (tex) { id = tex->getID(); } } } return id; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, id ); if(LLViewerMedia::textureHasMedia(id)) { getChildView("textbox autofix")->setEnabled(editable); getChildView("button align")->setEnabled(editable); } if (identical) { // All selected have the same texture if(texture_ctrl) { texture_ctrl->setTentative( FALSE ); texture_ctrl->setEnabled( editable ); texture_ctrl->setImageAssetID( id ); } } else { if(texture_ctrl) { if( id.isNull() ) { // None selected texture_ctrl->setTentative( FALSE ); texture_ctrl->setEnabled( FALSE ); texture_ctrl->setImageAssetID( LLUUID::null ); } else { // Tentative: multiple selected with different textures texture_ctrl->setTentative( TRUE ); texture_ctrl->setEnabled( editable ); texture_ctrl->setImageAssetID( id ); } } } } // planar align bool align_planar = false; bool identical_planar_aligned = false; bool is_planar = false; { LLCheckBoxCtrl* cb_planar_align = getChild<LLCheckBoxCtrl>("checkbox planar align"); align_planar = (cb_planar_align && cb_planar_align->get()); struct f1 : public LLSelectedTEGetFunctor<bool> { bool get(LLViewerObject* object, S32 face) { return (object->getTE(face)->getTexGen() == LLTextureEntry::TEX_GEN_PLANAR); } } func; bool texgens_identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, is_planar ); bool enabled = (editable && texgens_identical && is_planar); childSetValue("checkbox planar align", align_planar && enabled); childSetEnabled("checkbox planar align", enabled); if (align_planar && enabled) { struct f2 : public LLSelectedTEGetFunctor<LLFace *> { LLFace* get(LLViewerObject* object, S32 te) { return (object->mDrawable) ? object->mDrawable->getFace(te): NULL; } } get_te_face_func; LLFace* last_face; LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue(&get_te_face_func, last_face); LLPanelFaceGetIsAlignedTEFunctor get_is_aligend_func(last_face); // this will determine if the texture param controls are tentative: identical_planar_aligned = LLSelectMgr::getInstance()->getSelection()->applyToTEs(&get_is_aligend_func); } } // Texture scale { F32 scale_s = 1.f; struct f2 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->mScaleS; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_s ); identical = align_planar ? identical_planar_aligned : identical; getChild<LLUICtrl>("TexScaleU")->setValue(editable ? llabs(scale_s) : 0); getChild<LLUICtrl>("TexScaleU")->setTentative(LLSD((BOOL)(!identical))); getChildView("TexScaleU")->setEnabled(editable); getChild<LLUICtrl>("checkbox flip s")->setValue(LLSD((BOOL)(scale_s < 0 ? TRUE : FALSE ))); getChild<LLUICtrl>("checkbox flip s")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); getChildView("checkbox flip s")->setEnabled(editable); } { F32 scale_t = 1.f; struct f3 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->mScaleT; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, scale_t ); identical = align_planar ? identical_planar_aligned : identical; getChild<LLUICtrl>("TexScaleV")->setValue(llabs(editable ? llabs(scale_t) : 0)); getChild<LLUICtrl>("TexScaleV")->setTentative(LLSD((BOOL)(!identical))); getChildView("TexScaleV")->setEnabled(editable); getChild<LLUICtrl>("checkbox flip t")->setValue(LLSD((BOOL)(scale_t< 0 ? TRUE : FALSE ))); getChild<LLUICtrl>("checkbox flip t")->setTentative(LLSD((BOOL)((!identical) ? TRUE : FALSE ))); getChildView("checkbox flip t")->setEnabled(editable); } // Texture offset { getChildView("tex offset")->setEnabled(editable); F32 offset_s = 0.f; struct f4 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->mOffsetS; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_s ); identical = align_planar ? identical_planar_aligned : identical; getChild<LLUICtrl>("TexOffsetU")->setValue(editable ? offset_s : 0); getChild<LLUICtrl>("TexOffsetU")->setTentative(!identical); getChildView("TexOffsetU")->setEnabled(editable); } { F32 offset_t = 0.f; struct f5 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->mOffsetT; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, offset_t ); identical = align_planar ? identical_planar_aligned : identical; getChild<LLUICtrl>("TexOffsetV")->setValue(editable ? offset_t : 0); getChild<LLUICtrl>("TexOffsetV")->setTentative(!identical); getChildView("TexOffsetV")->setEnabled(editable); } // Texture rotation { F32 rotation = 0.f; struct f6 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->mRotation; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, rotation ); identical = align_planar ? identical_planar_aligned : identical; getChild<LLUICtrl>("TexRot")->setValue(editable ? rotation * RAD_TO_DEG : 0); getChild<LLUICtrl>("TexRot")->setTentative(!identical); getChildView("TexRot")->setEnabled(editable); } // Color swatch LLColorSwatchCtrl* mColorSwatch = getChild<LLColorSwatchCtrl>("colorswatch"); LLColor4 color = LLColor4::white; if(mColorSwatch) { struct f7 : public LLSelectedTEGetFunctor<LLColor4> { LLColor4 get(LLViewerObject* object, S32 face) { return object->getTE(face)->getColor(); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, color ); mColorSwatch->setOriginal(color); mColorSwatch->set(color, TRUE); mColorSwatch->setValid(editable); mColorSwatch->setEnabled( editable ); mColorSwatch->setCanApplyImmediately( editable ); } // Color transparency { getChildView("color trans")->setEnabled(editable); } F32 transparency = (1.f - color.mV[VALPHA]) * 100.f; { getChild<LLUICtrl>("ColorTrans")->setValue(editable ? transparency : 0); getChildView("ColorTrans")->setEnabled(editable); } { F32 glow = 0.f; struct f8 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return object->getTE(face)->getGlow(); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, glow ); getChild<LLUICtrl>("glow")->setValue(glow); getChildView("glow")->setEnabled(editable); getChild<LLUICtrl>("glow")->setTentative(!identical); getChildView("glow label")->setEnabled(editable); } // Bump { F32 shinyf = 0.f; struct f9 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return (F32)(object->getTE(face)->getShiny()); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, shinyf ); LLCtrlSelectionInterface* combobox_shininess = childGetSelectionInterface("combobox shininess"); if (combobox_shininess) { combobox_shininess->selectNthItem((S32)shinyf); } else { llwarns << "failed childGetSelectionInterface for 'combobox shininess'" << llendl; } getChildView("combobox shininess")->setEnabled(editable); getChild<LLUICtrl>("combobox shininess")->setTentative(!identical); getChildView("label shininess")->setEnabled(editable); } { F32 bumpf = 0.f; struct f10 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return (F32)(object->getTE(face)->getBumpmap()); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, bumpf ); LLCtrlSelectionInterface* combobox_bumpiness = childGetSelectionInterface("combobox bumpiness"); if (combobox_bumpiness) { combobox_bumpiness->selectNthItem((S32)bumpf); } else { llwarns << "failed childGetSelectionInterface for 'combobox bumpiness'" << llendl; } getChildView("combobox bumpiness")->setEnabled(editable); getChild<LLUICtrl>("combobox bumpiness")->setTentative(!identical); getChildView("label bumpiness")->setEnabled(editable); } { F32 genf = 0.f; struct f11 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return (F32)(object->getTE(face)->getTexGen()); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, genf ); S32 selected_texgen = ((S32) genf) >> TEM_TEX_GEN_SHIFT; LLCtrlSelectionInterface* combobox_texgen = childGetSelectionInterface("combobox texgen"); if (combobox_texgen) { combobox_texgen->selectNthItem(selected_texgen); } else { llwarns << "failed childGetSelectionInterface for 'combobox texgen'" << llendl; } getChildView("combobox texgen")->setEnabled(editable); getChild<LLUICtrl>("combobox texgen")->setTentative(!identical); getChildView("tex gen")->setEnabled(editable); if (selected_texgen == 1) { getChild<LLUICtrl>("TexScaleU")->setValue(2.0f * getChild<LLUICtrl>("TexScaleU")->getValue().asReal() ); getChild<LLUICtrl>("TexScaleV")->setValue(2.0f * getChild<LLUICtrl>("TexScaleV")->getValue().asReal() ); // EXP-1507 (change label based on the mapping mode) getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per meter")); } else if (selected_texgen == 0) // FIXME: should not be magic numbers { getChild<LLUICtrl>("rpt")->setValue(getString("string repeats per face")); } } { F32 fullbrightf = 0.f; struct f12 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { return (F32)(object->getTE(face)->getFullbright()); } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, fullbrightf ); getChild<LLUICtrl>("checkbox fullbright")->setValue((S32)fullbrightf); getChildView("checkbox fullbright")->setEnabled(editable); getChild<LLUICtrl>("checkbox fullbright")->setTentative(!identical); } // Repeats per meter label { getChildView("rpt")->setEnabled(editable); } // Repeats per meter { F32 repeats = 1.f; struct f13 : public LLSelectedTEGetFunctor<F32> { F32 get(LLViewerObject* object, S32 face) { U32 s_axis = VX; U32 t_axis = VY; // BUG: Only repeats along S axis // BUG: Only works for boxes. LLPrimitive::getTESTAxes(face, &s_axis, &t_axis); return object->getTE(face)->mScaleS / object->getScale().mV[s_axis]; } } func; identical = LLSelectMgr::getInstance()->getSelection()->getSelectedTEValue( &func, repeats ); getChild<LLUICtrl>("rptctrl")->setValue(editable ? repeats : 0); getChild<LLUICtrl>("rptctrl")->setTentative(!identical); LLComboBox* mComboTexGen = getChild<LLComboBox>("combobox texgen"); if (mComboTexGen) { BOOL enabled = editable && (!mComboTexGen || mComboTexGen->getCurrentIndex() != 1); getChildView("rptctrl")->setEnabled(enabled); getChildView("button apply")->setEnabled(enabled); } } // Set variable values for numeric expressions LLCalc* calcp = LLCalc::getInstance(); calcp->setVar(LLCalc::TEX_U_SCALE, childGetValue("TexScaleU").asReal()); calcp->setVar(LLCalc::TEX_V_SCALE, childGetValue("TexScaleV").asReal()); calcp->setVar(LLCalc::TEX_U_OFFSET, childGetValue("TexOffsetU").asReal()); calcp->setVar(LLCalc::TEX_V_OFFSET, childGetValue("TexOffsetV").asReal()); calcp->setVar(LLCalc::TEX_ROTATION, childGetValue("TexRot").asReal()); calcp->setVar(LLCalc::TEX_TRANSPARENCY, childGetValue("ColorTrans").asReal()); calcp->setVar(LLCalc::TEX_GLOW, childGetValue("glow").asReal()); }