From 61b28f5a1cdaed3e4b60a199604b8796079aec31 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Tue, 10 May 2011 17:45:07 -0700 Subject: converted spaces to tabs --- indra/newview/llviewermessage.cpp | 90 +++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fc11cbc28a..a49545f5e3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -265,7 +265,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ msg->newMessageFast(_PREHASH_MoneyTransferRequest); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_MoneyData); msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_DestID, uuid); @@ -337,7 +337,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) LL_INFOS("Messaging") << "process_logout_reply item not found: " << item_id << LL_ENDL; } } - LLAppViewer::instance()->forceQuit(); + LLAppViewer::instance()->forceQuit(); } void process_layer_data(LLMessageSystem *mesgsys, void **user_data) @@ -1868,7 +1868,7 @@ void inventory_offer_handler(LLOfferInfo* info) info->mPersist = true; p.name = "ObjectGiveItem"; // Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory. - LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, info->mFromGroup == TRUE); + LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, info->mFromGroup == TRUE); } else // Agent -> Agent Inventory Offer { @@ -1899,8 +1899,8 @@ void inventory_offer_handler(LLOfferInfo* info) // Inform user that there is a script floater via toast system { payload["give_inventory_notification"] = TRUE; - p.payload = payload; - LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, false); + p.payload = payload; + LLPostponedNotification::add<LLPostponedOfferNotification>(p, info->mFromID, false); } } @@ -2198,11 +2198,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) binary_bucket_size = msg->getSizeFast(_PREHASH_MessageBlock, _PREHASH_BinaryBucket); EInstantMessage dialog = (EInstantMessage)d; - // make sure that we don't have an empty or all-whitespace name + // make sure that we don't have an empty or all-whitespace name LLStringUtil::trim(name); if (name.empty()) { - name = LLTrans::getString("Unnamed"); + name = LLTrans::getString("Unnamed"); } // IDEVO convert new-style "Resident" names for display name = clean_name_from_im(name, dialog); @@ -2240,7 +2240,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.name = "IMSystemMessageTip"; params.substitutions = args; params.payload = payload; - LLPostponedNotification::add<LLPostponedIMSystemTipNotification>(params, from_id, false); + LLPostponedNotification::add<LLPostponedIMSystemTipNotification>(params, from_id, false); break; case IM_NOTHING_SPECIAL: @@ -2817,10 +2817,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["lure_id"] = session_id; payload["godlike"] = FALSE; - LLNotification::Params params("TeleportOffered"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false); + LLNotification::Params params("TeleportOffered"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false); } } break; @@ -2884,15 +2884,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if(message.empty()) { //support for frienship offers from clients before July 2008 - LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); + LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); } else { args["[MESSAGE]"] = message; - LLNotification::Params params("OfferFriendship"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false); + LLNotification::Params params("OfferFriendship"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add<LLPostponedOfferNotification>( params, from_id, false); } } } @@ -4252,8 +4252,8 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) F32 phase; U64 space_time_usec; - U32 seconds_per_day; - U32 seconds_per_year; + U32 seconds_per_day; + U32 seconds_per_year; // "SimulatorViewerTimeMessage" mesgsys->getU64Fast(_PREHASH_TimeInfo, _PREHASH_UsecSinceStart, space_time_usec); @@ -4420,7 +4420,7 @@ void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_da return; } - mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); + mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); objectp->adjustAudioGain(gain); } @@ -4548,7 +4548,7 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) break; default: // Used to be a commented out warning. - LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; + LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; break; } } @@ -5035,7 +5035,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) msg->getStringFast(_PREHASH_MoneyData, _PREHASH_Description, desc); LL_INFOS("Messaging") << "L$, credit, committed: " << balance << " " << credit << " " << committed << LL_ENDL; - + if (gStatusBar) { gStatusBar->setBalance(balance); @@ -5149,9 +5149,9 @@ static void money_balance_group_notify(const LLUUID& group_id, static void money_balance_avatar_notify(const LLUUID& agent_id, const LLAvatarName& av_name, - std::string notification, - LLSD args, - LLSD payload) + std::string notification, + LLSD args, + LLSD payload) { // Message uses name SLURLs, don't actually have to substitute in // the name. We're just making sure it's available. @@ -5161,24 +5161,24 @@ static void money_balance_avatar_notify(const LLUUID& agent_id, static void process_money_balance_reply_extended(LLMessageSystem* msg) { - // Added in server 1.40 and viewer 2.1, support for localization - // and agent ids for name lookup. - S32 transaction_type = 0; - LLUUID source_id; + // Added in server 1.40 and viewer 2.1, support for localization + // and agent ids for name lookup. + S32 transaction_type = 0; + LLUUID source_id; BOOL is_source_group = FALSE; - LLUUID dest_id; + LLUUID dest_id; BOOL is_dest_group = FALSE; - S32 amount = 0; - std::string item_description; + S32 amount = 0; + std::string item_description; - msg->getS32("TransactionInfo", "TransactionType", transaction_type); - msg->getUUID("TransactionInfo", "SourceID", source_id); + msg->getS32("TransactionInfo", "TransactionType", transaction_type); + msg->getUUID("TransactionInfo", "SourceID", source_id); msg->getBOOL("TransactionInfo", "IsSourceGroup", is_source_group); - msg->getUUID("TransactionInfo", "DestID", dest_id); + msg->getUUID("TransactionInfo", "DestID", dest_id); msg->getBOOL("TransactionInfo", "IsDestGroup", is_dest_group); - msg->getS32("TransactionInfo", "Amount", amount); - msg->getString("TransactionInfo", "ItemDescription", item_description); - LL_INFOS("Money") << "MoneyBalanceReply source " << source_id + msg->getS32("TransactionInfo", "Amount", amount); + msg->getString("TransactionInfo", "ItemDescription", item_description); + LL_INFOS("Money") << "MoneyBalanceReply source " << source_id << " dest " << dest_id << " type " << transaction_type << " item " << item_description << LL_ENDL; @@ -6477,10 +6477,10 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLSD payload; LLUUID object_id; - LLUUID owner_id; + LLUUID owner_id; msg->getUUID("Data", "ObjectID", object_id); - msg->getUUID("OwnerData", "OwnerID", owner_id); + msg->getUUID("OwnerData", "OwnerID", owner_id); if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) { @@ -6630,7 +6630,7 @@ void process_load_url(LLMessageSystem* msg, void**) // Check if object or owner is muted if (LLMuteList::getInstance()->isMuted(object_id, object_name) || - LLMuteList::getInstance()->isMuted(owner_id)) + LLMuteList::getInstance()->isMuted(owner_id)) { LL_INFOS("Messaging")<<"Ignoring load_url from muted object/owner."<<LL_ENDL; return; @@ -6772,9 +6772,9 @@ void process_covenant_reply(LLMessageSystem* msg, void**) gAgent.getID(), gAgent.getSessionID(), covenant_id, - LLAssetType::AT_NOTECARD, + LLAssetType::AT_NOTECARD, ET_Covenant, - onCovenantLoadComplete, + onCovenantLoadComplete, NULL, high_priority); } @@ -6847,7 +6847,7 @@ void onCovenantLoadComplete(LLVFS *vfs, LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || - LL_ERR_FILE_EMPTY == status) + LL_ERR_FILE_EMPTY == status) { covenant_text = "Estate covenant notecard is missing from database."; } @@ -6895,7 +6895,7 @@ void invalid_message_callback(LLMessageSystem* msg, void*, EMessageException exception) { - LLAppViewer::instance()->badNetworkHandler(); + LLAppViewer::instance()->badNetworkHandler(); } // Please do not add more message handlers here. This file is huge. -- cgit v1.2.3 From 6bafd98ae0b12878cb265645190fc46c919773d3 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 16 May 2011 17:17:56 -0700 Subject: initial sidepanel inventory xml changes --- .../skins/default/xui/en/sidepanel_inventory.xml | 87 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 8997c1a6d7..5f6ef16cf0 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -19,17 +19,82 @@ height="570" visible="true" width="330"> - <panel - class="panel_main_inventory" - filename="panel_main_inventory.xml" - follows="all" - layout="topleft" - left="0" - name="panel_main_inventory" - top="0" - label="" - height="545" - width="330" /> + <layout_stack + follows="left|right|top|bottom" + layout="topleft" + left="0" + top="0" + orientation="vertical" + name="inventory_layout_stack" + height="545" + width="330"> + <layout_panel> + <panel + class="panel_main_inventory" + filename="panel_main_inventory.xml" + follows="all" + layout="topleft" + left="0" + name="panel_main_inventory" + top="0" + label="" + height="445" + width="330" /> + </layout_panel> + <layout_panel + width="330" + follows="bottom|left|right" + height="100"> + <accordion + follows="all" + fit_parent="true" + height="100" + left="10" + single_expansion="true" + top="0" + name="accordion" + background_visible="true" + bg_alpha_color="DkGray2" + width="311"> + <accordion_tab + name="tab_clothing" + height="35" + title="MARKETPLACE INBOX"> + <flat_list_view + allow_select="true" + follows="all" + height="30" + item_pad="3" + keep_selection_visible_on_reshape="false" + layout="topleft" + left="0" + multi_select="true" + name="list_clothing" + top="0" + width="311" /> + </accordion_tab> + <accordion_tab + name="tab_attachments" + title="MARKETPLACE OUTBOX"> + <flat_list_view + allow_select="true" + follows="all" + height="30" + item_pad="3" + layout="topleft" + left="0" + keep_selection_visible_on_reshape="false" + multi_select="true" + name="list_attachments" + top="0" + width="311"> + <flat_list_view.no_items_text + value="No attachments worn" /> + </flat_list_view> + </accordion_tab> + </accordion> + </layout_panel> + </layout_stack> <panel follows="bottom|left|right" height="25" -- cgit v1.2.3 From 086988e6ed0accd0f2cb2e87317dbcfd93a11e02 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 16 May 2011 18:07:26 -0700 Subject: initial commit of llpanelmarketplace files --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llpanelmarketplace.cpp | 46 ++++++++++++++++++++++++++++++++++++ indra/newview/llpanelmarketplace.h | 46 ++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 indra/newview/llpanelmarketplace.cpp create mode 100644 indra/newview/llpanelmarketplace.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 95cfc23ede..f14313cf7d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,6 +348,7 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp + llpanelmarketplace.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -887,6 +888,7 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h + llpanelmarketplace.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplace.cpp b/indra/newview/llpanelmarketplace.cpp new file mode 100644 index 0000000000..c3d97f9d62 --- /dev/null +++ b/indra/newview/llpanelmarketplace.cpp @@ -0,0 +1,46 @@ +/** + * @file llfloatersounddevices.cpp + * @author Leyla Farazha + * @brief Sound Preferences used for minimal skin + * +* $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 "llpanelmarketplace.h" + + +// protected +LLPanelMarketplace::LLPanelMarketplace() +: LLPanel() +{ +} + +LLPanelMarketplace::~LLPanelMarketplace() +{ +} + +// virtual +BOOL LLPanelMarketplace::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplace.h b/indra/newview/llpanelmarketplace.h new file mode 100644 index 0000000000..bd0ef523fc --- /dev/null +++ b/indra/newview/llpanelmarketplace.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaces.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_LLPANELMARKETPLACE_H +#define LL_LLPANELMARKETPLACE_H + +#include "llpanel.h" + +class LLPanelMarketplace : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplace); + + LLPanelMarketplace(); + ~LLPanelMarketplace(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACE_H + -- cgit v1.2.3 From e8b0db53b2dbfab3fc060fefb6abb2d6dcf31fe9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 17 May 2011 14:44:23 -0700 Subject: changing llpanelmarketplace to llpanelmarketplaceinventory --- indra/newview/CMakeLists.txt | 4 +-- indra/newview/llpanelmarketplace.cpp | 46 --------------------------- indra/newview/llpanelmarketplace.h | 46 --------------------------- indra/newview/llpanelmarketplaceinventory.cpp | 45 ++++++++++++++++++++++++++ indra/newview/llpanelmarketplaceinventory.h | 46 +++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 94 deletions(-) delete mode 100644 indra/newview/llpanelmarketplace.cpp delete mode 100644 indra/newview/llpanelmarketplace.h create mode 100644 indra/newview/llpanelmarketplaceinventory.cpp create mode 100644 indra/newview/llpanelmarketplaceinventory.h diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f14313cf7d..8fde605cb0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,7 +348,7 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp - llpanelmarketplace.cpp + llpanelmarketplaceinventory.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -888,7 +888,7 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h - llpanelmarketplace.h + llpanelmarketplaceinventory.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplace.cpp b/indra/newview/llpanelmarketplace.cpp deleted file mode 100644 index c3d97f9d62..0000000000 --- a/indra/newview/llpanelmarketplace.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llfloatersounddevices.cpp - * @author Leyla Farazha - * @brief Sound Preferences used for minimal skin - * -* $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 "llpanelmarketplace.h" - - -// protected -LLPanelMarketplace::LLPanelMarketplace() -: LLPanel() -{ -} - -LLPanelMarketplace::~LLPanelMarketplace() -{ -} - -// virtual -BOOL LLPanelMarketplace::postBuild() -{ - return TRUE; -} diff --git a/indra/newview/llpanelmarketplace.h b/indra/newview/llpanelmarketplace.h deleted file mode 100644 index bd0ef523fc..0000000000 --- a/indra/newview/llpanelmarketplace.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaces.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_LLPANELMARKETPLACE_H -#define LL_LLPANELMARKETPLACE_H - -#include "llpanel.h" - -class LLPanelMarketplace : public LLPanel -{ -public: - - LOG_CLASS(LLPanelMarketplace); - - LLPanelMarketplace(); - ~LLPanelMarketplace(); - - /*virtual*/ BOOL postBuild(); -}; - - -#endif //LL_LLPANELMARKETPLACE_H - diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp new file mode 100644 index 0000000000..be2cef3601 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinventory.cpp @@ -0,0 +1,45 @@ +/** + * @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" + + +// protected +LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() +: LLPanel() +{ +} + +LLPanelMarketplaceInventory::~LLPanelMarketplaceInventory() +{ +} + +// virtual +BOOL LLPanelMarketplaceInventory::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceinventory.h b/indra/newview/llpanelmarketplaceinventory.h new file mode 100644 index 0000000000..367656ad38 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinventory.h @@ -0,0 +1,46 @@ +/** + * @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 + -- cgit v1.2.3 From dfebb9ebb7333387d59aa7ba4e5926671d6681f5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 17 May 2011 16:01:29 -0700 Subject: hooking up the marketplace inventory panel to the class --- indra/newview/llpanelmarketplaceinventory.cpp | 1 + .../skins/default/xui/en/sidepanel_inventory.xml | 60 +++++++++++----------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp index be2cef3601..2a56a9959a 100644 --- a/indra/newview/llpanelmarketplaceinventory.cpp +++ b/indra/newview/llpanelmarketplaceinventory.cpp @@ -27,6 +27,7 @@ #include "llpanelmarketplaceinventory.h" +static LLRegisterPanelClassWrapper<LLPanelMarketplaceInventory> t_panel_marketplace_inventory("panel_marketplace_inventory"); // protected LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 5f6ef16cf0..faf5e28bb8 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -28,7 +28,10 @@ name="inventory_layout_stack" height="545" width="330"> - <layout_panel> + <layout_panel + width="330" + follows="bottom|left|right" + height="445"> <panel class="panel_main_inventory" filename="panel_main_inventory.xml" @@ -45,6 +48,16 @@ width="330" follows="bottom|left|right" height="100"> + <panel + class="panel_marketplace_inventory" + follows="all" + layout="topleft" + left="0" + name="panel_marketplace" + top="0" + label="" + height="100" + width="330"> <accordion follows="all" fit_parent="true" @@ -58,41 +71,30 @@ width="311"> <accordion_tab name="tab_clothing" - height="35" + height="35" + min_height="150" + fit_panel="false" title="MARKETPLACE INBOX"> - <flat_list_view - allow_select="true" - follows="all" - height="30" - item_pad="3" - keep_selection_visible_on_reshape="false" - layout="topleft" - left="0" - multi_select="true" - name="list_clothing" - top="0" - width="311" /> + <view + follows="all" + left="0" + height="40" + top="0" + /> </accordion_tab> <accordion_tab name="tab_attachments" + fit_panel="false" title="MARKETPLACE OUTBOX"> - <flat_list_view - allow_select="true" - follows="all" - height="30" - item_pad="3" - layout="topleft" - left="0" - keep_selection_visible_on_reshape="false" - multi_select="true" - name="list_attachments" - top="0" - width="311"> - <flat_list_view.no_items_text - value="No attachments worn" /> - </flat_list_view> + <view + follows="all" + height="35" + left="0" + top="0" + /> </accordion_tab> </accordion> + </panel> </layout_panel> </layout_stack> <panel -- cgit v1.2.3 From 03dca7cb7e578d20ec07298cecc47e0ae67aaaf5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 17 May 2011 16:38:51 -0700 Subject: fixing llaccordian crash with multiple child panels --- indra/llui/llaccordionctrltab.cpp | 2 +- .../skins/default/xui/en/sidepanel_inventory.xml | 35 ++++++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/indra/llui/llaccordionctrltab.cpp b/indra/llui/llaccordionctrltab.cpp index 9e4849c58b..6afe276379 100644 --- a/indra/llui/llaccordionctrltab.cpp +++ b/indra/llui/llaccordionctrltab.cpp @@ -1022,7 +1022,7 @@ void LLAccordionCtrlTab::updateLayout ( const LLRect& child_rect ) S32 panel_width = child_rect.getWidth(); static LLUICachedControl<S32> scrollbar_size ("UIScrollbarSize", 0); - if(mScrollbar->getVisible() != false) + if(mScrollbar && mScrollbar->getVisible() != false) { panel_top+=mScrollbar->getDocPos(); panel_width-=scrollbar_size; diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index faf5e28bb8..41b9283edc 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -75,12 +75,35 @@ min_height="150" fit_panel="false" title="MARKETPLACE INBOX"> - <view - follows="all" - left="0" - height="40" - top="0" - /> + <panel + follows="all" + left="0" + height="40" + width="250" + top="0" + > + <text + left ="40" + top="15" + height="14" + width="100" + >Just a panel</text> + </panel> + <panel + follows="all" + left="0" + height="40" + visible="false" + width="250" + top="0" + > + <text + left ="40" + top="15" + height="14" + width="100" + >Just a panel 2</text> + </panel> </accordion_tab> <accordion_tab name="tab_attachments" -- cgit v1.2.3 From 95b8020d21b1ad60f82c767df7d7aac019ad8353 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> 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 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<LLPanelMarketplaceInbox> 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<LLPanelMarketplaceInventory> 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<LLPanelMarketplaceOutbox> 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<LLSidepanelInventory> t_inventory("sidepanel_inventory"); @@ -118,10 +119,56 @@ BOOL LLSidepanelInventory::postBuild() back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); } } - + + getChild<LLButton>("inbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + getChild<LLButton>("outbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + + stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); + stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); + getChild<LLButton>("outbox_btn")->setToggleState(false); + getChild<LLButton>("inbox_btn")->setToggleState(false); + return TRUE; } + +void LLSidepanelInventory::onToggleInboxBtn() +{ + LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + bool collapse = !getChild<LLButton>("inbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), collapse); + } + if (!collapse) + { + stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); + getChild<LLButton>("outbox_btn")->setToggleState(false); + } +} + +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + bool collapse = !getChild<LLButton>("outbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), collapse); + } + + if (!collapse) + { + stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); + getChild<LLButton>("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 <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" /> + <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> + <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="22" scale.top="16" scale.right="26" scale.bottom="7" /> <texture name="Microphone_On" file_name="icons/Microphone_On.png" preload="false" /> 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"> <layout_panel width="330" follows="bottom|left|right" - height="445"> + height="480"> <panel class="panel_main_inventory" filename="panel_main_inventory.xml" @@ -41,92 +41,119 @@ name="panel_main_inventory" top="0" label="" - height="445" + height="480" width="330" /> </layout_panel> <layout_panel width="330" + auto_resize="true" follows="bottom|left|right" - height="100"> + min_dim="35" + name="inbox_layout_panel" + max_dim="125" + height="35"> <panel - class="panel_marketplace_inventory" - follows="all" + follows="top|left|right" layout="topleft" left="0" - name="panel_marketplace" + name="marketplace_inbox" + class="panel_marketplace_inbox" top="0" label="" - height="100" + height="125" width="330"> - <accordion - follows="all" - fit_parent="true" - height="100" - left="10" - single_expansion="true" - top="0" - name="accordion" - background_visible="true" - bg_alpha_color="DkGray2" - width="311"> - <accordion_tab - name="tab_clothing" - height="35" - min_height="150" - fit_panel="false" - title="MARKETPLACE INBOX"> + <button + label="MARKETPLACE INBOX" + name="inbox_btn" + height="35" + width="308" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + halign="left" + follows="top|left|right" + is_toggle="true" + tab_stop="false" + pad_left="35" + top="0" + left="10" + ></button> <panel follows="all" left="0" - height="40" + height="90" width="250" - top="0" + top="30" > <text left ="40" top="15" + align="left" height="14" width="100" >Just a panel</text> </panel> - <panel - follows="all" - left="0" - height="40" - visible="false" - width="250" - top="0" + + </panel> + </layout_panel> + <layout_panel + width="330" + auto_resize="true" + follows="bottom|left|right" + name="outbox_layout_panel" + min_dim="35" + max_dim="125" + height="35"> + <panel + follows="top|left|right" + layout="topleft" + left="10" + name="marketplace_outbox" + class="panel_marketplace_outbox" + top="0" + label="" + height="125" + width="310"> + <button + label="MARKETPLACE OUTBOX" + is_toggle="true" + name="outbox_btn" + follows="top|left|right" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + height="35" + tab_stop="false" + width="308" + halign="left" + pad_left="35" + top="0" + left="0" + ></button> + <panel + follows="all" + left="0" + height="90" + width="250" + top="30" > - <text - left ="40" - top="15" - height="14" - width="100" - >Just a panel 2</text> - </panel> - </accordion_tab> - <accordion_tab - name="tab_attachments" - fit_panel="false" - title="MARKETPLACE OUTBOX"> - <view - follows="all" - height="35" - left="0" - top="0" - /> - </accordion_tab> - </accordion> + <text + left ="40" + top="15" + align="left" + height="14" + width="100" + >Just a panel</text> + </panel> + </panel> </layout_panel> </layout_stack> <panel follows="bottom|left|right" - height="25" + height="30" layout="topleft" name="button_panel" left="9" - top_pad="-2" + top_pad="2" width="308"> <layout_stack follows="bottom|left|right" -- cgit v1.2.3 From 406195e4f20e0bea341c8a7a979b56a8259b8536 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Tue, 24 May 2011 09:38:49 -0700 Subject: Added badges version 0.1 to buttons. Reviewed by Richard --- indra/llcommon/lldate.h | 2 + indra/llui/CMakeLists.txt | 2 + indra/llui/llbadge.cpp | 263 +++++++++++++++++++++ indra/llui/llbadge.h | 152 ++++++++++++ indra/llui/llbutton.cpp | 94 +++++++- indra/llui/llbutton.h | 12 +- indra/llxuixml/llinitparam.h | 2 + indra/newview/skins/default/colors.xml | 6 + indra/newview/skins/default/textures/textures.xml | 2 + .../skins/default/textures/widgets/Badge.png | Bin 0 -> 1716 bytes .../newview/skins/default/xui/en/widgets/badge.xml | 14 ++ 11 files changed, 543 insertions(+), 6 deletions(-) create mode 100644 indra/llui/llbadge.cpp create mode 100644 indra/llui/llbadge.h create mode 100644 indra/newview/skins/default/textures/widgets/Badge.png create mode 100644 indra/newview/skins/default/xui/en/widgets/badge.xml diff --git a/indra/llcommon/lldate.h b/indra/llcommon/lldate.h index 7ff8b550ad..f2bf2366ac 100644 --- a/indra/llcommon/lldate.h +++ b/indra/llcommon/lldate.h @@ -34,6 +34,8 @@ #include "stdtypes.h" +#include "llpreprocessor.h" + /** * @class LLDate * @brief This class represents a particular point in time in UTC. diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 33ab2e93b5..fb585e062c 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -28,6 +28,7 @@ include_directories( set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp + llbadge.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -119,6 +120,7 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h + llbadge.h llbutton.h llcallbackmap.h llcheckboxctrl.h diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp new file mode 100644 index 0000000000..ea934aa93b --- /dev/null +++ b/indra/llui/llbadge.cpp @@ -0,0 +1,263 @@ +/** + * @file llbadge.cpp + * @brief Implementation for badges + * + * $LicenseInfo:firstyear=2001&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$ + */ + +#define LLBADGE_CPP +#include "llbadge.h" + +#include "lluictrlfactory.h" + + +static LLDefaultChildRegistry::Register<LLBadge> r("badge"); + +// Compiler optimization, generate extern template +template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const; + + +LLBadge::Params::Params() + : image("image") + , image_color("image_color") + , label("label") + , label_color("label_color") + , location("location", LLRelPos::TOP_LEFT) + , location_percent_hcenter("location_percent_hcenter") + , location_percent_vcenter("location_percent_vcenter") + , padding_horiz("padding_horiz") + , padding_vert("padding_vert") +{ + // We set a name here so the name isn't necessary in any xml files that use badges + name = "badge"; +} + +bool LLBadge::Params::equals(const Params& a) const +{ + bool comp = true; + + // skip owner in comparison on purpose + + comp &= (image() == a.image()); + comp &= (image_color() == a.image_color()); + comp &= (label() == a.label()); + comp &= (label_color() == a.label_color()); + comp &= (location() == a.location()); + comp &= (location_percent_hcenter() == a.location_percent_hcenter()); + comp &= (location_percent_vcenter() == a.location_percent_vcenter()); + comp &= (padding_horiz() == a.padding_horiz()); + comp &= (padding_vert() == a.padding_vert()); + + return comp; +} + +LLBadge::LLBadge(const LLBadge::Params& p) + : LLUICtrl(p) + , mOwner(p.owner) + , mGLFont(p.font) + , mImage(p.image) + , mImageColor(p.image_color) + , mLabel(p.label) + , mLabelColor(p.label_color) + , mLocation(p.location) + , mLocationPercentHCenter(0.5f) + , mLocationPercentVCenter(0.5f) + , mPaddingHoriz(p.padding_horiz) + , mPaddingVert(p.padding_vert) +{ + if (mImage.isNull()) + { + llwarns << "Badge: " << getName() << " with no image!" << llendl; + } + + // + // The following logic is to set the mLocationPercentHCenter and mLocationPercentVCenter + // based on the Location enum and our horizontal and vertical location percentages. The + // draw code then uses this on the owner rectangle to compute the screen location for + // the badge. + // + + if (!LLRelPos::IsCenter(mLocation)) + { + F32 h_center = p.location_percent_hcenter * 0.01f; + F32 v_center = p.location_percent_vcenter * 0.01f; + + if (LLRelPos::IsRight(mLocation)) + { + mLocationPercentHCenter = 0.5f * (1.0f + h_center); + } + else if (LLRelPos::IsLeft(mLocation)) + { + mLocationPercentHCenter = 0.5f * (1.0f - h_center); + } + + if (LLRelPos::IsTop(mLocation)) + { + mLocationPercentVCenter = 0.5f * (1.0f + v_center); + } + else if (LLRelPos::IsBottom(mLocation)) + { + mLocationPercentVCenter = 0.5f * (1.0f - v_center); + } + } +} + +LLBadge::~LLBadge() +{ +} + +void LLBadge::setLabel(const LLStringExplicit& label) +{ + mLabel = label; +} + +// +// This is a fallback function to render a rectangle for badges without a valid image +// +void renderBadgeBackground(F32 centerX, F32 centerY, F32 width, F32 height, const LLColor4U &color) +{ + gGL.pushUIMatrix(); + gGL.loadUIIdentity(); + gGL.setSceneBlendType(LLRender::BT_REPLACE); + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + + gGL.color4ubv(color.mV); + gGL.texCoord2i(0, 0); + + F32 x = LLFontGL::sCurOrigin.mX + centerX - width * 0.5f; + F32 y = LLFontGL::sCurOrigin.mY + centerY - height * 0.5f; + + LLRectf screen_rect(llround(x), + llround(y), + llround(x) + width, + llround(y) + height); + + LLVector3 vertices[4]; + vertices[0] = LLVector3(screen_rect.mRight, screen_rect.mTop, 1.0f); + vertices[1] = LLVector3(screen_rect.mLeft, screen_rect.mTop, 1.0f); + vertices[2] = LLVector3(screen_rect.mLeft, screen_rect.mBottom, 1.0f); + vertices[3] = LLVector3(screen_rect.mRight, screen_rect.mBottom, 1.0f); + + gGL.begin(LLRender::QUADS); + { + gGL.vertexBatchPreTransformed(vertices, 4); + } + gGL.end(); + + gGL.popUIMatrix(); +} + + +// virtual +void LLBadge::draw() +{ + if (!mLabel.empty()) + { + LLUICtrl* owner_ctrl = mOwner.get(); + + if (owner_ctrl) + { + // + // Calculate badge position based on owner + // + + LLRect owner_rect; + owner_ctrl->localRectToOtherView(owner_ctrl->getLocalRect(), & owner_rect, this); + + F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter; + F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; + + // + // Calculate badge size based on label text + // + + LLWString badge_label_wstring = mLabel; + + S32 badge_label_begin_offset = 0; + S32 badge_char_length = S32_MAX; + S32 badge_pixel_length = S32_MAX; + F32 *right_position_out = NULL; + BOOL do_not_use_ellipses = false; + + F32 badge_width = (2.0f * mPaddingHoriz) + + mGLFont->getWidthF32(badge_label_wstring.c_str(), badge_label_begin_offset, badge_char_length); + + F32 badge_height = (2.0f * mPaddingVert) + mGLFont->getLineHeight(); + + // + // Draw button image, if available. + // Otherwise draw basic rectangular button. + // + + F32 alpha = getDrawContext().mAlpha; + + if (!mImage.isNull()) + { + F32 badge_x = badge_center_x - badge_width * 0.5f; + F32 badge_y = badge_center_y - badge_height * 0.5f; + + mImage->drawSolid(badge_x, badge_y, badge_width, badge_height, mImageColor % alpha); + } + else + { + lldebugs << "No image for badge " << getName() << " on owner " << owner_ctrl->getName() << llendl; + + renderBadgeBackground(badge_center_x, badge_center_y, + badge_width, badge_height, + mImageColor % alpha); + } + + // + // Draw the label + // + + mGLFont->render(badge_label_wstring, badge_label_begin_offset, + badge_center_x, badge_center_y, + mLabelColor % alpha, + LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position + LLFontGL::NORMAL, // normal text (not bold, italics, etc.) + LLFontGL::DROP_SHADOW_SOFT, + badge_char_length, badge_pixel_length, + right_position_out, do_not_use_ellipses); + } + } +} + + +namespace LLInitParam +{ + void TypeValues<LLRelPos::Location>::declareValues() + { + declare("bottom", LLRelPos::BOTTOM); + declare("bottom_left", LLRelPos::BOTTOM_LEFT); + declare("bottom_right", LLRelPos::BOTTOM_RIGHT); + declare("center", LLRelPos::CENTER); + declare("left", LLRelPos::LEFT); + declare("right", LLRelPos::RIGHT); + declare("top", LLRelPos::TOP); + declare("top_left", LLRelPos::TOP_LEFT); + declare("top_right", LLRelPos::TOP_RIGHT); + } +} + + +// eof diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h new file mode 100644 index 0000000000..c2e0a763b2 --- /dev/null +++ b/indra/llui/llbadge.h @@ -0,0 +1,152 @@ +/** + * @file llbadge.h + * @brief Header for badges + * + * $LicenseInfo:firstyear=2001&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_LLBADGE_H +#define LL_LLBADGE_H + +#include <string> + +#include "lluicolor.h" +#include "lluictrl.h" +#include "llstring.h" +#include "lluiimage.h" + +// +// Declarations +// + +class LLUICtrlFactory; +class LLFontGL; + +// +// Relative Position Alignment +// + +namespace LLRelPos +{ + enum Location + { + CENTER = 0, + + LEFT = (1 << 0), + RIGHT = (1 << 1), + + TOP = (1 << 2), + BOTTOM = (1 << 3), + + BOTTOM_LEFT = (BOTTOM | LEFT), + BOTTOM_RIGHT = (BOTTOM | RIGHT), + + TOP_LEFT = (TOP | LEFT), + TOP_RIGHT = (TOP | RIGHT), + }; + + inline bool IsBottom(Location relPos) { return (relPos & BOTTOM) == BOTTOM; } + inline bool IsCenter(Location relPos) { return (relPos == CENTER); } + inline bool IsLeft(Location relPos) { return (relPos & LEFT) == LEFT; } + inline bool IsRight(Location relPos) { return (relPos & RIGHT) == RIGHT; } + inline bool IsTop(Location relPos) { return (relPos & TOP) == TOP; } +} + +// NOTE: This needs to occur before Optional<LLRelPos::Location> declaration for proper compilation. +namespace LLInitParam +{ + template<> + struct TypeValues<LLRelPos::Location> : public TypeValuesHelper<LLRelPos::Location> + { + static void declareValues(); + }; +} + +// +// Classes +// + +class LLBadge +: public LLUICtrl +{ +public: + struct Params + : public LLInitParam::Block<Params, LLUICtrl::Params> + { + Optional< LLHandle<LLUICtrl> > owner; // Mandatory in code but not in xml + + Optional< LLUIImage* > image; + Optional< LLUIColor > image_color; + + Optional< std::string > label; + Optional< LLUIColor > label_color; + + Optional< LLRelPos::Location > location; + Optional< U32 > location_percent_hcenter; + Optional< U32 > location_percent_vcenter; + + Optional< F32 > padding_horiz; + Optional< F32 > padding_vert; + + Params(); + + bool equals(const Params&) const; + }; + +protected: + friend class LLUICtrlFactory; + LLBadge(const Params& p); + +public: + + ~LLBadge(); + + virtual void draw(); + + const std::string getLabel() const { return wstring_to_utf8str(mLabel); } + void setLabel( const LLStringExplicit& label); + +private: + const LLFontGL* mGLFont; + + LLPointer< LLUIImage > mImage; + LLUIColor mImageColor; + + LLUIString mLabel; + LLUIColor mLabelColor; + + LLRelPos::Location mLocation; + F32 mLocationPercentHCenter; + F32 mLocationPercentVCenter; + + LLHandle< LLUICtrl > mOwner; + + F32 mPaddingHoriz; + F32 mPaddingVert; +}; + +// Build time optimization, generate once in .cpp file +#ifndef LLBADGE_CPP +extern template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, BOOL recurse) const; +#endif + +#endif // LL_LLBADGE_H diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 45ceaff696..a63281b3c1 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -56,6 +56,9 @@ static LLDefaultChildRegistry::Register<LLButton> r("button"); template class LLButton* LLView::getChild<class LLButton>( const std::string& name, BOOL recurse) const; + + + // globals loaded from settings.xml S32 LLBUTTON_H_PAD = 0; S32 BTN_HEIGHT_SMALL= 0; @@ -99,7 +102,8 @@ LLButton::Params::Params() scale_image("scale_image", true), hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), - use_draw_context_alpha("use_draw_context_alpha", true) + use_draw_context_alpha("use_draw_context_alpha", true), + badge("badge") { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -160,8 +164,8 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownSignal(NULL), mMouseUpSignal(NULL), mHeldDownSignal(NULL), - mUseDrawContextAlpha(p.use_draw_context_alpha) - + mUseDrawContextAlpha(p.use_draw_context_alpha), + mBadge(NULL) { static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>()); @@ -244,6 +248,17 @@ LLButton::LLButton(const LLButton::Params& p) { setHeldDownCallback(initCommitCallback(p.mouse_held_callback)); } + + // Only create a badge here if a non-default one was provided. + if (p.badge.isProvided()) + { + if (!p.badge().equals(LLUICtrlFactory::getDefaultParams<LLBadge>())) + { + LLBadge::Params badge_params(p.badge()); + badge_params.owner = getUICtrlHandle(); + mBadge = LLUICtrlFactory::create<LLBadge>(badge_params); + } + } } LLButton::~LLButton() @@ -327,6 +342,13 @@ boost::signals2::connection LLButton::setHeldDownCallback( button_callback_t cb, BOOL LLButton::postBuild() { autoResize(); + + // Attach the badge to the appropriate parent panel + if (mBadge) + { + addBadgeToParentPanel(); + } + return TRUE; } BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) @@ -867,7 +889,7 @@ void LLButton::draw() S32_MAX, text_width, NULL, mUseEllipses); } - + LLUICtrl::draw(); } @@ -1063,6 +1085,70 @@ void LLButton::setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignmen } } +void LLButton::addBadgeToParentPanel() +{ + if (mBadge) + { + // Find the appropriate parent panel for the badge + + LLPanel * parentPanel = NULL; + LLUICtrl * parent = getParentUICtrl(); + + while (parent) + { + parentPanel = dynamic_cast<LLPanel*>(parent); + + if (parentPanel != NULL) + { + break; + } + + parent = parent->getParentUICtrl(); + } + + if (parentPanel) + { + parentPanel->addChild(mBadge); + } + else + { + llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on button " << getName() << llendl; + } + } + else + { + llwarns << "Unable to add NULL badge to button " << getName() << llendl; + } +} + +void LLButton::setBadgeLabel(const LLStringExplicit& label) +{ + if (mBadge == NULL) + { + LLBadge::Params badge_params(LLUICtrlFactory::getDefaultParams<LLBadge>()); + badge_params.owner = getUICtrlHandle(); + mBadge = LLUICtrlFactory::create<LLBadge>(badge_params); + + addBadgeToParentPanel(); + } + + if (mBadge) + { + mBadge->setLabel(label); + + // + // Push the badge to the front so it renders last + // + + LLUICtrl * parent = mBadge->getParentUICtrl(); + + if (parent) + { + parent->sendChildToFront(mBadge); + } + } +} + void LLButton::onMouseCaptureLost() { resetMouseDownTimer(); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 0cfc393e05..232ab81e0d 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -27,6 +27,8 @@ #ifndef LL_LLBUTTON_H #define LL_LLBUTTON_H +#include "lluuid.h" +#include "llbadge.h" #include "llcontrol.h" #include "lluictrl.h" #include "v4color.h" @@ -52,8 +54,6 @@ S32 round_up(S32 grid, S32 value); class LLUICtrlFactory; -class LLUIImage; -class LLUUID; // // Classes @@ -126,6 +126,8 @@ public: Optional<TimeIntervalParam> held_down_delay; Optional<bool> use_draw_context_alpha; + + Optional<LLBadge::Params> badge; Params(); }; @@ -249,6 +251,8 @@ public: void setImageDisabledSelected(LLPointer<LLUIImage> image); void setImageFlash(LLPointer<LLUIImage> image); void setImagePressed(LLPointer<LLUIImage> image); + + void setBadgeLabel(const LLStringExplicit& label); void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } BOOL getCommitOnReturn() const { return mCommitOnReturn; } @@ -267,6 +271,8 @@ protected: LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; } LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; } + void addBadgeToParentPanel(); + LLFrameTimer mMouseDownTimer; private: @@ -357,6 +363,8 @@ private: bool mForcePressedState; LLFrameTimer mFlashingTimer; + + LLBadge* mBadge; }; // Build time optimization, generate once in .cpp file diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index a853999e94..ce7cb5b3e0 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -34,6 +34,8 @@ #include <boost/unordered_map.hpp> #include <boost/shared_ptr.hpp> +#include "llerror.h" + namespace LLInitParam { template<typename T> const T& defaultValue() { static T value; return value; } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index a19eccf748..0795e38366 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -132,6 +132,12 @@ <color name="AvatarListItemIconVoiceLeftColor" reference="AvatarListItemIconOfflineColor" /> + <color + name="BadgeImageColor" + value="0.25 0.85 0.25 1.0" /> + <color + name="BadgeLabelColor" + reference="White" /> <color name="ButtonBorderColor" reference="Unused?" /> diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4f19dd9a6d..2a78337f65 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -72,6 +72,8 @@ with the same filename but different name <texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> <texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> + <texture name="Badge" file_name="widgets/Badge.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="Blank" file_name="Blank.png" preload="false" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png new file mode 100644 index 0000000000..afda6b66b9 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge.png differ diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml new file mode 100644 index 0000000000..4eb633ac0c --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- Additional attributes: + --> +<badge font="SansSerifSmall" + image="Badge" + image_color="BadgeImageColor" + label_color="BadgeLabelColor" + location="top_left" + location_percent_hcenter="85" + location_percent_vcenter="85" + padding_horiz="7" + padding_vert="4" + > +</badge> -- cgit v1.2.3 From 610b15aee47c5fae9df45b2d5ae515fd06b5a536 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 25 May 2011 10:30:44 -0700 Subject: Updated badge to different art that is opaque --- indra/newview/skins/default/textures/widgets/Badge.png | Bin 1716 -> 958 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png index afda6b66b9..862b13d219 100644 Binary files a/indra/newview/skins/default/textures/widgets/Badge.png and b/indra/newview/skins/default/textures/widgets/Badge.png differ -- cgit v1.2.3 From 33e4a2c7b1ab3a06f1adb5edd9850523c897ea77 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 25 May 2011 10:39:34 -0700 Subject: Updated Marketplace Inbox & Outbox panel to maintain size when one is expanded vs the other --- indra/llui/lllayoutstack.cpp | 18 +- indra/llui/lllayoutstack.h | 4 + indra/newview/llsidepanelinventory.cpp | 49 +-- .../skins/default/xui/en/sidepanel_inventory.xml | 403 +++++++++++---------- 4 files changed, 248 insertions(+), 226 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 9b6830a816..8a92796942 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -78,20 +78,20 @@ LLLayoutPanel::~LLLayoutPanel() delete mResizeBar; mResizeBar = NULL; } - + F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation) { if (orientation == LLLayoutStack::HORIZONTAL) { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); return mVisibleAmt * collapse_amt; } else { - F32 collapse_amt = + F32 collapse_amt = clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight()))); - return mVisibleAmt * collapse_amt; + return mVisibleAmt * collapse_amt; } } @@ -182,14 +182,14 @@ BOOL LLLayoutStack::postBuild() } bool LLLayoutStack::addChild(LLView* child, S32 tab_group) - { +{ LLLayoutPanel* panelp = dynamic_cast<LLLayoutPanel*>(child); - if (panelp) - { + if (panelp) + { mPanels.push_back(panelp); - } + } return LLView::addChild(child, tab_group); - } +} S32 LLLayoutStack::getDefaultHeight(S32 cur_height) diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 4ac8ef0ee9..2fc2cf3eb4 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -177,6 +177,10 @@ public: ~LLLayoutPanel(); void initFromParams(const Params& p); + + S32 getMinDim() const { return mMinDim; } + S32 getMaxDim() const { return mMaxDim; } + void setMinDim(S32 value) { mMinDim = value; } void setMaxDim(S32 value) { mMaxDim = value; } diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 7f5a2e64bf..9247611257 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -134,38 +134,45 @@ BOOL LLSidepanelInventory::postBuild() } -void LLSidepanelInventory::onToggleInboxBtn() +void manageInboxOutboxPanels(LLLayoutStack * stack, + LLButton * pressedButton, LLLayoutPanel * pressedPanel, + LLButton * otherButton, LLLayoutPanel * otherPanel) { - LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); - bool collapse = !getChild<LLButton>("inbox_btn")->getToggleState(); + bool expand = pressedButton->getToggleState(); + bool otherExpanded = otherButton->getToggleState(); - if (stack) - { - stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), collapse); - } - if (!collapse) + if (expand && otherExpanded) { - stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); - getChild<LLButton>("outbox_btn")->setToggleState(false); + // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size + pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight()); + + stack->collapsePanel(otherPanel, true); + otherButton->setToggleState(false); } + + stack->collapsePanel(pressedPanel, !expand); } -void LLSidepanelInventory::onToggleOutboxBtn() +void LLSidepanelInventory::onToggleInboxBtn() { LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); - bool collapse = !getChild<LLButton>("outbox_btn")->getToggleState(); + LLButton* pressedButton = getChild<LLButton>("inbox_btn"); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("inbox_layout_panel"); + LLButton* otherButton = getChild<LLButton>("outbox_btn"); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("outbox_layout_panel"); - if (stack) - { - stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), collapse); - } + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); +} - if (!collapse) - { - stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); - getChild<LLButton>("inbox_btn")->setToggleState(false); - } +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + LLButton* pressedButton = getChild<LLButton>("outbox_btn"); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("outbox_layout_panel"); + LLButton* otherButton = getChild<LLButton>("inbox_btn"); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("inbox_layout_panel"); + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); } diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index a0caf80256..ce5cf4c622 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -9,170 +9,181 @@ min_width="240" name="objects panel" width="333"> - <panel - follows="all" - layout="topleft" - left="0" - name="sidepanel__inventory_panel" - top="0" - label="" - height="570" - visible="true" - width="330"> - <layout_stack - follows="left|right|top|bottom" - layout="topleft" - left="0" - top="0" - orientation="vertical" - name="inventory_layout_stack" - height="540" - width="330"> - <layout_panel - width="330" - follows="bottom|left|right" - height="480"> - <panel - class="panel_main_inventory" - filename="panel_main_inventory.xml" - follows="all" - layout="topleft" - left="0" - name="panel_main_inventory" - top="0" - label="" - height="480" - width="330" /> - </layout_panel> - <layout_panel - width="330" - auto_resize="true" - follows="bottom|left|right" - min_dim="35" - name="inbox_layout_panel" - max_dim="125" - height="35"> - <panel - follows="top|left|right" - layout="topleft" - left="0" - name="marketplace_inbox" - class="panel_marketplace_inbox" - top="0" - label="" - height="125" - width="330"> - <button - label="MARKETPLACE INBOX" - name="inbox_btn" - height="35" - width="308" - image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" - halign="left" - follows="top|left|right" - is_toggle="true" - tab_stop="false" - pad_left="35" - top="0" - left="10" - ></button> - <panel - follows="all" - left="0" - height="90" - width="250" - top="30" - > - <text - left ="40" - top="15" - align="left" - height="14" - width="100" - >Just a panel</text> - </panel> - - </panel> - </layout_panel> - <layout_panel - width="330" - auto_resize="true" - follows="bottom|left|right" - name="outbox_layout_panel" - min_dim="35" - max_dim="125" - height="35"> - <panel - follows="top|left|right" - layout="topleft" - left="10" - name="marketplace_outbox" - class="panel_marketplace_outbox" - top="0" - label="" - height="125" - width="310"> - <button - label="MARKETPLACE OUTBOX" - is_toggle="true" - name="outbox_btn" - follows="top|left|right" - image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" - height="35" - tab_stop="false" - width="308" - halign="left" - pad_left="35" - top="0" - left="0" - ></button> - <panel - follows="all" - left="0" - height="90" - width="250" - top="30" + <panel + follows="all" + layout="topleft" + left="0" + name="sidepanel__inventory_panel" + top="0" + label="" + height="570" + visible="true" + width="330"> + <layout_stack + follows="left|right|top|bottom" + layout="topleft" + left="0" + top="0" + orientation="vertical" + name="inventory_layout_stack" + height="535" + width="330"> + <layout_panel + width="330" + follows="bottom|left|right" + height="480"> + <panel + class="panel_main_inventory" + filename="panel_main_inventory.xml" + follows="all" + layout="topleft" + left="0" + name="panel_main_inventory" + top="0" + label="" + height="480" + width="330" /> + </layout_panel> + <layout_panel + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + min_dim="35" + name="inbox_layout_panel" + max_dim="125" + height="35"> + <panel + follows="top|left|right" + layout="topleft" + left="0" + name="marketplace_inbox" + class="panel_marketplace_inbox" + top="0" + label="" + height="125" + width="330"> + <button + label="MARKETPLACE INBOX" + name="inbox_btn" + height="35" + width="308" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + halign="left" + follows="top|left|right" + is_toggle="true" + tab_stop="false" + pad_left="35" + top="0" + left="10" /> + <panel + follows="all" + left="0" + height="90" + width="250" + top="30" + > + <text + left ="40" + top="15" + align="left" + height="14" + width="100" + >Just a panel</text> + </panel> + </panel> + </layout_panel> + <layout_panel + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + name="outbox_layout_panel" + min_dim="35" + max_dim="125" + height="35"> + <panel + follows="top|left|right" + layout="topleft" + left="10" + name="marketplace_outbox" + class="panel_marketplace_outbox" + top="0" + label="" + height="125" + width="310"> + <button + label="MARKETPLACE OUTBOX" + is_toggle="true" + name="outbox_btn" + follows="top|left|right" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + height="35" + tab_stop="false" + width="308" + halign="left" + pad_left="35" + top="0" + left="0" /> + <button + label="SYNC" + is_toggle="false" + name="outbox_sync_btn" + follows="top|right" + height="25" + tab_stop="false" + width="45" + halign="center" + top="5" + left="-50" + enabled="false" /> + <panel + follows="all" + left="0" + height="90" + width="250" + top="30" > - <text - left ="40" - top="15" - align="left" - height="14" - width="100" + <text + left ="40" + top="15" + align="left" + height="14" + width="100" >Just a panel</text> - </panel> + </panel> - </panel> - </layout_panel> - </layout_stack> - <panel - follows="bottom|left|right" - height="30" - layout="topleft" - name="button_panel" - left="9" - top_pad="2" - width="308"> - <layout_stack - follows="bottom|left|right" - height="23" - layout="topleft" - mouse_opaque="false" - name="button_panel_ls" - left="0" - orientation="horizontal" - top="0" - width="308"> - <layout_panel - follows="bottom|left|right" - height="23" + </panel> + </layout_panel> + </layout_stack> + <panel + follows="bottom|left|right" + height="30" + layout="topleft" + name="button_panel" + left="9" + top_pad="7" + width="308"> + <layout_stack + follows="bottom|left|right" + height="23" + layout="topleft" + mouse_opaque="false" + name="button_panel_ls" + left="0" + orientation="horizontal" + top="0" + width="308"> + <layout_panel + follows="bottom|left|right" + height="23" layout="bottomleft" - left="0" + left="0" mouse_opaque="false" name="info_btn_lp" - user_resize="false" + user_resize="false" auto_resize="true" width="101"> <button @@ -186,15 +197,15 @@ tool_tip="Show object profile" top="0" width="100" /> - </layout_panel> - <layout_panel + </layout_panel> + <layout_panel follows="bottom|left|right" height="23" layout="bottomleft" - left_pad="1" + left_pad="1" mouse_opaque="false" name="share_btn_lp" - user_resize="false" + user_resize="false" auto_resize="true" width="100"> <button @@ -208,15 +219,15 @@ tool_tip="Share an inventory item" top="0" width="99" /> - </layout_panel> - <layout_panel + </layout_panel> + <layout_panel follows="bottom|left|right" height="23" layout="bottomleft" - left_pad="1" + left_pad="1" mouse_opaque="false" name="shop_btn_lp" - user_resize="false" + user_resize="false" auto_resize="true" width="100"> <button @@ -262,36 +273,36 @@ tool_tip="Teleport to the selected area" top="0" width="99" /> - </layout_panel> - </layout_stack> - </panel> - </panel> + </layout_panel> + </layout_stack> + </panel> + </panel> -<panel - follows="all" - layout="topleft" - left="0" - class="sidepanel_item_info" - filename="sidepanel_item_info.xml" - name="sidepanel__item_panel" - top="0" - label="" - height="570" - visible="false" - width="330"> - </panel> + <panel + follows="all" + layout="topleft" + left="0" + class="sidepanel_item_info" + filename="sidepanel_item_info.xml" + name="sidepanel__item_panel" + top="0" + label="" + height="570" + visible="false" + width="330"> + </panel> -<panel - follows="all" - layout="topleft" - left="0" - class="sidepanel_task_info" - filename="sidepanel_task_info.xml" - name="sidepanel__task_panel" - top="0" - label="" - height="570" - visible="false" - width="330"> - </panel> + <panel + follows="all" + layout="topleft" + left="0" + class="sidepanel_task_info" + filename="sidepanel_task_info.xml" + name="sidepanel__task_panel" + top="0" + label="" + height="570" + visible="false" + width="330"> + </panel> </panel> -- cgit v1.2.3 From f8907b327bb0009047b9cef54fde3d7dc6e8d6ca Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 25 May 2011 11:17:47 -0700 Subject: hooking up marketplace inbox to inventory --- indra/newview/llfolderviewitem.cpp | 8 ++++-- indra/newview/llviewerfoldertype.cpp | 24 +++++++++++++--- indra/newview/llviewerfoldertype.h | 1 + indra/newview/skins/default/textures/textures.xml | 2 +- .../textures/widgets/MarketplaceBtn_Off.png | Bin 711 -> 1067 bytes .../textures/widgets/MarketplaceBtn_Selected.png | Bin 702 -> 1086 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 32 ++++++++++++++------- 7 files changed, 49 insertions(+), 18 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index e9d1ad3a9e..d2bbfa2c2b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -30,6 +30,7 @@ // viewer includes #include "llfolderview.h" // Items depend extensively on LLFolderViews #include "llfoldervieweventlistener.h" +#include "llviewerfoldertype.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" #include "llinventorymodelbackgroundfetch.h" @@ -1190,8 +1191,11 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } else { - folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? - (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + bool is_hidden = folderp->getListener() && LLViewerFolderType::lookupIsHiddenType(folderp->getListener()->getPreferredType()); + + folderp->setVisible( !is_hidden && + (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? + (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation)))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index de1c8d14a8..1623357c90 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -40,6 +40,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry const std::string &icon_name_open, // name of the folder icon const std::string &icon_name_closed, BOOL is_quiet, // folder doesn't need a UI update when changed + bool is_hidden = false, const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank ) : @@ -47,7 +48,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry mNewCategoryName(new_category_name), mIconNameOpen(icon_name_open), mIconNameClosed(icon_name_closed), - mIsQuiet(is_quiet) + mIsQuiet(is_quiet), + mIsHidden(is_hidden) { mAllowedNames.clear(); } @@ -66,7 +68,8 @@ struct ViewerFolderEntry : public LLDictionaryEntry */ mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"), mNewCategoryName(new_category_name), - mIsQuiet(FALSE) + mIsQuiet(FALSE), + mIsHidden(false) { const std::string delims (","); LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims); @@ -91,6 +94,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry typedef std::vector<std::string> name_vec_t; name_vec_t mAllowedNames; BOOL mIsQuiet; + bool mIsHidden; }; class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>, @@ -126,9 +130,9 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_CURRENT_OUTFIT, new ViewerFolderEntry("Current Outfit", "Inv_SysOpen", "Inv_SysClosed", TRUE)); addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "Inv_LookFolderOpen", "Inv_LookFolderClosed", TRUE)); addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE)); - addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); - addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, "default")); + addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); #if SUPPORT_ENSEMBLES initEnsemblesFromFile(); @@ -255,6 +259,18 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) } +BOOL LLViewerFolderType::lookupIsHiddenType(LLFolderType::EType folder_type) +{ + const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); + if (entry) + { + return entry->mIsHidden; + } + return FALSE; +} + + + const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type) { const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h index f5938de619..a348274e8f 100644 --- a/indra/newview/llviewerfoldertype.h +++ b/indra/newview/llviewerfoldertype.h @@ -40,6 +40,7 @@ public: static const std::string& lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured + static BOOL lookupIsHiddenType(EType folder_type); // folder doesn't require UI update when changes have occured static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4f19dd9a6d..ec12d996bf 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -250,7 +250,7 @@ with the same filename but different name <texture name="Locked_Icon" file_name="icons/Locked_Icon.png" preload="false" /> <texture name="MarketplaceBtn_Off" file_name="widgets/MarketplaceBtn_Off.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> - <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="22" scale.top="16" scale.right="26" scale.bottom="7" /> + <texture name="MarketplaceBtn_Selected" file_name="widgets/MarketplaceBtn_Selected.png" preload="true" scale.left="30" scale.top="19" scale.right="35" scale.bottom="4" /> <texture name="Microphone_On" file_name="icons/Microphone_On.png" preload="false" /> diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png index e291a1c508..e603c44384 100644 Binary files a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png 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 index 33527f852b..fbc164123f 100644 Binary files a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png 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 a0caf80256..7663db2756 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -53,7 +53,7 @@ max_dim="125" height="35"> <panel - follows="top|left|right" + follows="all" layout="topleft" left="0" name="marketplace_inbox" @@ -79,18 +79,28 @@ ></button> <panel follows="all" - left="0" + left="10" height="90" - width="250" - top="30" + width="330" + top="35" > - <text - left ="40" - top="15" - align="left" - height="14" - width="100" - >Just a panel</text> + <inventory_panel + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + follows="all" + height="90" + start_folder="Inbox" + layout="topleft" + left="0" + name="All Items" + sort_order_setting="InventorySortOrder" + show_item_link_overlays="true" + top="0" + width="308" /> </panel> </panel> -- cgit v1.2.3 From bff172b374fa12e646d427e09f2ffac4289ab654 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 30 May 2011 15:38:37 -0700 Subject: EXP-824 Adding volume slider and block btn in basic mode IM panel --- indra/newview/llpanelimcontrolpanel.cpp | 92 +++++++- indra/newview/llpanelimcontrolpanel.h | 6 + .../minimal/xui/en/panel_im_control_panel.xml | 249 ++++++++++++++------- 3 files changed, 257 insertions(+), 90 deletions(-) diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 0cc5dcda82..06c8d496ff 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -99,7 +99,8 @@ void LLPanelChatControlPanel::updateCallButton() void LLPanelChatControlPanel::updateButtons(bool is_call_started) { getChildView("end_call_btn_panel")->setVisible( is_call_started); - getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); + getChildView("volume_ctrl_panel")->setVisible( is_call_started); + getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started && findChild<LLView>("voice_ctrls_btn_panel")); getChildView("call_btn_panel")->setVisible( ! is_call_started); updateCallButton(); @@ -119,9 +120,9 @@ BOOL LLPanelChatControlPanel::postBuild() childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this)); - + LLVoiceClient::getInstance()->addObserver(this); - + return TRUE; } @@ -156,13 +157,93 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); + + childSetAction("mute_btn", boost::bind(&LLPanelIMControlPanel::onClickMuteVolume, this)); + childSetAction("block_btn", boost::bind(&LLPanelIMControlPanel::onClickBlock, this)); + childSetAction("unblock_btn", boost::bind(&LLPanelIMControlPanel::onClickUnblock, this)); + + getChild<LLUICtrl>("volume_slider")->setCommitCallback(boost::bind(&LLPanelIMControlPanel::onVolumeChange, this, _2)); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); - + return LLPanelChatControlPanel::postBuild(); } +void LLPanelIMControlPanel::draw() +{ + bool is_muted = LLMuteList::getInstance()->isMuted(mAvatarID); + + getChild<LLUICtrl>("block_btn_panel")->setVisible(!is_muted); + getChild<LLUICtrl>("unblock_btn_panel")->setVisible(is_muted); + + if (getChildView("volume_ctrl_panel")->getVisible()) + { + + bool is_muted_voice = LLMuteList::getInstance()->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn"); + mute_btn->setValue( is_muted_voice ); + + LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider"); + volume_slider->setEnabled( !is_muted_voice ); + + F32 volume; + + if (is_muted_voice) + { + // it's clearer to display their volume as zero + volume = 0.f; + } + else + { + // actual volume + volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID); + } + volume_slider->setValue( (F64)volume ); + } + + LLPanelChatControlPanel::draw(); +} + +void LLPanelIMControlPanel::onClickMuteVolume() +{ + // By convention, we only display and toggle voice mutes, not all mutes + LLMuteList* mute_list = LLMuteList::getInstance(); + bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + if (!is_muted) + { + mute_list->add(mute, LLMute::flagVoiceChat); + } + else + { + mute_list->remove(mute, LLMute::flagVoiceChat); + } +} + +void LLPanelIMControlPanel::onClickBlock() +{ + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->add(mute); +} + +void LLPanelIMControlPanel::onClickUnblock() +{ + LLMute mute(mAvatarID, getChild<LLTextBox>("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->remove(mute); +} + +void LLPanelIMControlPanel::onVolumeChange(const LLSD& data) +{ + F32 volume = (F32)data.asReal(); + LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume); +} + void LLPanelIMControlPanel::onTeleportButtonClicked() { LLAvatarActions::offerTeleport(mAvatarID); @@ -262,6 +343,9 @@ void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& ful std::string avatar_name = full_name; getChild<LLTextBox>("avatar_name")->setValue(avatar_name); getChild<LLTextBox>("avatar_name")->setToolTip(avatar_name); + + bool is_linden = LLStringUtil::endsWith(full_name, " Linden"); + getChild<LLUICtrl>("mute_btn")->setEnabled( !is_linden); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 3bbe24ecb9..76d4475b74 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -94,6 +94,12 @@ private: void onPayButtonClicked(); void onFocusReceived(); + void onClickMuteVolume(); + void onClickBlock(); + void onClickUnblock(); + /*virtual*/ void draw(); + void onVolumeChange(const LLSD& data); + LLUUID mAvatarID; }; diff --git a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml index be13bc1bb7..a9c7b624fd 100644 --- a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml @@ -23,102 +23,179 @@ orientation="vertical" top_pad="5" width="145"> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="20" - layout="topleft" - left="2" - min_height="20" - width="140" - name="view_profile_btn_panel" - top="0" - user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Profile" - name="view_profile_btn" + <layout_panel + auto_resize="false" + follows="top|left|right" + height="20" + layout="topleft" + left="2" + min_height="20" + width="140" + name="view_profile_btn_panel" top="0" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="add_friend_btn_panel" - user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Add Friend" - name="add_friend_btn" - top="5" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="teleport_btn_panel" - user_resize="false"> - <button - auto_resize="false" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Profile" + name="view_profile_btn" + top="0" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="add_friend_btn_panel" + user_resize="false"> + <button follows="left|top|right" height="23" - label="Teleport" - name="teleport_btn" - tool_tip = "Offer to teleport this person" + label="Add Friend" + name="add_friend_btn" + top="5" width="140" /> - </layout_panel> - <layout_panel + </layout_panel> + <layout_panel auto_resize="false" follows="top|left|right" height="25" layout="topleft" min_height="25" width="140" - name="call_btn_panel" + name="teleport_btn_panel" user_resize="false"> - <button - follows="left|top|right" - height="23" - label="Call" - name="call_btn" - width="140" /> - </layout_panel> - <layout_panel - auto_resize="false" - follows="top|left|right" - height="25" - layout="topleft" - min_height="25" - width="140" - name="end_call_btn_panel" - user_resize="false" - visible="false"> - <button - follows="left|top|right" - height="23" - label="End Call" - name="end_call_btn" - width="140" /> - </layout_panel> - <layout_panel - mouse_opaque="false" - auto_resize="true" - follows="top|left" - height="0" - layout="topleft" - min_height="0" - width="140" - name="spacer" - user_resize="false" /> + <button + auto_resize="false" + follows="left|top|right" + height="23" + label="Teleport" + name="teleport_btn" + tool_tip = "Offer to teleport this person" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="call_btn_panel" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Call" + name="call_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="end_call_btn_panel" + user_resize="false" + visible="false"> + <button + follows="left|top|right" + height="23" + label="End Call" + name="end_call_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="block_btn_panel" + user_resize="false"> + <button + follows="left|top|right" + height="23" + label="Block" + name="block_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="25" + width="140" + name="unblock_btn_panel" + user_resize="false" + visible="false"> + <button + follows="left|top|right" + height="23" + label="Unblock" + name="unblock_btn" + width="140" /> + </layout_panel> + <layout_panel + auto_resize="false" + follows="top|left|right" + height="25" + layout="topleft" + min_height="54" + width="140" + name="volume_ctrl_panel" + visible="false" + user_resize="false"> + <text + follows="left|top|right" + left="5" + top="14" + height="23" + name="volume_ctrl_text" + width="140">Volume Control:</text> + <slider + follows="top|left" + height="23" + increment="0.01" + left="0" + max_val="0.95" + min_val="0.05" + name="volume_slider" + show_text="false" + tool_tip="Voice volume" + top_pad="-5" + value="0.5" + width="125" /> + <button + follows="top|left" + height="16" + image_disabled="Audio_Off" + image_disabled_selected="AudioMute_Off" + image_hover_selected="AudioMute_Over" + image_selected="AudioMute_Off" + image_unselected="Audio_Off" + is_toggle="true" + left_pad="0" + top_delta="4" + name="mute_btn" + width="16" /> + </layout_panel> + <layout_panel + mouse_opaque="false" + auto_resize="true" + follows="top|left" + height="0" + layout="topleft" + min_height="0" + width="140" + name="spacer" + user_resize="false" /> </layout_stack> </panel> -- cgit v1.2.3 From 4415c8505fd5c2bb0af6ec1324cee3d1ef6e8c78 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 30 May 2011 16:42:24 -0700 Subject: Adding the outbox --- indra/llcommon/llfoldertype.cpp | 1 + indra/llcommon/llfoldertype.h | 3 +- indra/newview/llviewerfoldertype.cpp | 1 + .../skins/default/xui/en/sidepanel_inventory.xml | 32 ++++++++++++++-------- 4 files changed, 25 insertions(+), 12 deletions(-) diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index ebc79af412..f5b3883f43 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -90,6 +90,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_OUTFIT, new FolderEntry("outfit", FALSE)); addEntry(LLFolderType::FT_MY_OUTFITS, new FolderEntry("my_otfts", TRUE)); addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE)); + addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index 936fbed17d..71e9338883 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -81,8 +81,9 @@ public: FT_MY_OUTFITS = 48, FT_INBOX = 49, + FT_OUTBOX = 50, - FT_COUNT = 50, + FT_COUNT = 51, FT_NONE = -1 }; diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 1623357c90..7e0e510c07 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -131,6 +131,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_OUTFIT, new ViewerFolderEntry("New Outfit", "Inv_LookFolderOpen", "Inv_LookFolderClosed", TRUE)); addEntry(LLFolderType::FT_MY_OUTFITS, new ViewerFolderEntry("My Outfits", "Inv_SysOpen", "Inv_SysClosed", TRUE)); addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); + addEntry(LLFolderType::FT_OUTBOX, new ViewerFolderEntry("Outbox", "Inv_SysOpen", "Inv_SysClosed", FALSE, true)); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, false, "default")); diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index fa79975669..5f90a74e74 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -96,7 +96,7 @@ start_folder="Inbox" layout="topleft" left="0" - name="All Items" + name="inventory_inbox" sort_order_setting="InventorySortOrder" show_item_link_overlays="true" top="0" @@ -114,7 +114,7 @@ max_dim="125" height="35"> <panel - follows="top|left|right" + follows="all" layout="topleft" left="10" name="marketplace_outbox" @@ -153,16 +153,26 @@ follows="all" left="0" height="90" - width="250" - top="30" + width="330" + top="35" > - <text - left ="40" - top="15" - align="left" - height="14" - width="100" - >Just a panel</text> + <inventory_panel + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + follows="all" + height="90" + start_folder="Outbox" + layout="topleft" + left="0" + name="inventory_outbox" + sort_order_setting="InventorySortOrder" + show_item_link_overlays="true" + top="0" + width="308" /> </panel> </panel> -- cgit v1.2.3 From ee1ba4d85c9e36e1563de5019c6ececa1f1c2d54 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 31 May 2011 15:11:55 -0700 Subject: adding inbox/outbox creation options --- indra/newview/llviewerinventory.cpp | 2 +- .../newview/skins/default/xui/en/menu_inventory_add.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 9e58acdcd3..22666cec0d 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -1269,7 +1269,7 @@ void menu_create_inventory_item(LLFolderView* root, LLFolderBridge *bridge, cons { std::string type_name = userdata.asString(); - if (("category" == type_name) || ("current" == type_name) || ("outfit" == type_name) || ("my_otfts" == type_name)) + if (("inbox" == type_name) || ("outbox" == type_name) || ("category" == type_name) || ("current" == type_name) || ("outfit" == type_name) || ("my_otfts" == type_name)) { LLFolderType::EType preferred_type = LLFolderType::lookup(type_name); diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index 90e8db3709..30eff8e6a7 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -67,6 +67,22 @@ function="Inventory.DoCreate" parameter="category" /> </menu_item_call> + <menu_item_call + label="Inbox" + layout="topleft" + name="Inbox"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="inbox" /> +</menu_item_call> + <menu_item_call + label="Outbox" + layout="topleft" + name="Outbox"> + <menu_item_call.on_click + function="Inventory.DoCreate" + parameter="outbox" /> +</menu_item_call> <menu_item_call label="New Script" layout="topleft" -- cgit v1.2.3 From cbf38d7c95e5968f47850d082eee223e1cef1aff Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 1 Jun 2011 12:28:49 -0700 Subject: EXP-841 FIX -- Create outbox sync button with basic enable/disable logic and animation Functions are stubbed out. Time delay happens through basic coroutine to allow animation viewing. Reviewed by Leyla --- indra/newview/llpanelmarketplaceoutbox.cpp | 93 ++++++++++++++++++++- indra/newview/llpanelmarketplaceoutbox.h | 19 +++++ indra/newview/skins/default/colors.xml | 5 +- .../skins/default/textures/icons/Inv_Gift.png | Bin 0 -> 1335 bytes .../skins/default/textures/icons/Sync_Disabled.png | Bin 0 -> 1187 bytes .../skins/default/textures/icons/Sync_Enabled.png | Bin 0 -> 1168 bytes .../default/textures/icons/Sync_Progress_1.png | Bin 0 -> 1149 bytes .../default/textures/icons/Sync_Progress_2.png | Bin 0 -> 1147 bytes .../default/textures/icons/Sync_Progress_3.png | Bin 0 -> 1211 bytes .../default/textures/icons/Sync_Progress_4.png | Bin 0 -> 1205 bytes .../default/textures/icons/Sync_Progress_5.png | Bin 0 -> 1137 bytes .../default/textures/icons/Sync_Progress_6.png | Bin 0 -> 1164 bytes indra/newview/skins/default/textures/textures.xml | 15 +++- .../skins/default/textures/widgets/Badge.png | Bin 958 -> 0 bytes .../default/textures/widgets/Badge_Background.png | Bin 0 -> 1352 bytes .../default/textures/widgets/Badge_Border.png | Bin 0 -> 1565 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 69 ++++++++++----- .../newview/skins/default/xui/en/widgets/badge.xml | 2 +- 18 files changed, 173 insertions(+), 30 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Inv_Gift.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Disabled.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Enabled.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_1.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_2.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_3.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_4.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_5.png create mode 100644 indra/newview/skins/default/textures/icons/Sync_Progress_6.png delete mode 100644 indra/newview/skins/default/textures/widgets/Badge.png create mode 100644 indra/newview/skins/default/textures/widgets/Badge_Background.png create mode 100644 indra/newview/skins/default/textures/widgets/Badge_Border.png diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 1f58fb33a4..0151276f99 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -24,15 +24,26 @@ * $/LicenseInfo$ */ -#include "llviewerprecompiledheaders.h" +#include <boost/coroutine/coroutine.hpp> +#include <boost/coroutine/future.hpp> #include "llpanelmarketplaceoutbox.h" +#include "llbutton.h" +#include "llcoros.h" +#include "lleventcoro.h" +#include "llloadingindicator.h" +#include "lltimer.h" + + static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox"); // protected LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() -: LLPanel() + : LLPanel() + , mSyncButton(NULL) + , mSyncIndicator(NULL) + , mSyncInProgress(false) { } @@ -43,5 +54,83 @@ LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() // virtual BOOL LLPanelMarketplaceOutbox::postBuild() { + mSyncButton = getChild<LLButton>("outbox_sync_btn"); + mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); + + mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator"); + + mSyncButton->setEnabled(!isOutboxEmpty()); + return TRUE; } + +bool LLPanelMarketplaceOutbox::isOutboxEmpty() const +{ + // TODO: Check for contents of outbox + + return false; +} + +bool LLPanelMarketplaceOutbox::isSyncInProgress() const +{ + return mSyncInProgress; +} + + +std::string gTimeDelayDebugFunc = ""; + +void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) +{ + waitForEventOn(self, "mainloop"); + + LLTimer delayTimer; + delayTimer.reset(); + delayTimer.setTimerExpirySec(5.0f); + + while (!delayTimer.hasExpired()) + { + waitForEventOn(self, "mainloop"); + } + + outboxPanel->onSyncComplete(); + + gTimeDelayDebugFunc = ""; +} + +void LLPanelMarketplaceOutbox::onSyncButtonClicked() +{ + // TODO: Actually trigger sync to marketplace + + mSyncInProgress = true; + updateSyncButtonStatus(); + + // Set a timer (for testing only) + + gTimeDelayDebugFunc = LLCoros::instance().launch("LLPanelMarketplaceOutbox timeDelay", boost::bind(&timeDelay, _1, this)); +} + +void LLPanelMarketplaceOutbox::onSyncComplete() +{ + mSyncInProgress = false; + + updateSyncButtonStatus(); +} + +void LLPanelMarketplaceOutbox::updateSyncButtonStatus() +{ + if (isSyncInProgress()) + { + mSyncButton->setVisible(false); + + mSyncIndicator->setVisible(true); + mSyncIndicator->start(); + } + else + { + mSyncIndicator->stop(); + mSyncIndicator->setVisible(false); + + mSyncButton->setVisible(true); + mSyncButton->setEnabled(!isOutboxEmpty()); + } +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index a6a28e0a83..2fbe819762 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -29,6 +29,11 @@ #include "llpanel.h" + +class LLButton; +class LLLoadingIndicator; + + class LLPanelMarketplaceOutbox : public LLPanel { public: @@ -39,6 +44,20 @@ public: ~LLPanelMarketplaceOutbox(); /*virtual*/ BOOL postBuild(); + + bool isOutboxEmpty() const; + bool isSyncInProgress() const; + + void onSyncComplete(); + +protected: + void onSyncButtonClicked(); + void updateSyncButtonStatus(); + +private: + LLButton * mSyncButton; + LLLoadingIndicator * mSyncIndicator; + bool mSyncInProgress; }; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 0795e38366..a548849d60 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -134,7 +134,10 @@ reference="AvatarListItemIconOfflineColor" /> <color name="BadgeImageColor" - value="0.25 0.85 0.25 1.0" /> + value="0.44 0.69 0.56 1.0" /> + <color + name="BadgeImageBorderColor" + value="0.9 0.9 0.9 1.0" /> <color name="BadgeLabelColor" reference="White" /> diff --git a/indra/newview/skins/default/textures/icons/Inv_Gift.png b/indra/newview/skins/default/textures/icons/Inv_Gift.png new file mode 100644 index 0000000000..5afe85d72d Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Inv_Gift.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Disabled.png b/indra/newview/skins/default/textures/icons/Sync_Disabled.png new file mode 100644 index 0000000000..ca2e8def97 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Disabled.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Enabled.png b/indra/newview/skins/default/textures/icons/Sync_Enabled.png new file mode 100644 index 0000000000..bc236c8b98 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Enabled.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_1.png b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png new file mode 100644 index 0000000000..624e556376 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_1.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_2.png b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png new file mode 100644 index 0000000000..5769803b3f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_2.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_3.png b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png new file mode 100644 index 0000000000..92d4bfb020 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_3.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_4.png b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png new file mode 100644 index 0000000000..6d43eb3a9f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_4.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_5.png b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png new file mode 100644 index 0000000000..766d063c99 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_5.png differ diff --git a/indra/newview/skins/default/textures/icons/Sync_Progress_6.png b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png new file mode 100644 index 0000000000..dfe7f68b72 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Sync_Progress_6.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index f0a1893502..a6e71cc38e 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -72,11 +72,11 @@ with the same filename but different name <texture name="BackButton_Over" file_name="icons/back_arrow_over.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> <texture name="BackButton_Press" file_name="icons/back_arrow_press.png" preload="false" scale.left="22" scale.top="12" scale.right="25" scale.bottom="12" /> - <texture name="Badge" file_name="widgets/Badge.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="Badge_Background" file_name="widgets/Badge_Background.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> + <texture name="Badge_Border" file_name="widgets/Badge_Border.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> <texture name="Blank" file_name="Blank.png" preload="false" /> - <texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="0" scale.top="1" scale.right="0" scale.bottom="0" /> <texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> @@ -479,7 +479,16 @@ with the same filename but different name <texture name="StopReload_Off" file_name="icons/StopReload_Off.png" preload="false" /> <texture name="StopReload_Over" file_name="icons/StopReload_Over.png" preload="false" /> - <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> + <texture name="Sync_Disabled" file_name="icons/Sync_Disabled.png" preload="true" /> + <texture name="Sync_Enabled" file_name="icons/Sync_Enabled.png" preload="true" /> + <texture name="Sync_Progress_1" file_name="icons/Sync_Progress_1.png" preload="true" /> + <texture name="Sync_Progress_2" file_name="icons/Sync_Progress_2.png" preload="true" /> + <texture name="Sync_Progress_3" file_name="icons/Sync_Progress_3.png" preload="true" /> + <texture name="Sync_Progress_4" file_name="icons/Sync_Progress_4.png" preload="true" /> + <texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" /> + <texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" /> + + <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> <texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" /> <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" /> <texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png deleted file mode 100644 index 862b13d219..0000000000 Binary files a/indra/newview/skins/default/textures/widgets/Badge.png and /dev/null differ diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background.png b/indra/newview/skins/default/textures/widgets/Badge_Background.png new file mode 100644 index 0000000000..5089c30312 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge_Background.png differ diff --git a/indra/newview/skins/default/textures/widgets/Badge_Border.png b/indra/newview/skins/default/textures/widgets/Badge_Border.png new file mode 100644 index 0000000000..4b086a63fb Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge_Border.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 fa79975669..ffc018b856 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -124,37 +124,60 @@ height="125" width="310"> <button - label="MARKETPLACE OUTBOX" - is_toggle="true" - name="outbox_btn" - follows="top|left|right" - image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" - height="35" - tab_stop="false" - width="308" - halign="left" - pad_left="35" - top="0" + label="MARKETPLACE OUTBOX" + is_toggle="true" + name="outbox_btn" + follows="top|left|right" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + height="35" + tab_stop="false" + width="308" + halign="left" + pad_left="35" + top="0" left="0" /> - <button - label="SYNC" + <button + image_disabled="Sync_Disabled" + image_disabled_selected="Sync_Disabled" + image_unselected="Sync_Enabled" + image_selected="Sync_Enabled" + label="" is_toggle="false" name="outbox_sync_btn" follows="top|right" - height="25" + height="16" tab_stop="false" - width="45" + width="16" halign="center" - top="5" - left="-50" + top="10" + left="-40" enabled="false" /> + <loading_indicator + follows="top|right" + name="outbox_sync_indicator" + top="10" + left="-40" + height="16" + width="16" + images_per_sec="1.0" + tab_stop="false" + visible="false"> + <images> + <image name="Sync_Progress_1"/> + <image name="Sync_Progress_2"/> + <image name="Sync_Progress_3"/> + <image name="Sync_Progress_4"/> + <image name="Sync_Progress_5"/> + <image name="Sync_Progress_6"/> + </images> + </loading_indicator> <panel - follows="all" - left="0" - height="90" - width="250" - top="30" + follows="all" + left="0" + height="90" + width="250" + top="30" > <text left ="40" diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml index 4eb633ac0c..ceec09d1e4 100644 --- a/indra/newview/skins/default/xui/en/widgets/badge.xml +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -2,7 +2,7 @@ <!-- Additional attributes: --> <badge font="SansSerifSmall" - image="Badge" + image="Badge_Background" image_color="BadgeImageColor" label_color="BadgeLabelColor" location="top_left" -- cgit v1.2.3 From 651a9587f82a143764856a4c2603d89c5d392cb6 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 1 Jun 2011 13:50:14 -0700 Subject: EXP-862 FIX -- Disable marketplace inbox/outbox panel separator when inbox and outbox are collapsed Marketplace panel is only resizable now when inbox or outbox is expanded. Reviewed by Leyla --- indra/newview/llsidepanelinventory.cpp | 24 +++++++++---- .../skins/default/xui/en/sidepanel_inventory.xml | 41 ++++++++++++---------- 2 files changed, 39 insertions(+), 26 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 9247611257..301322d24b 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -120,15 +120,22 @@ BOOL LLSidepanelInventory::postBuild() } } - getChild<LLButton>("inbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); - getChild<LLButton>("outbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + // Marketplace inbox/outbox setup + { + LLButton * inboxButton = getChild<LLButton>("inbox_btn"); + LLButton * outboxButton = getChild<LLButton>("outbox_btn"); - LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + inboxButton->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + outboxButton->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); - stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); - stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); - getChild<LLButton>("outbox_btn")->setToggleState(false); - getChild<LLButton>("inbox_btn")->setToggleState(false); + stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); + stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); + + inboxButton->setToggleState(false); + outboxButton->setToggleState(false); + } return TRUE; } @@ -151,6 +158,9 @@ void manageInboxOutboxPanels(LLLayoutStack * stack, } stack->collapsePanel(pressedPanel, !expand); + + // Enable user_resize on main inventory panel when at least one marketplace box is expanded + stack->setPanelUserResize("main_inventory_layout_panel", expand); } void LLSidepanelInventory::onToggleInboxBtn() diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index ffc018b856..484e90f083 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -26,11 +26,14 @@ top="0" orientation="vertical" name="inventory_layout_stack" - height="535" + height="535" width="330"> <layout_panel + name="main_inventory_layout_panel" + min_dim="150" width="330" - follows="bottom|left|right" + follows="bottom|left|right" + user_resize="false" height="480"> <panel class="panel_main_inventory" @@ -45,14 +48,14 @@ width="330" /> </layout_panel> <layout_panel - width="330" - auto_resize="true" - user_resize="false" - follows="bottom|left|right" - min_dim="35" - name="inbox_layout_panel" - max_dim="125" - height="35"> + width="330" + auto_resize="true" + user_resize="false" + follows="bottom|left|right" + min_dim="35" + name="inbox_layout_panel" + max_dim="125" + height="35"> <panel follows="all" layout="topleft" @@ -69,14 +72,14 @@ height="35" width="308" image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" + image_selected="MarketplaceBtn_Selected" halign="left" follows="top|left|right" is_toggle="true" tab_stop="false" pad_left="35" top="0" - left="10" /> + left="10" /> <panel follows="all" left="10" @@ -105,14 +108,14 @@ </panel> </layout_panel> <layout_panel - width="330" - auto_resize="true" + width="330" + auto_resize="true" user_resize="false" - follows="bottom|left|right" - name="outbox_layout_panel" - min_dim="35" - max_dim="125" - height="35"> + follows="bottom|left|right" + name="outbox_layout_panel" + min_dim="35" + max_dim="125" + height="35"> <panel follows="top|left|right" layout="topleft" -- cgit v1.2.3 From fe9eccdbae9af3c61bff4637c1a61cdc09068a32 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 1 Jun 2011 15:40:29 -0700 Subject: updating slvoice libraries --- autobuild.xml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index 8851e003ea..a33cfdd4fd 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1524,7 +1524,7 @@ <key>hash</key> <string>bb0abe962b3b8208ed2dab0424aab33d</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Linux/installer/pcre-7.6-linux-20110504.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-pcre/rev/228822/arch/Linux/installer/pcre-7.6-linux-20110504.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1570,9 +1570,9 @@ <key>archive</key> <map> <key>hash</key> - <string>e19576af3c0affc71293d8f0bcce2606</string> + <string>24e735ae005f3ce7a21a09cc02cece17</string> <key>url</key> - <string> http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-darwin-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Darwin/installer/slvoice-3.2.0002.10426-darwin-20110601.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1582,9 +1582,9 @@ <key>archive</key> <map> <key>hash</key> - <string>53fefed8120d7c6a0eb6778edae6fa32</string> + <string>8a0bc982367d6fdc20a28b391cd40566</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-linux-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/Linux/installer/slvoice-3.2.0002.10426-linux-20110601.tar.bz2</string> </map> <key>name</key> <string>linux</string> @@ -1594,9 +1594,9 @@ <key>archive</key> <map> <key>hash</key> - <string>44f84b3b45f7067a104a7c34d50d62f0</string> + <string>1e821cc7d25eabad013b7f3db260dd6b</string> <key>url</key> - <string>http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/slvoice-3.2.0002.9361-windows-20110120.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-slvoice/rev/231678/arch/CYGWIN/installer/slvoice-3.2.0002.10426-windows-20110601.tar.bz2</string> </map> <key>name</key> <string>windows</string> -- cgit v1.2.3 From 0c0f7558782edccda375609777967184b8440441 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 6 Jun 2011 16:30:22 -0700 Subject: fixing drag and drop for inbox, adding inbox text and cleaning up context menus --- indra/newview/llinventorybridge.cpp | 15 ++++++--- indra/newview/llinventorybridge.h | 1 + indra/newview/llpanelmarketplaceinbox.cpp | 38 ++++++++++++++++++++++ indra/newview/llpanelmarketplaceinbox.h | 9 +++++ .../skins/default/xui/en/sidepanel_inventory.xml | 25 +++++++++++--- 5 files changed, 79 insertions(+), 9 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index bdb9f6167a..20a187c302 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -572,7 +572,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } // Don't allow items to be pasted directly into the COF. - if (!isCOFFolder()) + if (!isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Paste")); } @@ -781,6 +781,11 @@ BOOL LLInvFVBridge::isCOFFolder() const return LLAppearanceMgr::instance().getIsInCOF(mUUID); } +BOOL LLInvFVBridge::isInboxFolder() const +{ + return gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)); +} + BOOL LLInvFVBridge::isItemPermissive() const { return FALSE; @@ -2601,7 +2606,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLViewerInventoryCategory *cat = getCategory(); // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. - if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) + if (!isCOFFolder() && !isInboxFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) @@ -2627,7 +2632,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { // Want some but not all of the items from getClipboardEntries for outfits. - if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT)) + if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT) || (cat->getPreferredType() == LLFolderType::FT_INBOX)) { mItems.push_back(std::string("Rename")); @@ -4298,7 +4303,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Detach From Yourself")); } - else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) + else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); @@ -4650,7 +4655,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Edit")); } // Don't allow items to be worn if their baseobj is in the trash. - if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder()) + if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder() || isInboxFolder()) { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 5ac328dcef..f268f36f3b 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -138,6 +138,7 @@ protected: BOOL isAgentInventory() const; // false if lost or in the inventory library BOOL isCOFFolder() const; // true if COF or descendent of + BOOL isInboxFolder() const; // true if COF or descendent of marketplace inbox virtual BOOL isItemPermissive() const; static void changeItemParent(LLInventoryModel* model, LLViewerInventoryItem* item, diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index b3afaea20e..b401087345 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -28,6 +28,9 @@ #include "llpanelmarketplaceinbox.h" +#include "llbutton.h" +#include "llinventorypanel.h" + static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); // protected @@ -43,5 +46,40 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() // virtual BOOL LLPanelMarketplaceInbox::postBuild() { + mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); + + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + return TRUE; +} + +BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; return TRUE; } + +void LLPanelMarketplaceInbox::draw() +{ + LLInventoryModel* model = mInventoryPanel->getModel(); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); + + S32 item_count = cats->size() + items->size(); + + if (item_count) + { + LLStringUtil::format_map_t args; + args["[NUM]"] = llformat ("%d", item_count); + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + } + else + { + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + } + + LLPanel::draw(); +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 519b213081..504659b1ef 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -29,6 +29,8 @@ #include "llpanel.h" +class LLInventoryPanel; + class LLPanelMarketplaceInbox : public LLPanel { public: @@ -39,6 +41,13 @@ public: ~LLPanelMarketplaceInbox(); /*virtual*/ BOOL postBuild(); + + /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); + + /*virtual*/ void draw(); + +private: + LLInventoryPanel* mInventoryPanel; }; diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 49c45233d8..91de3047e6 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -9,7 +9,7 @@ min_width="240" name="objects panel" width="333"> - <panel + <panel follows="all" layout="topleft" left="0" @@ -66,6 +66,8 @@ label="" height="125" width="330"> + <string name="InboxLabelWithArg">MARKETPLACE INBOX ([NUM])</string> + <string name="InboxLabelNoArg">MARKETPLACE INBOX</string> <button label="MARKETPLACE INBOX" name="inbox_btn" @@ -84,9 +86,24 @@ follows="all" left="10" height="90" - width="330" + width="308" top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" > + <text + type="string" + length="1" + follows="top|left|right" + font="SansSerifSmall" + use_ellipses="true" + name="move_items_text" + top="10" + left="4" + height="20" + width="304" + >Move items to your inventory to manage and use them.</text> <inventory_panel bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -95,14 +112,14 @@ border="false" bevel_style="none" follows="all" - height="90" + height="70" start_folder="Inbox" layout="topleft" left="0" name="inventory_inbox" sort_order_setting="InventorySortOrder" show_item_link_overlays="true" - top="0" + top_pad="0" width="308" /> </panel> </panel> -- cgit v1.2.3 From 98bcd9e2efe4cc0dc5e51da09c6f18424b9d9144 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Mon, 6 Jun 2011 17:00:59 -0700 Subject: EXP-859 FIX -- Save setting for last time inbox expanded EXP-841 PROGRESS -- Create outbox sync button with basic enable/disable logic and animation EXP-866 PROGRESS -- Create inbox observer to dynamically update inbox item count and badge value EXP-872 PROGRESS -- Hide inbox and outbox unless applicable Inbox expansion time is now saved as setting variable "LastInventoryInboxExpand". New outbox sync button art. Observers for items and categories are now implemented in the LLSidepanelInventory but the exact method of use is still to be determined. Functions are in place to show and hide the inbox and outbox panels but the logic around the decision is TBD. The resize bar for the inbox/outbox is now disabled when both inbox and outbox are collapsed. Reviewed by Leyla. --- indra/llui/llloadingindicator.h | 2 + indra/newview/lloutfitslist.cpp | 2 +- indra/newview/llpanelmarketplaceinbox.cpp | 12 +- indra/newview/llpanelmarketplaceoutbox.cpp | 5 +- indra/newview/llpanelwearing.cpp | 2 +- indra/newview/llsidepanelinventory.cpp | 235 ++++++++++++++++++--- indra/newview/llsidepanelinventory.h | 16 ++ .../default/textures/icons/OutboxPush_Disabled.png | Bin 0 -> 1848 bytes .../default/textures/icons/OutboxPush_Off.png | Bin 0 -> 1835 bytes .../skins/default/textures/icons/OutboxPush_On.png | Bin 0 -> 1851 bytes .../default/textures/icons/OutboxPush_On_Over.png | Bin 0 -> 1863 bytes .../textures/icons/OutboxPush_On_Selected.png | Bin 0 -> 1912 bytes .../default/textures/icons/OutboxPush_Over.png | Bin 0 -> 1826 bytes .../default/textures/icons/OutboxPush_Press.png | Bin 0 -> 1891 bytes .../textures/icons/OutboxPush_Progress_1.png | Bin 0 -> 1848 bytes .../textures/icons/OutboxPush_Progress_2.png | Bin 0 -> 1807 bytes .../textures/icons/OutboxPush_Progress_3.png | Bin 0 -> 1819 bytes .../textures/icons/OutboxPush_Progress_4.png | Bin 0 -> 1894 bytes .../textures/icons/OutboxPush_Progress_5.png | Bin 0 -> 1921 bytes .../textures/icons/OutboxPush_Progress_6.png | Bin 0 -> 1853 bytes .../default/textures/icons/OutboxPush_Selected.png | Bin 0 -> 1894 bytes .../icons/OutboxPush_Selected_Disabled.png | Bin 0 -> 1840 bytes .../textures/icons/OutboxPush_Selected_Over.png | Bin 0 -> 1870 bytes .../textures/icons/OutboxPush_Selected_Press.png | Bin 0 -> 1912 bytes indra/newview/skins/default/textures/textures.xml | 19 +- .../skins/default/xui/en/sidepanel_inventory.xml | 117 +++++----- 26 files changed, 318 insertions(+), 92 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Off.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_On.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Over.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Press.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Selected.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png create mode 100644 indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png diff --git a/indra/llui/llloadingindicator.h b/indra/llui/llloadingindicator.h index 4c47cc267c..7c44478848 100644 --- a/indra/llui/llloadingindicator.h +++ b/indra/llui/llloadingindicator.h @@ -86,6 +86,8 @@ public: */ void start(); + void reset() { mCurImageIdx = 0; } + private: LLLoadingIndicator(const Params&); void initFromParams(const Params&); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 6435126fc0..10887aa53a 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -364,8 +364,8 @@ LLOutfitsList::~LLOutfitsList() if (gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); - delete mCategoriesObserver; } + delete mCategoriesObserver; } BOOL LLOutfitsList::postBuild() diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index b401087345..6cebc5dd5a 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -68,7 +68,17 @@ void LLPanelMarketplaceInbox::draw() model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - S32 item_count = cats->size() + items->size(); + S32 item_count = 0; + + if (cats) + { + item_count += cats->size(); + } + + if (items) + { + item_count += items->size(); + } if (item_count) { diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 0151276f99..822286783f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -81,7 +81,7 @@ std::string gTimeDelayDebugFunc = ""; void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) { - waitForEventOn(self, "mainloop"); + waitForEventOn(self, "mainloop"); LLTimer delayTimer; delayTimer.reset(); @@ -89,7 +89,7 @@ void timeDelay(LLCoros::self& self, LLPanelMarketplaceOutbox* outboxPanel) while (!delayTimer.hasExpired()) { - waitForEventOn(self, "mainloop"); + waitForEventOn(self, "mainloop"); } outboxPanel->onSyncComplete(); @@ -123,6 +123,7 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus() mSyncButton->setVisible(false); mSyncIndicator->setVisible(true); + mSyncIndicator->reset(); mSyncIndicator->start(); } else diff --git a/indra/newview/llpanelwearing.cpp b/indra/newview/llpanelwearing.cpp index 911a9e5dda..0645fd8a54 100644 --- a/indra/newview/llpanelwearing.cpp +++ b/indra/newview/llpanelwearing.cpp @@ -174,8 +174,8 @@ LLPanelWearing::~LLPanelWearing() if (gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); - delete mCategoriesObserver; } + delete mCategoriesObserver; } BOOL LLPanelWearing::postBuild() diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 301322d24b..ae2ac4b5e5 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -31,32 +31,116 @@ #include "llappearancemgr.h" #include "llavataractions.h" #include "llbutton.h" +#include "lldate.h" #include "llfirstuse.h" +#include "llfoldertype.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llinventorymodelbackgroundfetch.h" +#include "llinventoryobserver.h" #include "llinventorypanel.h" +#include "lllayoutstack.h" #include "lloutfitobserver.h" #include "llpanelmaininventory.h" +#include "llselectmgr.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" #include "lltabcontainer.h" -#include "llselectmgr.h" #include "llweb.h" -#include "lllayoutstack.h" static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); -LLSidepanelInventory::LLSidepanelInventory() - : LLPanel(), - mItemPanel(NULL), - mPanelMainInventory(NULL) +// +// Constants +// + +static const char * const INBOX_EXPAND_TIME_SETTING = "LastInventoryInboxExpand"; + +static const char * const INBOX_BUTTON_NAME = "inbox_btn"; +static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; + +static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; +static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; +static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel"; + +static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; + +// +// Helpers +// + +class LLInboxOutboxInventoryAddedObserver : public LLInventoryAddedObserver { +public: + LLInboxOutboxInventoryAddedObserver(LLSidepanelInventory * sidepanelInventory) + : LLInventoryAddedObserver() + , mSidepanelInventory(sidepanelInventory) + {} + +protected: + virtual void done() + { + uuid_vec_t::const_iterator it = mAdded.begin(); + uuid_vec_t::const_iterator it_end = mAdded.end(); + + for(; it != it_end; ++it) + { + LLInventoryObject* item = gInventory.getObject(*it); + + // NOTE: This doesn't actually work because folder creation does not trigger this observer + if (item && item->getType() == LLAssetType::AT_CATEGORY) + { + // Check for FolderType FT_INBOX or FT_OUTBOX and report back to mSidepanelInventory + LLInventoryCategory * item_cat = static_cast<LLInventoryCategory *>(item); + LLFolderType::EType folderType = item_cat->getPreferredType(); + + if (folderType == LLFolderType::FT_INBOX) + { + mSidepanelInventory->enableInbox(true); + } + else if (folderType == LLFolderType::FT_OUTBOX) + { + mSidepanelInventory->enableOutbox(true); + } + } + } + + mAdded.clear(); + } +private: + LLSidepanelInventory * mSidepanelInventory; +}; + +// +// Implementation +// + +LLSidepanelInventory::LLSidepanelInventory() + : LLPanel() + , mItemPanel(NULL) + , mPanelMainInventory(NULL) + , mInventoryFetched(false) + , mCategoriesObserver(NULL) + , mInboxOutboxAddedObserver(NULL) +{ //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLSidepanelInventory::~LLSidepanelInventory() { + if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver)) + { + gInventory.removeObserver(mInboxOutboxAddedObserver); + } + delete mInboxOutboxAddedObserver; + + if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) + { + gInventory.removeObserver(mCategoriesObserver); + } + delete mCategoriesObserver; } BOOL LLSidepanelInventory::postBuild() @@ -122,32 +206,110 @@ BOOL LLSidepanelInventory::postBuild() // Marketplace inbox/outbox setup { - LLButton * inboxButton = getChild<LLButton>("inbox_btn"); - LLButton * outboxButton = getChild<LLButton>("outbox_btn"); + LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); + LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME); + + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + + LLLayoutPanel * inbox_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); + LLLayoutPanel * outbox_panel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); + + stack->collapsePanel(inbox_panel, true); + stack->collapsePanel(outbox_panel, true); - inboxButton->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); - outboxButton->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + inbox_button->setToggleState(false); + outbox_button->setToggleState(false); - LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); + inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + // TODO: Hide inbox/outbox panels until we determine the status of the feature + //inbox_panel->setVisible(false); + //outbox_panel->setVisible(false); - stack->collapsePanel(getChild<LLLayoutPanel>("inbox_layout_panel"), true); - stack->collapsePanel(getChild<LLLayoutPanel>("outbox_layout_panel"), true); + // Track added items + mInboxOutboxAddedObserver = new LLInboxOutboxInventoryAddedObserver(this); + gInventory.addObserver(mInboxOutboxAddedObserver); - inboxButton->setToggleState(false); - outboxButton->setToggleState(false); + // Track inbox and outbox folder changes + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + + mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); + mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); } return TRUE; } +void LLSidepanelInventory::draw() +{ + if (!mInventoryFetched && LLInventoryModelBackgroundFetch::instance().isEverythingFetched()) + { + mInventoryFetched = true; + + updateInboxOutboxPanels(); + } + + LLPanel::draw(); +} + +void LLSidepanelInventory::updateInboxOutboxPanels() +{ + // Iterate through gInventory looking for inbox and outbox + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + enableInbox(inbox_id.notNull()); + enableOutbox(outbox_id.notNull()); +} + +void LLSidepanelInventory::enableInbox(bool enabled) +{ + getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); +} + +void LLSidepanelInventory::enableOutbox(bool enabled) +{ + getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); +} -void manageInboxOutboxPanels(LLLayoutStack * stack, +void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) +{ + // Perhaps use this to track inbox changes? +} + +void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) +{ + // Perhaps use this to track outbox changes? +} + +bool manageInboxOutboxPanels(LLLayoutStack * stack, LLButton * pressedButton, LLLayoutPanel * pressedPanel, LLButton * otherButton, LLLayoutPanel * otherPanel) { bool expand = pressedButton->getToggleState(); bool otherExpanded = otherButton->getToggleState(); + // + // NOTE: Ideally we could have two panel sizes stored for a collapsed and expanded minimum size. + // For now, leave this code disabled because it creates some bad artifacts when expanding + // and collapsing the inbox/outbox. + // + //S32 smallMinSize = (expand ? pressedPanel->getMinDim() : otherPanel->getMinDim()); + //S32 pressedMinSize = (expand ? 2 * smallMinSize : smallMinSize); + //otherPanel->setMinDim(smallMinSize); + //pressedPanel->setMinDim(pressedMinSize); + if (expand && otherExpanded) { // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size @@ -159,33 +321,46 @@ void manageInboxOutboxPanels(LLLayoutStack * stack, stack->collapsePanel(pressedPanel, !expand); - // Enable user_resize on main inventory panel when at least one marketplace box is expanded - stack->setPanelUserResize("main_inventory_layout_panel", expand); + // Enable user_resize on main inventory panel only when a marketplace box is expanded + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, expand); + + return expand; } void LLSidepanelInventory::onToggleInboxBtn() { - LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); - LLButton* pressedButton = getChild<LLButton>("inbox_btn"); - LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("inbox_layout_panel"); - LLButton* otherButton = getChild<LLButton>("outbox_btn"); - LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("outbox_layout_panel"); + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLButton* pressedButton = getChild<LLButton>(INBOX_BUTTON_NAME); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); + LLButton* otherButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); - manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + bool inboxExpanded = manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); + + if (inboxExpanded) + { + // Save current time as a setting for future new-ness tests + gSavedSettings.setString(INBOX_EXPAND_TIME_SETTING, LLDate::now().asString()); + + // TODO: Hide inbox badge + } + else + { + // TODO: Show inbox badge + } } void LLSidepanelInventory::onToggleOutboxBtn() { - LLLayoutStack* stack = getChild<LLLayoutStack>("inventory_layout_stack"); - LLButton* pressedButton = getChild<LLButton>("outbox_btn"); - LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>("outbox_layout_panel"); - LLButton* otherButton = getChild<LLButton>("inbox_btn"); - LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>("inbox_layout_panel"); + LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); + LLButton* pressedButton = getChild<LLButton>(OUTBOX_BUTTON_NAME); + LLLayoutPanel* pressedPanel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); + LLButton* otherButton = getChild<LLButton>(INBOX_BUTTON_NAME); + LLLayoutPanel* otherPanel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); } - void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index a4e8d0e8e8..8047e11566 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -30,6 +30,8 @@ #include "llpanel.h" class LLFolderViewItem; +class LLInboxOutboxInventoryAddedObserver; +class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; class LLPanelMainInventory; @@ -59,6 +61,12 @@ public: void onToggleInboxBtn(); void onToggleOutboxBtn(); + void updateInboxOutboxPanels(); + void enableInbox(bool enabled); + void enableOutbox(bool enabled); + + virtual void draw(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -70,6 +78,9 @@ protected: bool canWearSelected(); // check whether selected items can be worn + void onInboxChanged(const LLUUID& inbox_id); + void onOutboxChanged(const LLUUID& outbox_id); + // // UI Elements // @@ -88,6 +99,7 @@ protected: void onTeleportButtonClicked(); void onOverflowButtonClicked(); void onBackButtonClicked(); + private: LLButton* mInfoBtn; LLButton* mShareBtn; @@ -97,6 +109,10 @@ private: LLButton* mOverflowBtn; LLButton* mShopBtn; + bool mInventoryFetched; + + LLInventoryCategoriesObserver* mCategoriesObserver; + LLInboxOutboxInventoryAddedObserver* mInboxOutboxAddedObserver; }; #endif //LL_LLSIDEPANELINVENTORY_H diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png b/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png new file mode 100644 index 0000000000..be58114aa1 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Disabled.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Off.png b/indra/newview/skins/default/textures/icons/OutboxPush_Off.png new file mode 100644 index 0000000000..e6b9480ab1 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Off.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On.png b/indra/newview/skins/default/textures/icons/OutboxPush_On.png new file mode 100644 index 0000000000..ffda2e92d4 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_On.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png new file mode 100644 index 0000000000..6b5911014f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_On_Over.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png b/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png new file mode 100644 index 0000000000..0e60b417b0 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_On_Selected.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_Over.png new file mode 100644 index 0000000000..9c26b92e73 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Over.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Press.png b/indra/newview/skins/default/textures/icons/OutboxPush_Press.png new file mode 100644 index 0000000000..3b5d462975 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Press.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png new file mode 100644 index 0000000000..f85be047b0 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_1.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png new file mode 100644 index 0000000000..cd4e482216 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_2.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png new file mode 100644 index 0000000000..d212a871ce Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_3.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png new file mode 100644 index 0000000000..e5b6023e36 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_4.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png new file mode 100644 index 0000000000..e1911a092f Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_5.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png new file mode 100644 index 0000000000..9e59f7843a Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Progress_6.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png new file mode 100644 index 0000000000..51e8bff646 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Selected.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png new file mode 100644 index 0000000000..300e2e69e1 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Disabled.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png new file mode 100644 index 0000000000..32fb236381 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Over.png differ diff --git a/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png new file mode 100644 index 0000000000..827f343b1e Binary files /dev/null and b/indra/newview/skins/default/textures/icons/OutboxPush_Selected_Press.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index a6e71cc38e..7888674b04 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -332,6 +332,23 @@ with the same filename but different name <texture name="OptionsMenu_Off" file_name="icons/OptionsMenu_Off.png" preload="false" /> <texture name="OptionsMenu_Press" file_name="icons/OptionsMenu_Press.png" preload="false" /> + <texture name="OutboxPush_Disabled" file_name="icons/OutboxPush_Disabled.png" preload="true" /> + <texture name="OutboxPush_Off" file_name="icons/OutboxPush_Off.png" preload="true" /> + <texture name="OutboxPush_On" file_name="icons/OutboxPush_On.png" preload="true" /> + <texture name="OutboxPush_On_Over" file_name="icons/OutboxPush_On_Over.png" preload="true" /> + <texture name="OutboxPush_Over" file_name="icons/OutboxPush_Over.png" preload="true" /> + <texture name="OutboxPush_Press" file_name="icons/OutboxPush_Press.png" preload="true" /> + <texture name="OutboxPush_Progress_1" file_name="icons/OutboxPush_Progress_1.png" preload="true" /> + <texture name="OutboxPush_Progress_2" file_name="icons/OutboxPush_Progress_2.png" preload="true" /> + <texture name="OutboxPush_Progress_3" file_name="icons/OutboxPush_Progress_3.png" preload="true" /> + <texture name="OutboxPush_Progress_4" file_name="icons/OutboxPush_Progress_4.png" preload="true" /> + <texture name="OutboxPush_Progress_5" file_name="icons/OutboxPush_Progress_5.png" preload="true" /> + <texture name="OutboxPush_Progress_6" file_name="icons/OutboxPush_Progress_6.png" preload="true" /> + <texture name="OutboxPush_Selected" file_name="icons/OutboxPush_Selected.png" preload="true" /> + <texture name="OutboxPush_Selected_Disabled" file_name="icons/OutboxPush_Selected_Disabled.png" preload="true" /> + <texture name="OutboxPush_Selected_Over" file_name="icons/OutboxPush_Selected_Over.png" preload="true" /> + <texture name="OutboxPush_Selected_Press" file_name="icons/OutboxPush_Selected_Press.png" preload="true" /> + <texture name="PanOrbit_Off" file_name="bottomtray/PanOrbit_Off.png" preload="false" /> <texture name="Parcel_Exp_Color" file_name="icons/Parcel_Exp_Color.png" preload="false" /> @@ -488,7 +505,7 @@ with the same filename but different name <texture name="Sync_Progress_5" file_name="icons/Sync_Progress_5.png" preload="true" /> <texture name="Sync_Progress_6" file_name="icons/Sync_Progress_6.png" preload="true" /> - <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> + <texture name="TabIcon_Appearance_Off" file_name="taskpanel/TabIcon_Appearance_Off.png" preload="false" /> <texture name="TabIcon_Appearance_Selected" file_name="taskpanel/TabIcon_Appearance_Selected.png" preload="false" /> <texture name="TabIcon_Close_Off" file_name="taskpanel/TabIcon_Close_Off.png" preload="false" /> <texture name="TabIcon_Home_Off" file_name="taskpanel/TabIcon_Home_Off.png" preload="false" /> diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 91de3047e6..c945f27ac6 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -89,21 +89,21 @@ width="308" top="35" bg_opaque_color="InventoryBackgroundColor" - background_visible="true" - background_opaque="true" + background_visible="true" + background_opaque="true" > <text type="string" - length="1" - follows="top|left|right" - font="SansSerifSmall" + length="1" + follows="top|left|right" + font="SansSerifSmall" use_ellipses="true" name="move_items_text" - top="10" - left="4" - height="20" - width="304" - >Move items to your inventory to manage and use them.</text> + top="10" + left="4" + height="20" + width="304" + >Move items to your inventory to manage and use them.</text> <inventory_panel bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -125,14 +125,14 @@ </panel> </layout_panel> <layout_panel - width="330" - auto_resize="true" + width="330" + auto_resize="true" user_resize="false" - follows="bottom|left|right" - name="outbox_layout_panel" - min_dim="35" - max_dim="125" - height="35"> + follows="bottom|left|right" + name="outbox_layout_panel" + min_dim="35" + max_dim="125" + height="35"> <panel follows="all" layout="topleft" @@ -144,52 +144,57 @@ height="125" width="310"> <button - label="MARKETPLACE OUTBOX" - is_toggle="true" - name="outbox_btn" - follows="top|left|right" - image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" - height="35" - tab_stop="false" - width="308" - halign="left" - pad_left="35" - top="0" - left="0" /> - <button - image_disabled="Sync_Disabled" - image_disabled_selected="Sync_Disabled" - image_unselected="Sync_Enabled" - image_selected="Sync_Enabled" - label="" - is_toggle="false" - name="outbox_sync_btn" - follows="top|right" - height="16" + label="MARKETPLACE OUTBOX" + is_toggle="true" + name="outbox_btn" + follows="top|left|right" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + height="35" tab_stop="false" - width="16" - halign="center" - top="10" - left="-40" - enabled="false" /> + width="308" + halign="left" + pad_left="35" + top="0" + left="0" /> + <button + image_unselected="OutboxPush_Off" + image_selected="OutboxPush_Selected" + image_hover_selected="OutboxPush_Selected_Over" + image_hover_unselected="OutboxPush_Over" + image_disabled_selected="OutboxPush_Selected_Disabled" + image_disabled="OutboxPush_Disabled" + image_pressed="OutboxPush_Press" + image_pressed_selected="OutboxPush_Selected_Press" + label="" + tool_tip="Push to my Marketplace Storefront" + is_toggle="false" + name="outbox_sync_btn" + follows="top|right" + tab_stop="false" + halign="center" + top="6" + left="-50" + height="23" + width="32" + enabled="false" /> <loading_indicator follows="top|right" name="outbox_sync_indicator" - top="10" - left="-40" - height="16" - width="16" - images_per_sec="1.0" + top="6" + left="-50" + height="23" + width="32" + images_per_sec="1.15" tab_stop="false" visible="false"> <images> - <image name="Sync_Progress_1"/> - <image name="Sync_Progress_2"/> - <image name="Sync_Progress_3"/> - <image name="Sync_Progress_4"/> - <image name="Sync_Progress_5"/> - <image name="Sync_Progress_6"/> + <image name="OutboxPush_Progress_1"/> + <image name="OutboxPush_Progress_2"/> + <image name="OutboxPush_Progress_3"/> + <image name="OutboxPush_Progress_4"/> + <image name="OutboxPush_Progress_5"/> + <image name="OutboxPush_Progress_6"/> </images> </loading_indicator> <panel -- cgit v1.2.3 From cf31723a1a258e0452dd26d9f5eb5fcdac290e05 Mon Sep 17 00:00:00 2001 From: callum <none@none> Date: Mon, 6 Jun 2011 17:12:17 -0700 Subject: EXP-844 INITIAL CHECKIN - FUNCTION DISABLED - As a first time user I would like to see a video after I log in that highlights the best features of Second Life --- indra/newview/app_settings/settings.xml | 25 +++++- indra/newview/llmediactrl.cpp | 18 ++--- indra/newview/llprogressview.cpp | 88 +++++++++++++++++----- indra/newview/llprogressview.h | 20 ++++- indra/newview/llstartup.cpp | 3 +- indra/newview/llviewerwindow.cpp | 8 ++ indra/newview/llviewerwindow.h | 1 + .../skins/default/xui/en/panel_progress.xml | 8 ++ 8 files changed, 132 insertions(+), 39 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index cf5f522519..218a0534e6 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6535,8 +6535,29 @@ <key>Value</key> <integer>0</integer> </map> - - <key>PrecachingDelay</key> + <key>PostFirstLoginIntroURL</key> + <map> + <key>Comment</key> + <string>URL of intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string></string> + </map> + <key>PostFirstLoginIntroViewed</key> + <map> + <key>Comment</key> + <string>Flag indicating if user has seen intro presenatation after first time users first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <string>0</string> + </map> + <key>PrecachingDelay</key> <map> <key>Comment</key> <string>Delay when logging in to load world before showing it (seconds)</string> diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index b3ad9efeb2..03ccabc994 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -38,6 +38,7 @@ #include "llviewermedia.h" #include "llviewertexture.h" #include "llviewerwindow.h" +#include "lldebugmessagebox.h" #include "llweb.h" #include "llrender.h" #include "llpluginclassmedia.h" @@ -708,6 +709,8 @@ LLPluginClassMedia* LLMediaCtrl::getMediaPlugin() // void LLMediaCtrl::draw() { + F32 alpha = getDrawContext().mAlpha; + if ( gRestoreGL == 1 ) { LLRect r = getRect(); @@ -746,21 +749,11 @@ void LLMediaCtrl::draw() } } -// if(mHidingInitialLoad) -// { -// // If we're hiding loading, don't draw at all. -// draw_media = false; -// } - bool background_visible = isBackgroundVisible(); bool background_opaque = isBackgroundOpaque(); if(draw_media) { - // alpha off for this - LLGLSUIDefault gls_ui; - LLGLDisable gls_alphaTest( GL_ALPHA_TEST ); - gGL.pushUIMatrix(); { if (mIgnoreUIScale) @@ -775,7 +768,8 @@ void LLMediaCtrl::draw() // scale texture to fit the space using texture coords gGL.getTexUnit(0)->bind(media_texture); - gGL.color4fv( LLColor4::white.mV ); + LLColor4 media_color = LLColor4::white % alpha; + gGL.color4fv( media_color.mV ); F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth(); F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight(); @@ -827,7 +821,6 @@ void LLMediaCtrl::draw() } // draw the browser - gGL.setSceneBlendType(LLRender::BT_REPLACE); gGL.begin( LLRender::QUADS ); if (! media_plugin->getTextureCoordsOpenGL()) { @@ -860,7 +853,6 @@ void LLMediaCtrl::draw() gGL.vertex2i( x_offset + width, y_offset ); } gGL.end(); - gGL.setSceneBlendType(LLRender::BT_ALPHA); } gGL.popUIMatrix(); diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index 31fde5d58a..028891a90e 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -55,23 +55,18 @@ LLProgressView* LLProgressView::sInstance = NULL; S32 gStartImageWidth = 1; S32 gStartImageHeight = 1; -const F32 FADE_IN_TIME = 1.f; - -const std::string ANIMATION_FILENAME = "Login Sequence "; -const std::string ANIMATION_SUFFIX = ".jpg"; -const F32 TOTAL_LOGIN_TIME = 10.f; // seconds, wild guess at time from GL context to actual world view -S32 gLastStartAnimationFrame = 0; // human-style indexing, first image = 1 -const S32 ANIMATION_FRAMES = 1; //13; +const F32 FADE_TO_WORLD_TIME = 1.0f; static LLRegisterPanelClassWrapper<LLProgressView> r("progress_view"); - // XUI: Translate LLProgressView::LLProgressView() : LLPanel(), mPercentDone( 0.f ), + mMediaCtrl( NULL ), mMouseDownInActiveArea( false ), - mUpdateEvents("LLProgressView") + mUpdateEvents("LLProgressView"), + mFadeToWorldTimer() { mUpdateEvents.listen("self", boost::bind(&LLProgressView::handleUpdate, this, _1)); } @@ -80,9 +75,14 @@ BOOL LLProgressView::postBuild() { mProgressBar = getChild<LLProgressBar>("login_progress_bar"); + // media control that is used to play intro video + mMediaCtrl = getChild<LLMediaCtrl>("login_media_panel"); + mMediaCtrl->setVisible( false ); // hidden initially + mMediaCtrl->addObserver( this ); // watch events + mCancelBtn = getChild<LLButton>("cancel_btn"); mCancelBtn->setClickedCallback( LLProgressView::onCancelButtonClicked, NULL ); - mFadeTimer.stop(); + mFadeToWorldTimer.stop(); getChild<LLTextBox>("title_text")->setText(LLStringExplicit(LLAppViewer::instance()->getSecondLifeTitle())); @@ -125,24 +125,43 @@ BOOL LLProgressView::handleKeyHere(KEY key, MASK mask) return TRUE; } +void LLProgressView::revealIntroPanel() +{ + // if user hasn't yet seen intro video + std::string intro_url = gSavedSettings.getString("PostFirstLoginIntroURL"); + if ( intro_url.length() > 0 && + gSavedSettings.getBOOL("PostFirstLoginIntroViewed" ) == FALSE ) + { + // navigate to intro URL and reveal widget + mMediaCtrl->navigateTo( intro_url ); + mMediaCtrl->setVisible( TRUE ); + + // flag as having seen the new user post login intro + gSavedSettings.setBOOL("PostFirstLoginIntroViewed", TRUE ); + } + else + { + // start the timer that will control the fade through to the world view + mFadeToWorldTimer.start(); + } +} + void LLProgressView::setVisible(BOOL visible) { // hiding progress view if (getVisible() && !visible) { - mFadeTimer.start(); + LLPanel::setVisible(FALSE); } // showing progress view - else if (visible && (!getVisible() || mFadeTimer.getStarted())) + else if (visible && (!getVisible() || mFadeToWorldTimer.getStarted())) { setFocus(TRUE); - mFadeTimer.stop(); - mProgressTimer.start(); + mFadeToWorldTimer.stop(); LLPanel::setVisible(TRUE); } } - void LLProgressView::draw() { static LLTimer timer; @@ -153,7 +172,7 @@ void LLProgressView::draw() { LLGLSUIDefault gls_ui; gGL.getTexUnit(0)->bind(gStartTexture.get()); - gGL.color4f(1.f, 1.f, 1.f, mFadeTimer.getStarted() ? clamp_rescale(mFadeTimer.getElapsedTimeF32(), 0.f, FADE_IN_TIME, 1.f, 0.f) : 1.f); + gGL.color4f(1.f, 1.f, 1.f, 1.f); F32 image_aspect = (F32)gStartImageWidth / (F32)gStartImageHeight; S32 width = getRect().getWidth(); S32 height = getRect().getHeight(); @@ -180,16 +199,36 @@ void LLProgressView::draw() } glPopMatrix(); - // Handle fade-in animation - if (mFadeTimer.getStarted()) + // handle fade out to world view when we're asked to + if (mFadeToWorldTimer.getStarted()) { + // draw fading panel + F32 alpha = clamp_rescale(mFadeToWorldTimer.getElapsedTimeF32(), 0.f, FADE_TO_WORLD_TIME, 1.f, 0.f); + LLViewDrawContext context(alpha); LLPanel::draw(); - if (mFadeTimer.getElapsedTimeF32() > FADE_IN_TIME) + + // faded out completely - remove panel and reveal world + if (mFadeToWorldTimer.getElapsedTimeF32() > FADE_TO_WORLD_TIME ) { + mFadeToWorldTimer.stop(); + // Fade is complete, release focus gFocusMgr.releaseFocusIfNeeded( this ); + + // turn off panel that hosts intro so we see the world LLPanel::setVisible(FALSE); - mFadeTimer.stop(); + + // stop observing events since we no longer care + mMediaCtrl->remObserver( this ); + + // hide the intro + mMediaCtrl->setVisible( false ); + + // navigate away from intro page to something innocuous since 'unload' is broken right now + //mMediaCtrl->navigateTo( "about:blank" ); + + // FIXME: this causes a crash that i haven't been able to fix + mMediaCtrl->unloadMediaSource(); gStartTexture = NULL; } @@ -307,3 +346,12 @@ bool LLProgressView::onAlertModal(const LLSD& notify) } return false; } + +void LLProgressView::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if( event == MEDIA_EVENT_CLOSE_REQUEST ) + { + // the intro web content calls javascript::window.close() when it's done + mFadeToWorldTimer.start(); + } +} diff --git a/indra/newview/llprogressview.h b/indra/newview/llprogressview.h index be1744f08a..73dd478e98 100644 --- a/indra/newview/llprogressview.h +++ b/indra/newview/llprogressview.h @@ -28,6 +28,7 @@ #define LL_LLPROGRESSVIEW_H #include "llpanel.h" +#include "llmediactrl.h" #include "llframetimer.h" #include "llevents.h" @@ -35,7 +36,10 @@ class LLImageRaw; class LLButton; class LLProgressBar; -class LLProgressView : public LLPanel +class LLProgressView : + public LLPanel, + public LLViewerMediaObserver + { public: LLProgressView(); @@ -49,25 +53,35 @@ public: /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask); /*virtual*/ void setVisible(BOOL visible); + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + void setText(const std::string& text); void setPercent(const F32 percent); // Set it to NULL when you want to eliminate the message. void setMessage(const std::string& msg); + // turns on (under certain circumstances) the into video after login + void revealIntroPanel(); + void setCancelButtonVisible(BOOL b, const std::string& label); static void onCancelButtonClicked( void* ); static void onClickMessage(void*); bool onAlertModal(const LLSD& sd); + // note - this is not just hiding the intro panel - it also hides the parent panel + // and is used when the intro is finished and we want to show the world + void removeIntroPanel(); + protected: LLProgressBar* mProgressBar; + LLMediaCtrl* mMediaCtrl; F32 mPercentDone; std::string mMessage; LLButton* mCancelBtn; - LLFrameTimer mFadeTimer; - LLFrameTimer mProgressTimer; + LLFrameTimer mFadeToWorldTimer; LLRect mOutlineRect; bool mMouseDownInActiveArea; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 86b09473ab..167dd68f08 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1953,7 +1953,8 @@ bool idle_startup() gViewerWindow->getWindow()->resetBusyCount(); gViewerWindow->getWindow()->setCursor(UI_CURSOR_ARROW); LL_DEBUGS("AppInit") << "Done releasing bitmap" << LL_ENDL; - gViewerWindow->setShowProgress(FALSE); + gViewerWindow->revealIntroPanel(); + //gViewerWindow->setShowProgress(FALSE); // reveal intro video now handles this gViewerWindow->setProgressCancelButtonVisible(FALSE); // We're not away from keyboard, even though login might have taken diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 34d15a597e..4ecb645337 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -4512,6 +4512,14 @@ void LLViewerWindow::setup3DViewport(S32 x_offset, S32 y_offset) glViewport(gGLViewport[0], gGLViewport[1], gGLViewport[2], gGLViewport[3]); } +void LLViewerWindow::revealIntroPanel() +{ + if (mProgressView) + { + mProgressView->revealIntroPanel(); + } +} + void LLViewerWindow::setShowProgress(const BOOL show) { if (mProgressView) diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index df6928aa1d..ff49ed1f62 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -271,6 +271,7 @@ public: void setProgressMessage(const std::string& msg); void setProgressCancelButtonVisible( BOOL b, const std::string& label = LLStringUtil::null ); LLProgressView *getProgressView() const; + void revealIntroPanel(); void updateObjectUnderCursor(); diff --git a/indra/newview/skins/default/xui/en/panel_progress.xml b/indra/newview/skins/default/xui/en/panel_progress.xml index 2868d91cc7..4535c56339 100644 --- a/indra/newview/skins/default/xui/en/panel_progress.xml +++ b/indra/newview/skins/default/xui/en/panel_progress.xml @@ -132,4 +132,12 @@ name="cancel_btn" top="700" width="90" /> + <web_browser + follows="all" + layout="topleft" + left="0" + name="login_media_panel" + width="1024" + height="768" + top="0"/> </panel> -- cgit v1.2.3 From 1aed9849285b574346087eb5ac7e0c8038fa21fe Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Tue, 7 Jun 2011 13:57:19 -0700 Subject: EXP-865 PROGRESS -- Modify LLBadge to allow it to hang off of non-buttons Added the following for increased LLBadge functionality: * Panels now choose whether or not they accept buttons as children, which they do by default. * UI controls now shuffle controls with "requests_front" to the front of their children list at postBuild time. * Badges are set to "requests_front" by default * Badges now accept border image and color attributes Reviewed by Callum --- indra/llui/llbadge.cpp | 11 +++++++ indra/llui/llbadge.h | 6 ++++ indra/llui/llbutton.cpp | 2 +- indra/llui/llbutton.h | 2 +- indra/llui/llpanel.cpp | 8 +++-- indra/llui/llpanel.h | 5 +++ indra/llui/lluictrl.cpp | 36 +++++++++++++++++++++- indra/llui/lluictrl.h | 8 +++-- indra/newview/skins/default/colors.xml | 2 +- .../newview/skins/default/xui/en/widgets/badge.xml | 5 ++- .../newview/skins/default/xui/en/widgets/panel.xml | 3 +- 11 files changed, 78 insertions(+), 10 deletions(-) diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index ea934aa93b..e4c64e327e 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -38,6 +38,8 @@ template class LLBadge* LLView::getChild<class LLBadge>(const std::string& name, LLBadge::Params::Params() : image("image") + , border_image("border_image") + , border_color("border_color") , image_color("image_color") , label("label") , label_color("label_color") @@ -57,6 +59,8 @@ bool LLBadge::Params::equals(const Params& a) const // skip owner in comparison on purpose + comp &= (border_image() == a.border_image()); + comp &= (border_color() == a.border_color()); comp &= (image() == a.image()); comp &= (image_color() == a.image_color()); comp &= (label() == a.label()); @@ -73,6 +77,8 @@ bool LLBadge::Params::equals(const Params& a) const LLBadge::LLBadge(const LLBadge::Params& p) : LLUICtrl(p) , mOwner(p.owner) + , mBorderImage(p.border_image) + , mBorderColor(p.border_color) , mGLFont(p.font) , mImage(p.image) , mImageColor(p.image_color) @@ -216,6 +222,11 @@ void LLBadge::draw() F32 badge_y = badge_center_y - badge_height * 0.5f; mImage->drawSolid(badge_x, badge_y, badge_width, badge_height, mImageColor % alpha); + + if (!mBorderImage.isNull()) + { + mBorderImage->drawSolid(badge_x, badge_y, badge_width, badge_height, mBorderColor % alpha); + } } else { diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index c2e0a763b2..05a76af42c 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -94,6 +94,9 @@ public: { Optional< LLHandle<LLUICtrl> > owner; // Mandatory in code but not in xml + Optional< LLUIImage* > border_image; + Optional< LLUIColor > border_color; + Optional< LLUIImage* > image; Optional< LLUIColor > image_color; @@ -126,6 +129,9 @@ public: void setLabel( const LLStringExplicit& label); private: + LLPointer< LLUIImage > mBorderImage; + LLUIColor mBorderColor; + const LLFontGL* mGLFont; LLPointer< LLUIImage > mImage; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index a63281b3c1..c841933a5f 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -1098,7 +1098,7 @@ void LLButton::addBadgeToParentPanel() { parentPanel = dynamic_cast<LLPanel*>(parent); - if (parentPanel != NULL) + if (parentPanel && parentPanel->acceptsBadge()) { break; } diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 232ab81e0d..07f0395719 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -125,7 +125,7 @@ public: Optional<F32> hover_glow_amount; Optional<TimeIntervalParam> held_down_delay; - Optional<bool> use_draw_context_alpha; + Optional<bool> use_draw_context_alpha; Optional<LLBadge::Params> badge; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index b2383106a8..1dcdd79efa 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -87,7 +87,8 @@ LLPanel::Params::Params() filename("filename"), class_name("class"), help_topic("help_topic"), - visible_callback("visible_callback") + visible_callback("visible_callback"), + accepts_badge("accepts_badge") { name = "panel"; addSynonym(background_visible, "bg_visible"); @@ -113,7 +114,8 @@ LLPanel::LLPanel(const LLPanel::Params& p) mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename), - mVisibleSignal(NULL) + mVisibleSignal(NULL), + mAcceptsBadge(p.accepts_badge) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { @@ -485,6 +487,8 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgAlphaImage = p.bg_alpha_image(); mBgOpaqueImageOverlay = p.bg_opaque_image_overlay; mBgAlphaImageOverlay = p.bg_alpha_image_overlay; + + mAcceptsBadge = p.accepts_badge; } static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 7bbbeaf709..67674fab7e 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -89,6 +89,8 @@ public: Multiple<LocalizedString> strings; Optional<CommitCallbackParam> visible_callback; + + Optional<bool> accepts_badge; Params(); }; @@ -250,6 +252,8 @@ public: boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb ); + bool acceptsBadge() const { return mAcceptsBadge; } + protected: // Override to set not found list LLButton* getDefaultButton() { return mDefaultBtn; } @@ -264,6 +268,7 @@ protected: static factory_stack_t sFactoryStack; private: + bool mAcceptsBadge; BOOL mBgVisible; // any background at all? BOOL mBgOpaque; // use opaque color or image LLUIColor mBgOpaqueColor; diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0a06b5e74f..d58df5801b 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -68,6 +68,7 @@ LLUICtrl::ControlVisibility::ControlVisibility() LLUICtrl::Params::Params() : tab_stop("tab_stop", true), chrome("chrome", false), + requests_front("requests_front", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -96,9 +97,10 @@ const LLUICtrl::Params& LLUICtrl::getDefaultParams() LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel) : LLView(p), - mTentative(FALSE), mIsChrome(FALSE), + mRequestsFront(p.requests_front), mTabStop(FALSE), + mTentative(FALSE), mViewModel(viewmodel), mControlVariable(NULL), mEnabledControlVariable(NULL), @@ -123,6 +125,8 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + mRequestsFront = p.requests_front; + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) @@ -403,6 +407,36 @@ LLViewModel* LLUICtrl::getViewModel() const return mViewModel; } +//virtual +BOOL LLUICtrl::postBuild() +{ + // + // Find all of the children that want to be in front and move them to the front + // + + if (getChildCount() > 0) + { + std::vector<LLUICtrl*> childrenToMoveToFront; + + for (LLView::child_list_const_iter_t child_it = beginChild(); child_it != endChild(); ++child_it) + { + LLUICtrl* uictrl = dynamic_cast<LLUICtrl*>(*child_it); + + if (uictrl && uictrl->mRequestsFront) + { + childrenToMoveToFront.push_back(uictrl); + } + } + + for (std::vector<LLUICtrl*>::iterator it = childrenToMoveToFront.begin(); it != childrenToMoveToFront.end(); ++it) + { + sendChildToFront(*it); + } + } + + return LLView::postBuild(); +} + bool LLUICtrl::setControlValue(const LLSD& value) { if (mControlVariable) diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index b37e9f6b1b..09bed9b958 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -94,7 +94,8 @@ public: { Optional<std::string> label; Optional<bool> tab_stop, - chrome; + chrome, + requests_front; Optional<LLSD> initial_value; Optional<CommitCallbackParam> init_callback, @@ -143,6 +144,8 @@ protected: virtual LLViewModel* getViewModel() const; // We shouldn't ever need to set this directly //virtual void setViewModel(const LLViewModelPtr&); + + virtual BOOL postBuild(); public: // LLView interface @@ -301,8 +304,9 @@ protected: private: - BOOL mTabStop; BOOL mIsChrome; + BOOL mRequestsFront; + BOOL mTabStop; BOOL mTentative; LLRootHandle<LLUICtrl> mUICtrlHandle; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index a548849d60..efd2559a55 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -136,7 +136,7 @@ name="BadgeImageColor" value="0.44 0.69 0.56 1.0" /> <color - name="BadgeImageBorderColor" + name="BadgeBorderColor" value="0.9 0.9 0.9 1.0" /> <color name="BadgeLabelColor" diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml index ceec09d1e4..f77c4b7178 100644 --- a/indra/newview/skins/default/xui/en/widgets/badge.xml +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -1,7 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <!-- Additional attributes: --> -<badge font="SansSerifSmall" +<badge border_image="Badge_Border" + border_color="BadgeBorderColor" + font="SansSerifSmall" image="Badge_Background" image_color="BadgeImageColor" label_color="BadgeLabelColor" @@ -10,5 +12,6 @@ location_percent_vcenter="85" padding_horiz="7" padding_vert="4" + requests_front="true" > </badge> diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index 9bf99fa363..47a210d9b7 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -10,4 +10,5 @@ bg_alpha_image_overlay="White" background_visible="false" background_opaque="false" - chrome="false"/> \ No newline at end of file + chrome="false" + accepts_badge="true"/> \ No newline at end of file -- cgit v1.2.3 From d8e84f85c9377a9bfd628d61ee1a661c31f3db84 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Tue, 7 Jun 2011 14:53:05 -0700 Subject: Fixing precompiled headers with outbox coroutine usage. Reviewed by Leyla. --- indra/newview/llpanelmarketplaceoutbox.cpp | 3 +-- indra/newview/llviewerprecompiledheaders.h | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 822286783f..96695becf0 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -24,8 +24,7 @@ * $/LicenseInfo$ */ -#include <boost/coroutine/coroutine.hpp> -#include <boost/coroutine/future.hpp> +#include "llviewerprecompiledheaders.h" #include "llpanelmarketplaceoutbox.h" diff --git a/indra/newview/llviewerprecompiledheaders.h b/indra/newview/llviewerprecompiledheaders.h index 45c9b3e91f..252183b6d7 100644 --- a/indra/newview/llviewerprecompiledheaders.h +++ b/indra/newview/llviewerprecompiledheaders.h @@ -33,6 +33,8 @@ // in viewer. // It is used to precompile headers for improved build speed. +#include <boost/coroutine/coroutine.hpp> + #include "linden_common.h" // Work around stupid Microsoft STL warning -- cgit v1.2.3 From 888b39c283e53fd128778e70e231bcb6053de4b8 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 8 Jun 2011 13:14:15 -0700 Subject: EXP-865 PROGRESS -- Modify LLBadge to allow it to hang off of non-buttons Moved LLBadge use from LLButton into a separate LLBadgeOwner class. LLButton now derives from LLBadgeOwner which handles the bulk of the badge management. --- indra/llui/CMakeLists.txt | 2 + indra/llui/llbadgeowner.cpp | 116 ++++++++++++++++++++++++++++++++++++++++++++ indra/llui/llbadgeowner.h | 58 ++++++++++++++++++++++ indra/llui/llbutton.cpp | 87 +++------------------------------ indra/llui/llbutton.h | 10 +--- 5 files changed, 185 insertions(+), 88 deletions(-) create mode 100644 indra/llui/llbadgeowner.cpp create mode 100644 indra/llui/llbadgeowner.h diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index fb585e062c..e9283788bd 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -29,6 +29,7 @@ set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp llbadge.cpp + llbadgeowner.cpp llbutton.cpp llcheckboxctrl.cpp llclipboard.cpp @@ -121,6 +122,7 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h llbadge.h + llbadgeowner.h llbutton.h llcallbackmap.h llcheckboxctrl.h diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp new file mode 100644 index 0000000000..c77cf21ae0 --- /dev/null +++ b/indra/llui/llbadgeowner.cpp @@ -0,0 +1,116 @@ +/** + * @file llbadgeowner.cpp + * @brief Class to manage badges attached to a UI control + * + * $LicenseInfo:firstyear=2001&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 "linden_common.h" + +#include "llbadgeowner.h" +#include "llpanel.h" + +// +// Classes +// + +LLBadgeOwner::LLBadgeOwner(LLHandle<LLUICtrl> ctrlHandle) + : mBadge(NULL) + , mBadgeOwnerCtrl(ctrlHandle) +{ +} + +void LLBadgeOwner::initBadgeParams(const LLBadge::Params& p) +{ + if (!p.equals(LLUICtrlFactory::getDefaultParams<LLBadge>())) + { + mBadge = createBadge(p); + } +} + +void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label) +{ + if (mBadge == NULL) + { + mBadge = createBadge(LLUICtrlFactory::getDefaultParams<LLBadge>()); + + addBadgeToParentPanel(); + } + + if (mBadge) + { + mBadge->setLabel(label); + + // + // Push the badge to the front so it renders on top + // + + LLUICtrl * parent = mBadge->getParentUICtrl(); + + if (parent) + { + parent->sendChildToFront(mBadge); + } + } +} + +void LLBadgeOwner::addBadgeToParentPanel() +{ + if (mBadge && mBadgeOwnerCtrl.get()) + { + // Find the appropriate parent panel for the badge + + LLUICtrl * owner_ctrl = mBadgeOwnerCtrl.get(); + LLUICtrl * parent = owner_ctrl->getParentUICtrl(); + + LLPanel * parentPanel = NULL; + + while (parent) + { + parentPanel = dynamic_cast<LLPanel *>(parent); + + if (parentPanel && parentPanel->acceptsBadge()) + { + break; + } + + parent = parent->getParentUICtrl(); + } + + if (parentPanel) + { + parentPanel->addChild(mBadge); + } + else + { + llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on ui control " << owner_ctrl->getName() << llendl; + } + } +} + +LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p) +{ + LLBadge::Params badge_params(p); + badge_params.owner = mBadgeOwnerCtrl; + + return LLUICtrlFactory::create<LLBadge>(badge_params); +} diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h new file mode 100644 index 0000000000..7b2bbe01fd --- /dev/null +++ b/indra/llui/llbadgeowner.h @@ -0,0 +1,58 @@ +/** + * @file llbadgeowner.h + * @brief Header for badge owners + * + * $LicenseInfo:firstyear=2001&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_LLBADGEOWNER_H +#define LL_LLBADGEOWNER_H + +#include "llbadge.h" +#include "lluictrl.h" + +// +// Classes +// + +class LLBadgeOwner +{ +public: + + LLBadgeOwner(LLHandle<LLUICtrl> ctrlHandle); + + void initBadgeParams(const LLBadge::Params& p); + void addBadgeToParentPanel(); + + void setBadgeLabel(const LLStringExplicit& label); + +private: + + LLBadge* createBadge(const LLBadge::Params& p); + +private: + + LLBadge* mBadge; + LLHandle<LLUICtrl> mBadgeOwnerCtrl; +}; + +#endif // LL_LLBADGEOWNER_H diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index c841933a5f..ecad38894c 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -113,6 +113,7 @@ LLButton::Params::Params() LLButton::LLButton(const LLButton::Params& p) : LLUICtrl(p), + LLBadgeOwner(getUICtrlHandle()), mMouseDownFrame(0), mMouseHeldDownCount(0), mBorderEnabled( FALSE ), @@ -164,8 +165,7 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownSignal(NULL), mMouseUpSignal(NULL), mHeldDownSignal(NULL), - mUseDrawContextAlpha(p.use_draw_context_alpha), - mBadge(NULL) + mUseDrawContextAlpha(p.use_draw_context_alpha) { static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>()); @@ -248,16 +248,10 @@ LLButton::LLButton(const LLButton::Params& p) { setHeldDownCallback(initCommitCallback(p.mouse_held_callback)); } - - // Only create a badge here if a non-default one was provided. + if (p.badge.isProvided()) { - if (!p.badge().equals(LLUICtrlFactory::getDefaultParams<LLBadge>())) - { - LLBadge::Params badge_params(p.badge()); - badge_params.owner = getUICtrlHandle(); - mBadge = LLUICtrlFactory::create<LLBadge>(badge_params); - } + LLBadgeOwner::initBadgeParams(p.badge()); } } @@ -343,14 +337,11 @@ BOOL LLButton::postBuild() { autoResize(); - // Attach the badge to the appropriate parent panel - if (mBadge) - { - addBadgeToParentPanel(); - } + addBadgeToParentPanel(); - return TRUE; + return LLUICtrl::postBuild(); } + BOOL LLButton::handleUnicodeCharHere(llwchar uni_char) { BOOL handled = FALSE; @@ -1085,70 +1076,6 @@ void LLButton::setImageOverlay(const LLUUID& image_id, LLFontGL::HAlign alignmen } } -void LLButton::addBadgeToParentPanel() -{ - if (mBadge) - { - // Find the appropriate parent panel for the badge - - LLPanel * parentPanel = NULL; - LLUICtrl * parent = getParentUICtrl(); - - while (parent) - { - parentPanel = dynamic_cast<LLPanel*>(parent); - - if (parentPanel && parentPanel->acceptsBadge()) - { - break; - } - - parent = parent->getParentUICtrl(); - } - - if (parentPanel) - { - parentPanel->addChild(mBadge); - } - else - { - llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on button " << getName() << llendl; - } - } - else - { - llwarns << "Unable to add NULL badge to button " << getName() << llendl; - } -} - -void LLButton::setBadgeLabel(const LLStringExplicit& label) -{ - if (mBadge == NULL) - { - LLBadge::Params badge_params(LLUICtrlFactory::getDefaultParams<LLBadge>()); - badge_params.owner = getUICtrlHandle(); - mBadge = LLUICtrlFactory::create<LLBadge>(badge_params); - - addBadgeToParentPanel(); - } - - if (mBadge) - { - mBadge->setLabel(label); - - // - // Push the badge to the front so it renders last - // - - LLUICtrl * parent = mBadge->getParentUICtrl(); - - if (parent) - { - parent->sendChildToFront(mBadge); - } - } -} - void LLButton::onMouseCaptureLost() { resetMouseDownTimer(); diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 07f0395719..5880a0e1f2 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -28,7 +28,7 @@ #define LL_LLBUTTON_H #include "lluuid.h" -#include "llbadge.h" +#include "llbadgeowner.h" #include "llcontrol.h" #include "lluictrl.h" #include "v4color.h" @@ -60,7 +60,7 @@ class LLUICtrlFactory; // class LLButton -: public LLUICtrl +: public LLUICtrl, public LLBadgeOwner { public: struct Params @@ -252,8 +252,6 @@ public: void setImageFlash(LLPointer<LLUIImage> image); void setImagePressed(LLPointer<LLUIImage> image); - void setBadgeLabel(const LLStringExplicit& label); - void setCommitOnReturn(BOOL commit) { mCommitOnReturn = commit; } BOOL getCommitOnReturn() const { return mCommitOnReturn; } @@ -271,8 +269,6 @@ protected: LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; } LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; } - void addBadgeToParentPanel(); - LLFrameTimer mMouseDownTimer; private: @@ -363,8 +359,6 @@ private: bool mForcePressedState; LLFrameTimer mFlashingTimer; - - LLBadge* mBadge; }; // Build time optimization, generate once in .cpp file -- cgit v1.2.3 From 86470d3889436017264a69d57fb2060a591955f4 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 8 Jun 2011 15:46:34 -0700 Subject: Fixed to allow param blocks to exceed 64k, even though the size makes me wince. Modified viewer window to not create a navigation bar on exit if one doesn't yet exist. Reviewed by Richard. --- indra/llui/tests/llurlmatch_test.cpp | 2 +- indra/llxuixml/llinitparam.cpp | 2 +- indra/llxuixml/llinitparam.h | 7 +++++-- indra/newview/llviewerwindow.cpp | 5 ++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/indra/llui/tests/llurlmatch_test.cpp b/indra/llui/tests/llurlmatch_test.cpp index e09ef33d49..3cd61e574e 100644 --- a/indra/llui/tests/llurlmatch_test.cpp +++ b/indra/llui/tests/llurlmatch_test.cpp @@ -95,7 +95,7 @@ namespace LLInitParam { const U8* my_addr = reinterpret_cast<const U8*>(this); const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); - mEnclosingBlockOffset = (U16)(my_addr - block_addr); + mEnclosingBlockOffset = 0x7FFFffff & ((U32)(my_addr - block_addr)); } bool BaseBlock::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, S32 generation){ return true; } diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp index b3312798dd..c024fd405e 100644 --- a/indra/llxuixml/llinitparam.cpp +++ b/indra/llxuixml/llinitparam.cpp @@ -40,7 +40,7 @@ namespace LLInitParam { const U8* my_addr = reinterpret_cast<const U8*>(this); const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block); - mEnclosingBlockOffset = (U16)(my_addr - block_addr); + mEnclosingBlockOffset = 0x7FFFffff & ((U32)(my_addr - block_addr)); } // diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index a853999e94..35c889b69f 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -34,6 +34,8 @@ #include <boost/unordered_map.hpp> #include <boost/shared_ptr.hpp> +#include "llerror.h" + namespace LLInitParam { template<typename T> const T& defaultValue() { static T value; return value; } @@ -302,8 +304,9 @@ namespace LLInitParam private: friend class BaseBlock; - U16 mEnclosingBlockOffset; - bool mIsProvided; + U32 mEnclosingBlockOffset:31; + U32 mIsProvided:1; + }; // various callbacks and constraints associated with an individual param diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 4ecb645337..e97f0fcc2e 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1979,7 +1979,10 @@ void LLViewerWindow::shutdownViews() // destroy the nav bar, not currently part of gViewerWindow // *TODO: Make LLNavigationBar part of gViewerWindow - delete LLNavigationBar::getInstance(); + if (LLNavigationBar::instanceExists()) + { + delete LLNavigationBar::getInstance(); + } // destroy menus after instantiating navbar above, as it needs // access to gMenuHolder -- cgit v1.2.3 From def85f2778d9b69bc3fb0e89c1cef854a1c01886 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Thu, 9 Jun 2011 12:12:28 -0700 Subject: EXP-865 FIX -- Modify LLBadge to allow it to hang off of non-buttons LLBadgeOwner now only depends on LLView instead of LLUICtrl Sidebar Tab Buttons now can support badges Reviewed by Leyla --- indra/llui/llbadge.cpp | 8 ++++---- indra/llui/llbadge.h | 5 +++-- indra/llui/llbadgeowner.cpp | 30 +++++++++++++++--------------- indra/llui/llbadgeowner.h | 6 +++--- indra/llui/llbutton.cpp | 2 +- indra/newview/llsidetray.cpp | 17 ++++++++++++++--- 6 files changed, 40 insertions(+), 28 deletions(-) diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index e4c64e327e..53db226b20 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -178,16 +178,16 @@ void LLBadge::draw() { if (!mLabel.empty()) { - LLUICtrl* owner_ctrl = mOwner.get(); + LLView* owner_view = mOwner.get(); - if (owner_ctrl) + if (owner_view) { // // Calculate badge position based on owner // LLRect owner_rect; - owner_ctrl->localRectToOtherView(owner_ctrl->getLocalRect(), & owner_rect, this); + owner_view->localRectToOtherView(owner_view->getLocalRect(), & owner_rect, this); F32 badge_center_x = owner_rect.mLeft + owner_rect.getWidth() * mLocationPercentHCenter; F32 badge_center_y = owner_rect.mBottom + owner_rect.getHeight() * mLocationPercentVCenter; @@ -230,7 +230,7 @@ void LLBadge::draw() } else { - lldebugs << "No image for badge " << getName() << " on owner " << owner_ctrl->getName() << llendl; + lldebugs << "No image for badge " << getName() << " on owner " << owner_view->getName() << llendl; renderBadgeBackground(badge_center_x, badge_center_y, badge_width, badge_height, diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index 05a76af42c..0f923ef01b 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -33,6 +33,7 @@ #include "lluictrl.h" #include "llstring.h" #include "lluiimage.h" +#include "llview.h" // // Declarations @@ -92,7 +93,7 @@ public: struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { - Optional< LLHandle<LLUICtrl> > owner; // Mandatory in code but not in xml + Optional< LLHandle<LLView> > owner; // Mandatory in code but not in xml Optional< LLUIImage* > border_image; Optional< LLUIColor > border_color; @@ -144,7 +145,7 @@ private: F32 mLocationPercentHCenter; F32 mLocationPercentVCenter; - LLHandle< LLUICtrl > mOwner; + LLHandle< LLView > mOwner; F32 mPaddingHoriz; F32 mPaddingVert; diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index c77cf21ae0..11f1463b9b 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -33,9 +33,9 @@ // Classes // -LLBadgeOwner::LLBadgeOwner(LLHandle<LLUICtrl> ctrlHandle) +LLBadgeOwner::LLBadgeOwner(LLHandle< LLView > viewHandle) : mBadge(NULL) - , mBadgeOwnerCtrl(ctrlHandle) + , mBadgeOwnerView(viewHandle) { } @@ -64,7 +64,7 @@ void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label) // Push the badge to the front so it renders on top // - LLUICtrl * parent = mBadge->getParentUICtrl(); + LLView * parent = mBadge->getParent(); if (parent) { @@ -75,34 +75,34 @@ void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label) void LLBadgeOwner::addBadgeToParentPanel() { - if (mBadge && mBadgeOwnerCtrl.get()) + LLView * owner_view = mBadgeOwnerView.get(); + + if (mBadge && owner_view) { // Find the appropriate parent panel for the badge - LLUICtrl * owner_ctrl = mBadgeOwnerCtrl.get(); - LLUICtrl * parent = owner_ctrl->getParentUICtrl(); - - LLPanel * parentPanel = NULL; + LLView * parent = owner_view->getParent(); + LLPanel * parent_panel = NULL; while (parent) { - parentPanel = dynamic_cast<LLPanel *>(parent); + parent_panel = dynamic_cast<LLPanel *>(parent); - if (parentPanel && parentPanel->acceptsBadge()) + if (parent_panel && parent_panel->acceptsBadge()) { break; } - parent = parent->getParentUICtrl(); + parent = parent->getParent(); } - if (parentPanel) + if (parent_panel) { - parentPanel->addChild(mBadge); + parent_panel->addChild(mBadge); } else { - llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on ui control " << owner_ctrl->getName() << llendl; + llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on " << owner_view->getName() << llendl; } } } @@ -110,7 +110,7 @@ void LLBadgeOwner::addBadgeToParentPanel() LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p) { LLBadge::Params badge_params(p); - badge_params.owner = mBadgeOwnerCtrl; + badge_params.owner = mBadgeOwnerView; return LLUICtrlFactory::create<LLBadge>(badge_params); } diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h index 7b2bbe01fd..456ef90c13 100644 --- a/indra/llui/llbadgeowner.h +++ b/indra/llui/llbadgeowner.h @@ -28,7 +28,7 @@ #define LL_LLBADGEOWNER_H #include "llbadge.h" -#include "lluictrl.h" +#include "llview.h" // // Classes @@ -38,7 +38,7 @@ class LLBadgeOwner { public: - LLBadgeOwner(LLHandle<LLUICtrl> ctrlHandle); + LLBadgeOwner(LLHandle< LLView > viewHandle); void initBadgeParams(const LLBadge::Params& p); void addBadgeToParentPanel(); @@ -52,7 +52,7 @@ private: private: LLBadge* mBadge; - LLHandle<LLUICtrl> mBadgeOwnerCtrl; + LLHandle< LLView > mBadgeOwnerView; }; #endif // LL_LLBADGEOWNER_H diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 907dc31721..637024e513 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -110,7 +110,7 @@ LLButton::Params::Params() LLButton::LLButton(const LLButton::Params& p) : LLUICtrl(p), - LLBadgeOwner(getUICtrlHandle()), + LLBadgeOwner(LLView::getHandle()), mMouseDownFrame(0), mMouseHeldDownCount(0), mBorderEnabled( FALSE ), diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 631b244785..fe3f2568bc 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -30,6 +30,7 @@ #include "llagentcamera.h" #include "llappviewer.h" +#include "llbadgeowner.h" #include "llbottomtray.h" #include "llfloaterreg.h" #include "llfirstuse.h" @@ -98,7 +99,7 @@ bool LLSideTray::instanceCreated () // Represents a single tab in the side tray, only used by LLSideTray ////////////////////////////////////////////////////////////////////////////// -class LLSideTrayTab: public LLPanel +class LLSideTrayTab: public LLPanel, public LLBadgeOwner { LOG_CLASS(LLSideTrayTab); friend class LLUICtrlFactory; @@ -113,11 +114,14 @@ public: Optional<std::string> image_selected; Optional<std::string> tab_title; Optional<std::string> description; + Optional<LLBadge::Params> badge; + Params() : image("image"), image_selected("image_selected"), tab_title("tab_title","no title"), - description("description","no description") + description("description","no description"), + badge("badge") {}; }; protected: @@ -162,12 +166,17 @@ private: LLSideTrayTab::LLSideTrayTab(const Params& p) : LLPanel(), + LLBadgeOwner(LLView::getHandle()), mTabTitle(p.tab_title), mImage(p.image), mImageSelected(p.image_selected), mDescription(p.description), mMainPanel(NULL) { + if (p.badge.isProvided()) + { + LLBadgeOwner::initBadgeParams(p.badge()); + } } LLSideTrayTab::~LLSideTrayTab() @@ -196,7 +205,9 @@ BOOL LLSideTrayTab::postBuild() getChild<LLButton>("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, false)); getChild<LLButton>("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, true)); - return true; + addBadgeToParentPanel(); + + return LLPanel::postBuild(); } static const S32 splitter_margin = 1; -- cgit v1.2.3 From 7847c8941f8c78ab7cdef65aadf4dfccf645bbf3 Mon Sep 17 00:00:00 2001 From: callum <none@none> Date: Thu, 9 Jun 2011 13:48:35 -0700 Subject: EXP-676 FIX As a web developer, I want to access information about the current state of the SL client, such as avatar location --- autobuild.xml | 8 +-- indra/llplugin/llpluginclassmedia.cpp | 18 +----- indra/llplugin/llpluginclassmedia.h | 3 +- indra/media_plugins/webkit/media_plugin_webkit.cpp | 36 ++++++----- indra/newview/llviewermedia.cpp | 69 +++++++++++----------- 5 files changed, 64 insertions(+), 70 deletions(-) diff --git a/autobuild.xml b/autobuild.xml index b59e3757c4..3fb0d6a9be 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -1206,9 +1206,9 @@ <key>archive</key> <map> <key>hash</key> - <string>82798d0da3ac3d97c91517a575d9ea1c</string> + <string>a7c80fd8516df3b879b669b2b220067f</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110526.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/Darwin/installer/llqtwebkit-4.7.1-darwin-20110608.tar.bz2</string> </map> <key>name</key> <string>darwin</string> @@ -1230,9 +1230,9 @@ <key>archive</key> <map> <key>hash</key> - <string>f0708d18943a05013493f69ab7dc6429</string> + <string>b9cc0333cc274c9cc40256ab7146b4fc</string> <key>url</key> - <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/231093/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110526.tar.bz2</string> + <string>http://automated-builds-secondlife-com.s3.amazonaws.com/hg/repo/3p-llqtwebkit/rev/232420/arch/CYGWIN/installer/llqtwebkit-4.7.1-windows-20110608.tar.bz2</string> </map> <key>name</key> <string>windows</string> diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 8f161201f4..d3d0403bbb 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -436,27 +436,15 @@ std::string LLPluginClassMedia::translateModifiers(MASK modifiers) return result; } -void LLPluginClassMedia::jsExposeObjectEvent( bool expose ) +void LLPluginClassMedia::jsEnableObject( bool enable ) { if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) { return; } - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_expose_object"); - message.setValueBoolean( "expose", expose ); - sendMessage( message ); -} - -void LLPluginClassMedia::jsValuesValidEvent( bool valid ) -{ - if( ! mPlugin || !mPlugin->isRunning() || mPlugin->isBlocked() ) - { - return; - } - - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_values_valid"); - message.setValueBoolean( "valid", valid ); + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "js_enable_object"); + message.setValueBoolean( "enable", enable ); sendMessage( message ); } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index c061390699..f8ed89f644 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -119,8 +119,7 @@ public: void scrollEvent(int x, int y, MASK modifiers); // Javascript <-> viewer events - void jsExposeObjectEvent( bool expose ); - void jsValuesValidEvent( bool valid ); + void jsEnableObject( bool enable ); void jsAgentLocationEvent( double x, double y, double z ); void jsAgentGlobalLocationEvent( double x, double y, double z ); void jsAgentOrientationEvent( double angle ); diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 27f3c7260e..fca071c628 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1168,19 +1168,11 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) authResponse(message_in); } else - if(message_name == "js_expose_object") + if(message_name == "js_enable_object") { #if LLQTWEBKIT_API_VERSION >= 9 - bool expose_object = message_in.getValueBoolean( "expose" ); - LLQtWebKit::getInstance()->setExposeObject( expose_object ); -#endif - } - else - if(message_name == "js_values_valid") - { -#if LLQTWEBKIT_API_VERSION >= 9 - bool valid = message_in.getValueBoolean( "valid" ); - LLQtWebKit::getInstance()->setValuesValid( valid ); + bool enable = message_in.getValueBoolean( "enable" ); + LLQtWebKit::getInstance()->setSLObjectEnabled( enable ); #endif } else @@ -1191,6 +1183,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) F32 y = message_in.getValueReal("y"); F32 z = message_in.getValueReal("z"); LLQtWebKit::getInstance()->setAgentLocation( x, y, z ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1201,6 +1194,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) F32 y = message_in.getValueReal("y"); F32 z = message_in.getValueReal("z"); LLQtWebKit::getInstance()->setAgentGlobalLocation( x, y, z ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1209,6 +1203,7 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) #if LLQTWEBKIT_API_VERSION >= 9 F32 angle = message_in.getValueReal("angle"); LLQtWebKit::getInstance()->setAgentOrientation( angle ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else @@ -1217,14 +1212,25 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) #if LLQTWEBKIT_API_VERSION >= 9 const std::string& region = message_in.getValue("region"); LLQtWebKit::getInstance()->setAgentRegion( region ); + LLQtWebKit::getInstance()->emitLocation(); #endif } else - if(message_name == "js_agent_maturity") + if(message_name == "js_agent_maturity") + { +#if LLQTWEBKIT_API_VERSION >= 9 + const std::string& maturity = message_in.getValue("maturity"); + LLQtWebKit::getInstance()->setAgentMaturity( maturity ); + LLQtWebKit::getInstance()->emitMaturity(); +#endif + } + else + if(message_name == "js_agent_language") { #if LLQTWEBKIT_API_VERSION >= 9 - const std::string& maturity = message_in.getValue("maturity"); - LLQtWebKit::getInstance()->setAgentMaturity( maturity ); + const std::string& language = message_in.getValue("language"); + LLQtWebKit::getInstance()->setAgentLanguage( language ); + LLQtWebKit::getInstance()->emitLanguage(); #endif } else @@ -1384,3 +1390,5 @@ int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void return 0; } + + diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1e53274cd6..b94da4b64c 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2349,43 +2349,42 @@ void LLViewerMediaImpl::updateJavascriptObject() if ( mMediaSource ) { // flag to expose this information to internal browser or not. - bool expose_javascript_object = gSavedSettings.getBOOL("BrowserEnableJSObject"); - mMediaSource->jsExposeObjectEvent( expose_javascript_object ); + bool enable = gSavedSettings.getBOOL("BrowserEnableJSObject"); + mMediaSource->jsEnableObject( enable ); - // indicate if the values we have are valid (currently do this blanket-fashion for - // everything depending on whether you are logged in or not - this may require a - // more granular approach once variables are added that ARE valid before login + // these values are only menaingful after login so don't set them before bool logged_in = LLLoginInstance::getInstance()->authSuccess(); - mMediaSource->jsValuesValidEvent( logged_in ); - - // current location within a region - LLVector3 agent_pos = gAgent.getPositionAgent(); - double x = agent_pos.mV[ VX ]; - double y = agent_pos.mV[ VY ]; - double z = agent_pos.mV[ VZ ]; - mMediaSource->jsAgentLocationEvent( x, y, z ); - - // current location within the grid - LLVector3d agent_pos_global = gAgent.getLastPositionGlobal(); - double global_x = agent_pos_global.mdV[ VX ]; - double global_y = agent_pos_global.mdV[ VY ]; - double global_z = agent_pos_global.mdV[ VZ ]; - mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z ); - - // current agent orientation - double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] ); - double angle = rotation * RAD_TO_DEG; - if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation! - mMediaSource->jsAgentOrientationEvent( angle ); - - // current region agent is in - std::string region_name(""); - LLViewerRegion* region = gAgent.getRegion(); - if ( region ) - { - region_name = region->getName(); - }; - mMediaSource->jsAgentRegionEvent( region_name ); + if ( logged_in ) + { + // current location within a region + LLVector3 agent_pos = gAgent.getPositionAgent(); + double x = agent_pos.mV[ VX ]; + double y = agent_pos.mV[ VY ]; + double z = agent_pos.mV[ VZ ]; + mMediaSource->jsAgentLocationEvent( x, y, z ); + + // current location within the grid + LLVector3d agent_pos_global = gAgent.getLastPositionGlobal(); + double global_x = agent_pos_global.mdV[ VX ]; + double global_y = agent_pos_global.mdV[ VY ]; + double global_z = agent_pos_global.mdV[ VZ ]; + mMediaSource->jsAgentGlobalLocationEvent( global_x, global_y, global_z ); + + // current agent orientation + double rotation = atan2( gAgent.getAtAxis().mV[VX], gAgent.getAtAxis().mV[VY] ); + double angle = rotation * RAD_TO_DEG; + if ( angle < 0.0f ) angle = 360.0f + angle; // TODO: has to be a better way to get orientation! + mMediaSource->jsAgentOrientationEvent( angle ); + + // current region agent is in + std::string region_name(""); + LLViewerRegion* region = gAgent.getRegion(); + if ( region ) + { + region_name = region->getName(); + }; + mMediaSource->jsAgentRegionEvent( region_name ); + } // language code the viewer is set to mMediaSource->jsAgentLanguageEvent( LLUI::getLanguage() ); -- cgit v1.2.3 From 7ed78f92747a7234435d1b6ceef50a3053003f48 Mon Sep 17 00:00:00 2001 From: leyla <leyla@leyla.com> Date: Fri, 10 Jun 2011 15:14:18 -0700 Subject: fixing folder sorting, folders don't have a date stamp so use first item's date --- indra/newview/llfolderviewitem.cpp | 15 +++++++++++++++ indra/newview/llfolderviewitem.h | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d2bbfa2c2b..57e5488a4e 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2334,6 +2334,21 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { + // folders have no creation date so use first non-folder descendent's date + if (!mCreationDate) + { + for(items_t::const_iterator iit = mItems.begin(); + iit != mItems.end(); ++iit) + { + LLFolderViewItem* itemp = (*iit); + if (itemp->getCreationDate()) + { + mCreationDate = itemp->getCreationDate(); + break; + } + } + } + return llmax<time_t>(mCreationDate, mSubtreeCreationDate); } diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index fc941510ab..dbd7d5a370 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -135,7 +135,7 @@ protected: std::string mSearchableLabel; S32 mLabelWidth; bool mLabelWidthDirty; - time_t mCreationDate; + mutable time_t mCreationDate; LLFolderViewFolder* mParentFolder; LLFolderViewEventListener* mListener; BOOL mIsCurSelection; @@ -278,7 +278,7 @@ public: // Used for sorting, like getLabel() above. virtual time_t getCreationDate() const { return mCreationDate; } - + LLFolderViewFolder* getParentFolder( void ) { return mParentFolder; } const LLFolderViewFolder* getParentFolder( void ) const { return mParentFolder; } -- cgit v1.2.3 From 3eeb14ee0abb5720e010d94eba52db09fa32237e Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Fri, 10 Jun 2011 16:20:30 -0700 Subject: EXP-856 FIX -- Inbox item count reflected as badge on inventory button * Modified badges to be parented to their owners if their owners have no parents * Modified side tray tab panels to create badges on side tab buttons when the xml specifies a badge. * Modified inbox to drive the badge value of the sidebar_inventory button. * Updated inbox and outbox sizes so scroll bars function as expected * Updated inventory_panel.xml to allow scroll tag to specify scroll bar properties, instead of just having them hardcoded. Reviewed by Richard --- indra/llui/llbadgeowner.cpp | 12 +- indra/newview/llinventorypanel.cpp | 11 +- indra/newview/llinventorypanel.h | 6 +- indra/newview/llpanelmarketplaceinbox.cpp | 40 ++++- indra/newview/llpanelmarketplaceinbox.h | 9 +- indra/newview/llsidetray.cpp | 180 +++++++++++++-------- indra/newview/llsidetray.h | 13 +- .../skins/default/xui/en/panel_side_tray.xml | 1 + .../skins/default/xui/en/sidepanel_inventory.xml | 125 +++++++------- .../default/xui/en/widgets/inventory_panel.xml | 9 +- 10 files changed, 255 insertions(+), 151 deletions(-) diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 11f1463b9b..3d63fc7f60 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -79,26 +79,28 @@ void LLBadgeOwner::addBadgeToParentPanel() if (mBadge && owner_view) { - // Find the appropriate parent panel for the badge + // Badge parent is badge owner by default + LLView * badge_parent = owner_view; + // Find the appropriate parent for the badge LLView * parent = owner_view->getParent(); - LLPanel * parent_panel = NULL; while (parent) { - parent_panel = dynamic_cast<LLPanel *>(parent); + LLPanel * parent_panel = dynamic_cast<LLPanel *>(parent); if (parent_panel && parent_panel->acceptsBadge()) { + badge_parent = parent; break; } parent = parent->getParent(); } - if (parent_panel) + if (badge_parent) { - parent_panel->addChild(mBadge); + badge_parent->addChild(mBadge); } else { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..5b47e939a4 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -42,7 +42,6 @@ #include "llinventorymodelbackgroundfetch.h" #include "llsidepanelinventory.h" #include "llsidetray.h" -#include "llscrollcontainer.h" #include "llviewerattachmenu.h" #include "llviewerfoldertype.h" #include "llvoavatarself.h" @@ -184,13 +183,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) { LLRect scroller_view_rect = getRect(); scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(p); + LLScrollContainer::Params scroller_params(params.scroll()); + scroller_params.rect(scroller_view_rect); + mScroller = LLUICtrlFactory::create<LLScrollContainer>(scroller_params); addChild(mScroller); mScroller->addChild(mFolderRoot); mFolderRoot->setScrollContainer(mScroller); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 9da9f7d8ba..484360b8ca 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -35,6 +35,7 @@ #include "llinventoryfilter.h" #include "llfolderview.h" #include "llinventorymodel.h" +#include "llscrollcontainer.h" #include "lluictrlfactory.h" #include <set> @@ -46,7 +47,6 @@ class LLInventoryFVBridgeBuilder; class LLMenuBarGL; class LLCheckBoxCtrl; class LLSpinCtrl; -class LLScrollContainer; class LLTextBox; class LLIconCtrl; class LLSaveFolderState; @@ -83,6 +83,7 @@ public: Optional<Filter> filter; Optional<std::string> start_folder; Optional<bool> use_label_suffix; + Optional<LLScrollContainer::Params> scroll; Params() : sort_order_setting("sort_order_setting"), @@ -91,7 +92,8 @@ public: show_item_link_overlays("show_item_link_overlays", false), filter("filter"), start_folder("start_folder"), - use_label_suffix("use_label_suffix", true) + use_label_suffix("use_label_suffix", true), + scroll("scroll") {} }; diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 6cebc5dd5a..a6d6308dc2 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -28,6 +28,7 @@ #include "llpanelmarketplaceinbox.h" +#include "llappviewer.h" #include "llbutton.h" #include "llinventorypanel.h" @@ -35,7 +36,8 @@ static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_ // protected LLPanelMarketplaceInbox::LLPanelMarketplaceInbox() -: LLPanel() + : LLPanel() + , mInventoryPanel(NULL) { } @@ -50,16 +52,24 @@ BOOL LLPanelMarketplaceInbox::postBuild() mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); + return TRUE; } +void LLPanelMarketplaceInbox::handleLoginComplete() +{ + // Set us up as the class to drive the badge value for the sidebar_inventory button + LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); +} + BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { *accept = ACCEPT_NO; return TRUE; } -void LLPanelMarketplaceInbox::draw() +U32 LLPanelMarketplaceInbox::getItemCount() const { LLInventoryModel* model = mInventoryPanel->getModel(); @@ -68,8 +78,8 @@ void LLPanelMarketplaceInbox::draw() model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - S32 item_count = 0; - + U32 item_count = 0; + if (cats) { item_count += cats->size(); @@ -80,10 +90,30 @@ void LLPanelMarketplaceInbox::draw() item_count += items->size(); } + return item_count; +} + +std::string LLPanelMarketplaceInbox::getBadgeString() const +{ + std::string item_count_str(""); + U32 item_count = getItemCount(); + if (item_count) + { + item_count_str = llformat("%d", item_count); + } + + return item_count_str; +} + +void LLPanelMarketplaceInbox::draw() +{ + std::string item_count_str = getBadgeString(); + + if (item_count_str.length() > 0) { LLStringUtil::format_map_t args; - args["[NUM]"] = llformat ("%d", item_count); + args["[NUM]"] = item_count_str; getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); } else diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 504659b1ef..61e8cf3c1f 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -28,10 +28,11 @@ #define LL_LLPANELMARKETPLACEINBOX_H #include "llpanel.h" +#include "llsidetray.h" class LLInventoryPanel; -class LLPanelMarketplaceInbox : public LLPanel +class LLPanelMarketplaceInbox : public LLPanel, public LLSideTrayTabBadgeDriver { public: @@ -46,6 +47,12 @@ public: /*virtual*/ void draw(); + U32 getItemCount() const; + std::string getBadgeString() const; + +private: + void handleLoginComplete(); + private: LLInventoryPanel* mInventoryPanel; }; diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index fe3f2568bc..651897a217 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -30,7 +30,7 @@ #include "llagentcamera.h" #include "llappviewer.h" -#include "llbadgeowner.h" +#include "llbadge.h" #include "llbottomtray.h" #include "llfloaterreg.h" #include "llfirstuse.h" @@ -41,6 +41,7 @@ #include "llfocusmgr.h" #include "llrootview.h" #include "llnavigationbar.h" +#include "llpanelmarketplaceinbox.h" #include "llaccordionctrltab.h" @@ -99,7 +100,7 @@ bool LLSideTray::instanceCreated () // Represents a single tab in the side tray, only used by LLSideTray ////////////////////////////////////////////////////////////////////////////// -class LLSideTrayTab: public LLPanel, public LLBadgeOwner +class LLSideTrayTab: public LLPanel { LOG_CLASS(LLSideTrayTab); friend class LLUICtrlFactory; @@ -144,7 +145,6 @@ public: static LLSideTrayTab* createInstance (); const std::string& getDescription () const { return mDescription;} - const std::string& getTabTitle() const { return mTabTitle;} void onOpen (const LLSD& key); @@ -154,7 +154,10 @@ public: BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); - LLPanel *getPanel(); + LLPanel* getPanel(); + + LLButton* createButton(bool allowTearOff, LLUICtrl::commit_callback_t callback); + private: std::string mTabTitle; std::string mImage; @@ -162,21 +165,21 @@ private: std::string mDescription; LLView* mMainPanel; + + bool mHasBadge; + LLBadge::Params mBadgeParams; }; LLSideTrayTab::LLSideTrayTab(const Params& p) : LLPanel(), - LLBadgeOwner(LLView::getHandle()), mTabTitle(p.tab_title), mImage(p.image), mImageSelected(p.image_selected), mDescription(p.description), - mMainPanel(NULL) + mMainPanel(NULL), + mBadgeParams(p.badge) { - if (p.badge.isProvided()) - { - LLBadgeOwner::initBadgeParams(p.badge()); - } + mHasBadge = p.badge.isProvided(); } LLSideTrayTab::~LLSideTrayTab() @@ -191,8 +194,6 @@ bool LLSideTrayTab::addChild(LLView* view, S32 tab_group) //return res; } - - //virtual BOOL LLSideTrayTab::postBuild() { @@ -205,8 +206,6 @@ BOOL LLSideTrayTab::postBuild() getChild<LLButton>("undock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, false)); getChild<LLButton>("dock")->setCommitCallback(boost::bind(&LLSideTrayTab::setDocked, this, true)); - addBadgeToParentPanel(); - return LLPanel::postBuild(); } @@ -534,18 +533,36 @@ public: return FALSE; } + void setBadgeDriver(LLSideTrayTabBadgeDriver* driver) + { + mBadgeDriver = driver; + } + protected: LLSideTrayButton(const LLButton::Params& p) - : LLButton(p) - , mDragLastScreenX(0) - , mDragLastScreenY(0) + : LLButton(p) + , mDragLastScreenX(0) + , mDragLastScreenY(0) + , mBadgeDriver(NULL) {} friend class LLUICtrlFactory; + void draw() + { + if (mBadgeDriver) + { + setBadgeLabel(mBadgeDriver->getBadgeString()); + } + + LLButton::draw(); + } + private: S32 mDragLastScreenX; S32 mDragLastScreenY; + + LLSideTrayTabBadgeDriver* mBadgeDriver; }; ////////////////////////////////////////////////////////////////////////////// @@ -626,11 +643,31 @@ BOOL LLSideTray::postBuild() return true; } +void LLSideTray::setTabButtonBadgeDriver(std::string tabName, LLSideTrayTabBadgeDriver* driver) +{ + mTabButtonBadgeDrivers[tabName] = driver; +} + void LLSideTray::handleLoginComplete() { //reset tab to "home" tab if it was changesd during login process selectTabByName("sidebar_home"); + for (badge_map_t::iterator it = mTabButtonBadgeDrivers.begin(); it != mTabButtonBadgeDrivers.end(); ++it) + { + LLButton* button = mTabButtons[it->first]; + LLSideTrayButton* side_button = dynamic_cast<LLSideTrayButton*>(button); + + if (side_button) + { + side_button->setBadgeDriver(it->second); + } + else + { + llwarns << "Unable to find button " << it->first << " to set the badge driver. " << llendl; + } + } + detachTabs(); } @@ -777,51 +814,6 @@ bool LLSideTray::selectTabByName(const std::string& name, bool keep_prev_visible return true; } -LLButton* LLSideTray::createButton (const std::string& name,const std::string& image,const std::string& tooltip, - LLUICtrl::commit_callback_t callback) -{ - static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); - - LLButton::Params bparams; - - LLRect rect; - rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); - - bparams.name(name); - bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); - bparams.rect (rect); - bparams.tab_stop(false); - bparams.image_unselected(sidetray_params.tab_btn_image_normal); - bparams.image_selected(sidetray_params.tab_btn_image_selected); - bparams.image_disabled(sidetray_params.tab_btn_image_normal); - bparams.image_disabled_selected(sidetray_params.tab_btn_image_selected); - - LLButton* button; - if (name == "sidebar_openclose") - { - // "Open/Close" button shouldn't allow "tear off" - // hence it is created as LLButton instance. - button = LLUICtrlFactory::create<LLButton>(bparams); - } - else - { - button = LLUICtrlFactory::create<LLSideTrayButton>(bparams); - } - - button->setClickedCallback(callback); - - button->setToolTip(tooltip); - - if(image.length()) - { - button->setImageOverlay(image); - } - - mButtonsPanel->addChildInBack(button); - - return button; -} - bool LLSideTray::addChild(LLView* view, S32 tab_group) { LLSideTrayTab* tab_panel = dynamic_cast<LLSideTrayTab*>(view); @@ -949,7 +941,56 @@ bool LLSideTray::addTab(LLSideTrayTab* tab) return true; } -void LLSideTray::createButtons () +LLButton* LLSideTrayTab::createButton(bool allowTearOff, LLUICtrl::commit_callback_t callback) +{ + static LLSideTray::Params sidetray_params(LLUICtrlFactory::getDefaultParams<LLSideTray>()); + + LLRect rect; + rect.setOriginAndSize(0, 0, sidetray_params.default_button_width, sidetray_params.default_button_height); + + LLButton::Params bparams; + + // Append "_button" to the side tray tab name + std::string button_name = getName() + "_button"; + bparams.name(button_name); + bparams.follows.flags (FOLLOWS_LEFT | FOLLOWS_TOP); + bparams.rect (rect); + bparams.tab_stop(false); + bparams.image_unselected(sidetray_params.tab_btn_image_normal); + bparams.image_selected(sidetray_params.tab_btn_image_selected); + bparams.image_disabled(sidetray_params.tab_btn_image_normal); + bparams.image_disabled_selected(sidetray_params.tab_btn_image_selected); + + if (mHasBadge) + { + bparams.badge = mBadgeParams; + } + + LLButton* button; + if (allowTearOff) + { + button = LLUICtrlFactory::create<LLSideTrayButton>(bparams); + } + else + { + // "Open/Close" button shouldn't allow "tear off" + // hence it is created as LLButton instance. + button = LLUICtrlFactory::create<LLButton>(bparams); + } + + button->setClickedCallback(callback); + + button->setToolTip(mTabTitle); + + if(mImage.length()) + { + button->setImageOverlay(mImage); + } + + return button; +} + +void LLSideTray::createButtons() { //create buttons for tabs child_vector_const_iter_t child_it = mTabs.begin(); @@ -962,17 +1003,22 @@ void LLSideTray::createButtons () // The "OpenClose" button will open/close the whole panel if (name == "sidebar_openclose") { - mCollapseButton = createButton(name,sidebar_tab->mImage,sidebar_tab->getTabTitle(), - boost::bind(&LLSideTray::onToggleCollapse, this)); + mCollapseButton = sidebar_tab->createButton(false, boost::bind(&LLSideTray::onToggleCollapse, this)); + + mButtonsPanel->addChildInBack(mCollapseButton); + LLHints::registerHintTarget("side_panel_btn", mCollapseButton->getHandle()); } else { - LLButton* button = createButton(name,sidebar_tab->mImage,sidebar_tab->getTabTitle(), - boost::bind(&LLSideTray::onTabButtonClick, this, name)); + LLButton* button = sidebar_tab->createButton(true, boost::bind(&LLSideTray::onTabButtonClick, this, name)); + + mButtonsPanel->addChildInBack(button); + mTabButtons[name] = button; } } + LLHints::registerHintTarget("inventory_btn", mTabButtons["sidebar_inventory"]->getHandle()); } diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 24882411f4..17158329dc 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -33,6 +33,13 @@ class LLAccordionCtrl; class LLSideTrayTab; +// Define an interface for side tab button badge values +class LLSideTrayTabBadgeDriver +{ +public: + virtual std::string getBadgeString() const = 0; +}; + // Deal with LLSideTrayTab being opaque. Generic do-nothing cast... template <class T> T tab_cast(LLSideTrayTab* tab) { return tab; } @@ -166,6 +173,8 @@ public: bool getCollapsed() { return mCollapsed; } + void setTabButtonBadgeDriver(std::string tabName, LLSideTrayTabBadgeDriver* driver); + public: virtual ~LLSideTray(){}; @@ -204,8 +213,6 @@ protected: void createButtons (); - LLButton* createButton (const std::string& name,const std::string& image,const std::string& tooltip, - LLUICtrl::commit_callback_t callback); void arrange (); void detachTabs (); void reflectCollapseChange(); @@ -234,6 +241,8 @@ private: LLPanel* mButtonsPanel; typedef std::map<std::string,LLButton*> button_map_t; button_map_t mTabButtons; + typedef std::map<std::string,LLSideTrayTabBadgeDriver*> badge_map_t; + badge_map_t mTabButtonBadgeDrivers; child_vector_t mTabs; child_vector_t mDetachedTabs; tab_order_vector_t mOriginalTabOrder; diff --git a/indra/newview/skins/default/xui/en/panel_side_tray.xml b/indra/newview/skins/default/xui/en/panel_side_tray.xml index 6ef93406ec..0f330a7b98 100644 --- a/indra/newview/skins/default/xui/en/panel_side_tray.xml +++ b/indra/newview/skins/default/xui/en/panel_side_tray.xml @@ -142,6 +142,7 @@ mouse_opaque="false" background_visible="true" > + <badge location="top_left" location_percent_vcenter="50" location_percent_hcenter="95" /> <panel class="sidepanel_inventory" name="sidepanel_inventory" diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index c945f27ac6..373a9011a1 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -26,13 +26,13 @@ top="0" orientation="vertical" name="inventory_layout_stack" - height="535" + height="535" width="330"> <layout_panel name="main_inventory_layout_panel" min_dim="150" width="330" - follows="bottom|left|right" + follows="bottom|left|right" user_resize="false" height="480"> <panel @@ -50,12 +50,12 @@ <layout_panel width="330" auto_resize="true" - user_resize="false" - follows="bottom|left|right" + user_resize="false" + follows="bottom|left|right" min_dim="35" name="inbox_layout_panel" max_dim="125" - height="35"> + height="125"> <panel follows="all" layout="topleft" @@ -69,59 +69,62 @@ <string name="InboxLabelWithArg">MARKETPLACE INBOX ([NUM])</string> <string name="InboxLabelNoArg">MARKETPLACE INBOX</string> <button - label="MARKETPLACE INBOX" - name="inbox_btn" - height="35" - width="308" - image_unselected="MarketplaceBtn_Off" - image_selected="MarketplaceBtn_Selected" - halign="left" - follows="top|left|right" - is_toggle="true" - tab_stop="false" - pad_left="35" - top="0" + label="MARKETPLACE INBOX" + name="inbox_btn" + height="35" + width="308" + image_unselected="MarketplaceBtn_Off" + image_selected="MarketplaceBtn_Selected" + halign="left" + follows="top|left|right" + is_toggle="true" + tab_stop="false" + pad_left="35" + top="0" left="10" /> - <panel - follows="all" - left="10" - height="90" - width="308" - top="35" - bg_opaque_color="InventoryBackgroundColor" - background_visible="true" - background_opaque="true" - > - <text - type="string" - length="1" - follows="top|left|right" - font="SansSerifSmall" - use_ellipses="true" - name="move_items_text" - top="10" - left="4" - height="20" - width="304" - >Move items to your inventory to manage and use them.</text> - <inventory_panel - bg_opaque_color="DkGray2" - bg_alpha_color="DkGray2" - background_visible="true" - background_opaque="true" - border="false" - bevel_style="none" - follows="all" - height="70" - start_folder="Inbox" - layout="topleft" - left="0" - name="inventory_inbox" - sort_order_setting="InventorySortOrder" - show_item_link_overlays="true" - top_pad="0" - width="308" /> - </panel> + <panel + follows="all" + left="10" + height="90" + width="308" + top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" + > + <text + type="string" + length="1" + follows="top|left|right" + font="SansSerifSmall" + use_ellipses="true" + name="move_items_text" + top="5" + left="4" + height="20" + width="304" + >Move items to your inventory to manage and use them.</text> + <inventory_panel + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + follows="all" + top="25" + height="70" + start_folder="Inbox" + layout="topleft" + left="0" + name="inventory_inbox" + sort_order_setting="InventorySortOrder" + show_item_link_overlays="true" + top_pad="0" + width="308"> + <scroll reserve_scroll_corner="false" /> + </inventory_panel> + </panel> </panel> </layout_panel> <layout_panel @@ -132,7 +135,7 @@ name="outbox_layout_panel" min_dim="35" max_dim="125" - height="35"> + height="125"> <panel follows="all" layout="topleft" @@ -200,7 +203,7 @@ <panel follows="all" left="0" - height="90" + bottom="125" width="330" top="35" > @@ -220,7 +223,9 @@ sort_order_setting="InventorySortOrder" show_item_link_overlays="true" top="0" - width="308" /> + width="308"> + <scroll reserve_scroll_corner="false" /> + </inventory_panel> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml index 93875d66e6..3164cc5eba 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml @@ -3,4 +3,11 @@ bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" - /> + > + <scroll + name="Inventory Scroller" + follows="all" + reserve_scroll_corner="true" + tab_stop="true" + /> +</panel> -- cgit v1.2.3 From 142c2fc29c9645df1bff924d6a61c09f04713a7b Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Tue, 14 Jun 2011 16:35:15 -0700 Subject: EXP-896 FIX -- Inbox not opened by default when new items are received EXP-894 FIX -- When scrolling to the bottom of the inbox, the last item is c... EXP-856 FIX -- Inbox item count reflected as badge on inventory button * Inbox auto-expands when "fresh" items are reported * Logic for "fresh" item determination is still in progress but works for purchases while logged in * Badges now only displayed when the inventory side panel is collapsed or when inventory not visible Reviewed by Leyla --- indra/newview/llfolderviewitem.h | 10 +++- indra/newview/llpanelmarketplaceinbox.cpp | 65 +++++++++++++++++++--- indra/newview/llpanelmarketplaceinbox.h | 14 ++++- indra/newview/llsidepanelinventory.cpp | 15 +++-- .../skins/default/xui/en/sidepanel_inventory.xml | 61 ++++++++++---------- 5 files changed, 118 insertions(+), 47 deletions(-) diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index dbd7d5a370..789e104e8b 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -167,7 +167,7 @@ protected: void extendSelectionFromRoot(LLFolderViewItem* selection); // this is an internal method used for adding items to folders. A - // no-op at this leve, but reimplemented in derived classes. + // no-op at this level, but reimplemented in derived classes. virtual BOOL addItem(LLFolderViewItem*) { return FALSE; } virtual BOOL addFolder(LLFolderViewFolder*) { return FALSE; } @@ -366,6 +366,9 @@ public: UNKNOWN, TRASH, NOT_TRASH } ETrash; + typedef std::list<LLFolderViewItem*> items_t; + typedef std::list<LLFolderViewFolder*> folders_t; + private: S32 mNumDescendantsSelected; @@ -374,8 +377,6 @@ public: // Accessed needed by LLFolderViewItem S32 numSelected(void) const { return mNumDescendantsSelected + (isSelected() ? 1 : 0); } protected: - typedef std::list<LLFolderViewItem*> items_t; - typedef std::list<LLFolderViewFolder*> folders_t; items_t mItems; folders_t mFolders; LLInventorySort mSortFunction; @@ -537,6 +538,9 @@ public: time_t getCreationDate() const; bool isTrash() const; S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; } + + folders_t::const_iterator getFoldersBegin() const { return mFolders.cbegin(); } + folders_t::const_iterator getFoldersEnd() const { return mFolders.cend(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index a6d6308dc2..0fe2560fbf 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -34,9 +34,14 @@ static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); +const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>(); +} + // protected -LLPanelMarketplaceInbox::LLPanelMarketplaceInbox() - : LLPanel() +LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) + : LLPanel(p) , mInventoryPanel(NULL) { } @@ -69,7 +74,31 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr return TRUE; } -U32 LLPanelMarketplaceInbox::getItemCount() const +U32 LLPanelMarketplaceInbox::getFreshItemCount() const +{ + U32 fresh_item_count = 0; + + LLFolderView * root_folder = mInventoryPanel->getRootFolder(); + + const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); + + LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); + LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); + + for (; folders_it != folders_end; ++folders_it) + { + const LLFolderViewFolder * folder = *folders_it; + + if (folder->getCreationDate() > 1500) + { + fresh_item_count++; + } + } + + return fresh_item_count; +} + +U32 LLPanelMarketplaceInbox::getTotalItemCount() const { LLInventoryModel* model = mInventoryPanel->getModel(); @@ -96,11 +125,16 @@ U32 LLPanelMarketplaceInbox::getItemCount() const std::string LLPanelMarketplaceInbox::getBadgeString() const { std::string item_count_str(""); - U32 item_count = getItemCount(); - if (item_count) + // If side panel collapsed or expanded and not inventory + if (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) { - item_count_str = llformat("%d", item_count); + U32 item_count = getFreshItemCount(); + + if (item_count) + { + item_count_str = llformat("%d", item_count); + } } return item_count_str; @@ -108,17 +142,32 @@ std::string LLPanelMarketplaceInbox::getBadgeString() const void LLPanelMarketplaceInbox::draw() { - std::string item_count_str = getBadgeString(); + U32 item_count = getTotalItemCount(); + + LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); - if (item_count_str.length() > 0) + if (item_count > 0) { + std::string item_count_str = llformat("%d", item_count); + LLStringUtil::format_map_t args; args["[NUM]"] = item_count_str; getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + + // set green text to fresh item count + U32 fresh_item_count = getFreshItemCount(); + fresh_new_count_view->setVisible((fresh_item_count > 0)); + + if (fresh_item_count > 0) + { + getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); + } } else { getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + + fresh_new_count_view->setVisible(FALSE); } LLPanel::draw(); diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 61e8cf3c1f..21069a0ea1 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -36,9 +36,17 @@ class LLPanelMarketplaceInbox : public LLPanel, public LLSideTrayTabBadgeDriver { public: + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params() {} + }; + LOG_CLASS(LLPanelMarketplaceInbox); - LLPanelMarketplaceInbox(); + // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 + static const LLPanelMarketplaceInbox::Params& getDefaultParams(); + + LLPanelMarketplaceInbox(const Params& p = getDefaultParams()); ~LLPanelMarketplaceInbox(); /*virtual*/ BOOL postBuild(); @@ -47,7 +55,9 @@ public: /*virtual*/ void draw(); - U32 getItemCount() const; + U32 getFreshItemCount() const; + U32 getTotalItemCount() const; + std::string getBadgeString() const; private: diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 6ac845385b..33d512d89e 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -43,6 +43,7 @@ #include "lllayoutstack.h" #include "lloutfitobserver.h" #include "llpanelmaininventory.h" +#include "llpanelmarketplaceinbox.h" #include "llselectmgr.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" @@ -341,12 +342,6 @@ void LLSidepanelInventory::onToggleInboxBtn() { // Save current time as a setting for future new-ness tests gSavedSettings.setString(INBOX_EXPAND_TIME_SETTING, LLDate::now().asString()); - - // TODO: Hide inbox badge - } - else - { - // TODO: Show inbox badge } } @@ -365,6 +360,14 @@ void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); + // Expand the inbox if we have fresh items + LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); + if (inbox && (inbox->getFreshItemCount() > 0)) + { + getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } + if(key.size() == 0) return; diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 373a9011a1..9a91f90f79 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -54,8 +54,8 @@ follows="bottom|left|right" min_dim="35" name="inbox_layout_panel" - max_dim="125" - height="125"> + max_dim="200" + height="200"> <panel follows="all" layout="topleft" @@ -64,12 +64,12 @@ class="panel_marketplace_inbox" top="0" label="" - height="125" + height="200" width="330"> - <string name="InboxLabelWithArg">MARKETPLACE INBOX ([NUM])</string> - <string name="InboxLabelNoArg">MARKETPLACE INBOX</string> + <string name="InboxLabelWithArg">Received Items ([NUM])</string> + <string name="InboxLabelNoArg">Received Items</string> <button - label="MARKETPLACE INBOX" + label="Received Items" name="inbox_btn" height="35" width="308" @@ -82,28 +82,33 @@ pad_left="35" top="0" left="10" /> + <text + type="string" + length="1" + follows="right|top" + layout="topleft" + height="13" + top="10" + right="-20" + name="inbox_fresh_new_count" + font="SansSerifMedium" + halign="right" + text_color="EmphasisColor" + top_pad="0" + width="300"> + [NUM] New + </text> <panel follows="all" left="10" - height="90" + bottom="200" width="308" top="35" bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" - > - <text - type="string" - length="1" - follows="top|left|right" - font="SansSerifSmall" - use_ellipses="true" - name="move_items_text" - top="5" - left="4" - height="20" - width="304" - >Move items to your inventory to manage and use them.</text> + tool_tip="Drag and drop items to your inventory to manage and use them" + > <inventory_panel bg_opaque_color="DkGray2" bg_alpha_color="DkGray2" @@ -112,8 +117,8 @@ border="false" bevel_style="none" follows="all" - top="25" - height="70" + top="0" + height="165" start_folder="Inbox" layout="topleft" left="0" @@ -134,8 +139,8 @@ follows="bottom|left|right" name="outbox_layout_panel" min_dim="35" - max_dim="125" - height="125"> + max_dim="200" + height="200"> <panel follows="all" layout="topleft" @@ -144,10 +149,10 @@ class="panel_marketplace_outbox" top="0" label="" - height="125" + height="200" width="310"> <button - label="MARKETPLACE OUTBOX" + label="Merchant Outbox" is_toggle="true" name="outbox_btn" follows="top|left|right" @@ -203,7 +208,7 @@ <panel follows="all" left="0" - bottom="125" + bottom="200" width="330" top="35" > @@ -215,7 +220,7 @@ border="false" bevel_style="none" follows="all" - height="90" + height="165" start_folder="Outbox" layout="topleft" left="0" -- cgit v1.2.3 From 4d0d3a1fc51d8769a3a132e1a57ec709e19f906d Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 15 Jun 2011 10:27:39 -0700 Subject: EXP-824 Updating im volume slider labels --- indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml index a9c7b624fd..2cb77bcdf3 100644 --- a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml @@ -153,13 +153,6 @@ name="volume_ctrl_panel" visible="false" user_resize="false"> - <text - follows="left|top|right" - left="5" - top="14" - height="23" - name="volume_ctrl_text" - width="140">Volume Control:</text> <slider follows="top|left" height="23" @@ -169,8 +162,8 @@ min_val="0.05" name="volume_slider" show_text="false" - tool_tip="Voice volume" - top_pad="-5" + tool_tip="Call Volume" + top_pad="32" value="0.5" width="125" /> <button -- cgit v1.2.3 From de1fe235c04312b3b25531bb727a4d4cc9abd00a Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 15 Jun 2011 10:29:35 -0700 Subject: EXP-878 Volume slider shown at 0 --- indra/newview/llpanelimcontrolpanel.cpp | 11 +++++++---- indra/newview/llpanelimcontrolpanel.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index c15d1973d8..e370f2f622 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -71,7 +71,7 @@ void LLPanelChatControlPanel::onChange(EStatusType status, const std::string &ch void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { - updateButtons(new_state >= LLVoiceChannel::STATE_CALL_STARTED); + updateButtons(new_state); } void LLPanelChatControlPanel::updateCallButton() @@ -96,12 +96,15 @@ void LLPanelChatControlPanel::updateCallButton() getChildView("call_btn")->setEnabled(enable_connect); } -void LLPanelChatControlPanel::updateButtons(bool is_call_started) +void LLPanelChatControlPanel::updateButtons(LLVoiceChannel::EState state) { + bool is_call_started = state >= LLVoiceChannel::STATE_CALL_STARTED; getChildView("end_call_btn_panel")->setVisible( is_call_started); - getChildView("volume_ctrl_panel")->setVisible( is_call_started); getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started && findChild<LLView>("voice_ctrls_btn_panel")); getChildView("call_btn_panel")->setVisible( ! is_call_started); + + getChildView("volume_ctrl_panel")->setVisible(state == LLVoiceChannel::STATE_CONNECTED); + updateCallButton(); } @@ -136,7 +139,7 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id) mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); //call (either p2p, group or ad-hoc) can be already in started state - updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); + updateButtons(voice_channel->getState()); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 76d4475b74..bba847b5d4 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -54,7 +54,7 @@ public: virtual void onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state); - void updateButtons(bool is_call_started); + void updateButtons(LLVoiceChannel::EState state); // Enables/disables call button depending on voice availability void updateCallButton(); -- cgit v1.2.3 From 5e3d344fba6f73959d9a8caeac68984d2ae99004 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Wed, 15 Jun 2011 16:21:19 -0700 Subject: EXP-872 FIX -- Hide inbox and outbox unless applicable EXP-893 FIX -- Single order purchases not sorted with most recent item delivered at top of list EXP-904 FIX -- Newness/Freshness value out of synch with new items in Inbox on next login when ordering in bulk with Inventory window open * Inbox and outbox can now be forced on by setting the debug variables "InventoryDisplayInbox" and "InventoryDisplayOutbox" * Inbox is only displayed when logging into a grid that has a marketplace that returns pup as a merchant * Inbox contents is now a forced download when the user logs in, rather than the typical lazy load of the rest of the inventory Reviewed by Leyla --- indra/newview/app_settings/settings.xml | 35 ++++++++- indra/newview/llsidepanelinventory.cpp | 131 ++++++++++++++------------------ indra/newview/llsidepanelinventory.h | 7 +- 3 files changed, 93 insertions(+), 80 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 218a0534e6..bae127d217 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4180,7 +4180,29 @@ <key>Value</key> <real>1.0</real> </map> - <key>InventoryLinking</key> + <key>InventoryDisplayInbox</key> + <map> + <key>Comment</key> + <string>Override received items inventory inbox display</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>InventoryDisplayOutbox</key> + <map> + <key>Comment</key> + <string>Override merchant inventory outbox display</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> + <key>InventoryLinking</key> <map> <key>Comment</key> <string>Enable ability to create links to folders and items via "Paste as link".</string> @@ -4422,6 +4444,17 @@ <key>Value</key> <real>2.0</real> </map> + <key>LastInventoryInboxExpand</key> + <map> + <key>Comment</key> + <string>The last time the received items inbox was expanded.</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>String</string> + <key>Value</key> + <string /> + </map> <key>LCDDestination</key> <map> <key>Comment</key> diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 33d512d89e..d916c430a8 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -29,8 +29,10 @@ #include "llagent.h" #include "llappearancemgr.h" +#include "llappviewer.h" #include "llavataractions.h" #include "llbutton.h" +#include "llcurl.h" #include "lldate.h" #include "llfirstuse.h" #include "llfoldertype.h" @@ -47,7 +49,9 @@ #include "llselectmgr.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" +#include "llstring.h" #include "lltabcontainer.h" +#include "llviewernetwork.h" #include "llweb.h" static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); @@ -71,47 +75,27 @@ static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack" // Helpers // -class LLInboxOutboxInventoryAddedObserver : public LLInventoryAddedObserver +class LLInventoryUserStatusResponder : public LLHTTPClient::Responder { public: - LLInboxOutboxInventoryAddedObserver(LLSidepanelInventory * sidepanelInventory) - : LLInventoryAddedObserver() + LLInventoryUserStatusResponder(LLSidepanelInventory * sidepanelInventory) + : LLCurl::Responder() , mSidepanelInventory(sidepanelInventory) - {} + { + } -protected: - virtual void done() + void errorWithContent(U32 status, const std::string& reason, const LLSD& content) { - uuid_vec_t::const_iterator it = mAdded.begin(); - uuid_vec_t::const_iterator it_end = mAdded.end(); - - for(; it != it_end; ++it) - { - LLInventoryObject* item = gInventory.getObject(*it); - - // NOTE: This doesn't actually work because folder creation does not trigger this observer - if (item && item->getType() == LLAssetType::AT_CATEGORY) - { - // Check for FolderType FT_INBOX or FT_OUTBOX and report back to mSidepanelInventory - LLInventoryCategory * item_cat = static_cast<LLInventoryCategory *>(item); - LLFolderType::EType folderType = item_cat->getPreferredType(); - - if (folderType == LLFolderType::FT_INBOX) - { - mSidepanelInventory->enableInbox(true); - } - else if (folderType == LLFolderType::FT_OUTBOX) - { - mSidepanelInventory->enableOutbox(true); - } - } - } + llinfos << "Marketplace Inbox Disabled" << llendl; + } - mAdded.clear(); + void result(const LLSD& content) + { + mSidepanelInventory->enableInbox(true); } private: - LLSidepanelInventory * mSidepanelInventory; + LLSidepanelInventory * mSidepanelInventory; }; // @@ -124,19 +108,12 @@ LLSidepanelInventory::LLSidepanelInventory() , mPanelMainInventory(NULL) , mInventoryFetched(false) , mCategoriesObserver(NULL) - , mInboxOutboxAddedObserver(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } LLSidepanelInventory::~LLSidepanelInventory() { - if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver)) - { - gInventory.removeObserver(mInboxOutboxAddedObserver); - } - delete mInboxOutboxAddedObserver; - if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver)) { gInventory.removeObserver(mCategoriesObserver); @@ -207,9 +184,6 @@ BOOL LLSidepanelInventory::postBuild() // Marketplace inbox/outbox setup { - LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); - LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME); - LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); LLLayoutPanel * inbox_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); @@ -217,61 +191,69 @@ BOOL LLSidepanelInventory::postBuild() stack->collapsePanel(inbox_panel, true); stack->collapsePanel(outbox_panel, true); + + // Disable user_resize on main inventory panel by default + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, false); + + LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); + LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME); inbox_button->setToggleState(false); outbox_button->setToggleState(false); inbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); - - // TODO: Hide inbox/outbox panels until we determine the status of the feature - //inbox_panel->setVisible(false); - //outbox_panel->setVisible(false); - - // Track added items - mInboxOutboxAddedObserver = new LLInboxOutboxInventoryAddedObserver(this); - gInventory.addObserver(mInboxOutboxAddedObserver); - // Track inbox and outbox folder changes - const bool do_not_create_folder = false; - const bool do_not_find_in_library = false; + // Set the inbox and outbox visible based on debug settings (final setting comes from http request below) + inbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayInbox")); + outbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayOutbox")); - const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); - const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); - - mCategoriesObserver = new LLInventoryCategoriesObserver(); - gInventory.addObserver(mCategoriesObserver); - - mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); - mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + // Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); } return TRUE; } -void LLSidepanelInventory::draw() +void LLSidepanelInventory::handleLoginComplete() { - if (!mInventoryFetched && LLInventoryModelBackgroundFetch::instance().isEverythingFetched()) + // + // Hard coding this as a temporary way to determine whether or not to display the inbox + // + + std::string url = "https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) { - mInventoryFetched = true; - - updateInboxOutboxPanels(); + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); } - LLPanel::draw(); -} + std::string url_suffix = "api/1/users/b72d31f8-d03c-4a3b-a002-3dd7b4a712b8/user_status"; + + LLHTTPClient::get(url + url_suffix, new LLInventoryUserStatusResponder(this)); + + // + // Track inbox and outbox folder changes + // -void LLSidepanelInventory::updateInboxOutboxPanels() -{ - // Iterate through gInventory looking for inbox and outbox const bool do_not_create_folder = false; const bool do_not_find_in_library = false; const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); - enableInbox(inbox_id.notNull()); - enableOutbox(outbox_id.notNull()); + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + + mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); + mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + + // + // Trigger a load for the entire contents of the Inbox + // + + LLInventoryModelBackgroundFetch::instance().start(inbox_id); } void LLSidepanelInventory::enableInbox(bool enabled) @@ -286,7 +268,8 @@ void LLSidepanelInventory::enableOutbox(bool enabled) void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) { - // Perhaps use this to track inbox changes? + // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting + LLInventoryModelBackgroundFetch::instance().start(inbox_id); } void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 8047e11566..25fc28d56b 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -30,7 +30,6 @@ #include "llpanel.h" class LLFolderViewItem; -class LLInboxOutboxInventoryAddedObserver; class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; @@ -44,6 +43,8 @@ public: LLSidepanelInventory(); virtual ~LLSidepanelInventory(); + void handleLoginComplete(); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -61,12 +62,9 @@ public: void onToggleInboxBtn(); void onToggleOutboxBtn(); - void updateInboxOutboxPanels(); void enableInbox(bool enabled); void enableOutbox(bool enabled); - virtual void draw(); - protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -112,7 +110,6 @@ private: bool mInventoryFetched; LLInventoryCategoriesObserver* mCategoriesObserver; - LLInboxOutboxInventoryAddedObserver* mInboxOutboxAddedObserver; }; #endif //LL_LLSIDEPANELINVENTORY_H -- cgit v1.2.3 From e60e193d2d6e418ed7f2530184457277112dea10 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Wed, 15 Jun 2011 17:15:30 -0700 Subject: Fixing mac DD build. Changed cbegin() and cend() to begin() and end(). Reviewed by Richard --- indra/newview/llfolderviewitem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 789e104e8b..035979b021 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -539,8 +539,8 @@ public: bool isTrash() const; S32 getNumSelectedDescendants(void) const { return mNumDescendantsSelected; } - folders_t::const_iterator getFoldersBegin() const { return mFolders.cbegin(); } - folders_t::const_iterator getFoldersEnd() const { return mFolders.cend(); } + folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); } + folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -- cgit v1.2.3 From f42d2607be4aad88f432346787e556836b58a757 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Thu, 16 Jun 2011 16:38:31 -0700 Subject: EXP-905 Missing items from right click context menus in My Inbox EXP-892 No way to delete items in Inbox without moving them to Inventory --- indra/newview/llinventorybridge.cpp | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 88475bd942..f4670731ad 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -571,7 +571,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, } } - // Don't allow items to be pasted directly into the COF. + // Don't allow items to be pasted directly into the COF or the inbox if (!isCOFFolder() && !isInboxFolder()) { items.push_back(std::string("Paste")); @@ -2530,6 +2530,7 @@ void LLFolderBridge::folderOptionsMenu() { mItems.push_back(std::string("Add To Outfit")); } + mItems.push_back(std::string("Replace Outfit")); } if (is_ensemble) @@ -2617,17 +2618,19 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLViewerInventoryCategory *cat = getCategory(); // BAP removed protected check to re-enable standard ops in untyped folders. // Not sure what the right thing is to do here. - if (!isCOFFolder() && !isInboxFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) + if (!isCOFFolder() && cat && (cat->getPreferredType() != LLFolderType::FT_OUTFIT)) { - // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. - if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) - mItems.push_back(std::string("New Folder")); - mItems.push_back(std::string("New Script")); - mItems.push_back(std::string("New Note")); - mItems.push_back(std::string("New Gesture")); - mItems.push_back(std::string("New Clothes")); - mItems.push_back(std::string("New Body Parts")); - + if (!isInboxFolder()) // don't allow creation in inbox + { + // Do not allow to create 2-level subfolder in the Calling Card/Friends folder. EXT-694. + if (!LLFriendCardsManager::instance().isCategoryInFriendFolder(cat)) + mItems.push_back(std::string("New Folder")); + mItems.push_back(std::string("New Script")); + mItems.push_back(std::string("New Note")); + mItems.push_back(std::string("New Gesture")); + mItems.push_back(std::string("New Clothes")); + mItems.push_back(std::string("New Body Parts")); + } #if SUPPORT_ENSEMBLES // Changing folder types is an unfinished unsupported feature // and can lead to unexpected behavior if enabled. @@ -2643,7 +2646,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) else { // Want some but not all of the items from getClipboardEntries for outfits. - if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT) || (cat->getPreferredType() == LLFolderType::FT_INBOX)) + if (cat && (cat->getPreferredType() == LLFolderType::FT_OUTFIT)) { mItems.push_back(std::string("Rename")); @@ -4320,7 +4323,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Detach From Yourself")); } - else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder() && !isInboxFolder()) + else if (!isItemInTrash() && !isLinkedObjectInTrash() && !isLinkedObjectMissing() && !isCOFFolder()) { items.push_back(std::string("Wearable And Object Separator")); items.push_back(std::string("Wearable And Object Wear")); @@ -4672,7 +4675,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Edit")); } // Don't allow items to be worn if their baseobj is in the trash. - if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder() || isInboxFolder()) + if (isLinkedObjectInTrash() || isLinkedObjectMissing() || isCOFFolder()) { disabled_items.push_back(std::string("Wearable And Object Wear")); disabled_items.push_back(std::string("Wearable Add")); -- cgit v1.2.3 From 64f978dc81cf6b3dad42fc5f1cf3896208efc8ac Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Thu, 16 Jun 2011 16:39:30 -0700 Subject: EXP-891 Right click on Inbox or Outbox toggles up down arrow but has no action --- indra/llui/llbutton.cpp | 57 ++++++++++++---------- indra/llui/llbutton.h | 4 ++ .../skins/default/xui/en/sidepanel_inventory.xml | 2 + .../skins/default/xui/en/widgets/button.xml | 1 + 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 637024e513..7b015bd576 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -100,7 +100,8 @@ LLButton::Params::Params() hover_glow_amount("hover_glow_amount"), commit_on_return("commit_on_return", true), use_draw_context_alpha("use_draw_context_alpha", true), - badge("badge") + badge("badge"), + handle_right_mouse("handle_right_mouse") { addSynonym(is_toggle, "toggle"); held_down_delay.seconds = 0.5f; @@ -162,7 +163,8 @@ LLButton::LLButton(const LLButton::Params& p) mMouseDownSignal(NULL), mMouseUpSignal(NULL), mHeldDownSignal(NULL), - mUseDrawContextAlpha(p.use_draw_context_alpha) + mUseDrawContextAlpha(p.use_draw_context_alpha), + mHandleRightMouse(p.handle_right_mouse) { static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0); static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>()); @@ -457,7 +459,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask) BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask) { - if (!childrenHandleRightMouseDown(x, y, mask)) + if (mHandleRightMouse && !childrenHandleRightMouseDown(x, y, mask)) { // Route future Mouse messages here preemptively. (Release on mouse up.) gFocusMgr.setMouseCapture( this ); @@ -470,37 +472,42 @@ BOOL LLButton::handleRightMouseDown(S32 x, S32 y, MASK mask) // if (pointInView(x, y)) // { // } + // send the mouse down signal + LLUICtrl::handleRightMouseDown(x,y,mask); + // *TODO: Return result of LLUICtrl call above? Should defer to base class + // but this might change the mouse handling of existing buttons in a bad way + // if they are not mouse opaque. } - // send the mouse down signal - LLUICtrl::handleRightMouseDown(x,y,mask); - // *TODO: Return result of LLUICtrl call above? Should defer to base class - // but this might change the mouse handling of existing buttons in a bad way - // if they are not mouse opaque. + return TRUE; } BOOL LLButton::handleRightMouseUp(S32 x, S32 y, MASK mask) { - // We only handle the click if the click both started and ended within us - if( hasMouseCapture() ) + if (mHandleRightMouse) { - // Always release the mouse - gFocusMgr.setMouseCapture( NULL ); + // We only handle the click if the click both started and ended within us + if( hasMouseCapture() ) + { + // Always release the mouse + gFocusMgr.setMouseCapture( NULL ); -// if (pointInView(x, y)) -// { -// mRightMouseUpSignal(this, x,y,mask); -// } - } - else - { - childrenHandleRightMouseUp(x, y, mask); + // if (pointInView(x, y)) + // { + // mRightMouseUpSignal(this, x,y,mask); + // } + } + else + { + childrenHandleRightMouseUp(x, y, mask); + } + + // send the mouse up signal + LLUICtrl::handleRightMouseUp(x,y,mask); + // *TODO: Return result of LLUICtrl call above? Should defer to base class + // but this might change the mouse handling of existing buttons in a bad way. + // if they are not mouse opaque. } - // send the mouse up signal - LLUICtrl::handleRightMouseUp(x,y,mask); - // *TODO: Return result of LLUICtrl call above? Should defer to base class - // but this might change the mouse handling of existing buttons in a bad way. - // if they are not mouse opaque. return TRUE; } diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 5880a0e1f2..5968916006 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -129,6 +129,8 @@ public: Optional<LLBadge::Params> badge; + Optional<bool> handle_right_mouse; + Params(); }; @@ -359,6 +361,8 @@ private: bool mForcePressedState; LLFrameTimer mFlashingTimer; + + bool mHandleRightMouse; }; // Build time optimization, generate once in .cpp file diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 9a91f90f79..1fedd6aab8 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -76,6 +76,7 @@ image_unselected="MarketplaceBtn_Off" image_selected="MarketplaceBtn_Selected" halign="left" + handle_right_mouse="false" follows="top|left|right" is_toggle="true" tab_stop="false" @@ -154,6 +155,7 @@ <button label="Merchant Outbox" is_toggle="true" + handle_right_mouse="false" name="outbox_btn" follows="top|left|right" image_unselected="MarketplaceBtn_Off" diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 16241ed84e..302014eb24 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -25,5 +25,6 @@ pad_bottom="3" height="23" scale_image="true" + handle_right_mouse="true" use_draw_context_alpha="true"> </button> -- cgit v1.2.3 From 0d246c0c5fc3ddef2022572b560eaec0018a722e Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Thu, 16 Jun 2011 17:14:51 -0700 Subject: EXP-872 PROGRESS -- Hide Inbox unless applicable EXP-910 FIX -- Newness badge shown on suitcase inventory icon when InventoryDisplayInbox is set to False EXP-895 FIX -- Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel * Main inventory, outbox and inbox all clear the selection of the others when they gain focus * The Fresh Item Count badge is no longer displayed on the inventory side tab button when the inbox is disabled * The New Item Count text is no longer displayed. (we will enable it again when freshness is supported) --- indra/newview/llpanelmaininventory.cpp | 20 ++++++++++++++++ indra/newview/llpanelmaininventory.h | 2 ++ indra/newview/llpanelmarketplaceinbox.cpp | 38 ++++++++++++++++++++++++++++-- indra/newview/llpanelmarketplaceinbox.h | 2 ++ indra/newview/llpanelmarketplaceoutbox.cpp | 28 ++++++++++++++++++++++ indra/newview/llpanelmarketplaceoutbox.h | 2 ++ indra/newview/llsidepanelinventory.cpp | 37 ++++++++++++++++++++--------- indra/newview/llsidepanelinventory.h | 8 ++++++- 8 files changed, 123 insertions(+), 14 deletions(-) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bc4998dd0c..9f797eb147 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -193,6 +193,9 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild<LLMenuItemGL>("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild<LLMenuItemGL>("Bulk Upload")->setLabelArg("[COST]", upload_cost); + // Trigger callback for focus received so we can deselect items in inbox/outbox + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); + return TRUE; } @@ -572,6 +575,23 @@ void LLPanelMainInventory::updateItemcountText() getChild<LLUICtrl>("ItemcountText")->setValue(text); } +void LLPanelMainInventory::onFocusReceived() +{ + LLInventoryPanel * inbox_panel = findChild<LLInventoryPanel>("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = findChild<LLInventoryPanel>("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } +} + void LLPanelMainInventory::setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 2b2ee1c0c9..86b2c87e0b 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -114,6 +114,8 @@ protected: bool isSaveTextureEnabled(const LLSD& userdata); void updateItemcountText(); + void onFocusReceived(); + private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 0fe2560fbf..eff27aa541 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -31,6 +31,11 @@ #include "llappviewer.h" #include "llbutton.h" #include "llinventorypanel.h" +#include "llsidepanelinventory.h" + + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); @@ -59,6 +64,8 @@ BOOL LLPanelMarketplaceInbox::postBuild() LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); + return TRUE; } @@ -68,6 +75,28 @@ void LLPanelMarketplaceInbox::handleLoginComplete() LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); } +void LLPanelMarketplaceInbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + } +} + BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { *accept = ACCEPT_NO; @@ -126,8 +155,9 @@ std::string LLPanelMarketplaceInbox::getBadgeString() const { std::string item_count_str(""); - // If side panel collapsed or expanded and not inventory - if (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) + // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel + if (getParent()->getVisible() && + (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) { U32 item_count = getFreshItemCount(); @@ -154,6 +184,7 @@ void LLPanelMarketplaceInbox::draw() args["[NUM]"] = item_count_str; getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); +#if SUPPORTING_FRESH_ITEM_COUNT // set green text to fresh item count U32 fresh_item_count = getFreshItemCount(); fresh_new_count_view->setVisible((fresh_item_count > 0)); @@ -162,6 +193,9 @@ void LLPanelMarketplaceInbox::draw() { getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); } +#else + fresh_new_count_view->setVisible(FALSE); +#endif } else { diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 21069a0ea1..d5b216b56d 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -63,6 +63,8 @@ public: private: void handleLoginComplete(); + void onFocusReceived(); + private: LLInventoryPanel* mInventoryPanel; }; diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 96695becf0..c8752b3e0f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -31,7 +31,11 @@ #include "llbutton.h" #include "llcoros.h" #include "lleventcoro.h" +#include "llinventorypanel.h" #include "llloadingindicator.h" +#include "llpanelmarketplaceinbox.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h" #include "lltimer.h" @@ -60,9 +64,33 @@ BOOL LLPanelMarketplaceOutbox::postBuild() mSyncButton->setEnabled(!isOutboxEmpty()); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); + return TRUE; } +void LLPanelMarketplaceOutbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + } +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 2fbe819762..94bc066224 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -54,6 +54,8 @@ protected: void onSyncButtonClicked(); void updateSyncButtonStatus(); + void onFocusReceived(); + private: LLButton * mSyncButton; LLLoadingIndicator * mSyncIndicator; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index d916c430a8..32394da042 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -32,10 +32,10 @@ #include "llappviewer.h" #include "llavataractions.h" #include "llbutton.h" -#include "llcurl.h" #include "lldate.h" #include "llfirstuse.h" #include "llfoldertype.h" +#include "llhttpclient.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" @@ -69,6 +69,9 @@ static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel"; +static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; +static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; + static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; // @@ -84,14 +87,23 @@ public: { } - void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + void completed(U32 status, const std::string& reason, const LLSD& content) { - llinfos << "Marketplace Inbox Disabled" << llendl; - } - - void result(const LLSD& content) - { - mSidepanelInventory->enableInbox(true); + if (isGoodStatus(status)) + { + // Complete success + mSidepanelInventory->enableInbox(true); + } + else if (status == 401) + { + // API is available for use but OpenID authorization failed + mSidepanelInventory->enableInbox(true); + } + else + { + // API in unavailable + llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; + } } private: @@ -106,7 +118,8 @@ LLSidepanelInventory::LLSidepanelInventory() : LLPanel() , mItemPanel(NULL) , mPanelMainInventory(NULL) - , mInventoryFetched(false) + , mInboxEnabled(false) + , mOutboxEnabled(false) , mCategoriesObserver(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() @@ -205,8 +218,8 @@ BOOL LLSidepanelInventory::postBuild() outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); // Set the inbox and outbox visible based on debug settings (final setting comes from http request below) - inbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayInbox")); - outbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayOutbox")); + enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); + enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox")); // Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); @@ -258,11 +271,13 @@ void LLSidepanelInventory::handleLoginComplete() void LLSidepanelInventory::enableInbox(bool enabled) { + mInboxEnabled = enabled; getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); } void LLSidepanelInventory::enableOutbox(bool enabled) { + mOutboxEnabled = enabled; getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); } diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 25fc28d56b..b68abd65cc 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -43,8 +43,10 @@ public: LLSidepanelInventory(); virtual ~LLSidepanelInventory(); +private: void handleLoginComplete(); +public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -65,6 +67,9 @@ public: void enableInbox(bool enabled); void enableOutbox(bool enabled); + bool isInboxEnabled() const { return mInboxEnabled; } + bool isOutboxEnabled() const { return mOutboxEnabled; } + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -107,7 +112,8 @@ private: LLButton* mOverflowBtn; LLButton* mShopBtn; - bool mInventoryFetched; + bool mInboxEnabled; + bool mOutboxEnabled; LLInventoryCategoriesObserver* mCategoriesObserver; }; -- cgit v1.2.3 From 6215e6ba2542633afc5f8957817015f4bcf9f3cf Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Fri, 17 Jun 2011 13:22:13 -0700 Subject: EXP-872 PROGRESS -- Hide inbox unless applicable * Updated to use the current user's agent id instead of Pup's Reviewed by Leyla :) --- indra/newview/llsidepanelinventory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 32394da042..787ebd29c2 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -241,10 +241,12 @@ void LLSidepanelInventory::handleLoginComplete() std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; - std::string url_suffix = "api/1/users/b72d31f8-d03c-4a3b-a002-3dd7b4a712b8/user_status"; - - LLHTTPClient::get(url + url_suffix, new LLInventoryUserStatusResponder(this)); + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this)); // // Track inbox and outbox folder changes -- cgit v1.2.3 From 353da63a07b07b75ad73b9f5cb8e463d07ebea3a Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Fri, 17 Jun 2011 15:24:24 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* cleaned up and refactored inventory code a bit reviewed by Leyla --- indra/newview/llfolderview.cpp | 49 +++-- indra/newview/llfolderview.h | 9 +- indra/newview/llfolderviewitem.cpp | 119 +++++++++--- indra/newview/llfolderviewitem.h | 14 +- indra/newview/llinventoryfilter.cpp | 122 +++++------- indra/newview/llinventoryfilter.h | 6 +- indra/newview/llinventorypanel.cpp | 324 +++++++++++++++---------------- indra/newview/llinventorypanel.h | 19 +- indra/newview/llpanellandmarks.cpp | 4 +- indra/newview/llplacesinventorypanel.cpp | 85 +++----- indra/newview/lltexturectrl.cpp | 1 - 11 files changed, 370 insertions(+), 382 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..260693ebc7 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -167,13 +167,22 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- /// Class LLFolderView ///---------------------------------------------------------------------------- +LLFolderView::Params::Params() +: task_id("task_id"), + title("title"), + use_label_suffix("use_label_suffix"), + allow_multiselect("allow_multiselect", true), + use_ellipses("use_ellipses", false) +{ +} + // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), mScrollContainer( NULL ), mPopupMenuHandle(), - mAllowMultiSelect(TRUE), + mAllowMultiSelect(p.allow_multiselect), mShowFolderHierarchy(FALSE), mSourceID(p.task_id), mRenameItem( NULL ), @@ -194,10 +203,12 @@ LLFolderView::LLFolderView(const Params& p) mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), mParentPanel(p.parent_panel), - mUseEllipses(false), + mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL) { + mRoot = this; + LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); setRect( rect ); @@ -424,11 +435,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } - // Need to call arrange regardless of visibility, since children's visibility - // might need to be changed too (e.g. even though a folder is invisible, its - // children also need to be set invisible for state-tracking purposes, e.g. - // llfolderviewitem::filter). - // if (folderp->getVisible()) + if (folderp->getVisible()) { S32 child_height = 0; S32 child_width = 0; @@ -764,7 +771,7 @@ void LLFolderView::sanitizeSelection() } // Don't allow invisible items (such as root folders) to be selected. - if (item->getHidden()) + if (item == getRoot()) { items_to_remove.push_back(item); } @@ -787,7 +794,7 @@ void LLFolderView::sanitizeSelection() parent_folder; parent_folder = parent_folder->getParentFolder()) { - if (parent_folder->potentiallyVisible() && !parent_folder->getHidden()) + if (parent_folder->potentiallyVisible()) { // give initial selection to first ancestor folder that potentially passes the filter if (!new_selection) @@ -808,11 +815,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) @@ -962,7 +964,9 @@ void LLFolderView::draw() } - LLFolderViewFolder::draw(); + // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, + // and arrow for the root folder + LLView::draw(); mDragAndDropThisFrame = FALSE; } @@ -1642,11 +1646,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - // Don't change selectin to hidden folder. See EXT-5328. - if (!parent_folder->getHidden()) - { - setSelection(parent_folder, FALSE, TRUE); - } + setSelection(parent_folder, FALSE, TRUE); } else { @@ -2031,7 +2031,7 @@ void LLFolderView::removeItemID(const LLUUID& id) LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2048,7 +2048,7 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2496,11 +2496,6 @@ BOOL LLFolderView::isFilterModified() return mFilter->isNotDefault(); } -BOOL LLFolderView::getAllowMultiSelect() -{ - return mAllowMultiSelect; -} - void delete_selected_item(void* user_data) { if(user_data) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 1464a058d8..12f6170a7d 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -89,7 +89,11 @@ public: Mandatory<LLPanel*> parent_panel; Optional<LLUUID> task_id; Optional<std::string> title; - Optional<bool> use_label_suffix; + Optional<bool> use_label_suffix, + allow_multiselect, + use_ellipses; + + Params(); }; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -102,7 +106,6 @@ public: // and resort the items if necessary. void setSortOrder(U32 order); void setFilterPermMask(PermissionMask filter_perm_mask); - void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } typedef boost::signals2::signal<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)> signal_t; void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); } @@ -117,7 +120,6 @@ public: //LLInventoryFilter::EFolderShow getShowFolderState(); U32 getSortOrder() const; BOOL isFilterModified(); - BOOL getAllowMultiSelect(); // Close all folders in the view void closeAllFolders(); @@ -238,7 +240,6 @@ public: void setShowSingleSelection(BOOL show); BOOL getShowSingleSelection() { return mShowSingleSelection; } F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); } - void setUseEllipses(bool use_ellipses) { mUseEllipses = use_ellipses; } bool getUseEllipses() { return mUseEllipses; } void addItemID(const LLUUID& id, LLFolderViewItem* itemp); diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index e9d1ad3a9e..904c233850 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -132,8 +132,13 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mListener(p.listener), mHidden(false), mShowLoadStatus(false) +{ +} + +BOOL LLFolderViewItem::postBuild() { refresh(); + return TRUE; } // Destroys the object @@ -195,7 +200,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children) LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children ); // Skip over items that are invisible or are hidden from the UI. - while(itemp && (!itemp->getVisible() || itemp->getHidden())) + while(itemp && !itemp->getVisible()) { LLFolderViewItem* next_itemp = itemp->mParentFolder->getPreviousFromChild( itemp, include_children ); if (itemp == next_itemp) @@ -351,7 +356,10 @@ void LLFolderViewItem::arrangeAndSet(BOOL set_selection, BOOL take_keyboard_focus) { LLFolderView* root = getRoot(); - getParentFolder()->requestArrange(); + if (getParentFolder()) + { + getParentFolder()->requestArrange(); + } if(set_selection) { setSelectionFromRoot(this, TRUE, take_keyboard_focus); @@ -442,23 +450,20 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) S32 LLFolderViewItem::getItemHeight() { - if (getHidden()) return 0; - return mItemHeight; } void LLFolderViewItem::filter( LLInventoryFilter& filter) { const BOOL previous_passed_filter = mPassedFilter; - const BOOL passed_filter = mListener && filter.check(this); + const BOOL passed_filter = filter.check(this); // If our visibility will change as a result of this filter, then // we need to be rearranged in our parent folder if (mParentFolder) { - if (getVisible() != passed_filter) - mParentFolder->requestArrange(); - if (passed_filter != previous_passed_filter) + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) mParentFolder->requestArrange(); } @@ -863,11 +868,6 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderViewItem::draw() { - if (getHidden()) - { - return; - } - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); @@ -891,8 +891,8 @@ void LLFolderViewItem::draw() // Draw open folder arrow // const bool up_to_date = mListener && mListener->isUpToDate(); - const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) || // we fetched our children and some of them have passed the filter... - (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) + const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) // we fetched our children and some of them have passed the filter... + || (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) if (possibly_has_children) { LLUIImage* arrow_image = default_params.folder_arrow_image; @@ -1054,8 +1054,11 @@ void LLFolderViewItem::draw() { root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); } - if ((mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) || - (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && root_is_loading && (mShowLoadStatus || mHidden))) + if ((mIsLoading + && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) + || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() + && root_is_loading + && (mShowLoadStatus || mHidden))) { std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) "; font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, @@ -1119,7 +1122,8 @@ LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): mLastCalculatedWidth(0), mCompletedFilterGeneration(-1), mMostFilteredDescendantGeneration(-1), - mNeedsSort(false) + mNeedsSort(false), + mPassedFolderFilter(FALSE) { } @@ -1131,6 +1135,17 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() } +void LLFolderViewFolder::setFilteredFolder(bool filtered, S32 filter_generation) +{ + mPassedFolderFilter = filtered; + mLastFilterGeneration = filter_generation; +} + +bool LLFolderViewFolder::getFilteredFolder(S32 filter_generation) +{ + return mPassedFolderFilter && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); +} + // addToFolder() returns TRUE if it succeeds. FALSE otherwise BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) { @@ -1190,8 +1205,10 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } else { - folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? - (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + folderp->setVisible( + folderp->getFilteredFolder(filter_generation) // folder must pass folder filters + && (folderp->getFiltered(filter_generation) + || folderp->hasFilteredDescendants(filter_generation))); // passed item filter or has descendants that passed filter } if (folderp->getVisible()) @@ -1311,7 +1328,9 @@ void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recur mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation); mCompletedFilterGeneration = generation; // only aggregate up if we are a lower (older) value - if (recurse_up && mParentFolder && generation < mParentFolder->getCompletedFilterGeneration()) + if (recurse_up + && mParentFolder + && generation < mParentFolder->getCompletedFilterGeneration()) { mParentFolder->setCompletedFilterGeneration(generation, TRUE); } @@ -1336,15 +1355,17 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) // filter folder itself if (getLastFilterGeneration() < filter_generation) { - if (getLastFilterGeneration() >= must_pass_generation && // folder has been compared to a valid precursor filter - !mPassedFilter) // and did not pass the filter + if (getLastFilterGeneration() >= must_pass_generation // folder has been compared to a valid precursor filter + && !mPassedFilter) // and did not pass the filter { // go ahead and flag this folder as done mLastFilterGeneration = filter_generation; } - else + else // filter self only on first pass through { - // filter self only on first pass through + // filter against folder rules + filterFolder(filter); + // and then item rules LLFolderViewItem::filter( filter ); } if (mHidden) @@ -1377,7 +1398,10 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } // when applying a filter, matching folders get their contents downloaded first - if (filter.isNotDefault() && getFiltered(filter.getMinRequiredGeneration()) && (mListener && !gInventory.isCategoryComplete(mListener->getUUID()))) + if (filter.isNotDefault() + && getFiltered(filter.getMinRequiredGeneration()) + && (mListener + && !gInventory.isCategoryComplete(mListener->getUUID()))) { LLInventoryModelBackgroundFetch::instance().start(mListener->getUUID()); } @@ -1467,6 +1491,31 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } } +void LLFolderViewFolder::filterFolder(LLInventoryFilter& filter) +{ + const BOOL previous_passed_filter = mPassedFolderFilter; + const BOOL passed_filter = filter.checkFolder(this); + + // If our visibility will change as a result of this filter, then + // we need to be rearranged in our parent folder + if (mParentFolder) + { + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) + { + mParentFolder->requestArrange(); + } + } + + setFilteredFolder(passed_filter, filter.getCurrentGeneration()); + filter.decrementFilterCount(); + + if (getRoot()->getDebugFilters()) + { + mStatusText = llformat("%d", mLastFilterGeneration); + } +} + void LLFolderViewFolder::setFiltered(BOOL filtered, S32 filter_generation) { // if this folder is now filtered, but wasn't before @@ -2059,7 +2108,9 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r (*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */ } } - if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) + if (mParentFolder + && (recurse == RECURSE_UP + || recurse == RECURSE_UP_DOWN)) { mParentFolder->setOpenArrangeRecursively(openitem, RECURSE_UP); } @@ -2301,13 +2352,16 @@ void LLFolderViewFolder::draw() bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); - if(!up_to_date && mListener && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) + if(!up_to_date + && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) { possibly_has_children = true; } - BOOL loading = ( mIsOpen && possibly_has_children && !up_to_date ); + BOOL loading = (mIsOpen + && possibly_has_children + && !up_to_date ); if ( loading && !mIsLoading ) { @@ -2573,7 +2627,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde { // ignore sort order for landmarks in the Favorites folder. // they should be always sorted as in Favorites bar. See EXT-719 - if (a->getSortGroup() == SG_ITEM && b->getSortGroup() == SG_ITEM + if (a->getSortGroup() == SG_ITEM + && b->getSortGroup() == SG_ITEM && a->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK && b->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK) { @@ -2600,8 +2655,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde // We sort by name if we aren't sorting by date // OR if these are folders and we are sorting folders by name. bool by_name = (!mByDate - || (mFoldersByName - && (a->getSortGroup() != SG_ITEM))); + || (mFoldersByName + && (a->getSortGroup() != SG_ITEM))); if (a->getSortGroup() != b->getSortGroup()) { diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index fc941510ab..c48e568b30 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -174,6 +174,8 @@ protected: static LLFontGL* getLabelFontForStyle(U8 style); public: + BOOL postBuild(); + // This function clears the currently selected item, and records // the specified selected item appropriately for display and use // in the UI. If open is TRUE, then folders are opened up along @@ -202,11 +204,6 @@ public: virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); virtual S32 getItemHeight(); - // Hide the folder from the UI, such as if you want to hide the root - // folder in an inventory panel. - void setHidden(bool hidden) { mHidden = hidden; } - bool getHidden() const { return mHidden; } - // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); @@ -392,6 +389,8 @@ protected: S32 mCompletedFilterGeneration; S32 mMostFilteredDescendantGeneration; bool mNeedsSort; + bool mPassedFolderFilter; + public: typedef enum e_recurse_type { @@ -432,6 +431,11 @@ public: virtual void filter( LLInventoryFilter& filter); virtual void setFiltered(BOOL filtered, S32 filter_generation); virtual void dirtyFilter(); + + // folder-specific filtering (filter status propagates top down instead of bottom up) + void filterFolder(LLInventoryFilter& filter); + void setFilteredFolder(bool filtered, S32 filter_generation); + bool getFilteredFolder(S32 filter_generation); // Passes selection information on to children and record // selection information if necessary. diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index dee15a1efd..49e0ab33e5 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -107,6 +107,31 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) return passed; } +bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) +{ + // we're showing all folders, overriding filter + if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + { + return true; + } + + const LLFolderViewEventListener* listener = folder->getListener(); + const LLUUID folder_id = listener->getUUID(); + + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) + { + // Can only filter categories for items in your inventory + // (e.g. versus in-world object contents). + const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); + if (!cat) + return false; + if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) + return false; + } + + return true; +} + BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const { const LLFolderViewEventListener* listener = item->getListener(); @@ -137,30 +162,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } - - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_CATEGORY - // Pass if this item is a category of the filter type, or - // if its parent is a category of the filter type. - if (filterTypes & FILTERTYPE_CATEGORY) - { - // Can only filter categories for items in your inventory - // (e.g. versus in-world object contents). - if (!object) return FALSE; - - LLUUID cat_id = object_id; - if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) - { - cat_id = object->getParentUUID(); - } - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); - if (!cat) - return FALSE; - if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) - return FALSE; - } - - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -172,7 +173,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con return FALSE; } - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_DATE // Pass if this item is within the date range. @@ -293,15 +293,15 @@ BOOL LLInventoryFilter::isModifiedAndClear() return ret; } -void LLInventoryFilter::setFilterObjectTypes(U64 types) +void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) { - if (mFilterOps.mFilterObjectTypes != types) + if (current_types != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterObjectTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterObjectTypes & types); + BOOL fewer_bits_set = (current_types & ~types); + BOOL more_bits_set = (~current_types & types); - mFilterOps.mFilterObjectTypes = types; + current_types = types; if (more_bits_set && fewer_bits_set) { // neither less or more restrive, both simultaneously @@ -318,62 +318,23 @@ void LLInventoryFilter::setFilterObjectTypes(U64 types) setModified(FILTER_MORE_RESTRICTIVE); } } +} + +void LLInventoryFilter::setFilterObjectTypes(U64 types) +{ + updateFilterTypes(types, mFilterOps.mFilterObjectTypes); mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; } void LLInventoryFilter::setFilterCategoryTypes(U64 types) { - if (mFilterOps.mFilterCategoryTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterCategoryTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterCategoryTypes & types); - - mFilterOps.mFilterCategoryTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } - mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; + updateFilterTypes(types, mFilterOps.mFilterCategoryTypes); + mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY; } void LLInventoryFilter::setFilterWearableTypes(U64 types) { - if (mFilterOps.mFilterWearableTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterWearableTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterWearableTypes & types); - - mFilterOps.mFilterWearableTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } + updateFilterTypes(types, mFilterOps.mFilterWearableTypes); mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE; } @@ -898,11 +859,16 @@ void LLInventoryFilter::fromLLSD(LLSD& data) } } -U32 LLInventoryFilter::getFilterObjectTypes() const +U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; } +U64 LLInventoryFilter::getFilterCategoryTypes() const +{ + return mFilterOps.mFilterCategoryTypes; +} + BOOL LLInventoryFilter::hasFilterString() const { return mFilterSubString.size() > 0; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 39e6f797a2..f9460822f7 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -31,6 +31,7 @@ #include "llpermissionsflags.h" class LLFolderViewItem; +class LLFolderViewFolder; class LLInventoryFilter { @@ -81,11 +82,13 @@ public: // + Parameters // +-------------------------------------------------------------------+ void setFilterObjectTypes(U64 types); - U32 getFilterObjectTypes() const; + U64 getFilterObjectTypes() const; + U64 getFilterCategoryTypes() const; BOOL isFilterObjectTypesWith(LLInventoryType::EType t) const; void setFilterCategoryTypes(U64 types); void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); + void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -110,6 +113,7 @@ public: // + Execution And Results // +-------------------------------------------------------------------+ BOOL check(const LLFolderViewItem* item); + bool checkFolder(const LLFolderViewFolder* folder); BOOL checkAgainstFilterType(const LLFolderViewItem* item) const; BOOL checkAgainstPermissions(const LLFolderViewItem* item) const; BOOL checkAgainstFilterLinks(const LLFolderViewItem* item) const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..1ff423056a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -132,8 +132,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), mViewsInitialized(false), - mStartFolderString(p.start_folder), - mBuildDefaultHierarchy(true), mInvFVBridgeBuilder(NULL) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -146,11 +144,48 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2)); mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars)); - - if (mStartFolderString != "") + +} + +void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + LLUUID root_id; + + if ("LIBRARY" == params.start_folder()) { - mBuildDefaultHierarchy = false; + root_id = gInventory.getLibraryRootFolderID(); } + else + { + root_id = (preferred_type != LLFolderType::FT_NONE) + ? gInventory.findCategoryUUIDForType(preferred_type) + : LLUUID::null; + } + + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.use_label_suffix = params.use_label_suffix; + p.allow_multiselect = mAllowMultiSelect; + mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); + } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -159,22 +194,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves - // Create root folder - { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.use_label_suffix = params.use_label_suffix; - mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); - } + buildFolderView(params); mCommitCallbackRegistrar.popScope(); @@ -206,7 +226,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // Build view of inventory if we need default full hierarchy and inventory ready, // otherwise wait for idle callback. - if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) + if (mInventory->isInventoryUsable() && !mViewsInitialized) { initializeViews(); } @@ -264,6 +284,15 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } +const LLInventoryFilter* LLInventoryPanel::getFilter() const +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) @@ -488,23 +517,16 @@ void LLInventoryPanel::onIdle(void *userdata) } } +const LLUUID& LLInventoryPanel::getRootFolderID() const +{ + return mFolderRoot->getListener()->getUUID(); +} + void LLInventoryPanel::initializeViews() { if (!gInventory.isInventoryUsable()) return; - // Determine the root folder in case specified, and - // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - - if ("LIBRARY" == mStartFolderString) - { - mStartFolderID = gInventory.getLibraryRootFolderID(); - } - else - { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - } - rebuildViewsFor(mStartFolderID); + rebuildViewsFor(getRootFolderID()); mViewsInitialized = true; @@ -533,7 +555,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && id.notNull()) + if (old_view && old_view != mFolderRoot) { old_view->destroyView(); } @@ -543,118 +565,101 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) void LLInventoryPanel::buildNewViews(const LLUUID& id) { - LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS); - LLFolderViewItem* itemp = NULL; - LLInventoryObject* objectp = gInventory.getObject(id); - if (objectp) - { - const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); - if (id == mStartFolderID) - { - parent_folder = mFolderRoot; - } - else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID))) - { - // This item exists outside the inventory's hierarchy, so don't add it. - return; - } - - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << llendl; - return; - } - - if ((objectp->getType() == LLAssetType::AT_CATEGORY) && - (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) - { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - mFolderRoot, - objectp->getUUID()); - if (new_listener) - { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); - itemp = folderp; - - // Hide the root folder, so we can show the contents of a folder flat - // but still have the parent folder present for listener-related operations. - if (id == mStartFolderID) - { - folderp->setHidden(TRUE); - } - const LLViewerInventoryCategory *cat = dynamic_cast<LLViewerInventoryCategory *>(objectp); - if (cat && getIsHiddenFolderType(cat->getPreferredType())) - { - folderp->setHidden(TRUE); - } - } - } - else - { - // Build new view for item. - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - mFolderRoot, - item->getUUID(), - item->getFlags()); - - if (new_listener) - { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create<LLFolderViewItem> (params); - } - } - - if (itemp) - { - itemp->addToFolder(parent_folder, mFolderRoot); - - // Don't add children of hidden folders unless this is the panel's root folder. - if (itemp->getHidden() && (id != mStartFolderID)) - { - return; - } + LLInventoryObject const* objectp = gInventory.getObject(id); + LLUUID root_id = mFolderRoot->getListener()->getUUID(); + LLFolderViewFolder* parent_folder = NULL; + + if (id == root_id) + { + parent_folder = mFolderRoot; + } + else if (objectp) + { + LLFolderViewItem* itemp = NULL; + const LLUUID &parent_id = objectp->getParentUUID(); + parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); + + if (parent_folder) + { + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; + return; + } + + if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) + { + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + mFolderRoot, + objectp->getUUID()); + if (new_listener) + { + LLFolderViewFolder::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.root = mFolderRoot; + params.listener = new_listener; + params.tool_tip = params.name; + LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params); + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + itemp = folderp; + } + } + else + { + // Build new view for item. + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + mFolderRoot, + item->getUUID(), + item->getFlags()); + + if (new_listener) + { + LLFolderViewItem::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.creation_date = new_listener->getCreationDate(); + params.root = mFolderRoot; + params.listener = new_listener; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + itemp = LLUICtrlFactory::create<LLFolderViewItem> (params); + } + } + + if (itemp) + { + itemp->addToFolder(parent_folder, mFolderRoot); + } } } // If this is a folder, add the children of the folder and recursively add any // child folders. - if ((id == mStartFolderID) || - (objectp && objectp->getType() == LLAssetType::AT_CATEGORY)) + if (id.isNull() + || (objectp + && objectp->getType() == LLAssetType::AT_CATEGORY)) { LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; @@ -671,7 +676,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } } - if(items) + if(items && parent_folder) { for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); item_iter != items->end(); @@ -688,23 +693,17 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) // bit of a hack to make sure the inventory is open. void LLInventoryPanel::openStartFolderOrMyInventory() { - if (mStartFolderString != "") - { - mFolderRoot->openFolder(mStartFolderString); - } - else + // Find My Inventory folder and open it up by name + for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) { - // Find My Inventory folder and open it up by name - for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) + LLFolderViewFolder *fchild = dynamic_cast<LLFolderViewFolder*>(child); + if (fchild + && fchild->getListener() + && fchild->getListener()->getUUID() == gInventory.getRootFolderID()) { - LLFolderViewFolder *fchild = dynamic_cast<LLFolderViewFolder*>(child); - if (fchild && fchild->getListener() && - (fchild->getListener()->getUUID() == gInventory.getRootFolderID())) - { - const std::string& child_name = child->getName(); - mFolderRoot->openFolder(child_name); - break; - } + const std::string& child_name = child->getName(); + mFolderRoot->openFolder(child_name); + break; } } } @@ -1067,15 +1066,12 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) { - if (!getIsHiddenFolderType(folder_type)) - { - mHiddenFolderTypes.push_back(folder_type); - } + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << folder_type)); } BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const { - return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end()); + return !(getFilter()->getFilterCategoryTypes() & (1ULL << folder_type)); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 9da9f7d8ba..da67da13b2 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -126,6 +126,7 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); void clearSelection(); LLInventoryFilter* getFilter(); + const LLInventoryFilter* getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); } void setFilterPermMask(PermissionMask filter_perm_mask); @@ -140,7 +141,6 @@ public: void setShowFolderState(LLInventoryFilter::EFolderShow show); LLInventoryFilter::EFolderShow getShowFolderState(); - void setAllowMultiSelect(BOOL allow) { mFolderRoot->setAllowMultiSelect(allow); } // This method is called when something has changed about the inventory. void modelChanged(U32 mask); LLFolderView* getRootFolder() { return mFolderRoot; } @@ -207,23 +207,18 @@ private: //-------------------------------------------------------------------- public: void addHideFolderType(LLFolderType::EType folder_type); -protected: - BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; -private: - std::vector<LLFolderType::EType> mHiddenFolderTypes; - //-------------------------------------------------------------------- - // Initialization routines for building up the UI ("views") - //-------------------------------------------------------------------- public: BOOL getIsViewsInitialized() const { return mViewsInitialized; } - const LLUUID& getStartFolderID() const { return mStartFolderID; } - const std::string& getStartFolderString() { return mStartFolderString; } + const LLUUID& getRootFolderID() const; protected: // Builds the UI. Call this once the inventory is usable. void initializeViews(); - void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. - virtual void buildNewViews(const LLUUID& id); + void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. + + virtual void buildFolderView(const LLInventoryPanel::Params& params); + virtual void buildNewViews(const LLUUID& id); + BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; private: BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() BOOL mViewsInitialized; // Views have been generated diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 80f6862169..f09f675b75 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -645,7 +645,7 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesI // Start background fetch, mostly for My Inventory and Library if (expanded) { - const LLUUID &cat_id = inventory_list->getStartFolderID(); + const LLUUID &cat_id = inventory_list->getRootFolderID(); // Just because the category itself has been fetched, doesn't mean its child folders have. /* if (!gInventory.isCategoryComplete(cat_id)) @@ -1414,7 +1414,7 @@ static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::strin static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list) { - LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getStartFolderID()); + LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getRootFolderID()); if (category) { return category->getDescendentCount() > 0; diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 29e262199e..f7823f4fe8 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llinventoryfunctions.h" #include "llpanellandmarks.h" #include "llplacesinventorybridge.h" +#include "llviewerfoldertype.h" static LLDefaultChildRegistry::Register<LLPlacesInventoryPanel> r("places_inventory_panel"); @@ -56,72 +57,44 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel() delete mSavedFolderState; } -BOOL LLPlacesInventoryPanel::postBuild() +void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { - LLInventoryPanel::postBuild(); + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); - // clear Contents(); - { - mFolderRoot->destroyView(); - mFolderRoot->getParent()->removeChild(mFolderRoot); - mFolderRoot->die(); - - if( mScroller ) - { - removeChild( mScroller ); - mScroller->die(); - mScroller = NULL; - } - mFolderRoot = NULL; - } - - - mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves + LLUUID root_id; - // create root folder + if ("LIBRARY" == params.start_folder()) { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLPlacesFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); + root_id = gInventory.getLibraryRootFolderID(); } - - mCommitCallbackRegistrar.popScope(); - - mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); - - // scroller + else { - LLRect scroller_view_rect = getRect(); - scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create<LLScrollContainer>(p); + root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); } - addChild(mScroller); - mScroller->addChild(mFolderRoot); - - mFolderRoot->setScrollContainer(mScroller); - mFolderRoot->addChild(mFolderRoot->mStatusTextBox); - - // cut subitems - mFolderRoot->setUseEllipses(true); - - return TRUE; + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLPlacesFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.parent_panel = this; + p.allow_multiselect = mAllowMultiSelect; + p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller + mFolderRoot = (LLFolderView*)LLUICtrlFactory::create<LLPlacesFolderView>(p); } + // save current folder open state void LLPlacesInventoryPanel::saveFolderState() { diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1023a4339b..b182c15dd0 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -420,7 +420,6 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryPanel->setAllowMultiSelect(FALSE); // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. -- cgit v1.2.3 From e297016af881e51c14441ac63b67257e3d8624e2 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Fri, 17 Jun 2011 15:25:37 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* forgot a file reviewed by Leyla --- indra/newview/llplacesinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 6641871a0b..f647e7f970 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -46,7 +46,7 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void buildFolderView(const LLInventoryPanel::Params& params); void saveFolderState(); void restoreFolderState(); -- cgit v1.2.3 From 5af57330eb23dd6f00f02bafdf08ee70b5cae50b Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Mon, 20 Jun 2011 08:57:57 -0700 Subject: EXP-917 FIX -- Inbox and Outbox options shown in the + Menu in the Inventory Panel Oops. --- .../newview/skins/default/xui/en/menu_inventory_add.xml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index f38ea04858..e0ccb18c08 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -91,22 +91,6 @@ function="Inventory.DoCreate" parameter="category" /> </menu_item_call> - <menu_item_call - label="Inbox" - layout="topleft" - name="Inbox"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="inbox" /> -</menu_item_call> - <menu_item_call - label="Outbox" - layout="topleft" - name="Outbox"> - <menu_item_call.on_click - function="Inventory.DoCreate" - parameter="outbox" /> -</menu_item_call> <menu_item_call label="New Script" layout="topleft" -- cgit v1.2.3 From 015db564cff18fa58fa677b48ef7a7048c444fb4 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 20 Jun 2011 11:00:02 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* removed mHidden variable --- indra/newview/llfolderviewitem.cpp | 7 +------ indra/newview/llfolderviewitem.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 904c233850..5f1d32ee5a 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -130,7 +130,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mIconOpen(p.icon_open), mIconOverlay(p.icon_overlay), mListener(p.listener), - mHidden(false), mShowLoadStatus(false) { } @@ -1058,7 +1057,7 @@ void LLFolderViewItem::draw() && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && root_is_loading - && (mShowLoadStatus || mHidden))) + && mShowLoadStatus)) { std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) "; font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, @@ -1368,10 +1367,6 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) // and then item rules LLFolderViewItem::filter( filter ); } - if (mHidden) - { - setOpen(); - } } if (getRoot()->getDebugFilters()) diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index c48e568b30..7d640adf2e 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -157,7 +157,6 @@ protected: BOOL mDragAndDropTarget; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; - bool mHidden; bool mShowLoadStatus; // helper function to change the selection from the root. -- cgit v1.2.3 From 4ba2a801489d59b39f0c0cd9b2fc7cc4fe396a8e Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 20 Jun 2011 11:02:36 -0700 Subject: fixed build on mac/linux --- indra/newview/llfolderviewitem.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 5f1d32ee5a..1f53586ccc 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1171,8 +1171,6 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) mHasVisibleChildren = hasFilteredDescendants(filter_generation); - LLInventoryFilter::EFolderShow show_folder_state = getRoot()->getFilter()->getShowFolderState(); - // calculate height as a single item (without any children), and reshapes rectangle to match LLFolderViewItem::arrange( width, height, filter_generation ); -- cgit v1.2.3 From 941a360c465a902a083bbab3da176351331428b5 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 20 Jun 2011 18:03:58 -0700 Subject: EXP-893 FIX Single order purchases not sorted with most recent item delivered at top of list reviewed by Leyla --- indra/newview/llfolderviewitem.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 57e5488a4e..85791774d7 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1985,6 +1985,13 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) item->dirtyFilter(); requestArrange(); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && !parentp->getCreationDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } @@ -2004,6 +2011,13 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) // rearrange all descendants too, as our indentation level might have changed folder->requestArrange(TRUE); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && !parentp->getCreationDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } -- cgit v1.2.3 From 149b160a6d544824401348e8e97a64339815d8c1 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 20 Jun 2011 18:14:26 -0700 Subject: EXP-872 Hide inbox unless applicable --- indra/newview/llsidepanelinventory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 787ebd29c2..864637d744 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -51,6 +51,7 @@ #include "llsidepaneltaskinfo.h" #include "llstring.h" #include "lltabcontainer.h" +#include "llviewermedia.h" #include "llviewernetwork.h" #include "llweb.h" @@ -245,8 +246,13 @@ void LLSidepanelInventory::handleLoginComplete() url += "api/1/users/"; url += gAgent.getID().getString(); url += "/user_status"; + + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); + headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); - LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this)); + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); // // Track inbox and outbox folder changes -- cgit v1.2.3 From 658fdbb4df40207c67b4cfa6d911e41af9545efa Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Mon, 20 Jun 2011 18:14:36 -0700 Subject: EXP-872 Hide inbox unless applicable --- indra/newview/llviewermedia.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index a70c6f4887..180e1d5676 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,6 +160,8 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); + + static std::string getOpenIDCookie() { return sOpenIDCookie; } private: static void setOpenIDCookie(); -- cgit v1.2.3 From 917e2d18973bd17929d589ee58b3f47a09c7157b Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 21 Jun 2011 14:16:27 -0700 Subject: EXP-895 Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel --- indra/newview/llfolderview.cpp | 8 +- indra/newview/llpanelmaininventory.cpp | 6 +- indra/newview/llpanelmarketplaceinbox.cpp | 426 +++++++++++++++--------------- indra/newview/llpanelmarketplaceinbox.h | 2 + indra/newview/llsidepanelinventory.h | 3 +- 5 files changed, 227 insertions(+), 218 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..ba6fa18aab 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -806,13 +806,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } + new_selection = NULL; } if (new_selection) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9f797eb147..728642e4c7 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -577,14 +577,16 @@ void LLPanelMainInventory::updateItemcountText() void LLPanelMainInventory::onFocusReceived() { - LLInventoryPanel * inbox_panel = findChild<LLInventoryPanel>("inventory_inbox"); + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); if (inbox_panel) { inbox_panel->clearSelection(); } - LLInventoryPanel * outbox_panel = findChild<LLInventoryPanel>("inventory_outbox"); + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); if (outbox_panel) { diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index eff27aa541..1962724891 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -1,208 +1,218 @@ -/** - * @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" - -#include "llappviewer.h" -#include "llbutton.h" -#include "llinventorypanel.h" -#include "llsidepanelinventory.h" - - -#define SUPPORTING_FRESH_ITEM_COUNT 0 - - -static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); - -const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() -{ - return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>(); -} - -// protected -LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) - : LLPanel(p) - , mInventoryPanel(NULL) -{ -} - -LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() -{ -} - -// virtual -BOOL LLPanelMarketplaceInbox::postBuild() -{ - mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); - - mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); - - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); - - LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); - - return TRUE; -} - -void LLPanelMarketplaceInbox::handleLoginComplete() -{ - // Set us up as the class to drive the badge value for the sidebar_inventory button - LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); -} - -void LLPanelMarketplaceInbox::onFocusReceived() -{ - LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); - - if (sidepanel_inventory) - { - LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); - - if (inv_panel) - { - inv_panel->clearSelection(); - } - - LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); - - if (outbox_panel) - { - outbox_panel->clearSelection(); - } - } -} - -BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) -{ - *accept = ACCEPT_NO; - return TRUE; -} - -U32 LLPanelMarketplaceInbox::getFreshItemCount() const -{ - U32 fresh_item_count = 0; - - LLFolderView * root_folder = mInventoryPanel->getRootFolder(); - - const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); - - LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); - LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); - - for (; folders_it != folders_end; ++folders_it) - { - const LLFolderViewFolder * folder = *folders_it; - - if (folder->getCreationDate() > 1500) - { - fresh_item_count++; - } - } - - return fresh_item_count; -} - -U32 LLPanelMarketplaceInbox::getTotalItemCount() const -{ - LLInventoryModel* model = mInventoryPanel->getModel(); - - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - - U32 item_count = 0; - - if (cats) - { - item_count += cats->size(); - } - - if (items) - { - item_count += items->size(); - } - - return item_count; -} - -std::string LLPanelMarketplaceInbox::getBadgeString() const -{ - std::string item_count_str(""); - - // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel - if (getParent()->getVisible() && - (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) - { - U32 item_count = getFreshItemCount(); - - if (item_count) - { - item_count_str = llformat("%d", item_count); - } - } - - return item_count_str; -} - -void LLPanelMarketplaceInbox::draw() -{ - U32 item_count = getTotalItemCount(); - - LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); - - if (item_count > 0) - { - std::string item_count_str = llformat("%d", item_count); - - LLStringUtil::format_map_t args; - args["[NUM]"] = item_count_str; - getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); - -#if SUPPORTING_FRESH_ITEM_COUNT - // set green text to fresh item count - U32 fresh_item_count = getFreshItemCount(); - fresh_new_count_view->setVisible((fresh_item_count > 0)); - - if (fresh_item_count > 0) - { - getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); - } -#else - fresh_new_count_view->setVisible(FALSE); -#endif - } - else - { - getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); - - fresh_new_count_view->setVisible(FALSE); - } - - LLPanel::draw(); -} +/** + * @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" + +#include "llappviewer.h" +#include "llbutton.h" +#include "llinventorypanel.h" +#include "llsidepanelinventory.h" + + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + + +static LLRegisterPanelClassWrapper<LLPanelMarketplaceInbox> t_panel_marketplace_inbox("panel_marketplace_inbox"); + +const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceInbox>(); +} + +// protected +LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) + : LLPanel(p) + , mInventoryPanel(NULL) +{ +} + +LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceInbox::postBuild() +{ + mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); + + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); + + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); + + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); + + return TRUE; +} + +void LLPanelMarketplaceInbox::onSelectionChange() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->updateVerbs(); +} + + +void LLPanelMarketplaceInbox::handleLoginComplete() +{ + // Set us up as the class to drive the badge value for the sidebar_inventory button + LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); +} + +void LLPanelMarketplaceInbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + } +} + +BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; + return TRUE; +} + +U32 LLPanelMarketplaceInbox::getFreshItemCount() const +{ + U32 fresh_item_count = 0; + + LLFolderView * root_folder = mInventoryPanel->getRootFolder(); + + const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); + + LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); + LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); + + for (; folders_it != folders_end; ++folders_it) + { + const LLFolderViewFolder * folder = *folders_it; + + if (folder->getCreationDate() > 1500) + { + fresh_item_count++; + } + } + + return fresh_item_count; +} + +U32 LLPanelMarketplaceInbox::getTotalItemCount() const +{ + LLInventoryModel* model = mInventoryPanel->getModel(); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); + + U32 item_count = 0; + + if (cats) + { + item_count += cats->size(); + } + + if (items) + { + item_count += items->size(); + } + + return item_count; +} + +std::string LLPanelMarketplaceInbox::getBadgeString() const +{ + std::string item_count_str(""); + + // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel + if (getParent()->getVisible() && + (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) + { + U32 item_count = getFreshItemCount(); + + if (item_count) + { + item_count_str = llformat("%d", item_count); + } + } + + return item_count_str; +} + +void LLPanelMarketplaceInbox::draw() +{ + U32 item_count = getTotalItemCount(); + + LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); + + if (item_count > 0) + { + std::string item_count_str = llformat("%d", item_count); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + +#if SUPPORTING_FRESH_ITEM_COUNT + // set green text to fresh item count + U32 fresh_item_count = getFreshItemCount(); + fresh_new_count_view->setVisible((fresh_item_count > 0)); + + if (fresh_item_count > 0) + { + getChild<LLUICtrl>("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); + } +#else + fresh_new_count_view->setVisible(FALSE); +#endif + } + else + { + getChild<LLButton>("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + + fresh_new_count_view->setVisible(FALSE); + } + + LLPanel::draw(); +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index d5b216b56d..b176d57d3f 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -63,6 +63,8 @@ public: private: void handleLoginComplete(); + void onSelectionChange(); + void onFocusReceived(); private: diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index b68abd65cc..df29cbceba 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -70,6 +70,8 @@ public: bool isInboxEnabled() const { return mInboxEnabled; } bool isOutboxEnabled() const { return mOutboxEnabled; } + void updateVerbs(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -77,7 +79,6 @@ protected: void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); // "wear", "teleport", etc. void performActionOnSelection(const std::string &action); - void updateVerbs(); bool canWearSelected(); // check whether selected items can be worn -- cgit v1.2.3 From 1e87fc43d7c07be618678aab6ee9f5511e593e92 Mon Sep 17 00:00:00 2001 From: Don Kjer <don@lindenlab.com> Date: Tue, 21 Jun 2011 14:57:02 -0700 Subject: Fix for memory leak & extra inventory observers in start_new_inventory_observer. Reviewed by Richard --- indra/newview/llviewermessage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3832be727f..766df29a81 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -937,7 +937,6 @@ protected: //one global instance to bind them LLOpenTaskOffer* gNewInventoryObserver=NULL; - class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: @@ -947,6 +946,8 @@ protected: } }; +LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; + void start_new_inventory_observer() { if (!gNewInventoryObserver) //task offer observer @@ -963,7 +964,12 @@ void start_new_inventory_observer() gInventory.addObserver(gInventoryMoveObserver); } - gInventory.addObserver(new LLNewInventoryHintObserver()); + if (!gNewInventoryHintObserver) + { + // Observer is deleted by gInventory + gNewInventoryHintObserver = new LLNewInventoryHintObserver(); + gInventory.addObserver(gNewInventoryHintObserver); + } } class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver -- cgit v1.2.3 From e2f9276a083f5883e250b0edcc5c68273985be8b Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 21 Jun 2011 15:18:05 -0700 Subject: EXP-877 Profile button not active when selecting items in Marketplace inbox --- indra/newview/llavataractions.cpp | 64 +++++++++++++++++---------- indra/newview/llavataractions.h | 3 ++ indra/newview/llsidepanelinventory.cpp | 80 ++++++++++++++++++++-------------- 3 files changed, 92 insertions(+), 55 deletions(-) diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index cbbdcb2983..eeb4ec8458 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -69,6 +69,7 @@ #include "lltrans.h" #include "llcallingcard.h" #include "llslurl.h" // IDEVO +#include "llsidepanelinventory.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -444,8 +445,6 @@ void LLAvatarActions::share(const LLUUID& id) namespace action_give_inventory { - typedef std::set<LLUUID> uuid_set_t; - /** * Returns a pointer to 'Add More' inventory panel of Edit Outfit SP. */ @@ -475,18 +474,16 @@ namespace action_give_inventory /** * Checks My Inventory visibility. */ + static bool is_give_inventory_acceptable() { - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return false; - // check selection in the panel - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool acceptable = false; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); @@ -529,12 +526,12 @@ namespace action_give_inventory } } - static void build_items_string(const uuid_set_t& inventory_selected_uuids , std::string& items_string) + static void build_items_string(const std::set<LLUUID>& inventory_selected_uuids , std::string& items_string) { llassert(inventory_selected_uuids.size() > 0); const std::string& separator = LLTrans::getString("words_separator"); - for (uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); ; ) + for (std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); ; ) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); if (NULL != inv_cat) @@ -570,10 +567,7 @@ namespace action_give_inventory return; } - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -590,8 +584,8 @@ namespace action_give_inventory // We souldn't open IM session, just calculate session ID for logging purpose. See EXT-6710 const LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, avatar_uuid); - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); const std::string& separator = LLTrans::getString("words_separator"); std::string noncopy_item_names; @@ -654,10 +648,7 @@ namespace action_give_inventory { llassert(avatar_names.size() == avatar_uuids.size()); - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -678,6 +669,33 @@ namespace action_give_inventory } } + + +//static +std::set<LLUUID> LLAvatarActions::getInventorySelectedUUIDs() +{ + std::set<LLUUID> inventory_selected_uuids; + + LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); + if (active_panel) + { + inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + } + + if (inventory_selected_uuids.empty()) + { + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); + LLInventoryPanel * inbox = sidepanel_inventory->findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + inventory_selected_uuids = inbox->getRootFolder()->getSelectionList(); + } + + } + + return inventory_selected_uuids; +} + //static void LLAvatarActions::shareWithAvatars() { @@ -705,12 +723,12 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL // check selection in the panel LLFolderView* root_folder = inv_panel->getRootFolder(); - const uuid_set_t inventory_selected_uuids = root_folder->getSelectionList(); + const std::set<LLUUID> inventory_selected_uuids = root_folder->getSelectionList(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool can_share = true; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set<LLUUID>::const_iterator it = inventory_selected_uuids.begin(); + const std::set<LLUUID>::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 956fed7461..fbfd815f41 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -36,6 +36,7 @@ class LLInventoryPanel; + /** * Friend-related actions (add, remove, offer teleport, etc) */ @@ -196,6 +197,8 @@ public: */ static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL); + static std::set<LLUUID> getInventorySelectedUUIDs(); + private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 864637d744..79d68de289 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -246,11 +246,11 @@ void LLSidepanelInventory::handleLoginComplete() url += "api/1/users/"; url += gAgent.getID().getString(); url += "/user_status"; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); + headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); @@ -423,22 +423,24 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return; + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + } } + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); - return; - } - // Get selected items set. - const std::set<LLUUID> selected_uuids_set = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); + const std::set<LLUUID> selected_uuids_set = LLAvatarActions::getInventorySelectedUUIDs(); if (selected_uuids_set.empty()) return; // nothing selected // Convert the set to a vector. @@ -574,34 +576,29 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { + bool can_share = false; + LLPanelMainInventory* panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) - { - llwarns << "Failed to get the main inventory panel" << llendl; - return false; - } + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); - LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel(); + return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false) + || (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) ); + // Avoid flicker in the Recent tab while inventory is being loaded. - if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; - - return LLAvatarActions::canShareSelectedItems(active_panel); + //if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; } + bool LLSidepanelInventory::canWearSelected() { - LLPanelMainInventory* panel_main_inventory = - mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); + std::set<LLUUID> selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + + if (selected_uuids.empty()) return false; - } - std::set<LLUUID> selected_uuids = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); for (std::set<LLUUID>::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); ++it) @@ -618,7 +615,15 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return NULL; + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return NULL; + } + } } const LLUUID &item_id = current_item->getListener()->getUUID(); LLInventoryItem *item = gInventory.getItem(item_id); @@ -627,9 +632,20 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() U32 LLSidepanelInventory::getSelectedCount() { + int count = 0; + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); - return selection_list.size(); + count += selection_list.size(); + + LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + if (inbox) + { + selection_list = inbox->getRootFolder()->getSelectionList(); + count += selection_list.size(); + } + + return count; } LLInventoryPanel *LLSidepanelInventory::getActivePanel() -- cgit v1.2.3 From 57017a7a6e65c885b6124849fd5da3eae68717f8 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Wed, 22 Jun 2011 14:26:15 -0400 Subject: EXP-920 FIX -- Received Items panel is not opened if closed when a new Direct Delivery items is delivered when user has Inventory panel open * Mac build fix by removing an unused variable * Inbox panel now auto-expands when new item delivered Reviewed by Richard --- indra/newview/llsidepanelinventory.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 79d68de289..1182e5db34 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -75,6 +75,8 @@ static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; +static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; + // // Helpers // @@ -293,6 +295,14 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) { // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting LLInventoryModelBackgroundFetch::instance().start(inbox_id); + + // Expand the inbox since we have fresh items + LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + if (inbox && (inbox->getFreshItemCount() > 0)) + { + getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } } void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) @@ -367,7 +377,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) LLFirstUse::newInventory(false); // Expand the inbox if we have fresh items - LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>("marketplace_inbox"); + LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); if (inbox && (inbox->getFreshItemCount() > 0)) { getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); @@ -576,8 +586,6 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { - bool can_share = false; - LLPanelMainInventory* panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); -- cgit v1.2.3 From 8737446eb737bc26dcb1ac9462cc060baef0e13f Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Wed, 22 Jun 2011 14:28:19 -0400 Subject: EXP-919 FIX -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * The code should no longer create these folders when querying for them. Reviewed by Richard --- indra/newview/llinventorybridge.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f4670731ad..58579bdf4f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -783,7 +783,14 @@ BOOL LLInvFVBridge::isCOFFolder() const BOOL LLInvFVBridge::isInboxFolder() const { - return gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)); + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + if (inbox_id.isNull()) + { + return FALSE; + } + + return gInventory.isObjectDescendentOf(mUUID, inbox_id); } BOOL LLInvFVBridge::isItemPermissive() const -- cgit v1.2.3 From 21cc9a2868bc8260c7754df237e4abf1114be9e2 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Wed, 22 Jun 2011 17:02:11 -0400 Subject: EXP-919 FIX 2 -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * Fixed the "start_in" folder tag to no longer create folders it is trying to track that do not exist. --- indra/newview/llinventorypanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5b47e939a4..ebee1704f0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -497,7 +497,7 @@ void LLInventoryPanel::initializeViews() } else { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); + mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null); } rebuildViewsFor(mStartFolderID); -- cgit v1.2.3 From 4267014b146798cabe96568b2091c6bb2dd2b294 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Wed, 22 Jun 2011 17:35:25 -0400 Subject: EXP-890 FIX -- Resizing inbox or outbox to minimum size while open does not show present items when hte box is next opened EXP-897 FIX -- Black box shown in UI when shrinking Inbox down in size * Layout panel now supports "expanded_min_dim" parameter which allows a different min size to be specified when the layout panel is collapsed vs expanded. * Inbox and Outbox expanded_min_dim attributes are now set to be larger than min dim so they can not be collapsed all the way when they are expanded. --- indra/llui/lllayoutstack.cpp | 97 +++++++++++----------- indra/llui/lllayoutstack.h | 34 ++++++-- .../skins/default/xui/en/sidepanel_inventory.xml | 4 +- 3 files changed, 80 insertions(+), 55 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 8a92796942..d87ee428aa 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -49,6 +49,8 @@ void LLLayoutStack::OrientationNames::declareValues() // LLLayoutPanel::LLLayoutPanel(const Params& p) : LLPanel(p), + mExpandedMinDimSpecified(false), + mExpandedMinDim(p.min_dim), mMinDim(p.min_dim), mMaxDim(p.max_dim), mAutoResize(p.auto_resize), @@ -58,6 +60,13 @@ LLLayoutPanel::LLLayoutPanel(const Params& p) mVisibleAmt(1.f), // default to fully visible mResizeBar(NULL) { + // Set the expanded min dim if it is provided, otherwise it gets the p.min_dim value + if (p.expanded_min_dim.isProvided()) + { + mExpandedMinDimSpecified = true; + mExpandedMinDim = p.expanded_min_dim(); + } + // panels initialized as hidden should not start out partially visible if (!getVisible()) { @@ -84,13 +93,13 @@ F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientati if (orientation == LLLayoutStack::HORIZONTAL) { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)mMinDim / (F32)llmax(1, getRect().getWidth())); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, getRelevantMinDim() / (F32)llmax(1, getRect().getWidth())); return mVisibleAmt * collapse_amt; } else { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)mMinDim / (F32)llmax(1, getRect().getHeight()))); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, getRelevantMinDim() / (F32)llmax(1, getRect().getHeight()))); return mVisibleAmt * collapse_amt; } } @@ -281,9 +290,9 @@ bool LLLayoutStack::getPanelMinSize(const std::string& panel_name, S32* min_dimp { LLLayoutPanel* panel = findEmbeddedPanelByName(panel_name); - if (panel) + if (panel && min_dimp) { - if (min_dimp) *min_dimp = panel->mMinDim; + *min_dimp = panel->getRelevantMinDim(); } return NULL != panel; @@ -316,7 +325,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) e_panel_list_t::iterator panel_it; for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); if (panelp->getVisible()) { if (mAnimate) @@ -366,9 +375,9 @@ void LLLayoutStack::updateLayout(BOOL force_resize) if (mOrientation == HORIZONTAL) { // enforce minimize size constraint by default - if (panelp->getRect().getWidth() < (*panel_it)->mMinDim) + if (panelp->getRect().getWidth() < (*panel_it)->getRelevantMinDim()) { - panelp->reshape((*panel_it)->mMinDim, panelp->getRect().getHeight()); + panelp->reshape((*panel_it)->getRelevantMinDim(), panelp->getRect().getHeight()); } total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor(mOrientation)); // want n-1 panel gaps for n panels @@ -380,9 +389,9 @@ void LLLayoutStack::updateLayout(BOOL force_resize) else //VERTICAL { // enforce minimize size constraint by default - if (panelp->getRect().getHeight() < (*panel_it)->mMinDim) + if (panelp->getRect().getHeight() < (*panel_it)->getRelevantMinDim()) { - panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->mMinDim); + panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->getRelevantMinDim()); } total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor(mOrientation)); if (panel_it != mPanels.begin()) @@ -409,28 +418,20 @@ void LLLayoutStack::updateLayout(BOOL force_resize) || (!(*panel_it)->mAutoResize && !force_resize)) { - if (mOrientation == HORIZONTAL) - { - shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - } - else //VERTICAL - { - shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - } + S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); + F32 relevant_min = ((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); + + shrink_headroom_total += relevant_dimension - relevant_min; } else { num_resizable_panels++; - if (mOrientation == HORIZONTAL) - { - shrink_headroom_available += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - shrink_headroom_total += (*panel_it)->getRect().getWidth() - (*panel_it)->mMinDim; - } - else //VERTICAL - { - shrink_headroom_available += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - shrink_headroom_total += (*panel_it)->getRect().getHeight() - (*panel_it)->mMinDim; - } + + S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); + F32 relevant_min = ((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); + + shrink_headroom_available += relevant_dimension - relevant_min; + shrink_headroom_total += relevant_dimension - relevant_min; } } @@ -452,27 +453,28 @@ void LLLayoutStack::updateLayout(BOOL force_resize) for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); S32 cur_width = panelp->getRect().getWidth(); S32 cur_height = panelp->getRect().getHeight(); S32 new_width = cur_width; - S32 new_height = cur_height; + S32 new_height = cur_height; + S32 relevant_min = (S32) panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { - new_width = llmax((*panel_it)->mMinDim, new_width); + new_width = llmax(relevant_min, new_width); } else { - new_height = llmax((*panel_it)->mMinDim, new_height); + new_height = llmax(relevant_min, new_height); } S32 delta_size = 0; // if panel can automatically resize (not animating, and resize flag set)... - if ((*panel_it)->getCollapseFactor(mOrientation) == 1.f - && (force_resize || (*panel_it)->mAutoResize) - && !(*panel_it)->mResizeBar->hasMouseCapture()) + if (panelp->getCollapseFactor(mOrientation) == 1.f + && (force_resize || panelp->mAutoResize) + && !panelp->mResizeBar->hasMouseCapture()) { if (mOrientation == HORIZONTAL) { @@ -481,8 +483,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { // shrink proportionally to amount over minimum // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_width - (*panel_it)->mMinDim); + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - panelp->getRelevantMinDim()) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_width - relevant_min); } else { @@ -491,7 +493,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) num_resizable_panels--; } pixels_to_distribute -= delta_size; - new_width = llmax((*panel_it)->mMinDim, cur_width + delta_size); + new_width = llmax(relevant_min, cur_width + delta_size); } else { @@ -504,8 +506,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { // shrink proportionally to amount over minimum // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - (*panel_it)->mMinDim) / (F32)shrink_headroom_available)) : 0; - shrink_headroom_available -= (cur_height - (*panel_it)->mMinDim); + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_height - relevant_min) / (F32)shrink_headroom_available)) : 0; + shrink_headroom_available -= (cur_height - relevant_min); } else { @@ -513,7 +515,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) num_resizable_panels--; } pixels_to_distribute -= delta_size; - new_height = llmax((*panel_it)->mMinDim, cur_height + delta_size); + new_height = llmax(relevant_min, cur_height + delta_size); } else { @@ -566,19 +568,20 @@ void LLLayoutStack::updateLayout(BOOL force_resize) LLLayoutPanel* last_resizeable_panel = NULL; for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { - LLPanel* panelp = (*panel_it); + LLLayoutPanel* panelp = (*panel_it); + F32 relevant_min = panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinDim, - (*panel_it)->mMinDim + shrink_headroom_total); + relevant_min, + relevant_min + shrink_headroom_total); } else //VERTICAL { (*panel_it)->mResizeBar->setResizeLimits( - (*panel_it)->mMinDim, - (*panel_it)->mMinDim + shrink_headroom_total); + relevant_min, + relevant_min + shrink_headroom_total); } // toggle resize bars based on panel visibility, resizability, etc @@ -658,7 +661,7 @@ void LLLayoutStack::calcMinExtents() { if (mOrientation == HORIZONTAL) { - mMinWidth += (*panel_it)->mMinDim; + mMinWidth += (*panel_it)->getRelevantMinDim(); if (panel_it != mPanels.begin()) { mMinWidth += mPanelSpacing; @@ -666,7 +669,7 @@ void LLLayoutStack::calcMinExtents() } else //VERTICAL { - mMinHeight += (*panel_it)->mMinDim; + mMinHeight += (*panel_it)->getRelevantMinDim(); if (panel_it != mPanels.begin()) { mMinHeight += mPanelSpacing; diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h index 2fc2cf3eb4..d8ef0aeaca 100644 --- a/indra/llui/lllayoutstack.h +++ b/indra/llui/lllayoutstack.h @@ -30,10 +30,10 @@ #include "llpanel.h" -class LLPanel; class LLLayoutPanel; + class LLLayoutStack : public LLView, public LLInstanceTracker<LLLayoutStack> { public: @@ -149,6 +149,7 @@ private: F32 mCloseTimeConstant; }; // end class LLLayoutStack + class LLLayoutPanel : public LLPanel { friend class LLLayoutStack; @@ -156,13 +157,15 @@ friend class LLUICtrlFactory; public: struct Params : public LLInitParam::Block<Params, LLPanel::Params> { - Optional<S32> min_dim, + Optional<S32> expanded_min_dim, + min_dim, max_dim; Optional<bool> user_resize, auto_resize; Params() - : min_dim("min_dim", 0), + : expanded_min_dim("expanded_min_dim", 0), + min_dim("min_dim", 0), max_dim("max_dim", 0), user_resize("user_resize", true), auto_resize("auto_resize", true) @@ -179,17 +182,34 @@ public: void initFromParams(const Params& p); S32 getMinDim() const { return mMinDim; } - S32 getMaxDim() const { return mMaxDim; } + void setMinDim(S32 value) { mMinDim = value; if (!mExpandedMinDimSpecified) mExpandedMinDim = value; } - void setMinDim(S32 value) { mMinDim = value; } + S32 getMaxDim() const { return mMaxDim; } void setMaxDim(S32 value) { mMaxDim = value; } -protected: - LLLayoutPanel(const Params& p) ; + S32 getExpandedMinDim() const { return mExpandedMinDim; } + void setExpandedMinDim(S32 value) { mExpandedMinDim = value; mExpandedMinDimSpecified = true; } + + S32 getRelevantMinDim() const + { + S32 min_dim = mMinDim; + + if (!mCollapsed) + { + min_dim = mExpandedMinDim; + } + + return min_dim; + } +protected: + LLLayoutPanel(const Params& p); F32 getCollapseFactor(LLLayoutStack::ELayoutOrientation orientation); + bool mExpandedMinDimSpecified; + S32 mExpandedMinDim; + S32 mMinDim; S32 mMaxDim; BOOL mAutoResize; diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 1fedd6aab8..00f3135035 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -52,9 +52,10 @@ auto_resize="true" user_resize="false" follows="bottom|left|right" - min_dim="35" name="inbox_layout_panel" + min_dim="35" max_dim="200" + expanded_min_dim="90" height="200"> <panel follows="all" @@ -141,6 +142,7 @@ name="outbox_layout_panel" min_dim="35" max_dim="200" + expanded_min_dim="90" height="200"> <panel follows="all" -- cgit v1.2.3 From 5999574c106d0d2566d191c754f6a630d8407787 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 22 Jun 2011 16:12:01 -0700 Subject: making it so that inbox shows up quicker --- indra/newview/llsidepanelinventory.cpp | 64 +++++----------------------------- indra/newview/llviewermedia.cpp | 49 ++++++++++++++++++++++++++ indra/newview/llviewermedia.h | 2 -- 3 files changed, 58 insertions(+), 57 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 79d68de289..19c8ee0123 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -52,7 +52,6 @@ #include "llstring.h" #include "lltabcontainer.h" #include "llviewermedia.h" -#include "llviewernetwork.h" #include "llweb.h" static LLRegisterPanelClassWrapper<LLSidepanelInventory> t_inventory("sidepanel_inventory"); @@ -79,37 +78,6 @@ static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack" // Helpers // -class LLInventoryUserStatusResponder : public LLHTTPClient::Responder -{ -public: - LLInventoryUserStatusResponder(LLSidepanelInventory * sidepanelInventory) - : LLCurl::Responder() - , mSidepanelInventory(sidepanelInventory) - { - } - - void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - // Complete success - mSidepanelInventory->enableInbox(true); - } - else if (status == 401) - { - // API is available for use but OpenID authorization failed - mSidepanelInventory->enableInbox(true); - } - else - { - // API in unavailable - llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; - } - } - -private: - LLSidepanelInventory * mSidepanelInventory; -}; // // Implementation @@ -135,6 +103,13 @@ LLSidepanelInventory::~LLSidepanelInventory() delete mCategoriesObserver; } +void handleInventoryDisplayInboxChanged() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); +} + BOOL LLSidepanelInventory::postBuild() { // UI elements from inventory panel @@ -226,34 +201,13 @@ BOOL LLSidepanelInventory::postBuild() LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); } + gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); + return TRUE; } void LLSidepanelInventory::handleLoginComplete() { - // - // Hard coding this as a temporary way to determine whether or not to display the inbox - // - - std::string url = "https://marketplace.secondlife.com/"; - - if (!LLGridManager::getInstance()->isInProductionGrid()) - { - std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); - url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); - } - - url += "api/1/users/"; - url += gAgent.getID().getString(); - url += "/user_status"; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); - - LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); - // // Track inbox and outbox folder changes // diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1e53274cd6..4be39bb88e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -64,8 +64,10 @@ #include "llappviewer.h" #include "lllogininstance.h" //#include "llfirstuse.h" +#include "llviewernetwork.h" #include "llwindow.h" + #include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. @@ -1360,6 +1362,34 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom } +class LLInventoryUserStatusResponder : public LLHTTPClient::Responder +{ +public: + LLInventoryUserStatusResponder() + : LLCurl::Responder() + { + } + + void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + // Complete success + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else if (status == 401) + { + // API is available for use but OpenID authorization failed + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else + { + // API in unavailable + llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; + } + } +}; + ///////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::setOpenIDCookie() @@ -1406,6 +1436,25 @@ void LLViewerMedia::setOpenIDCookie() LLHTTPClient::get(profile_url, new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); + + std::string url = "https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; + + headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = sOpenIDCookie; + headers["User-Agent"] = getCurrentUserAgent(); + + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), headers); } } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 180e1d5676..a70c6f4887 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,8 +160,6 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); - - static std::string getOpenIDCookie() { return sOpenIDCookie; } private: static void setOpenIDCookie(); -- cgit v1.2.3 From ae2cbe5258ad76e22420be2760379480e10fb72c Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 22 Jun 2011 19:18:41 -0700 Subject: EXP-923 FIX Landmarks moved to new folders do not show as moved until relog in viewer - Delete, Copy, and Paste functions not working as well --- indra/newview/llfolderview.cpp | 1 + indra/newview/llfolderviewitem.h | 2 +- indra/newview/llinventorypanel.cpp | 5 ++- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/llpanelobjectinventory.cpp | 59 +++++++++++++++++--------------- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 260693ebc7..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -274,6 +274,7 @@ LLFolderView::LLFolderView(const Params& p) menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); mPopupMenuHandle = menu->getHandle(); + mListener->openItem(); } // Destroys the object diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 7d640adf2e..267dbc9028 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -94,7 +94,7 @@ public: Optional<LLUIImage*> icon_open; // used for folders Optional<LLUIImage*> icon_overlay; // for links Optional<LLFolderView*> root; - Optional<LLFolderViewEventListener*> listener; + Mandatory<LLFolderViewEventListener*> listener; Optional<LLUIImage*> folder_arrow_image; Optional<S32> folder_indentation; // pixels diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1ff423056a..49e68402e5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -463,9 +463,8 @@ void LLInventoryPanel::modelChanged(U32 mask) // This item already exists in both memory and UI. It was probably reparented. if (model_item && view_item) { - // Don't process the item if it's hanging from the root, since its - // model_item's parent will be NULL. - if (view_item->getRoot() != view_item->getParent()) + // Don't process the item if it is the root + if (view_item->getRoot() != view_item) { LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); // Item has been moved. diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index f09f675b75..1595531f7b 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -529,7 +529,7 @@ void LLLandmarksPanel::setParcelID(const LLUUID& parcel_id) // virtual void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason) { - llerrs<< "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; + llwarns << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl; } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index bfe6cab52f..e0d0239929 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -761,7 +761,7 @@ void LLTaskCategoryBridge::openItem() BOOL LLTaskCategoryBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { //llinfos << "LLTaskInvFVBridge::startDrag()" << llendl; - if(mPanel) + if(mPanel && mUUID.notNull()) { LLViewerObject* object = gObjectList.findObject(mPanel->getTaskUUID()); if(object) @@ -1349,79 +1349,81 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* LLTaskInvFVBridge* new_bridge = NULL; const LLInventoryItem* item = dynamic_cast<LLInventoryItem*>(object); const U32 itemflags = ( NULL == item ? 0 : item->getFlags() ); - LLAssetType::EType type = object->getType(); + LLAssetType::EType type = object ? object->getType() : LLAssetType::AT_CATEGORY; + LLUUID object_id = object ? object->getUUID() : LLUUID::null; + std::string object_name = object ? object->getName() : std::string(); switch(type) { case LLAssetType::AT_TEXTURE: new_bridge = new LLTaskTextureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SOUND: new_bridge = new LLTaskSoundBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LANDMARK: new_bridge = new LLTaskLandmarkBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CALLINGCARD: new_bridge = new LLTaskCallingCardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SCRIPT: // OLD SCRIPTS DEPRECATED - JC llwarns << "Old script" << llendl; //new_bridge = new LLTaskOldScriptBridge(panel, - // object->getUUID(), - // object->getName()); + // object_id, + // object_name); break; case LLAssetType::AT_OBJECT: new_bridge = new LLTaskObjectBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_NOTECARD: new_bridge = new LLTaskNotecardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_ANIMATION: new_bridge = new LLTaskAnimationBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_GESTURE: new_bridge = new LLTaskGestureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: new_bridge = new LLTaskWearableBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_CATEGORY: new_bridge = new LLTaskCategoryBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LSL_TEXT: new_bridge = new LLTaskLSLBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_MESH: new_bridge = new LLTaskMeshBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; default: llinfos << "Unhandled inventory type (llassetstorage.h): " @@ -1521,6 +1523,7 @@ void LLPanelObjectInventory::reset() p.task_id = getTaskUUID(); p.parent_panel = this; p.tool_tip= LLTrans::getString("PanelContentsTooltip"); + p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL); mFolders = LLUICtrlFactory::create<LLFolderView>(p); // this ensures that we never say "searching..." or "no items found" mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); -- cgit v1.2.3 From c61a7fbaace20415be3003eaab95ce359ff8621a Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 23 Jun 2011 10:34:44 -0400 Subject: EXP-926 FIX -- Received items badge count and item count shown in inbox do not always match * getFreshItemCount() function returns getTotalItemCount() for now, until we properly support item fresh-ness --- indra/newview/llpanelmarketplaceinbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 1962724891..14c4c46fe7 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -115,6 +115,7 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr U32 LLPanelMarketplaceInbox::getFreshItemCount() const { +#if SUPPORTING_FRESH_ITEM_COUNT U32 fresh_item_count = 0; LLFolderView * root_folder = mInventoryPanel->getRootFolder(); @@ -135,6 +136,9 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const } return fresh_item_count; +#else + return getTotalItemCount(); +#endif } U32 LLPanelMarketplaceInbox::getTotalItemCount() const -- cgit v1.2.3 From 4ebf8e3abc365f79b41008de8fd6509c46ea44bd Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 23 Jun 2011 12:02:59 -0700 Subject: fix for gcc build --- indra/llui/lllayoutstack.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index d87ee428aa..c34acd3db6 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -419,7 +419,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) && !force_resize)) { S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); - F32 relevant_min = ((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); + S32 relevant_min = llround((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); shrink_headroom_total += relevant_dimension - relevant_min; } @@ -428,7 +428,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) num_resizable_panels++; S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); - F32 relevant_min = ((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); + S32 relevant_min = llround((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); shrink_headroom_available += relevant_dimension - relevant_min; shrink_headroom_total += relevant_dimension - relevant_min; -- cgit v1.2.3 From e7d86046d9bba6f0da34a6417e6bb45be518accd Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 23 Jun 2011 15:49:16 -0400 Subject: Build fixes from the merge. Recommended by Richard. --- indra/newview/llfolderview.cpp | 5 ----- indra/newview/llfolderviewitem.cpp | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 27b58bec4e..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -816,11 +816,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 38b36af6f0..f5e1aa005b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1206,8 +1206,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) bool is_hidden = folderp->getListener() && LLViewerFolderType::lookupIsHiddenType(folderp->getListener()->getPreferredType()); folderp->setVisible( !is_hidden - && (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS - || (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation)))); // passed filter or has descendants that passed filter + && (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) -- cgit v1.2.3 From 842b6d2d142abcaa11a825a96537b0ceaef33e24 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 23 Jun 2011 16:34:54 -0400 Subject: Build fix after merge. --- indra/llui/lllayoutstack.cpp | 47 +++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index c34acd3db6..7e0c5542ea 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -332,16 +332,16 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); - if ((*panel_it)->mVisibleAmt > 0.99f) + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 1.f, LLCriticalDamp::getInterpolant(mOpenTimeConstant)); + if (panelp->mVisibleAmt > 0.99f) { - (*panel_it)->mVisibleAmt = 1.f; + panelp->mVisibleAmt = 1.f; } } } else { - (*panel_it)->mVisibleAmt = 1.f; + panelp->mVisibleAmt = 1.f; } } else // not visible @@ -350,36 +350,36 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { if (!mAnimatedThisFrame) { - (*panel_it)->mVisibleAmt = lerp((*panel_it)->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); - if ((*panel_it)->mVisibleAmt < 0.001f) + panelp->mVisibleAmt = lerp(panelp->mVisibleAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + if (panelp->mVisibleAmt < 0.001f) { - (*panel_it)->mVisibleAmt = 0.f; + panelp->mVisibleAmt = 0.f; } } } else { - (*panel_it)->mVisibleAmt = 0.f; + panelp->mVisibleAmt = 0.f; } } - if ((*panel_it)->mCollapsed) + if (panelp->mCollapsed) { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, 1.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } else { - (*panel_it)->mCollapseAmt = lerp((*panel_it)->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); + panelp->mCollapseAmt = lerp(panelp->mCollapseAmt, 0.f, LLCriticalDamp::getInterpolant(mCloseTimeConstant)); } if (mOrientation == HORIZONTAL) { // enforce minimize size constraint by default - if (panelp->getRect().getWidth() < (*panel_it)->getRelevantMinDim()) + if (panelp->getRect().getWidth() < panelp->getRelevantMinDim()) { - panelp->reshape((*panel_it)->getRelevantMinDim(), panelp->getRect().getHeight()); + panelp->reshape(panelp->getRelevantMinDim(), panelp->getRect().getHeight()); } - total_width += llround(panelp->getRect().getWidth() * (*panel_it)->getCollapseFactor(mOrientation)); + total_width += llround(panelp->getRect().getWidth() * panelp->getCollapseFactor(mOrientation)); // want n-1 panel gaps for n panels if (panel_it != mPanels.begin()) { @@ -389,11 +389,11 @@ void LLLayoutStack::updateLayout(BOOL force_resize) else //VERTICAL { // enforce minimize size constraint by default - if (panelp->getRect().getHeight() < (*panel_it)->getRelevantMinDim()) + if (panelp->getRect().getHeight() < panelp->getRelevantMinDim()) { - panelp->reshape(panelp->getRect().getWidth(), (*panel_it)->getRelevantMinDim()); + panelp->reshape(panelp->getRect().getWidth(), panelp->getRelevantMinDim()); } - total_height += llround(panelp->getRect().getHeight() * (*panel_it)->getCollapseFactor(mOrientation)); + total_height += llround(panelp->getRect().getHeight() * panelp->getCollapseFactor(mOrientation)); if (panel_it != mPanels.begin()) { total_height += mPanelSpacing; @@ -412,23 +412,20 @@ void LLLayoutStack::updateLayout(BOOL force_resize) continue; } + S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); + S32 relevant_min = (*panel_it)->getRelevantMinDim(); + // if currently resizing a panel or the panel is flagged as not automatically resizing // only track total available headroom, but don't use it for automatic resize logic if ((*panel_it)->mResizeBar->hasMouseCapture() || (!(*panel_it)->mAutoResize && !force_resize)) { - S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); - S32 relevant_min = llround((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); - shrink_headroom_total += relevant_dimension - relevant_min; } else { num_resizable_panels++; - - S32 relevant_dimension = (mOrientation == HORIZONTAL) ? (*panel_it)->getRect().getWidth() : (*panel_it)->getRect().getHeight(); - S32 relevant_min = llround((*panel_it)->mCollapsed ? (*panel_it)->getRelevantMinDim() : (*panel_it)->mExpandedMinDim); shrink_headroom_available += relevant_dimension - relevant_min; shrink_headroom_total += relevant_dimension - relevant_min; @@ -483,7 +480,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) { // shrink proportionally to amount over minimum // so we can do this in one pass - delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - panelp->getRelevantMinDim()) / (F32)shrink_headroom_available)) : 0; + delta_size = (shrink_headroom_available > 0) ? llround((F32)pixels_to_distribute * ((F32)(cur_width - relevant_min) / (F32)shrink_headroom_available)) : 0; shrink_headroom_available -= (cur_width - relevant_min); } else @@ -691,7 +688,7 @@ void LLLayoutStack::createResizeBars() LLResizeBar::Params resize_params; resize_params.name("resize"); resize_params.resizing_view(lp); - resize_params.min_size(lp->mMinDim); + resize_params.min_size(lp->getRelevantMinDim()); resize_params.side(side); resize_params.snapping_enabled(false); LLResizeBar* resize_bar = LLUICtrlFactory::create<LLResizeBar>(resize_params); -- cgit v1.2.3 From e74f9fcc147edd24576a25bb6a0af69ac8d6a600 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 23 Jun 2011 18:11:55 -0400 Subject: EXP-919 FIX -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * The badge no longer displays (2) when the folder does not exist. * The inbox panel no longer displays the inventory and library folders. * The inbox is supposed to display a string for the item not being found, but doesn't for an unknown reason. --- indra/newview/llinventorypanel.cpp | 12 +++++- indra/newview/llinventorypanel.h | 1 - indra/newview/llpanelmarketplaceinbox.cpp | 43 ++++++++++++++-------- indra/newview/llsidepanelinventory.cpp | 43 ++++++++++++++-------- .../skins/default/xui/en/sidepanel_inventory.xml | 1 + 5 files changed, 67 insertions(+), 33 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3666c51c82..0af6451108 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -150,7 +150,10 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { // Determine the root folder in case specified, and // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + std::string start_folder_name(params.start_folder()); + + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name); LLUUID root_id; @@ -164,6 +167,12 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null; } + + if ((root_id == LLUUID::null) && !start_folder_name.empty()) + { + llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; + root_id = LLUUID::generateNewID(); + } LLRect folder_rect(0, 0, @@ -184,7 +193,6 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) p.use_label_suffix = params.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); - } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 864c403397..4b915484f8 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -226,7 +226,6 @@ private: BOOL mViewsInitialized; // Views have been generated // UUID of category from which hierarchy should be built. Set with the // "start_folder" xml property. Default is LLUUID::null that means total Inventory hierarchy. - std::string mStartFolderString; LLUUID mStartFolderID; }; diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 14c4c46fe7..1f3fbb40b4 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -59,7 +59,7 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() BOOL LLPanelMarketplaceInbox::postBuild() { mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); - + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); @@ -67,7 +67,10 @@ BOOL LLPanelMarketplaceInbox::postBuild() LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); - + + // Set up the note to display when the inbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InboxNoItems"); + return TRUE; } @@ -116,6 +119,12 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr U32 LLPanelMarketplaceInbox::getFreshItemCount() const { #if SUPPORTING_FRESH_ITEM_COUNT + + // + // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably + // will return "2" for the Inventory and LIBRARY top-levels when that happens. + // + U32 fresh_item_count = 0; LLFolderView * root_folder = mInventoryPanel->getRootFolder(); @@ -143,23 +152,27 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const U32 LLPanelMarketplaceInbox::getTotalItemCount() const { + U32 item_count = 0; + LLInventoryModel* model = mInventoryPanel->getModel(); + const LLUUID inbox_id = model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + if (!inbox_id.isNull()) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - - U32 item_count = 0; + model->getDirectDescendentsOf(inbox_id, cats, items); - if (cats) - { - item_count += cats->size(); - } + if (cats) + { + item_count += cats->size(); + } - if (items) - { - item_count += items->size(); + if (items) + { + item_count += items->size(); + } } return item_count; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index f9e029be19..f769612f3f 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -67,7 +67,7 @@ static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; -static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel"; +static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; @@ -177,15 +177,16 @@ BOOL LLSidepanelInventory::postBuild() { LLLayoutStack* stack = getChild<LLLayoutStack>(INVENTORY_LAYOUT_STACK_NAME); - LLLayoutPanel * inbox_panel = getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME); - LLLayoutPanel * outbox_panel = getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME); - - stack->collapsePanel(inbox_panel, true); - stack->collapsePanel(outbox_panel, true); - // Disable user_resize on main inventory panel by default - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, false); + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(OUTBOX_LAYOUT_PANEL_NAME, false); + // Collapse both inbox and outbox panels + stack->collapsePanel(getChild<LLLayoutPanel>(INBOX_LAYOUT_PANEL_NAME), true); + stack->collapsePanel(getChild<LLLayoutPanel>(OUTBOX_LAYOUT_PANEL_NAME), true); + + // Set up button states and callbacks LLButton * inbox_button = getChild<LLButton>(INBOX_BUTTON_NAME); LLButton * outbox_button = getChild<LLButton>(OUTBOX_BUTTON_NAME); @@ -219,18 +220,30 @@ void LLSidepanelInventory::handleLoginComplete() const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + if (inbox_id.isNull() && outbox_id.isNull()) + { + return; + } mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); - mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); - mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + if (!outbox_id.isNull()) + { + mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + } + + if (!inbox_id.isNull()) + { + mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); - // - // Trigger a load for the entire contents of the Inbox - // + // + // Trigger a load for the entire contents of the Inbox + // - LLInventoryModelBackgroundFetch::instance().start(inbox_id); + LLInventoryModelBackgroundFetch::instance().start(inbox_id); + } } void LLSidepanelInventory::enableInbox(bool enabled) @@ -293,7 +306,7 @@ bool manageInboxOutboxPanels(LLLayoutStack * stack, stack->collapsePanel(pressedPanel, !expand); // Enable user_resize on main inventory panel only when a marketplace box is expanded - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, expand); + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); return expand; } diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 00f3135035..778daac83b 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -69,6 +69,7 @@ width="330"> <string name="InboxLabelWithArg">Received Items ([NUM])</string> <string name="InboxLabelNoArg">Received Items</string> + <string name="InboxNoItems">Items purchased through the marketplace will be delivered here.</string> <button label="Received Items" name="inbox_btn" -- cgit v1.2.3 From c6d9a6b8321807523926fe7055b0b80572d29f44 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 23 Jun 2011 15:35:23 -0700 Subject: another gcc fix --- indra/llui/lllayoutstack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7e0c5542ea..6a91ec56e4 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -93,13 +93,13 @@ F32 LLLayoutPanel::getCollapseFactor(LLLayoutStack::ELayoutOrientation orientati if (orientation == LLLayoutStack::HORIZONTAL) { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, getRelevantMinDim() / (F32)llmax(1, getRect().getWidth())); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getWidth())); return mVisibleAmt * collapse_amt; } else { F32 collapse_amt = - clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, getRelevantMinDim() / (F32)llmax(1, getRect().getHeight()))); + clamp_rescale(mCollapseAmt, 0.f, 1.f, 1.f, llmin(1.f, (F32)getRelevantMinDim() / (F32)llmax(1, getRect().getHeight()))); return mVisibleAmt * collapse_amt; } } @@ -456,7 +456,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) S32 cur_height = panelp->getRect().getHeight(); S32 new_width = cur_width; S32 new_height = cur_height; - S32 relevant_min = (S32) panelp->getRelevantMinDim(); + S32 relevant_min = panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { @@ -566,7 +566,7 @@ void LLLayoutStack::updateLayout(BOOL force_resize) for (panel_it = mPanels.begin(); panel_it != mPanels.end(); ++panel_it) { LLLayoutPanel* panelp = (*panel_it); - F32 relevant_min = panelp->getRelevantMinDim(); + S32 relevant_min = panelp->getRelevantMinDim(); if (mOrientation == HORIZONTAL) { -- cgit v1.2.3 From 71b6d9d842e03a4a1eece88ec20a50b041b6137f Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Thu, 23 Jun 2011 17:50:52 -0700 Subject: fixing non-dnd portion of EXT-895 --- indra/newview/llpanelmaininventory.cpp | 4 +++- indra/newview/llpanelmarketplaceinbox.cpp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 728642e4c7..f23ae8c8ff 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1,4 +1,4 @@ -/** +n/** * @file llsidepanelmaininventory.cpp * @brief Implementation of llsidepanelmaininventory. * @@ -592,6 +592,8 @@ void LLPanelMainInventory::onFocusReceived() { outbox_panel->clearSelection(); } + + sidepanel_inventory->updateVerbs(); } void LLPanelMainInventory::setFilterTextFromFilter() diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 1f3fbb40b4..2b04987084 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -69,7 +69,7 @@ BOOL LLPanelMarketplaceInbox::postBuild() mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); // Set up the note to display when the inbox is empty - mInventoryPanel->getFilter()->setEmptyLookupMessage("InboxNoItems"); + //mInventoryPanel->getFilter()->setEmptyLookupMessage("InboxNoItems"); return TRUE; } @@ -108,6 +108,8 @@ void LLPanelMarketplaceInbox::onFocusReceived() outbox_panel->clearSelection(); } } + + sidepanel_inventory->updateVerbs(); } BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) -- cgit v1.2.3 From 019eae669eee8b3f877730b30c4f23b723fb907a Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Fri, 24 Jun 2011 10:32:58 -0400 Subject: Removing mysterious "n" at the start of the file to fix the build. --- indra/newview/llpanelmaininventory.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f23ae8c8ff..f39fbfc498 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -1,6 +1,6 @@ -n/** - * @file llsidepanelmaininventory.cpp - * @brief Implementation of llsidepanelmaininventory. +/** + * @file llpanelmaininventory.cpp + * @brief Implementation of llpanelmaininventory. * * $LicenseInfo:firstyear=2001&license=viewerlgpl$ * Second Life Viewer Source Code @@ -592,7 +592,7 @@ void LLPanelMainInventory::onFocusReceived() { outbox_panel->clearSelection(); } - + sidepanel_inventory->updateVerbs(); } -- cgit v1.2.3 From e733d5c0a96694d7d6879185f88bcc9b0613f39a Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 27 Jun 2011 18:29:51 -0700 Subject: preemptively adding folder type for basic inventory so we can update sim code to match --- indra/llcommon/llfoldertype.cpp | 2 ++ indra/llcommon/llfoldertype.h | 4 +++- indra/newview/llviewerfoldertype.cpp | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index c2cfb7286e..54096e3294 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -93,6 +93,8 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_MESH, new FolderEntry("mesh", TRUE)); addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE)); + + addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_root", TRUE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; diff --git a/indra/llcommon/llfoldertype.h b/indra/llcommon/llfoldertype.h index cb32cb075b..1fa45d7a50 100644 --- a/indra/llcommon/llfoldertype.h +++ b/indra/llcommon/llfoldertype.h @@ -84,7 +84,9 @@ public: FT_INBOX = 50, - FT_COUNT = 51, + FT_BASIC_ROOT = 51, + + FT_COUNT = 52, FT_NONE = -1 }; diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index 42f780a8a3..cb8e5b61ec 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -130,6 +130,7 @@ LLViewerFolderDictionary::LLViewerFolderDictionary() addEntry(LLFolderType::FT_INBOX, new ViewerFolderEntry("Inbox", "Inv_SysOpen", "Inv_SysClosed", FALSE)); + addEntry(LLFolderType::FT_BASIC_ROOT, new ViewerFolderEntry("Basic Root", "Inv_SysOpen", "Inv_SysClosed", FALSE)); addEntry(LLFolderType::FT_NONE, new ViewerFolderEntry("New Folder", "Inv_FolderOpen", "Inv_FolderClosed", FALSE, "default")); -- cgit v1.2.3 From 200073c97a34a90718c3362efaed98c52fa12a17 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Mon, 27 Jun 2011 19:13:42 -0700 Subject: fixed basic root folder entry to match 8 character limit --- indra/llcommon/llfoldertype.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llfoldertype.cpp b/indra/llcommon/llfoldertype.cpp index 39afdac056..f6d0f5bce8 100644 --- a/indra/llcommon/llfoldertype.cpp +++ b/indra/llcommon/llfoldertype.cpp @@ -94,7 +94,7 @@ LLFolderDictionary::LLFolderDictionary() addEntry(LLFolderType::FT_INBOX, new FolderEntry("inbox", TRUE)); addEntry(LLFolderType::FT_OUTBOX, new FolderEntry("outbox", TRUE)); - addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_root", TRUE)); + addEntry(LLFolderType::FT_BASIC_ROOT, new FolderEntry("basic_rt", TRUE)); addEntry(LLFolderType::FT_NONE, new FolderEntry("-1", FALSE)); }; -- cgit v1.2.3 From c998f21c5201a4c117ad601fbd23c116fd9faa04 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Tue, 28 Jun 2011 14:45:09 -0700 Subject: EXP-922 FIX Purchased Direct Delivery items do not appear in Recent Inventory tab switched to using filters to hide inbox and show it for recent items only --- indra/newview/llfolderviewitem.cpp | 8 ++++---- indra/newview/llinventoryfilter.cpp | 7 ++++--- indra/newview/llinventorypanel.cpp | 10 ++++++++++ indra/newview/llviewerfoldertype.cpp | 19 ++----------------- indra/newview/llviewerfoldertype.h | 1 - 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index f5e1aa005b..d3b204200a 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1203,10 +1203,10 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } else { - bool is_hidden = folderp->getListener() && LLViewerFolderType::lookupIsHiddenType(folderp->getListener()->getPreferredType()); - - folderp->setVisible( !is_hidden - && (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + folderp->setVisible( folderp->getListener() + && ((folderp->getFilteredFolder(filter_generation) + && folderp->getFiltered(filter_generation)) + || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 49e0ab33e5..d6278a5fda 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -125,7 +125,8 @@ bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); if (!cat) return false; - if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) + LLFolderType::EType cat_type = cat->getPreferredType(); + if (cat_type != LLFolderType::FT_NONE && (1LL << cat_type & mFilterOps.mFilterCategoryTypes) == U64(0)) return false; } @@ -298,8 +299,8 @@ void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) if (current_types != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (current_types & ~types); - BOOL more_bits_set = (~current_types & types); + bool fewer_bits_set = (current_types & ~types) != 0; + bool more_bits_set = (~current_types & types) != 0; current_types = types; if (more_bits_set && fewer_bits_set) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 0af6451108..834da49c61 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -245,6 +245,9 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) } mFolderRoot->setSortOrder(getFilter()->getSortOrder()); + // hide inbox + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << LLFolderType::FT_INBOX)); + // Initialize base class params. LLPanel::initFromParams(params); } @@ -1090,6 +1093,13 @@ public: struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params> {}; + void initFromParams(const Params& p) + { + LLInventoryPanel::initFromParams(p); + // turn on inbox for recent items + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() | (1ULL << LLFolderType::FT_INBOX)); + } + protected: LLInventoryRecentItemsPanel (const Params&); friend class LLUICtrlFactory; diff --git a/indra/newview/llviewerfoldertype.cpp b/indra/newview/llviewerfoldertype.cpp index fbd25bc8b4..9101222393 100644 --- a/indra/newview/llviewerfoldertype.cpp +++ b/indra/newview/llviewerfoldertype.cpp @@ -40,7 +40,6 @@ struct ViewerFolderEntry : public LLDictionaryEntry const std::string &icon_name_open, // name of the folder icon const std::string &icon_name_closed, BOOL is_quiet, // folder doesn't need a UI update when changed - bool is_hidden = false, const std::string &dictionary_name = empty_string // no reverse lookup needed on non-ensembles, so in most cases just leave this blank ) : @@ -48,8 +47,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry mNewCategoryName(new_category_name), mIconNameOpen(icon_name_open), mIconNameClosed(icon_name_closed), - mIsQuiet(is_quiet), - mIsHidden(is_hidden) + mIsQuiet(is_quiet) { mAllowedNames.clear(); } @@ -68,8 +66,7 @@ struct ViewerFolderEntry : public LLDictionaryEntry */ mIconNameOpen("Inv_FolderOpen"), mIconNameClosed("Inv_FolderClosed"), mNewCategoryName(new_category_name), - mIsQuiet(FALSE), - mIsHidden(false) + mIsQuiet(FALSE) { const std::string delims (","); LLStringUtilBase<char>::getTokens(allowed_names, mAllowedNames, delims); @@ -94,7 +91,6 @@ struct ViewerFolderEntry : public LLDictionaryEntry typedef std::vector<std::string> name_vec_t; name_vec_t mAllowedNames; BOOL mIsQuiet; - bool mIsHidden; }; class LLViewerFolderDictionary : public LLSingleton<LLViewerFolderDictionary>, @@ -264,17 +260,6 @@ BOOL LLViewerFolderType::lookupIsQuietType(LLFolderType::EType folder_type) } -BOOL LLViewerFolderType::lookupIsHiddenType(LLFolderType::EType folder_type) -{ - const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); - if (entry) - { - return entry->mIsHidden; - } - return FALSE; -} - - const std::string &LLViewerFolderType::lookupNewCategoryName(LLFolderType::EType folder_type) { const ViewerFolderEntry *entry = LLViewerFolderDictionary::getInstance()->lookup(folder_type); diff --git a/indra/newview/llviewerfoldertype.h b/indra/newview/llviewerfoldertype.h index a348274e8f..f5938de619 100644 --- a/indra/newview/llviewerfoldertype.h +++ b/indra/newview/llviewerfoldertype.h @@ -40,7 +40,6 @@ public: static const std::string& lookupIconName(EType folder_type, BOOL is_open = FALSE); // folder icon name static BOOL lookupIsQuietType(EType folder_type); // folder doesn't require UI update when changes have occured - static BOOL lookupIsHiddenType(EType folder_type); // folder doesn't require UI update when changes have occured static const std::string& lookupNewCategoryName(EType folder_type); // default name when creating new category static LLFolderType::EType lookupTypeFromNewCategoryName(const std::string& name); // default name when creating new category -- cgit v1.2.3 From 8a4b3e33cdd6f196f25e4acf86e80de08907590e Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 29 Jun 2011 13:13:10 -0700 Subject: EXP-961 FIX Keyboard definition file keys.xml contains invalid XML markup --- doc/contributions.txt | 1 + indra/newview/app_settings/keys.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index b744f4db3e..8d7e7a4a60 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -158,6 +158,7 @@ Ann Congrejo CT-193 Ansariel Hiller STORM-1101 + VWR-26150 Ardy Lay STORM-859 VWR-19499 diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml index d085475c6c..101deea55b 100644 --- a/indra/newview/app_settings/keys.xml +++ b/indra/newview/app_settings/keys.xml @@ -181,7 +181,7 @@ <binding key="PAD_DIVIDE" mask="CTL_ALT_SHIFT" command="start_gesture"/> </third_person> - # Basic editing camera control + <-- Basic editing camera control --> <edit> <binding key="A" mask="NONE" command="spin_around_cw"/> <binding key="D" mask="NONE" command="spin_around_ccw"/> -- cgit v1.2.3 From 2b2feaa929eda46bfeb4fe8baf2838e798ab35ac Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 29 Jun 2011 14:26:51 -0700 Subject: fixing key file comment - missing ! --- indra/newview/app_settings/keys.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml index 101deea55b..6e3673e7d9 100644 --- a/indra/newview/app_settings/keys.xml +++ b/indra/newview/app_settings/keys.xml @@ -181,7 +181,7 @@ <binding key="PAD_DIVIDE" mask="CTL_ALT_SHIFT" command="start_gesture"/> </third_person> - <-- Basic editing camera control --> + <!-- Basic editing camera control --> <edit> <binding key="A" mask="NONE" command="spin_around_cw"/> <binding key="D" mask="NONE" command="spin_around_ccw"/> -- cgit v1.2.3 From e443dd3aab1c0bb017ffbf7a0b53edde3680f33b Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 29 Jun 2011 15:21:10 -0700 Subject: EXP-944 Add additional logging for troubleshooting EXP-930 - DD inbox not showing on linux viewer --- indra/newview/llviewermedia.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 74b87045e7..39ad1cfd20 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1385,7 +1385,7 @@ public: else { // API in unavailable - llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; + llinfos << "Marketplace API is unavailable -- Inbox Disabled, status = " << status << ", reason = " << reason << llendl; } } }; -- cgit v1.2.3 From 8c6e6c305850f196e0eed7ebb4bf8aa528613fa4 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 29 Jun 2011 15:24:05 -0700 Subject: EXP-895 Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel --- indra/newview/llinventorybridge.cpp | 10 ++++ indra/newview/llviewermessage.cpp | 101 +++++++++++++++++++++++++++++++----- indra/newview/llviewermessage.h | 2 + 3 files changed, 99 insertions(+), 14 deletions(-) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 58579bdf4f..6644eea219 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1798,6 +1798,10 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { + if (gInventory.isObjectDescendentOf(inv_cat->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + { + set_dad_inbox_object(inv_cat->getUUID()); + } // Reparent the folder and restamp children if it's moving // into trash. @@ -3176,6 +3180,12 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, // (move the item, restamp if into trash) else { + // set up observer to select item once drag and drop from inbox is complete + if (gInventory.isObjectDescendentOf(inv_item->getUUID(), gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false))) + { + set_dad_inbox_object(inv_item->getUUID()); + } + LLInvFVBridge::changeItemParent( model, (LLViewerInventoryItem*)inv_item, diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fa394e55b3..2ff540b625 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -694,7 +694,7 @@ bool join_group_response(const LLSD& notification, const LLSD& response) return false; } -static void highlight_inventory_items_in_panel(const std::vector<LLUUID>& items, LLInventoryPanel *inventory_panel) +static void highlight_inventory_objects_in_panel(const std::vector<LLUUID>& items, LLInventoryPanel *inventory_panel) { if (NULL == inventory_panel) return; @@ -708,7 +708,7 @@ static void highlight_inventory_items_in_panel(const std::vector<LLUUID>& items, continue; } - LLInventoryItem* item = gInventory.getItem(item_id); + LLInventoryObject* item = gInventory.getObject(item_id); llassert(item); if (!item) { continue; @@ -787,7 +787,6 @@ class LLViewerInventoryMoveFromWorldObserver : public LLInventoryAddItemByAssetO public: LLViewerInventoryMoveFromWorldObserver() : LLInventoryAddItemByAssetObserver() - , mActivePanel(NULL) { } @@ -798,13 +797,16 @@ private: /*virtual */void onAssetAdded(const LLUUID& asset_id) { // Store active Inventory panel. - mActivePanel = LLInventoryPanel::getActiveInventoryPanel(); + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } // Store selected items (without destination folder) mSelectedItems.clear(); - if (mActivePanel) + if (LLInventoryPanel::getActiveInventoryPanel()) { - mSelectedItems = mActivePanel->getRootFolder()->getSelectionList(); + mSelectedItems = LLInventoryPanel::getActiveInventoryPanel()->getRootFolder()->getSelectionList(); } mSelectedItems.erase(mMoveIntoFolderID); } @@ -815,12 +817,14 @@ private: */ void done() { + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); + // if selection is not changed since watch started lets hightlight new items. - if (mActivePanel && !isSelectionChanged()) + if (active_panel && !isSelectionChanged()) { LL_DEBUGS("Inventory_Move") << "Selecting new items..." << LL_ENDL; - mActivePanel->clearSelection(); - highlight_inventory_items_in_panel(mAddedItems, mActivePanel); + active_panel->clearSelection(); + highlight_inventory_objects_in_panel(mAddedItems, active_panel); } } @@ -828,16 +832,16 @@ private: * Returns true if selected inventory items were changed since moved inventory items were started to watch. */ bool isSelectionChanged() - { - const LLInventoryPanel * const current_active_panel = LLInventoryPanel::getActiveInventoryPanel(); + { + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); - if (NULL == mActivePanel || current_active_panel != mActivePanel) + if (NULL == active_panel) { return true; } // get selected items (without destination folder) - selected_items_t selected_items = mActivePanel->getRootFolder()->getSelectionList(); + selected_items_t selected_items = active_panel->getRootFolder()->getSelectionList(); selected_items.erase(mMoveIntoFolderID); // compare stored & current sets of selected items @@ -851,7 +855,7 @@ private: return different_items.size() > 0; } - LLInventoryPanel *mActivePanel; + LLHandle<LLPanel> mActivePanel; typedef std::set<LLUUID> selected_items_t; selected_items_t mSelectedItems; @@ -880,6 +884,75 @@ void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder gInventoryMoveObserver->watchAsset(inv_item->getAssetUUID()); } + +/** + * Class to observe moving of items and to select them in inventory. + * + * Used currently for dragging from inbox to regular inventory folders + */ + +class LLViewerInventoryMoveObserver : public LLInventoryObserver +{ +public: + + LLViewerInventoryMoveObserver(const LLUUID& object_id) + : LLInventoryObserver() + , mObjectID(object_id) + { + if (LLInventoryPanel::getActiveInventoryPanel()) + { + mActivePanel = LLInventoryPanel::getActiveInventoryPanel()->getHandle(); + } + } + + virtual ~LLViewerInventoryMoveObserver() {} + virtual void changed(U32 mask); + +private: + LLUUID mObjectID; + LLHandle<LLPanel> mActivePanel; + +}; + +void LLViewerInventoryMoveObserver::changed(U32 mask) +{ + LLInventoryPanel* active_panel = dynamic_cast<LLInventoryPanel*>(mActivePanel.get()); + + if (NULL == active_panel) + { + gInventory.removeObserver(this); + return; + } + + if((mask & (LLInventoryObserver::STRUCTURE)) != 0) + { + const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); + + std::set<LLUUID>::const_iterator id_it = changed_items.begin(); + std::set<LLUUID>::const_iterator id_end = changed_items.end(); + for (;id_it != id_end; ++id_it) + { + if ((*id_it) == mObjectID) + { + active_panel->clearSelection(); + std::vector<LLUUID> items; + items.push_back(mObjectID); + highlight_inventory_objects_in_panel(items, active_panel); + active_panel->getRootFolder()->scrollToShowSelection(); + + gInventory.removeObserver(this); + break; + } + } + } +} + +void set_dad_inbox_object(const LLUUID& object_id) +{ + LLViewerInventoryMoveObserver* move_observer = new LLViewerInventoryMoveObserver(object_id); + gInventory.addObserver(move_observer); +} + //unlike the FetchObserver for AgentOffer, we only make one //instance of the AddedObserver for TaskOffers //and it never dies. We do this because we don't know the UUID of diff --git a/indra/newview/llviewermessage.h b/indra/newview/llviewermessage.h index b4a9b8e677..9d09d9c01a 100644 --- a/indra/newview/llviewermessage.h +++ b/indra/newview/llviewermessage.h @@ -203,6 +203,8 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name) bool highlight_offered_object(const LLUUID& obj_id); void set_dad_inventory_item(LLInventoryItem* inv_item, const LLUUID& into_folder_uuid); +void set_dad_inbox_object(const LLUUID& object_id); + class LLOfferInfo : public LLNotificationResponderInterface { -- cgit v1.2.3 From 737c6bd95236b25e2a5ed39f18b01257b5988134 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 29 Jun 2011 15:36:18 -0700 Subject: EXP-961 FIX Keyboard definition file keys.xml contains invalid XML markup --- indra/newview/app_settings/keys.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/keys.xml b/indra/newview/app_settings/keys.xml index 101deea55b..6e3673e7d9 100644 --- a/indra/newview/app_settings/keys.xml +++ b/indra/newview/app_settings/keys.xml @@ -181,7 +181,7 @@ <binding key="PAD_DIVIDE" mask="CTL_ALT_SHIFT" command="start_gesture"/> </third_person> - <-- Basic editing camera control --> + <!-- Basic editing camera control --> <edit> <binding key="A" mask="NONE" command="spin_around_cw"/> <binding key="D" mask="NONE" command="spin_around_ccw"/> -- cgit v1.2.3 From 08fca382036feaab113f03211adfc0ba6313929c Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 29 Jun 2011 23:03:15 -0700 Subject: EXP-922 FIX Purchased Direct Delivery items do not appear in Recent Inventory tab fixed having visible child items forcing filtered folder to appear --- indra/newview/llfolderviewitem.cpp | 23 ++++++++++++++++++++--- indra/newview/llfolderviewitem.h | 5 ++++- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index d3b204200a..1fb8c52068 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1204,9 +1204,9 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) else { folderp->setVisible( folderp->getListener() - && ((folderp->getFilteredFolder(filter_generation) - && folderp->getFiltered(filter_generation)) - || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + && (folderp->getFiltered(filter_generation) + || (folderp->getFilteredFolder(filter_generation) + && folderp->hasFilteredDescendants(filter_generation)))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) @@ -1531,6 +1531,23 @@ void LLFolderViewFolder::dirtyFilter() LLFolderViewItem::dirtyFilter(); } +BOOL LLFolderViewFolder::getFiltered() +{ + return getFilteredFolder(getRoot()->getFilter()->getMinRequiredGeneration()) + && LLFolderViewItem::getFiltered(); +} + +BOOL LLFolderViewFolder::getFiltered(S32 filter_generation) +{ + return getFilteredFolder(filter_generation) && LLFolderViewItem::getFiltered(filter_generation); +} + +BOOL LLFolderViewFolder::hasFilteredDescendants(S32 filter_generation) +{ + return mMostFilteredDescendantGeneration >= filter_generation; +} + + BOOL LLFolderViewFolder::hasFilteredDescendants() { return mMostFilteredDescendantGeneration >= getRoot()->getFilter()->getCurrentGeneration(); diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index b9a1cdd9c8..6046188c1e 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -424,12 +424,15 @@ public: virtual void setCompletedFilterGeneration(S32 generation, BOOL recurse_up); virtual S32 getCompletedFilterGeneration() { return mCompletedFilterGeneration; } - BOOL hasFilteredDescendants(S32 filter_generation) { return mMostFilteredDescendantGeneration >= filter_generation; } + BOOL hasFilteredDescendants(S32 filter_generation); BOOL hasFilteredDescendants(); // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); virtual void setFiltered(BOOL filtered, S32 filter_generation); + virtual BOOL getFiltered(); + virtual BOOL getFiltered(S32 filter_generation); + virtual void dirtyFilter(); // folder-specific filtering (filter status propagates top down instead of bottom up) -- cgit v1.2.3 From 3a3d0661b801e015df6ac960be2d2787b16d1688 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Thu, 30 Jun 2011 14:58:36 -0700 Subject: EXP-962 Share button in Inventory Recent tab blinks when no recent items are listed --- indra/newview/llsidepanelinventory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index f769612f3f..caadefeaf3 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -557,12 +557,16 @@ bool LLSidepanelInventory::canShare() mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); LLInventoryPanel* inbox = findChild<LLInventoryPanel>("inventory_inbox"); + + // Avoid flicker in the Recent tab while inventory is being loaded. + if ( (!inbox || inbox->getRootFolder()->getSelectionList().empty()) + && (panel_main_inventory && !panel_main_inventory->getActivePanel()->getRootFolder()->hasVisibleChildren()) ) + { + return false; + } return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false) || (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) ); - - // Avoid flicker in the Recent tab while inventory is being loaded. - //if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; } -- cgit v1.2.3 From 9847f5674cb5528612be1448f8dd25abfb362045 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Thu, 30 Jun 2011 14:59:12 -0700 Subject: MKT-3227 DD clothing and bodyparts forced to worn arriving in inbox --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 318beafe65..21d5de9a5b 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2589,7 +2589,7 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) LLInventoryState::sWearNewClothing = FALSE; } - if (tid == LLInventoryState::sWearNewClothingTransactionID) + if (tid.notNull() && tid == LLInventoryState::sWearNewClothingTransactionID) { count = wearable_ids.size(); for (i = 0; i < count; ++i) -- cgit v1.2.3 From f09cabd4b03a56b6ae9c9def483f96ae6bdbdc1f Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 30 Jun 2011 16:15:10 -0700 Subject: EXP-970 FIX Group Roles > choose name causes other UI to become disabled --- indra/llui/llview.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 245126d178..8803d106ba 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1299,15 +1299,7 @@ void LLView::drawChildren() { if (!mChildList.empty()) { - static const LLRect* rootRect = NULL; - - if (!mParentView) - { - rootRect = &mRect; - } - - LLRect screenRect; - + LLView* rootp = LLUI::getRootView(); ++sDepth; for (child_list_reverse_iter_t child_iter = mChildList.rbegin(); child_iter != mChildList.rend();) // ++child_iter) @@ -1317,9 +1309,8 @@ void LLView::drawChildren() if (viewp->getVisible() && viewp->getRect().isValid()) { - // Only draw views that are within the root view - localRectToScreen(viewp->getRect(),&screenRect); - if ( rootRect->overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect)) + LLRect screen_rect = viewp->calcScreenRect(); + if ( rootp->getLocalRect().overlaps(screen_rect) && LLUI::sDirtyRect.overlaps(screen_rect)) { LLUI::pushMatrix(); { -- cgit v1.2.3 From 6c12a5ca550e06730e06d1a909fbf43d7bda16f5 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 30 Jun 2011 16:25:19 -0700 Subject: EXP-919 FIX -- Items not shown in Received Items panel EXP-929 FIX -- First Direct Delivery item purchased while logged in: Received Items folder visible in inventory and item not visible in Received items panel - no badge count update * Inbox and Outbox inventory panels now live in their own XML files and are hot loaded into place when appropriate, like when the "Received Items" folder is first created, for example. * The Inbox and Outbox panels now show relevant default messages when the folders are empty or do not exist * Added LLInventoryCategoryAddedObserver, a new inventory observer type to observe added folders * Hacked LLInventoryPanel to properly set up inbox and outbox inventory views for the "Received Items" folder and the "Merchant Outbox" folder that aren't created with the proper system folder type * Changed inventory badge count computation to use LLFolderView rather than the inventory directly * Applied various focus, selection and other inbox fixes to the outbox Reviewed by Richard. --- indra/newview/llfolderviewitem.h | 1 + indra/newview/llinventoryobserver.cpp | 28 ++++ indra/newview/llinventoryobserver.h | 22 +++ indra/newview/llinventorypanel.cpp | 43 +++++ indra/newview/llpanelmaininventory.cpp | 4 +- indra/newview/llpanelmaininventory.h | 2 +- indra/newview/llpanelmarketplaceinbox.cpp | 90 ++++++----- indra/newview/llpanelmarketplaceinbox.h | 2 + indra/newview/llpanelmarketplaceoutbox.cpp | 63 ++++++-- indra/newview/llpanelmarketplaceoutbox.h | 19 ++- indra/newview/llsidepanelinventory.cpp | 180 +++++++++++++++++---- indra/newview/llsidepanelinventory.h | 8 +- indra/newview/llsidepanelinventorysubpanel.cpp | 4 +- indra/newview/llsidepanelinventorysubpanel.h | 2 +- indra/newview/llsidepaneliteminfo.cpp | 7 +- indra/newview/llsidepaneliteminfo.h | 2 +- .../skins/default/xui/en/panel_inbox_inventory.xml | 17 ++ .../default/xui/en/panel_outbox_inventory.xml | 17 ++ .../skins/default/xui/en/sidepanel_inventory.xml | 85 +++++----- indra/newview/skins/default/xui/en/strings.xml | 2 + 20 files changed, 461 insertions(+), 137 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/panel_inbox_inventory.xml create mode 100644 indra/newview/skins/default/xui/en/panel_outbox_inventory.xml diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 6046188c1e..f9b47e29ee 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -547,6 +547,7 @@ public: folders_t::const_iterator getFoldersBegin() const { return mFolders.begin(); } folders_t::const_iterator getFoldersEnd() const { return mFolders.end(); } + folders_t::size_type getFoldersCount() const { return mFolders.size(); } }; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index 6bf19e346d..ceba4a0191 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -601,6 +601,34 @@ void LLInventoryAddedObserver::changed(U32 mask) } } +void LLInventoryCategoryAddedObserver::changed(U32 mask) +{ + if (!(mask & LLInventoryObserver::ADD)) + { + return; + } + + const LLInventoryModel::changed_items_t& changed_ids = gInventory.getChangedIDs(); + + for (LLInventoryModel::changed_items_t::const_iterator cit = changed_ids.begin(); cit != changed_ids.end(); ++cit) + { + LLViewerInventoryCategory* cat = gInventory.getCategory(*cit); + + if (cat) + { + mAddedCategories.push_back(cat); + } + } + + if (!mAddedCategories.empty()) + { + done(); + + mAddedCategories.clear(); + } +} + + LLInventoryTransactionObserver::LLInventoryTransactionObserver(const LLTransactionID& transaction_id) : mTransactionID(transaction_id) { diff --git a/indra/newview/llinventoryobserver.h b/indra/newview/llinventoryobserver.h index 2d9021961e..aa1eae84d7 100644 --- a/indra/newview/llinventoryobserver.h +++ b/indra/newview/llinventoryobserver.h @@ -218,6 +218,28 @@ protected: uuid_vec_t mAdded; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLInventoryCategoryAddedObserver +// +// Base class for doing something when a new category is created in the +// inventory. +// It does not watch for a certain UUID, rather it acts when anything is added +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLInventoryCategoryAddedObserver : public LLInventoryObserver +{ +public: + + typedef std::vector<LLViewerInventoryCategory*> cat_vec_t; + + LLInventoryCategoryAddedObserver() : mAddedCategories() {} + /*virtual*/ void changed(U32 mask); + +protected: + virtual void done() = 0; + + cat_vec_t mAddedCategories; +}; + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryTransactionObserver // diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 834da49c61..864e6a181e 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -161,6 +161,49 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { root_id = gInventory.getLibraryRootFolderID(); } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_INBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Received Items") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + else if (preferred_type == LLFolderType::FT_OUTBOX) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == "Merchant Outbox") + { + root_id = cat->getUUID(); + } + } + } + } + // leslie -- end temporary HACK else { root_id = (preferred_type != LLFolderType::FT_NONE) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index f39fbfc498..1920cc2940 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -95,8 +95,8 @@ private: /// LLPanelMainInventory ///---------------------------------------------------------------------------- -LLPanelMainInventory::LLPanelMainInventory() - : LLPanel(), +LLPanelMainInventory::LLPanelMainInventory(const LLPanel::Params& p) + : LLPanel(p), mActivePanel(NULL), mSavedFolderState(NULL), mFilterText(""), diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 86b2c87e0b..899931aa89 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -57,7 +57,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver public: friend class LLFloaterInventoryFinder; - LLPanelMainInventory(); + LLPanelMainInventory(const LLPanel::Params& p = getDefaultParams()); ~LLPanelMainInventory(); BOOL postBuild(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 2b04987084..4e7e72a469 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -58,18 +58,9 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() // virtual BOOL LLPanelMarketplaceInbox::postBuild() { - mInventoryPanel = getChild<LLInventoryPanel>("inventory_inbox"); - - mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); - - mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); - - // Set up the note to display when the inbox is empty - //mInventoryPanel->getFilter()->setEmptyLookupMessage("InboxNoItems"); return TRUE; } @@ -88,6 +79,31 @@ void LLPanelMarketplaceInbox::handleLoginComplete() LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); } +void LLPanelMarketplaceInbox::setupInventoryPanel() +{ + LLView * inbox_inventory_placeholder = getChild<LLView>("inbox_inventory_placeholder"); + LLView * inbox_inventory_parent = inbox_inventory_placeholder->getParent(); + + mInventoryPanel = + LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_inbox_inventory.xml", + inbox_inventory_parent, + LLInventoryPanel::child_registry_t::instance()); + + // Reshape the inventory to the proper size + LLRect inventory_placeholder_rect = inbox_inventory_placeholder->getRect(); + mInventoryPanel->setShape(inventory_placeholder_rect); + + // Set the sort order newest to oldest, and a selection change callback + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); + + // Set up the note to display when the inbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryInboxNoItems"); + + // Hide the placeholder text + inbox_inventory_placeholder->setVisible(FALSE); +} + void LLPanelMarketplaceInbox::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); @@ -107,9 +123,9 @@ void LLPanelMarketplaceInbox::onFocusReceived() { outbox_panel->clearSelection(); } + + sidepanel_inventory->updateVerbs(); } - - sidepanel_inventory->updateVerbs(); } BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) @@ -129,20 +145,25 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const U32 fresh_item_count = 0; - LLFolderView * root_folder = mInventoryPanel->getRootFolder(); - - const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); - - LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); - LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); - - for (; folders_it != folders_end; ++folders_it) + if (mInventoryPanel) { - const LLFolderViewFolder * folder = *folders_it; - - if (folder->getCreationDate() > 1500) + const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder(); + + if (inbox_folder) { - fresh_item_count++; + LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); + LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); + + for (; folders_it != folders_end; ++folders_it) + { + const LLFolderViewFolder * folder = *folders_it; + + // TODO: Replace this check with new "fresh" flag + if (folder->getCreationDate() > 1500) + { + fresh_item_count++; + } + } } } @@ -156,27 +177,16 @@ U32 LLPanelMarketplaceInbox::getTotalItemCount() const { U32 item_count = 0; - LLInventoryModel* model = mInventoryPanel->getModel(); - const LLUUID inbox_id = model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); - - if (!inbox_id.isNull()) + if (mInventoryPanel) { - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - model->getDirectDescendentsOf(inbox_id, cats, items); - - if (cats) - { - item_count += cats->size(); - } - - if (items) + const LLFolderViewFolder * inbox_folder = mInventoryPanel->getRootFolder(); + + if (inbox_folder) { - item_count += items->size(); + item_count += inbox_folder->getFoldersCount(); } } - + return item_count; } diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index b176d57d3f..4ecea29304 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -54,6 +54,8 @@ public: /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg); /*virtual*/ void draw(); + + void setupInventoryPanel(); U32 getFreshItemCount() const; U32 getTotalItemCount() const; diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index c8752b3e0f..74d0de3b30 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -28,6 +28,7 @@ #include "llpanelmarketplaceoutbox.h" +#include "llappviewer.h" #include "llbutton.h" #include "llcoros.h" #include "lleventcoro.h" @@ -41,9 +42,15 @@ static LLRegisterPanelClassWrapper<LLPanelMarketplaceOutbox> t_panel_marketplace_outbox("panel_marketplace_outbox"); +const LLPanelMarketplaceOutbox::Params& LLPanelMarketplaceOutbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams<LLPanelMarketplaceOutbox>(); +} + // protected -LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() - : LLPanel() +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox(const Params& p) + : LLPanel(p) + , mInventoryPanel(NULL) , mSyncButton(NULL) , mSyncIndicator(NULL) , mSyncInProgress(false) @@ -57,18 +64,22 @@ LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() // virtual BOOL LLPanelMarketplaceOutbox::postBuild() { - mSyncButton = getChild<LLButton>("outbox_sync_btn"); - mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); - - mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator"); - - mSyncButton->setEnabled(!isOutboxEmpty()); - + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceOutbox::handleLoginComplete, this)); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); return TRUE; } +void LLPanelMarketplaceOutbox::handleLoginComplete() +{ + mSyncButton = getChild<LLButton>("outbox_sync_btn"); + mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); + mSyncButton->setEnabled(!isOutboxEmpty()); + + mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator"); +} + void LLPanelMarketplaceOutbox::onFocusReceived() { LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel<LLSidepanelInventory>("sidepanel_inventory"); @@ -88,9 +99,43 @@ void LLPanelMarketplaceOutbox::onFocusReceived() { inbox_panel->clearSelection(); } + + sidepanel_inventory->updateVerbs(); } } +void LLPanelMarketplaceOutbox::onSelectionChange() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->updateVerbs(); +} + +void LLPanelMarketplaceOutbox::setupInventoryPanel() +{ + LLView * outbox_inventory_placeholder = getChild<LLView>("outbox_inventory_placeholder"); + LLView * outbox_inventory_parent = outbox_inventory_placeholder->getParent(); + + mInventoryPanel = + LLUICtrlFactory::createFromFile<LLInventoryPanel>("panel_outbox_inventory.xml", + outbox_inventory_parent, + LLInventoryPanel::child_registry_t::instance()); + + // Reshape the inventory to the proper size + LLRect inventory_placeholder_rect = outbox_inventory_placeholder->getRect(); + mInventoryPanel->setShape(inventory_placeholder_rect); + + // Set the sort order newest to oldest, and a selection change callback + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceOutbox::onSelectionChange, this)); + + // Set up the note to display when the outbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InventoryOutboxNoItems"); + + // Hide the placeholder text + outbox_inventory_placeholder->setVisible(FALSE); +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 94bc066224..1b502127ef 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -31,20 +31,31 @@ class LLButton; +class LLInventoryPanel; class LLLoadingIndicator; class LLPanelMarketplaceOutbox : public LLPanel { public: - + + struct Params : public LLInitParam::Block<Params, LLPanel::Params> + { + Params() {} + }; + LOG_CLASS(LLPanelMarketplaceOutbox); - LLPanelMarketplaceOutbox(); + // RN: for some reason you can't just use LLUICtrlFactory::getDefaultParams as a default argument in VC8 + static const LLPanelMarketplaceOutbox::Params& getDefaultParams(); + + LLPanelMarketplaceOutbox(const Params& p = getDefaultParams()); ~LLPanelMarketplaceOutbox(); /*virtual*/ BOOL postBuild(); + void setupInventoryPanel(); + bool isOutboxEmpty() const; bool isSyncInProgress() const; @@ -54,9 +65,13 @@ protected: void onSyncButtonClicked(); void updateSyncButtonStatus(); + void handleLoginComplete(); void onFocusReceived(); + void onSelectionChange(); private: + LLInventoryPanel * mInventoryPanel; + LLButton * mSyncButton; LLLoadingIndicator * mSyncIndicator; bool mSyncInProgress; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index caadefeaf3..fc049f1854 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -46,6 +46,7 @@ #include "lloutfitobserver.h" #include "llpanelmaininventory.h" #include "llpanelmarketplaceinbox.h" +#include "llpanelmarketplaceoutbox.h" #include "llselectmgr.h" #include "llsidepaneliteminfo.h" #include "llsidepaneltaskinfo.h" @@ -75,11 +76,56 @@ static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; +static const char * const MARKETPLACE_OUTBOX_PANEL = "marketplace_outbox"; // // Helpers // +class LLInboxOutboxAddedObserver : public LLInventoryCategoryAddedObserver +{ +public: + LLInboxOutboxAddedObserver(LLSidepanelInventory * sidepanelInventory) + : LLInventoryCategoryAddedObserver() + , mSidepanelInventory(sidepanelInventory) + { + } + + void done() + { + for (cat_vec_t::iterator it = mAddedCategories.begin(); it != mAddedCategories.end(); ++it) + { + LLViewerInventoryCategory* added_category = *it; + + LLFolderType::EType added_category_type = added_category->getPreferredType(); + + switch (added_category_type) + { + case LLFolderType::FT_INBOX: + mSidepanelInventory->observeInboxModifications(added_category->getUUID()); + break; + case LLFolderType::FT_OUTBOX: + mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); + break; + case LLFolderType::FT_NONE: + // HACK until sim update to properly create folder with system type + if (added_category->getName() == "Received Items") + { + mSidepanelInventory->observeInboxModifications(added_category->getUUID()); + } + else if (added_category->getName() == "Merchant Outbox") + { + mSidepanelInventory->observeOutboxModifications(added_category->getUUID()); + } + default: + break; + } + } + } + +private: + LLSidepanelInventory * mSidepanelInventory; +}; // // Implementation @@ -92,6 +138,7 @@ LLSidepanelInventory::LLSidepanelInventory() , mInboxEnabled(false) , mOutboxEnabled(false) , mCategoriesObserver(NULL) + , mInboxOutboxAddedObserver(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } @@ -103,6 +150,12 @@ LLSidepanelInventory::~LLSidepanelInventory() gInventory.removeObserver(mCategoriesObserver); } delete mCategoriesObserver; + + if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver)) + { + gInventory.removeObserver(mInboxOutboxAddedObserver); + } + delete mInboxOutboxAddedObserver; } void handleInventoryDisplayInboxChanged() @@ -139,7 +192,7 @@ BOOL LLSidepanelInventory::postBuild() mOverflowBtn = mInventoryPanel->getChild<LLButton>("overflow_btn"); mOverflowBtn->setClickedCallback(boost::bind(&LLSidepanelInventory::onOverflowButtonClicked, this)); - mPanelMainInventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + mPanelMainInventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); mPanelMainInventory->setSelectCallback(boost::bind(&LLSidepanelInventory::onSelectionChange, this, _1, _2)); LLTabContainer* tabs = mPanelMainInventory->getChild<LLTabContainer>("inventory filter tabs"); tabs->setCommitCallback(boost::bind(&LLSidepanelInventory::updateVerbs, this)); @@ -157,7 +210,7 @@ BOOL LLSidepanelInventory::postBuild() // UI elements from item panel { - mItemPanel = findChild<LLSidepanelItemInfo>("sidepanel__item_panel"); + mItemPanel = getChild<LLSidepanelItemInfo>("sidepanel__item_panel"); LLButton* back_btn = mItemPanel->getChild<LLButton>("back_btn"); back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); @@ -221,29 +274,100 @@ void LLSidepanelInventory::handleLoginComplete() const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); - if (inbox_id.isNull() && outbox_id.isNull()) + // Set up observer to listen for creation of inbox and outbox if at least one of them doesn't exist + if (inbox_id.isNull() || outbox_id.isNull()) { - return; + observeInboxOutboxCreation(); } - mCategoriesObserver = new LLInventoryCategoriesObserver(); - gInventory.addObserver(mCategoriesObserver); - + // Set up observer for inbox changes, if we have an inbox already + if (!inbox_id.isNull()) + { + observeInboxModifications(inbox_id); + } + + // Set up observer for outbox changes, if we have an outbox already if (!outbox_id.isNull()) { - mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + observeOutboxModifications(outbox_id); } +} + +void LLSidepanelInventory::observeInboxOutboxCreation() +{ + // + // Set up observer to track inbox and outbox folder creation + // - if (!inbox_id.isNull()) + if (mInboxOutboxAddedObserver == NULL) + { + mInboxOutboxAddedObserver = new LLInboxOutboxAddedObserver(this); + + gInventory.addObserver(mInboxOutboxAddedObserver); + } +} + +void LLSidepanelInventory::observeInboxModifications(const LLUUID& inboxID) +{ + // + // Track inbox and outbox folder changes + // + + if (inboxID.isNull()) + { + llwarns << "Attempting to track modifications to non-existant inbox" << llendl; + return; + } + + if (mCategoriesObserver == NULL) { - mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + } + + mCategoriesObserver->addCategory(inboxID, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inboxID)); + + // + // Trigger a load for the entire contents of the Inbox + // + + LLInventoryModelBackgroundFetch::instance().start(inboxID); + + // + // Set up the inbox inventory view + // + + LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + inbox->setupInventoryPanel(); +} - // - // Trigger a load for the entire contents of the Inbox - // - LLInventoryModelBackgroundFetch::instance().start(inbox_id); +void LLSidepanelInventory::observeOutboxModifications(const LLUUID& outboxID) +{ + // + // Track outbox folder changes + // + + if (outboxID.isNull()) + { + llwarns << "Attempting to track modifications to non-existant outbox" << llendl; + return; } + + if (mCategoriesObserver == NULL) + { + mCategoriesObserver = new LLInventoryCategoriesObserver(); + gInventory.addObserver(mCategoriesObserver); + } + + mCategoriesObserver->addCategory(outboxID, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outboxID)); + + // + // Set up the outbox inventory view + // + + LLPanelMarketplaceOutbox * outbox = getChild<LLPanelMarketplaceOutbox>(MARKETPLACE_OUTBOX_PANEL); + outbox->setupInventoryPanel(); } void LLSidepanelInventory::enableInbox(bool enabled) @@ -264,7 +388,7 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) LLInventoryModelBackgroundFetch::instance().start(inbox_id); // Expand the inbox since we have fresh items - LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); if (inbox && (inbox->getFreshItemCount() > 0)) { getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); @@ -344,7 +468,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) LLFirstUse::newInventory(false); // Expand the inbox if we have fresh items - LLPanelMarketplaceInbox * inbox = getChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); + LLPanelMarketplaceInbox * inbox = findChild<LLPanelMarketplaceInbox>(MARKETPLACE_INBOX_PANEL); if (inbox && (inbox->getFreshItemCount() > 0)) { getChild<LLButton>(INBOX_BUTTON_NAME)->setToggleState(true); @@ -396,7 +520,7 @@ void LLSidepanelInventory::onShopButtonClicked() void LLSidepanelInventory::performActionOnSelection(const std::string &action) { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { @@ -404,10 +528,11 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) if (inbox) { current_item = inbox->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return; - } + } + + if (!current_item) + { + return; } } @@ -590,7 +715,7 @@ bool LLSidepanelInventory::canWearSelected() LLInventoryItem *LLSidepanelInventory::getSelectedItem() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { @@ -598,10 +723,11 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() if (inbox) { current_item = inbox->getRootFolder()->getCurSelectedItem(); - if (!current_item) - { - return NULL; - } + } + + if (!current_item) + { + return NULL; } } const LLUUID &item_id = current_item->getListener()->getUUID(); @@ -613,7 +739,7 @@ U32 LLSidepanelInventory::getSelectedCount() { int count = 0; - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild<LLPanelMainInventory>("panel_main_inventory"); + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->getChild<LLPanelMainInventory>("panel_main_inventory"); std::set<LLUUID> selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); count += selection_list.size(); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index df29cbceba..9117e3bf27 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -30,6 +30,7 @@ #include "llpanel.h" class LLFolderViewItem; +class LLInboxOutboxAddedObserver; class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; @@ -45,8 +46,12 @@ public: private: void handleLoginComplete(); - + public: + void observeInboxOutboxCreation(); + void observeInboxModifications(const LLUUID& inboxID); + void observeOutboxModifications(const LLUUID& outboxID); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -117,6 +122,7 @@ private: bool mOutboxEnabled; LLInventoryCategoriesObserver* mCategoriesObserver; + LLInboxOutboxAddedObserver* mInboxOutboxAddedObserver; }; #endif //LL_LLSIDEPANELINVENTORY_H diff --git a/indra/newview/llsidepanelinventorysubpanel.cpp b/indra/newview/llsidepanelinventorysubpanel.cpp index 37b10b592f..2918bb388a 100644 --- a/indra/newview/llsidepanelinventorysubpanel.cpp +++ b/indra/newview/llsidepanelinventorysubpanel.cpp @@ -46,8 +46,8 @@ ///---------------------------------------------------------------------------- // Default constructor -LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel() - : LLPanel(), +LLSidepanelInventorySubpanel::LLSidepanelInventorySubpanel(const LLPanel::Params& p) + : LLPanel(p), mIsDirty(TRUE), mIsEditing(FALSE), mCancelBtn(NULL), diff --git a/indra/newview/llsidepanelinventorysubpanel.h b/indra/newview/llsidepanelinventorysubpanel.h index b2de7d3b0b..b5cf3aaf17 100644 --- a/indra/newview/llsidepanelinventorysubpanel.h +++ b/indra/newview/llsidepanelinventorysubpanel.h @@ -40,7 +40,7 @@ class LLInventoryItem; class LLSidepanelInventorySubpanel : public LLPanel { public: - LLSidepanelInventorySubpanel(); + LLSidepanelInventorySubpanel(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelInventorySubpanel(); /*virtual*/ void setVisible(BOOL visible); diff --git a/indra/newview/llsidepaneliteminfo.cpp b/indra/newview/llsidepaneliteminfo.cpp index fbd2f7ca83..1ce05da849 100644 --- a/indra/newview/llsidepaneliteminfo.cpp +++ b/indra/newview/llsidepaneliteminfo.cpp @@ -130,9 +130,10 @@ void LLObjectInventoryObserver::inventoryChanged(LLViewerObject* object, static LLRegisterPanelClassWrapper<LLSidepanelItemInfo> t_item_info("sidepanel_item_info"); // Default constructor -LLSidepanelItemInfo::LLSidepanelItemInfo() - : mItemID(LLUUID::null) - , mObjectInventoryObserver(NULL) +LLSidepanelItemInfo::LLSidepanelItemInfo(const LLPanel::Params& p) + : LLSidepanelInventorySubpanel(p) + , mItemID(LLUUID::null) + , mObjectInventoryObserver(NULL) { mPropertiesObserver = new LLItemPropertiesObserver(this); } diff --git a/indra/newview/llsidepaneliteminfo.h b/indra/newview/llsidepaneliteminfo.h index 25be145f64..12aaca923e 100644 --- a/indra/newview/llsidepaneliteminfo.h +++ b/indra/newview/llsidepaneliteminfo.h @@ -44,7 +44,7 @@ class LLPermissions; class LLSidepanelItemInfo : public LLSidepanelInventorySubpanel { public: - LLSidepanelItemInfo(); + LLSidepanelItemInfo(const LLPanel::Params& p = getDefaultParams()); virtual ~LLSidepanelItemInfo(); /*virtual*/ BOOL postBuild(); diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml new file mode 100644 index 0000000000..49abbcde71 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + name="inventory_inbox" + start_folder="Inbox" + follows="all" layout="topleft" + top="0" left="0" height="165" width="308" + top_pad="0" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + show_item_link_overlays="true" + > + <scroll reserve_scroll_corner="false" /> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml new file mode 100644 index 0000000000..af32056428 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_outbox_inventory.xml @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inventory_panel + name="inventory_outbox" + start_folder="Outbox" + follows="all" layout="topleft" + top="0" left="0" height="165" width="308" + top_pad="0" + bg_opaque_color="DkGray2" + bg_alpha_color="DkGray2" + background_visible="true" + background_opaque="true" + border="false" + bevel_style="none" + show_item_link_overlays="true" + > + <scroll reserve_scroll_corner="false" /> +</inventory_panel> diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 778daac83b..baf37ae0b4 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -69,7 +69,6 @@ width="330"> <string name="InboxLabelWithArg">Received Items ([NUM])</string> <string name="InboxLabelNoArg">Received Items</string> - <string name="InboxNoItems">Items purchased through the marketplace will be delivered here.</string> <button label="Received Items" name="inbox_btn" @@ -112,26 +111,19 @@ background_opaque="true" tool_tip="Drag and drop items to your inventory to manage and use them" > - <inventory_panel - bg_opaque_color="DkGray2" - bg_alpha_color="DkGray2" - background_visible="true" - background_opaque="true" - border="false" - bevel_style="none" - follows="all" - top="0" - height="165" - start_folder="Inbox" - layout="topleft" - left="0" - name="inventory_inbox" - sort_order_setting="InventorySortOrder" - show_item_link_overlays="true" - top_pad="0" - width="308"> - <scroll reserve_scroll_corner="false" /> - </inventory_panel> + <text + name="inbox_inventory_placeholder" + type="string" + follows="all" + layout="topleft" + top="0" + left="0" + width="308" + height="165" + wrap="true" + halign="center"> + Purchases from the marketplace will be delivered here. + </text> </panel> </panel> </layout_panel> @@ -211,33 +203,30 @@ </images> </loading_indicator> <panel - follows="all" - left="0" - bottom="200" - width="330" - top="35" - > - <inventory_panel - bg_opaque_color="DkGray2" - bg_alpha_color="DkGray2" - background_visible="true" - background_opaque="true" - border="false" - bevel_style="none" - follows="all" - height="165" - start_folder="Outbox" - layout="topleft" - left="0" - name="inventory_outbox" - sort_order_setting="InventorySortOrder" - show_item_link_overlays="true" - top="0" - width="308"> - <scroll reserve_scroll_corner="false" /> - </inventory_panel> - </panel> - + follows="all" + left="10" + bottom="200" + width="308" + top="35" + bg_opaque_color="InventoryBackgroundColor" + background_visible="true" + background_opaque="true" + tool_tip="Drag and drop items here to prepare them for sale on your storefront" + > + <text + name="outbox_inventory_placeholder" + type="string" + follows="all" + layout="topleft" + top="0" + left="0" + width="308" + height="165" + wrap="true" + halign="center"> + Set up your merchant account to use this feature. + </text> + </panel> </panel> </layout_panel> </layout_stack> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 71f48c833d..2fa7b9f796 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2021,6 +2021,8 @@ Returns a string with the requested data about the region <string name="PlacesNoMatchingItems">Didn't find what you're looking for? Try [secondlife:///app/search/places/[SEARCH_TERM] Search].</string> <string name="FavoritesNoMatchingItems">Drag a landmark here to add it to your favorites.</string> <string name="InventoryNoTexture">You do not have a copy of this texture in your inventory</string> + <string name="InventoryInboxNoItems">Items purchased through the marketplace will be delivered here.</string> + <string name="InventoryOutboxNoItems">Drag items here in preparation for listing on your marketplace storefront.</string> <!-- use value="" because they have preceding spaces --> <string name="no_transfer" value=" (no transfer)" /> <string name="no_modify" value=" (no modify)" /> -- cgit v1.2.3 From 0382b8dcbfe53f226ebc4ee3779c855cc246becb Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 30 Jun 2011 17:29:12 -0700 Subject: EXP-893 EXTRA -- Single order purchases not sorted with most recent item delivered at top of list Fixed folder getCreationDate function to handle nested folders. This should allow the inbox to properly date sort items delivered with nested folders. Reviewed by Leyla. --- indra/newview/llfolderviewitem.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 1fb8c52068..b76e8395fb 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -2409,19 +2409,39 @@ void LLFolderViewFolder::draw() time_t LLFolderViewFolder::getCreationDate() const { - // folders have no creation date so use first non-folder descendent's date + // folders have no creation date try to create one from an item somewhere in our folder hierarchy if (!mCreationDate) { - for(items_t::const_iterator iit = mItems.begin(); - iit != mItems.end(); ++iit) + for (items_t::const_iterator iit = mItems.begin(); + iit != mItems.end(); ++iit) { LLFolderViewItem* itemp = (*iit); - if (itemp->getCreationDate()) + + const time_t item_creation_date = itemp->getCreationDate(); + + if (item_creation_date) { - mCreationDate = itemp->getCreationDate(); + mCreationDate = item_creation_date; break; } } + + if (!mCreationDate) + { + for (folders_t::const_iterator fit = mFolders.begin(); + fit != mFolders.end(); ++fit) + { + LLFolderViewFolder* folderp = (*fit); + + const time_t folder_creation_date = folderp->getCreationDate(); + + if (folder_creation_date) + { + mCreationDate = folder_creation_date; + break; + } + } + } } return llmax<time_t>(mCreationDate, mSubtreeCreationDate); -- cgit v1.2.3 From 37bc2b2fe89674b3ffbd4e2152554e05cdf6abe3 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Fri, 1 Jul 2011 13:14:17 -0700 Subject: EXP-895 fixing selection problems - again --- indra/newview/llfolderview.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfc4fcaec6..bfbe8ac96e 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -814,8 +814,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); + new_selection = NULL; } if (new_selection) -- cgit v1.2.3 From d9d858a7520a7f3627afbe49a19217264f8c4928 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Tue, 5 Jul 2011 11:19:54 -0700 Subject: EXP-973 FIX -- Inbox and Outbox panel flash on and off when open inventory panel for first time in session on Agni in direct delivery viewer Layout panels that contain the inbox and outbox are now invisible by default. Reviewed by Richard. --- indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index baf37ae0b4..79a0ec7c72 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -53,9 +53,10 @@ user_resize="false" follows="bottom|left|right" name="inbox_layout_panel" + visible="false" min_dim="35" max_dim="200" - expanded_min_dim="90" + expanded_min_dim="90" height="200"> <panel follows="all" @@ -133,9 +134,10 @@ user_resize="false" follows="bottom|left|right" name="outbox_layout_panel" + visible="false" min_dim="35" max_dim="200" - expanded_min_dim="90" + expanded_min_dim="90" height="200"> <panel follows="all" -- cgit v1.2.3 From 2f21ec48a222662351c9f8e7243673eb6a31b457 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Tue, 5 Jul 2011 12:32:12 -0700 Subject: EXP-860 FIX -- Display NEW for items added to inbox * Added createFolderView, createFolderViewFolder and createFolderViewItem virtuals to LLInventoryPanel so these can be overridden by a derived class for custom display. * Added new LLInboxInventoryPanel class that overrides createFolderViewFolder with a LLInboxFolderViewFolder for custom display with NEW tags. * LLInboxFolderViewFolder NEW tag is tied to the mFresh variable that currently has no logic attached to it, meaning it remains off all the time. Reviewed by Richard. --- indra/llui/llbadgeowner.cpp | 8 + indra/llui/llbadgeowner.h | 3 + indra/newview/CMakeLists.txt | 10 +- indra/newview/llinventorypanel.cpp | 120 ++++++++------ indra/newview/llinventorypanel.h | 5 + indra/newview/llpanelmarketplaceinboxinventory.cpp | 178 +++++++++++++++++++++ indra/newview/llpanelmarketplaceinboxinventory.h | 78 +++++++++ .../skins/default/xui/en/panel_inbox_inventory.xml | 6 +- .../xui/en/widgets/inbox_folder_view_folder.xml | 10 ++ 9 files changed, 365 insertions(+), 53 deletions(-) create mode 100644 indra/newview/llpanelmarketplaceinboxinventory.cpp create mode 100644 indra/newview/llpanelmarketplaceinboxinventory.h create mode 100644 indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 3d63fc7f60..77f15567bf 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -73,6 +73,14 @@ void LLBadgeOwner::setBadgeLabel(const LLStringExplicit& label) } } +void LLBadgeOwner::setBadgeVisibility(bool visible) +{ + if (mBadge) + { + mBadge->setVisible(visible); + } +} + void LLBadgeOwner::addBadgeToParentPanel() { LLView * owner_view = mBadgeOwnerView.get(); diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h index 456ef90c13..a2399189a5 100644 --- a/indra/llui/llbadgeowner.h +++ b/indra/llui/llbadgeowner.h @@ -42,8 +42,11 @@ public: void initBadgeParams(const LLBadge::Params& p); void addBadgeToParentPanel(); + + bool badgeHasParent() const { return (mBadge && mBadge->getParent()); } void setBadgeLabel(const LLStringExplicit& label); + void setBadgeVisibility(bool visible); private: diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index d79d3f1f72..a78fe3aab5 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -361,8 +361,9 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp - llpanelmarketplaceinbox.cpp - llpanelmarketplaceoutbox.cpp + llpanelmarketplaceinbox.cpp + llpanelmarketplaceinboxinventory.cpp + llpanelmarketplaceoutbox.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -911,8 +912,9 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h - llpanelmarketplaceinbox.h - llpanelmarketplaceoutbox.h + llpanelmarketplaceinbox.h + llpanelmarketplaceinboxinventory.h + llpanelmarketplaceoutbox.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 864e6a181e..49170caee8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -216,26 +216,15 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; root_id = LLUUID::generateNewID(); } - - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, - LLAssetType::AT_CATEGORY, - LLInventoryType::IT_CATEGORY, - this, - NULL, - root_id); - p.use_label_suffix = params.use_label_suffix; - p.allow_multiselect = mAllowMultiSelect; - mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); + + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -611,6 +600,69 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) buildNewViews(id); } +LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) +{ + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + + LLFolderView::Params p; + + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = bridge; + p.use_label_suffix = useLabelSuffix; + p.allow_multiselect = mAllowMultiSelect; + + return LLUICtrlFactory::create<LLFolderView>(p); +} + +LLFolderViewFolder * LLInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLFolderViewFolder>(params); +} + +LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge) +{ + LLFolderViewItem::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.creation_date = bridge->getCreationDate(); + params.root = mFolderRoot; + params.listener = bridge; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLFolderViewItem>(params); +} + void LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); @@ -649,18 +701,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) objectp->getUUID()); if (new_listener) { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create<LLFolderViewFolder>(params); + LLFolderViewFolder* folderp = createFolderViewFolder(new_listener); folderp->setItemSortOrder(mFolderRoot->getSortOrder()); itemp = folderp; } @@ -679,20 +720,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) if (new_listener) { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create<LLFolderViewItem> (params); + itemp = createFolderViewItem(new_listener); } } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 4b915484f8..4d06573ad9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -39,6 +39,7 @@ #include "lluictrlfactory.h" #include <set> +class LLFolderViewFolder; class LLFolderViewItem; class LLInventoryFilter; class LLInventoryModel; @@ -221,6 +222,10 @@ protected: virtual void buildFolderView(const LLInventoryPanel::Params& params); virtual void buildNewViews(const LLUUID& id); BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; + + virtual LLFolderView* createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix); + virtual LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + virtual LLFolderViewItem* createFolderViewItem(LLInvFVBridge * bridge); private: BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() BOOL mViewsInitialized; // Views have been generated diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp new file mode 100644 index 0000000000..50f3451b6f --- /dev/null +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -0,0 +1,178 @@ +/** + * @file llpanelmarketplaceinboxinventory.cpp + * @brief LLInboxInventoryPanel class definition + * + * $LicenseInfo:firstyear=2009&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 "llpanelmarketplaceinboxinventory.h" + +#include "llfolderview.h" +#include "llfoldervieweventlistener.h" +#include "llinventorybridge.h" +#include "llinventoryfunctions.h" +#include "llpanellandmarks.h" +#include "llplacesinventorybridge.h" +#include "llviewerfoldertype.h" + + +// +// statics +// + +static LLDefaultChildRegistry::Register<LLInboxInventoryPanel> r1("inbox_inventory_panel"); +static LLDefaultChildRegistry::Register<LLInboxFolderViewFolder> r2("inbox_folder_view_folder"); + + +// +// LLInboxInventoryPanel Implementation +// + +LLInboxInventoryPanel::LLInboxInventoryPanel(const LLInboxInventoryPanel::Params& p) + : LLInventoryPanel(p) +{ +} + +LLInboxInventoryPanel::~LLInboxInventoryPanel() +{ +} + +// virtual +void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + + LLUUID root_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + // leslie -- temporary HACK to work around sim not creating inbox and outbox with proper system folder type + if (root_id.isNull()) + { + std::string start_folder_name(params.start_folder()); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + gInventory.getDirectDescendentsOf(gInventory.getRootFolderID(), cats, items); + + if (cats) + { + for (LLInventoryModel::cat_array_t::const_iterator cat_it = cats->begin(); cat_it != cats->end(); ++cat_it) + { + LLInventoryCategory* cat = *cat_it; + + if (cat->getName() == start_folder_name) + { + root_id = cat->getUUID(); + break; + } + } + } + + if (root_id == LLUUID::null) + { + llwarns << "No category found that matches inbox inventory panel start_folder: " << start_folder_name << llendl; + } + } + // leslie -- end temporary HACK + + if (root_id == LLUUID::null) + { + llwarns << "Inbox inventory panel has no root folder!" << llendl; + root_id = LLUUID::generateNewID(); + } + + LLRect folder_rect(0, 0, getRect().getWidth(), 0); + + LLFolderView::Params p; + + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.use_label_suffix = params.use_label_suffix; + p.allow_multiselect = mAllowMultiSelect; + + mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); +} + +LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) +{ + LLInboxFolderViewFolder::Params params; + + params.name = bridge->getDisplayName(); + params.icon = bridge->getIcon(); + params.icon_open = bridge->getOpenIcon(); + + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + + params.root = mFolderRoot; + params.listener = bridge; + params.tool_tip = params.name; + + return LLUICtrlFactory::create<LLInboxFolderViewFolder>(params); +} + + +// +// LLInboxFolderViewFolder Implementation +// + +LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) + : LLFolderViewFolder(p) + , LLBadgeOwner(getHandle()) + , mFresh(false) +{ + initBadgeParams(p.new_badge()); +} + +LLInboxFolderViewFolder::~LLInboxFolderViewFolder() +{ +} + +// virtual +void LLInboxFolderViewFolder::draw() +{ + if (!badgeHasParent()) + { + addBadgeToParentPanel(); + } + + setBadgeVisibility(mFresh); + + LLFolderViewFolder::draw(); +} + + +// eof diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h new file mode 100644 index 0000000000..71b8d0be67 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -0,0 +1,78 @@ +/** + * @file llpanelmarketplaceinboxinventory.h + * @brief LLInboxInventoryPanel class declaration + * + * $LicenseInfo:firstyear=2009&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_INBOXINVENTORYPANEL_H +#define LL_INBOXINVENTORYPANEL_H + + +#include "llbadgeowner.h" +#include "llinventorypanel.h" +#include "llfolderviewitem.h" + + +class LLInboxInventoryPanel : public LLInventoryPanel +{ +public: + struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params> + { + Params() {} + }; + + LLInboxInventoryPanel(const Params& p); + ~LLInboxInventoryPanel(); + + // virtual + void buildFolderView(const LLInventoryPanel::Params& params); + + // virtual + LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); +}; + + +class LLInboxFolderViewFolder : public LLFolderViewFolder, public LLBadgeOwner +{ +public: + struct Params : public LLInitParam::Block<Params, LLFolderViewFolder::Params> + { + Optional<LLBadge::Params> new_badge; + + Params() + : new_badge("new_badge") + { + } + }; + + LLInboxFolderViewFolder(const Params& p); + ~LLInboxFolderViewFolder(); + + void draw(); + +protected: + bool mFresh; +}; + + +#endif //LL_INBOXINVENTORYPANEL_H diff --git a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml index 49abbcde71..d06190ec54 100644 --- a/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_inbox_inventory.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<inventory_panel +<inbox_inventory_panel name="inventory_inbox" - start_folder="Inbox" + start_folder="Received Items" follows="all" layout="topleft" top="0" left="0" height="165" width="308" top_pad="0" @@ -14,4 +14,4 @@ show_item_link_overlays="true" > <scroll reserve_scroll_corner="false" /> -</inventory_panel> +</inbox_inventory_panel> diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml new file mode 100644 index 0000000000..2c987b158d --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_folder_view_folder + folder_arrow_image="Folder_Arrow" + folder_indentation="8" + item_height="20" + item_top_pad="4" + selection_image="Rounded_Square" + > + <new_badge label="New" location="right" location_percent_hcenter="70" /> +</inbox_folder_view_folder> -- cgit v1.2.3 From 610c788dd5bbaf886ff5d66b0687d8e8b2a371b7 Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 5 Jul 2011 15:15:00 -0700 Subject: EXP-981 Selecting Wear and detach options for an object in Received Items folder causes issues with Profile, Share, and Wear buttons --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfbe8ac96e..20d948de70 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2183,7 +2183,7 @@ void LLFolderView::doIdle() LLFastTimer t3(FTM_AUTO_SELECT); // select new item only if a filtered item not currently selected LLFolderViewItem* selected_itemp = mSelectedItems.empty() ? NULL : mSelectedItems.back(); - if ((!selected_itemp || !selected_itemp->getFiltered()) && !mAutoSelectOverride) + if ((selected_itemp && !selected_itemp->getFiltered()) && !mAutoSelectOverride) { // select first filtered item LLSelectFirstFilteredItem filter; -- cgit v1.2.3 From f0e853d5d6de793137e8ee67760f7fa6ddde952e Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Tue, 5 Jul 2011 15:16:06 -0700 Subject: updating code comment for EXP-981 --- indra/newview/llfolderview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 20d948de70..8fd69304ad 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -2173,7 +2173,7 @@ void LLFolderView::doIdle() // filter to determine visiblity before arranging filterFromRoot(); - // automatically show matching items, and select first one + // automatically show matching items, and select first one if we had a selection // do this every frame until user puts keyboard focus into the inventory window // signaling the end of the automatic update // only do this when mNeedsFilter is set, meaning filtered items have -- cgit v1.2.3 From 72c7525e677b8e5391abf5b552aa8d068f0e82d6 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Tue, 5 Jul 2011 16:07:09 -0700 Subject: EXP-916 FIX -- Folder in Inbox indicates loading when all items are displayed in folder * Updated inbox inventory to not ever display the loading status like other inventory windows. * show_load_status is now an optional parameter for LLInventoryPanel and LLFolderView. Its default value is true but it is overridden to be false for the LLInboxInventoryPanel. Reviewed by Richard. --- indra/newview/llfolderview.cpp | 5 ++++- indra/newview/llfolderview.h | 1 + indra/newview/llinventorypanel.cpp | 2 ++ indra/newview/llinventorypanel.h | 3 +++ indra/newview/llpanelmarketplaceinboxinventory.cpp | 25 ++++++---------------- .../xui/en/widgets/inbox_inventory_panel.xml | 2 ++ .../default/xui/en/widgets/inventory_panel.xml | 1 + 7 files changed, 20 insertions(+), 19 deletions(-) create mode 100644 indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index bfbe8ac96e..b04ab493bf 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -172,6 +172,7 @@ LLFolderView::Params::Params() title("title"), use_label_suffix("use_label_suffix"), allow_multiselect("allow_multiselect", true), + show_load_status("show_load_status", true), use_ellipses("use_ellipses", false) { } @@ -208,6 +209,8 @@ LLFolderView::LLFolderView(const Params& p) mStatusTextBox(NULL) { mRoot = this; + + mShowLoadStatus = p.show_load_status(); LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); @@ -354,7 +357,7 @@ BOOL LLFolderView::addFolder( LLFolderViewFolder* folder) { recursiveIncrementNumDescendantsSelected(folder->numSelected()); } - folder->setShowLoadStatus(true); + folder->setShowLoadStatus(mShowLoadStatus); folder->setOrigin(0, 0); folder->reshape(getRect().getWidth(), 0); folder->setVisible(FALSE); diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 12f6170a7d..96027e55a8 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -91,6 +91,7 @@ public: Optional<std::string> title; Optional<bool> use_label_suffix, allow_multiselect, + show_load_status, use_ellipses; Params(); diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 49170caee8..25e43b34a6 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -130,6 +130,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mInventory(p.inventory), mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), + mShowLoadStatus(p.show_load_status), mViewsInitialized(false), mInvFVBridgeBuilder(NULL) { @@ -617,6 +618,7 @@ LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool u p.listener = bridge; p.use_label_suffix = useLabelSuffix; p.allow_multiselect = mAllowMultiSelect; + p.show_load_status = mShowLoadStatus; return LLUICtrlFactory::create<LLFolderView>(p); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 4d06573ad9..e3fc4b227c 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -84,6 +84,7 @@ public: Optional<Filter> filter; Optional<std::string> start_folder; Optional<bool> use_label_suffix; + Optional<bool> show_load_status; Optional<LLScrollContainer::Params> scroll; Params() @@ -94,6 +95,7 @@ public: filter("filter"), start_folder("start_folder"), use_label_suffix("use_label_suffix", true), + show_load_status("show_load_status"), scroll("scroll") {} }; @@ -178,6 +180,7 @@ protected: LLInvPanelComplObserver* mCompletionObserver; BOOL mAllowMultiSelect; BOOL mShowItemLinkOverlays; // Shows link graphic over inventory item icons + BOOL mShowLoadStatus; LLFolderView* mFolderRoot; LLScrollContainer* mScroller; diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 50f3451b6f..b644f0e5cb 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -103,25 +103,14 @@ void LLInboxInventoryPanel::buildFolderView(const LLInventoryPanel::Params& para root_id = LLUUID::generateNewID(); } - LLRect folder_rect(0, 0, getRect().getWidth(), 0); - - LLFolderView::Params p; - - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, - LLAssetType::AT_CATEGORY, - LLInventoryType::IT_CATEGORY, - this, - NULL, - root_id); - p.use_label_suffix = params.use_label_suffix; - p.allow_multiselect = mAllowMultiSelect; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); - mFolderRoot = LLUICtrlFactory::create<LLFolderView>(p); + mFolderRoot = createFolderView(new_listener, params.use_label_suffix()); } LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge * bridge) diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml new file mode 100644 index 0000000000..830c27bdac --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/inbox_inventory_panel.xml @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<inbox_inventory_panel show_load_status="false" /> diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml index 3164cc5eba..00f4c43915 100644 --- a/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/inventory_panel.xml @@ -3,6 +3,7 @@ bg_opaque_color="InventoryBackgroundColor" background_visible="true" background_opaque="true" + show_load_status="true" > <scroll name="Inventory Scroller" -- cgit v1.2.3 From aecfaef10c41dce7395c3a02dcd84a39b6ffbeee Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Tue, 5 Jul 2011 16:51:04 -0700 Subject: EXP-982 FIX As a user, I would like to see the new web-based profiles without any browser chrome and at an appropriate default size --- indra/newview/app_settings/settings.xml | 15 +++++++++++++++ indra/newview/llavataractions.cpp | 4 +++- indra/newview/llfloaterwebcontent.cpp | 18 ++++++++++++++++-- indra/newview/llfloaterwebcontent.h | 2 +- .../skins/default/xui/en/floater_media_browser.xml | 2 +- .../skins/default/xui/en/floater_web_content.xml | 9 +++++++-- .../skins/minimal/xui/en/floater_web_content.xml | 9 +++++++-- 7 files changed, 50 insertions(+), 9 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 34a179f95b..9d46cd442b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13405,5 +13405,20 @@ <key>Value</key> <integer>1</integer> </map> + <key>WebProfileRect</key> + <map> + <key>Comment</key> + <string>Web profile dimensions</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Rect</string> + <key>Value</key> + <array> + <integer>0</integer> + <integer>650</integer> + <integer>475</integer> + <integer>0</integer> + </array> </map> </map> </llsd> diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index eeb4ec8458..b2d97a796a 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -313,7 +313,9 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa std::string url = getProfileURL(username); // PROFILES: open in webkit window - LLWeb::loadWebURLInternal(url, "", agent_id.asString()); + const bool show_chrome = false; + static LLCachedControl<LLRect> profile_rect(gSavedSettings, "WebProfileRect"); + LLFloaterWebContent::create(url, "", agent_id.asString(), show_chrome, profile_rect); } // static diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 058567492b..43eecbf048 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -99,7 +99,7 @@ void LLFloaterWebContent::initializeURLHistory() } //static -void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid ) +void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid, bool show_chrome, const LLRect& preferred_media_size) { lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; @@ -155,6 +155,20 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar // tell the browser instance to load the specified URL browser->open_media(url, target); LLViewerMedia::proxyWindowOpened(target, uuid); + + browser->getChild<LLLayoutPanel>("status_bar")->setVisible(show_chrome); + browser->getChild<LLLayoutPanel>("nav_controls")->setVisible(show_chrome); + + if (!show_chrome) + { + browser->setResizeLimits(100, 100); + } + + if (!preferred_media_size.isEmpty()) + { + //ignore x, y for now + browser->geometryChanged(browser->getRect().mLeft, browser->getRect().mBottom, preferred_media_size.getWidth(), preferred_media_size.getHeight()); + } } } @@ -210,7 +224,7 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) lldebugs << "geometry change: " << geom << llendl; - handleReshape(geom,false); + setShape(geom); } void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index ecc7e970d8..56b6ef12c8 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -46,7 +46,7 @@ public: void initializeURLHistory(); - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); + static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null, bool show_chrome = true, const LLRect& preferred_media_size = LLRect() ); static void closeRequest(const std::string &uuid); static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml index 43729d7c9f..5a1f920398 100644 --- a/indra/newview/skins/default/xui/en/floater_media_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -5,7 +5,7 @@ height="440" layout="topleft" min_height="140" - min_width="467" + min_width="0" name="floater_about" help_topic="floater_about" save_rect="true" diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index e04a72cbc0..a62ff21589 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -18,6 +18,7 @@ follows="left|right|top|bottom" layout="topleft" left="5" + animate="false" name="stack1" orientation="vertical" top="20" @@ -156,14 +157,18 @@ name="external_controls" top_delta="0" user_resize="false" + auto_resize="true" width="585"> <web_browser - bottom="-22" + bottom="-2" follows="all" layout="topleft" left="0" name="webbrowser" top="0"/> + </layout_panel> + <layout_panel name="status_bar" + height="23"> <text type="string" length="200" @@ -174,7 +179,7 @@ name="statusbartext" parse_urls="false" text_color="0.4 0.4 0.4 1" - top_pad="5" + top_pad="3" width="495"/> <progress_bar color_bar="0.3 1.0 0.3 1" diff --git a/indra/newview/skins/minimal/xui/en/floater_web_content.xml b/indra/newview/skins/minimal/xui/en/floater_web_content.xml index 50cb5b14ce..fd45ef2f62 100644 --- a/indra/newview/skins/minimal/xui/en/floater_web_content.xml +++ b/indra/newview/skins/minimal/xui/en/floater_web_content.xml @@ -17,6 +17,7 @@ follows="left|right|top|bottom" layout="topleft" left="5" + animate="false" name="stack1" orientation="vertical" top="20" @@ -155,14 +156,18 @@ name="external_controls" top_delta="0" user_resize="false" + auto_resize="true" width="585"> <web_browser - bottom="-22" + bottom="-2" follows="all" layout="topleft" left="0" name="webbrowser" top="0"/> + </layout_panel> + <layout_panel name="status_bar" + height="23"> <text type="string" length="200" @@ -173,7 +178,7 @@ name="statusbartext" parse_urls="false" text_color="0.4 0.4 0.4 1" - top_pad="5" + top_pad="3" width="495"/> <progress_bar color_bar="0.3 1.0 0.3 1" -- cgit v1.2.3 From e92d3dcf1013ab340fdef514b41ebf790f79e04c Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Tue, 5 Jul 2011 23:40:19 -0700 Subject: EXP-971 FIX New Direct Delivery item does not sort as most recent item in Recent Tab if that tab is open when item delivered --- indra/newview/llagentwearables.cpp | 2 +- indra/newview/llavataractions.cpp | 1 + indra/newview/llfilteredwearablelist.cpp | 1 + indra/newview/llfolderview.h | 16 ---------- indra/newview/llfolderviewitem.cpp | 5 +-- indra/newview/llfolderviewitem.h | 1 + indra/newview/llinventorybridge.cpp | 1 + indra/newview/llinventoryfunctions.h | 24 ++++++++++++-- indra/newview/llinventorymodelbackgroundfetch.cpp | 2 ++ indra/newview/llinventorypanel.cpp | 38 ++++++++++++++++++++++- indra/newview/llinventorypanel.h | 16 +++++----- indra/newview/llpanelappearancetab.cpp | 1 + indra/newview/llpanellandmarks.cpp | 1 + indra/newview/llpanelmarketplaceinbox.cpp | 1 + indra/newview/llpanelmarketplaceinboxinventory.h | 4 +-- indra/newview/llpanelobjectinventory.cpp | 3 ++ indra/newview/llpaneloutfitedit.cpp | 2 +- indra/newview/llpreviewgesture.cpp | 1 + indra/newview/llsidepanelappearance.cpp | 1 + indra/newview/llviewermenu.cpp | 1 + indra/newview/llviewermessage.cpp | 2 ++ 21 files changed, 89 insertions(+), 35 deletions(-) diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index d426afb17c..36272f0c7c 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -33,7 +33,6 @@ #include "llagentwearablesfetch.h" #include "llappearancemgr.h" #include "llcallbacklist.h" -#include "llfolderview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" @@ -45,6 +44,7 @@ #include "llsidepanelappearance.h" #include "llsidetray.h" #include "lltexlayer.h" +#include "lltooldraganddrop.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "llwearable.h" diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index b2d97a796a..4685865bce 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -49,6 +49,7 @@ #include "llfloaterpay.h" #include "llfloaterwebcontent.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llgiveinventory.h" #include "llinventorybridge.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType diff --git a/indra/newview/llfilteredwearablelist.cpp b/indra/newview/llfilteredwearablelist.cpp index cd5e779c4d..a29ccf2b6d 100644 --- a/indra/newview/llfilteredwearablelist.cpp +++ b/indra/newview/llfilteredwearablelist.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventoryitemslist.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" LLFilteredWearableListManager::LLFilteredWearableListManager(LLInventoryItemsList* list, LLInventoryCollectFunctor* collector) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 96027e55a8..0b92548fd0 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -58,22 +58,6 @@ class LLScrollContainer; class LLUICtrl; class LLTextBox; -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLFolderViewFunctor -// -// Simple abstract base class for applying a functor to folders and -// items in a folder view hierarchy. This is suboptimal for algorithms -// that only work folders or only work on items, but I'll worry about -// that later when it's determined to be too slow. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -class LLFolderViewFunctor -{ -public: - virtual ~LLFolderViewFunctor() {} - virtual void doFolder(LLFolderViewFolder* folder) = 0; - virtual void doItem(LLFolderViewItem* item) = 0; -}; - //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLFolderView // diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index b76e8395fb..02fa77f6ab 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -33,6 +33,7 @@ #include "llviewerfoldertype.h" #include "llinventorybridge.h" // for LLItemBridge in LLInventorySort::operator() #include "llinventoryfilter.h" +#include "llinventoryfunctions.h" #include "llinventorymodelbackgroundfetch.h" #include "llpanel.h" #include "llviewercontrol.h" // gSavedSettings @@ -2042,7 +2043,7 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) requestArrange(); requestSort(); LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && !parentp->getCreationDate()) + while (parentp && parentp->mSortFunction.isByDate()) { // parent folder doesn't have a time stamp yet, so get it from us parentp->requestSort(); @@ -2068,7 +2069,7 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) folder->requestArrange(TRUE); requestSort(); LLFolderViewFolder* parentp = getParentFolder(); - while (parentp && !parentp->getCreationDate()) + while (parentp && !parentp->mSortFunction.isByDate()) { // parent folder doesn't have a time stamp yet, so get it from us parentp->requestSort(); diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index f9b47e29ee..e2f94a2b63 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -66,6 +66,7 @@ public: // Returns true if order has changed bool updateSort(U32 order); U32 getSort() { return mSortOrder; } + bool isByDate() { return mByDate; } bool operator()(const LLFolderViewItem* const& a, const LLFolderViewItem* const& b); private: diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 6644eea219..75d4c4e80d 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -40,6 +40,7 @@ #include "llfloateropenobject.h" #include "llfloaterreg.h" #include "llfloaterworldmap.h" +#include "llfolderview.h" #include "llfriendcard.h" #include "llgesturemgr.h" #include "llgiveinventory.h" diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h index cfe1747fd4..2016b92666 100644 --- a/indra/newview/llinventoryfunctions.h +++ b/indra/newview/llinventoryfunctions.h @@ -28,9 +28,9 @@ #ifndef LL_LLINVENTORYFUNCTIONS_H #define LL_LLINVENTORYFUNCTIONS_H -#include "llinventorytype.h" -#include "llfolderview.h" -#include "llfolderviewitem.h" +#include "llinventorymodel.h" +#include "llinventory.h" +#include "llwearabletype.h" /******************************************************************************** ** ** @@ -417,6 +417,24 @@ public: /** Inventory Collector Functions ** ** *******************************************************************************/ +class LLFolderViewItem; +class LLFolderViewFolder; + +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLFolderViewFunctor +// +// Simple abstract base class for applying a functor to folders and +// items in a folder view hierarchy. This is suboptimal for algorithms +// that only work folders or only work on items, but I'll worry about +// that later when it's determined to be too slow. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +class LLFolderViewFunctor +{ +public: + virtual ~LLFolderViewFunctor() {} + virtual void doFolder(LLFolderViewFolder* folder) = 0; + virtual void doItem(LLFolderViewItem* item) = 0; +}; class LLInventoryState { diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 7b1ff102e7..afaf660cb7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -31,7 +31,9 @@ #include "llappviewer.h" #include "llcallbacklist.h" #include "llinventorypanel.h" +#include "llinventorymodel.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewermessage.h" #include "llviewerregion.h" #include "llviewerwindow.h" diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 25e43b34a6..d11e7572fe 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llavataractions.h" #include "llfloaterinventory.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llimfloater.h" #include "llimview.h" #include "llinventorybridge.h" @@ -340,6 +341,17 @@ void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType getFilter()->setFilterCategoryTypes(types); } +U32 LLInventoryPanel::getFilterObjectTypes() const +{ + return mFolderRoot->getFilterObjectTypes(); +} + +U32 LLInventoryPanel::getFilterPermMask() const +{ + return mFolderRoot->getFilterPermissions(); +} + + void LLInventoryPanel::setFilterPermMask(PermissionMask filter_perm_mask) { getFilter()->setFilterPermissions(filter_perm_mask); @@ -355,6 +367,12 @@ void LLInventoryPanel::setFilterSubString(const std::string& string) getFilter()->setFilterSubString(string); } +const std::string LLInventoryPanel::getFilterSubString() +{ + return mFolderRoot->getFilterSubString(); +} + + void LLInventoryPanel::setSortOrder(U32 order) { getFilter()->setSortOrder(order); @@ -366,6 +384,12 @@ void LLInventoryPanel::setSortOrder(U32 order) } } +U32 LLInventoryPanel::getSortOrder() const +{ + return mFolderRoot->getSortOrder(); +} + + void LLInventoryPanel::setSinceLogoff(BOOL sl) { getFilter()->setDateRangeLastLogoff(sl); @@ -537,6 +561,12 @@ void LLInventoryPanel::modelChanged(U32 mask) } } +LLFolderView* LLInventoryPanel::getRootFolder() +{ + return mFolderRoot; +} + + // static void LLInventoryPanel::onIdle(void *userdata) { @@ -800,6 +830,12 @@ void LLInventoryPanel::openSelected() bridge->openItem(); } +void LLInventoryPanel::unSelectAll() +{ + mFolderRoot->setSelection(NULL, FALSE, FALSE); +} + + BOOL LLInventoryPanel::handleHover(S32 x, S32 y, MASK mask) { BOOL handled = LLView::handleHover(x, y, mask); @@ -879,7 +915,7 @@ void LLInventoryPanel::setSelection(const LLUUID& obj_id, BOOL take_keyboard_foc mFolderRoot->setSelectionByID(obj_id, take_keyboard_focus); } -void LLInventoryPanel::setSelectCallback(const LLFolderView::signal_t::slot_type& cb) +void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb) { if (mFolderRoot) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index e3fc4b227c..4894b43a56 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -33,12 +33,12 @@ #include "llfloater.h" #include "llinventory.h" #include "llinventoryfilter.h" -#include "llfolderview.h" #include "llinventorymodel.h" #include "llscrollcontainer.h" #include "lluictrlfactory.h" #include <set> +class LLFolderView; class LLFolderViewFolder; class LLFolderViewItem; class LLInventoryFilter; @@ -128,17 +128,17 @@ public: // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); - void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); + void setSelectCallback(const boost::function<void (const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb); void clearSelection(); LLInventoryFilter* getFilter(); const LLInventoryFilter* getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); - U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); } + U32 getFilterObjectTypes() const; void setFilterPermMask(PermissionMask filter_perm_mask); - U32 getFilterPermMask() const { return mFolderRoot->getFilterPermissions(); } + U32 getFilterPermMask() const; void setFilterWearableTypes(U64 filter); void setFilterSubString(const std::string& string); - const std::string getFilterSubString() { return mFolderRoot->getFilterSubString(); } + const std::string getFilterSubString(); void setSinceLogoff(BOOL sl); void setHoursAgo(U32 hours); BOOL getSinceLogoff(); @@ -148,7 +148,7 @@ public: LLInventoryFilter::EFolderShow getShowFolderState(); // This method is called when something has changed about the inventory. void modelChanged(U32 mask); - LLFolderView* getRootFolder() { return mFolderRoot; } + LLFolderView* getRootFolder(); LLScrollContainer* getScrollableContainer() { return mScroller; } void onSelectionChange(const std::deque<LLFolderViewItem*> &items, BOOL user_action); @@ -163,7 +163,7 @@ public: static void dumpSelectionInformation(void* user_data); void openSelected(); - void unSelectAll() { mFolderRoot->setSelection(NULL, FALSE, FALSE); } + void unSelectAll(); static void onIdle(void* user_data); @@ -204,7 +204,7 @@ public: static const std::string INHERIT_SORT_ORDER; void setSortOrder(U32 order); - U32 getSortOrder() const { return mFolderRoot->getSortOrder(); } + U32 getSortOrder() const; private: std::string mSortOrderSetting; diff --git a/indra/newview/llpanelappearancetab.cpp b/indra/newview/llpanelappearancetab.cpp index 9910a3a2ac..8fa8867c69 100644 --- a/indra/newview/llpanelappearancetab.cpp +++ b/indra/newview/llpanelappearancetab.cpp @@ -31,6 +31,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" +#include "llviewerinventory.h" //virtual bool LLPanelAppearanceTab::canTakeOffSelected() diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 9b9573d06b..a9cc247d1b 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -46,6 +46,7 @@ #include "llfolderviewitem.h" #include "llinventorymodelbackgroundfetch.h" #include "llinventorypanel.h" +#include "llinventoryfunctions.h" #include "lllandmarkactions.h" #include "llmenubutton.h" #include "llplacesinventorybridge.h" diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 4e7e72a469..af74f8f261 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -31,6 +31,7 @@ #include "llappviewer.h" #include "llbutton.h" #include "llinventorypanel.h" +#include "llfolderview.h" #include "llsidepanelinventory.h" diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 71b8d0be67..262d2c367a 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -30,8 +30,6 @@ #include "llbadgeowner.h" #include "llinventorypanel.h" -#include "llfolderviewitem.h" - class LLInboxInventoryPanel : public LLInventoryPanel { @@ -48,7 +46,7 @@ public: void buildFolderView(const LLInventoryPanel::Params& params); // virtual - LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); + class LLFolderViewFolder* createFolderViewFolder(LLInvFVBridge * bridge); }; diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index e0d0239929..e3b61f695a 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -44,6 +44,7 @@ #include "llcallbacklist.h" #include "llbuycurrencyhtml.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llinventorybridge.h" #include "llinventorydefines.h" #include "llinventoryfilter.h" @@ -58,8 +59,10 @@ #include "llselectmgr.h" #include "llsidetray.h" #include "llstatusbar.h" +#include "lltooldraganddrop.h" #include "lltrans.h" #include "llviewerassettype.h" +#include "llviewerinventory.h" #include "llviewerregion.h" #include "llviewerobjectlist.h" #include "llviewermessage.h" diff --git a/indra/newview/llpaneloutfitedit.cpp b/indra/newview/llpaneloutfitedit.cpp index 62f582c343..35e2e96bab 100644 --- a/indra/newview/llpaneloutfitedit.cpp +++ b/indra/newview/llpaneloutfitedit.cpp @@ -36,7 +36,7 @@ #include "lloutfitobserver.h" #include "llcofwearables.h" #include "llfilteredwearablelist.h" -#include "llfolderviewitem.h" +#include "llfolderview.h" #include "llinventory.h" #include "llinventoryitemslist.h" #include "llviewercontrol.h" diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp index 9f5c55bad1..f47928b131 100644 --- a/indra/newview/llpreviewgesture.cpp +++ b/indra/newview/llpreviewgesture.cpp @@ -42,6 +42,7 @@ #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llinventorymodelbackgroundfetch.h" +#include "llkeyboard.h" #include "llmultigesture.h" #include "llnotificationsutil.h" #include "llradiogroup.h" diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index 16729f045a..28ec11d1c7 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -32,6 +32,7 @@ #include "llagentcamera.h" #include "llagentwearables.h" #include "llappearancemgr.h" +#include "llfolderview.h" #include "llinventorypanel.h" #include "llfiltereditor.h" #include "llfloaterreg.h" diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 41d8b57f36..4035928904 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -107,6 +107,7 @@ #include "lltrans.h" #include "lleconomy.h" #include "lltoolgrab.h" +#include "llwindow.h" #include "boost/unordered_map.hpp" using namespace LLVOAvatarDefines; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 2ff540b625..30485d5e07 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -37,6 +37,7 @@ #include "lleconomy.h" #include "lleventtimer.h" #include "llfloaterreg.h" +#include "llfolderview.h" #include "llfollowcamparams.h" #include "llinventorydefines.h" #include "lllslconstants.h" @@ -87,6 +88,7 @@ #include "lluri.h" #include "llviewergenericmessage.h" #include "llviewermenu.h" +#include "llviewerinventory.h" #include "llviewerjoystick.h" #include "llviewerobjectlist.h" #include "llviewerparcelmgr.h" -- cgit v1.2.3 From 1f59f11f38586ac7ff94fbf855aae568bb302351 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 11:03:33 -0700 Subject: fix for build --- indra/newview/llpanelmarketplaceinboxinventory.h | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 262d2c367a..8f198c41c1 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -30,6 +30,7 @@ #include "llbadgeowner.h" #include "llinventorypanel.h" +#include "llfolderviewitem.h" class LLInboxInventoryPanel : public LLInventoryPanel { -- cgit v1.2.3 From 6c63a1ae09dca557af67a06c7871bfe287765dd4 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 13:26:06 -0700 Subject: tweaked web profile floater size --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 9d46cd442b..255bb48f65 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13417,7 +13417,7 @@ <array> <integer>0</integer> <integer>650</integer> - <integer>475</integer> + <integer>490</integer> <integer>0</integer> </array> </map> </map> -- cgit v1.2.3 From 60f6d809262d97de3b41dcf18a43d783b4b485dc Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 6 Jul 2011 15:48:33 -0700 Subject: EXP-980 Inbox sorting does not persist between sessions --- indra/newview/llfolderview.cpp | 11 +++-------- indra/newview/llfolderviewitem.cpp | 10 +++++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 8fd69304ad..29ed70dea5 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -320,15 +320,10 @@ void LLFolderView::setSortOrder(U32 order) if (order != mSortOrder) { LLFastTimer t(FTM_SORT); + mSortOrder = order; - - for (folders_t::iterator iter = mFolders.begin(); - iter != mFolders.end();) - { - folders_t::iterator fit = iter++; - (*fit)->sortBy(order); - } - + + sortBy(order); arrangeAll(); } } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index b76e8395fb..8f56d81232 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1902,9 +1902,13 @@ void LLFolderViewFolder::sortBy(U32 order) folders_t::iterator fit = iter++; (*fit)->sortBy(order); } - - mFolders.sort(mSortFunction); - mItems.sort(mSortFunction); + + // Don't sort the topmost folders (My Inventory and Library) + if (mListener->getUUID().notNull()) + { + mFolders.sort(mSortFunction); + mItems.sort(mSortFunction); + } if (order & LLInventoryFilter::SO_DATE) { -- cgit v1.2.3 From f12f186a38d6df53348c313cc5a41cc0e492952c Mon Sep 17 00:00:00 2001 From: Leyla Farazha <leyla@lindenlab.com> Date: Wed, 6 Jul 2011 17:36:45 -0700 Subject: Null check in case this is causing the places crash --- indra/newview/llfolderview.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 28b95e751e..50c3f9a734 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -931,14 +931,15 @@ void LLFolderView::draw() if (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() || mCompletedFilterGeneration < mFilter->getMinRequiredGeneration()) { mStatusText = LLTrans::getString("Searching"); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); } else { - LLStringUtil::format_map_t args; - args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); - mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); - //font->renderUTF8(mStatusText, 0, 2, 1, sSearchStatusColor, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE ); + if (getFilter()) + { + LLStringUtil::format_map_t args; + args["[SEARCH_TERM]"] = LLURI::escape(getFilter()->getFilterSubStringOrig()); + mStatusText = LLTrans::getString(getFilter()->getEmptyLookupMessage(), args); + } } mStatusTextBox->setValue(mStatusText); mStatusTextBox->setVisible( TRUE ); -- cgit v1.2.3 From caff254c9155b55412556c9270bec4b114d83270 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 18:43:52 -0700 Subject: EXP-847 FIX As a user, I would like to see the How To floater appear the first time I log in to basic mode --- indra/newview/app_settings/settings.xml | 25 +++++++++++++++++++++- indra/newview/app_settings/settings_minimal.xml | 13 ++++++++++- indra/newview/llfloaterhelpbrowser.h | 1 + indra/newview/llstartup.cpp | 12 +++++++++++ indra/newview/llviewerhelp.cpp | 3 ++- .../skins/default/xui/en/floater_help_browser.xml | 2 ++ .../skins/minimal/xui/en/floater_help_browser.xml | 10 ++++----- 7 files changed, 58 insertions(+), 8 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 255bb48f65..0ae4545911 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13419,6 +13419,29 @@ <integer>650</integer> <integer>490</integer> <integer>0</integer> - </array> </map> + </array> + </map> + <key>HelpFloaterOpen</key> + <map> + <key>Comment</key> + <string>Show Help Floater on login?</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>ShowHelpOnFirstLogin</key> + <map> + <key>Comment</key> + <string>Show Help Floater on first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> </map> </llsd> diff --git a/indra/newview/app_settings/settings_minimal.xml b/indra/newview/app_settings/settings_minimal.xml index 70a75cb4ca..29e52ab054 100644 --- a/indra/newview/app_settings/settings_minimal.xml +++ b/indra/newview/app_settings/settings_minimal.xml @@ -459,5 +459,16 @@ <key>Value</key> <integer>0</integer> </map> - </map> + <key>ShowHelpOnFirstLogin</key> + <map> + <key>Comment</key> + <string>Show Help Floater on first login</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + </map> </llsd> diff --git a/indra/newview/llfloaterhelpbrowser.h b/indra/newview/llfloaterhelpbrowser.h index 2731c81b9c..afe0f4df69 100644 --- a/indra/newview/llfloaterhelpbrowser.h +++ b/indra/newview/llfloaterhelpbrowser.h @@ -42,6 +42,7 @@ class LLFloaterHelpBrowser : /*virtual*/ BOOL postBuild(); /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void onOpen(const LLSD& key); // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 167dd68f08..ba1f7cd2e3 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -76,6 +76,7 @@ #include "lluserrelations.h" #include "llversioninfo.h" #include "llviewercontrol.h" +#include "llviewerhelp.h" #include "llvfs.h" #include "llxorcipher.h" // saved password, MAC address #include "llwindow.h" @@ -1692,11 +1693,22 @@ bool idle_startup() gViewerThrottle.setMaxBandwidth(FAST_RATE_BPS / 1024.f); } + if (gSavedSettings.getBOOL("ShowHelpOnFirstLogin")) + { + gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); + } + // Set the show start location to true, now that the user has logged // on with this install. gSavedSettings.setBOOL("ShowStartLocation", TRUE); } + if (gSavedSettings.getBOOL("HelpFloaterOpen")) + { + // show default topic + LLViewerHelp::instance().showTopic(""); + } + // We're successfully logged in. gSavedSettings.setBOOL("FirstLoginThisInstall", FALSE); diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 9fe8c142b9..69522b7ab3 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -101,8 +101,9 @@ void LLViewerHelp::showTopic(const std::string &topic) // work out the URL for this topic and display it showHelp(); + std::string helpURL = LLViewerHelpUtil::buildHelpURL( help_topic ); - setRawURL( helpURL ); + setRawURL(helpURL); } std::string LLViewerHelp::defaultTopic() diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index 02e50ee584..de6d586f72 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -2,6 +2,8 @@ <floater legacy_header_height="18" can_resize="true" + left="10000" + bottom="10000" height="600" layout="topleft" min_height="150" diff --git a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml index cc551f7d58..6eb40bc943 100644 --- a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml @@ -3,12 +3,12 @@ legacy_header_height="18" can_resize="true" can_minimize="false" - height="360" + height="460" layout="topleft" min_height="360" - left="645" + left="10000" top="10" - min_width="345" + min_width="335" name="floater_help_browser" save_rect="true" single_instance="true" @@ -22,7 +22,7 @@ name="done_text"> </floater.string> <layout_stack - bottom="360" + bottom="460" follows="left|right|top|bottom" layout="topleft" left="5" @@ -38,7 +38,7 @@ user_resize="false" width="325"> <web_browser - trusted_content="true" + trusted_content="true" bottom="-5" follows="left|right|top|bottom" layout="topleft" -- cgit v1.2.3 From 21d8cc88051297e24bfc21a83c4335c6b005fee6 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 18:44:42 -0700 Subject: EXP-847 FIX As a user, I would like to see the How To floater appear the first time I log in to basic mode --- indra/newview/llfloaterhelpbrowser.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/newview/llfloaterhelpbrowser.cpp b/indra/newview/llfloaterhelpbrowser.cpp index 627defd006..3012638d44 100644 --- a/indra/newview/llfloaterhelpbrowser.cpp +++ b/indra/newview/llfloaterhelpbrowser.cpp @@ -71,9 +71,18 @@ void LLFloaterHelpBrowser::buildURLHistory() } } +void LLFloaterHelpBrowser::onOpen(const LLSD& key) +{ + gSavedSettings.setBOOL("HelpFloaterOpen", TRUE); +} + //virtual void LLFloaterHelpBrowser::onClose(bool app_quitting) { + if (!app_quitting) + { + gSavedSettings.setBOOL("HelpFloaterOpen", FALSE); + } // really really destroy the help browser when it's closed, it'll be recreated. destroy(); // really destroy this dialog on closure, it's relatively heavyweight. } -- cgit v1.2.3 From 4ec383808b7f45072875c8315a245b13941272ee Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 19:04:08 -0700 Subject: EXP-982 FIX As a user, I wuold like to see the new web-based profiles without any browser chrome fixed status bar resizing to take up too much space --- indra/newview/skins/default/xui/en/floater_web_content.xml | 4 +++- indra/newview/skins/minimal/xui/en/floater_web_content.xml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index a62ff21589..69e6057556 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -168,7 +168,9 @@ top="0"/> </layout_panel> <layout_panel name="status_bar" - height="23"> + height="23" + auto_resize="false" + user_resize="false"> <text type="string" length="200" diff --git a/indra/newview/skins/minimal/xui/en/floater_web_content.xml b/indra/newview/skins/minimal/xui/en/floater_web_content.xml index fd45ef2f62..1d9a967d5a 100644 --- a/indra/newview/skins/minimal/xui/en/floater_web_content.xml +++ b/indra/newview/skins/minimal/xui/en/floater_web_content.xml @@ -167,7 +167,9 @@ top="0"/> </layout_panel> <layout_panel name="status_bar" - height="23"> + height="23" + auto_resize="false" + user_resize="false"> <text type="string" length="200" -- cgit v1.2.3 From fabb46db1e3fdcdc36c23c697d0e4bdb800e7954 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 19:10:32 -0700 Subject: EXP-940 FIX Make search button on by default in advanced mode --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0ae4545911..1751f6702a 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9681,7 +9681,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>ShowSnapshotButton</key> <map> -- cgit v1.2.3 From 77e99e0887b8b1f60ccfe1aeb1cf31c56517f81d Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Wed, 6 Jul 2011 20:01:12 -0700 Subject: EXP-983 WIP potential fix for crash when using Place Profile in viewer experience --- indra/newview/llfolderview.cpp | 5 ++++- indra/newview/llfolderviewitem.cpp | 2 +- indra/newview/llinventorypanel.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 50c3f9a734..e8a2d5539b 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -1926,8 +1926,11 @@ void LLFolderView::deleteAllChildren() closeRenamer(); LLView::deleteViewByHandle(mPopupMenuHandle); mPopupMenuHandle = LLHandle<LLView>(); - mRenamer = NULL; + mScrollContainer = NULL; mRenameItem = NULL; + mRenamer = NULL; + mStatusTextBox = NULL; + clearSelection(); LLView::deleteAllChildren(); } diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 87bbe76320..e15365cf52 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1804,7 +1804,7 @@ void LLFolderViewFolder::destroyView() folderp->destroyView(); // removes entry from mFolders } - deleteAllChildren(); + //deleteAllChildren(); if (mParentFolder) { diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index d11e7572fe..8f947b15b9 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -623,7 +623,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && old_view != mFolderRoot) + if (old_view) { old_view->destroyView(); } -- cgit v1.2.3 From 791da71c3ea45130cd3817a059a18418e43269b0 Mon Sep 17 00:00:00 2001 From: Leslie Linden <leslie@lindenlab.com> Date: Thu, 7 Jul 2011 10:37:50 -0700 Subject: EXP-983 FIX -- Viewer crashes around Place Profile and Landmarks listing in Viewer Experience * Fixed up some funny use of objects that had already been deleted. Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 21 ++++++++++++--------- indra/newview/llinventorypanel.h | 4 ++-- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 8f947b15b9..84199a895a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -471,7 +471,8 @@ void LLInventoryPanel::modelChanged(U32 mask) { view_item->destroyView(); } - buildNewViews(item_id); + view_item = buildNewViews(item_id); + view_folder = dynamic_cast<LLFolderViewFolder *>(view_item); } ////////////////////////////// @@ -524,7 +525,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // STRUCTURE Operation // This item already exists in both memory and UI. It was probably reparented. - if (model_item && view_item) + else if (model_item && view_item) { // Don't process the item if it is the root if (view_item->getRoot() != view_item) @@ -552,7 +553,7 @@ void LLInventoryPanel::modelChanged(U32 mask) ////////////////////////////// // REMOVE Operation // This item has been removed from memory, but its associated UI element still exists. - if (!model_item && view_item) + else if (!model_item && view_item) { // Remove the item's UI. view_item->destroyView(); @@ -619,7 +620,7 @@ void LLInventoryPanel::initializeViews() } } -void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) +LLFolderViewItem* LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); @@ -628,7 +629,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) old_view->destroyView(); } - buildNewViews(id); + return buildNewViews(id); } LLFolderView * LLInventoryPanel::createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix) @@ -695,19 +696,19 @@ LLFolderViewItem * LLInventoryPanel::createFolderViewItem(LLInvFVBridge * bridge return LLUICtrlFactory::create<LLFolderViewItem>(params); } -void LLInventoryPanel::buildNewViews(const LLUUID& id) +LLFolderViewItem* LLInventoryPanel::buildNewViews(const LLUUID& id) { LLInventoryObject const* objectp = gInventory.getObject(id); LLUUID root_id = mFolderRoot->getListener()->getUUID(); LLFolderViewFolder* parent_folder = NULL; - + LLFolderViewItem* itemp = NULL; + if (id == root_id) { parent_folder = mFolderRoot; } else if (objectp) { - LLFolderViewItem* itemp = NULL; const LLUUID &parent_id = objectp->getParentUUID(); parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); @@ -719,7 +720,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() << llendl; - return; + return NULL; } if ((objectp->getType() == LLAssetType::AT_CATEGORY) && @@ -796,6 +797,8 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } mInventory->unlockDirectDescendentArrays(id); } + + return itemp; } // bit of a hack to make sure the inventory is open. diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 4894b43a56..a4287a438e 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -220,10 +220,10 @@ public: protected: // Builds the UI. Call this once the inventory is usable. void initializeViews(); - void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. + LLFolderViewItem* rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. virtual void buildFolderView(const LLInventoryPanel::Params& params); - virtual void buildNewViews(const LLUUID& id); + LLFolderViewItem* buildNewViews(const LLUUID& id); BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; virtual LLFolderView* createFolderView(LLInvFVBridge * bridge, bool useLabelSuffix); -- cgit v1.2.3 From 674d8522a10d0067a8b4067aca9853cbce68e3c9 Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 7 Jul 2011 12:11:30 -0700 Subject: EXP-847 FIX As a user, I would like to see the How To floater appear the first time I log in to basic mode made help window not appear on login for advanced mode made help window visibility state properly persist in advanced mode --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llviewerhelp.cpp | 13 +------------ 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1751f6702a..ad9b6b0c90 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13430,7 +13430,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>1</integer> + <integer>0</integer> </map> <key>ShowHelpOnFirstLogin</key> <map> diff --git a/indra/newview/llviewerhelp.cpp b/indra/newview/llviewerhelp.cpp index 69522b7ab3..3a3d4f3881 100644 --- a/indra/newview/llviewerhelp.cpp +++ b/indra/newview/llviewerhelp.cpp @@ -149,18 +149,7 @@ std::string LLViewerHelp::getTopicFromFocus() // static void LLViewerHelp::showHelp() { - LLFloaterHelpBrowser* helpbrowser = dynamic_cast<LLFloaterHelpBrowser*>(LLFloaterReg::getInstance("help_browser")); - if (helpbrowser) - { - BOOL visible = TRUE; - BOOL take_focus = TRUE; - helpbrowser->setVisible(visible); - helpbrowser->setFrontmost(take_focus); - } - else - { - llwarns << "Eep, help_browser floater not found" << llendl; - } + LLFloaterReg::showInstance("help_browser"); } // static -- cgit v1.2.3 From 5302a9c67a77c455132648e6b61f7f309956613e Mon Sep 17 00:00:00 2001 From: Richard Linden <none@none> Date: Thu, 7 Jul 2011 12:26:00 -0700 Subject: EXP-847 FIX As a user, I would like to see the How To floater appear the first time I log in to basic mode turned off save_rect for basic mode help window so it isn't influenced by resizing window in advanced mode --- indra/newview/skins/minimal/xui/en/floater_help_browser.xml | 1 - 1 file changed, 1 deletion(-) diff --git a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml index 6eb40bc943..477f210352 100644 --- a/indra/newview/skins/minimal/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/minimal/xui/en/floater_help_browser.xml @@ -10,7 +10,6 @@ top="10" min_width="335" name="floater_help_browser" - save_rect="true" single_instance="true" title="HOW TO" width="335"> -- cgit v1.2.3 From e4bb8a442dbaff26ef305945a6768e386b634718 Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Thu, 7 Jul 2011 12:54:08 -0700 Subject: EXP-984 FIX -- My Inventory listing scrolls to bottom when Received Items panel is loaded with several items present * Updated initial view setup to clear selection from "My Inventory" or the root folder after opening it. Reviewed by Richard. --- indra/newview/llinventorypanel.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 84199a895a..702e8d5a1f 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -814,6 +814,7 @@ void LLInventoryPanel::openStartFolderOrMyInventory() { const std::string& child_name = child->getName(); mFolderRoot->openFolder(child_name); + mFolderRoot->clearSelection(); // No need to keep it selected though! break; } } -- cgit v1.2.3 From 8e9fd4bdf2ddce90d8e4bfc8f49b0ebeec29c9fe Mon Sep 17 00:00:00 2001 From: Leslie Linden <none@none> Date: Thu, 7 Jul 2011 12:58:06 -0700 Subject: EXP-985 FIX -- Always show Inbox panel if "Received Items" folder exists The presence of the inbox folder now forces the "Received Items" folder to be visible. The same logic applies to the outbox as well. Reviewed by Richard. --- indra/newview/llsidepanelinventory.cpp | 14 ++++++++++++++ indra/newview/llviewermedia.cpp | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index fc049f1854..6a3a6200e9 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -165,6 +165,13 @@ void handleInventoryDisplayInboxChanged() sidepanel_inventory->enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); } +void handleInventoryDisplayOutboxChanged() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast<LLSidepanelInventory*>(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox")); +} + BOOL LLSidepanelInventory::postBuild() { // UI elements from inventory panel @@ -258,6 +265,7 @@ BOOL LLSidepanelInventory::postBuild() } gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); + gSavedSettings.getControl("InventoryDisplayOutbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayOutboxChanged)); return TRUE; } @@ -284,12 +292,18 @@ void LLSidepanelInventory::handleLoginComplete() if (!inbox_id.isNull()) { observeInboxModifications(inbox_id); + + // Enable the display of the inbox if it exists + enableInbox(true); } // Set up observer for outbox changes, if we have an outbox already if (!outbox_id.isNull()) { observeOutboxModifications(outbox_id); + + // Enable the display of the outbox if it exists + enableOutbox(true); } } diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 39ad1cfd20..1be58eae45 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1385,7 +1385,7 @@ public: else { // API in unavailable - llinfos << "Marketplace API is unavailable -- Inbox Disabled, status = " << status << ", reason = " << reason << llendl; + llinfos << "Marketplace API is unavailable -- Inbox may be disabled, status = " << status << ", reason = " << reason << llendl; } } }; -- cgit v1.2.3