diff options
Diffstat (limited to 'indra/newview/llfloaterpreference.h')
| -rw-r--r-- | indra/newview/llfloaterpreference.h | 233 |
1 files changed, 146 insertions, 87 deletions
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 52592c0bad..e99731b92e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -2,30 +2,25 @@ * @file llfloaterpreference.h * @brief LLPreferenceCore class definition * - * $LicenseInfo:firstyear=2002&license=viewergpl$ - * - * Copyright (c) 2002-2007, Linden Research, Inc. - * + * $LicenseInfo:firstyear=2002&license=viewerlgpl$ * Second Life Viewer Source Code - * The source code in this file ("Source Code") is provided by Linden Lab - * to you under the terms of the GNU General Public License, version 2.0 - * ("GPL"), unless you have obtained a separate licensing agreement - * ("Other License"), formally executed by you and Linden Lab. Terms of - * the GPL can be found in doc/GPL-license.txt in this distribution, or - * online at http://secondlife.com/developers/opensource/gplv2 + * 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. * - * There are special exceptions to the terms and conditions of the GPL as - * it is applied to this Source Code. View the full text of the exception - * in the file doc/FLOSS-exception.txt in this software distribution, or - * online at http://secondlife.com/developers/opensource/flossexception + * 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. * - * By copying, modifying or distributing this software, you acknowledge - * that you have read and understood your obligations described above, - * and agree to abide by those obligations. + * 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 * - * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO - * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, - * COMPLETENESS OR PERFORMANCE. + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ @@ -39,99 +34,163 @@ #define LL_LLFLOATERPREFERENCE_H #include "llfloater.h" -#include "lltabcontainervertical.h" -class LLPanelGeneral; -class LLPanelInput; +class LLPanelPreference; class LLPanelLCD; -class LLPanelDisplay; -class LLPanelAudioPrefs; class LLPanelDebug; -class LLPanelNetwork; -class LLPanelWeb; class LLMessageSystem; -class LLPrefsChat; -class LLPrefsVoice; -class LLPrefsIM; -class LLPanelMsgs; class LLScrollListCtrl; +class LLSliderCtrl; +class LLSD; +class LLTextBox; -class LLPreferenceCore -{ - -public: - LLPreferenceCore(LLTabContainer* tab_container, LLButton * default_btn); - ~LLPreferenceCore(); - - void apply(); - void cancel(); - - LLTabContainer* getTabContainer() { return mTabContainer; } +typedef enum + { + GS_LOW_GRAPHICS, + GS_MID_GRAPHICS, + GS_HIGH_GRAPHICS, + GS_ULTRA_GRAPHICS + + } EGraphicsSettings; - void setPersonalInfo( - const char* visibility, - BOOL im_via_email, - const char* email); - - static void onTabChanged(void* user_data, bool from_click); - - // refresh all the graphics preferences menus - void refreshEnabledGraphics(); - -private: - LLTabContainer *mTabContainer; - LLPanelGeneral *mGeneralPanel; - LLPanelInput *mInputPanel; - LLPanelNetwork *mNetworkPanel; - LLPanelDisplay *mDisplayPanel; - LLPanelAudioPrefs *mAudioPanel; -// LLPanelDebug *mDebugPanel; - LLPrefsChat *mPrefsChat; - LLPrefsVoice *mPrefsVoice; - LLPrefsIM *mPrefsIM; - LLPanelWeb *mWebPanel; - LLPanelMsgs *mMsgPanel; - LLPanelLCD *mLCDPanel; -}; // Floater to control preferences (display, audio, bandwidth, general. class LLFloaterPreference : public LLFloater { public: - LLFloaterPreference(); + LLFloaterPreference(const LLSD& key); ~LLFloaterPreference(); void apply(); void cancel(); - virtual BOOL postBuild(); - static void show(void*); + /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); // static data update, called from message handler - static void updateUserInfo( - const char* visibility, - BOOL im_via_email, - const char* email); + static void updateUserInfo(const std::string& visibility, bool im_via_email, const std::string& email); // refresh all the graphics preferences menus static void refreshEnabledGraphics(); + + // translate user's busy response message according to current locale if message is default, otherwise do nothing + static void initBusyResponse(); + +protected: + void onBtnOK(); + void onBtnCancel(); + void onBtnApply(); + + void onClickBrowserClearCache(); + + // set value of "BusyResponseChanged" in account settings depending on whether busy response + // string differs from default after user changes. + void onBusyResponseChanged(); + // if the custom settings box is clicked + void onChangeCustom(); + void updateMeterText(LLUICtrl* ctrl); + void onOpenHardwareSettings(); + /// callback for defaults + void setHardwareDefaults(); + // callback for when client turns on shaders + void onVertexShaderEnable(); + + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + void saveSettings(); + -protected: - LLPreferenceCore *mPreferenceCore; +public: - /*virtual*/ void draw(); - /*virtual*/ void onClose(bool app_quitting); + void setCacheLocation(const LLStringExplicit& location); + + void onClickSetCache(); + void onClickResetCache(); + void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata); + void onSelectSkin(); + void onClickSetKey(); + void setKey(KEY key); + void onClickSetMiddleMouse(); +// void onClickSkipDialogs(); +// void onClickResetDialogs(); + void onClickEnablePopup(); + void onClickDisablePopup(); + void resetAllIgnored(); + void setAllIgnored(); + void onClickLogPath(); + void enableHistory(); + void setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email); + void refreshEnabledState(); + void disableUnavailableSettings(); + void onCommitWindowedMode(); + void refresh(); // Refresh enable/disable + // if the quality radio buttons are changed + void onChangeQuality(const LLSD& data); + + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void onUpdateSliderText(LLUICtrl* ctrl, const LLSD& name); +// void fractionFromDecimal(F32 decimal_val, S32& numerator, S32& denominator); + + void onCommitParcelMediaAutoPlayEnable(); + void onCommitMediaEnabled(); + void onCommitMusicEnabled(); + void applyResolution(); + void onChangeMaturity(); + void onClickBlockList(); + void applyUIColor(LLUICtrl* ctrl, const LLSD& param); + void getUIColor(LLUICtrl* ctrl, const LLSD& param); + + void buildPopupLists(); + static void refreshSkin(void* data); +private: + static std::string sSkin; + bool mGotPersonalInfo; + bool mOriginalIMViaEmail; + + bool mOriginalHideOnlineStatus; + std::string mDirectoryVisibility; +}; - LLButton* mAboutBtn; - LLButton *mOKBtn; - LLButton *mCancelBtn; - LLButton *mApplyBtn; +class LLPanelPreference : public LLPanel +{ +public: + LLPanelPreference(); + /*virtual*/ BOOL postBuild(); + + virtual void apply(); + virtual void cancel(); + void setControlFalse(const LLSD& user_data); + virtual void setHardwareDefaults(){}; + + // This function squirrels away the current values of the controls so that + // cancel() can restore them. + virtual void saveSettings(); + +private: + //for "Only friends and groups can call or IM me" + static void showFriendsOnlyWarning(LLUICtrl*, const LLSD&); + + typedef std::map<LLControlVariable*, LLSD> control_values_map_t; + control_values_map_t mSavedValues; - static void onClickAbout(void*); - static void onBtnOK(void*); - static void onBtnCancel(void*); - static void onBtnApply(void*); + typedef std::map<std::string, LLColor4> string_color_map_t; + string_color_map_t mSavedColors; +}; - static LLFloaterPreference* sInstance; +class LLPanelPreferenceGraphics : public LLPanelPreference +{ +public: + BOOL postBuild(); + void draw(); + void apply(); + void cancel(); + void saveSettings(); + void setHardwareDefaults(); +protected: + bool hasDirtyChilds(); + void resetDirtyChilds(); + }; #endif // LL_LLPREFERENCEFLOATER_H |
