Beispiel #1
0
void LLFloaterOutbox::onOpen()
{
	//
	// Initialize the Market Place or go update the outbox
	//

	if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED)
	{
		initializeMarketPlace();
	}
	else
	{
		setupOutbox();
	}

	//
	// Update the floater view
	//
	updateView();

	//
	// Trigger fetch of outbox contents
	//
	fetchOutboxContents();
}
Beispiel #2
0
void LLFloaterOutbox::onOutboxChanged()
{
	LLViewerInventoryCategory* category = gInventory.getCategory(mOutboxId);
	if (mOutboxId.notNull() && category)
	{
		fetchOutboxContents();
		updateView();
	}
	else
	{
		cleanOutbox();
	}
}
void LLFloaterOutbox::onOutboxChanged()
{
    llassert(!mOutboxId.isNull());

    if (mOutboxInventoryPanel)
    {
        mOutboxInventoryPanel->requestSort();
    }

    fetchOutboxContents();

    updateView();
}
void LLFloaterOutbox::setupOutbox()
{
    if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)
    {
        // If we are *not* a merchant or we have no market place connection established yet, do nothing
        return;
    }

    // We are a merchant. Get the outbox, create it if needs be.
    mOutboxId = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, true, false);
    if (mOutboxId.isNull())
    {
        // We should never get there unles inventory fails badly
        llerrs << "Inventory problem: failure to create the outbox for a merchant!" << llendl;
        return;
    }

    // No longer need to observe new category creation
    if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
    {
        gInventory.removeObserver(mCategoryAddedObserver);
        delete mCategoryAddedObserver;
        mCategoryAddedObserver = NULL;
    }
    llassert(!mCategoryAddedObserver);

    // Create observer for outbox modifications
    if (mCategoriesObserver == NULL)
    {
        mCategoriesObserver = new LLInventoryCategoriesObserver();
        gInventory.addObserver(mCategoriesObserver);
        mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this));
    }
    llassert(mCategoriesObserver);

    // Set up the outbox inventory view
    // Singu Note: we handle this in postBuild, grabbing the panel from the built xml.

    // Reshape the inventory to the proper size
    LLRect inventory_placeholder_rect = mInventoryPlaceholder->getRect();
    mOutboxInventoryPanel->setShape(inventory_placeholder_rect);

    // Set the sort order newest to oldest
    mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME);
    mOutboxInventoryPanel->getFilter()->markDefault();

    // Get the content of the outbox
    fetchOutboxContents();
}
Beispiel #5
0
void LLFloaterOutbox::setupOutbox()
{
	if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() != MarketplaceStatusCodes::MARKET_PLACE_MERCHANT)
	{
		// If we are *not* a merchant or we have no market place connection established yet, do nothing
		return;
	}

	// We are a merchant. Get the outbox, create it if needs be.
	LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, true);
	if (outbox_id.isNull())
	{
		// We should never get there unless inventory fails badly
		LL_ERRS() << "Inventory problem: failure to create the outbox for a merchant!" << LL_ENDL;
		return;
	}

	// Consolidate Merchant Outbox
	// We shouldn't have to do that but with a client/server system relying on a "well known folder" convention, things get messy and conventions get broken down eventually
	gInventory.consolidateForType(outbox_id, LLFolderType::FT_OUTBOX);

	if (outbox_id == mOutboxId)
	{

		LL_WARNS() << "Inventory warning: Merchant outbox already set" << LL_ENDL;
		return;
	}
	mOutboxId = outbox_id;

	// No longer need to observe new category creation
	if (mCategoryAddedObserver && gInventory.containsObserver(mCategoryAddedObserver))
	{
		gInventory.removeObserver(mCategoryAddedObserver);
		delete mCategoryAddedObserver;
		mCategoryAddedObserver = NULL;
	}
	llassert(!mCategoryAddedObserver);

	// Create observer for outbox modifications : clear the old one and create a new one
	if (mCategoriesObserver && gInventory.containsObserver(mCategoriesObserver))
	{
		gInventory.removeObserver(mCategoriesObserver);
		delete mCategoriesObserver;
	}
	mCategoriesObserver = new LLInventoryCategoriesObserver();
	gInventory.addObserver(mCategoriesObserver);
	mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this));
	llassert(mCategoriesObserver);

	// Set up the outbox inventory view
	// Singu Note: we handle this in postBuild, grabbing the panel from the built xml.
	LLInventoryPanel* inventory_panel = mOutboxInventoryPanel.get();

	// Reshape the inventory to the proper size
	LLRect inventory_placeholder_rect = mInventoryPlaceholder->getRect();
	inventory_panel->setShape(inventory_placeholder_rect);

	// Set the sort order newest to oldest
	inventory_panel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME);
	inventory_panel->getFilter()->markDefault();

	// Get the content of the outbox
	fetchOutboxContents();
}
Beispiel #6
0
void LLFloaterOutbox::onFocusReceived()
{
	fetchOutboxContents();
}