diff options
author | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-09-29 20:43:41 +0300 |
---|---|---|
committer | Vadim ProductEngine <vsavchuk@productengine.com> | 2010-09-29 20:43:41 +0300 |
commit | 4f3339ff99af47e6a21f555489cdc9eb66c5ea06 (patch) | |
tree | 37a94ed16aa6c0ebd3d6802ad8d341a038138b2c /indra/newview/llfloaterpreference.cpp | |
parent | cb3042d84d51532c0b6953b69bdc8f9651ea7631 (diff) |
STORM-227 FIXED Made long cache location in Preferences->Setup readable.
Changes:
- The line editor is now scrollable.
- Its value is duplicated in the tool-tip.
Technical notes:
If you set the "enabled" param of a line editor to "false", that will disable text selection in the widget.
However, if a line editor is initially enabled and then gets disabled with setEnabled(FALSE), it will remain selectable.
It looks like bug, but I'm not going to fix it now to not introduce issues like this one.
Instead, I'm applying to workaround which is to enable the widget initially and disable later, thus keeping it read-only but selectable.
Diffstat (limited to 'indra/newview/llfloaterpreference.cpp')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ff6df548c4..41f85ae29d 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -323,8 +323,9 @@ BOOL LLFloaterPreference::postBuild() if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); + getChild<LLUICtrl>("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227) std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - getChild<LLUICtrl>("cache_location")->setValue(cache_location); + setCacheLocation(cache_location); // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) @@ -414,7 +415,7 @@ void LLFloaterPreference::apply() fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); - getChild<LLUICtrl>("cache_location")->setValue(cache_location); + setCacheLocation(cache_location); LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue()); @@ -1310,6 +1311,12 @@ void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param) color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); } +void LLFloaterPreference::setCacheLocation(const LLStringExplicit& location) +{ + LLUICtrl* cache_location_editor = getChild<LLUICtrl>("cache_location"); + cache_location_editor->setValue(location); + cache_location_editor->setToolTip(location); +} //---------------------------------------------------------------------------- static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference"); |