diff options
| -rwxr-xr-x | indra/newview/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | indra/newview/llfloaterdeleteprefpreset.cpp | 12 | ||||
| -rw-r--r-- | indra/newview/llfloaterloadprefpreset.cpp | 92 | ||||
| -rw-r--r-- | indra/newview/llfloaterloadprefpreset.h | 53 | ||||
| -rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 123 | ||||
| -rwxr-xr-x | indra/newview/llfloaterpreference.h | 9 | ||||
| -rw-r--r-- | indra/newview/llpanelpresetspulldown.h | 2 | ||||
| -rw-r--r-- | indra/newview/llpresetsmanager.cpp | 22 | ||||
| -rw-r--r-- | indra/newview/llpresetsmanager.h | 4 | ||||
| -rwxr-xr-x | indra/newview/llviewerfloaterreg.cpp | 2 | ||||
| -rw-r--r-- | indra/newview/skins/default/xui/en/floater_load_pref_preset.xml | 49 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 83 | ||||
| -rwxr-xr-x | indra/newview/skins/default/xui/en/strings.xml | 1 | 
13 files changed, 358 insertions, 96 deletions
| diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 192be979fb..d1b0aae542 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -255,6 +255,7 @@ set(viewer_SOURCE_FILES      llfloaterlagmeter.cpp      llfloaterland.cpp      llfloaterlandholdings.cpp +    llfloaterloadprefpreset.cpp      llfloatermap.cpp      llfloatermediasettings.cpp      llfloatermemleak.cpp @@ -866,6 +867,7 @@ set(viewer_HEADER_FILES      llfloaterlagmeter.h      llfloaterland.h      llfloaterlandholdings.h +    llfloaterloadprefpreset.h      llfloatermap.h      llfloatermediasettings.h      llfloatermemleak.h diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index f147a5ee90..5cd37d61fc 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -1,5 +1,5 @@  /**  - * @file llfloaterdeletprefpreset.cpp + * @file llfloaterdeleteprefpreset.cpp   * @brief Floater to delete a graphics / camera preset   *   * $LicenseInfo:firstyear=2014&license=viewerlgpl$ @@ -67,15 +67,7 @@ void LLFloaterDeletePrefPreset::onBtnDelete()  	LLComboBox* combo = getChild<LLComboBox>("preset_combo");  	std::string name = combo->getSimple(); -	if (LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name)) -	{ -		// If you delete the active preset (which should never happen) then recreate it. -		if (name == gSavedSettings.getString("PresetGraphicActive")) -		{ -			LLPresetsManager::getInstance()->savePreset(mSubdirectory, PRESETS_DEFAULT); -		} -	} -	else +	if (!LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name))  	{  		LLSD args;  		args["NAME"] = name; diff --git a/indra/newview/llfloaterloadprefpreset.cpp b/indra/newview/llfloaterloadprefpreset.cpp new file mode 100644 index 0000000000..6ec2e5c09d --- /dev/null +++ b/indra/newview/llfloaterloadprefpreset.cpp @@ -0,0 +1,92 @@ +/**  + * @file llfloateloadprefpreset.cpp + * @brief Floater to load a graphics / camera preset + * + * $LicenseInfo:firstyear=2015&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2015, Linden Research, Inc. + *  + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + *  + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + * Lesser General Public License for more details. + *  + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA + *  + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloaterloadprefpreset.h" + +#include "llbutton.h" +#include "llcombobox.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" +#include "llpresetsmanager.h" +#include "llviewercontrol.h" + +LLFloaterLoadPrefPreset::LLFloaterLoadPrefPreset(const LLSD &key) +:	LLFloater(key) +{ +} + +// virtual +BOOL LLFloaterLoadPrefPreset::postBuild() +{ +	getChild<LLButton>("ok")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnOk, this)); +	getChild<LLButton>("cancel")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnCancel, this)); +	LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterLoadPrefPreset::onPresetsListChange, this)); + +	return TRUE; +} + +void LLFloaterLoadPrefPreset::onOpen(const LLSD& key) +{ +	mSubdirectory = key.asString(); +	std::string floater_title = getString(std::string("title_") + mSubdirectory); + +	setTitle(floater_title); + +	LLComboBox* combo = getChild<LLComboBox>("preset_combo"); + +	EDefaultOptions option = DEFAULT_TOP; +	LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); +} + +void LLFloaterLoadPrefPreset::onPresetsListChange() +{ +	LLComboBox* combo = getChild<LLComboBox>("preset_combo"); + +	EDefaultOptions option = DEFAULT_TOP; +	LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo, option); +} + +void LLFloaterLoadPrefPreset::onBtnCancel() +{ +	closeFloater(); +} + +void LLFloaterLoadPrefPreset::onBtnOk() +{ +	LLComboBox* combo = getChild<LLComboBox>("preset_combo"); +	std::string name = combo->getSimple(); + +	LLPresetsManager::getInstance()->loadPreset(mSubdirectory, name); +	LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); +	if (instance) +	{ +		instance->refreshEnabledGraphics(); +	} + +	closeFloater(); +} diff --git a/indra/newview/llfloaterloadprefpreset.h b/indra/newview/llfloaterloadprefpreset.h new file mode 100644 index 0000000000..9471f6f1e1 --- /dev/null +++ b/indra/newview/llfloaterloadprefpreset.h @@ -0,0 +1,53 @@ +/**  + * @file llfloaterloadprefpreset.h + * @brief Floater to load a graphics / camera preset + + * + * $LicenseInfo:firstyear=2015&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2015, Linden Research, Inc. + *  + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + *  + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU + * Lesser General Public License for more details. + *  + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA + *  + * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERLOADPREFPRESET_H +#define LL_LLFLOATERLOADPREFPRESET_H + +#include "llfloater.h" + +class LLComboBox; + +class LLFloaterLoadPrefPreset : public LLFloater +{ + +public: +	LLFloaterLoadPrefPreset(const LLSD &key); + +	/*virtual*/	BOOL	postBuild(); +	/*virtual*/ void	onOpen(const LLSD& key); + +	void onBtnOk(); +	void onBtnCancel(); + +private: +	void onPresetsListChange(); + +	std::string mSubdirectory; +}; + +#endif // LL_LLFLOATERLOADPREFPRESET_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cb59cc27d7..6dd030b280 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -107,6 +107,7 @@  #include "lllogininstance.h"        // to check if logged in yet  #include "llsdserialize.h" +#include "llpanelpresetspulldown.h"  #include "llpresetsmanager.h"  #include "llviewercontrol.h"  #include "llpresetsmanager.h" @@ -735,11 +736,11 @@ void LLFloaterPreference::onOpen(const LLSD& key)  	bool started = (LLStartUp::getStartupState() == STATE_STARTED); -	LLComboBox* combo = getChild<LLComboBox>("graphic_preset_combo"); +	LLButton* load_btn = findChild<LLButton>("PrefLoadButton");	  	LLButton* save_btn = findChild<LLButton>("PrefSaveButton");	  	LLButton* delete_btn = findChild<LLButton>("PrefDeleteButton");	 -	combo->setEnabled(started); +	load_btn->setEnabled(started);  	save_btn->setEnabled(started);  	delete_btn->setEnabled(started);  } @@ -789,8 +790,6 @@ void LLFloaterPreference::setHardwareDefaults()  		if (panel)  			panel->setHardwareDefaults();  	} - -	LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT);  }  void LLFloaterPreference::getControlNames(std::vector<std::string>& names) @@ -899,11 +898,6 @@ void LLFloaterPreference::onBtnOK()  		LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();  		pPathfindingConsole->onRegionBoundaryCross();  	} - -	// Write settings to currently defined preset.  This will recreate a missing preset file -	// and ensure the preset file matches the current settings (which may have been changed -	// via some other means). -	LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive"));  }  // static  @@ -1156,11 +1150,11 @@ void LLFloaterPreference::refreshEnabledState()  	if (gSavedSettings.getBOOL("VertexShaderEnable") == FALSE ||   		gSavedSettings.getBOOL("RenderAvatarVP") == FALSE)  	{ -		ctrl_avatar_cloth->setEnabled(false); +		ctrl_avatar_cloth->setEnabled(FALSE);  	}   	else  	{ -		ctrl_avatar_cloth->setEnabled(true); +		ctrl_avatar_cloth->setEnabled(TRUE);  	}  	// Vertex Shaders @@ -1174,14 +1168,16 @@ void LLFloaterPreference::refreshEnabledState()  	BOOL shaders = ctrl_shader_enable->get();  	if (shaders)  	{ +llwarns << "DBG terrain OFF" << llendl;  		terrain_detail->setValue(1);  		terrain_detail->setEnabled(FALSE); -		terrain_text->setEnabled(false); +		terrain_text->setEnabled(FALSE);  	}  	else  	{ +llwarns << "DBG terrain ON" << llendl;  		terrain_detail->setEnabled(TRUE); -		terrain_text->setEnabled(true); +		terrain_text->setEnabled(TRUE);  	}  	// WindLight @@ -1331,12 +1327,12 @@ void LLFloaterPreference::disableUnavailableSettings()  		ctrl_wind_light->setEnabled(FALSE);  		ctrl_wind_light->setValue(FALSE); -		sky->setEnabled(false); -		sky_text->setEnabled(false); +		sky->setEnabled(FALSE); +		sky_text->setEnabled(FALSE);  		ctrl_reflections->setEnabled(FALSE);  		ctrl_reflections->setValue(0); -		reflections_text->setEnabled(false); +		reflections_text->setEnabled(FALSE);  		ctrl_avatar_vp->setEnabled(FALSE);  		ctrl_avatar_vp->setValue(FALSE); @@ -1346,7 +1342,7 @@ void LLFloaterPreference::disableUnavailableSettings()  		ctrl_shadows->setEnabled(FALSE);  		ctrl_shadows->setValue(0); -		shadows_text->setEnabled(false); +		shadows_text->setEnabled(FALSE);  		ctrl_ssao->setEnabled(FALSE);  		ctrl_ssao->setValue(FALSE); @@ -1366,13 +1362,13 @@ void LLFloaterPreference::disableUnavailableSettings()  		ctrl_wind_light->setEnabled(FALSE);  		ctrl_wind_light->setValue(FALSE); -		sky->setEnabled(false); -		sky_text->setEnabled(false); +		sky->setEnabled(FALSE); +		sky_text->setEnabled(FALSE);  		//deferred needs windlight, disable deferred  		ctrl_shadows->setEnabled(FALSE);  		ctrl_shadows->setValue(0); -		shadows_text->setEnabled(false); +		shadows_text->setEnabled(FALSE);  		ctrl_ssao->setEnabled(FALSE);  		ctrl_ssao->setValue(FALSE); @@ -1392,7 +1388,7 @@ void LLFloaterPreference::disableUnavailableSettings()  	{  		ctrl_shadows->setEnabled(FALSE);  		ctrl_shadows->setValue(0); -		shadows_text->setEnabled(false); +		shadows_text->setEnabled(FALSE);  		ctrl_ssao->setEnabled(FALSE);  		ctrl_ssao->setValue(FALSE); @@ -1418,7 +1414,7 @@ void LLFloaterPreference::disableUnavailableSettings()  	{  		ctrl_shadows->setEnabled(FALSE);  		ctrl_shadows->setValue(0); -		shadows_text->setEnabled(false); +		shadows_text->setEnabled(FALSE);  	}  	// disabled reflections @@ -1426,7 +1422,7 @@ void LLFloaterPreference::disableUnavailableSettings()  	{  		ctrl_reflections->setEnabled(FALSE);  		ctrl_reflections->setValue(FALSE); -		reflections_text->setEnabled(false); +		reflections_text->setEnabled(FALSE);  	}  	// disabled av @@ -1441,7 +1437,7 @@ void LLFloaterPreference::disableUnavailableSettings()  		//deferred needs AvatarVP, disable deferred  		ctrl_shadows->setEnabled(FALSE);  		ctrl_shadows->setValue(0); -		shadows_text->setEnabled(false); +		shadows_text->setEnabled(FALSE);  		ctrl_ssao->setEnabled(FALSE);  		ctrl_ssao->setValue(FALSE); @@ -1488,7 +1484,6 @@ void LLFloaterPreference::refresh()  	updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail",	true), getChild<LLTextBox>("FlexibleMeshDetailText",	true));  	updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail",		true), getChild<LLTextBox>("TreeMeshDetailText",		true));  	updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail",		true), getChild<LLTextBox>("AvatarMeshDetailText",		true)); -	updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2",		true), getChild<LLTextBox>("AvatarMeshDetailText2",		true));  	updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail",	true), getChild<LLTextBox>("AvatarPhysicsDetailText",		true));  	updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail",	true), getChild<LLTextBox>("TerrainMeshDetailText",		true));  	updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess",	true), getChild<LLTextBox>("PostProcessText",			true)); @@ -1782,8 +1777,11 @@ void LLFloaterPreference::updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* te  	F32 value = (F32)ctrl->getValue().asReal(); -	if (0.0f == value) +	if (101.0f == value)  	{ +		// It has been decided that having the slider all the way to the right will be the off position, which +		// is a value of 101, so it is necessary to change value to 0 disable impostor generation. +		value = 0.0f;  		text_box->setText(LLTrans::getString("Off"));  	}  	else @@ -2007,9 +2005,9 @@ LLPanelPreference::LLPanelPreference()  {  	mCommitCallbackRegistrar.add("Pref.setControlFalse",	boost::bind(&LLPanelPreference::setControlFalse,this, _2));  	mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox",	boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); -	mCommitCallbackRegistrar.add("Pref.Preset",	boost::bind(&LLPanelPreference::onChangePreset, this, _2));  	mCommitCallbackRegistrar.add("Pref.PrefDelete",	boost::bind(&LLPanelPreference::DeletePreset, this, _2));  	mCommitCallbackRegistrar.add("Pref.PrefSave",	boost::bind(&LLPanelPreference::SavePreset, this, _2)); +	mCommitCallbackRegistrar.add("Pref.PrefLoad",	boost::bind(&LLPanelPreference::LoadPreset, this, _2));  }  //virtual @@ -2219,19 +2217,10 @@ void LLPanelPreference::SavePreset(const LLSD& user_data)  	LLFloaterReg::showInstance("save_pref_preset", subdirectory);  } -void LLPanelPreference::onChangePreset(const LLSD& user_data) +void LLPanelPreference::LoadPreset(const LLSD& user_data)  {  	std::string subdirectory = user_data.asString(); - -	LLComboBox* combo = getChild<LLComboBox>(subdirectory + "_preset_combo"); -	std::string name = combo->getSimple(); - -	LLPresetsManager::getInstance()->loadPreset(subdirectory, name); -	LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); -	if (instance) -	{ -		instance->refreshEnabledGraphics(); -	} +	LLFloaterReg::showInstance("load_pref_preset", subdirectory);  }  void LLPanelPreference::setHardwareDefaults() @@ -2293,27 +2282,52 @@ BOOL LLPanelPreferenceGraphics::postBuild()  	}  #endif -	LLComboBox* combo = getChild<LLComboBox>("graphic_preset_combo"); -	combo->setLabel(LLTrans::getString("preset_combo_label")); - -	setPresetNamesInComboBox(); - +	setPresetText();  	LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this));  	return LLPanelPreference::postBuild();  } +void LLPanelPreferenceGraphics::draw() +{ +	LLPanelPreference::draw(); +	setPresetText(); +} +  void LLPanelPreferenceGraphics::onPresetsListChange()  { -	setPresetNamesInComboBox(); +	resetDirtyChilds(); +	setPresetText();  } -void LLPanelPreferenceGraphics::setPresetNamesInComboBox() +void LLPanelPreferenceGraphics::setPresetText()  { -	LLComboBox* combo = getChild<LLComboBox>("graphic_preset_combo"); +	LLTextBox* preset_text = getChild<LLTextBox>("preset_text"); -	EDefaultOptions option = DEFAULT_SHOW; -	LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); +	if (hasDirtyChilds()) +	{ +		gSavedSettings.setString("PresetGraphicActive", ""); + +		LLPanelPresetsPulldown* instance = LLFloaterReg::findTypedInstance<LLPanelPresetsPulldown>("presets_pulldown"); +		if (instance) +		{ +llwarns << "DBG populate" << llendl; +			instance->populatePanel(); +		} +	} + +	std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); + +	if (!preset_graphic_active.empty()) +	{ +		preset_text->setText(preset_graphic_active); +	} +	else +	{ +		preset_text->setText(LLTrans::getString("none_paren_cap")); +	} + +	preset_text->resetDirty();  }  bool LLPanelPreferenceGraphics::hasDirtyChilds() @@ -2330,7 +2344,18 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds()  		if (ctrl)  		{  			if (ctrl->isDirty()) -				return true; +			{ +				LLControlVariable* control = ctrl->getControlVariable(); +				if (control) +				{ +					std::string control_name = control->getName(); +					if ((control_name != "RenderDeferred") && (control_name != "RenderTerrainDetail")) +					{ +llwarns << "DBG " << control_name << llendl; +						return true; +					} +				} +			}  		}  		// Push children onto the end of the work stack  		for (child_list_t::const_iterator iter = curview->getChildList()->begin(); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 96d026277f..f73560e3c5 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -222,9 +222,9 @@ public:  	// cancel() can restore them.  	virtual void saveSettings(); -	void onChangePreset(const LLSD& user_data);  	void DeletePreset(const LLSD& user_data);  	void SavePreset(const LLSD& user_data); +	void LoadPreset(const LLSD& user_data);  	class Updater; @@ -248,15 +248,18 @@ class LLPanelPreferenceGraphics : public LLPanelPreference  {  public:  	BOOL postBuild(); +	void draw();  	void cancel();  	void saveSettings(); +	void resetDirtyChilds();  	void setHardwareDefaults(); -	void setPresetNamesInComboBox(); +	void setPresetText(); +  	static const std::string getPresetsPath();  protected:  	bool hasDirtyChilds(); -	void resetDirtyChilds(); +private:  	void onPresetsListChange();  }; diff --git a/indra/newview/llpanelpresetspulldown.h b/indra/newview/llpanelpresetspulldown.h index f3e0340247..146ccc0b09 100644 --- a/indra/newview/llpanelpresetspulldown.h +++ b/indra/newview/llpanelpresetspulldown.h @@ -43,9 +43,9 @@ class LLPanelPresetsPulldown : public LLPanel  	/*virtual*/ void onTopLost();  	/*virtual*/ void onVisibilityChange ( BOOL new_visibility );  	/*virtual*/ BOOL postBuild(); +	void populatePanel();   private: -	void populatePanel();  	void onGraphicsButtonClick(const LLSD& user_data);  	void onRowClick(const LLSD& user_data); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 67d06ff5dd..05138ee0c3 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -54,14 +54,14 @@ void LLPresetsManager::createMissingDefault()  	{  		LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL;  		// Write current graphic settings to default.xml -		// If this name is to be localized additional code will be needed to delete the old default +		// *TODO: If this name is to be localized additional code will be needed to delete the old default  		// when changing languages.  		savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); -	} -	if (gSavedSettings.getString("PresetGraphicActive").empty()) -	{ -		gSavedSettings.setString("PresetGraphicActive", PRESETS_DEFAULT); +		if (gSavedSettings.getString("PresetGraphicActive").empty()) +		{ +			gSavedSettings.setString("PresetGraphicActive", PRESETS_DEFAULT); +		}  	}  } @@ -187,6 +187,8 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st  	formatter->format(paramsData, presetsXML, LLSDFormatter::OPTIONS_PRETTY);  	presetsXML.close(); +	gSavedSettings.setString("PresetGraphicActive", name); +  	// signal interested parties  	mPresetListChangeSignal(); @@ -234,6 +236,10 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st  	if(gSavedSettings.loadFromFile(full_path, false, true) > 0)  	{ +		if(PRESETS_GRAPHIC == subdirectory) +		{ +			gSavedSettings.setString("PresetGraphicActive", name); +		}  		mPresetListChangeSignal();  	}  } @@ -252,6 +258,12 @@ bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::  		return false;  	} +	// If you delete the preset that is currently marked as loaded then also indicate that no preset is loaded. +	if (gSavedSettings.getString("PresetGraphicActive") == name) +	{ +		gSavedSettings.setString("PresetGraphicActive", ""); +	} +  	// signal interested parties  	mPresetListChangeSignal(); diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index e9ed164322..50fe9f4216 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -59,9 +59,11 @@ public:  	void loadPreset(const std::string& subdirectory, const std::string & name);  	bool deletePreset(const std::string& subdirectory, const std::string& name); -	/// Emitted when a preset gets loaded or deleted. +	// Emitted when a preset gets loaded, deleted, or saved.  	boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); +	// Emitted when a preset gets loaded or saved. +  	preset_name_list_t mPresetNames;  	LLPresetsManager(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 8acb56d650..5ab7551849 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -79,6 +79,7 @@  #include "llfloaterlagmeter.h"  #include "llfloaterland.h"  #include "llfloaterlandholdings.h" +#include "llfloaterloadprefpreset.h"  #include "llfloatermap.h"  #include "llfloatermediasettings.h"  #include "llfloatermemleak.h" @@ -242,6 +243,7 @@ void LLViewerFloaterReg::registerFloaters()  	LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>);  	LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>); +	LLFloaterReg::add("load_pref_preset", "floater_load_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLoadPrefPreset>);  	LLFloaterReg::add("mem_leaking", "floater_mem_leaking.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMemLeak>); diff --git a/indra/newview/skins/default/xui/en/floater_load_pref_preset.xml b/indra/newview/skins/default/xui/en/floater_load_pref_preset.xml new file mode 100644 index 0000000000..72feeeef74 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_load_pref_preset.xml @@ -0,0 +1,49 @@ +<?xml version="1.0" encoding="UTF-8"?> +<floater + legacy_header_height="18" + height="130" + help_topic="floater_load_pref" + layout="topleft" + name="Load Pref Preset" + save_rect="true" + title="LOAD PREF PRESET" + width="550"> + +    <string name="title_graphic">Load Graphic Preset</string> +    <string name="title_camera">Load Camera Preset</string> + +    <text +     follows="top|left|right" +     font="SansSerif" +     height="10" +     layout="topleft" +     left="50" +     name="Preset" +     top="60" +     width="60"> +     Preset: +    </text> +    <combo_box +     follows="top|left" +     layout="topleft" +     left_pad="10" +     name="preset_combo" +     top_delta="-5" +     width="200"/> +    <button +     follows="bottom|right" +     height="23" +     label="OK" +     layout="topleft" +     left_pad="15" +     name="ok" +     width="70"/> +    <button +     follows="bottom|right" +     height="23" +     label="Cancel" +     layout="topleft" +     left_pad="5" +     name="cancel" +     width="70"/> +</floater> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 983e0edb97..b5a1c1eda6 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -17,36 +17,37 @@      height="16"      layout="topleft"      left="5" -    name="presets_text"      top="10" -    width="60"> -      Presets: +    width="100"> +      Preset in use: +  </text> + +  <text +    follows="top|left|right" +    font="SansSerif" +    height="16" +    layout="topleft" +    left_delta="110" +    name="preset_text" +    top="10" +    width="120"> +      (None)    </text> -  <combo_box -   	follows="top|left" -   	layout="topleft" -   	left_pad="0" -   	max_chars="100" -   	name="graphic_preset_combo" -   	top_delta="0" -   	width="150"> -    <combo_box.commit_callback -      function="Pref.Preset" -      parameter="graphic" /> -  </combo_box> +    <button      follows="top|left"      height="23" -    label="Save As..." +    label="Load preset..."      layout="topleft"      left_pad="5" -    name="PrefSaveButton" +    name="PrefLoadButton"      top_delta="0"      width="115">      <button.commit_callback -      function="Pref.PrefSave" +      function="Pref.PrefLoad"  	  parameter="graphic"/>    </button> +    <button      follows="top|left"      height="23" @@ -60,6 +61,7 @@        function="Pref.PrefDelete"  	  parameter="graphic"/>    </button> +    <text      type="string"      length="1" @@ -255,6 +257,19 @@        top="30"        width="517"> +      <button +        follows="top|left" +        height="23" +        label="Reset all to recommended settings" +        layout="topleft" +        left="10" +        name="Defaults" +        top_delta="0" +        width="250"> +        <button.commit_callback +          function="Pref.HardwareDefaults" /> +      </button> +        <slider          control_name="RenderFarClip"          decimal_digits="0" @@ -269,7 +284,7 @@          min_val="64"          max_val="512"          name="DrawDistance" -        top_delta="0" +        top_delta="40"          width="330" />        <text          type="string" @@ -348,6 +363,19 @@            top_delta="0"            width="485"> +          <button +            follows="top|left" +            height="23" +            label="Reset all to recommended settings" +            layout="topleft" +            left="0" +            name="Defaults" +            top="0" +            width="250"> +            <button.commit_callback +              function="Pref.HardwareDefaults" /> +          </button> +            <text              type="string"              length="1" @@ -355,7 +383,7 @@              height="16"              layout="topleft"              name="GeneralText" -            top="0" +            top_delta="25"              left="5"              width="128">               General @@ -471,14 +499,14 @@              control_name="MaximumARC"              follows="left|top"              height="16" -            initial_value="0" +            initial_value="101"              increment="1"              label="Maximum ARC:"              label_width="165"              layout="topleft"              left="50" -            min_val="0" -            max_val="100" +            min_val="1" +            max_val="101"              name="MaximumARC"              show_text="false"              top_delta="16" @@ -1185,14 +1213,15 @@      <button        follows="left|bottom"        height="23" -      label="Recommended Settings" +      label="Save settings as a preset..."        layout="topleft"        left="10" -      name="Defaults" +      name="PrefSaveButton"        top="310" -      width="200"> +      width="250">        <button.commit_callback -        function="Pref.HardwareDefaults" /> +        function="Pref.PrefSave" +        parameter="graphic" />      </button>    </tab_container>  </panel> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 023c6e5bbb..c09129c867 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4046,4 +4046,5 @@ Try enclosing path to the editor with double quotes.    <string name="preset_combo_label">-Empty list-</string>    <string name="Default">Default</string>    <string name="Off">Off</string> +  <string name="none_paren_cap">(None)</string>    </strings> | 
