diff options
author | Merov Linden <merov@lindenlab.com> | 2014-04-21 15:26:14 -0700 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2014-04-21 15:26:14 -0700 |
commit | cda6ac9e9b0dc9c75746440d98a98d3556ec9b4e (patch) | |
tree | d31844606df07076fd32e01087d87f80acfccb31 | |
parent | 250f05861eeec06b864e57c1fda6a996b6a94029 (diff) |
DD-71 : Implement a new item properties floater, calls the same code as the sidepanel in the inventory but with the back button hidden
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.cpp | 27 | ||||
-rwxr-xr-x | indra/newview/llfloatermarketplacelistings.h | 16 | ||||
-rwxr-xr-x | indra/newview/llinventorybridge.cpp | 10 | ||||
-rwxr-xr-x | indra/newview/llviewerfloaterreg.cpp | 1 | ||||
-rwxr-xr-x | indra/newview/skins/default/xui/en/floater_item_properties.xml | 23 |
5 files changed, 76 insertions, 1 deletions
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<LLSidepanelItemInfo>("item_panel"); + LLButton* back_btn = panel->getChild<LLButton>("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<LLSidepanelItemInfo>("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<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); + LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); 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 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + height="570" + layout="topleft" + name="Item Properties" + help_topic="item+properties" + title="ITEM PROPERTIES" + width="330"> + <panel + follows="all" + layout="topleft" + left="0" + class="sidepanel_item_info" + filename="sidepanel_item_info.xml" + name="item_panel" + top="20" + label="" + height="570" + visible="true" + width="330"> + </panel> +</floater> |