Skip to content
Snippets Groups Projects
Commit 4f3339ff authored by Vadim ProductEngine's avatar Vadim ProductEngine
Browse files

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.
parent cb3042d8
No related branches found
No related tags found
No related merge requests found
...@@ -323,8 +323,9 @@ BOOL LLFloaterPreference::postBuild() ...@@ -323,8 +323,9 @@ BOOL LLFloaterPreference::postBuild()
if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab")))
tabcontainer->selectFirstTab(); 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, ""); 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 floater is opened before login set default localized busy message
if (LLStartUp::getStartupState() < STATE_STARTED) if (LLStartUp::getStartupState() < STATE_STARTED)
...@@ -414,7 +415,7 @@ void LLFloaterPreference::apply() ...@@ -414,7 +415,7 @@ void LLFloaterPreference::apply()
fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView()); fov_slider->setMaxValue(LLViewerCamera::getInstance()->getMaxView());
std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); 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()); LLViewerMedia::setCookiesEnabled(getChild<LLUICtrl>("cookies_enabled")->getValue());
...@@ -1310,6 +1311,12 @@ void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param) ...@@ -1310,6 +1311,12 @@ void LLFloaterPreference::getUIColor(LLUICtrl* ctrl, const LLSD& param)
color_swatch->setOriginal(LLUIColorTable::instance().getColor(param.asString())); 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"); static LLRegisterPanelClassWrapper<LLPanelPreference> t_places("panel_preference");
......
...@@ -103,6 +103,8 @@ class LLFloaterPreference : public LLFloater ...@@ -103,6 +103,8 @@ class LLFloaterPreference : public LLFloater
public: public:
void setCacheLocation(const LLStringExplicit& location);
void onClickSetCache(); void onClickSetCache();
void onClickResetCache(); void onClickResetCache();
void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata); void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata);
......
...@@ -195,7 +195,6 @@ ...@@ -195,7 +195,6 @@
control_name="CacheLocationTopFolder" control_name="CacheLocationTopFolder"
border_style="line" border_style="line"
border_thickness="1" border_thickness="1"
enabled="false"
follows="left|top" follows="left|top"
font="SansSerif" font="SansSerif"
height="23" height="23"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment