summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2024-01-17 00:30:37 +0200
committerGitHub <noreply@github.com>2024-01-17 00:30:37 +0200
commit469f2621f170484943093a830ec385f1b8d20934 (patch)
tree43065026a9c69b195f7e0a812c8b260bd068ed1d /indra
parent0249eefe53f2267a179a1271ae21b9c9af878ca9 (diff)
SL-20708 don't reset "Quality & speed" slider when canceling Advanced Settings
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llfloaterpreference.cpp23
-rw-r--r--indra/newview/llfloaterpreference.h10
-rw-r--r--indra/newview/llfloaterpreferencesgraphicsadvanced.cpp2
3 files changed, 20 insertions, 15 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index aa723eb3a8..d15c52cc24 100644
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -620,7 +620,7 @@ void LLFloaterPreference::apply()
saveAvatarProperties();
}
-void LLFloaterPreference::cancel()
+void LLFloaterPreference::cancel(const std::vector<std::string> settings_to_skip)
{
LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core");
// Call cancel() on all panels that derive from LLPanelPreference
@@ -630,7 +630,7 @@ void LLFloaterPreference::cancel()
LLView* view = *iter;
LLPanelPreference* panel = dynamic_cast<LLPanelPreference*>(view);
if (panel)
- panel->cancel();
+ panel->cancel(settings_to_skip);
}
// hide joystick pref floater
LLFloaterReg::hideInstance("pref_joystick");
@@ -1011,15 +1011,16 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata)
}
refresh();
}
- cancel();
-
+
if (userdata.asString() == "closeadvanced")
{
+ cancel({"RenderQualityPerformance"});
LLFloaterReg::hideInstance("prefs_graphics_advanced");
updateMaxComplexity();
}
else
{
+ cancel();
closeFloater();
}
}
@@ -2206,7 +2207,7 @@ void LLPanelPreference::toggleMuteWhenMinimized()
}
}
-void LLPanelPreference::cancel()
+void LLPanelPreference::cancel(const std::vector<std::string> settings_to_skip)
{
for (control_values_map_t::iterator iter = mSavedValues.begin();
iter != mSavedValues.end(); ++iter)
@@ -2219,6 +2220,12 @@ void LLPanelPreference::cancel()
continue;
}
+ auto found = std::find(settings_to_skip.begin(), settings_to_skip.end(), control->getName());
+ if (found != settings_to_skip.end())
+ {
+ continue;
+ }
+
control->set(ctrl_value);
}
@@ -2461,9 +2468,9 @@ void LLPanelPreferenceGraphics::resetDirtyChilds()
}
}
-void LLPanelPreferenceGraphics::cancel()
+void LLPanelPreferenceGraphics::cancel(const std::vector<std::string> settings_to_skip)
{
- LLPanelPreference::cancel();
+ LLPanelPreference::cancel(settings_to_skip);
}
void LLPanelPreferenceGraphics::saveSettings()
{
@@ -2751,7 +2758,7 @@ void LLPanelPreferenceControls::apply()
}
}
-void LLPanelPreferenceControls::cancel()
+void LLPanelPreferenceControls::cancel(const std::vector<std::string> settings_to_skip)
{
for (U32 i = 0; i < LLKeyConflictHandler::MODE_COUNT - 1; ++i)
{
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index 04ac87364d..bdade3c1b9 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -79,7 +79,7 @@ public:
~LLFloaterPreference();
void apply();
- void cancel();
+ void cancel(const std::vector<std::string> settings_to_skip = {});
/*virtual*/ void draw();
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
@@ -251,7 +251,7 @@ public:
virtual ~LLPanelPreference();
virtual void apply();
- virtual void cancel();
+ virtual void cancel(const std::vector<std::string> settings_to_skip = {});
void setControlFalse(const LLSD& user_data);
virtual void setHardwareDefaults();
@@ -294,14 +294,12 @@ class LLPanelPreferenceGraphics : public LLPanelPreference
public:
BOOL postBuild();
void draw();
- void cancel();
+ void cancel(const std::vector<std::string> settings_to_skip = {});
void saveSettings();
void resetDirtyChilds();
void setHardwareDefaults();
void setPresetText();
- static const std::string getPresetsPath();
-
protected:
bool hasDirtyChilds();
@@ -320,7 +318,7 @@ public:
BOOL postBuild();
void apply();
- void cancel();
+ void cancel(const std::vector<std::string> settings_to_skip = {});
void saveSettings();
void resetDirtyChilds();
diff --git a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
index a91f0ec060..f83ce868a3 100644
--- a/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
+++ b/indra/newview/llfloaterpreferencesgraphicsadvanced.cpp
@@ -93,7 +93,7 @@ void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting)
LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences");
if (instance)
{
- instance->cancel();
+ instance->cancel({"RenderQualityPerformance"});
}
updateMaxComplexity();
}