summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2018-12-21 15:31:37 -0800
committerRider Linden <rider@lindenlab.com>2018-12-21 15:31:37 -0800
commitfb093ce412697a281756dcbbe5451d681f113aa7 (patch)
tree380f0b855c628bf1740110235fda96e6fde72039
parent8227a0b270f6e7cc521adeb7b97ad2d5fb646973 (diff)
parent91952ec0a5343cd60f09e8bd5779fd0d49d0a886 (diff)
Merge
-rw-r--r--indra/newview/llinventorypanel.cpp28
-rw-r--r--indra/newview/llinventorypanel.h3
-rw-r--r--indra/newview/llsettingspicker.cpp19
-rw-r--r--indra/newview/llsettingspicker.h1
-rw-r--r--indra/newview/llsettingsvo.cpp21
5 files changed, 47 insertions, 25 deletions
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 7fea502c0f..5f244ec6a2 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -152,6 +152,7 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mShowItemLinkOverlays(p.show_item_link_overlays),
mShowEmptyMessage(p.show_empty_message),
mSuppressFolderMenu(p.suppress_folder_menu),
+ mSuppressOpenItemAction(false),
mViewsInitialized(false),
mInvFVBridgeBuilder(NULL),
mInventoryViewModel(p.name),
@@ -1658,21 +1659,18 @@ BOOL LLInventoryPanel::handleKeyHere( KEY key, MASK mask )
// Open selected items if enter key hit on the inventory panel
if (mask == MASK_NONE)
{
-
-// @TODO$: Rider: This code is dead with Outbox, however should something similar be
-// done for VMM?
-//
-// //Don't allow attaching or opening items from Merchant Outbox
-// LLFolderViewItem* folder_item = mFolderRoot.get()->getCurSelectedItem();
-// if(folder_item)
-// {
-// LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
-// if(bridge && bridge->is() && (bridge->getInventoryType() != LLInventoryType::IT_CATEGORY))
-// {
-// return handled;
-// }
-// }
-
+ if (mSuppressOpenItemAction)
+ {
+ LLFolderViewItem* folder_item = mFolderRoot.get()->getCurSelectedItem();
+ if(folder_item)
+ {
+ LLInvFVBridge* bridge = (LLInvFVBridge*)folder_item->getViewModelItem();
+ if(bridge && (bridge->getInventoryType() != LLInventoryType::IT_CATEGORY))
+ {
+ return handled;
+ }
+ }
+ }
LLInventoryAction::doToSelected(mInventory, mFolderRoot.get(), "open");
handled = TRUE;
}
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index 97e1c37a31..b2a60543af 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -243,6 +243,8 @@ public:
void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
void updateSelection();
+ void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; }
+
LLFolderViewModelInventory* getFolderViewModel() { return &mInventoryViewModel; }
const LLFolderViewModelInventory* getFolderViewModel() const { return &mInventoryViewModel; }
@@ -264,6 +266,7 @@ protected:
bool mShowItemLinkOverlays; // Shows link graphic over inventory item icons
bool mShowEmptyMessage;
bool mSuppressFolderMenu;
+ bool mSuppressOpenItemAction;
LLHandle<LLFolderView> mFolderRoot;
LLScrollContainer* mScroller;
diff --git a/indra/newview/llsettingspicker.cpp b/indra/newview/llsettingspicker.cpp
index b82be3a23e..d115f6fa4f 100644
--- a/indra/newview/llsettingspicker.cpp
+++ b/indra/newview/llsettingspicker.cpp
@@ -105,6 +105,7 @@ BOOL LLFloaterSettingsPicker::postBuild()
mInventoryPanel->setSelectCallback([this](const LLFloaterSettingsPicker::itemlist_t &items, bool useraction){ onSelectionChange(items, useraction); });
mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS);
+ mInventoryPanel->setSuppressOpenItemAction(true);
// Disable auto selecting first filtered item because it takes away
// selection from the item set by LLTextureCtrl owning this floater.
@@ -336,6 +337,24 @@ BOOL LLFloaterSettingsPicker::handleDoubleClick(S32 x, S32 y, MASK mask)
return result;
}
+BOOL LLFloaterSettingsPicker::handleKeyHere(KEY key, MASK mask)
+{
+ if ((key == KEY_RETURN) && (mask == MASK_NONE))
+ {
+ LLFolderViewItem* item_viewp = mInventoryPanel->getItemByID(mSettingItemID);
+ if (item_viewp && item_viewp->getIsCurSelection())
+ {
+ // Quick-apply
+ if (mCommitSignal)
+ (*mCommitSignal)(this, LLSD(mSettingItemID));
+ closeFloater();
+ return TRUE;
+ }
+ }
+
+ return LLFloater::handleKeyHere(key, mask);
+}
+
//=========================================================================
void LLFloaterSettingsPicker::setActive(bool active)
{
diff --git a/indra/newview/llsettingspicker.h b/indra/newview/llsettingspicker.h
index 434eb04c61..5acc562fe5 100644
--- a/indra/newview/llsettingspicker.h
+++ b/indra/newview/llsettingspicker.h
@@ -94,6 +94,7 @@ private:
void onButtonCancel();
void onButtonSelect();
virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask) override;
+ BOOL handleKeyHere(KEY key, MASK mask) override;
LLHandle<LLView> mOwnerHandle;
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 0def17b32d..6b1a0a2b77 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -154,23 +154,24 @@ void LLSettingsVOBase::createInventoryItem(const LLSettingsBase::ptr_t &settings
void LLSettingsVOBase::onInventoryItemCreated(const LLUUID &inventoryId, LLSettingsBase::ptr_t settings, inventory_result_fn callback)
{
+ LLViewerInventoryItem *pitem = gInventory.getItem(inventoryId);
+ if (pitem)
+ {
+ LLPermissions perm = pitem->getPermissions();
+ if (perm.getMaskEveryone() != PERM_COPY)
+ {
+ perm.setMaskEveryone(PERM_COPY);
+ pitem->setPermissions(perm);
+ pitem->updateServer(FALSE);
+ }
+ }
if (!settings)
{ // The item was created as new with no settings passed in. Simulator should have given it the default for the type... check ID,
// no need to upload asset.
LLUUID asset_id;
- LLViewerInventoryItem *pitem = gInventory.getItem(inventoryId);
-
if (pitem)
{
asset_id = pitem->getAssetUUID();
-
- LLPermissions perm = pitem->getPermissions();
- if (perm.getMaskEveryone() != PERM_COPY)
- {
- perm.setMaskEveryone(PERM_COPY);
- pitem->setPermissions(perm);
- pitem->updateServer(FALSE);
- }
}
if (callback)
callback(asset_id, inventoryId, LLUUID::null, LLSD());