From f497a8a3d5793ac536d737007fc528b859d748e5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 3 Jun 2013 03:27:25 +0200 Subject: [PATCH 01/26] Fox the Octopus break I caused --- indra/newview/llviewermessage.cpp | 119 +++++++++++++++--------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 78e514a75..3e142bf51 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3465,78 +3465,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) @@ -3605,8 +3608,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)) From c5489932cfde7f4d6c7ad17224c6eab98dd57191 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Tue, 4 Jun 2013 00:31:44 +0200 Subject: [PATCH 02/26] Fix ASSERT(!mUploadFinished || mBeingRedirected) Hopefully this is the last case. --- indra/llmessage/aicurlthread.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; From e59cefa0ccf505baf4385d5fbff3d8d0bca7f2c3 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Fri, 7 Jun 2013 16:19:46 +0200 Subject: [PATCH 03/26] Bug fix of LLPipeline::setRenderDebugFeatureControl This commit has no effect on how the viewer behaves currently. --- indra/newview/llviewercontrol.cpp | 2 +- indra/newview/pipeline.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 59958523b..f07bcf110 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/pipeline.cpp b/indra/newview/pipeline.cpp index 311d21c0b..508b8bb2c 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -5951,7 +5951,7 @@ void LLPipeline::setRenderDebugFeatureControl(U32 bit, bool value) } else { - gPipeline.mRenderDebugFeatureMask &= !bit; + gPipeline.mRenderDebugFeatureMask &= ~bit; } } From aca39d8c11d53f468e58fca34982717da1ae6c0e Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Mon, 10 Jun 2013 16:07:45 +0200 Subject: [PATCH 04/26] Fix crash when granting/removing build rights to others. Bug was introduced in c701c615664f598818d070775b1509103a24f03e for single persons, but already existed for when granting rights to more than one person at a time. There is still a problem left now that you have to confirm several times (once, but also had to confirm two or three times) before it gets through. That doesn't seem related to THIS bug, but seems to be a new bug, possibly introduced in the same commit mentioned above. --- indra/newview/llfloaterfriends.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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)); } } } From def40055b013d909fd585be9c0d02da500aa83e9 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 12 Jun 2013 03:10:11 +0200 Subject: [PATCH 05/26] Don't add windows filesname to service list. --- indra/llmessage/aicurlperservice.cpp | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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. From af1eaac79d76dd1ba0017b21cab4b155eb7a7ba1 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 12 Jun 2013 14:55:46 +0200 Subject: [PATCH 06/26] Bug fix. Revert an incorrect change made in c5fc945f33e441705d8518077468184dda6b3599 (imported from viewer 3). This stops ASSERT(mSegments.back()->getEnd() == getLength()) in LLTextEditor::loadKeywords. --- indra/llui/llkeywords.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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() ) { From 34b921a101ce493404264f271037e1ed54c19120 Mon Sep 17 00:00:00 2001 From: Aleric Inglewood Date: Wed, 12 Jun 2013 21:21:41 +0200 Subject: [PATCH 07/26] Disable llassert(!mUploadFinished) This fires so little that it isn't worth anymore to look into it (the only problem resulting from this is a wrong timeout on one of the http requests); and therefore no longer makes sense to have it triggered in alpha builds at all, since those do not produce enough debug output to understand what caused it in the first place. --- indra/llmessage/aihttptimeout.cpp | 3 +++ 1 file changed, 3 insertions(+) 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; From 35bcf34f06d6aa2a6adfa1bd1a1062443ebfc69f Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 14 Jun 2013 14:49:24 -0400 Subject: [PATCH 08/26] Removing unused panel_group_finder.xml, looks like some ancient version of panel_group.xml --- .../default/xui/en-us/panel_group_finder.xml | 19 ------------------- .../default/xui/es/panel_group_finder.xml | 16 ---------------- .../default/xui/fr/panel_group_finder.xml | 9 --------- .../default/xui/pt/panel_group_finder.xml | 9 --------- 4 files changed, 53 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en-us/panel_group_finder.xml delete mode 100644 indra/newview/skins/default/xui/es/panel_group_finder.xml delete mode 100644 indra/newview/skins/default/xui/fr/panel_group_finder.xml delete mode 100644 indra/newview/skins/default/xui/pt/panel_group_finder.xml diff --git a/indra/newview/skins/default/xui/en-us/panel_group_finder.xml b/indra/newview/skins/default/xui/en-us/panel_group_finder.xml deleted file mode 100644 index 3e5156880..000000000 --- a/indra/newview/skins/default/xui/en-us/panel_group_finder.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - There are unapplied changes on the current tab. - - - Do you want to apply these changes? - - - - - - - - - diff --git a/indra/newview/skins/default/xui/es/panel_group_finder.xml b/indra/newview/skins/default/xui/es/panel_group_finder.xml deleted file mode 100644 index 820273e64..000000000 --- a/indra/newview/skins/default/xui/es/panel_group_finder.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - Hay cambios sin aplicar en esta pestaña. - - - ¿Deseas aplicar estos cambios? - - - - - - - - - diff --git a/indra/newview/skins/default/xui/fr/panel_group_finder.xml b/indra/newview/skins/default/xui/fr/panel_group_finder.xml deleted file mode 100644 index 50fefe36c..000000000 --- a/indra/newview/skins/default/xui/fr/panel_group_finder.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - Certains changements n'ont pas été appliqués sur cet onglet. - - - Voulez-vous enregistrer les modifications? - - diff --git a/indra/newview/skins/default/xui/pt/panel_group_finder.xml b/indra/newview/skins/default/xui/pt/panel_group_finder.xml deleted file mode 100644 index 051db51ff..000000000 --- a/indra/newview/skins/default/xui/pt/panel_group_finder.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - Existem mudanças não concluídas na aba atual - - - Deseja aplicar as mudanças? - - From cf675c37482ad510de5b07a89429f65198b62e8d Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 14 Jun 2013 22:04:27 -0400 Subject: [PATCH 09/26] Feature Request (from IRC): Add option to display complete name on profile (Available on Vanity Preferences at the bottom of the main tab) Note: This will not work with legacy names selected because that disables the display name system altogether right now, if we ever separate the disabling to another setting, this would work. --- indra/newview/app_settings/settings_ascent.xml | 11 +++++++++++ indra/newview/ascentprefsvan.cpp | 2 ++ indra/newview/ascentprefsvan.h | 1 + indra/newview/llpanelavatar.cpp | 5 ++++- .../xui/en-us/panel_preferences_ascent_vanity.xml | 1 + 5 files changed, 19 insertions(+), 1 deletion(-) 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/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 524de0fb0..3915aab8f 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -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/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml index f38cc9632..531da05a5 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_ascent_vanity.xml @@ -12,6 +12,7 @@ + From 8ce71811c57e93fe0a0a3153ba213d33085ac514 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Fri, 14 Jun 2013 23:08:56 -0400 Subject: [PATCH 10/26] Feature Request (from IRC): Allow less restrictive access to group profiles from search mAllowEdit has really signified whether or not llpanelgroup was in its own standalone floater This change removes the restrictions the lindens chose to put on group search, allowing the user as much control as possible over a group from outside a dedicated floater Notices and Land & Money get their information from messages passed through viewermessage, addressed to the right instance by id, as such they must be unique to the standalone floater Cancel button in group search will only enable when changes have been made and will refresh the group, clearing changes. The OK button is not visible in group search as it serves the same purpose as the Apply button here. --- indra/newview/llfloaterdirectory.cpp | 2 +- indra/newview/llpanelgroup.cpp | 17 ++++++++----- indra/newview/llpanelgroupgeneral.cpp | 25 +++++++------------ indra/newview/llpanelgrouproles.cpp | 2 +- indra/newview/llpanelgroupvoting.cpp | 2 +- .../default/xui/en-us/floater_directory.xml | 2 +- 6 files changed, 24 insertions(+), 26 deletions(-) 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/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/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/skins/default/xui/en-us/floater_directory.xml b/indra/newview/skins/default/xui/en-us/floater_directory.xml index 78391be16..6817602b0 100644 --- a/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/indra/newview/skins/default/xui/en-us/floater_directory.xml @@ -703,7 +703,7 @@ To buy direct, visit the land and click on the place name in the title bar. width="430" /> - From c5d21cfb1c4758f08b2a36dab194af65a26b20eb Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Sat, 15 Jun 2013 06:10:31 -0400 Subject: [PATCH 11/26] Updated pick panel code, removed dead stuff including xmls. --- indra/newview/llpanelavatar.cpp | 6 +- indra/newview/llpanelpick.cpp | 277 ++++-------------- indra/newview/llpanelpick.h | 44 +-- .../default/xui/en-us/panel_avatar_pick.xml | 8 - .../default/xui/en-us/panel_top_pick.xml | 29 -- .../skins/default/xui/es/panel_top_pick.xml | 10 - .../skins/default/xui/fr/panel_top_pick.xml | 10 - .../skins/default/xui/pt/panel_top_pick.xml | 10 - 8 files changed, 76 insertions(+), 318 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en-us/panel_top_pick.xml delete mode 100644 indra/newview/skins/default/xui/es/panel_top_pick.xml delete mode 100644 indra/newview/skins/default/xui/fr/panel_top_pick.xml delete mode 100644 indra/newview/skins/default/xui/pt/panel_top_pick.xml diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 3915aab8f..bd0f62603 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); } diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index f599fc915..2f4261be9 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -73,9 +73,8 @@ //static std::list LLPanelPick::sAllPanels; -LLPanelPick::LLPanelPick(BOOL top_pick) +LLPanelPick::LLPanelPick() : LLPanel(std::string("Top Picks Panel")), - mTopPick(top_pick), mPickID(), mCreatorID(), mParcelID(), @@ -86,26 +85,12 @@ LLPanelPick::LLPanelPick(BOOL top_pick) mNameEditor(NULL), mDescEditor(NULL), mLocationEditor(NULL), - mTeleportBtn(NULL), - mMapBtn(NULL), - //mLandmarkBtn(NULL), - mSortOrderText(NULL), - mSortOrderEditor(NULL), - mEnabledCheck(NULL), mSetBtn(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"); } @@ -142,83 +127,52 @@ 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->setCommitCallback(boost::bind(&LLPanelPick::onCommitAny, this)); mDescEditor = getChild("desc_editor"); mDescEditor->setCommitOnFocusLost(TRUE); - mDescEditor->setCommitCallback(onCommitAny); - mDescEditor->setCallbackUserData(this); + 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->setCommitCallback(boost::bind(&LLPanelPick::onClickSet,this)); - mTeleportBtn = getChild( "pick_teleport_btn"); - mTeleportBtn->setClickedCallback(boost::bind(&LLPanelPick::onClickTeleport,this)); - - 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,7 +180,6 @@ 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; @@ -243,24 +196,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 +230,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 +264,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 +276,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(); @@ -369,15 +304,8 @@ void LLPanelPick::markForServerRequest() } -std::string LLPanelPick::getPickName() -{ - return mNameEditor->getText(); -} - - void LLPanelPick::sendPickInfoRequest() { - //llassert_always(mCreatorID != gAgent.getID()); LLAvatarPropertiesProcessor::getInstance()->addObserver(mCreatorID, this); LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(mCreatorID, mPickID); @@ -396,24 +324,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 +343,49 @@ 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] - } + + 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 +393,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..be8fa660a 100644 --- a/indra/newview/llpanelpick.h +++ b/indra/newview/llpanelpick.h @@ -30,43 +30,32 @@ * $/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 +76,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 +84,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 +111,8 @@ protected: LLTextEditor* mDescEditor; LLLineEditor* mLocationEditor; - LLButton* mTeleportBtn; - LLButton* mMapBtn; - - LLTextBox* mSortOrderText; - LLLineEditor* mSortOrderEditor; - LLCheckBoxCtrl* mEnabledCheck; - LLButton* mSetBtn; + LLButton* mTeleportBtn; + LLButton* mSetBtn; typedef std::list panel_list_t; static panel_list_t sAllPanels; diff --git a/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml b/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml index b43b2718d..2739e0f06 100644 --- a/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml +++ b/indra/newview/skins/default/xui/en-us/panel_avatar_pick.xml @@ -18,12 +18,4 @@ name="pick_teleport_btn" width="70" />