From 873a92785f4688e37ba5be54d7e7123988aefc03 Mon Sep 17 00:00:00 2001 From: Northspring Date: Fri, 26 Sep 2014 22:26:56 +0200 Subject: Polish translation update for viewer-release 3.7.17: Removing redundant files not present in /en/ directory (1/3) --- .../default/xui/pl/floater_animation_preview.xml | 187 --------------------- .../skins/default/xui/pl/floater_inventory.xml | 16 -- .../skins/default/xui/pl/floater_nearby_chat.xml | 4 - .../skins/default/xui/pl/floater_perm_prefs.xml | 16 -- .../skins/default/xui/pl/floater_postcard.xml | 36 ---- .../default/xui/pl/floater_voice_controls.xml | 30 ---- .../skins/default/xui/pl/menu_bottomtray.xml | 17 -- .../default/xui/pl/menu_inspect_avatar_gear.xml | 21 --- .../default/xui/pl/menu_inspect_self_gear.xml | 31 ---- .../xui/pl/menu_people_friends_view_sort.xml | 8 - .../xui/pl/menu_people_groups_view_sort.xml | 5 - .../xui/pl/menu_people_nearby_view_sort.xml | 8 - .../xui/pl/menu_people_recent_view_sort.xml | 7 - .../default/xui/pl/panel_adhoc_control_panel.xml | 14 -- .../skins/default/xui/pl/panel_bottomtray.xml | 47 ------ .../default/xui/pl/panel_group_control_panel.xml | 17 -- .../default/xui/pl/panel_im_control_panel.xml | 29 ---- .../skins/default/xui/pl/panel_region_texture.xml | 57 ------- .../skins/default/xui/pl/panel_side_tray.xml | 29 ---- 19 files changed, 579 deletions(-) delete mode 100755 indra/newview/skins/default/xui/pl/floater_animation_preview.xml delete mode 100755 indra/newview/skins/default/xui/pl/floater_inventory.xml delete mode 100755 indra/newview/skins/default/xui/pl/floater_nearby_chat.xml delete mode 100755 indra/newview/skins/default/xui/pl/floater_perm_prefs.xml delete mode 100755 indra/newview/skins/default/xui/pl/floater_postcard.xml delete mode 100755 indra/newview/skins/default/xui/pl/floater_voice_controls.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_bottomtray.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_inspect_avatar_gear.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_inspect_self_gear.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_people_friends_view_sort.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_people_groups_view_sort.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_people_nearby_view_sort.xml delete mode 100755 indra/newview/skins/default/xui/pl/menu_people_recent_view_sort.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_adhoc_control_panel.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_bottomtray.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_group_control_panel.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_im_control_panel.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_region_texture.xml delete mode 100755 indra/newview/skins/default/xui/pl/panel_side_tray.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/pl/floater_animation_preview.xml b/indra/newview/skins/default/xui/pl/floater_animation_preview.xml deleted file mode 100755 index 3402d8d31f..0000000000 --- a/indra/newview/skins/default/xui/pl/floater_animation_preview.xml +++ /dev/null @@ -1,187 +0,0 @@ - - - - Inicjalizacja ruchu nie powiodła się. - - - Długość pliku animacji wynosi [LENGTH] sekund. - -Maksymalna długość pliku animacji wynosi [MAX_LENGTH] sekund. - - - Brak możliwości odczytania plików animacji do wyświetlenia. - -[STATUS] - - - Ok - - - Niewłaściwe zakończenie nazwy pliku. - - - Brak możliwości wyświetlenia definicji ograniczenia. - - - Plik BVH nie może zostać otworzony. - - - Niewłaściwy nagłówek HIERARCHII. - - - ROOT oraz JOINT nieodnalezione. - - - Brak nazwy JOINT. - - - OFFSET nieodnalezione. - - - CHANNELS nieodnalezione. - - - Brak otrzymania kolejności obrotu. - - - Brak osi obrotu. - - - MOTION nieodnalezione. - - - Brak otrzymania liczby klatek obrazu. - - - Brak otrzymania czasu dla ilości klatek obrazu. - - - Brak otrzymania wartości pozycji. - - - Nie można odczytać wartości obrotu. - - - Nie można otworzyć pliku tłumaczenia. - - - Nie można przeczytać tłumaczenia nagłówka. - - - Nie można przetłumaczyć nazw. - - - Nie można przeczytać tłumaczenia dla wartości ignorowania. - - - Nie można przeczytać tłumaczenia wartości relatywnej. - - - Nie można przeczytać nazw wartości tłumaczenia. - - - Nie można przeczytać tłumaczenia pola. - - - Brak otrzymania nazwy dla mergechild. - - - Brak otrzymania nazwy dla mergeparent. - - - Brak wartości prerogatywy. - - - Brak otrzymania wartości powtórzeń. - - - Brak otrzymawnia wartości easeIn. - - - Brak otrzymania wartości dla easeOut. - - - Brak otrzymania wartości morfizacji. - - - Nie można odczytać nazwy emocji. - - - Nieprawidłowa nazwa, użyj "hip". - - - Nazwa: - - - Opis: - - - - - - - Pozycja ręki - - - - - - - - - - - - - - - - - - Ekspresja - - - - - - - - - - - - - - - - - - - - - - - - - Przeglądaj kiedy: - - - - - - - - - - - + Godzin - + Dni - - + + + + + + + -- cgit v1.2.3 From 42821c7c54ff2eed5327262bf26b28ad429ee1d3 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 25 Nov 2014 09:02:28 -0500 Subject: STORM-2082 Small fix for button highlighting issue --- indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 72976deaed..955c0f1a41 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -168,6 +168,7 @@ control_name="ShowAdvancedGraphicsSettings" enabled_control="ShowAdvancedGraphicsSettings" is_toggle="true" + image_selected="PushButton_Off" follows="top|left" height="23" label="Basic Settings" @@ -180,6 +181,7 @@ control_name="ShowAdvancedGraphicsSettings" disabled_control="ShowAdvancedGraphicsSettings" is_toggle="true" + image_disabled_selected="PushButton_Disabled" follows="top|left" height="23" label="Advanced Settings" -- cgit v1.2.3 From ea0216f67c12195aadb1993180c28c43b04294bd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 25 Nov 2014 16:33:53 -0500 Subject: STORM-2082 Add tab containers, remove buttons and obsolete debug setting --- indra/newview/app_settings/settings.xml | 11 - .../default/textures/icons/FastPrefs_Icon.png | Bin 0 -> 268 bytes indra/newview/skins/default/textures/textures.xml | 2 + .../xui/en/menu_preferences_graphics_gear.xml | 21 - .../default/xui/en/panel_preferences_graphics1.xml | 1467 ++++++++++---------- .../skins/default/xui/en/panel_status_bar.xml | 11 +- 6 files changed, 759 insertions(+), 753 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/FastPrefs_Icon.png delete mode 100644 indra/newview/skins/default/xui/en/menu_preferences_graphics_gear.xml (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 2e8737f0d7..17b43901a9 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10529,17 +10529,6 @@ Value 0 - ShowAdvancedGraphicsSettings - - Comment - Show advanced graphics settings - Persist - 1 - Type - Boolean - Value - 0 - ShowAllObjectHoverTip Comment diff --git a/indra/newview/skins/default/textures/icons/FastPrefs_Icon.png b/indra/newview/skins/default/textures/icons/FastPrefs_Icon.png new file mode 100644 index 0000000000..380d3812d8 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/FastPrefs_Icon.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1f10d966d5..2dbf9d1bab 100755 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -204,6 +204,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/xui/en/menu_preferences_graphics_gear.xml b/indra/newview/skins/default/xui/en/menu_preferences_graphics_gear.xml deleted file mode 100644 index 0e0f8f6865..0000000000 --- a/indra/newview/skins/default/xui/en/menu_preferences_graphics_gear.xml +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 955c0f1a41..0a7cc995c7 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -20,8 +20,8 @@ left="5" name="label" top="10" - width="120"> - Graphic Presets: + width="60"> + Presets: - - - + width="115"> + + + - + function="Pref.QualityPerformance"/> + - - - + + + + diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 064ece6e4b..a1f7503269 100755 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -35,7 +35,7 @@ 24:00 AM PST + + + Graphic Presets + + diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index a1f7503269..bb38c384a8 100755 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -105,14 +105,13 @@ width="145"> 24:00 AM PST - Loading... - + + + -None saved yet- + -- cgit v1.2.3 From 563e22e81c6bf14bca6370b098a257f94f4f843f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 30 Nov 2014 11:24:22 -0500 Subject: STORM-2082 Make code more generic to handle the future camera presets. --- indra/newview/llfloaterdeleteprefpreset.cpp | 9 +- indra/newview/llfloaterdeleteprefpreset.h | 2 + indra/newview/llfloaterpreference.cpp | 6 +- indra/newview/llpresetsmanager.cpp | 122 ++++++++++++++-------------- indra/newview/llpresetsmanager.h | 12 +-- 5 files changed, 75 insertions(+), 76 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index 5dc51c4223..bef5b4e3bf 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -49,14 +49,14 @@ BOOL LLFloaterDeletePrefPreset::postBuild() void LLFloaterDeletePrefPreset::onOpen(const LLSD& key) { - std::string param = key.asString(); - std::string floater_title = getString(std::string("title_") + param); + std::string mSubdirectory = key.asString(); + std::string floater_title = getString(std::string("title_") + mSubdirectory); setTitle(floater_title); LLComboBox* combo = getChild("preset_combo"); - LLPresetsManager::getInstance()->setPresetNamesInComboBox(combo); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo); } void LLFloaterDeletePrefPreset::onBtnDelete() @@ -64,6 +64,7 @@ void LLFloaterDeletePrefPreset::onBtnDelete() LLComboBox* combo = getChild("preset_combo"); std::string name = combo->getSimple(); + // Ignore return status LLPresetsManager::getInstance()->deletePreset(name); } @@ -71,7 +72,7 @@ void LLFloaterDeletePrefPreset::onPresetsListChange() { LLComboBox* combo = getChild("preset_combo"); - LLPresetsManager::getInstance()->setPresetNamesInComboBox(combo); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, combo); } void LLFloaterDeletePrefPreset::onBtnCancel() diff --git a/indra/newview/llfloaterdeleteprefpreset.h b/indra/newview/llfloaterdeleteprefpreset.h index fc531ca1b7..356bc1a437 100644 --- a/indra/newview/llfloaterdeleteprefpreset.h +++ b/indra/newview/llfloaterdeleteprefpreset.h @@ -46,6 +46,8 @@ public: private: void onPresetsListChange(); + + std::string mSubdirectory; }; #endif // LL_LLFLOATERDELETEPREFPRESET_H diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6b798f6549..508d82522e 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -749,7 +749,9 @@ void LLFloaterPreference::onOpen(const LLSD& key) { LL_WARNS() << "No " << default_file << " found -- creating one" << LL_ENDL; // Write current graphic settings to default.xml - LLPresetsManager::getInstance()->savePreset("Default"); + // If this name is to be localized additional code will be needed to delete the old default + // when changing languages. + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, "Default"); } } @@ -2160,7 +2162,7 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - LLPresetsManager::getInstance()->setPresetNamesInComboBox(combo); + LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo); } void LLPanelPreferenceGraphics::draw() diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 6b0023d97a..6e00a90ae5 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -45,7 +45,8 @@ LLPresetsManager::~LLPresetsManager() { } -std::string LLPresetsManager::getUserDir(const std::string& subdirectory) +//std::string LLPresetsManager::getUserDir(const std::string& subdirectory) +std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) { std::string presets_path = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR); std::string full_path; @@ -64,22 +65,7 @@ std::string LLPresetsManager::getUserDir(const std::string& subdirectory) return full_path; } -std::string LLPresetsManager::getCameraPresetsDir() -{ - return getUserDir(PRESETS_CAMERA); -} - -std::string LLPresetsManager::getGraphicPresetsDir() -{ - return getUserDir(PRESETS_GRAPHIC); -} - -void LLPresetsManager::getPresetNames(preset_name_list_t& presets) const -{ - presets = mPresetNames; -} - -void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir) +void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets) { LL_INFOS("AppInit") << "Loading presets from " << dir << LL_ENDL; @@ -106,48 +92,61 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir) } } } + + presets = mPresetNames; } -void LLPresetsManager::savePreset(const std::string& name) +void LLPresetsManager::savePreset(const std::string& subdirectory, const std::string& name) { llassert(!name.empty()); + std::vector name_list; // This ugliness is the current list of all the control variables in the graphics and hardware - // preferences floaters. Additions or subtractions to the floaters must also be reflected here. - std::vector name_list = boost::assign::list_of - ("RenderQualityPerformance") - ("RenderFarClip") - ("RenderMaxPartCount") - ("RenderGlowResolutionPow") - ("RenderTerrainDetail") - ("RenderAvatarLODFactor") - ("RenderAvatarMaxVisible") - ("RenderUseImpostors") - ("RenderTerrainLODFactor") - ("RenderTreeLODFactor") - ("RenderVolumeLODFactor") - ("RenderFlexTimeFactor") - ("RenderTransparentWater") - ("RenderObjectBump") - ("RenderLocalLights") - ("VertexShaderEnable") - ("RenderAvatarVP") - ("RenderAvatarCloth") - ("RenderReflectionDetail") - ("WindLightUseAtmosShaders") - ("WLSkyDetail") - ("RenderDeferred") - ("RenderDeferredSSAO") - ("RenderDepthOfField") - ("RenderShadowDetail") - - ("RenderAnisotropic") - ("RenderFSAASamples") - ("RenderGamma") - ("RenderVBOEnable") - ("RenderCompressTextures") - ("TextureMemory") - ("RenderFogRatio"); + // preferences floaters or the settings for camera views. + // Additions or subtractions to the control variables in the floaters must also be reflected here. + if(PRESETS_GRAPHIC == subdirectory) + { + name_list = boost::assign::list_of + ("RenderQualityPerformance") + ("RenderFarClip") + ("RenderMaxPartCount") + ("RenderGlowResolutionPow") + ("RenderTerrainDetail") + ("RenderAvatarLODFactor") + ("RenderAvatarMaxVisible") + ("RenderUseImpostors") + ("RenderTerrainLODFactor") + ("RenderTreeLODFactor") + ("RenderVolumeLODFactor") + ("RenderFlexTimeFactor") + ("RenderTransparentWater") + ("RenderObjectBump") + ("RenderLocalLights") + ("VertexShaderEnable") + ("RenderAvatarVP") + ("RenderAvatarCloth") + ("RenderReflectionDetail") + ("WindLightUseAtmosShaders") + ("WLSkyDetail") + ("RenderDeferred") + ("RenderDeferredSSAO") + ("RenderDepthOfField") + ("RenderShadowDetail") + + ("RenderAnisotropic") + ("RenderFSAASamples") + ("RenderGamma") + ("RenderVBOEnable") + ("RenderCompressTextures") + ("TextureMemory") + ("RenderFogRatio"); + } + + if(PRESETS_CAMERA == subdirectory) + { + name_list = boost::assign::list_of + ("Placeholder"); + } // make an empty llsd LLSD paramsData(LLSD::emptyMap()); @@ -166,7 +165,7 @@ void LLPresetsManager::savePreset(const std::string& name) paramsData[ctrl_name]["Value"] = value; } - std::string pathName(getUserDir(PRESETS_GRAPHIC) + "\\" + LLURI::escape(name) + ".xml"); + std::string pathName(getPresetsDir(subdirectory) + "\\" + LLURI::escape(name) + ".xml"); // write to file llofstream presetsXML(pathName); @@ -178,17 +177,16 @@ void LLPresetsManager::savePreset(const std::string& name) mPresetListChangeSignal(); } -void LLPresetsManager::setPresetNamesInComboBox(LLComboBox* combo) +void LLPresetsManager::setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo) { combo->clearRows(); - std::string presets_dir = getGraphicPresetsDir(); + std::string presets_dir = getPresetsDir(subdirectory); if (!presets_dir.empty()) { - loadPresetNamesFromDir(presets_dir); std::list preset_names; - getPresetNames(preset_names); + loadPresetNamesFromDir(presets_dir, preset_names); combo->setLabel(LLTrans::getString("preset_combo_label")); @@ -206,9 +204,9 @@ void LLPresetsManager::setPresetNamesInComboBox(LLComboBox* combo) void LLPresetsManager::loadPreset(const std::string& name) { - std::string pathName(getUserDir(PRESETS_GRAPHIC) + "\\" + LLURI::escape(name) + ".xml"); + std::string full_path(getPresetsDir(PRESETS_GRAPHIC) + "\\" + LLURI::escape(name) + ".xml"); - gSavedSettings.loadFromFile(pathName, false, true); + gSavedSettings.loadFromFile(full_path, false, true); } bool LLPresetsManager::deletePreset(const std::string& name) @@ -221,10 +219,10 @@ bool LLPresetsManager::deletePreset(const std::string& name) return false; } - // (*TODO Should the name be escaped here? - if (gDirUtilp->deleteFilesInDir(getUserDir(PRESETS_GRAPHIC), name + ".xml") < 1) + if (gDirUtilp->deleteFilesInDir(getPresetsDir(PRESETS_GRAPHIC), LLURI::escape(name) + ".xml") < 1) { LL_WARNS("Presets") << "Error removing preset " << name << " from disk" << LL_ENDL; + return false; } else { diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 128c5850f2..3a2542bda0 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -42,13 +42,11 @@ public: typedef std::list preset_name_list_t; typedef boost::signals2::signal preset_list_signal_t; - void setPresetNamesInComboBox(LLComboBox* combo); - void getPresetNames(preset_name_list_t& presets) const; - void loadPresetNamesFromDir(const std::string& dir); - void savePreset(const std::string & name); + static std::string getPresetsDir(const std::string& subdirectory); + void setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo); + void loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets); + void savePreset(const std::string& subdirectory, const std::string & name); void loadPreset(const std::string & name); - static std::string getCameraPresetsDir(); - static std::string getGraphicPresetsDir(); bool deletePreset(const std::string& name); /// Emitted when a preset gets loaded or deleted. @@ -60,8 +58,6 @@ public: LLPresetsManager(); ~LLPresetsManager(); - static std::string getUserDir(const std::string& subdirectory); - preset_list_signal_t mPresetListChangeSignal; }; -- cgit v1.2.3 From 6d1296f71640c9c25affcff4e784ea5798ba2d5c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 1 Dec 2014 08:09:17 -0500 Subject: STORM-2082 Implement save floater and some code cleanup. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llfloaterdeleteprefpreset.cpp | 12 ++- indra/newview/llfloaterdeleteprefpreset.h | 2 +- indra/newview/llfloaterpreference.cpp | 25 ++++-- indra/newview/llfloaterpreference.h | 5 +- indra/newview/llfloatersaveprefpreset.cpp | 97 ++++++++++++++++++++++ indra/newview/llfloatersaveprefpreset.h | 57 +++++++++++++ indra/newview/llpresetsmanager.cpp | 41 ++++----- indra/newview/llpresetsmanager.h | 4 +- indra/newview/llviewerfloaterreg.cpp | 2 + .../default/xui/en/floater_save_pref_preset.xml | 50 +++++++++++ .../newview/skins/default/xui/en/notifications.xml | 14 ++++ .../default/xui/en/panel_preferences_graphics1.xml | 6 +- 13 files changed, 274 insertions(+), 43 deletions(-) create mode 100644 indra/newview/llfloatersaveprefpreset.cpp create mode 100644 indra/newview/llfloatersaveprefpreset.h create mode 100644 indra/newview/skins/default/xui/en/floater_save_pref_preset.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 213446ccfb..57fa11a0bf 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -279,6 +279,7 @@ set(viewer_SOURCE_FILES llfloaterregioninfo.cpp llfloaterreporter.cpp llfloaterregionrestarting.cpp + llfloatersaveprefpreset.cpp llfloatersceneloadstats.cpp llfloaterscriptdebug.cpp llfloaterscriptedprefs.cpp @@ -890,6 +891,7 @@ set(viewer_HEADER_FILES llfloaterregioninfo.h llfloaterreporter.h llfloaterregionrestarting.h + llfloatersaveprefpreset.h llfloatersceneloadstats.h llfloaterscriptdebug.h llfloaterscriptedprefs.h diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index bef5b4e3bf..74f8805d03 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -28,9 +28,11 @@ #include "llfloaterdeleteprefpreset.h" +#include "llpresetsmanager.h" + #include "llbutton.h" #include "llcombobox.h" -#include "llpresetsmanager.h" +#include "llnotificationsutil.h" LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key) : LLFloater(key) @@ -49,7 +51,7 @@ BOOL LLFloaterDeletePrefPreset::postBuild() void LLFloaterDeletePrefPreset::onOpen(const LLSD& key) { - std::string mSubdirectory = key.asString(); + mSubdirectory = key.asString(); std::string floater_title = getString(std::string("title_") + mSubdirectory); setTitle(floater_title); @@ -65,7 +67,11 @@ void LLFloaterDeletePrefPreset::onBtnDelete() std::string name = combo->getSimple(); // Ignore return status - LLPresetsManager::getInstance()->deletePreset(name); + LLPresetsManager::getInstance()->deletePreset(mSubdirectory, name); + + LLSD args; + args["NAME"] = name; + LLNotificationsUtil::add("PresetDeleted", args); } void LLFloaterDeletePrefPreset::onPresetsListChange() diff --git a/indra/newview/llfloaterdeleteprefpreset.h b/indra/newview/llfloaterdeleteprefpreset.h index 356bc1a437..0ab3da7139 100644 --- a/indra/newview/llfloaterdeleteprefpreset.h +++ b/indra/newview/llfloaterdeleteprefpreset.h @@ -25,7 +25,7 @@ * $/LicenseInfo$ */ -#ifndef LL_LLFLOATERDELETPREFPRESET_H +#ifndef LL_LLFLOATERDELETEPREFPRESET_H #define LL_LLFLOATERDELETEPREFPRESET_H #include "llfloater.h" diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 508d82522e..2e1e1ba318 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1883,8 +1883,9 @@ LLPanelPreference::LLPanelPreference() { mCommitCallbackRegistrar.add("Pref.setControlFalse", boost::bind(&LLPanelPreference::setControlFalse,this, _2)); mCommitCallbackRegistrar.add("Pref.updateMediaAutoPlayCheckbox", boost::bind(&LLPanelPreference::updateMediaAutoPlayCheckbox, this, _1)); - mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this)); - mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::onDeletePreset, this)); + mCommitCallbackRegistrar.add("Pref.Preset", boost::bind(&LLPanelPreference::onChangePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefDelete", boost::bind(&LLPanelPreference::DeletePreset, this, _2)); + mCommitCallbackRegistrar.add("Pref.PrefSave", boost::bind(&LLPanelPreference::SavePreset, this, _2)); } //virtual @@ -2082,17 +2083,27 @@ void LLPanelPreference::updateMediaAutoPlayCheckbox(LLUICtrl* ctrl) } } -void LLPanelPreference::onDeletePreset() +void LLPanelPreference::DeletePreset(const LLSD& user_data) { - LLFloaterReg::showInstance("delete_pref_preset", PRESETS_GRAPHIC); + std::string subdirectory = user_data.asString(); + LLFloaterReg::showInstance("delete_pref_preset", subdirectory); } -void LLPanelPreference::onChangePreset() +void LLPanelPreference::SavePreset(const LLSD& user_data) { - LLComboBox* combo = getChild("graphic_preset_combo"); + std::string subdirectory = user_data.asString(); + LLFloaterReg::showInstance("save_pref_preset", subdirectory); +} + +void LLPanelPreference::onChangePreset(const LLSD& user_data) +{ + std::string subdirectory = user_data.asString(); + + LLComboBox* combo = getChild(subdirectory + "_preset_combo"); std::string name = combo->getSimple(); - LLPresetsManager::getInstance()->loadPreset(name); + + LLPresetsManager::getInstance()->loadPreset(subdirectory, name); LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); if (instance) { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index be228c8625..5452dc6442 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -221,8 +221,9 @@ public: // cancel() can restore them. virtual void saveSettings(); - void onDeletePreset(); - void onChangePreset(); + void onChangePreset(const LLSD& user_data); + void DeletePreset(const LLSD& user_data); + void SavePreset(const LLSD& user_data); class Updater; diff --git a/indra/newview/llfloatersaveprefpreset.cpp b/indra/newview/llfloatersaveprefpreset.cpp new file mode 100644 index 0000000000..16d77c0750 --- /dev/null +++ b/indra/newview/llfloatersaveprefpreset.cpp @@ -0,0 +1,97 @@ +/** + * @file llfloatersaveprefpreset.cpp + * @brief Floater to save a graphics / camera preset + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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. + * + * 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. + * + * 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 + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llfloatersaveprefpreset.h" + +#include "llbutton.h" +#include "llcombobox.h" +#include "llnotificationsutil.h" +#include "llpresetsmanager.h" + +LLFloaterSavePrefPreset::LLFloaterSavePrefPreset(const LLSD &key) +: LLFloater(key) +{ +} + +// virtual +BOOL LLFloaterSavePrefPreset::postBuild() +{ + getChild("preset_combo")->setTextEntryCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this)); + getChild("preset_combo")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this)); + getChild("save")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onBtnSave, this)); + getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onBtnCancel, this)); + + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetsListChange, this)); + + mSaveButton = getChild("save"); + mPresetCombo = getChild("preset_combo"); + + return TRUE; +} + +void LLFloaterSavePrefPreset::onPresetNameEdited() +{ + // Disable saving a preset having empty name. + std::string name = mPresetCombo->getSimple(); + + mSaveButton->setEnabled(!name.empty()); +} + +void LLFloaterSavePrefPreset::onOpen(const LLSD& key) +{ + mSubdirectory = key.asString(); + + std::string floater_title = getString(std::string("title_") + mSubdirectory); + + setTitle(floater_title); + + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo); + + onPresetNameEdited(); +} + +void LLFloaterSavePrefPreset::onBtnSave() +{ + std::string name = mPresetCombo->getSimple(); + + LLPresetsManager::getInstance()->savePreset(mSubdirectory, name); + + LLSD args; + args["NAME"] = name; + LLNotificationsUtil::add("PresetSaved", args); +} + +void LLFloaterSavePrefPreset::onPresetsListChange() +{ + LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo); +} + +void LLFloaterSavePrefPreset::onBtnCancel() +{ + closeFloater(); +} diff --git a/indra/newview/llfloatersaveprefpreset.h b/indra/newview/llfloatersaveprefpreset.h new file mode 100644 index 0000000000..09a87b8c62 --- /dev/null +++ b/indra/newview/llfloatersaveprefpreset.h @@ -0,0 +1,57 @@ +/** + * @file llfloatersaveprefpreset.h + * @brief Floater to save a graphics / camera preset + + * + * $LicenseInfo:firstyear=2014&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2014, 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. + * + * 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. + * + * 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 + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERSAVEPREFPRESET_H +#define LL_LLFLOATERSAVEPREFPRESET_H + +#include "llfloater.h" + +class LLComboBox; + +class LLFloaterSavePrefPreset : public LLFloater +{ + +public: + LLFloaterSavePrefPreset(const LLSD &key); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onOpen(const LLSD& key); + + void onBtnSave(); + void onBtnCancel(); + +private: + LLComboBox* mPresetCombo; + LLButton* mSaveButton; + + void onPresetsListChange(); + void onPresetNameEdited(); + + std::string mSubdirectory; +}; + +#endif // LL_LLFLOATERSAVEPREFPRESET_H diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 6e00a90ae5..f6f2275da9 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -165,7 +165,7 @@ void LLPresetsManager::savePreset(const std::string& subdirectory, const std::st paramsData[ctrl_name]["Value"] = value; } - std::string pathName(getPresetsDir(subdirectory) + "\\" + LLURI::escape(name) + ".xml"); + std::string pathName(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml"); // write to file llofstream presetsXML(pathName); @@ -188,46 +188,35 @@ void LLPresetsManager::setPresetNamesInComboBox(const std::string& subdirectory, std::list preset_names; loadPresetNamesFromDir(presets_dir, preset_names); - combo->setLabel(LLTrans::getString("preset_combo_label")); - - for (std::list::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it) + if (preset_names.begin() != preset_names.end()) { - const std::string& name = *it; - combo->add(name, LLSD().with(0, name)); + for (std::list::const_iterator it = preset_names.begin(); it != preset_names.end(); ++it) + { + const std::string& name = *it; + combo->add(name, LLSD().with(0, name)); + } + } + else + { + combo->setLabel(LLTrans::getString("preset_combo_label")); } - } - else - { - LL_WARNS() << "Could not obtain graphic presets path" << LL_ENDL; } } -void LLPresetsManager::loadPreset(const std::string& name) +void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::string& name) { - std::string full_path(getPresetsDir(PRESETS_GRAPHIC) + "\\" + LLURI::escape(name) + ".xml"); + std::string full_path(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml"); gSavedSettings.loadFromFile(full_path, false, true); } -bool LLPresetsManager::deletePreset(const std::string& name) +bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::string& name) { - // remove from param list - preset_name_list_t::iterator it = find(mPresetNames.begin(), mPresetNames.end(), name); - if (it == mPresetNames.end()) - { - LL_WARNS("Presets") << "No preset named " << name << LL_ENDL; - return false; - } - - if (gDirUtilp->deleteFilesInDir(getPresetsDir(PRESETS_GRAPHIC), LLURI::escape(name) + ".xml") < 1) + if (gDirUtilp->deleteFilesInDir(getPresetsDir(subdirectory), LLURI::escape(name) + ".xml") < 1) { LL_WARNS("Presets") << "Error removing preset " << name << " from disk" << LL_ENDL; return false; } - else - { - mPresetNames.erase(it); - } // signal interested parties mPresetListChangeSignal(); diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 3a2542bda0..7bbaa778c6 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -46,8 +46,8 @@ public: void setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo); void loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets); void savePreset(const std::string& subdirectory, const std::string & name); - void loadPreset(const std::string & name); - bool deletePreset(const std::string& name); + void loadPreset(const std::string& subdirectory, const std::string & name); + bool deletePreset(const std::string& subdirectory, const std::string& name); /// Emitted when a preset gets loaded or deleted. boost::signals2::connection setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 03360deaee..3ee67d8ac5 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -101,6 +101,7 @@ #include "llfloaterregioninfo.h" #include "llfloaterregionrestarting.h" #include "llfloaterreporter.h" +#include "llfloatersaveprefpreset.h" #include "llfloatersceneloadstats.h" #include "llfloaterscriptdebug.h" #include "llfloaterscriptedprefs.h" @@ -290,6 +291,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("preview_texture", "floater_preview_texture.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "preview"); LLFloaterReg::add("properties", "floater_inventory_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("publish_classified", "floater_publish_classified.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("save_pref_preset", "floater_save_pref_preset.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("script_colors", "floater_script_ed_prefs.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("telehubs", "floater_telehub.xml",&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/floater_save_pref_preset.xml b/indra/newview/skins/default/xui/en/floater_save_pref_preset.xml new file mode 100644 index 0000000000..5919d9e3d7 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_save_pref_preset.xml @@ -0,0 +1,50 @@ + + + + Save Graphic Preset + Save Camera Preset + + + Preset: + + + + diff --git a/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml b/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml index 697bfd58e7..652d85656c 100644 --- a/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml +++ b/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml @@ -12,29 +12,60 @@ layout="topleft" name="presets_pulldown" width="225"> - Graphic Presets + + + + + + + -- cgit v1.2.3 From afd12a6e784574e69ef3b3e7cac14573fe7c3197 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 3 Dec 2014 09:38:10 -0500 Subject: STORM-2082 Send signal to pulldown panel to refresh itself --- indra/newview/llpanelpresetspulldown.cpp | 2 -- indra/newview/llpresetsmanager.cpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index cd049712e1..093b5caad9 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -150,8 +150,6 @@ void LLPanelPresetsPulldown::onRowClick(const LLSD& user_data) instance->refreshEnabledGraphics(); } setVisible(FALSE); - // This line shouldn't be necessary but it is. - populatePanel(); } } } diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index ddcd54162c..260f2c9547 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -242,6 +242,9 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st std::string full_path(getPresetsDir(subdirectory) + gDirUtilp->getDirDelimiter() + LLURI::escape(name) + ".xml"); gSavedSettings.loadFromFile(full_path, false, true); + + // signal interested parties + mPresetListChangeSignal(); } bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::string& name) -- cgit v1.2.3 From 6c534dff5f30e503d6f5b63cdeeb4c0e2a29ae28 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 3 Dec 2014 10:10:42 -0500 Subject: remove obsolete menu entries in favor of integrated render info display --- indra/newview/skins/default/xui/en/menu_viewer.xml | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 21e15ba270..c96a0366ca 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2658,26 +2658,6 @@ - - - - - - - - Date: Wed, 3 Dec 2014 10:13:50 -0500 Subject: further improvements to avatar render info display and logging of associated server messages --- indra/newview/llavatarrenderinfoaccountant.cpp | 119 +++++++++++-------------- indra/newview/llavatarrenderinfoaccountant.h | 2 - indra/newview/llvoavatar.cpp | 54 +++++------ 3 files changed, 81 insertions(+), 94 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index ca2674bf94..83ae0438d9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -70,14 +70,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight GET: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight GET error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -91,10 +91,7 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights request for region " << regionp->getName() << ":" << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; if (content.isMap()) { @@ -109,40 +106,57 @@ public: LLUUID target_agent_id = LLUUID(report_iter->first); const LLSD & agent_info_map = report_iter->second; LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if (avatarp && - avatarp->isAvatar() && - agent_info_map.isMap()) + if ( avatarp + && avatarp->isAvatar() + && agent_info_map.isMap()) { // Extract the data for this avatar - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; if (agent_info_map.has(KEY_WEIGHT)) { ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } report_iter++; } } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + } + } // has "agents" else if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info GET error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() << LL_ENDL; } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; } } else { - LL_INFOS() << "Avatar render weight info recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -165,14 +179,14 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - LL_WARNS() << "HTTP error result for avatar weight POST: " << statusNum + LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum << ", " << reason << " returned by region " << regionp->getName() << LL_ENDL; } else { - LL_WARNS() << "Avatar render weight POST error recieved but region not found for " + LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " << mRegionHandle << ", error " << statusNum << ", " << reason @@ -185,18 +199,15 @@ public: LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); if (regionp) { - if (LLAvatarRenderInfoAccountant::logRenderInfo()) - { - LL_INFOS() << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() + << ": " << content << LL_ENDL; if (content.isMap()) { if (content.has(KEY_ERROR)) { const LLSD & error = content[KEY_ERROR]; - LL_WARNS() << "Avatar render info POST error: " + LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " << error[KEY_IDENTIFIER] << ": " << error[KEY_MESSAGE] << " from region " << regionp->getName() @@ -206,7 +217,7 @@ public: } else { - LL_INFOS() << "Avatar render weight POST result recieved but region not found for " + LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " << mRegionHandle << LL_ENDL; } } @@ -223,13 +234,10 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " + << regionp->getName() + << " from " << url + << LL_ENDL; // Build the render info to POST to the region LLSD report = LLSD::emptyMap(); @@ -252,14 +260,8 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio info[KEY_WEIGHT] = avatar->getVisualComplexity(); agents[avatar->getID().asString()] = info; - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; - LL_INFOS() << "LRI: other info geometry " << avatar->getAttachmentGeometryBytes() - << ", area " << avatar->getAttachmentSurfaceArea() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; } } iter++; @@ -268,6 +270,9 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio report[KEY_AGENTS] = agents; if (agents.size() > 0) { + LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() + << " avatars to region " << regionp->getName() + << LL_ENDL; LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); } } @@ -283,13 +288,10 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi std::string url = regionp->getCapability("AvatarRenderInfo"); if (!url.empty()) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " + << regionp->getName() + << " from " << url + << LL_ENDL; // First send a request to get the latest data LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); @@ -308,11 +310,8 @@ void LLAvatarRenderInfoAccountant::idle() S32 num_avs = LLCharacter::sInstances.size(); - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Scanning all regions and checking for render info updates" - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + << LL_ENDL; // Check all regions and see if it's time to fetch/send data for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); @@ -344,12 +343,9 @@ void LLAvatarRenderInfoAccountant::idle() // are returned for a new LLViewerRegion, and is the earliest time to get render info void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) { - if (logRenderInfo()) - { - LL_INFOS() << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; - } + LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" + << " and timer for region " << region_id + << LL_ENDL; // Reset the global timer so it will scan regions immediately sRenderInfoReportTimer.reset(); @@ -360,10 +356,3 @@ void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& reg regionp->getRenderInfoRequestTimer().reset(); } } - -// static -bool LLAvatarRenderInfoAccountant::logRenderInfo() -{ - static LLCachedControl render_mute_logging_enabled(gSavedSettings, "RenderAutoMuteLogging", false); - return render_mute_logging_enabled; -} diff --git a/indra/newview/llavatarrenderinfoaccountant.h b/indra/newview/llavatarrenderinfoaccountant.h index d68f2dccfb..62c899f7a4 100644 --- a/indra/newview/llavatarrenderinfoaccountant.h +++ b/indra/newview/llavatarrenderinfoaccountant.h @@ -46,8 +46,6 @@ public: static void idle(); - static bool logRenderInfo(); - private: // Send data updates about once per minute, only need per-frame resolution static LLFrameTimer sRenderInfoReportTimer; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 3a83943209..816b2c8b67 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7948,7 +7948,6 @@ void LLVOAvatar::getImpostorValues(LLVector4a* extents, LLVector3& angle, F32& d angle.mV[2] = da; } - void LLVOAvatar::idleUpdateRenderCost() { if (gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_AVATAR_DRAW_INFO)) @@ -7962,30 +7961,35 @@ void LLVOAvatar::idleUpdateRenderCost() if ( !mText ) { initDebugTextHud(); + mText->setFadeDistance(15.0, 5.0); // limit clutter in large crowds } else { mText->clearString(); // clear debug text } - static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); - info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); - if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this + calculateUpdateRenderCost(); // Update mVisualComplexity if needed + + static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); + info_line = llformat("%d arc", mVisualComplexity); + + if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this { - green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); - red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); + green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); + red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( mAttachmentGeometryBytes > max_attachment_bytes + info_style = ( mVisualComplexity > max_render_cost ? LLFontGL::BOLD : LLFontGL::NORMAL ); + } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; - mText->addLine(info_line, info_color); - + LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; + mText->addLine(info_line, info_color, info_style); + static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0); info_line = llformat("%.2f m^2", mAttachmentSurfaceArea); @@ -7994,40 +7998,36 @@ void LLVOAvatar::idleUpdateRenderCost() green_level = 1.f-llclamp((mAttachmentSurfaceArea-max_attachment_area)/max_attachment_area, 0.f, 1.f); red_level = llmin(mAttachmentSurfaceArea/max_attachment_area, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( max_attachment_area > mAttachmentSurfaceArea + info_style = ( mAttachmentSurfaceArea > max_attachment_area ? LLFontGL::BOLD : LLFontGL::NORMAL ); } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } LL_DEBUGS() << "adding max area " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); - calculateUpdateRenderCost(); // Update mVisualComplexity if needed - - static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); - info_line = llformat("%d arc", mVisualComplexity); - - if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this + static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); + info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); + if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this { - green_level = 1.f-llclamp(((F32) mVisualComplexity-(F32)max_render_cost)/(F32)max_render_cost, 0.f, 1.f); - red_level = llmin((F32) mVisualComplexity/(F32)max_render_cost, 1.f); + green_level = 1.f-llclamp(((F32) mAttachmentGeometryBytes-(F32)max_attachment_bytes)/(F32)max_attachment_bytes, 0.f, 1.f); + red_level = llmin((F32) mAttachmentGeometryBytes/(F32)max_attachment_bytes, 1.f); info_color.set(red_level, green_level, 0.0, 1.0); - info_style = ( mVisualComplexity > max_render_cost + info_style = ( mAttachmentGeometryBytes > max_attachment_bytes ? LLFontGL::BOLD : LLFontGL::NORMAL ); - } else { - info_color.setToWhite(); + info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; - mText->addLine(info_line, info_color, info_style); - + LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; + mText->addLine(info_line, info_color); + updateText(); // corrects position } } -- cgit v1.2.3 From 5be238b127ff30f09105ad6f0d9b8ee3dec8b40f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 4 Dec 2014 14:27:15 -0500 Subject: STORM-2082 Revert name of Reset button from Undo back to Reset. Hopefully this will be renamed Recommended Settings. Display a test icon (artwork needed) in the pulldown panel --- indra/newview/llfloaterpreference.cpp | 8 -------- indra/newview/llpanelpresetspulldown.cpp | 5 +++-- indra/newview/llpresetsmanager.h | 1 - .../skins/default/xui/en/panel_preferences_graphics1.xml | 16 ++-------------- .../skins/default/xui/en/panel_presets_pulldown.xml | 8 +++----- 5 files changed, 8 insertions(+), 30 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 7b9c4c3035..7b252ebd4f 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -342,7 +342,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); - mCommitCallbackRegistrar.add("Pref.Recommended", boost::bind(&LLFloaterPreference::setRecommended, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); mCommitCallbackRegistrar.add("Pref.UpdateSliderText", boost::bind(&LLFloaterPreference::refreshUI,this)); @@ -798,13 +797,6 @@ void LLFloaterPreference::setHardwareDefaults() if (panel) panel->setHardwareDefaults(); } -} - -void LLFloaterPreference::setRecommended() -{ - LLFeatureManager::getInstance()->applyRecommendedSettings(); - - refreshEnabledGraphics(); LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); } diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 093b5caad9..1918623cab 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -89,8 +89,9 @@ void LLPanelPresetsPulldown::populatePanel() if (name == gSavedSettings.getString("PresetGraphicActive")) { - row["columns"][1]["column"] = "active_name"; - row["columns"][1]["value"] = "X"; + row["columns"][1]["column"] = "icon"; + row["columns"][1]["type"] = "icon"; + row["columns"][1]["value"] = "Inv_Landmark"; } scroll->addElement(row); diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 1bac2c65e1..d7d84b5746 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -64,7 +64,6 @@ public: preset_name_list_t mPresetNames; -//protected: LLPresetsManager(); ~LLPresetsManager(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 6df4a4f2ea..24f3dd803f 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -37,7 +37,7 @@ - diff --git a/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml b/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml index fdcbce05d2..b87dda2315 100644 --- a/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml +++ b/indra/newview/skins/default/xui/en/panel_presets_pulldown.xml @@ -2,8 +2,8 @@ Date: Fri, 12 Dec 2014 11:13:11 -0500 Subject: STORM-2082 Merge Hardware floater into main graphics preferences display Change notifications so they are emitted only when an error occurs Put active preset at top of list Add Maximum ARC slider Merge two small methods into slider update code --- indra/newview/CMakeLists.txt | 2 - indra/newview/app_settings/settings.xml | 11 ++ indra/newview/llfloaterdeleteprefpreset.cpp | 6 +- indra/newview/llfloaterhardwaresettings.cpp | 201 ------------------- indra/newview/llfloaterhardwaresettings.h | 84 -------- indra/newview/llfloaterpreference.cpp | 168 +++++++++++----- indra/newview/llfloaterpreference.h | 4 +- indra/newview/llfloatersaveprefpreset.cpp | 8 +- indra/newview/llpanelpresetspulldown.cpp | 2 +- indra/newview/llpresetsmanager.cpp | 21 +- indra/newview/llpresetsmanager.h | 5 +- indra/newview/llviewerfloaterreg.cpp | 2 - .../newview/skins/default/xui/en/notifications.xml | 8 +- .../default/xui/en/panel_preferences_graphics1.xml | 218 +++++++++++++++++++-- indra/newview/skins/default/xui/en/strings.xml | 3 +- 15 files changed, 362 insertions(+), 381 deletions(-) delete mode 100755 indra/newview/llfloaterhardwaresettings.cpp delete mode 100755 indra/newview/llfloaterhardwaresettings.h (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 57fa11a0bf..192be979fb 100755 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -243,7 +243,6 @@ set(viewer_SOURCE_FILES llfloatergroupinvite.cpp llfloatergroups.cpp llfloaterhandler.cpp - llfloaterhardwaresettings.cpp llfloaterhelpbrowser.cpp llfloaterhud.cpp llfloaterimagepreview.cpp @@ -852,7 +851,6 @@ set(viewer_HEADER_FILES llfloatergroupinvite.h llfloatergroups.h llfloaterhandler.h - llfloaterhardwaresettings.h llfloaterhelpbrowser.h llfloaterhud.h llfloaterimagepreview.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6016839875..276a65edc5 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -15562,6 +15562,17 @@ Value + MaximumARC + + Comment + Controls RenderAutoMuteRenderWeightLimit in a non-linear fashion + Persist + 1 + Type + U32 + Value + 0 + diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index 2f7d0552a3..f147a5ee90 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -74,10 +74,12 @@ void LLFloaterDeletePrefPreset::onBtnDelete() { LLPresetsManager::getInstance()->savePreset(mSubdirectory, PRESETS_DEFAULT); } - + } + else + { LLSD args; args["NAME"] = name; - LLNotificationsUtil::add("PresetDeleted", args); + LLNotificationsUtil::add("PresetNotDeleted", args); } } diff --git a/indra/newview/llfloaterhardwaresettings.cpp b/indra/newview/llfloaterhardwaresettings.cpp deleted file mode 100755 index 035eb307c2..0000000000 --- a/indra/newview/llfloaterhardwaresettings.cpp +++ /dev/null @@ -1,201 +0,0 @@ -/** - * @file llfloaterhardwaresettings.cpp - * @brief Menu of all the different graphics hardware settings - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * 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. - * - * 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. - * - * 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 - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterhardwaresettings.h" - -// Viewer includes -#include "llfloaterpreference.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "llviewertexturelist.h" -#include "llfeaturemanager.h" -#include "llspinctrl.h" -#include "llstartup.h" -#include "lltextbox.h" -#include "llcombobox.h" -#include "pipeline.h" - -// Linden library includes -#include "llradiogroup.h" -#include "lluictrlfactory.h" -#include "llwindow.h" -#include "llsliderctrl.h" - -LLFloaterHardwareSettings::LLFloaterHardwareSettings(const LLSD& key) - : LLFloater(key), - - // these should be set on imminent refresh() call, - // but init them anyway - mUseVBO(0), - mUseAniso(0), - mFSAASamples(0), - mGamma(0.0), - mVideoCardMem(0), - mFogRatio(0.0), - mProbeHardwareOnStartup(FALSE) -{ -} - -LLFloaterHardwareSettings::~LLFloaterHardwareSettings() -{ -} - -void LLFloaterHardwareSettings::initCallbacks(void) -{ -} - -// menu maintenance functions - -void LLFloaterHardwareSettings::refresh() -{ - LLPanel::refresh(); - - mUseVBO = gSavedSettings.getBOOL("RenderVBOEnable"); - mUseAniso = gSavedSettings.getBOOL("RenderAnisotropic"); - mFSAASamples = gSavedSettings.getU32("RenderFSAASamples"); - mGamma = gSavedSettings.getF32("RenderGamma"); - mVideoCardMem = gSavedSettings.getS32("TextureMemory"); - mFogRatio = gSavedSettings.getF32("RenderFogRatio"); - mProbeHardwareOnStartup = gSavedSettings.getBOOL("ProbeHardwareOnStartup"); - - getChild("fsaa")->setValue((LLSD::Integer) mFSAASamples); - refreshEnabledState(); -} - -void LLFloaterHardwareSettings::refreshEnabledState() -{ - F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); - S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); - S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); - getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); - getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("vbo")->setEnabled(FALSE); - } - - if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || - !gGLManager.mHasVertexBufferObject) - { - getChildView("texture compression")->setEnabled(FALSE); - } - - // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance - LLSpinCtrl* gamma_ctrl = getChild("gamma"); - gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); - getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); - - // anti-aliasing - { - LLUICtrl* fsaa_ctrl = getChild("fsaa"); - LLTextBox* fsaa_text = getChild("antialiasing label"); - LLView* fsaa_restart = getChildView("antialiasing restart"); - - // Enable or disable the control, the "Antialiasing:" label and the restart warning - // based on code support for the feature on the current hardware. - - if (gPipeline.canUseAntiAliasing()) - { - fsaa_ctrl->setEnabled(TRUE); - - // borrow the text color from the gamma control for consistency - fsaa_text->setColor(gamma_ctrl->getEnabledTextColor()); - - fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); - } - else - { - fsaa_ctrl->setEnabled(FALSE); - fsaa_ctrl->setValue((LLSD::Integer) 0); - - // borrow the text color from the gamma control for consistency - fsaa_text->setColor(gamma_ctrl->getDisabledTextColor()); - - fsaa_restart->setVisible(FALSE); - } - } -} - -//============================================================================ - -BOOL LLFloaterHardwareSettings::postBuild() -{ - childSetAction("OK", onBtnOK, this); - -// Don't do this on Mac as their braindead GL versioning -// sets this when 8x and 16x are indeed available -// -#if !LL_DARWIN - if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) - { //remove FSAA settings above "4x" - LLComboBox* combo = getChild("fsaa"); - combo->remove("8x"); - combo->remove("16x"); - } -#endif - - refresh(); - center(); - - // load it up - initCallbacks(); - return TRUE; -} - - -void LLFloaterHardwareSettings::apply() -{ - refresh(); -} - - -void LLFloaterHardwareSettings::cancel() -{ - gSavedSettings.setBOOL("RenderVBOEnable", mUseVBO); - gSavedSettings.setBOOL("RenderAnisotropic", mUseAniso); - gSavedSettings.setU32("RenderFSAASamples", mFSAASamples); - gSavedSettings.setF32("RenderGamma", mGamma); - gSavedSettings.setS32("TextureMemory", mVideoCardMem); - gSavedSettings.setF32("RenderFogRatio", mFogRatio); - gSavedSettings.setBOOL("ProbeHardwareOnStartup", mProbeHardwareOnStartup ); - - closeFloater(); -} - -// static -void LLFloaterHardwareSettings::onBtnOK( void* userdata ) -{ - LLFloaterHardwareSettings *fp =(LLFloaterHardwareSettings *)userdata; - fp->apply(); - fp->closeFloater(false); -} - - diff --git a/indra/newview/llfloaterhardwaresettings.h b/indra/newview/llfloaterhardwaresettings.h deleted file mode 100755 index 626771b1d2..0000000000 --- a/indra/newview/llfloaterhardwaresettings.h +++ /dev/null @@ -1,84 +0,0 @@ -/** - * @file llfloaterhardwaresettings.h - * @brief Menu of all the different graphics hardware settings - * - * $LicenseInfo:firstyear=2001&license=viewerlgpl$ - * Second Life Viewer Source Code - * 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. - * - * 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. - * - * 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 - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATER_HARDWARE_SETTINGS_H -#define LL_LLFLOATER_HARDWARE_SETTINGS_H - -#include "llfloater.h" - -/// Menuing system for all of windlight's functionality -class LLFloaterHardwareSettings : public LLFloater -{ - friend class LLFloaterPreference; - -public: - - LLFloaterHardwareSettings(const LLSD& key); - /*virtual*/ ~LLFloaterHardwareSettings(); - - /*virtual*/ BOOL postBuild(); - - /// initialize all the callbacks for the menu - void initCallbacks(void); - - /// OK button - static void onBtnOK( void* userdata ); - - //// menu management - - /// show off our menu - static void show(); - - /// return if the menu exists or not - static bool isOpen(); - - /// sync up menu with parameters - void refresh(); - - /// Apply the changed values. - void apply(); - - /// don't apply the changed values - void cancel(); - - /// refresh the enabled values - void refreshEnabledState(); - -protected: - BOOL mUseVBO; - BOOL mUseAniso; - BOOL mUseFBO; - U32 mFSAASamples; - F32 mGamma; - S32 mVideoCardMem; - F32 mFogRatio; - BOOL mProbeHardwareOnStartup; - -private: -}; - -#endif - diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index e0c579f783..c7b4ae8ddc 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -48,7 +48,6 @@ //#include "llfirstuse.h" #include "llfloaterreg.h" #include "llfloaterabout.h" -#include "llfloaterhardwaresettings.h" #include "llfloatersidepanelcontainer.h" #include "llfloaterimsession.h" #include "llkeyboard.h" @@ -112,6 +111,7 @@ #include "llviewercontrol.h" #include "llpresetsmanager.h" #include "llfeaturemanager.h" +#include "llviewertexturelist.h" const F32 MAX_USER_FAR_CLIP = 512.f; const F32 MIN_USER_FAR_CLIP = 64.f; @@ -549,12 +549,6 @@ void LLFloaterPreference::apply() if (panel) panel->apply(); } - // hardware menu apply - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->apply(); - } gViewerWindow->requestResolutionUpdate(); // for UIScaleFactor @@ -632,13 +626,6 @@ void LLFloaterPreference::cancel() // hide spellchecker settings folder LLFloaterReg::hideInstance("prefs_spellchecker"); - // cancel hardware menu - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->cancel(); - } - // reverts any changes to current skin gSavedSettings.setString("SkinCurrent", sSkin); @@ -921,11 +908,6 @@ void LLFloaterPreference::refreshEnabledGraphics() instance->refresh(); //instance->refreshEnabledState(); } - LLFloaterHardwareSettings* hardware_settings = LLFloaterReg::getTypedInstance("prefs_hardware_settings"); - if (hardware_settings) - { - hardware_settings->refreshEnabledState(); - } } void LLFloaterPreference::onClickClearCache() @@ -1201,7 +1183,61 @@ void LLFloaterPreference::refreshEnabledState() enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); ctrl_shadow->setEnabled(enabled); - + + // Hardware settings + F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); + S32Megabytes min_tex_mem = LLViewerTextureList::getMinVideoRamSetting(); + S32Megabytes max_tex_mem = LLViewerTextureList::getMaxVideoRamSetting(false, mem_multiplier); + getChild("GraphicsCardTextureMemory")->setMinValue(min_tex_mem.value()); + getChild("GraphicsCardTextureMemory")->setMaxValue(max_tex_mem.value()); + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderVBOEnable") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("vbo")->setEnabled(FALSE); + } + + if (!LLFeatureManager::getInstance()->isFeatureAvailable("RenderCompressTextures") || + !gGLManager.mHasVertexBufferObject) + { + getChildView("texture compression")->setEnabled(FALSE); + } + + // if no windlight shaders, turn off nighttime brightness, gamma, and fog distance + LLUICtrl* gamma_ctrl = getChild("gamma"); + gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + + /* Disabling this block of code because canUseAntiAliasing currently always returns true + // anti-aliasing + LLComboBox* fsaa_ctrl = getChild("fsaa"); + LLTextBox* fsaa_text = getChild("antialiasing label"); + LLTextBox* fsaa_restart = getChild("antialiasing restart"); + + // Enable or disable the control, the "Antialiasing:" label and the restart warning + // based on code support for the feature on the current hardware. + + if (gPipeline.canUseAntiAliasing()) + { + fsaa_ctrl->setEnabled(TRUE); + + LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor"); + fsaa_text->setColor(color); + + fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); + } + else + { + fsaa_ctrl->setEnabled(FALSE); + fsaa_ctrl->setValue((LLSD::Integer) 0); + + LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor"); + fsaa_text->setColor(color); + + fsaa_restart->setVisible(FALSE); + } + */ // now turn off any features that are unavailable disableUnavailableSettings(); @@ -1365,23 +1401,26 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); + getChild("fsaa")->setValue((LLSD::Integer) gSavedSettings.getU32("RenderFSAASamples")); + refreshEnabledState(); // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); - updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); - updateReflectionsText(getChild("Reflections", true), getChild("ReflectionsText", true)); - updateShadowDetailText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true), "ObjectMeshDetail"); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true), "FlexibleMeshDetail"); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true), "TreeMeshDetail"); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true), "AvatarMeshDetail"); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true), "AvatarMeshDetail2"); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail"); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true), "TerrainMeshDetail"); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true), "RenderPostProcess"); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true), "SkyMeshDetail"); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true), "TerrainDetail"); + updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true), "MaximumARC"); + updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true), "Reflections"); + updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true), "ShadowDetail"); } void LLFloaterPreference::onCommitWindowedMode() @@ -1633,24 +1672,7 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("Reflections" + llformat("%d", value))); -} -void LLFloaterPreference::updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box) -{ - if (text_box == NULL || ctrl== NULL) - return; - - U32 value = (U32)ctrl->getValue().asInteger(); - text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); -} - -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) +void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name) { if (text_box == NULL || ctrl== NULL) return; @@ -1663,7 +1685,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b llassert(range > 0); F32 midPoint = min + range / 3.0f; F32 highPoint = min + (2.0f * range / 3.0f); - + + if ("ShadowDetail" == name) + { + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("RenderShadowDetail" + llformat("%d", value))); + return; + } + + if ("Reflections" == name) + { + U32 value = (U32)ctrl->getValue().asInteger(); + text_box->setText(getString("Reflections" + llformat("%d", value))); + return; + } + // choose the right text if (value < midPoint) { @@ -1677,6 +1713,22 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b { text_box->setText(LLTrans::getString("GraphicsQualityHigh")); } + + if ("MaximumARC" == name) + { + F32 control_value = value; + if (0.0f == control_value) + { + text_box->setText(LLTrans::getString("Off")); + } + else + { + // 13 is the maximum value of this control set in panel_preferences_graphics1.xml + control_value = exp(13.0f - control_value) + 20000.0f; + } + + gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); + } } void LLFloaterPreference::onChangeMaturity() @@ -2152,6 +2204,18 @@ static LLPanelInjector t_pref_privacy("panel_preferenc BOOL LLPanelPreferenceGraphics::postBuild() { +// Don't do this on Mac as their braindead GL versioning +// sets this when 8x and 16x are indeed available +// +#if !LL_DARWIN + if (gGLManager.mIsIntel || gGLManager.mGLVersion < 3.f) + { //remove FSAA settings above "4x" + LLComboBox* combo = getChild("fsaa"); + combo->remove("8x"); + combo->remove("16x"); + } +#endif + LLComboBox* combo = getChild("graphic_preset_combo"); combo->setLabel(LLTrans::getString("preset_combo_label")); @@ -2171,7 +2235,7 @@ void LLPanelPreferenceGraphics::setPresetNamesInComboBox() { LLComboBox* combo = getChild("graphic_preset_combo"); - EDefaultOptions option = DEFAULT_POSITION_TOP; + EDefaultOptions option = DEFAULT_SHOW; LLPresetsManager::getInstance()->setPresetNamesInComboBox(PRESETS_GRAPHIC, combo, option); } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index d43c41272a..eebc0849ee 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -156,9 +156,7 @@ public: // if the quality radio buttons are changed void onChangeQuality(const LLSD& data); - void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void updateReflectionsText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void updateShadowDetailText(LLSliderCtrl* ctrl, LLTextBox* text_box); + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name); void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); diff --git a/indra/newview/llfloatersaveprefpreset.cpp b/indra/newview/llfloatersaveprefpreset.cpp index 02281d8b3c..610c701d8d 100644 --- a/indra/newview/llfloatersaveprefpreset.cpp +++ b/indra/newview/llfloatersaveprefpreset.cpp @@ -70,7 +70,7 @@ void LLFloaterSavePrefPreset::onOpen(const LLSD& key) setTitle(floater_title); - EDefaultOptions option = DEFAULT_POSITION_TOP; + EDefaultOptions option = DEFAULT_SHOW; LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option); onPresetNameEdited(); @@ -80,11 +80,11 @@ void LLFloaterSavePrefPreset::onBtnSave() { std::string name = mPresetCombo->getSimple(); - if (LLPresetsManager::getInstance()->savePreset(mSubdirectory, name)) + if (!LLPresetsManager::getInstance()->savePreset(mSubdirectory, name)) { LLSD args; args["NAME"] = name; - LLNotificationsUtil::add("PresetSaved", args); + LLNotificationsUtil::add("PresetNotSaved", args); } closeFloater(); @@ -92,7 +92,7 @@ void LLFloaterSavePrefPreset::onBtnSave() void LLFloaterSavePrefPreset::onPresetsListChange() { - EDefaultOptions option = DEFAULT_POSITION_TOP; + EDefaultOptions option = DEFAULT_SHOW; LLPresetsManager::getInstance()->setPresetNamesInComboBox(mSubdirectory, mPresetCombo, option); } diff --git a/indra/newview/llpanelpresetspulldown.cpp b/indra/newview/llpanelpresetspulldown.cpp index 1918623cab..4756f3bd75 100644 --- a/indra/newview/llpanelpresetspulldown.cpp +++ b/indra/newview/llpanelpresetspulldown.cpp @@ -71,7 +71,7 @@ BOOL LLPanelPresetsPulldown::postBuild() void LLPanelPresetsPulldown::populatePanel() { std::string presets_dir = LLPresetsManager::getInstance()->getPresetsDir(PRESETS_GRAPHIC); - LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_POSITION_NORMAL); + LLPresetsManager::getInstance()->loadPresetNamesFromDir(presets_dir, mPresetNames, DEFAULT_SHOW); LLScrollListCtrl* scroll = getChild("preset_list"); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 971a5ecf52..1c14cc6ece 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -99,20 +99,26 @@ void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_nam { std::string path = gDirUtilp->add(dir, file); std::string name = gDirUtilp->getBaseFileName(LLURI::unescape(path), /*strip_exten = */ true); + // Two things are happening here: + // 1 - Always put the active preset at the top of the list + // 2 - Possibly hide the default preset if (PRESETS_DEFAULT != name) { - mPresetNames.push_back(name); + if (name != gSavedSettings.getString("PresetGraphicActive")) + { + mPresetNames.push_back(name); + } + else + { + mPresetNames.insert(mPresetNames.begin(), name); + } } else { switch (default_option) { - case DEFAULT_POSITION_TOP: - mPresetNames.insert(mPresetNames.begin(), name); - break; - - case DEFAULT_POSITION_NORMAL: - mPresetNames.push_back(name); + case DEFAULT_SHOW: + mPresetNames.push_back(LLTrans::getString(PRESETS_DEFAULT)); break; case DEFAULT_HIDE: @@ -164,6 +170,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st ("RenderDeferredSSAO") ("RenderDepthOfField") ("RenderShadowDetail") + ("RenderAutoMuteRenderWeightLimit") ("RenderAnisotropic") ("RenderFSAASamples") diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 180cca5bc4..bf6a531d48 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -39,9 +39,8 @@ static const std::string PRESETS_CAMERA = "camera"; enum EDefaultOptions { - DEFAULT_POSITION_TOP, // Put "Default" as the first item in the combobox - DEFAULT_POSITION_NORMAL, // No special positioning - DEFAULT_HIDE // Do not display "Default" in the combobox + DEFAULT_SHOW, + DEFAULT_HIDE // Do not display "Default" in a list }; class LLPresetsManager : public LLSingleton diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 3ee67d8ac5..8acb56d650 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -69,7 +69,6 @@ #include "llfloatergesture.h" #include "llfloatergodtools.h" #include "llfloatergroups.h" -#include "llfloaterhardwaresettings.h" #include "llfloaterhelpbrowser.h" #include "llfloaterhud.h" #include "llfloaterimagepreview.h" @@ -274,7 +273,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("places", "floater_places.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("preferences", "floater_preferences.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("prefs_proxy", "floater_preferences_proxy.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("prefs_hardware_settings", "floater_hardware_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("prefs_spellchecker_import", "floater_spellcheck_import.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("prefs_translation", "floater_translation_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("prefs_spellchecker", "floater_spellcheck.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 1618ea0ec7..340777faf3 100755 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7659,16 +7659,16 @@ Attachment has been saved. -Preset [NAME] has been saved. +Error saving preset [NAME]. -Preset [NAME] has been deleted. +Error deleting preset [NAME]. + + + + + Low + + None + + + Hardware + + + + + + + + + + (0 = default brightness, lower = brighter) + + + + + + + + + + Antialiasing: + + + + + + + + + + (requires viewer restart) + @@ -958,18 +1158,6 @@ - + diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 1c655c6559..023c6e5bbb 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4044,5 +4044,6 @@ Try enclosing path to the editor with double quotes. -Empty list- - + Default + Off -- cgit v1.2.3 From e713ef765f268af1cba0f7b04f1e331332630e97 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 13 Dec 2014 06:28:12 -0500 Subject: STORM-2082 Write out settings to preset file if settings changed on the login page Code improvements from bitbucket comments --- indra/newview/llfloaterpreference.cpp | 75 +++++++++++++--------- indra/newview/llfloaterpreference.h | 2 +- .../default/xui/en/panel_preferences_graphics1.xml | 5 +- 3 files changed, 47 insertions(+), 35 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index c7b4ae8ddc..6e5b75e80b 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -864,13 +864,10 @@ void LLFloaterPreference::onBtnOK() pPathfindingConsole->onRegionBoundaryCross(); } - if (LLStartUp::getStartupState() == STATE_STARTED) - { - // Write settings to currently defined preset. This will recreate a missing preset file - // and ensure the preset file matches the current settings (which may have been changed - // via some other means). - LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); - } + // Write settings to currently defined preset. This will recreate a missing preset file + // and ensure the preset file matches the current settings (which may have been changed + // via some other means). + LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, gSavedSettings.getString("PresetGraphicActive")); } // static @@ -1208,6 +1205,7 @@ void LLFloaterPreference::refreshEnabledState() gamma_ctrl->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("(brightness, lower is brighter)")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); + getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); /* Disabling this block of code because canUseAntiAliasing currently always returns true // anti-aliasing @@ -1408,19 +1406,19 @@ void LLFloaterPreference::refresh() // sliders and their text boxes // mPostProcess = gSavedSettings.getS32("RenderGlowResolutionPow"); // slider text boxes - updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true), "ObjectMeshDetail"); - updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true), "FlexibleMeshDetail"); - updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true), "TreeMeshDetail"); - updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true), "AvatarMeshDetail"); - updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true), "AvatarMeshDetail2"); - updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true), "AvatarPhysicsDetail"); - updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true), "TerrainMeshDetail"); - updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true), "RenderPostProcess"); - updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true), "SkyMeshDetail"); - updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true), "TerrainDetail"); - updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true), "MaximumARC"); - updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true), "Reflections"); - updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true), "ShadowDetail"); + updateSliderText(getChild("ObjectMeshDetail", true), getChild("ObjectMeshDetailText", true)); + updateSliderText(getChild("FlexibleMeshDetail", true), getChild("FlexibleMeshDetailText", true)); + updateSliderText(getChild("TreeMeshDetail", true), getChild("TreeMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail", true), getChild("AvatarMeshDetailText", true)); + updateSliderText(getChild("AvatarMeshDetail2", true), getChild("AvatarMeshDetailText2", true)); + updateSliderText(getChild("AvatarPhysicsDetail", true), getChild("AvatarPhysicsDetailText", true)); + updateSliderText(getChild("TerrainMeshDetail", true), getChild("TerrainMeshDetailText", true)); + updateSliderText(getChild("RenderPostProcess", true), getChild("PostProcessText", true)); + updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); + updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); + updateSliderText(getChild("MaximumARC", true), getChild("MaximumARCText", true)); + updateSliderText(getChild("Reflections", true), getChild("ReflectionsText", true)); + updateSliderText(getChild("ShadowDetail", true), getChild("RenderShadowDetailText", true)); } void LLFloaterPreference::onCommitWindowedMode() @@ -1672,19 +1670,12 @@ void LLFloaterPreference::refreshUI() refresh(); } -void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name) +void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box) { if (text_box == NULL || ctrl== NULL) return; - // get range and points when text should change - F32 value = (F32)ctrl->getValue().asReal(); - F32 min = ctrl->getMinValue(); - F32 max = ctrl->getMaxValue(); - F32 range = max - min; - llassert(range > 0); - F32 midPoint = min + range / 3.0f; - F32 highPoint = min + (2.0f * range / 3.0f); + std::string name = ctrl->getName(); if ("ShadowDetail" == name) { @@ -1700,6 +1691,15 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b return; } + // get range and points when text should change + F32 value = (F32)ctrl->getValue().asReal(); + F32 min = ctrl->getMinValue(); + F32 max = ctrl->getMaxValue(); + F32 range = max - min; + llassert(range > 0); + F32 midPoint = min + range / 3.0f; + F32 highPoint = min + (2.0f * range / 3.0f); + // choose the right text if (value < midPoint) { @@ -1723,8 +1723,21 @@ void LLFloaterPreference::updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_b } else { - // 13 is the maximum value of this control set in panel_preferences_graphics1.xml - control_value = exp(13.0f - control_value) + 20000.0f; + // 100 is the maximum value of this control set in panel_preferences_graphics1.xml + F32 minp = 0.0f; + F32 maxp = 100.0f; + + // The result should be between 20,000 and 500,000 + F32 minv = log(20000.0f); + F32 maxv = log(500000.0f); + + // calculate adjustment factor + F32 scale = (maxv - minv) / (maxp - minp); + + control_value = exp(minv + scale * (control_value - minp)); + + // Invert result + control_value = 500000.0f - control_value; } gSavedSettings.setU32("RenderAutoMuteRenderWeightLimit", (U32)control_value); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index eebc0849ee..12230c2877 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -156,7 +156,7 @@ public: // if the quality radio buttons are changed void onChangeQuality(const LLSD& data); - void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box, const std::string& name); + void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); void refreshUI(); void onCommitParcelMediaAutoPlayEnable(); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 43b9d6003f..4636313f94 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -550,13 +550,13 @@ follows="left|top" height="16" initial_value="0" - increment=".1" + increment="1" label="Maximum ARC:" label_width="185" layout="topleft" left="30" min_val="0" - max_val="13" + max_val="100" name="MaximumARC" show_text="false" top_delta="16" @@ -1158,6 +1158,5 @@ - -- cgit v1.2.3 From c655ae00a1e9d3540a9280181766bd4f646e1cce Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 13 Dec 2014 20:53:27 -0500 Subject: STORM-2082 When a control is greyed out make sure it's associated text is greyed out. Sky: has two dependencies; grey it out when either one is not available. Remove Basic Shaders from Basic tab --- indra/newview/llfloaterpreference.cpp | 35 ++++++++++++++++++++-- .../default/xui/en/panel_preferences_graphics1.xml | 26 +++++----------- 2 files changed, 39 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6e5b75e80b..814e552027 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1088,12 +1088,14 @@ void LLFloaterPreference::buildPopupLists() void LLFloaterPreference::refreshEnabledState() { LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") && gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps; ctrl_reflections->setEnabled(reflections); + reflections_text->setEnabled(reflections); // Bump & Shiny LLCheckBoxCtrl* bumpshiny_ctrl = getChild("BumpShiny"); @@ -1129,6 +1131,7 @@ void LLFloaterPreference::refreshEnabledState() // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLTextBox* terrain_text = getChild("TerrainDetailText"); ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); @@ -1137,19 +1140,26 @@ void LLFloaterPreference::refreshEnabledState() { terrain_detail->setValue(1); terrain_detail->setEnabled(FALSE); + terrain_text->setEnabled(false); } else { - terrain_detail->setEnabled(TRUE); + terrain_detail->setEnabled(TRUE); + terrain_text->setEnabled(true); } // WindLight LLCheckBoxCtrl* ctrl_wind_light = getChild("WindLightUseAtmosShaders"); - + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); + // *HACK just checks to see if we can use shaders... // maybe some cards that use shaders, but don't support windlight ctrl_wind_light->setEnabled(ctrl_shader_enable->getEnabled() && shaders); + sky->setEnabled(ctrl_wind_light->get() && shaders); + sky_text->setEnabled(ctrl_wind_light->get() && shaders); + //Deferred/SSAO/Shadows LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); @@ -1168,6 +1178,7 @@ void LLFloaterPreference::refreshEnabledState() LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); LLUICtrl* ctrl_shadow = getChild("ShadowDetail"); + LLTextBox* shadow_text = getChild("RenderShadowDetailText"); // note, okay here to get from ctrl_deferred as it's twin, ctrl_deferred2 will alway match it enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferredSSAO") && (ctrl_deferred->get() ? TRUE : FALSE); @@ -1180,6 +1191,7 @@ void LLFloaterPreference::refreshEnabledState() enabled = enabled && LLFeatureManager::getInstance()->isFeatureAvailable("RenderShadowDetail"); ctrl_shadow->setEnabled(enabled); + shadow_text->setEnabled(enabled); // Hardware settings F32 mem_multiplier = gSavedSettings.getF32("RenderTextureMemoryMultiple"); @@ -1249,6 +1261,7 @@ void LLFloaterPreference::refreshEnabledState() void LLFloaterPreference::disableUnavailableSettings() { LLUICtrl* ctrl_reflections = getChild("Reflections"); + LLTextBox* reflections_text = getChild("ReflectionsText"); LLCheckBoxCtrl* ctrl_avatar_vp = getChild("AvatarVertexProgram"); LLCheckBoxCtrl* ctrl_avatar_cloth = getChild("AvatarCloth"); LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); @@ -1257,8 +1270,11 @@ void LLFloaterPreference::disableUnavailableSettings() LLCheckBoxCtrl* ctrl_deferred = getChild("UseLightShaders"); LLCheckBoxCtrl* ctrl_deferred2 = getChild("UseLightShaders2"); LLUICtrl* ctrl_shadows = getChild("ShadowDetail"); + LLTextBox* shadows_text = getChild("RenderShadowDetailText"); LLCheckBoxCtrl* ctrl_ssao = getChild("UseSSAO"); LLCheckBoxCtrl* ctrl_dof = getChild("UseDoF"); + LLSliderCtrl* sky = getChild("SkyMeshDetail"); + LLTextBox* sky_text = getChild("SkyMeshDetailText"); // if vertex shaders off, disable all shader related products if (!LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")) @@ -1268,9 +1284,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); - + + sky->setEnabled(false); + sky_text->setEnabled(false); + ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(0); + reflections_text->setEnabled(false); ctrl_avatar_vp->setEnabled(FALSE); ctrl_avatar_vp->setValue(FALSE); @@ -1280,6 +1300,7 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1299,9 +1320,13 @@ void LLFloaterPreference::disableUnavailableSettings() ctrl_wind_light->setEnabled(FALSE); ctrl_wind_light->setValue(FALSE); + sky->setEnabled(false); + sky_text->setEnabled(false); + //deferred needs windlight, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1321,6 +1346,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); @@ -1346,6 +1372,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); } // disabled reflections @@ -1353,6 +1380,7 @@ void LLFloaterPreference::disableUnavailableSettings() { ctrl_reflections->setEnabled(FALSE); ctrl_reflections->setValue(FALSE); + reflections_text->setEnabled(false); } // disabled av @@ -1367,6 +1395,7 @@ void LLFloaterPreference::disableUnavailableSettings() //deferred needs AvatarVP, disable deferred ctrl_shadows->setEnabled(FALSE); ctrl_shadows->setValue(0); + shadows_text->setEnabled(false); ctrl_ssao->setEnabled(FALSE); ctrl_ssao->setValue(FALSE); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 4636313f94..a53097a117 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -264,28 +264,13 @@ Low - - - - @@ -438,7 +423,7 @@ width="300" > + parameter="TerrainDetail" /> Low @@ -629,6 +615,7 @@ height="16" layout="topleft" name="TerrainMeshDetailText" + text_readonly_color="LabelDisabledColor" top_delta="0" left_delta="304" width="128"> @@ -844,6 +831,7 @@ height="16" layout="topleft" name="ReflectionsText" + text_readonly_color="LabelDisabledColor" top_delta="0" left_delta="284" width="128"> @@ -866,7 +854,6 @@ Low @@ -970,6 +957,7 @@ layout="topleft" left_delta="264" name="RenderShadowDetailText" + text_readonly_color="LabelDisabledColor" top_delta="0" width="128"> None -- cgit v1.2.3 From 8f5ddebf0abfbcf73f25313214b06b98f2c7889c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 14 Dec 2014 19:17:52 -0500 Subject: STORM-2082 Remove ugly list of control names. Instead, obtain the list from the View data Remove a few remants used by the old hardware floater --- indra/newview/llfloaterpreference.cpp | 42 +++++++++++++++++++++++++----- indra/newview/llfloaterpreference.h | 2 +- indra/newview/llpresetsmanager.cpp | 49 +++++++---------------------------- 3 files changed, 46 insertions(+), 47 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 814e552027..9df7f82275 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -340,7 +340,6 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) mCommitCallbackRegistrar.add("Pref.ClickEnablePopup", boost::bind(&LLFloaterPreference::onClickEnablePopup, this)); mCommitCallbackRegistrar.add("Pref.ClickDisablePopup", boost::bind(&LLFloaterPreference::onClickDisablePopup, this)); mCommitCallbackRegistrar.add("Pref.LogPath", boost::bind(&LLFloaterPreference::onClickLogPath, this)); - mCommitCallbackRegistrar.add("Pref.HardwareSettings", boost::bind(&LLFloaterPreference::onOpenHardwareSettings, this)); mCommitCallbackRegistrar.add("Pref.HardwareDefaults", boost::bind(&LLFloaterPreference::setHardwareDefaults, this)); mCommitCallbackRegistrar.add("Pref.VertexShaderEnable", boost::bind(&LLFloaterPreference::onVertexShaderEnable, this)); mCommitCallbackRegistrar.add("Pref.WindowedMod", boost::bind(&LLFloaterPreference::onCommitWindowedMode, this)); @@ -788,6 +787,42 @@ void LLFloaterPreference::setHardwareDefaults() LLPresetsManager::getInstance()->savePreset(PRESETS_GRAPHIC, PRESETS_DEFAULT); } +void LLFloaterPreference::getControlNames(std::vector& names) +{ + LLView* view = findChild("display"); + if (view) + { + std::list stack; + stack.push_back(view); + while(!stack.empty()) + { + // Process view on top of the stack + LLView* curview = stack.front(); + stack.pop_front(); + + LLUICtrl* ctrl = dynamic_cast(curview); + if (ctrl) + { + LLControlVariable* control = ctrl->getControlVariable(); + if (control) + { + std::string control_name = control->getName(); + if (std::find(names.begin(), names.end(), control_name) == names.end()) + { + names.push_back(control_name); + } + } + } + + for (child_list_t::const_iterator iter = curview->getChildList()->begin(); + iter != curview->getChildList()->end(); ++iter) + { + stack.push_back(*iter); + } + } + } +} + //virtual void LLFloaterPreference::onClose(bool app_quitting) { @@ -799,11 +834,6 @@ void LLFloaterPreference::onClose(bool app_quitting) } } -void LLFloaterPreference::onOpenHardwareSettings() -{ - LLFloater* floater = LLFloaterReg::showInstance("prefs_hardware_settings"); - addDependentFloater(floater, FALSE); -} // static void LLFloaterPreference::onBtnOK() { diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 12230c2877..f6b5f5229d 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -93,6 +93,7 @@ public: void saveAvatarProperties( void ); void selectPrivacyPanel(); void selectChatPanel(); + void getControlNames(std::vector& names); protected: void onBtnOK(); @@ -110,7 +111,6 @@ protected: // if the custom settings box is clicked void onChangeCustom(); void updateMeterText(LLUICtrl* ctrl); - void onOpenHardwareSettings(); // callback for defaults void setHardwareDefaults(); void setRecommended(); diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 1c14cc6ece..05a135b19c 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -36,6 +36,8 @@ #include "lltrans.h" #include "lluictrlfactory.h" #include "llviewercontrol.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" LLPresetsManager::LLPresetsManager() { @@ -137,51 +139,18 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st llassert(!name.empty()); std::vector name_list; - // This ugliness is the current list of all the control variables in the graphics and hardware - // preferences floaters or the settings for camera views. - // Additions or subtractions to the control variables in the floaters must also be reflected here. + if(PRESETS_GRAPHIC == subdirectory) { gSavedSettings.setString("PresetGraphicActive", name); - name_list = boost::assign::list_of - ("RenderQualityPerformance") - ("RenderFarClip") - ("RenderMaxPartCount") - ("RenderGlowResolutionPow") - ("RenderTerrainDetail") - ("RenderAvatarLODFactor") - ("RenderAvatarMaxVisible") - ("RenderUseImpostors") - ("RenderTerrainLODFactor") - ("RenderTreeLODFactor") - ("RenderVolumeLODFactor") - ("RenderFlexTimeFactor") - ("RenderTransparentWater") - ("RenderObjectBump") - ("RenderLocalLights") - ("VertexShaderEnable") - ("RenderAvatarVP") - ("RenderAvatarCloth") - ("RenderReflectionDetail") - ("WindLightUseAtmosShaders") - ("WLSkyDetail") - ("RenderDeferred") - ("RenderDeferredSSAO") - ("RenderDepthOfField") - ("RenderShadowDetail") - ("RenderAutoMuteRenderWeightLimit") - - ("RenderAnisotropic") - ("RenderFSAASamples") - ("RenderGamma") - ("RenderVBOEnable") - ("RenderCompressTextures") - ("TextureMemory") - ("RenderFogRatio") - - ("PresetGraphicActive"); + LLFloaterPreference* instance = LLFloaterReg::findTypedInstance("preferences"); + if (instance) + { + instance->getControlNames(name_list); + name_list.push_back("PresetGraphicActive"); } + } if(PRESETS_CAMERA == subdirectory) { -- cgit v1.2.3 From fe627f64742cbec698df0a907cb8aaea297df599 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 15 Dec 2014 15:59:49 -0500 Subject: MAINT-4716: correct reading of and debug display for avatar render cost info --- indra/newview/llappviewer.cpp | 2 +- indra/newview/llavatarrenderinfoaccountant.cpp | 470 ++++++++++++++----------- indra/newview/llavatarrenderinfoaccountant.h | 33 +- indra/newview/llviewerregion.cpp | 3 +- indra/newview/llviewerregion.h | 6 +- indra/newview/llvoavatar.cpp | 59 +++- 6 files changed, 337 insertions(+), 236 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3a5008507a..4ad8181055 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -5090,7 +5090,7 @@ void LLAppViewer::idle() } // Update AV render info - LLAvatarRenderInfoAccountant::idle(); + LLAvatarRenderInfoAccountant::getInstance()->idle(); { LL_RECORD_BLOCK_TIME(FTM_AUDIO_UPDATE); diff --git a/indra/newview/llavatarrenderinfoaccountant.cpp b/indra/newview/llavatarrenderinfoaccountant.cpp index 83ae0438d9..8631f245a9 100644 --- a/indra/newview/llavatarrenderinfoaccountant.cpp +++ b/indra/newview/llavatarrenderinfoaccountant.cpp @@ -28,14 +28,16 @@ // Precompiled header #include "llviewerprecompiledheaders.h" -// associated header -#include "llavatarrenderinfoaccountant.h" // STL headers // std headers // external library headers // other Linden headers #include "llcharacter.h" -#include "llhttpclient.h" +#include "httprequest.h" +#include "httphandler.h" +#include "httpresponse.h" +#include "llcorehttputil.h" +#include "llappcorehttp.h" #include "lltimer.h" #include "llviewercontrol.h" #include "llviewermenu.h" @@ -43,6 +45,8 @@ #include "llviewerregion.h" #include "llvoavatar.h" #include "llworld.h" +// associated header +#include "llavatarrenderinfoaccountant.h" static const std::string KEY_AGENTS = "agents"; // map @@ -53,228 +57,259 @@ static const std::string KEY_MESSAGE = "message"; static const std::string KEY_ERROR = "error"; -// Send data updates about once per minute, only need per-frame resolution -LLFrameTimer LLAvatarRenderInfoAccountant::sRenderInfoReportTimer; +static const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds +static const F32 SECS_BETWEEN_REGION_REQUEST = 15.0; // Look for new avs every 15 seconds +static const F32 SECS_BETWEEN_REGION_REPORTS = 60.0; // Update each region every 60 seconds + + +// The policy class for HTTP traffic; this is the right value for all capability requests. +static LLCore::HttpRequest::policy_t http_policy(LLAppCoreHttp::AP_REPORTING); + +// Priority for HTTP requests. Use 0U. +static LLCore::HttpRequest::priority_t http_priority(0U); +LLAvatarRenderInfoAccountant::LLAvatarRenderInfoAccountant() + : mHttpRequest(new LLCore::HttpRequest) + , mHttpHeaders(new LLCore::HttpHeaders) + , mHttpOptions(new LLCore::HttpOptions) +{ + mHttpOptions->setTransferTimeout(SECS_BETWEEN_REGION_SCANS); + + mHttpHeaders->append(HTTP_OUT_HEADER_CONTENT_TYPE, HTTP_CONTENT_LLSD_XML); + mHttpHeaders->append(HTTP_OUT_HEADER_ACCEPT, HTTP_CONTENT_LLSD_XML); +} + +LLAvatarRenderInfoAccountant::~LLAvatarRenderInfoAccountant() +{ + mHttpOptions->release(); + mHttpHeaders->release(); + // delete mHttpRequest; ??? +} // HTTP responder class for GET request for avatar render weight information -class LLAvatarRenderInfoGetResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoGetHandler : public LLCore::HttpHandler { +private: + LOG_CLASS(LLAvatarRenderInfoGetHandler); + public: - LLAvatarRenderInfoGetResponder(U64 region_handle) : mRegionHandle(region_handle) + LLAvatarRenderInfoGetHandler() : LLCore::HttpHandler() { } - virtual void error(U32 statusNum, const std::string& reason) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight GET: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight GET error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } - - } - - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights request for region '" << regionp->getName() << "':" << LL_ENDL; - - if (content.isMap()) - { - if (content.has(KEY_AGENTS)) + LLCore::HttpStatus status = response->getStatus(); + if (status) + { + LLSD avatar_render_info; + if (LLCoreHttpUtil::responseToLLSD(response, false /* quiet logging */, + avatar_render_info)) { - const LLSD & agents = content[KEY_AGENTS]; - if (agents.isMap()) + if (avatar_render_info.isMap()) { - LLSD::map_const_iterator report_iter = agents.beginMap(); - while (report_iter != agents.endMap()) + if (avatar_render_info.has(KEY_AGENTS)) { - LLUUID target_agent_id = LLUUID(report_iter->first); - const LLSD & agent_info_map = report_iter->second; - LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); - if ( avatarp - && avatarp->isAvatar() - && agent_info_map.isMap()) - { // Extract the data for this avatar - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Agent " << target_agent_id - << ": " << agent_info_map << LL_ENDL; - - if (agent_info_map.has(KEY_WEIGHT)) + const LLSD & agents = avatar_render_info[KEY_AGENTS]; + if (agents.isMap()) + { + for (LLSD::map_const_iterator agent_iter = agents.beginMap(); + agent_iter != agents.endMap(); + agent_iter++ + ) { - ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); - } + LLUUID target_agent_id = LLUUID(agent_iter->first); + LLViewerObject* avatarp = gObjectList.findObject(target_agent_id); + if (avatarp && avatarp->isAvatar()) + { + const LLSD & agent_info_map = agent_iter->second; + if (agent_info_map.isMap()) + { + LL_DEBUGS("AvatarRenderInfo") << " Agent " << target_agent_id + << ": " << agent_info_map << LL_ENDL; + + if (agent_info_map.has(KEY_WEIGHT)) + { + ((LLVOAvatar *) avatarp)->setReportedVisualComplexity(agent_info_map[KEY_WEIGHT].asInteger()); + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "agent entry invalid" + << " agent " << target_agent_id + << " map " << agent_info_map + << LL_ENDL; + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "Unknown agent " << target_agent_id << LL_ENDL; + } + } // for agent_iter } else { - LL_WARNS("AvatarRenderInfo") << "LRI: agent entry invalid" - << " agent " << target_agent_id - << " map " << agent_info_map - << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response agents avatar_render_info is not map" << LL_ENDL; } - report_iter++; + } // has "agents" + else if (avatar_render_info.has(KEY_ERROR)) + { + const LLSD & error = avatar_render_info[KEY_ERROR]; + LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " + << error[KEY_IDENTIFIER] + << ": " << error[KEY_MESSAGE] + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "no agent key in get response" << LL_ENDL; } } else { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response agents content is not map" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response is not map" << LL_ENDL; } - - } // has "agents" - else if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info GET error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + } else { - LL_WARNS("AvatarRenderInfo") << "LRI: no agent key in get response" << LL_ENDL; + LL_WARNS("AvatarRenderInfo") << "malformed get response parse failure" << LL_ENDL; } - } - else - { - LL_WARNS("AvatarRenderInfo") << "LRI: malformed get response is not map" << LL_ENDL; - } - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight info recieved but region not found for " - << mRegionHandle << LL_ENDL; + } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "GET failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - } - -private: - U64 mRegionHandle; }; // HTTP responder class for POST request for avatar render weight information -class LLAvatarRenderInfoPostResponder : public LLHTTPClient::Responder +class LLAvatarRenderInfoPostHandler : public LLCore::HttpHandler { -public: - LLAvatarRenderInfoPostResponder(U64 region_handle) : mRegionHandle(region_handle) - { - } + private: + LOG_CLASS(LLAvatarRenderInfoPostHandler); - virtual void error(U32 statusNum, const std::string& reason) + public: + LLAvatarRenderInfoPostHandler() : LLCore::HttpHandler() { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) - { - LL_WARNS("AvatarRenderInfo") << "HTTP error result for avatar weight POST: " << statusNum - << ", " << reason - << " returned by region " << regionp->getName() - << LL_ENDL; - } - else - { - LL_WARNS("AvatarRenderInfo") << "Avatar render weight POST error recieved but region not found for " - << mRegionHandle - << ", error " << statusNum - << ", " << reason - << LL_ENDL; - } } - virtual void result(const LLSD& content) - { - LLViewerRegion * regionp = LLWorld::getInstance()->getRegionFromHandle(mRegionHandle); - if (regionp) + void onCompleted(LLCore::HttpHandle handle, + LLCore::HttpResponse* response) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Result for avatar weights POST for region " << regionp->getName() - << ": " << content << LL_ENDL; - - if (content.isMap()) + LLCore::HttpStatus status = response->getStatus(); + if (status) { - if (content.has(KEY_ERROR)) - { - const LLSD & error = content[KEY_ERROR]; - LL_WARNS("AvatarRenderInfo") << "Avatar render info POST error: " - << error[KEY_IDENTIFIER] - << ": " << error[KEY_MESSAGE] - << " from region " << regionp->getName() - << LL_ENDL; - } + LL_DEBUGS("AvatarRenderInfo") << "post succeeded" << LL_ENDL; } + else + { + // Something went wrong. Translate the status to + // a meaningful message. + LL_WARNS("AvatarRenderInfo") << "POST failed Status: " + << status.toTerseString() + << ", Reason: " << status.toString() + << LL_ENDL; + } + + delete this; // release the handler object } - else - { - LL_INFOS("AvatarRenderInfo") << "Avatar render weight POST result recieved but region not found for " - << mRegionHandle << LL_ENDL; - } - } - -private: - U64 mRegionHandle; }; -// static // Send request for one region, no timer checks +// called when the void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if ( regionp->getRenderInfoReportTimer().hasExpired() ) // Time to make request { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Checking for avatar render info to send to region " - << regionp->getName() - << " from " << url - << LL_ENDL; - - // Build the render info to POST to the region - LLSD report = LLSD::emptyMap(); - LLSD agents = LLSD::emptyMap(); - - std::vector::iterator iter = LLCharacter::sInstances.begin(); - while( iter != LLCharacter::sInstances.end() ) + U32 num_avs = 0; + + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) { - LLVOAvatar* avatar = dynamic_cast(*iter); - if (avatar && - avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) - !avatar->isDead() && // Not dead yet - avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region + // Build the render info to POST to the region + LLSD agents = LLSD::emptyMap(); + + std::vector::iterator iter = LLCharacter::sInstances.begin(); + while( iter != LLCharacter::sInstances.end() ) { - avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - - LLSD info = LLSD::emptyMap(); - if (avatar->getVisualComplexity() > 0) + LLVOAvatar* avatar = dynamic_cast(*iter); + if (avatar && + avatar->getRezzedStatus() >= 2 && // Mostly rezzed (maybe without baked textures downloaded) + !avatar->isDead() && // Not dead yet + avatar->getObjectHost() == regionp->getHost()) // Ensure it's on the same region { - info[KEY_WEIGHT] = avatar->getVisualComplexity(); - agents[avatar->getID().asString()] = info; + avatar->calculateUpdateRenderCost(); // Make sure the numbers are up-to-date - LL_DEBUGS("AvatarRenderInfo") << "LRI: Sending avatar render info for " << avatar->getID() - << ": " << info << LL_ENDL; + LLSD info = LLSD::emptyMap(); + if (avatar->getVisualComplexity() > 0) + { + info[KEY_WEIGHT] = avatar->getVisualComplexity(); + agents[avatar->getID().asString()] = info; + + LL_DEBUGS("AvatarRenderInfo") << "Sending avatar render info for " << avatar->getID() + << ": " << info << LL_ENDL; + num_avs++; + } } + iter++; } - iter++; - } - report[KEY_AGENTS] = agents; - if (agents.size() > 0) + if (num_avs > 0) + { + LLSD report = LLSD::emptyMap(); + report[KEY_AGENTS] = agents; + + LLCore::HttpHandle handle(LLCORE_HTTP_HANDLE_INVALID); + LLAvatarRenderInfoPostHandler* handler = new LLAvatarRenderInfoPostHandler; + + handle = LLCoreHttpUtil::requestPostWithLLSD(mHttpRequest, + http_policy, + http_priority, + url, + report, + mHttpOptions, + mHttpHeaders, + handler); + if (LLCORE_HTTP_HANDLE_INVALID == handle) + { + LLCore::HttpStatus status(mHttpRequest->getStatus()); + LL_WARNS("AvatarRenderInfo") << "HTTP POST request failed" + << " Status: " << status.toTerseString() + << " Reason: '" << status.toString() << "'" + << LL_ENDL; + delete handler; + } + else + { + LL_INFOS("AvatarRenderInfo") << "Sent render costs for " << num_avs + << " avatars to region " << regionp->getName() + << LL_ENDL; + + + } + } + else + { + LL_DEBUGS("AvatarRenderInfo") << "no agent info to send" << LL_ENDL; + } + } + else { - LL_INFOS("AvatarRenderInfo") << "LRI: Sending info for " << agents.size() - << " avatars to region " << regionp->getName() - << LL_ENDL; - LLHTTPClient::post(url, report, new LLAvatarRenderInfoPostResponder(regionp->getHandle())); + LL_WARNS("AvatarRenderInfo") << "AvatarRenderInfo cap is empty" << LL_ENDL; } + + // Reset this regions timer, moving to longer intervals if there are lots of avatars around + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_REPORTS + (2.f * num_avs)); } } @@ -285,16 +320,39 @@ void LLAvatarRenderInfoAccountant::sendRenderInfoToRegion(LLViewerRegion * regio // Send request for one region, no timer checks void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regionp) { - std::string url = regionp->getCapability("AvatarRenderInfo"); - if (!url.empty()) + if (regionp->getRenderInfoRequestTimer().hasExpired()) { - LL_DEBUGS("AvatarRenderInfo") << "LRI: Requesting avatar render info for region " - << regionp->getName() - << " from " << url - << LL_ENDL; + std::string url = regionp->getCapability("AvatarRenderInfo"); + if (!url.empty()) + { + + LLAvatarRenderInfoGetHandler* handler = new LLAvatarRenderInfoGetHandler; + // First send a request to get the latest data + LLCore::HttpHandle handle = mHttpRequest->requestGet(http_policy, + http_priority, + url, + NULL, + NULL, + handler); + if (LLCORE_HTTP_HANDLE_INVALID != handle) + { + LL_INFOS("AvatarRenderInfo") << "Requested avatar render info for region " + << regionp->getName() + << LL_ENDL; + } + else + { + LL_WARNS("AvatarRenderInfo") << "Failed to launch HTTP GET request. Try again." + << LL_ENDL; + delete handler; + } + } + else + { + LL_WARNS("AvatarRenderInfo") << "no AvatarRenderInfo cap for " << regionp->getName() << LL_ENDL; + } - // First send a request to get the latest data - LLHTTPClient::get(url, new LLAvatarRenderInfoGetResponder(regionp->getHandle())); + regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST); } } @@ -303,56 +361,60 @@ void LLAvatarRenderInfoAccountant::getRenderInfoFromRegion(LLViewerRegion * regi // Called every frame - send render weight requests to every region void LLAvatarRenderInfoAccountant::idle() { - if (sRenderInfoReportTimer.hasExpired()) - { - const F32 SECS_BETWEEN_REGION_SCANS = 5.f; // Scan the region list every 5 seconds - const F32 SECS_BETWEEN_REGION_REQUEST = 60.0; // Update each region every 60 seconds + mHttpRequest->update(0); // give any pending http operations a chance to call completion methods - S32 num_avs = LLCharacter::sInstances.size(); - - LL_DEBUGS("AvatarRenderInfo") << "LRI: Scanning all regions and checking for render info updates" + if (mRenderInfoScanTimer.hasExpired()) + { + LL_DEBUGS("AvatarRenderInfo") << "Scanning regions for render info updates" << LL_ENDL; - // Check all regions and see if it's time to fetch/send data + // Check all regions for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); - iter != LLWorld::getInstance()->getRegionList().end(); ++iter) + iter != LLWorld::getInstance()->getRegionList().end(); + ++iter) { LLViewerRegion* regionp = *iter; - if (regionp && - regionp->isAlive() && - regionp->capabilitiesReceived() && // Region has capability URLs available - regionp->getRenderInfoRequestTimer().hasExpired()) // Time to make request + if ( regionp + && regionp->isAlive() + && regionp->capabilitiesReceived()) { + // each of these is further governed by and resets its own timer sendRenderInfoToRegion(regionp); getRenderInfoFromRegion(regionp); - - // Reset this regions timer, moving to longer intervals if there are lots of avatars around - regionp->getRenderInfoRequestTimer().resetWithExpiry(SECS_BETWEEN_REGION_REQUEST + (2.f * num_avs)); } } // We scanned all the regions, reset the request timer. - sRenderInfoReportTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + mRenderInfoScanTimer.resetWithExpiry(SECS_BETWEEN_REGION_SCANS); } } +void LLAvatarRenderInfoAccountant::resetRenderInfoScanTimer() +{ + // this will force the next frame to rescan + mRenderInfoScanTimer.reset(); +} // static -// Make sRenderInfoReportTimer expire so the next call to idle() will scan and query a new region -// called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities +// Called via LLViewerRegion::setCapabilitiesReceived() boost signals when the capabilities // are returned for a new LLViewerRegion, and is the earliest time to get render info -void LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer(const LLUUID& region_id) +void LLAvatarRenderInfoAccountant::scanNewRegion(const LLUUID& region_id) { - LL_INFOS("AvatarRenderInfo") << "LRI: Viewer has new region capabilities, clearing global render info timer" - << " and timer for region " << region_id - << LL_ENDL; + LL_INFOS("AvatarRenderInfo") << region_id << LL_ENDL; - // Reset the global timer so it will scan regions immediately - sRenderInfoReportTimer.reset(); + // Reset the global timer so it will scan regions on the next call to ::idle + LLAvatarRenderInfoAccountant::getInstance()->resetRenderInfoScanTimer(); LLViewerRegion* regionp = LLWorld::instance().getRegionFromID(region_id); if (regionp) - { // Reset the region's timer so it will request data immediately + { // Reset the region's timers so we will: + // * request render info from it immediately + // * report on the following scan regionp->getRenderInfoRequestTimer().reset(); + regionp->getRenderInfoReportTimer().resetWithExpiry(SECS_BETWEEN_REGION_SCANS); + } + else + { + LL_WARNS("AvatarRenderInfo") << "unable to resolve region "< { -public: - LLAvatarRenderInfoAccountant() {}; - ~LLAvatarRenderInfoAccountant() {}; + private: + LOG_CLASS(LLAvatarRenderInfoAccountant); - static void sendRenderInfoToRegion(LLViewerRegion * regionp); - static void getRenderInfoFromRegion(LLViewerRegion * regionp); + public: + LLAvatarRenderInfoAccountant(); + ~LLAvatarRenderInfoAccountant(); - static void expireRenderInfoReportTimer(const LLUUID& region_id); + void sendRenderInfoToRegion(LLViewerRegion * regionp); + void getRenderInfoFromRegion(LLViewerRegion * regionp); - static void idle(); + void idle(); // called once per frame -private: - // Send data updates about once per minute, only need per-frame resolution - static LLFrameTimer sRenderInfoReportTimer; + void resetRenderInfoScanTimer(); + + static void scanNewRegion(const LLUUID& region_id); + + private: + // frequency of region scans, + // further limited by per region Request and Report timers + LLFrameTimer mRenderInfoScanTimer; + + // + LLCore::HttpRequest* mHttpRequest; + LLCore::HttpHeaders* mHttpHeaders; + LLCore::HttpOptions* mHttpOptions; }; #endif /* ! defined(LL_llavatarrenderinfoaccountant_H) */ diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 11cbf3fc24..31493ca6ce 100755 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -475,8 +475,7 @@ LLViewerRegion::LLViewerRegion(const U64 &handle, mImpl->mObjectPartition.push_back(NULL); //PARTITION_NONE mImpl->mVOCachePartition = getVOCachePartition(); - mRenderInfoRequestTimer.resetWithExpiry(0.f); // Set timer to be expired - setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::expireRenderInfoReportTimer, _1)); + setCapabilitiesReceivedCallback(boost::bind(&LLAvatarRenderInfoAccountant::scanNewRegion, _1)); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 1e225553b8..fbe229e00f 100755 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -431,7 +431,8 @@ public: static BOOL sVOCacheCullingEnabled; //vo cache culling enabled or not. static S32 sLastCameraUpdated; - LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + LLFrameTimer & getRenderInfoRequestTimer() { return mRenderInfoRequestTimer; }; + LLFrameTimer & getRenderInfoReportTimer() { return mRenderInfoReportTimer; }; struct CompareRegionByLastUpdate { @@ -536,7 +537,8 @@ private: // the materials capability throttle LLFrameTimer mMaterialsCapThrottleTimer; -LLFrameTimer mRenderInfoRequestTimer; + LLFrameTimer mRenderInfoRequestTimer; + LLFrameTimer mRenderInfoReportTimer; }; inline BOOL LLViewerRegion::getRegionProtocol(U64 protocol) const diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 816b2c8b67..7e9f098172 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -3121,12 +3121,10 @@ bool LLVOAvatar::isVisuallyMuted() else { // Determine if visually muted or not - U32 max_cost = (U32) (max_render_cost); - muted = LLMuteList::getInstance()->isMuted(getID()) || (mAttachmentGeometryBytes > max_attachment_bytes && max_attachment_bytes > 0) || (mAttachmentSurfaceArea > max_attachment_area && max_attachment_area > 0.f) || - (mVisualComplexity > max_cost && max_render_cost > 0); + (mVisualComplexity > max_render_cost && max_render_cost > 0); // Could be part of the grand || collection above, but yanked out to make the logic visible if (!muted) @@ -7967,11 +7965,17 @@ void LLVOAvatar::idleUpdateRenderCost() { mText->clearString(); // clear debug text } - + + /* + * NOTE: the logic for whether or not each of the values below + * controls muting MUST match that in the isVisuallyMuted method. + */ + + // Render Cost (ARC) calculateUpdateRenderCost(); // Update mVisualComplexity if needed static LLCachedControl max_render_cost(gSavedSettings, "RenderAutoMuteRenderWeightLimit", 0); - info_line = llformat("%d arc", mVisualComplexity); + info_line = llformat("%d ARC", mVisualComplexity); if (max_render_cost != 0) // zero means don't care, so don't bother coloring based on this { @@ -7980,16 +7984,37 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(red_level, green_level, 0.0, 1.0); info_style = ( mVisualComplexity > max_render_cost ? LLFontGL::BOLD : LLFontGL::NORMAL ); + } + else + { + info_color.set(LLColor4::grey); + info_style = LLFontGL::NORMAL; + } + mText->addLine(info_line, info_color, info_style); + + // TEMPORARY Reported Cost + info_line = llformat("%d reported ARC", mReportedVisualComplexity); + mText->addLine(info_line, info_color /* same as real ARC */, LLFontGL::ITALIC); + + // Visual rank + info_line = llformat("%d rank", mVisibilityRank); + if (sMaxVisible != 0) // zero means no limit, so don't bother coloring based on this + { + green_level = 1.f-llclamp(((F32)sMaxVisible-(F32)mVisibilityRank)/(F32)sMaxVisible, 0.f, 1.f); + red_level = llmin((F32) mVisibilityRank/(F32)sMaxVisible, 1.f); + info_color.set(red_level, green_level, 0.0, 1.0); + info_style = ( mVisibilityRank > sMaxVisible + ? LLFontGL::BOLD : LLFontGL::NORMAL ); } else { info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max cost " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); + // Attachment Surface Area static LLCachedControl max_attachment_area(gSavedSettings, "RenderAutoMuteSurfaceAreaLimit", 0); info_line = llformat("%.2f m^2", mAttachmentSurfaceArea); @@ -8007,9 +8032,9 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max area " << info_line << LL_ENDL; mText->addLine(info_line, info_color, info_style); + // Attachment byte limit static LLCachedControl max_attachment_bytes(gSavedSettings, "RenderAutoMuteByteLimit", 0); info_line = llformat("%.1f KB", mAttachmentGeometryBytes/1024.f); if (max_attachment_bytes != 0) // zero means don't care, so don't bother coloring based on this @@ -8025,8 +8050,7 @@ void LLVOAvatar::idleUpdateRenderCost() info_color.set(LLColor4::grey); info_style = LLFontGL::NORMAL; } - LL_DEBUGS() << "adding max bytes " << info_line << LL_ENDL; - mText->addLine(info_line, info_color); + mText->addLine(info_line, info_color, info_style); updateText(); // corrects position } @@ -8049,7 +8073,8 @@ void LLVOAvatar::calculateUpdateRenderCost() for (U8 baked_index = 0; baked_index < BAKED_NUM_INDICES; baked_index++) { - const LLAvatarAppearanceDictionary::BakedEntry *baked_dict = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); + const LLAvatarAppearanceDictionary::BakedEntry *baked_dict + = LLAvatarAppearanceDictionary::getInstance()->getBakedTexture((EBakedTextureIndex)baked_index); ETextureIndex tex_index = baked_dict->mTextureIndex; if ((tex_index != TEX_SKIRT_BAKED) || (isWearingWearableType(LLWearableType::WT_SKIRT))) { @@ -8061,11 +8086,11 @@ void LLVOAvatar::calculateUpdateRenderCost() } - for (attachment_map_t::const_iterator iter = mAttachmentPoints.begin(); - iter != mAttachmentPoints.end(); - ++iter) + for (attachment_map_t::const_iterator attachment_point = mAttachmentPoints.begin(); + attachment_point != mAttachmentPoints.end(); + ++attachment_point) { - LLViewerJointAttachment* attachment = iter->second; + LLViewerJointAttachment* attachment = attachment_point->second; for (LLViewerJointAttachment::attachedobjs_vec_t::iterator attachment_iter = attachment->mAttachedObjects.begin(); attachment_iter != attachment->mAttachedObjects.end(); ++attachment_iter) @@ -8095,10 +8120,12 @@ void LLVOAvatar::calculateUpdateRenderCost() } } - for (LLVOVolume::texture_cost_t::iterator iter = textures.begin(); iter != textures.end(); ++iter) + for (LLVOVolume::texture_cost_t::iterator volume_texture = textures.begin(); + volume_texture != textures.end(); + ++volume_texture) { // add the cost of each individual texture in the linkset - cost += iter->second; + cost += volume_texture->second; } } } -- cgit v1.2.3 From 20828d7f8fa29a92a9e2141a2373ac99bf44057e Mon Sep 17 00:00:00 2001 From: Northspring Date: Fri, 19 Dec 2014 23:35:45 +0100 Subject: Updated Polish translation up to 3.7.24 --- .../skins/default/xui/pl/floater_openobject.xml | 9 ++++++-- indra/newview/skins/default/xui/pl/floater_pay.xml | 23 +++++++++++++------- .../skins/default/xui/pl/floater_pay_object.xml | 25 ++++++++++++++-------- indra/newview/skins/default/xui/pl/menu_viewer.xml | 1 + .../newview/skins/default/xui/pl/notifications.xml | 4 ++++ indra/newview/skins/default/xui/pl/strings.xml | 9 ++++++++ 6 files changed, 52 insertions(+), 19 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/pl/floater_openobject.xml b/indra/newview/skins/default/xui/pl/floater_openobject.xml index 653f7b4824..f27e4ff858 100755 --- a/indra/newview/skins/default/xui/pl/floater_openobject.xml +++ b/indra/newview/skins/default/xui/pl/floater_openobject.xml @@ -1,5 +1,10 @@ - + + + + + + General @@ -471,14 +499,14 @@ control_name="MaximumARC" follows="left|top" height="16" - initial_value="0" + initial_value="101" increment="1" label="Maximum ARC:" label_width="165" layout="topleft" left="50" - min_val="0" - max_val="100" + min_val="1" + max_val="101" name="MaximumARC" show_text="false" top_delta="16" @@ -1185,14 +1213,15 @@ diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 023c6e5bbb..c09129c867 100755 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -4046,4 +4046,5 @@ Try enclosing path to the editor with double quotes. -Empty list- Default Off + (None) -- cgit v1.2.3 From 56f43a390015f3ba721554ef9a0e436b6bfad5f9 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 20 Jan 2015 13:35:26 -0500 Subject: STORM-2082 Still trying to work out the dirtyChilds issue. Also made some small UI adjustments. --- indra/newview/llfloaterdeleteprefpreset.cpp | 2 ++ indra/newview/llfloaterpreference.cpp | 32 ++++++---------------- indra/newview/llfloaterpreference.h | 2 ++ indra/newview/llpresetsmanager.cpp | 13 ++++++--- indra/newview/llpresetsmanager.h | 1 + .../default/xui/en/panel_preferences_graphics1.xml | 17 ++++++------ 6 files changed, 31 insertions(+), 36 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index 5cd37d61fc..68b107a1aa 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -73,6 +73,8 @@ void LLFloaterDeletePrefPreset::onBtnDelete() args["NAME"] = name; LLNotificationsUtil::add("PresetNotDeleted", args); } + + closeFloater(); } void LLFloaterDeletePrefPreset::onPresetsListChange() diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6dd030b280..34c34ffd65 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -107,7 +107,6 @@ #include "lllogininstance.h" // to check if logged in yet #include "llsdserialize.h" -#include "llpanelpresetspulldown.h" #include "llpresetsmanager.h" #include "llviewercontrol.h" #include "llpresetsmanager.h" @@ -1168,14 +1167,12 @@ void LLFloaterPreference::refreshEnabledState() BOOL shaders = ctrl_shader_enable->get(); if (shaders) { -llwarns << "DBG terrain OFF" << llendl; terrain_detail->setValue(1); terrain_detail->setEnabled(FALSE); terrain_text->setEnabled(FALSE); } else { -llwarns << "DBG terrain ON" << llendl; terrain_detail->setEnabled(TRUE); terrain_text->setEnabled(TRUE); } @@ -2282,7 +2279,9 @@ BOOL LLPanelPreferenceGraphics::postBuild() } #endif + resetDirtyChilds(); setPresetText(); + LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLPanelPreferenceGraphics::onPresetsListChange, this)); return LLPanelPreference::postBuild(); @@ -2290,8 +2289,8 @@ BOOL LLPanelPreferenceGraphics::postBuild() void LLPanelPreferenceGraphics::draw() { - LLPanelPreference::draw(); setPresetText(); + LLPanelPreference::draw(); } void LLPanelPreferenceGraphics::onPresetsListChange() @@ -2307,13 +2306,9 @@ void LLPanelPreferenceGraphics::setPresetText() if (hasDirtyChilds()) { gSavedSettings.setString("PresetGraphicActive", ""); - - LLPanelPresetsPulldown* instance = LLFloaterReg::findTypedInstance("presets_pulldown"); - if (instance) - { -llwarns << "DBG populate" << llendl; - instance->populatePanel(); - } + // This doesn't seem to cause an infinite recursion. This trigger is needed to cause the pulldown + // panel to update. + LLPresetsManager::getInstance()->triggerChangeSignal(); } std::string preset_graphic_active = gSavedSettings.getString("PresetGraphicActive"); @@ -2326,8 +2321,6 @@ llwarns << "DBG populate" << llendl; { preset_text->setText(LLTrans::getString("none_paren_cap")); } - - preset_text->resetDirty(); } bool LLPanelPreferenceGraphics::hasDirtyChilds() @@ -2345,16 +2338,7 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() { if (ctrl->isDirty()) { - LLControlVariable* control = ctrl->getControlVariable(); - if (control) - { - std::string control_name = control->getName(); - if ((control_name != "RenderDeferred") && (control_name != "RenderTerrainDetail")) - { -llwarns << "DBG " << control_name << llendl; - return true; - } - } + return true; } } // Push children onto the end of the work stack @@ -2363,7 +2347,7 @@ llwarns << "DBG " << control_name << llendl; { view_stack.push_back(*iter); } - } + } return false; } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index f73560e3c5..bb6e848178 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -259,7 +259,9 @@ public: protected: bool hasDirtyChilds(); + private: + void onPresetsListChange(); }; diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 05138ee0c3..a08f77eeb1 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -47,6 +47,11 @@ LLPresetsManager::~LLPresetsManager() { } +void LLPresetsManager::triggerChangeSignal() +{ + mPresetListChangeSignal(); +} + void LLPresetsManager::createMissingDefault() { std::string default_file = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, PRESETS_DIR, PRESETS_GRAPHIC, "default.xml"); @@ -86,7 +91,7 @@ std::string LLPresetsManager::getPresetsDir(const std::string& subdirectory) void LLPresetsManager::loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option) { - LL_INFOS("AppInit") << "Loading presets from " << dir << LL_ENDL; + LL_INFOS("AppInit") << "Loading list of preset names from " << dir << LL_ENDL; mPresetNames.clear(); @@ -190,7 +195,7 @@ bool LLPresetsManager::savePreset(const std::string& subdirectory, const std::st gSavedSettings.setString("PresetGraphicActive", name); // signal interested parties - mPresetListChangeSignal(); + triggerChangeSignal(); return true; } @@ -240,7 +245,7 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st { gSavedSettings.setString("PresetGraphicActive", name); } - mPresetListChangeSignal(); + triggerChangeSignal(); } } @@ -265,7 +270,7 @@ bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std:: } // signal interested parties - mPresetListChangeSignal(); + triggerChangeSignal(); return true; } diff --git a/indra/newview/llpresetsmanager.h b/indra/newview/llpresetsmanager.h index 50fe9f4216..a47c07dfba 100644 --- a/indra/newview/llpresetsmanager.h +++ b/indra/newview/llpresetsmanager.h @@ -52,6 +52,7 @@ public: typedef boost::signals2::signal preset_list_signal_t; void createMissingDefault(); + void triggerChangeSignal(); static std::string getPresetsDir(const std::string& subdirectory); void setPresetNamesInComboBox(const std::string& subdirectory, LLComboBox* combo, EDefaultOptions default_option); void loadPresetNamesFromDir(const std::string& dir, preset_name_list_t& presets, EDefaultOptions default_option); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index b5a1c1eda6..6bc549ce94 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -235,7 +235,8 @@ @@ -254,7 +255,7 @@ layout="topleft" mouse_opaque="false" name="Basic" - top="30" + top="10" width="517"> + + + General + + + + + m + + + + + + + + + Low + + + + Avatar + + + + + + + 0 + + + + + + + 0 + + + + + + + Low + + + + + + + Low + + + + Shaders + + + + + + + + + + + + + + + + + + + Low + + + + + + + + + + Water Reflections: + + + + + + + + + + + + + + + + + + Low + + + + + + + + + + + + + + + + Shadows: + + + + + + + + + Mesh + + + + + + + Low + + + + + + + Low + + + + + + + Low + + + + + + + Low + + + + Hardware + + + + + + + + + (0 = default brightness, lower = brighter) + + + + + + + + + + Antialiasing: + + + + + + + + + + (requires viewer restart) + + + + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 756c765bbd..5d4bfdd17f 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -10,7 +10,6 @@ top="1" width="517"> - - - - - - - - - - - m - + - - - + + + m + - - - + + + + + + + - - - - - - - - - - - - General - - - - - m - - - - - - - - - Low - - - - Avatar - - - - - - - 0 - - - - - - - 0 - - - - - - - Low - - - - - - - Low - - - - Shaders - - - - - - - - - - - - - - - - - - - Low - - - - - - - - - - Water Reflections: - - - - - - - - - - - - - - - - - - Low - - - - - - - - - - - - - - - - Shadows: - - - - - - - - - Mesh - - - - - - - Low - - - - - - - Low - - - - - - - Low - - - - - - - Low - - - - Hardware - - - - - - - - - (0 = default brightness, lower = brighter) - - - - - - - - - - Antialiasing: - - - - - - - - - - (requires viewer restart) - - - - - + - - + -- cgit v1.2.3 From c8a0aa99b4b879c4e22307a679053d4bd61dd9ff Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 18 Feb 2015 16:48:23 -0500 Subject: STORM-2082 Fix issue with isDirty --- indra/newview/llfloaterpreference.cpp | 62 +++++++++++------------------------ indra/newview/llfloaterpreference.h | 1 - 2 files changed, 20 insertions(+), 43 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index d2dfb63f9d..4b45837ec0 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1172,7 +1172,7 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() { LLComboBox* ctrl_reflections = getChild("Reflections"); LLTextBox* reflections_text = getChild("ReflectionsText"); - + // Reflections BOOL reflections = gSavedSettings.getBOOL("VertexShaderEnable") && gGLManager.mHasCubeMap @@ -1213,9 +1213,9 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() // Vertex Shaders // Global Shader Enable LLCheckBoxCtrl* ctrl_shader_enable = getChild("BasicShaders"); - LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var + LLSliderCtrl* terrain_detail = getChild("TerrainDetail"); // can be linked with control var LLTextBox* terrain_text = getChild("TerrainDetailText"); - + ctrl_shader_enable->setEnabled(LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable")); BOOL shaders = ctrl_shader_enable->get(); @@ -1305,36 +1305,6 @@ void LLFloaterPreferenceGraphicsAdvanced::refreshEnabledState() getChildView("fog")->setEnabled(!gPipeline.canUseWindLightShaders()); getChildView("antialiasing restart")->setVisible(!LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred")); - /* Disabling this block of code because canUseAntiAliasing currently always returns true - // anti-aliasing - LLComboBox* fsaa_ctrl = getChild("fsaa"); - LLTextBox* fsaa_text = getChild("antialiasing label"); - LLTextBox* fsaa_restart = getChild("antialiasing restart"); - - // Enable or disable the control, the "Antialiasing:" label and the restart warning - // based on code support for the feature on the current hardware. - - if (gPipeline.canUseAntiAliasing()) - { - fsaa_ctrl->setEnabled(TRUE); - - LLColor4 color = LLUIColorTable::instance().getColor("LabelTextColor"); - fsaa_text->setColor(color); - - fsaa_restart->setVisible(!gSavedSettings.getBOOL("RenderDeferred")); - } - else - { - fsaa_ctrl->setEnabled(FALSE); - fsaa_ctrl->setValue((LLSD::Integer) 0); - - LLColor4 color = LLUIColorTable::instance().getColor("LabelDisabledColor"); - fsaa_text->setColor(color); - - fsaa_restart->setVisible(FALSE); - } - */ - // now turn off any features that are unavailable disableUnavailableSettings(); @@ -1506,12 +1476,11 @@ void LLFloaterPreference::refresh() { LLPanel::refresh(); refreshEnabledState(); -} - -void LLFloaterPreferenceGraphicsAdvanced::draw() -{ - refresh(); - LLFloater::draw(); + LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); + if (advanced) + { + advanced->refresh(); + } } void LLFloaterPreferenceGraphicsAdvanced::refresh() @@ -2182,7 +2151,10 @@ void LLPanelPreference::saveSettings() mSavedValues.clear(); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack @@ -2410,7 +2382,10 @@ bool LLPanelPreferenceGraphics::hasDirtyChilds() LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack @@ -2449,7 +2424,10 @@ void LLPanelPreferenceGraphics::resetDirtyChilds() LLFloater* advanced = LLFloaterReg::findTypedInstance("prefs_graphics_advanced"); std::list view_stack; view_stack.push_back(this); - view_stack.push_back(advanced); + if (advanced) + { + view_stack.push_back(advanced); + } while(!view_stack.empty()) { // Process view on top of the stack diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index cc3c85e340..a123e0502f 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -278,7 +278,6 @@ public: void updateSliderText(LLSliderCtrl* ctrl, LLTextBox* text_box); void updateImpostorsText(LLSliderCtrl* ctrl, LLTextBox* text_box); void updateMaximumArcText(LLSliderCtrl* ctrl, LLTextBox* text_box); - void draw(); void refresh(); // callback for when client turns on shaders void onVertexShaderEnable(); -- cgit v1.2.3 From 7b8206476466a33235f6300152645493e18be357 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 18 Feb 2015 17:22:56 -0500 Subject: STORM-2082 Advanced floater xml adjustments --- .../en/floater_preferences_graphics_advanced.xml | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 981a30b436..01a5e36ab0 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -7,7 +7,7 @@ single_instance="true" save_rect="true" title="ADVANCED GRAPHICS PREFERENCES" - width="450"> + width="400"> @@ -32,7 +32,7 @@ layout="topleft" name="GeneralText" top_delta="35" - left="5" + left="10" width="128"> General @@ -62,7 +62,7 @@ name="DrawDistanceMeterText2" top_delta="0" left_delta="330" - width="102"> + width="20"> m @@ -112,7 +112,7 @@ name="PostProcessText" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -124,7 +124,7 @@ layout="topleft" name="AvatarText" top_delta="20" - left="5" + left="10" width="128"> Avatar @@ -159,7 +159,7 @@ left_delta="304" text_readonly_color="LabelDisabledColor" name="MaximumARCText" - width="128"> + width="65"> 0 @@ -194,7 +194,7 @@ left_delta="304" text_readonly_color="LabelDisabledColor" name="ImpostorsText" - width="128"> + width="65"> 0 @@ -225,7 +225,7 @@ name="AvatarMeshDetailText" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -256,7 +256,7 @@ top_delta="0" left_delta="304" name="AvatarPhysicsDetailText" - width="128"> + width="65"> Low @@ -268,7 +268,7 @@ layout="topleft" name="ShadersText" top_delta="20" - left="5" + left="10" width="128"> Shaders @@ -354,7 +354,7 @@ left_delta="284" name="TerrainDetailText" text_readonly_color="LabelDisabledColor" - width="128"> + width="65"> Low @@ -471,7 +471,7 @@ name="SkyMeshDetailText" text_readonly_color="LabelDisabledColor" top_delta="0" - width="128"> + width="65"> Low @@ -560,7 +560,7 @@ layout="topleft" name="AvatarText" top_delta="20" - left="5" + left="10" width="128"> Mesh @@ -595,7 +595,7 @@ text_readonly_color="LabelDisabledColor" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -626,7 +626,7 @@ name="TreeMeshDetailText" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -658,7 +658,7 @@ name="ObjectMeshDetailText" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -688,7 +688,7 @@ name="FlexibleMeshDetailText" top_delta="0" left_delta="304" - width="128"> + width="65"> Low @@ -700,7 +700,7 @@ layout="topleft" name="ShadersText" top_delta="20" - left="5" + left="10" width="128"> Hardware @@ -764,7 +764,7 @@ left="30" name="(brightness, lower is brighter)" top_delta="16" - width="230"> + width="260"> (0 = default brightness, lower = brighter) @@ -854,8 +854,8 @@ left_pad="10" name="antialiasing restart" top_delta="0" - width="190"> - (requires viewer restart) + width="130"> + (requires restart) -- cgit v1.2.3 From 2d31abfcd97d844343b642b4aef56e26d7883a00 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Thu, 19 Feb 2015 14:34:31 -0500 Subject: STORM-2082 Fix edge case bug --- indra/newview/llpresetsmanager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpresetsmanager.cpp b/indra/newview/llpresetsmanager.cpp index 205c5e6dfb..9fa5282862 100644 --- a/indra/newview/llpresetsmanager.cpp +++ b/indra/newview/llpresetsmanager.cpp @@ -246,16 +246,19 @@ void LLPresetsManager::loadPreset(const std::string& subdirectory, const std::st bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std::string& name) { + bool sts = true; + if (PRESETS_DEFAULT == name) { + // This code should never execute LL_WARNS("Presets") << "You are not allowed to delete the default preset." << LL_ENDL; - return false; + sts = false; } if (gDirUtilp->deleteFilesInDir(getPresetsDir(subdirectory), LLURI::escape(name) + ".xml") < 1) { LL_WARNS("Presets") << "Error removing preset " << name << " from disk" << LL_ENDL; - return false; + sts = false; } // If you delete the preset that is currently marked as loaded then also indicate that no preset is loaded. @@ -267,7 +270,7 @@ bool LLPresetsManager::deletePreset(const std::string& subdirectory, const std:: // signal interested parties triggerChangeSignal(); - return true; + return sts; } boost::signals2::connection LLPresetsManager::setPresetListChangeCallback(const preset_list_signal_t::slot_type& cb) -- cgit v1.2.3 From c598094d153c36b7b1c5504c460e3e4a750e947e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 20 Feb 2015 09:21:18 -0500 Subject: STORM-2082 Remove obsolete xml file --- .../default/xui/en/floater_hardware_settings.xml | 198 --------------------- 1 file changed, 198 deletions(-) delete mode 100755 indra/newview/skins/default/xui/en/floater_hardware_settings.xml (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml deleted file mode 100755 index 9deb0d2030..0000000000 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ /dev/null @@ -1,198 +0,0 @@ - - - - Filtering: - - - - Antialiasing: - - - - - - - - - - (requires viewer restart) - - - - (0 = default brightness, lower = brighter) - - - Enable VBO: - - - - Enable S3TC: - - - - - - General @@ -859,4 +846,45 @@ + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 5d4bfdd17f..a94907f0c9 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -233,12 +233,12 @@ -- cgit v1.2.3 From 1b7c00b558c55dd2c7a8edd8a82632dcb1219fce Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 22 Feb 2015 10:19:41 -0500 Subject: STORM-2082 Rearrange Reset, load, save, delete buttons. Make load, save, and delete floaters close when preferences floater closes. --- indra/newview/llfloaterdeleteprefpreset.cpp | 7 ++ indra/newview/llfloaterloadprefpreset.cpp | 6 +- indra/newview/llfloatersaveprefpreset.cpp | 8 +- .../default/xui/en/panel_preferences_graphics1.xml | 107 +++++++++++---------- 4 files changed, 73 insertions(+), 55 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterdeleteprefpreset.cpp b/indra/newview/llfloaterdeleteprefpreset.cpp index 68b107a1aa..7dedbbf984 100644 --- a/indra/newview/llfloaterdeleteprefpreset.cpp +++ b/indra/newview/llfloaterdeleteprefpreset.cpp @@ -30,9 +30,11 @@ #include "llbutton.h" #include "llcombobox.h" +#include "llfloaterpreference.h" #include "llnotificationsutil.h" #include "llpresetsmanager.h" #include "llviewercontrol.h" +#include "llfloaterreg.h" LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key) : LLFloater(key) @@ -42,6 +44,11 @@ LLFloaterDeletePrefPreset::LLFloaterDeletePrefPreset(const LLSD &key) // virtual BOOL LLFloaterDeletePrefPreset::postBuild() { + LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); + if (preferences) + { + preferences->addDependentFloater(this); + } getChild("delete")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnDelete, this)); getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterDeletePrefPreset::onBtnCancel, this)); LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterDeletePrefPreset::onPresetsListChange, this)); diff --git a/indra/newview/llfloaterloadprefpreset.cpp b/indra/newview/llfloaterloadprefpreset.cpp index d831da43f5..403db35cc0 100644 --- a/indra/newview/llfloaterloadprefpreset.cpp +++ b/indra/newview/llfloaterloadprefpreset.cpp @@ -42,7 +42,11 @@ LLFloaterLoadPrefPreset::LLFloaterLoadPrefPreset(const LLSD &key) // virtual BOOL LLFloaterLoadPrefPreset::postBuild() -{ +{ LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); + if (preferences) + { + preferences->addDependentFloater(this); + } getChild("ok")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnOk, this)); getChild("cancel")->setCommitCallback(boost::bind(&LLFloaterLoadPrefPreset::onBtnCancel, this)); LLPresetsManager::instance().setPresetListChangeCallback(boost::bind(&LLFloaterLoadPrefPreset::onPresetsListChange, this)); diff --git a/indra/newview/llfloatersaveprefpreset.cpp b/indra/newview/llfloatersaveprefpreset.cpp index 686a2f3269..bdef718d0e 100644 --- a/indra/newview/llfloatersaveprefpreset.cpp +++ b/indra/newview/llfloatersaveprefpreset.cpp @@ -30,6 +30,8 @@ #include "llbutton.h" #include "llcombobox.h" +#include "llfloaterpreference.h" +#include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llpresetsmanager.h" @@ -40,7 +42,11 @@ LLFloaterSavePrefPreset::LLFloaterSavePrefPreset(const LLSD &key) // virtual BOOL LLFloaterSavePrefPreset::postBuild() -{ +{ LLFloaterPreference* preferences = LLFloaterReg::getTypedInstance("preferences"); + if (preferences) + { + preferences->addDependentFloater(this); + } getChild("preset_combo")->setTextEntryCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this)); getChild("preset_combo")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onPresetNameEdited, this)); getChild("save")->setCommitCallback(boost::bind(&LLFloaterSavePrefPreset::onBtnSave, this)); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index a94907f0c9..6cf9045f2a 100755 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -31,34 +31,6 @@ (None) - - - - - - + + + + + + + -- cgit v1.2.3 From 72f832ba8dba0e843601b70b8ef80f40c564240f Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sun, 22 Feb 2015 10:32:07 -0500 Subject: STORM-2082 Change case of Maximum complexity --- .../skins/default/xui/en/floater_preferences_graphics_advanced.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 9c6589d466..054337dfc0 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -122,7 +122,7 @@ height="16" initial_value="101" increment="1" - label="Maximum Complexity:" + label="Maximum complexity:" label_width="185" layout="topleft" left="30" -- cgit v1.2.3 From b011afaa81608c1d1c19bfa808bf9c2b99e8e5c8 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Mon, 23 Feb 2015 19:09:56 -0500 Subject: STORM-2082 Clicking on Ok/Cancel in Advanced floater only closes it now --- indra/newview/llfloaterpreference.cpp | 32 ++++++++++++++++------ indra/newview/llfloaterpreference.h | 4 +-- .../en/floater_preferences_graphics_advanced.xml | 6 ++-- 3 files changed, 30 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 21c684ab25..3cbd5cc684 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -333,8 +333,8 @@ LLFloaterPreference::LLFloaterPreference(const LLSD& key) registered_dialog = true; } - mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this)); - mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this)); + mCommitCallbackRegistrar.add("Pref.Cancel", boost::bind(&LLFloaterPreference::onBtnCancel, this, _2)); + mCommitCallbackRegistrar.add("Pref.OK", boost::bind(&LLFloaterPreference::onBtnOK, this, _2)); mCommitCallbackRegistrar.add("Pref.ClearCache", boost::bind(&LLFloaterPreference::onClickClearCache, this)); mCommitCallbackRegistrar.add("Pref.WebClearCache", boost::bind(&LLFloaterPreference::onClickBrowserClearCache, this)); @@ -877,7 +877,7 @@ void LLFloaterPreference::onClose(bool app_quitting) } // static -void LLFloaterPreference::onBtnOK() +void LLFloaterPreference::onBtnOK(const LLSD& userdata) { // commit any outstanding text entry if (hasFocus()) @@ -893,7 +893,15 @@ void LLFloaterPreference::onBtnOK() { saveSettings(); apply(); - closeFloater(false); + + if (userdata.asString() == "closeadvanced") + { + LLFloaterReg::hideInstance("prefs_graphics_advanced"); + } + else + { + closeFloater(false); + } //Conversation transcript and log path changed so reload conversations based on new location if(mPriorInstantMessageLogPath.length()) @@ -938,7 +946,7 @@ void LLFloaterPreference::onBtnOK() } // static -void LLFloaterPreference::onBtnCancel() +void LLFloaterPreference::onBtnCancel(const LLSD& userdata) { if (hasFocus()) { @@ -950,7 +958,15 @@ void LLFloaterPreference::onBtnCancel() refresh(); } cancel(); - closeFloater(); + + if (userdata.asString() == "closeadvanced") + { + LLFloaterReg::hideInstance("prefs_graphics_advanced"); + } + else + { + closeFloater(); + } } // static @@ -1545,8 +1561,8 @@ void LLFloaterPreferenceGraphicsAdvanced::refresh() updateSliderText(getChild("SkyMeshDetail", true), getChild("SkyMeshDetailText", true)); updateSliderText(getChild("TerrainDetail", true), getChild("TerrainDetailText", true)); setIndirectControls(); - setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild("IndirectMaxNonImpostorsText", true)); - setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild("IndirectMaxComplexityText", true)); + setMaxNonImpostorsText(gSavedSettings.getU32("RenderAvatarMaxNonImpostors"),getChild("IndirectMaxNonImpostorsText", true)); + setMaxComplexityText(gSavedSettings.getU32("RenderAvatarMaxComplexity"),getChild("IndirectMaxComplexityText", true)); refreshEnabledState(); } diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 5058e7bb23..9730722558 100755 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -95,8 +95,8 @@ public: void getControlNames(std::vector& names); protected: - void onBtnOK(); - void onBtnCancel(); + void onBtnOK(const LLSD& userdata); + void onBtnCancel(const LLSD& userdata); void onClickClearCache(); // Clear viewer texture cache, vfs, and VO cache on next startup void onClickBrowserClearCache(); // Clear web history and caches as well as viewer caches above diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 054337dfc0..3f68efdc70 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -870,7 +870,8 @@ top_delta="0" width="80"> + function="Pref.OK" + parameter="closeadvanced" /> -- cgit v1.2.3 From 45c62ff8421467f5b63d8be2f9adfb6341675e28 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 24 Feb 2015 16:45:10 -0500 Subject: STORM-2082 Add non-displaying xml entries for RenderAvatarMax{Complexity, NonImpostors} so those values are saved in a preset file. --- .../en/floater_preferences_graphics_advanced.xml | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 3f68efdc70..25576fe643 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -889,4 +889,29 @@ parameter="closeadvanced" /> + + + + + + -- cgit v1.2.3 From a8530e8b193f58109fa939fc57d079e3fcd0430c Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 25 Feb 2015 08:22:38 -0500 Subject: STORM-2082 Change menu text --- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index d737df3941..448d3f2ebe 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -1533,7 +1533,7 @@ parameter="scene_load_stats" /> Date: Wed, 25 Feb 2015 09:28:16 -0500 Subject: STORM-2082 Add tool tip for Complexity slider --- .../skins/default/xui/en/floater_preferences_graphics_advanced.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml index 25576fe643..766adb8a34 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml @@ -118,6 +118,7 @@ Date: Wed, 25 Feb 2015 19:30:23 +0100 Subject: Updated Polish translation up to 3.7.26 Waiting for the revert of commit c924d3adeead --- indra/newview/skins/default/xui/pl/notifications.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/pl/notifications.xml b/indra/newview/skins/default/xui/pl/notifications.xml index f72dd69fed..a19463beee 100755 --- a/indra/newview/skins/default/xui/pl/notifications.xml +++ b/indra/newview/skins/default/xui/pl/notifications.xml @@ -3569,9 +3569,11 @@ Spróbuj ponownie za minutę. Zostałeś/aś teleportowany/a przez dodatek na [ITEM_ID] + Zostałeś/aś teleportowany/a przez obiekt '[OBJECT_NAME]' na działce '[PARCEL_NAME]' + Zostałeś/aś teleportowany/a przez obiekt '[OBJECT_NAME]' należący do [OWNER_ID] -- cgit v1.2.3 From 4d65987af842f59994b6c547a0598410d881179b Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 9 Mar 2015 15:18:00 -0400 Subject: indentation fix --- indra/newview/llface.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 32b510b21a..a85016dcb7 100755 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -330,17 +330,17 @@ void LLFace::dirtyTexture() { vobj->mLODChanged = TRUE; - LLVOAvatar* avatar = vobj->getAvatar(); - if (avatar) - { //avatar render cost may have changed - avatar->updateVisualComplexity(); - } + LLVOAvatar* avatar = vobj->getAvatar(); + if (avatar) + { //avatar render cost may have changed + avatar->updateVisualComplexity(); + } } gPipeline.markRebuild(drawablep, LLDrawable::REBUILD_VOLUME, FALSE); } } } - + gPipeline.markTextured(drawablep); } -- cgit v1.2.3 From 6380ff6513f0db197e00bc340926666dfaedf1d0 Mon Sep 17 00:00:00 2001 From: Northspring Date: Sun, 15 Mar 2015 14:32:38 +0100 Subject: Polish translation: Some dynamically assigned strings in snapshot floater are too long --- indra/newview/skins/default/xui/pl/floater_snapshot.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/pl/floater_snapshot.xml b/indra/newview/skins/default/xui/pl/floater_snapshot.xml index fe1c493c16..540aa4686e 100755 --- a/indra/newview/skins/default/xui/pl/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/pl/floater_snapshot.xml @@ -31,22 +31,22 @@ Zapisano do Szafy! - Zapisano na komputerze! + Zapisano na dysku! - Publikacja obrazu na osi czasu nie powiodła się. + Publikacja nie powiodła się. - Publikacja obrazu na kanale nie powiodła się. + Publikacja nie powiodła się. - Wysyłanie maila nie powiodło się. + Wysyłanie maila nieudane. - Zapis do Szafy nie powiódł się. + Zapis do Szafy nieudany. - Zapis na komputerze nie powiódł się. + Zapis na dysku nieudany.