diff options
author | Leslie Linden <leslie@lindenlab.com> | 2011-09-16 11:46:37 -0700 |
---|---|---|
committer | Leslie Linden <leslie@lindenlab.com> | 2011-09-16 11:46:37 -0700 |
commit | 5af39ea28be1a76ec0c3042a0bf34e7d64835c18 (patch) | |
tree | db55a3bfb7d93477b414ab295c13f3878b31f394 /indra/newview/llpanelmarketplaceoutbox.cpp | |
parent | 10d92237adca8bffc82c887dbd37b988602b2d59 (diff) |
EXP-1169 FIX -- No synch error icon given on Outbox on Agni where API does not exist
* Moved marketplace URL related functions into a new file llmarketplacefunctions.cpp/h.
This will the future home of more marketplace-related functions.
* Disabled sync button when the marketplace API is unavailable.
Diffstat (limited to 'indra/newview/llpanelmarketplaceoutbox.cpp')
-rw-r--r-- | indra/newview/llpanelmarketplaceoutbox.cpp | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 73fb92ff72..2764527c44 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -35,6 +35,7 @@ #include "lleventcoro.h" #include "llinventorypanel.h" #include "llloadingindicator.h" +#include "llmarketplacefunctions.h" #include "llnotificationsutil.h" #include "llpanelmarketplaceinbox.h" #include "llsdutil.h" @@ -82,7 +83,7 @@ void LLPanelMarketplaceOutbox::handleLoginComplete() { mSyncButton = getChild<LLButton>("outbox_sync_btn"); mSyncButton->setCommitCallback(boost::bind(&LLPanelMarketplaceOutbox::onSyncButtonClicked, this)); - mSyncButton->setEnabled(!isOutboxEmpty()); + mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty()); mSyncIndicator = getChild<LLLoadingIndicator>("outbox_sync_indicator"); } @@ -223,20 +224,7 @@ void LLPanelMarketplaceOutbox::onSyncButtonClicked() updateSyncButtonStatus(); // Make the url for the inventory import request - 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()); - - // TEMP for Jim's pdp - //url = "http://pdp24.lindenlab.com:3000/"; - } - - url += "api/1/users/"; - url += gAgent.getID().getString(); - url += "/inventory_import"; + std::string url = getMarketplaceURL_InventoryImport(); llinfos << "http get: " << url << llendl; LLHTTPClient::get(url, new LLInventorySyncResponder(this), LLViewerMedia::getHeaders()); @@ -311,7 +299,7 @@ void LLPanelMarketplaceOutbox::updateSyncButtonStatus() mSyncIndicator->setVisible(false); mSyncButton->setVisible(true); - mSyncButton->setEnabled(!isOutboxEmpty()); + mSyncButton->setEnabled(getMarketplaceSyncEnabled() && !isOutboxEmpty()); } } @@ -352,7 +340,7 @@ void LLPanelMarketplaceOutbox::draw() if (!isSyncInProgress()) { - mSyncButton->setEnabled(not_empty); + mSyncButton->setEnabled(getMarketplaceSyncEnabled() && not_empty); } LLPanel::draw(); |