diff --git a/indra/cmake/Python.cmake b/indra/cmake/Python.cmake index 748c8c2be..83a0690c6 100644 --- a/indra/cmake/Python.cmake +++ b/indra/cmake/Python.cmake @@ -20,10 +20,12 @@ if (WINDOWS) [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_CURRENT_USER\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] ) -elseif (EXISTS /etc/debian_version) - # On Debian and Ubuntu, avoid Python 2.4 if possible. - find_program(PYTHON_EXECUTABLE python2.5 python2.3 python PATHS /usr/bin) + +elseif (EXISTS /etc/arch-release) + # On Archlinux, use Python 2 + + find_program(PYTHON_EXECUTABLE python2 PATHS /usr/bin) if (PYTHON_EXECUTABLE) set(PYTHONINTERP_FOUND ON) diff --git a/indra/cwdebug/debug.h b/indra/cwdebug/debug.h index e14fb18b9..4167813ea 100644 --- a/indra/cwdebug/debug.h +++ b/indra/cwdebug/debug.h @@ -275,7 +275,7 @@ class TeeStream : public std::ostream { }; #if CWDEBUG_LOCATION -class BackTrace { +class LL_COMMON_API BackTrace { private: boost::shared_array M_buffer; int M_frames; diff --git a/indra/llmessage/aicurlperservice.cpp b/indra/llmessage/aicurlperservice.cpp index 8b00d32b6..6f6047bae 100644 --- a/indra/llmessage/aicurlperservice.cpp +++ b/indra/llmessage/aicurlperservice.cpp @@ -122,6 +122,20 @@ AIPerService::AIPerService(AIPerService const&) : mHTTPBandwidth(0) // - userinfo does not contain a '@', and if it exists, is always terminated by a '@'. // - port does not contain a ':', and if it exists is always prepended by a ':'. // +// This function also needs to deal with full paths, in which case it should return +// an empty string. +// +// Full paths can have the form: "/something..." +// or "C:\something..." +// and maybe even "C:/something..." +// +// The first form leads to an empty string being returned because the '/' signals the +// end of the authority and we'll return immediately. +// The second one will abort when hitting the backslash because that is an illegal +// character in an url (before the first '/' anyway). +// The third will abort because "C:" would be the hostname and a colon in the hostname +// is not legal. +// //static std::string AIPerService::extract_canonical_servicename(std::string const& url) { @@ -159,8 +173,13 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url) } else { - // Found slash that is not part of the "sheme://" string. Signals end of authority. + // Found a slash that is not part of the "sheme://" string. Signals end of authority. // We're done. + if (hostname < sheme_colon) + { + // This happens when windows filenames are passed to this function of the form "C:/..." + servicename.clear(); + } break; } } @@ -173,6 +192,12 @@ std::string AIPerService::extract_canonical_servicename(std::string const& url) servicename.clear(); // Remove the "userinfo@" } } + else if (c == '\\') + { + // Found a backslash, which is an illegal character for an URL. This is a windows path... reject it. + servicename.clear(); + break; + } if (p >= hostname) { // Convert hostname to lowercase in a way that we compare two hostnames equal iff libcurl does. diff --git a/indra/llmessage/aicurlthread.cpp b/indra/llmessage/aicurlthread.cpp index 4a9c9198c..6ede742b8 100644 --- a/indra/llmessage/aicurlthread.cpp +++ b/indra/llmessage/aicurlthread.cpp @@ -2196,6 +2196,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size return header_len; } std::string header(header_line, header_len); + bool being_redirected = false; bool done = false; if (!LLStringUtil::_isASCII(header)) { @@ -2240,7 +2241,7 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size if (status >= 300 && status < 400) { // Timeout administration needs to know if we're being redirected. - self_w->httptimeout()->being_redirected(); + being_redirected = true; } } // Update HTTP bandwidth. @@ -2254,6 +2255,14 @@ size_t BufferedCurlEasyRequest::curlHeaderCallback(char* data, size_t size, size // Transfer timed out. Return 0 which will abort with error CURLE_WRITE_ERROR. return 0; } + if (being_redirected) + { + // Call this after data_received(), because that might reset mBeingRedirected if it causes a late- upload_finished! + // Ie, when the upload finished was not detected and this is a redirect header then the call to data_received() + // will call upload_finished() which sets HTTPTimeout::mUploadFinished (and resets HTTPTimeout::mBeingRedirected), + // after which we set HTTPTimeout::mBeingRedirected here because we ARE being redirected. + self_w->httptimeout()->being_redirected(); + } if (done) { return header_len; diff --git a/indra/llmessage/aihttptimeout.cpp b/indra/llmessage/aihttptimeout.cpp index 22dbb1cfd..bfb0f767b 100644 --- a/indra/llmessage/aihttptimeout.cpp +++ b/indra/llmessage/aihttptimeout.cpp @@ -157,7 +157,10 @@ void HTTPTimeout::upload_starting(void) // | void HTTPTimeout::upload_finished(void) { + // Disable this assert when there isn't enough debug output to do anything with it. +#if defined(CWDEBUG) || defined(DEBUG_CURLIO) llassert(!mUploadFinished); // If we get here twice, then the 'upload finished' detection failed. +#endif mUploadFinished = true; // Only accept a call to upload_starting() if being_redirected() is called after this point. mBeingRedirected = false; diff --git a/indra/llui/llkeywords.cpp b/indra/llui/llkeywords.cpp index 972209859..e3a2795fb 100644 --- a/indra/llui/llkeywords.cpp +++ b/indra/llui/llkeywords.cpp @@ -367,7 +367,7 @@ void LLKeywords::findSegments(std::vector* seg_list, const LLW return; } - S32 text_len = wtext.size() + 1; + S32 text_len = wtext.size(); seg_list->push_back( new LLTextSegment( LLColor3(defaultColor), 0, text_len ) ); @@ -584,6 +584,7 @@ void LLKeywords::insertSegment(std::vector& seg_list, LLTextSe { LLTextSegmentPtr last = seg_list.back(); S32 new_seg_end = new_segment->getEnd(); + llassert(new_seg_end <= text_len); if( new_segment->getStart() == last->getStart() ) { diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index f5950aff3..ac2be6bf2 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -776,8 +776,7 @@ void LLPanel::childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl* LLUICtrl* child = getChild(id, true); if (child) { - child->setCommitCallback(cb); - child->setCallbackUserData(userdata); + child->setCommitCallback(cb, userdata); } } @@ -790,15 +789,6 @@ void LLPanel::childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void } } -void LLPanel::childSetUserData(const std::string& id, void* userdata) -{ - LLUICtrl* child = getChild(id, true); - if (child) - { - child->setCallbackUserData(userdata); - } -} - void LLPanel::childSetColor(const std::string& id, const LLColor4& color) { LLUICtrl* child = getChild(id, true); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 768476b5f..cafc8cf46 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -174,7 +174,6 @@ public: void childSetCommitCallback(const std::string& id, void (*cb)(LLUICtrl*, void*), void* userdata = NULL ); void childSetValidate(const std::string& id, BOOL (*cb)(LLUICtrl*, void*) ); - void childSetUserData(const std::string& id, void* userdata); void childSetColor(const std::string& id, const LLColor4& color); void childSetAlpha(const std::string& id, F32 alpha); diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index a5bbc9b90..3f198bbaf 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -3869,16 +3869,14 @@ LLScrollColumnHeader::LLScrollColumnHeader(const std::string& label, const LLRec mHasResizableElement(FALSE) { mListPosition = LLComboBox::ABOVE; - setCommitCallback(onSelectSort); - setCallbackUserData(this); + setCommitCallback(boost::bind(&LLScrollColumnHeader::onSelectSort, this)); mButton->setTabStop(FALSE); // require at least two frames between mouse down and mouse up event to capture intentional "hold" not just bad framerate mButton->setHeldDownDelay(LLUI::sConfigGroup->getF32("ColumnHeaderDropDownDelay"), 2); - mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::onHeldDown, this)); + mButton->setHeldDownCallback(boost::bind(&LLScrollColumnHeader::showList, this)); mButton->setClickedCallback(boost::bind(&LLScrollColumnHeader::onClick, this)); mButton->setMouseDownCallback(boost::bind(&LLScrollColumnHeader::onMouseDown, this)); - mButton->setCallbackUserData(this); mButton->setToolTip(label); mAscendingText = std::string("[LOW]...[HIGH](Ascending)"); // *TODO: Translate @@ -4037,7 +4035,7 @@ BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask) } else { - onClick(this); + onClick(); } return TRUE; } @@ -4065,42 +4063,29 @@ void LLScrollColumnHeader::setImageOverlay(const std::string &image_name, LLFont } } -//static -void LLScrollColumnHeader::onClick(void* user_data) +void LLScrollColumnHeader::onClick() { - LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data; - if (!headerp) return; + if (!mColumn) return; - LLScrollListColumn* column = headerp->mColumn; - if (!column) return; - - if (headerp->mList->getVisible()) + if (mList->getVisible()) { - headerp->hideList(); + hideList(); } - LLScrollListCtrl::onClickColumn(column); + LLScrollListCtrl::onClickColumn(mColumn); // propagate new sort order to sort order list - headerp->mList->selectNthItem(column->mParentCtrl->getSortAscending() ? 0 : 1); + mList->selectNthItem(mColumn->mParentCtrl->getSortAscending() ? 0 : 1); - headerp->mList->setFocus(TRUE); + mList->setFocus(TRUE); } -//static -void LLScrollColumnHeader::onMouseDown(void* user_data) +void LLScrollColumnHeader::onMouseDown() { // for now, do nothing but block the normal showList() behavior return; } -//static -void LLScrollColumnHeader::onHeldDown(void* user_data) -{ - LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data; - headerp->showList(); -} - void LLScrollColumnHeader::showList() { if (mShowSortOptions) @@ -4183,30 +4168,25 @@ void LLScrollColumnHeader::showList() } } -//static -void LLScrollColumnHeader::onSelectSort(LLUICtrl* ctrl, void* user_data) +void LLScrollColumnHeader::onSelectSort() { - LLScrollColumnHeader* headerp = (LLScrollColumnHeader*)user_data; - if (!headerp) return; - - LLScrollListColumn* column = headerp->mColumn; - if (!column) return; - LLScrollListCtrl *parent = column->mParentCtrl; + if (!mColumn) return; + LLScrollListCtrl* parent = mColumn->mParentCtrl; if (!parent) return; - if (headerp->getCurrentIndex() == 0) + if (getCurrentIndex() == 0) { // ascending - parent->sortByColumn(column->mSortingColumn, TRUE); + parent->sortByColumn(mColumn->mSortingColumn, TRUE); } else { // descending - parent->sortByColumn(column->mSortingColumn, FALSE); + parent->sortByColumn(mColumn->mSortingColumn, FALSE); } // restore original column header - headerp->setLabel(headerp->mOrigLabel); + setLabel(mOrigLabel); } LLView* LLScrollColumnHeader::findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding) diff --git a/indra/llui/llscrolllistctrl.h b/indra/llui/llscrolllistctrl.h index 70f490dcc..528f413ed 100644 --- a/indra/llui/llscrolllistctrl.h +++ b/indra/llui/llscrolllistctrl.h @@ -241,10 +241,9 @@ public: void enableResizeBar(BOOL enable); std::string getLabel() { return mOrigLabel; } - static void onSelectSort(LLUICtrl* ctrl, void* user_data); - static void onClick(void* user_data); - static void onMouseDown(void* user_data); - static void onHeldDown(void* user_data); + void onSelectSort(); + void onClick(); + void onMouseDown(); private: LLScrollListColumn* mColumn; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 44dea9cd1..efbd3404f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -684,6 +684,17 @@ Value 0 + LiruLegacyOutfitStoreObjChanges + + Comment + While true, automatic detach is performed upon all copyable attachments just before legacy outfit creation to preserve any modifications to them. As a last resort, setting this false allows creating a legacy outfit that won't save changes made to copyable attachments since wearing them or login. + Persist + 1 + Type + Boolean + Value + 1 + LiruNoTransactionClutter Comment diff --git a/indra/newview/app_settings/settings_ascent.xml b/indra/newview/app_settings/settings_ascent.xml index dd8d4e606..57f972799 100644 --- a/indra/newview/app_settings/settings_ascent.xml +++ b/indra/newview/app_settings/settings_ascent.xml @@ -620,5 +620,16 @@ Value /away + SinguCompleteNameProfiles + + Comment + Use the complete name "Display Name (legacy.name)" in profiles, instead of following the choice set by PhoenixNameSystem. + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/ascentprefsvan.cpp b/indra/newview/ascentprefsvan.cpp index 9802144ec..7d8de21ea 100644 --- a/indra/newview/ascentprefsvan.cpp +++ b/indra/newview/ascentprefsvan.cpp @@ -192,6 +192,7 @@ void LLPrefsAscentVan::refreshValues() mAnnounceSnapshots = gSavedSettings.getBOOL("AnnounceSnapshots"); mAnnounceStreamMetadata = gSavedSettings.getBOOL("AnnounceStreamMetadata"); mUnfocusedFloatersOpaque = gSavedSettings.getBOOL("FloaterUnfocusedBackgroundOpaque"); + mCompleteNameProfiles = gSavedSettings.getBOOL("SinguCompleteNameProfiles"); //Tags\Colors ---------------------------------------------------------------------------- mAscentBroadcastTag = gSavedSettings.getBOOL("AscentBroadcastTag"); @@ -261,6 +262,7 @@ void LLPrefsAscentVan::cancel() gSavedSettings.setBOOL("AnnounceSnapshots", mAnnounceSnapshots); gSavedSettings.setBOOL("AnnounceStreamMetadata", mAnnounceStreamMetadata); gSavedSettings.setBOOL("FloaterUnfocusedBackgroundOpaque", mUnfocusedFloatersOpaque); + gSavedSettings.setBOOL("SinguCompleteNameProfiles", mCompleteNameProfiles); //Tags\Colors ---------------------------------------------------------------------------- gSavedSettings.setBOOL("AscentBroadcastTag", mAscentBroadcastTag); diff --git a/indra/newview/ascentprefsvan.h b/indra/newview/ascentprefsvan.h index 78984b3c5..b9eaa18e4 100644 --- a/indra/newview/ascentprefsvan.h +++ b/indra/newview/ascentprefsvan.h @@ -63,6 +63,7 @@ protected: bool mAnnounceSnapshots; bool mAnnounceStreamMetadata; bool mUnfocusedFloatersOpaque; + bool mCompleteNameProfiles; //Tags\Colors BOOL mAscentBroadcastTag; std::string mReportClientUUID; diff --git a/indra/newview/hippofloaterxml.cpp b/indra/newview/hippofloaterxml.cpp index 76aa9abcf..210094508 100644 --- a/indra/newview/hippofloaterxml.cpp +++ b/indra/newview/hippofloaterxml.cpp @@ -363,18 +363,24 @@ bool HippoFloaterXmlImpl::execute(LLFloater *floater, LLUICtrl *ctrl, if (HippoFloaterXmlImpl *floaterp = dynamic_cast(ctrl)) { floaterp->mIsNotifyOnClose = set; } else { - if (set) - ctrl->setCommitCallback(boost::bind(¬ifyCallback, _1, floater), ctrl); - else - ctrl->setCommitCallback(0); + HippoFloaterXmlImpl *thisFloater = static_cast(floater); + if (set) { + notice_ptr_t connptr(new notice_connection_t(ctrl->setCommitCallback(boost::bind(¬ifyCallback, _1, floater), ctrl))); + thisFloater->mNotices[ctrl] = connptr; + } else { + thisFloater->mNotices.erase(ctrl); + } } } else if (key == "picker") { bool set = (value != "0"); if (!dynamic_cast(ctrl)) { - if (set) - ctrl->setCommitCallback(boost::bind(&pickerCallback, _1, floater), ctrl); - else - ctrl->setCommitCallback(0); + HippoFloaterXmlImpl *thisFloater = static_cast(floater); + if (set) { + notice_ptr_t connptr(new notice_connection_t(ctrl->setCommitCallback(boost::bind(&pickerCallback, _1, floater), ctrl))); + thisFloater->mNotices[ctrl] = connptr; + } else { + thisFloater->mNotices.erase(ctrl); + } } } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 66d8b81ba..2d43a6e18 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -3664,6 +3664,7 @@ public: if (!LLApp::isRunning() || mFailed) return; + /* Singu Note: This wasn't working when we detached copyable attachments early, changeOutfit instead LLInventoryModel::item_array_t body_items, wear_items, obj_items, gest_items; for(std::set::const_iterator it = mWearItems.begin(); it != mWearItems.end(); ++it) { @@ -3692,6 +3693,8 @@ public: if(!body_items.empty() || !wear_items.empty() || !obj_items.empty() || !gest_items.empty()) LLAppearanceMgr::instance().updateCOF(body_items, wear_items, obj_items, gest_items, false); + */ + LLAppearanceMgr::instance().changeOutfit(true, mFolderID, false); } private: class LLCreateBase : public LLInventoryCallback @@ -3880,6 +3883,7 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name, LLInventoryModel::item_array_t remove_items; LLPointer cb = new LLCreateLegacyOutfit(folder_id,boost::bind(&scroll_to_folder,folder_id),boost::bind(&show_created_outfit,folder_id,true)); + uuid_vec_t obj_ids; // Collect the uuids of copyable objects, in order to keep any changes made in the copies for (LLInventoryModel::item_array_t::const_iterator iter = items.begin(); iter != items.end(); @@ -3888,8 +3892,9 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name, LLViewerInventoryItem* item = (*iter); LLViewerInventoryItem* base_item = item->getLinkedItem() ? item->getLinkedItem() : item; bool is_copy = base_item->getPermissions().allowCopyBy(gAgent.getID()); + bool is_obj = base_item->getInventoryType() == LLInventoryType::IT_OBJECT; //Just treat 'object' type as modifiable... permission slam screws them up pretty well. - bool is_mod = base_item->getInventoryType() == LLInventoryType::IT_OBJECT || base_item->getPermissions().allowModifyBy(gAgent.getID()); + bool is_mod = is_obj || base_item->getPermissions().allowModifyBy(gAgent.getID()); //If it's multi-worn we want to create a copy of the item if possible AND create a new link to that new copy with the same desc as the old link. bool is_multi = base_item->isWearableType() && gAgentWearables.getWearableCount(base_item->getWearableType()) > 1 ; @@ -3899,9 +3904,12 @@ LLUUID LLAppearanceMgr::makeNewOutfitLegacy(const std::string& new_folder_name, } else if( is_copy ) { + if (is_obj) obj_ids.push_back(base_item->getUUID()); // If it's a copyable object, store it for later cb->makeCopy(item,is_multi && use_links); } } + if (gSavedSettings.getBOOL("LiruLegacyOutfitStoreObjChanges")) // As a last resort, someone may create a legacy outfit to undo attachment changes + LLAppearanceMgr::instance().removeItemsFromAvatar(obj_ids); // The avatar will have to go without these for now cb->dispatch(); return folder_id; diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 9be913ae8..410559450 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -338,7 +338,7 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa LLFloaterAvatarInfo* floater = LLFloaterAvatarInfo::getInstance(agent_id); if(!floater) { - floater = new LLFloaterAvatarInfo(LLTrans::getString("Command_Profile_Label")+" "+av_name.getCompleteName(), agent_id); + floater = new LLFloaterAvatarInfo(av_name.getCompleteName()+" - "+LLTrans::getString("Command_Profile_Label"), agent_id); floater->center(); } diff --git a/indra/newview/lldroptarget.cpp b/indra/newview/lldroptarget.cpp index 610ce2068..c86e1f18c 100644 --- a/indra/newview/lldroptarget.cpp +++ b/indra/newview/lldroptarget.cpp @@ -9,31 +9,27 @@ * Altered to support a callback so it can return the item * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Pulled into its own file for more widespread use + * Rewritten by Liru Færs to act as its own ui element and use a control * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code * Copyright (c) 2004-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. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ diff --git a/indra/newview/lldroptarget.h b/indra/newview/lldroptarget.h index 1a08484ce..e064c1b02 100644 --- a/indra/newview/lldroptarget.h +++ b/indra/newview/lldroptarget.h @@ -9,31 +9,27 @@ * Altered to support a callback so it can return the item * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Pulled into its own file for more widespread use + * Rewritten by Liru Færs to act as its own ui element and use a control * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * $LicenseInfo:firstyear=2004&license=viewergpl$ - * + * $LicenseInfo:firstyear=2004&license=viewerlgpl$ + * Second Life Viewer Source Code * Copyright (c) 2004-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. + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ */ diff --git a/indra/newview/llfloateravatarinfo.cpp b/indra/newview/llfloateravatarinfo.cpp index 4a6883ecf..fe13d15fd 100644 --- a/indra/newview/llfloateravatarinfo.cpp +++ b/indra/newview/llfloateravatarinfo.cpp @@ -55,6 +55,7 @@ LLFloaterAvatarInfo::LLFloaterAvatarInfo(const std::string& name, const LLUUID & LLCallbackMap::map_t factory_map; factory_map["Panel Avatar"] = LLCallbackMap(createPanelAvatar, this); LLUICtrlFactory::getInstance()->buildFloater(this, "floater_profile.xml", &factory_map); + setTitle(name); } // virtual diff --git a/indra/newview/llfloaterdirectory.cpp b/indra/newview/llfloaterdirectory.cpp index 552406479..cd3c85b5f 100644 --- a/indra/newview/llfloaterdirectory.cpp +++ b/indra/newview/llfloaterdirectory.cpp @@ -390,7 +390,7 @@ void* LLFloaterDirectory::createGroupDetail(void* userdata) { LLFloaterDirectory *self = (LLFloaterDirectory*)userdata; self->mPanelGroupp = new LLPanelGroup(gAgent.getGroupID()); - self->mPanelGroupp->setAllowEdit(FALSE || gAgent.isGodlike()); // Gods can always edit panels + self->mPanelGroupp->setAllowEdit(false); // Singu Note: This setting actually just tells the panel whether or not it is in search self->mPanelGroupp->setVisible(FALSE); return self->mPanelGroupp; } diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index e6017e50e..c2c958f98 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -1064,7 +1064,11 @@ void LLPanelFriends::onClickPay(void* user_data) void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke command) { if (rights.empty()) return; - + + // Make a copy on the heap: rights is allocated on the stack. + // This copy will be deleted in LLPanelFriends::modifyRightsConfirmation. + rights_map_t* heap_rights = new rights_map_t(rights); + // for single friend, show their name if (rights.size() == 1) { @@ -1078,14 +1082,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm LLNotificationsUtil::add("GrantModifyRights", args, LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights)); + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); } else { LLNotificationsUtil::add("RevokeModifyRights", args, LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights)); + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); } } else @@ -1095,14 +1099,14 @@ void LLPanelFriends::confirmModifyRights(rights_map_t& rights, EGrantRevoke comm LLNotificationsUtil::add("GrantModifyRightsMultiple", LLSD(), LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights)); + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); } else { LLNotificationsUtil::add("RevokeModifyRightsMultiple", LLSD(), LLSD(), - boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, &rights)); + boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, heap_rights)); } } } diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index e6f077863..6aa386ffd 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2100,7 +2100,6 @@ void LLPanelLandOptions::refresh() } mSeeAvatarsCtrl->set(parcel->getSeeAVs()); - mSeeAvatarsCtrl->setLabel(getString("see_avs_text")); mSeeAvatarsCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index ec9bf09b0..fc358d79a 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -263,8 +263,7 @@ BOOL LLFloaterNotification::postBuild() return TRUE; } - responses_combo->setCommitCallback(onCommitResponse); - responses_combo->setCallbackUserData(this); + responses_combo->setCommitCallback(boost::bind(&LLFloaterNotification::respond, this)); LLSD form_sd = form->asLLSD(); diff --git a/indra/newview/llfloaternotificationsconsole.h b/indra/newview/llfloaternotificationsconsole.h index 037255318..c4a361538 100644 --- a/indra/newview/llfloaternotificationsconsole.h +++ b/indra/newview/llfloaternotificationsconsole.h @@ -73,7 +73,6 @@ public: void onClose(bool app_quitting) { setVisible(FALSE); } private: - static void onCommitResponse(LLUICtrl* ctrl, void* data) { ((LLFloaterNotification*)data)->respond(); } LLNotification* mNote; }; #endif diff --git a/indra/newview/llmakeoutfitdialog.cpp b/indra/newview/llmakeoutfitdialog.cpp index be70012d1..2c607e6c7 100644 --- a/indra/newview/llmakeoutfitdialog.cpp +++ b/indra/newview/llmakeoutfitdialog.cpp @@ -86,7 +86,6 @@ LLMakeOutfitDialog::LLMakeOutfitDialog(bool modal) : LLModalDialog(LLStringUtil: if (!gHippoGridManager->getConnectedGrid()->supportsInvLinks()) { - childSetEnabled("checkbox_use_links", false); childSetValue("checkbox_use_links", false); childSetEnabled("checkbox_use_outfits", false); childSetValue("checkbox_use_outfits", false); @@ -140,7 +139,8 @@ void LLMakeOutfitDialog::refresh() if (fUseOutfits) pCheckCtrl->setValue(true); } - childSetEnabled("checkbox_use_links", !fUseOutfits); + getChild("checkbox_use_links")->setEnabled(!fUseOutfits && gHippoGridManager->getConnectedGrid()->supportsInvLinks()); + getChild("checkbox_legacy_copy_changes")->setEnabled(!fUseOutfits); } diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 7374f8d05..4db8f3e73 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -1214,7 +1214,7 @@ void LLPanelAvatarPicks::processProperties(void* data, EAvatarProcessorType type for(LLAvatarPicks::picks_list_t::iterator it = picks->picks_list.begin(); it != picks->picks_list.end(); ++it) { - LLPanelPick* panel_pick = new LLPanelPick(FALSE); + LLPanelPick* panel_pick = new LLPanelPick(); panel_pick->setPickID(it->first, mAvatarID); // This will request data from the server when the pick is first @@ -1259,7 +1259,7 @@ void LLPanelAvatarPicks::onClickNew(void* data) } // [/RLVa:KB] LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - LLPanelPick* panel_pick = new LLPanelPick(FALSE); + LLPanelPick* panel_pick = new LLPanelPick(); LLTabContainer* tabs = self->getChild("picks tab"); panel_pick->initNewPick(); @@ -1275,7 +1275,7 @@ void LLPanelAvatarPicks::onClickNew(void* data) void LLPanelAvatarPicks::onClickImport(void* data) { LLPanelAvatarPicks* self = (LLPanelAvatarPicks*)data; - self->mPanelPick = new LLPanelPick(FALSE); + self->mPanelPick = new LLPanelPick(); self->mPanelPick->importNewPick(&LLPanelAvatarPicks::onClickImport_continued, data); } @@ -1514,7 +1514,10 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status) void LLPanelAvatar::onAvatarNameResponse(const LLUUID& agent_id, const LLAvatarName& av_name) { std::string name; - LLAvatarNameCache::getPNSName(av_name, name); + if (gSavedSettings.getBOOL("SinguCompleteNameProfiles")) + name = av_name.getCompleteName(); + else + LLAvatarNameCache::getPNSName(av_name, name); getChild("dnname")->setText(name); } diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 2b4b7f8eb..de5f765cc 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -244,40 +244,37 @@ void LLPanelClassified::reset() BOOL LLPanelClassified::postBuild() { mSnapshotCtrl = getChild("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); mSnapshotSize = mSnapshotCtrl->getRect(); mNameEditor = getChild("given_name_editor"); mNameEditor->setMaxTextLength(DB_PARCEL_NAME_LEN); mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mNameEditor->setCommitCallback(onCommitAny); - mNameEditor->setCallbackUserData(this); + mNameEditor->setFocusReceivedCallback(boost::bind(&LLPanelClassified::checkDirty, this)); + mNameEditor->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); mNameEditor->setPrevalidate( LLLineEditor::prevalidateASCII ); mDescEditor = getChild("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setFocusReceivedCallback(boost::bind(focusReceived, _1, this)); - mDescEditor->setCommitCallback(onCommitAny); - mDescEditor->setCallbackUserData(this); + mDescEditor->setFocusReceivedCallback(boost::bind(&LLPanelClassified::checkDirty, this)); + mDescEditor->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); mDescEditor->setTabsToNextField(TRUE); mLocationEditor = getChild("location_editor"); mSetBtn = getChild( "set_location_btn"); - mSetBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickSet, this)); + mSetBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickSet, this)); mTeleportBtn = getChild( "classified_teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickTeleport, this)); + mTeleportBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickTeleport, this)); mMapBtn = getChild( "classified_map_btn"); - mMapBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickMap, this)); + mMapBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickMap, this)); if(mInFinder) { mProfileBtn = getChild( "classified_profile_btn"); - mProfileBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickProfile, this)); + mProfileBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickProfile, this)); } mCategoryCombo = getChild( "classified_category_combo"); @@ -289,13 +286,11 @@ BOOL LLPanelClassified::postBuild() mCategoryCombo->add(iter->second, (void *)((intptr_t)iter->first), ADD_BOTTOM); } mCategoryCombo->setCurrentByIndex(0); - mCategoryCombo->setCommitCallback(onCommitAny); - mCategoryCombo->setCallbackUserData(this); + mCategoryCombo->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); mMatureCombo = getChild( "classified_mature_check"); mMatureCombo->setCurrentByIndex(0); - mMatureCombo->setCommitCallback(onCommitAny); - mMatureCombo->setCallbackUserData(this); + mMatureCombo->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); if (gAgent.wantsPGOnly()) { // Teens don't get to set mature flag. JC @@ -306,13 +301,11 @@ BOOL LLPanelClassified::postBuild() if (!mInFinder) { mAutoRenewCheck = getChild( "auto_renew_check"); - mAutoRenewCheck->setCommitCallback(onCommitAny); - mAutoRenewCheck->setCallbackUserData(this); + mAutoRenewCheck->setCommitCallback(boost::bind(&LLPanelClassified::checkDirty, this)); } mUpdateBtn = getChild("classified_update_btn"); - mUpdateBtn->setClickedCallback(boost::bind(&LLPanelClassified::onClickUpdate, this)); - mUpdateBtn->setCallbackUserData(this); + mUpdateBtn->setCommitCallback(boost::bind(&LLPanelClassified::onClickUpdate, this)); if (!mInFinder) { @@ -392,9 +385,6 @@ void LLPanelClassified::processProperties(void* data, EAvatarProcessorType type) mUpdateBtn->setLabel(getString("update_txt")); resetDirty(); - - // I don't know if a second call is deliberate or a bad merge, so I'm leaving it here. - resetDirty(); } } } @@ -496,7 +486,7 @@ void LLPanelClassified::initNewClassified() mUpdateBtn->setLabel(getString("publish_txt")); // simulate clicking the "location" button - LLPanelClassified::onClickSet(this); + onClickSet(); } @@ -713,33 +703,28 @@ void LLPanelClassified::refresh() } } -// static -void LLPanelClassified::onClickUpdate(void* data) +void LLPanelClassified::onClickUpdate() { - LLPanelClassified* self = (LLPanelClassified*)data; - - if(self == NULL) return; - // Disallow leading spaces, punctuation, etc. that screw up // sort order. - if ( ! self->titleIsValid() ) + if (!titleIsValid()) { return; - }; + } // If user has not set mature, do not allow publish - if(self->mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) + if (mMatureCombo->getCurrentIndex() == DECLINE_TO_STATE) { // Tell user about it LLNotificationsUtil::add("SetClassifiedMature", LLSD(), LLSD(), - boost::bind(&LLPanelClassified::confirmMature, self, _1, _2)); + boost::bind(&LLPanelClassified::confirmMature, this, _1, _2)); return; } // Mature content flag is set, proceed - self->gotMature(); + gotMature(); } // Callback from a dialog indicating response to mature notification @@ -781,38 +766,30 @@ void LLPanelClassified::gotMature() else { // Ask the user how much they want to pay - LLFloaterPriceForListing::show( callbackGotPriceForListing, this ); + new LLFloaterPriceForListing(boost::bind(&LLPanelClassified::callbackGotPriceForListing, this, _1)); } } -// static -void LLPanelClassified::callbackGotPriceForListing(S32 option, std::string text, void* data) +void LLPanelClassified::callbackGotPriceForListing(const std::string& text) { - LLPanelClassified* self = (LLPanelClassified*)data; - - // Only do something if user hits publish - if (option != 0) return; - S32 price_for_listing = strtol(text.c_str(), NULL, 10); if (price_for_listing < MINIMUM_PRICE_FOR_LISTING) { LLSD args; - std::string price_text = llformat("%d", MINIMUM_PRICE_FOR_LISTING); - args["MIN_PRICE"] = price_text; - + args["MIN_PRICE"] = llformat("%d", MINIMUM_PRICE_FOR_LISTING); LLNotificationsUtil::add("MinClassifiedPrice", args); return; } // price is acceptable, put it in the dialog for later read by // update send - self->mPriceForListing = price_for_listing; + mPriceForListing = price_for_listing; LLSD args; args["AMOUNT"] = llformat("%d", price_for_listing); args["CURRENCY"] = gHippoGridManager->getConnectedGrid()->getCurrencySymbol(); LLNotificationsUtil::add("PublishClassified", args, LLSD(), - boost::bind(&LLPanelClassified::confirmPublish, self, _1, _2)); + boost::bind(&LLPanelClassified::confirmPublish, this, _1, _2)); } void LLPanelClassified::resetDirty() @@ -862,51 +839,39 @@ bool LLPanelClassified::confirmPublish(const LLSD& notification, const LLSD& res return false; } - -// static -void LLPanelClassified::onClickTeleport(void* data) +void LLPanelClassified::onClickTeleport() { - LLPanelClassified* self = (LLPanelClassified*)data; - - if (!self->mPosGlobal.isExactlyZero()) + if (!mPosGlobal.isExactlyZero()) { - gAgent.teleportViaLocation(self->mPosGlobal); - gFloaterWorldMap->trackLocation(self->mPosGlobal); + gAgent.teleportViaLocation(mPosGlobal); + gFloaterWorldMap->trackLocation(mPosGlobal); - self->sendClassifiedClickMessage("teleport"); + sendClassifiedClickMessage("teleport"); } } - -// static -void LLPanelClassified::onClickMap(void* data) +void LLPanelClassified::onClickMap() { - LLPanelClassified* self = (LLPanelClassified*)data; - gFloaterWorldMap->trackLocation(self->mPosGlobal); + gFloaterWorldMap->trackLocation(mPosGlobal); LLFloaterWorldMap::show(true); - self->sendClassifiedClickMessage("map"); + sendClassifiedClickMessage("map"); } -// static -void LLPanelClassified::onClickProfile(void* data) +void LLPanelClassified::onClickProfile() { - LLPanelClassified* self = (LLPanelClassified*)data; - LLAvatarActions::showProfile(self->mCreatorID); - self->sendClassifiedClickMessage("profile"); + LLAvatarActions::showProfile(mCreatorID); + sendClassifiedClickMessage("profile"); } -// static /* -void LLPanelClassified::onClickLandmark(void* data) +void LLPanelClassified::onClickLandmark() { - LLPanelClassified* self = (LLPanelClassified*)data; - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); + create_landmark(mNameEditor->getText(), "", mPosGlobal); } */ -// static -void LLPanelClassified::onClickSet(void* data) +void LLPanelClassified::onClickSet() { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) @@ -914,10 +879,9 @@ void LLPanelClassified::onClickSet(void* data) return; } // [/RLVa:KB] - LLPanelClassified* self = (LLPanelClassified*)data; // Save location for later. - self->mPosGlobal = gAgent.getPositionGlobal(); + mPosGlobal = gAgent.getPositionGlobal(); std::string location_text; std::string regionName = "(will update after publish)"; @@ -929,22 +893,22 @@ void LLPanelClassified::onClickSet(void* data) location_text.assign(regionName); location_text.append(", "); - S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); + S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)mPosGlobal.mdV[VZ]); - location_text.append(self->mSimName); + location_text.append(mSimName); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); - self->mLocationEditor->setText(location_text); - self->mLocationChanged = true; + mLocationEditor->setText(location_text); + mLocationChanged = true; - self->setDefaultAccessCombo(); + setDefaultAccessCombo(); // Set this to null so it updates on the next save. - self->mParcelID.setNull(); + mParcelID.setNull(); - onCommitAny(NULL, data); + checkDirty(); } @@ -963,23 +927,6 @@ BOOL LLPanelClassified::checkDirty() return mDirty; } -// static -void LLPanelClassified::onCommitAny(LLUICtrl* ctrl, void* data) -{ - LLPanelClassified* self = (LLPanelClassified*)data; - if (self) - { - self->checkDirty(); - } -} - -// static -void LLPanelClassified::focusReceived(LLFocusableElement* ctrl, void* data) -{ - // allow the data to be saved - onCommitAny((LLUICtrl*)ctrl, data); -} - void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) { @@ -1000,15 +947,22 @@ void LLPanelClassified::sendClassifiedClickMessage(const std::string& type) //////////////////////////////////////////////////////////////////////////////////////////// -LLFloaterPriceForListing::LLFloaterPriceForListing() +LLFloaterPriceForListing::LLFloaterPriceForListing(const signal_t::slot_type& cb) : LLFloater(std::string("PriceForListing")), - mCallback(NULL), - mUserData(NULL) -{ } + mSignal(new signal_t) +{ + // Builds and adds to gFloaterView + LLUICtrlFactory::getInstance()->buildFloater(this, "floater_price_for_listing.xml"); + center(); + + mSignal->connect(cb); +} //virtual LLFloaterPriceForListing::~LLFloaterPriceForListing() -{ } +{ + delete mSignal; +} //virtual BOOL LLFloaterPriceForListing::postBuild() @@ -1023,50 +977,18 @@ BOOL LLFloaterPriceForListing::postBuild() edit->setFocus(TRUE); } - childSetAction("set_price_btn", onClickSetPrice, this); + getChild("set_price_btn")->setCommitCallback(boost::bind(&LLFloaterPriceForListing::buttonCore, this)); - childSetAction("cancel_btn", onClickCancel, this); + getChild("cancel_btn")->setCommitCallback(boost::bind(&LLFloater::close, this, false)); setDefaultBtn("set_price_btn"); return TRUE; } -//static -void LLFloaterPriceForListing::show( void (*callback)(S32, std::string, void*), void* userdata) +void LLFloaterPriceForListing::buttonCore() { - LLFloaterPriceForListing *self = new LLFloaterPriceForListing(); - - // Builds and adds to gFloaterView - LLUICtrlFactory::getInstance()->buildFloater(self, "floater_price_for_listing.xml"); - self->center(); - - self->mCallback = callback; - self->mUserData = userdata; -} - -//static -void LLFloaterPriceForListing::onClickSetPrice(void* data) -{ - buttonCore(0, data); -} - -//static -void LLFloaterPriceForListing::onClickCancel(void* data) -{ - buttonCore(1, data); -} - -//static -void LLFloaterPriceForListing::buttonCore(S32 button, void* data) -{ - LLFloaterPriceForListing* self = (LLFloaterPriceForListing*)data; - - if (self->mCallback) - { - std::string text = self->childGetText("price_edit"); - self->mCallback(button, text, self->mUserData); - self->close(); - } + (*mSignal)(childGetText("price_edit")); + close(); } void LLPanelClassified::setDefaultAccessCombo() diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index a3bb42554..04432edfd 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -38,23 +38,19 @@ #define LL_LLPANELCLASSIFIED_H #include "llavatarpropertiesprocessor.h" -#include "llpanel.h" #include "llclassifiedinfo.h" #include "v3dmath.h" #include "lluuid.h" #include "llfloater.h" -//#include "llrect.h" class LLButton; class LLCheckBoxCtrl; class LLComboBox; -class LLIconCtrl; class LLLineEditor; class LLTextBox; class LLTextEditor; class LLTextureCtrl; class LLUICtrl; -class LLMessageSystem; class LLPanelClassified : public LLPanel, public LLAvatarPropertiesObserver { @@ -104,7 +100,7 @@ public: // Confirmation dialogs flow in this order bool confirmMature(const LLSD& notification, const LLSD& response); void gotMature(); - static void callbackGotPriceForListing(S32 option, std::string text, void* data); + void callbackGotPriceForListing(const std::string& text); bool confirmPublish(const LLSD& notification, const LLSD& response); void sendClassifiedClickMessage(const std::string& type); @@ -112,14 +108,11 @@ public: protected: bool saveCallback(const LLSD& notification, const LLSD& response); - static void onClickUpdate(void* data); - static void onClickTeleport(void* data); - static void onClickMap(void* data); - static void onClickProfile(void* data); - static void onClickSet(void* data); - - static void focusReceived(LLFocusableElement* ctrl, void* data); - static void onCommitAny(LLUICtrl* ctrl, void* data); + void onClickUpdate(); + void onClickTeleport(); + void onClickMap(); + void onClickProfile(); + void onClickSet(); void setDefaultAccessCombo(); // Default AO and PG regions to proper classified access @@ -183,20 +176,15 @@ class LLFloaterPriceForListing : public LLFloater { public: - LLFloaterPriceForListing(); + typedef boost::signals2::signal signal_t; + LLFloaterPriceForListing(const signal_t::slot_type& cb); virtual ~LLFloaterPriceForListing(); virtual BOOL postBuild(); - static void show( void (*callback)(S32 option, std::string value, void* userdata), void* userdata ); - private: - static void onClickSetPrice(void*); - static void onClickCancel(void*); - static void buttonCore(S32 button, void* data); + void buttonCore(); -private: - void (*mCallback)(S32 option, std::string, void*); - void* mUserData; + signal_t* mSignal; }; diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp index 619f89e84..ad8b2cd40 100644 --- a/indra/newview/llpanelgroup.cpp +++ b/indra/newview/llpanelgroup.cpp @@ -246,14 +246,13 @@ BOOL LLPanelGroup::postBuild() if (button) { button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnCancel,this)); - button->setVisible(mAllowEdit); + button->setEnabled(mAllowEdit); // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing } button = getChild("btn_apply"); if (button) { button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnApply,this)); - button->setVisible(mAllowEdit); button->setEnabled(FALSE); mApplyBtn = button; @@ -263,7 +262,6 @@ BOOL LLPanelGroup::postBuild() if (button) { button->setClickedCallback(boost::bind(&LLPanelGroup::onBtnRefresh,this)); - button->setVisible(mAllowEdit); } return TRUE; @@ -286,11 +284,15 @@ void LLPanelGroup::tabChanged() { //some tab information has changed,....enable/disable the apply button //based on if they need an apply + std::string str; + const bool need = mCurrentTab->needsApply(str); if ( mApplyBtn ) { - std::string mesg; - mApplyBtn->setEnabled(mCurrentTab->needsApply(mesg)); + mApplyBtn->setEnabled(need); } + if (mAllowEdit) return; // Cancel should always be enabled for standalone group floater, this is expected behavior and may be used for simply closing + if (LLUICtrl* ctrl = getChild("btn_cancel")) + ctrl->setEnabled(need); } void LLPanelGroup::handleClickTab() @@ -477,7 +479,10 @@ void LLPanelGroup::onBtnOK(void* user_data) void LLPanelGroup::onBtnCancel(void* user_data) { LLPanelGroup* self = static_cast(user_data); - self->close(); + if (self->mAllowEdit) // We're in a standalone floater + self->close(); + else // We're in search, we can't close out, just refreshData to kill changes + self->refreshData(); } // static diff --git a/indra/newview/llpanelgroupgeneral.cpp b/indra/newview/llpanelgroupgeneral.cpp index 55b5b70ad..e524a280b 100644 --- a/indra/newview/llpanelgroupgeneral.cpp +++ b/indra/newview/llpanelgroupgeneral.cpp @@ -298,8 +298,7 @@ void LLPanelGroupGeneral::onCommitEnrollment() } // Make sure the agent can change enrollment info. - if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS) - || !mAllowEdit) + if (!gAgent.hasPowerInGroup(mGroupID,GP_MEMBER_OPTIONS)) { return; } @@ -317,7 +316,7 @@ void LLPanelGroupGeneral::onCommitEnrollment() void LLPanelGroupGeneral::onCommitTitle() { - if (mGroupID.isNull() || !mAllowEdit) return; + if (mGroupID.isNull()) return; LLGroupMgr::getInstance()->sendGroupTitleUpdate(mGroupID,mComboActiveTitle->getCurrentID()); update(GC_TITLES); mComboActiveTitle->resetDirty(); @@ -564,7 +563,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mComboActiveTitle) { mComboActiveTitle->setVisible(is_member); - mComboActiveTitle->setEnabled(mAllowEdit); if ( mActiveTitleLabel) mActiveTitleLabel->setVisible(is_member); @@ -624,7 +622,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) if (mCtrlShowInGroupList) { mCtrlShowInGroupList->set(gdatap->mShowInList); - mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident); + mCtrlShowInGroupList->setEnabled(can_change_ident); mCtrlShowInGroupList->resetDirty(); } @@ -638,20 +636,20 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { mComboMature->setCurrentByIndex(NON_MATURE_CONTENT); } - mComboMature->setEnabled(mAllowEdit && can_change_ident); + mComboMature->setEnabled(can_change_ident); mComboMature->setVisible( !gAgent.isTeen() ); mComboMature->resetDirty(); } if (mCtrlOpenEnrollment) { mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment); - mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts); + mCtrlOpenEnrollment->setEnabled(can_change_member_opts); mCtrlOpenEnrollment->resetDirty(); } if (mCtrlEnrollmentFee) { mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0); - mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts); + mCtrlEnrollmentFee->setEnabled(can_change_member_opts); mCtrlEnrollmentFee->resetDirty(); } @@ -659,9 +657,7 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) { S32 fee = gdatap->mMembershipFee; mSpinEnrollmentFee->set((F32)fee); - mSpinEnrollmentFee->setEnabled( mAllowEdit && - (fee > 0) && - can_change_member_opts); + mSpinEnrollmentFee->setEnabled(fee && can_change_member_opts); mSpinEnrollmentFee->resetDirty(); } if ( mBtnJoinGroup ) @@ -693,7 +689,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mCtrlReceiveNotices->setVisible(is_member); if (is_member) { - mCtrlReceiveNotices->setEnabled(mAllowEdit); if(!mCtrlReceiveNotices->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc. { mCtrlReceiveNotices->set(agent_gdatap.mAcceptNotices); @@ -707,7 +702,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mCtrlListGroup->setVisible(is_member); if (is_member) { - mCtrlListGroup->setEnabled(mAllowEdit); if(!mCtrlListGroup->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc. { mCtrlListGroup->set(agent_gdatap.mListInProfile); @@ -721,7 +715,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) mCtrlReceiveChat->setVisible(is_member); if (is_member) { - mCtrlReceiveChat->setEnabled(mAllowEdit); if(!mCtrlReceiveChat->isDirty()) //If the user hasn't edited this then refresh it. Value may have changed in groups panel, etc. { mCtrlReceiveChat->set(!gIMMgr->getIgnoreGroup(mGroupID)); @@ -730,8 +723,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc) } } - if (mInsignia) mInsignia->setEnabled(mAllowEdit && can_change_ident); - if (mEditCharter) mEditCharter->setEnabled(mAllowEdit && can_change_ident); + if (mInsignia) mInsignia->setEnabled(can_change_ident); + if (mEditCharter) mEditCharter->setEnabled(can_change_ident); if (mGroupName) mGroupName->setText(gdatap->mName); if (mGroupNameEditor) mGroupNameEditor->setVisible(FALSE); diff --git a/indra/newview/llpanelgroupnotices.cpp b/indra/newview/llpanelgroupnotices.cpp index a69b4c76a..3deb47999 100644 --- a/indra/newview/llpanelgroupnotices.cpp +++ b/indra/newview/llpanelgroupnotices.cpp @@ -222,8 +222,7 @@ BOOL LLPanelGroupNotices::postBuild() mNoticesList = getChild("notice_list",recurse); mNoticesList->setCommitOnSelectionChange(TRUE); - mNoticesList->setCommitCallback(onSelectNotice); - mNoticesList->setCallbackUserData(this); + mNoticesList->setCommitCallback(boost::bind(&LLPanelGroupNotices::onSelectNotice, this)); mBtnNewMessage = getChild("create_new_notice",recurse); mBtnNewMessage->setClickedCallback(boost::bind(&LLPanelGroupNotices::onClickNewMessage,this)); @@ -494,14 +493,11 @@ void LLPanelGroupNotices::processNotices(LLMessageSystem* msg) mNoticesList->updateSort(); } -void LLPanelGroupNotices::onSelectNotice(LLUICtrl* ctrl, void* data) +void LLPanelGroupNotices::onSelectNotice() { - LLPanelGroupNotices* self = (LLPanelGroupNotices*)data; - - if(!self) return; - LLScrollListItem* item = self->mNoticesList->getFirstSelected(); + LLScrollListItem* item = mNoticesList->getFirstSelected(); if (!item) return; - + LLMessageSystem* msg = gMessageSystem; msg->newMessage("GroupNoticeRequest"); msg->nextBlock("AgentData"); diff --git a/indra/newview/llpanelgroupnotices.h b/indra/newview/llpanelgroupnotices.h index 916032c1b..fdd878394 100644 --- a/indra/newview/llpanelgroupnotices.h +++ b/indra/newview/llpanelgroupnotices.h @@ -78,7 +78,7 @@ private: static void onClickRefreshNotices(void* data); void processNotices(LLMessageSystem* msg); - static void onSelectNotice(LLUICtrl* ctrl, void* data); + void onSelectNotice(); enum ENoticeView { diff --git a/indra/newview/llpanelgrouproles.cpp b/indra/newview/llpanelgrouproles.cpp index d341d3ce8..0b5acb543 100644 --- a/indra/newview/llpanelgrouproles.cpp +++ b/indra/newview/llpanelgrouproles.cpp @@ -198,7 +198,7 @@ BOOL LLPanelGroupRoles::isVisibleByAgent(LLAgent* agentp) GP_MEMBER_EJECT | GP_MEMBER_OPTIONS ); */ - return mAllowEdit && agentp->isInGroup(mGroupID); + return agentp->isInGroup(mGroupID); } diff --git a/indra/newview/llpanelgroupvoting.cpp b/indra/newview/llpanelgroupvoting.cpp index 0eac7e5ec..2b03523b8 100644 --- a/indra/newview/llpanelgroupvoting.cpp +++ b/indra/newview/llpanelgroupvoting.cpp @@ -1491,7 +1491,7 @@ LLPanelGroupVoting::~LLPanelGroupVoting() BOOL LLPanelGroupVoting::isVisibleByAgent(LLAgent* agentp) { //if they are in the group, the panel is viewable - return mAllowEdit && agentp->isInGroup(mGroupID); + return agentp->isInGroup(mGroupID); } BOOL LLPanelGroupVoting::postBuild() diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index f599fc915..674d9b65d 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -30,82 +30,65 @@ * $/LicenseInfo$ */ -// Display of a "Top Pick" used both for the global top picks in the -// Find directory, and also for each individual user's picks in their -// profile. +// Display of each individual user's picks in their profile. #include "llviewerprecompiledheaders.h" #include "llpanelpick.h" -#include "lldir.h" +#include "lllineeditor.h" +#include "llnotificationsutil.h" #include "llparcel.h" -#include "message.h" +#include "lltexteditor.h" +#include "lltexturectrl.h" +#include "lluictrlfactory.h" #include "llagent.h" -#include "llbutton.h" -#include "llcheckboxctrl.h" -#include "llviewercontrol.h" -#include "lllineeditor.h" -#include "lltextbox.h" -#include "llviewertexteditor.h" -#include "lltexturectrl.h" -#include "lluiconstants.h" -#include "llviewergenericmessage.h" -#include "lluictrlfactory.h" -#include "llviewerparcelmgr.h" -#include "llworldmap.h" #include "llfloaterworldmap.h" +#include "llpreviewtexture.h" +#include "llviewerparcelmgr.h" #include "llviewerregion.h" -#include "llviewerwindow.h" -#include "llnotificationsutil.h" // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] - //For pick import and export - RK #include "statemachine/aifilepicker.h" -#include "llviewernetwork.h" -#include "llsdserialize.h" #include "hippogridmanager.h" +#include "llsdserialize.h" + +void show_picture(const LLUUID& id, const std::string& name) +{ + // Try to show and focus existing preview + if (LLPreview::show(id)) return; + // If there isn't one, make a new preview + LLPreview* preview = new LLPreviewTexture("preview texture", gSavedSettings.getRect("PreviewTextureRect"), name, id); + preview->setFocus(true); +} + //static std::list LLPanelPick::sAllPanels; -LLPanelPick::LLPanelPick(BOOL top_pick) +LLPanelPick::LLPanelPick() : LLPanel(std::string("Top Picks Panel")), - mTopPick(top_pick), mPickID(), mCreatorID(), mParcelID(), - mDataRequested(FALSE), - mDataReceived(FALSE), + mDataRequested(false), + mDataReceived(false), mPosGlobal(), mSnapshotCtrl(NULL), mNameEditor(NULL), mDescEditor(NULL), mLocationEditor(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), - //mLandmarkBtn(NULL), - mSortOrderText(NULL), - mSortOrderEditor(NULL), - mEnabledCheck(NULL), mSetBtn(NULL), + mOpenBtn(NULL), mImporting(0) { sAllPanels.push_back(this); - std::string pick_def_file; - if (top_pick) - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_top_pick.xml"); - } - else - { - LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml"); - } + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_pick.xml"); } @@ -130,8 +113,8 @@ void LLPanelPick::reset() mParcelID.setNull(); // Don't request data, this isn't valid - mDataRequested = TRUE; - mDataReceived = FALSE; + mDataRequested = true; + mDataReceived = false; mPosGlobal.clearVec(); @@ -142,83 +125,55 @@ void LLPanelPick::reset() BOOL LLPanelPick::postBuild() { mSnapshotCtrl = getChild("snapshot_ctrl"); - mSnapshotCtrl->setCommitCallback(onCommitAny); - mSnapshotCtrl->setCallbackUserData(this); + mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); mNameEditor = getChild("given_name_editor"); - mNameEditor->setCommitOnFocusLost(TRUE); - mNameEditor->setCommitCallback(onCommitAny); - mNameEditor->setCallbackUserData(this); + mNameEditor->setCommitOnFocusLost(true); + mNameEditor->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); mDescEditor = getChild("desc_editor"); - mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setCommitCallback(onCommitAny); - mDescEditor->setCallbackUserData(this); - mDescEditor->setTabsToNextField(TRUE); + mDescEditor->setCommitOnFocusLost(true); + mDescEditor->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); + mDescEditor->setTabsToNextField(true); mLocationEditor = getChild("location_editor"); - mSetBtn = getChild( "set_location_btn"); - mSetBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickSet,this)); + mSetBtn = getChild( "set_location_btn"); + mSetBtn->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this)); - mTeleportBtn = getChild( "pick_teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); + mOpenBtn = getChild("open_picture_btn"); + mOpenBtn->setCommitCallback(boost::bind(show_picture, boost::bind(&LLTextureCtrl::getImageAssetID, mSnapshotCtrl), boost::bind(&LLLineEditor::getText, mNameEditor))); - mMapBtn = getChild( "pick_map_btn"); - mMapBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickMap,this)); - - mSortOrderText = getChild("sort_order_text"); - - mSortOrderEditor = getChild("sort_order_editor"); - mSortOrderEditor->setPrevalidate(LLLineEditor::prevalidateInt); - mSortOrderEditor->setCommitOnFocusLost(TRUE); - mSortOrderEditor->setCommitCallback(onCommitAny); - mSortOrderEditor->setCallbackUserData(this); - - mEnabledCheck = getChild( "enabled_check"); - mEnabledCheck->setCommitCallback(onCommitAny); - mEnabledCheck->setCallbackUserData(this); + getChild("pick_teleport_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); + getChild("pick_map_btn")->setCommitCallback(boost::bind(&LLPanelPick::onClickMap,this)); return TRUE; } void LLPanelPick::processProperties(void* data, EAvatarProcessorType type) { - if(APT_PICK_INFO != type) - { - return; - } + if (!data || APT_PICK_INFO != type) return; LLPickData* pick_info = static_cast(data); - //llassert_always(pick_info->creator_id != gAgent.getID()); - //llassert_always(mCreatorID != gAgent.getID()); - if(!pick_info - || pick_info->creator_id != mCreatorID - || pick_info->pick_id != mPickID) - { + if (pick_info->creator_id != mCreatorID || pick_info->pick_id != mPickID) return; - } LLAvatarPropertiesProcessor::getInstance()->removeObserver(mCreatorID, this); // "Location text" is actually the owner name, the original // name that owner gave the parcel, and the location. std::string location_text = pick_info->user_name + ", "; - if (!pick_info->original_name.empty()) { - location_text.append(pick_info->original_name); - location_text.append(", "); + location_text += pick_info->original_name + ", "; } - - location_text.append(pick_info->sim_name); - location_text.append(" "); + location_text += pick_info->sim_name + " "; //Fix for location text importing - RK for (panel_list_t::iterator iter = sAllPanels.begin(); iter != sAllPanels.end(); ++iter) { LLPanelPick* self = *iter; - if(!self->mImporting) self->mLocationText = location_text; + if (!self->mImporting) self->mLocationText = location_text; else location_text = self->mLocationText; self->mImporting = false; } @@ -226,10 +181,9 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type) S32 region_x = llround((F32)pick_info->pos_global.mdV[VX]) % REGION_WIDTH_UNITS; S32 region_y = llround((F32)pick_info->pos_global.mdV[VY]) % REGION_WIDTH_UNITS; S32 region_z = llround((F32)pick_info->pos_global.mdV[VZ]); - location_text.append(llformat("(%d, %d, %d)", region_x, region_y, region_z)); - mDataReceived = TRUE; + mDataReceived = true; // Found the panel, now fill in the information mPickID = pick_info->pick_id; @@ -243,24 +197,17 @@ void LLPanelPick::processProperties(void* data, EAvatarProcessorType type) mDescEditor->setText(pick_info->desc); mSnapshotCtrl->setImageAssetID(pick_info->snapshot_id); mLocationEditor->setText(location_text); - mEnabledCheck->set(pick_info->enabled); - - mSortOrderEditor->setText(llformat("%d", pick_info->sort_order)); - } // Fill in some reasonable defaults for a new pick. void LLPanelPick::initNewPick() { mPickID.generate(); - - mCreatorID = gAgent.getID(); - + mCreatorID = gAgentID; mPosGlobal = gAgent.getPositionGlobal(); // Try to fill in the current parcel - LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); - if (parcel) + if (LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel()) { mNameEditor->setText(parcel->getName()); mDescEditor->setText(parcel->getDesc()); @@ -284,21 +231,14 @@ void LLPanelPick::importNewPick_continued(void (*callback)(void*, bool), void* d bool result = false; if (filepicker->hasFilename()) { - std::string file = filepicker->getFilename(); - - llifstream importer(file); + llifstream importer(filepicker->getFilename()); LLSD data; LLSDSerialize::fromXMLDocument(data, importer); - LLSD file_data = data["Data"]; - data = LLSD(); mPickID.generate(); - - mCreatorID = gAgent.getID(); - + mCreatorID = gAgentID; mPosGlobal = LLVector3d(file_data["globalPos"]); - mNameEditor->setText(file_data["name"].asString()); mDescEditor->setText(file_data["desc"].asString()); mSnapshotCtrl->setImageAssetID(file_data["snapshotID"].asUUID()); @@ -325,10 +265,10 @@ void LLPanelPick::exportPick_continued(AIFilePicker* filepicker) if (!filepicker->hasFilename()) return; - std::string destination = filepicker->getFilename(); + LLSD header; + header["Version"] = 2; LLSD datas; - datas["name"] = mNameEditor->getText(); datas["desc"] = mDescEditor->getText(); datas["parcelID"] = mParcelID; @@ -337,16 +277,12 @@ void LLPanelPick::exportPick_continued(AIFilePicker* filepicker) datas["locationText"] = mLocationText; LLSD file; - LLSD header; - header["Version"] = 2; file["Header"] = header; - std::string grid_uri = gHippoGridManager->getConnectedGrid()->getLoginUri(); - //LLStringUtil::toLower(uris[0]); - file["Grid"] = grid_uri; + file["Grid"] = gHippoGridManager->getConnectedGrid()->getLoginUri(); file["Data"] = datas; // Create a file stream and write to it - llofstream export_file(destination); + llofstream export_file(filepicker->getFilename()); LLSDSerialize::toPrettyXML(file, export_file); // Open the file save dialog export_file.close(); @@ -364,24 +300,17 @@ void LLPanelPick::setPickID(const LLUUID& pick_id, const LLUUID& creator_id) // from the server next time it is drawn. void LLPanelPick::markForServerRequest() { - mDataRequested = FALSE; - mDataReceived = FALSE; -} - - -std::string LLPanelPick::getPickName() -{ - return mNameEditor->getText(); + mDataRequested = false; + mDataReceived = false; } void LLPanelPick::sendPickInfoRequest() { - //llassert_always(mCreatorID != gAgent.getID()); LLAvatarPropertiesProcessor::getInstance()->addObserver(mCreatorID, this); LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(mCreatorID, mPickID); - mDataRequested = TRUE; + mDataRequested = true; } @@ -396,24 +325,18 @@ void LLPanelPick::sendPickInfoUpdate() mPickID.generate(); } - pick_data.agent_id = gAgent.getID(); - pick_data.session_id = gAgent.getSessionID(); + pick_data.agent_id = gAgentID; + pick_data.session_id = gAgentSessionID; pick_data.pick_id = mPickID; - pick_data.creator_id = gAgent.getID(); - - //legacy var need to be deleted - pick_data.top_pick = mTopPick; + pick_data.creator_id = gAgentID; + pick_data.top_pick = false; //legacy var need to be deleted pick_data.parcel_id = mParcelID; pick_data.name = mNameEditor->getText(); pick_data.desc = mDescEditor->getText(); pick_data.snapshot_id = mSnapshotCtrl->getImageAssetID(); pick_data.pos_global = mPosGlobal; - if(mTopPick) - pick_data.sort_order = atoi(mSortOrderEditor->getText().c_str()); - else - pick_data.sort_order = 0; - - pick_data.enabled = mEnabledCheck->get(); + pick_data.sort_order = 0; + pick_data.enabled = true; LLAvatarPropertiesProcessor::getInstance()->sendPickInfoUpdate(&pick_data); } @@ -421,106 +344,50 @@ void LLPanelPick::sendPickInfoUpdate() void LLPanelPick::draw() -{ - refresh(); - - LLPanel::draw(); -} - - -void LLPanelPick::refresh() { if (!mDataRequested) { sendPickInfoRequest(); } - // Check for god mode - BOOL godlike = gAgent.isGodlike(); - BOOL is_self = (gAgent.getID() == mCreatorID); - // Set button visibility/enablement appropriately - if (mTopPick) - { - mSnapshotCtrl->setEnabled(godlike); - mNameEditor->setEnabled(godlike); - mDescEditor->setEnabled(godlike); - - mSortOrderText->setVisible(godlike); - - mSortOrderEditor->setVisible(godlike); - mSortOrderEditor->setEnabled(godlike); - - mEnabledCheck->setVisible(godlike); - mEnabledCheck->setEnabled(godlike); - - mSetBtn->setVisible(godlike); - //mSetBtn->setEnabled(godlike); + bool is_self = gAgentID == mCreatorID; + mSnapshotCtrl->setEnabled(is_self); + mNameEditor->setEnabled(is_self); + mDescEditor->setEnabled(is_self); + mSetBtn->setVisible(is_self); + //mSetBtn->setEnabled(is_self); // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - mSetBtn->setEnabled(godlike && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); -// [/RLVa:KB] - } - - - - else - { - mSnapshotCtrl->setEnabled(is_self); - mNameEditor->setEnabled(is_self); - mDescEditor->setEnabled(is_self); - - mSortOrderText->setVisible(FALSE); - - mSortOrderEditor->setVisible(FALSE); - mSortOrderEditor->setEnabled(FALSE); - - mEnabledCheck->setVisible(FALSE); - mEnabledCheck->setEnabled(FALSE); - - mSetBtn->setVisible(is_self); - //mSetBtn->setEnabled(is_self); -// [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) - mSetBtn->setEnabled(is_self && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) ); + mSetBtn->setEnabled(is_self && !gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)); // [/RLVa] - } + mOpenBtn->setVisible(!is_self); + + LLPanel::draw(); } - - - - -// static -void LLPanelPick::onClickTeleport(void* data) +void LLPanelPick::onClickTeleport() { - LLPanelPick* self = (LLPanelPick*)data; - - if (!self->mPosGlobal.isExactlyZero()) + if (!mPosGlobal.isExactlyZero()) { - gAgent.teleportViaLocation(self->mPosGlobal); - gFloaterWorldMap->trackLocation(self->mPosGlobal); + gAgent.teleportViaLocation(mPosGlobal); + gFloaterWorldMap->trackLocation(mPosGlobal); } } - -// static -void LLPanelPick::onClickMap(void* data) +void LLPanelPick::onClickMap() { - LLPanelPick* self = (LLPanelPick*)data; - gFloaterWorldMap->trackLocation(self->mPosGlobal); + gFloaterWorldMap->trackLocation(mPosGlobal); LLFloaterWorldMap::show(true); } -// static /* -void LLPanelPick::onClickLandmark(void* data) +void LLPanelPick::onClickLandmark() { - LLPanelPick* self = (LLPanelPick*)data; - create_landmark(self->mNameEditor->getText(), "", self->mPosGlobal); + create_landmark(mNameEditor->getText(), "", mPosGlobal); } */ -// static -void LLPanelPick::onClickSet(void* data) +void LLPanelPick::onClickSet() { // [RLVa:KB] - Checked: 2009-07-04 (RLVa-1.0.0a) if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) @@ -528,63 +395,41 @@ void LLPanelPick::onClickSet(void* data) return; } // [/RLVa:KB] - LLPanelPick* self = (LLPanelPick*)data; // Save location for later. - self->mPosGlobal = gAgent.getPositionGlobal(); + mPosGlobal = gAgent.getPositionGlobal(); - std::string location_text; - location_text.assign("(will update after save)"); - location_text.append(", "); + std::string location_text("(will update after save), " + mSimName); - S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; - S32 region_y = llround((F32)self->mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; - S32 region_z = llround((F32)self->mPosGlobal.mdV[VZ]); - - location_text.append(self->mSimName); + S32 region_x = llround((F32)mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)mPosGlobal.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)mPosGlobal.mdV[VZ]); location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); // if sim name in pick is different from current sim name // make sure it's clear that all that's being changed // is the location and nothing else - if ( gAgent.getRegion ()->getName () != self->mSimName ) + if (gAgent.getRegion()->getName() != mSimName) { LLNotificationsUtil::add("SetPickLocation"); - }; + } - self->mLocationEditor->setText(location_text); + mLocationEditor->setText(location_text); - onCommitAny(NULL, data); + onCommitAny(); } - -// static -void LLPanelPick::onCommitAny(LLUICtrl* ctrl, void* data) +void LLPanelPick::onCommitAny() { - LLPanelPick* self = (LLPanelPick*)data; - - if(self->mCreatorID != gAgent.getID()) - return; + if (mCreatorID != gAgentID) return; // have we received up to date data for this pick? - if (self->mDataReceived) + if (mDataReceived) { - self->sendPickInfoUpdate(); - - // Big hack - assume that top picks are always in a browser, - // and non-top-picks are always in a tab container. - /*if (self->mTopPick) + sendPickInfoUpdate(); + if (LLTabContainer* tab = dynamic_cast(getParent())) { - LLPanelDirPicks* panel = (LLPanelDirPicks*)self->getParent(); - panel->renamePick(self->mPickID, self->mNameEditor->getText()); + tab->setCurrentTabName(mNameEditor->getText()); } - else - {*/ - LLTabContainer* tab = (LLTabContainer*)self->getParent(); - if (tab) - { - if(tab) tab->setCurrentTabName(self->mNameEditor->getText()); - } - //} } } diff --git a/indra/newview/llpanelpick.h b/indra/newview/llpanelpick.h index 84f41b8da..eb2d30a89 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -30,43 +30,30 @@ * $/LicenseInfo$ */ -// Display of a "Top Pick" used both for the global top picks in the -// Find directory, and also for each individual user's picks in their -// profile. +// Display of each individual user's picks in their profile. #ifndef LL_LLPANELPICK_H #define LL_LLPANELPICK_H #include "llpanel.h" -#include "v3dmath.h" -#include "lluuid.h" #include "llavatarpropertiesprocessor.h" -class LLButton; -class LLCheckBoxCtrl; -class LLIconCtrl; class LLLineEditor; -class LLTextBox; class LLTextEditor; class LLTextureCtrl; -class LLUICtrl; -class LLMessageSystem; class AIFilePicker; class LLPanelPick : public LLPanel, public LLAvatarPropertiesObserver { public: - LLPanelPick(BOOL top_pick); + LLPanelPick(); /*virtual*/ ~LLPanelPick(); void reset(); /*virtual*/ BOOL postBuild(); - /*virtual*/ void draw(); - /*virtual*/ void refresh(); - /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); // Setup a new pick, including creating an id, giving a sane @@ -87,7 +74,7 @@ public: // from the server next time it is drawn. void markForServerRequest(); - std::string getPickName(); + const std::string& getPickName() const { return mNameEditor->getText(); } const LLUUID& getPickID() const { return mPickID; } const LLUUID& getPickCreatorID() const { return mCreatorID; } @@ -95,26 +82,24 @@ public: void sendPickInfoUpdate(); protected: - static void onClickTeleport(void* data); - static void onClickMap(void* data); - //static void onClickLandmark(void* data); - static void onClickSet(void* data); + void onClickTeleport(); + void onClickMap(); + //void onClickLandmark(); + void onClickSet(); - static void onCommitAny(LLUICtrl* ctrl, void* data); + void onCommitAny(); -protected: //Pick import and export - RK - BOOL mImporting; + bool mImporting; std::string mLocationText; - BOOL mTopPick; LLUUID mPickID; LLUUID mCreatorID; LLUUID mParcelID; // Data will be requested on first draw - BOOL mDataRequested; - BOOL mDataReceived; + bool mDataRequested; + bool mDataReceived; std::string mSimName; LLVector3d mPosGlobal; @@ -124,13 +109,9 @@ protected: LLTextEditor* mDescEditor; LLLineEditor* mLocationEditor; - LLButton* mTeleportBtn; - LLButton* mMapBtn; - - LLTextBox* mSortOrderText; - LLLineEditor* mSortOrderEditor; - LLCheckBoxCtrl* mEnabledCheck; - LLButton* mSetBtn; + LLUICtrl* mTeleportBtn; + LLUICtrl* mSetBtn; + LLUICtrl* mOpenBtn; typedef std::list panel_list_t; static panel_list_t sAllPanels; diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 391499f26..ee27ead48 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -249,7 +249,7 @@ void LLParticipantList::refreshSpeakers() if (speakerp->mStatus == LLSpeaker::STATUS_MUTED) { icon_cell->setValue("mute_icon.tga"); - static const LLCachedControl sAscentMutedColor(gColors, "AscentMutedColor"); + static const LLCachedControl sAscentMutedColor("AscentMutedColor"); icon_cell->setColor(speakerp->mModeratorMutedVoice ? /*LLColor4::grey*/sAscentMutedColor : LLColor4(1.f, 71.f / 255.f, 71.f / 255.f, 1.f)); } else diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index ea0ac8b94..86e17aa4b 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -186,7 +186,7 @@ public: static void onBtnRemove( void* userdata ); static void onBtnBrowser( void* userdata ); - static void onLocalScrollCommit ( LLUICtrl* ctrl, void *userdata ); + void onLocalScrollCommit(); // tag: vaa emerald local_asset_browser [end] protected: @@ -486,8 +486,7 @@ BOOL LLFloaterTexturePicker::postBuild() childSetAction("Browser", LLFloaterTexturePicker::onBtnBrowser, this); mLocalScrollCtrl = getChild("local_name_list"); - mLocalScrollCtrl->setCallbackUserData(this); - mLocalScrollCtrl->setCommitCallback(onLocalScrollCommit); + mLocalScrollCtrl->setCommitCallback(boost::bind(&LLFloaterTexturePicker::onLocalScrollCommit, this)); LocalAssetBrowser::UpdateTextureCtrlList( mLocalScrollCtrl ); // tag: vaa emerald local_asset_browser [end] @@ -909,15 +908,14 @@ void LLFloaterTexturePicker::onBtnBrowser(void *userdata) FloaterLocalAssetBrowser::show(NULL); } -// static, reacts to user clicking a valid field in the local scroll list. -void LLFloaterTexturePicker::onLocalScrollCommit(LLUICtrl *ctrl, void *userdata) +// reacts to user clicking a valid field in the local scroll list. +void LLFloaterTexturePicker::onLocalScrollCommit() { - LLFloaterTexturePicker* self = (LLFloaterTexturePicker*) userdata; - LLUUID id = (LLUUID)self->mLocalScrollCtrl->getSelectedItemLabel( LOCALLIST_COL_ID ); + LLUUID id(mLocalScrollCtrl->getSelectedItemLabel(LOCALLIST_COL_ID)); - self->mOwner->setImageAssetID( id ); - if ( self->childGetValue("apply_immediate_check").asBoolean() ) - { self->mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, id); } // calls an overridden function. + mOwner->setImageAssetID(id); + if (childGetValue("apply_immediate_check").asBoolean()) + mOwner->onFloaterCommit(LLTextureCtrl::TEXTURE_CHANGE, id); // calls an overridden function. } // tag: vaa emerald local_asset_browser [end] diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index f501d7701..8fd959cf2 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -170,7 +170,7 @@ static bool handleRenderPerfTestChanged(const LLSD& newvalue) LLPipeline::RENDER_TYPE_CLASSIC_CLOUDS, LLPipeline::RENDER_TYPE_HUD_PARTICLES, LLPipeline::END_RENDER_TYPES); - gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_FEATURE_UI, false); + gPipeline.setRenderDebugFeatureControl(~(U32)0, false); // Reset all RENDER_DEBUG_FEATURE_* flags. } else { diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index c929c94f2..1fc40806c 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3613,78 +3613,81 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) // because I moved it to above //chatter = gObjectList.findObject(from_id); // - if (chatter) + + msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); + + if ((source_temp == CHAT_SOURCE_OBJECT) && (type_temp == CHAT_TYPE_OWNER) && + (mesg.substr(0, 3) == "># ")) { - if ((source_temp == CHAT_SOURCE_OBJECT) && (type_temp == CHAT_TYPE_OWNER) && - (mesg.substr(0, 3) == "># ")) + if (mesg.substr(mesg.size()-3, 3) == " #<"){ + // hello from object + if (from_id.isNull()) return; + char buf[200]; + snprintf(buf, 200, "%s v%d.%d.%d", gVersionChannel, gVersionMajor, gVersionMinor, gVersionPatch); + send_chat_from_viewer(buf, CHAT_TYPE_WHISPER, 427169570); + sChatObjectAuth[from_id] = 1; + return; + } + else if (from_id.isNull() || sChatObjectAuth.find(from_id) != sChatObjectAuth.end()) { - if (mesg.substr(mesg.size()-3, 3) == " #<"){ - // hello from object - if (from_id.isNull()) return; - char buf[200]; - snprintf(buf, 200, "%s v%d.%d.%d", gVersionChannel, gVersionMajor, gVersionMinor, gVersionPatch); - send_chat_from_viewer(buf, CHAT_TYPE_WHISPER, 427169570); - sChatObjectAuth[from_id] = 1; - return; - } - else if (from_id.isNull() || sChatObjectAuth.find(from_id) != sChatObjectAuth.end()) + LLUUID key; + if (key.set(mesg.substr(3, 36),false)) { - LLUUID key; - if (key.set(mesg.substr(3, 36),false)) + // object command found + if (key.isNull() && (mesg.size() == 39)) { - // object command found - if (key.isNull() && (mesg.size() == 39)) + // clear all nameplates + for (int i=0; i(obj)) - { - avatar->clearNameFromChat(); - } - } - } - else - { - if (key.isNull()) - { - llwarns << "Nameplate from chat on NULL avatar (ignored)" << llendl; - return; - } - LLVOAvatar *avatar = gObjectList.findAvatar(key); - if (!avatar) - { - llwarns << "Nameplate from chat on invalid avatar (ignored)" << llendl; - return; - } - if (mesg.size() == 39) + LLViewerObject *obj = gObjectList.getObject(i); + if (LLVOAvatar *avatar = dynamic_cast(obj)) { avatar->clearNameFromChat(); } - else if (mesg[39] == ' ') - { - avatar->setNameFromChat(mesg.substr(40)); - } } - return; } - else if (mesg.substr(2, 9) == " floater ") + else { - HippoFloaterXml::execute(mesg.substr(11)); - return; - } - else if (mesg.substr(2, 6) == " auth ") - { - std::string authUrl = mesg.substr(8); - authUrl += (authUrl.find('?') != std::string::npos)? "&auth=": "?auth="; - authUrl += gAuthString; - LLHTTPClient::get(authUrl, new AuthHandler); - return; + if (key.isNull()) + { + llwarns << "Nameplate from chat on NULL avatar (ignored)" << llendl; + return; + } + LLVOAvatar *avatar = gObjectList.findAvatar(key); + if (!avatar) + { + llwarns << "Nameplate from chat on invalid avatar (ignored)" << llendl; + return; + } + if (mesg.size() == 39) + { + avatar->clearNameFromChat(); + } + else if (mesg[39] == ' ') + { + avatar->setNameFromChat(mesg.substr(40)); + } } + return; + } + else if (mesg.substr(2, 9) == " floater ") + { + HippoFloaterXml::execute(mesg.substr(11)); + return; + } + else if (mesg.substr(2, 6) == " auth ") + { + std::string authUrl = mesg.substr(8); + authUrl += (authUrl.find('?') != std::string::npos)? "&auth=": "?auth="; + authUrl += gAuthString; + LLHTTPClient::get(authUrl, new AuthHandler); + return; } } + } + if (chatter) + { chat.mPosAgent = chatter->getPositionAgent(); // Make swirly things only for talking objects. (not script debug messages, though) @@ -3753,8 +3756,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) if (is_audible) { - msg->getStringFast(_PREHASH_ChatData, _PREHASH_Message, mesg); - // NaCl - Newline flood protection static LLCachedControl AntiSpamEnabled(gSavedSettings,"AntiSpamEnabled",false); if (AntiSpamEnabled && can_block(from_id)) diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 32817b9a1..0e8e97f3a 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -809,9 +809,9 @@ void LLViewerParcelMedia::filterMedia(LLParcel* parcel, U32 type) sDeniedMedia.erase(ip); dirty = true; } - if (dirty) + if (dirty && SLFloaterMediaFilter::findInstance()) { - SLFloaterMediaFilter::setDirty(); + SLFloaterMediaFilter::getInstance()->setDirty(); } } @@ -987,7 +987,7 @@ void callback_media_alert(const LLSD ¬ification, const LLSD &response, LLParc } LLViewerParcelMedia::sMediaQueries.erase(domain); - SLFloaterMediaFilter::setDirty(); + if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty(); } void LLViewerParcelMedia::saveDomainFilterList() @@ -1018,7 +1018,7 @@ bool LLViewerParcelMedia::loadDomainFilterList() llifstream medialistFile(medialist_filename); LLSDSerialize::fromXML(sMediaFilterList, medialistFile); medialistFile.close(); - SLFloaterMediaFilter::setDirty(); + if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty(); return true; } else @@ -1034,7 +1034,7 @@ void LLViewerParcelMedia::clearDomainFilterList() sDeniedMedia.clear(); saveDomainFilterList(); LLNotificationsUtil::add("MediaFiltersCleared"); - SLFloaterMediaFilter::setDirty(); + if (SLFloaterMediaFilter::findInstance()) SLFloaterMediaFilter::getInstance()->setDirty(); } std::string LLViewerParcelMedia::extractDomain(std::string url) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index 73ee75104..7e9f8ea5e 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -1621,7 +1621,11 @@ void LLViewerRegion::unpackRegionHandshake() msg->addUUID("AgentID", gAgent.getID()); msg->addUUID("SessionID", gAgent.getSessionID()); msg->nextBlock("RegionInfo"); - msg->addU32("Flags", 0x0 ); + + U32 flags = 0; + flags |= REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE; + + msg->addU32("Flags", flags ); msg->sendReliable(host); } diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index 821b87a5d..e22fc3907 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -56,6 +56,8 @@ #define WATER 2 const U32 MAX_OBJECT_CACHE_ENTRIES = 50000; +// Region handshake flags +const U32 REGION_HANDSHAKE_SUPPORTS_SELF_APPEARANCE = 1U << 2; class LLEventPoll; class LLVLComposition; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index d12b63997..29072ce93 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -3,10 +3,9 @@ * @brief Text editor widget to let users enter a multi-line document. * * $LicenseInfo:firstyear=2001&license=viewergpl$ - * + * Second Life Viewer Source Code * Copyright (c) 2001-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 @@ -32,42 +31,39 @@ #include "llviewerprecompiledheaders.h" -#include "llfocusmgr.h" -#include "llaudioengine.h" -#include "llagent.h" -#include "llinventory.h" -#include "llinventorydefines.h" -#include "llinventorymodel.h" -#include "llinventorypanel.h" -#include "llinventorybridge.h" // for landmark prefix string - #include "llviewertexteditor.h" -#include "llfloaterchat.h" +#include "llagent.h" +#include "llaudioengine.h" +#include "llavataractions.h" #include "llfloaterworldmap.h" -#include "llnotify.h" +#include "llfocusmgr.h" +#include "llinventorybridge.h" // for landmark prefix string +#include "llinventorydefines.h" +#include "llinventorymodel.h" +#include "llmemorystream.h" +#include "llmenugl.h" +#include "llnotecard.h" +#include "llnotificationsutil.h" #include "llpreview.h" #include "llpreviewtexture.h" #include "llpreviewnotecard.h" -#include "llpreviewlandmark.h" #include "llscrollbar.h" #include "lltooldraganddrop.h" +#include "lluictrlfactory.h" +#include "llviewerassettype.h" #include "llviewercontrol.h" +#include "llviewerinventory.h" #include "llviewertexturelist.h" #include "llviewerwindow.h" -#include "llviewerinventory.h" -#include "lluictrlfactory.h" -#include "llnotecard.h" -#include "llmemorystream.h" -#include "llmenugl.h" -#include "llviewerassettype.h" - -#include "llappviewer.h" // for gPacificDaylightTime // [RLVa:KB] #include "rlvhandler.h" // [/RLVa:KB] +void open_landmark(LLViewerInventoryItem* inv_item, const std::string& title, BOOL show_keep_discard, const LLUUID& source_id, BOOL take_focus); +extern BOOL gPacificDaylightTime; + static LLRegisterWidget r("text_editor"); ///---------------------------------------------------------------------------- @@ -113,7 +109,7 @@ public: // See if we can bring an existing preview to the front if(!LLPreview::show(item->getUUID(), true)) { - if(!gSavedSettings.getBOOL("ShowNewInventory")) + if (gSavedSettings.getBOOL("ShowNewInventory")) // Singu Note: ShowNewInventory is true, not false, when they want a preview { // There isn't one, so make a new preview S32 left, top; @@ -1407,6 +1403,10 @@ BOOL LLViewerTextEditor::openEmbeddedItem(LLInventoryItem* item, llwchar wc) openEmbeddedLandmark( item, wc ); return TRUE; + case LLAssetType::AT_CALLINGCARD: + openEmbeddedCallingcard( item, wc ); + return TRUE; + case LLAssetType::AT_LSL_TEXT: case LLAssetType::AT_CLOTHING: case LLAssetType::AT_OBJECT: @@ -1483,18 +1483,26 @@ void LLViewerTextEditor::openEmbeddedNotecard( LLInventoryItem* item, llwchar wc copyInventory(item, gInventoryCallbacks.registerCB(mInventoryCallback)); } +void LLViewerTextEditor::openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc ) +{ + if(item && !item->getCreatorUUID().isNull()) + { + LLAvatarActions::showProfile(item->getCreatorUUID()); + } +} + void LLViewerTextEditor::showUnsavedAlertDialog( LLInventoryItem* item ) { LLSD payload; payload["item_id"] = item->getUUID(); payload["notecard_id"] = mNotecardInventoryID; - LLNotifications::instance().add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog); + LLNotificationsUtil::add( "ConfirmNotecardSave", LLSD(), payload, LLViewerTextEditor::onNotecardDialog); } // static bool LLViewerTextEditor::onNotecardDialog(const LLSD& notification, const LLSD& response ) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if( option == 0 ) { // itemptr is deleted by LLPreview::save @@ -1512,13 +1520,13 @@ void LLViewerTextEditor::showCopyToInvDialog( LLInventoryItem* item, llwchar wc LLUUID item_id = item->getUUID(); payload["item_id"] = item_id; payload["item_wc"] = LLSD::Integer(wc); - LLNotifications::instance().add( "ConfirmItemCopy", LLSD(), payload, + LLNotificationsUtil::add( "ConfirmItemCopy", LLSD(), payload, boost::bind(&LLViewerTextEditor::onCopyToInvDialog, this, _1, _2)); } bool LLViewerTextEditor::onCopyToInvDialog(const LLSD& notification, const LLSD& response) { - S32 option = LLNotification::getSelectedOption(notification, response); + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); if( 0 == option ) { LLUUID item_id = notification["payload"]["item_id"].asUUID(); diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index 0a364a90f..702b97ca1 100644 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -117,6 +117,7 @@ private: void openEmbeddedSound( LLInventoryItem* item, llwchar wc ); void openEmbeddedLandmark( LLInventoryItem* item, llwchar wc ); void openEmbeddedNotecard( LLInventoryItem* item, llwchar wc); + void openEmbeddedCallingcard( LLInventoryItem* item, llwchar wc); void showCopyToInvDialog( LLInventoryItem* item, llwchar wc ); void showUnsavedAlertDialog( LLInventoryItem* item ); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index ea15621a1..a56b4c5af 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -26,6 +26,9 @@ #include "llviewerprecompiledheaders.h" #include "llvoicevivox.h" +#if LL_LINUX && defined(LL_STANDALONE) +#include // g_find_program_in_path +#endif #include "llsdutil.h" diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 88f1ad044..2d42aff94 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5999,7 +5999,7 @@ void LLPipeline::setRenderDebugFeatureControl(U32 bit, bool value) } else { - gPipeline.mRenderDebugFeatureMask &= !bit; + gPipeline.mRenderDebugFeatureMask &= ~bit; } } diff --git a/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/indra/newview/skins/default/xui/en-us/floater_about_land.xml index 122ef6d05..d4d678906 100644 --- a/indra/newview/skins/default/xui/en-us/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en-us/floater_about_land.xml @@ -641,9 +641,6 @@ Only large parcels can be listed in search. This option is disabled because you cannot modify this parcel's options. - - See and chat with residents on this parcel - @@ -765,7 +762,7 @@ Only large parcels can be listed in search. Allow Residents on other parcels to: diff --git a/indra/newview/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index 54ba7516e..ef5e8fd71 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -704,7 +704,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/floater_directory2.xml b/indra/newview/skins/default/xui/en-us/floater_directory2.xml index 396006a20..05b63606f 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory2.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory2.xml @@ -640,7 +640,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/floater_directory3.xml b/indra/newview/skins/default/xui/en-us/floater_directory3.xml index 16386db58..e3b17ab10 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory3.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory3.xml @@ -763,7 +763,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - diff --git a/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml b/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml index d7b1e9688..2ff113358 100644 --- a/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml +++ b/indra/newview/skins/default/xui/en-us/floater_new_outfit_dialog.xml @@ -9,20 +9,20 @@