void LLPanelEmerald::onTagComboBoxCommit(LLUICtrl* ctrl, void* userdata) { LLComboBox* box = (LLComboBox*)ctrl; if(box) { gSavedSettings.setString("EmeraldTagColor",box->getSimple()); LLPrimitive::tagstring = ModularSystemsLink::emerald_tags[box->getSimple()].asString(); gAgent.sendAgentSetAppearance(); } }
// static void LLFloaterWorldMap::onAvatarComboCommit( LLUICtrl* ctrl, void* userdata ) { LLFloaterWorldMap* self = gFloaterWorldMap; if( !self || self->mIsClosing ) { return; } LLCtrlListInterface *list = gFloaterWorldMap->childGetListInterface("friend combo"); if (!list) return; const LLUUID& new_avatar_id = list->getCurrentID(); if (new_avatar_id.notNull()) { std::string name; LLComboBox* combo = gFloaterWorldMap->getChild<LLComboBox>("friend combo"); if (combo) name = combo->getSimple(); self->trackAvatar(new_avatar_id, name); onShowTargetBtn(self); } else { // Reset to user postion if nothing is tracked self->mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } }
// static void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, void*) { LLComboBox* combo = (LLComboBox*)ctrl; std::string name = combo->getSimple(); LLSD value = combo->getValue(); llinfos << "commit combo name " << name << " value " << value.asString() << llendl; }
bool LLFloaterDayCycle::newPromptCallback(const LLSD& notification, const LLSD& response) { std::string text = response["message"].asString(); S32 option = LLNotification::getSelectedOption(notification, response); if(text == "") { return false; } if(option == 0) { LLComboBox* comboBox = sDayCycle->getChild<LLComboBox>("DayCyclePresetsCombo"); LLFloaterDayCycle* sDayCycle = NULL; LLComboBox* keyCombo = NULL; if(LLFloaterDayCycle::isOpen()) { sDayCycle = LLFloaterDayCycle::instance(); keyCombo = sDayCycle->getChild<LLComboBox>("WLKeyPresets"); } // add the current parameters to the list // see if it's there first // if not there, add a new one if(LLDayCycleManager::getInstance()->findPreset(text).empty()) { //AscentDayCycleManager::instance()->addParamSet(text, // AscentDayCycleManager::instance()->mCurParams); LLDayCycleManager::getInstance()->savePreset(text, LLWLParamManager::getInstance()->mDay.asLLSD()); comboBox->add(text); comboBox->sortByName(); // add a blank to the bottom comboBox->selectFirstItem(); if(comboBox->getSimple() == "") { comboBox->remove(0); } comboBox->add(LLStringUtil::null); comboBox->setSelectedByValue(text, true); if(LLFloaterDayCycle::isOpen()) { keyCombo->add(text); keyCombo->sortByName(); } } else // otherwise, send a message to the user { LLNotificationsUtil::add("ExistsSkyPresetAlert"); } } return false; }
bool LLFloaterWindLight::newPromptCallback(const LLSD& notification, const LLSD& response) { std::string text = response["message"].asString(); S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if(text == "") { return false; } if(option == 0) { LLComboBox* comboBox = getChild<LLComboBox>("WLPresetsCombo"); LLFloaterDayCycle* day_cycle = LLFloaterReg::findTypedInstance<LLFloaterDayCycle>("env_day_cycle"); LLComboBox* keyCombo = NULL; if(day_cycle) { keyCombo = day_cycle->getChild<LLComboBox>("WLKeyPresets"); } // add the current parameters to the list // see if it's there first std::map<std::string, LLWLParamSet>::iterator mIt = LLWLParamManager::instance()->mParamList.find(text); // if not there, add a new one if(mIt == LLWLParamManager::instance()->mParamList.end()) { LLWLParamManager::instance()->addParamSet(text, LLWLParamManager::instance()->mCurParams); comboBox->add(text); comboBox->sortByName(); // add a blank to the bottom comboBox->selectFirstItem(); if(comboBox->getSimple() == "") { comboBox->remove(0); } comboBox->add(LLStringUtil::null); comboBox->setSelectedByValue(text, true); if(keyCombo) { keyCombo->add(text); keyCombo->sortByName(); } LLWLParamManager::instance()->savePreset(text); // otherwise, send a message to the user } else { LLNotificationsUtil::add("ExistsSkyPresetAlert"); } } return false; }
void LLFloaterWindLight::newPromptCallback(S32 option, const std::string& text, void* userData) { if(text == "") { return; } if(option == 0) { LLComboBox* comboBox = sWindLight->getChild<LLComboBox>( "WLPresetsCombo"); LLFloaterDayCycle* sDayCycle = NULL; LLComboBox* keyCombo = NULL; if(LLFloaterDayCycle::isOpen()) { sDayCycle = LLFloaterDayCycle::instance(); keyCombo = sDayCycle->getChild<LLComboBox>( "WLKeyPresets"); } // add the current parameters to the list // see if it's there first std::map<std::string, LLWLParamSet>::iterator mIt = LLWLParamManager::instance()->mParamList.find(text); // if not there, add a new one if(mIt == LLWLParamManager::instance()->mParamList.end()) { LLWLParamManager::instance()->addParamSet(text, LLWLParamManager::instance()->mCurParams); comboBox->add(text); comboBox->sortByName(); // add a blank to the bottom comboBox->selectFirstItem(); if(comboBox->getSimple() == "") { comboBox->remove(0); } comboBox->add(LLStringUtil::null); comboBox->setSelectedByValue(text, true); if(LLFloaterDayCycle::isOpen()) { keyCombo->add(text); keyCombo->sortByName(); } LLWLParamManager::instance()->savePreset(text); // otherwise, send a message to the user } else { gViewerWindow->alertXml("ExistsSkyPresetAlert"); } } }
// static void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) { //LLPanelObject* self = (LLPanelObject*) userdata; LLComboBox* box = (LLComboBox*) ctrl; if (box) { // apply the currently selected material to the object const std::string& material_name = box->getSimple(); U8 material_code = LLMaterialTable::basic.getMCode(material_name); LLSelectMgr::getInstance()->selectionSetMaterial(material_code); } }
// static void LLPanelLogin::onSelectServer(LLUICtrl*, void*) { // *NOTE: The paramters for this method are ignored. // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) // calls this method. // The user twiddled with the grid choice ui. // apply the selection to the grid setting. std::string grid_label; S32 grid_index; LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); LLSD combo_val = combo->getValue(); if (LLSD::TypeInteger == combo_val.type()) { grid_index = combo->getValue().asInteger(); if ((S32)GRID_INFO_OTHER == grid_index) { // This happens if the user specifies a custom grid // via command line. grid_label = combo->getSimple(); } } else { // no valid selection, return other grid_index = (S32)GRID_INFO_OTHER; grid_label = combo_val.asString(); } // This new seelction will override preset uris // from the command line. LLViewerLogin* vl = LLViewerLogin::getInstance(); vl->resetURIs(); if(grid_index != GRID_INFO_OTHER) { vl->setGridChoice((EGridInfo)grid_index); } else { vl->setGridChoice(grid_label); } // grid changed so show new splash screen (possibly) loadLoginPage(); }
// static void LLPanelVolume::onCommitMaterial( LLUICtrl* ctrl, void* userdata ) { //LLPanelObject* self = (LLPanelObject*) userdata; LLComboBox* box = (LLComboBox*) ctrl; if (box) { // apply the currently selected material to the object const std::string& material_name = box->getSimple(); std::string LEGACY_FULLBRIGHT_DESC = LLTrans::getString("Fullbright"); if (material_name != LEGACY_FULLBRIGHT_DESC) { U8 material_code = LLMaterialTable::basic.getMCode(material_name); LLSelectMgr::getInstance()->selectionSetMaterial(material_code); } } }
//static void LLInventoryView::onQuickFilterCommit(LLUICtrl* ctrl, void* user_data) { LLComboBox* quickfilter = (LLComboBox*)ctrl; LLInventoryView* view = (LLInventoryView*)(quickfilter->getParent()); if (!view->mActivePanel) { return; } std::string item_type = quickfilter->getSimple(); if (view->getString("filter_type_custom") == item_type) { // When they select custom, show the floater then return if( !(view->filtersVisible(view)) ) { view->toggleFindOptions(); } return; } else { if(!LLFilterDictionary::instanceExists()) LLFilterDictionary::instance().init(view); U32 filter_type = LLFilterDictionary::instance().lookup(item_type); if(!filter_type) { llwarns << "Ignoring unknown filter: " << item_type << llendl; return; } else { view->mActivePanel->setFilterTypes( filter_type ); // Force the filters window to update itself, if it's open. LLFloaterInventoryFinder* finder = view->getFinder(); if( finder ) finder->updateElementsFromFilter(); } } }
void LLFloaterWorldMap::trackLandmark( const LLUUID& landmark_item_id ) { LLCtrlSelectionInterface *iface = childGetSelectionInterface("landmark combo"); if (!iface) return; buildLandmarkIDLists(); BOOL found = FALSE; S32 idx; for (idx = 0; idx < mLandmarkItemIDList.count(); idx++) { if ( mLandmarkItemIDList.get(idx) == landmark_item_id) { found = TRUE; break; } } if (found && iface->setCurrentByID( landmark_item_id ) ) { LLUUID asset_id = mLandmarkAssetIDList.get( idx ); std::string name; LLComboBox* combo = getChild<LLComboBox>( "landmark combo"); if (combo) name = combo->getSimple(); mTrackedStatus = LLTracker::TRACKING_LANDMARK; LLTracker::trackLandmark(mLandmarkAssetIDList.get( idx ), // assetID mLandmarkItemIDList.get( idx ), // itemID name); // name if( asset_id != sHomeID ) { // start the download process gLandmarkList.getAsset( asset_id); } // We have to download both region info and landmark data, so set busy. JC // getWindow()->incBusyCount(); } else { LLTracker::stopTracking(NULL); } setDefaultBtn("Teleport"); }
void LLFloaterWorldMap::onAvatarComboCommit() { if( mIsClosing ) { return; } LLCtrlListInterface *list = mListFriendCombo; if (!list) return; const LLUUID& new_avatar_id = list->getCurrentID(); if (new_avatar_id.notNull()) { std::string name; LLComboBox* combo = getChild<LLComboBox>("friend combo"); if (combo) name = combo->getSimple(); trackAvatar(new_avatar_id, name); onShowTargetBtn(); } else { // Reset to user postion if nothing is tracked mSetToUserPosition = ( LLTracker::getTrackingStatus() == LLTracker::TRACKING_NOTHING ); } }
// static void LLPanelLogin::onSelectServer(LLUICtrl*, void*) { // *NOTE: The parameters for this method are ignored. // This function is only called by one thread, so we can use a static here. static bool looping; if (looping) return; looping = true; // LLPanelLogin::onServerComboLostFocus(LLFocusableElement* fe, void*) // calls this method. // The user twiddled with the grid choice ui. // apply the selection to the grid setting. std::string grid_name; S32 grid_index; LLComboBox* combo = sInstance->getChild<LLComboBox>("server_combo"); LLSD combo_val = combo->getValue(); if (LLSD::TypeInteger == combo_val.type()) { grid_index = combo->getValue().asInteger(); grid_name = combo->getSimple(); } else { // no valid selection, return other grid_index = (S32)GRID_INFO_OTHER; grid_name = combo_val.asString(); } // This new selection will override preset uris // from the command line. LLViewerLogin* vl = LLViewerLogin::getInstance(); if(grid_index != GRID_INFO_OTHER) { vl->setGridChoice((EGridInfo)grid_index); } else { vl->setGridChoice(grid_name); } // Find a saved login entry that uses this grid, if any. bool found = false; LLSavedLoginsList const& entries = sInstance->mLoginHistoryData.getEntries(); for (LLSavedLoginsList::const_reverse_iterator i = entries.rbegin(); i != entries.rend(); ++i) { if (!i->asLLSD().isMap()) { continue; } if (i->getGridName() == grid_name) { if (!vl->nameEditted()) { // Change the other fields to match this grid. LLPanelLogin::setFields(*i, false); } else // Probably creating a new account. { // Likely the current password is for a different grid. clearPassword(); } found = true; break; } } if (!found) { clearPassword(); // If the grid_name starts with 'http[s]://' then // we have to assume it's a new loginuri, set // on the commandline. if (grid_name.substr(0, 4) == "http") { // Use it as login uri. vl->setGridURI(grid_name); // And set the login page if it was given. std::string loginPage = gSavedSettings.getString("LoginPage"); std::string helperURI = gSavedSettings.getString("CmdLineHelperURI"); if (!loginPage.empty()) vl->setLoginPageURI(loginPage); if (!helperURI.empty()) vl->setHelperURI(helperURI); } } // grid changed so show new splash screen (possibly) loadLoginPage(); looping = false; }
// static void LLFloaterTestImpl::onCommitCombo(LLUICtrl* ctrl, const LLSD& value) { LLComboBox* combo = (LLComboBox*)ctrl; llinfos << "commit combo name " << combo->getSimple() << " value " << value.asString() << llendl; }
void LLFacebookPhotoPanel::updateResolution(BOOL do_update) { LLComboBox* combobox = static_cast<LLComboBox *>(mResolutionComboBox); LLComboBox* filterbox = static_cast<LLComboBox *>(mFilterComboBox); std::string sdstring = combobox->getSelectedValue(); LLSD sdres; std::stringstream sstream(sdstring); LLSDSerialize::fromNotation(sdres, sstream, sdstring.size()); S32 width = sdres[0]; S32 height = sdres[1]; // Note : index 0 of the filter drop down is assumed to be "No filter" in whichever locale std::string filter_name = (filterbox->getCurrentIndex() ? filterbox->getSimple() : ""); LLSnapshotLivePreview * previewp = static_cast<LLSnapshotLivePreview *>(mPreviewHandle.get()); if (previewp && combobox->getCurrentIndex() >= 0) { // <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare; moved up checkAspectRatio(width); S32 original_width = 0 , original_height = 0 ; previewp->getSize(original_width, original_height) ; if (width == 0 || height == 0) { // take resolution from current window size LL_DEBUGS() << "Setting preview res from window: " << gViewerWindow->getWindowWidthRaw() << "x" << gViewerWindow->getWindowHeightRaw() << LL_ENDL; previewp->setSize(gViewerWindow->getWindowWidthRaw(), gViewerWindow->getWindowHeightRaw()); } // <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare else if (width == -1 || height == -1) { // take resolution from custom size LLSpinCtrl* width_spinner = getChild<LLSpinCtrl>("custom_snapshot_width"); LLSpinCtrl* height_spinner = getChild<LLSpinCtrl>("custom_snapshot_height"); S32 custom_width = width_spinner->getValue().asInteger(); S32 custom_height = height_spinner->getValue().asInteger(); if (checkImageSize(previewp, custom_width, custom_height, TRUE, previewp->getMaxImageSize())) { width_spinner->set(custom_width); height_spinner->set(custom_height); } LL_DEBUGS() << "Setting preview res from custom: " << custom_width << "x" << custom_height << LL_ENDL; previewp->setSize(custom_width, custom_height); } // </FS:Ansariel> else { // use the resolution from the selected pre-canned drop-down choice LL_DEBUGS() << "Setting preview res selected from combo: " << width << "x" << height << LL_ENDL; previewp->setSize(width, height); } // <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare; moved up //checkAspectRatio(width); previewp->getSize(width, height); // Recompute quality setting mQuality = compute_jpeg_quality(width, height); previewp->setSnapshotQuality(mQuality, false); if (original_width != width || original_height != height) { previewp->setSize(width, height); if (do_update) { previewp->updateSnapshot(TRUE); updateControls(); } } // Get the old filter, compare to the current one "filter_name" and set if changed std::string original_filter = previewp->getFilter(); if (original_filter != filter_name) { previewp->setFilter(filter_name); if (do_update) { previewp->updateSnapshot(FALSE, TRUE); updateControls(); } } } // <FS:Ansariel> FIRE-15112: Allow custom resolution for SLShare BOOL custom_resolution = static_cast<LLComboBox *>(mResolutionComboBox)->getSelectedValue().asString() == "[i-1,i-1]"; getChild<LLSpinCtrl>("custom_snapshot_width")->setEnabled(custom_resolution); getChild<LLSpinCtrl>("custom_snapshot_height")->setEnabled(custom_resolution); getChild<LLCheckBoxCtrl>("keep_aspect_ratio")->setEnabled(custom_resolution); // </FS:Ansariel> }