From 4aef5f54de70a8d729c93f7eb11995a7d23feed0 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Wed, 16 Jun 2010 17:32:51 -0700 Subject: EXT-7734 FIX In-world object properteis often don't show correct information reviewed by Leyla --- indra/newview/llinventoryfunctions.cpp | 5 ++ indra/newview/llinventoryfunctions.h | 1 + indra/newview/llpanelobjectinventory.cpp | 12 +-- indra/newview/llselectmgr.h | 15 ++-- indra/newview/llsidepaneltaskinfo.cpp | 27 ++++++- indra/newview/llsidepaneltaskinfo.h | 4 +- .../skins/default/xui/en/sidepanel_item_info.xml | 89 +++++++++++----------- 7 files changed, 86 insertions(+), 67 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 68fc86467c..3913e1805f 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -327,6 +327,11 @@ BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id) return FALSE; } +void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id) +{ + LLSideTray::getInstance()->showPanel("sidepanel_inventory", LLSD().with("id", item_uuid).with("object", object_id)); +} + void show_item_profile(const LLUUID& item_uuid) { LLUUID linked_uuid = gInventory.getLinkedItemID(item_uuid); diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index 93c56e1b8a..aa4ac98241 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -53,6 +53,7 @@ BOOL get_is_category_removable(const LLInventoryModel* model, const LLUUID& id); BOOL get_is_category_renameable(const LLInventoryModel* model, const LLUUID& id); void show_item_profile(const LLUUID& item_uuid); +void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id); void show_item_original(const LLUUID& item_uuid); diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index da809b7baa..f683cbc8d0 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -176,17 +176,7 @@ LLInventoryItem* LLTaskInvFVBridge::findItem() const void LLTaskInvFVBridge::showProperties() { - show_item_profile(mUUID); - - // Disable old properties floater; this is replaced by the sidepanel. - /* - LLFloaterProperties* floater = LLFloaterReg::showTypedInstance("properties", mUUID); - if (floater) - { - floater->setObjectID(mPanel->getTaskUUID()); - } - */ - + show_task_item_profile(mUUID, mPanel->getTaskUUID()); } struct LLBuyInvItemData diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h index d315f40ff3..668c04cf15 100644 --- a/indra/newview/llselectmgr.h +++ b/indra/newview/llselectmgr.h @@ -257,7 +257,6 @@ public: LLObjectSelection(); void updateEffects(); - void cleanupNodes(); BOOL isEmpty() const; @@ -281,11 +280,6 @@ public: template bool getSelectedTEValue(LLSelectedTEGetFunctor* func, T& res); template bool isMultipleTEValue(LLSelectedTEGetFunctor* func, const T& ignore_value); - void addNode(LLSelectNode *nodep); - void addNodeAtEnd(LLSelectNode *nodep); - void moveNodeToFront(LLSelectNode *nodep); - void removeNode(LLSelectNode *nodep); - void deleteAllNodes(); // Delete all nodes S32 getNumNodes(); LLSelectNode* findNode(LLViewerObject* objectp); @@ -312,6 +306,15 @@ public: ESelectType getSelectType() const { return mSelectType; } +private: + void addNode(LLSelectNode *nodep); + void addNodeAtEnd(LLSelectNode *nodep); + void moveNodeToFront(LLSelectNode *nodep); + void removeNode(LLSelectNode *nodep); + void deleteAllNodes(); + void cleanupNodes(); + + private: list_t mList; const LLObjectSelection &operator=(const LLObjectSelection &); diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index e76397671b..3ab71eac64 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -80,6 +80,7 @@ static LLRegisterPanelClassWrapper 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("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() diff --git a/indra/newview/llsidepaneltaskinfo.h b/indra/newview/llsidepaneltaskinfo.h index 15274c90db..010173e84e 100644 --- a/indra/newview/llsidepaneltaskinfo.h +++ b/indra/newview/llsidepaneltaskinfo.h @@ -67,6 +67,8 @@ protected: /*virtual*/ void save(); /*virtual*/ void updateVerbs(); + void refreshAll(); // ignore current keyboard focus and update all fields + // statics static void onClickClaim(void*); static void onClickRelease(void*); @@ -120,7 +122,7 @@ protected: LLViewerObject* getObject(); private: LLViewerObject* mObject; - LLObjectSelectionHandle mObjectSelection; + LLObjectSelectionHandle mObjectSelection; static LLSidepanelTaskInfo* sActivePanel; }; diff --git a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml index e2bd6f375e..b3bc618eec 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_item_info.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_item_info.xml @@ -159,51 +159,49 @@ name="LabelCreatorName" top_delta="6" width="140"> - Nicole Linden - -