summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpreference.cpp
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2010-09-29 20:43:41 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2010-09-29 20:43:41 +0300
commit4f3339ff99af47e6a21f555489cdc9eb66c5ea06 (patch)
tree37a94ed16aa6c0ebd3d6802ad8d341a038138b2c /indra/newview/llfloaterpreference.cpp
parentcb3042d84d51532c0b6953b69bdc8f9651ea7631 (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.cpp11
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");