From 8878a5e561f292a8afcd933eaafb2c4c65b7bf7f Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 9 Dec 2011 12:29:33 -0800 Subject: * Changed background opacity of outbox and inventory to match. * Removed superfluous marketplace layout stack, leftover from inbox/outbox in same inventory window. --- indra/newview/llavataractions.cpp | 2 +- indra/newview/llfloateroutbox.cpp | 40 +++++----- indra/newview/llfloateroutbox.h | 1 - indra/newview/llsidepanelinventory.cpp | 92 +++++++--------------- indra/newview/llsidepanelinventory.h | 14 ++-- .../default/xui/en/floater_merchant_outbox.xml | 20 +---- .../skins/default/xui/en/panel_main_inventory.xml | 7 -- .../default/xui/en/panel_outbox_inventory.xml | 1 - .../skins/default/xui/en/sidepanel_inventory.xml | 50 +++--------- 9 files changed, 69 insertions(+), 158 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8ca621538f..e7e098e423 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -707,7 +707,7 @@ std::set LLAvatarActions::getInventorySelectedUUIDs() LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); if (sidepanel_inventory) { - inventory_selected_uuids = sidepanel_inventory->getInboxOrOutboxSelectionList(); + inventory_selected_uuids = sidepanel_inventory->getInboxSelectionList(); } } diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp index 6a3eaba016..619be87187 100644 --- a/indra/newview/llfloateroutbox.cpp +++ b/indra/newview/llfloateroutbox.cpp @@ -83,7 +83,6 @@ LLFloaterOutbox::LLFloaterOutbox(const LLSD& key) , mOutboxId(LLUUID::null) , mOutboxInventoryPanel(NULL) , mOutboxItemCount(0) - , mInventoryDisablePanel(NULL) , mInventoryFolderCountText(NULL) , mInventoryImportInProgress(NULL) , mInventoryPlaceholder(NULL) @@ -110,7 +109,6 @@ LLFloaterOutbox::~LLFloaterOutbox() BOOL LLFloaterOutbox::postBuild() { - mInventoryDisablePanel = getChild("outbox_inventory_disable_panel"); mInventoryFolderCountText = getChild("outbox_folder_count"); mInventoryImportInProgress = getChild("import_progress_indicator"); mInventoryPlaceholder = getChild("outbox_inventory_placeholder_panel"); @@ -136,21 +134,24 @@ void LLFloaterOutbox::onOpen(const LLSD& key) // // Look for an outbox and set up the inventory API // - - const bool do_not_create_folder = false; - const bool do_not_find_in_library = false; - - const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); - if (outbox_id.isNull()) - { - // Observe category creation to catch outbox creation - mCategoryAddedObserver = new LLOutboxAddedObserver(this); - gInventory.addObserver(mCategoryAddedObserver); - } - else + if (mOutboxId.isNull()) { - setupOutbox(outbox_id); + const bool do_not_create_folder = false; + const bool do_not_find_in_library = false; + + const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + if (outbox_id.isNull()) + { + // Observe category creation to catch outbox creation + mCategoryAddedObserver = new LLOutboxAddedObserver(this); + gInventory.addObserver(mCategoryAddedObserver); + } + else + { + setupOutbox(outbox_id); + } } updateView(); @@ -164,10 +165,11 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId) mOutboxId = outboxId; // No longer need to observe new category creation - if (mCategoryAddedObserver != NULL) + if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver)) { gInventory.removeObserver(mCategoryAddedObserver); - } + delete mCategoryAddedObserver; + } // Create observer for outbox modifications mCategoriesObserver = new LLInventoryCategoriesObserver(); @@ -286,6 +288,8 @@ BOOL LLFloaterOutbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFloaterOutbox::onImportButtonClicked() { + mOutboxInventoryPanel->clearSelection(); + LLMarketplaceInventoryImporter::instance().triggerImport(); } @@ -355,13 +359,11 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress) { mImportButton->setEnabled(false); - mInventoryDisablePanel->setVisible(true); mInventoryImportInProgress->setVisible(true); } else { mInventoryImportInProgress->setVisible(false); - mInventoryDisablePanel->setVisible(false); mImportButton->setEnabled(mOutboxItemCount > 0); } diff --git a/indra/newview/llfloateroutbox.h b/indra/newview/llfloateroutbox.h index 9b6568c69c..3d2ce86144 100644 --- a/indra/newview/llfloateroutbox.h +++ b/indra/newview/llfloateroutbox.h @@ -79,7 +79,6 @@ private: LLInventoryPanel * mOutboxInventoryPanel; U32 mOutboxItemCount; - LLView * mInventoryDisablePanel; LLTextBox * mInventoryFolderCountText; LLView * mInventoryImportInProgress; LLView * mInventoryPlaceholder; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index eade91798b..5cda381d10 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -69,12 +69,10 @@ static LLRegisterPanelClassWrapper t_inventory("sidepanel_ static const char * const INBOX_BUTTON_NAME = "inbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; -static const char * const INBOX_OUTBOX_LAYOUT_PANEL_NAME = "inbox_outbox_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 INBOX_OUTBOX_LAYOUT_STACK_NAME = "inbox_outbox_layout_stack"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; @@ -83,10 +81,10 @@ static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; // Helpers // -class LLInboxOutboxAddedObserver : public LLInventoryCategoryAddedObserver +class LLInboxAddedObserver : public LLInventoryCategoryAddedObserver { public: - LLInboxOutboxAddedObserver(LLSidepanelInventory * sidepanelInventory) + LLInboxAddedObserver(LLSidepanelInventory * sidepanelInventory) : LLInventoryCategoryAddedObserver() , mSidepanelInventory(sidepanelInventory) { @@ -127,7 +125,7 @@ LLSidepanelInventory::LLSidepanelInventory() , mPanelMainInventory(NULL) , mInboxEnabled(false) , mCategoriesObserver(NULL) - , mInboxOutboxAddedObserver(NULL) + , mInboxAddedObserver(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() } @@ -140,11 +138,11 @@ LLSidepanelInventory::~LLSidepanelInventory() } delete mCategoriesObserver; - if (mInboxOutboxAddedObserver && gInventory.containsObserver(mInboxOutboxAddedObserver)) + if (mInboxAddedObserver && gInventory.containsObserver(mInboxAddedObserver)) { - gInventory.removeObserver(mInboxOutboxAddedObserver); + gInventory.removeObserver(mInboxAddedObserver); } - delete mInboxOutboxAddedObserver; + delete mInboxAddedObserver; } void handleInventoryDisplayInboxChanged() @@ -217,21 +215,16 @@ BOOL LLSidepanelInventory::postBuild() } } - // Marketplace inbox/outbox setup + // Received items inbox setup { LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); // Disable user_resize on main inventory panel by default inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); - inv_stack->setPanelUserResize(INBOX_OUTBOX_LAYOUT_PANEL_NAME, false); - - // Collapse marketplace panel by default - inv_stack->collapsePanel(getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME), true); - - LLLayoutStack* inout_stack = getChild(INBOX_OUTBOX_LAYOUT_STACK_NAME); + inv_stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false); // Collapse inbox panel - inout_stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), true); + inv_stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), true); // Set up button states and callbacks LLButton * inbox_button = getChild(INBOX_BUTTON_NAME); @@ -243,7 +236,7 @@ BOOL LLSidepanelInventory::postBuild() enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); // Trigger callback for after login so we can setup to track inbox changes after initial inventory load - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInboxOutbox, this)); + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::updateInbox, this)); } gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); @@ -254,7 +247,7 @@ BOOL LLSidepanelInventory::postBuild() return TRUE; } -void LLSidepanelInventory::updateInboxOutbox() +void LLSidepanelInventory::updateInbox() { // // Track inbox folder changes @@ -265,10 +258,10 @@ void LLSidepanelInventory::updateInboxOutbox() const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); - // Set up observer to listen for creation of inbox and outbox if at least one of them doesn't exist + // Set up observer to listen for creation of inbox if at least one of them doesn't exist if (inbox_id.isNull()) { - observeInboxOutboxCreation(); + observeInboxCreation(); } // Set up observer for inbox changes, if we have an inbox already else @@ -280,17 +273,17 @@ void LLSidepanelInventory::updateInboxOutbox() } } -void LLSidepanelInventory::observeInboxOutboxCreation() +void LLSidepanelInventory::observeInboxCreation() { // - // Set up observer to track inbox and outbox folder creation + // Set up observer to track inbox folder creation // - if (mInboxOutboxAddedObserver == NULL) + if (mInboxAddedObserver == NULL) { - mInboxOutboxAddedObserver = new LLInboxOutboxAddedObserver(this); + mInboxAddedObserver = new LLInboxAddedObserver(this); - gInventory.addObserver(mInboxOutboxAddedObserver); + gInventory.addObserver(mInboxAddedObserver); } } @@ -334,13 +327,6 @@ void LLSidepanelInventory::enableInbox(bool enabled) LLLayoutPanel * inbox_layout_panel = getChild(INBOX_LAYOUT_PANEL_NAME); inbox_layout_panel->setVisible(enabled); - - if (mInboxEnabled) - { - LLLayoutPanel * inout_layout_panel = getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME); - - inout_layout_panel->setVisible(TRUE); - } } void LLSidepanelInventory::openInbox() @@ -358,7 +344,7 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) LLInventoryModelBackgroundFetch::instance().start(inbox_id); #if AUTO_EXPAND_INBOX - // Expand the inbox since we have fresh items and the outbox is not expanded + // Expand the inbox since we have fresh items if (mInboxEnabled) { getChild(INBOX_BUTTON_NAME)->setToggleState(true); @@ -367,39 +353,19 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) #endif } -bool LLSidepanelInventory::manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel) -{ - bool expand = pressedButton->getToggleState(); - - LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); - LLLayoutStack* inout_stack = getChild(INBOX_OUTBOX_LAYOUT_STACK_NAME); - LLLayoutPanel* inout_panel = getChild(INBOX_OUTBOX_LAYOUT_PANEL_NAME); - - // Enable user_resize on main inventory panel only when a marketplace box is expanded - inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); - inv_stack->collapsePanel(inout_panel, !expand); - - { - // NOTE: This is an attempt to reshape the inventory panel to the proper size but it doesn't seem to propagate - // properly to the child panels. - - S32 new_height = inout_panel->getRect().getHeight(); - - pressedPanel->reshape(pressedPanel->getRect().getWidth(), new_height); - } - - // Expand/collapse the indicated panel - inout_stack->collapsePanel(pressedPanel, !expand); - - return expand; -} - void LLSidepanelInventory::onToggleInboxBtn() { LLButton* inboxButton = getChild(INBOX_BUTTON_NAME); LLLayoutPanel* inboxPanel = getChild(INBOX_LAYOUT_PANEL_NAME); - - const bool inbox_expanded = manageInboxOutboxPanels(inboxButton, inboxPanel); + LLLayoutStack* inv_stack = getChild(INVENTORY_LAYOUT_STACK_NAME); + + const bool inbox_expanded = inboxButton->getToggleState(); + + // Enable user_resize on main inventory panel only when inbox is expanded + inv_stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, inbox_expanded); + + // Expand/collapse the indicated panel + inv_stack->collapsePanel(inboxPanel, !inbox_expanded); if (inbox_expanded && inboxPanel->isInVisibleChain()) { @@ -735,7 +701,7 @@ void LLSidepanelInventory::clearSelections(bool clearMain, bool clearInbox) updateVerbs(); } -std::set LLSidepanelInventory::getInboxOrOutboxSelectionList() +std::set LLSidepanelInventory::getInboxSelectionList() { std::set inventory_selected_uuids; diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 915db727d6..a33607f50d 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -31,7 +31,7 @@ class LLButton; class LLFolderViewItem; -class LLInboxOutboxAddedObserver; +class LLInboxAddedObserver; class LLInventoryCategoriesObserver; class LLInventoryItem; class LLInventoryPanel; @@ -47,10 +47,10 @@ public: virtual ~LLSidepanelInventory(); private: - void updateInboxOutbox(); + void updateInbox(); public: - void observeInboxOutboxCreation(); + void observeInboxCreation(); void observeInboxModifications(const LLUUID& inboxID); /*virtual*/ BOOL postBuild(); @@ -63,7 +63,7 @@ public: BOOL isMainInventoryPanelActive() const; void clearSelections(bool clearMain, bool clearInbox); - std::set getInboxOrOutboxSelectionList(); + std::set getInboxSelectionList(); void showItemInfoPanel(); void showTaskInfoPanel(); @@ -94,8 +94,6 @@ protected: void onInboxChanged(const LLUUID& inbox_id); - bool manageInboxOutboxPanels(LLButton * pressedButton, LLLayoutPanel * pressedPanel); - // // UI Elements // @@ -127,8 +125,8 @@ private: bool mInboxEnabled; - LLInventoryCategoriesObserver* mCategoriesObserver; - LLInboxOutboxAddedObserver* mInboxOutboxAddedObserver; + LLInventoryCategoriesObserver* mCategoriesObserver; + LLInboxAddedObserver* mInboxAddedObserver; }; #endif //LL_LLSIDEPANELINVENTORY_H diff --git a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml index f0b29f2248..0368601bf4 100644 --- a/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml +++ b/indra/newview/skins/default/xui/en/floater_merchant_outbox.xml @@ -6,7 +6,7 @@ height="440" help_topic="floater_merchant_outbox" min_width="300" - min_height="100" + min_height="200" name="floater_merchant_outbox" save_rect="true" save_visibility="true" @@ -31,8 +31,6 @@ width="313" top="0" bg_opaque_color="InventoryBackgroundColor" - background_visible="true" - background_opaque="true" > - diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index e6c5110999..3007be7d5e 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -1,6 +1,5 @@ - - - + height="235"> Received items ([NUM]) Received items