From f5578150b246355bcce8736520f10b4b73226e5d Mon Sep 17 00:00:00 2001 From: ziree Date: Thu, 23 Jun 2011 00:10:14 +0200 Subject: [PATCH] Added local chat status messages to AO import, fixed AO reloading getting stuck in some cases. FIRE-1444 --- indra/newview/ao.cpp | 16 ++- indra/newview/ao.h | 6 +- indra/newview/aoengine.cpp | 48 ++++++--- .../skins/default/xui/en/notifications.xml | 98 +++++++++++++++++++ 4 files changed, 152 insertions(+), 16 deletions(-) diff --git a/indra/newview/ao.cpp b/indra/newview/ao.cpp index 474bc6528d..048cdc55ef 100644 --- a/indra/newview/ao.cpp +++ b/indra/newview/ao.cpp @@ -40,7 +40,7 @@ #include FloaterAO::FloaterAO(const LLSD& key) -: LLTransientDockableFloater(NULL,true,key), +: LLTransientDockableFloater(NULL,true,key),LLEventTimer(10.0), mSetList(0), mSelectedSet(0), mSelectedState(0), @@ -48,6 +48,7 @@ FloaterAO::FloaterAO(const LLSD& key) mImportRunning(FALSE), mMore(TRUE) { + mEventTimer.stop(); } FloaterAO::~FloaterAO() @@ -56,11 +57,24 @@ FloaterAO::~FloaterAO() void FloaterAO::reloading(BOOL yes) { + if(yes) + mEventTimer.start(); + else + mEventTimer.stop(); + mReloadCoverPanel->setVisible(yes); enableSetControls(!yes); enableStateControls(!yes); } +BOOL FloaterAO::tick() +{ + // reloading took too long, probably missed the signal, so we hide the reload cover + llwarns << "AO reloading timeout." << llendl; + updateList(); + return FALSE; +} + void FloaterAO::updateSetParameters() { mOverrideSitsCheckBox->setValue(mSelectedSet->getSitOverride()); diff --git a/indra/newview/ao.h b/indra/newview/ao.h index cf4d05c816..eb2bb3946f 100644 --- a/indra/newview/ao.h +++ b/indra/newview/ao.h @@ -28,6 +28,7 @@ #ifndef AO_H #define AO_H +#include "lleventtimer.h" #include "lltransientdockablefloater.h" #include "aoset.h" @@ -40,7 +41,8 @@ class LLSpinCtrl; class LLTextBox; class FloaterAO -: public LLTransientDockableFloater +: public LLTransientDockableFloater, + public LLEventTimer { friend class LLFloaterReg; @@ -98,6 +100,8 @@ class FloaterAO BOOL newSetCallback(const LLSD& notification,const LLSD& response); BOOL removeSetCallback(const LLSD& notification,const LLSD& response); + virtual BOOL tick(); + std::vector mSetList; AOSet* mSelectedSet; AOSet::AOState* mSelectedState; diff --git a/indra/newview/aoengine.cpp b/indra/newview/aoengine.cpp index b8e8f77e7c..16ce46bdcf 100644 --- a/indra/newview/aoengine.cpp +++ b/indra/newview/aoengine.cpp @@ -37,6 +37,7 @@ #include "llinventoryfunctions.h" // for ROOT_FIRESTORM_FOLDER #include "llinventorymodel.h" #include "llinventoryobserver.h" +#include "llnotificationsutil.h" #include "llstring.h" #include "llvfs.h" #include "llviewercontrol.h" @@ -1303,13 +1304,13 @@ BOOL AOEngine::importNotecard(const LLInventoryItem* item) llwarns << "importing AO notecard: " << item->getName() << llendl; if(getSetByName(item->getName())) { - llwarns << "set with this name already exists" << llendl; + LLNotificationsUtil::add("AOImportSetAlreadyExists", LLSD()); return FALSE; } if(!gAgent.allowOperation(PERM_COPY,item->getPermissions(),GP_OBJECT_MANIPULATE) && !gAgent.isGodlike()) { - llwarns << "Insufficient permissions to read notecard." << llendl; + LLNotificationsUtil::add("AOImportPermissionDenied", LLSD()); return FALSE; } @@ -1318,7 +1319,7 @@ BOOL AOEngine::importNotecard(const LLInventoryItem* item) mImportSet=new AOSet(item->getParentUUID()); if(!mImportSet) { - llwarns << "could not create import set." << llendl; + LLNotificationsUtil::add("AOImportCreateSetFailed", LLSD()); return FALSE; } mImportSet->setName(item->getName()); @@ -1353,7 +1354,8 @@ void AOEngine::onNotecardLoadComplete( LLVFS* vfs,const LLUUID& assetUUID,LLAsse { if(status!=LL_ERR_NOERR) { - llwarns << "Error downloading import notecard." << llendl; + // AOImportDownloadFailed + LLNotificationsUtil::add("AOImportDownloadFailed", LLSD()); // NULL tells the importer to cancel all operations and free the import set memory AOEngine::instance().parseNotecard(NULL); return; @@ -1401,7 +1403,7 @@ void AOEngine::parseNotecard(const char* buffer) if(found==-1) { - llwarns << "notecard is missing the text portion" << llendl; + LLNotificationsUtil::add("AOImportNoText", LLSD()); delete mImportSet; mImportSet=0; mUpdatedSignal(); @@ -1411,7 +1413,7 @@ void AOEngine::parseNotecard(const char* buffer) LLViewerInventoryCategory* importCategory=gInventory.getCategory(mImportSet->getInventoryUUID()); if(!importCategory) { - llwarns << "couldn't find folder to read the animations" << llendl; + LLNotificationsUtil::add("AOImportNoFolder", LLSD()); delete mImportSet; mImportSet=0; mUpdatedSignal(); @@ -1442,14 +1444,18 @@ void AOEngine::parseNotecard(const char* buffer) LLStringUtil::trim(line); if(line.find("[")!=0) { - llwarns << "line " << index << " has no valid [ state prefix" << llendl; + LLSD args; + args["LINE"]=(S32) index; + LLNotificationsUtil::add("AOImportNoStatePrefix",args); continue; } U32 endTag=line.find("]"); if(endTag==std::string::npos) { - llwarns << "line " << index << " has no valid ] delimiter" << llendl; + LLSD args; + args["LINE"]=(S32) index; + LLNotificationsUtil::add("AOImportNoValidDelimiter",args); continue; } @@ -1459,7 +1465,9 @@ void AOEngine::parseNotecard(const char* buffer) AOSet::AOState* newState=mImportSet->getStateByName(stateName); if(!newState) { - llwarns << "state name " << stateName << " not found." << llendl; + LLSD args; + args["NAME"]=stateName; + LLNotificationsUtil::add("AOImportStateNameNotFound",args); continue; } @@ -1474,7 +1482,9 @@ void AOEngine::parseNotecard(const char* buffer) animation.mInventoryUUID=animationMap[animation.mName]; if(animation.mInventoryUUID.isNull()) { - llwarns << "couldn't find animation " << animation.mName << " in animation map." << llendl; + LLSD args; + args["NAME"]=animation.mName; + LLNotificationsUtil::add("AOImportAnimationNotFound",args); continue; } animation.mSortOrder=animIndex; @@ -1485,7 +1495,7 @@ void AOEngine::parseNotecard(const char* buffer) if(!isValid) { - llwarns << "Notecard didn't contain any usable data. Aborting import." << llendl; + LLNotificationsUtil::add("AOImportInvalid",LLSD()); // NOTE: cleanup is always the same, needs streamlining delete mImportSet; mImportSet=0; @@ -1514,10 +1524,16 @@ void AOEngine::processImport() mImportSet=0; mImportCategory.setNull(); mUpdatedSignal(); - llwarns << "could not create import category for set " << mImportSet->getName() << " ... giving up" << llendl; + LLSD args; + args["NAME"]=mImportSet->getName(); + LLNotificationsUtil::add("AOImportAbortCreateSet",args); } else - llwarns << "could not create import category for set " << mImportSet->getName() << " ... retrying ..." << llendl; + { + LLSD args; + args["NAME"]=mImportSet->getName(); + LLNotificationsUtil::add("AOImportRetryCreateSet",args); + } return; } mImportSet->setInventoryUUID(mImportCategory); @@ -1543,7 +1559,11 @@ void AOEngine::processImport() lldebugs << "deleted, size now: " << state->mAnimations.size() << llendl; } else - llwarns << "linking animation failed!" << llendl; + { + LLSD args; + args["NAME"]=state->mAnimations[animationIndex].mName; + LLNotificationsUtil::add("AOImportLinkFailed",args); + } } } } diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a35b19d85b..a530097925 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -7201,6 +7201,104 @@ Remove AO set "[AO_SET_NAME]" from the list? yestext="Remove"/> + +An animation set with this name already exists. + + + +Insufficient permissions to read notecard. + + + +Error while creating import set. + + + +Could not download notecard. + + + +Notecard is empty or unreadable. + + + +Couldn't find folder to read the animations. + + + +Notecard line [LINE] has no valid [ state prefix. + + + +Notecard line [LINE] has no valid ] delimiter. + + + +State name [NAME] not found. + + + +Couldn't find animation [NAME]. Please make sure it's present in the same folder as the import notecard. + + + +Notecard didn't contain any usable data. Aborting import. + + + +Could not create import folder for animation set [NAME]. Retrying ... + + + +Could not create import folder for animation set [NAME]. Giving up. + + + +Creating animation link for animation "[NAME]" failed! + +