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 | |
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')
-rw-r--r-- | indra/newview/llfloaterpreference.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterpreference.h | 2 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_preferences_setup.xml | 1 |
3 files changed, 11 insertions, 3 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"); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index d1e15d5ab8..e99731b92e 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -103,6 +103,8 @@ protected: public: + void setCacheLocation(const LLStringExplicit& location); + void onClickSetCache(); void onClickResetCache(); void onClickSkin(LLUICtrl* ctrl,const LLSD& userdata); diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 879781f746..140d16e37f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -195,7 +195,6 @@ control_name="CacheLocationTopFolder" border_style="line" border_thickness="1" - enabled="false" follows="left|top" font="SansSerif" height="23" |