diff options
author | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-02-26 10:52:23 +0200 |
---|---|---|
committer | AndreyL ProductEngine <alihatskiy@productengine.com> | 2016-02-26 10:52:23 +0200 |
commit | 9d681027b343a68a4e1151855145b79b95717d57 (patch) | |
tree | b77c6e2f915307a0cf7d1320a403068c298e33ac /indra | |
parent | 9353dd38b1922c4e01d90c469df4013e21b6e9e2 (diff) |
MAINT-5699 Graphics preset changes to None each time the Advanced Graphics floater is opened
Diffstat (limited to 'indra')
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 37 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.h | 3 |
2 files changed, 40 insertions, 0 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index cfaafeb496..718b068c8a 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -673,6 +673,12 @@ void LLFloaterPreference::cancel() LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get(); pPathfindingConsole->onRegionBoundaryCross(); } + + if (!mSavedGraphicsPreset.empty()) + { + gSavedSettings.setString("PresetGraphicActive", mSavedGraphicsPreset); + LLPresetsManager::getInstance()->triggerChangeSignal(); + } } void LLFloaterPreference::onOpen(const LLSD& key) @@ -1970,6 +1976,18 @@ void LLFloaterPreference::onClickSpellChecker() void LLFloaterPreference::onClickAdvanced() { LLFloaterReg::showInstance("prefs_graphics_advanced"); + + LLTabContainer* tabcontainer = getChild<LLTabContainer>("pref core"); + for (child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + iter != tabcontainer->getChildList()->end(); ++iter) + { + LLView* view = *iter; + LLPanelPreferenceGraphics* panel = dynamic_cast<LLPanelPreferenceGraphics*>(view); + if (panel) + { + panel->resetDirtyChilds(); + } + } } void LLFloaterPreference::onClickActionChange() @@ -2076,6 +2094,11 @@ void LLFloaterPreference::changed() } +void LLFloaterPreference::saveGraphicsPreset(std::string& preset) +{ + mSavedGraphicsPreset = preset; +} + //------------------------------Updater--------------------------------------- static bool handleBandwidthChanged(const LLSD& newvalue) @@ -2465,6 +2488,11 @@ void LLPanelPreferenceGraphics::setPresetText() if (hasDirtyChilds() && !preset_graphic_active.empty()) { + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); + if (instance) + { + instance->saveGraphicsPreset(preset_graphic_active); + } gSavedSettings.setString("PresetGraphicActive", ""); preset_graphic_active.clear(); // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown @@ -2599,6 +2627,15 @@ void LLFloaterPreferenceGraphicsAdvanced::onOpen(const LLSD& key) refresh(); } +void LLFloaterPreferenceGraphicsAdvanced::onClickCloseBtn(bool app_quitting) +{ + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance<LLFloaterPreference>("preferences"); + if (instance) + { + instance->cancel(); + } +} + LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 03dab13689..8de65b733b 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -176,6 +176,7 @@ public: void buildPopupLists(); static void refreshSkin(void* data); void selectPanel(const LLSD& name); + void saveGraphicsPreset(std::string& preset); private: @@ -196,6 +197,7 @@ private: std::string mDirectoryVisibility; LLAvatarData mAvatarProperties; + std::string mSavedGraphicsPreset; LOG_CLASS(LLFloaterPreference); }; @@ -271,6 +273,7 @@ public: LLFloaterPreferenceGraphicsAdvanced(const LLSD& key); ~LLFloaterPreferenceGraphicsAdvanced(); void onOpen(const LLSD& key); + void onClickCloseBtn(bool app_quitting); void disableUnavailableSettings(); void refreshEnabledGraphics(); void refreshEnabledState(); |