diff options
21 files changed, 355 insertions, 122 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 07e4cc22e0..46d2f92ad0 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -172,6 +172,10 @@ public: } } + LLIconCtrl* getIconCtrl() const + { + return mIcon; + } private: LLIconCtrl* mIcon; @@ -1629,6 +1633,7 @@ void LLTabContainer::setTabImage(LLPanel* child, LLIconCtrl* icon) if(button) { button->setIcon(icon); + reshapeTuple(tuple); } } } @@ -1639,12 +1644,22 @@ void LLTabContainer::reshapeTuple(LLTabTuple* tuple) if (!mIsVertical) { + S32 image_overlay_width = 0; + + if(mCustomIconCtrlUsed) + { + LLCustomButtonIconCtrl* button = dynamic_cast<LLCustomButtonIconCtrl*>(tuple->mButton); + LLIconCtrl* icon_ctrl = button->getIconCtrl(); + image_overlay_width = icon_ctrl ? icon_ctrl->getRect().getWidth() : 0; + } + else + { + image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? + tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : 0; + } // remove current width from total tab strip width mTotalTabWidth -= tuple->mButton->getRect().getWidth(); - S32 image_overlay_width = tuple->mButton->getImageOverlay().notNull() ? - tuple->mButton->getImageOverlay()->getImage()->getWidth(0) : 0; - tuple->mPadding = image_overlay_width; tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 3c73ae9b0c..20c939874b 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -232,7 +232,7 @@ std::string LLUrlEntryHTTPNoProtocol::getUrl(const std::string &string) const LLUrlEntrySLURL::LLUrlEntrySLURL() { // see http://slurl.com/about.php for details on the SLURL format - mPattern = boost::regex("http://(maps.secondlife.com|slurl.com)/secondlife/\\S+/?(\\d+)?/?(\\d+)?/?(\\d+)?/?\\S*", + mPattern = boost::regex("http://(maps.secondlife.com|slurl.com)/secondlife/[^ /]+(/\\d+){0,3}(/?(\\?title|\\?img|\\?msg)=\\S*)?/?", boost::regex::perl|boost::regex::icase); mMenuName = "menu_url_slurl.xml"; mTooltip = LLTrans::getString("TooltipSLURL"); diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 1d75374930..e6666c7f83 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -50,6 +50,7 @@ #include "llfloatergroups.h" #include "llfloaterreg.h" #include "llfloaterpay.h" +#include "llfloaterworldmap.h" #include "llinventorymodel.h" // for gInventory.findCategoryUUIDForType #include "llimview.h" // for gIMMgr #include "llmutelist.h" @@ -317,6 +318,20 @@ void LLAvatarActions::showProfile(const LLUUID& id) } // static +void LLAvatarActions::showOnMap(const LLUUID& id) +{ + std::string name; + if (!gCacheName->getFullName(id, name)) + { + gCacheName->get(id, FALSE, boost::bind(&LLAvatarActions::showOnMap, id)); + return; + } + + gFloaterWorldMap->trackAvatar(id, name); + LLFloaterReg::showInstance("world_map"); +} + +// static void LLAvatarActions::pay(const LLUUID& id) { LLNotification::Params params("BusyModePay"); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 16a58718a2..a7f3acad4f 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -99,6 +99,11 @@ public: static void showProfile(const LLUUID& id); /** + * Show avatar on world map. + */ + static void showOnMap(const LLUUID& id); + + /** * Give money to the avatar. */ static void pay(const LLUUID& id); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 6180b880b5..5e8d5a63d0 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -116,34 +116,6 @@ public: return LLPanel::handleMouseUp(x,y,mask); } - //*TODO remake it using mouse enter/leave and static LLHandle<LLIconCtrl> to add/remove as a child - BOOL handleToolTip(S32 x, S32 y, MASK mask) - { - LLTextBase* name = getChild<LLTextBase>("user_name"); - if (name && name->parentPointInView(x, y) && mAvatarID.notNull() && mFrom.size() && SYSTEM_FROM != mFrom) - { - - // Spawn at right side of the name textbox. - LLRect sticky_rect = name->calcScreenRect(); - S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); - - LLToolTip::Params params; - params.background_visible(false); - params.click_callback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, 0, 0, 0)); - params.delay_time(0.0f); // spawn instantly on hover - params.image(LLUI::getUIImage("Info_Small")); - params.message(""); - params.padding(0); - params.pos(LLCoordGL(icon_x, sticky_rect.mTop - 2)); - params.sticky_rect(sticky_rect); - - LLToolTipMgr::getInstance()->show(params); - return TRUE; - } - - return LLPanel::handleToolTip(x, y, mask); - } - void onObjectIconContextMenuItemClicked(const LLSD& userdata) { std::string level = userdata.asString(); @@ -198,7 +170,10 @@ public: menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mPopupMenuHandleObject = menu->getHandle(); - setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); + setDoubleClickCallback(boost::bind(&LLChatHistoryHeader::showInspector, this)); + + setMouseEnterCallback(boost::bind(&LLChatHistoryHeader::showInfoCtrl, this)); + setMouseLeaveCallback(boost::bind(&LLChatHistoryHeader::hideInfoCtrl, this)); return LLPanel::postBuild(); } @@ -232,7 +207,7 @@ public: return LLPanel::handleRightMouseDown(x,y,mask); } - void onHeaderPanelClick(S32 x, S32 y, MASK mask) + void showInspector() { if (mSourceType == CHAT_SOURCE_OBJECT) { @@ -245,6 +220,17 @@ public: //if chat source is system, you may add "else" here to define behaviour. } + static void onClickInfoCtrl(LLUICtrl* info_ctrl) + { + if (!info_ctrl) return; + + LLChatHistoryHeader* header = dynamic_cast<LLChatHistoryHeader*>(info_ctrl->getParent()); + if (!header) return; + + header->showInspector(); + } + + const LLUUID& getAvatarId () const { return mAvatarID;} void setup(const LLChat& chat,const LLStyle::Params& style_params) @@ -385,6 +371,33 @@ protected: } } + void showInfoCtrl() + { + if (mAvatarID.isNull() || mFrom.empty() || SYSTEM_FROM == mFrom) return; + + if (!sInfoCtrl) + { + sInfoCtrl = LLUICtrlFactory::createFromFile<LLUICtrl>("inspector_info_ctrl.xml", NULL, LLPanel::child_registry_t::instance()); + sInfoCtrl->setCommitCallback(boost::bind(&LLChatHistoryHeader::onClickInfoCtrl, sInfoCtrl)); + } + + LLTextBase* name = getChild<LLTextBase>("user_name"); + LLRect sticky_rect = name->getRect(); + S32 icon_x = llmin(sticky_rect.mLeft + name->getTextBoundingRect().getWidth() + 7, sticky_rect.mRight - 3); + sInfoCtrl->setOrigin(icon_x, sticky_rect.getCenterY() - sInfoCtrl->getRect().getHeight() / 2 ) ; + addChild(sInfoCtrl); + } + + void hideInfoCtrl() + { + if (!sInfoCtrl) return; + + if (sInfoCtrl->getParent() == this) + { + removeChild(sInfoCtrl); + } + } + private: void setTimeField(const LLChat& chat) { @@ -413,6 +426,8 @@ protected: LLHandle<LLView> mPopupMenuHandleAvatar; LLHandle<LLView> mPopupMenuHandleObject; + static LLUICtrl* sInfoCtrl; + LLUUID mAvatarID; EChatSourceType mSourceType; std::string mFrom; @@ -421,6 +436,7 @@ protected: S32 mMinUserNameWidth; }; +LLUICtrl* LLChatHistoryHeader::sInfoCtrl = NULL; LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLUICtrl(p), diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index 9c0e7a158d..098e540678 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -442,7 +442,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) void LLIMFloater::getAllowedRect(LLRect& rect) { - rect = gViewerWindow->getWorldViewRectRaw(); + rect = gViewerWindow->getWorldViewRectScaled(); static S32 right_padding = 0; if (right_padding == 0) { diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 04c684b240..a9ead36a70 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -674,6 +674,15 @@ void LLLocationInputCtrl::onLocationPrearrange(const LLSD& data) _1, filter)); } } + if(mList->isEmpty()) + { + /** + * Add a couple of empty items for a better view. + * EXT-5194 + */ + for(int i = 0; i < NUMBER_OF_EMPTY_ITEMS; i++ ) + add("", LLSD()); + } sortByName(); mList->mouseOverHighlightNthItem(-1); // Clear highlight on the last selected item. diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 4bb41f3bf4..ee128a5cf7 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -120,6 +120,13 @@ private: ICON_COUNT }; + /** + * This constant holds number of empty dropdown items, which will be displayed instead of doing nothing when the list is empty. + * Added due to EXT-5194 + */ + static const S32 NUMBER_OF_EMPTY_ITEMS = 3; + + friend class LLUICtrlFactory; LLLocationInputCtrl(const Params&); virtual ~LLLocationInputCtrl(); diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 6b07409676..b61d3ef371 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -48,7 +48,6 @@ #include "llscrollcontainer.h" #include "llavatariconctrl.h" #include "llweb.h" -#include "llfloaterworldmap.h" #include "llfloaterreg.h" #include "llnotificationsutil.h" #include "llvoiceclient.h" @@ -449,10 +448,7 @@ void LLPanelProfileTab::scrollToTop() void LLPanelProfileTab::onMapButtonClick() { - std::string name; - gCacheName->getFullName(getAvatarId(), name); - gFloaterWorldMap->trackAvatar(getAvatarId(), name); - LLFloaterReg::showInstance("world_map"); + LLAvatarActions::showOnMap(getAvatarId()); } void LLPanelProfileTab::updateButtons() diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 40ea75ea7a..45a8dc4cbe 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -69,6 +69,10 @@ static const std::string TRASH_BUTTON_NAME = "trash_btn"; // helper functions static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::string& string); static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list); +static void collapse_all_folders(LLFolderView* root_folder); +static void expand_all_folders(LLFolderView* root_folder); +static bool has_expanded_folders(LLFolderView* root_folder); +static bool has_collapsed_folders(LLFolderView* root_folder); /** * Functor counting expanded and collapsed folders in folder view tree to know @@ -683,31 +687,29 @@ void LLLandmarksPanel::updateListCommands() // keep Options & Add Landmark buttons always enabled mListCommands->childSetEnabled(ADD_FOLDER_BUTTON_NAME, add_folder_enabled); mListCommands->childSetEnabled(TRASH_BUTTON_NAME, trash_enabled); - mListCommands->childSetEnabled(OPTIONS_BUTTON_NAME,getCurSelectedItem() != NULL); } void LLLandmarksPanel::onActionsButtonClick() { + LLMenuGL* menu = mGearFolderMenu; + LLFolderViewItem* cur_item = NULL; if(mCurrentSelectedList) - cur_item = mCurrentSelectedList->getRootFolder()->getCurSelectedItem(); - - if(!cur_item) - return; - - LLFolderViewEventListener* listenerp = cur_item->getListener(); - - LLMenuGL* menu =NULL; - if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - menu = mGearLandmarkMenu; - } - else if (listenerp->getInventoryType() == LLInventoryType::IT_CATEGORY) { - mGearFolderMenu->getChild<LLMenuItemCallGL>("expand")->setVisible(!cur_item->isOpen()); - mGearFolderMenu->getChild<LLMenuItemCallGL>("collapse")->setVisible(cur_item->isOpen()); - menu = mGearFolderMenu; + cur_item = mCurrentSelectedList->getRootFolder()->getCurSelectedItem(); + if(!cur_item) + return; + + LLFolderViewEventListener* listenerp = cur_item->getListener(); + if(!listenerp) + return; + + if (listenerp->getInventoryType() == LLInventoryType::IT_LANDMARK) + { + menu = mGearLandmarkMenu; + } } + showActionMenu(menu,OPTIONS_BUTTON_NAME); } @@ -805,26 +807,33 @@ void LLLandmarksPanel::onClipboardAction(const LLSD& userdata) const void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) { - if(!mCurrentSelectedList) return; - - LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); std::string command_name = userdata.asString(); if ("expand_all" == command_name) { - root_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); - root_folder->arrangeAll(); + expand_all_folders(mFavoritesInventoryPanel->getRootFolder()); + expand_all_folders(mLandmarksInventoryPanel->getRootFolder()); + expand_all_folders(mMyInventoryPanel->getRootFolder()); + expand_all_folders(mLibraryInventoryPanel->getRootFolder()); + + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + (*iter)->changeOpenClose(false); + } } else if ("collapse_all" == command_name) { - root_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); + collapse_all_folders(mFavoritesInventoryPanel->getRootFolder()); + collapse_all_folders(mLandmarksInventoryPanel->getRootFolder()); + collapse_all_folders(mMyInventoryPanel->getRootFolder()); + collapse_all_folders(mLibraryInventoryPanel->getRootFolder()); - // The top level folder is invisible, it must be open to - // display its sub-folders. - root_folder->openTopLevelFolders(); - root_folder->arrangeAll(); + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + (*iter)->changeOpenClose(true); + } } - else if ( "sort_by_date" == command_name) + else if ("sort_by_date" == command_name) { mSortByDate = !mSortByDate; updateSortOrder(mLandmarksInventoryPanel, mSortByDate); @@ -833,7 +842,10 @@ void LLLandmarksPanel::onFoldingAction(const LLSD& userdata) } else { - root_folder->doToSelected(&gInventory, userdata); + if(mCurrentSelectedList) + { + mCurrentSelectedList->getRootFolder()->doToSelected(&gInventory, userdata); + } } } @@ -853,53 +865,87 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const { std::string command_name = userdata.asString(); - - LLPlacesFolderView* rootFolderView = mCurrentSelectedList ? + LLPlacesFolderView* root_folder_view = mCurrentSelectedList ? static_cast<LLPlacesFolderView*>(mCurrentSelectedList->getRootFolder()) : NULL; - if (NULL == rootFolderView) return false; - - // disable some commands for multi-selection. EXT-1757 - if (rootFolderView->getSelectedCount() > 1) + if ("collapse_all" == command_name) { - if ( "teleport" == command_name - || "more_info" == command_name - || "rename" == command_name - || "show_on_map" == command_name - || "copy_slurl" == command_name - ) + bool disable_collapse_all = !has_expanded_folders(mFavoritesInventoryPanel->getRootFolder()) + && !has_expanded_folders(mLandmarksInventoryPanel->getRootFolder()) + && !has_expanded_folders(mMyInventoryPanel->getRootFolder()) + && !has_expanded_folders(mLibraryInventoryPanel->getRootFolder()); + if (disable_collapse_all) { - return false; + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + if ((*iter)->isExpanded()) + { + disable_collapse_all = false; + break; + } + } } + return !disable_collapse_all; } + else if ("expand_all" == command_name) + { + bool disable_expand_all = !has_collapsed_folders(mFavoritesInventoryPanel->getRootFolder()) + && !has_collapsed_folders(mLandmarksInventoryPanel->getRootFolder()) + && !has_collapsed_folders(mMyInventoryPanel->getRootFolder()) + && !has_collapsed_folders(mLibraryInventoryPanel->getRootFolder()); + if (disable_expand_all) + { + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + if (!(*iter)->isExpanded()) + { + disable_expand_all = false; + break; + } + } + } - // disable some commands for Favorites accordion. EXT-1758 - if (mCurrentSelectedList == mFavoritesInventoryPanel) + return !disable_expand_all; + } + else if ("sort_by_date" == command_name) { - if ( "expand_all" == command_name - || "collapse_all" == command_name - || "sort_by_date" == command_name - ) + // disable "sort_by_date" for Favorites accordion because + // it has its own items order. EXT-1758 + if (mCurrentSelectedList == mFavoritesInventoryPanel) + { return false; + } } - - LLCheckFolderState checker; - rootFolderView->applyFunctorRecursively(checker); - - // We assume that the root folder is always expanded so we enable "collapse_all" - // command when we have at least one more expanded folder. - if (checker.getExpandedFolders() < 2 && "collapse_all" == command_name) + else if (!root_folder_view) { return false; } - - if (checker.getCollapsedFolders() < 1 && "expand_all" == command_name) + else if ( "paste" == command_name + || "rename" == command_name + || "cut" == command_name + || "copy" == command_name + || "delete" == command_name + || "collapse" == command_name + || "expand" == command_name + ) { - return false; + return canSelectedBeModified(command_name); } - - if("category" == command_name) + else if ( "teleport" == command_name + || "more_info" == command_name + || "rename" == command_name + || "show_on_map" == command_name + || "copy_slurl" == command_name + ) + { + // disable some commands for multi-selection. EXT-1757 + if (root_folder_view->getSelectedCount() > 1) + { + return false; + } + } + else if("category" == command_name) { // we can add folder only in Landmarks Accordion if (mCurrentSelectedList == mLandmarksInventoryPanel) @@ -909,10 +955,6 @@ bool LLLandmarksPanel::isActionEnabled(const LLSD& userdata) const } else return false; } - else if("paste" == command_name || "rename" == command_name || "cut" == command_name || "delete" == command_name) - { - return canSelectedBeModified(command_name); - } else if("create_pick" == command_name) { std::set<LLUUID> selection; @@ -970,6 +1012,9 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co { // validate own rules first + LLFolderViewItem* selected = getCurSelectedItem(); + if (!selected) return false; + // nothing can be modified in Library if (mLibraryInventoryPanel == mCurrentSelectedList) return false; @@ -996,24 +1041,41 @@ bool LLLandmarksPanel::canSelectedBeModified(const std::string& command_name) co } // then ask LLFolderView permissions + + LLFolderView* root_folder = mCurrentSelectedList->getRootFolder(); + + if ("copy" == command_name) + { + return root_folder->canCopy(); + } + else if ("collapse" == command_name) + { + return selected->isOpen(); + } + else if ("expand" == command_name) + { + return !selected->isOpen(); + } + if (can_be_modified) { - LLFolderViewItem* selected = getCurSelectedItem(); + LLFolderViewEventListener* listenerp = selected->getListener(); + if ("cut" == command_name) { - can_be_modified = mCurrentSelectedList->getRootFolder()->canCut(); + can_be_modified = root_folder->canCut(); } else if ("rename" == command_name) { - can_be_modified = selected ? selected->getListener()->isItemRenameable() : false; + can_be_modified = listenerp ? listenerp->isItemRenameable() : false; } else if ("delete" == command_name) { - can_be_modified = selected ? selected->getListener()->isItemRemovable(): false; + can_be_modified = listenerp ? listenerp->isItemRemovable() : false; } else if("paste" == command_name) { - return mCurrentSelectedList->getRootFolder()->canPaste(); + can_be_modified = root_folder->canPaste(); } else { @@ -1197,4 +1259,54 @@ static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list) return false; } + +static void collapse_all_folders(LLFolderView* root_folder) +{ + if (!root_folder) + return; + + root_folder->setOpenArrangeRecursively(FALSE, LLFolderViewFolder::RECURSE_DOWN); + + // The top level folder is invisible, it must be open to + // display its sub-folders. + root_folder->openTopLevelFolders(); + root_folder->arrangeAll(); +} + +static void expand_all_folders(LLFolderView* root_folder) +{ + if (!root_folder) + return; + + root_folder->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); + root_folder->arrangeAll(); +} + +static bool has_expanded_folders(LLFolderView* root_folder) +{ + LLCheckFolderState checker; + root_folder->applyFunctorRecursively(checker); + + // We assume that the root folder is always expanded so we enable "collapse_all" + // command when we have at least one more expanded folder. + if (checker.getExpandedFolders() < 2) + { + return false; + } + + return true; +} + +static bool has_collapsed_folders(LLFolderView* root_folder) +{ + LLCheckFolderState checker; + root_folder->applyFunctorRecursively(checker); + + if (checker.getCollapsedFolders() < 1) + { + return false; + } + + return true; +} // EOF diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 6358bd6f23..f1ce1a18b5 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -155,14 +155,14 @@ private: void doCreatePick(LLLandmark* landmark); private: - LLPlacesInventoryPanel* mFavoritesInventoryPanel; - LLPlacesInventoryPanel* mLandmarksInventoryPanel; - LLPlacesInventoryPanel* mMyInventoryPanel; - LLPlacesInventoryPanel* mLibraryInventoryPanel; + LLPlacesInventoryPanel* mFavoritesInventoryPanel; + LLPlacesInventoryPanel* mLandmarksInventoryPanel; + LLPlacesInventoryPanel* mMyInventoryPanel; + LLPlacesInventoryPanel* mLibraryInventoryPanel; LLMenuGL* mGearLandmarkMenu; LLMenuGL* mGearFolderMenu; LLMenuGL* mMenuAdd; - LLPlacesInventoryPanel* mCurrentSelectedList; + LLPlacesInventoryPanel* mCurrentSelectedList; LLInventoryObserver* mInventoryObserver; LLPanel* mListCommands; diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp index 900d28adca..854651cd01 100644 --- a/indra/newview/llpanelpeoplemenus.cpp +++ b/indra/newview/llpanelpeoplemenus.cpp @@ -39,6 +39,7 @@ #include "llpanelpeoplemenus.h" // newview +#include "llagent.h" #include "llagentdata.h" // for gAgentID #include "llavataractions.h" #include "llviewermenu.h" // for gMenuHolder @@ -125,7 +126,7 @@ LLContextMenu* NearbyMenu::createMenu() registrar.add("Avatar.IM", boost::bind(&LLAvatarActions::startIM, id)); registrar.add("Avatar.Call", boost::bind(&LLAvatarActions::startCall, id)); registrar.add("Avatar.OfferTeleport", boost::bind(&NearbyMenu::offerTeleport, this)); - registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::startIM, id)); // *TODO: unimplemented + registrar.add("Avatar.ShowOnMap", boost::bind(&LLAvatarActions::showOnMap, id)); registrar.add("Avatar.Share", boost::bind(&LLAvatarActions::share, id)); registrar.add("Avatar.Pay", boost::bind(&LLAvatarActions::pay, id)); registrar.add("Avatar.BlockUnblock", boost::bind(&LLAvatarActions::toggleBlock, id)); @@ -218,6 +219,13 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata) { return LLAvatarActions::canCall(); } + else if (item == std::string("can_show_on_map")) + { + const LLUUID& id = mUUIDs.front(); + + return (LLAvatarTracker::instance().isBuddyOnline(id) && is_agent_mappable(id)) + || gAgent.isGodlike(); + } return false; } diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index e4773f99c5..5d20e280b5 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -36,6 +36,8 @@ #include "llweb.h" +#include "llurlregistry.h" + const std::string LLSLURL::PREFIX_SL_HELP = "secondlife://app."; const std::string LLSLURL::PREFIX_SL = "sl://"; const std::string LLSLURL::PREFIX_SECONDLIFE = "secondlife://"; @@ -95,6 +97,20 @@ bool LLSLURL::isSLURL(const std::string& url) return false; } +bool LLSLURL::isValidSLURL(const std::string& url) +{ + std::string temp_url(url); + //"www." may appear in DnD- see description of PREFIX_SLURL_WWW. + // If it is found, we remove it because it isn't expected in regexp. + if (matchPrefix(url, PREFIX_SLURL_WWW)) + { + size_t position = url.find("www."); + temp_url.erase(position,4); + } + + return LLUrlRegistry::getInstance()->isUrl(temp_url); +} + // static bool LLSLURL::isSLURLCommand(const std::string& url) { diff --git a/indra/newview/llslurl.h b/indra/newview/llslurl.h index 6a695e84f3..a79a8fc97c 100644 --- a/indra/newview/llslurl.h +++ b/indra/newview/llslurl.h @@ -61,6 +61,11 @@ public: static bool isSLURL(const std::string& url); /** + * Returns true if url is proven valid by regexp check from LLUrlRegistry + */ + static bool isValidSLURL(const std::string& url); + + /** * Is this a special secondlife://app/ URL? */ static bool isSLURLCommand(const std::string& url); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 1669ce6312..eba6463d84 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -826,8 +826,10 @@ LLWindowCallbacks::DragNDropResult LLViewerWindow::handleDragNDrop( LLWindow *wi if (slurl_dnd_enabled) { + // special case SLURLs - if ( LLSLURL::isSLURL( data ) ) + // isValidSLURL() call was added here to make sure that dragged SLURL is valid (EXT-4964) + if ( LLSLURL::isSLURL( data ) && LLSLURL::isValidSLURL( data ) ) { if (drop) { @@ -3008,17 +3010,16 @@ void LLViewerWindow::updateWorldViewRect(bool use_full_window) if (mWorldViewRectRaw != new_world_rect) { - LLRect old_world_rect = mWorldViewRectRaw; mWorldViewRectRaw = new_world_rect; gResizeScreenTexture = TRUE; LLViewerCamera::getInstance()->setViewHeightInPixels( mWorldViewRectRaw.getHeight() ); LLViewerCamera::getInstance()->setAspect( getWorldViewAspectRatio() ); + LLRect old_world_rect_scaled = mWorldViewRectScaled; mWorldViewRectScaled = calcScaledRect(mWorldViewRectRaw, mDisplayScale); // sending a signal with a new WorldView rect - old_world_rect = calcScaledRect(old_world_rect, mDisplayScale); - mOnWorldViewRectUpdated(old_world_rect, mWorldViewRectScaled); + mOnWorldViewRectUpdated(old_world_rect_scaled, mWorldViewRectScaled); } } diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml index 964713adbf..65a05f3ec5 100644 --- a/indra/newview/skins/default/xui/en/floater_im_container.xml +++ b/indra/newview/skins/default/xui/en/floater_im_container.xml @@ -24,7 +24,7 @@ tab_height="16" use_custom_icon_ctrl="true" tab_icon_ctrl_pad="2" - font_halign="left" + halign="left" use_ellipses="true" top="0" width="390" /> diff --git a/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml b/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml new file mode 100644 index 0000000000..39fb54d513 --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspector_info_ctrl.xml @@ -0,0 +1,9 @@ +<button + chrome="true" + image_selected="Info_Small" + image_unselected="Info_Small" + image_pressed="Info_Small" + height="12" + name="inspector_info_ctrl" + width="12" /> +
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby.xml b/indra/newview/skins/default/xui/en/menu_people_nearby.xml index 9d2ccba4da..014a52bb4f 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby.xml @@ -47,6 +47,16 @@ parameter="can_call" /> </menu_item_call> <menu_item_call + label="Map" + layout="topleft" + name="Map"> + <menu_item_call.on_click + function="Avatar.ShowOnMap" /> + <menu_item_call.on_enable + function="Avatar.EnableItem" + parameter="can_show_on_map" /> + </menu_item_call> + <menu_item_call label="Share" layout="topleft" name="Share"> diff --git a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml index 9b3948b29b..3e38503e43 100644 --- a/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml +++ b/indra/newview/skins/default/xui/en/menu_places_gear_folder.xml @@ -45,6 +45,9 @@ <on_click function="Places.LandmarksGear.CopyPaste.Action" parameter="copy" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="copy" /> </menu_item_call> <menu_item_call label="Paste" @@ -88,6 +91,9 @@ <on_click function="Places.LandmarksGear.Folding.Action" parameter="expand" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="expand" /> </menu_item_call> <menu_item_call label="Collapse" @@ -96,6 +102,9 @@ <on_click function="Places.LandmarksGear.Folding.Action" parameter="collapse" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="collapse" /> </menu_item_call> <menu_item_call label="Expand all folders" diff --git a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml index d484564e0d..a314cedc21 100644 --- a/indra/newview/skins/default/xui/en/panel_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_navigation_bar.xml @@ -151,7 +151,6 @@ width="590"> <label follows="left|top" - font.style="BOLD" height="15" layout="topleft" left="10" diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 57535649de..ff5d89470c 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -129,7 +129,8 @@ background_visible="true" label="Close" layout="topleft" name="close_btn" - left_pad="3" + right="-10" + top="1" width="60" /> </panel> </panel> |