diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index b01e730f92..2af6b597e8 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -229,7 +229,8 @@ LLTabContainer::Params::Params() tab_icon_ctrl_pad("tab_icon_ctrl_pad", 0), use_ellipses("use_ellipses"), label_shadow("label_shadow",false), // no drop shadowed labels by default -Zi - font_halign("halign") + font_halign("halign"), + use_tab_offset("use_tab_offset", false) {} LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) @@ -273,6 +274,7 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mEnableTabsFlashing(p.enable_tabs_flashing), mTabsFlashingColor(p.tabs_flashing_color), mUseTabEllipses(p.use_ellipses), + mUseTabOffset(p.use_tab_offset), mDropShadowedText(p.label_shadow) // support for drop shadowed tab labels { // AO: Treat the IM tab container specially @@ -1153,11 +1155,10 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - tab_panel_rect = LLRect(LLPANEL_BORDER_WIDTH * 3, - tab_panel_top, - getRect().getWidth() - LLPANEL_BORDER_WIDTH * 2, - tab_panel_bottom ); - } + S32 left_offset = mUseTabOffset ? LLPANEL_BORDER_WIDTH * 3 : LLPANEL_BORDER_WIDTH; + S32 right_offset = mUseTabOffset ? LLPANEL_BORDER_WIDTH * 2 : LLPANEL_BORDER_WIDTH; + tab_panel_rect = LLRect(left_offset, tab_panel_top, getRect().getWidth() - right_offset, tab_panel_bottom); + } child->setFollowsAll(); child->translate( tab_panel_rect.mLeft - child->getRect().mLeft, tab_panel_rect.mBottom - child->getRect().mBottom); child->reshape( tab_panel_rect.getWidth(), tab_panel_rect.getHeight(), TRUE ); @@ -1657,25 +1658,23 @@ BOOL LLTabContainer::selectTab(S32 which) LLTabTuple* selected_tuple = getTab(which); if (!selected_tuple) - { return FALSE; - } - + LLSD cbdata; if (selected_tuple->mTabPanel) cbdata = selected_tuple->mTabPanel->getName(); - BOOL res = FALSE; - if( !mValidateSignal || (*mValidateSignal)( this, cbdata ) ) + BOOL result = FALSE; + if (!mValidateSignal || (*mValidateSignal)(this, cbdata)) { - res = setTab(which); - if (res && mCommitSignal) + result = setTab(which); + if (result && mCommitSignal) { (*mCommitSignal)(this, cbdata); } } - - return res; + + return result; } // private diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index 2907f994e3..5006d977b6 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -135,6 +135,8 @@ public: */ Optional tab_icon_ctrl_pad; + Optional use_tab_offset; + Params(); }; @@ -354,6 +356,8 @@ private: S32 mTabIconCtrlPad; bool mUseTabEllipses; LLFrameTimer mMouseDownTimer; + + bool mUseTabOffset; }; #endif // LL_TABCONTAINER_H diff --git a/indra/newview/fsslurl.cpp b/indra/newview/fsslurl.cpp index 86e7b9794e..a559d9bef1 100644 --- a/indra/newview/fsslurl.cpp +++ b/indra/newview/fsslurl.cpp @@ -154,6 +154,13 @@ LLSLURL::LLSLURL(const std::string& slurl) if(slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) { LL_DEBUGS("SLURL") << "secondlife scheme" << LL_ENDL; + if (path_array.size() == 0) + { + // um, we need a path... + mType = EMPTY; + return; + } + // parse a maingrid style slurl. We know the grid is maingrid // so grab it. // A location slurl for maingrid (with the special schemes) can be in the form diff --git a/indra/newview/fsslurl.h b/indra/newview/fsslurl.h index a3bd8e495b..03eb95853a 100644 --- a/indra/newview/fsslurl.h +++ b/indra/newview/fsslurl.h @@ -60,7 +60,8 @@ public: HOME_LOCATION, LAST_LOCATION, APP, - HELP + HELP, + EMPTY }; LLSLURL(): mType(INVALID) { } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3a51eeaa9d..f94325e013 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1915,7 +1915,7 @@ void LLItemBridge::performAction(LLInventoryModel* model, std::string action) } else if ("show_in_main_panel" == action) { - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + LLInventoryPanel::openInventoryPanelAndSetSelection(true, mUUID, true); return; } else if ("cut" == action) @@ -3703,7 +3703,7 @@ void LLFolderBridge::performAction(LLInventoryModel* model, std::string action) // else if ("show_in_main_panel" == action) { - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, mUUID, TRUE); + LLInventoryPanel::openInventoryPanelAndSetSelection(true, mUUID, true); return; } else if ("cut" == action) diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index eda7db0be2..f8c92c86f8 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -2135,62 +2135,68 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) } //static -void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const LLUUID& obj_id, BOOL use_main_panel, BOOL take_keyboard_focus, BOOL reset_filter) +void LLInventoryPanel::openInventoryPanelAndSetSelection(bool auto_open, const LLUUID& obj_id, + bool use_main_panel, bool take_keyboard_focus, bool reset_filter) { // Use correct inventory floater //LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); //sidepanel_inventory->showInventoryPanel(); // - bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX))); + LLUUID cat_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX); + bool in_inbox = gInventory.isObjectDescendentOf(obj_id, cat_id); bool show_inbox = gSavedSettings.getBOOL("FSShowInboxFolder"); // Optional hiding of Received Items folder aka Inbox - // FIRE-22167: Make "Show in Main View" work properly - //if (!in_inbox && (use_main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected())) //if (main_panel && !in_inbox) + //if (!in_inbox && use_main_panel) //{ // sidepanel_inventory->selectAllItemsPanel(); //} // - - LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater(); - if(!auto_open && inventory_floater && inventory_floater->getVisible()) + if (!auto_open) { - LLSidepanelInventory *inventory_panel = inventory_floater->findChild("main_panel"); - LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel(); - if(main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode()) + LLFloater* inventory_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater(); + if (inventory_floater && inventory_floater->getVisible()) { - LL_DEBUGS("Inventory") << "Opening gallery panel for item" << obj_id << LL_ENDL; - main_panel->setGallerySelection(obj_id); - return; + LLSidepanelInventory *inventory_panel = inventory_floater->findChild("main_panel"); + LLPanelMainInventory* main_panel = inventory_panel->getMainInventoryPanel(); + if (main_panel->isSingleFolderMode() && main_panel->isGalleryViewMode()) + { + LL_DEBUGS("Inventory") << "Opening gallery panel for item" << obj_id << LL_ENDL; + main_panel->setGallerySelection(obj_id); + return; + } } } - // Use correct inventory floater - //LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); - //if (main_inventory && main_inventory->isSingleFolderMode() - // && use_main_panel) + // Use correct inventory floater + //if (use_main_panel) //{ - // const LLInventoryObject *obj = gInventory.getObject(obj_id); - // if (obj) + // LLPanelMainInventory* main_inventory = sidepanel_inventory->getMainInventoryPanel(); + // if (main_inventory && main_inventory->isSingleFolderMode()) // { - // LL_DEBUGS("Inventory") << "Opening main inventory panel for item" << obj_id << LL_ENDL; - // main_inventory->setSingleFolderViewRoot(obj->getParentUUID(), false); - // main_inventory->setGallerySelection(obj_id); - // return; + // const LLInventoryObject *obj = gInventory.getObject(obj_id); + // if (obj) + // { + // LL_DEBUGS("Inventory") << "Opening main inventory panel for item" << obj_id << LL_ENDL; + // main_inventory->setSingleFolderViewRoot(obj->getParentUUID(), false); + // main_inventory->setGallerySelection(obj_id); + // return; + // } // } //} - if (!inventory_floater) + LLFloater* inv_floater = LLFloaterSidePanelContainer::getTopmostInventoryFloater(); + if (!inv_floater) { - inventory_floater = LLFloaterReg::showInstance("inventory"); + inv_floater = LLFloaterReg::showInstance("inventory"); } - if (use_main_panel && inventory_floater) + if (use_main_panel && inv_floater) { - LLSidepanelInventory* inventory_panel = inventory_floater->findChild("main_panel"); + LLSidepanelInventory* inventory_panel = inv_floater->findChild("main_panel"); LLPanelMainInventory* main_inventory = inventory_panel->getMainInventoryPanel(); if (main_inventory && main_inventory->isSingleFolderMode()) { - const LLInventoryObject *obj = gInventory.getObject(obj_id); + const LLInventoryObject* obj = gInventory.getObject(obj_id); if (obj) { main_inventory->setSingleFolderViewRoot(obj->getParentUUID(), false); @@ -2202,7 +2208,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L // LLInventoryPanel *active_panel = LLInventoryPanel::getActiveInventoryPanel(auto_open); - if (active_panel) { LL_DEBUGS("Messaging", "Inventory") << "Highlighting" << obj_id << LL_ENDL; @@ -2218,10 +2223,8 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L // { LLSidepanelInventory* sidepanel_inventory = LLFloaterSidePanelContainer::getPanel("inventory"); // Use correct inventory floater - LLInventoryPanel * inventory_panel = NULL; sidepanel_inventory->openInbox(); - inventory_panel = sidepanel_inventory->getInboxPanel(); - + LLInventoryPanel* inventory_panel = sidepanel_inventory->getInboxPanel(); if (inventory_panel) { inventory_panel->setSelection(obj_id, take_keyboard_focus); @@ -2254,7 +2257,6 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L void LLInventoryPanel::setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id) { - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("inventory"); for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) { diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 31587abc5c..8cae4388d9 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -260,12 +260,12 @@ public: // "Auto_open" determines if we open an inventory panel if none are open. static LLInventoryPanel *getActiveInventoryPanel(BOOL auto_open = TRUE); - static void openInventoryPanelAndSetSelection(BOOL auto_open, + static void openInventoryPanelAndSetSelection(bool auto_open, const LLUUID& obj_id, - BOOL use_main_panel = FALSE, - BOOL take_keyboard_focus = TAKE_FOCUS_YES, - BOOL reset_filter = FALSE); - static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id); + bool use_main_panel = false, + bool take_keyboard_focus = true, + bool reset_filter = false); + static void setSFViewAndOpenFolder(const LLInventoryPanel* panel, const LLUUID& folder_id); void addItemID(const LLUUID& id, LLFolderViewItem* itemp); void removeItemID(const LLUUID& id); LLFolderViewItem* getItemByID(const LLUUID& id); diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 687afb4026..0ec9b4c30c 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -5705,7 +5705,7 @@ void on_new_single_inventory_upload_complete( } else { - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, server_response["new_inventory_item"].asUUID(), TRUE, TAKE_FOCUS_NO, TRUE); + LLInventoryPanel::openInventoryPanelAndSetSelection(true, server_response["new_inventory_item"].asUUID(), true, false, true); } // restore keyboard focus diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 89ec482d5c..fe1c09a62e 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -116,6 +116,13 @@ LLSLURL::LLSLURL(const std::string& slurl) // and the slurl type (APP or LOCATION) if(slurl_uri.scheme() == LLSLURL::SLURL_SECONDLIFE_SCHEME) { + if (path_array.size() == 0) + { + // um, we need a path... + mType = EMPTY; + return; + } + // parse a maingrid style slurl. We know the grid is maingrid // so grab it. // A location slurl for maingrid (with the special schemes) can be in the form diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index fd0db1837c..d53383e421 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -55,13 +55,14 @@ public: static const char* SLURL_REGION_PATH; // if you modify this enumeration, update typeName as well - enum SLURL_TYPE { - INVALID, + enum SLURL_TYPE { + INVALID, LOCATION, HOME_LOCATION, LAST_LOCATION, APP, HELP, + EMPTY, NUM_SLURL_TYPES // must be last }; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 492e6579e9..97dc513583 100644 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -140,6 +140,11 @@ bool LLURLDispatcherImpl::dispatch(const LLSLURL& slurl, LLMediaCtrl* web, bool trusted_browser) { + // SL-20422 : Clicking the "Bring it back" link on Aditi displays a teleport alert + // Stop further processing empty urls like [secondlife:/// Bring it back.] + if (slurl.getType() == LLSLURL::EMPTY) + return true; + const bool right_click = false; return dispatchCore(slurl, nav_type, right_click, web, trusted_browser); } diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp index 7013567bad..8b204ca012 100644 --- a/indra/newview/llviewerassetupload.cpp +++ b/indra/newview/llviewerassetupload.cpp @@ -904,9 +904,9 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti // // FIRE-22943: Don't switch away from the "Recent Items" tab. - //LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, FALSE, TAKE_FOCUS_NO, (panel == NULL)); - BOOL show_main_panel = (!panel || panel->getName() != "Recent Items"); - LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, show_main_panel, TAKE_FOCUS_NO, (panel == NULL)); + //LLInventoryPanel::openInventoryPanelAndSetSelection(true, serverInventoryItem, false, false, !panel); + bool show_main_panel = (!panel || panel->getName() != "Recent Items"); + LLInventoryPanel::openInventoryPanelAndSetSelection(true, serverInventoryItem, show_main_panel, false, !panel); // // restore keyboard focus diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fca7af63b6..3963562ff3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1720,20 +1720,29 @@ void open_inventory_offer(const uuid_vec_t& objects, const std::string& from_nam } else { - // Highlight item - // Only show if either ShowInInventory is true OR it is an inventory - // offer from an agent and the asset is not previewable - const BOOL auto_open = gSavedSettings.getBOOL("ShowInInventory") || (from_agent_manual && !check_asset_previewable(asset_type)); - //gSavedSettings.getBOOL("ShowInInventory") && // don't open if showininventory is false - //!from_name.empty(); // don't open if it's not from anyone. - // Use correct inventory floater - //if (auto_open) - //{ - // LLFloaterReg::showInstance("inventory"); - //} - // - if (auto_open) // Don't mess with open inventory panels when ShowInInventory is FALSE - LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true); + // Highlight item + // Only show if either ShowInInventory is true OR it is an inventory + // offer from an agent and the asset is not previewable + //bool show_in_inventory = gSavedSettings.get("ShowInInventory"); + //bool auto_open = + // show_in_inventory && // don't open if ShowInInventory is FALSE + // !from_name.empty(); // don't open if it's not from anyone + + //// SL-20419 : Don't change active tab if floater is visible + //LLFloater* instance = LLFloaterReg::findInstance("inventory"); + //bool use_main_panel = instance && instance->getVisible(); + + //if (auto_open) + //{ + // LLFloaterReg::showInstance("inventory"); + //} + + //LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, use_main_panel); + + const bool auto_open = gSavedSettings.getBOOL("ShowInInventory") || (from_agent_manual && !check_asset_previewable(asset_type)); + if (auto_open) // Don't mess with open inventory panels when ShowInInventory is FALSE + LLInventoryPanel::openInventoryPanelAndSetSelection(auto_open, obj_id, true); + // } } } diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index 73bbe63448..9f5d0b3a16 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -995,7 +995,7 @@ void LLWearableItemsList::updateChangedItems(const uuid_vec_t& changed_items_uui if (!inv_item) continue; - LLUUID linked_uuid = inv_item->getLinkedUUID(); + const LLUUID& linked_uuid = inv_item->getLinkedUUID(); if (std::find(uuids_begin, uuids_end, linked_uuid) != uuids_end) { item->setNeedsRefresh(true);