summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskolb <none@none>2009-12-21 09:31:48 -0800
committerskolb <none@none>2009-12-21 09:31:48 -0800
commitec8738ac4501fd2158ca2ebeb146239f98dcd971 (patch)
treec63d3222fbb5f8036b012c60e8622cd085fbe60d
parentb910de4ad7f91bb2022bfb8304c3dea32c0a4857 (diff)
parentd894c7a0d8292ce2114e88f382dcf6187b0d2535 (diff)
Merge viewer 2-0 into media
-rw-r--r--indra/llui/llnotificationslistener.cpp269
-rw-r--r--indra/llui/llnotificationslistener.h20
-rw-r--r--indra/llui/llurlentry.cpp4
-rw-r--r--indra/llui/llurlregistry.cpp20
-rw-r--r--indra/llui/llurlregistry.h4
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h6
-rw-r--r--indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp11
-rw-r--r--indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp63
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llfloaterland.cpp22
-rw-r--r--indra/newview/llfloaterland.h7
-rw-r--r--indra/newview/llfloaterscriptlimits.cpp1061
-rw-r--r--indra/newview/llfloaterscriptlimits.h259
-rw-r--r--indra/newview/llfloatertopobjects.cpp5
-rw-r--r--indra/newview/llnavigationbar.cpp18
-rw-r--r--indra/newview/llpanelpicks.cpp12
-rw-r--r--indra/newview/llpanelpicks.h2
-rw-r--r--indra/newview/lltexturefetch.cpp22
-rw-r--r--indra/newview/lltextureview.cpp28
-rw-r--r--indra/newview/lltoastalertpanel.h2
-rw-r--r--indra/newview/llviewerdisplay.cpp2
-rw-r--r--indra/newview/llviewerfloaterreg.cpp2
-rw-r--r--indra/newview/llviewerregion.cpp3
-rw-r--r--indra/newview/llviewerstats.cpp4
-rw-r--r--indra/newview/llviewertexture.cpp3
-rw-r--r--indra/newview/skins/default/xui/en/floater_about_land.xml12
-rw-r--r--indra/newview/skins/default/xui/en/floater_customize.xml25
-rw-r--r--indra/newview/skins/default/xui/en/floater_script_limits.xml20
-rw-r--r--indra/newview/skins/default/xui/en/floater_search.xml4
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_setup.xml8
-rw-r--r--indra/newview/skins/default/xui/en/panel_script_limits_my_avatar.xml62
-rw-r--r--indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml122
-rw-r--r--indra/newview/skins/default/xui/en/strings.xml53
33 files changed, 2087 insertions, 72 deletions
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index fe4fbe7510..629964c322 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -10,10 +10,10 @@
*/
#include "linden_common.h"
-
#include "llnotificationslistener.h"
-
#include "llnotifications.h"
+#include "llsd.h"
+#include "llui.h"
LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
LLEventAPI("LLNotifications",
@@ -24,6 +24,47 @@ LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications
"Add a notification with specified [\"name\"], [\"substitutions\"] and [\"payload\"].\n"
"If optional [\"reply\"] specified, arrange to send user response on that LLEventPump.",
&LLNotificationsListener::requestAdd);
+ add("listChannels",
+ "Post to [\"reply\"] a map of info on existing channels",
+ &LLNotificationsListener::listChannels,
+ LLSD().with("reply", LLSD()));
+ add("listChannelNotifications",
+ "Post to [\"reply\"] an array of info on notifications in channel [\"channel\"]",
+ &LLNotificationsListener::listChannelNotifications,
+ LLSD().with("reply", LLSD()).with("channel", LLSD()));
+ add("respond",
+ "Respond to notification [\"uuid\"] with data in [\"response\"]",
+ &LLNotificationsListener::respond,
+ LLSD().with("uuid", LLSD()));
+ add("cancel",
+ "Cancel notification [\"uuid\"]",
+ &LLNotificationsListener::cancel,
+ LLSD().with("uuid", LLSD()));
+ add("ignore",
+ "Ignore future notification [\"name\"]\n"
+ "(from <notification name= > in notifications.xml)\n"
+ "according to boolean [\"ignore\"].\n"
+ "If [\"name\"] is omitted or undefined, [un]ignore all future notifications.\n"
+ "Note that ignored notifications are not forwarded unless intercepted before\n"
+ "the \"Ignore\" channel.",
+ &LLNotificationsListener::ignore);
+ add("forward",
+ "Forward to [\"pump\"] future notifications on channel [\"channel\"]\n"
+ "according to boolean [\"forward\"]. When enabled, only types matching\n"
+ "[\"types\"] are forwarded, as follows:\n"
+ "omitted or undefined: forward all notifications\n"
+ "string: forward only the specific named [sig]type\n"
+ "array of string: forward any notification matching any named [sig]type.\n"
+ "When boolean [\"respond\"] is true, we auto-respond to each forwarded\n"
+ "notification.",
+ &LLNotificationsListener::forward,
+ LLSD().with("channel", LLSD()));
+}
+
+// This is here in the .cpp file so we don't need the definition of class
+// Forwarder in the header file.
+LLNotificationsListener::~LLNotificationsListener()
+{
}
void LLNotificationsListener::requestAdd(const LLSD& event_data) const
@@ -57,3 +98,227 @@ void LLNotificationsListener::NotificationResponder(const std::string& reply_pum
reponse_event["response"] = response;
LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event);
}
+
+void LLNotificationsListener::listChannels(const LLSD& params) const
+{
+ LLReqID reqID(params);
+ LLSD response(reqID.makeResponse());
+ for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
+ cmend(mNotifications.mChannels.end());
+ cmi != cmend; ++cmi)
+ {
+ LLSD channelInfo;
+ channelInfo["parent"] = cmi->second->getParentChannelName();
+ response[cmi->first] = channelInfo;
+ }
+ LLEventPumps::instance().obtain(params["reply"]).post(response);
+}
+
+void LLNotificationsListener::listChannelNotifications(const LLSD& params) const
+{
+ LLReqID reqID(params);
+ LLSD response(reqID.makeResponse());
+ LLNotificationChannelPtr channel(mNotifications.getChannel(params["channel"]));
+ if (channel)
+ {
+ LLSD notifications(LLSD::emptyArray());
+ for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end());
+ ni != nend; ++ni)
+ {
+ notifications.append(asLLSD(*ni));
+ }
+ response["notifications"] = notifications;
+ }
+ LLEventPumps::instance().obtain(params["reply"]).post(response);
+}
+
+void LLNotificationsListener::respond(const LLSD& params) const
+{
+ LLNotificationPtr notification(mNotifications.find(params["uuid"]));
+ if (notification)
+ {
+ notification->respond(params["response"]);
+ }
+}
+
+void LLNotificationsListener::cancel(const LLSD& params) const
+{
+ LLNotificationPtr notification(mNotifications.find(params["uuid"]));
+ if (notification)
+ {
+ mNotifications.cancel(notification);
+ }
+}
+
+void LLNotificationsListener::ignore(const LLSD& params) const
+{
+ // Calling a method named "ignore", but omitting its "ignore" Boolean
+ // argument, should by default cause something to be ignored. Explicitly
+ // pass ["ignore"] = false to cancel ignore.
+ bool ignore = true;
+ if (params.has("ignore"))
+ {
+ ignore = params["ignore"].asBoolean();
+ }
+ // This method can be used to affect either a single notification name or
+ // all future notifications. The two use substantially different mechanisms.
+ if (params["name"].isDefined())
+ {
+ // ["name"] was passed: ignore just that notification
+ LLUI::sSettingGroups["ignores"]->setBOOL(params["name"], ignore);
+ }
+ else
+ {
+ // no ["name"]: ignore all future notifications
+ mNotifications.setIgnoreAllNotifications(ignore);
+ }
+}
+
+class LLNotificationsListener::Forwarder: public LLEventTrackable
+{
+ LOG_CLASS(LLNotificationsListener::Forwarder);
+public:
+ Forwarder(LLNotifications& llnotifications, const std::string& channel):
+ mNotifications(llnotifications),
+ mRespond(false)
+ {
+ // Connect to the specified channel on construction. Because
+ // LLEventTrackable is a base, we should automatically disconnect when
+ // destroyed.
+ LLNotificationChannelPtr channelptr(llnotifications.getChannel(channel));
+ if (channelptr)
+ {
+ // Try connecting at the front of the 'changed' signal. That way
+ // we shouldn't get starved by preceding listeners.
+ channelptr->connectAtFrontChanged(boost::bind(&Forwarder::handle, this, _1));
+ }
+ }
+
+ void setPumpName(const std::string& name) { mPumpName = name; }
+ void setTypes(const LLSD& types) { mTypes = types; }
+ void setRespond(bool respond) { mRespond = respond; }
+
+private:
+ bool handle(const LLSD& notification) const;
+ bool matchType(const LLSD& filter, const std::string& type) const;
+
+ LLNotifications& mNotifications;
+ std::string mPumpName;
+ LLSD mTypes;
+ bool mRespond;
+};
+
+void LLNotificationsListener::forward(const LLSD& params)
+{
+ std::string channel(params["channel"]);
+ // First decide whether we're supposed to start forwarding or stop it.
+ // Default to true.
+ bool forward = true;
+ if (params.has("forward"))
+ {
+ forward = params["forward"].asBoolean();
+ }
+ if (! forward)
+ {
+ // This is a request to stop forwarding notifications on the specified
+ // channel. The rest of the params don't matter.
+ // Because mForwarders contains scoped_ptrs, erasing the map entry
+ // DOES delete the heap Forwarder object. Because Forwarder derives
+ // from LLEventTrackable, destroying it disconnects it from the
+ // channel.
+ mForwarders.erase(channel);
+ return;
+ }
+ // From here on, we know we're being asked to start (or modify) forwarding
+ // on the specified channel. Find or create an appropriate Forwarder.
+ ForwarderMap::iterator
+ entry(mForwarders.insert(ForwarderMap::value_type(channel, ForwarderMap::mapped_type())).first);
+ if (! entry->second)
+ {
+ entry->second.reset(new Forwarder(mNotifications, channel));
+ }
+ // Now, whether this Forwarder is brand-new or not, update it with the new
+ // request info.
+ Forwarder& fwd(*entry->second);
+ fwd.setPumpName(params["pump"]);
+ fwd.setTypes(params["types"]);
+ fwd.setRespond(params["respond"]);
+}
+
+bool LLNotificationsListener::Forwarder::handle(const LLSD& notification) const
+{
+ LL_INFOS("LLNotificationsListener") << "handle(" << notification << ")" << LL_ENDL;
+ if (notification["sigtype"].asString() == "delete")
+ {
+ LL_INFOS("LLNotificationsListener") << "ignoring delete" << LL_ENDL;
+ return false;
+ }
+ LLNotificationPtr note(mNotifications.find(notification["id"]));
+ if (! note)
+ {
+ LL_INFOS("LLNotificationsListener") << notification["id"] << " not found" << LL_ENDL;
+ return false;
+ }
+ if (! matchType(mTypes, note->getType()))
+ {
+ LL_INFOS("LLNotificationsListener") << "didn't match types " << mTypes << LL_ENDL;
+ return false;
+ }
+ LL_INFOS("LLNotificationsListener") << "sending via '" << mPumpName << "'" << LL_ENDL;
+ // This is a notification we care about. Forward it through specified
+ // LLEventPump.
+ LLEventPumps::instance().obtain(mPumpName).post(asLLSD(note));
+ // Are we also being asked to auto-respond?
+ if (mRespond)
+ {
+ LL_INFOS("LLNotificationsListener") << "should respond" << LL_ENDL;
+ note->respond(LLSD::emptyMap());
+ // Did that succeed in removing the notification? Only cancel() if
+ // it's still around -- otherwise we get an LL_ERRS crash!
+ note = mNotifications.find(notification["id"]);
+ if (note)
+ {
+ LL_INFOS("LLNotificationsListener") << "respond() didn't clear, canceling" << LL_ENDL;
+ mNotifications.cancel(note);
+ }
+ }
+ return false; // let other listeners get same notification
+}
+
+bool LLNotificationsListener::Forwarder::matchType(const LLSD& filter, const std::string& type) const
+{
+ // Decide whether this notification matches filter:
+ // undefined: forward all notifications
+ if (filter.isUndefined())
+ {
+ return true;
+ }
+ // array of string: forward any notification matching any named type
+ if (filter.isArray())
+ {
+ for (LLSD::array_const_iterator ti(filter.beginArray()), tend(filter.endArray());
+ ti != tend; ++ti)
+ {
+ if (ti->asString() == type)
+ {
+ return true;
+ }
+ }
+ // Didn't match any entry in the array
+ return false;
+ }
+ // string: forward only the specific named type
+ return (filter.asString() == type);
+}
+
+LLSD LLNotificationsListener::asLLSD(LLNotificationPtr note)
+{
+ LLSD notificationInfo(note->asLLSD());
+ // For some reason the following aren't included in asLLSD().
+ notificationInfo["summary"] = note->summarize();
+ notificationInfo["id"] = note->id();
+ notificationInfo["type"] = note->getType();
+ notificationInfo["message"] = note->getMessage();
+ notificationInfo["label"] = note->getLabel();
+ return notificationInfo;
+}
diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h
index 9b405d7b4b..de208b57f0 100644
--- a/indra/llui/llnotificationslistener.h
+++ b/indra/llui/llnotificationslistener.h
@@ -13,6 +13,10 @@
#define LL_LLNOTIFICATIONSLISTENER_H
#include "lleventapi.h"
+#include "llnotificationptr.h"
+#include <boost/shared_ptr.hpp>
+#include <map>
+#include <string>
class LLNotifications;
class LLSD;
@@ -21,13 +25,27 @@ class LLNotificationsListener : public LLEventAPI
{
public:
LLNotificationsListener(LLNotifications & notifications);
+ ~LLNotificationsListener();
+private:
void requestAdd(LLSD const & event_data) const;
-private:
void NotificationResponder(const std::string& replypump,
const LLSD& notification,
const LLSD& response) const;
+
+ void listChannels(const LLSD& params) const;
+ void listChannelNotifications(const LLSD& params) const;
+ void respond(const LLSD& params) const;
+ void cancel(const LLSD& params) const;
+ void ignore(const LLSD& params) const;
+ void forward(const LLSD& params);
+
+ static LLSD asLLSD(LLNotificationPtr);
+
+ class Forwarder;
+ typedef std::map<std::string, boost::shared_ptr<Forwarder> > ForwarderMap;
+ ForwarderMap mForwarders;
LLNotifications & mNotifications;
};
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 7350457274..983f0a2d49 100644
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -80,7 +80,7 @@ std::string LLUrlEntryBase::escapeUrl(const std::string &url) const
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789"
- "-._~!$?&()*+,@:;=/%";
+ "-._~!$?&()*+,@:;=/%#";
std::sort(no_escape_chars.begin(), no_escape_chars.end());
initialized = true;
@@ -201,7 +201,7 @@ std::string LLUrlEntryHTTPLabel::getUrl(const std::string &string)
//
LLUrlEntryHTTPNoProtocol::LLUrlEntryHTTPNoProtocol()
{
- mPattern = boost::regex("(\\bwww\\.\\S+\\.\\S+|\\S+.com\\S*|\\S+.net\\S*|\\S+.edu\\S*|\\S+.org\\S*)",
+ mPattern = boost::regex("(\\bwww\\.\\S+\\.\\S+|\\b[^ \t\n\r\f\v:/]+.com\\S*|\\b[^ \t\n\r\f\v:/]+.net\\S*|\\b[^ \t\n\r\f\v:/]+.edu\\S*|\\b[^ \t\n\r\f\v:/]+.org\\S*)",
boost::regex::perl|boost::regex::icase);
mMenuName = "menu_url_http.xml";
mTooltip = LLTrans::getString("TooltipHttpUrl");
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index afcff0d409..ad5c0911f8 100644
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -223,3 +223,23 @@ bool LLUrlRegistry::hasUrl(const LLWString &text)
LLUrlMatch match;
return findUrl(text, match);
}
+
+bool LLUrlRegistry::isUrl(const std::string &text)
+{
+ LLUrlMatch match;
+ if (findUrl(text, match))
+ {
+ return (match.getStart() == 0 && match.getEnd() >= text.size()-1);
+ }
+ return false;
+}
+
+bool LLUrlRegistry::isUrl(const LLWString &text)
+{
+ LLUrlMatch match;
+ if (findUrl(text, match))
+ {
+ return (match.getStart() == 0 && match.getEnd() >= text.size()-1);
+ }
+ return false;
+}
diff --git a/indra/llui/llurlregistry.h b/indra/llui/llurlregistry.h
index d7800d8cfc..399ee0a988 100644
--- a/indra/llui/llurlregistry.h
+++ b/indra/llui/llurlregistry.h
@@ -85,6 +85,10 @@ public:
bool hasUrl(const std::string &text);
bool hasUrl(const LLWString &text);
+ // return true if the given string is a URL that findUrl would match
+ bool isUrl(const std::string &text);
+ bool isUrl(const LLWString &text);
+
private:
LLUrlRegistry();
friend class LLSingleton<LLUrlRegistry>;
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
index 2244ccc146..799808aa8b 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamertriviallogging.h
@@ -37,10 +37,16 @@
#include <cstdio>
+extern "C" {
+#include <sys/types.h>
+#include <unistd.h>
+}
+
/////////////////////////////////////////////////////////////////////////
// Debug/Info/Warning macros.
#define MSGMODULEFOO "(media plugin)"
#define STDERRMSG(...) do{\
+ fprintf(stderr, " pid:%d: ", (int)getpid());\
fprintf(stderr, MSGMODULEFOO " %s:%d: ", __FUNCTION__, __LINE__);\
fprintf(stderr, __VA_ARGS__);\
fputc('\n',stderr);\
diff --git a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
index 5bb0ef5a99..109e20f179 100644
--- a/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
+++ b/indra/media_plugins/gstreamer010/llmediaimplgstreamervidplug.cpp
@@ -108,11 +108,10 @@ gst_slvideo_show_frame (GstBaseSink * bsink, GstBuffer * buf)
slvideo = GST_SLVIDEO(bsink);
-#if 0
- fprintf(stderr, "\n\ntransferring a frame of %dx%d <- %p (%d)\n\n",
- slvideo->width, slvideo->height, GST_BUFFER_DATA(buf),
- slvideo->format);
-#endif
+ DEBUGMSG("\n\ntransferring a frame of %dx%d <- %p (%d)\n\n",
+ slvideo->width, slvideo->height, GST_BUFFER_DATA(buf),
+ slvideo->format);
+
if (GST_BUFFER_DATA(buf))
{
// copy frame and frame info into neutral territory
@@ -528,7 +527,7 @@ void gst_slvideo_init_class (void)
"http://www.secondlife.com/");
#undef PACKAGE
ll_gst_plugin_register_static (&gst_plugin_desc);
- DEBUGMSG(stderr, "\n\n\nCLASS INIT\n\n\n");
+ DEBUGMSG("\n\n\nCLASS INIT\n\n\n");
}
#endif // LL_GSTREAMER010_ENABLED
diff --git a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
index d21ff26f83..8e850ed7ff 100644
--- a/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
+++ b/indra/media_plugins/gstreamer010/media_plugin_gstreamer010.cpp
@@ -115,13 +115,16 @@ private:
int mDepth;
- // media natural size
+ // media NATURAL size
int mNaturalWidth;
int mNaturalHeight;
- int mNaturalRowbytes;
- // previous media natural size so we can detect changes
- int mPreviousNaturalWidth;
- int mPreviousNaturalHeight;
+ // media current size
+ int mCurrentWidth;
+ int mCurrentHeight;
+ int mCurrentRowbytes;
+ // previous media size so we can detect changes
+ int mPreviousWidth;
+ int mPreviousHeight;
// desired render size from host
int mWidth;
int mHeight;
@@ -149,7 +152,7 @@ MediaPluginGStreamer010::MediaPluginGStreamer010(
void *host_user_data ) :
MediaPluginBase(host_send_func, host_user_data),
mBusWatchID ( 0 ),
- mNaturalRowbytes ( 4 ),
+ mCurrentRowbytes ( 4 ),
mTextureFormatPrimary ( GL_RGBA ),
mTextureFormatType ( GL_UNSIGNED_INT_8_8_8_8_REV ),
mSeekWanted(false),
@@ -195,6 +198,7 @@ MediaPluginGStreamer010::processGSTEvents(GstBus *bus,
}
else
{
+ // TODO: grok 'duration' message type
DEBUGMSG("Got GST message type: %s",
LLGST_MESSAGE_TYPE_NAME (message));
}
@@ -429,8 +433,8 @@ MediaPluginGStreamer010::update(int milliseconds)
{
DEBUGMSG("NEW FRAME READY");
- if (mVideoSink->retained_frame_width != mNaturalWidth ||
- mVideoSink->retained_frame_height != mNaturalHeight)
+ if (mVideoSink->retained_frame_width != mCurrentWidth ||
+ mVideoSink->retained_frame_height != mCurrentHeight)
// *TODO: also check for change in format
{
// just resize container, don't consume frame
@@ -457,39 +461,39 @@ MediaPluginGStreamer010::update(int milliseconds)
GST_OBJECT_UNLOCK(mVideoSink);
- mNaturalRowbytes = neww * newd;
+ mCurrentRowbytes = neww * newd;
DEBUGMSG("video container resized to %dx%d",
neww, newh);
mDepth = newd;
- mNaturalWidth = neww;
- mNaturalHeight = newh;
+ mCurrentWidth = neww;
+ mCurrentHeight = newh;
sizeChanged();
return true;
}
if (mPixels &&
- mNaturalHeight <= mHeight &&
- mNaturalWidth <= mWidth &&
+ mCurrentHeight <= mHeight &&
+ mCurrentWidth <= mWidth &&
!mTextureSegmentName.empty())
{
// we're gonna totally consume this frame - reset 'ready' flag
mVideoSink->retained_frame_ready = FALSE;
int destination_rowbytes = mWidth * mDepth;
- for (int row=0; row<mNaturalHeight; ++row)
+ for (int row=0; row<mCurrentHeight; ++row)
{
memcpy(&mPixels
[destination_rowbytes * row],
&mVideoSink->retained_frame_data
- [mNaturalRowbytes * row],
- mNaturalRowbytes);
+ [mCurrentRowbytes * row],
+ mCurrentRowbytes);
}
GST_OBJECT_UNLOCK(mVideoSink);
DEBUGMSG("NEW FRAME REALLY TRULY CONSUMED, TELLING HOST");
- setDirty(0,0,mNaturalWidth,mNaturalHeight);
+ setDirty(0,0,mCurrentWidth,mCurrentHeight);
}
else
{
@@ -841,12 +845,21 @@ MediaPluginGStreamer010::sizeChanged()
{
// the shared writing space has possibly changed size/location/whatever
- // Check to see whether the movie's natural size has updated
- if (mNaturalWidth != mPreviousNaturalWidth ||
- mNaturalHeight != mPreviousNaturalHeight)
+ // Check to see whether the movie's NATURAL size has been set yet
+ if (1 == mNaturalWidth &&
+ 1 == mNaturalHeight)
{
- mPreviousNaturalWidth = mNaturalWidth;
- mPreviousNaturalHeight = mNaturalHeight;
+ mNaturalWidth = mCurrentWidth;
+ mNaturalHeight = mCurrentHeight;
+ DEBUGMSG("Media NATURAL size better detected as %dx%d",
+ mNaturalWidth, mNaturalHeight);
+ }
+
+ if (mCurrentWidth != mPreviousWidth ||
+ mCurrentHeight != mPreviousHeight) // if the size has changed then the shm has changed and the app needs telling
+ {
+ mPreviousWidth = mCurrentWidth;
+ mPreviousHeight = mCurrentHeight;
LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_request");
message.setValue("name", mTextureSegmentName);
@@ -941,10 +954,12 @@ void MediaPluginGStreamer010::receiveMessage(const char *message_string)
// lame to have to decide this now, it depends on the movie. Oh well.
mDepth = 4;
+ mCurrentWidth = 1;
+ mCurrentHeight = 1;
+ mPreviousWidth = 1;
+ mPreviousHeight = 1;
mNaturalWidth = 1;
mNaturalHeight = 1;
- mPreviousNaturalWidth = 1;
- mPreviousNaturalHeight = 1;
mWidth = 1;
mHeight = 1;
mTextureWidth = 1;
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index fa3d0d1db9..f3d399c616 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -200,6 +200,7 @@ set(viewer_SOURCE_FILES
llfloaterregioninfo.cpp
llfloaterreporter.cpp
llfloaterscriptdebug.cpp
+ llfloaterscriptlimits.cpp
llfloatersearch.cpp
llfloatersellland.cpp
llfloatersettingsdebug.cpp
@@ -696,7 +697,7 @@ set(viewer_HEADER_FILES
llfloatermediasettings.h
llfloatermemleak.h
llfloaternamedesc.h
- llfloaternearbymedia.h
+ llfloaternearbymedia.h
llfloaternotificationsconsole.h
llfloateropenobject.h
llfloaterparcel.h
@@ -709,6 +710,7 @@ set(viewer_HEADER_FILES
llfloaterregioninfo.h
llfloaterreporter.h
llfloaterscriptdebug.h
+ llfloaterscriptlimits.h
llfloatersearch.h
llfloatersellland.h
llfloatersettingsdebug.h
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 81322abbf7..02884575b0 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -52,6 +52,7 @@
#include "llfloateravatarpicker.h"
#include "llfloaterauction.h"
#include "llfloatergroups.h"
+#include "llfloaterscriptlimits.h"
#include "llavataractions.h"
#include "lllineeditor.h"
#include "llnamelistctrl.h"
@@ -148,6 +149,10 @@ void send_parcel_select_objects(S32 parcel_local_id, U32 return_type,
msg->sendReliable(region->getHost());
}
+LLParcel* LLFloaterLand::getCurrentSelectedParcel()
+{
+ return mParcel->getParcel();
+};
//static
LLPanelLandObjects* LLFloaterLand::getCurrentPanelLandObjects()
@@ -421,6 +426,9 @@ BOOL LLPanelLandGeneral::postBuild()
mBtnBuyLand = getChild<LLButton>("Buy Land...");
mBtnBuyLand->setClickedCallback(onClickBuyLand, (void*)&BUY_PERSONAL_LAND);
+ mBtnScriptLimits = getChild<LLButton>("Scripts...");
+ mBtnScriptLimits->setClickedCallback(onClickScriptLimits, this);
+
mBtnBuyGroupLand = getChild<LLButton>("Buy For Group...");
mBtnBuyGroupLand->setClickedCallback(onClickBuyLand, (void*)&BUY_GROUP_LAND);
@@ -508,6 +516,7 @@ void LLPanelLandGeneral::refresh()
mTextDwell->setText(LLStringUtil::null);
mBtnBuyLand->setEnabled(FALSE);
+ mBtnScriptLimits->setEnabled(FALSE);
mBtnBuyGroupLand->setEnabled(FALSE);
mBtnReleaseLand->setEnabled(FALSE);
mBtnReclaimLand->setEnabled(FALSE);
@@ -715,6 +724,8 @@ void LLPanelLandGeneral::refresh()
mBtnBuyLand->setEnabled(
LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false));
+ mBtnScriptLimits->setEnabled(true);
+// LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, false));
mBtnBuyGroupLand->setEnabled(
LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, true));
@@ -854,6 +865,17 @@ void LLPanelLandGeneral::onClickBuyLand(void* data)
LLViewerParcelMgr::getInstance()->startBuyLand(*for_group);
}
+// static
+void LLPanelLandGeneral::onClickScriptLimits(void* data)
+{
+ LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
+ LLParcel* parcel = panelp->mParcel->getParcel();
+ if(parcel != NULL)
+ {
+ LLFloaterReg::showInstance("script_limits");
+ }
+}
+
BOOL LLPanelLandGeneral::enableDeedToGroup(void* data)
{
LLPanelLandGeneral* panelp = (LLPanelLandGeneral*)data;
diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h
index f7fb978c2a..eb47fbe15b 100644
--- a/indra/newview/llfloaterland.h
+++ b/indra/newview/llfloaterland.h
@@ -70,6 +70,7 @@ class LLPanelLandAccess;
class LLPanelLandBan;
class LLPanelLandRenters;
class LLPanelLandCovenant;
+class LLParcel;
class LLFloaterLand
: public LLFloater
@@ -80,7 +81,9 @@ public:
static LLPanelLandObjects* getCurrentPanelLandObjects();
static LLPanelLandCovenant* getCurrentPanelLandCovenant();
-
+
+ LLParcel* getCurrentSelectedParcel();
+
virtual void onOpen(const LLSD& key);
virtual BOOL postBuild();
@@ -146,6 +149,7 @@ public:
static BOOL enableDeedToGroup(void*);
static void onClickDeed(void*);
static void onClickBuyLand(void* data);
+ static void onClickScriptLimits(void* data);
static void onClickRelease(void*);
static void onClickReclaim(void*);
static void onClickBuyPass(void* deselect_when_done);
@@ -215,6 +219,7 @@ protected:
LLTextBox* mTextDwell;
LLButton* mBtnBuyLand;
+ LLButton* mBtnScriptLimits;
LLButton* mBtnBuyGroupLand;
// these buttons share the same location, but
diff --git a/indra/newview/llfloaterscriptlimits.cpp b/indra/newview/llfloaterscriptlimits.cpp
new file mode 100644
index 0000000000..3042fbc6ec
--- /dev/null
+++ b/indra/newview/llfloaterscriptlimits.cpp
@@ -0,0 +1,1061 @@
+/**
+ * @file llfloaterscriptlimits.cpp
+ * @author Gabriel Lee
+ * @brief Implementation of the region info and controls floater and panels.
+ *
+ * $LicenseInfo:firstyear=2004&license=viewergpl$
+ *
+ * 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.
+ * $/LicenseInfo$
+ */
+
+#include "llviewerprecompiledheaders.h"
+#include "llfloaterscriptlimits.h"
+
+#include "llsdutil.h"
+#include "llsdutil_math.h"
+#include "message.h"
+
+#include "llagent.h"
+#include "llfloateravatarpicker.h"
+#include "llfloaterland.h"
+#include "llfloaterreg.h"
+#include "llregionhandle.h"
+#include "llscrolllistctrl.h"
+#include "llscrolllistitem.h"
+#include "llparcel.h"
+#include "lltabcontainer.h"
+#include "lltracker.h"
+#include "lltrans.h"
+#include "llviewercontrol.h"
+#include "lluictrlfactory.h"
+#include "llviewerparcelmgr.h"
+#include "llviewerregion.h"
+#include "llviewerwindow.h"
+
+///----------------------------------------------------------------------------
+/// LLFloaterScriptLimits
+///----------------------------------------------------------------------------
+
+// due to server side bugs the full summary display is not possible
+// until they are fixed this define creates a simple version of the
+// summary which only shows available & correct information
+#define USE_SIMPLE_SUMMARY
+
+LLFloaterScriptLimits::LLFloaterScriptLimits(const LLSD& seed)
+ : LLFloater(seed)
+{
+}
+
+BOOL LLFloaterScriptLimits::postBuild()
+{
+ // a little cheap and cheerful - if there's an about land panel open default to showing parcel info,
+ // otherwise default to showing attachments (avatar appearance)
+ bool selectParcelPanel = false;
+
+ LLFloaterLand* instance = LLFloaterReg::getTypedInstance<LLFloaterLand>("about_land");
+ if(instance)
+ {
+ if(instance->isShown())
+ {
+ selectParcelPanel = true;
+ }
+ }
+
+ mTab = getChild<LLTabContainer>("scriptlimits_panels");
+
+ // contruct the panels
+ LLPanelScriptLimitsRegionMemory* panel_memory;
+ panel_memory = new LLPanelScriptLimitsRegionMemory;
+ mInfoPanels.push_back(panel_memory);
+
+ LLUICtrlFactory::getInstance()->buildPanel(panel_memory, "panel_script_limits_region_memory.xml");
+ mTab->addTabPanel(panel_memory);
+
+ LLPanelScriptLimitsRegionURLs* panel_urls = new LLPanelScriptLimitsRegionURLs;
+ mInfoPanels.push_back(panel_urls);
+ LLUICtrlFactory::getInstance()->buildPanel(panel_urls, "panel_script_limits_region_urls.xml");
+ mTab->addTabPanel(panel_urls);
+
+ LLPanelScriptLimitsAttachment* panel_attachments = new LLPanelScriptLimitsAttachment;
+ mInfoPanels.push_back(panel_attachments);
+ LLUICtrlFactory::getInstance()->buildPanel(panel_attachments, "panel_script_limits_my_avatar.xml");
+ mTab->addTabPanel(panel_attachments);
+
+ if(selectParcelPanel)
+ {
+ mTab->selectTab(0);
+ }
+ else
+ {
+ mTab->selectTab(2);
+ }
+
+ return TRUE;
+}
+
+LLFloaterScriptLimits::~LLFloaterScriptLimits()
+{
+}
+
+// public
+void LLFloaterScriptLimits::refresh()
+{
+ for(info_panels_t::iterator iter = mInfoPanels.begin();
+ iter != mInfoPanels.end(); ++iter)
+ {
+ (*iter)->refresh();
+ }
+}
+
+
+///----------------------------------------------------------------------------
+// Base class for panels
+///----------------------------------------------------------------------------
+
+LLPanelScriptLimitsInfo::LLPanelScriptLimitsInfo()
+ : LLPanel()
+{
+}
+
+
+// virtual
+BOOL LLPanelScriptLimitsInfo::postBuild()
+{
+ refresh();
+ return TRUE;
+}
+
+// virtual
+void LLPanelScriptLimitsInfo::updateChild(LLUICtrl* child_ctr)
+{
+}
+
+///----------------------------------------------------------------------------
+// Responders
+///----------------------------------------------------------------------------
+
+void fetchScriptLimitsRegionInfoResponder::result(const LLSD& content)
+{
+ // at this point we have an llsd which should contain ether one or two urls to the services we want.
+ // first we look for the details service:
+ if(content.has("ScriptResourceDetails"))
+ {
+ LLHTTPClient::get(content["ScriptResourceDetails"], new fetchScriptLimitsRegionDetailsResponder(mInfo));
+ }
+ else
+ {
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(!instance)
+ {
+ llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ }
+ else
+ {
+
+// temp - only show info if we get details - there's nothing to show if not until the sim gets fixed
+#ifdef USE_SIMPLE_SUMMARY
+
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ std::string msg = LLTrans::getString("ScriptLimitsRequestDontOwnParcel");
+ panel_memory->childSetValue("loading_text", LLSD(msg));
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+ panel_urls->childSetValue("loading_text", LLSD(msg));
+
+ // intentional early out as we dont want the resource summary if we are using the "simple summary"
+ // and the details are missing
+ return;
+#endif
+ }
+ }
+
+ // then the summary service:
+ if(content.has("ScriptResourceSummary"))
+ {
+ LLHTTPClient::get(content["ScriptResourceSummary"], new fetchScriptLimitsRegionSummaryResponder(mInfo));
+ }
+}
+
+void fetchScriptLimitsRegionInfoResponder::error(U32 status, const std::string& reason)
+{
+ llinfos << "Error from responder " << reason << llendl;
+}
+
+void fetchScriptLimitsRegionSummaryResponder::result(const LLSD& content)
+{
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(!instance)
+ {
+ llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ }
+ else
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ panel_memory->setRegionSummary(content);
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+ panel_urls->setRegionSummary(content);
+ }
+}
+
+void fetchScriptLimitsRegionSummaryResponder::error(U32 status, const std::string& reason)
+{
+ llinfos << "Error from responder " << reason << llendl;
+}
+
+void fetchScriptLimitsRegionDetailsResponder::result(const LLSD& content)
+{
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+
+ if(!instance)
+ {
+ llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ }
+ else
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ panel_memory->setRegionDetails(content);
+
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+ panel_urls->setRegionDetails(content);
+ }
+}
+
+void fetchScriptLimitsRegionDetailsResponder::error(U32 status, const std::string& reason)
+{
+ llinfos << "Error from responder " << reason << llendl;
+}
+
+void fetchScriptLimitsAttachmentInfoResponder::result(const LLSD& content)
+{
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+
+ if(!instance)
+ {
+ llinfos << "Failed to get llfloaterscriptlimits instance" << llendl;
+ }
+ else
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsAttachment* panel = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
+ panel->setAttachmentDetails(content);
+ }
+}
+
+void fetchScriptLimitsAttachmentInfoResponder::error(U32 status, const std::string& reason)
+{
+ llinfos << "Error from responder " << reason << llendl;
+}
+
+///----------------------------------------------------------------------------
+// Memory Panel
+///----------------------------------------------------------------------------
+
+BOOL LLPanelScriptLimitsRegionMemory::getLandScriptResources()
+{
+ LLSD body;
+ std::string url = gAgent.getRegion()->getCapability("LandResources");
+ if (!url.empty())
+ {
+ body["parcel_id"] = mParcelId;
+
+ LLSD info;
+ info["parcel_id"] = mParcelId;
+ LLHTTPClient::post(url, body, new fetchScriptLimitsRegionInfoResponder(info));
+
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+void LLPanelScriptLimitsRegionMemory::processParcelInfo(const LLParcelData& parcel_data)
+{
+ mParcelId = parcel_data.parcel_id;
+
+ if(!getLandScriptResources())
+ {
+ std::string msg_error = LLTrans::getString("ScriptLimitsRequestError");
+ childSetValue("loading_text", LLSD(msg_error));
+ }
+ else
+ {
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting");
+ childSetValue("loading_text", LLSD(msg_waiting));
+ }
+}
+
+void LLPanelScriptLimitsRegionMemory::setParcelID(const LLUUID& parcel_id)
+{
+ if (!parcel_id.isNull())
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->addObserver(parcel_id, this);
+ LLRemoteParcelInfoProcessor::getInstance()->sendParcelInfoRequest(parcel_id);
+ }
+ else
+ {
+ std::string msg_error = LLTrans::getString("ScriptLimitsRequestError");
+ childSetValue("loading_text", LLSD(msg_error));
+ }
+}
+
+// virtual
+void LLPanelScriptLimitsRegionMemory::setErrorStatus(U32 status, const std::string& reason)
+{
+ llerrs << "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<<llendl;
+}
+
+void LLPanelScriptLimitsRegionMemory::setRegionDetails(LLSD content)
+{
+ LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list");
+
+ S32 number_parcels = content["parcels"].size();
+
+ LLStringUtil::format_map_t args_parcels;
+ args_parcels["[PARCELS]"] = llformat ("%d", number_parcels);
+ std::string msg_parcels = LLTrans::getString("ScriptLimitsParcelsOwned", args_parcels);
+ childSetValue("parcels_listed", LLSD(msg_parcels));
+
+ S32 total_objects = 0;
+ S32 total_size = 0;
+
+ for(S32 i = 0; i < number_parcels; i++)
+ {
+ std::string parcel_name = content["parcels"][i]["name"].asString();
+
+ S32 number_objects = content["parcels"][i]["objects"].size();
+ for(S32 j = 0; j < number_objects; j++)
+ {
+ S32 size = content["parcels"][i]["objects"][j]["resources"]["memory"].asInteger() / 1024;
+ total_size += size;
+
+ std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString();
+ LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID();
+
+ LLSD element;
+
+ element["id"] = task_id;
+ element["columns"][0]["column"] = "size";
+ element["columns"][0]["value"] = llformat("%d", size);
+ element["columns"][0]["font"] = "SANSSERIF";
+ element["columns"][1]["column"] = "name";
+ element["columns"][1]["value"] = name_buf;
+ element["columns"][1]["font"] = "SANSSERIF";
+ element["columns"][2]["column"] = "owner";
+ element["columns"][2]["value"] = "";
+ element["columns"][2]["font"] = "SANSSERIF";
+ element["columns"][3]["column"] = "location";
+ element["columns"][3]["value"] = parcel_name;
+ element["columns"][3]["font"] = "SANSSERIF";
+
+ list->addElement(element);
+ mObjectListIDs.push_back(task_id);
+ total_objects++;
+ }
+ }
+
+ mParcelMemoryUsed =total_size;
+ mGotParcelMemoryUsed = TRUE;
+ populateParcelMemoryText();
+}
+
+void LLPanelScriptLimitsRegionMemory::populateParcelMemoryText()
+{
+ if(mGotParcelMemoryUsed && mGotParcelMemoryMax)
+ {
+#ifdef USE_SIMPLE_SUMMARY
+ LLStringUtil::format_map_t args_parcel_memory;
+ args_parcel_memory["[COUNT]"] = llformat ("%d", mParcelMemoryUsed);
+ std::string msg_parcel_memory = LLTrans::getString("ScriptLimitsMemoryUsedSimple", args_parcel_memory);
+ childSetValue("memory_used", LLSD(msg_parcel_memory));
+#else
+ S32 parcel_memory_available = mParcelMemoryMax - mParcelMemoryUsed;
+
+ LLStringUtil::format_map_t args_parcel_memory;
+ args_parcel_memory["[COUNT]"] = llformat ("%d", mParcelMemoryUsed);
+ args_parcel_memory["[MAX]"] = llformat ("%d", mParcelMemoryMax);
+ args_parcel_memory["[AVAILABLE]"] = llformat ("%d", parcel_memory_available);
+ std::string msg_parcel_memory = LLTrans::getString("ScriptLimitsMemoryUsed", args_parcel_memory);
+ childSetValue("memory_used", LLSD(msg_parcel_memory));
+#endif
+
+ childSetValue("loading_text", LLSD(std::string("")));
+ }
+}
+
+void LLPanelScriptLimitsRegionMemory::setRegionSummary(LLSD content)
+{
+ if(content["summary"]["available"][0]["type"].asString() == std::string("memory"))
+ {
+ mParcelMemoryMax = content["summary"]["available"][0]["amount"].asInteger();
+ mGotParcelMemoryMax = TRUE;
+ }
+ else if(content["summary"]["available"][1]["type"].asString() == std::string("memory"))
+ {
+ mParcelMemoryMax = content["summary"]["available"][1]["amount"].asInteger();
+ mGotParcelMemoryMax = TRUE;
+ }
+ else
+ {
+ llinfos << "summary doesn't contain memory info" << llendl;
+ return;
+ }
+/*
+ currently this is broken on the server, so we get this value from the details section
+ and update via populateParcelMemoryText() when both sets of information have been returned
+
+ when the sim is fixed this should be used instead:
+ if(content["summary"]["used"][0]["type"].asString() == std::string("memory"))
+ {
+ mParcelMemoryUsed = content["summary"]["used"][0]["amount"].asInteger();
+ mGotParcelMemoryUsed = TRUE;
+ }
+ else if(content["summary"]["used"][1]["type"].asString() == std::string("memory"))
+ {
+ mParcelMemoryUsed = content["summary"]["used"][1]["amount"].asInteger();
+ mGotParcelMemoryUsed = TRUE;
+ }
+ else
+ {
+ //ERROR!!!
+ return;
+ }*/
+
+ populateParcelMemoryText();
+}
+
+BOOL LLPanelScriptLimitsRegionMemory::postBuild()
+{
+ childSetAction("refresh_list_btn", onClickRefresh, this);
+ childSetAction("highlight_btn", onClickHighlight, this);
+ childSetAction("return_btn", onClickReturn, this);
+
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting");
+ childSetValue("loading_text", LLSD(msg_waiting));
+
+ return StartRequestChain();
+}
+
+BOOL LLPanelScriptLimitsRegionMemory::StartRequestChain()
+{
+ LLUUID region_id;
+
+ LLFloaterLand* instance = LLFloaterReg::getTypedInstance<LLFloaterLand>("about_land");
+ if(!instance)
+ {
+ //this isnt really an error...
+// llinfos << "Failed to get about land instance" << llendl;
+// std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+ childSetValue("loading_text", LLSD(std::string("")));
+ //might have to do parent post build here
+ //if not logic below could use early outs
+ return FALSE;
+ }
+
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+
+ LLParcel* parcel = instance->getCurrentSelectedParcel();
+ LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion();
+
+ LLUUID current_region_id = gAgent.getRegion()->getRegionID();
+
+ if ((region) && (parcel))
+ {
+ LLVector3 parcel_center = parcel->getCenterpoint();
+
+ region_id = region->getRegionID();
+
+ if(region_id != current_region_id)
+ {
+ std::string msg_wrong_region = LLTrans::getString("ScriptLimitsRequestWrongRegion");
+ childSetValue("loading_text", LLSD(msg_wrong_region));
+ panel_urls->childSetValue("loading_text", LLSD(msg_wrong_region));
+ return FALSE;
+ }
+
+ LLVector3d pos_global = region->getCenterGlobal();
+
+ LLSD body;
+ std::string url = region->getCapability("RemoteParcelRequest");
+ if (!url.empty())
+ {
+ body["location"] = ll_sd_from_vector3(parcel_center);
+ if (!region_id.isNull())
+ {
+ body["region_id"] = region_id;
+ }
+ if (!pos_global.isExactlyZero())
+ {
+ U64 region_handle = to_region_handle(pos_global);
+ body["region_handle"] = ll_sd_from_U64(region_handle);
+ }
+ LLHTTPClient::post(url, body, new LLRemoteParcelRequestResponder(getObserverHandle()));
+ }
+ else
+ {
+ llwarns << "Can't get parcel info for script information request" << region_id
+ << ". Region: " << region->getName()
+ << " does not support RemoteParcelRequest" << llendl;
+
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+ childSetValue("loading_text", LLSD(msg_waiting));
+ panel_urls->childSetValue("loading_text", LLSD(msg_waiting));
+ }
+ }
+ else
+ {
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+ childSetValue("loading_text", LLSD(msg_waiting));
+ panel_urls->childSetValue("loading_text", LLSD(msg_waiting));
+ }
+
+ return LLPanelScriptLimitsInfo::postBuild();
+}
+
+void LLPanelScriptLimitsRegionMemory::clearList()
+{
+ LLCtrlListInterface *list = childGetListInterface("scripts_list");
+
+ if (list)
+ {
+ list->operateOnAll(LLCtrlListInterface::OP_DELETE);
+ }
+
+ mGotParcelMemoryUsed = FALSE;
+ mGotParcelMemoryMax = FALSE;
+
+ LLStringUtil::format_map_t args_parcel_memory;
+ std::string msg_empty_string("");
+ childSetValue("memory_used", LLSD(msg_empty_string));
+ childSetValue("parcels_listed", LLSD(msg_empty_string));
+
+ mObjectListIDs.clear();
+}
+
+// static
+void LLPanelScriptLimitsRegionMemory::onClickRefresh(void* userdata)
+{
+ llinfos << "LLPanelRegionGeneralInfo::onClickRefresh" << llendl;
+
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ panel_memory->clearList();
+
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+ panel_urls->clearList();
+
+ panel_memory->StartRequestChain();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ return;
+ }
+}
+
+void LLPanelScriptLimitsRegionMemory::showBeacon()
+{
+/* LLScrollListCtrl* list = getChild<LLScrollListCtrl>("scripts_list");
+ if (!list) return;
+
+ LLScrollListItem* first_selected = list->getFirstSelected();
+ if (!first_selected) return;
+
+ std::string name = first_selected->getColumn(1)->getValue().asString();
+ std::string pos_string = first_selected->getColumn(3)->getValue().asString();
+
+ llinfos << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" <<llendl;
+ llinfos << "name = " << name << " pos = " << pos_string << llendl;
+
+ F32 x, y, z;
+ S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z);
+ if (matched != 3) return;
+
+ LLVector3 pos_agent(x, y, z);
+ LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent);
+ llinfos << "name = " << name << " pos = " << pos_string << llendl;
+ std::string tooltip("");
+ LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM);*/
+}
+
+// static
+void LLPanelScriptLimitsRegionMemory::onClickHighlight(void* userdata)
+{
+/* llinfos << "LLPanelRegionGeneralInfo::onClickHighlight" << llendl;
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ panel->showBeacon();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+// std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+// panel->childSetValue("loading_text", LLSD(msg_waiting));
+ return;
+ }*/
+}
+
+void LLPanelScriptLimitsRegionMemory::returnObjects()
+{
+/* llinfos << "started" << llendl;
+ LLMessageSystem *msg = gMessageSystem;
+
+ LLViewerRegion* region = gAgent.getRegion();
+ if (!region) return;
+
+ llinfos << "got region" << llendl;
+ LLCtrlListInterface *list = childGetListInterface("scripts_list");
+ if (!list || list->getItemCount() == 0) return;
+
+ llinfos << "got list" << llendl;
+ std::vector<LLUUID>::iterator id_itor;
+
+ bool start_message = true;
+
+ for (id_itor = mObjectListIDs.begin(); id_itor != mObjectListIDs.end(); ++id_itor)
+ {
+ LLUUID task_id = *id_itor;
+ llinfos << task_id << llendl;
+ if (!list->isSelected(task_id))
+ {
+ llinfos << "not selected" << llendl;
+ // Selected only
+ continue;
+ }
+ llinfos << "selected" << llendl;
+ if (start_message)
+ {
+ msg->newMessageFast(_PREHASH_ParcelReturnObjects);
+ msg->nextBlockFast(_PREHASH_AgentData);
+ msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
+ msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID());
+ msg->nextBlockFast(_PREHASH_ParcelData);
+ msg->addS32Fast(_PREHASH_LocalID, -1); // Whole region
+ msg->addS32Fast(_PREHASH_ReturnType, RT_LIST);
+ start_message = false;
+ llinfos << "start message" << llendl;
+ }
+
+ msg->nextBlockFast(_PREHASH_TaskIDs);
+ msg->addUUIDFast(_PREHASH_TaskID, task_id);
+ llinfos << "added id" << llendl;
+
+ if (msg->isSendFullFast(_PREHASH_TaskIDs))
+ {
+ msg->sendReliable(region->getHost());
+ start_message = true;
+ llinfos << "sent 1" << llendl;
+ }
+ }
+
+ if (!start_message)
+ {
+ msg->sendReliable(region->getHost());
+ llinfos << "sent 2" << llendl;
+ }*/
+}
+
+// static
+void LLPanelScriptLimitsRegionMemory::onClickReturn(void* userdata)
+{
+/* llinfos << "LLPanelRegionGeneralInfo::onClickReturn" << llendl;
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ panel->returnObjects();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+// std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+// panel->childSetValue("loading_text", LLSD(msg_waiting));
+ return;
+ }*/
+}
+
+///----------------------------------------------------------------------------
+// URLs Panel
+///----------------------------------------------------------------------------
+
+void LLPanelScriptLimitsRegionURLs::setRegionDetails(LLSD content)
+{
+ LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list");
+
+ S32 number_parcels = content["parcels"].size();
+
+ LLStringUtil::format_map_t args_parcels;
+ args_parcels["[PARCELS]"] = llformat ("%d", number_parcels);
+ std::string msg_parcels = LLTrans::getString("ScriptLimitsParcelsOwned", args_parcels);
+ childSetValue("parcels_listed", LLSD(msg_parcels));
+
+ S32 total_objects = 0;
+ S32 total_size = 0;
+
+ for(S32 i = 0; i < number_parcels; i++)
+ {
+ std::string parcel_name = content["parcels"][i]["name"].asString();
+ llinfos << parcel_name << llendl;
+
+ S32 number_objects = content["parcels"][i]["objects"].size();
+ for(S32 j = 0; j < number_objects; j++)
+ {
+ if(content["parcels"][i]["objects"][j]["resources"].has("urls"))
+ {
+ S32 size = content["parcels"][i]["objects"][j]["resources"]["urls"].asInteger();
+ total_size += size;
+
+ std::string name_buf = content["parcels"][i]["objects"][j]["name"].asString();
+ LLUUID task_id = content["parcels"][i]["objects"][j]["id"].asUUID();
+
+ LLSD element;
+
+ element["id"] = task_id;
+ element["columns"][0]["column"] = "urls";
+ element["columns"][0]["value"] = llformat("%d", size);
+ element["columns"][0]["font"] = "SANSSERIF";
+ element["columns"][1]["column"] = "name";
+ element["columns"][1]["value"] = name_buf;
+ element["columns"][1]["font"] = "SANSSERIF";
+ element["columns"][2]["column"] = "owner";
+ element["columns"][2]["value"] = "";
+ element["columns"][2]["font"] = "SANSSERIF";
+ element["columns"][3]["column"] = "location";
+ element["columns"][3]["value"] = parcel_name;
+ element["columns"][3]["font"] = "SANSSERIF";
+
+ list->addElement(element);
+ mObjectListIDs.push_back(task_id);
+ total_objects++;
+ }
+ }
+ }
+
+ mParcelURLsUsed =total_size;
+ mGotParcelURLsUsed = TRUE;
+ populateParcelURLsText();
+}
+
+void LLPanelScriptLimitsRegionURLs::populateParcelURLsText()
+{
+ if(mGotParcelURLsUsed && mGotParcelURLsMax)
+ {
+
+#ifdef USE_SIMPLE_SUMMARY
+ LLStringUtil::format_map_t args_parcel_urls;
+ args_parcel_urls["[COUNT]"] = llformat ("%d", mParcelURLsUsed);
+ std::string msg_parcel_urls = LLTrans::getString("ScriptLimitsURLsUsedSimple", args_parcel_urls);
+ childSetValue("urls_used", LLSD(msg_parcel_urls));
+#else
+ S32 parcel_urls_available = mParcelURLsMax - mParcelURLsUsed;
+
+ LLStringUtil::format_map_t args_parcel_urls;
+ args_parcel_urls["[COUNT]"] = llformat ("%d", mParcelURLsUsed);
+ args_parcel_urls["[MAX]"] = llformat ("%d", mParcelURLsMax);
+ args_parcel_urls["[AVAILABLE]"] = llformat ("%d", parcel_urls_available);
+ std::string msg_parcel_urls = LLTrans::getString("ScriptLimitsURLsUsed", args_parcel_urls);
+ childSetValue("urls_used", LLSD(msg_parcel_urls));
+#endif
+
+ childSetValue("loading_text", LLSD(std::string("")));
+
+ }
+}
+
+void LLPanelScriptLimitsRegionURLs::setRegionSummary(LLSD content)
+{
+ if(content["summary"]["available"][0]["type"].asString() == std::string("urls"))
+ {
+ mParcelURLsMax = content["summary"]["available"][0]["amount"].asInteger();
+ mGotParcelURLsMax = TRUE;
+ }
+ else if(content["summary"]["available"][1]["type"].asString() == std::string("urls"))
+ {
+ mParcelURLsMax = content["summary"]["available"][1]["amount"].asInteger();
+ mGotParcelURLsMax = TRUE;
+ }
+ else
+ {
+ llinfos << "summary contains no url info" << llendl;
+ return;
+ }
+/*
+ currently this is broken on the server, so we get this value from the details section
+ and update via populateParcelMemoryText() when both sets of information have been returned
+
+ when the sim is fixed this should be used instead:
+ if(content["summary"]["used"][0]["type"].asString() == std::string("urls"))
+ {
+ mParcelURLsUsed = content["summary"]["used"][0]["amount"].asInteger();
+ mGotParcelURLsUsed = TRUE;
+ }
+ else if(content["summary"]["used"][1]["type"].asString() == std::string("urls"))
+ {
+ mParcelURLsUsed = content["summary"]["used"][1]["amount"].asInteger();
+ mGotParcelURLsUsed = TRUE;
+ }
+ else
+ {
+ //ERROR!!!
+ return;
+ }*/
+
+ populateParcelURLsText();
+}
+
+BOOL LLPanelScriptLimitsRegionURLs::postBuild()
+{
+ childSetAction("refresh_list_btn", onClickRefresh, this);
+ childSetAction("highlight_btn", onClickHighlight, this);
+ childSetAction("return_btn", onClickReturn, this);
+
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting");
+ childSetValue("loading_text", LLSD(msg_waiting));
+ return FALSE;
+}
+
+void LLPanelScriptLimitsRegionURLs::clearList()
+{
+ LLCtrlListInterface *list = childGetListInterface("scripts_list");
+
+ if (list)
+ {
+ list->operateOnAll(LLCtrlListInterface::OP_DELETE);
+ }
+
+ mGotParcelURLsUsed = FALSE;
+ mGotParcelURLsMax = FALSE;
+
+ LLStringUtil::format_map_t args_parcel_urls;
+ std::string msg_empty_string("");
+ childSetValue("urls_used", LLSD(msg_empty_string));
+ childSetValue("parcels_listed", LLSD(msg_empty_string));
+
+ mObjectListIDs.clear();
+}
+
+// static
+void LLPanelScriptLimitsRegionURLs::onClickRefresh(void* userdata)
+{
+ llinfos << "Refresh clicked" << llendl;
+
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel_memory = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ // use the memory panel to re-request all the info
+ panel_memory->clearList();
+
+ LLPanelScriptLimitsRegionURLs* panel_urls = (LLPanelScriptLimitsRegionURLs*)tab->getChild<LLPanel>("script_limits_region_urls_panel");
+ // but the urls panel to clear itself
+ panel_urls->clearList();
+
+ panel_memory->StartRequestChain();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ return;
+ }
+}
+
+// static
+void LLPanelScriptLimitsRegionURLs::onClickHighlight(void* userdata)
+{
+/* llinfos << "Highlight clicked" << llendl;
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ // use the beacon function from the memory panel
+ panel->showBeacon();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+// std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+// panel->childSetValue("loading_text", LLSD(msg_waiting));
+ return;
+ }*/
+}
+
+// static
+void LLPanelScriptLimitsRegionURLs::onClickReturn(void* userdata)
+{
+/* llinfos << "Return clicked" << llendl;
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsRegionMemory* panel = (LLPanelScriptLimitsRegionMemory*)tab->getChild<LLPanel>("script_limits_region_memory_panel");
+ // use the return function from the memory panel
+ panel->returnObjects();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after highlight button clicked" << llendl;
+// std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestError");
+// panel->childSetValue("loading_text", LLSD(msg_waiting));
+ return;
+ }*/
+}
+
+///----------------------------------------------------------------------------
+// Attachment Panel
+///----------------------------------------------------------------------------
+
+BOOL LLPanelScriptLimitsAttachment::requestAttachmentDetails()
+{
+ LLSD body;
+ std::string url = gAgent.getRegion()->getCapability("AttachmentResources");
+ if (!url.empty())
+ {
+ LLHTTPClient::get(url, body, new fetchScriptLimitsAttachmentInfoResponder());
+ return TRUE;
+ }
+ else
+ {
+ return FALSE;
+ }
+}
+
+void LLPanelScriptLimitsAttachment::setAttachmentDetails(LLSD content)
+{
+ LLScrollListCtrl *list = getChild<LLScrollListCtrl>("scripts_list");
+ S32 number_attachments = content["attachments"].size();
+
+ for(int i = 0; i < number_attachments; i++)
+ {
+ std::string humanReadableLocation = "";
+ if(content["attachments"][i].has("location"))
+ {
+ std::string actualLocation = content["attachments"][i]["location"];
+ humanReadableLocation = LLTrans::getString(actualLocation.c_str());
+ }
+
+ S32 number_objects = content["attachments"][i]["objects"].size();
+ for(int j = 0; j < number_objects; j++)
+ {
+ LLUUID task_id = content["attachments"][i]["objects"][j]["id"].asUUID();
+ S32 size = 0;
+ if(content["attachments"][i]["objects"][j]["resources"].has("memory"))
+ {
+ size = content["attachments"][i]["objects"][j]["resources"]["memory"].asInteger();
+ }
+ S32 urls = 0;
+ if(content["attachments"][i]["objects"][j]["resources"].has("urls"))
+ {
+ urls = content["attachments"][i]["objects"][j]["resources"]["urls"].asInteger();
+ }
+ std::string name = content["attachments"][i]["objects"][j]["name"].asString();
+
+ LLSD element;
+
+ element["id"] = task_id;
+ element["columns"][0]["column"] = "size";
+ element["columns"][0]["value"] = llformat("%d", size);
+ element["columns"][0]["font"] = "SANSSERIF";
+
+ element["columns"][1]["column"] = "urls";
+ element["columns"][1]["value"] = llformat("%d", urls);
+ element["columns"][1]["font"] = "SANSSERIF";
+
+ element["columns"][2]["column"] = "name";
+ element["columns"][2]["value"] = name;
+ element["columns"][2]["font"] = "SANSSERIF";
+
+ element["columns"][3]["column"] = "location";
+ element["columns"][3]["value"] = humanReadableLocation;
+ element["columns"][3]["font"] = "SANSSERIF";
+
+ list->addElement(element);
+ }
+ }
+
+ childSetValue("loading_text", LLSD(std::string("")));
+}
+
+BOOL LLPanelScriptLimitsAttachment::postBuild()
+{
+ childSetAction("refresh_list_btn", onClickRefresh, this);
+
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting");
+ childSetValue("loading_text", LLSD(msg_waiting));
+ return requestAttachmentDetails();
+}
+
+void LLPanelScriptLimitsAttachment::clearList()
+{
+ LLCtrlListInterface *list = childGetListInterface("scripts_list");
+
+ if (list)
+ {
+ list->operateOnAll(LLCtrlListInterface::OP_DELETE);
+ }
+
+ std::string msg_waiting = LLTrans::getString("ScriptLimitsRequestWaiting");
+ childSetValue("loading_text", LLSD(msg_waiting));
+}
+
+// static
+void LLPanelScriptLimitsAttachment::onClickRefresh(void* userdata)
+{
+ llinfos << "Refresh clicked" << llendl;
+
+ LLFloaterScriptLimits* instance = LLFloaterReg::getTypedInstance<LLFloaterScriptLimits>("script_limits");
+ if(instance)
+ {
+ LLTabContainer* tab = instance->getChild<LLTabContainer>("scriptlimits_panels");
+ LLPanelScriptLimitsAttachment* panel_attachments = (LLPanelScriptLimitsAttachment*)tab->getChild<LLPanel>("script_limits_my_avatar_panel");
+ panel_attachments->clearList();
+ panel_attachments->requestAttachmentDetails();
+ return;
+ }
+ else
+ {
+ llwarns << "could not find LLPanelScriptLimitsRegionMemory instance after refresh button clicked" << llendl;
+ return;
+ }
+}
diff --git a/indra/newview/llfloaterscriptlimits.h b/indra/newview/llfloaterscriptlimits.h
new file mode 100644
index 0000000000..88239136e3
--- /dev/null
+++ b/indra/newview/llfloaterscriptlimits.h
@@ -0,0 +1,259 @@
+/**
+ * @file llfloaterscriptlimits.h
+ * @author Gabriel Lee
+ * @brief Declaration of the region info and controls floater and panels.
+ *
+ * $LicenseInfo:firstyear=2004&license=viewergpl$
+ *
+ * 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.
+ * $/LicenseInfo$
+ */
+
+#ifndef LL_LLFLOATERSCRIPTLIMITS_H
+#define LL_LLFLOATERSCRIPTLIMITS_H
+
+#include <vector>
+#include "llfloater.h"
+#include "llhost.h"
+#include "llpanel.h"
+#include "llremoteparcelrequest.h"
+
+class LLPanelScriptLimitsInfo;
+class LLTabContainer;
+
+class LLPanelScriptLimitsRegionMemory;
+
+class LLFloaterScriptLimits : public LLFloater
+{
+ friend class LLFloaterReg;
+public:
+
+ /*virtual*/ BOOL postBuild();
+
+ // from LLPanel
+ virtual void refresh();
+
+private:
+
+ LLFloaterScriptLimits(const LLSD& seed);
+ ~LLFloaterScriptLimits();
+
+protected:
+
+ LLTabContainer* mTab;
+ typedef std::vector<LLPanelScriptLimitsInfo*> info_panels_t;
+ info_panels_t mInfoPanels;
+};
+
+
+// Base class for all script limits information panels.
+class LLPanelScriptLimitsInfo : public LLPanel
+{
+public:
+ LLPanelScriptLimitsInfo();
+
+ virtual BOOL postBuild();
+ virtual void updateChild(LLUICtrl* child_ctrl);
+
+protected:
+ void initCtrl(const std::string& name);
+
+ typedef std::vector<std::string> strings_t;
+
+ LLHost mHost;
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// Responders
+/////////////////////////////////////////////////////////////////////////////
+
+class fetchScriptLimitsRegionInfoResponder: public LLHTTPClient::Responder
+{
+ public:
+ fetchScriptLimitsRegionInfoResponder(const LLSD& info) : mInfo(info) {};
+
+ void result(const LLSD& content);
+ void error(U32 status, const std::string& reason);
+ public:
+ protected:
+ LLSD mInfo;
+};
+
+class fetchScriptLimitsRegionSummaryResponder: public LLHTTPClient::Responder
+{
+ public:
+ fetchScriptLimitsRegionSummaryResponder(const LLSD& info) : mInfo(info) {};
+
+ void result(const LLSD& content);
+ void error(U32 status, const std::string& reason);
+ public:
+ protected:
+ LLSD mInfo;
+};
+
+class fetchScriptLimitsRegionDetailsResponder: public LLHTTPClient::Responder
+{
+ public:
+ fetchScriptLimitsRegionDetailsResponder(const LLSD& info) : mInfo(info) {};
+
+ void result(const LLSD& content);
+ void error(U32 status, const std::string& reason);
+ public:
+ protected:
+ LLSD mInfo;
+};
+
+class fetchScriptLimitsAttachmentInfoResponder: public LLHTTPClient::Responder
+{
+ public:
+ fetchScriptLimitsAttachmentInfoResponder() {};
+
+ void result(const LLSD& content);
+ void error(U32 status, const std::string& reason);
+ public:
+ protected:
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// Memory panel
+/////////////////////////////////////////////////////////////////////////////
+
+class LLPanelScriptLimitsRegionMemory : public LLPanelScriptLimitsInfo, LLRemoteParcelInfoObserver
+{
+
+public:
+ LLPanelScriptLimitsRegionMemory()
+ : LLPanelScriptLimitsInfo(), LLRemoteParcelInfoObserver(), mParcelId(LLUUID()), mGotParcelMemoryUsed(FALSE), mGotParcelMemoryMax(FALSE) {};
+ ~LLPanelScriptLimitsRegionMemory()
+ {
+ LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this);
+ };
+
+ // LLPanel
+ virtual BOOL postBuild();
+
+ void setRegionDetails(LLSD content);
+ void setRegionSummary(LLSD content);
+
+ BOOL StartRequestChain();
+
+ void populateParcelMemoryText();
+ BOOL getLandScriptResources();
+ void clearList();
+ void showBeacon();
+ void returnObjects();
+
+private:
+
+ LLUUID mParcelId;
+ BOOL mGotParcelMemoryUsed;
+ BOOL mGotParcelMemoryMax;
+ S32 mParcelMemoryMax;
+ S32 mParcelMemoryUsed;
+
+ std::vector<LLUUID> mObjectListIDs;
+
+protected:
+
+// LLRemoteParcelInfoObserver interface:
+/*virtual*/ void processParcelInfo(const LLParcelData& parcel_data);
+/*virtual*/ void setParcelID(const LLUUID& parcel_id);
+/*virtual*/ void setErrorStatus(U32 status, const std::string& reason);
+
+ static void onClickRefresh(void* userdata);
+ static void onClickHighlight(void* userdata);
+ static void onClickReturn(void* userdata);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// URLs panel
+/////////////////////////////////////////////////////////////////////////////
+
+class LLPanelScriptLimitsRegionURLs : public LLPanelScriptLimitsInfo
+{
+
+public:
+ LLPanelScriptLimitsRegionURLs()
+ : LLPanelScriptLimitsInfo(), mParcelId(LLUUID()), mGotParcelURLsUsed(FALSE), mGotParcelURLsMax(FALSE) {};
+ ~LLPanelScriptLimitsRegionURLs()
+ {
+ };
+
+ // LLPanel
+ virtual BOOL postBuild();
+
+ void setRegionDetails(LLSD content);
+ void setRegionSummary(LLSD content);
+
+ void populateParcelURLsText();
+ void clearList();
+
+private:
+
+ LLUUID mParcelId;
+ BOOL mGotParcelURLsUsed;
+ BOOL mGotParcelURLsMax;
+ S32 mParcelURLsMax;
+ S32 mParcelURLsUsed;
+
+ std::vector<LLUUID> mObjectListIDs;
+
+protected:
+
+ static void onClickRefresh(void* userdata);
+ static void onClickHighlight(void* userdata);
+ static void onClickReturn(void* userdata);
+};
+
+/////////////////////////////////////////////////////////////////////////////
+// Attachment panel
+/////////////////////////////////////////////////////////////////////////////
+
+class LLPanelScriptLimitsAttachment : public LLPanelScriptLimitsInfo
+{
+
+public:
+ LLPanelScriptLimitsAttachment()
+ : LLPanelScriptLimitsInfo() {};
+ ~LLPanelScriptLimitsAttachment()
+ {
+ };
+
+ // LLPanel
+ virtual BOOL postBuild();
+
+ void setAttachmentDetails(LLSD content);
+
+ BOOL requestAttachmentDetails();
+ void clearList();
+
+private:
+
+protected:
+
+ static void onClickRefresh(void* userdata);
+};
+
+#endif
diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp
index 86992d6a31..c930e99bad 100644
--- a/indra/newview/llfloatertopobjects.cpp
+++ b/indra/newview/llfloatertopobjects.cpp
@@ -162,7 +162,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data)
msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ReportType, mCurrentMode);
LLScrollListCtrl *list = getChild<LLScrollListCtrl>("objects_list");
-
+
S32 block_count = msg->getNumberOfBlocks("ReportData");
for (S32 block = 0; block < block_count; ++block)
{
@@ -432,7 +432,6 @@ void LLFloaterTopObjects::onRefresh()
filter = mFilter;
clearList();
-
LLMessageSystem *msg = gMessageSystem;
msg->newMessageFast(_PREHASH_LandStatRequest);
msg->nextBlockFast(_PREHASH_AgentData);
@@ -465,7 +464,7 @@ void LLFloaterTopObjects::onGetByOwnerName()
}
void LLFloaterTopObjects::showBeacon()
-{
+{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list");
if (!list) return;
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 6210151d1b..71dc0f9011 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -51,6 +51,8 @@
#include "llsidetray.h"
#include "llslurl.h"
#include "llurlsimstring.h"
+#include "llurlregistry.h"
+#include "llurldispatcher.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
#include "llviewerparcelmgr.h"
@@ -58,6 +60,7 @@
#include "llappviewer.h"
#include "llviewercontrol.h"
#include "llfloatermediabrowser.h"
+#include "llweb.h"
#include "llinventorymodel.h"
#include "lllandmarkactions.h"
@@ -543,7 +546,20 @@ void LLNavigationBar::onRegionNameResponse(
// Invalid location?
if (!region_handle)
{
- invokeSearch(typed_location);
+ // handle any secondlife:// SLapps, or
+ // display http:// URLs in the media browser, or
+ // anything else is sent to the search floater
+ if (LLUrlRegistry::instance().isUrl(typed_location))
+ {
+ if (! LLURLDispatcher::dispatchFromTextEditor(typed_location))
+ {
+ LLWeb::loadURL(typed_location);
+ }
+ }
+ else
+ {
+ invokeSearch(typed_location);
+ }
return;
}
diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp
index 4d22d96072..69fa110d11 100644
--- a/indra/newview/llpanelpicks.cpp
+++ b/indra/newview/llpanelpicks.cpp
@@ -485,6 +485,18 @@ void LLPanelPicks::onOpen(const LLSD& key)
LLPanelProfileTab::onOpen(key);
}
+void LLPanelPicks::onClosePanel()
+{
+ if (mPanelClassifiedInfo)
+ {
+ onPanelClassifiedClose(mPanelClassifiedInfo);
+ }
+ if (mPanelPickInfo)
+ {
+ onPanelPickClose(mPanelPickInfo);
+ }
+}
+
void LLPanelPicks::onListCommit(const LLFlatListView* f_list)
{
// Make sure only one of the lists has selection.
diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h
index fd8a9e6938..1b2e35ca46 100644
--- a/indra/newview/llpanelpicks.h
+++ b/indra/newview/llpanelpicks.h
@@ -74,6 +74,8 @@ public:
/*virtual*/ void onOpen(const LLSD& key);
+ /*virtual*/ void onClosePanel();
+
void processProperties(void* data, EAvatarProcessorType type);
void updateData();
diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp
index 83e0b53960..e80dafe245 100644
--- a/indra/newview/lltexturefetch.cpp
+++ b/indra/newview/lltexturefetch.cpp
@@ -158,7 +158,7 @@ public:
void callbackHttpGet(const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer,
- bool last_block, bool success);
+ bool partial, bool success);
void callbackCacheRead(bool success, LLImageFormatted* image,
S32 imagesize, BOOL islocal);
void callbackCacheWrite(bool success);
@@ -316,7 +316,7 @@ public:
if (HTTP_OK <= status && status < HTTP_MULTIPLE_CHOICES)
{
success = true;
- if (HTTP_PARTIAL_CONTENT == status) // partial information (i.e. last block)
+ if (HTTP_PARTIAL_CONTENT == status) // partial information
{
partial = true;
}
@@ -882,8 +882,18 @@ bool LLTextureFetchWorker::doWork(S32 param)
++mHTTPFailCount;
if (mHTTPFailCount >= max_attempts)
{
- resetFormattedData();
- return true; // failed
+ if (cur_size > 0)
+ {
+ // Use available data
+ mLoadedDiscard = mFormattedImage->getDiscardLevel();
+ mState = DECODE_IMAGE;
+ return false;
+ }
+ else
+ {
+ resetFormattedData();
+ return true; // failed
+ }
}
else
{
@@ -1207,7 +1217,7 @@ bool LLTextureFetchWorker::processSimulatorPackets()
void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
const LLIOPipe::buffer_ptr_t& buffer,
- bool last_block, bool success)
+ bool partial, bool success)
{
LLMutexLock lock(&mWorkMutex);
@@ -1236,7 +1246,7 @@ void LLTextureFetchWorker::callbackHttpGet(const LLChannelDescriptors& channels,
mBuffer = new U8[data_size];
buffer->readAfter(channels.in(), NULL, mBuffer, data_size);
mBufferSize += data_size;
- if (data_size < mRequestedSize || last_block == true)
+ if (data_size < mRequestedSize && mRequestedDiscard == 0)
{
mHaveAllData = TRUE;
}
diff --git a/indra/newview/lltextureview.cpp b/indra/newview/lltextureview.cpp
index 9573b884eb..98731f90f4 100644
--- a/indra/newview/lltextureview.cpp
+++ b/indra/newview/lltextureview.cpp
@@ -412,7 +412,7 @@ void LLGLTexMemBar::draw()
F32 cache_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getUsage()) ;
F32 cache_max_usage = (F32)BYTES_TO_MEGA_BYTES(LLAppViewer::getTextureCache()->getMaxUsage()) ;
S32 line_height = (S32)(LLFontGL::getFontMonospace()->getLineHeight() + .5f);
- S32 h_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
+ S32 v_offset = (S32)((texture_bar_height + 2.5f) * mTextureView->mNumTextureBars + 2.5f);
//----------------------------------------------------------------------------
LLGLSUIDefault gls_ui;
LLColor4 text_color(1.f, 1.f, 1.f, 0.75f);
@@ -428,14 +428,14 @@ void LLGLTexMemBar::draw()
cache_usage, cache_max_usage);
//, cache_entries, cache_max_entries
- LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*3,
+ LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*3,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
//----------------------------------------------------------------------------
#if 0
S32 bar_left = 400;
S32 bar_width = 200;
- S32 top = line_height*3 - 2 + h_offset;
+ S32 top = line_height*3 - 2 + v_offset;
S32 bottom = top - 6;
S32 left = bar_left;
S32 right = left + bar_width;
@@ -494,18 +494,18 @@ void LLGLTexMemBar::draw()
#endif
//----------------------------------------------------------------------------
- text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d IW:%d RAW:%d HTP:%d CRE:%d",
+ text = llformat("Textures: %d Fetch: %d(%d) Pkts:%d(%d) Cache R/W: %d/%d LFS:%d RAW:%d HTP:%d DEC:%d CRE:%d",
gTextureList.getNumImages(),
LLAppViewer::getTextureFetch()->getNumRequests(), LLAppViewer::getTextureFetch()->getNumDeletes(),
LLAppViewer::getTextureFetch()->mPacketCount, LLAppViewer::getTextureFetch()->mBadPacketCount,
LLAppViewer::getTextureCache()->getNumReads(), LLAppViewer::getTextureCache()->getNumWrites(),
LLLFSThread::sLocal->getPending(),
- LLAppViewer::getImageDecodeThread()->getPending(),
LLImageRaw::sRawImageCount,
LLAppViewer::getTextureFetch()->getNumHTTPRequests(),
+ LLAppViewer::getImageDecodeThread()->getPending(),
gTextureList.mCreateTextureList.size());
- LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, h_offset + line_height*2,
+ LLFontGL::getFontMonospace()->renderUTF8(text, 0, 0, v_offset + line_height*2,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
@@ -515,40 +515,40 @@ void LLGLTexMemBar::draw()
color = bandwidth > max_bandwidth ? LLColor4::red : bandwidth > max_bandwidth*.75f ? LLColor4::yellow : text_color;
color[VALPHA] = text_color[VALPHA];
text = llformat("BW:%.0f/%.0f",bandwidth, max_bandwidth);
- LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, line_height*2,
+ LLFontGL::getFontMonospace()->renderUTF8(text, 0, left, v_offset + line_height*2,
color, LLFontGL::LEFT, LLFontGL::TOP);
S32 dx1 = 0;
if (LLAppViewer::getTextureFetch()->mDebugPause)
{
- LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(std::string("!"), 0, title_x1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
dx1 += 8;
}
if (mTextureView->mFreezeView)
{
- LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(std::string("*"), 0, title_x1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
dx1 += 8;
}
if (mTextureView->mOrderFetch)
{
- LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(title_string1b, 0, title_x1+dx1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
else
{
- LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(title_string1a, 0, title_x1+dx1, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
- LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(title_string2, 0, title_x2, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
- LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(title_string3, 0, title_x3, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
- LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, h_offset + line_height,
+ LLFontGL::getFontMonospace()->renderUTF8(title_string4, 0, title_x4, v_offset + line_height,
text_color, LLFontGL::LEFT, LLFontGL::TOP);
}
diff --git a/indra/newview/lltoastalertpanel.h b/indra/newview/lltoastalertpanel.h
index 875ab82c54..43e105a4f1 100644
--- a/indra/newview/lltoastalertpanel.h
+++ b/indra/newview/lltoastalertpanel.h
@@ -37,6 +37,7 @@
#include "llfloater.h"
#include "llui.h"
#include "llnotificationptr.h"
+#include "llerror.h"
class LLButton;
class LLCheckBoxCtrl;
@@ -53,6 +54,7 @@ class LLLineEditor;
class LLToastAlertPanel
: public LLToastPanel
{
+ LOG_CLASS(LLToastAlertPanel);
public:
typedef bool (*display_callback_t)(S32 modal);
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 68a5147bc7..3dac0ee452 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -713,7 +713,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
gBumpImageList.updateImages(); // must be called before gTextureList version so that it's textures are thrown out first.
F32 max_image_decode_time = 0.050f*gFrameIntervalSeconds; // 50 ms/second decode time
- max_image_decode_time = llclamp(max_image_decode_time, 0.001f, 0.005f ); // min 1ms/frame, max 5ms/frame)
+ max_image_decode_time = llclamp(max_image_decode_time, 0.002f, 0.005f ); // min 2ms/frame, max 5ms/frame)
gTextureList.updateImages(max_image_decode_time);
//remove dead textures from GL
diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp
index 35c9a1d367..00db11a767 100644
--- a/indra/newview/llviewerfloaterreg.cpp
+++ b/indra/newview/llviewerfloaterreg.cpp
@@ -94,6 +94,7 @@
#include "llfloaterregioninfo.h"
#include "llfloaterreporter.h"
#include "llfloaterscriptdebug.h"
+#include "llfloaterscriptlimits.h"
#include "llfloatersellland.h"
#include "llfloatersettingsdebug.h"
#include "llfloatersnapshot.h"
@@ -241,6 +242,7 @@ void LLViewerFloaterReg::registerFloaters()
LLFloaterReg::add("script_debug", "floater_script_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebug>);
LLFloaterReg::add("script_debug_output", "floater_script_debug_panel.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptDebugOutput>);
LLFloaterReg::add("script_floater", "floater_script.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLScriptFloater>);
+ LLFloaterReg::add("script_limits", "floater_script_limits.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterScriptLimits>);
LLFloaterReg::add("sell_land", "floater_sell_land.xml", &LLFloaterSellLand::buildFloater);
LLFloaterReg::add("settings_debug", "floater_settings_debug.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSettingsDebug>);
LLFloaterReg::add("stats", "floater_stats.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloater>);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index d1c9840a97..77d2d493bd 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -1421,6 +1421,8 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
setCapability("Seed", url);
LLSD capabilityNames = LLSD::emptyArray();
+
+ capabilityNames.append("AttachmentResources");
capabilityNames.append("ChatSessionRequest");
capabilityNames.append("CopyInventoryFromNotecard");
capabilityNames.append("DispatchRegionInfo");
@@ -1434,6 +1436,7 @@ void LLViewerRegion::setSeedCapability(const std::string& url)
capabilityNames.append("GetTexture");
capabilityNames.append("GroupProposalBallot");
capabilityNames.append("HomeLocation");
+ capabilityNames.append("LandResources");
capabilityNames.append("MapLayer");
capabilityNames.append("MapLayerGod");
capabilityNames.append("NewFileAgentInventory");
diff --git a/indra/newview/llviewerstats.cpp b/indra/newview/llviewerstats.cpp
index a1a3bc6d6a..8059f866ba 100644
--- a/indra/newview/llviewerstats.cpp
+++ b/indra/newview/llviewerstats.cpp
@@ -656,9 +656,9 @@ void update_statistics(U32 frame_count)
gObjectBits = 0;
// gDecodedBits = 0;
- // Only update texture stats ones per second so that they are less noisy
+ // Only update texture stats periodically so that they are less noisy
{
- static const F32 texture_stats_freq = 1.f;
+ static const F32 texture_stats_freq = 10.f;
static LLFrameTimer texture_stats_timer;
if (texture_stats_timer.getElapsedTimeF32() >= texture_stats_freq)
{
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index b45148a186..ae9db94000 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -1497,7 +1497,8 @@ F32 LLViewerFetchedTexture::calcDecodePriority()
{
priority += 10000000.f;
}
- else if(mAdditionalDecodePriority > 0.0f)
+
+ if(mAdditionalDecodePriority > 0.0f)
{
// 1-9
S32 additional_priority = (S32)(1.0f + mAdditionalDecodePriority*8.0f + .5f); // round
diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml
index 81e6503407..a581190d18 100644
--- a/indra/newview/skins/default/xui/en/floater_about_land.xml
+++ b/indra/newview/skins/default/xui/en/floater_about_land.xml
@@ -274,7 +274,7 @@
<button
enabled="false"
follows="left|top"
- height="23S"
+ height="23"
label="Deed"
layout="topleft"
left_pad="2"
@@ -472,6 +472,16 @@
top="328"
width="100" />
<button
+ enabled="true"
+ follows="left|top"
+ height="23"
+ label="Script Info"
+ layout="topleft"
+ left="10"
+ name="Scripts..."
+ top="352"
+ width="100" />
+ <button
enabled="false"
follows="left|top"
height="23"
diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml
index 153a9c2c45..94686f0bb0 100644
--- a/indra/newview/skins/default/xui/en/floater_customize.xml
+++ b/indra/newview/skins/default/xui/en/floater_customize.xml
@@ -55,6 +55,7 @@
label="Shape"
layout="topleft"
name="Shape"
+ help_topic="customize_shape_tab"
width="400">
<icon
follows="top|right"
@@ -340,6 +341,7 @@ scratch and wear it.
label="Skin"
layout="topleft"
name="Skin"
+ help_topic="customize_skin_tab"
width="400">
<icon
follows="top|right"
@@ -591,6 +593,7 @@ scratch and wear it.
label="Hair"
layout="topleft"
name="Hair"
+ help_topic="customize_hair_tab"
width="400">
<icon
follows="top|right"
@@ -812,6 +815,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Eyes"
+ help_topic="customize_eyes_tab"
top_delta="0"
width="389">
<icon
@@ -1010,6 +1014,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Shirt"
+ help_topic="customize_shirt_tab"
top_delta="0"
width="389">
<icon
@@ -1215,6 +1220,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Pants"
+ help_topic="customize_pants_tab"
top_delta="0"
width="389">
<icon
@@ -1420,6 +1426,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Shoes"
+ help_topic="customize_shoes_tab"
top_delta="0"
width="389">
<icon
@@ -1625,6 +1632,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Socks"
+ help_topic="customize_socks_tab"
top_delta="0"
width="389">
<icon
@@ -1830,6 +1838,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Jacket"
+ help_topic="customize_jacket_tab"
top_delta="0"
width="389">
<icon
@@ -2047,6 +2056,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Gloves"
+ help_topic="customize_gloves_tab"
top_delta="0"
width="389">
<icon
@@ -2252,6 +2262,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Undershirt"
+ help_topic="customize_undershirt_tab"
top_delta="0"
width="389">
<icon
@@ -2457,6 +2468,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Underpants"
+ help_topic="customize_underpants_tab"
top_delta="0"
width="389">
<icon
@@ -2662,6 +2674,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Skirt"
+ help_topic="customize_skirt_tab"
top_delta="0"
width="389">
<icon
@@ -2867,6 +2880,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Alpha"
+ help_topic="customize_alpha_tab"
top_delta="0"
width="389">
<icon
@@ -3154,6 +3168,7 @@ scratch and wear it.
layout="topleft"
left_delta="0"
name="Tattoo"
+ help_topic="customize_tattoo_tab"
top_delta="0"
width="389">
<icon
@@ -3381,6 +3396,16 @@ scratch and wear it.
</scroll_container>
<button
bottom="598"
+ follows="right|left"
+ height="20"
+ label="Script Info"
+ label_selected="Script Info"
+ layout="topleft"
+ name="script_info"
+ left="2"
+ width="98" />
+ <button
+ bottom="598"
follows="right|bottom"
height="23"
label="Make Outfit"
diff --git a/indra/newview/skins/default/xui/en/floater_script_limits.xml b/indra/newview/skins/default/xui/en/floater_script_limits.xml
new file mode 100644
index 0000000000..98c44ad1b3
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/floater_script_limits.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<floater
+ legacy_header_height="18"
+ height="570"
+ help_topic="scriptlimits"
+ layout="topleft"
+ name="scriptlimits"
+ save_rect="true"
+ title="SCRIPT INFORMATION"
+ width="480">
+ <tab_container
+ bottom="555"
+ follows="left|right|top|bottom"
+ layout="topleft"
+ left="1"
+ name="scriptlimits_panels"
+ right="-1"
+ tab_position="top"
+ top="20" />
+</floater>
diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml
index 9c1a5499db..5a9e2ebe6e 100644
--- a/indra/newview/skins/default/xui/en/floater_search.xml
+++ b/indra/newview/skins/default/xui/en/floater_search.xml
@@ -4,8 +4,8 @@
can_resize="true"
height="646"
layout="topleft"
- min_height="140"
- min_width="467"
+ min_height="646"
+ min_width="670"
name="floater_search"
help_topic="floater_search"
save_rect="true"
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
index 83dc7cd854..34bd6fb091 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml
@@ -98,12 +98,12 @@
decimal_digits="0"
follows="left|top"
height="15"
- increment="10"
- initial_value="50"
+ increment="100"
+ initial_value="500"
layout="topleft"
left_delta="150"
- max_val="1500"
- min_val="50"
+ max_val="10000"
+ min_val="100"
name="max_bandwidth"
top_delta="0"
width="180" />
diff --git a/indra/newview/skins/default/xui/en/panel_script_limits_my_avatar.xml b/indra/newview/skins/default/xui/en/panel_script_limits_my_avatar.xml
new file mode 100644
index 0000000000..d98f690339
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_script_limits_my_avatar.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ border="true"
+ follows="top|left"
+ height="570"
+ label="MY AVATAR"
+ layout="topleft"
+ left="0"
+ name="script_limits_my_avatar_panel"
+ top="0"
+ width="480">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="20"
+ layout="topleft"
+ left="10"
+ name="loading_text"
+ top="10"
+ text_color="EmphasisColor"
+ width="480">
+ Loading...
+ </text>
+ <scroll_list
+ draw_heading="true"
+ follows="all"
+ height="500"
+ layout="topleft"
+ left_delta="0"
+ multi_select="true"
+ name="scripts_list"
+ top_delta="17"
+ width="460">
+ <scroll_list.columns
+ label="Size (kb)"
+ name="size"
+ width="70" />
+ <scroll_list.columns
+ label="URLs"
+ name="urls"
+ width="50" />
+ <scroll_list.columns
+ label="Object Name"
+ name="name"
+ width="140" />
+ <scroll_list.columns
+ label="Location"
+ name="location"
+ width="130" />
+ </scroll_list>
+ <button
+ follows="bottom|left"
+ height="19"
+ label="Refresh List"
+ layout="bottomleft"
+ left_pad="5"
+ name="refresh_list_btn"
+ top="34"
+ left="10"
+ width="100" />
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml
new file mode 100644
index 0000000000..0fa3c1cf2e
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_script_limits_region_memory.xml
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ border="true"
+ follows="top|left"
+ height="570"
+ label="REGION MEMORY"
+ layout="topleft"
+ name="script_limits_region_memory_panel"
+ top="0"
+ left="0"
+ width="480">
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="10"
+ name="script_memory"
+ top_pad="24"
+ text_color="White"
+ width="480">
+ Parcel Script Memory
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="30"
+ name="parcels_listed"
+ top_delta="18"
+ visible="true"
+ width="480">
+ Parcels Owned:
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="16"
+ layout="topleft"
+ left="30"
+ name="memory_used"
+ top_delta="18"
+ width="480">
+ Memory used:
+ </text>
+ <text
+ type="string"
+ length="1"
+ follows="left|top"
+ height="20"
+ layout="topleft"
+ left="10"
+ name="loading_text"
+ top_delta="32"
+ text_color="EmphasisColor"
+ width="480">
+ Loading...
+ </text>
+ <scroll_list
+ draw_heading="true"
+ follows="all"
+ height="409"
+ layout="topleft"
+ left_delta="0"
+ multi_select="true"
+ name="scripts_list"
+ top_delta="16"
+ width="460">
+ <scroll_list.columns
+ label="Size (kb)"
+ name="size"
+ width="70" />
+ <scroll_list.columns
+ label="Object Name"
+ name="name"
+ width="100" />
+ <scroll_list.columns
+ label="Object Owner"
+ name="owner"
+ width="100" />
+ <scroll_list.columns
+ label="Parcel / Location"
+ name="location"
+ width="130" />
+<!-- <scroll_list.commit_callback
+ function="TopObjects.CommitObjectsList" />-->
+ </scroll_list>
+ <button
+ follows="bottom|left"
+ height="19"
+ label="Refresh List"
+ layout="bottomleft"
+ left_pad="5"
+ name="refresh_list_btn"
+ top="34"
+ left="10"
+ width="100" />
+ <button
+ follows="bottom|right"
+ height="19"
+ visible="false"
+ label="Highlight"
+ layout="bottomright"
+ left="370"
+ name="highlight_btn"
+ top="34"
+ width="100" />
+ <button
+ follows="bottom|right"
+ height="19"
+ visible="false"
+ label="Return"
+ layout="bottomright"
+ name="return_btn"
+ top="34"
+ left_delta="-105"
+ width="100" />
+</panel>
diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml
index ec4723bd55..a1f2548f81 100644
--- a/indra/newview/skins/default/xui/en/strings.xml
+++ b/indra/newview/skins/default/xui/en/strings.xml
@@ -2041,6 +2041,59 @@ this texture in your inventory
<string name="RegionInfoAllowedResidents">Allowed residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string>
<string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string>
+ <!-- script limits floater -->
+ <string name="ScriptLimitsParcelScriptMemory">Parcel Script Memory</string>
+ <string name="ScriptLimitsParcelsOwned">Parcels Listed: [PARCELS]</string>
+ <string name="ScriptLimitsMemoryUsed">Memory used: [COUNT] kb out of [MAX] kb; [AVAILABLE] kb available</string>
+ <string name="ScriptLimitsMemoryUsedSimple">Memory used: [COUNT] kb</string>
+ <string name="ScriptLimitsParcelScriptURLs">Parcel Script URLs</string>
+ <string name="ScriptLimitsURLsUsed">URLs used: [COUNT] out of [MAX]; [AVAILABLE] available</string>
+ <string name="ScriptLimitsURLsUsedSimple">URLs used: [COUNT]</string>
+ <string name="ScriptLimitsRequestError">Error requesting information</string>
+ <string name="ScriptLimitsRequestWrongRegion">Error: script information is only available in your current region</string>
+ <string name="ScriptLimitsRequestWaiting">Retrieving information...</string>
+ <string name="ScriptLimitsRequestDontOwnParcel">You do not have permission to examine this parcel</string>
+
+ <string name="SITTING_ON">Sitting On</string>
+ <string name="ATTACH_CHEST">Chest</string>
+ <string name="ATTACH_HEAD">Head</string>
+ <string name="ATTACH_LSHOULDER">Left Shoulder</string>
+ <string name="ATTACH_RSHOULDER">Right Shoulder</string>
+ <string name="ATTACH_LHAND">Left Hand</string>
+ <string name="ATTACH_RHAND">Right Hand</string>
+ <string name="ATTACH_LFOOT">Left Foot</string>
+ <string name="ATTACH_RFOOT">Right Foot</string>
+ <string name="ATTACH_BACK">Back</string>
+ <string name="ATTACH_PELVIS">Pelvis</string>
+ <string name="ATTACH_MOUTH">Mouth</string>
+ <string name="ATTACH_CHIN">Chin</string>
+ <string name="ATTACH_LEAR">Left Ear</string>
+ <string name="ATTACH_REAR">Right Ear</string>
+ <string name="ATTACH_LEYE">Left Eye</string>
+ <string name="ATTACH_REYE">Right Eye</string>
+ <string name="ATTACH_NOSE">Nose</string>
+ <string name="ATTACH_RUARM">Right Upper Arm</string>
+ <string name="ATTACH_RLARM">Right Lower Arm</string>
+ <string name="ATTACH_LUARM">Left Upper Arm</string>
+ <string name="ATTACH_LLARM">Left Lower Arm</string>
+ <string name="ATTACH_RHIP">Right Hip</string>
+ <string name="ATTACH_RULEG">Right Upper Leg</string>
+ <string name="ATTACH_RLLEG">Right Lower Leg</string>
+ <string name="ATTACH_LHIP">Left Hip</string>
+ <string name="ATTACH_LULEG">Left Upper Leg</string>
+ <string name="ATTACH_LLLEG">Left Lower Leg</string>
+ <string name="ATTACH_BELLY">Belly</string>
+ <string name="ATTACH_RPEC">Right Pec</string>
+ <string name="ATTACH_LPEC">Left Pec</string>
+ <string name="ATTACH_HUD_CENTER_2">HUD Center 2</string>
+ <string name="ATTACH_HUD_TOP_RIGHT">HUD Top Right</string>
+ <string name="ATTACH_HUD_TOP_CENTER">HUD Top Center</string>
+ <string name="ATTACH_HUD_TOP_LEFT">HUD Top Left</string>
+ <string name="ATTACH_HUD_CENTER_1">HUD Center 1</string>
+ <string name="ATTACH_HUD_BOTTOM_LEFT">HUD Bottom Left</string>
+ <string name="ATTACH_HUD_BOTTOM">HUD Bottom</string>
+ <string name="ATTACH_HUD_BOTTOM_RIGHT">HUD Bottom Right</string>
+
<!-- script editor -->
<string name="CursorPos">Line [LINE], Column [COLUMN]</string>