Merge branch 'master' of git://github.com/AlericInglewood/SingularityViewer into Cupcake

Conflicts:
	indra/newview/llappviewer.cpp
This commit is contained in:
Drake Arconis
2013-03-20 08:31:04 -04:00
14 changed files with 168 additions and 103 deletions

View File

@@ -226,7 +226,7 @@ void LLSingleton<DERIVED_TYPE>::createInstance(SingletonInstanceData& data)
if (data.mInitState == INITIALIZING) 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; return;
} }

View File

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

View File

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

View File

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

View File

@@ -679,45 +679,20 @@ private:
LLNotificationComparator mComparator; LLNotificationComparator mComparator;
}; };
class LLNotificationTemplates :
public LLSingleton<LLNotificationTemplates>
class LLNotifications :
public LLSingleton<LLNotifications>,
public LLNotificationChannelBase
{ {
LOG_CLASS(LLNotifications); LOG_CLASS(LLNotificationTemplates);
friend class LLSingleton<LLNotificationTemplates>;
// This class may not use LLNotifications.
typedef char LLNotifications;
friend class LLSingleton<LLNotifications>;
public: public:
// load notification descriptions from file;
// OK to call more than once because it will reload
bool loadTemplates(); bool loadTemplates();
LLXMLNodePtr checkForXMLTemplate(LLXMLNodePtr item); 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 // This is all stuff for managing the templates
// take your template out // take your template out
LLNotificationTemplatePtr getTemplate(const std::string& name); LLNotificationTemplatePtr getTemplate(const std::string& name);
@@ -736,17 +711,67 @@ public:
// useful if you're reloading the file // useful if you're reloading the file
void clearTemplates(); // erase all templates 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(); 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; typedef std::map<std::string, LLNotificationChannelPtr> ChannelMap;
ChannelMap mChannels; ChannelMap mChannels;
void addChannel(LLNotificationChannelPtr pChan); void addChannel(LLNotificationChannelPtr pChan);
LLNotificationChannelPtr getChannel(const std::string& channelName); 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: private:
// we're a singleton, so we don't have a public constructor // we're a singleton, so we don't have a public constructor
@@ -760,22 +785,11 @@ private:
bool uniqueFilter(LLNotificationPtr pNotification); bool uniqueFilter(LLNotificationPtr pNotification);
bool uniqueHandler(const LLSD& payload); bool uniqueHandler(const LLSD& payload);
bool failedUniquenessTest(const LLSD& payload); bool failedUniquenessTest(const LLSD& payload);
LLNotificationChannelPtr pHistoryChannel; LLNotificationChannelPtr pHistoryChannel;
LLNotificationChannelPtr pExpirationChannel; 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; 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")); LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize"));
LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile");
LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic");
LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures");
LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor"); LLVOVolume::sLODFactor = gSavedSettings.getF32("RenderVolumeLODFactor");
@@ -714,7 +713,7 @@ bool LLAppViewer::init()
LLTrans::parseStrings("strings.xml", default_trans_args); LLTrans::parseStrings("strings.xml", default_trans_args);
// Setup notifications after LLUI::initClass() has been called. // Setup notifications after LLUI::initClass() has been called.
LLNotifications::instance(); LLNotifications::instance().createDefaultChannels();
LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ; LL_INFOS("InitInfo") << "Notifications initialized." << LL_ENDL ;
writeSystemInfo(); writeSystemInfo();
@@ -876,7 +875,7 @@ bool LLAppViewer::init()
{ {
// can't use an alert here since we're exiting and // can't use an alert here since we're exiting and
// all hell breaks lose. // all hell breaks lose.
std::string msg = LLNotifications::instance().getGlobalString("UnsupportedGLRequirements"); std::string msg = LLNotificationTemplates::instance().getGlobalString("UnsupportedGLRequirements");
LLStringUtil::format(msg,LLTrans::getDefaultArgs()); LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox( OSMessageBox(
msg, msg,
@@ -891,7 +890,7 @@ bool LLAppViewer::init()
{ {
// can't use an alert here since we're exiting and // can't use an alert here since we're exiting and
// all hell breaks lose. // all hell breaks lose.
std::string msg = LLNotifications::instance().getGlobalString("UnsupportedCPUSSE2"); std::string msg = LLNotificationTemplates::instance().getGlobalString("UnsupportedCPUSSE2");
LLStringUtil::format(msg,LLTrans::getDefaultArgs()); LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox( OSMessageBox(
msg, msg,
@@ -905,7 +904,7 @@ bool LLAppViewer::init()
{ {
// can't use an alert here since we're exiting and // can't use an alert here since we're exiting and
// all hell breaks lose. // all hell breaks lose.
std::string msg = LNotifications::instance().getGlobalString("UnsupportedCPUSSE2"); std::string msg = LNotificationTemplates::instance().getGlobalString("UnsupportedCPUSSE2");
LLStringUtil::format(msg,LLTrans::getDefaultArgs()); LLStringUtil::format(msg,LLTrans::getDefaultArgs());
OSMessageBox( OSMessageBox(
msg, msg,
@@ -923,31 +922,31 @@ bool LLAppViewer::init()
std::string minSpecs; std::string minSpecs;
// get cpu data from xml // get cpu data from xml
std::stringstream minCPUString(LLNotifications::instance().getGlobalString("UnsupportedCPUAmount")); std::stringstream minCPUString(LLNotificationTemplates::instance().getGlobalString("UnsupportedCPUAmount"));
S32 minCPU = 0; S32 minCPU = 0;
minCPUString >> minCPU; minCPUString >> minCPU;
// get RAM data from XML // get RAM data from XML
std::stringstream minRAMString(LLNotifications::instance().getGlobalString("UnsupportedRAMAmount")); std::stringstream minRAMString(LLNotificationTemplates::instance().getGlobalString("UnsupportedRAMAmount"));
U64 minRAM = 0; U64 minRAM = 0;
minRAMString >> minRAM; minRAMString >> minRAM;
minRAM = minRAM * 1024 * 1024; minRAM = minRAM * 1024 * 1024;
if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN) if(!LLFeatureManager::getInstance()->isGPUSupported() && LLFeatureManager::getInstance()->getGPUClass() != GPU_CLASS_UNKNOWN)
{ {
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedGPU"); minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedGPU");
minSpecs += "\n"; minSpecs += "\n";
unsupported = true; unsupported = true;
} }
if(gSysCPU.getMHz() < minCPU) if(gSysCPU.getMHz() < minCPU)
{ {
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedCPU"); minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedCPU");
minSpecs += "\n"; minSpecs += "\n";
unsupported = true; unsupported = true;
} }
if(gSysMemory.getPhysicalMemoryClamped() < minRAM) if(gSysMemory.getPhysicalMemoryClamped() < minRAM)
{ {
minSpecs += LLNotifications::instance().getGlobalString("UnsupportedRAM"); minSpecs += LLNotificationTemplates::instance().getGlobalString("UnsupportedRAM");
minSpecs += "\n"; minSpecs += "\n";
unsupported = true; unsupported = true;
} }
@@ -980,6 +979,11 @@ bool LLAppViewer::init()
LLViewerJoystick::getInstance()->init(false); LLViewerJoystick::getInstance()->init(false);
// Finish windlight initialization.
LLWLParamManager::instance().initHack();
// Use prefered Environment.
LLEnvManagerNew::instance().usePrefs();
gGLActive = FALSE; gGLActive = FALSE;
return true; return true;
} }

View File

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

View File

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

View File

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

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

View File

@@ -588,7 +588,10 @@ void LLWaterParamManager::initSingleton()
loadAllPresets(); 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 // static

View File

@@ -775,14 +775,19 @@ boost::signals2::connection LLWLParamManager::setPresetListChangeCallback(const
} }
// static
void LLWLParamManager::initSingleton() void LLWLParamManager::initSingleton()
{ {
LL_DEBUGS("Windlight") << "Initializing sky" << LL_ENDL; LL_DEBUGS("Windlight") << "Initializing sky" << LL_ENDL;
loadAllPresets(); 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 // load the day
std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName(); std::string preferred_day = LLEnvManagerNew::instance().getDayCycleName();
if (!LLDayCycleManager::instance().getPreset(preferred_day, mDay)) 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 // but use linden time sets it to what the estate is
mAnimator.setTimeType(LLWLAnimator::TIME_LINDEN); 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 // static

View File

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