Fixed LLCompileQueue messages via update to v-d in parts. Script resets now output properly~

This commit is contained in:
Lirusaito
2013-01-03 14:08:39 -05:00
parent 88de1b28a2
commit c3829485e4
3 changed files with 59 additions and 75 deletions

View File

@@ -55,6 +55,7 @@
#include "llviewerobject.h" #include "llviewerobject.h"
#include "llviewerregion.h" #include "llviewerregion.h"
#include "llresmgr.h" #include "llresmgr.h"
#include "llbutton.h" #include "llbutton.h"
#include "lldir.h" #include "lldir.h"
#include "llnotificationsutil.h" #include "llnotificationsutil.h"
@@ -207,8 +208,7 @@ BOOL LLFloaterScriptQueue::start()
args["[COUNT]"] = llformat ("%d", mObjectIDs.count()); args["[COUNT]"] = llformat ("%d", mObjectIDs.count());
buffer = getString ("Starting", args); buffer = getString ("Starting", args);
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
list->setCommentText(buffer);
return nextObject(); return nextObject();
} }
@@ -240,12 +240,9 @@ BOOL LLFloaterScriptQueue::nextObject()
} while((mObjectIDs.count() > 0) && !successful_start); } while((mObjectIDs.count() > 0) && !successful_start);
if(isDone() && !mDone) if(isDone() && !mDone)
{ {
mDone = true;
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(getString("Done"), ADD_BOTTOM);
getChildView("close")->setEnabled(TRUE);
mDone = TRUE;
list->setCommentText(getString("Done"));
childSetEnabled("close",TRUE);
} }
return successful_start; return successful_start;
} }
@@ -283,6 +280,40 @@ BOOL LLFloaterScriptQueue::popNext()
/// Class LLFloaterCompileQueue /// Class LLFloaterCompileQueue
///---------------------------------------------------------------------------- ///----------------------------------------------------------------------------
class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier
{
public:
LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) :
mQueueId(queue_id)
{
}
virtual LLAssetUploadQueue* get() const
{
LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
if(NULL == queue)
{
return NULL;
}
return queue->getUploadQueue();
}
virtual void log(std::string message) const
{
LLFloaterCompileQueue* queue = (LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
if(NULL == queue)
{
return;
}
queue->getChild<LLScrollListCtrl>("queue output")->addSimpleElement(message, ADD_BOTTOM);
}
private:
LLUUID mQueueId;
};
// static // static
LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono) LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono)
{ {
@@ -292,46 +323,6 @@ LLFloaterCompileQueue* LLFloaterCompileQueue::create(BOOL mono)
rect.translate(left - rect.mLeft, top - rect.mTop); rect.translate(left - rect.mLeft, top - rect.mTop);
LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", rect); LLFloaterCompileQueue* new_queue = new LLFloaterCompileQueue("queue", rect);
class LLCompileFloaterUploadQueueSupplier : public LLAssetUploadQueueSupplier
{
public:
LLCompileFloaterUploadQueueSupplier(const LLUUID& queue_id) :
mQueueId(queue_id)
{
}
virtual LLAssetUploadQueue* get() const
{
LLFloaterCompileQueue* queue =
(LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
if(NULL == queue)
{
return NULL;
}
return queue->mUploadQueue;
}
virtual void log(std::string message) const
{
LLFloaterCompileQueue* queue =
(LLFloaterCompileQueue*) LLFloaterScriptQueue::findInstance(mQueueId);
if(NULL == queue)
{
return;
}
LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output");
list->setCommentText(message.c_str());
}
private:
LLUUID mQueueId;
};
new_queue->mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(new_queue->getID())); new_queue->mUploadQueue = new LLAssetUploadQueue(new LLCompileFloaterUploadQueueSupplier(new_queue->getID()));
new_queue->mMono = mono; new_queue->mMono = mono;
new_queue->open(); new_queue->open();
@@ -414,8 +405,8 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl; llinfos << "LLFloaterCompileQueue::scriptArrived()" << llendl;
LLScriptQueueData* data = (LLScriptQueueData*)user_data; LLScriptQueueData* data = (LLScriptQueueData*)user_data;
if(!data) return; if(!data) return;
LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> (LLFloaterScriptQueue::findInstance(data->mQueueID));
(LLFloaterScriptQueue::findInstance(data->mQueueID));
std::string buffer; std::string buffer;
if(queue && (0 == status)) if(queue && (0 == status))
{ {
@@ -519,8 +510,7 @@ void LLFloaterCompileQueue::scriptArrived(LLVFS *vfs, const LLUUID& asset_id,
} }
if(queue && (buffer.size() > 0)) if(queue && (buffer.size() > 0))
{ {
LLScrollListCtrl* list = queue->getChild<LLScrollListCtrl>("queue output"); queue->getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
list->setCommentText(buffer);
} }
delete data; delete data;
} }
@@ -543,8 +533,7 @@ void LLFloaterCompileQueue::onSaveBytecodeComplete(const LLUUID& asset_id, void*
{ {
llinfos << "LLFloaterCompileQueue::onSaveBytecodeComplete()" << llendl; llinfos << "LLFloaterCompileQueue::onSaveBytecodeComplete()" << llendl;
LLCompileQueueData* data = (LLCompileQueueData*)user_data; LLCompileQueueData* data = (LLCompileQueueData*)user_data;
LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> LLFloaterCompileQueue* queue = static_cast<LLFloaterCompileQueue*> (LLFloaterScriptQueue::findInstance(data->mQueueID));
(LLFloaterScriptQueue::findInstance(data->mQueueID));
if(queue && (0 == status) && data) if(queue && (0 == status) && data)
{ {
queue->saveItemByItemID(data->mItemId); queue->saveItemByItemID(data->mItemId);
@@ -704,10 +693,9 @@ void LLFloaterResetQueue::handleInventory(LLViewerObject* viewer_obj,
if (object) if (object)
{ {
LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it)); LLInventoryItem* item = (LLInventoryItem*)((LLInventoryObject*)(*it));
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer; std::string buffer;
buffer = getString("Resetting") + LLTrans::getString(":") + " " + item->getName(); buffer = getString("Resetting") + LLTrans::getString(":") + " " + item->getName();
list->setCommentText(buffer); getChild<LLScrollListCtrl>("queue output")->addSimpleElement(buffer, ADD_BOTTOM);
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ScriptReset); msg->newMessageFast(_PREHASH_ScriptReset);
msg->nextBlockFast(_PREHASH_AgentData); msg->nextBlockFast(_PREHASH_AgentData);
@@ -769,7 +757,7 @@ void LLFloaterRunQueue::handleInventory(LLViewerObject* viewer_obj,
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer; std::string buffer;
buffer = getString("Running") + LLTrans::getString(":") + " " + item->getName(); buffer = getString("Running") + LLTrans::getString(":") + " " + item->getName();
list->setCommentText(buffer); list->addSimpleElement(buffer, ADD_BOTTOM);
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SetScriptRunning); msg->newMessageFast(_PREHASH_SetScriptRunning);
@@ -833,7 +821,7 @@ void LLFloaterNotRunQueue::handleInventory(LLViewerObject* viewer_obj,
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output"); LLScrollListCtrl* list = getChild<LLScrollListCtrl>("queue output");
std::string buffer; std::string buffer;
buffer = getString("NotRunning") + LLTrans::getString(":") + " " + item->getName(); buffer = getString("NotRunning") + LLTrans::getString(":") + " " + item->getName();
list->setCommentText(buffer); list->addSimpleElement(buffer, ADD_BOTTOM);
LLMessageSystem* msg = gMessageSystem; LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_SetScriptRunning); msg->newMessageFast(_PREHASH_SetScriptRunning);

View File

@@ -105,7 +105,7 @@ protected:
// Object Queue // Object Queue
LLDynamicArray<LLUUID> mObjectIDs; LLDynamicArray<LLUUID> mObjectIDs;
LLUUID mCurrentObjectID; LLUUID mCurrentObjectID;
BOOL mDone; bool mDone;
LLUUID mID; LLUUID mID;
static LLMap<LLUUID, LLFloaterScriptQueue*> sInstances; static LLMap<LLUUID, LLFloaterScriptQueue*> sInstances;
@@ -143,6 +143,8 @@ public:
// remove any object in mScriptScripts with the matching uuid. // remove any object in mScriptScripts with the matching uuid.
void removeItemByItemID(const LLUUID& item_id); void removeItemByItemID(const LLUUID& item_id);
LLAssetUploadQueue* getUploadQueue() { return mUploadQueue; }
protected: protected:
LLFloaterCompileQueue(const std::string& name, const LLRect& rect); LLFloaterCompileQueue(const std::string& name, const LLRect& rect);
virtual ~LLFloaterCompileQueue(); virtual ~LLFloaterCompileQueue();
@@ -204,8 +206,6 @@ protected:
// This is called by inventoryChanged // This is called by inventoryChanged
virtual void handleInventory(LLViewerObject* viewer_obj, virtual void handleInventory(LLViewerObject* viewer_obj,
LLInventoryObject::object_list_t* inv); LLInventoryObject::object_list_t* inv);
protected:
}; };
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -228,8 +228,6 @@ protected:
// This is called by inventoryChanged // This is called by inventoryChanged
virtual void handleInventory(LLViewerObject* viewer_obj, virtual void handleInventory(LLViewerObject* viewer_obj,
LLInventoryObject::object_list_t* inv); LLInventoryObject::object_list_t* inv);
protected:
}; };
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -252,8 +250,6 @@ protected:
// This is called by inventoryChanged // This is called by inventoryChanged
virtual void handleInventory(LLViewerObject* viewer_obj, virtual void handleInventory(LLViewerObject* viewer_obj,
LLInventoryObject::object_list_t* inv); LLInventoryObject::object_list_t* inv);
protected:
}; };
#endif // LL_LLCOMPILEQUEUE_H #endif // LL_LLCOMPILEQUEUE_H

View File

@@ -1076,7 +1076,7 @@ bool idle_startup()
gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged, _2)); gSavedSettings.getControl("_NACL_AntiSpamAmount")->getSignal()->connect(boost::bind(&NACLAntiSpamRegistry::handleNaclAntiSpamAmountChanged, _2));
// NaCl End // NaCl End
//good as place as any to create user windlight directories //good a place as any to create user windlight directories
std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", "")); std::string user_windlight_path_name(gDirUtilp->getExpandedFilename( LL_PATH_USER_SETTINGS , "windlight", ""));
LLFile::mkdir(user_windlight_path_name.c_str()); LLFile::mkdir(user_windlight_path_name.c_str());