This commit is contained in:
Lirusaito
2013-03-20 09:01:37 -04:00
30 changed files with 467 additions and 459 deletions

View File

@@ -38,6 +38,8 @@
#include "lllistener_openal.h"
const float LLAudioEngine_OpenAL::WIND_BUFFER_SIZE_SEC = 0.05f;
LLAudioEngine_OpenAL::LLAudioEngine_OpenAL()
:
mWindGen(NULL),
@@ -185,6 +187,8 @@ LLAudioChannelOpenAL::~LLAudioChannelOpenAL()
void LLAudioChannelOpenAL::cleanup()
{
alSourceStop(mALSource);
alSourcei(mALSource, AL_BUFFER, AL_NONE);
mCurrentBufferp = NULL;
}
@@ -324,7 +328,14 @@ void LLAudioBufferOpenAL::cleanup()
{
if(mALBuffer != AL_NONE)
{
alGetError(); // clear error
alDeleteBuffers(1, &mALBuffer);
ALenum error = alutGetError();
if(ALC_NO_ERROR != error)
{
LL_WARNS("OpenAL") << "Error: " << alutGetErrorString( error ) << " when cleaning up a buffer" << LL_ENDL;
}
mALBuffer = AL_NONE;
}
}
@@ -441,6 +452,7 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
F64 pitch;
F64 center_freq;
ALenum error;
ALuint *buffers = NULL;
if (!mEnableWind)
return;
@@ -484,58 +496,68 @@ void LLAudioEngine_OpenAL::updateWind(LLVector3 wind_vec, F32 camera_altitude)
mNumEmptyWindALBuffers = llmax(mNumEmptyWindALBuffers, 0);
//llinfos << "mNumEmptyWindALBuffers: " << mNumEmptyWindALBuffers <<" (" << unprocessed << ":" << processed << ")" << llendl;
while(processed--) // unqueue old buffers
//delete the old wind buffers
buffers = new ALuint[processed];
alGetError(); /* clear error */
alSourceUnqueueBuffers(mWindSource, processed, &buffers[0]);
error = alGetError();
if(error != AL_NO_ERROR)
{
ALuint buffer;
ALenum error;
alGetError(); /* clear error */
alSourceUnqueueBuffers(mWindSource, 1, &buffer);
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl;
}
else
{
alDeleteBuffers(1, &buffer);
}
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (unqueuing) buffers" << llendl;
}
else
{
alDeleteBuffers(processed, &buffers[0]);
}
// We dont need to keep track of the buffers' id now.
delete[] buffers;
buffers = NULL;
//create the buffers for the empty wind buffers
unprocessed += mNumEmptyWindALBuffers;
buffers = new ALuint[mNumEmptyWindALBuffers];
alGetError(); /* clear error */
alGenBuffers(mNumEmptyWindALBuffers,&buffers[0]);
if((error=alGetError()) != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl;
//break;
}
unprocessed += mNumEmptyWindALBuffers;
while (mNumEmptyWindALBuffers > 0) // fill+queue new buffers
//fill the buffers with generated wind.
int errors = 0;
for(int i = 0; i < mNumEmptyWindALBuffers; i++)
{
ALuint buffer;
alGetError(); /* clear error */
alGenBuffers(1,&buffer);
if((error=alGetError()) != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() Error creating wind buffer: " << error << llendl;
break;
}
alBufferData(buffer,
AL_FORMAT_STEREO16,
mWindGen->windGenerate(mWindBuf,
mWindBufSamples),
mWindBufBytes,
mWindBufFreq);
alBufferData(buffers[i],
AL_FORMAT_STEREO16,
mWindGen->windGenerate(mWindBuf,
mWindBufSamples),
mWindBufBytes,
mWindBufFreq);
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (bufferdata) buffers" << llendl;
errors++;
}
alSourceQueueBuffers(mWindSource, 1, &buffer);
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl;
}
--mNumEmptyWindALBuffers;
}
//queue the buffers
alSourceQueueBuffers(mWindSource, mNumEmptyWindALBuffers, &buffers[0]);
error = alGetError();
if(error != AL_NO_ERROR)
{
llwarns << "LLAudioEngine_OpenAL::updateWind() error swapping (queuing) buffers" << llendl;
}
mNumEmptyWindALBuffers = errors;
// We dont need to keep track of the buffers' id now.
delete[] buffers;
buffers = NULL;
//restart playing if not playing
ALint playing;
alGetSourcei(mWindSource, AL_SOURCE_STATE, &playing);
if(playing != AL_PLAYING)

View File

@@ -72,8 +72,8 @@ class LLAudioEngine_OpenAL : public LLAudioEngine
ALuint mWindSource;
int mNumEmptyWindALBuffers;
static const int MAX_NUM_WIND_BUFFERS = 80;
static const float WIND_BUFFER_SIZE_SEC = 0.05f; // 1/20th sec
static const int MAX_NUM_WIND_BUFFERS = 80;
static const float WIND_BUFFER_SIZE_SEC; // 1/20th sec
};
class LLAudioChannelOpenAL : public LLAudioChannel

View File

@@ -226,7 +226,7 @@ void LLSingleton<DERIVED_TYPE>::createInstance(SingletonInstanceData& data)
if (data.mInitState == INITIALIZING)
{
lldebugs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from initSingleton(), using half-initialized object" << llendl;
llerrs << "Tried to access singleton " << typeid(DERIVED_TYPE).name() << " from initSingleton(), using half-initialized object" << llendl;
return;
}

View File

@@ -48,7 +48,7 @@
// Locally used constants
//
const U32 SEC_PER_DAY = 86400;
const F64 SEC_TO_MICROSEC = 1000000.f;
const F64 SEC_TO_MICROSEC = 1000000.0;
const U64 SEC_TO_MICROSEC_U64 = 1000000;
const F64 USEC_TO_SEC_F64 = 0.000001;

View File

@@ -1,46 +0,0 @@
/*
* LLCalcParser.cpp
* SecondLife
*
* Created by Aimee Walton on 28/09/2008.
* Copyright 2008 Aimee Walton.
*
*/
#include "linden_common.h"
#include "llcalcparser.h"
using namespace boost::spirit::classic;
F32 LLCalcParser::lookup(const std::string::iterator& start, const std::string::iterator& end) const
{
LLCalc::calc_map_t::iterator iter;
std::string name(start, end);
if (mConstants)
{
iter = mConstants->find(name);
if (iter != mConstants->end())
{
return (*iter).second;
}
}
else
{
// This should never happen!
throw_(end, std::string("Missing constants table"));
}
if (mVariables)
{
iter = mVariables->find(name);
if (iter != mVariables->end())
{
return (*iter).second;
}
}
throw_(end, std::string("Unknown symbol " + name));
return 0.f;
}

View File

@@ -40,7 +40,7 @@
class AIHTTPHeaders;
class AICurlEasyRequestStateMachine;
class AITransferInfo;
struct AITransferInfo;
namespace AICurlPrivate {
@@ -406,8 +406,8 @@ class BufferedCurlEasyRequest : public CurlEasyRequest {
//U32 mBodyLimit; // From the old LLURLRequestDetail::mBodyLimit, but never used.
U32 mStatus; // HTTP status, decoded from the first header line.
std::string mReason; // The "reason" from the same header line.
S32 mRequestTransferedBytes;
S32 mResponseTransferedBytes;
U32 mRequestTransferedBytes;
U32 mResponseTransferedBytes;
AIBufferedCurlEasyRequestEvents* mBufferEventsTarget;
public:

View File

@@ -89,6 +89,9 @@ class AIHTTPTimeoutPolicy {
U16 curl_transaction,
U16 total_delay);
// Destructor.
virtual ~AIHTTPTimeoutPolicy() { }
void sanity_checks(void) const;
// Accessors.

View File

@@ -315,11 +315,11 @@ LLAlertDialog::LLAlertDialog( LLNotificationPtr notification, bool modal)
if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_DEFAULT_RESPONSE)
{
setCheckBox(LLNotifications::instance().getGlobalString("skipnexttime"), ignore_label);
setCheckBox(LLNotificationTemplates::instance().getGlobalString("skipnexttime"), ignore_label);
}
else if (form->getIgnoreType() == LLNotificationForm::IGNORE_WITH_LAST_RESPONSE)
{
setCheckBox(LLNotifications::instance().getGlobalString("alwayschoose"), ignore_label);
setCheckBox(LLNotificationTemplates::instance().getGlobalString("alwayschoose"), ignore_label);
}
}

View File

@@ -100,10 +100,10 @@ private:
for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it)
{
if (!LLNotifications::instance().templateExists((*it)->getName())) continue;
if (!LLNotificationTemplates::instance().templateExists((*it)->getName())) continue;
// only store notifications flagged as persisting
LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate((*it)->getName());
LLNotificationTemplatePtr templatep = LLNotificationTemplates::instance().getTemplate((*it)->getName());
if (!templatep->mPersist) continue;
data.append((*it)->asLLSD());
@@ -228,7 +228,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLXMLNodeP
LLXMLNodePtr child = xml_node->getFirstChild();
while(child)
{
child = LLNotifications::instance().checkForXMLTemplate(child);
child = LLNotificationTemplates::instance().checkForXMLTemplate(child);
LLSD item_entry;
std::string element_name = child->getName()->mString;
@@ -662,7 +662,7 @@ bool LLNotification::isEquivalentTo(LLNotificationPtr that) const
void LLNotification::init(const std::string& template_name, const LLSD& form_elements)
{
mTemplatep = LLNotifications::instance().getTemplate(template_name);
mTemplatep = LLNotificationTemplates::instance().getTemplate(template_name);
if (!mTemplatep) return;
const LLStringUtil::format_map_t& default_args = LLTrans::getDefaultArgs();
@@ -1098,12 +1098,19 @@ LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelN
return p->second;
}
// this function is called once at construction time, after the object is constructed.
void LLNotificationTemplates::initSingleton()
{
loadTemplates();
}
// this function is called once at construction time, after the object is constructed.
void LLNotifications::initSingleton()
{
loadTemplates();
createDefaultChannels();
loadNotifications();
// Cannot create default channels here, since that recursively accesses the singleton.
// Instead we call createDefaultChannels() from LLAppViewer::init().
//createDefaultChannels();
}
void LLNotifications::createDefaultChannels()
@@ -1142,7 +1149,7 @@ void LLNotifications::createDefaultChannels()
static std::string sStringSkipNextTime("Skip this dialog next time");
static std::string sStringAlwaysChoose("Always choose this option");
bool LLNotifications::addTemplate(const std::string &name,
bool LLNotificationTemplates::addTemplate(const std::string &name,
LLNotificationTemplatePtr theTemplate)
{
if (mTemplates.count(name))
@@ -1154,7 +1161,7 @@ bool LLNotifications::addTemplate(const std::string &name,
return true;
}
LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
LLNotificationTemplatePtr LLNotificationTemplates::getTemplate(const std::string& name)
{
if (mTemplates.count(name))
{
@@ -1166,12 +1173,12 @@ LLNotificationTemplatePtr LLNotifications::getTemplate(const std::string& name)
}
}
bool LLNotifications::templateExists(const std::string& name)
bool LLNotificationTemplates::templateExists(const std::string& name)
{
return (mTemplates.count(name) != 0);
}
void LLNotifications::clearTemplates()
void LLNotificationTemplates::clearTemplates()
{
mTemplates.clear();
}
@@ -1192,7 +1199,7 @@ void LLNotifications::forceResponse(const LLNotification::Params& params, S32 op
temp_notify->respond(response);
}
LLNotifications::TemplateNames LLNotifications::getTemplateNames() const
LLNotificationTemplates::TemplateNames LLNotificationTemplates::getTemplateNames() const
{
TemplateNames names;
for (TemplateMap::const_iterator it = mTemplates.begin(); it != mTemplates.end(); ++it)
@@ -1242,7 +1249,7 @@ void replaceSubstitutionStrings(LLXMLNodePtr node, StringMap& replacements)
// returns true if the template request was invalid and there's nothing else we
// can do with this node, false if you should keep processing (it may have
// replaced the contents of the node referred to)
LLXMLNodePtr LLNotifications::checkForXMLTemplate(LLXMLNodePtr item)
LLXMLNodePtr LLNotificationTemplates::checkForXMLTemplate(LLXMLNodePtr item)
{
if (item->hasName("usetemplate"))
{
@@ -1271,7 +1278,7 @@ LLXMLNodePtr LLNotifications::checkForXMLTemplate(LLXMLNodePtr item)
return item;
}
bool LLNotifications::loadTemplates()
bool LLNotificationTemplates::loadTemplates()
{
const std::string xml_filename = "notifications.xml";
LLXMLNodePtr root;
@@ -1289,11 +1296,6 @@ bool LLNotifications::loadTemplates()
for (LLXMLNodePtr item = root->getFirstChild();
item.notNull(); item = item->getNextSibling())
{
// we do this FIRST so that item can be changed if we
// encounter a usetemplate -- we just replace the
// current xml node and keep processing
item = checkForXMLTemplate(item);
if (item->hasName("global"))
{
std::string global_name;
@@ -1321,7 +1323,35 @@ bool LLNotifications::loadTemplates()
" found in " << xml_filename << llendl;
continue;
}
}
return true;
}
bool LLNotifications::loadNotifications()
{
const std::string xml_filename = "notifications.xml";
LLXMLNodePtr root;
BOOL success = LLUICtrlFactory::getLayeredXMLNode(xml_filename, root);
if (!success || root.isNull() || !root->hasName( "notifications" ))
{
llerrs << "Problem reading UI Notifications file: " << xml_filename << llendl;
return false;
}
for (LLXMLNodePtr item = root->getFirstChild();
item.notNull(); item = item->getNextSibling())
{
// we do this FIRST so that item can be changed if we
// encounter a usetemplate -- we just replace the
// current xml node and keep processing
item = LLNotificationTemplates::instance().checkForXMLTemplate(item);
if (!item->hasName("notification"))
continue;
// now we know we have a notification entry, so let's build it
LLNotificationTemplatePtr pTemplate(new LLNotificationTemplate());
@@ -1369,7 +1399,7 @@ bool LLNotifications::loadTemplates()
for (LLXMLNodePtr child = item->getFirstChild();
!child.isNull(); child = child->getNextSibling())
{
child = checkForXMLTemplate(child);
child = LLNotificationTemplates::instance().checkForXMLTemplate(child);
// <url>
if (child->hasName("url"))
@@ -1405,7 +1435,7 @@ bool LLNotifications::loadTemplates()
pTemplate->mForm = LLNotificationFormPtr(new LLNotificationForm(pTemplate->mName, child));
}
}
addTemplate(pTemplate->mName, pTemplate);
LLNotificationTemplates::instance().addTemplate(pTemplate->mName, pTemplate);
}
//std::ostringstream ostream;
@@ -1485,7 +1515,7 @@ void LLNotifications::update(const LLNotificationPtr pNotif)
}
LLNotificationPtr LLNotifications::find(LLUUID uuid)
LLNotificationPtr LLNotifications::find(LLUUID const& uuid)
{
LLNotificationPtr target = LLNotificationPtr(new LLNotification(uuid));
LLNotificationSet::iterator it=mItems.find(target);
@@ -1505,7 +1535,7 @@ void LLNotifications::forEachNotification(NotificationProcess process)
std::for_each(mItems.begin(), mItems.end(), process);
}
std::string LLNotifications::getGlobalString(const std::string& key) const
std::string LLNotificationTemplates::getGlobalString(const std::string& key) const
{
GlobalStringMap::const_iterator it = mGlobalStrings.find(key);
if (it != mGlobalStrings.end())

View File

@@ -679,45 +679,20 @@ private:
LLNotificationComparator mComparator;
};
class LLNotifications :
public LLSingleton<LLNotifications>,
public LLNotificationChannelBase
class LLNotificationTemplates :
public LLSingleton<LLNotificationTemplates>
{
LOG_CLASS(LLNotifications);
LOG_CLASS(LLNotificationTemplates);
friend class LLSingleton<LLNotificationTemplates>;
// This class may not use LLNotifications.
typedef char LLNotifications;
friend class LLSingleton<LLNotifications>;
public:
// load notification descriptions from file;
// OK to call more than once because it will reload
bool loadTemplates();
LLXMLNodePtr checkForXMLTemplate(LLXMLNodePtr item);
// we provide a collection of simple add notification functions so that it's reasonable to create notifications in one line
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions = LLSD(),
const LLSD& payload = LLSD());
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions,
const LLSD& payload,
const std::string& functor_name);
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions,
const LLSD& payload,
LLNotificationFunctorRegistry::ResponseFunctor functor);
LLNotificationPtr add(const LLNotification::Params& p);
void add(const LLNotificationPtr pNotif);
void cancel(LLNotificationPtr pNotif);
void update(const LLNotificationPtr pNotif);
LLNotificationPtr find(LLUUID uuid);
typedef boost::function<void (LLNotificationPtr)> NotificationProcess;
void forEachNotification(NotificationProcess process);
// This is all stuff for managing the templates
// take your template out
LLNotificationTemplatePtr getTemplate(const std::string& name);
@@ -736,17 +711,67 @@ public:
// useful if you're reloading the file
void clearTemplates(); // erase all templates
void forceResponse(const LLNotification::Params& params, S32 option);
// put your template in (should only be called from LLNotifications).
bool addTemplate(const std::string& name, LLNotificationTemplatePtr theTemplate);
std::string getGlobalString(const std::string& key) const;
private:
// we're a singleton, so we don't have a public constructor
LLNotificationTemplates() { }
/*virtual*/ void initSingleton();
TemplateMap mTemplates;
typedef std::map<std::string, LLXMLNodePtr> XMLTemplateMap;
XMLTemplateMap mXmlTemplates;
typedef std::map<std::string, std::string> GlobalStringMap;
GlobalStringMap mGlobalStrings;
};
class LLNotifications :
public LLSingleton<LLNotifications>,
public LLNotificationChannelBase
{
LOG_CLASS(LLNotifications);
friend class LLSingleton<LLNotifications>;
public:
// load notification descriptions from file;
// OK to call more than once because it will reload
bool loadNotifications();
void createDefaultChannels();
// we provide a collection of simple add notification functions so that it's reasonable to create notifications in one line
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions = LLSD(),
const LLSD& payload = LLSD());
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions,
const LLSD& payload,
const std::string& functor_name);
LLNotificationPtr add(const std::string& name,
const LLSD& substitutions,
const LLSD& payload,
LLNotificationFunctorRegistry::ResponseFunctor functor);
LLNotificationPtr add(const LLNotification::Params& p);
void forceResponse(const LLNotification::Params& params, S32 option);
typedef std::map<std::string, LLNotificationChannelPtr> ChannelMap;
ChannelMap mChannels;
void addChannel(LLNotificationChannelPtr pChan);
LLNotificationChannelPtr getChannel(const std::string& channelName);
void add(const LLNotificationPtr pNotif);
void cancel(LLNotificationPtr pNotif);
void update(const LLNotificationPtr pNotif);
LLNotificationPtr find(LLUUID const& uuid);
std::string getGlobalString(const std::string& key) const;
typedef boost::function<void (LLNotificationPtr)> NotificationProcess;
void forEachNotification(NotificationProcess process);
private:
// we're a singleton, so we don't have a public constructor
@@ -760,22 +785,11 @@ private:
bool uniqueFilter(LLNotificationPtr pNotification);
bool uniqueHandler(const LLSD& payload);
bool failedUniquenessTest(const LLSD& payload);
LLNotificationChannelPtr pHistoryChannel;
LLNotificationChannelPtr pExpirationChannel;
// put your template in
bool addTemplate(const std::string& name, LLNotificationTemplatePtr theTemplate);
TemplateMap mTemplates;
std::string mFileName;
typedef std::map<std::string, LLXMLNodePtr> XMLTemplateMap;
XMLTemplateMap mXmlTemplates;
LLNotificationMap mUniqueNotifications;
typedef std::map<std::string, std::string> GlobalStringMap;
GlobalStringMap mGlobalStrings;
};

View File

@@ -483,7 +483,6 @@ static void settings_to_globals()
LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile");
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures");
LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
@@ -714,7 +713,7 @@ bool LLAppViewer::init()
LLTrans::parseStrings("strings.xml", default_trans_args);
// Setup notifications after LLUI::initClass() has been called.
LLNotifications::instance();
LLNotifications::instance().createDefaultChannels();
LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ;
writeSystemInfo();
@@ -876,7 +875,7 @@ bool LLAppViewer::init()
{
// can't use an alert here since we're exiting and
// all hell breaks lose.
std::string msg = LLNotifications::instance().getGlobalString("UnsupportedGLRequirements");
std::string msg = LLNotificationTemplates::instance().getGlobalString("UnsupportedGLRequirements");
LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox(
msg,
@@ -891,7 +890,7 @@ bool LLAppViewer::init()
{
// can't use an alert here since we're exiting and
// all hell breaks lose.
std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2");
std::string msg = LLNotificationTemplates::instance().getGlobalString("UnsupportedCPUSSE2");
LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox(
msg,
@@ -905,7 +904,7 @@ bool LLAppViewer::init()
{
// can't use an alert here since we're exiting and
// all hell breaks lose.
std::string msg = LNotifications::instance().getGlobalString("UnsupportedCPUSSE2");
std::string msg = LNotificationTemplates::instance().getGlobalString("UnsupportedCPUSSE2");
LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox(
msg,
@@ -923,31 +922,31 @@ bool LLAppViewer::init()
std::string minSpecs;
// get cpu data from xml
std::stringstream minCPUString(LLNotifications::instance().getGlobalString("UnsupportedCPUAmount"));
std::stringstream minCPUString(LLNotificationTemplates::instance().getGlobalString("UnsupportedCPUAmount"));
S32 minCPU = 0;
minCPUString >> minCPU;
// get RAM data from XML
std::stringstream minRAMString(LLNotifications::instance().getGlobalString("UnsupportedRAMAmount"));
std::stringstream minRAMString(LLNotificationTemplates::instance().getGlobalString("UnsupportedRAMAmount"));
U64 minRAM = 0;
minRAMString >> minRAM;
minRAM = minRAM * 1024 * 1024;
if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
{
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedGPU");
minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedGPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysCPU.getMHz() < minCPU)
{
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU");
minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedCPU");
minSpecs += "\n";
unsupported = true;
}
if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
{
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM");
minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedRAM");
minSpecs += "\n";
unsupported = true;
}
@@ -980,6 +979,11 @@ bool LLAppViewer::init()
LLViewerJoystick::getInstance()->init(false);
// Finish windlight initialization.
LLWLParamManager::instance().initHack();
// Use prefered Environment.
LLEnvManagerNew::instance().usePrefs();
gGLActive = FALSE;
return true;
}

View File

@@ -484,8 +484,8 @@ void LLFastTimerView::draw()
sTimerColors[&LLFastTimer::NamedTimer::getRootNamedTimer()] = LLColor4::grey;
F32 hue = 0.f;
for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer());
// <ALCH:LL> Move color generation down to be in the next loop.
/*for (timer_tree_iterator_t it = begin_timer_tree(LLFastTimer::NamedTimer::getRootNamedTimer());
it != timer_tree_iterator_t();
++it)
{
@@ -502,7 +502,8 @@ void LLFastTimerView::draw()
child_color.setHSL(hue, saturation, lightness);
sTimerColors[idp] = child_color;
}
}*/
// </ALCH:LL>
const S32 LEGEND_WIDTH = 220;
{
@@ -516,6 +517,20 @@ void LLFastTimerView::draw()
++it)
{
LLFastTimer::NamedTimer* idp = (*it);
// <ALCH:LL> Move color generation down to be in the next loop.
const F32 HUE_INCREMENT = 0.23f;
hue = fmodf(hue + HUE_INCREMENT, 1.f);
// saturation increases with depth
F32 saturation = clamp_rescale((F32)idp->getDepth(), 0.f, 3.f, 0.f, 1.f);
// lightness alternates with depth
F32 lightness = idp->getDepth() % 2 ? 0.5f : 0.6f;
LLColor4 child_color;
child_color.setHSL(hue, saturation, lightness);
sTimerColors[idp] = child_color;
// </ALCH:LL>
// <FS:LO> Making the ledgend part of fast timers scrollable
if(mScrollOffset_tmp)
{

View File

@@ -165,7 +165,7 @@ void LLFloaterDisplayName::onCacheSetName(bool success,
// We might have a localized string for this message
// error_args will usually be empty from the server.
if (!error_tag.empty()
&& LLNotifications::getInstance()->templateExists(error_tag))
&& LLNotificationTemplates::getInstance()->templateExists(error_tag))
{
LLNotifications::instance().add(error_tag);
return;

View File

@@ -187,8 +187,8 @@ BOOL LLFloaterNotificationConsole::postBuild()
getChild<LLButton>("add_notification")->setClickedCallback(onClickAdd, this);
LLComboBox* notifications = getChild<LLComboBox>("notification_types");
LLNotifications::TemplateNames names = LLNotifications::instance().getTemplateNames();
for (LLNotifications::TemplateNames::iterator template_it = names.begin();
LLNotificationTemplates::TemplateNames names = LLNotificationTemplates::instance().getTemplateNames();
for (LLNotificationTemplates::TemplateNames::iterator template_it = names.begin();
template_it != names.end();
++template_it)
{

View File

@@ -107,13 +107,20 @@ LLPanelDirBrowser::LLPanelDirBrowser(const std::string& name, LLFloaterDirectory
BOOL LLPanelDirBrowser::postBuild()
{
childSetCommitCallback("results", onCommitList, this);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("results"))
ctrl->setCommitCallback(onCommitList, this);
childSetAction("< Prev", onClickPrev, this);
childHide("< Prev");
if (LLButton* btn = findChild<LLButton>("< Prev"))
{
childSetAction("< Prev", onClickPrev, this);
btn->setVisible(false);
}
childSetAction("Next >", onClickNext, this);
childHide("Next >");
if (LLButton* btn = findChild<LLButton>("Next >"))
{
childSetAction("Next >", onClickNext, this);
btn->setVisible(false);
}
return TRUE;
}
@@ -136,7 +143,7 @@ void LLPanelDirBrowser::draw()
if (mLastResultTimer.getElapsedTimeF32() > 0.5)
{
if (!mDidAutoSelect &&
!childHasFocus("results"))
hasChild("results") && !childHasFocus("results"))
{
LLCtrlListInterface *list = childGetListInterface("results");
if (list)
@@ -171,7 +178,8 @@ void LLPanelDirBrowser::nextPage()
void LLPanelDirBrowser::prevPage()
{
mSearchStart -= mResultsPerPage;
childSetVisible("< Prev", mSearchStart > 0);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("< Prev"))
ctrl->setVisible(mSearchStart > 0);
performQuery();
}
@@ -180,14 +188,17 @@ void LLPanelDirBrowser::prevPage()
void LLPanelDirBrowser::resetSearchStart()
{
mSearchStart = 0;
childHide("Next >");
childHide("< Prev");
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Next >"))
ctrl->setVisible(false);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("< Prev"))
ctrl->setVisible(false);
}
// protected
void LLPanelDirBrowser::updateResultCount()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
if (!list) return;
S32 result_count = list->getItemCount();
std::string result_text;
@@ -218,7 +229,7 @@ void LLPanelDirBrowser::updateResultCount()
}
else
{
childEnable("results");
list->setEnabled(true);
}
}
@@ -319,7 +330,7 @@ void LLPanelDirBrowser::updateMaturityCheckbox()
void LLPanelDirBrowser::selectByUUID(const LLUUID& id)
{
LLCtrlListInterface *list = childGetListInterface("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
if (!list) return;
BOOL found = list->setCurrentByID(id);
if (found)
@@ -363,7 +374,7 @@ U32 LLPanelDirBrowser::getSelectedEventID() const
void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type)
{
LLCtrlListInterface *list = childGetListInterface("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
if (!list) return;
LLSD id_sd = childGetValue("results");
@@ -379,7 +390,7 @@ void LLPanelDirBrowser::getSelectedInfo(LLUUID* id, S32 *type)
void LLPanelDirBrowser::onCommitList(LLUICtrl* ctrl, void* data)
{
LLPanelDirBrowser* self = (LLPanelDirBrowser*)data;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
// Start with everyone invisible
@@ -515,7 +526,7 @@ void LLPanelDirBrowser::processDirPeopleReply(LLMessageSystem *msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -610,7 +621,7 @@ void LLPanelDirBrowser::processDirPlacesReply(LLMessageSystem* msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -696,7 +707,7 @@ void LLPanelDirBrowser::processDirEventsReply(LLMessageSystem* msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -835,7 +846,7 @@ void LLPanelDirBrowser::processDirGroupsReply(LLMessageSystem* msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -932,7 +943,7 @@ void LLPanelDirBrowser::processDirClassifiedReply(LLMessageSystem* msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -1005,7 +1016,7 @@ void LLPanelDirBrowser::processDirLandReply(LLMessageSystem *msg, void**)
self->mHaveSearchResults = TRUE;
LLCtrlListInterface *list = self->childGetListInterface("results");
LLScrollListCtrl* list = self->findChild<LLScrollListCtrl>("results");
if (!list) return;
if (!list->getCanSelect())
@@ -1184,7 +1195,7 @@ LLSD LLPanelDirBrowser::createLandSale(const LLUUID& parcel_id, BOOL is_auction,
void LLPanelDirBrowser::newClassified()
{
LLCtrlListInterface *list = childGetListInterface("results");
LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results");
if (!list) return;
if (mFloaterDirectory->mPanelClassifiedp)
@@ -1212,8 +1223,6 @@ void LLPanelDirBrowser::newClassified()
void LLPanelDirBrowser::setupNewSearch()
{
LLScrollListCtrl* list = getChild<LLScrollListCtrl>("results");
gDirBrowserInstances.removeData(mSearchID);
// Make a new query ID
mSearchID.generate();
@@ -1221,9 +1230,12 @@ void LLPanelDirBrowser::setupNewSearch()
gDirBrowserInstances.addData(mSearchID, this);
// ready the list for results
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->setCommentText(LLTrans::getString("Searching"));
childDisable("results");
if (LLScrollListCtrl* list = findChild<LLScrollListCtrl>("results"))
{
list->operateOnAll(LLCtrlListInterface::OP_DELETE);
list->setCommentText(LLTrans::getString("Searching"));
list->setEnabled(false);
}
mResultsReceived = 0;
mHaveSearchResults = FALSE;

View File

@@ -75,8 +75,6 @@ BOOL LLPanelDirEvents::postBuild()
childSetAction("Today", onClickToday, this);
childSetCommitCallback("mature", onCommitMature, this);
childSetAction("Search", LLPanelDirBrowser::onClickSearchCore, this);
setDefaultBtn("Search");
@@ -296,14 +294,6 @@ void LLPanelDirEvents::onForwardBtn(void* data)
}
// static
void LLPanelDirEvents::onCommitMature(LLUICtrl* ctrl, void* data)
{
// just perform another search
onClickSearchCore(data);
}
// static
void LLPanelDirEvents::onClickDelete(void *userdata)
{

View File

@@ -61,7 +61,6 @@ protected:
static void onBackBtn(void* data);
static void onForwardBtn(void* data);
static void onClickToday(void *userdata);
static void onCommitMature(LLUICtrl* ctrl, void* data);
static void onClickSearch(void *data);
static void onClickDelete(void *data);

View File

@@ -108,12 +108,16 @@ BOOL LLPanelDirFind::postBuild()
LLPanelDirBrowser::postBuild();
childSetAction("back_btn", onClickBack, this);
childSetAction("home_btn", onClickHome, this);
if (hasChild("home_btn"))
childSetAction("home_btn", onClickHome, this);
childSetAction("forward_btn", onClickForward, this);
childSetAction("reload_btn", onClickRefresh, this);
childSetCommitCallback("search_editor", onCommitSearch, this);
childSetAction("search_btn", onClickSearch, this);
childSetAction("?", onClickHelp, this);
if (hasChild("search_editor"))
childSetCommitCallback("search_editor", onCommitSearch, this);
if (hasChild("search_btn"))
childSetAction("search_btn", onClickSearch, this);
if (hasChild("?"))
childSetAction("?", onClickHelp, this);
// showcase doesn't have maturity flags -- it's all PG
if (hasChild("incmature"))
@@ -161,7 +165,8 @@ BOOL LLPanelDirFind::postBuild()
navigateToDefaultPage();
}
childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL));
if (LLUICtrl* ctrl = findChild<LLUICtrl>("filter_gaming"))
ctrl->setVisible((gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL));
return TRUE;
}
@@ -257,7 +262,8 @@ void LLPanelDirFindAll::search(const std::string& search_text)
void LLPanelDirFind::focus()
{
childSetFocus("search_editor");
if (hasChild("search_editor"))
childSetFocus("search_editor");
}
void LLPanelDirFind::navigateToDefaultPage()
@@ -291,17 +297,20 @@ void LLPanelDirFind::navigateToDefaultPage()
start_url += "panel=" + getName() + "&";
}
BOOL inc_pg = childGetValue("incpg").asBoolean();
BOOL inc_mature = childGetValue("incmature").asBoolean();
BOOL inc_adult = childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
if (hasChild("incmature"))
{
// if nothing's checked, just go for pg; we don't notify in
// this case because it's a default page.
inc_pg = true;
}
bool inc_pg = childGetValue("incpg").asBoolean();
bool inc_mature = childGetValue("incmature").asBoolean();
bool inc_adult = childGetValue("incadult").asBoolean();
if (!(inc_pg || inc_mature || inc_adult))
{
// if nothing's checked, just go for pg; we don't notify in
// this case because it's a default page.
inc_pg = true;
}
start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true);
start_url += getSearchURLSuffix(inc_pg, inc_mature, inc_adult, true);
}
}
llinfos << "default web search url: " << start_url << llendl;
@@ -433,7 +442,7 @@ const std::string LLPanelDirFind::getSearchURLSuffix(bool inc_pg, bool inc_matur
if (!gHippoGridManager->getConnectedGrid()->isSecondLife())
{
substring = "[DICE]";
url.replace(url.find(substring), substring.length(), childGetValue("filter_gaming").asBoolean() ? "y" : "n");
url.replace(url.find(substring), substring.length(), (hasChild("filter_gaming") && childGetValue("filter_gaming").asBoolean()) ? "y" : "n");
}
}
}
@@ -570,7 +579,8 @@ BOOL LLPanelDirFindAllOld::postBuild()
childDisable("Search");
setDefaultBtn( "Search" );
childSetVisible("filter_gaming", (gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL_CLASSIC));
if (LLUICtrl* ctrl = findChild<LLUICtrl>("filter_gaming"))
ctrl->setVisible((gAgent.getRegion()->getGamingFlags() & REGION_GAMING_PRESENT) && !(gAgent.getRegion()->getGamingFlags() & REGION_GAMING_HIDE_FIND_ALL_CLASSIC));
return TRUE;
}
@@ -634,7 +644,7 @@ void LLPanelDirFindAllOld::onClickSearch(void *userdata)
scope |= DFQ_INC_ADULT;
}
if (self->childGetValue("filter_gaming").asBoolean())
if (self->hasChild("filter_gaming") && self->childGetValue("filter_gaming").asBoolean())
{
scope |= DFQ_FILTER_GAMING;
}

View File

@@ -103,7 +103,6 @@ BOOL LLPanelDirLand::postBuild()
childSetAction("Search", onClickSearchCore, this);
setDefaultBtn("Search");
childSetTextArg("land", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
childSetTextArg("pricecheck_symbol", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());
childSetLabelArg("pricecheck", "[CURRENCY]", gHippoGridManager->getConnectedGrid()->getCurrencySymbol());

View File

@@ -69,7 +69,7 @@ BOOL LLPanelGroupTab::isVisibleByAgent(LLAgent* agentp)
BOOL LLPanelGroupTab::postBuild()
{
// Hook up the help button callback.
LLButton* button = getChild<LLButton>("help_button");
LLButton* button = findChild<LLButton>("help_button");
if (button)
{
button->setClickedCallback(boost::bind(&LLPanelGroupTab::onClickHelp,this));

View File

@@ -515,7 +515,7 @@ BOOL LLPanelGroupSubTab::postBuild()
delete icon;
}
icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse);
icon = getChild<LLIconCtrl>("power_all_have_icon",no_recurse, false);
if (icon && !icon->getImageName().empty())
{
mActionIcons["full"] = icon->getImageName();
@@ -523,7 +523,7 @@ BOOL LLPanelGroupSubTab::postBuild()
delete icon;
}
icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse);
icon = getChild<LLIconCtrl>("power_partial_icon",no_recurse, false);
if (icon && !icon->getImageName().empty())
{
mActionIcons["partial"] = icon->getImageName();

View File

@@ -83,8 +83,8 @@ void LLPanelMsgs::buildLists() //void LLFloaterPreference::buildPopupLists() in
disabled_popups.deleteAllItems();
enabled_popups.deleteAllItems();
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
for (LLNotificationTemplates::TemplateMap::const_iterator iter = LLNotificationTemplates::instance().templatesBegin();
iter != LLNotificationTemplates::instance().templatesEnd();
++iter)
{
LLNotificationTemplatePtr templatep = iter->second;
@@ -175,8 +175,8 @@ void LLPanelMsgs::cancel()
void LLPanelMsgs::resetAllIgnored()
{
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
for (LLNotificationTemplates::TemplateMap::const_iterator iter = LLNotificationTemplates::instance().templatesBegin();
iter != LLNotificationTemplates::instance().templatesEnd();
++iter)
{
if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
@@ -188,8 +188,8 @@ void LLPanelMsgs::resetAllIgnored()
void LLPanelMsgs::setAllIgnored()
{
for (LLNotifications::TemplateMap::const_iterator iter = LLNotifications::instance().templatesBegin();
iter != LLNotifications::instance().templatesEnd();
for (LLNotificationTemplates::TemplateMap::const_iterator iter = LLNotificationTemplates::instance().templatesBegin();
iter != LLNotificationTemplates::instance().templatesEnd();
++iter)
{
if (iter->second->mForm->getIgnoreType() != LLNotificationForm::IGNORE_NO)
@@ -210,7 +210,7 @@ void LLPanelMsgs::onClickEnablePopup(void* user_data)
std::vector<LLScrollListItem*>::iterator itor;
for (itor = items.begin(); itor != items.end(); ++itor)
{
LLNotificationTemplatePtr templatep = LLNotifications::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
LLNotificationTemplatePtr templatep = LLNotificationTemplates::instance().getTemplate(*(std::string*)((*itor)->getUserdata()));
gSavedSettings.setWarning(templatep->mName, TRUE);
}

View File

@@ -97,7 +97,7 @@ BOOL LLPanelPlace::postBuild()
mDescEditor = getChild<LLTextEditor>("desc_editor");
mInfoEditor = getChild<LLTextBox>("info_editor");
mLandTypeEditor = getChild<LLTextBox>("land_type_display");
mLandTypeEditor = findChild<LLTextBox>("land_type_display");
mLocationDisplay = getChild<LLTextBox>("location_editor");
@@ -145,7 +145,8 @@ void LLPanelPlace::resetLocation()
mNameEditor->setText( LLStringUtil::null );
mDescEditor->setText( LLStringUtil::null );
mInfoEditor->setText( LLStringUtil::null );
mLandTypeEditor->setText( LLStringUtil::null );
if (mLandTypeEditor)
mLandTypeEditor->setText(LLStringUtil::null);
mLocationDisplay->setText( LLStringUtil::null );
}
@@ -198,7 +199,8 @@ void LLPanelPlace::setLocationString(const std::string& location)
void LLPanelPlace::setLandTypeString(const std::string& land_type)
{
mLandTypeEditor->setText(land_type);
if (mLandTypeEditor)
mLandTypeEditor->setText(land_type);
}
void LLPanelPlace::setErrorStatus(U32 status, const std::string& reason)

View File

@@ -126,7 +126,8 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
}
}
}
childSetAction("Save",onClickSave,this);
if (hasChild("Save", true))
childSetAction("Save",onClickSave,this);
// only assert shape if not hosted in a multifloater
if (!getHost())
@@ -135,18 +136,20 @@ LLPreviewNotecard::LLPreviewNotecard(const std::string& name,
setRect(curRect);
}
childSetVisible("lock", FALSE);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("lock"))
ctrl->setVisible(false);
const LLInventoryItem* item = getItem();
childSetCommitCallback("desc", LLPreview::onText, this);
if (item)
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
if (hasChild("desc", true))
{
childSetCommitCallback("desc", LLPreview::onText, this);
if (const LLInventoryItem* item = getItem())
childSetText("desc", item->getDescription());
childSetPrevalidate("desc", &LLLineEditor::prevalidatePrintableNotPipe);
}
setTitle(title);
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
@@ -166,7 +169,7 @@ LLPreviewNotecard::~LLPreviewNotecard()
BOOL LLPreviewNotecard::postBuild()
{
LLViewerTextEditor *ed = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* ed = findChild<LLViewerTextEditor>("Notecard Editor");
if (ed)
{
ed->setNotecardInfo(mNotecardItemID, mObjectID);
@@ -192,27 +195,27 @@ bool LLPreviewNotecard::saveItem(LLPointer<LLInventoryItem>* itemptr)
void LLPreviewNotecard::setEnabled( BOOL enabled )
{
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
childSetEnabled("Notecard Editor", enabled);
childSetVisible("lock", !enabled);
childSetEnabled("desc", enabled);
childSetEnabled("Save", enabled && editor && (!editor->isPristine()));
if (editor)
editor->setEnabled(enabled);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("lock"))
ctrl->setVisible(!enabled);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("desc"))
ctrl->setEnabled(enabled);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Save"))
ctrl->setEnabled(enabled && editor && !editor->isPristine());
}
void LLPreviewNotecard::draw()
{
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
BOOL script_changed = editor && !editor->isPristine();
//childSetFocus("Save", FALSE);
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
BOOL script_changed = !editor->isPristine();
childSetEnabled("Save", script_changed && getEnabled());
if (LLUICtrl* ctrl = findChild<LLUICtrl>("Save"))
ctrl->setEnabled(script_changed && getEnabled());
LLPreview::draw();
}
@@ -228,7 +231,7 @@ BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask)
if ('F' == key && (mask & MASK_CONTROL) && !(mask & (MASK_SHIFT | MASK_ALT)))
{
LLFloaterSearchReplace::show(getChild<LLViewerTextEditor>("Notecard Editor"));
LLFloaterSearchReplace::show(findChild<LLViewerTextEditor>("Notecard Editor"));
return TRUE;
}
@@ -238,9 +241,9 @@ BOOL LLPreviewNotecard::handleKeyHere(KEY key, MASK mask)
// virtual
BOOL LLPreviewNotecard::canClose()
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
if(mForceClose || editor->isPristine())
if (mForceClose || (editor && editor->isPristine()))
{
return TRUE;
}
@@ -255,9 +258,7 @@ BOOL LLPreviewNotecard::canClose()
const LLInventoryItem* LLPreviewNotecard::getDragItem()
{
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
if(editor)
if (LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor"))
{
return editor->getDragItem();
}
@@ -266,10 +267,9 @@ const LLInventoryItem* LLPreviewNotecard::getDragItem()
bool LLPreviewNotecard::hasEmbeddedInventory()
{
LLViewerTextEditor* editor = NULL;
editor = getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return false;
return editor->hasEmbeddedInventory();
if (LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->hasEmbeddedInventory();
return false;
}
void LLPreviewNotecard::refreshFromInventory()
@@ -280,15 +280,13 @@ void LLPreviewNotecard::refreshFromInventory()
void LLPreviewNotecard::loadAsset()
{
// request the asset.
const LLInventoryItem* item = getItem();
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
if (!editor)
return;
if(item)
// request the asset.
if (const LLInventoryItem* item = getItem())
{
if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),
GP_OBJECT_MANIPULATE)
@@ -355,7 +353,8 @@ void LLPreviewNotecard::loadAsset()
// <edit> You can always save in task inventory
if(!mObjectUUID.isNull()) editor->setEnabled(TRUE);
// </edit>
childSetVisible("lock", TRUE);
if (LLUICtrl* ctrl = findChild<LLUICtrl>("lock"))
ctrl->setVisible(true);
}
}
else
@@ -391,22 +390,23 @@ void LLPreviewNotecard::onLoadComplete(LLVFS *vfs,
buffer[file_length] = 0;
LLViewerTextEditor* previewEditor = preview->getChild<LLViewerTextEditor>("Notecard Editor");
if( (file_length > 19) && !strncmp( buffer, "Linden text version", 19 ) )
if (LLViewerTextEditor* previewEditor = preview->findChild<LLViewerTextEditor>("Notecard Editor"))
{
if( !previewEditor->importBuffer( buffer, file_length+1 ) )
if ((file_length > 19) && !strncmp(buffer, "Linden text version", 19))
{
llwarns << "Problem importing notecard" << llendl;
if (!previewEditor->importBuffer(buffer, file_length+1))
{
llwarns << "Problem importing notecard" << llendl;
}
}
else
{
// Version 0 (just text, doesn't include version number)
previewEditor->setText(LLStringExplicit(buffer));
}
}
else
{
// Version 0 (just text, doesn't include version number)
previewEditor->setText(LLStringExplicit(buffer));
}
previewEditor->makePristine();
previewEditor->makePristine();
}
const LLInventoryItem* item = preview->getItem();
BOOL modifiable = item && gAgent.allowOperation(PERM_MODIFY,
@@ -466,42 +466,37 @@ void LLPreviewNotecard::onClickSave(void* user_data)
// static
void LLPreviewNotecard::onClickGetItems(void* user_data)
{
LLPreviewNotecard* preview = (LLPreviewNotecard*)user_data;
if(preview)
LLPreviewNotecard* preview = static_cast<LLPreviewNotecard*>(user_data);
if (LLViewerTextEditor* editor = preview->findChild<LLViewerTextEditor>("Notecard Editor"))
{
LLViewerTextEditor* editor = preview->getChild<LLViewerTextEditor>("Notecard Editor");
if(editor)
std::vector<LLPointer<LLInventoryItem> > items = editor->getEmbeddedItems();
if (items.size())
{
std::vector<LLPointer<LLInventoryItem> > items = editor->getEmbeddedItems();
if(items.size())
std::vector<LLPointer<LLInventoryItem> >::iterator iter = items.begin();
std::vector<LLPointer<LLInventoryItem> >::iterator end = items.end();
for ( ; iter != end; ++iter)
{
const BOOL use_caps = FALSE;
std::vector<LLPointer<LLInventoryItem> >::iterator iter = items.begin();
std::vector<LLPointer<LLInventoryItem> >::iterator end = items.end();
for( ; iter != end; ++iter)
LLInventoryItem* item = static_cast<LLInventoryItem*>(*iter);
#if 0 //use_caps
{
LLInventoryItem* item = static_cast<LLInventoryItem*>(*iter);
if(use_caps)
{
copy_inventory_from_notecard(LLUUID::null, preview->getObjectID(), preview->getNotecardItemID(), item, 0);
}
else
{
// Only one item per message actually works
gMessageSystem->newMessageFast(_PREHASH_CopyInventoryFromNotecard);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_NotecardData);
gMessageSystem->addUUIDFast(_PREHASH_NotecardItemID, preview->getNotecardItemID());
gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID());
gMessageSystem->nextBlockFast(_PREHASH_InventoryData);
gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID());
gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())));
gAgent.sendReliableMessage();
}
copy_inventory_from_notecard(LLUUID::null, preview->getObjectID(), preview->getNotecardItemID(), item, 0);
}
#else
{
// Only one item per message actually works
gMessageSystem->newMessageFast(_PREHASH_CopyInventoryFromNotecard);
gMessageSystem->nextBlockFast(_PREHASH_AgentData);
gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
gMessageSystem->nextBlockFast(_PREHASH_NotecardData);
gMessageSystem->addUUIDFast(_PREHASH_NotecardItemID, preview->getNotecardItemID());
gMessageSystem->addUUIDFast(_PREHASH_ObjectID, preview->getObjectID());
gMessageSystem->nextBlockFast(_PREHASH_InventoryData);
gMessageSystem->addUUIDFast(_PREHASH_ItemID, item->getUUID());
gMessageSystem->addUUIDFast(_PREHASH_FolderID, gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(item->getType())));
gAgent.sendReliableMessage();
}
#endif
}
}
}
@@ -530,9 +525,9 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
}
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
if(!editor->isPristine())
if (editor && !editor->isPristine())
{
// We need to update the asset information
LLTransactionID tid;
@@ -602,8 +597,8 @@ bool LLPreviewNotecard::saveIfNeeded(LLInventoryItem* copyitem)
// static
void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data, S32 status, LLExtStat ext_status) // StoreAssetData callback (fixed)
{
LLSaveNotecardInfo* info = (LLSaveNotecardInfo*)user_data;
if(info && (0 == status))
LLSaveNotecardInfo* info = static_cast<LLSaveNotecardInfo*>(user_data);
if (0 == status)
{
if(info->mObjectUUID.isNull())
{
@@ -647,8 +642,7 @@ void LLPreviewNotecard::onSaveComplete(const LLUUID& asset_uuid, void* user_data
// Perform item copy to inventory
if (info->mCopyItem.notNull())
{
LLViewerTextEditor* editor = info->mSelf->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
if (LLViewerTextEditor* editor = info->mSelf->findChild<LLViewerTextEditor>("Notecard Editor"))
{
editor->copyInventory(info->mCopyItem);
}
@@ -741,10 +735,10 @@ void LLPreviewNotecard::saveAs_continued(AIFilePicker* filepicker)
if (!filepicker->hasFilename())
return;
LLViewerTextEditor* editor = getChild<LLViewerTextEditor>("Notecard Editor");
LLViewerTextEditor* editor = findChild<LLViewerTextEditor>("Notecard Editor");
std::string buffer;
if (!editor->exportBuffer(buffer))
if (editor && !editor->exportBuffer(buffer))
{
// FIXME: Notify the user!
return;
@@ -782,7 +776,7 @@ LLUUID LLPreviewNotecard::getItemID()
LLTextEditor* LLPreviewNotecard::getEditor()
{
return getChild<LLViewerTextEditor>("Notecard Editor");
return findChild<LLViewerTextEditor>("Notecard Editor");
}
void LLPreviewNotecard::initMenu()
@@ -823,183 +817,128 @@ void LLPreviewNotecard::initMenu()
// static
void LLPreviewNotecard::onSearchMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
LLFloaterSearchReplace::show(editor);
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
LLFloaterSearchReplace::show(editor);
}
// static
void LLPreviewNotecard::onUndoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->undo();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->undo();
}
// static
void LLPreviewNotecard::onRedoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->redo();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->redo();
}
// static
void LLPreviewNotecard::onCutMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->cut();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->cut();
}
// static
void LLPreviewNotecard::onCopyMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->copy();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->copy();
}
// static
void LLPreviewNotecard::onPasteMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->paste();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->paste();
}
// static
void LLPreviewNotecard::onSelectAllMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->selectAll();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->selectAll();
}
// static
void LLPreviewNotecard::onDeselectMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (self)
{
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (editor)
{
editor->deselect();
}
}
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
editor->deselect();
}
// static
BOOL LLPreviewNotecard::enableUndoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canUndo();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canUndo();
return false;
}
// static
BOOL LLPreviewNotecard::enableRedoMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canRedo();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canRedo();
return false;
}
// static
BOOL LLPreviewNotecard::enableCutMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canCut();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canCut();
return false;
}
// static
BOOL LLPreviewNotecard::enableCopyMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canCopy();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canCopy();
return false;
}
// static
BOOL LLPreviewNotecard::enablePasteMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canPaste();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canPaste();
return false;
}
// static
BOOL LLPreviewNotecard::enableSelectAllMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canSelectAll();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canSelectAll();
return false;
}
// static
BOOL LLPreviewNotecard::enableDeselectMenu(void* userdata)
{
LLPreviewNotecard* self = (LLPreviewNotecard*)userdata;
if (!self) return FALSE;
LLViewerTextEditor* editor = self->getChild<LLViewerTextEditor>("Notecard Editor");
if (!editor) return FALSE;
return editor->canDeselect();
LLPreviewNotecard* self = static_cast<LLPreviewNotecard*>(userdata);
if (LLViewerTextEditor* editor = self->findChild<LLViewerTextEditor>("Notecard Editor"))
return editor->canDeselect();
return false;
}
// EOF

View File

@@ -6131,7 +6131,7 @@ bool attempt_standard_notification(LLMessageSystem* msgsystem)
// notification was specified using the new mechanism, so we can just handle it here
std::string notificationID;
msgsystem->getStringFast(_PREHASH_AlertInfo, _PREHASH_Message, notificationID);
if (!LLNotifications::getInstance()->templateExists(notificationID))
if (!LLNotificationTemplates::getInstance()->templateExists(notificationID))
{
return false;
}
@@ -6309,7 +6309,7 @@ void process_alert_core(const std::string& message, BOOL modal)
}
else
{
std::string new_msg =LLNotifications::instance().getGlobalString(text);
std::string new_msg =LLNotificationTemplates::instance().getGlobalString(text);
args["MESSAGE"] = new_msg;
LLNotificationsUtil::add("SystemMessage", args);
}
@@ -6317,7 +6317,7 @@ void process_alert_core(const std::string& message, BOOL modal)
else if (modal)
{
LLSD args;
std::string new_msg =LLNotifications::instance().getGlobalString(message);
std::string new_msg =LLNotificationTemplates::instance().getGlobalString(message);
args["ERROR_MESSAGE"] = new_msg;
LLNotificationsUtil::add("ErrorMessage", args);
}
@@ -6328,7 +6328,7 @@ void process_alert_core(const std::string& message, BOOL modal)
if (message.find(AUTOPILOT_CANCELED_MSG) == std::string::npos )
{
LLSD args;
std::string new_msg =LLNotifications::instance().getGlobalString(message);
std::string new_msg =LLNotificationTemplates::instance().getGlobalString(message);
std::string localized_msg;
bool is_message_localized = LLTrans::findString(localized_msg, new_msg);

View File

@@ -588,7 +588,10 @@ void LLWaterParamManager::initSingleton()
loadAllPresets();
LLEnvManagerNew::instance().usePrefs();
// This shouldn't be called here. It has nothing to do with the initialization of this singleton.
// Instead, call it one-time when the viewer starts. Calling it here causes a recursive entry
// of LLWaterParamManager::initSingleton().
//LLEnvManagerNew::instance().usePrefs();
}
// static

View File

@@ -775,14 +775,19 @@ boost::signals2::connection LLWLParamManager::setPresetListChangeCallback(const
}
// static
void LLWLParamManager::initSingleton()
{
LL_DEBUGS("Windlight") << "Initializing sky" << LL_ENDL;
loadAllPresets();
// Here it used to call LLWLParamManager::initHack(), but we can't do that since it calls
// LLWLParamManager::initSingleton() recursively. Instead, call it from LLAppViewer::init().
}
// This is really really horrible, but can't be fixed without a rewrite.
void LLWLParamManager::initHack()
{
// load the day
std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName();
if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay))
@@ -810,7 +815,10 @@ void LLWLParamManager::initSingleton()
// but use linden time sets it to what the estate is
mAnimator.setTimeType(LLWLAnimator::TIME_LINDEN);
LLEnvManagerNew::instance().usePrefs();
// This shouldn't be called here. It has nothing to do with the initialization of this singleton.
// Instead, call it one-time when the viewer starts. Calling it here causes a recursive entry
// of LLWLParamManager::initSingleton().
//LLEnvManagerNew::instance().usePrefs();
}
// static

View File

@@ -341,6 +341,9 @@ private:
std::map<LLWLParamKey, LLWLParamSet> mParamList;
preset_list_signal_t mPresetListChangeSignal;
public:
void initHack();
};
inline F32 LLWLParamManager::getDomeOffset(void) const

View File

@@ -672,6 +672,7 @@ To buy direct, visit the land and click on the place name in the title bar.
font="SansSerifSmall" height="16" initial_value="false"
label="Adult content" left_delta="110" mouse_opaque="true"
name="incadult" width="204" />
<check_box name="filter_gaming" label="Hide Gaming" control_name="FilterGamingGroups" follows="right|top" bottom="-46" left_delta="110"/>
<scroll_list background_visible="true" bottom="-513" column_padding="0" draw_border="true"
draw_heading="true"
follows="left|top|right|bottom" height="464" left="4" mouse_opaque="true"

View File

@@ -103,9 +103,9 @@ vote on open proposals, and view old proposals.
mouse_opaque="true" name="majority"
text_disabled_color="0.67647, 0.76275, 0.93529, 0.45"
tool_tip="Majority of total votes needed to win." width="107">
Simple Majority
2/3 Majority
Unanimous
<radio_item follows="all" bottom="-18" left_delta="2">Simple Majority</radio_item>
<radio_item follows="all" bottom_delta="-9">2/3 Majority</radio_item>
<radio_item follows="all" bottom_delta="-10">Unanimous</radio_item>
</radio_group>
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
bottom_delta="-72" drop_shadow_visible="true" follows="left|top"