Merge branch 'DRTVWR-518-ui' of https://bitbucket.org/lindenlab/viewer (and undo "Find/Show Original" opening a new inventory window)

master
Ansariel 2020-11-12 20:04:54 +01:00
commit c7fa67a466
12 changed files with 178 additions and 56 deletions

View File

@ -51,6 +51,9 @@
#include "llgroupactions.h"
const std::string LINDEN_HOMES_SKU = "131";
bool LLFloaterLandHoldings::sHasLindenHome = false;
// protected
LLFloaterLandHoldings::LLFloaterLandHoldings(const LLSD& key)
: LLFloater(key),
@ -148,10 +151,24 @@ void LLFloaterLandHoldings::refresh()
void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
{
LLFloaterLandHoldings* self = LLFloaterReg::findTypedInstance<LLFloaterLandHoldings>("land_holdings");
// Is this packet from an old, closed window?
S32 count = msg->getNumberOfBlocks("QueryData");
std::string land_sku;
sHasLindenHome = false;
if (!self)
{
for (S32 i = 0; i < count; i++)
{
if ( msg->getSizeFast(_PREHASH_QueryData, i, _PREHASH_ProductSKU) > 0 )
{
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
if (LINDEN_HOMES_SKU == land_sku)
{
sHasLindenHome = true;
return;
}
}
}
return;
}
@ -174,12 +191,9 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
F32 global_x;
F32 global_y;
std::string sim_name;
std::string land_sku;
std::string land_type;
S32 i;
S32 count = msg->getNumberOfBlocks("QueryData");
for (i = 0; i < count; i++)
for (S32 i = 0; i < count; i++)
{
msg->getUUID("QueryData", "OwnerID", owner_id, i);
msg->getString("QueryData", "Name", name, i);
@ -196,6 +210,10 @@ void LLFloaterLandHoldings::processPlacesReply(LLMessageSystem* msg, void**)
msg->getStringFast( _PREHASH_QueryData, _PREHASH_ProductSKU, land_sku, i);
LL_INFOS() << "Land sku: " << land_sku << LL_ENDL;
land_type = LLProductInfoRequestManager::instance().getDescriptionForSku(land_sku);
if (LINDEN_HOMES_SKU == land_sku)
{
sHasLindenHome = true;
}
}
else
{

View File

@ -57,6 +57,8 @@ public:
static void onGrantList(void* data);
static bool sHasLindenHome;
protected:
void refreshAggregates();

View File

@ -2091,6 +2091,8 @@ void LLItemBridge::gotoItem()
if (active_panel)
{
active_panel->setSelection(obj->getLinkedUUID(), TAKE_FOCUS_NO);
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//active_panel->setFocus(TRUE);
}
}
@ -8017,24 +8019,30 @@ void LLLinkFolderBridge::performAction(LLInventoryModel* model, std::string acti
}
LLItemBridge::performAction(model,action);
}
void LLLinkFolderBridge::gotoItem()
{
const LLUUID &cat_uuid = getFolderID();
if (!cat_uuid.isNull())
{
LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid);
if (base_folder)
{
if (LLInventoryModel* model = getInventoryModel())
{
model->fetchDescendentsOf(cat_uuid);
}
base_folder->setOpen(TRUE);
mRoot->setSelection(base_folder,TRUE);
mRoot->scrollToShowSelection();
}
}
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//LLItemBridge::gotoItem();
//LLInventoryPanel::getActiveInventoryPanel()->openFolderByID(getFolderID());
const LLUUID &cat_uuid = getFolderID();
if (!cat_uuid.isNull())
{
LLFolderViewItem *base_folder = mInventoryPanel.get()->getItemByID(cat_uuid);
if (base_folder)
{
if (LLInventoryModel* model = getInventoryModel())
{
model->fetchDescendentsOf(cat_uuid);
}
base_folder->setOpen(TRUE);
mRoot->setSelection(base_folder,TRUE);
mRoot->scrollToShowSelection();
}
}
// </FS:Ansariel>
}
const LLUUID &LLLinkFolderBridge::getFolderID() const
{
if (LLViewerInventoryItem *link_item = getItem())

View File

@ -881,7 +881,8 @@ void show_item_profile(const LLUUID& item_uuid)
void show_item_original(const LLUUID& item_uuid)
{
// <FS:Ansariel> FIRE-19493: "Show Original" should open main inventory panel
// <FS:Ansariel> FIRE-19493: "Show Original" should open main inventory panel;
// Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//LLFloater* floater_inventory = LLFloaterReg::getInstance("inventory");
//if (!floater_inventory)
//{
@ -890,9 +891,7 @@ void show_item_original(const LLUUID& item_uuid)
//}
////sidetray inventory panel
//LLSidepanelInventory *sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
//bool do_reset_inventory_filter = !floater_inventory->isInVisibleChain();
//LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
//LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel();
//if (!active_panel)
@ -911,11 +910,7 @@ void show_item_original(const LLUUID& item_uuid)
// return;
//}
//active_panel->setSelection(gInventory.getLinkedItemID(item_uuid), TAKE_FOCUS_YES);
//
//if(do_reset_inventory_filter)
//{
// reset_inventory_filter();
//}
//active_panel->setFocus(TRUE);
LLFloaterReg::showInstance("inventory");
LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
@ -2755,6 +2750,17 @@ void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root
// </FS:Ansariel>
else
{
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//if (action == "goto")
//{
// LLSidepanelInventory *sidepanel_inventory = LLPanelMainInventory::newWindow()->LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
// if (sidepanel_inventory && sidepanel_inventory->getMainInventoryPanel())
// {
// model = sidepanel_inventory->getMainInventoryPanel()->getActivePanel()->getModel();
// }
//}
// </FS:Ansariel>
std::set<LLFolderViewItem*>::iterator set_iter;
for (set_iter = selected_items.begin(); set_iter != selected_items.end(); ++set_iter)
{

View File

@ -379,6 +379,8 @@ void LLInventoryPanel::draw()
{
// Select the desired item (in case it wasn't loaded when the selection was requested)
updateSelection();
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//updateFolderState();
LLPanel::draw();
}
@ -1314,6 +1316,8 @@ void LLInventoryPanel::setSelectCallback(const boost::function<void (const std::
void LLInventoryPanel::clearSelection()
{
mSelectThisID.setNull();
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//mOpenFolderID.setNull();
}
LLInventoryPanel::selected_items_t LLInventoryPanel::getSelectedItems() const
@ -1919,6 +1923,32 @@ void LLInventoryPanel::updateSelection()
}
}
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//void LLInventoryPanel::openFolderByID( const LLUUID& folder_id)
//{
// LLFolderViewItem* itemp = getItemByID(folder_id);
// if(itemp && itemp->getViewModelItem())
// {
// itemp->setOpen(TRUE);
// mOpenFolderID.setNull();
// return;
// }
// else
// {
// // save the desired folder to be open later (if/when ready)
// mOpenFolderID = folder_id;
// }
//}
//
//void LLInventoryPanel::updateFolderState()
//{
// if (mOpenFolderID.notNull())
// {
// openFolderByID(mOpenFolderID);
// }
//}
// </FS:Ansariel>
void LLInventoryPanel::doToSelected(const LLSD& userdata)
{
if (("purge" == userdata.asString()))

View File

@ -253,7 +253,11 @@ public:
LLFolderViewItem* getItemByID(const LLUUID& id);
LLFolderViewFolder* getFolderByID(const LLUUID& id);
void setSelectionByID(const LLUUID& obj_id, BOOL take_keyboard_focus);
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//void openFolderByID(const LLUUID& folder_id);
void updateSelection();
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//void updateFolderState();
void setSuppressOpenItemAction(bool supress_open_item) { mSuppressOpenItemAction = supress_open_item; }
@ -269,7 +273,9 @@ protected:
void openStartFolderOrMyInventory(); // open the first level of inventory
void onItemsCompletion(); // called when selected items are complete
LLUUID mSelectThisID;
LLUUID mSelectThisID;
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//LLUUID mOpenFolderID;
LLInventoryModel* mInventory;
LLInventoryObserver* mInventoryObserver;
LLInvPanelComplObserver* mCompletionObserver;
@ -364,27 +370,6 @@ private:
bool mViewsInitialized; // Views have been generated
};
class LLInventoryFavoriteItemsPanel : public LLInventoryPanel
{
public:
struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
{};
void initFromParams(const Params& p);
bool isSelectionRemovable() { return false; }
void setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb);
protected:
LLInventoryFavoriteItemsPanel(const Params& params);
~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); }
void updateFavoritesRootFolder();
boost::signals2::connection mFolderChangedSignal;
boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
friend class LLUICtrlFactory;
};
/************************************************************************/
/* Asset Pre-Filtered Inventory Panel related class */
/* Exchanges filter's flexibility for speed of generation and */

View File

@ -495,15 +495,16 @@ void LLPanelMainInventory::closeAllFolders()
getPanel()->getRootFolder()->closeAllFolders();
}
void LLPanelMainInventory::newWindow()
LLFloaterSidePanelContainer* LLPanelMainInventory::newWindow()
{
static S32 instance_num = 0;
instance_num = (instance_num + 1) % S32_MAX;
if (!gAgentCamera.cameraMouselook())
{
LLFloaterReg::showTypedInstance<LLFloaterSidePanelContainer>("inventory", LLSD(instance_num));
return LLFloaterReg::showTypedInstance<LLFloaterSidePanelContainer>("inventory", LLSD(instance_num));
}
return NULL;
}
void LLPanelMainInventory::doCreate(const LLSD& userdata)
@ -1756,7 +1757,18 @@ void LLPanelMainInventory::onCustomAction(const LLSD& userdata)
{
return;
}
static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto");
// <FS:Ansariel> Undo SL-13826 Open a new inventory floater for "Find original" and "Show original" result
//LLSidepanelInventory *sidepanel_inventory = newWindow()->LLFloaterSidePanelContainer::getPanel<LLSidepanelInventory>("inventory");
//if (sidepanel_inventory)
//{
// LLPanelMainInventory* new_inventory = sidepanel_inventory->getMainInventoryPanel();
// if (new_inventory)
// {
// static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->performAction(new_inventory->getActivePanel()->getModel(), "goto");
// }
//}
static_cast<LLFolderViewModelItemInventory*>(current_item->getViewModelItem())->performAction(getActivePanel()->getModel(), "goto");
// </FS:Ansariel>
}
if (command_name == "find_links")

View File

@ -47,6 +47,7 @@ class LLMenuButton;
class LLMenuGL;
class LLToggleableMenu;
class LLFloater;
class LLFloaterSidePanelContainer;
class LLComboBox; // <FS:Zi> Filter dropdown
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -98,7 +99,7 @@ public:
void setFocusFilterEditor();
static void newWindow();
static LLFloaterSidePanelContainer* newWindow();
void toggleFindOptions();

View File

@ -132,10 +132,12 @@
#include "llpanelpick.h"
#include "llpanelgrouplandmoney.h"
#include "llpanelgroupnotices.h"
#include "llparcel.h"
#include "llpreview.h"
#include "llpreviewscript.h"
#include "llproxy.h"
#include "llproductinforequest.h"
#include "llqueryflags.h"
#include "llselectmgr.h"
#include "llsky.h"
#include "llstatview.h"
@ -3132,6 +3134,14 @@ bool idle_startup()
gAgentAvatarp->sendHoverHeight();
// look for parcels we own
send_places_query(LLUUID::null,
LLUUID::null,
"",
DFQ_AGENT_OWNED,
LLParcel::C_ANY,
"");
// <FS:Techwolf Lupindo> FIRE-6643 Display MOTD when login screens are disabled
if (gSavedSettings.getBOOL("FSDisableLoginScreens"))
{

View File

@ -68,6 +68,7 @@
#include "llfloaterimcontainer.h"
#include "llfloaterland.h"
#include "llfloaterimnearbychat.h"
#include "llfloaterlandholdings.h"
#include "llfloaterpathfindingcharacters.h"
#include "llfloaterpathfindinglinksets.h"
#include "llfloaterpay.h"
@ -7163,6 +7164,16 @@ class LLWorldSetHomeLocation : public view_listener_t
}
};
class LLWorldLindenHome : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
std::string url = LLFloaterLandHoldings::sHasLindenHome ? LLTrans::getString("lindenhomes_my_home_url") : LLTrans::getString("lindenhomes_get_home_url");
LLWeb::loadURL(url);
return true;
}
};
class LLWorldTeleportHome : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
@ -11072,6 +11083,17 @@ public:
}
};
class LLUpdateMembershipLabel : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
const std::string label_str = LLAgentBenefitsMgr::isCurrent("Base") ? LLTrans::getString("MembershipUpgradeText") : LLTrans::getString("MembershipPremiumText");
gMenuHolder->childSetLabelArg("Membership", "[Membership]", label_str);
return true;
}
};
void handle_voice_morphing_subscribe()
{
LLWeb::loadURL(LLTrans::getString("voice_morphing_url"));
@ -11398,6 +11420,8 @@ void initialize_menus()
view_listener_t::addEnable(new LLUploadCostCalculator(), "Upload.CalculateCosts");
view_listener_t::addEnable(new LLUpdateMembershipLabel(), "Membership.UpdateLabel");
// <FS:Ansariel> [FS communication UI]
//enable.add("Conversation.IsConversationLoggingAllowed", boost::bind(&LLFloaterIMContainer::isConversationLoggingAllowed));
@ -11488,6 +11512,8 @@ void initialize_menus()
view_listener_t::addMenu(new LLWorldTeleportHome(), "World.TeleportHome");
view_listener_t::addMenu(new LLWorldSetAway(), "World.SetAway");
view_listener_t::addMenu(new LLWorldSetDoNotDisturb(), "World.SetDoNotDisturb");
view_listener_t::addMenu(new LLWorldLindenHome(), "World.LindenHome");
view_listener_t::addMenu(new LLWorldGetAway(), "World.GetAway"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldGetBusy(), "World.GetBusy"); //[SJ FIRE-2177]
view_listener_t::addMenu(new LLWorldSetAutorespond(), "World.SetAutorespond");

View File

@ -36,6 +36,16 @@
function="BuyCurrency" />
</menu_item_call>
<menu_item_call
label="[Membership]"
name="Membership">
<menu_item_call.on_click
function="Advanced.ShowURL"
parameter="https://secondlife.com/my/account/membership.php"/>
<menu_item_call.on_visible
function="Membership.UpdateLabel"/>
</menu_item_call>
<menu_item_separator/>
<menu_item_check
@ -888,6 +898,13 @@
function="Floater.Show"
parameter="land_holdings" />
</menu_item_call>
<menu_item_call
label="My Linden Home..."
name="Linden Home">
<menu_item_call.on_click
function="World.LindenHome"/>
</menu_item_call>
<menu
create_jump_keys="true"

View File

@ -2282,6 +2282,10 @@ If the message does not appear in the next few minutes, it may have been dropped
<string name="voice_morphing_url">https://secondlife.com/destination/voice-island</string>
<string name="premium_voice_morphing_url">https://secondlife.com/destination/voice-morphing-premium</string>
<string name="lindenhomes_get_home_url">https://secondlife.com/land/lindenhomes/member.php</string>
<string name="lindenhomes_my_home_url">https://land.secondlife.com/en-Us/lindenhomes/my-home.php</string>
<string name="membership_url">https://secondlife.com/my/account/membership.php</string>
<!-- Financial operations strings -->
<string name="paid_you_ldollars">[NAME] paid you L$[AMOUNT] [REASON].</string>
<string name="paid_you_ldollars_gift">[NAME] paid you L$[AMOUNT]: [REASON]</string>
@ -2473,6 +2477,9 @@ If you continue to experience problems, please check your network and firewall s
<string name="Premium PlusMembership">Premium Plus</string>
<string name="InternalMembership">Internal</string> <!-- No need to translate -->
<string name="MembershipUpgradeText">Upgrade to Premium</string>
<string name="MembershipPremiumText">My Premium membership</string>
<!-- Question strings for delete items notifications -->
<string name="DeleteItems">Delete selected items?</string>
<string name="DeleteItem">Delete selected item?</string>