diff options
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 286 |
1 files changed, 147 insertions, 139 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 481c13846a..9dab30bb01 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -181,7 +181,7 @@ bool callback_clear_cache(const LLSD& notification, const LLSD& response) if ( option == 0 ) // YES { // flag client texture cache for clearing next time the client runs - gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", true); LLNotificationsUtil::add("CacheWillClear"); } @@ -201,7 +201,7 @@ bool callback_clear_browser_cache(const LLSD& notification, const LLSD& response LLNavigationBar::getInstance()->clearHistoryCache(); // flag client texture cache for clearing next time the client runs - gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", true); LLNotificationsUtil::add("CacheWillClear"); LLSearchHistory::getInstance()->clearHistory(); @@ -428,8 +428,15 @@ void LLFloaterPreference::saveAvatarPropertiesCoro(const std::string cap_url, bo LL_DEBUGS("Preferences") << "Agent id: " << gAgentID << " Data: " << data << " Result: " << httpResults << LL_ENDL; } -BOOL LLFloaterPreference::postBuild() +bool LLFloaterPreference::postBuild() { + mDeleteTranscriptsBtn = getChild<LLButton>("delete_transcripts"); + + mEnabledPopups = getChild<LLScrollListCtrl>("enabled_popups"); + mDisabledPopups = getChild<LLScrollListCtrl>("disabled_popups"); + mEnablePopupBtn = getChild<LLButton>("enable_this_popup"); + mDisablePopupBtn = getChild<LLButton>("disable_this_popup"); + gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLFloaterIMSessionTab::processChatHistoryStyleUpdate, false)); gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged)); @@ -438,6 +445,12 @@ BOOL LLFloaterPreference::postBuild() gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeMaturity, this)); + gSavedSettings.getControl("RenderAvatarComplexityMode")->getSignal()->connect( + [this](LLControlVariable* control, const LLSD& new_val, const LLSD& old_val) + { + onChangeComplexityMode(new_val); + }); + gSavedPerAccountSettings.getControl("ModelUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeModelFolder, this)); gSavedPerAccountSettings.getControl("PBRUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangePBRFolder, this)); gSavedPerAccountSettings.getControl("TextureUploadFolder")->getSignal()->connect(boost::bind(&LLFloaterPreference::onChangeTextureFolder, this)); @@ -448,11 +461,11 @@ BOOL LLFloaterPreference::postBuild() if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); - getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227) + getChild<LLUICtrl>("cache_location")->setEnabled(false); // make it read-only but selectable (STORM-227) std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); setCacheLocation(cache_location); - getChild<LLUICtrl>("log_path_string")->setEnabled(FALSE); // make it read-only but selectable + getChild<LLUICtrl>("log_path_string")->setEnabled(false); // make it read-only but selectable getChild<LLComboBox>("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); @@ -478,6 +491,9 @@ BOOL LLFloaterPreference::postBuild() fov_slider->setMinValue(LLViewerCamera::getInstance()->getMinView()); fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); + bool enable_complexity = gSavedSettings.getS32("RenderAvatarComplexityMode") != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild<LLSliderCtrl>("IndirectMaxComplexity")->setEnabled(enable_complexity); + // Hook up and init for filtering mFilterEdit = getChild<LLSearchEditor>("search_prefs_edit"); mFilterEdit->setKeystrokeCallback(boost::bind(&LLFloaterPreference::onUpdateFilterTerm, this, false)); @@ -505,17 +521,17 @@ BOOL LLFloaterPreference::postBuild() getChild<LLComboBox>("language_combobox")->add("System default", LLSD("default"), ADD_TOP, true); } - return TRUE; + return true; } void LLFloaterPreference::updateDeleteTranscriptsButton() { - getChild<LLButton>("delete_transcripts")->setEnabled(LLLogChat::transcriptFilesExist()); + mDeleteTranscriptsBtn->setEnabled(LLLogChat::transcriptFilesExist()); } void LLFloaterPreference::onDoNotDisturbResponseChanged() { - // set "DoNotDisturbResponseChanged" TRUE if user edited message differs from default, FALSE otherwise + // set "DoNotDisturbResponseChanged" true if user edited message differs from default, false otherwise bool response_changed_flag = LLTrans::getString("DoNotDisturbModeResponseDefault") != getChild<LLUICtrl>("do_not_disturb_response")->getValue().asString(); @@ -531,11 +547,11 @@ LLFloaterPreference::~LLFloaterPreference() void LLFloaterPreference::draw() { - BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL); - gSavedSettings.setBOOL("FirstSelectedDisabledPopups", has_first_selected); + bool has_first_selected = (mDisabledPopups->getFirstSelected()!=NULL); + mEnablePopupBtn->setEnabled(has_first_selected); - has_first_selected = (getChildRef<LLScrollListCtrl>("enabled_popups").getFirstSelected()!=NULL); - gSavedSettings.setBOOL("FirstSelectedEnabledPopups", has_first_selected); + has_first_selected = (mEnabledPopups->getFirstSelected()!=NULL); + mDisablePopupBtn->setEnabled(has_first_selected); LLFloater::draw(); } @@ -586,7 +602,7 @@ void LLFloaterPreference::apply() LLViewerMedia::getInstance()->setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); - if (hasChild("web_proxy_enabled", TRUE) &&hasChild("web_proxy_editor", TRUE) && hasChild("web_proxy_port", TRUE)) + if (hasChild("web_proxy_enabled", true) &&hasChild("web_proxy_editor", true) && hasChild("web_proxy_port", true)) { bool proxy_enable = getChild<LLUICtrl>("web_proxy_enabled")->getValue(); std::string proxy_address = getChild<LLUICtrl>("web_proxy_editor")->getValue(); @@ -619,7 +635,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 @@ -629,7 +645,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"); @@ -676,7 +692,7 @@ void LLFloaterPreference::cancel() void LLFloaterPreference::onOpen(const LLSD& key) { // this variable and if that follows it are used to properly handle do not disturb mode response message - static bool initialized = FALSE; + static bool initialized = false; // if user is logged in and we haven't initialized do not disturb mode response yet, do it if (!initialized && LLStartUp::getStartupState() == STATE_STARTED) { @@ -685,8 +701,8 @@ void LLFloaterPreference::onOpen(const LLSD& key) // To keep track of whether do not disturb response is default or changed by user additional setting DoNotDisturbResponseChanged // was added into per account settings. - // initialization should happen once,so setting variable to TRUE - initialized = TRUE; + // initialization should happen once,so setting variable to true + initialized = true; // this connection is needed to properly set "DoNotDisturbResponseChanged" setting when user makes changes in // do not disturb response message. gSavedPerAccountSettings.getControl("DoNotDisturbModeResponse")->getSignal()->connect(boost::bind(&LLFloaterPreference::onDoNotDisturbResponseChanged, this)); @@ -859,7 +875,7 @@ void LLFloaterPreference::setRecommendedSettings() void LLFloaterPreference::resetAutotuneSettings() { - gSavedSettings.setBOOL("AutoTuneFPS", FALSE); + gSavedSettings.setBOOL("AutoTuneFPS", false); const std::string autotune_settings[] = { "AutoTuneLock", @@ -973,12 +989,12 @@ void LLFloaterPreference::onBtnOK(const LLSD& userdata) } LLUIColorTable::instance().saveUserSettings(); - gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); + gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), true); //Only save once logged in and loaded per account settings if(mGotPersonalInfo) { - gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); + gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), true); } } else @@ -1009,14 +1025,15 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) } refresh(); } - cancel(); if (userdata.asString() == "closeadvanced") { + cancel({"RenderQualityPerformance"}); LLFloaterReg::hideInstance("prefs_graphics_advanced"); } else { + cancel(); closeFloater(); } } @@ -1091,7 +1108,7 @@ void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue) if (color_swatch) { LLColor4 new_color = color_swatch->get(); - color_swatch->set( new_color.setAlpha(newvalue.asReal()) ); + color_swatch->set(new_color.setAlpha((F32)newvalue.asReal())); } } @@ -1161,13 +1178,8 @@ void LLFloaterPreference::refreshSkin(void* data) void LLFloaterPreference::buildPopupLists() { - LLScrollListCtrl& disabled_popups = - getChildRef<LLScrollListCtrl>("disabled_popups"); - LLScrollListCtrl& enabled_popups = - getChildRef<LLScrollListCtrl>("enabled_popups"); - - disabled_popups.deleteAllItems(); - enabled_popups.deleteAllItems(); + mDisabledPopups->deleteAllItems(); + mEnabledPopups->deleteAllItems(); for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin(); iter != LLNotifications::instance().templatesEnd(); @@ -1209,11 +1221,11 @@ void LLFloaterPreference::buildPopupLists() } } } - item = disabled_popups.addElement(row); + item = mDisabledPopups->addElement(row); } else { - item = enabled_popups.addElement(row); + item = mEnabledPopups->addElement(row); } if (item) @@ -1225,13 +1237,8 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { - LLCheckBoxCtrl* ctrl_pbr = getChild<LLCheckBoxCtrl>("UsePBRShaders"); - - //PBR - ctrl_pbr->setEnabled(TRUE); - // Cannot have floater active until caps have been received - getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() < STATE_STARTED ? false : true); + getChild<LLButton>("default_creation_permissions")->setEnabled(LLStartUp::getStartupState() >= STATE_STARTED); getChildView("block_list")->setEnabled(LLLoginInstance::getInstance()->authSuccess()); } @@ -1314,16 +1321,14 @@ void LLFloaterPreference::onClickSetSounds() void LLFloaterPreference::onClickEnablePopup() { - LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups"); - - std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected(); + std::vector<LLScrollListItem*> items = mDisabledPopups->getAllSelected(); std::vector<LLScrollListItem*>::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata())); - //gSavedSettings.setWarning(templatep->mName, TRUE); + //gSavedSettings.setWarning(templatep->mName, true); std::string notification_name = templatep->mName; - LLUI::getInstance()->mSettingGroups["ignores"]->setBOOL(notification_name, TRUE); + LLUI::getInstance()->mSettingGroups["ignores"]->setBOOL(notification_name, true); } buildPopupLists(); @@ -1335,9 +1340,7 @@ void LLFloaterPreference::onClickEnablePopup() void LLFloaterPreference::onClickDisablePopup() { - LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups"); - - std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected(); + std::vector<LLScrollListItem*> items = mEnabledPopups->getAllSelected(); std::vector<LLScrollListItem*>::iterator itor; for (itor = items.begin(); itor != items.end(); ++itor) { @@ -1472,28 +1475,28 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility) if (visibility == VISIBILITY_DEFAULT) { mOriginalHideOnlineStatus = false; - getChildView("online_visibility")->setEnabled(TRUE); + getChildView("online_visibility")->setEnabled(true); } else if (visibility == VISIBILITY_HIDDEN) { mOriginalHideOnlineStatus = true; - getChildView("online_visibility")->setEnabled(TRUE); + getChildView("online_visibility")->setEnabled(true); } else { mOriginalHideOnlineStatus = true; } - getChild<LLUICtrl>("online_searchresults")->setEnabled(TRUE); - getChildView("friends_online_notify_checkbox")->setEnabled(TRUE); + getChild<LLUICtrl>("online_searchresults")->setEnabled(true); + getChildView("friends_online_notify_checkbox")->setEnabled(true); getChild<LLUICtrl>("online_visibility")->setValue(mOriginalHideOnlineStatus); getChild<LLUICtrl>("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility); - getChildView("favorites_on_login_check")->setEnabled(TRUE); - getChildView("log_path_button")->setEnabled(TRUE); - getChildView("chat_font_size")->setEnabled(TRUE); - getChildView("conversation_log_combo")->setEnabled(TRUE); - getChild<LLUICtrl>("voice_call_friends_only_check")->setEnabled(TRUE); + getChildView("favorites_on_login_check")->setEnabled(true); + getChildView("log_path_button")->setEnabled(true); + getChildView("chat_font_size")->setEnabled(true); + getChildView("conversation_log_combo")->setEnabled(true); + getChild<LLUICtrl>("voice_call_friends_only_check")->setEnabled(true); getChild<LLUICtrl>("voice_call_friends_only_check")->setValue(gSavedPerAccountSettings.getBOOL("VoiceCallsFriendsOnly")); } @@ -1625,6 +1628,12 @@ void LLFloaterPreference::onChangeMaturity() getChild<LLIconCtrl>("rating_icon_adult")->setVisible(sim_access == SIM_ACCESS_ADULT); } +void LLFloaterPreference::onChangeComplexityMode(const LLSD& newvalue) +{ + bool enable_complexity = newvalue.asInteger() != LLVOAvatar::AV_RENDER_ONLY_SHOW_FRIENDS; + getChild<LLSliderCtrl>("IndirectMaxComplexity")->setEnabled(enable_complexity); +} + std::string get_category_path(LLFolderType::EType cat_type) { LLUUID cat_id = gInventory.findUserDefinedCategoryUUIDForType(cat_type); @@ -1741,9 +1750,9 @@ void LLFloaterPreference::onAtmosShaderChange() if(ctrl_alm) { //Deferred/SSAO/Shadows - BOOL bumpshiny = LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); - BOOL shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); - BOOL enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && + bool bumpshiny = LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump") && gSavedSettings.getBOOL("RenderObjectBump"); + bool shaders = gSavedSettings.getBOOL("WindLightUseAtmosShaders"); + bool enabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred") && bumpshiny && shaders; @@ -1780,11 +1789,9 @@ void LLFloaterPreference::onDeleteTranscriptsResponse(const LLSD& notification, void LLFloaterPreference::onLogChatHistorySaved() { - LLButton * delete_transcripts_buttonp = getChild<LLButton>("delete_transcripts"); - - if (!delete_transcripts_buttonp->getEnabled()) + if (!mDeleteTranscriptsBtn->getEnabled()) { - delete_transcripts_buttonp->setEnabled(true); + mDeleteTranscriptsBtn->setEnabled(true); } } @@ -1894,7 +1901,7 @@ void LLFloaterPreference::setCacheLocation(const LLStringExplicit& location) void LLFloaterPreference::selectPanel(const LLSD& name) { LLTabContainer * tab_containerp = getChild<LLTabContainer>("pref core"); - LLPanel * panel = tab_containerp->getPanelByName(name); + LLPanel * panel = tab_containerp->getPanelByName(name.asStringRef()); if (NULL != panel) { tab_containerp->selectTabPanel(panel); @@ -1915,7 +1922,7 @@ void LLFloaterPreference::changed() { if (LLConversationLog::instance().getIsLoggingEnabled()) { - getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); + getChild<LLButton>("clear_log")->setEnabled(LLConversationLog::instance().getConversations().size() > 0); } else { @@ -1971,12 +1978,12 @@ public: protected: - BOOL tick() + bool tick() { mCallback(mNewValue); mEventTimer.stop(); - return FALSE; + return false; } private: @@ -1998,31 +2005,31 @@ LLPanelPreference::LLPanelPreference() } //virtual -BOOL LLPanelPreference::postBuild() +bool LLPanelPreference::postBuild() { ////////////////////// PanelGeneral /////////////////// - if (hasChild("display_names_check", TRUE)) + if (hasChild("display_names_check", true)) { - BOOL use_people_api = gSavedSettings.getBOOL("UsePeopleAPI"); + bool use_people_api = gSavedSettings.getBOOL("UsePeopleAPI"); LLCheckBoxCtrl* ctrl_display_name = getChild<LLCheckBoxCtrl>("display_names_check"); ctrl_display_name->setEnabled(use_people_api); if (!use_people_api) { - ctrl_display_name->setValue(FALSE); + ctrl_display_name->setValue(false); } } ////////////////////// PanelVoice /////////////////// - if (hasChild("voice_unavailable", TRUE)) + if (hasChild("voice_unavailable", true)) { - BOOL voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); + bool voice_disabled = gSavedSettings.getBOOL("CmdLineDisableVoice"); getChildView("voice_unavailable")->setVisible( voice_disabled); getChildView("enable_voice_check")->setVisible( !voice_disabled); } //////////////////////PanelSkins /////////////////// - if (hasChild("skin_selection", TRUE)) + if (hasChild("skin_selection", true)) { LLFloaterPreference::refreshSkin(this); @@ -2036,32 +2043,32 @@ BOOL LLPanelPreference::postBuild() } //////////////////////PanelPrivacy /////////////////// - if (hasChild("media_enabled", TRUE)) + if (hasChild("media_enabled", true)) { bool media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia"); getChild<LLCheckBoxCtrl>("media_enabled")->set(media_enabled); getChild<LLCheckBoxCtrl>("autoplay_enabled")->setEnabled(media_enabled); } - if (hasChild("music_enabled", TRUE)) + if (hasChild("music_enabled", true)) { getChild<LLCheckBoxCtrl>("music_enabled")->set(gSavedSettings.getBOOL("AudioStreamingMusic")); } - if (hasChild("voice_call_friends_only_check", TRUE)) + if (hasChild("voice_call_friends_only_check", true)) { getChild<LLCheckBoxCtrl>("voice_call_friends_only_check")->setCommitCallback(boost::bind(&showFriendsOnlyWarning, _1, _2)); } - if (hasChild("allow_multiple_viewer_check", TRUE)) + if (hasChild("allow_multiple_viewer_check", true)) { getChild<LLCheckBoxCtrl>("allow_multiple_viewer_check")->setCommitCallback(boost::bind(&showMultipleViewersWarning, _1, _2)); } - if (hasChild("favorites_on_login_check", TRUE)) + if (hasChild("favorites_on_login_check", true)) { getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setCommitCallback(boost::bind(&handleFavoritesOnLoginChanged, _1, _2)); bool show_favorites_at_login = LLPanelLogin::getShowFavorites(); getChild<LLCheckBoxCtrl>("favorites_on_login_check")->setValue(show_favorites_at_login); } - if (hasChild("mute_chb_label", TRUE)) + if (hasChild("mute_chb_label", true)) { getChild<LLTextBox>("mute_chb_label")->setShowCursorHand(false); getChild<LLTextBox>("mute_chb_label")->setSoundFlags(LLView::MOUSE_UP); @@ -2069,7 +2076,7 @@ BOOL LLPanelPreference::postBuild() } //////////////////////PanelSetup /////////////////// - if (hasChild("max_bandwidth", TRUE)) + if (hasChild("max_bandwidth", true)) { mBandWidthUpdater = new LLPanelPreference::Updater(boost::bind(&handleBandwidthChanged, _1), BANDWIDTH_UPDATER_TIMEOUT); gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()->connect(boost::bind(&LLPanelPreference::Updater::update, mBandWidthUpdater, _2)); @@ -2198,7 +2205,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) @@ -2211,6 +2218,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); } @@ -2232,7 +2245,7 @@ void LLPanelPreference::setControlFalse(const LLSD& user_data) LLControlVariable* control = findControl(control_name); if (control) - control->set(LLSD(FALSE)); + control->set(LLSD(false)); } void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) @@ -2309,7 +2322,7 @@ private: static LLPanelInjector<LLPanelPreferenceGraphics> t_pref_graph("panel_preference_graphics"); static LLPanelInjector<LLPanelPreferencePrivacy> t_pref_privacy("panel_preference_privacy"); -BOOL LLPanelPreferenceGraphics::postBuild() +bool LLPanelPreferenceGraphics::postBuild() { LLFloaterReg::showInstance("prefs_graphics_advanced"); LLFloaterReg::hideInstance("prefs_graphics_advanced"); @@ -2326,7 +2339,6 @@ BOOL LLPanelPreferenceGraphics::postBuild() void LLPanelPreferenceGraphics::draw() { - setPresetText(); LLPanelPreference::draw(); } @@ -2453,9 +2465,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() { @@ -2496,7 +2508,7 @@ LLPanelPreferenceControls::~LLPanelPreferenceControls() { } -BOOL LLPanelPreferenceControls::postBuild() +bool LLPanelPreferenceControls::postBuild() { // populate list of controls pControlsTable = getChild<LLScrollListCtrl>("controls_list"); @@ -2506,7 +2518,7 @@ BOOL LLPanelPreferenceControls::postBuild() pKeyModeBox->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onModeCommit, this)); getChild<LLButton>("restore_defaults")->setCommitCallback(boost::bind(&LLPanelPreferenceControls::onRestoreDefaultsBtn, this)); - return TRUE; + return true; } void LLPanelPreferenceControls::regenerateControls() @@ -2743,7 +2755,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) { @@ -2832,7 +2844,7 @@ void LLPanelPreferenceControls::onListCommit() if (root_floater) root_floater->addDependentFloater(dialog); dialog->openFloater(); - dialog->setFocus(TRUE); + dialog->setFocus(true); } } else @@ -3098,12 +3110,12 @@ LLFloaterPreferenceProxy::~LLFloaterPreferenceProxy() { } -BOOL LLFloaterPreferenceProxy::postBuild() +bool LLFloaterPreferenceProxy::postBuild() { LLRadioGroup* socksAuth = getChild<LLRadioGroup>("socks5_auth_type"); if (!socksAuth) { - return FALSE; + return false; } if (socksAuth->getSelectedValue().asString() == "None") { @@ -3118,7 +3130,7 @@ BOOL LLFloaterPreferenceProxy::postBuild() getChild<LLLineEditor>("socks5_password")->setValue(socks_cred->getAuthenticator()["creds"].asString()); } - return TRUE; + return true; } void LLFloaterPreferenceProxy::onOpen(const LLSD& key) @@ -3270,9 +3282,9 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings() // Check for invalid states for the other HTTP proxy radio LLRadioGroup* otherHttpProxy = getChild<LLRadioGroup>("other_http_proxy_type"); if ((otherHttpProxy->getSelectedValue().asString() == "Socks" && - getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get() == FALSE )||( + !getChild<LLCheckBoxCtrl>("socks_proxy_enabled")->get())||( otherHttpProxy->getSelectedValue().asString() == "Web" && - getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get() == FALSE ) ) + !getChild<LLCheckBoxCtrl>("web_proxy_enabled")->get())) { otherHttpProxy->selectFirstItem(); } @@ -3281,10 +3293,10 @@ void LLFloaterPreferenceProxy::onChangeSocksSettings() void LLFloaterPreference::onUpdateFilterTerm(bool force) { - LLWString seachValue = utf8str_to_wstring( mFilterEdit->getValue() ); - LLWStringUtil::toLower( seachValue ); + LLWString seachValue = utf8str_to_wstring(mFilterEdit->getValue()); + LLWStringUtil::toLower(seachValue); - if( !mSearchData || (mSearchData->mLastFilter == seachValue && !force)) + if (!mSearchData || (mSearchData->mLastFilter == seachValue && !force)) return; if (mSearchDataDirty) @@ -3295,21 +3307,20 @@ void LLFloaterPreference::onUpdateFilterTerm(bool force) mSearchData->mLastFilter = seachValue; - if( !mSearchData->mRootTab ) + if (!mSearchData->mRootTab) return; mSearchData->mRootTab->hightlightAndHide( seachValue ); filterIgnorableNotifications(); - LLTabContainer *pRoot = getChild< LLTabContainer >( "pref core" ); - if( pRoot ) + if (LLTabContainer* pRoot = getChild<LLTabContainer>("pref core")) pRoot->selectFirstTab(); } void LLFloaterPreference::filterIgnorableNotifications() { - bool visible = getChildRef<LLScrollListCtrl>("enabled_popups").highlightMatchingItems(mFilterEdit->getValue()); - visible |= getChildRef<LLScrollListCtrl>("disabled_popups").highlightMatchingItems(mFilterEdit->getValue()); + bool visible = mEnabledPopups->highlightMatchingItems(mFilterEdit->getValue()); + visible |= mDisabledPopups->highlightMatchingItems(mFilterEdit->getValue()); if (visible) { @@ -3319,72 +3330,69 @@ void LLFloaterPreference::filterIgnorableNotifications() void collectChildren( LLView const *aView, ll::prefs::PanelDataPtr aParentPanel, ll::prefs::TabContainerDataPtr aParentTabContainer ) { - if( !aView ) + if (!aView) return; - llassert_always( aParentPanel || aParentTabContainer ); + llassert_always(aParentPanel || aParentTabContainer); - LLView::child_list_const_iter_t itr = aView->beginChild(); - LLView::child_list_const_iter_t itrEnd = aView->endChild(); - - while( itr != itrEnd ) + for (LLView* pView : *aView->getChildList()) { - LLView *pView = *itr; + if (!pView) + continue; + ll::prefs::PanelDataPtr pCurPanelData = aParentPanel; ll::prefs::TabContainerDataPtr pCurTabContainer = aParentTabContainer; - if( !pView ) - continue; - LLPanel const *pPanel = dynamic_cast< LLPanel const *>( pView ); - LLTabContainer const *pTabContainer = dynamic_cast< LLTabContainer const *>( pView ); - ll::ui::SearchableControl const *pSCtrl = dynamic_cast< ll::ui::SearchableControl const *>( pView ); - if( pTabContainer ) + LLPanel const *pPanel = dynamic_cast<LLPanel const*>(pView); + LLTabContainer const *pTabContainer = dynamic_cast<LLTabContainer const*>(pView); + ll::ui::SearchableControl const *pSCtrl = dynamic_cast<ll::ui::SearchableControl const*>( pView ); + + if (pTabContainer) { pCurPanelData.reset(); - pCurTabContainer = ll::prefs::TabContainerDataPtr( new ll::prefs::TabContainerData ); - pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>( pTabContainer ); + pCurTabContainer = ll::prefs::TabContainerDataPtr(new ll::prefs::TabContainerData); + pCurTabContainer->mTabContainer = const_cast< LLTabContainer *>(pTabContainer); pCurTabContainer->mLabel = pTabContainer->getLabel(); pCurTabContainer->mPanel = 0; - if( aParentPanel ) - aParentPanel->mChildPanel.push_back( pCurTabContainer ); - if( aParentTabContainer ) - aParentTabContainer->mChildPanel.push_back( pCurTabContainer ); + if (aParentPanel) + aParentPanel->mChildPanel.push_back(pCurTabContainer); + if (aParentTabContainer) + aParentTabContainer->mChildPanel.push_back(pCurTabContainer); } - else if( pPanel ) + else if (pPanel) { pCurTabContainer.reset(); - pCurPanelData = ll::prefs::PanelDataPtr( new ll::prefs::PanelData ); + pCurPanelData = ll::prefs::PanelDataPtr(new ll::prefs::PanelData); pCurPanelData->mPanel = pPanel; pCurPanelData->mLabel = pPanel->getLabel(); llassert_always( aParentPanel || aParentTabContainer ); - if( aParentTabContainer ) - aParentTabContainer->mChildPanel.push_back( pCurPanelData ); - else if( aParentPanel ) - aParentPanel->mChildPanel.push_back( pCurPanelData ); + if (aParentTabContainer) + aParentTabContainer->mChildPanel.push_back(pCurPanelData); + else if (aParentPanel) + aParentPanel->mChildPanel.push_back(pCurPanelData); } - else if( pSCtrl && pSCtrl->getSearchText().size() ) + else if (pSCtrl && pSCtrl->getSearchText().size()) { - ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr( new ll::prefs::SearchableItem() ); + ll::prefs::SearchableItemPtr item = ll::prefs::SearchableItemPtr(new ll::prefs::SearchableItem()); item->mView = pView; item->mCtrl = pSCtrl; - item->mLabel = utf8str_to_wstring( pSCtrl->getSearchText() ); - LLWStringUtil::toLower( item->mLabel ); + item->mLabel = utf8str_to_wstring(pSCtrl->getSearchText()); + LLWStringUtil::toLower(item->mLabel); - llassert_always( aParentPanel || aParentTabContainer ); + llassert_always(aParentPanel || aParentTabContainer); - if( aParentPanel ) - aParentPanel->mChildren.push_back( item ); - if( aParentTabContainer ) - aParentTabContainer->mChildren.push_back( item ); + if (aParentPanel) + aParentPanel->mChildren.push_back(item); + if (aParentTabContainer) + aParentTabContainer->mChildren.push_back(item); } - collectChildren( pView, pCurPanelData, pCurTabContainer ); - ++itr; + collectChildren(pView, pCurPanelData, pCurTabContainer); } } |