diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanellandmarks.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llsidetray.cpp | 15 | ||||
-rw-r--r-- | indra/newview/llsidetray.h | 10 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 25 | ||||
-rw-r--r-- | indra/newview/llviewermessage.cpp | 10 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/notifications.xml | 10 |
6 files changed, 54 insertions, 20 deletions
diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 30acf37f82..d6e407a0ed 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -35,6 +35,7 @@ #include "llbutton.h" #include "llfloaterreg.h" +#include "llnotificationsutil.h" #include "llsdutil.h" #include "llsdutil_math.h" #include "llregionhandle.h" @@ -632,8 +633,7 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const LLViewerInventoryItem* landmark = LLLandmarkActions::findLandmarkForAgentPos(); if(landmark) { - LLSideTray::getInstance()->showPanel("panel_places", - LLSD().with("type", "landmark").with("id",landmark->getUUID())); + LLNotificationsUtil::add("LandmarkAlreadyExists"); } else { diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index fb8aa39445..50c47e293e 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -639,6 +639,21 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para return NULL; } +void LLSideTray::togglePanel(LLPanel* &sub_panel, const std::string& panel_name, const LLSD& params) +{ + if(!sub_panel) + return; + + if (sub_panel->isInVisibleChain()) + { + LLSideTray::getInstance()->collapseSideBar(); + } + else + { + LLSideTray::getInstance()->showPanel(panel_name, params); + } +} + // This is just LLView::findChildView specialized to restrict the search to LLPanels. // Optimization for EXT-4068 to avoid searching down to the individual item level // when inventories are large. diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index de2cfe9711..b1c8675793 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -94,7 +94,15 @@ public: * if no such tab - return NULL, otherwise a pointer to the panel * Pass params as array, or they may be overwritten(example - params["name"]="nearby") */ - LLPanel* showPanel (const std::string& panel_name, const LLSD& params); + LLPanel* showPanel (const std::string& panel_name, const LLSD& params); + + /** + * Toggling Side Tray tab which contains "sub_panel" child of "panel_name" panel. + * If "sub_panel" is not visible Side Tray is opened to display it, + * otherwise Side Tray is collapsed. + * params are passed to "panel_name" panel onOpen(). + */ + void togglePanel (LLPanel* &sub_panel, const std::string& panel_name, const LLSD& params); /* * get the panel (don't show it or do anything else with it) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index f87d5693e8..88a61c9d49 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3365,13 +3365,13 @@ void handle_show_side_tray() root->addChild(side_tray); } -class LLShowPanelPeopleTab : public view_listener_t +// Toggle one of "People" panel tabs in side tray. +class LLTogglePanelPeopleTab : public view_listener_t { bool handleEvent(const LLSD& userdata) { std::string panel_name = userdata.asString(); - // Open tab of the "People" panel in side tray. LLSD param; param["people_panel_tab_name"] = panel_name; @@ -3381,15 +3381,15 @@ class LLShowPanelPeopleTab : public view_listener_t if (panel_name == "friends_panel") { - return togglePanel(friends_panel, param); + return togglePeoplePanel(friends_panel, panel_name, param); } else if (panel_name == "groups_panel") { - return togglePanel(groups_panel, param); + return togglePeoplePanel(groups_panel, panel_name, param); } else if (panel_name == "nearby_panel") { - return togglePanel(nearby_panel, param); + return togglePeoplePanel(nearby_panel, panel_name, param); } else { @@ -3397,23 +3397,16 @@ class LLShowPanelPeopleTab : public view_listener_t } } - static bool togglePanel(LLPanel* &panel, const LLSD& param) + static bool togglePeoplePanel(LLPanel* &panel, const std::string& panel_name, const LLSD& param) { if(!panel) { - panel = LLSideTray::getInstance()->findChild<LLPanel>(param["people_panel_tab_name"].asString()); + panel = LLSideTray::getInstance()->getPanel(panel_name); if(!panel) return false; } - if (panel->isInVisibleChain()) - { - LLSideTray::getInstance()->collapseSideBar(); - } - else - { - LLSideTray::getInstance()->showPanel("panel_people", param); - } + LLSideTray::getInstance()->togglePanel(panel, "panel_people", param); return true; } @@ -7940,7 +7933,7 @@ void initialize_menus() view_listener_t::addMenu(new LLSelfEnableRemoveAllAttachments(), "Self.EnableRemoveAllAttachments"); // we don't use boost::bind directly to delay side tray construction - view_listener_t::addMenu( new LLShowPanelPeopleTab(), "SideTray.PanelPeopleTab"); + view_listener_t::addMenu( new LLTogglePanelPeopleTab(), "SideTray.PanelPeopleTab"); // Avatar pie menu view_listener_t::addMenu(new LLObjectMute(), "Avatar.Mute"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3dfd5c1dd2..c929e81ea4 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -738,6 +738,7 @@ void start_new_inventory_observer() class LLDiscardAgentOffer : public LLInventoryFetchComboObserver { + LOG_CLASS(LLDiscardAgentOffer); public: LLDiscardAgentOffer(const LLUUID& folder_id, const LLUUID& object_id) : mFolderID(folder_id), @@ -1114,7 +1115,7 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD& // * callback may be called immediately, // * adding the mute sends a message, // * we can't build two messages at once. - if (2 == button) + if (2 == button) // Block { gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this)); } @@ -2054,6 +2055,13 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) //if (((is_busy && !is_owned_by_me) || is_muted)) if ( is_muted || mute_im) { + // Prefetch the offered item so that it can be discarded by the appropriate observer. (EXT-4331) + LLInventoryFetchObserver::item_ref_t items; + items.push_back(info->mObjectID); + LLInventoryFetchObserver* fetch_item = new LLInventoryFetchObserver(); + fetch_item->fetchItems(items); + delete fetch_item; + // Same as closing window info->forceResponse(IOR_DECLINE); } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 957b4d74db..1ec004b194 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1402,6 +1402,16 @@ You have added "[LANDMARK_NAME]" to your [FOLDER_NAME] folder. </notification> <notification + icon="alert.tga" + name="LandmarkAlreadyExists" + type="alert"> +You already have a landmark for this location. + <usetemplate + name="okbutton" + yestext="OK"/> + </notification> + + <notification icon="alertmodal.tga" name="CannotCreateLandmarkNotOwner" type="alertmodal"> |