diff options
author | Merov Linden <merov@lindenlab.com> | 2012-05-02 15:59:15 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-05-02 15:59:15 -0700 |
commit | 56af97063aaa35c1a70f5edaf47f4a015600860d (patch) | |
tree | 299b113fab1ff7176c86342aa3e881491cd3b883 /indra/newview/llfloaterpreference.cpp | |
parent | b679975d8fdc22d33d0f62288934be8f0209157e (diff) | |
parent | 681c5de92bd09622de360818682240b0a17403f7 (diff) |
Pull from vir/drano
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index a333989e7e..173b0e538c 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -741,7 +741,8 @@ void LLFloaterPreference::onClose(bool app_quitting) void LLFloaterPreference::onOpenHardwareSettings() { - LLFloaterReg::showInstance("prefs_hardware_settings"); + LLFloater* floater = LLFloaterReg::showInstance("prefs_hardware_settings"); + addDependentFloater(floater, FALSE); } // static void LLFloaterPreference::onBtnOK() @@ -1800,7 +1801,46 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } +class LLPanelPreferencePrivacy : public LLPanelPreference +{ +public: + LLPanelPreferencePrivacy() + { + mAccountIndependentSettings.push_back("VoiceCallsFriendsOnly"); + mAccountIndependentSettings.push_back("AutoDisengageMic"); + } + + /*virtual*/ void saveSettings() + { + LLPanelPreference::saveSettings(); + + // Don't save (=erase from the saved values map) per-account privacy settings + // if we're not logged in, otherwise they will be reset to defaults on log off. + if (LLStartUp::getStartupState() != STATE_STARTED) + { + // Erase only common settings, assuming there are no color settings on Privacy page. + for (control_values_map_t::iterator it = mSavedValues.begin(); it != mSavedValues.end(); ) + { + const std::string setting = it->first->getName(); + if (std::find(mAccountIndependentSettings.begin(), + mAccountIndependentSettings.end(), setting) == mAccountIndependentSettings.end()) + { + mSavedValues.erase(it++); + } + else + { + ++it; + } + } + } + } + +private: + std::list<std::string> mAccountIndependentSettings; +}; + static LLRegisterPanelClassWrapper<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics"); +static LLRegisterPanelClassWrapper<LLPanelPreferencePrivacy> t_pref_privacy("panel_preference_privacy"); BOOL LLPanelPreferenceGraphics::postBuild() { |