diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llfloaterdeleteprefpreset.cpp | 2 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.cpp | 32 | ||||
-rwxr-xr-x | indra/newview/llfloaterpreference.h | 2 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llpresetsmanager.h | 1 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml | 17 |
6 files changed, 31 insertions, 36 deletions
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<LLPanelPresetsPulldown>("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<void()> 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 @@ <tab_container follows="left|top" - height="400" + layout="topleft" + height="390" halign="center" left="0" name="PreferencesGraphicsTabs" @@ -243,7 +244,7 @@ tab_min_width="40" tab_position="top" tab_height="25" - top_delta="25" + top="80" width="517"> <!-- This block shows Basic Settings --> @@ -254,7 +255,7 @@ layout="topleft" mouse_opaque="false" name="Basic" - top="30" + top="10" width="517"> <button @@ -264,7 +265,7 @@ layout="topleft" left="10" name="Defaults" - top_delta="0" + top_delta="5" width="250"> <button.commit_callback function="Pref.HardwareDefaults" /> @@ -338,12 +339,12 @@ layout="topleft" mouse_opaque="false" name="Advanced" - top_delta="20" + top_delta="10" width="517"> <scroll_container follows="top|left" - height="270" + height="260" label="CustomGraphics" layout="topleft" left="5" @@ -368,7 +369,7 @@ height="23" label="Reset all to recommended settings" layout="topleft" - left="0" + left="5" name="Defaults" top="0" width="250"> @@ -1217,7 +1218,7 @@ layout="topleft" left="10" name="PrefSaveButton" - top="310" + top="300" width="250"> <button.commit_callback function="Pref.PrefSave" |