Merge remote-tracking branch 'lirusaito/master'

This commit is contained in:
Latif Khalifa
2013-04-23 12:57:33 +02:00
11 changed files with 2043 additions and 264 deletions

View File

@@ -86,7 +86,7 @@ public:
if (added_category_type == LLFolderType::FT_OUTBOX)
{
mOutboxFloater->setupOutbox(added_category->getUUID());
mOutboxFloater->initializeMarketPlace();
}
}
}
@@ -152,13 +152,17 @@ BOOL LLFloaterOutbox::postBuild()
//
// Set up the outbox inventory view
//
mOutboxInventoryPanel = getChild<LLInventoryPanel>("panel_outbox_inventory");
llassert(mOutboxInventoryPanel);
mOutboxTopLevelDropZone = getChild<LLPanel>("outbox_generic_drag_target");
LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLFloaterOutbox::onFocusReceived, this));
// Observe category creation to catch outbox creation (moot if already existing)
mCategoryAddedObserver = new LLOutboxAddedObserver(this);
gInventory.addObserver(mCategoryAddedObserver);
return TRUE;
}
@@ -179,34 +183,26 @@ void LLFloaterOutbox::onClose(bool app_quitting)
void LLFloaterOutbox::onOpen()
{
//
// Look for an outbox and set up the inventory API
// Initialize the Market Place or go update the outbox
//
if (mOutboxId.isNull())
if (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED)
{
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);
}
initializeMarketPlace();
}
else
{
setupOutbox();
}
//
// Update the floater view
//
updateView();
//
// Trigger fetch of outbox contents
//
fetchOutboxContents();
}
@@ -223,13 +219,22 @@ void LLFloaterOutbox::fetchOutboxContents()
}
}
void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
void LLFloaterOutbox::setupOutbox()
{
llassert(outboxId.notNull());
llassert(mOutboxId.isNull());
llassert(mCategoriesObserver == NULL);
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;
}
mOutboxId = outboxId;
// 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))
@@ -238,14 +243,19 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
delete mCategoryAddedObserver;
mCategoryAddedObserver = NULL;
}
llassert(!mCategoryAddedObserver);
// Create observer for outbox modifications
mCategoriesObserver = new LLInventoryCategoriesObserver();
gInventory.addObserver(mCategoriesObserver);
if (mCategoriesObserver == NULL)
{
mCategoriesObserver = new LLInventoryCategoriesObserver();
gInventory.addObserver(mCategoriesObserver);
mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this));
}
llassert(mCategoriesObserver);
mCategoriesObserver->addCategory(mOutboxId, boost::bind(&LLFloaterOutbox::onOutboxChanged, this));
llassert(mOutboxInventoryPanel);
// 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();
@@ -255,8 +265,12 @@ void LLFloaterOutbox::setupOutbox(const LLUUID& outboxId)
mOutboxInventoryPanel->setSortOrder(LLInventoryFilter::SO_FOLDERS_BY_NAME);
mOutboxInventoryPanel->getFilter()->markDefault();
// Get the content of the outbox
fetchOutboxContents();
}
void LLFloaterOutbox::initializeMarketPlace()
{
//
// Initialize the marketplace import API
//
@@ -330,6 +344,7 @@ void LLFloaterOutbox::updateView()
{
mOutboxInventoryPanel->setVisible(TRUE);
mInventoryPlaceholder->setVisible(FALSE);
mOutboxTopLevelDropZone->setVisible(TRUE);
}
else
{
@@ -338,13 +353,18 @@ void LLFloaterOutbox::updateView()
mOutboxInventoryPanel->setVisible(FALSE);
}
// Show the drop zone if there is an outbox folder
mOutboxTopLevelDropZone->setVisible(mOutboxId.notNull());
mInventoryPlaceholder->setVisible(TRUE);
std::string outbox_text;
std::string outbox_text2;
std::string outbox_title;
std::string outbox_tooltip;
const LLSD& subs = getMarketplaceStringSubstitutions();
U32 mkt_status = LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus();
// Text styles for marketplace hyperlinks
std::string subs_link;
@@ -352,28 +372,54 @@ void LLFloaterOutbox::updateView()
if (mOutboxId.notNull())
{
// "Outbox is empty!" message strings
outbox_text = LLTrans::getString("InventoryOutboxNoItems");
subs_link = "[MARKETPLACE_DASHBOARD_URL]";
subs_text = " " + LLTrans::getString("InventoryOutboxNoItemsSubs");
outbox_text2 = LLTrans::getString("InventoryOutboxNoItems2");
outbox_title = LLTrans::getString("InventoryOutboxNoItemsTitle");
outbox_tooltip = LLTrans::getString("InventoryOutboxNoItemsTooltip");
}
else
else if (mkt_status <= MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING)
{
// "Initializing!" message strings
outbox_text = LLTrans::getString("InventoryOutboxInitializing");
subs_link = "[MARKETPLACE_CREATE_STORE_URL]";
subs_text = " " + LLTrans::getString("InventoryOutboxInitializingSubs");
outbox_text2 = LLTrans::getString("InventoryOutboxInitializing2");
outbox_title = LLTrans::getString("InventoryOutboxInitializingTitle");
outbox_tooltip = LLTrans::getString("InventoryOutboxInitializingTooltip");
}
else if (mkt_status == MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT)
{
// "Not a merchant!" message strings
outbox_text = LLTrans::getString("InventoryOutboxNotMerchant");
subs_link = "[MARKETPLACE_CREATE_STORE_URL]";
subs_text = " " + LLTrans::getString("InventoryOutboxNotMerchantSubs");
outbox_text2 = LLTrans::getString("InventoryOutboxNotMerchant2");
outbox_title = LLTrans::getString("InventoryOutboxNotMerchantTitle");
outbox_tooltip = LLTrans::getString("InventoryOutboxNotMerchantTooltip");
}
else
{
// "Errors!" message strings
outbox_text = LLTrans::getString("InventoryOutboxError");
subs_link = "[MARKETPLACE_CREATE_STORE_URL]";
subs_text = " " + LLTrans::getString("InventoryOutboxErrorSubs");
outbox_text2 = " " + LLTrans::getString("InventoryOutboxError2");
outbox_title = LLTrans::getString("InventoryOutboxErrorTitle");
outbox_tooltip = LLTrans::getString("InventoryOutboxErrorTooltip");
}
mInventoryText->clear();
mInventoryText->appendColoredText(outbox_text, false, false, gColors.getColor("TextFgReadOnlyColor"));
const LLColor4 color = gColors.getColor("TextFgReadOnlyColor");
mInventoryText->appendColoredText(outbox_text, false, false, color);
LLStringUtil::format(subs_link, subs);
LLStyleSP subs_link_style(new LLStyle);
subs_link_style->setLinkHREF(subs_link);
subs_link_style->setColor(gSavedSettings.getColor4("HTMLLinkColor"));
mInventoryText->appendStyledText(subs_text, false, false, subs_link_style);
mInventoryText->appendColoredText(outbox_text2, false, false, color);
mInventoryTitle->setValue(outbox_title);
mInventoryPlaceholder->getParent()->setToolTip(outbox_tooltip);
}
@@ -498,6 +544,11 @@ void LLFloaterOutbox::importReportResults(U32 status, const LLSD& content)
void LLFloaterOutbox::importStatusChanged(bool inProgress)
{
if (mOutboxId.isNull() && (LLMarketplaceInventoryImporter::getInstance()->getMarketPlaceStatus() == MarketplaceStatusCodes::MARKET_PLACE_MERCHANT))
{
setupOutbox();
}
if (inProgress)
{
if (mImportBusy)
@@ -515,6 +566,7 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
}
else
{
setStatusString("");
mImportBusy = false;
mImportButton->setEnabled(mOutboxItemCount > 0);
mInventoryImportInProgress->setVisible(false);
@@ -525,7 +577,7 @@ void LLFloaterOutbox::importStatusChanged(bool inProgress)
void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content)
{
if (status != MarketplaceErrorCodes::IMPORT_DONE)
if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
{
char status_string[16];
sprintf(status_string, "%d", status);

View File

@@ -55,7 +55,7 @@ public:
LLFloaterOutbox(const LLSD& key);
~LLFloaterOutbox();
void setupOutbox(const LLUUID& outboxId);
void initializeMarketPlace();
// virtuals
BOOL postBuild();
@@ -71,6 +71,7 @@ public:
// void onMouseLeave(S32 x, S32 y, MASK mask);
protected:
void setupOutbox();
void fetchOutboxContents();
void importReportResults(U32 status, const LLSD& content);

View File

@@ -166,20 +166,25 @@ namespace LLMarketplaceImport
llinfos << " SLM POST status: " << status << llendl;
llinfos << " SLM POST reason: " << reason << llendl;
llinfos << " SLM POST content: " << content.asString() << llendl;
llinfos << " SLM POST timer: " << slmPostTimer.getElapsedTimeF32() << llendl;
}
if ((status == MarketplaceErrorCodes::IMPORT_REDIRECT) ||
(status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
(status == MarketplaceErrorCodes::IMPORT_JOB_LOW_SPEED) ||
(status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
// MAINT-2301 : we determined we can safely ignore that error in that context
if (status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT)
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST clearing marketplace cookie due to authentication failure or timeout" << llendl;
llinfos << " SLM POST : Ignoring time out status and treating it as success" << llendl;
}
status = MarketplaceErrorCodes::IMPORT_DONE;
}
if (status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST)
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST clearing marketplace cookie due to client or server error" << llendl;
}
sMarketplaceCookie.clear();
}
@@ -224,21 +229,23 @@ namespace LLMarketplaceImport
llinfos << " SLM GET status: " << status << llendl;
llinfos << " SLM GET reason: " << reason << llendl;
llinfos << " SLM GET content: " << content.asString() << llendl;
llinfos << " SLM GET timer: " << slmGetTimer.getElapsedTimeF32() << llendl;
}
if ((status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR) ||
(status == MarketplaceErrorCodes::IMPORT_JOB_LOW_SPEED) ||
(status == MarketplaceErrorCodes::IMPORT_JOB_TIMEOUT))
// MAINT-2452 : Do not clear the cookie on IMPORT_DONE_WITH_ERRORS
if ((status >= MarketplaceErrorCodes::IMPORT_BAD_REQUEST) &&
(status != MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
{
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET clearing marketplace cookie due to authentication failure or timeout (" << status << " / " << reason << ")." << llendl;
llinfos << " SLM GET clearing marketplace cookie due to client or server error (" << status << " / " << reason << ")." << llendl;
}
sMarketplaceCookie.clear();
}
else if (gSavedSettings.getBOOL("InventoryOutboxLogging") && (status == MarketplaceErrorCodes::IMPORT_DONE_WITH_ERRORS))
{
llinfos << " SLM GET : Got IMPORT_DONE_WITH_ERRORS, marketplace cookie not cleared." << llendl;
}
sImportInProgress = (status == MarketplaceErrorCodes::IMPORT_PROCESSING);
sImportGetPending = false;
@@ -334,7 +341,9 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM GET: " << url << llendl;
llinfos << " SLM GET: pollStatus, LLHTTPClient::get, url = " << url << llendl;
llinfos << " SLM GET: headers " << llendl;
llinfos << headers << llendl;
}
slmGetTimer.start();
@@ -368,7 +377,9 @@ namespace LLMarketplaceImport
if (gSavedSettings.getBOOL("InventoryOutboxLogging"))
{
llinfos << " SLM POST: " << url << llendl;
llinfos << " SLM POST: triggerImport, LLHTTPClient::post, url = " << url << llendl;
llinfos << " SLM POST: headers " << llendl;
llinfos << headers << llendl;
}
slmPostTimer.start();
@@ -404,6 +415,7 @@ LLMarketplaceInventoryImporter::LLMarketplaceInventoryImporter()
: mAutoTriggerImport(false)
, mImportInProgress(false)
, mInitialized(false)
, mMarketPlaceStatus(MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED)
, mErrorInitSignal(NULL)
, mStatusChangedSignal(NULL)
, mStatusReportSignal(NULL)
@@ -446,16 +458,20 @@ void LLMarketplaceInventoryImporter::initialize()
if (!LLMarketplaceImport::hasSessionCookie())
{
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_INITIALIZING;
LLMarketplaceImport::establishMarketplaceSessionCookie();
}
else
{
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT;
}
}
void LLMarketplaceInventoryImporter::reinitializeAndTriggerImport()
{
mInitialized = false;
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_INITIALIZED;
initialize();
mAutoTriggerImport = true;
}
@@ -507,17 +523,30 @@ void LLMarketplaceInventoryImporter::updateImport()
if (mInitialized)
{
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_MERCHANT;
// Follow up with auto trigger of import
if (mAutoTriggerImport)
{
mAutoTriggerImport = false;
mImportInProgress = triggerImport();
}
}
else if (mErrorInitSignal)
else
{
(*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
U32 status = LLMarketplaceImport::getResultStatus();
if ((status == MarketplaceErrorCodes::IMPORT_FORBIDDEN) ||
(status == MarketplaceErrorCodes::IMPORT_AUTHENTICATION_ERROR))
{
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_NOT_MERCHANT;
}
else
{
mMarketPlaceStatus = MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE;
}
if (mErrorInitSignal && (mMarketPlaceStatus == MarketplaceStatusCodes::MARKET_PLACE_CONNECTION_FAILURE))
{
(*mErrorInitSignal)(LLMarketplaceImport::getResultStatus(), LLMarketplaceImport::getResults());
}
}
}
}

View File

@@ -48,11 +48,28 @@ namespace MarketplaceErrorCodes
IMPORT_DONE = HTTP_OK,
IMPORT_PROCESSING = HTTP_ACCEPTED,
IMPORT_REDIRECT = HTTP_FOUND,
IMPORT_BAD_REQUEST = HTTP_BAD_REQUEST,
IMPORT_AUTHENTICATION_ERROR = HTTP_UNAUTHORIZED,
IMPORT_FORBIDDEN = HTTP_FORBIDDEN,
IMPORT_NOT_FOUND = HTTP_NOT_FOUND,
IMPORT_DONE_WITH_ERRORS = HTTP_CONFLICT,
IMPORT_JOB_FAILED = HTTP_GONE,
IMPORT_JOB_LOW_SPEED = HTTP_INTERNAL_ERROR_LOW_SPEED,
IMPORT_JOB_TIMEOUT = HTTP_INTERNAL_ERROR_CURL_TIMEOUT
IMPORT_JOB_TIMEOUT = HTTP_INTERNAL_ERROR_CURL_TIMEOUT,
IMPORT_SERVER_SITE_DOWN = HTTP_INTERNAL_SERVER_ERROR,
IMPORT_SERVER_API_DISABLED = HTTP_SERVICE_UNAVAILABLE,
};
}
namespace MarketplaceStatusCodes
{
enum sCode
{
MARKET_PLACE_NOT_INITIALIZED = 0,
MARKET_PLACE_INITIALIZING = 1,
MARKET_PLACE_CONNECTION_FAILURE = 2,
MARKET_PLACE_MERCHANT = 3,
MARKET_PLACE_NOT_MERCHANT = 4,
};
}
@@ -75,6 +92,7 @@ public:
void initialize();
bool triggerImport();
bool isImportInProgress() const { return mImportInProgress; }
U32 getMarketPlaceStatus() const { return mMarketPlaceStatus; }
protected:
void reinitializeAndTriggerImport();
@@ -84,6 +102,7 @@ private:
bool mAutoTriggerImport;
bool mImportInProgress;
bool mInitialized;
U32 mMarketPlaceStatus;
status_report_signal_t * mErrorInitSignal;
status_changed_signal_t * mStatusChangedSignal;

View File

@@ -3,10 +3,9 @@
* @brief Message popup preferences panel
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -34,36 +33,30 @@
#include "llpanelmsgs.h"
#include "llnotificationsutil.h"
#include "llscrolllistctrl.h"
#include "llviewerwindow.h"
#include "llviewercontrol.h"
#include "lluictrlfactory.h"
#include "llfirstuse.h"
#include "llnotificationtemplate.h"
//-----------------------------------------------------------------------------
LLPanelMsgs::LLPanelMsgs() :
LLPanel("Messages Panel")
LLPanelMsgs::LLPanelMsgs()
{
LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_popups.xml");
}
LLPanelMsgs::~LLPanelMsgs()
{ }
{
}
//-----------------------------------------------------------------------------
// postBuild()
//-----------------------------------------------------------------------------
BOOL LLPanelMsgs::postBuild()
{
childSetAction("enable_popup", onClickEnablePopup, this);
childSetAction("reset_dialogs_btn", onClickResetDialogs, this);
childSetAction("skip_dialogs_btn", onClickSkipDialogs, this);
childSetAction("skip_frst_btn", onClickSkipFirstTime, this);
getChild<LLUICtrl>("enable_popup")->setCommitCallback(boost::bind(&LLPanelMsgs::onClickEnablePopup, this));
getChild<LLUICtrl>("disable_popup")->setCommitCallback(boost::bind(&LLPanelMsgs::onClickDisablePopup, this));
getChild<LLUICtrl>("reset_dialogs_btn")->setCommitCallback(boost::bind(&LLPanelMsgs::onClickResetDialogs, this));
getChild<LLUICtrl>("skip_dialogs_btn")->setCommitCallback(boost::bind(&LLPanelMsgs::onClickSkipDialogs, this));
getChild<LLUICtrl>("skip_frst_btn")->setCommitCallback(boost::bind(&LLPanelMsgs::onClickSkipFirstTime, this));
buildLists();
buildPopupLists();
childSetValue("accept_new_inventory", gSavedSettings.getBOOL("AutoAcceptNewInventory"));
childSetValue("show_new_inventory", gSavedSettings.getBOOL("ShowNewInventory"));
@@ -72,8 +65,18 @@ BOOL LLPanelMsgs::postBuild()
return TRUE;
}
void LLPanelMsgs::draw()
{
BOOL has_first_selected = (getChildRef<LLScrollListCtrl>("disabled_popups").getFirstSelected()!=NULL);
childSetEnabled("enable_popup", has_first_selected);
void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in v3
has_first_selected = (getChildRef<LLScrollListCtrl>("enabled_popups").getFirstSelected()!=NULL);
childSetEnabled("disable_popup", has_first_selected);
LLPanel::draw();
}
void LLPanelMsgs::buildPopupLists() //void LLFloaterPreference::buildPopupLists() in v3
{
LLScrollListCtrl& disabled_popups =
getChildRef<LLScrollListCtrl>("disabled_popups");
@@ -103,7 +106,7 @@ void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in
LLStringUtil::format(ignore_msg,notification->getSubstitutions());
row["columns"][0]["value"] = ignore_msg;
row["columns"][0]["font"] = "SANSSERIF_SMALL";
row["columns"][0]["width"] = 300;
row["columns"][0]["width"] = 500;
LLScrollListItem* item = NULL;
@@ -129,13 +132,11 @@ void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in
row["columns"][1]["font"] = "SANSSERIF_SMALL";
row["columns"][1]["width"] = 160;
}
item = disabled_popups.addElement(row,
ADD_SORTED);
item = disabled_popups.addElement(row, ADD_SORTED);
}
else
{
item = enabled_popups.addElement(row,
ADD_SORTED);
item = enabled_popups.addElement(row, ADD_SORTED);
}
if (item)
@@ -145,22 +146,6 @@ void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in
}
}
void LLPanelMsgs::draw()
{
LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups");
if (disabled_popups.getFirstSelected())
{
childEnable("enable_popup");
}
else
{
childDisable("enable_popup");
}
LLPanel::draw();
}
void LLPanelMsgs::apply()
{
@@ -173,6 +158,36 @@ void LLPanelMsgs::cancel()
{
}
void LLPanelMsgs::onClickEnablePopup()
{
LLScrollListCtrl& disabled_popups = getChildRef<LLScrollListCtrl>("disabled_popups");
std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
LLNotificationTemplatePtr templatep = LLNotificationTemplates::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
gSavedSettings.setWarning(templatep->mName, TRUE);
}
buildPopupLists();
}
void LLPanelMsgs::onClickDisablePopup()
{
LLScrollListCtrl& enabled_popups = getChildRef<LLScrollListCtrl>("enabled_popups");
std::vector<LLScrollListItem*> items = enabled_popups.getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
LLNotificationTemplatePtr templatep = LLNotificationTemplates::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
gSavedSettings.setWarning(templatep->mName, false);
}
buildPopupLists();
}
void LLPanelMsgs::resetAllIgnored()
{
for (LLNotificationTemplates::TemplateMap::const_iterator iter = LLNotificationTemplates::instance().templatesBegin();
@@ -199,70 +214,22 @@ void LLPanelMsgs::setAllIgnored()
}
}
//static
void LLPanelMsgs::onClickEnablePopup(void* user_data)
void LLPanelMsgs::onClickResetDialogs()
{
LLPanelMsgs* panelp = (LLPanelMsgs*)user_data;
LLScrollListCtrl& disabled_popups = panelp->getChildRef<LLScrollListCtrl>("disabled_popups");
std::vector<LLScrollListItem*> items = disabled_popups.getAllSelected();
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
LLNotificationTemplatePtr templatep = LLNotificationTemplates::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
gSavedSettings.setWarning(templatep->mName, TRUE);
}
panelp->buildLists();
resetAllIgnored();
LLFirstUse::resetFirstUse();
buildPopupLists();
}
bool callback_reset_dialogs(const LLSD& notification, const LLSD& response, LLPanelMsgs* panelp)
void LLPanelMsgs::onClickSkipDialogs()
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (0 == option)
{
if ( panelp )
{
panelp->resetAllIgnored();
LLFirstUse::resetFirstUse();
panelp->buildLists();
}
}
return false;
setAllIgnored();
LLFirstUse::disableFirstUse();
buildPopupLists();
}
// static
void LLPanelMsgs::onClickResetDialogs(void* user_data)
{
LLNotificationsUtil::add("ResetShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_reset_dialogs, _1, _2, (LLPanelMsgs*)user_data));
}
bool callback_skip_dialogs(const LLSD& notification, const LLSD& response, LLPanelMsgs* panelp)
{
S32 option = LLNotification::getSelectedOption(notification, response);
if (0 == option)
{
if ( panelp )
{
panelp->setAllIgnored();
LLFirstUse::disableFirstUse();
panelp->buildLists();
}
}
return false;
}
// static
void LLPanelMsgs::onClickSkipDialogs(void* user_data)
{
LLNotificationsUtil::add("SkipShowNextTimeDialogs", LLSD(), LLSD(), boost::bind(&callback_skip_dialogs, _1, _2, (LLPanelMsgs*)user_data));
}
// static
void LLPanelMsgs::onClickSkipFirstTime(void* user_data)
void LLPanelMsgs::onClickSkipFirstTime()
{
LLFirstUse::disableFirstUse();
LLPanelMsgs* panelp = (LLPanelMsgs*)user_data;
if(panelp) panelp->buildLists();
buildPopupLists();
}

View File

@@ -3,10 +3,9 @@
* @brief Message popup preferences panel
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Second Life Viewer Source Code
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
@@ -35,29 +34,26 @@
#include "llpanel.h"
class LLScrollListCtrl;
class LLPanelMsgs : public LLPanel
{
public:
LLPanelMsgs();
/*virtual*/ ~LLPanelMsgs();
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
void apply();
void cancel();
/*virtual*/ void draw();
/*virtual*/ BOOL postBuild();
static void onClickEnablePopup(void* user_data);
static void onClickResetDialogs(void* user_data);
static void onClickSkipDialogs(void* user_data);
static void onClickSkipFirstTime(void* user_data);
void buildLists();
void onClickEnablePopup();
void onClickDisablePopup();
void resetAllIgnored();
void setAllIgnored();
void onClickResetDialogs();
void onClickSkipDialogs();
void onClickSkipFirstTime();
void buildPopupLists();
};
#endif // LL_PANEL_MSGS

View File

@@ -162,6 +162,7 @@ extern bool gShiftFrame;
// function prototypes
bool check_offer_throttle(const std::string& from_name, bool check_only);
bool check_asset_previewable(const LLAssetType::EType asset_type);
void callbackCacheEstateOwnerName(const LLUUID& id, const LLAvatarName& av_name);
static void process_money_balance_reply_extended(LLMessageSystem* msg);
@@ -1147,46 +1148,78 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
}
}
void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
// Return "true" if we have a preview method for that asset type, "false" otherwise
bool check_asset_previewable(const LLAssetType::EType asset_type)
{
uuid_vec_t::const_iterator it = items.begin();
uuid_vec_t::const_iterator end = items.end();
LLInventoryItem* item;
for(; it != end; ++it)
{
item = gInventory.getItem(*it);
if(!item)
{
LL_WARNS("Messaging") << "Unable to show inventory item: " << *it << LL_ENDL;
continue;
}
if(!highlight_offered_object(item->getUUID()))
{
continue;
}
LLAssetType::EType asset_type = item->getType();
return (asset_type == LLAssetType::AT_NOTECARD) ||
(asset_type == LLAssetType::AT_LANDMARK) ||
(asset_type == LLAssetType::AT_TEXTURE) ||
(asset_type == LLAssetType::AT_ANIMATION) ||
(asset_type == LLAssetType::AT_SCRIPT) ||
(asset_type == LLAssetType::AT_SOUND);
}
//if we are throttled, don't display them
if (check_offer_throttle(from_name, false))
void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_name)
{
for (uuid_vec_t::const_iterator obj_iter = objects.begin();
obj_iter != objects.end();
++obj_iter)
{
const LLUUID& obj_id = (*obj_iter);
if(!highlight_offered_object(obj_id))
{
// I'm not sure this is a good idea - Definitely a bad idea. HB
//bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
bool show_keep_discard = true;
switch(asset_type)
continue;
}
const LLInventoryObject *obj = gInventory.getObject(obj_id);
if (!obj)
{
llwarns << "Cannot find object [ itemID:" << obj_id << " ] to open." << llendl;
continue;
}
const LLAssetType::EType asset_type = obj->getActualType();
// Either an inventory item or a category.
const LLInventoryItem* item = dynamic_cast<const LLInventoryItem*>(obj);
if (item && check_asset_previewable(asset_type))
{
////////////////////////////////////////////////////////////////////////////////
// Special handling for various types.
if (check_offer_throttle(from_name, false)) // If we are throttled, don't display
{
case LLAssetType::AT_NOTECARD:
open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
break;
case LLAssetType::AT_LANDMARK:
open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
break;
case LLAssetType::AT_TEXTURE:
open_texture(*it, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
break;
default:
break;
// I'm not sure this is a good idea - Definitely a bad idea. HB
//bool show_keep_discard = item->getPermissions().getCreator() != gAgent.getID();
bool show_keep_discard = true;
switch(asset_type)
{
case LLAssetType::AT_NOTECARD:
{
open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, show_keep_discard, LLUUID::null, FALSE);
break;
}
case LLAssetType::AT_LANDMARK:
{
open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
}
break;
case LLAssetType::AT_TEXTURE:
{
open_texture(obj_id, std::string("Texture: ") + item->getName(), show_keep_discard, LLUUID::null, FALSE);
break;
}
case LLAssetType::AT_ANIMATION:
case LLAssetType::AT_SCRIPT:
case LLAssetType::AT_SOUND:
LLInvFVBridgeAction::doAction(asset_type, obj_id, &gInventory);
break;
default:
LL_DEBUGS("Messaging") << "No preview method for previewable asset type : " << LLAssetType::lookupHumanReadable(asset_type) << LL_ENDL;
break;
}
}
}
//highlight item, if it's not in the trash or lost+found
// Don't auto-open the inventory floater
@@ -1196,42 +1229,28 @@ void open_inventory_offer(const uuid_vec_t& items, const std::string& from_name)
return;
}
if(gSavedSettings.getBOOL("ShowInInventory") &&
//Trash Check
if ((gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH)))
// don't select lost and found items if the user is active
|| (gAwayTimer.getStarted() && gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND))))
{
return;
}
if (gSavedSettings.getBOOL("ShowInInventory") &&
asset_type != LLAssetType::AT_CALLINGCARD &&
item->getInventoryType() != LLInventoryType::IT_ATTACHMENT &&
!from_name.empty())
{
LLInventoryView::showAgentInventory(TRUE);
}
//Trash Check
LLUUID trash_id;
trash_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_TRASH);
if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id))
{
return;
}
LLUUID lost_and_found_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_LOST_AND_FOUND);
//BOOL inventory_has_focus = gFocusMgr.childHasKeyboardFocus(view);
BOOL user_is_away = gAwayTimer.getStarted();
// don't select lost and found items if the user is active
if (gInventory.isObjectDescendentOf(item->getUUID(), lost_and_found_id)
&& !user_is_away)
{
return;
}
////////////////////////////////////////////////////////////////////////////////
// Highlight item
//Not sure about this check. Could make it easy to miss incoming items.
//don't dick with highlight while the user is working
//if(inventory_has_focus && !user_is_away)
// break;
LL_DEBUGS("Messaging") << "Highlighting" << item->getUUID() << LL_ENDL;
LL_DEBUGS("Messaging") << "Highlighting" << obj_id << LL_ENDL;
LLFocusableElement* focus_ctrl = gFocusMgr.getKeyboardFocus();
view->getPanel()->setSelection(item->getUUID(), TAKE_FOCUS_NO);
view->getPanel()->setSelection(obj_id, TAKE_FOCUS_NO);
gFocusMgr.setKeyboardFocus(focus_ctrl);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<panel border="true" bottom="0" height="500" label="Popups" left="0" name="popups" title="Popups" width="400">
<text bottom="-20" follows="top" left="15" name="dont_show_label">Do not show these popups:</text>
<scroll_list follows="top" height="88" name="disabled_popups" width="480"/>
<button follows="top" height="20" label="Enable this popup" name="enable_popup" width="175"/>
<button follows="top" height="20" label="Enable all popups..." left="200" name="reset_dialogs_btn" tool_tip="Enable all of the optional popups and &apos;first time use&apos; notifications." width="175" bottom_delta="0"/>
<text follows="top" left="15" name="show_label" bottom_delta="-24">Show these popups:</text>
<scroll_list follows="top" height="88" left="15" name="enabled_popups" width="480"/>
<button follows="top" height="20" label="Disable first time popups..." name="skip_frst_btn" tool_tip="Disable all of the first time use notifications." width="175"/>
<button bottom_delta="0" follows="top" height="20" label="Disable all these popups..." left="200" name="skip_dialogs_btn" tool_tip="Disable all of the optional popups and &apos;first time use&apos; notifications." width="175"/>
<text bottom_delta="-24" follows="top" height="10" left="15" name="text_box2">Offers of notecards, textures and landmarks:</text>
<check_box bottom_delta="-25" follows="top" height="16" initial_value="false" label="Automatically accept" left="40" name="accept_new_inventory"/>
<check_box bottom_delta="-20" follows="top" height="16" initial_value="true" label="Automatically view after accepting" name="show_new_inventory"/>
<check_box bottom_delta="-20" follows="top" height="16" initial_value="true" label="Automatically show newly accepted objects in inventory" left="18" name="show_in_inventory"/>
<check_box bottom="-22" left="16" follows="top" height="16" label="Automatically accept item offers" name="accept_new_inventory"/>
<check_box bottom_delta="0" left_delta="250" follows="top" height="16" label="View previewable items after accepting" name="show_new_inventory"/>
<check_box bottom_delta="-20" left="16" follows="top" height="16" label="Show newly accepted objects in inventory" name="show_in_inventory"/>
<text bottom_delta="-12" follows="top" left="15" name="show_label">Always show:</text>
<scroll_list follows="top" multi_select="true" height="169" name="enabled_popups" width="480"/>
<button follows="top" height="20" label="Enable all" left="25" name="reset_dialogs_btn" tool_tip="Enable all of the optional popups and 'first time use' notifications." width="100"/>
<button follows="top" height="20" label="" image_overlay="arrow_up.tga" left_delta="105" name="enable_popup" width="30" bottom_delta="0"/>
<button follows="top" height="20" label="Disable first time popups..." left_delta="35" name="skip_frst_btn" tool_tip="Disable all of the first time use notifications." width="175" bottom_delta="0"/>
<button follows="top" height="20" label="" image_overlay="arrow_down.tga" left_delta="180" name="disable_popup" width="30" bottom_delta="0"/>
<button bottom_delta="0" follows="top" height="20" label="Disable all" left_delta="35" name="skip_dialogs_btn" tool_tip="Disable all of the optional popups and 'first time use' notifications." width="100"/>
<text follows="top" left="15" name="dont_show_label" bottom_delta="-12">Never show:</text>
<scroll_list follows="top" multi_select="true" height="169" left="15" name="disabled_popups" width="480"/>
</panel>

View File

@@ -3010,13 +3010,29 @@ Where tag = tag string to match. Removes bot's matching the tag.
<string name="InventoryOutboxNotMerchant">
If you'd like to become a merchant, you'll need to
</string>
<string name="InventoryOutboxNotMerchantSubs">create a Marketplace store.</string>
<string name="InventoryOutboxNotMerchantSubs">create a Marketplace store</string>
<string name="InventoryOutboxNotMerchant2">.</string>
<string name="InventoryOutboxNoItemsTitle">Your outbox is empty.</string>
<string name="InventoryOutboxNoItemsTooltip"></string>
<string name="InventoryOutboxNoItems">
Drag folders to this area and click "Send to Marketplace" to list them for sale on the
</string>
<string name="InventoryOutboxNoItemsSubs">Marketplace.</string>
<string name="InventoryOutboxNoItemsSubs">Marketplace</string>
<string name="InventoryOutboxNoItems2">.</string>
<string name="InventoryOutboxInitializingTitle">Initializing Marketplace.</string>
<string name="InventoryOutboxInitializingTooltip"></string>
<string name="InventoryOutboxInitializing">
We are accessing your account on the
</string>
<string name="InventoryOutboxInitializingSubs">Marketplace store</string>
<string name="InventoryOutboxInitializing2">.</string>
<string name="InventoryOutboxErrorTitle">Marketplace Errors.</string>
<string name="InventoryOutboxErrorTooltip"></string>
<string name="InventoryOutboxError">
The
</string>
<string name="InventoryOutboxErrorSubs">Marketplace store</string>
<string name="InventoryOutboxError2">is returning errors.</string>
<!-- use value="" because they have preceding spaces -->
<string name="no_transfer" value=" (no transfer)" />

View File

@@ -5,7 +5,7 @@ usage() {
echo "Usage: repackage PLATFORM FILEIN.tar.bz2 [FILEOUT.tar.bz2]
Repackage an archive from llautobuild format into singularity format
PLATTFORM can be one of windows, linux, mac.
PLATTFORM can be one of windows, linux, linux64, mac.
"
exit 0
}