diff --git a/indra/newview/fsdata.cpp b/indra/newview/fsdata.cpp index c0965faa0a..25c07c1a5c 100644 --- a/indra/newview/fsdata.cpp +++ b/indra/newview/fsdata.cpp @@ -764,10 +764,12 @@ LLSD FSData::allowedLogin() if(block.has("gridtype")) { blocked = false; +#ifdef OPENSIM if ((block["gridtype"].asString() == "opensim") && LLGridManager::getInstance()->isInOpenSim()) { return block; } +#endif if ((block["gridtype"].asString() == "secondlife") && LLGridManager::getInstance()->isInSecondLife()) { return block; diff --git a/indra/newview/fsfloatersearch.cpp b/indra/newview/fsfloatersearch.cpp index ef9de543e7..77f95a704f 100644 --- a/indra/newview/fsfloatersearch.cpp +++ b/indra/newview/fsfloatersearch.cpp @@ -286,6 +286,12 @@ void FSFloaterSearch::onOpen(const LLSD& key) { mTabContainer->selectTabPanel(mPanelGroups); } + + FSSearchPanelBase* current_panel = dynamic_cast(mTabContainer->getCurrentPanel()); + if (current_panel) + { + current_panel->focusDefaultElement(); + } } //virtual @@ -713,7 +719,7 @@ void FSFloaterSearch::onBtnEventReminder() static LLPanelInjector t_panel_fs_search_people("panel_ls_people"); -FSPanelSearchPeople::FSPanelSearchPeople() : LLPanel() +FSPanelSearchPeople::FSPanelSearchPeople() : FSSearchPanelBase() , mQueryID(NULL) , mStartSearch(0) , mResultsReceived(0) @@ -749,6 +755,11 @@ BOOL FSPanelSearchPeople::postBuild() return TRUE; } +void FSPanelSearchPeople::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + void FSPanelSearchPeople::find() { std::string text = mSearchComboBox->getSimple(); @@ -976,7 +987,7 @@ void FSPanelSearchPeople::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_groups("panel_ls_groups"); -FSPanelSearchGroups::FSPanelSearchGroups() : LLPanel() +FSPanelSearchGroups::FSPanelSearchGroups() : FSSearchPanelBase() , mQueryID(NULL) , mStartSearch(0) , mResultsReceived(0) @@ -1012,6 +1023,11 @@ BOOL FSPanelSearchGroups::postBuild() return TRUE; } +void FSPanelSearchGroups::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + void FSPanelSearchGroups::find() { std::string text = filterShortWords(mSearchComboBox->getSimple()); @@ -1261,7 +1277,7 @@ void FSPanelSearchGroups::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_places("panel_ls_places"); -FSPanelSearchPlaces::FSPanelSearchPlaces() : LLPanel() +FSPanelSearchPlaces::FSPanelSearchPlaces() : FSSearchPanelBase() , mQueryID(NULL) , mStartSearch(0) , mResultsReceived(0) @@ -1308,6 +1324,11 @@ BOOL FSPanelSearchPlaces::postBuild() return TRUE; } +void FSPanelSearchPlaces::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + void FSPanelSearchPlaces::find() { std::string text = filterShortWords(mSearchComboBox->getSimple()); @@ -1593,7 +1614,7 @@ void FSPanelSearchPlaces::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_land("panel_ls_land"); -FSPanelSearchLand::FSPanelSearchLand() : LLPanel() +FSPanelSearchLand::FSPanelSearchLand() : FSSearchPanelBase() , mQueryID(NULL) , mStartSearch(0) , mResultsReceived(0) @@ -1944,7 +1965,7 @@ void FSPanelSearchLand::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_classifieds("panel_ls_classifieds"); -FSPanelSearchClassifieds::FSPanelSearchClassifieds() : LLPanel() +FSPanelSearchClassifieds::FSPanelSearchClassifieds() : FSSearchPanelBase() , mQueryID(NULL) , mStartSearch(0) , mResultsReceived(0) @@ -1995,6 +2016,11 @@ BOOL FSPanelSearchClassifieds::postBuild() return TRUE; } +void FSPanelSearchClassifieds::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + void FSPanelSearchClassifieds::find() { std::string text = filterShortWords(mSearchComboBox->getSimple()); @@ -2246,7 +2272,7 @@ void FSPanelSearchClassifieds::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_events("panel_ls_events"); -FSPanelSearchEvents::FSPanelSearchEvents() : LLPanel() +FSPanelSearchEvents::FSPanelSearchEvents() : FSSearchPanelBase() , mQueryID(NULL) , mResultsReceived(0) , mStartSearch(0) @@ -2298,6 +2324,11 @@ BOOL FSPanelSearchEvents::postBuild() return TRUE; } +void FSPanelSearchEvents::focusDefaultElement() +{ + mSearchComboBox->focusTextEntry(); +} + void FSPanelSearchEvents::find() { std::string text = filterShortWords(mSearchComboBox->getSimple()); @@ -2658,7 +2689,7 @@ void FSPanelSearchEvents::processSearchReply(LLMessageSystem* msg, void**) static LLPanelInjector t_panel_fs_search_web("panel_ls_web"); -FSPanelSearchWeb::FSPanelSearchWeb() : LLPanel() +FSPanelSearchWeb::FSPanelSearchWeb() : FSSearchPanelBase() , mWebBrowser(NULL) { // declare a map that transforms a category name into diff --git a/indra/newview/fsfloatersearch.h b/indra/newview/fsfloatersearch.h index 78a700bbcf..04b4b475f1 100644 --- a/indra/newview/fsfloatersearch.h +++ b/indra/newview/fsfloatersearch.h @@ -63,20 +63,30 @@ struct SearchQuery : public LLInitParam::Block // Search Panels // /////////////////////////////// -class FSPanelSearchPeople : public LLPanel +class FSSearchPanelBase : public LLPanel +{ +public: + FSSearchPanelBase() : LLPanel() { } + virtual ~FSSearchPanelBase() { } + virtual void focusDefaultElement() { } +}; + +class FSPanelSearchPeople : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchPeople(); static void processSearchReply(LLMessageSystem* msg, void**); + /*virtual*/ void focusDefaultElement(); + protected: const S32& getNumResultsReturned() const { return mNumResultsReturned; }; const S32& getNumResultsReceived() const { return mResultsReceived; }; private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchPeople(); + virtual ~FSPanelSearchPeople(); void onBtnFind(); void onSelectItem(); @@ -101,16 +111,18 @@ private: LLScrollListCtrl* mSearchResults; }; -class FSPanelSearchGroups : public LLPanel +class FSPanelSearchGroups : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchGroups(); static void processSearchReply(LLMessageSystem* msg, void**); -protected: + + /*virtual*/ void focusDefaultElement(); + private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchGroups(); + virtual ~FSPanelSearchGroups(); void onBtnFind(); void onSelectItem(); @@ -135,16 +147,18 @@ private: LLScrollListCtrl* mSearchResults; }; -class FSPanelSearchPlaces : public LLPanel +class FSPanelSearchPlaces : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchPlaces(); static void processSearchReply(LLMessageSystem* msg, void**); -protected: + + /*virtual*/ void focusDefaultElement(); + private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchPlaces(); + virtual ~FSPanelSearchPlaces(); void onBtnFind(); void onSelectItem(); @@ -170,7 +184,7 @@ private: LLComboBox* mPlacesCategory; }; -class FSPanelSearchLand : public LLPanel +class FSPanelSearchLand : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: @@ -179,7 +193,7 @@ public: protected: private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchLand(); + virtual ~FSPanelSearchLand(); void onBtnFind(); void onSelectItem(); @@ -205,16 +219,18 @@ private: LLScrollListCtrl* mSearchResults; }; -class FSPanelSearchClassifieds : public LLPanel +class FSPanelSearchClassifieds : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchClassifieds(); static void processSearchReply(LLMessageSystem* msg, void**); -protected: + + /*virtual*/ void focusDefaultElement(); + private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchClassifieds(); + virtual ~FSPanelSearchClassifieds(); void onBtnFind(); void onSelectItem(); @@ -240,16 +256,18 @@ private: LLComboBox* mClassifiedsCategory; }; -class FSPanelSearchEvents : public LLPanel +class FSPanelSearchEvents : public FSSearchPanelBase { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchEvents(); static void processSearchReply(LLMessageSystem* msg, void**); -protected: + + /*virtual*/ void focusDefaultElement(); + private: /*virtual*/ BOOL postBuild(); - /*virtual*/ ~FSPanelSearchEvents(); + virtual ~FSPanelSearchEvents(); void onBtnFind(); void onSelectItem(); @@ -281,15 +299,16 @@ private: LLRadioGroup* mEventsMode; }; -class FSPanelSearchWeb : public LLPanel, public LLViewerMediaObserver +class FSPanelSearchWeb : public FSSearchPanelBase, public LLViewerMediaObserver { LOG_CLASS(FSFloaterSearch); public: FSPanelSearchWeb(); /*virtual*/ BOOL postBuild(); void loadURL(const SearchQuery &query); + private: - ~FSPanelSearchWeb() {}; + virtual ~FSPanelSearchWeb() {}; LLMediaCtrl* mWebBrowser; LLSD mCategoryPaths; diff --git a/indra/newview/llsearchcombobox.h b/indra/newview/llsearchcombobox.h index 68f3979532..8e0c77bdd7 100755 --- a/indra/newview/llsearchcombobox.h +++ b/indra/newview/llsearchcombobox.h @@ -61,6 +61,9 @@ public: ~LLSearchComboBox(); + // Made publicly accessible + void focusTextEntry(); + protected: LLSearchComboBox(const Params&p); @@ -96,7 +99,8 @@ protected: /** * Sets focus to text box */ - void focusTextEntry(); + // Made publicly accessible + //void focusTextEntry(); LLButton* mSearchButton; }; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 33369ec591..e6f5352fc7 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -9133,10 +9133,13 @@ class FSAddToContactSet : public view_listener_t { bool handleEvent(const LLSD& userdata) { - LLVOAvatar* avatarp = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); - if (avatarp) + if (!rlv_handler_t::isEnabled() || !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) { - LLFloaterReg::showInstance("fs_add_contact", LLSD(avatarp->getID()), TRUE); + LLVOAvatar* avatarp = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject()); + if (avatarp) + { + LLFloaterReg::showInstance("fs_add_contact", LLSD(avatarp->getID()), TRUE); + } } return true; }