From cda6ac9e9b0dc9c75746440d98a98d3556ec9b4e Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 21 Apr 2014 15:26:14 -0700 Subject: DD-71 : Implement a new item properties floater, calls the same code as the sidepanel in the inventory but with the back button hidden --- indra/newview/llfloatermarketplacelistings.cpp | 27 ++++++++++++++++++++++ indra/newview/llfloatermarketplacelistings.h | 16 +++++++++++++ indra/newview/llinventorybridge.cpp | 10 +++++++- indra/newview/llviewerfloaterreg.cpp | 1 + .../default/xui/en/floater_item_properties.xml | 23 ++++++++++++++++++ 5 files changed, 76 insertions(+), 1 deletion(-) create mode 100755 indra/newview/skins/default/xui/en/floater_item_properties.xml (limited to 'indra/newview') diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 2cfbd97ef1..39df5f4abe 100755 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -39,6 +39,7 @@ #include "llnotificationhandler.h" #include "llnotificationmanager.h" #include "llnotificationsutil.h" +#include "llsidepaneliteminfo.h" #include "lltextbox.h" #include "lltrans.h" @@ -629,7 +630,33 @@ void LLFloaterMarketplaceValidation::appendMessage(std::string& message) } } +//----------------------------------------------------------------------------- +// LLFloaterItemProperties +//----------------------------------------------------------------------------- +LLFloaterItemProperties::LLFloaterItemProperties(const LLSD& key) +: LLFloater(key) +{ +} +LLFloaterItemProperties::~LLFloaterItemProperties() +{ +} +BOOL LLFloaterItemProperties::postBuild() +{ + // On the standalone properties floater, we have no need for a back button... + LLSidepanelItemInfo* panel = getChild("item_panel"); + LLButton* back_btn = panel->getChild("back_btn"); + back_btn->setVisible(FALSE); + + return LLFloater::postBuild(); +} + +void LLFloaterItemProperties::onOpen(const LLSD& key) +{ + // Tell the panel which item it needs to visualize + LLSidepanelItemInfo* panel = getChild("item_panel"); + panel->setItemID(key["id"].asUUID()); +} diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 1d3378791d..43665e643e 100755 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -171,4 +171,20 @@ private: LLTextEditor* mEditor; }; +//----------------------------------------------------------------------------- +// LLFloaterItemProperties +//----------------------------------------------------------------------------- + +class LLFloaterItemProperties : public LLFloater +{ +public: + LLFloaterItemProperties(const LLSD& key); + virtual ~LLFloaterItemProperties(); + + BOOL postBuild(); + virtual void onOpen(const LLSD& key); + +private: +}; + #endif // LL_LLFLOATERMARKETPLACELISTINGS_H diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3f2a5501bd..a9d5768854 100755 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -290,7 +290,15 @@ BOOL LLInvFVBridge::copyToClipboard() const // *TODO: make sure this does the right thing void LLInvFVBridge::showProperties() { - show_item_profile(mUUID); + LLUUID marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS, true); + if (gInventory.isObjectDescendentOf(mUUID, marketplacelistings_id)) + { + LLFloaterReg::showInstance("item_properties", LLSD().with("id",mUUID)); + } + else + { + show_item_profile(mUUID); + } // Disable old properties floater; this is replaced by the sidepanel. /* diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 49f1529caf..3df0467e45 100755 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -227,6 +227,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLInspectAvatarUtil::registerFloater(); LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); diff --git a/indra/newview/skins/default/xui/en/floater_item_properties.xml b/indra/newview/skins/default/xui/en/floater_item_properties.xml new file mode 100755 index 0000000000..0fc54a9c8b --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_item_properties.xml @@ -0,0 +1,23 @@ + + + + + -- cgit v1.2.3