void FloaterQuickPrefs::onClickRegionWL() { mWLPresetsCombo->setSimple(LLStringExplicit("Default")); mWaterPresetsCombo->setSimple(LLStringExplicit("Default")); LLEnvManagerNew::instance().useRegionSettings(); LLWLParamManager::instance().getParamSet(LLWLParamKey("Default", LLEnvKey::SCOPE_LOCAL), LLWLParamManager::instance().mCurParams); }
// called from setFocus() // called internally too void HippoPanelGridsImpl::refresh() { const std::string &defaultGrid = gHippoGridManager->getDefaultGridName(); LLComboBox *grids = getChild<LLComboBox>("grid_selector"); S32 selectIndex = -1, i = 0; grids->removeall(); if (defaultGrid != "") { grids->add(defaultGrid); selectIndex = i++; } HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { const std::string &grid = it->second->getGridName(); if (grid != defaultGrid) { grids->add(grid); if (grid == mCurGrid) selectIndex = i; i++; } } if ((mState == ADD_NEW) || (mState == ADD_COPY)) { grids->add("<new>"); selectIndex = i++; } if (selectIndex >= 0) { grids->setCurrentByIndex(selectIndex); } else { grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label } childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " "); childSetEnabled("btn_delete", (selectIndex >= 0)); childSetEnabled("btn_copy", (mState == NORMAL) && (selectIndex >= 0)); childSetEnabled("btn_default", (mState == NORMAL) && (selectIndex > 0)); childSetEnabled("gridname", (mState == ADD_NEW) || (mState == ADD_COPY)); if (childGetValue("platform").asString() == "SecondLife") { // disable platform selector, if logged into the grid edited and it is SL // so object export restrictions cannot be circumvented by changing the platform bool enablePlatform = (LLStartUp::getStartupState() < STATE_LOGIN_CLEANUP) || (mCurGrid != gHippoGridManager->getConnectedGrid()->getGridName()); childSetEnabled("platform", enablePlatform); childSetEnabled("search", false); childSetText("search", LLStringExplicit("")); childSetEnabled("render_compat", false); childSetValue("render_compat", false); } else { childSetEnabled("platform", true); childSetEnabled("search", true); childSetText("search", gHippoGridManager->getConnectedGrid()->getSearchUrl()); childSetEnabled("render_compat", true); } }
void FloaterLocalAssetBrowser::UpdateRightSide() { /* Since i'm not keeping a bool on if the floater is expanded or not, i'll just check if one of the widgets that shows when the floater is expanded is visible. Also obviously before updating - checking if something IS actually selected :o */ if ( !sLFInstance->mTextureView->getVisible() ) { return; } if ( !sLFInstance->mBitmapList->getAllSelected().empty() ) { LocalBitmap* unit = gLocalBrowser->GetBitmapUnit( LLUUID(sLFInstance->mBitmapList->getSelectedItemLabel(BITMAPLIST_COL_ID)) ); if ( unit ) { sLFInstance->mTextureView->setImageAssetID( unit->getID() ); sLFInstance->mUpdateChkBox->set( unit->getUpdateBool() ); sLFInstance->mPathTxt->setText( unit->getFileName() ); sLFInstance->mUUIDTxt->setText( unit->getID().asString() ); sLFInstance->mNameTxt->setText( unit->getShortName() ); sLFInstance->mTimeTxt->setText( unit->getLastModified().asString() ); sLFInstance->mLinkTxt->setText( unit->getLinkStatus() ); sLFInstance->mTypeComboBox->selectNthItem( unit->getType() ); sLFInstance->mTextureView->setEnabled(true); sLFInstance->mUpdateChkBox->setEnabled(true); sLFInstance->mTypeComboBox->setEnabled(true); } } else { sLFInstance->mTextureView->setImageAssetID( NO_IMAGE ); sLFInstance->mTextureView->setEnabled( false ); sLFInstance->mUpdateChkBox->set( false ); sLFInstance->mUpdateChkBox->setEnabled( false ); sLFInstance->mTypeComboBox->selectFirstItem(); sLFInstance->mTypeComboBox->setEnabled( false ); sLFInstance->mPathTxt->setText( LLStringExplicit("None") ); sLFInstance->mUUIDTxt->setText( LLStringExplicit("None") ); sLFInstance->mNameTxt->setText( LLStringExplicit("None") ); sLFInstance->mLinkTxt->setText( LLStringExplicit("None") ); sLFInstance->mTimeTxt->setText( LLStringExplicit("None") ); } }
void LLFloaterAO::refresh() { childSetText("line_walking", idstr(LLAO::mOverrides[LLUUID("6ed24bd8-91aa-4b12-ccc7-c97c857ab4e0")])); childSetText("line_running", idstr(LLAO::mOverrides[LLUUID("05ddbff8-aaa9-92a1-2b74-8fe77a29b445")])); childSetText("line_crouchwalk", idstr(LLAO::mOverrides[LLUUID("47f5f6fb-22e5-ae44-f871-73aaaf4a6022")])); childSetText("line_flying", idstr(LLAO::mOverrides[LLUUID("aec4610c-757f-bc4e-c092-c6e9caf18daf")])); childSetText("line_turn_left", idstr(LLAO::mOverrides[LLUUID("56e0ba0d-4a9f-7f27-6117-32f2ebbf6135")])); childSetText("line_turn_right", idstr(LLAO::mOverrides[LLUUID("2d6daa51-3192-6794-8e2e-a15f8338ec30")])); childSetText("line_jumping", idstr(LLAO::mOverrides[LLUUID("2305bd75-1ca9-b03b-1faa-b176b8a8c49e")])); childSetText("line_fly_up", idstr(LLAO::mOverrides[LLUUID("62c5de58-cb33-5743-3d07-9e4cd4352864")])); childSetText("line_crouching", idstr(LLAO::mOverrides[LLUUID("201f3fdf-cb1f-dbec-201f-7333e328ae7c")])); childSetText("line_fly_down", idstr(LLAO::mOverrides[LLUUID("20f063ea-8306-2562-0b07-5c853b37b31e")])); mStandsCombo->clearRows(); for(std::list<LLUUID>::iterator itr = LLAO::mStandOverrides.begin();itr != LLAO::mStandOverrides.end(); itr++) { mStandsCombo->add((*itr).asString()); } mStandsCombo->setSimple(LLStringExplicit(LLAO::mStandOverrides.back().asString())); childSetText("line_hover", idstr(LLAO::mOverrides[LLUUID("4ae8016b-31b9-03bb-c401-b1ea941db41d")])); childSetText("line_sitting", idstr(LLAO::mOverrides[LLUUID("1a5fe8ac-a804-8a5d-7cbd-56bd83184568")])); childSetText("line_prejump", idstr(LLAO::mOverrides[LLUUID("7a4e87fe-de39-6fcb-6223-024b00893244")])); childSetText("line_falling", idstr(LLAO::mOverrides[LLUUID("666307d9-a860-572d-6fd4-c3ab8865c094")])); childSetText("line_stride", idstr(LLAO::mOverrides[LLUUID("1cb562b0-ba21-2202-efb3-30f82cdf9595")])); childSetText("line_soft_landing", idstr(LLAO::mOverrides[LLUUID("7a17b059-12b2-41b1-570a-186368b6aa6f")])); childSetText("line_medium_landing", idstr(LLAO::mOverrides[LLUUID("f4f00d6e-b9fe-9292-f4cb-0ae06ea58d57")])); childSetText("line_hard_landing", idstr(LLAO::mOverrides[LLUUID("3da1d753-028a-5446-24f3-9c9b856d9422")])); childSetText("line_flying_slow", idstr(LLAO::mOverrides[LLUUID("2b5a38b2-5e00-3a97-a495-4c826bc443e6")])); childSetText("line_sitting_on_ground", idstr(LLAO::mOverrides[LLUUID("1a2bd58e-87ff-0df8-0b4c-53e047b0bb6e")])); }
BOOL LLAOStandTimer::tick() { if(!mPaused && LLAO::isEnabled() && !LLAO::mStandOverrides.empty()) { LLVOAvatar* avatarp = gAgent.getAvatarObject(); if (avatarp) { for ( LLVOAvatar::AnimIterator anim_it = avatarp->mPlayingAnimations.begin(); anim_it != avatarp->mPlayingAnimations.end(); anim_it++) { if(LLAO::isStand(anim_it->first)) { //back is always last played, front is next avatarp->stopMotion(LLAO::mStandOverrides.back()); avatarp->startMotion(LLAO::mStandOverrides.front()); LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front()); LLAO::mStandOverrides.pop_front(); LLFloaterAO* ao = LLFloaterAO::sInstance; if(ao) { ao->mStandsCombo->setSimple(LLStringExplicit(LLAO::mStandOverrides.back().asString())); } break; } } } } return FALSE; }
void LLPanelLogin::updateGridCombo() { const std::string &defaultGrid = gHippoGridManager->getDefaultGridName(); LLComboBox *grids = getChild<LLComboBox>("grids_combo"); std::string top_entry; grids->removeall(); const HippoGridInfo *curGrid = gHippoGridManager->getCurrentGrid(); const HippoGridInfo *defGrid = gHippoGridManager->getGrid(defaultGrid); HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { std::string grid = it->second->getGridName(); if(grid.empty() || it->second == defGrid || it->second == curGrid) continue; grids->add(grid); } if(curGrid || defGrid) { if(defGrid) grids->add(defGrid->getGridName(),ADD_TOP); if(curGrid && defGrid != curGrid) grids->add(curGrid->getGridName(),ADD_TOP); grids->setCurrentByIndex(0); } else { grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label } }
BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); // media control that is used to play intro video mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); mMediaCtrl->setVisible( false ); // hidden initially mMediaCtrl->addObserver( this ); // watch events LLViewerMedia::setOnlyAudibleMediaTextureID(mMediaCtrl->getTextureID()); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); getChild<LLTextBox>("message_text")->setClickedCallback(onClickMessage, this); // hidden initially, until we need it LLPanel::setVisible(FALSE); LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLProgressView::onAlertModal, this, _1)); sInstance = this; return TRUE; }
void LLPanelLogin::updateGridCombo() { const std::string &defaultGrid = gHippoGridManager->getDefaultGridNick(); const std::string ¤tGrid = gHippoGridManager->getCurrentGridNick(); LLComboBox *grids = getChild<LLComboBox>("grids_combo"); S32 selectIndex = -1, i = 0; grids->removeall(); if (defaultGrid != "") { grids->add(defaultGrid); selectIndex = i++; } HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { const std::string &grid = it->second->getGridName(); if (grid != defaultGrid) { grids->add(grid); if (grid == currentGrid) selectIndex = i; i++; } } if (selectIndex >= 0) { grids->setCurrentByIndex(selectIndex); } else { grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label } }
void LLPanelTopInfoBar::initParcelIcons() { mParcelIcon[VOICE_ICON] = getChild<LLIconCtrl>("voice_icon"); mParcelIcon[FLY_ICON] = getChild<LLIconCtrl>("fly_icon"); mParcelIcon[PUSH_ICON] = getChild<LLIconCtrl>("push_icon"); mParcelIcon[BUILD_ICON] = getChild<LLIconCtrl>("build_icon"); mParcelIcon[SCRIPTS_ICON] = getChild<LLIconCtrl>("scripts_icon"); mParcelIcon[DAMAGE_ICON] = getChild<LLIconCtrl>("damage_icon"); mParcelIcon[SEE_AVATARS_ICON] = getChild<LLIconCtrl>("see_avatars_icon"); mParcelIcon[VOICE_ICON]->setToolTip(LLTrans::getString("LocationCtrlVoiceTooltip")); mParcelIcon[FLY_ICON]->setToolTip(LLTrans::getString("LocationCtrlFlyTooltip")); mParcelIcon[PUSH_ICON]->setToolTip(LLTrans::getString("LocationCtrlPushTooltip")); mParcelIcon[BUILD_ICON]->setToolTip(LLTrans::getString("LocationCtrlBuildTooltip")); mParcelIcon[SCRIPTS_ICON]->setToolTip(LLTrans::getString("LocationCtrlScriptsTooltip")); mParcelIcon[DAMAGE_ICON]->setToolTip(LLTrans::getString("LocationCtrlDamageTooltip")); mParcelIcon[SEE_AVATARS_ICON]->setToolTip(LLTrans::getString("LocationCtrlSeeAVsTooltip")); mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON)); mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON)); mParcelIcon[PUSH_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, PUSH_ICON)); mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON)); mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON)); mParcelIcon[SEE_AVATARS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SEE_AVATARS_ICON)); mDamageText->setText(LLStringExplicit("100%")); }
void lggDicDownloadFloater::onClickDownload(void* data) { lggDicDownloadFloater* self = (lggDicDownloadFloater*)data; if (self) { //std::string selection = self->childGetValue("Emerald_combo_dics").asString(); LLComboBox* comboBox = self->getChild<LLComboBox>("Emerald_combo_dics"); if (comboBox != NULL) { if (!comboBox->getSelectedItemLabel().empty()) { std::string newDict(self->sNames[comboBox->getCurrentIndex()]); LLHTTPClient::get(gSavedSettings.getString("SpellDownloadURL")+newDict+".aff", new EmeraldDicDownloader(self,newDict+".aff")); LLHTTPClient::get(gSavedSettings.getString("SpellDownloadURL")+newDict+".dic", new EmeraldDicDownloader(NULL,newDict+".dic")); LLButton* button = self->getChild<LLButton>("Emerald_dic_download"); if (button) { // TODO: move this to xml button->setLabel(LLStringExplicit("Downloading... Please Wait")); button->setEnabled(FALSE); } } } } }
void LLFloaterLocalBitmapBrowser::updateRightSide() { if ( sSelfInstances.empty() ) { return; } std::list<LLFloaterLocalBitmapBrowser*>::iterator iter; for( iter = sSelfInstances.begin(); iter != sSelfInstances.end(); iter++ ) { LLFloaterLocalBitmapBrowser* sLFInstance = *iter; if ( !sLFInstance->mBitmapList->getAllSelected().empty() ) { LLLocalBitmap* unit = gLocalBrowser->getBitmapUnit( LLUUID(sLFInstance->mBitmapList->getSelectedItemLabel(BLIST_COL_ID)) ); if ( unit ) { sLFInstance->mTextureView->setImageAssetID( unit->getID() ); sLFInstance->mUpdateChkBox->set( unit->getUpdateBool() ); sLFInstance->mPathTxt->setText( unit->getFileName() ); sLFInstance->mUUIDTxt->setText( unit->getID().asString() ); sLFInstance->mTimeTxt->setText( unit->getLastModified().asString() ); sLFInstance->mLinkTxt->setText( unit->getLinkStatus() ); sLFInstance->mTypeComboBox->selectNthItem( unit->getType() ); sLFInstance->mTextureView->setEnabled(true); sLFInstance->mUpdateChkBox->setEnabled(true); sLFInstance->mTypeComboBox->setEnabled(true); } } else { sLFInstance->mTextureView->setImageAssetID( NO_IMAGE ); sLFInstance->mTextureView->setEnabled( false ); sLFInstance->mUpdateChkBox->set( false ); sLFInstance->mUpdateChkBox->setEnabled( false ); sLFInstance->mTypeComboBox->selectFirstItem(); sLFInstance->mTypeComboBox->setEnabled( false ); sLFInstance->mPathTxt->setText( LLStringExplicit("None") ); sLFInstance->mUUIDTxt->setText( LLStringExplicit("None") ); sLFInstance->mLinkTxt->setText( LLStringExplicit("None") ); sLFInstance->mTimeTxt->setText( LLStringExplicit("None") ); } } }
void LLFloaterTools::updateTreeGrassCombo(bool visible) { LLTextBox* tree_grass_label = getChild<LLTextBox>("tree_grass_label"); if (visible) { LLPCode pcode = LLToolPlacer::getObjectType(); std::map<std::string, S32>::iterator it, end; std::string selected; if (pcode == LLToolPlacerPanel::sTree) { tree_grass_label->setVisible(visible); LLButton* button = getChild<LLButton>("ToolTree"); tree_grass_label->setText(button->getToolTip()); selected = gSavedSettings.getString("LastTree"); it = LLVOTree::sSpeciesNames.begin(); end = LLVOTree::sSpeciesNames.end(); } else if (pcode == LLToolPlacerPanel::sGrass) { tree_grass_label->setVisible(visible); LLButton* button = getChild<LLButton>("ToolGrass"); tree_grass_label->setText(button->getToolTip()); selected = gSavedSettings.getString("LastGrass"); it = LLVOGrass::sSpeciesNames.begin(); end = LLVOGrass::sSpeciesNames.end(); } else { mComboTreesGrass->removeall(); mComboTreesGrass->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label mComboTreesGrass->setEnabled(false); mComboTreesGrass->setVisible(false); tree_grass_label->setVisible(false); return; } mComboTreesGrass->removeall(); mComboTreesGrass->add("Random"); int select = 0, i = 0; while (it != end) { const std::string &species = it->first; mComboTreesGrass->add(species); ++i; if (species == selected) select = i; ++it; } // if saved species not found, default to "Random" mComboTreesGrass->selectNthItem(select); mComboTreesGrass->setEnabled(true); } mComboTreesGrass->setVisible(visible); tree_grass_label->setVisible(visible); }
void LLProgressView::setMessage(const std::string& msg) { mMessage = msg; mURLInMessage = (mMessage.find( "https://" ) != std::string::npos || mMessage.find( "http://" ) != std::string::npos || mMessage.find( "ftp://" ) != std::string::npos); getChild<LLTextBox>("message_text")->setWrappedText(LLStringExplicit(mMessage)); getChild<LLTextBox>("message_text")->setHoverActive(mURLInMessage); }
void LLNearbyChatBar::sendChat( EChatType type ) { if (mChatBox) { LLWString text = mChatBox->getConvertedText(); if (!text.empty()) { // store sent line in history, duplicates will get filtered mChatBox->updateHistory(); // Check if this is destined for another channel S32 channel = 0; stripChannelNumber(text, &channel); std::string utf8text = wstring_to_utf8str(text); // Try to trigger a gesture, if not chat to a script. std::string utf8_revised_text; if (0 == channel) { // discard returned "found" boolean LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); } else { utf8_revised_text = utf8text; } utf8_revised_text = utf8str_trim(utf8_revised_text); type = processChatTypeTriggers(type, utf8_revised_text); if (!utf8_revised_text.empty()) { // Chat with animation sendChatFromViewer(utf8_revised_text, type, TRUE); } } mChatBox->setText(LLStringExplicit("")); } gAgent.stopTyping(); // If the user wants to stop chatting on hitting return, lose focus // and go out of chat mode. if (gSavedSettings.getBOOL("CloseChatOnReturn")) { stopChat(); } }
BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked ); mFadeTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); getChild<LLTextBox>("message_text")->setClickedCallback(onClickMessage, this); sInstance = this; return TRUE; }
BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( boost::bind(&LLProgressView::onCancelButtonClicked) ); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); getChild<LLTextBox>("message_text")->setClickedCallback(boost::bind(&LLProgressView::onClickMessage, this)); // hidden initially, until we need it setVisible(FALSE); sInstance = this; return TRUE; }
void LLPanelTopInfoBar::initParcelIcons() { mParcelIcon[VOICE_ICON] = getChild<LLIconCtrl>("voice_icon"); mParcelIcon[FLY_ICON] = getChild<LLIconCtrl>("fly_icon"); mParcelIcon[PUSH_ICON] = getChild<LLIconCtrl>("push_icon"); mParcelIcon[BUILD_ICON] = getChild<LLIconCtrl>("build_icon"); mParcelIcon[SCRIPTS_ICON] = getChild<LLIconCtrl>("scripts_icon"); mParcelIcon[DAMAGE_ICON] = getChild<LLIconCtrl>("damage_icon"); mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON)); mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON)); mParcelIcon[PUSH_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, PUSH_ICON)); mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON)); mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON)); mDamageText->setText(LLStringExplicit("100%")); }
// unhide the default nearby chat bar on request (pressing Enter or a letter key) void LLNearbyChat::showDefaultChatBar(BOOL visible,const char* text) const { if(!mDefaultChatBar) return; // change settings control to signal button state gSavedSettings.setBOOL("MainChatbarVisible",visible); mDefaultChatBar->getParent()->setVisible(visible); mDefaultChatBar->setVisible(visible); mDefaultChatBar->setFocus(visible); if(!text) return; if(mDefaultChatBar->getText().empty()) { mDefaultChatBar->setText(LLStringExplicit(text)); mDefaultChatBar->setCursorToEnd(); } }
// called from setFocus() // called internally too void HippoPanelGridsImpl::refresh() { const std::string &defaultGrid = gHippoGridManager->getDefaultGridName(); LLComboBox *grids = getChild<LLComboBox>("grid_selector"); S32 selectIndex = -1, i = 0; grids->removeall(); if (defaultGrid != "") { grids->add(defaultGrid); selectIndex = i++; } HippoGridManager::GridIterator it, end = gHippoGridManager->endGrid(); for (it = gHippoGridManager->beginGrid(); it != end; ++it) { const std::string &grid = it->second->getGridName(); if (grid != defaultGrid) { grids->add(grid); if (grid == mCurGrid) selectIndex = i; i++; } } if ((mState == ADD_NEW) || (mState == ADD_COPY)) { grids->add("<new>"); selectIndex = i++; } if (selectIndex >= 0) { grids->setCurrentByIndex(selectIndex); } else { grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label } childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " "); childSetEnabled("btn_delete", (selectIndex >= 0) && mIsEditable ); childSetEnabled("btn_copy", (mState == NORMAL) && (selectIndex >= 0)); childSetEnabled("btn_default", (mState == NORMAL) && (selectIndex > 0)); childSetEnabled("gridname", (mState == ADD_NEW) || (mState == ADD_COPY)); }
// unhide the default nearby chat bar on request (pressing Enter or a letter key) void FSNearbyChat::showDefaultChatBar(BOOL visible, const char* text) const { if (!mDefaultChatBar) { return; } // change settings control to signal button state gSavedSettings.setBOOL("MainChatbarVisible",visible); mDefaultChatBar->getParent()->setVisible(visible); mDefaultChatBar->setVisible(visible); mDefaultChatBar->setFocus(visible); // <FS:KC> Fix for bad edge snapping if (visible) { gFloaterView->setSnapOffsetChatBar(mDefaultChatBar->getRect().getHeight() + MAGIC_CHAT_BAR_PAD); } else { gFloaterView->setSnapOffsetChatBar(0); } if (!text) { return; } if (mDefaultChatBar->getText().empty()) { mDefaultChatBar->setText(LLStringExplicit(text)); mDefaultChatBar->setCursorToEnd(); } // </FS:KC> Fix for bad edge snapping }
void LLNearbyChatBar::sendChat( EChatType type ) { if (mChatBox) { LLWString text = mChatBox->getConvertedText(); if (!text.empty()) { if(type == CHAT_TYPE_OOC) { std::string tempText = mChatBox->getText(); tempText = gSavedSettings.getString("PhoenixOOCPrefix") + " " + tempText + " " + gSavedSettings.getString("PhoenixOOCPostfix"); mChatBox->setText(tempText); text = utf8str_to_wstring(tempText); } // store sent line in history, duplicates will get filtered mChatBox->updateHistory(); // Check if this is destined for another channel S32 channel = 0; stripChannelNumber(text, &channel); std::string utf8text = wstring_to_utf8str(text); // Try to trigger a gesture, if not chat to a script. std::string utf8_revised_text; if (0 == channel) { //-TT Satomi Ahn - Patch MU_OOC if (gSavedSettings.getBOOL("AutoCloseOOC")) { // Try to find any unclosed OOC chat (i.e. an opening // double parenthesis without a matching closing double // parenthesis. if (utf8text.find("(( ") != -1 && utf8text.find("))") == -1) { // add the missing closing double parenthesis. utf8text += " ))"; } else if (utf8text.find("((") != -1 && utf8text.find("))") == -1) { if (utf8text.at(utf8text.length() - 1) == ')') { // cosmetic: add a space first to avoid a closing triple parenthesis utf8text += " "; } // add the missing closing double parenthesis. utf8text += "))"; } else if (utf8text.find("[[ ") != -1 && utf8text.find("]]") == -1) { // add the missing closing double parenthesis. utf8text += " ]]"; } else if (utf8text.find("[[") != -1 && utf8text.find("]]") == -1) { if (utf8text.at(utf8text.length() - 1) == ']') { // cosmetic: add a space first to avoid a closing triple parenthesis utf8text += " "; } // add the missing closing double parenthesis. utf8text += "]]"; } } // Convert MU*s style poses into IRC emotes here. if (gSavedSettings.getBOOL("AllowMUpose") && utf8text.find(":") == 0 && utf8text.length() > 3) { if (utf8text.find(":'") == 0) { utf8text.replace(0, 1, "/me"); } else if (isalpha(utf8text.at(1))) // Do not prevent smileys and such. { utf8text.replace(0, 1, "/me "); } } //-TT Satomi Ahn - Patch MU_OOC // discard returned "found" boolean LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); } else { utf8_revised_text = utf8text; } utf8_revised_text = utf8str_trim(utf8_revised_text); EChatType nType; if(type == CHAT_TYPE_OOC) nType = CHAT_TYPE_NORMAL; else nType = type; type = processChatTypeTriggers(nType, utf8_revised_text); if (!utf8_revised_text.empty() && cmd_line_chat(utf8_revised_text, type)) { // Chat with animation sendChatFromViewer(utf8_revised_text, type, PhoenixPlayChatAnimation); } } mChatBox->setText(LLStringExplicit("")); } gAgent.stopTyping(); // If the user wants to stop chatting on hitting return, lose focus // and go out of chat mode. if (gSavedSettings.getBOOL("CloseChatOnReturn")) { stopChat(); } }
void FloaterGridManager::refreshGrids() { LLScrollListCtrl *grids = FloaterGridManager::getInstance()->getChild<LLScrollListCtrl>("grid_selector"); std::string lastSelectedItem; LLSD element; if (grids->getFirstSelected()) { lastSelectedItem = grids->getFirstSelected()->getValue().asString(); } grids->deleteAllItems(); for (HippoGridManager::GridIterator it = gHippoGridManager->beginGrid(); it != gHippoGridManager->endGrid(); ++it) { std::string grid_nick = it->second->getGridNick(); // There's no reason why empty grids nicks should be in this list, ugh if (!grid_nick.empty() && grid_nick != gHippoGridManager->getCurrentGridNick()) { element["id"] = grid_nick; element["columns"][0]["column"] = "grid"; element["columns"][0]["type"] = "text"; element["columns"][0]["value"] = grid_nick; grids->addElement(element, ADD_BOTTOM); } } // Setting the default needs to be rethought. // Right now, we just use the last-selected grid, // but leaving this as the current behavior for now if (!gHippoGridManager->getCurrentGridNick().empty()) { element["id"] = gHippoGridManager->getCurrentGridNick(); element["columns"][0]["column"] = "grid"; element["columns"][0]["type"] = "text"; element["columns"][0]["font-style"] = "BOLD"; element["columns"][0]["value"] = gHippoGridManager->getCurrentGridNick(); grids->addElement(element, ADD_TOP); } // Reselect the item if we had one selected if (lastSelectedItem.empty()) { grids->selectItemByLabel(gHippoGridManager->getCurrentGridNick()); } else { grids->selectItemByLabel(lastSelectedItem); } // TODO: get rid of all this state junk if ((FloaterGridManager::getInstance()->getState() == ADD_NEW) || (FloaterGridManager::getInstance()->getState() == ADD_COPY)) { grids->addElement("<new>", ADD_BOTTOM); } //if (selectIndex >= 0) //{ // grids->setCurrentByIndex(selectIndex); //} //else //{ // grids->setLabel(LLStringExplicit("")); // LLComboBox::removeall() does not clear the label //} // FloaterGridManager::getInstance()->childSetTextArg("default_grid", "[DEFAULT]", (defaultGrid != "")? defaultGrid: " "); FloaterGridManager::getInstance()->childSetEnabled("btn_delete", grids->getItemCount() > 0); FloaterGridManager::getInstance()->childSetEnabled("btn_copy", (FloaterGridManager::getInstance()->getState() == NORMAL) && (grids->getItemCount() > 0)); // FloaterGridManager::getInstance()->childSetEnabled("set_default", (FloaterGridManager::getInstance()->getState() == NORMAL) && (grids->getItemCount() > 0)); FloaterGridManager::getInstance()->childSetEnabled("gridnick", (FloaterGridManager::getInstance()->getState() == ADD_NEW) || (FloaterGridManager::getInstance()->getState() == ADD_COPY)); if (FloaterGridManager::getInstance()->getState() == NORMAL) { HippoGridInfo *gridInfo = gHippoGridManager->getGrid(FloaterGridManager::getInstance()->getCurGrid()); if (gridInfo) { FloaterGridManager::getInstance()->childSetText("gridnick", gridInfo->getGridNick()); //FloaterGridManager::getInstance()->childSetText("grid_name", gridInfo->getGridName()); FloaterGridManager::getInstance()->childSetText("loginuri", gridInfo->getLoginUri()); FloaterGridManager::getInstance()->childSetText("loginpage", gridInfo->getLoginPage()); FloaterGridManager::getInstance()->childSetText("helperuri", gridInfo->getHelperUri()); FloaterGridManager::getInstance()->childSetText("website", gridInfo->getWebSite()); FloaterGridManager::getInstance()->childSetText("support", gridInfo->getSupportUrl()); FloaterGridManager::getInstance()->childSetText("register", gridInfo->getRegisterUrl()); FloaterGridManager::getInstance()->childSetText("password", gridInfo->getPasswordUrl()); FloaterGridManager::getInstance()->childSetText("first_name", gridInfo->getFirstName()); FloaterGridManager::getInstance()->childSetText("last_name", gridInfo->getLastName()); if(gridInfo->getAvatarPassword().length() == 32) FloaterGridManager::getInstance()->childSetText("avatar_password", std::string(PASSWORD_FILLER)); else if(gridInfo->getPasswordUrl().empty()) FloaterGridManager::getInstance()->childSetText("avatar_password", std::string("")); if (gridInfo->getPlatform() == HippoGridInfo::PLATFORM_SECONDLIFE) { FloaterGridManager::getInstance()->childSetEnabled("search", false); FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); //childSetEnabled("render_compat", false); //childSetValue("render_compat", false); } else { FloaterGridManager::getInstance()->childSetEnabled("search", true); FloaterGridManager::getInstance()->childSetText("search", gridInfo->getSearchUrl()); //childSetEnabled("render_compat", true); //childSetValue("render_compat", gridInfo->isRenderCompat()); } } else { FloaterGridManager::getInstance()->childSetText("gridnick", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("gridname", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("loginuri", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("loginpage", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("helperuri", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("website", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("support", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("register", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("password", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("first_name", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("last_name", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("avatar_password", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); } } else if (FloaterGridManager::getInstance()->getState() == ADD_NEW) { llinfos << "mState == ADD_NEW" << llendl; std::string required = "<required>"; FloaterGridManager::getInstance()->childSetText("gridnick", required); FloaterGridManager::getInstance()->childSetText("gridname", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("loginuri", required); FloaterGridManager::getInstance()->childSetText("loginpage", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("helperuri", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("website", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("support", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("register", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("password", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("first_name", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("last_name", LLStringUtil::null); FloaterGridManager::getInstance()->childSetText("avatar_password", LLStringUtil::null); // childSetEnabled("search", true); FloaterGridManager::getInstance()->childSetText("search", LLStringUtil::null); } else if (FloaterGridManager::getInstance()->getState() == ADD_COPY) { llinfos << "mState == ADD_COPY" << llendl; FloaterGridManager::getInstance()->childSetText("gridnick", LLStringExplicit("<required>")); } else { llwarns << "Illegal state " << FloaterGridManager::getInstance()->getState() << llendl; } return; }
// static void LLPreviewNotecard::onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, void* user_data, S32 status, LLExtStat ext_status) { llinfos << "LLPreviewNotecard::onLoadComplete()" << llendl; LLUUID* item_id = (LLUUID*)user_data; LLPreviewNotecard* preview = LLPreviewNotecard::getInstance(*item_id); if( preview ) { if(0 == status) { LLVFile file(vfs, asset_uuid, type, LLVFile::READ); S32 file_length = file.getSize(); char* buffer = new char[file_length+1]; file.read((U8*)buffer, file_length); /*Flawfinder: ignore*/ // put a EOS at the end buffer[file_length] = 0; if (LLViewerTextEditor* previewEditor = preview->findChild<LLViewerTextEditor>("Notecard Editor")) { if ((file_length > 19) && !strncmp(buffer, "Linden text version", 19)) { if (!previewEditor->importBuffer(buffer, file_length+1)) { llwarns << "Problem importing notecard" << llendl; } } else { // Version 0 (just text, doesn't include version number) previewEditor->setText(LLStringExplicit(buffer)); } previewEditor->makePristine(); } const LLInventoryItem* item = preview->getItem(); BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); preview->setEnabled(modifiable); delete[] buffer; preview->mAssetStatus = PREVIEW_ASSET_LOADED; } else { LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { LLNotificationsUtil::add("NotecardMissing"); } else if (LL_ERR_INSUFFICIENT_PERMISSIONS == status) { LLNotificationsUtil::add("NotecardNoPermissions"); } else { LLNotificationsUtil::add("UnableToLoadNotecard"); } llwarns << "Problem loading notecard: " << status << llendl; preview->mAssetStatus = PREVIEW_ASSET_ERROR; } } delete item_id; }
void fire(const LLUUID &inv_item) { S32 file_size; LLAPRFile infile; infile.open(data->filename, LL_APR_RB, LLAPRFile::access_t(), &file_size); if (infile.getFileHandle()) { //cmdline_printchat("got file handle @ postinv"); LLVFile file(gVFS, data->assetid, data->type, LLVFile::WRITE); file.setMaxSize(file_size); const S32 buf_size = 65536; U8 copy_buf[buf_size]; while ((file_size = infile.read(copy_buf, buf_size))) { file.write(copy_buf, file_size); } switch(data->type) { case LLAssetType::AT_NOTECARD: //cmdline_printchat("case notecard @ postinv"); { *//*LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,""); S32 size = gVFS->getSize(data->assetid, data->type); U8* buffer = new U8[size]; gVFS->getData(data->assetid, data->type, buffer, 0, size); edit->setText(LLStringExplicit((char*)buffer)); std::string card; edit->exportBuffer(card); cmdline_printchat("Encoded notecard");; edit->die(); delete buffer; //buffer = new U8[card.size()]; //size = card.size(); //strcpy((char*)buffer,card.c_str()); file.remove(); LLVFile newfile(gVFS, data->assetid, data->type, LLVFile::APPEND); newfile.setMaxSize(size); newfile.write((const U8*)card.c_str(),size);*//* //FAIL. std::string agent_url = gAgent.getRegion()->getCapability("UpdateNotecardAgentInventory"); LLSD body; body["item_id"] = inv_item; //cmdline_printchat("posting content as " + data->assetid.asString()); LLHTTPClient::post(agent_url, body, new JCPostInvUploadResponder(body, data->assetid, data->type,inv_item,data)); } break; case LLAssetType::AT_LSL_TEXT: //cmdline_printchat("case lsltext @ postinv"); { std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); LLSD body; body["item_id"] = inv_item; S32 size = gVFS->getSize(data->assetid, data->type); U8* buffer = new U8[size]; gVFS->getData(data->assetid, data->type, buffer, 0, size); std::string script((char*)buffer); BOOL domono = FALSE;//Phox- this needs to be fixed when the preproc is added = JCLSLPreprocessor::mono_directive(script); *//*if(script.find("//mono\n") != -1) { domono = TRUE; }else if(script.find("//lsl2\n") != -1) { domono = FALSE; }*//* delete buffer; buffer = 0; body["target"] = (domono == TRUE) ? "mono" : "lsl2"; //cmdline_printchat("posting content as " + data->assetid.asString()); LLHTTPClient::post(url, body, new JCPostInvUploadResponder(body, data->assetid, data->type,inv_item,data)); } break; default: break; }
void LLProgressView::setText(const std::string& text) { getChild<LLTextBox>("progress_text")->setWrappedText(LLStringExplicit(text)); }
void FSFloaterNearbyChat::sendChat( EChatType type ) { if (mInputEditor) { LLWString text = mInputEditor->getWText(); LLWStringUtil::trim(text); LLWStringUtil::replaceChar(text,182,'\n'); // Convert paragraph symbols back into newlines. if (!text.empty()) { if(type == CHAT_TYPE_OOC) { std::string tempText = wstring_to_utf8str( text ); tempText = gSavedSettings.getString("FSOOCPrefix") + " " + tempText + " " + gSavedSettings.getString("FSOOCPostfix"); text = utf8str_to_wstring(tempText); } // Check if this is destined for another channel S32 channel = 0; stripChannelNumber(text, &channel); // If "/<number>" is not specified, see if a channel has been set in // the spinner. if (gSavedSettings.getBOOL("FSNearbyChatbar") && gSavedSettings.getBOOL("FSShowChatChannel") && (channel == 0)) { channel = (S32)(FSFloaterNearbyChat::getInstance()->getChild<LLSpinCtrl>("ChatChannel")->get()); } std::string utf8text = wstring_to_utf8str(text); // Try to trigger a gesture, if not chat to a script. std::string utf8_revised_text; if (0 == channel) { // Convert OOC and MU* style poses utf8text = applyAutoCloseOoc(utf8text); utf8text = applyMuPose(utf8text); // discard returned "found" boolean LLGestureMgr::instance().triggerAndReviseString(utf8text, &utf8_revised_text); } else { utf8_revised_text = utf8text; } utf8_revised_text = utf8str_trim(utf8_revised_text); EChatType nType; if(type == CHAT_TYPE_OOC) nType = CHAT_TYPE_NORMAL; else nType = type; type = processChatTypeTriggers(nType, utf8_revised_text); if (!utf8_revised_text.empty() && cmd_line_chat(utf8_revised_text, type)) { // Chat with animation sendChatFromViewer(utf8_revised_text, type, gSavedSettings.getBOOL("PlayChatAnim")); } } mInputEditor->setText(LLStringExplicit("")); } gAgent.stopTyping(); // If the user wants to stop chatting on hitting return, lose focus // and go out of chat mode. if (gSavedSettings.getBOOL("CloseChatOnReturn") && gSavedSettings.getBOOL("FSUnfocusChatHistoryOnReturn")) { stopChat(); } }