From 95b8020d21b1ad60f82c767df7d7aac019ad8353 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 23 May 2011 16:11:50 -0700 Subject: adding marketplace inbox and outbox reviewed by Leslie --- indra/newview/CMakeLists.txt | 6 +- indra/newview/llpanelmarketplaceinbox.cpp | 47 +++++++ indra/newview/llpanelmarketplaceinbox.h | 46 +++++++ indra/newview/llpanelmarketplaceinventory.cpp | 46 ------- indra/newview/llpanelmarketplaceinventory.h | 46 ------- indra/newview/llpanelmarketplaceoutbox.cpp | 47 +++++++ indra/newview/llpanelmarketplaceoutbox.h | 46 +++++++ indra/newview/llsidepanelinventory.cpp | 49 +++++++- indra/newview/llsidepanelinventory.h | 3 + indra/newview/skins/default/textures/textures.xml | 2 + .../textures/widgets/MarketplaceBtn_Off.png | Bin 0 -> 711 bytes .../textures/widgets/MarketplaceBtn_Selected.png | Bin 0 -> 702 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 139 ++++++++++++--------- 13 files changed, 326 insertions(+), 151 deletions(-) create mode 100644 indra/newview/llpanelmarketplaceinbox.cpp create mode 100644 indra/newview/llpanelmarketplaceinbox.h delete mode 100644 indra/newview/llpanelmarketplaceinventory.cpp delete mode 100644 indra/newview/llpanelmarketplaceinventory.h create mode 100644 indra/newview/llpanelmarketplaceoutbox.cpp create mode 100644 indra/newview/llpanelmarketplaceoutbox.h create mode 100644 indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png create mode 100644 indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8fde605cb0..67f9fede45 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,7 +348,8 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp - llpanelmarketplaceinventory.cpp + llpanelmarketplaceinbox.cpp + llpanelmarketplaceoutbox.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -888,7 +889,8 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h - llpanelmarketplaceinventory.h + llpanelmarketplaceinbox.h + llpanelmarketplaceoutbox.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp new file mode 100644 index 0000000000..b3afaea20e --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -0,0 +1,47 @@ +/** + * @file llpanelmarketplaceinbox.cpp + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceinbox.h" + +static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); + +// protected +LLPanelMarketplaceInbox::LLPanelMarketplaceInbox() +: LLPanel() +{ +} + +LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceInbox::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h new file mode 100644 index 0000000000..519b213081 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaceinbox.h + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELMARKETPLACEINBOX_H +#define LL_LLPANELMARKETPLACEINBOX_H + +#include "llpanel.h" + +class LLPanelMarketplaceInbox : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplaceInbox); + + LLPanelMarketplaceInbox(); + ~LLPanelMarketplaceInbox(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACEINBOX_H + diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp deleted file mode 100644 index 2a56a9959a..0000000000 --- a/indra/newview/llpanelmarketplaceinventory.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaceinventory.cpp - * @brief Panel for marketplace inbox and outbox - * -* $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ -#include "llviewerprecompiledheaders.h" - -#include "llpanelmarketplaceinventory.h" - -static LLRegisterPanelClassWrapper t_panel_marketplace_inventory("panel_marketplace_inventory"); - -// protected -LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() -: LLPanel() -{ -} - -LLPanelMarketplaceInventory::~LLPanelMarketplaceInventory() -{ -} - -// virtual -BOOL LLPanelMarketplaceInventory::postBuild() -{ - return TRUE; -} diff --git a/indra/newview/llpanelmarketplaceinventory.h b/indra/newview/llpanelmarketplaceinventory.h deleted file mode 100644 index 367656ad38..0000000000 --- a/indra/newview/llpanelmarketplaceinventory.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaceinventory.h - * @brief Panel for marketplace inbox and outbox - * -* $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLPANELMARKETPLACEINVENTORY_H -#define LL_LLPANELMARKETPLACEINVENTORY_H - -#include "llpanel.h" - -class LLPanelMarketplaceInventory : public LLPanel -{ -public: - - LOG_CLASS(LLPanelMarketplaceInventory); - - LLPanelMarketplaceInventory(); - ~LLPanelMarketplaceInventory(); - - /*virtual*/ BOOL postBuild(); -}; - - -#endif //LL_LLPANELMARKETPLACEINVENTORY_H - diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp new file mode 100644 index 0000000000..1f58fb33a4 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -0,0 +1,47 @@ +/** + * @file llpanelmarketplaceoutbox.cpp + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceoutbox.h" + +static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); + +// protected +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() +: LLPanel() +{ +} + +LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceOutbox::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h new file mode 100644 index 0000000000..a6a28e0a83 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaceoutbox.h + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLPANELMARKETPLACEOUTBOX_H +#define LL_LLPANELMARKETPLACEOUTBOX_H + +#include "llpanel.h" + +class LLPanelMarketplaceOutbox : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplaceOutbox); + + LLPanelMarketplaceOutbox(); + ~LLPanelMarketplaceOutbox(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACEOUTBOX_H + diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 31ea542743..7f5a2e64bf 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -42,6 +42,7 @@ #include "lltabcontainer.h" #include "llselectmgr.h" #include "llweb.h" +#include "lllayoutstack.h" static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); @@ -118,10 +119,56 @@ BOOL LLSidepanelInventory::postBuild() back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); } } - + + getChild("inbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + getChild("outbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + LLLayoutStack* stack = getChild("inventory_layout_stack"); + + stack->collapsePanel(getChild("inbox_layout_panel"), true); + stack->collapsePanel(getChild("outbox_layout_panel"), true); + getChild("outbox_btn")->setToggleState(false); + getChild("inbox_btn")->setToggleState(false); + return TRUE; } + +void LLSidepanelInventory::onToggleInboxBtn() +{ + LLLayoutStack* stack = getChild("inventory_layout_stack"); + bool collapse = !getChild("inbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild("inbox_layout_panel"), collapse); + } + if (!collapse) + { + stack->collapsePanel(getChild("outbox_layout_panel"), true); + getChild("outbox_btn")->setToggleState(false); + } +} + +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild("inventory_layout_stack"); + bool collapse = !getChild("outbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild("outbox_layout_panel"), collapse); + } + + if (!collapse) + { + stack->collapsePanel(getChild("inbox_layout_panel"), true); + getChild("inbox_btn")->setToggleState(false); + } + +} + + void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 32c98bc034..a4e8d0e8e8 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -56,6 +56,9 @@ public: // checks can share selected item(s) bool canShare(); + void onToggleInboxBtn(); + void onToggleOutboxBtn(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1ca48b01a8..4f19dd9a6d 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -249,6 +249,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png new file mode 100644 index 0000000000..e291a1c508 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png differ diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png new file mode 100644 index 0000000000..33527f852b Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png differ diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 41b9283edc..a0caf80256 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -26,12 +26,12 @@ top="0" orientation="vertical" name="inventory_layout_stack" - height="545" + height="540" width="330"> + height="480"> + min_dim="35" + name="inbox_layout_panel" + max_dim="125" + height="35"> - - + Just a panel - + + + + + - Just a panel 2 - - - - - - + Just a panel + +