summaryrefslogtreecommitdiff
path: root/indra/newview/llsidepaneltaskinfo.cpp
diff options
context:
space:
mode:
authorLeyla Farazha <leyla@lindenlab.com>2010-06-21 10:21:52 -0700
committerLeyla Farazha <leyla@lindenlab.com>2010-06-21 10:21:52 -0700
commitc8970618567e867b619c9fb5e225978bc5f66781 (patch)
treed5ec9d2f27d887e9a39b1109469ca405b14c6a85 /indra/newview/llsidepaneltaskinfo.cpp
parent6be9f280ff5b2e2eba3bb9c3f14d7166579d1a49 (diff)
parenta069e0d3db0e0771e54768a702fa18e57415992e (diff)
Merge with q/viewer-release
Diffstat (limited to 'indra/newview/llsidepaneltaskinfo.cpp')
-rw-r--r--indra/newview/llsidepaneltaskinfo.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp
index 475a6b1da7..f71a4a475b 100644
--- a/indra/newview/llsidepaneltaskinfo.cpp
+++ b/indra/newview/llsidepaneltaskinfo.cpp
@@ -80,6 +80,7 @@ static LLRegisterPanelClassWrapper<LLSidepanelTaskInfo> t_task_info("sidepanel_t
LLSidepanelTaskInfo::LLSidepanelTaskInfo()
{
setMouseOpaque(FALSE);
+ LLSelectMgr::instance().mUpdateSignal.connect(boost::bind(&LLSidepanelTaskInfo::refreshAll, this));
}
@@ -271,7 +272,6 @@ void LLSidepanelTaskInfo::refresh()
// BUG: fails if a root and non-root are both single-selected.
const BOOL is_perm_modify = (mObjectSelection->getFirstRootNode() && LLSelectMgr::getInstance()->selectGetRootsModify()) ||
LLSelectMgr::getInstance()->selectGetModify();
- const LLFocusableElement* keyboard_focus_view = gFocusMgr.getKeyboardFocus();
S32 string_index = 0;
std::string MODIFY_INFO_STRINGS[] =
@@ -365,14 +365,14 @@ void LLSidepanelTaskInfo::refresh()
if (is_one_object)
{
- if (keyboard_focus_view != LineEditorObjectName)
+ if (!LineEditorObjectName->hasFocus())
{
childSetText("Object Name",nodep->mName);
}
if (LineEditorObjectDesc)
{
- if (keyboard_focus_view != LineEditorObjectDesc)
+ if (!LineEditorObjectDesc->hasFocus())
{
LineEditorObjectDesc->setText(nodep->mDescription);
}
@@ -1178,9 +1178,30 @@ void LLSidepanelTaskInfo::save()
onCommitIncludeInSearch(getChild<LLCheckBoxCtrl>("search_check"), this);
}
+// removes keyboard focus so that all fields can be updated
+// and then restored focus
+void LLSidepanelTaskInfo::refreshAll()
+{
+ // update UI as soon as we have an object
+ // but remove keyboard focus first so fields are free to update
+ LLFocusableElement* focus = NULL;
+ if (hasFocus())
+ {
+ focus = gFocusMgr.getKeyboardFocus();
+ setFocus(FALSE);
+ }
+ refresh();
+ if (focus)
+ {
+ focus->setFocus(TRUE);
+ }
+}
+
+
void LLSidepanelTaskInfo::setObjectSelection(LLObjectSelectionHandle selection)
{
mObjectSelection = selection;
+ refreshAll();
}
LLSidepanelTaskInfo* LLSidepanelTaskInfo::getActivePanel()