summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-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
4 files changed, 36 insertions, 15 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;