From 2b5faa0b9cac3736b9d96a68cd13e05ee39ab7d1 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Mon, 9 Nov 2009 13:12:43 -0800 Subject: Changed SRV Request timeout to respond with an event instead of an error --- indra/viewer_components/login/lllogin.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index 7a30315b9a..ea1e3ff3f9 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -141,9 +141,14 @@ void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD credential LL_INFOS("LLLogin") << "Requesting SRV record from " << uri << LL_ENDL; // *NOTE:Mani - Completely arbitrary timeout value for SRV request. - filter.errorAfter(5, "SRV Request timed out!"); - - // Make request + // filter.errorAfter(5, "SRV Request timed out!"); + + // + F32 seconds_to_timeout = 5.0f; + filter.actionAfter(seconds_to_timeout, + sendProgressEvent("offline", "fail.login", LLSD())); + + // Make request LLSD request; request["op"] = "rewriteURI"; request["uri"] = uri; -- cgit v1.2.3 From ae9c4e3ae9e76358e30c1b0c7a5d5f4fa35e66b8 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 10 Nov 2009 17:41:54 -0500 Subject: Minor comment cleanup for llagentwearables.cpp. --- indra/newview/llagentwearables.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 3fc1055acd..41807ceca0 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -887,9 +887,8 @@ void LLAgentWearables::processAgentInitialWearablesUpdate(LLMessageSystem* mesgs lldebugs << " " << LLWearableDictionary::getTypeLabel(type) << llendl; } - // What we do here is get the complete information on the items in - // the inventory, and set up an observer that will wait for that to - // happen. + // Get the complete information on the items in the inventory and set up an observer + // that will trigger when the complete information is fetched. LLInventoryFetchDescendentsObserver::folder_ref_t folders; folders.push_back(current_outfit_id); outfit->fetchDescendents(folders); -- cgit v1.2.3 From af9b99b457a6a6ab9f04a20bcde6a90091321375 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Tue, 10 Nov 2009 18:30:36 -0500 Subject: EXT-2349 : Diagnose warning spam: [X] is in model and in view, but STRUCTURE flag not set No longer allowing recursive calls to gInventory.notifyObservers. Added debugging tools to catch when this happens. This fixes the symptom, but we'll also need to remove whatever code is causing the recursive calls. --- indra/newview/llinventorymodel.cpp | 42 ++++++++++++++++++++++++++++++++------ indra/newview/llinventorymodel.h | 28 ++++++++++++++----------- 2 files changed, 52 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b41695fd34..51052a22b5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -172,6 +172,7 @@ LLInventoryModel::LLInventoryModel() mRootFolderID(), mLibraryRootFolderID(), mLibraryOwnerID(), + mIsNotifyObservers(FALSE), mIsAgentInvUsable(false) { } @@ -533,7 +534,10 @@ void LLInventoryModel::updateLinkedItems(const LLUUID& object_id) item_array, LLInventoryModel::INCLUDE_TRASH, is_linked_item_match); - + if (cat_array.empty() && item_array.empty()) + { + return; + } for (LLInventoryModel::cat_array_t::iterator cat_iter = cat_array.begin(); cat_iter != cat_array.end(); cat_iter++) @@ -635,6 +639,7 @@ U32 LLInventoryModel::updateItem(const LLViewerInventoryItem* item) new_item = old_item; LLUUID old_parent_id = old_item->getParentUUID(); LLUUID new_parent_id = item->getParentUUID(); + if(old_parent_id != new_parent_id) { // need to update the parent-child tree @@ -1129,6 +1134,16 @@ BOOL LLInventoryModel::containsObserver(LLInventoryObserver* observer) const // The optional argument 'service_name' is used by Agent Inventory Service [DEV-20328] void LLInventoryModel::notifyObservers(const std::string service_name) { + if (mIsNotifyObservers) + { + // Within notifyObservers, something called notifyObservers + // again. This type of recursion is unsafe because it causes items to be + // processed twice, and this can easily lead to infinite loops. + llwarns << "Call was made to notifyObservers within notifyObservers!" << llendl; + return; + } + mIsNotifyObservers = TRUE; + llinfos << "Start process notifyObservers for " << this << llendl; for (observer_list_t::iterator iter = mObservers.begin(); iter != mObservers.end(); ) { @@ -1150,12 +1165,21 @@ void LLInventoryModel::notifyObservers(const std::string service_name) mModifyMask = LLInventoryObserver::NONE; mChangedItemIDs.clear(); + mIsNotifyObservers = FALSE; } // store flag for change // and id of object change applies to void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent) { + if (mIsNotifyObservers) + { + // Something marked an item for change within a call to notifyObservers + // (which is in the process of processing the list of items marked for change). + // This means the change may fail to be processed. + llwarns << "Adding changed mask within notify observers! Change will likely be lost." << llendl; + } + mModifyMask |= mask; if (referent.notNull()) { @@ -1824,13 +1848,13 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) { //llinfos << "LLInventoryModel::addItem()" << llendl; - - // This can happen if assettype enums change. This can be a backwards compatibility issue - // in some viewer prototypes prior to when the AT_LINK enum changed from 23 to 24. + // This can happen if assettype enums from llassettype.h ever change. + // For example, there is a known backwards compatibility issue in some viewer prototypes prior to when + // the AT_LINK enum changed from 23 to 24. if ((item->getType() == LLAssetType::AT_NONE) || LLAssetType::lookup(item->getType()) == LLAssetType::badLookup()) { - llwarns << "Got bad asset type for item ( name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ), ignoring." << llendl; + llwarns << "Got bad asset type for item [ name: " << item->getName() << " type: " << item->getType() << " inv-type: " << item->getInventoryType() << " ], ignoring." << llendl; return; } if(item) @@ -1839,7 +1863,7 @@ void LLInventoryModel::addItem(LLViewerInventoryItem* item) // The item will show up as a broken link. if (item->getIsBrokenLink()) { - llinfos << "Adding broken link ( name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl; + llinfos << "Adding broken link [ name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ) parent: " << item->getParentUUID() << llendl; } mItemMap[item->getUUID()] = item; } @@ -3263,6 +3287,12 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) for(i = 0; i < count; ++i) { titem->unpackMessage(msg, _PREHASH_ItemData, i); + // If the item has already been added (e.g. from link prefetch), then it doesn't need to be re-added. + if (gInventory.getItem(titem->getUUID())) + { + llinfos << "Skipping prefetched item [ Name: " << titem->getName() << " | Type: " << titem->getActualType() << " | ItemUUID: " << titem->getUUID() << " ] " << llendl; + continue; + } gInventory.updateItem(titem); } diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index aba0a619db..5f51408bcf 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -472,23 +472,12 @@ protected: cat_array_t* getUnlockedCatArray(const LLUUID& id); item_array_t* getUnlockedItemArray(const LLUUID& id); -protected: +private: // Variables used to track what has changed since the last notify. U32 mModifyMask; typedef std::set changed_items_t; changed_items_t mChangedItemIDs; - // Information for tracking the actual inventory. We index this - // information in a lot of different ways so we can access - // the inventory using several different identifiers. - // mInventory member data is the 'master' list of inventory, and - // mCategoryMap and mItemMap store uuid->object mappings. - typedef std::map > cat_map_t; - typedef std::map > item_map_t; - //inv_map_t mInventory; - cat_map_t mCategoryMap; - item_map_t mItemMap; - std::map mCategoryLock; std::map mItemLock; @@ -521,6 +510,21 @@ protected: // This flag is used to handle an invalid inventory state. bool mIsAgentInvUsable; +private: + // Information for tracking the actual inventory. We index this + // information in a lot of different ways so we can access + // the inventory using several different identifiers. + // mInventory member data is the 'master' list of inventory, and + // mCategoryMap and mItemMap store uuid->object mappings. + typedef std::map > cat_map_t; + typedef std::map > item_map_t; + //inv_map_t mInventory; + cat_map_t mCategoryMap; + item_map_t mItemMap; + + // Flag set when notifyObservers is being called, to look for bugs + // where it's called recursively. + BOOL mIsNotifyObservers; public: // *NOTE: DEBUG functionality void dumpInventory() const; -- cgit v1.2.3 From fb20a7281d8e5107f83e7439df054ccd3733d0c4 Mon Sep 17 00:00:00 2001 From: James Cook Date: Tue, 10 Nov 2009 17:12:07 -0800 Subject: EXT-2338 Move button tooltips to strings the viewer translation tool can parse. Also moved mSpeakBtn from llnearbychatbar to llbottomtray, because the bottom tray is its parent. --- indra/newview/llbottomtray.cpp | 36 ++++++++++++++++++++++ indra/newview/llbottomtray.h | 7 ++++- indra/newview/llnearbychatbar.cpp | 30 ------------------ indra/newview/llnearbychatbar.h | 10 ------ indra/newview/llspeakbutton.cpp | 10 ++++++ indra/newview/llspeakbutton.h | 5 +++ .../skins/default/xui/en/panel_bottomtray.xml | 6 ++-- 7 files changed, 60 insertions(+), 44 deletions(-) (limited to 'indra') diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 832694873f..9ea8b53d3d 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -40,6 +40,7 @@ #include "llimfloater.h" // for LLIMFloater #include "lllayoutstack.h" #include "llnearbychatbar.h" +#include "llspeakbutton.h" #include "llsplitbutton.h" #include "llsyswellwindow.h" #include "llfloatercamera.h" @@ -181,6 +182,28 @@ void LLBottomTray::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& } } +// virtual +void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, bool proximal) +{ + // Time it takes to connect to voice channel might be pretty long, + // so don't expect user login or STATUS_VOICE_ENABLED to be followed by STATUS_JOINED. + BOOL enable = FALSE; + + switch (status) + { + // Do not add STATUS_VOICE_ENABLED because voice chat is + // inactive until STATUS_JOINED + case STATUS_JOINED: + enable = TRUE; + break; + default: + enable = FALSE; + break; + } + + mSpeakBtn->setEnabled(enable); +} + //virtual void LLBottomTray::onFocusLost() { @@ -275,6 +298,19 @@ BOOL LLBottomTray::postBuild() mSnapshotPanel = getChild("snapshot_panel"); setRightMouseDownCallback(boost::bind(&LLBottomTray::showBottomTrayContextMenu,this, _2, _3,_4)); + mSpeakBtn = getChild("talk"); + + // Speak button should be initially disabled because + // it takes some time between logging in to world and connecting to voice channel. + mSpeakBtn->setEnabled(FALSE); + + // Localization tool doesn't understand custom buttons like + mSpeakBtn->setSpeakToolTip( getString("SpeakBtnToolTip") ); + mSpeakBtn->setShowToolTip( getString("VoiceControlBtnToolTip") ); + + // Registering Chat Bar to receive Voice client status change notifications. + gVoiceClient->addObserver(this); + if (mChicletPanel && mToolbarStack && mNearbyChatBar) { verifyChildControlsSizes(); diff --git a/indra/newview/llbottomtray.h b/indra/newview/llbottomtray.h index 02588a1975..3f6d0756de 100644 --- a/indra/newview/llbottomtray.h +++ b/indra/newview/llbottomtray.h @@ -33,7 +33,7 @@ #ifndef LL_LLBOTTOMPANEL_H #define LL_LLBOTTOMPANEL_H -#include +#include "llmenugl.h" #include "llpanel.h" #include "llimview.h" @@ -51,6 +51,7 @@ class LLBottomTray : public LLSingleton , public LLPanel , public LLIMSessionObserver + , public LLVoiceClientStatusObserver { friend class LLSingleton; public: @@ -74,6 +75,10 @@ public: virtual void onFocusLost(); virtual void setVisible(BOOL visible); + // Implements LLVoiceClientStatusObserver::onChange() to enable the speak + // button when voice is available + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + void showBottomTrayContextMenu(S32 x, S32 y, MASK mask); void showGestureButton(BOOL visible); diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index d54545971b..dfeade2e4d 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -36,7 +36,6 @@ #include "lltrans.h" #include "llnearbychatbar.h" -#include "llspeakbutton.h" #include "llbottomtray.h" #include "llagent.h" #include "llgesturemgr.h" @@ -234,14 +233,6 @@ BOOL LLNearbyChatBar::postBuild() mOutputMonitor = getChild("chat_zone_indicator"); mOutputMonitor->setVisible(FALSE); - mSpeakBtn = getParent()->getChild("talk"); - - // Speak button should be initially disabled because - // it takes some time between logging in to world and connecting to voice channel. - mSpeakBtn->setEnabled(FALSE); - - // Registering Chat Bar to receive Voice client status change notifications. - gVoiceClient->addObserver(this); return TRUE; } @@ -730,27 +721,6 @@ public: } }; -void LLNearbyChatBar::onChange(EStatusType status, const std::string &channelURI, bool proximal) -{ - // Time it takes to connect to voice channel might be pretty long, - // so don't expect user login or STATUS_VOICE_ENABLED to be followed by STATUS_JOINED. - BOOL enable = FALSE; - - switch (status) - { - // Do not add STATUS_VOICE_ENABLED because voice chat is - // inactive until STATUS_JOINED - case STATUS_JOINED: - enable = TRUE; - break; - default: - enable = FALSE; - break; - } - - mSpeakBtn->setEnabled(enable); -} - // Creating the object registers with the dispatcher. LLChatHandler gChatHandler; diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index 56ee706a97..224118e088 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -42,9 +42,6 @@ #include "llspeakers.h" -class LLSpeakButton; - - class LLGestureComboBox : public LLComboBox , public LLGestureManagerObserver @@ -76,7 +73,6 @@ protected: class LLNearbyChatBar : public LLPanel -, public LLVoiceClientStatusObserver { public: // constructor for inline chat-bars (e.g. hosted in chat history window) @@ -105,11 +101,6 @@ public: S32 getMinWidth() const; S32 getMaxWidth() const; - /** - * Implements LLVoiceClientStatusObserver::onChange() - */ - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - protected: static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str); static void onChatBoxKeystroke(LLLineEditor* caller, void* userdata); @@ -127,7 +118,6 @@ protected: static S32 sLastSpecialChatChannel; LLLineEditor* mChatBox; - LLSpeakButton* mSpeakBtn; LLOutputMonitorCtrl* mOutputMonitor; LLLocalSpeakerMgr* mSpeakerMgr; }; diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp index 57ea018f25..51d53b2674 100644 --- a/indra/newview/llspeakbutton.cpp +++ b/indra/newview/llspeakbutton.cpp @@ -133,6 +133,16 @@ LLSpeakButton::~LLSpeakButton() LLTransientFloaterMgr::getInstance()->removeControlView(mShowBtn); } +void LLSpeakButton::setSpeakToolTip(const std::string& msg) +{ + mSpeakBtn->setToolTip(msg); +} + +void LLSpeakButton::setShowToolTip(const std::string& msg) +{ + mShowBtn->setToolTip(msg); +} + void LLSpeakButton::onMouseDown_SpeakBtn() { bool down = true; diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h index e213c562dd..02c8ab3890 100644 --- a/indra/newview/llspeakbutton.h +++ b/indra/newview/llspeakbutton.h @@ -62,6 +62,11 @@ public: /*virtual*/ ~LLSpeakButton(); /*virtual*/ void draw(); + // *HACK: Need to put tooltips in a translatable location, + // the panel that contains this button. + void setSpeakToolTip(const std::string& msg); + void setShowToolTip(const std::string& msg); + protected: friend class LLUICtrlFactory; LLSpeakButton(const Params& p); diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 3fbc8e1afd..e96d3a152f 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -13,6 +13,8 @@ chrome="true" border_visible="false" width="1000"> + Turns microphone on/off + Shows/hides voice control panel + width="100" /> Date: Wed, 11 Nov 2009 11:45:20 -0500 Subject: Link spam reduction - consolidating inventory cache loading messages. --- indra/newview/llinventorymodel.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index e7d7eb19d0..a25c3d0c10 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2176,7 +2176,7 @@ bool LLInventoryModel::loadSkeleton( // Add all the items loaded which are parented to a // category with a correctly cached parent - count = items.count(); + S32 bad_link_count = 0; cat_map_t::iterator unparented = mCategoryMap.end(); for(item_array_t::const_iterator item_iter = items.begin(); item_iter != items.end(); @@ -2193,7 +2193,11 @@ bool LLInventoryModel::loadSkeleton( // This can happen if the linked object's baseobj is removed from the cache but the linked object is still in the cache. if (item->getIsBrokenLink()) { - llinfos << "Attempted to add cached link item without baseobj present ( name: " << item->getName() << " itemID: " << item->getUUID() << " assetID: " << item->getAssetUUID() << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl; + bad_link_count++; + lldebugs << "Attempted to add cached link item without baseobj present ( name: " + << item->getName() << " itemID: " << item->getUUID() + << " assetID: " << item->getAssetUUID() + << " ). Ignoring and invalidating " << cat->getName() << " . " << llendl; invalid_categories.insert(cit->second); continue; } @@ -2203,6 +2207,12 @@ bool LLInventoryModel::loadSkeleton( } } } + if (bad_link_count > 0) + { + llinfos << "Attempted to add " << bad_link_count + << " cached link items without baseobj present. " + << "The corresponding categories were invalidated." << llendl; + } } else { -- cgit v1.2.3 From 5bb5333964e99448d1e23403fdf31cc202e2fe95 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 11 Nov 2009 12:42:39 -0500 Subject: EXT-2377 : Add XML switch to showing either menubar or gear menu First pass attempt at this. This is not debugged, but hg won't let me merge until I commit this change... --- indra/newview/llpanelmaininventory.cpp | 24 +++++++++++++++++++--- indra/newview/llpanelmaininventory.h | 14 ++++++++++++- .../skins/default/xui/en/floater_inventory.xml | 4 ++-- .../skins/default/xui/en/panel_main_inventory.xml | 12 +++++++++++ .../skins/default/xui/en/sidepanel_inventory.xml | 1 + 5 files changed, 49 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 15a75cb930..9b33fc1839 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -49,7 +49,7 @@ #include "llviewermenu.h" #include "llviewertexturelist.h" -static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); // Seraph is this redundant with constructor? +static LLDefaultChildRegistry::Register r("panel_main_inventory"); void on_file_loaded_for_save(BOOL success, LLViewerFetchedTexture *src_vi, @@ -90,8 +90,8 @@ private: /// LLPanelMainInventory ///---------------------------------------------------------------------------- -LLPanelMainInventory::LLPanelMainInventory() - : LLPanel(), +LLPanelMainInventory::LLPanelMainInventory(const LLPanelMainInventory::Params& p) + : LLPanel(p), mActivePanel(NULL), mSavedFolderState(NULL), mFilterText(""), @@ -124,6 +124,24 @@ LLPanelMainInventory::LLPanelMainInventory() mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); + + if (p.hide_top_menu) + { + LLInventoryPanel *top_panel = getChild("top_panel"); + if (top_panel) + { + top_panel->setVisible(FALSE); + } + } + + if (p.hide_bottom_menu) + { + LLInventoryPanel *bottom_panel = getChild("bottom_panel"); + if (bottom_panel) + { + bottom_panel->setVisible(FALSE); + } + } } BOOL LLPanelMainInventory::postBuild() diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 29e9baa6cf..e447d8ce06 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -58,7 +58,19 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver public: friend class LLFloaterInventoryFinder; - LLPanelMainInventory(); + struct Params + : public LLInitParam::Block + { + Optional hide_top_menu; + Optional hide_bottom_menu; + + Params() : + hide_top_menu("hide_top_menu", false), + hide_bottom_menu("hide_bottom_menu", false) + {} + }; + + LLPanelMainInventory(const Params&); ~LLPanelMainInventory(); BOOL postBuild(); diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 30639f955f..b48c962413 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -36,10 +36,10 @@ filename="panel_main_inventory.xml" follows="all" layout="topleft" + hide_top_panel="true" left="0" label="Inventory Panel" name="Inventory Panel" top="15" - width="467"> - + width="467" /> diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index fcee0ef953..6f57d1ca80 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -103,6 +103,17 @@ width="18" /> + + diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index cbcc3f10ad..5975bb41fd 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -24,6 +24,7 @@ filename="panel_main_inventory.xml" follows="all" layout="topleft" + hide_top_panel="true" left="0" name="panel_main_inventory" top="0" -- cgit v1.2.3 From 51e3a486c6de28eb0a722edeee685192e9bde1b2 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Wed, 11 Nov 2009 14:28:40 -0800 Subject: Changes to fix an LLERRS caused by SRV request timeout. Added settings to config SRV request params Increased timeout to 10 seconds Changed timeout to generate login failure event instead of an error. Added unit test to cover SRV failure event. --- indra/newview/app_settings/settings.xml | 24 ++++++++++++++++- indra/newview/lllogininstance.cpp | 3 +++ indra/newview/tests/lllogininstance_test.cpp | 1 + indra/viewer_components/login/lllogin.cpp | 30 ++++++++++++++++------ .../viewer_components/login/tests/lllogin_test.cpp | 29 +++++++++++++++++++++ 5 files changed, 78 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6f6d5fb979..dccf4de651 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4248,7 +4248,29 @@ Value 0 - LogMessages + LoginSRVTimeout + + Comment + Duration in seconds of the login SRV request timeout + Persist + 1 + Type + F32 + Value + 10.0 + + LoginSRVPump + + Comment + Name of the message pump that handles SRV request + Persist + 1 + Type + String + Value + LLAres + + LogMessages Comment Log network traffic diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index e5f347ddc4..955347bce2 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -182,6 +182,9 @@ void LLLoginInstance::constructAuthParams(const LLSD& credentials) mRequestData["method"] = "login_to_simulator"; mRequestData["params"] = request_params; mRequestData["options"] = requested_options; + + mRequestData["cfg_srv_timeout"] = gSavedSettings.getF32("LoginSRVTimeout"); + mRequestData["cfg_srv_pump"] = gSavedSettings.getString("LoginSRVPump"); } bool LLLoginInstance::handleLoginEvent(const LLSD& event) diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index d31a81e128..7b28a3b72c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -76,6 +76,7 @@ LLControlGroup::LLControlGroup(const std::string& name) : LLControlGroup::~LLControlGroup() {} void LLControlGroup::setBOOL(const std::string& name, BOOL val) {} BOOL LLControlGroup::getBOOL(const std::string& name) { return FALSE; } +F32 LLControlGroup::getF32(const std::string& name) { return 0.0f; } U32 LLControlGroup::saveToFile(const std::string& filename, BOOL nondefault_only) { return 1; } void LLControlGroup::setString(const std::string& name, const std::string& val) {} std::string LLControlGroup::getString(const std::string& name) { return "test_string"; } diff --git a/indra/viewer_components/login/lllogin.cpp b/indra/viewer_components/login/lllogin.cpp index ea1e3ff3f9..b14c59ab9a 100644 --- a/indra/viewer_components/login/lllogin.cpp +++ b/indra/viewer_components/login/lllogin.cpp @@ -70,7 +70,7 @@ public: LLEventPump& getEventPump() { return mPump; } private: - void sendProgressEvent(const std::string& state, const std::string& change, + LLSD getProgressEventLLSD(const std::string& state, const std::string& change, const LLSD& data = LLSD()) { LLSD status_data; @@ -87,7 +87,13 @@ private: { status_data["data"] = data; } + return status_data; + } + void sendProgressEvent(const std::string& state, const std::string& change, + const LLSD& data = LLSD()) + { + LLSD status_data = getProgressEventLLSD(state, change, data); mPump.post(status_data); } @@ -140,20 +146,28 @@ void LLLogin::Impl::login_(LLCoros::self& self, std::string uri, LLSD credential // Request SRV record. LL_INFOS("LLLogin") << "Requesting SRV record from " << uri << LL_ENDL; - // *NOTE:Mani - Completely arbitrary timeout value for SRV request. - // filter.errorAfter(5, "SRV Request timed out!"); - - // + // *NOTE:Mani - Completely arbitrary default timeout value for SRV request. F32 seconds_to_timeout = 5.0f; - filter.actionAfter(seconds_to_timeout, - sendProgressEvent("offline", "fail.login", LLSD())); + if(credentials.has("cfg_srv_timeout")) + { + seconds_to_timeout = credentials["cfg_srv_timeout"].asReal(); + } + + filter.eventAfter(seconds_to_timeout, + getProgressEventLLSD("offline", "fail.login")); + + std::string srv_pump_name = "LLAres"; + if(credentials.has("cfg_srv_pump")) + { + srv_pump_name = credentials["cfg_srv_pump"].asString(); + } // Make request LLSD request; request["op"] = "rewriteURI"; request["uri"] = uri; request["reply"] = replyPump.getName(); - rewrittenURIs = postAndWait(self, request, "LLAres", filter); + rewrittenURIs = postAndWait(self, request, srv_pump_name, filter); } // we no longer need the filter LLEventPump& xmlrpcPump(LLEventPumps::instance().obtain("LLXMLRPCTransaction")); diff --git a/indra/viewer_components/login/tests/lllogin_test.cpp b/indra/viewer_components/login/tests/lllogin_test.cpp index a8ae2883d5..c3b1838422 100644 --- a/indra/viewer_components/login/tests/lllogin_test.cpp +++ b/indra/viewer_components/login/tests/lllogin_test.cpp @@ -47,6 +47,7 @@ public: bool call(const LLSD& event) { mDebug(STRINGIZE("LoginListener called!: " << event)); + mLastEvent = event; return false; } @@ -414,4 +415,32 @@ namespace tut ensure_equals("Failed to offline", listener.lastEvent()["state"].asString(), "offline"); } + + template<> template<> + void llviewerlogin_object::test<5>() + { + DEBUG; + // Test SRV request timeout. + set_test_name("LLLogin SRV timeout testing"); + + // Testing normal login procedure. + LLEventStream llaresPump("LLAres"); // Dummy LLAres pump. + + // LLAresListener dummyLLAres("dummy_llares"); + // dummyLLAres.listenTo(llaresPump); + + LLLogin login; + LoginListener listener("test_ear"); + listener.listenTo(login.getEventPump()); + + LLSD credentials; + credentials["first"] = "these"; + credentials["last"] = "don't"; + credentials["passwd"] = "matter"; + credentials["cfg_srv_timeout"] = 0.0f; + + login.connect("login.bar.com", credentials); + + ensure_equals("Failed to offline", listener.lastEvent()["change"].asString(), "srvrequest"); + } } -- cgit v1.2.3 From 6b14f9a48f18842e207013d89e4578a73ee5e7bf Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Wed, 11 Nov 2009 22:42:25 +0000 Subject: DEV-41358: Changed format of preferred maturity for search. Now preferred maturity is passed to the search web pages as an r={13|21|42} query param. --- indra/newview/llfloatersearch.cpp | 16 +++++++++++++--- indra/newview/skins/default/xui/en/floater_search.xml | 4 ++-- 2 files changed, 15 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index ca2cdffcf8..e2df2ffdf7 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -124,9 +124,19 @@ void LLFloaterSearch::search(const LLSD &key) url += "&p=" + search_token.asString(); // also append the user's preferred maturity (can be changed via prefs) - std::string maturity = "pg"; - if (gAgent.prefersMature()) maturity += ",mature"; - if (gAgent.prefersAdult()) maturity += ",adult"; + std::string maturity; + if (gAgent.prefersAdult()) + { + maturity = "42"; // PG,Mature,Adult + } + else if (gAgent.prefersMature()) + { + maturity = "21"; // PG,Mature + } + else + { + maturity = "13"; // PG + } url += "&r=" + maturity; // and load the URL in the web view diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index b9cf456842..d9498586af 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -25,7 +25,7 @@ Done -- cgit v1.2.3 From 2117b096d7733d3d6a41923e227e3bf3c3ec0d28 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 11 Nov 2009 18:13:43 -0500 Subject: EXT-2377 : Add XML switch to showing either menubar or gear menu Reverting previous checkin for enabling this. This is more complicated than worth spending time on, at the moment. --- indra/newview/llpanelmaininventory.cpp | 29 +++------------------- indra/newview/llpanelmaininventory.h | 14 +---------- .../skins/default/xui/en/panel_main_inventory.xml | 12 --------- .../skins/default/xui/en/sidepanel_inventory.xml | 1 - 4 files changed, 4 insertions(+), 52 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9b33fc1839..e3b2ab77aa 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -49,7 +49,7 @@ #include "llviewermenu.h" #include "llviewertexturelist.h" -static LLDefaultChildRegistry::Register r("panel_main_inventory"); +static LLRegisterPanelClassWrapper t_inventory("panel_main_inventory"); // Seraph is this redundant with constructor? void on_file_loaded_for_save(BOOL success, LLViewerFetchedTexture *src_vi, @@ -90,8 +90,8 @@ private: /// LLPanelMainInventory ///---------------------------------------------------------------------------- -LLPanelMainInventory::LLPanelMainInventory(const LLPanelMainInventory::Params& p) - : LLPanel(p), +LLPanelMainInventory::LLPanelMainInventory() + : LLPanel(), mActivePanel(NULL), mSavedFolderState(NULL), mFilterText(""), @@ -124,24 +124,6 @@ LLPanelMainInventory::LLPanelMainInventory(const LLPanelMainInventory::Params& p mSavedFolderState = new LLSaveFolderState(); mSavedFolderState->setApply(FALSE); - - if (p.hide_top_menu) - { - LLInventoryPanel *top_panel = getChild("top_panel"); - if (top_panel) - { - top_panel->setVisible(FALSE); - } - } - - if (p.hide_bottom_menu) - { - LLInventoryPanel *bottom_panel = getChild("bottom_panel"); - if (bottom_panel) - { - bottom_panel->setVisible(FALSE); - } - } } BOOL LLPanelMainInventory::postBuild() @@ -222,11 +204,6 @@ void LLPanelMainInventory::initListCommandsHandlers() mListCommands->childSetAction("options_gear_btn", boost::bind(&LLPanelMainInventory::onGearButtonClick, this)); mListCommands->childSetAction("trash_btn", boost::bind(&LLPanelMainInventory::onTrashButtonClick, this)); mListCommands->childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddButtonClick, this)); - /* - mListCommands->getChild("add_btn")->setHeldDownCallback(boost::bind(&LLPanelMainInventory::onAddButtonHeldDown, this)); - static const LLSD add_landmark_command("add_landmark"); - mListCommands->childSetAction("add_btn", boost::bind(&LLPanelMainInventory::onAddAction, this, add_landmark_command)); - */ LLDragAndDropButton* trash_btn = mListCommands->getChild("trash_btn"); trash_btn->setDragAndDropHandler(boost::bind(&LLPanelMainInventory::handleDragAndDropToTrash, this diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index e447d8ce06..29e9baa6cf 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -58,19 +58,7 @@ class LLPanelMainInventory : public LLPanel, LLInventoryObserver public: friend class LLFloaterInventoryFinder; - struct Params - : public LLInitParam::Block - { - Optional hide_top_menu; - Optional hide_bottom_menu; - - Params() : - hide_top_menu("hide_top_menu", false), - hide_bottom_menu("hide_bottom_menu", false) - {} - }; - - LLPanelMainInventory(const Params&); + LLPanelMainInventory(); ~LLPanelMainInventory(); BOOL postBuild(); diff --git a/indra/newview/skins/default/xui/en/panel_main_inventory.xml b/indra/newview/skins/default/xui/en/panel_main_inventory.xml index 6f57d1ca80..fcee0ef953 100644 --- a/indra/newview/skins/default/xui/en/panel_main_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_main_inventory.xml @@ -103,17 +103,6 @@ width="18" /> - - diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 5975bb41fd..cbcc3f10ad 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -24,7 +24,6 @@ filename="panel_main_inventory.xml" follows="all" layout="topleft" - hide_top_panel="true" left="0" name="panel_main_inventory" top="0" -- cgit v1.2.3 From 4f3d32f5c726f0ec301e1efefa32ef948faea03e Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Wed, 11 Nov 2009 18:23:54 -0500 Subject: Believe this fixes the remaining issues with missing attachment links on first use of 2.0 - EXT-1593 and EXT-1591. --- indra/newview/llagentwearables.cpp | 2 ++ indra/newview/llappearancemgr.cpp | 21 +++++++++++++++++++++ indra/newview/llappearancemgr.h | 1 + 3 files changed, 24 insertions(+) (limited to 'indra') diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index 3fc1055acd..7129c0cfcf 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -2023,6 +2023,8 @@ void LLInitialWearablesFetch::done() else { processWearablesMessage(); + // Create links for attachments that may have arrived before the COF existed. + LLAppearanceManager::linkRegisteredAttachments(); } delete this; } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index d14de1c301..0901289dac 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -1123,6 +1123,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) { if (do_update) LLAppearanceManager::updateAppearanceFromCOF(); + return; } else { @@ -1134,6 +1135,7 @@ void LLAppearanceManager::wearItem( LLInventoryItem* item, bool do_update ) LLAssetType::AT_LINK, cb); } + return; } /* static */ @@ -1281,3 +1283,22 @@ void LLAppearanceManager::unregisterAttachment(const LLUUID& item_id) //llinfos << "no link changes, inv link not enabled" << llendl; } } + +/* static */ +void LLAppearanceManager::linkRegisteredAttachments() +{ + for (std::set::iterator it = sRegisteredAttachments.begin(); + it != sRegisteredAttachments.end(); + ++it) + { + LLUUID item_id = *it; + LLViewerInventoryItem *item = gInventory.getItem(item_id); + if (item) + { + wearItem(item, false); + gInventory.addChangedMask(LLInventoryObserver::LABEL, item_id); + gInventory.notifyObservers(); + } + } + sRegisteredAttachments.clear(); +} diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h index 56f54dfc23..7dea16b6cf 100644 --- a/indra/newview/llappearancemgr.h +++ b/indra/newview/llappearancemgr.h @@ -71,6 +71,7 @@ public: static void unregisterAttachment(const LLUUID& item_id); static void registerAttachment(const LLUUID& item_id); static void setAttachmentInvLinkEnable(bool val); + static void linkRegisteredAttachments(); private: static void filterWearableItems(LLInventoryModel::item_array_t& items, S32 max_per_type); -- cgit v1.2.3 From 6bdd6eeb98bf44e8b16f7e63f378813f92652444 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 11 Nov 2009 19:13:33 -0500 Subject: EXT-2261 : Inventory view should show default foldres (i.e. expand My Inventory) --- indra/newview/llinventorypanel.cpp | 24 +++++++++++++++++++++--- indra/newview/llinventorypanel.h | 2 +- 2 files changed, 22 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 9a71e53441..dfd4af5c28 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -191,11 +191,9 @@ BOOL LLInventoryPanel::postBuild() { rebuildViewsFor(mStartFolderID); mHasInventoryConnection = true; + defaultOpenInventory(); } - // bit of a hack to make sure the inventory is open. - mFolders->openFolder(preferred_type != LLFolderType::FT_NONE ? LLViewerFolderType::lookupNewCategoryName(preferred_type) : "My Inventory"); - if (mSortOrderSetting != INHERIT_SORT_ORDER) { setSortOrder(gSavedSettings.getU32(mSortOrderSetting)); @@ -300,6 +298,7 @@ void LLInventoryPanel::modelChanged(U32 mask) { rebuildViewsFor(mStartFolderID); mHasInventoryConnection = true; + defaultOpenInventory(); return; } @@ -561,6 +560,25 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } } +// bit of a hack to make sure the inventory is open. +void LLInventoryPanel::defaultOpenInventory() +{ + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); + if (preferred_type != LLFolderType::FT_NONE) + { + const std::string& top_level_folder_name = LLViewerFolderType::lookupNewCategoryName(preferred_type); + mFolders->openFolder(top_level_folder_name); + } + else + { + // Get the first child (it should be "My Inventory") and + // open it up by name (just to make sure the first child is actually a folder). + LLView* first_child = mFolders->getFirstChild(); + const std::string& first_child_name = first_child->getName(); + mFolders->openFolder(first_child_name); + } +} + struct LLConfirmPurgeData { LLUUID mID; diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 9f74fad5c1..e398c44105 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -165,7 +165,7 @@ protected: // Given the id and the parent, build all of the folder views. void rebuildViewsFor(const LLUUID& id); virtual void buildNewViews(const LLUUID& id); // made virtual to support derived classes. EXT-719 - + void defaultOpenInventory(); // open the first level of inventory protected: LLInventoryModel* mInventory; LLInventoryObserver* mInventoryObserver; -- cgit v1.2.3 From 067f91f8ad57fc1eed10e1811b2c7f588d84052a Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 11 Nov 2009 19:55:37 -0500 Subject: EXT-387 : Clean up WARNINGS - Advanced.DumpAvatarLocalTextures Added menu callbacks in for avatar texture debug, but disabled functionality for release version. --- indra/newview/llviewermenu.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 976d89a5b7..728fb7c616 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1879,7 +1879,9 @@ class LLAdvancedDebugAvatarTextures : public view_listener_t { bool handleEvent(const LLSD& userdata) { +#ifndef LL_RELEASE_FOR_DOWNLOAD handle_debug_avatar_textures(NULL); +#endif return true; } }; @@ -1893,7 +1895,9 @@ class LLAdvancedDumpAvatarLocalTextures : public view_listener_t { bool handleEvent(const LLSD& userdata) { +#ifndef LL_RELEASE_FOR_DOWNLOAD handle_dump_avatar_local_textures(NULL); +#endif return true; } }; @@ -7860,10 +7864,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckDebugCharacterVis(), "Advanced.CheckDebugCharacterVis"); view_listener_t::addMenu(new LLAdvancedDumpAttachments(), "Advanced.DumpAttachments"); view_listener_t::addMenu(new LLAdvancedRebakeTextures(), "Advanced.RebakeTextures"); - #ifndef LL_RELEASE_FOR_DOWNLOAD view_listener_t::addMenu(new LLAdvancedDebugAvatarTextures(), "Advanced.DebugAvatarTextures"); view_listener_t::addMenu(new LLAdvancedDumpAvatarLocalTextures(), "Advanced.DumpAvatarLocalTextures"); - #endif // Advanced > Network view_listener_t::addMenu(new LLAdvancedEnableMessageLog(), "Advanced.EnableMessageLog"); view_listener_t::addMenu(new LLAdvancedDisableMessageLog(), "Advanced.DisableMessageLog"); -- cgit v1.2.3 From bcdd3c25b6bcfaac7849e9aad6fd6c9bb2da1e82 Mon Sep 17 00:00:00 2001 From: Loren Shih Date: Wed, 11 Nov 2009 20:21:45 -0500 Subject: Took out unnecessary llinfos msg from LLInventoryModel. --- indra/newview/llinventorymodel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index c56feab588..d455c7bdbf 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -1147,7 +1147,6 @@ void LLInventoryModel::notifyObservers(const std::string service_name) return; } mIsNotifyObservers = TRUE; - llinfos << "Start process notifyObservers for " << this << llendl; for (observer_list_t::iterator iter = mObservers.begin(); iter != mObservers.end(); ) { -- cgit v1.2.3 From 393f68c1a9785b29adc210124e342af24937d5f5 Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 12 Nov 2009 12:36:30 +0000 Subject: DEV-2925: Added a new remote object inspector. This is used to display details about objects that may not be in the current scene (the existing object inspector is tied to selection and only works for objects in the scene). The remote inspector lets you see the name and owner of the object. You can also teleport to the object's location, view the location on the map, or mute the object. I've also added more information to the notification you receive when an object sends you an IM via llInstantMessage(). This notification now has an "Inspect" button that brings up the remote object inspector. --- indra/newview/CMakeLists.txt | 2 + indra/newview/llinspectremoteobject.cpp | 200 +++++++++++++++++++++ indra/newview/llinspectremoteobject.h | 40 +++++ indra/newview/llviewerfloaterreg.cpp | 2 + indra/newview/llviewermessage.cpp | 28 ++- .../skins/default/xui/en/inspect_remote_object.xml | 99 ++++++++++ .../newview/skins/default/xui/en/notifications.xml | 5 + 7 files changed, 375 insertions(+), 1 deletion(-) create mode 100644 indra/newview/llinspectremoteobject.cpp create mode 100644 indra/newview/llinspectremoteobject.h create mode 100644 indra/newview/skins/default/xui/en/inspect_remote_object.xml (limited to 'indra') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 13c381edae..3b18b7d700 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -246,6 +246,7 @@ set(viewer_SOURCE_FILES llinspectavatar.cpp llinspectgroup.cpp llinspectobject.cpp + llinspectremoteobject.cpp llinventorybridge.cpp llinventoryclipboard.cpp llinventoryfilter.cpp @@ -741,6 +742,7 @@ set(viewer_HEADER_FILES llinspectavatar.h llinspectgroup.h llinspectobject.h + llinspectremoteobject.h llinventorybridge.h llinventoryclipboard.h llinventoryfilter.h diff --git a/indra/newview/llinspectremoteobject.cpp b/indra/newview/llinspectremoteobject.cpp new file mode 100644 index 0000000000..e4d2eec242 --- /dev/null +++ b/indra/newview/llinspectremoteobject.cpp @@ -0,0 +1,200 @@ +/** + * @file llinspectremoteobject.cpp + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llinspectremoteobject.h" +#include "llinspect.h" +#include "llslurl.h" +#include "llmutelist.h" +#include "llurlaction.h" +#include "llpanelblockedlist.h" +#include "llfloaterreg.h" +#include "llui.h" +#include "lluictrl.h" + +class LLViewerObject; + +////////////////////////////////////////////////////////////////////////////// +// LLInspectRemoteObject +////////////////////////////////////////////////////////////////////////////// + +// Remote Object Inspector, a small information window used to +// display information about potentially-remote objects. Used +// to display details about objects sending messages to the user. +class LLInspectRemoteObject : public LLInspect +{ + friend class LLFloaterReg; + +public: + LLInspectRemoteObject(const LLSD& object_id); + virtual ~LLInspectRemoteObject() {}; + + /*virtual*/ BOOL postBuild(void); + /*virtual*/ void onOpen(const LLSD& avatar_id); + + void onClickMap(); + void onClickBlock(); + void onClickClose(); + +private: + void update(); + static void nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data); + +private: + LLUUID mObjectID; + LLUUID mOwnerID; + std::string mOwner; + std::string mSLurl; + std::string mName; + bool mGroupOwned; +}; + +LLInspectRemoteObject::LLInspectRemoteObject(const LLSD& sd) : + LLInspect(LLSD()), + mObjectID(NULL), + mOwnerID(NULL), + mOwner(""), + mSLurl(""), + mName(""), + mGroupOwned(false) +{ +} + +/*virtual*/ +BOOL LLInspectRemoteObject::postBuild(void) +{ + // hook up the inspector's buttons + getChild("map_btn")->setCommitCallback( + boost::bind(&LLInspectRemoteObject::onClickMap, this)); + getChild("block_btn")->setCommitCallback( + boost::bind(&LLInspectRemoteObject::onClickBlock, this)); + getChild("close_btn")->setCommitCallback( + boost::bind(&LLInspectRemoteObject::onClickClose, this)); + + return TRUE; +} + +/*virtual*/ +void LLInspectRemoteObject::onOpen(const LLSD& data) +{ + // Start animation + LLInspect::onOpen(data); + + // Extract appropriate object information from input LLSD + // (Eventually, it might be nice to query server for details + // rather than require caller to pass in the information.) + mObjectID = data["object_id"].asUUID(); + mName = data["name"].asString(); + mOwnerID = data["owner_id"].asUUID(); + mGroupOwned = data["group_owned"].asBoolean(); + mSLurl = data["slurl"].asString(); + + // work out the owner's name + mOwner = ""; + if (gCacheName) + { + gCacheName->get(mOwnerID, mGroupOwned, nameCallback, this); + } + + // update the inspector with the current object state + update(); + + // Position the inspector relative to the mouse cursor + LLUI::positionViewNearMouse(this); +} + +void LLInspectRemoteObject::onClickMap() +{ + std::string url = "secondlife://" + mSLurl; + LLUrlAction::showLocationOnMap(url); + closeFloater(); +} + +void LLInspectRemoteObject::onClickBlock() +{ + LLMute::EType mute_type = mGroupOwned ? LLMute::GROUP : LLMute::AGENT; + LLMute mute(mOwnerID, mOwner, mute_type); + LLMuteList::getInstance()->add(mute); + LLPanelBlockedList::showPanelAndSelect(mute.mID); + closeFloater(); +} + +void LLInspectRemoteObject::onClickClose() +{ + closeFloater(); +} + +//static +void LLInspectRemoteObject::nameCallback(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data) +{ + LLInspectRemoteObject *self = (LLInspectRemoteObject*)data; + self->mOwner = first; + if (!last.empty()) + { + self->mOwner += " " + last; + } + self->update(); +} + +void LLInspectRemoteObject::update() +{ + // show the object name as the inspector's title + getChild("object_name")->setValue(mName); + + // show the object's owner - click it to show profile + std::string owner = mOwner; + if (! mOwnerID.isNull()) + { + if (mGroupOwned) + { + owner = LLSLURL::buildCommand("group", mOwnerID, "about"); + } + else + { + owner = LLSLURL::buildCommand("agent", mOwnerID, "about"); + } + } + getChild("object_owner")->setValue(owner); + + // display the object's SLurl - click it to teleport + std::string url = "secondlife:///app/teleport/" + mSLurl; + getChild("object_slurl")->setValue(url); +} + +////////////////////////////////////////////////////////////////////////////// +// LLInspectRemoteObjectUtil +////////////////////////////////////////////////////////////////////////////// +void LLInspectRemoteObjectUtil::registerFloater() +{ + LLFloaterReg::add("inspect_remote_object", "inspect_remote_object.xml", + &LLFloaterReg::build); +} diff --git a/indra/newview/llinspectremoteobject.h b/indra/newview/llinspectremoteobject.h new file mode 100644 index 0000000000..e756f1caf4 --- /dev/null +++ b/indra/newview/llinspectremoteobject.h @@ -0,0 +1,40 @@ +/** + * @file llinspectremoteobject.h + * + * $LicenseInfo:firstyear=2009&license=viewergpl$ + * + * Copyright (c) 2009, Linden Research, Inc. + * + * Second Life Viewer Source Code + * The source code in this file ("Source Code") is provided by Linden Lab + * to you under the terms of the GNU General Public License, version 2.0 + * ("GPL"), unless you have obtained a separate licensing agreement + * ("Other License"), formally executed by you and Linden Lab. Terms of + * the GPL can be found in doc/GPL-license.txt in this distribution, or + * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 + * + * There are special exceptions to the terms and conditions of the GPL as + * it is applied to this Source Code. View the full text of the exception + * in the file doc/FLOSS-exception.txt in this software distribution, or + * online at + * http://secondlifegrid.net/programs/open_source/licensing/flossexception + * + * By copying, modifying or distributing this software, you acknowledge + * that you have read and understood your obligations described above, + * and agree to abide by those obligations. + * + * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO + * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, + * COMPLETENESS OR PERFORMANCE. + * $/LicenseInfo$ + */ + +#ifndef LLINSPECTREMOTEOBJECT_H +#define LLINSPECTREMOTEOBJECT_H + +namespace LLInspectRemoteObjectUtil +{ + void registerFloater(); +} + +#endif diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index edbac69e1b..964d3bc2fa 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -112,6 +112,7 @@ #include "llinspectavatar.h" #include "llinspectgroup.h" #include "llinspectobject.h" +#include "llinspectremoteobject.h" #include "llmediaremotectrl.h" #include "llmoveview.h" #include "llnearbychat.h" @@ -176,6 +177,7 @@ void LLViewerFloaterReg::registerFloaters() LLInspectAvatarUtil::registerFloater(); LLInspectGroupUtil::registerFloater(); LLInspectObjectUtil::registerFloater(); + LLInspectRemoteObjectUtil::registerFloater(); LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index a90790c59a..6d6fc5f49f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -1431,6 +1431,17 @@ bool goto_url_callback(const LLSD& notification, const LLSD& response) } static LLNotificationFunctorRegistration goto_url_callback_reg("GotoURL", goto_url_callback); +bool inspect_remote_object_callback(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + if (0 == option) + { + LLFloaterReg::showInstance("inspect_remote_object", notification["payload"]); + } + return false; +} +static LLNotificationFunctorRegistration inspect_remote_object_callback_reg("ServerObjectMessage", inspect_remote_object_callback); + void process_improved_im(LLMessageSystem *msg, void **user_data) { if (gNoRender) @@ -1952,9 +1963,24 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) return; } + // Build a link to open the object IM info window. + std::string location = ll_safe_string((char*)binary_bucket,binary_bucket_size); + LLStringUtil::trim(location); + LLSD substitutions; + substitutions["NAME"] = name; substitutions["MSG"] = message.substr(message_offset); - LLNotifications::instance().add("ServerObjectMessage", substitutions); + + LLSD payload; + payload["object_id"] = session_id; + payload["owner_id"] = from_id; + payload["slurl"] = location; + payload["name"] = name; + if (from_group) + { + payload["groupowned"] = "true"; + } + LLNotifications::instance().add("ServerObjectMessage", substitutions, payload); } break; case IM_FROM_TASK_AS_ALERT: diff --git a/indra/newview/skins/default/xui/en/inspect_remote_object.xml b/indra/newview/skins/default/xui/en/inspect_remote_object.xml new file mode 100644 index 0000000000..07c684d904 --- /dev/null +++ b/indra/newview/skins/default/xui/en/inspect_remote_object.xml @@ -0,0 +1,99 @@ + + + + + Test Object Name That Is Really Long + + + Owner: + + + Longavatarname Johnsonlongstonnammer + + + Location: + + + http://slurl.com/Ahern/50/50/50 + +