void LLFloaterBuyContents::onClickBuy()
{
	// Make sure this wasn't selected through other mechanisms 
	// (ie, being the default button and pressing enter.
	if(!getChildView("buy_btn")->getEnabled())
	{
		// We shouldn't be enabled.  Just close.
		closeFloater();
		return;
	}

	// We may want to wear this item
	if (getChild<LLUICtrl>("wear_check")->getValue())
	{
		LLInventoryState::sWearNewClothing = TRUE;
	}

	// Put the items where we put new folders.
	LLUUID category_id;
	category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_ROOT_INVENTORY);

	// *NOTE: doesn't work for multiple object buy, which UI does not
	// currently support sale info is used for verification only, if
	// it doesn't match region info then sale is canceled.
	LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo);

	// NOTE: do this here instead of on receipt of object, since contents are transfered
	// via a generic BulkUpdateInventory message with no way of distinguishing it from
	// other inventory operations
	LLFirstUse::newInventory();
	closeFloater();
}
Esempio n. 2
0
void LLFloaterEditSky::onSaveConfirmed()
{
	// Save current params to the selected preset.
	LLWLParamKey key(getSelectedSkyPreset());

	LL_DEBUGS("Windlight") << "Saving sky preset " << key.name << LL_ENDL;
	LLWLParamManager& wl_mgr = LLWLParamManager::instance();
	if (wl_mgr.hasParamSet(key))
	{
		wl_mgr.setParamSet(key, wl_mgr.mCurParams);
	}
	else
	{
		wl_mgr.addParamSet(key, wl_mgr.mCurParams);
	}

	wl_mgr.savePreset(key);

	// Change preference if requested.
	if (mMakeDefaultCheckBox->getValue())
	{
		LL_DEBUGS("Windlight") << key.name << " is now the new preferred sky preset" << LL_ENDL;
		LLEnvManagerNew::instance().setUseSkyPreset(key.name);
	}

	closeFloater();
}
// static 
void LLFloaterPreference::onBtnOK()
{
	// commit any outstanding text entry
	if (hasFocus())
	{
		LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
		if (cur_focus && cur_focus->acceptsTextInput())
		{
			cur_focus->onCommit();
		}
	}

	if (canClose())
	{
		saveSettings();
		apply();
		closeFloater(false);

		LLUIColorTable::instance().saveUserSettings();
		gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE );
		std::string crash_settings_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, CRASH_SETTINGS_FILE);
		// save all settings, even if equals defaults
		gCrashSettings.saveToFile(crash_settings_filename, FALSE);
	}
	else
	{
		// Show beep, pop up dialog, etc.
		llinfos << "Can't close preferences!" << llendl;
	}

	LLPanelLogin::refreshLocation( false );
}
void LLTextureCtrl::setEnabled( BOOL enabled )
{
	LLFloaterTexturePicker* floaterp = (LLFloaterTexturePicker*)mFloaterHandle.get();
	if( enabled )
	{
		std::string tooltip;
		if (floaterp) tooltip = floaterp->getString("choose_picture");
		setToolTip( tooltip );
	}
	else
	{
		setToolTip( std::string() );
		// *TODO: would be better to keep floater open and show
		// disabled state.
		closeFloater();
	}

	if( floaterp )
	{
		floaterp->setActive(enabled);
	}

	mCaption->setEnabled( enabled );
	mEnable = enabled;
	// <edit>
	/*
	LLView::setEnabled( enabled );
	*/
	// </edit>
}
Esempio n. 5
0
void LLInspectObject::onClickMoreInfo()
{
	LLSD key;
	key["task"] = "task";
	LLSideTray::getInstance()->showPanel("sidepanel_inventory", key);	
	closeFloater();
}
Esempio n. 6
0
void LLInspectObject::onClickMoreInfo()
{
	LLSD key;
	key["task"] = "task";
	LLFloaterSidePanelContainer::showPanel("inventory", key);
	closeFloater();
}
Esempio n. 7
0
// virtual
void LLInspect::draw()
{
	static LLCachedControl<F32> FADE_TIME(*LLUI::sSettingGroups["config"], "InspectorFadeTime", 1.f);
	static LLCachedControl<F32> STAY_TIME(*LLUI::sSettingGroups["config"], "InspectorShowTime", 1.f);
	if (mOpenTimer.getStarted())
	{
		LLFloater::draw();
		if (mOpenTimer.getElapsedTimeF32() > STAY_TIME)
		{
			mOpenTimer.stop();
			mCloseTimer.start();
		}

	}
	else if (mCloseTimer.getStarted())
	{
		F32 alpha = clamp_rescale(mCloseTimer.getElapsedTimeF32(), 0.f, FADE_TIME, 1.f, 0.f);
		LLViewDrawContext context(alpha);
		LLFloater::draw();
		if (mCloseTimer.getElapsedTimeF32() > FADE_TIME)
		{
			closeFloater(false);
		}
	}
	else
	{
		LLFloater::draw();
	}
}
void LLFloaterBuyCurrencyUI::onClickErrorWeb()
{
	LLWeb::loadURLExternal(mManager.errorURI());
	closeFloater();
	// Update L$ balance
	LLStatusBar::sendMoneyBalanceRequest();
}
void LLInspectAvatar::onClickCSR()
{
	std::string name;
	gCacheName->getFullName(mAvatarID, name);
	LLAvatarActions::csr(mAvatarID, name);
	closeFloater();
}
Esempio n. 10
0
void LLInspectGroup::requestUpdate()
{
	// Don't make network requests when spawning from the debug menu at the
	// login screen (which is useful to work on the layout).
	if (mGroupID.isNull())
	{
		if (LLStartUp::getStartupState() >= STATE_STARTED)
		{
			// once we're running we don't want to show the test floater
			// for bogus LLUUID::null links
			closeFloater();
		}
		return;
	}

	// Clear out old data so it doesn't flash between old and new
	getChild<LLUICtrl>("group_name")->setValue("");
	getChild<LLUICtrl>("group_subtitle")->setValue("");
	getChild<LLUICtrl>("group_details")->setValue("");
	getChild<LLUICtrl>("group_cost")->setValue("");
	// Must have a visible button so the inspector can take focus
	getChild<LLUICtrl>("view_profile_btn")->setVisible(true);
	getChild<LLUICtrl>("leave_btn")->setVisible(false);
	getChild<LLUICtrl>("join_btn")->setVisible(false);
	
	// Make a new request for properties
	delete mPropertiesRequest;
	mPropertiesRequest = new LLFetchGroupData(mGroupID, this);

	// Name lookup will be faster out of cache, use that
	gCacheName->getGroup(mGroupID,
		boost::bind(&LLInspectGroup::nameUpdatedCallback,
			this, _1, _2, _3));
}
void LLFloaterColorPicker::showUI ()
{
	setVisible ( TRUE );
	setFocus ( TRUE );
	openFloater(getKey());

	// HACK: if system color picker is required - close the SL one we made and use default system dialog
	if ( gSavedSettings.getBOOL ( "UseDefaultColorPicker" ) )
	{
		LLColorSwatchCtrl* swatch = getSwatch ();

		setVisible ( FALSE );

		// code that will get switched in for default system color picker
		if ( swatch )
		{
			LLColor4 curCol = swatch->get ();
			send_agent_pause();
			getWindow()->dialogColorPicker( &curCol [ 0 ], &curCol [ 1 ], &curCol [ 2 ] );
			send_agent_resume();

			setOrigRgb ( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] );
			setCurRgb( curCol [ 0 ], curCol [ 1 ], curCol [ 2 ] );

			LLColorSwatchCtrl::onColorChanged ( swatch, LLColorSwatchCtrl::COLOR_CHANGE );
		}

		closeFloater();
	}
}
void LLInspectRemoteObject::onClickBlock()
{
	LLMute::EType mute_type = mGroupOwned ? LLMute::GROUP : LLMute::AGENT;
	LLMute mute(mOwnerID, mOwner, mute_type);
	LLMuteList::getInstance()->add(mute);
	LLPanelBlockedList::showPanelAndSelect(mute.mID);
	closeFloater();
}
Esempio n. 13
0
void LLMultiFloater::tabClose()
{
	if (mTabContainer->getTabCount() == 0)
	{
		// no more children, close myself
		closeFloater();
	}
}
void LLFloaterAuction::cleanupAndClose()
{
	mImageID.setNull();
	mImage = NULL;
	mParcelID = -1;
	mParcelHost.invalidate();
	closeFloater();
}
Esempio n. 15
0
void LLTextureCtrl::setVisible( BOOL visible ) 
{
	if( !visible )
	{
		closeFloater();
	}
	LLUICtrl::setVisible( visible );
}
void LLInspectAvatar::requestUpdate()
{
	// Don't make network requests when spawning from the debug menu at the
	// login screen (which is useful to work on the layout).
	if (mAvatarID.isNull())
	{
		if (LLStartUp::getStartupState() >= STATE_STARTED)
		{
			// once we're running we don't want to show the test floater
			// for bogus LLUUID::null links
			closeFloater();
		}
		return;
	}

	// Clear out old data so it doesn't flash between old and new
	getChild<LLUICtrl>("user_name")->setValue("");
	getChild<LLUICtrl>("user_subtitle")->setValue("");
	getChild<LLUICtrl>("user_details")->setValue("");
	
	// Make a new request for properties
	delete mPropertiesRequest;
	mPropertiesRequest = new LLFetchAvatarData(mAvatarID, this);

	// You can't re-add someone as a friend if they are already your friend
	bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL;
	bool is_self = (mAvatarID == gAgentID);
	if (is_self)
	{
		getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
		getChild<LLUICtrl>("im_btn")->setVisible(false);
	}
	else if (is_friend)
	{
		getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
		getChild<LLUICtrl>("im_btn")->setVisible(true);
	}
	else
	{
		getChild<LLUICtrl>("add_friend_btn")->setVisible(true);
		getChild<LLUICtrl>("im_btn")->setVisible(false);
	}

	// Use an avatar_icon even though the image id will come down with the
	// avatar properties because the avatar_icon code maintains a cache of icons
	// and this may result in the image being visible sooner.
	// *NOTE: This may generate a duplicate avatar properties request, but that
	// will be suppressed internally in the avatar properties processor.
	
	//remove avatar id from cache to get fresh info
	LLAvatarIconIDCache::getInstance()->remove(mAvatarID);

	childSetValue("avatar_icon", LLSD(mAvatarID) );

	gCacheName->get(mAvatarID, FALSE,
		boost::bind(&LLInspectAvatar::nameUpdatedCallback,
			this, _1, _2, _3, _4));
}
void LLFloaterFacebook::onCancel()
{
    LLFloaterBigPreview* big_preview_floater = dynamic_cast<LLFloaterBigPreview*>(LLFloaterReg::getInstance("big_preview"));
    if (big_preview_floater)
    {
        big_preview_floater->closeOnFloaterOwnerClosing(this);
    }
    closeFloater();
}
Esempio n. 18
0
//////////////////////////////////////////////////////////////////////////
// Private Section
void LLFloaterGetBlockedObjectName::applyBlocking()
{
	if (mGetObjectNameCallback)
	{
		const std::string& text = getChild<LLUICtrl>("object_name")->getValue().asString();
		mGetObjectNameCallback(text);
	}
	closeFloater();
}
void FSAreaSearch::cancel()
{
	checkRegion();
	closeFloater();
	
	mSearchedName = "";
	mSearchedDesc = "";
	mSearchedOwner = "";
	mSearchedGroup = "";
}
 void onSave()
 {
     mItemName = childGetValue("name ed").asString();
     LLStringUtil::trim(mItemName);
     if( !mItemName.empty() )
     {
         mSaveAsSignal(mItemName);
         closeFloater(); // destroys this object
     }
 }
Esempio n. 21
0
void LLPreviewNotecard::deleteNotecard()
{
	LLViewerInventoryItem* item = gInventory.getItem(mItemUUID);
	if (item != NULL)
	{
		const LLUUID trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
		change_item_parent(&gInventory, item, trash_id, FALSE);
	}

	closeFloater();
}
void FSFloaterObjectExport::onOpen(const LLSD& key)
{
	LLObjectSelectionHandle object_selection = LLSelectMgr::getInstance()->getSelection();
	if(!(object_selection->getPrimaryObject()))
	{
		closeFloater();
		return;
	}
	mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
	refresh();
}
void LLFloaterHardwareSettings::cancel()
{
	gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO);
	gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso);
	gSavedSettings.setU32("RenderFSAASamples", mFSAASamples);
	gSavedSettings.setF32("RenderGamma", mGamma);
	gSavedSettings.setS32("TextureMemory", mVideoCardMem);
	gSavedSettings.setF32("RenderFogRatio", mFogRatio);
	gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup );

	closeFloater();
}
Esempio n. 24
0
void LLMultiFloater::draw()
{
	if (mTabContainer->getTabCount() == 0)
	{
		//RN: could this potentially crash in draw hierarchy?
		closeFloater();
	}
	else
	{
		LLFloater::draw();
	}
}
void LLCallFloater::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state)
{
	// check is voice operational and if it doesn't work hide VCP (EXT-4397)
	if(LLVoiceClient::getInstance()->voiceEnabled() && LLVoiceClient::getInstance()->isVoiceWorking())
	{
		updateState(new_state);
	}
	else
	{
		closeFloater();
	}
}
void LLFloaterWindowSize::onClickSet()
{
	LLComboBox* ctrl_window_size = getChild<LLComboBox>("window_size_combo");
	U32 width = 0;
	U32 height = 0;
	std::string resolution = ctrl_window_size->getValue().asString();
	if (extractWindowSizeFromString(resolution, &width, &height))
	{
		LLViewerWindow::movieSize(width, height);
	}
	closeFloater();
}
void LLFloaterBuy::onClickBuy()
{
	// Put the items where we put new folders.
	LLUUID category_id;
	category_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OBJECT);

	// *NOTE: doesn't work for multiple object buy, which UI does not
	// currently support sale info is used for verification only, if
	// it doesn't match region info then sale is canceled.
	LLSelectMgr::getInstance()->sendBuy(gAgent.getID(), category_id, mSaleInfo );

	closeFloater();
}
void KVFloaterFlickrUpload::authCallback(bool authorised)
{
	if(authorised)
	{
		childSetValue("account_name", gSavedPerAccountSettings.getString("KittyFlickrUsername"));
		childSetEnabled("upload_btn", true);
	}
	else
	{
		LLNotificationsUtil::add("KittyFlickrUploadCancelledAuthRejected");
		closeFloater(false);
	}
}
// virtual
void FloaterHop::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event)
{
	if(event == MEDIA_EVENT_LOCATION_CHANGED)
	{
		const std::string url = self->getLocation();

		set_current_url( url );
	}
	else if(event == MEDIA_EVENT_NAVIGATE_BEGIN)
	{

	}
	else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE)
	{

	}
	else if(event == MEDIA_EVENT_CLOSE_REQUEST)
	{
		// The browser instance wants its window closed.
		closeFloater();
	}
	else if(event == MEDIA_EVENT_GEOMETRY_CHANGE)
	{
		geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight());
	}
	else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED )
	{

	}
	else if(event == MEDIA_EVENT_PROGRESS_UPDATED )
	{

	}
	else if(event == MEDIA_EVENT_NAME_CHANGED )
	{
		std::string page_title = self->getMediaName();
		// simulate browser behavior - title is empty, use the current URL
		if (mShowPageTitle)
		{
			if ( page_title.length() > 0 )
				setTitle( page_title );
			else
				setTitle( mCurrentURL );
		}
	}
	else if(event == MEDIA_EVENT_LINK_HOVERED )
	{

	}
}
// static 
void LLFloaterPreference::onBtnCancel()
{
	if (hasFocus())
	{
		LLUICtrl* cur_focus = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus());
		if (cur_focus && cur_focus->acceptsTextInput())
		{
			cur_focus->onCommit();
		}
		refresh();
	}
	cancel();
	closeFloater();
}