STORM-2082 Merge Hardware floater into main graphics preferences display

Change notifications so they are emitted only when an error occurs
Put active preset at top of list
Add Maximum ARC slider
Merge two small methods into slider update code
master
Jonathan Yap 2014-12-12 11:13:11 -05:00
parent 47282ceb7e
commit 8d12072979
15 changed files with 362 additions and 381 deletions

View File

@ -243,7 +243,6 @@ set(viewer_SOURCE_FILES
llfloatergroupinvite.cpp
llfloatergroups.cpp
llfloaterhandler.cpp
llfloaterhardwaresettings.cpp
llfloaterhelpbrowser.cpp
llfloaterhud.cpp
llfloaterimagepreview.cpp
@ -852,7 +851,6 @@ set(viewer_HEADER_FILES
llfloatergroupinvite.h
llfloatergroups.h
llfloaterhandler.h
llfloaterhardwaresettings.h
llfloaterhelpbrowser.h
llfloaterhud.h
llfloaterimagepreview.h

View File

@ -15562,6 +15562,17 @@
<key>Value</key>
<string />
</map>
<key>MaximumARC</key>
<map>
<key>Comment</key>
<string>Controls RenderAutoMuteRenderWeightLimit in a non-linear fashion</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>U32</string>
<key>Value</key>
<integer>0</integer>
</map>
</map>
</llsd>

View File

@ -74,10 +74,12 @@ void LLFloaterDeletePrefPreset::onBtnDelete()
{
LLPresetsManager::getInstance()->savePreset(mSubdirectory, PRESETS_DEFAULT);
}
}
else
{
LLSD args;
args["NAME"] = name;
LLNotificationsUtil::add("PresetDeleted", args);
LLNotificationsUtil::add("PresetNotDeleted", args);
}
}

View File

@ -1,201 +0,0 @@
/**
* @file llfloaterhardwaresettings.cpp
* @brief Menu of all the different graphics hardware settings
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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 "llfloaterhardwaresettings.h"
// Viewer includes
#include "llfloaterpreference.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
#include "llviewertexturelist.h"
#include "llfeaturemanager.h"
#include "llspinctrl.h"
#include "llstartup.h"
#include "lltextbox.h"
#include "llcombobox.h"
#include "pipeline.h"
// Linden library includes
#include "llradiogroup.h"
#include "lluictrlfactory.h"
#include "llwindow.h"
#include "llsliderctrl.h"
LLFloaterHardwareSettings::LLFloaterHardwareSettings(const LLSD& key)
: LLFloater(key),
// these should be set on imminent refresh() call,
// but init them anyway
mUseVBO(0),
mUseAniso(0),
mFSAASamples(0),
mGamma(0.0),
mVideoCardMem(0),
mFogRatio(0.0),
mProbeHardwareOnStartup(FALSE)
{
}
LLFloaterHardwareSettings::~LLFloaterHardwareSettings()
{
}
void LLFloaterHardwareSettings::initCallbacks(void)
{
}
// menu maintenance functions
void LLFloaterHardwareSettings::refresh()
{
LLPanel::refresh();
mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable");
mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic");
mFSAASamples = gSavedSettings.getU32("RenderFSAASamples");
mGamma = gSavedSettings.getF32("RenderGamma");
mVideoCardMem = gSavedSettings.getS32("TextureMemory");
mFogRatio = gSavedSettings.getF32("RenderFogRatio");
mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup");
getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) mFSAASamples);
refreshEnabledState();
}
void LLFloaterHardwareSettings::refreshEnabledState()
{
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value());
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
!gGLManager.mHasVertexBufferObject)
{
getChildView("vbo")->setEnabled(FALSE);
}
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") ||
!gGLManager.mHasVertexBufferObject)
{
getChildView("texture compression")->setEnabled(FALSE);
}
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
LLSpinCtrl* gamma_ctrl = getChild<LLSpinCtrl>("gamma");
gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders());
getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());
getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());
// anti-aliasing
{
LLUICtrl* fsaa_ctrl = getChild<LLUICtrl>("fsaa");
LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label");
LLView* fsaa_restart = getChildView("antialiasing restart");
// Enable or disable the control, the "Antialiasing:" label and the restart warning
// based on code support for the feature on the current hardware.
if (gPipeline.canUseAntiAliasing())
{
fsaa_ctrl->setEnabled(TRUE);
// borrow the text color from the gamma control for consistency
fsaa_text->setColor(gamma_ctrl->getEnabledTextColor());
fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
}
else
{
fsaa_ctrl->setEnabled(FALSE);
fsaa_ctrl->setValue((LLSD::Integer) 0);
// borrow the text color from the gamma control for consistency
fsaa_text->setColor(gamma_ctrl->getDisabledTextColor());
fsaa_restart->setVisible(FALSE);
}
}
}
//============================================================================
BOOL LLFloaterHardwareSettings::postBuild()
{
childSetAction("OK", onBtnOK, this);
// Don't do this on Mac as their braindead GL versioning
// sets this when 8x and 16x are indeed available
//
#if !LL_DARWIN
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
{ //remove FSAA settings above "4x"
LLComboBox* combo = getChild<LLComboBox>("fsaa");
combo->remove("8x");
combo->remove("16x");
}
#endif
refresh();
center();
// load it up
initCallbacks();
return TRUE;
}
void LLFloaterHardwareSettings::apply()
{
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();
}
// static
void LLFloaterHardwareSettings::onBtnOK( void* userdata )
{
LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata;
fp->apply();
fp->closeFloater(false);
}

View File

@ -1,84 +0,0 @@
/**
* @file llfloaterhardwaresettings.h
* @brief Menu of all the different graphics hardware settings
*
* $LicenseInfo:firstyear=2001&license=viewerlgpl$
* Second Life Viewer Source Code
* Copyright (C) 2010, 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_LLFLOATER_HARDWARE_SETTINGS_H
#define LL_LLFLOATER_HARDWARE_SETTINGS_H
#include "llfloater.h"
/// Menuing system for all of windlight's functionality
class LLFloaterHardwareSettings : public LLFloater
{
friend class LLFloaterPreference;
public:
LLFloaterHardwareSettings(const LLSD& key);
/*virtual*/ ~LLFloaterHardwareSettings();
/*virtual*/ BOOL postBuild();
/// initialize all the callbacks for the menu
void initCallbacks(void);
/// OK button
static void onBtnOK( void* userdata );
//// menu management
/// show off our menu
static void show();
/// return if the menu exists or not
static bool isOpen();
/// sync up menu with parameters
void refresh();
/// Apply the changed values.
void apply();
/// don't apply the changed values
void cancel();
/// refresh the enabled values
void refreshEnabledState();
protected:
BOOL mUseVBO;
BOOL mUseAniso;
BOOL mUseFBO;
U32 mFSAASamples;
F32 mGamma;
S32 mVideoCardMem;
F32 mFogRatio;
BOOL mProbeHardwareOnStartup;
private:
};
#endif

View File

@ -48,7 +48,6 @@
//#include "llfirstuse.h"
#include "llfloaterreg.h"
#include "llfloaterabout.h"
#include "llfloaterhardwaresettings.h"
#include "llfloatersidepanelcontainer.h"
#include "llfloaterimsession.h"
#include "llkeyboard.h"
@ -112,6 +111,7 @@
#include "llviewercontrol.h"
#include "llpresetsmanager.h"
#include "llfeaturemanager.h"
#include "llviewertexturelist.h"
const F32 MAX_USER_FAR_CLIP = 512.f;
const F32 MIN_USER_FAR_CLIP = 64.f;
@ -549,12 +549,6 @@ void LLFloaterPreference::apply()
if (panel)
panel->apply();
}
// hardware menu apply
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
if (hardware_settings)
{
hardware_settings->apply();
}
gViewerWindow->requestResolutionUpdate(); // for UIScaleFactor
@ -632,13 +626,6 @@ void LLFloaterPreference::cancel()
// hide spellchecker settings folder
LLFloaterReg::hideInstance("prefs_spellchecker");
// cancel hardware menu
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
if (hardware_settings)
{
hardware_settings->cancel();
}
// reverts any changes to current skin
gSavedSettings.setString("SkinCurrent", sSkin);
@ -921,11 +908,6 @@ void LLFloaterPreference::refreshEnabledGraphics()
instance->refresh();
//instance->refreshEnabledState();
}
LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance<LLFloaterHardwareSettings>("prefs_hardware_settings");
if (hardware_settings)
{
hardware_settings->refreshEnabledState();
}
}
void LLFloaterPreference::onClickClearCache()
@ -1201,7 +1183,61 @@ void LLFloaterPreference::refreshEnabledState()
enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail");
ctrl_shadow->setEnabled(enabled);
// Hardware settings
F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple");
S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting();
S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier);
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value());
getChild<LLSliderCtrl>("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value());
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") ||
!gGLManager.mHasVertexBufferObject)
{
getChildView("vbo")->setEnabled(FALSE);
}
if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") ||
!gGLManager.mHasVertexBufferObject)
{
getChildView("texture compression")->setEnabled(FALSE);
}
// if no windlight shaders, turn off nighttime brightness, gamma, and fog distance
LLUICtrl* gamma_ctrl = getChild<LLUICtrl>("gamma");
gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders());
getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders());
getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders());
/* Disabling this block of code because canUseAntiAliasing currently always returns true
// anti-aliasing
LLComboBox* fsaa_ctrl = getChild<LLComboBox>("fsaa");
LLTextBox* fsaa_text = getChild<LLTextBox>("antialiasing label");
LLTextBox* fsaa_restart = getChild<LLTextBox>("antialiasing restart");
// Enable or disable the control, the "Antialiasing:" label and the restart warning
// based on code support for the feature on the current hardware.
if (gPipeline.canUseAntiAliasing())
{
fsaa_ctrl->setEnabled(TRUE);
LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor");
fsaa_text->setColor(color);
fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred"));
}
else
{
fsaa_ctrl->setEnabled(FALSE);
fsaa_ctrl->setValue((LLSD::Integer) 0);
LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor");
fsaa_text->setColor(color);
fsaa_restart->setVisible(FALSE);
}
*/
// now turn off any features that are unavailable
disableUnavailableSettings();
@ -1365,23 +1401,26 @@ void LLFloaterPreference::refresh()
{
LLPanel::refresh();
getChild<LLUICtrl>("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples"));
refreshEnabledState();
// sliders and their text boxes
// mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow");
// slider text boxes
updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail", true), getChild<LLTextBox>("ObjectMeshDetailText", true));
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));
updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("TerrainDetail", true), getChild<LLTextBox>("TerrainDetailText", true));
updateReflectionsText(getChild<LLSliderCtrl>("Reflections", true), getChild<LLTextBox>("ReflectionsText", true));
updateShadowDetailText(getChild<LLSliderCtrl>("ShadowDetail", true), getChild<LLTextBox>("RenderShadowDetailText", true));
updateSliderText(getChild<LLSliderCtrl>("ObjectMeshDetail", true), getChild<LLTextBox>("ObjectMeshDetailText", true), "ObjectMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("FlexibleMeshDetail", true), getChild<LLTextBox>("FlexibleMeshDetailText", true), "FlexibleMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("TreeMeshDetail", true), getChild<LLTextBox>("TreeMeshDetailText", true), "TreeMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail", true), getChild<LLTextBox>("AvatarMeshDetailText", true), "AvatarMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("AvatarMeshDetail2", true), getChild<LLTextBox>("AvatarMeshDetailText2", true), "AvatarMeshDetail2");
updateSliderText(getChild<LLSliderCtrl>("AvatarPhysicsDetail", true), getChild<LLTextBox>("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail");
updateSliderText(getChild<LLSliderCtrl>("TerrainMeshDetail", true), getChild<LLTextBox>("TerrainMeshDetailText", true), "TerrainMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("RenderPostProcess", true), getChild<LLTextBox>("PostProcessText", true), "RenderPostProcess");
updateSliderText(getChild<LLSliderCtrl>("SkyMeshDetail", true), getChild<LLTextBox>("SkyMeshDetailText", true), "SkyMeshDetail");
updateSliderText(getChild<LLSliderCtrl>("TerrainDetail", true), getChild<LLTextBox>("TerrainDetailText", true), "TerrainDetail");
updateSliderText(getChild<LLSliderCtrl>("MaximumARC", true), getChild<LLTextBox>("MaximumARCText", true), "MaximumARC");
updateSliderText(getChild<LLSliderCtrl>("Reflections", true), getChild<LLTextBox>("ReflectionsText", true), "Reflections");
updateSliderText(getChild<LLSliderCtrl>("ShadowDetail", true), getChild<LLTextBox>("RenderShadowDetailText", true), "ShadowDetail");
}
void LLFloaterPreference::onCommitWindowedMode()
@ -1633,24 +1672,7 @@ void LLFloaterPreference::refreshUI()
refresh();
}
void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box)
{
if (text_box == NULL || ctrl== NULL)
return;
U32 value = (U32)ctrl->getValue().asInteger();
text_box->setText(getString("Reflections" + llformat("%d", value)));
}
void LLFloaterPreference::updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box)
{
if (text_box == NULL || ctrl== NULL)
return;
U32 value = (U32)ctrl->getValue().asInteger();
text_box->setText(getString("RenderShadowDetail" + llformat("%d", value)));
}
void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box)
void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name)
{
if (text_box == NULL || ctrl== NULL)
return;
@ -1663,7 +1685,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
llassert(range > 0);
F32 midPoint = min + range / 3.0f;
F32 highPoint = min + (2.0f * range / 3.0f);
if ("ShadowDetail" == name)
{
U32 value = (U32)ctrl->getValue().asInteger();
text_box->setText(getString("RenderShadowDetail" + llformat("%d", value)));
return;
}
if ("Reflections" == name)
{
U32 value = (U32)ctrl->getValue().asInteger();
text_box->setText(getString("Reflections" + llformat("%d", value)));
return;
}
// choose the right text
if (value < midPoint)
{
@ -1677,6 +1713,22 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b
{
text_box->setText(LLTrans::getString("GraphicsQualityHigh"));
}
if ("MaximumARC" == name)
{
F32 control_value = value;
if (0.0f == control_value)
{
text_box->setText(LLTrans::getString("Off"));
}
else
{
// 13 is the maximum value of this control set in panel_preferences_graphics1.xml
control_value = exp(13.0f - control_value) + 20000.0f;
}
gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value);
}
}
void LLFloaterPreference::onChangeMaturity()
@ -2152,6 +2204,18 @@ static LLPanelInjector<LLPanelPreferencePrivacy> t_pref_privacy("panel_preferenc
BOOL LLPanelPreferenceGraphics::postBuild()
{
// Don't do this on Mac as their braindead GL versioning
// sets this when 8x and 16x are indeed available
//
#if !LL_DARWIN
if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f)
{ //remove FSAA settings above "4x"
LLComboBox* combo = getChild<LLComboBox>("fsaa");
combo->remove("8x");
combo->remove("16x");
}
#endif
LLComboBox* combo = getChild<LLComboBox>("graphic_preset_combo");
combo->setLabel(LLTrans::getString("preset_combo_label"));
@ -2171,7 +2235,7 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox()
{
LLComboBox* combo = getChild<LLComboBox>("graphic_preset_combo");
EDefaultOptions option = DEFAULT_POSITION_TOP;
EDefaultOptions option = DEFAULT_SHOW;
LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option);
}

View File

@ -156,9 +156,7 @@ public:
// if the quality radio buttons are changed
void onChangeQuality(const LLSD& data);
void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box);
void updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box);
void updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box);
void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name);
void refreshUI();
void onCommitParcelMediaAutoPlayEnable();

View File

@ -70,7 +70,7 @@ void LLFloaterSavePrefPreset::onOpen(const LLSD& key)
setTitle(floater_title);
EDefaultOptions option = DEFAULT_POSITION_TOP;
EDefaultOptions option = DEFAULT_SHOW;
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option);
onPresetNameEdited();
@ -80,11 +80,11 @@ void LLFloaterSavePrefPreset::onBtnSave()
{
std::string name = mPresetCombo->getSimple();
if (LLPresetsManager::getInstance()->savePreset(mSubdirectory, name))
if (!LLPresetsManager::getInstance()->savePreset(mSubdirectory, name))
{
LLSD args;
args["NAME"] = name;
LLNotificationsUtil::add("PresetSaved", args);
LLNotificationsUtil::add("PresetNotSaved", args);
}
closeFloater();
@ -92,7 +92,7 @@ void LLFloaterSavePrefPreset::onBtnSave()
void LLFloaterSavePrefPreset::onPresetsListChange()
{
EDefaultOptions option = DEFAULT_POSITION_TOP;
EDefaultOptions option = DEFAULT_SHOW;
LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option);
}

View File

@ -71,7 +71,7 @@ BOOL LLPanelPresetsPulldown::postBuild()
void LLPanelPresetsPulldown::populatePanel()
{
std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC);
LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_POSITION_NORMAL);
LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_SHOW);
LLScrollListCtrl* scroll = getChild<LLScrollListCtrl>("preset_list");

View File

@ -99,20 +99,26 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_nam
{
std::string path = gDirUtilp->add(dir, file);
std::string name = gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true);
// Two things are happening here:
// 1 - Always put the active preset at the top of the list
// 2 - Possibly hide the default preset
if (PRESETS_DEFAULT != name)
{
mPresetNames.push_back(name);
if (name != gSavedSettings.getString("PresetGraphicActive"))
{
mPresetNames.push_back(name);
}
else
{
mPresetNames.insert(mPresetNames.begin(), name);
}
}
else
{
switch (default_option)
{
case DEFAULT_POSITION_TOP:
mPresetNames.insert(mPresetNames.begin(), name);
break;
case DEFAULT_POSITION_NORMAL:
mPresetNames.push_back(name);
case DEFAULT_SHOW:
mPresetNames.push_back(LLTrans::getString(PRESETS_DEFAULT));
break;
case DEFAULT_HIDE:
@ -164,6 +170,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st
("RenderDeferredSSAO")
("RenderDepthOfField")
("RenderShadowDetail")
("RenderAutoMuteRenderWeightLimit")
("RenderAnisotropic")
("RenderFSAASamples")

View File

@ -39,9 +39,8 @@ static const std::string PRESETS_CAMERA = "camera";
enum EDefaultOptions
{
DEFAULT_POSITION_TOP, // Put "Default" as the first item in the combobox
DEFAULT_POSITION_NORMAL, // No special positioning
DEFAULT_HIDE // Do not display "Default" in the combobox
DEFAULT_SHOW,
DEFAULT_HIDE // Do not display "Default" in a list
};
class LLPresetsManager : public LLSingleton<LLPresetsManager>

View File

@ -69,7 +69,6 @@
#include "llfloatergesture.h"
#include "llfloatergodtools.h"
#include "llfloatergroups.h"
#include "llfloaterhardwaresettings.h"
#include "llfloaterhelpbrowser.h"
#include "llfloaterhud.h"
#include "llfloaterimagepreview.h"
@ -274,7 +273,6 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>);
LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreference>);
LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterPreferenceProxy>);
LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterHardwareSettings>);
LLFloaterReg::add("prefs_spellchecker_import", "floater_spellcheck_import.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerImport>);
LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTranslationSettings>);
LLFloaterReg::add("prefs_spellchecker", "floater_spellcheck.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSpellCheckerSettings>);

View File

@ -7659,16 +7659,16 @@ Attachment has been saved.
<notification
icon="notifytip.tga"
name="PresetSaved"
name="PresetNotSaved"
type="notifytip">
Preset [NAME] has been saved.
Error saving preset [NAME].
</notification>
<notification
icon="notifytip.tga"
name="PresetDeleted"
name="PresetNotDeleted"
type="notifytip">
Preset [NAME] has been deleted.
Error deleting preset [NAME].
</notification>
<notification

View File

@ -320,7 +320,7 @@
<panel
border="false"
follows="top|left"
height="600"
height="700"
label="CustomGraphics"
layout="topleft"
left="5"
@ -542,9 +542,42 @@
min_val="1"
max_val="65"
name="MaxNumberAvatarDrawn"
top_delta="20"
top_delta="16"
width="325" />
<slider
control_name="MaximumARC"
follows="left|top"
height="16"
initial_value="0"
increment=".1"
label="Maximum ARC:"
label_width="185"
layout="topleft"
left="30"
min_val="0"
max_val="13"
name="MaximumARC"
show_text="false"
top_delta="16"
width="300">
<slider.commit_callback
function="Pref.UpdateSliderText"
parameter="MaximumARCText" />
</slider>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
top_delta="0"
left_delta="304"
name="MaximumARCText"
width="128">
Low
</text>
<check_box
control_name="RenderUseImpostors"
height="16"
@ -941,6 +974,173 @@
width="128">
None
</text>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
name="ShadersText"
top_delta="20"
left="5"
width="128">
Hardware
</text>
<slider
control_name="TextureMemory"
decimal_digits="0"
follows="left|top"
height="16"
increment="16"
initial_value="32"
label="Texture Memory (MB):"
label_width="185"
layout="topleft"
left="30"
max_val="4096"
name="GraphicsCardTextureMemory"
tool_tip="Amount of memory to allocate for textures. Defaults to video card memory. Reducing this may improve performance but may also make textures blurry."
top_delta="16"
width="335" />
<slider
control_name="RenderFogRatio"
follows="left|top"
height="16"
initial_value="4"
decimal_digits="1"
label="Fog Distance Ratio:"
label_width="185"
layout="topleft"
left="30"
name="fog"
min_val="0.5"
max_val="10"
increment="0.1"
top_delta="16"
width="332" />
<slider
control_name="RenderGamma"
follows="left|top"
height="16"
initial_value="1"
decimal_digits="2"
label="Gamma:"
label_width="185"
layout="topleft"
left="30"
name="gamma"
min_val="0"
max_val="2"
increment="0.01"
top_delta="16"
width="332" />
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left="30"
name="(brightness, lower is brighter)"
top_delta="16"
width="230">
(0 = default brightness, lower = brighter)
</text>
<check_box
control_name="RenderAnisotropic"
height="16"
label="Anisotropic Filtering (slower when enabled)"
layout="topleft"
left="30"
name="ani"
top_delta="16"
width="256" />
<check_box
control_name="RenderVBOEnable"
height="16"
initial_value="true"
label="Enable OpenGL Vertex Buffer Objects"
layout="topleft"
left="30"
top_delta="16"
name="vbo"
tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled."
width="315" />
<check_box
control_name="RenderCompressTextures"
height="16"
initial_value="true"
label="Enable Texture Compression (requires restart)"
layout="topleft"
left="30"
top_delta="16"
name="texture compression"
tool_tip="Compresses textures in video memory, allowing for higher resolution textures to be loaded at the cost of some color quality."
width="315" />
<text
type="string"
length="1"
follows="left|top"
height="20"
layout="topleft"
left="30"
name="antialiasing label"
top_delta="20"
width="100">
Antialiasing:
</text>
<combo_box
control_name="RenderFSAASamples"
height="20"
initial_value="false"
label="Antialiasing"
layout="topleft"
left_pad="40"
name="fsaa"
top_delta="0"
width="90">
<combo_box.item
label="Disabled"
name="FSAADisabled"
value="0" />
<combo_box.item
label="2x"
name="2x"
value="2" />
<combo_box.item
label="4x"
name="4x"
value="4" />
<combo_box.item
label="8x"
name="8x"
value="8" />
<combo_box.item
label="16x"
name="16x"
value="16" />
</combo_box>
<text
type="string"
length="1"
follows="left|top"
height="16"
layout="topleft"
left_pad="10"
name="antialiasing restart"
top_delta="0"
width="190">
(requires viewer restart)
</text>
</panel>
</scroll_container>
</panel>
@ -958,18 +1158,6 @@
<button.commit_callback
function="Pref.HardwareDefaults" />
</button>
<button
follows="right|bottom"
height="23"
label="Hardware..."
label_selected="Hardware"
layout="topleft"
left_pad="25"
name="GraphicsHardwareButton"
top="310"
width="115">
<button.commit_callback
function="Pref.HardwareSettings" />
</button>
</tab_container>
</panel>

View File

@ -4044,5 +4044,6 @@ Try enclosing path to the editor with double quotes.
<!-- Presets graphic/camera -->
<string name="preset_combo_label">-Empty list-</string>
<string name="Default">Default</string>
<string name="Off">Off</string>
</strings>