Skip to content
Snippets Groups Projects
Commit 04d6bd30 authored by Leyla Farazha's avatar Leyla Farazha
Browse files

merge

parents 68649fbf c290b0cc
No related branches found
No related tags found
No related merge requests found
......@@ -305,13 +305,6 @@ LLAgent::LLAgent() :
mListener.reset(new LLAgentListener(*this));
mMoveTimer.stop();
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
}
// Requires gSavedSettings to be initialized.
......@@ -333,6 +326,14 @@ void LLAgent::init()
gSavedSettings.getControl("PreferredMaturity")->getValidateSignal()->connect(boost::bind(&LLAgent::validateMaturity, this, _2));
gSavedSettings.getControl("PreferredMaturity")->getSignal()->connect(boost::bind(&LLAgent::handleMaturity, this, _2));
LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLAgent::parcelChangedCallback));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsActionAllowed", boost::bind(&LLAgent::isActionAllowed, _2));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.PressMicrophone", boost::bind(&LLAgent::pressMicrophone, _2));
LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Agent.ReleaseMicrophone", boost::bind(&LLAgent::releaseMicrophone, _2));
LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Agent.IsMicrophoneOn", boost::bind(&LLAgent::isMicrophoneOn, _2));
mInitialized = TRUE;
}
......
......@@ -389,6 +389,7 @@ LLTeleportHistoryPanel::~LLTeleportHistoryPanel()
{
LLTeleportHistoryFlatItemStorage::instance().purge();
delete mGearMenuHandle.get();
mTeleportHistoryChangedConnection.disconnect();
}
BOOL LLTeleportHistoryPanel::postBuild()
......
......@@ -56,7 +56,8 @@ const std::string& LLTeleportHistoryItem::getTitle() const
LLTeleportHistory::LLTeleportHistory():
mCurrentItem(-1),
mRequestedItem(-1),
mGotInitialUpdate(false)
mGotInitialUpdate(false),
mTeleportHistoryStorage(NULL)
{
mTeleportFinishedConn = LLViewerParcelMgr::getInstance()->
setTeleportFinishedCallback(boost::bind(&LLTeleportHistory::updateCurrentLocation, this, _1));
......@@ -115,6 +116,10 @@ void LLTeleportHistory::handleLoginComplete()
void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
{
if (!mTeleportHistoryStorage)
{
mTeleportHistoryStorage = LLTeleportHistoryStorage::getInstance();
}
if (mRequestedItem != -1) // teleport within the history in progress?
{
mCurrentItem = mRequestedItem;
......@@ -152,7 +157,7 @@ void LLTeleportHistory::updateCurrentLocation(const LLVector3d& new_pos)
if (mCurrentItem < 0 || mCurrentItem >= (int) mItems.size()) // sanity check
{
llwarns << "Invalid current item. (this should not happen)" << llendl;
llassert(!"Invalid current teleport histiry item");
llassert(!"Invalid current teleport history item");
return;
}
LLVector3 new_pos_local = gAgent.getPosAgentFromGlobal(new_pos);
......
......@@ -33,6 +33,7 @@
#include <string>
#include <boost/function.hpp>
#include <boost/signals2.hpp>
#include "llteleporthistorystorage.h"
/**
......@@ -210,6 +211,8 @@ class LLTeleportHistory: public LLSingleton<LLTeleportHistory>
*/
bool mGotInitialUpdate;
LLTeleportHistoryStorage* mTeleportHistoryStorage;
/**
* Signal emitted when the history gets changed.
*
......
......@@ -93,9 +93,6 @@ class LLTeleportHistoryStorage: public LLSingleton<LLTeleportHistoryStorage>
void removeItem(S32 idx);
void save();
void load();
void dump() const;
/**
* Set a callback to be called upon history changes.
......@@ -113,6 +110,9 @@ class LLTeleportHistoryStorage: public LLSingleton<LLTeleportHistoryStorage>
private:
void load();
void dump() const;
void onTeleportHistoryChange();
bool compareByTitleAndGlobalPos(const LLTeleportHistoryPersistentItem& a, const LLTeleportHistoryPersistentItem& b);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment