Merge viewer-lynx

meow-7.2.2
Ansariel 2016-07-13 10:16:47 +02:00
commit 067b1c232e
9 changed files with 95 additions and 50 deletions

View File

@ -5740,7 +5740,7 @@
<key>Type</key>
<string>F32</string>
<key>Value</key>
<integer>40.0</integer>
<real>300.0</real>
</map>
<key>FindLandArea</key>
<map>

View File

@ -235,9 +235,10 @@ void LLFloaterScriptQueue::onCloseBtn(void* user_data)
self->closeFloater();
}
void LLFloaterScriptQueue::addObject(const LLUUID& id)
void LLFloaterScriptQueue::addObject(const LLUUID& id, std::string name)
{
mObjectIDs.insert(id);
ObjectData obj = { id, name };
mObjectList.push_back(obj);
}
BOOL LLFloaterScriptQueue::start()
@ -269,7 +270,7 @@ bool LLFloaterScriptQueue::onScriptModifyConfirmation(const LLSD& notification,
LLStringUtil::format_map_t args;
args["[START]"] = mStartString;
args["[COUNT]"] = llformat ("%d", mObjectIDs.size());
args["[COUNT]"] = llformat ("%d", mObjectList.size());
buffer = getString ("Starting", args);
getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
@ -292,7 +293,7 @@ void LLFloaterScriptQueue::addStringMessage(const std::string &message)
BOOL LLFloaterScriptQueue::isDone() const
{
return (mCurrentObjectID.isNull() && (mObjectIDs.size() == 0));
return (mCurrentObjectID.isNull() && (mObjectList.size() == 0));
}
///----------------------------------------------------------------------------
@ -429,7 +430,7 @@ void LLFloaterCompileQueue::processExperienceIdResults(LLSD result, LLUUID paren
LLCoros::instance().launch("ScriptQueueCompile", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro,
queue->mStartString,
hFloater,
queue->mObjectIDs,
queue->mObjectList,
fn));
}
@ -502,10 +503,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat
if (result.has("timeout") && result["timeout"].asBoolean())
{
// <FS:Ansariel> Translation fixes
//std::string buffer = "Timeout: " + inventory->getName();
std::string buffer = that->getString("Timeout") + ": " + inventory->getName();
// </FS:Ansariel>
LLStringUtil::format_map_t args;
args["[OBJECT_NAME]"] = inventory->getName();
std::string buffer = that->getString("Timeout", args);
that->addStringMessage(buffer);
return true;
}
@ -568,10 +568,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat
{
if (result.has("timeout") && result["timeout"].asBoolean())
{
// <FS:Ansariel> Translation fixes
//std::string buffer = "Timeout: " + inventory->getName();
std::string buffer = that->getString("Timeout") + ": " + inventory->getName();
// </FS:Ansariel>
LLStringUtil::format_map_t args;
args["[OBJECT_NAME]"] = inventory->getName();
std::string buffer = that->getString("Timeout", args);
that->addStringMessage(buffer);
return true;
}
@ -633,10 +632,9 @@ bool LLFloaterCompileQueue::processScript(LLHandle<LLFloaterCompileQueue> hfloat
{
if (result.has("timeout") && result["timeout"].asBoolean())
{
// <FS:Ansariel> Translation fixes
//std::string buffer = "Timeout: " + inventory->getName();
std::string buffer = that->getString("Timeout") + ": " + inventory->getName();
// </FS:Ansariel>
LLStringUtil::format_map_t args;
args["[OBJECT_NAME]"] = inventory->getName();
std::string buffer = that->getString("Timeout", args);
that->addStringMessage(buffer);
return true;
}
@ -750,7 +748,7 @@ bool LLFloaterResetQueue::startQueue()
LLCoros::instance().launch("ScriptResetQueue", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro,
mStartString,
getDerivedHandle<LLFloaterScriptQueue>(),
mObjectIDs,
mObjectList,
fn));
return true;
@ -804,7 +802,7 @@ bool LLFloaterRunQueue::startQueue()
LLCoros::instance().launch("ScriptRunQueue", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro,
mStartString,
hFloater,
mObjectIDs,
mObjectList,
fn));
return true;
@ -859,7 +857,7 @@ bool LLFloaterNotRunQueue::startQueue()
LLCoros::instance().launch("ScriptQueueNotRun", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro,
mStartString,
hFloater,
mObjectIDs,
mObjectList,
fn));
return true;
@ -914,7 +912,7 @@ bool LLFloaterDeleteQueue::startQueue()
LLCoros::instance().launch("ScriptDeleteQueue", boost::bind(LLFloaterScriptQueue::objectScriptProcessingQueueCoro,
mStartString,
hFloater,
mObjectIDs,
mObjectList,
fn));
return true;
@ -936,7 +934,7 @@ void ObjectInventoryFetcher::inventoryChanged(LLViewerObject* object,
}
void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater,
uuid_list_t objectList, fnQueueAction_t func)
object_data_list_t objectList, fnQueueAction_t func)
{
LLCoros::set_consuming(true);
LLFloaterScriptQueue * floater(NULL);
@ -950,12 +948,13 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L
// .with("[COUNT]", LLSD::Integer(objectList.size())));
// floater = NULL;
for (uuid_list_t::iterator itObj(objectList.begin()); (itObj != objectList.end()); ++itObj)
for (object_data_list_t::iterator itObj(objectList.begin()); (itObj != objectList.end()); ++itObj)
{
bool firstForObject = true;
LL_INFOS("SCRIPTQ") << "Next object in queue with ID=" << (*itObj).asString() << LL_ENDL;
LLUUID object_id = (*itObj).mObjectId;
LL_INFOS("SCRIPTQ") << "Next object in queue with ID=" << object_id.asString() << LL_ENDL;
LLPointer<LLViewerObject> obj = gObjectList.findObject(*itObj);
LLPointer<LLViewerObject> obj = gObjectList.findObject(object_id);
LLInventoryObject::object_list_t inventory;
if (obj)
{
@ -963,13 +962,31 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L
fetcher->fetchInventory();
floater = hfloater.get();
if (floater)
{
LLStringUtil::format_map_t args;
args["[OBJECT_NAME]"] = (*itObj).mObjectName;
floater->addStringMessage(floater->getString("LoadingObjInv", args));
}
LLSD result = llcoro::suspendUntilEventOnWithTimeout(maildrop, fetch_timeout,
LLSD().with("timeout", LLSD::Boolean(true)));
if (result.has("timeout") && result["timeout"].asBoolean())
{
LL_WARNS("SCRIPTQ") << "Unable to retrieve inventory for object " << (*itObj).asString() <<
LL_WARNS("SCRIPTQ") << "Unable to retrieve inventory for object " << object_id.asString() <<
". Skipping to next object." << LL_ENDL;
// floater could have been closed
floater = hfloater.get();
if (floater)
{
LLStringUtil::format_map_t args;
args["[OBJECT_NAME]"] = (*itObj).mObjectName;
floater->addStringMessage(floater->getString("Timeout", args));
}
continue;
}
@ -977,7 +994,7 @@ void LLFloaterScriptQueue::objectScriptProcessingQueueCoro(std::string action, L
}
else
{
LL_WARNS("SCRIPTQ") << "Unable to retrieve object with ID of " << (*itObj) <<
LL_WARNS("SCRIPTQ") << "Unable to retrieve object with ID of " << object_id <<
". Skipping to next." << LL_ENDL;
continue;
}

View File

@ -78,7 +78,7 @@ public:
void setMono(bool mono) { mMono = mono; }
// addObject() accepts an object id.
void addObject(const LLUUID& id);
void addObject(const LLUUID& id, std::string name);
// start() returns TRUE if the queue has started, otherwise FALSE.
BOOL start();
@ -106,7 +106,14 @@ protected:
LLButton* mCloseBtn;
// Object Queue
uuid_list_t mObjectIDs;
struct ObjectData
{
LLUUID mObjectId;
std::string mObjectName;
};
typedef std::vector<ObjectData> object_data_list_t;
object_data_list_t mObjectList;
LLUUID mCurrentObjectID;
bool mDone;
@ -114,7 +121,7 @@ protected:
bool mMono;
typedef boost::function<bool(const LLPointer<LLViewerObject> &, LLInventoryObject*, LLEventPump &)> fnQueueAction_t;
static void objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, uuid_list_t objectList, fnQueueAction_t func);
static void objectScriptProcessingQueueCoro(std::string action, LLHandle<LLFloaterScriptQueue> hfloater, object_data_list_t objectList, fnQueueAction_t func);
};

View File

@ -40,6 +40,8 @@
#include "llcorehttputil.h"
#include "lleventfilter.h"
#include "boost/make_shared.hpp"
#include "llsdutil.h" // <FS:ND/> for ll_pretty_print_sd
namespace LLEventPolling
@ -47,7 +49,7 @@ namespace LLEventPolling
namespace Details
{
class LLEventPollImpl
class LLEventPollImpl: public boost::enable_shared_from_this<LLEventPollImpl>
{
public:
LLEventPollImpl(const LLHost &sender);
@ -123,7 +125,7 @@ namespace Details
{
std::string coroname =
LLCoros::instance().launch("LLEventPollImpl::eventPollCoro",
boost::bind(&LLEventPollImpl::eventPollCoro, this, url));
boost::bind(&LLEventPollImpl::eventPollCoro, this->shared_from_this(), url));
LL_INFOS("LLEventPollImpl") << coroname << " with url '" << url << LL_ENDL;
}
}
@ -283,8 +285,7 @@ namespace Details
LLEventPoll::LLEventPoll(const std::string& poll_url, const LLHost& sender):
mImpl()
{
mImpl = boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl>
(new LLEventPolling::Details::LLEventPollImpl(sender));
mImpl = boost::make_shared<LLEventPolling::Details::LLEventPollImpl>(sender);
mImpl->start(poll_url);
}

View File

@ -27,12 +27,6 @@
#ifndef LL_LLEVENTPOLL_H
#define LL_LLEVENTPOLL_H
#include "boost/move/unique_ptr.hpp"
namespace boost
{
using ::boost::movelib::unique_ptr; // move unique_ptr into the boost namespace.
}
class LLHost;
@ -57,7 +51,7 @@ public:
private:
boost::unique_ptr<LLEventPolling::Details::LLEventPollImpl> mImpl;
boost::shared_ptr<LLEventPolling::Details::LLEventPollImpl> mImpl;
};

View File

@ -212,6 +212,21 @@ void LLToast::hide()
}
}
/*virtual*/
void LLToast::setFocus(BOOL b)
{
if (b && !hasFocus() && mPanel)
{
LLModalDialog::setFocus(TRUE);
// mostly for buttons
mPanel->setFocus(TRUE);
}
else
{
LLModalDialog::setFocus(b);
}
}
void LLToast::onFocusLost()
{
if(mWrapperPanel && !isBackgroundVisible())

View File

@ -150,6 +150,8 @@ public:
//
virtual void hide();
/*virtual*/ void setFocus(BOOL b);
/*virtual*/ void onFocusLost();
/*virtual*/ void onFocusReceived();

View File

@ -8583,20 +8583,25 @@ bool enable_avatar_call()
namespace
{
struct QueueObjects : public LLSelectedObjectFunctor
struct QueueObjects : public LLSelectedNodeFunctor
{
BOOL scripted;
BOOL modifiable;
LLFloaterScriptQueue* mQueue;
QueueObjects(LLFloaterScriptQueue* q) : mQueue(q), scripted(FALSE), modifiable(FALSE) {}
virtual bool apply(LLViewerObject* obj)
virtual bool apply(LLSelectNode* node)
{
LLViewerObject* obj = node->getObject();
if (!obj)
{
return true;
}
scripted = obj->flagScripted();
modifiable = obj->permModify();
if( scripted && modifiable )
{
mQueue->addObject(obj->getID());
mQueue->addObject(obj->getID(), node->mName);
return false;
}
else
@ -8612,7 +8617,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
QueueObjects func(q);
LLSelectMgr *mgr = LLSelectMgr::getInstance();
LLObjectSelectionHandle selectHandle = mgr->getSelection();
bool fail = selectHandle->applyToObjects(&func);
bool fail = selectHandle->applyToNodes(&func);
if(fail)
{
if ( !func.scripted )

View File

@ -30,12 +30,16 @@
Not running
</floater.string>
<floater.string
name="Deleting">
Deleting
name="Timeout">
Timeout: [OBJECT_NAME]
</floater.string>
<floater.string
name="Timeout">
Timeout: [NAME]
name="LoadingObjInv">
Loading inventory for: [OBJECT_NAME]
</floater.string>
<floater.string
name="Deleting">
Deleting
</floater.string>
<floater.string
name="SkippingPermissions">