merge with viewer-release
commit
a0bb55adc6
12
BuildParams
12
BuildParams
|
|
@ -111,6 +111,18 @@ viewer-mesh.login_channel = "Project Viewer - Mesh"
|
|||
viewer-mesh.viewer_grid = aditi
|
||||
viewer-mesh.email = shining@lists.lindenlab.com
|
||||
|
||||
# ========================================
|
||||
# viewer-chui
|
||||
#
|
||||
# ========================================
|
||||
|
||||
viewer-chui.viewer_channel = "Project Viewer - CHUI"
|
||||
viewer-chui.login_channel = "Project Viewer - CHUI"
|
||||
viewer-chui.viewer_grid = agni
|
||||
viewer-chui.build_debug_release_separately = true
|
||||
viewer-chui.build_CYGWIN_Debug = false
|
||||
viewer-chui.build_viewer_update_version_manager = false
|
||||
|
||||
# ================
|
||||
# oz
|
||||
# ================
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
* semantics: one instance per process, rather than one instance per module as
|
||||
* sometimes happens with data simply declared static.
|
||||
*/
|
||||
class LL_COMMON_API LLInstanceTrackerBase : public boost::noncopyable
|
||||
class LL_COMMON_API LLInstanceTrackerBase
|
||||
{
|
||||
protected:
|
||||
/// Get a process-unique void* pointer slot for the specified type_info
|
||||
|
|
@ -209,6 +209,9 @@ protected:
|
|||
virtual const KEY& getKey() const { return mInstanceKey; }
|
||||
|
||||
private:
|
||||
LLInstanceTracker( const LLInstanceTracker& );
|
||||
const LLInstanceTracker& operator=( const LLInstanceTracker& );
|
||||
|
||||
void add_(KEY key)
|
||||
{
|
||||
mInstanceKey = key;
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#define LLREFCOUNT_H
|
||||
|
||||
#include <boost/noncopyable.hpp>
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
|
||||
#define LL_REF_COUNT_DEBUG 0
|
||||
#if LL_REF_COUNT_DEBUG
|
||||
|
|
@ -86,4 +87,22 @@ private:
|
|||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* intrusive pointer support
|
||||
* this allows you to use boost::intrusive_ptr with any LLRefCount-derived type
|
||||
*/
|
||||
namespace boost
|
||||
{
|
||||
inline void intrusive_ptr_add_ref(LLRefCount* p)
|
||||
{
|
||||
p->ref();
|
||||
}
|
||||
|
||||
inline void intrusive_ptr_release(LLRefCount* p)
|
||||
{
|
||||
p->unref();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@
|
|||
#include "llapp.h"
|
||||
#include "llapr.h"
|
||||
#include "apr_thread_cond.h"
|
||||
#include "boost/intrusive_ptr.hpp"
|
||||
|
||||
class LLThread;
|
||||
class LLMutex;
|
||||
|
|
@ -266,6 +267,22 @@ private:
|
|||
S32 mRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* intrusive pointer support for LLThreadSafeRefCount
|
||||
* this allows you to use boost::intrusive_ptr with any LLThreadSafeRefCount-derived type
|
||||
*/
|
||||
namespace boost
|
||||
{
|
||||
inline void intrusive_ptr_add_ref(LLThreadSafeRefCount* p)
|
||||
{
|
||||
p->ref();
|
||||
}
|
||||
|
||||
inline void intrusive_ptr_release(LLThreadSafeRefCount* p)
|
||||
{
|
||||
p->unref();
|
||||
}
|
||||
};
|
||||
//============================================================================
|
||||
|
||||
// Simple responder for self destructing callbacks
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p)
|
|||
|
||||
void LLLoadingIndicator::initFromParams(const Params& p)
|
||||
{
|
||||
BOOST_FOREACH(LLUIImage* image, p.images.image)
|
||||
BOOST_FOREACH(LLUIImage* image, p.images().image)
|
||||
{
|
||||
mImages.push_back(image);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class LLLoadingIndicator
|
|||
LOG_CLASS(LLLoadingIndicator);
|
||||
public:
|
||||
|
||||
struct Images : public LLInitParam::BatchBlock<Images>
|
||||
struct Images : public LLInitParam::Block<Images>
|
||||
{
|
||||
Multiple<LLUIImage*> image;
|
||||
|
||||
|
|
@ -62,8 +62,8 @@ public:
|
|||
|
||||
struct Params : public LLInitParam::Block<Params, LLUICtrl::Params>
|
||||
{
|
||||
Optional<F32> images_per_sec;
|
||||
Optional<Images> images;
|
||||
Optional<F32> images_per_sec;
|
||||
Optional<Atomic<Images> > images;
|
||||
|
||||
Params()
|
||||
: images_per_sec("images_per_sec", 1.0f),
|
||||
|
|
|
|||
|
|
@ -44,33 +44,27 @@ void LLMenuButton::MenuPositions::declareValues()
|
|||
|
||||
LLMenuButton::Params::Params()
|
||||
: menu_filename("menu_filename"),
|
||||
position("position", MP_BOTTOM_LEFT)
|
||||
position("menu_position", MP_BOTTOM_LEFT)
|
||||
{
|
||||
addSynonym(position, "position");
|
||||
}
|
||||
|
||||
|
||||
LLMenuButton::LLMenuButton(const LLMenuButton::Params& p)
|
||||
: LLButton(p),
|
||||
mIsMenuShown(false),
|
||||
mMenuPosition(p.position)
|
||||
mMenuPosition(p.position),
|
||||
mOwnMenu(false)
|
||||
{
|
||||
std::string menu_filename = p.menu_filename;
|
||||
|
||||
if (!menu_filename.empty())
|
||||
{
|
||||
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (!menu)
|
||||
{
|
||||
llwarns << "Error loading menu_button menu" << llendl;
|
||||
return;
|
||||
}
|
||||
setMenu(menu_filename, mMenuPosition);
|
||||
updateMenuOrigin();
|
||||
}
|
||||
|
||||
menu->setVisibilityChangeCallback(boost::bind(&LLMenuButton::onMenuVisibilityChange, this, _2));
|
||||
|
||||
mMenuHandle = menu->getHandle();
|
||||
|
||||
updateMenuOrigin();
|
||||
}
|
||||
LLMenuButton::~LLMenuButton()
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
|
||||
boost::signals2::connection LLMenuButton::setMouseDownCallback( const mouse_signal_t::slot_type& cb )
|
||||
|
|
@ -80,9 +74,7 @@ boost::signals2::connection LLMenuButton::setMouseDownCallback( const mouse_sign
|
|||
|
||||
void LLMenuButton::hideMenu()
|
||||
{
|
||||
if(mMenuHandle.isDead()) return;
|
||||
|
||||
LLToggleableMenu* menu = dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
|
||||
LLToggleableMenu* menu = getMenu();
|
||||
if (menu)
|
||||
{
|
||||
menu->setVisible(FALSE);
|
||||
|
|
@ -94,19 +86,39 @@ LLToggleableMenu* LLMenuButton::getMenu()
|
|||
return dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
|
||||
}
|
||||
|
||||
void LLMenuButton::setMenu(LLToggleableMenu* menu, EMenuPosition position /*MP_TOP_LEFT*/)
|
||||
void LLMenuButton::setMenu(const std::string& menu_filename, EMenuPosition position /*MP_TOP_LEFT*/)
|
||||
{
|
||||
if (menu_filename.empty())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLToggleableMenu* menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>(menu_filename, LLMenuGL::sMenuContainer, LLMenuHolderGL::child_registry_t::instance());
|
||||
if (!menu)
|
||||
{
|
||||
llwarns << "Error loading menu_button menu" << llendl;
|
||||
return;
|
||||
}
|
||||
|
||||
setMenu(menu, position, true);
|
||||
}
|
||||
|
||||
void LLMenuButton::setMenu(LLToggleableMenu* menu, EMenuPosition position /*MP_TOP_LEFT*/, bool take_ownership /*false*/)
|
||||
{
|
||||
if (!menu) return;
|
||||
|
||||
cleanup(); // destroy the previous memnu if we own it
|
||||
|
||||
mMenuHandle = menu->getHandle();
|
||||
mMenuPosition = position;
|
||||
mOwnMenu = take_ownership;
|
||||
|
||||
menu->setVisibilityChangeCallback(boost::bind(&LLMenuButton::onMenuVisibilityChange, this, _2));
|
||||
}
|
||||
|
||||
BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
|
||||
{
|
||||
if (mMenuHandle.isDead()) return FALSE;
|
||||
if (!getMenu()) return FALSE;
|
||||
|
||||
if( KEY_RETURN == key && mask == MASK_NONE && !gKeyboard->getKeyRepeated(key))
|
||||
{
|
||||
|
|
@ -118,7 +130,7 @@ BOOL LLMenuButton::handleKeyHere(KEY key, MASK mask )
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
LLToggleableMenu* menu = dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
|
||||
LLToggleableMenu* menu = getMenu();
|
||||
if (menu && menu->getVisible() && key == KEY_ESCAPE && mask == MASK_NONE)
|
||||
{
|
||||
menu->setVisible(FALSE);
|
||||
|
|
@ -139,9 +151,12 @@ BOOL LLMenuButton::handleMouseDown(S32 x, S32 y, MASK mask)
|
|||
|
||||
void LLMenuButton::toggleMenu()
|
||||
{
|
||||
if(mMenuHandle.isDead()) return;
|
||||
if (mValidateSignal && !(*mValidateSignal)(this, LLSD()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLToggleableMenu* menu = dynamic_cast<LLToggleableMenu*>(mMenuHandle.get());
|
||||
LLToggleableMenu* menu = getMenu();
|
||||
if (!menu) return;
|
||||
|
||||
// Store the button rectangle to toggle menu visibility if a mouse event
|
||||
|
|
@ -170,7 +185,8 @@ void LLMenuButton::toggleMenu()
|
|||
|
||||
void LLMenuButton::updateMenuOrigin()
|
||||
{
|
||||
if (mMenuHandle.isDead()) return;
|
||||
LLToggleableMenu* menu = getMenu();
|
||||
if (!menu) return;
|
||||
|
||||
LLRect rect = getRect();
|
||||
|
||||
|
|
@ -179,12 +195,12 @@ void LLMenuButton::updateMenuOrigin()
|
|||
case MP_TOP_LEFT:
|
||||
{
|
||||
mX = rect.mLeft;
|
||||
mY = rect.mTop + mMenuHandle.get()->getRect().getHeight();
|
||||
mY = rect.mTop + menu->getRect().getHeight();
|
||||
break;
|
||||
}
|
||||
case MP_TOP_RIGHT:
|
||||
{
|
||||
const LLRect& menu_rect = mMenuHandle.get()->getRect();
|
||||
const LLRect& menu_rect = menu->getRect();
|
||||
mX = rect.mRight - menu_rect.getWidth();
|
||||
mY = rect.mTop + menu_rect.getHeight();
|
||||
break;
|
||||
|
|
@ -211,3 +227,11 @@ void LLMenuButton::onMenuVisibilityChange(const LLSD& param)
|
|||
mIsMenuShown = false;
|
||||
}
|
||||
}
|
||||
|
||||
void LLMenuButton::cleanup()
|
||||
{
|
||||
if (mMenuHandle.get() && mOwnMenu)
|
||||
{
|
||||
mMenuHandle.get()->die();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ class LLToggleableMenu;
|
|||
class LLMenuButton
|
||||
: public LLButton
|
||||
{
|
||||
LOG_CLASS(LLMenuButton);
|
||||
|
||||
public:
|
||||
typedef enum e_menu_position
|
||||
{
|
||||
|
|
@ -53,7 +55,7 @@ public:
|
|||
{
|
||||
// filename for it's toggleable menu
|
||||
Optional<std::string> menu_filename;
|
||||
Optional<EMenuPosition> position;
|
||||
Optional<EMenuPosition, MenuPositions> position;
|
||||
|
||||
Params();
|
||||
};
|
||||
|
|
@ -68,13 +70,15 @@ public:
|
|||
void hideMenu();
|
||||
|
||||
LLToggleableMenu* getMenu();
|
||||
void setMenu(LLToggleableMenu* menu, EMenuPosition position = MP_TOP_LEFT);
|
||||
void setMenu(const std::string& menu_filename, EMenuPosition position = MP_TOP_LEFT);
|
||||
void setMenu(LLToggleableMenu* menu, EMenuPosition position = MP_TOP_LEFT, bool take_ownership = false);
|
||||
|
||||
void setMenuPosition(EMenuPosition position) { mMenuPosition = position; }
|
||||
|
||||
protected:
|
||||
friend class LLUICtrlFactory;
|
||||
LLMenuButton(const Params&);
|
||||
~LLMenuButton();
|
||||
|
||||
void toggleMenu();
|
||||
void updateMenuOrigin();
|
||||
|
|
@ -82,11 +86,14 @@ protected:
|
|||
void onMenuVisibilityChange(const LLSD& param);
|
||||
|
||||
private:
|
||||
void cleanup();
|
||||
|
||||
LLHandle<LLView> mMenuHandle;
|
||||
bool mIsMenuShown;
|
||||
EMenuPosition mMenuPosition;
|
||||
S32 mX;
|
||||
S32 mY;
|
||||
bool mOwnMenu; // true if we manage the menu lifetime
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -4021,11 +4021,6 @@ BOOL LLContextMenu::handleRightMouseUp( S32 x, S32 y, MASK mask )
|
|||
return result;
|
||||
}
|
||||
|
||||
void LLContextMenu::draw()
|
||||
{
|
||||
LLMenuGL::draw();
|
||||
}
|
||||
|
||||
BOOL LLContextMenu::appendContextSubMenu(LLContextMenu *menu)
|
||||
{
|
||||
|
||||
|
|
|
|||
|
|
@ -668,8 +668,6 @@ public:
|
|||
// can't set visibility directly, must call show or hide
|
||||
virtual void setVisible (BOOL visible);
|
||||
|
||||
virtual void draw ();
|
||||
|
||||
virtual void show (S32 x, S32 y);
|
||||
virtual void hide ();
|
||||
|
||||
|
|
|
|||
|
|
@ -246,7 +246,7 @@ LLNotificationForm::LLNotificationForm(const std::string& name, const LLNotifica
|
|||
LLParamSDParser parser;
|
||||
parser.writeSD(mFormData, p.form_elements);
|
||||
|
||||
if (!mFormData.isArray())
|
||||
if (!mFormData.isArray() && !mFormData.isUndefined())
|
||||
{
|
||||
// change existing contents to a one element array
|
||||
LLSD new_llsd_array = LLSD::emptyArray();
|
||||
|
|
@ -407,9 +407,12 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
|
|||
mURLOption(p.url.option),
|
||||
mURLTarget(p.url.target),
|
||||
mUnique(p.unique.isProvided()),
|
||||
mCombineBehavior(p.unique.combine),
|
||||
mPriority(p.priority),
|
||||
mPersist(p.persist),
|
||||
mDefaultFunctor(p.functor.isProvided() ? p.functor() : p.name())
|
||||
mDefaultFunctor(p.functor.isProvided() ? p.functor() : p.name()),
|
||||
mLogToChat(p.log_to_chat),
|
||||
mLogToIM(p.log_to_im)
|
||||
{
|
||||
if (p.sound.isProvided()
|
||||
&& LLUI::sSettingGroups["config"]->controlExists(p.sound))
|
||||
|
|
@ -886,6 +889,28 @@ std::string LLNotification::getURL() const
|
|||
return (mTemplatep ? url : "");
|
||||
}
|
||||
|
||||
bool LLNotification::canLogToChat() const
|
||||
{
|
||||
return mTemplatep->mLogToChat;
|
||||
}
|
||||
|
||||
bool LLNotification::canLogToIM() const
|
||||
{
|
||||
return mTemplatep->mLogToIM;
|
||||
}
|
||||
|
||||
bool LLNotification::hasFormElements() const
|
||||
{
|
||||
return mTemplatep->mForm->getNumElements() != 0;
|
||||
}
|
||||
|
||||
LLNotification::ECombineBehavior LLNotification::getCombineBehavior() const
|
||||
{
|
||||
return mTemplatep->mCombineBehavior;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// =========================================================
|
||||
// LLNotificationChannel implementation
|
||||
// ---
|
||||
|
|
@ -946,7 +971,7 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt
|
|||
std::string cmd = payload["sigtype"];
|
||||
LLNotificationSet::iterator foundItem = mItems.find(pNotification);
|
||||
bool wasFound = (foundItem != mItems.end());
|
||||
bool passesFilter = mFilter(pNotification);
|
||||
bool passesFilter = mFilter ? mFilter(pNotification) : true;
|
||||
|
||||
// first, we offer the result of the filter test to the simple
|
||||
// signals for pass/fail. One of these is guaranteed to be called.
|
||||
|
|
@ -1051,41 +1076,28 @@ bool LLNotificationChannelBase::updateItem(const LLSD& payload, LLNotificationPt
|
|||
return abortProcessing;
|
||||
}
|
||||
|
||||
/* static */
|
||||
LLNotificationChannelPtr LLNotificationChannel::buildChannel(const std::string& name,
|
||||
const std::string& parent,
|
||||
LLNotificationFilter filter,
|
||||
LLNotificationComparator comparator)
|
||||
LLNotificationChannel::LLNotificationChannel(const Params& p)
|
||||
: LLNotificationChannelBase(p.filter(), p.comparator()),
|
||||
LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()),
|
||||
mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString())
|
||||
{
|
||||
// note: this is not a leak; notifications are self-registering.
|
||||
// This factory helps to prevent excess deletions by making sure all smart
|
||||
// pointers to notification channels come from the same source
|
||||
new LLNotificationChannel(name, parent, filter, comparator);
|
||||
return LLNotifications::instance().getChannel(name);
|
||||
BOOST_FOREACH(const std::string& source, p.sources)
|
||||
{
|
||||
connectToChannel(source);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LLNotificationChannel::LLNotificationChannel(const std::string& name,
|
||||
const std::string& parent,
|
||||
LLNotificationFilter filter,
|
||||
LLNotificationComparator comparator) :
|
||||
LLNotificationChannelBase(filter, comparator),
|
||||
mName(name),
|
||||
mParent(parent)
|
||||
LLNotificationComparator comparator)
|
||||
: LLNotificationChannelBase(filter, comparator),
|
||||
LLInstanceTracker<LLNotificationChannel, std::string>(name),
|
||||
mName(name)
|
||||
{
|
||||
// store myself in the channel map
|
||||
LLNotifications::instance().addChannel(LLNotificationChannelPtr(this));
|
||||
// bind to notification broadcast
|
||||
if (parent.empty())
|
||||
{
|
||||
LLNotifications::instance().connectChanged(
|
||||
boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(parent);
|
||||
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
|
||||
}
|
||||
connectToChannel(parent);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1128,6 +1140,21 @@ std::string LLNotificationChannel::summarize()
|
|||
return s;
|
||||
}
|
||||
|
||||
void LLNotificationChannel::connectToChannel( const std::string& channel_name )
|
||||
{
|
||||
if (channel_name.empty())
|
||||
{
|
||||
LLNotifications::instance().connectChanged(
|
||||
boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
|
||||
}
|
||||
else
|
||||
{
|
||||
LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name);
|
||||
p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ---
|
||||
// END OF LLNotificationChannel implementation
|
||||
|
|
@ -1220,6 +1247,8 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (pNotif->getCombineBehavior() == LLNotification::USE_NEWEST)
|
||||
{
|
||||
// Update the existing unique notification with the data from this particular instance...
|
||||
// This guarantees that duplicate notifications will be collapsed to the one
|
||||
// most recently triggered
|
||||
|
|
@ -1238,25 +1267,14 @@ bool LLNotifications::failedUniquenessTest(const LLSD& payload)
|
|||
cancel(pNotif);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void LLNotifications::addChannel(LLNotificationChannelPtr pChan)
|
||||
{
|
||||
mChannels[pChan->getName()] = pChan;
|
||||
}
|
||||
|
||||
LLNotificationChannelPtr LLNotifications::getChannel(const std::string& channelName)
|
||||
{
|
||||
ChannelMap::iterator p = mChannels.find(channelName);
|
||||
if(p == mChannels.end())
|
||||
{
|
||||
llerrs << "Did not find channel named " << channelName << llendl;
|
||||
return LLNotificationChannelPtr();
|
||||
}
|
||||
return p->second;
|
||||
return LLNotificationChannelPtr(LLNotificationChannel::getInstance(channelName));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1272,24 +1290,21 @@ void LLNotifications::createDefaultChannels()
|
|||
{
|
||||
// now construct the various channels AFTER loading the notifications,
|
||||
// because the history channel is going to rewrite the stored notifications file
|
||||
LLNotificationChannel::buildChannel("Enabled", "",
|
||||
!boost::bind(&LLNotifications::getIgnoreAllNotifications, this));
|
||||
LLNotificationChannel::buildChannel("Expiration", "Enabled",
|
||||
boost::bind(&LLNotifications::expirationFilter, this, _1));
|
||||
LLNotificationChannel::buildChannel("Unexpired", "Enabled",
|
||||
!boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind
|
||||
LLNotificationChannel::buildChannel("Unique", "Unexpired",
|
||||
boost::bind(&LLNotifications::uniqueFilter, this, _1));
|
||||
LLNotificationChannel::buildChannel("Ignore", "Unique",
|
||||
filterIgnoredNotifications);
|
||||
LLNotificationChannel::buildChannel("VisibilityRules", "Ignore",
|
||||
boost::bind(&LLNotifications::isVisibleByRules, this, _1));
|
||||
LLNotificationChannel::buildChannel("Visible", "VisibilityRules",
|
||||
&LLNotificationFilters::includeEverything);
|
||||
|
||||
// create special persistent notification channel
|
||||
// this isn't a leak, don't worry about the empty "new"
|
||||
new LLPersistentNotificationChannel();
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Enabled", "",
|
||||
!boost::bind(&LLNotifications::getIgnoreAllNotifications, this)));
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Expiration", "Enabled",
|
||||
boost::bind(&LLNotifications::expirationFilter, this, _1)));
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Unexpired", "Enabled",
|
||||
!boost::bind(&LLNotifications::expirationFilter, this, _1))); // use negated bind
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Unique", "Unexpired",
|
||||
boost::bind(&LLNotifications::uniqueFilter, this, _1)));
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Ignore", "Unique",
|
||||
filterIgnoredNotifications));
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("VisibilityRules", "Ignore",
|
||||
boost::bind(&LLNotifications::isVisibleByRules, this, _1)));
|
||||
mDefaultChannels.push_back(new LLNotificationChannel("Visible", "VisibilityRules",
|
||||
&LLNotificationFilters::includeEverything));
|
||||
mDefaultChannels.push_back(new LLPersistentNotificationChannel());
|
||||
|
||||
// connect action methods to these channels
|
||||
LLNotifications::instance().getChannel("Enabled")->
|
||||
|
|
|
|||
|
|
@ -94,10 +94,11 @@
|
|||
// and we need this to manage the notification callbacks
|
||||
#include "llevents.h"
|
||||
#include "llfunctorregistry.h"
|
||||
#include "llpointer.h"
|
||||
#include "llinitparam.h"
|
||||
#include "llnotificationslistener.h"
|
||||
#include "llnotificationptr.h"
|
||||
#include "llpointer.h"
|
||||
#include "llrefcount.h"
|
||||
|
||||
class LLAvatarName;
|
||||
typedef enum e_notification_priority
|
||||
|
|
@ -296,6 +297,7 @@ LOG_CLASS(LLNotification);
|
|||
friend class LLNotifications;
|
||||
|
||||
public:
|
||||
|
||||
// parameter object used to instantiate a new notification
|
||||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
|
|
@ -513,7 +515,17 @@ public:
|
|||
std::string getURL() const;
|
||||
S32 getURLOption() const;
|
||||
S32 getURLOpenExternally() const;
|
||||
bool canLogToChat() const;
|
||||
bool canLogToIM() const;
|
||||
bool hasFormElements() const;
|
||||
|
||||
typedef enum e_combine_behavior
|
||||
{
|
||||
USE_NEWEST,
|
||||
USE_OLDEST
|
||||
} ECombineBehavior;
|
||||
|
||||
ECombineBehavior getCombineBehavior() const;
|
||||
const LLNotificationFormPtr getForm();
|
||||
|
||||
const LLDate getExpiration() const
|
||||
|
|
@ -704,7 +716,8 @@ typedef std::multimap<std::string, LLNotificationPtr> LLNotificationMap;
|
|||
// all of the built-in tests should attach to the "Visible" channel
|
||||
//
|
||||
class LLNotificationChannelBase :
|
||||
public LLEventTrackable
|
||||
public LLEventTrackable,
|
||||
public LLRefCount
|
||||
{
|
||||
LOG_CLASS(LLNotificationChannelBase);
|
||||
public:
|
||||
|
|
@ -784,32 +797,47 @@ protected:
|
|||
// destroy it, but if it becomes necessary to do so, the shared_ptr model
|
||||
// will ensure that we don't leak resources.
|
||||
class LLNotificationChannel;
|
||||
typedef boost::shared_ptr<LLNotificationChannel> LLNotificationChannelPtr;
|
||||
typedef boost::intrusive_ptr<LLNotificationChannel> LLNotificationChannelPtr;
|
||||
|
||||
// manages a list of notifications
|
||||
// Note that if this is ever copied around, we might find ourselves with multiple copies
|
||||
// of a queue with notifications being added to different nonequivalent copies. So we
|
||||
// make it inherit from boost::noncopyable, and then create a map of shared_ptr to manage it.
|
||||
//
|
||||
// NOTE: LLNotificationChannel is self-registering. The *correct* way to create one is to
|
||||
// do something like:
|
||||
// LLNotificationChannel::buildChannel("name", "parent"...);
|
||||
// This returns an LLNotificationChannelPtr, which you can store, or
|
||||
// you can then retrieve the channel by using the registry:
|
||||
// LLNotifications::instance().getChannel("name")...
|
||||
// make it inherit from boost::noncopyable, and then create a map of LLPointer to manage it.
|
||||
//
|
||||
class LLNotificationChannel :
|
||||
boost::noncopyable,
|
||||
public LLNotificationChannelBase
|
||||
public LLNotificationChannelBase,
|
||||
public LLInstanceTracker<LLNotificationChannel, std::string>
|
||||
{
|
||||
LOG_CLASS(LLNotificationChannel);
|
||||
|
||||
public:
|
||||
// Notification Channels have a filter, which determines which notifications
|
||||
// will be added to this channel.
|
||||
// Channel filters cannot change.
|
||||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
Mandatory<std::string> name;
|
||||
Optional<LLNotificationFilter> filter;
|
||||
Optional<LLNotificationComparator> comparator;
|
||||
Multiple<std::string> sources;
|
||||
|
||||
Params()
|
||||
: comparator("", LLNotificationComparators::orderByUUID())
|
||||
{}
|
||||
};
|
||||
|
||||
LLNotificationChannel(const Params& p = Params());
|
||||
|
||||
LLNotificationChannel(const std::string& name, const std::string& parent,
|
||||
LLNotificationFilter filter, LLNotificationComparator comparator=LLNotificationComparators::orderByUUID());
|
||||
|
||||
virtual ~LLNotificationChannel() {}
|
||||
typedef LLNotificationSet::iterator Iterator;
|
||||
|
||||
std::string getName() const { return mName; }
|
||||
std::string getParentChannelName() { return mParent; }
|
||||
|
||||
void connectToChannel(const std::string& channel_name);
|
||||
|
||||
bool isEmpty() const;
|
||||
|
||||
|
|
@ -822,21 +850,6 @@ public:
|
|||
|
||||
std::string summarize();
|
||||
|
||||
// factory method for constructing these channels; since they're self-registering,
|
||||
// we want to make sure that you can't use new to make them
|
||||
static LLNotificationChannelPtr buildChannel(const std::string& name, const std::string& parent,
|
||||
LLNotificationFilter filter=LLNotificationFilters::includeEverything,
|
||||
LLNotificationComparator comparator=LLNotificationComparators::orderByUUID());
|
||||
|
||||
protected:
|
||||
// Notification Channels have a filter, which determines which notifications
|
||||
// will be added to this channel.
|
||||
// Channel filters cannot change.
|
||||
// Channels have a protected constructor so you can't make smart pointers that don't
|
||||
// come from our internal reference; call NotificationChannel::build(args)
|
||||
LLNotificationChannel(const std::string& name, const std::string& parent,
|
||||
LLNotificationFilter filter, LLNotificationComparator comparator);
|
||||
|
||||
private:
|
||||
std::string mName;
|
||||
std::string mParent;
|
||||
|
|
@ -923,10 +936,6 @@ public:
|
|||
|
||||
void createDefaultChannels();
|
||||
|
||||
typedef std::map<std::string, LLNotificationChannelPtr> ChannelMap;
|
||||
ChannelMap mChannels;
|
||||
|
||||
void addChannel(LLNotificationChannelPtr pChan);
|
||||
LLNotificationChannelPtr getChannel(const std::string& channelName);
|
||||
|
||||
std::string getGlobalString(const std::string& key) const;
|
||||
|
|
@ -965,6 +974,7 @@ private:
|
|||
bool mIgnoreAllNotifications;
|
||||
|
||||
boost::scoped_ptr<LLNotificationsListener> mListener;
|
||||
std::vector<LLNotificationChannelPtr> mDefaultChannels;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -121,13 +121,13 @@ void LLNotificationsListener::listChannels(const LLSD& params) const
|
|||
{
|
||||
LLReqID reqID(params);
|
||||
LLSD response(reqID.makeResponse());
|
||||
for (LLNotifications::ChannelMap::const_iterator cmi(mNotifications.mChannels.begin()),
|
||||
cmend(mNotifications.mChannels.end());
|
||||
for (LLNotificationChannel::instance_iter cmi(LLNotificationChannel::beginInstances()),
|
||||
cmend(LLNotificationChannel::endInstances());
|
||||
cmi != cmend; ++cmi)
|
||||
{
|
||||
LLSD channelInfo;
|
||||
channelInfo["parent"] = cmi->second->getParentChannelName();
|
||||
response[cmi->first] = channelInfo;
|
||||
//channelInfo["parent"] = cmi->second->getParentChannelName();
|
||||
response[cmi->getName()] = channelInfo;
|
||||
}
|
||||
LLEventPumps::instance().obtain(params["reply"]).post(response);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,6 +61,17 @@ typedef boost::shared_ptr<LLNotificationForm> LLNotificationFormPtr;
|
|||
// from the appropriate local language directory).
|
||||
struct LLNotificationTemplate
|
||||
{
|
||||
struct CombineBehaviorNames
|
||||
: public LLInitParam::TypeValuesHelper<LLNotification::ECombineBehavior, CombineBehaviorNames>
|
||||
{
|
||||
static void declareValues()
|
||||
{
|
||||
declare("newest", LLNotification::USE_NEWEST);
|
||||
declare("oldest", LLNotification::USE_OLDEST);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct GlobalString : public LLInitParam::Block<GlobalString>
|
||||
{
|
||||
Mandatory<std::string> name,
|
||||
|
|
@ -94,9 +105,11 @@ struct LLNotificationTemplate
|
|||
Optional<LLInitParam::Flag> dummy_val;
|
||||
public:
|
||||
Multiple<UniquenessContext> contexts;
|
||||
Optional<LLNotification::ECombineBehavior, CombineBehaviorNames> combine;
|
||||
|
||||
UniquenessConstraint()
|
||||
: contexts("context"),
|
||||
combine("combine", LLNotification::USE_NEWEST),
|
||||
dummy_val("")
|
||||
{}
|
||||
};
|
||||
|
|
@ -170,7 +183,9 @@ struct LLNotificationTemplate
|
|||
struct Params : public LLInitParam::Block<Params>
|
||||
{
|
||||
Mandatory<std::string> name;
|
||||
Optional<bool> persist;
|
||||
Optional<bool> persist,
|
||||
log_to_im,
|
||||
log_to_chat;
|
||||
Optional<std::string> functor,
|
||||
icon,
|
||||
label,
|
||||
|
|
@ -190,6 +205,8 @@ struct LLNotificationTemplate
|
|||
Params()
|
||||
: name("name"),
|
||||
persist("persist", false),
|
||||
log_to_im("log_to_im", false),
|
||||
log_to_chat("log_to_chat", true),
|
||||
functor("functor"),
|
||||
icon("icon"),
|
||||
label("label"),
|
||||
|
|
@ -245,6 +262,7 @@ struct LLNotificationTemplate
|
|||
// (used for things like progress indications, or repeating warnings
|
||||
// like "the grid is going down in N minutes")
|
||||
bool mUnique;
|
||||
LLNotification::ECombineBehavior mCombineBehavior;
|
||||
// if we want to be unique only if a certain part of the payload or substitutions args
|
||||
// are constant specify the field names for the payload. The notification will only be
|
||||
// combined if all of the fields named in the context are identical in the
|
||||
|
|
@ -291,6 +309,10 @@ struct LLNotificationTemplate
|
|||
LLUUID mSoundEffect;
|
||||
// List of tags that rules can match against.
|
||||
std::list<std::string> mTags;
|
||||
|
||||
// inject these notifications into chat/IM streams
|
||||
bool mLogToChat;
|
||||
bool mLogToIM;
|
||||
};
|
||||
|
||||
#endif //LL_LLNOTIFICATION_TEMPLATE_H
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ namespace LLInitParam
|
|||
{
|
||||
// LLSD specialization
|
||||
// block param interface
|
||||
bool ParamValue<LLSD, TypeValues<LLSD>, false>::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name)
|
||||
bool ParamValue<LLSD, NOT_BLOCK>::deserializeBlock(Parser& p, Parser::name_stack_range_t name_stack, bool new_name)
|
||||
{
|
||||
LLSD& sd = LLParamSDParserUtilities::getSDWriteNode(mValue, name_stack);
|
||||
|
||||
|
|
@ -328,12 +328,12 @@ namespace LLInitParam
|
|||
}
|
||||
|
||||
//static
|
||||
void ParamValue<LLSD, TypeValues<LLSD>, false>::serializeElement(Parser& p, const LLSD& sd, Parser::name_stack_t& name_stack)
|
||||
void ParamValue<LLSD, NOT_BLOCK>::serializeElement(Parser& p, const LLSD& sd, Parser::name_stack_t& name_stack)
|
||||
{
|
||||
p.writeValue<LLSD::String>(sd.asString(), name_stack);
|
||||
}
|
||||
|
||||
void ParamValue<LLSD, TypeValues<LLSD>, false>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const
|
||||
void ParamValue<LLSD, NOT_BLOCK>::serializeBlock(Parser& p, Parser::name_stack_t& name_stack, const BaseBlock* diff_block) const
|
||||
{
|
||||
// read from LLSD value and serialize out to parser (which could be LLSD, XUI, etc)
|
||||
Parser::name_stack_t stack;
|
||||
|
|
|
|||
|
|
@ -974,31 +974,31 @@ void gl_rect_2d_checkerboard(const LLRect& rect, GLfloat alpha)
|
|||
{
|
||||
if (!LLGLSLShader::sNoFixedFunction)
|
||||
{
|
||||
// Initialize the first time this is called.
|
||||
const S32 PIXELS = 32;
|
||||
static GLubyte checkerboard[PIXELS * PIXELS];
|
||||
static BOOL first = TRUE;
|
||||
if( first )
|
||||
// Initialize the first time this is called.
|
||||
const S32 PIXELS = 32;
|
||||
static GLubyte checkerboard[PIXELS * PIXELS];
|
||||
static BOOL first = TRUE;
|
||||
if( first )
|
||||
{
|
||||
for( S32 i = 0; i < PIXELS; i++ )
|
||||
{
|
||||
for( S32 i = 0; i < PIXELS; i++ )
|
||||
for( S32 j = 0; j < PIXELS; j++ )
|
||||
{
|
||||
for( S32 j = 0; j < PIXELS; j++ )
|
||||
{
|
||||
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
|
||||
}
|
||||
checkerboard[i * PIXELS + j] = ((i & 1) ^ (j & 1)) * 0xFF;
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
first = FALSE;
|
||||
}
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
|
||||
// ...white squares
|
||||
gGL.color4f( 1.f, 1.f, 1.f, alpha );
|
||||
gl_rect_2d(rect);
|
||||
// ...white squares
|
||||
gGL.color4f( 1.f, 1.f, 1.f, alpha );
|
||||
gl_rect_2d(rect);
|
||||
|
||||
// ...gray squares
|
||||
gGL.color4f( .7f, .7f, .7f, alpha );
|
||||
gGL.flush();
|
||||
// ...gray squares
|
||||
gGL.color4f( .7f, .7f, .7f, alpha );
|
||||
gGL.flush();
|
||||
|
||||
glPolygonStipple( checkerboard );
|
||||
|
||||
|
|
@ -1474,144 +1474,132 @@ void gl_segmented_rect_2d_fragment_tex(const S32 left,
|
|||
gGL.popUIMatrix();
|
||||
}
|
||||
|
||||
void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width,
|
||||
const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec,
|
||||
const U32 edges)
|
||||
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect,
|
||||
const LLVector3& width_vec, const LLVector3& height_vec)
|
||||
{
|
||||
LLVector3 left_border_width = ((edges & (~(U32)ROUNDED_RECT_RIGHT)) != 0) ? border_width : LLVector3::zero;
|
||||
LLVector3 right_border_width = ((edges & (~(U32)ROUNDED_RECT_LEFT)) != 0) ? border_width : LLVector3::zero;
|
||||
|
||||
LLVector3 top_border_height = ((edges & (~(U32)ROUNDED_RECT_BOTTOM)) != 0) ? border_height : LLVector3::zero;
|
||||
LLVector3 bottom_border_height = ((edges & (~(U32)ROUNDED_RECT_TOP)) != 0) ? border_height : LLVector3::zero;
|
||||
|
||||
|
||||
gGL.begin(LLRender::QUADS);
|
||||
{
|
||||
// draw bottom left
|
||||
gGL.texCoord2f(0.f, 0.f);
|
||||
gGL.texCoord2f(clip_rect.mLeft, clip_rect.mBottom);
|
||||
gGL.vertex3f(0.f, 0.f, 0.f);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 0.f);
|
||||
gGL.vertex3fv(left_border_width.mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(0.f, border_scale.mV[VY]);
|
||||
gGL.vertex3fv(bottom_border_height.mV);
|
||||
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
// draw bottom middle
|
||||
gGL.texCoord2f(border_scale.mV[VX], 0.f);
|
||||
gGL.vertex3fv(left_border_width.mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 0.f);
|
||||
gGL.vertex3fv((width_vec - right_border_width).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
// draw bottom right
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 0.f);
|
||||
gGL.vertex3fv((width_vec - right_border_width).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f, 0.f);
|
||||
gGL.texCoord2f(clip_rect.mRight, clip_rect.mBottom);
|
||||
gGL.vertex3fv(width_vec.mV);
|
||||
|
||||
gGL.texCoord2f(1.f, border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec + bottom_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
// draw left
|
||||
gGL.texCoord2f(0.f, border_scale.mV[VY]);
|
||||
gGL.vertex3fv(bottom_border_height.mV);
|
||||
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(0.f, 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
// draw middle
|
||||
gGL.texCoord2f(border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
// draw right
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + bottom_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f, border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec + bottom_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mBottom);
|
||||
gGL.vertex3fv((width_vec + center_draw_rect.mBottom * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f, 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
// draw top left
|
||||
gGL.texCoord2f(0.f, 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f);
|
||||
gGL.vertex3fv((left_border_width + height_vec).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(0.f, 1.f);
|
||||
gGL.texCoord2f(clip_rect.mLeft, clip_rect.mTop);
|
||||
gGL.vertex3fv((height_vec).mV);
|
||||
|
||||
// draw top middle
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((left_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(border_scale.mV[VX], 1.f);
|
||||
gGL.vertex3fv((left_border_width + height_vec).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mLeft, clip_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mLeft * width_vec + height_vec).mV);
|
||||
|
||||
// draw top right
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f, 1.f - border_scale.mV[VY]);
|
||||
gGL.vertex3fv((width_vec + height_vec - top_border_height).mV);
|
||||
gGL.texCoord2f(clip_rect.mRight, center_uv_rect.mTop);
|
||||
gGL.vertex3fv((width_vec + center_draw_rect.mTop * height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f, 1.f);
|
||||
gGL.texCoord2f(clip_rect.mRight, clip_rect.mTop);
|
||||
gGL.vertex3fv((width_vec + height_vec).mV);
|
||||
|
||||
gGL.texCoord2f(1.f - border_scale.mV[VX], 1.f);
|
||||
gGL.vertex3fv((width_vec - right_border_width + height_vec).mV);
|
||||
gGL.texCoord2f(center_uv_rect.mRight, clip_rect.mTop);
|
||||
gGL.vertex3fv((center_draw_rect.mRight * width_vec + height_vec).mV);
|
||||
}
|
||||
gGL.end();
|
||||
|
||||
}
|
||||
|
||||
void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec)
|
||||
{
|
||||
gl_segmented_rect_3d_tex(border_scale, border_width, border_height, width_vec, height_vec, ROUNDED_RECT_TOP);
|
||||
}
|
||||
|
||||
void LLUI::initClass(const settings_map_t& settings,
|
||||
LLImageProviderInterface* image_provider,
|
||||
|
|
@ -2114,7 +2102,7 @@ const LLView* LLUI::resolvePath(const LLView* context, const std::string& path)
|
|||
|
||||
namespace LLInitParam
|
||||
{
|
||||
ParamValue<LLUIColor, TypeValues<LLUIColor> >::ParamValue(const LLUIColor& color)
|
||||
ParamValue<LLUIColor>::ParamValue(const LLUIColor& color)
|
||||
: super_t(color),
|
||||
red("red"),
|
||||
green("green"),
|
||||
|
|
@ -2125,7 +2113,7 @@ namespace LLInitParam
|
|||
updateBlockFromValue(false);
|
||||
}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIColor>::updateValueFromBlock()
|
||||
{
|
||||
if (control.isProvided() && !control().empty())
|
||||
{
|
||||
|
|
@ -2137,7 +2125,7 @@ namespace LLInitParam
|
|||
}
|
||||
}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool make_block_authoritative)
|
||||
void ParamValue<LLUIColor>::updateBlockFromValue(bool make_block_authoritative)
|
||||
{
|
||||
LLColor4 color = getValue();
|
||||
red.set(color.mV[VRED], make_block_authoritative);
|
||||
|
|
@ -2153,7 +2141,7 @@ namespace LLInitParam
|
|||
&& !(b->getFontDesc() < a->getFontDesc());
|
||||
}
|
||||
|
||||
ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::ParamValue(const LLFontGL* fontp)
|
||||
ParamValue<const LLFontGL*>::ParamValue(const LLFontGL* fontp)
|
||||
: super_t(fontp),
|
||||
name("name"),
|
||||
size("size"),
|
||||
|
|
@ -2167,7 +2155,7 @@ namespace LLInitParam
|
|||
updateBlockFromValue(false);
|
||||
}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock()
|
||||
void ParamValue<const LLFontGL*>::updateValueFromBlock()
|
||||
{
|
||||
const LLFontGL* res_fontp = LLFontGL::getFontByName(name);
|
||||
if (res_fontp)
|
||||
|
|
@ -2190,7 +2178,7 @@ namespace LLInitParam
|
|||
}
|
||||
}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool make_block_authoritative)
|
||||
void ParamValue<const LLFontGL*>::updateBlockFromValue(bool make_block_authoritative)
|
||||
{
|
||||
if (getValue())
|
||||
{
|
||||
|
|
@ -2200,7 +2188,7 @@ namespace LLInitParam
|
|||
}
|
||||
}
|
||||
|
||||
ParamValue<LLRect, TypeValues<LLRect> >::ParamValue(const LLRect& rect)
|
||||
ParamValue<LLRect>::ParamValue(const LLRect& rect)
|
||||
: super_t(rect),
|
||||
left("left"),
|
||||
top("top"),
|
||||
|
|
@ -2212,7 +2200,7 @@ namespace LLInitParam
|
|||
updateBlockFromValue(false);
|
||||
}
|
||||
|
||||
void ParamValue<LLRect, TypeValues<LLRect> >::updateValueFromBlock()
|
||||
void ParamValue<LLRect>::updateValueFromBlock()
|
||||
{
|
||||
LLRect rect;
|
||||
|
||||
|
|
@ -2276,7 +2264,7 @@ namespace LLInitParam
|
|||
updateValue(rect);
|
||||
}
|
||||
|
||||
void ParamValue<LLRect, TypeValues<LLRect> >::updateBlockFromValue(bool make_block_authoritative)
|
||||
void ParamValue<LLRect>::updateBlockFromValue(bool make_block_authoritative)
|
||||
{
|
||||
// because of the ambiguity in specifying a rect by position and/or dimensions
|
||||
// we use the lowest priority pairing so that any valid pairing in xui
|
||||
|
|
@ -2293,7 +2281,7 @@ namespace LLInitParam
|
|||
height.set(value.getHeight(), make_block_authoritative);
|
||||
}
|
||||
|
||||
ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::ParamValue(const LLCoordGL& coord)
|
||||
ParamValue<LLCoordGL>::ParamValue(const LLCoordGL& coord)
|
||||
: super_t(coord),
|
||||
x("x"),
|
||||
y("y")
|
||||
|
|
@ -2301,12 +2289,12 @@ namespace LLInitParam
|
|||
updateBlockFromValue(false);
|
||||
}
|
||||
|
||||
void ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::updateValueFromBlock()
|
||||
void ParamValue<LLCoordGL>::updateValueFromBlock()
|
||||
{
|
||||
updateValue(LLCoordGL(x, y));
|
||||
}
|
||||
|
||||
void ParamValue<LLCoordGL, TypeValues<LLCoordGL> >::updateBlockFromValue(bool make_block_authoritative)
|
||||
void ParamValue<LLCoordGL>::updateBlockFromValue(bool make_block_authoritative)
|
||||
{
|
||||
x.set(getValue().mX, make_block_authoritative);
|
||||
y.set(getValue().mY, make_block_authoritative);
|
||||
|
|
|
|||
|
|
@ -127,8 +127,7 @@ typedef enum e_rounded_edge
|
|||
|
||||
void gl_segmented_rect_2d_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const U32 edges = ROUNDED_RECT_ALL);
|
||||
void gl_segmented_rect_2d_fragment_tex(const S32 left, const S32 top, const S32 right, const S32 bottom, const S32 texture_width, const S32 texture_height, const S32 border_size, const F32 start_fragment, const F32 end_fragment, const U32 edges = ROUNDED_RECT_ALL);
|
||||
void gl_segmented_rect_3d_tex(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec, U32 edges = ROUNDED_RECT_ALL);
|
||||
void gl_segmented_rect_3d_tex_top(const LLVector2& border_scale, const LLVector3& border_width, const LLVector3& border_height, const LLVector3& width_vec, const LLVector3& height_vec);
|
||||
void gl_segmented_rect_3d_tex(const LLRectf& clip_rect, const LLRectf& center_uv_rect, const LLRectf& center_draw_rect, const LLVector3& width_vec, const LLVector3& height_vec);
|
||||
|
||||
inline void gl_rect_2d( const LLRect& rect, BOOL filled )
|
||||
{
|
||||
|
|
@ -512,7 +511,7 @@ public:
|
|||
namespace LLInitParam
|
||||
{
|
||||
template<>
|
||||
class ParamValue<LLRect, TypeValues<LLRect> >
|
||||
class ParamValue<LLRect>
|
||||
: public CustomParamValue<LLRect>
|
||||
{
|
||||
typedef CustomParamValue<LLRect> super_t;
|
||||
|
|
@ -531,7 +530,7 @@ namespace LLInitParam
|
|||
};
|
||||
|
||||
template<>
|
||||
class ParamValue<LLUIColor, TypeValues<LLUIColor> >
|
||||
class ParamValue<LLUIColor>
|
||||
: public CustomParamValue<LLUIColor>
|
||||
{
|
||||
typedef CustomParamValue<LLUIColor> super_t;
|
||||
|
|
@ -549,7 +548,7 @@ namespace LLInitParam
|
|||
};
|
||||
|
||||
template<>
|
||||
class ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >
|
||||
class ParamValue<const LLFontGL*>
|
||||
: public CustomParamValue<const LLFontGL* >
|
||||
{
|
||||
typedef CustomParamValue<const LLFontGL*> super_t;
|
||||
|
|
@ -589,7 +588,7 @@ namespace LLInitParam
|
|||
|
||||
|
||||
template<>
|
||||
class ParamValue<LLCoordGL, TypeValues<LLCoordGL> >
|
||||
class ParamValue<LLCoordGL>
|
||||
: public CustomParamValue<LLCoordGL>
|
||||
{
|
||||
typedef CustomParamValue<LLCoordGL> super_t;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,50 @@ void LLUIImage::drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4&
|
|||
drawSolid(border_rect, color);
|
||||
}
|
||||
|
||||
void LLUIImage::draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, const LLVector3& y_axis,
|
||||
const LLRect& rect, const LLColor4& color)
|
||||
{
|
||||
F32 border_scale = 1.f;
|
||||
F32 border_height = (1.f - mScaleRegion.getHeight()) * getHeight();
|
||||
F32 border_width = (1.f - mScaleRegion.getWidth()) * getWidth();
|
||||
if (rect.getHeight() < border_height || rect.getWidth() < border_width)
|
||||
{
|
||||
if(border_height - rect.getHeight() > border_width - rect.getWidth())
|
||||
{
|
||||
border_scale = (F32)rect.getHeight() / border_height;
|
||||
}
|
||||
else
|
||||
{
|
||||
border_scale = (F32)rect.getWidth() / border_width;
|
||||
}
|
||||
}
|
||||
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLVector3 rect_origin = origin_agent + (rect.mLeft * x_axis) + (rect.mBottom * y_axis);
|
||||
LLUI::translate(rect_origin.mV[VX],
|
||||
rect_origin.mV[VY],
|
||||
rect_origin.mV[VZ]);
|
||||
gGL.getTexUnit(0)->bind(getImage());
|
||||
gGL.color4fv(color.mV);
|
||||
|
||||
LLRectf center_uv_rect(mClipRegion.mLeft + mScaleRegion.mLeft * mClipRegion.getWidth(),
|
||||
mClipRegion.mBottom + mScaleRegion.mTop * mClipRegion.getHeight(),
|
||||
mClipRegion.mLeft + mScaleRegion.mRight * mClipRegion.getWidth(),
|
||||
mClipRegion.mBottom + mScaleRegion.mBottom * mClipRegion.getHeight());
|
||||
gl_segmented_rect_3d_tex(mClipRegion,
|
||||
center_uv_rect,
|
||||
LLRectf(border_width * border_scale * 0.5f / (F32)rect.getWidth(),
|
||||
(rect.getHeight() - (border_height * border_scale * 0.5f)) / (F32)rect.getHeight(),
|
||||
(rect.getWidth() - (border_width * border_scale * 0.5f)) / (F32)rect.getWidth(),
|
||||
(border_height * border_scale * 0.5f) / (F32)rect.getHeight()),
|
||||
rect.getWidth() * x_axis,
|
||||
rect.getHeight() * y_axis);
|
||||
|
||||
} LLUI::popMatrix();
|
||||
}
|
||||
|
||||
|
||||
S32 LLUIImage::getWidth() const
|
||||
{
|
||||
// return clipped dimensions of actual image area
|
||||
|
|
@ -155,7 +199,7 @@ void LLUIImage::onImageLoaded()
|
|||
|
||||
namespace LLInitParam
|
||||
{
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIImage*>::updateValueFromBlock()
|
||||
{
|
||||
// The keyword "none" is specifically requesting a null image
|
||||
// do not default to current value. Used to overwrite template images.
|
||||
|
|
@ -172,7 +216,7 @@ namespace LLInitParam
|
|||
}
|
||||
}
|
||||
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool make_block_authoritative)
|
||||
void ParamValue<LLUIImage*>::updateBlockFromValue(bool make_block_authoritative)
|
||||
{
|
||||
if (getValue() == NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ public:
|
|||
void drawBorder(S32 x, S32 y, S32 width, S32 height, const LLColor4& color, S32 border_width) const;
|
||||
void drawBorder(const LLRect& rect, const LLColor4& color, S32 border_width) const { drawBorder(rect.mLeft, rect.mBottom, rect.getWidth(), rect.getHeight(), color, border_width); }
|
||||
void drawBorder(S32 x, S32 y, const LLColor4& color, S32 border_width) const { drawBorder(x, y, getWidth(), getHeight(), color, border_width); }
|
||||
|
||||
|
||||
void draw3D(const LLVector3& origin_agent, const LLVector3& x_axis, const LLVector3& y_axis, const LLRect& rect, const LLColor4& color);
|
||||
|
||||
const std::string& getName() const { return mName; }
|
||||
|
||||
virtual S32 getWidth() const;
|
||||
|
|
@ -92,7 +94,7 @@ protected:
|
|||
namespace LLInitParam
|
||||
{
|
||||
template<>
|
||||
class ParamValue<LLUIImage*, TypeValues<LLUIImage*> >
|
||||
class ParamValue<LLUIImage*>
|
||||
: public CustomParamValue<LLUIImage*>
|
||||
{
|
||||
typedef boost::add_reference<boost::add_const<LLUIImage*>::type>::type T_const_ref;
|
||||
|
|
@ -100,7 +102,7 @@ namespace LLInitParam
|
|||
public:
|
||||
Optional<std::string> name;
|
||||
|
||||
ParamValue(LLUIImage* const& image)
|
||||
ParamValue(LLUIImage* const& image = NULL)
|
||||
: super_t(image)
|
||||
{
|
||||
updateBlockFromValue(false);
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ namespace LLInitParam
|
|||
mEnclosingBlockOffset = (U16)(my_addr - block_addr);
|
||||
}
|
||||
|
||||
void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
|
||||
void BlockDescriptor::addParam(const ParamDescriptorPtr in_param, const char* char_name){}
|
||||
void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
|
||||
param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;}
|
||||
|
||||
|
|
@ -127,14 +127,14 @@ namespace LLInitParam
|
|||
bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; }
|
||||
bool BaseBlock::validateBlock(bool emit_errors) const { return true; }
|
||||
|
||||
ParamValue<LLUIColor, TypeValues<LLUIColor> >::ParamValue(const LLUIColor& color)
|
||||
ParamValue<LLUIColor>::ParamValue(const LLUIColor& color)
|
||||
: super_t(color)
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIColor>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool)
|
||||
void ParamValue<LLUIColor>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b)
|
||||
|
|
@ -142,14 +142,14 @@ namespace LLInitParam
|
|||
return false;
|
||||
}
|
||||
|
||||
ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::ParamValue(const LLFontGL* fontp)
|
||||
ParamValue<const LLFontGL*>::ParamValue(const LLFontGL* fontp)
|
||||
: super_t(fontp)
|
||||
{}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock()
|
||||
void ParamValue<const LLFontGL*>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool)
|
||||
void ParamValue<const LLFontGL*>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
void TypeValues<LLFontGL::HAlign>::declareValues()
|
||||
|
|
@ -161,10 +161,10 @@ namespace LLInitParam
|
|||
void TypeValues<LLFontGL::ShadowType>::declareValues()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIImage*>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool)
|
||||
void ParamValue<LLUIImage*>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ namespace LLInitParam
|
|||
S32 max_count){}
|
||||
ParamDescriptor::~ParamDescriptor() {}
|
||||
|
||||
void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name){}
|
||||
void BlockDescriptor::addParam(const ParamDescriptorPtr in_param, const char* char_name){}
|
||||
param_handle_t BaseBlock::getHandleFromParam(const Param* param) const {return 0;}
|
||||
void BaseBlock::addSynonym(Param& param, const std::string& synonym) {}
|
||||
|
||||
|
|
@ -97,14 +97,14 @@ namespace LLInitParam
|
|||
bool BaseBlock::mergeBlock(BlockDescriptor& block_data, const BaseBlock& other, bool overwrite) { return true; }
|
||||
bool BaseBlock::validateBlock(bool emit_errors) const { return true; }
|
||||
|
||||
ParamValue<LLUIColor, TypeValues<LLUIColor> >::ParamValue(const LLUIColor& color)
|
||||
ParamValue<LLUIColor>::ParamValue(const LLUIColor& color)
|
||||
: super_t(color)
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIColor>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIColor, TypeValues<LLUIColor> >::updateBlockFromValue(bool)
|
||||
void ParamValue<LLUIColor>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
bool ParamCompare<const LLFontGL*, false>::equals(const LLFontGL* a, const LLFontGL* b)
|
||||
|
|
@ -113,14 +113,14 @@ namespace LLInitParam
|
|||
}
|
||||
|
||||
|
||||
ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::ParamValue(const LLFontGL* fontp)
|
||||
ParamValue<const LLFontGL*>::ParamValue(const LLFontGL* fontp)
|
||||
: super_t(fontp)
|
||||
{}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateValueFromBlock()
|
||||
void ParamValue<const LLFontGL*>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<const LLFontGL*, TypeValues<const LLFontGL*> >::updateBlockFromValue(bool)
|
||||
void ParamValue<const LLFontGL*>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
void TypeValues<LLFontGL::HAlign>::declareValues()
|
||||
|
|
@ -132,10 +132,10 @@ namespace LLInitParam
|
|||
void TypeValues<LLFontGL::ShadowType>::declareValues()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateValueFromBlock()
|
||||
void ParamValue<LLUIImage*>::updateValueFromBlock()
|
||||
{}
|
||||
|
||||
void ParamValue<LLUIImage*, TypeValues<LLUIImage*> >::updateBlockFromValue(bool)
|
||||
void ParamValue<LLUIImage*>::updateBlockFromValue(bool)
|
||||
{}
|
||||
|
||||
bool ParamCompare<LLUIImage*, false>::equals(
|
||||
|
|
|
|||
|
|
@ -112,6 +112,35 @@ namespace LLInitParam
|
|||
std::copy(src_block_data.mAllParams.begin(), src_block_data.mAllParams.end(), std::back_inserter(mAllParams));
|
||||
}
|
||||
|
||||
void BlockDescriptor::addParam(const ParamDescriptorPtr in_param, const char* char_name)
|
||||
{
|
||||
// create a copy of the param descriptor in mAllParams
|
||||
// so other data structures can store a pointer to it
|
||||
mAllParams.push_back(in_param);
|
||||
ParamDescriptorPtr param(mAllParams.back());
|
||||
|
||||
std::string name(char_name);
|
||||
if ((size_t)param->mParamHandle > mMaxParamOffset)
|
||||
{
|
||||
llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
|
||||
}
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
mUnnamedParams.push_back(param);
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't use insert, since we want to overwrite existing entries
|
||||
mNamedParams[name] = param;
|
||||
}
|
||||
|
||||
if (param->mValidationFunc)
|
||||
{
|
||||
mValidationList.push_back(std::make_pair(param->mParamHandle, param->mValidationFunc));
|
||||
}
|
||||
}
|
||||
|
||||
BlockDescriptor::BlockDescriptor()
|
||||
: mMaxParamOffset(0),
|
||||
mInitializationState(UNINITIALIZED),
|
||||
|
|
@ -358,36 +387,6 @@ namespace LLInitParam
|
|||
return false;
|
||||
}
|
||||
|
||||
//static
|
||||
void BaseBlock::addParam(BlockDescriptor& block_data, const ParamDescriptorPtr in_param, const char* char_name)
|
||||
{
|
||||
// create a copy of the param descriptor in mAllParams
|
||||
// so other data structures can store a pointer to it
|
||||
block_data.mAllParams.push_back(in_param);
|
||||
ParamDescriptorPtr param(block_data.mAllParams.back());
|
||||
|
||||
std::string name(char_name);
|
||||
if ((size_t)param->mParamHandle > block_data.mMaxParamOffset)
|
||||
{
|
||||
llerrs << "Attempted to register param with block defined for parent class, make sure to derive from LLInitParam::Block<YOUR_CLASS, PARAM_BLOCK_BASE_CLASS>" << llendl;
|
||||
}
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
block_data.mUnnamedParams.push_back(param);
|
||||
}
|
||||
else
|
||||
{
|
||||
// don't use insert, since we want to overwrite existing entries
|
||||
block_data.mNamedParams[name] = param;
|
||||
}
|
||||
|
||||
if (param->mValidationFunc)
|
||||
{
|
||||
block_data.mValidationList.push_back(std::make_pair(param->mParamHandle, param->mValidationFunc));
|
||||
}
|
||||
}
|
||||
|
||||
void BaseBlock::addSynonym(Param& param, const std::string& synonym)
|
||||
{
|
||||
BlockDescriptor& block_data = mostDerivedBlockDescriptor();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -42,7 +42,7 @@
|
|||
#include <boost/spirit/include/classic_core.hpp>
|
||||
|
||||
#include "lluicolor.h"
|
||||
|
||||
#include "v3math.h"
|
||||
using namespace BOOST_SPIRIT_CLASSIC_NS;
|
||||
|
||||
const S32 MAX_STRING_ATTRIBUTE_SIZE = 40;
|
||||
|
|
@ -79,7 +79,6 @@ struct Occurs : public LLInitParam::Block<Occurs>
|
|||
{}
|
||||
};
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
USE_REQUIRED,
|
||||
|
|
@ -101,14 +100,23 @@ namespace LLInitParam
|
|||
|
||||
struct Element;
|
||||
struct Group;
|
||||
struct Choice;
|
||||
struct Sequence;
|
||||
struct Any;
|
||||
|
||||
struct All : public LLInitParam::Block<All, Occurs>
|
||||
{
|
||||
Multiple< Lazy<Element, IS_A_BLOCK> > elements;
|
||||
|
||||
All()
|
||||
: elements("element")
|
||||
{
|
||||
maxOccurs = 1;
|
||||
}
|
||||
};
|
||||
|
||||
struct Attribute : public LLInitParam::Block<Attribute>
|
||||
{
|
||||
Mandatory<std::string> name;
|
||||
Mandatory<std::string> type;
|
||||
Mandatory<std::string> name,
|
||||
type;
|
||||
Mandatory<EUse> use;
|
||||
|
||||
Attribute()
|
||||
|
|
@ -127,24 +135,13 @@ struct Any : public LLInitParam::Block<Any, Occurs>
|
|||
{}
|
||||
};
|
||||
|
||||
struct All : public LLInitParam::Block<All, Occurs>
|
||||
{
|
||||
Multiple< Lazy<Element> > elements;
|
||||
|
||||
All()
|
||||
: elements("element")
|
||||
{
|
||||
maxOccurs = 1;
|
||||
}
|
||||
};
|
||||
|
||||
struct Choice : public LLInitParam::ChoiceBlock<Choice, Occurs>
|
||||
{
|
||||
Alternative< Lazy<Element> > element;
|
||||
Alternative< Lazy<Group> > group;
|
||||
Alternative< Lazy<Choice> > choice;
|
||||
Alternative< Lazy<Sequence> > sequence;
|
||||
Alternative< Lazy<Any> > any;
|
||||
Alternative< Lazy<Element, IS_A_BLOCK> > element;
|
||||
Alternative< Lazy<Group, IS_A_BLOCK> > group;
|
||||
Alternative< Lazy<Choice, IS_A_BLOCK> > choice;
|
||||
Alternative< Lazy<Sequence, IS_A_BLOCK> > sequence;
|
||||
Alternative< Lazy<Any> > any;
|
||||
|
||||
Choice()
|
||||
: element("element"),
|
||||
|
|
@ -158,11 +155,11 @@ struct Choice : public LLInitParam::ChoiceBlock<Choice, Occurs>
|
|||
|
||||
struct Sequence : public LLInitParam::ChoiceBlock<Sequence, Occurs>
|
||||
{
|
||||
Alternative< Lazy<Element> > element;
|
||||
Alternative< Lazy<Group> > group;
|
||||
Alternative< Lazy<Choice> > choice;
|
||||
Alternative< Lazy<Sequence> > sequence;
|
||||
Alternative< Lazy<Any> > any;
|
||||
Alternative< Lazy<Element, IS_A_BLOCK> > element;
|
||||
Alternative< Lazy<Group, IS_A_BLOCK> > group;
|
||||
Alternative< Lazy<Choice> > choice;
|
||||
Alternative< Lazy<Sequence, IS_A_BLOCK> > sequence;
|
||||
Alternative< Lazy<Any> > any;
|
||||
};
|
||||
|
||||
struct GroupContents : public LLInitParam::ChoiceBlock<GroupContents, Occurs>
|
||||
|
|
@ -247,7 +244,7 @@ struct ComplexType : public LLInitParam::Block<ComplexType, ComplexTypeContents>
|
|||
Optional<bool> mixed;
|
||||
|
||||
Multiple<Attribute> attribute;
|
||||
Multiple< Lazy<Element> > elements;
|
||||
Multiple< Lazy<Element, IS_A_BLOCK > > elements;
|
||||
|
||||
ComplexType()
|
||||
: name("name"),
|
||||
|
|
@ -313,7 +310,6 @@ public:
|
|||
setNameSpace(ns);
|
||||
};
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
//
|
||||
|
|
@ -670,6 +666,7 @@ LLXUIParser::LLXUIParser()
|
|||
registerParserFuncs<S32>(readS32Value, writeS32Value);
|
||||
registerParserFuncs<F32>(readF32Value, writeF32Value);
|
||||
registerParserFuncs<F64>(readF64Value, writeF64Value);
|
||||
registerParserFuncs<LLVector3>(readVector3Value, writeVector3Value);
|
||||
registerParserFuncs<LLColor4>(readColor4Value, writeColor4Value);
|
||||
registerParserFuncs<LLUIColor>(readUIColorValue, writeUIColorValue);
|
||||
registerParserFuncs<LLUUID>(readUUIDValue, writeUUIDValue);
|
||||
|
|
@ -1144,6 +1141,31 @@ bool LLXUIParser::writeF64Value(Parser& parser, const void* val_ptr, name_stack_
|
|||
return false;
|
||||
}
|
||||
|
||||
bool LLXUIParser::readVector3Value(Parser& parser, void* val_ptr)
|
||||
{
|
||||
LLXUIParser& self = static_cast<LLXUIParser&>(parser);
|
||||
LLVector3* vecp = (LLVector3*)val_ptr;
|
||||
if(self.mCurReadNode->getFloatValue(3, vecp->mV) >= 3)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLXUIParser::writeVector3Value(Parser& parser, const void* val_ptr, name_stack_t& stack)
|
||||
{
|
||||
LLXUIParser& self = static_cast<LLXUIParser&>(parser);
|
||||
LLXMLNodePtr node = self.getNode(stack);
|
||||
if (node.notNull())
|
||||
{
|
||||
LLVector3 vector = *((LLVector3*)val_ptr);
|
||||
node->setFloatValue(3, vector.mV);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LLXUIParser::readColor4Value(Parser& parser, void* val_ptr)
|
||||
{
|
||||
LLXUIParser& self = static_cast<LLXUIParser&>(parser);
|
||||
|
|
|
|||
|
|
@ -127,6 +127,7 @@ private:
|
|||
static bool readS32Value(Parser& parser, void* val_ptr);
|
||||
static bool readF32Value(Parser& parser, void* val_ptr);
|
||||
static bool readF64Value(Parser& parser, void* val_ptr);
|
||||
static bool readVector3Value(Parser& parser, void* val_ptr);
|
||||
static bool readColor4Value(Parser& parser, void* val_ptr);
|
||||
static bool readUIColorValue(Parser& parser, void* val_ptr);
|
||||
static bool readUUIDValue(Parser& parser, void* val_ptr);
|
||||
|
|
@ -144,6 +145,7 @@ private:
|
|||
static bool writeS32Value(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeF32Value(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeF64Value(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeVector3Value(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeColor4Value(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeUIColorValue(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
static bool writeUUIDValue(Parser& parser, const void* val_ptr, name_stack_t&);
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@ set(viewer_SOURCE_FILES
|
|||
llfloateruipreview.cpp
|
||||
llfloaterurlentry.cpp
|
||||
llfloatervoiceeffect.cpp
|
||||
llfloatervoicevolume.cpp
|
||||
llfloaterwebcontent.cpp
|
||||
llfloaterwebprofile.cpp
|
||||
llfloaterwhitelistentry.cpp
|
||||
|
|
@ -800,6 +801,7 @@ set(viewer_HEADER_FILES
|
|||
llfloateruipreview.h
|
||||
llfloaterurlentry.h
|
||||
llfloatervoiceeffect.h
|
||||
llfloatervoicevolume.h
|
||||
llfloaterwebcontent.h
|
||||
llfloaterwebprofile.h
|
||||
llfloaterwhitelistentry.h
|
||||
|
|
|
|||
|
|
@ -808,6 +808,26 @@ void LLAvatarActions::toggleBlock(const LLUUID& id)
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLAvatarActions::toggleMuteVoice(const LLUUID& id)
|
||||
{
|
||||
std::string name;
|
||||
gCacheName->getFullName(id, name); // needed for mute
|
||||
|
||||
LLMuteList* mute_list = LLMuteList::getInstance();
|
||||
bool is_muted = mute_list->isMuted(id, LLMute::flagVoiceChat);
|
||||
|
||||
LLMute mute(id, name, LLMute::AGENT);
|
||||
if (!is_muted)
|
||||
{
|
||||
mute_list->add(mute, LLMute::flagVoiceChat);
|
||||
}
|
||||
else
|
||||
{
|
||||
mute_list->remove(mute, LLMute::flagVoiceChat);
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::canOfferTeleport(const LLUUID& id)
|
||||
{
|
||||
|
|
@ -1022,6 +1042,12 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
|
|||
return LLMuteList::getInstance()->isMuted(id, name);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::isVoiceMuted(const LLUUID& id)
|
||||
{
|
||||
return LLMuteList::getInstance()->isMuted(id, LLMute::flagVoiceChat);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLAvatarActions::canBlock(const LLUUID& id)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -123,6 +123,11 @@ public:
|
|||
*/
|
||||
static void toggleBlock(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Block/unblock the avatar voice.
|
||||
*/
|
||||
static void toggleMuteVoice(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* Return true if avatar with "id" is a friend
|
||||
*/
|
||||
|
|
@ -133,6 +138,11 @@ public:
|
|||
*/
|
||||
static bool isBlocked(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* @return true if the avatar voice is blocked
|
||||
*/
|
||||
static bool isVoiceMuted(const LLUUID& id);
|
||||
|
||||
/**
|
||||
* @return true if you can block the avatar
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -35,11 +35,8 @@
|
|||
|
||||
using namespace LLNotificationsUI;
|
||||
|
||||
bool LLBrowserNotification::processNotification(const LLSD& notify)
|
||||
bool LLBrowserNotification::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
if (!notification) return false;
|
||||
|
||||
LLUUID media_id = notification->getPayload()["media_id"].asUUID();
|
||||
LLMediaCtrl* media_instance = LLMediaCtrl::getInstance(media_id);
|
||||
if (media_instance)
|
||||
|
|
|
|||
|
|
@ -143,7 +143,8 @@ public:
|
|||
{
|
||||
LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT));
|
||||
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD().with("blocked_to_select", getAvatarId()));
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_people",
|
||||
LLSD().with("people_panel_tab_name", "blocked_panel").with("blocked_to_select", getAvatarId()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -335,30 +335,15 @@ void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
|
|||
/* LLNotificationChiclet implementation */
|
||||
/************************************************************************/
|
||||
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
|
||||
: LLSysWellChiclet(p)
|
||||
, mUreadSystemNotifications(0)
|
||||
: LLSysWellChiclet(p),
|
||||
mUreadSystemNotifications(0)
|
||||
{
|
||||
// connect counter handlers to the signals
|
||||
connectCounterUpdatersToSignal("notify");
|
||||
connectCounterUpdatersToSignal("groupnotify");
|
||||
connectCounterUpdatersToSignal("offer");
|
||||
|
||||
mNotificationChannel.reset(new ChicletNotificationChannel(this));
|
||||
// ensure that notification well window exists, to synchronously
|
||||
// handle toast add/delete events.
|
||||
LLNotificationWellWindow::getInstance()->setSysWellChiclet(this);
|
||||
}
|
||||
|
||||
void LLNotificationChiclet::connectCounterUpdatersToSignal(const std::string& notification_type)
|
||||
{
|
||||
LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance();
|
||||
LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type);
|
||||
if(n_handler)
|
||||
{
|
||||
n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this));
|
||||
n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this));
|
||||
}
|
||||
}
|
||||
|
||||
void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data)
|
||||
{
|
||||
std::string action = user_data.asString();
|
||||
|
|
@ -407,6 +392,18 @@ void LLNotificationChiclet::setCounter(S32 counter)
|
|||
updateWidget(getCounter() == 0);
|
||||
|
||||
}
|
||||
|
||||
bool LLNotificationChiclet::ChicletNotificationChannel::filterNotification( LLNotificationPtr notification )
|
||||
{
|
||||
if( !(notification->canLogToIM() && notification->hasFormElements())
|
||||
&& (!notification->getPayload().has("give_inventory_notification")
|
||||
|| notification->getPayload()["give_inventory_notification"]))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "lloutputmonitorctrl.h"
|
||||
#include "llgroupmgr.h"
|
||||
#include "llimview.h"
|
||||
#include "llnotifications.h"
|
||||
|
||||
class LLMenuGL;
|
||||
class LLIMFloater;
|
||||
|
|
@ -911,11 +912,35 @@ protected:
|
|||
|
||||
class LLNotificationChiclet : public LLSysWellChiclet
|
||||
{
|
||||
LOG_CLASS(LLNotificationChiclet);
|
||||
|
||||
friend class LLUICtrlFactory;
|
||||
public:
|
||||
struct Params : public LLInitParam::Block<Params, LLSysWellChiclet::Params>{};
|
||||
|
||||
protected:
|
||||
struct ChicletNotificationChannel : public LLNotificationChannel
|
||||
{
|
||||
ChicletNotificationChannel(LLNotificationChiclet* chiclet)
|
||||
: LLNotificationChannel(LLNotificationChannel::Params().filter(filterNotification).name(chiclet->getSessionId().asString())),
|
||||
mChiclet(chiclet)
|
||||
{
|
||||
// connect counter handlers to the signals
|
||||
connectToChannel("Group Notifications");
|
||||
connectToChannel("Offer");
|
||||
connectToChannel("Notifications");
|
||||
}
|
||||
|
||||
static bool filterNotification(LLNotificationPtr notify);
|
||||
// connect counter updaters to the corresponding signals
|
||||
/*virtual*/ void onAdd(LLNotificationPtr p) { mChiclet->setCounter(++mChiclet->mUreadSystemNotifications); }
|
||||
/*virtual*/ void onDelete(LLNotificationPtr p) { mChiclet->setCounter(--mChiclet->mUreadSystemNotifications); }
|
||||
|
||||
LLNotificationChiclet* const mChiclet;
|
||||
};
|
||||
|
||||
boost::scoped_ptr<ChicletNotificationChannel> mNotificationChannel;
|
||||
|
||||
LLNotificationChiclet(const Params& p);
|
||||
|
||||
/**
|
||||
|
|
@ -933,12 +958,6 @@ protected:
|
|||
*/
|
||||
/*virtual*/ void createMenu();
|
||||
|
||||
// connect counter updaters to the corresponding signals
|
||||
void connectCounterUpdatersToSignal(const std::string& notification_type);
|
||||
|
||||
// methods for updating a number of unread System notifications
|
||||
void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); }
|
||||
void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); }
|
||||
/*virtual*/ void setCounter(S32 counter);
|
||||
S32 mUreadSystemNotifications;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -44,21 +44,16 @@ public:
|
|||
BOOL postBuild();
|
||||
|
||||
private:
|
||||
bool update(const LLSD& payload, bool passed_filter);
|
||||
bool update(const LLSD& payload);
|
||||
static void toggleClick(void* user_data);
|
||||
static void onClickNotification(void* user_data);
|
||||
static void onClickNotificationReject(void* user_data);
|
||||
LLNotificationChannelPtr mChannelPtr;
|
||||
LLNotificationChannelPtr mChannelRejectsPtr;
|
||||
};
|
||||
|
||||
LLNotificationChannelPanel::LLNotificationChannelPanel(const LLNotificationChannelPanel::Params& p)
|
||||
: LLLayoutPanel(p)
|
||||
{
|
||||
mChannelPtr = LLNotifications::instance().getChannel(p.name);
|
||||
mChannelRejectsPtr = LLNotificationChannelPtr(
|
||||
LLNotificationChannel::buildChannel(p.name() + "rejects", mChannelPtr->getParentChannelName(),
|
||||
!boost::bind(mChannelPtr->getFilter(), _1)));
|
||||
buildFromFile( "panel_notifications_channel.xml");
|
||||
}
|
||||
|
||||
|
|
@ -68,15 +63,11 @@ BOOL LLNotificationChannelPanel::postBuild()
|
|||
header_button->setLabel(mChannelPtr->getName());
|
||||
header_button->setClickedCallback(toggleClick, this);
|
||||
|
||||
mChannelPtr->connectChanged(boost::bind(&LLNotificationChannelPanel::update, this, _1, true));
|
||||
mChannelRejectsPtr->connectChanged(boost::bind(&LLNotificationChannelPanel::update, this, _1, false));
|
||||
mChannelPtr->connectChanged(boost::bind(&LLNotificationChannelPanel::update, this, _1));
|
||||
|
||||
LLScrollListCtrl* scroll = getChild<LLScrollListCtrl>("notifications_list");
|
||||
scroll->setDoubleClickCallback(onClickNotification, this);
|
||||
scroll->setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mRight, 0));
|
||||
scroll = getChild<LLScrollListCtrl>("notification_rejects_list");
|
||||
scroll->setDoubleClickCallback(onClickNotificationReject, this);
|
||||
scroll->setRect(LLRect( getRect().mLeft, getRect().mTop, getRect().mRight, 0));
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
|
@ -97,8 +88,6 @@ void LLNotificationChannelPanel::toggleClick(void *user_data)
|
|||
// turn off tab stop for collapsed panel
|
||||
self->getChild<LLScrollListCtrl>("notifications_list")->setTabStop(!header_button->getToggleState());
|
||||
self->getChild<LLScrollListCtrl>("notifications_list")->setVisible(!header_button->getToggleState());
|
||||
self->getChild<LLScrollListCtrl>("notification_rejects_list")->setTabStop(!header_button->getToggleState());
|
||||
self->getChild<LLScrollListCtrl>("notification_rejects_list")->setVisible(!header_button->getToggleState());
|
||||
}
|
||||
|
||||
/*static*/
|
||||
|
|
@ -118,24 +107,7 @@ void LLNotificationChannelPanel::onClickNotification(void* user_data)
|
|||
}
|
||||
}
|
||||
|
||||
/*static*/
|
||||
void LLNotificationChannelPanel::onClickNotificationReject(void* user_data)
|
||||
{
|
||||
LLNotificationChannelPanel* self = (LLNotificationChannelPanel*)user_data;
|
||||
if (!self) return;
|
||||
LLScrollListItem* firstselected = self->getChild<LLScrollListCtrl>("notification_rejects_list")->getFirstSelected();
|
||||
llassert(firstselected);
|
||||
if (firstselected)
|
||||
{
|
||||
void* data = firstselected->getUserdata();
|
||||
if (data)
|
||||
{
|
||||
gFloaterView->getParentFloater(self)->addDependentFloater(new LLFloaterNotification((LLNotification*)data), TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool LLNotificationChannelPanel::update(const LLSD& payload, bool passed_filter)
|
||||
bool LLNotificationChannelPanel::update(const LLSD& payload)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(payload["id"].asUUID());
|
||||
if (notification)
|
||||
|
|
@ -151,9 +123,7 @@ bool LLNotificationChannelPanel::update(const LLSD& payload, bool passed_filter)
|
|||
row["columns"][2]["column"] = "date";
|
||||
row["columns"][2]["type"] = "date";
|
||||
|
||||
LLScrollListItem* sli = passed_filter ?
|
||||
getChild<LLScrollListCtrl>("notifications_list")->addElement(row) :
|
||||
getChild<LLScrollListCtrl>("notification_rejects_list")->addElement(row);
|
||||
LLScrollListItem* sli = getChild<LLScrollListCtrl>("notifications_list")->addElement(row);
|
||||
sli->setUserdata(&(*notification));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,14 +44,12 @@
|
|||
#include "llviewernetwork.h"
|
||||
#include "llwindowshade.h"
|
||||
|
||||
#define USE_WINDOWSHADE_DIALOGS 0
|
||||
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLOutboxNotification class
|
||||
///----------------------------------------------------------------------------
|
||||
|
||||
bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& notify)
|
||||
bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLNotificationPtr& notify)
|
||||
{
|
||||
LLFloaterOutbox* outbox_floater = LLFloaterReg::getTypedInstance<LLFloaterOutbox>("outbox");
|
||||
|
||||
|
|
@ -60,6 +58,14 @@ bool LLNotificationsUI::LLOutboxNotification::processNotification(const LLSD& no
|
|||
return false;
|
||||
}
|
||||
|
||||
void LLNotificationsUI::LLOutboxNotification::onDelete(LLNotificationPtr p)
|
||||
{
|
||||
LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast<LLNotificationsUI::LLSysHandler*>(LLNotifications::instance().getChannel("AlertModal").get());
|
||||
if (sys_handler)
|
||||
{
|
||||
sys_handler->onDelete(p);
|
||||
}
|
||||
}
|
||||
|
||||
///----------------------------------------------------------------------------
|
||||
/// LLOutboxAddedObserver helper class
|
||||
|
|
@ -516,52 +522,11 @@ void LLFloaterOutbox::initializationReportError(U32 status, const LLSD& content)
|
|||
updateView();
|
||||
}
|
||||
|
||||
void LLFloaterOutbox::showNotification(const LLSD& notify)
|
||||
void LLFloaterOutbox::showNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if (!notification)
|
||||
{
|
||||
llerrs << "Unable to find outbox notification!" << notify.asString() << llendl;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
#if USE_WINDOWSHADE_DIALOGS
|
||||
|
||||
if (mWindowShade)
|
||||
{
|
||||
delete mWindowShade;
|
||||
}
|
||||
|
||||
LLRect floater_rect = getLocalRect();
|
||||
floater_rect.mTop -= getHeaderHeight();
|
||||
floater_rect.stretch(-5, 0);
|
||||
|
||||
LLWindowShade::Params params;
|
||||
params.name = "notification_shade";
|
||||
params.rect = floater_rect;
|
||||
params.follows.flags = FOLLOWS_ALL;
|
||||
params.modal = true;
|
||||
params.can_close = false;
|
||||
params.shade_color = LLColor4::white % 0.25f;
|
||||
params.text_color = LLColor4::white;
|
||||
|
||||
mWindowShade = LLUICtrlFactory::create<LLWindowShade>(params);
|
||||
|
||||
addChild(mWindowShade);
|
||||
mWindowShade->show(notification);
|
||||
|
||||
#else
|
||||
|
||||
LLNotificationsUI::LLEventHandler * handler =
|
||||
LLNotificationsUI::LLNotificationManager::instance().getHandlerForNotification("alertmodal");
|
||||
|
||||
LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast<LLNotificationsUI::LLSysHandler *>(handler);
|
||||
LLNotificationsUI::LLSysHandler * sys_handler = dynamic_cast<LLNotificationsUI::LLSysHandler*>(LLNotifications::instance().getChannel("AlertModal").get());
|
||||
llassert(sys_handler);
|
||||
|
||||
sys_handler->processNotification(notify);
|
||||
|
||||
#endif
|
||||
sys_handler->processNotification(notification);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ public:
|
|||
EAcceptance* accept,
|
||||
std::string& tooltip_msg);
|
||||
|
||||
void showNotification(const LLSD& notify);
|
||||
void showNotification(const LLNotificationPtr& notification);
|
||||
|
||||
BOOL handleHover(S32 x, S32 y, MASK mask);
|
||||
void onMouseLeave(S32 x, S32 y, MASK mask);
|
||||
|
|
|
|||
|
|
@ -1502,7 +1502,8 @@ void LLFloaterPreference::onChangeMaturity()
|
|||
// but the UI for this will still be enabled
|
||||
void LLFloaterPreference::onClickBlockList()
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD());
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_people",
|
||||
LLSD().with("people_panel_tab_name", "blocked_panel"));
|
||||
}
|
||||
|
||||
void LLFloaterPreference::onClickProxySettings()
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
|
|||
|
||||
if (!getVisible())
|
||||
{
|
||||
openFloater();
|
||||
openFloater();
|
||||
}
|
||||
|
||||
LLPanel* panel = NULL;
|
||||
|
|
@ -69,10 +69,7 @@ LLPanel* LLFloaterSidePanelContainer::openChildPanel(const std::string& panel_na
|
|||
LLSideTrayPanelContainer* container = dynamic_cast<LLSideTrayPanelContainer*>(view->getParent());
|
||||
if (container)
|
||||
{
|
||||
LLSD new_params = params;
|
||||
new_params[LLSideTrayPanelContainer::PARAM_SUB_PANEL_NAME] = panel_name;
|
||||
container->onOpen(new_params);
|
||||
|
||||
container->openPanel(panel_name, params);
|
||||
panel = container->getCurrentPanel();
|
||||
}
|
||||
else if ((panel = dynamic_cast<LLPanel*>(view)) != NULL)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,209 @@
|
|||
/**
|
||||
* @file llfloatervoicevolume.cpp
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#include "llviewerprecompiledheaders.h"
|
||||
|
||||
#include "llfloatervoicevolume.h"
|
||||
|
||||
// Linden libraries
|
||||
#include "llavatarname.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llfloater.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "lltextbox.h"
|
||||
|
||||
// viewer files
|
||||
#include "llagent.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llinspect.h"
|
||||
#include "lltransientfloatermgr.h"
|
||||
#include "llvoiceclient.h"
|
||||
|
||||
class LLAvatarName;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// LLFloaterVoiceVolume
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// Avatar Inspector, a small information window used when clicking
|
||||
// on avatar names in the 2D UI and in the ambient inspector widget for
|
||||
// the 3D world.
|
||||
class LLFloaterVoiceVolume : public LLInspect, LLTransientFloater
|
||||
{
|
||||
friend class LLFloaterReg;
|
||||
|
||||
public:
|
||||
// avatar_id - Avatar ID for which to show information
|
||||
// Inspector will be positioned relative to current mouse position
|
||||
LLFloaterVoiceVolume(const LLSD& avatar_id);
|
||||
virtual ~LLFloaterVoiceVolume();
|
||||
|
||||
/*virtual*/ BOOL postBuild(void);
|
||||
|
||||
// Because floater is single instance, need to re-parse data on each spawn
|
||||
// (for example, inspector about same avatar but in different position)
|
||||
/*virtual*/ void onOpen(const LLSD& avatar_id);
|
||||
|
||||
/*virtual*/ LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; }
|
||||
|
||||
private:
|
||||
// Set the volume slider to this user's current client-side volume setting,
|
||||
// hiding/disabling if the user is not nearby.
|
||||
void updateVolumeControls();
|
||||
|
||||
void onClickMuteVolume();
|
||||
void onVolumeChange(const LLSD& data);
|
||||
void onAvatarNameCache(const LLUUID& agent_id, const LLAvatarName& av_name);
|
||||
|
||||
private:
|
||||
LLUUID mAvatarID;
|
||||
// Need avatar name information to spawn friend add request
|
||||
LLAvatarName mAvatarName;
|
||||
};
|
||||
|
||||
LLFloaterVoiceVolume::LLFloaterVoiceVolume(const LLSD& sd)
|
||||
: LLInspect(LLSD()) // single_instance, doesn't really need key
|
||||
, mAvatarID() // set in onOpen() *Note: we used to show partner's name but we dont anymore --angela 3rd Dec*
|
||||
, mAvatarName()
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this);
|
||||
LLTransientFloater::init(this);
|
||||
}
|
||||
|
||||
LLFloaterVoiceVolume::~LLFloaterVoiceVolume()
|
||||
{
|
||||
LLTransientFloaterMgr::getInstance()->removeControlView(this);
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
BOOL LLFloaterVoiceVolume::postBuild(void)
|
||||
{
|
||||
getChild<LLUICtrl>("mute_btn")->setCommitCallback(
|
||||
boost::bind(&LLFloaterVoiceVolume::onClickMuteVolume, this) );
|
||||
|
||||
getChild<LLUICtrl>("volume_slider")->setCommitCallback(
|
||||
boost::bind(&LLFloaterVoiceVolume::onVolumeChange, this, _2));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Multiple calls to showInstance("floater_voice_volume", foo) will provide different
|
||||
// LLSD for foo, which we will catch here.
|
||||
//virtual
|
||||
void LLFloaterVoiceVolume::onOpen(const LLSD& data)
|
||||
{
|
||||
// Start open animation
|
||||
LLInspect::onOpen(data);
|
||||
|
||||
// Extract appropriate avatar id
|
||||
mAvatarID = data["avatar_id"];
|
||||
|
||||
LLUI::positionViewNearMouse(this);
|
||||
|
||||
getChild<LLUICtrl>("avatar_name")->setValue("");
|
||||
updateVolumeControls();
|
||||
|
||||
LLAvatarNameCache::get(mAvatarID,
|
||||
boost::bind(&LLFloaterVoiceVolume::onAvatarNameCache, this, _1, _2));
|
||||
}
|
||||
|
||||
void LLFloaterVoiceVolume::updateVolumeControls()
|
||||
{
|
||||
bool voice_enabled = LLVoiceClient::getInstance()->getVoiceEnabled(mAvatarID);
|
||||
|
||||
LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
|
||||
LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
|
||||
|
||||
// Do not display volume slider and mute button if it
|
||||
// is ourself or we are not in a voice channel together
|
||||
if (!voice_enabled || (mAvatarID == gAgent.getID()))
|
||||
{
|
||||
mute_btn->setVisible(false);
|
||||
volume_slider->setVisible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
mute_btn->setVisible(true);
|
||||
volume_slider->setVisible(true);
|
||||
|
||||
// By convention, we only display and toggle voice mutes, not all mutes
|
||||
bool is_muted = LLAvatarActions::isVoiceMuted(mAvatarID);
|
||||
bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden");
|
||||
|
||||
mute_btn->setEnabled(!is_linden);
|
||||
mute_btn->setValue(is_muted);
|
||||
|
||||
volume_slider->setEnabled(!is_muted);
|
||||
|
||||
F32 volume;
|
||||
if (is_muted)
|
||||
{
|
||||
// it's clearer to display their volume as zero
|
||||
volume = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// actual volume
|
||||
volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID);
|
||||
}
|
||||
volume_slider->setValue((F64)volume);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LLFloaterVoiceVolume::onClickMuteVolume()
|
||||
{
|
||||
LLAvatarActions::toggleMuteVoice(mAvatarID);
|
||||
updateVolumeControls();
|
||||
}
|
||||
|
||||
void LLFloaterVoiceVolume::onVolumeChange(const LLSD& data)
|
||||
{
|
||||
F32 volume = (F32)data.asReal();
|
||||
LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume);
|
||||
}
|
||||
|
||||
void LLFloaterVoiceVolume::onAvatarNameCache(
|
||||
const LLUUID& agent_id,
|
||||
const LLAvatarName& av_name)
|
||||
{
|
||||
if (agent_id != mAvatarID)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
getChild<LLUICtrl>("avatar_name")->setValue(av_name.getCompleteName());
|
||||
mAvatarName = av_name;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// LLFloaterVoiceVolumeUtil
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
void LLFloaterVoiceVolumeUtil::registerFloater()
|
||||
{
|
||||
LLFloaterReg::add("floater_voice_volume", "floater_voice_volume.xml",
|
||||
&LLFloaterReg::build<LLFloaterVoiceVolume>);
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
/**
|
||||
* @file llfloatervoicevolume.h
|
||||
*
|
||||
* $LicenseInfo:firstyear=2012&license=viewerlgpl$
|
||||
* Second Life Viewer Source Code
|
||||
* Copyright (C) 2012, Linden Research, Inc.
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation;
|
||||
* version 2.1 of the License only.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
|
||||
* $/LicenseInfo$
|
||||
*/
|
||||
|
||||
#ifndef LL_LLFLOATERVOICEVOLUME_H
|
||||
#define LL_LLFLOATERVOICEVOLUME_H
|
||||
|
||||
namespace LLFloaterVoiceVolumeUtil
|
||||
{
|
||||
// Register with LLFloaterReg
|
||||
void registerFloater();
|
||||
}
|
||||
|
||||
#endif // LL_LLFLOATERVOICEVOLUME_H
|
||||
|
|
@ -176,6 +176,7 @@ LLFolderView::Params::Params()
|
|||
show_load_status("show_load_status", true),
|
||||
use_ellipses("use_ellipses", false)
|
||||
{
|
||||
folder_indentation = -4;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -224,10 +225,7 @@ LLFolderView::LLFolderView(const Params& p)
|
|||
mAutoOpenCandidate = NULL;
|
||||
mAutoOpenTimer.stop();
|
||||
mKeyboardSelection = FALSE;
|
||||
const LLFolderViewItem::Params& item_params =
|
||||
LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
|
||||
S32 indentation = item_params.folder_indentation();
|
||||
mIndentation = -indentation; // children start at indentation 0
|
||||
mIndentation = p.folder_indentation;
|
||||
gIdleCallbacks.addFunction(idle, this);
|
||||
|
||||
//clear label
|
||||
|
|
@ -235,7 +233,6 @@ LLFolderView::LLFolderView(const Params& p)
|
|||
// just make sure the label ("Inventory Folder") never shows up
|
||||
mLabel = LLStringUtil::null;
|
||||
|
||||
//mRenamer->setWriteableBgColor(LLColor4::white);
|
||||
// Escape is handled by reverting the rename, not commiting it (default behavior)
|
||||
LLLineEditor::Params params;
|
||||
params.name("ren");
|
||||
|
|
@ -527,7 +524,7 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent)
|
|||
LLView::reshape(width, height, called_from_parent);
|
||||
scroll_rect = mScrollContainer->getContentWindowRect();
|
||||
}
|
||||
width = llmax(mMinWidth, scroll_rect.getWidth());
|
||||
width = llmax(mMinWidth, scroll_rect.getWidth());
|
||||
height = llmax(mRunningHeight, scroll_rect.getHeight());
|
||||
|
||||
// Restrict width within scroll container's width
|
||||
|
|
@ -1921,21 +1918,11 @@ BOOL LLFolderView::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
|
|||
|
||||
// when drop is not handled by child, it should be handled
|
||||
// by the folder which is the hierarchy root.
|
||||
if (!handled)
|
||||
{
|
||||
if (getListener()->getUUID().notNull())
|
||||
if (!handled
|
||||
&& getListener()->getUUID().notNull())
|
||||
{
|
||||
handled = LLFolderViewFolder::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!mFolders.empty())
|
||||
{
|
||||
// dispatch to last folder as a hack to support "Contents" folder in object inventory
|
||||
handled = mFolders.back()->handleDragAndDropFromChild(mask,drop,cargo_type,cargo_data,accept,tooltip_msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (handled)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -187,14 +187,6 @@ public:
|
|||
// public rename functionality - can only start the process
|
||||
void startRenamingSelectedItem( void );
|
||||
|
||||
// These functions were used when there was only one folderview,
|
||||
// and relied on that concept. This functionality is now handled
|
||||
// by the listeners and the lldraganddroptool.
|
||||
//LLFolderViewItem* getMovingItem() { return mMovingItem; }
|
||||
//void setMovingItem( LLFolderViewItem* item ) { mMovingItem = item; }
|
||||
//void dragItemIntoFolder( LLFolderViewItem* moving_item, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept );
|
||||
//void dragFolderIntoFolder( LLFolderViewFolder* moving_folder, LLFolderViewFolder* dst_folder, BOOL drop, BOOL* accept );
|
||||
|
||||
// LLView functionality
|
||||
///*virtual*/ BOOL handleKey( KEY key, MASK mask, BOOL called_from_parent );
|
||||
/*virtual*/ BOOL handleKeyHere( KEY key, MASK mask );
|
||||
|
|
|
|||
|
|
@ -417,9 +417,8 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation)
|
|||
const Params& p = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
|
||||
S32 indentation = p.folder_indentation();
|
||||
// Only indent deeper items in hierarchy
|
||||
mIndentation = (getParentFolder()
|
||||
&& getParentFolder()->getParentFolder() )
|
||||
? mParentFolder->getIndentation() + indentation
|
||||
mIndentation = (getParentFolder())
|
||||
? getParentFolder()->getIndentation() + indentation
|
||||
: 0;
|
||||
if (mLabelWidthDirty)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ std::vector<LLFollowCamParams*> LLFollowCamMgr::sParamStack;
|
|||
//-------------------------------------------------------
|
||||
// constants
|
||||
//-------------------------------------------------------
|
||||
const F32 ONE_HALF = 0.5;
|
||||
const F32 FOLLOW_CAM_ZOOM_FACTOR = 0.1f;
|
||||
const F32 FOLLOW_CAM_MIN_ZOOM_AMOUNT = 0.1f;
|
||||
const F32 DISTANCE_EPSILON = 0.0001f;
|
||||
|
|
|
|||
|
|
@ -166,7 +166,6 @@ BOOL LLHUDNameTag::lineSegmentIntersect(const LLVector3& start, const LLVector3&
|
|||
}
|
||||
|
||||
// scale screen size of borders down
|
||||
//RN: for now, text on hud objects is never occluded
|
||||
|
||||
LLVector3 x_pixel_vec;
|
||||
LLVector3 y_pixel_vec;
|
||||
|
|
@ -187,45 +186,29 @@ BOOL LLHUDNameTag::lineSegmentIntersect(const LLVector3& start, const LLVector3&
|
|||
+ (y_pixel_vec * screen_offset.mV[VY]);
|
||||
|
||||
|
||||
//if (mUseBubble)
|
||||
LLVector3 bg_pos = render_position
|
||||
+ (F32)mOffsetY * y_pixel_vec
|
||||
- (width_vec / 2.f)
|
||||
- (height_vec);
|
||||
|
||||
LLVector3 v[] =
|
||||
{
|
||||
LLVector3 bg_pos = render_position
|
||||
+ (F32)mOffsetY * y_pixel_vec
|
||||
- (width_vec / 2.f)
|
||||
- (height_vec);
|
||||
//LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]);
|
||||
bg_pos,
|
||||
bg_pos + width_vec,
|
||||
bg_pos + width_vec + height_vec,
|
||||
bg_pos + height_vec,
|
||||
};
|
||||
|
||||
LLVector3 v[] =
|
||||
LLVector3 dir = end-start;
|
||||
F32 a, b, t;
|
||||
|
||||
if (LLTriangleRayIntersect(v[0], v[1], v[2], start, dir, a, b, t, FALSE) ||
|
||||
LLTriangleRayIntersect(v[2], v[3], v[0], start, dir, a, b, t, FALSE) )
|
||||
{
|
||||
if (t <= 1.f)
|
||||
{
|
||||
bg_pos,
|
||||
bg_pos + width_vec,
|
||||
bg_pos + width_vec + height_vec,
|
||||
bg_pos + height_vec,
|
||||
};
|
||||
|
||||
if (debug_render)
|
||||
{
|
||||
gGL.begin(LLRender::LINE_STRIP);
|
||||
gGL.vertex3fv(v[0].mV);
|
||||
gGL.vertex3fv(v[1].mV);
|
||||
gGL.vertex3fv(v[2].mV);
|
||||
gGL.vertex3fv(v[3].mV);
|
||||
gGL.vertex3fv(v[0].mV);
|
||||
gGL.vertex3fv(v[2].mV);
|
||||
gGL.end();
|
||||
}
|
||||
|
||||
LLVector3 dir = end-start;
|
||||
F32 a, b, t;
|
||||
|
||||
if (LLTriangleRayIntersect(v[0], v[1], v[2], start, dir, a, b, t, FALSE) ||
|
||||
LLTriangleRayIntersect(v[2], v[3], v[0], start, dir, a, b, t, FALSE) )
|
||||
{
|
||||
if (t <= 1.f)
|
||||
{
|
||||
intersection = start + dir*t;
|
||||
return TRUE;
|
||||
}
|
||||
intersection = start + dir*t;
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -241,12 +224,6 @@ void LLHUDNameTag::render()
|
|||
}
|
||||
}
|
||||
|
||||
void LLHUDNameTag::renderForSelect()
|
||||
{
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
renderText(TRUE);
|
||||
}
|
||||
|
||||
void LLHUDNameTag::renderText(BOOL for_select)
|
||||
{
|
||||
if (!mVisible || mHidden)
|
||||
|
|
@ -299,24 +276,6 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
|||
LLColor4 bg_color = LLUIColorTable::instance().getColor("NameTagBackground");
|
||||
bg_color.setAlpha(gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
|
||||
// maybe a no-op?
|
||||
//const S32 border_height = 16;
|
||||
//const S32 border_width = 16;
|
||||
const S32 border_height = 8;
|
||||
const S32 border_width = 8;
|
||||
|
||||
// *TODO move this into helper function
|
||||
F32 border_scale = 1.f;
|
||||
|
||||
if (border_height * 2 > mHeight)
|
||||
{
|
||||
border_scale = (F32)mHeight / ((F32)border_height * 2.f);
|
||||
}
|
||||
if (border_width * 2 > mWidth)
|
||||
{
|
||||
border_scale = llmin(border_scale, (F32)mWidth / ((F32)border_width * 2.f));
|
||||
}
|
||||
|
||||
// scale screen size of borders down
|
||||
//RN: for now, text on hud objects is never occluded
|
||||
|
||||
|
|
@ -325,152 +284,34 @@ void LLHUDNameTag::renderText(BOOL for_select)
|
|||
|
||||
LLViewerCamera::getInstance()->getPixelVectors(mPositionAgent, y_pixel_vec, x_pixel_vec);
|
||||
|
||||
LLVector2 border_scale_vec((F32)border_width / (F32)imagep->getTextureWidth(), (F32)border_height / (F32)imagep->getTextureHeight());
|
||||
LLVector3 width_vec = mWidth * x_pixel_vec;
|
||||
LLVector3 height_vec = mHeight * y_pixel_vec;
|
||||
LLVector3 scaled_border_width = (F32)llfloor(border_scale * (F32)border_width) * x_pixel_vec;
|
||||
LLVector3 scaled_border_height = (F32)llfloor(border_scale * (F32)border_height) * y_pixel_vec;
|
||||
|
||||
mRadius = (width_vec + height_vec).magVec() * 0.5f;
|
||||
|
||||
LLCoordGL screen_pos;
|
||||
LLViewerCamera::getInstance()->projectPosAgentToScreen(mPositionAgent, screen_pos, FALSE);
|
||||
|
||||
LLVector2 screen_offset;
|
||||
// if (!mUseBubble)
|
||||
// {
|
||||
// screen_offset = mPositionOffset;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
screen_offset = updateScreenPos(mPositionOffset);
|
||||
// }
|
||||
LLVector2 screen_offset = updateScreenPos(mPositionOffset);
|
||||
|
||||
LLVector3 render_position = mPositionAgent
|
||||
+ (x_pixel_vec * screen_offset.mV[VX])
|
||||
+ (y_pixel_vec * screen_offset.mV[VY]);
|
||||
|
||||
// if (mUseBubble)
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
LLRect screen_rect;
|
||||
screen_rect.setCenterAndSize(0, static_cast<S32>(lltrunc(-mHeight / 2 + mOffsetY)), static_cast<S32>(lltrunc(mWidth)), static_cast<S32>(lltrunc(mHeight)));
|
||||
imagep->draw3D(render_position, x_pixel_vec, y_pixel_vec, screen_rect, bg_color);
|
||||
if (mLabelSegments.size())
|
||||
{
|
||||
LLGLDepthTest gls_depth(GL_TRUE, GL_FALSE);
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
LLVector3 bg_pos = render_position
|
||||
+ (F32)mOffsetY * y_pixel_vec
|
||||
- (width_vec / 2.f)
|
||||
- (height_vec);
|
||||
LLUI::translate(bg_pos.mV[VX], bg_pos.mV[VY], bg_pos.mV[VZ]);
|
||||
LLUIImagePtr rect_top_image = LLUI::getUIImage("Rounded_Rect_Top");
|
||||
LLRect label_top_rect = screen_rect;
|
||||
const S32 label_height = llround((mFontp->getLineHeight() * (F32)mLabelSegments.size() + (VERTICAL_PADDING / 3.f)));
|
||||
label_top_rect.mBottom = label_top_rect.mTop - label_height;
|
||||
LLColor4 label_top_color = text_color;
|
||||
label_top_color.mV[VALPHA] = gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor;
|
||||
|
||||
if (for_select)
|
||||
{
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
S32 name = mSourceObject->mGLName;
|
||||
LLColor4U coloru((U8)(name >> 16), (U8)(name >> 8), (U8)name);
|
||||
gGL.color4ubv(coloru.mV);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
|
||||
LLUI::popMatrix();
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
gGL.getTexUnit(0)->bind(imagep->getImage());
|
||||
|
||||
gGL.color4fv(bg_color.mV);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, height_vec);
|
||||
|
||||
if ( mLabelSegments.size())
|
||||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
gGL.color4f(text_color.mV[VX], text_color.mV[VY], text_color.mV[VZ], gSavedSettings.getF32("ChatBubbleOpacity") * alpha_factor);
|
||||
LLVector3 label_height = (mFontp->getLineHeight() * mLabelSegments.size() + (VERTICAL_PADDING / 3.f)) * y_pixel_vec;
|
||||
LLVector3 label_offset = height_vec - label_height;
|
||||
LLUI::translate(label_offset.mV[VX], label_offset.mV[VY], label_offset.mV[VZ]);
|
||||
gl_segmented_rect_3d_tex_top(border_scale_vec, scaled_border_width, scaled_border_height, width_vec, label_height);
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
BOOL outside_width = llabs(mPositionOffset.mV[VX]) > mWidth * 0.5f;
|
||||
BOOL outside_height = llabs(mPositionOffset.mV[VY] + (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.5f : 0.f)) > mHeight * (mVertAlignment == ALIGN_VERT_TOP ? mHeight * 0.75f : 0.5f);
|
||||
|
||||
// draw line segments pointing to parent object
|
||||
if (!mOffscreen && (outside_width || outside_height))
|
||||
{
|
||||
LLUI::pushMatrix();
|
||||
{
|
||||
gGL.color4fv(bg_color.mV);
|
||||
LLVector3 target_pos = -1.f * (mPositionOffset.mV[VX] * x_pixel_vec + mPositionOffset.mV[VY] * y_pixel_vec);
|
||||
target_pos += (width_vec / 2.f);
|
||||
target_pos += mVertAlignment == ALIGN_VERT_CENTER ? (height_vec * 0.5f) : LLVector3::zero;
|
||||
target_pos -= 3.f * x_pixel_vec;
|
||||
target_pos -= 6.f * y_pixel_vec;
|
||||
LLUI::translate(target_pos.mV[VX], target_pos.mV[VY], target_pos.mV[VZ]);
|
||||
gl_segmented_rect_3d_tex(border_scale_vec, 3.f * x_pixel_vec, 3.f * y_pixel_vec, 6.f * x_pixel_vec, 6.f * y_pixel_vec);
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
|
||||
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
LLGLDepthTest gls_depth(mZCompare ? GL_TRUE : GL_FALSE, GL_FALSE);
|
||||
|
||||
LLVector3 box_center_offset;
|
||||
box_center_offset = (width_vec * 0.5f) + (height_vec * 0.5f);
|
||||
LLUI::translate(box_center_offset.mV[VX], box_center_offset.mV[VY], box_center_offset.mV[VZ]);
|
||||
gGL.color4fv(bg_color.mV);
|
||||
LLUI::setLineWidth(2.0);
|
||||
gGL.begin(LLRender::LINES);
|
||||
{
|
||||
if (outside_width)
|
||||
{
|
||||
LLVector3 vert;
|
||||
// draw line in x then y
|
||||
if (mPositionOffset.mV[VX] < 0.f)
|
||||
{
|
||||
// start at right edge
|
||||
vert = width_vec * 0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start at left edge
|
||||
vert = width_vec * -0.5f;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
gGL.vertex3fv(vert.mV);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
vert -= mPositionOffset.mV[VY] * y_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLVector3 vert;
|
||||
// draw line in y then x
|
||||
if (mPositionOffset.mV[VY] < 0.f)
|
||||
{
|
||||
// start at top edge
|
||||
vert = (height_vec * 0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
else
|
||||
{
|
||||
// start at bottom edge
|
||||
vert = (height_vec * -0.5f) - (mPositionOffset.mV[VX] * x_pixel_vec);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
vert = -mPositionOffset.mV[VY] * y_pixel_vec - mPositionOffset.mV[VX] * x_pixel_vec;
|
||||
vert -= ((mVertAlignment == ALIGN_VERT_TOP) ? (height_vec * 0.5f) : LLVector3::zero);
|
||||
gGL.vertex3fv(vert.mV);
|
||||
}
|
||||
}
|
||||
gGL.end();
|
||||
LLUI::setLineWidth(1.0);
|
||||
|
||||
}
|
||||
}
|
||||
LLUI::popMatrix();
|
||||
rect_top_image->draw3D(render_position, x_pixel_vec, y_pixel_vec, label_top_rect, label_top_color);
|
||||
}
|
||||
|
||||
F32 y_offset = (F32)mOffsetY;
|
||||
|
|
@ -874,29 +715,26 @@ void LLHUDNameTag::updateAll()
|
|||
for (r_it = sVisibleTextObjects.rbegin(); r_it != sVisibleTextObjects.rend(); ++r_it)
|
||||
{
|
||||
LLHUDNameTag* textp = (*r_it);
|
||||
// if (textp->mUseBubble)
|
||||
// {
|
||||
if (current_screen_area / screen_area > LOD_2_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(3);
|
||||
}
|
||||
else if (current_screen_area / screen_area > LOD_1_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(2);
|
||||
}
|
||||
else if (current_screen_area / screen_area > LOD_0_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
textp->setLOD(0);
|
||||
}
|
||||
textp->updateSize();
|
||||
// find on-screen position and initialize collision rectangle
|
||||
textp->mTargetPositionOffset = textp->updateScreenPos(LLVector2::zero);
|
||||
current_screen_area += (F32)(textp->mSoftScreenRect.getWidth() * textp->mSoftScreenRect.getHeight());
|
||||
// }
|
||||
if (current_screen_area / screen_area > LOD_2_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(3);
|
||||
}
|
||||
else if (current_screen_area / screen_area > LOD_1_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(2);
|
||||
}
|
||||
else if (current_screen_area / screen_area > LOD_0_SCREEN_COVERAGE)
|
||||
{
|
||||
textp->setLOD(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
textp->setLOD(0);
|
||||
}
|
||||
textp->updateSize();
|
||||
// find on-screen position and initialize collision rectangle
|
||||
textp->mTargetPositionOffset = textp->updateScreenPos(LLVector2::zero);
|
||||
current_screen_area += (F32)(textp->mSoftScreenRect.getWidth() * textp->mSoftScreenRect.getHeight());
|
||||
}
|
||||
|
||||
LLStat* camera_vel_stat = LLViewerCamera::getInstance()->getVelocityStat();
|
||||
|
|
@ -914,20 +752,12 @@ void LLHUDNameTag::updateAll()
|
|||
{
|
||||
LLHUDNameTag* src_textp = (*src_it);
|
||||
|
||||
// if (!src_textp->mUseBubble)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
VisibleTextObjectIterator dst_it = src_it;
|
||||
++dst_it;
|
||||
for (; dst_it != sVisibleTextObjects.end(); ++dst_it)
|
||||
{
|
||||
LLHUDNameTag* dst_textp = (*dst_it);
|
||||
|
||||
// if (!dst_textp->mUseBubble)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
if (src_textp->mSoftScreenRect.overlaps(dst_textp->mSoftScreenRect))
|
||||
{
|
||||
LLRectf intersect_rect = src_textp->mSoftScreenRect;
|
||||
|
|
@ -976,10 +806,6 @@ void LLHUDNameTag::updateAll()
|
|||
VisibleTextObjectIterator this_object_it;
|
||||
for (this_object_it = sVisibleTextObjects.begin(); this_object_it != sVisibleTextObjects.end(); ++this_object_it)
|
||||
{
|
||||
// if (!(*this_object_it)->mUseBubble)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
(*this_object_it)->mPositionOffset = lerp((*this_object_it)->mPositionOffset, (*this_object_it)->mTargetPositionOffset, LLCriticalDamp::getInterpolant(POSITION_DAMPING_TC));
|
||||
}
|
||||
}
|
||||
|
|
@ -1037,10 +863,6 @@ void LLHUDNameTag::addPickable(std::set<LLViewerObject*> &pick_list)
|
|||
VisibleTextObjectIterator text_it;
|
||||
for (text_it = sVisibleTextObjects.begin(); text_it != sVisibleTextObjects.end(); ++text_it)
|
||||
{
|
||||
// if (!(*text_it)->mUseBubble)
|
||||
// {
|
||||
// continue;
|
||||
// }
|
||||
pick_list.insert((*text_it)->mSourceObject);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ public:
|
|||
/*virtual*/ void markDead();
|
||||
friend class LLHUDObject;
|
||||
/*virtual*/ F32 getDistance() const { return mLastDistance; }
|
||||
//void setUseBubble(BOOL use_bubble) { mUseBubble = use_bubble; }
|
||||
S32 getLOD() { return mLOD; }
|
||||
BOOL getVisible() { return mVisible; }
|
||||
BOOL getHidden() const { return mHidden; }
|
||||
|
|
@ -136,7 +135,6 @@ protected:
|
|||
LLHUDNameTag(const U8 type);
|
||||
|
||||
/*virtual*/ void render();
|
||||
/*virtual*/ void renderForSelect();
|
||||
void renderText(BOOL for_select);
|
||||
static void updateAll();
|
||||
void setLOD(S32 lod);
|
||||
|
|
|
|||
|
|
@ -232,9 +232,11 @@ LLHUDEffect *LLHUDObject::addHUDEffect(const U8 type)
|
|||
case LL_HUD_EFFECT_LOOKAT:
|
||||
hud_objectp = new LLHUDEffectLookAt(type);
|
||||
break;
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
case LL_HUD_EFFECT_VOICE_VISUALIZER:
|
||||
hud_objectp = new LLVoiceVisualizer(type);
|
||||
break;
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
case LL_HUD_EFFECT_POINTAT:
|
||||
hud_objectp = new LLHUDEffectPointAt(type);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -94,7 +94,9 @@ public:
|
|||
LL_HUD_EFFECT_EDIT,
|
||||
LL_HUD_EFFECT_LOOKAT,
|
||||
LL_HUD_EFFECT_POINTAT,
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
LL_HUD_EFFECT_VOICE_VISUALIZER, // Ventrella
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
LL_HUD_NAME_TAG,
|
||||
LL_HUD_EFFECT_BLOB
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,10 +37,9 @@
|
|||
using namespace LLNotificationsUI;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLIMHandler::LLIMHandler(e_notification_type type, const LLSD& id)
|
||||
LLIMHandler::LLIMHandler()
|
||||
: LLSysHandler("IM Notifications", "notifytoast")
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
mChannel = LLChannelManager::getInstance()->createNotificationChannel()->getHandle();
|
||||
}
|
||||
|
|
@ -59,26 +58,19 @@ void LLIMHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLIMHandler::processNotification(const LLSD& notify)
|
||||
bool LLIMHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
|
||||
{
|
||||
LLSD substitutions = notification->getSubstitutions();
|
||||
|
||||
// According to comments in LLIMMgr::addMessage(), if we get message
|
||||
|
|
@ -103,28 +95,12 @@ bool LLIMHandler::processNotification(const LLSD& notify)
|
|||
p.notification = notification;
|
||||
p.panel = im_box;
|
||||
p.can_be_stored = false;
|
||||
p.on_delete_toast = boost::bind(&LLIMHandler::onDeleteToast, this, _1);
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->addToast(p);
|
||||
|
||||
// send a signal to the counter manager;
|
||||
mNewNotificationSignal();
|
||||
}
|
||||
else if (notify["sigtype"].asString() == "delete")
|
||||
{
|
||||
mChannel.get()->killToastByNotificationID(notification->getID());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLIMHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
// send a signal to the counter manager
|
||||
mDelNotificationSignal();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,38 +28,21 @@
|
|||
#include "llinspectavatar.h"
|
||||
|
||||
// viewer files
|
||||
#include "llagent.h"
|
||||
#include "llagentdata.h"
|
||||
#include "llavataractions.h"
|
||||
#include "llavatariconctrl.h"
|
||||
#include "llavatarnamecache.h"
|
||||
#include "llavatarpropertiesprocessor.h"
|
||||
#include "llcallingcard.h"
|
||||
#include "lldateutil.h"
|
||||
#include "llfloaterreporter.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
#include "llimview.h"
|
||||
#include "llinspect.h"
|
||||
#include "llmutelist.h"
|
||||
#include "llpanelblockedlist.h"
|
||||
#include "llslurl.h"
|
||||
#include "llstartup.h"
|
||||
#include "llspeakers.h"
|
||||
#include "llviewermenu.h"
|
||||
#include "llvoiceclient.h"
|
||||
#include "llviewerobjectlist.h"
|
||||
#include "lltransientfloatermgr.h"
|
||||
#include "llnotificationsutil.h"
|
||||
|
||||
// Linden libraries
|
||||
#include "llfloater.h"
|
||||
#include "llfloaterreg.h"
|
||||
#include "llmenubutton.h"
|
||||
#include "lltextbox.h"
|
||||
#include "lltoggleablemenu.h"
|
||||
#include "lltooltip.h" // positionViewNearMouse()
|
||||
#include "lltrans.h"
|
||||
#include "lluictrl.h"
|
||||
|
||||
#include "llavatariconctrl.h"
|
||||
|
||||
class LLFetchAvatarData;
|
||||
|
||||
|
|
@ -81,22 +64,13 @@ public:
|
|||
LLInspectAvatar(const LLSD& avatar_id);
|
||||
virtual ~LLInspectAvatar();
|
||||
|
||||
/*virtual*/ BOOL postBuild(void);
|
||||
|
||||
// Because floater is single instance, need to re-parse data on each spawn
|
||||
// (for example, inspector about same avatar but in different position)
|
||||
/*virtual*/ void onOpen(const LLSD& avatar_id);
|
||||
|
||||
// When closing they should close their gear menu
|
||||
/*virtual*/ void onClose(bool app_quitting);
|
||||
|
||||
// Update view based on information from avatar properties processor
|
||||
void processAvatarData(LLAvatarData* data);
|
||||
|
||||
// override the inspector mouse leave so timer is only paused if
|
||||
// gear menu is not open
|
||||
/* virtual */ void onMouseLeave(S32 x, S32 y, MASK mask);
|
||||
|
||||
virtual LLTransientFloaterMgr::ETransientGroup getGroup() { return LLTransientFloaterMgr::GLOBAL; }
|
||||
|
||||
private:
|
||||
|
|
@ -104,47 +78,6 @@ private:
|
|||
// Used on construction and if avatar id changes.
|
||||
void requestUpdate();
|
||||
|
||||
// Set the volume slider to this user's current client-side volume setting,
|
||||
// hiding/disabling if the user is not nearby.
|
||||
void updateVolumeSlider();
|
||||
|
||||
// Shows/hides moderator panel depending on voice state
|
||||
void updateModeratorPanel();
|
||||
|
||||
// Moderator ability to enable/disable voice chat for avatar
|
||||
void toggleSelectedVoice(bool enabled);
|
||||
|
||||
// Button callbacks
|
||||
void onClickAddFriend();
|
||||
void onClickViewProfile();
|
||||
void onClickIM();
|
||||
void onClickCall();
|
||||
void onClickTeleport();
|
||||
void onClickInviteToGroup();
|
||||
void onClickPay();
|
||||
void onClickShare();
|
||||
void onToggleMute();
|
||||
void onClickReport();
|
||||
void onClickFreeze();
|
||||
void onClickEject();
|
||||
void onClickKick();
|
||||
void onClickCSR();
|
||||
void onClickZoomIn();
|
||||
void onClickFindOnMap();
|
||||
bool onVisibleFindOnMap();
|
||||
bool onVisibleEject();
|
||||
bool onVisibleFreeze();
|
||||
bool onVisibleZoomIn();
|
||||
void onClickMuteVolume();
|
||||
void onVolumeChange(const LLSD& data);
|
||||
bool enableMute();
|
||||
bool enableUnmute();
|
||||
bool enableTeleportOffer();
|
||||
bool godModeEnabled();
|
||||
|
||||
// Is used to determine if "Add friend" option should be enabled in gear menu
|
||||
bool isNotFriend();
|
||||
|
||||
void onAvatarNameCache(const LLUUID& agent_id,
|
||||
const LLAvatarName& av_name);
|
||||
|
||||
|
|
@ -209,39 +142,8 @@ LLInspectAvatar::LLInspectAvatar(const LLSD& sd)
|
|||
mAvatarName(),
|
||||
mPropertiesRequest(NULL)
|
||||
{
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.ViewProfile", boost::bind(&LLInspectAvatar::onClickViewProfile, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.AddFriend", boost::bind(&LLInspectAvatar::onClickAddFriend, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.IM",
|
||||
boost::bind(&LLInspectAvatar::onClickIM, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Call", boost::bind(&LLInspectAvatar::onClickCall, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Teleport", boost::bind(&LLInspectAvatar::onClickTeleport, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.InviteToGroup", boost::bind(&LLInspectAvatar::onClickInviteToGroup, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Pay", boost::bind(&LLInspectAvatar::onClickPay, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Share", boost::bind(&LLInspectAvatar::onClickShare, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.ToggleMute", boost::bind(&LLInspectAvatar::onToggleMute, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Freeze", boost::bind(&LLInspectAvatar::onClickFreeze, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Eject", boost::bind(&LLInspectAvatar::onClickEject, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Kick", boost::bind(&LLInspectAvatar::onClickKick, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.CSR", boost::bind(&LLInspectAvatar::onClickCSR, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.Report", boost::bind(&LLInspectAvatar::onClickReport, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.FindOnMap", boost::bind(&LLInspectAvatar::onClickFindOnMap, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.ZoomIn", boost::bind(&LLInspectAvatar::onClickZoomIn, this));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.DisableVoice", boost::bind(&LLInspectAvatar::toggleSelectedVoice, this, false));
|
||||
mCommitCallbackRegistrar.add("InspectAvatar.EnableVoice", boost::bind(&LLInspectAvatar::toggleSelectedVoice, this, true));
|
||||
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.EnableGod", boost::bind(&LLInspectAvatar::godModeEnabled, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.VisibleFindOnMap", boost::bind(&LLInspectAvatar::onVisibleFindOnMap, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.VisibleEject", boost::bind(&LLInspectAvatar::onVisibleEject, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.VisibleFreeze", boost::bind(&LLInspectAvatar::onVisibleFreeze, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.VisibleZoomIn", boost::bind(&LLInspectAvatar::onVisibleZoomIn, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.Gear.Enable", boost::bind(&LLInspectAvatar::isNotFriend, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.Gear.EnableCall", boost::bind(&LLAvatarActions::canCall));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.Gear.EnableTeleportOffer", boost::bind(&LLInspectAvatar::enableTeleportOffer, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.EnableMute", boost::bind(&LLInspectAvatar::enableMute, this));
|
||||
mEnableCallbackRegistrar.add("InspectAvatar.EnableUnmute", boost::bind(&LLInspectAvatar::enableUnmute, this));
|
||||
|
||||
// can't make the properties request until the widgets are constructed
|
||||
// as it might return immediately, so do it in postBuild.
|
||||
// as it might return immediately, so do it in onOpen.
|
||||
|
||||
LLTransientFloaterMgr::getInstance()->addControlView(LLTransientFloaterMgr::GLOBAL, this);
|
||||
LLTransientFloater::init(this);
|
||||
|
|
@ -257,25 +159,6 @@ LLInspectAvatar::~LLInspectAvatar()
|
|||
LLTransientFloaterMgr::getInstance()->removeControlView(this);
|
||||
}
|
||||
|
||||
/*virtual*/
|
||||
BOOL LLInspectAvatar::postBuild(void)
|
||||
{
|
||||
getChild<LLUICtrl>("add_friend_btn")->setCommitCallback(
|
||||
boost::bind(&LLInspectAvatar::onClickAddFriend, this) );
|
||||
|
||||
getChild<LLUICtrl>("view_profile_btn")->setCommitCallback(
|
||||
boost::bind(&LLInspectAvatar::onClickViewProfile, this) );
|
||||
|
||||
getChild<LLUICtrl>("mute_btn")->setCommitCallback(
|
||||
boost::bind(&LLInspectAvatar::onClickMuteVolume, this) );
|
||||
|
||||
getChild<LLUICtrl>("volume_slider")->setCommitCallback(
|
||||
boost::bind(&LLInspectAvatar::onVolumeChange, this, _2));
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
// Multiple calls to showInstance("inspect_avatar", foo) will provide different
|
||||
// LLSD for foo, which we will catch here.
|
||||
//virtual
|
||||
|
|
@ -287,11 +170,6 @@ void LLInspectAvatar::onOpen(const LLSD& data)
|
|||
// Extract appropriate avatar id
|
||||
mAvatarID = data["avatar_id"];
|
||||
|
||||
BOOL self = mAvatarID == gAgent.getID();
|
||||
|
||||
getChild<LLUICtrl>("gear_self_btn")->setVisible(self);
|
||||
getChild<LLUICtrl>("gear_btn")->setVisible(!self);
|
||||
|
||||
// Position the inspector relative to the mouse cursor
|
||||
// Similar to how tooltips are positioned
|
||||
// See LLToolTipMgr::createToolTip
|
||||
|
|
@ -304,20 +182,13 @@ void LLInspectAvatar::onOpen(const LLSD& data)
|
|||
LLUI::positionViewNearMouse(this);
|
||||
}
|
||||
|
||||
// Generate link to avatar profile.
|
||||
getChild<LLUICtrl>("avatar_profile_link")->setTextArg("[LINK]", LLSLURL("agent", mAvatarID, "about").getSLURLString());
|
||||
|
||||
// can't call from constructor as widgets are not built yet
|
||||
requestUpdate();
|
||||
|
||||
updateVolumeSlider();
|
||||
|
||||
updateModeratorPanel();
|
||||
}
|
||||
|
||||
// virtual
|
||||
void LLInspectAvatar::onClose(bool app_quitting)
|
||||
{
|
||||
getChild<LLMenuButton>("gear_btn")->hideMenu();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::requestUpdate()
|
||||
{
|
||||
// Don't make network requests when spawning from the debug menu at the
|
||||
|
|
@ -344,25 +215,6 @@ void LLInspectAvatar::requestUpdate()
|
|||
delete mPropertiesRequest;
|
||||
mPropertiesRequest = new LLFetchAvatarData(mAvatarID, this);
|
||||
|
||||
// You can't re-add someone as a friend if they are already your friend
|
||||
bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL;
|
||||
bool is_self = (mAvatarID == gAgentID);
|
||||
if (is_self)
|
||||
{
|
||||
getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
|
||||
getChild<LLUICtrl>("im_btn")->setVisible(false);
|
||||
}
|
||||
else if (is_friend)
|
||||
{
|
||||
getChild<LLUICtrl>("add_friend_btn")->setVisible(false);
|
||||
getChild<LLUICtrl>("im_btn")->setVisible(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
getChild<LLUICtrl>("add_friend_btn")->setVisible(true);
|
||||
getChild<LLUICtrl>("im_btn")->setVisible(false);
|
||||
}
|
||||
|
||||
// Use an avatar_icon even though the image id will come down with the
|
||||
// avatar properties because the avatar_icon code maintains a cache of icons
|
||||
// and this may result in the image being visible sooner.
|
||||
|
|
@ -405,214 +257,6 @@ void LLInspectAvatar::processAvatarData(LLAvatarData* data)
|
|||
mPropertiesRequest = NULL;
|
||||
}
|
||||
|
||||
// For the avatar inspector, we only want to unpause the fade timer
|
||||
// if neither the gear menu or self gear menu are open
|
||||
void LLInspectAvatar::onMouseLeave(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
LLToggleableMenu* gear_menu = getChild<LLMenuButton>("gear_btn")->getMenu();
|
||||
LLToggleableMenu* gear_menu_self = getChild<LLMenuButton>("gear_self_btn")->getMenu();
|
||||
if ( gear_menu && gear_menu->getVisible() &&
|
||||
gear_menu_self && gear_menu_self->getVisible() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(childHasVisiblePopupMenu())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
mOpenTimer.unpause();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::updateModeratorPanel()
|
||||
{
|
||||
bool enable_moderator_panel = false;
|
||||
|
||||
if (LLVoiceChannel::getCurrentVoiceChannel() &&
|
||||
mAvatarID != gAgent.getID())
|
||||
{
|
||||
LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID();
|
||||
|
||||
if (session_id != LLUUID::null)
|
||||
{
|
||||
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
|
||||
|
||||
if (speaker_mgr)
|
||||
{
|
||||
LLPointer<LLSpeaker> self_speakerp = speaker_mgr->findSpeaker(gAgent.getID());
|
||||
LLPointer<LLSpeaker> selected_speakerp = speaker_mgr->findSpeaker(mAvatarID);
|
||||
|
||||
if(speaker_mgr->isVoiceActive() && selected_speakerp &&
|
||||
selected_speakerp->isInVoiceChannel() &&
|
||||
((self_speakerp && self_speakerp->mIsModerator) || gAgent.isGodlike()))
|
||||
{
|
||||
getChild<LLUICtrl>("enable_voice")->setVisible(selected_speakerp->mModeratorMutedVoice);
|
||||
getChild<LLUICtrl>("disable_voice")->setVisible(!selected_speakerp->mModeratorMutedVoice);
|
||||
|
||||
enable_moderator_panel = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (enable_moderator_panel)
|
||||
{
|
||||
if (!getChild<LLUICtrl>("moderator_panel")->getVisible())
|
||||
{
|
||||
getChild<LLUICtrl>("moderator_panel")->setVisible(true);
|
||||
// stretch the floater so it can accommodate the moderator panel
|
||||
reshape(getRect().getWidth(), getRect().getHeight() + getChild<LLUICtrl>("moderator_panel")->getRect().getHeight());
|
||||
}
|
||||
}
|
||||
else if (getChild<LLUICtrl>("moderator_panel")->getVisible())
|
||||
{
|
||||
getChild<LLUICtrl>("moderator_panel")->setVisible(false);
|
||||
// shrink the inspector floater back to original size
|
||||
reshape(getRect().getWidth(), getRect().getHeight() - getChild<LLUICtrl>("moderator_panel")->getRect().getHeight());
|
||||
}
|
||||
}
|
||||
|
||||
void LLInspectAvatar::toggleSelectedVoice(bool enabled)
|
||||
{
|
||||
LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID();
|
||||
LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id);
|
||||
|
||||
if (speaker_mgr)
|
||||
{
|
||||
if (!gAgent.getRegion())
|
||||
return;
|
||||
|
||||
std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest");
|
||||
LLSD data;
|
||||
data["method"] = "mute update";
|
||||
data["session-id"] = session_id;
|
||||
data["params"] = LLSD::emptyMap();
|
||||
data["params"]["agent_id"] = mAvatarID;
|
||||
data["params"]["mute_info"] = LLSD::emptyMap();
|
||||
// ctrl value represents ability to type, so invert
|
||||
data["params"]["mute_info"]["voice"] = !enabled;
|
||||
|
||||
class MuteVoiceResponder : public LLHTTPClient::Responder
|
||||
{
|
||||
public:
|
||||
MuteVoiceResponder(const LLUUID& session_id)
|
||||
{
|
||||
mSessionID = session_id;
|
||||
}
|
||||
|
||||
virtual void error(U32 status, const std::string& reason)
|
||||
{
|
||||
llwarns << status << ": " << reason << llendl;
|
||||
|
||||
if ( gIMMgr )
|
||||
{
|
||||
//403 == you're not a mod
|
||||
//should be disabled if you're not a moderator
|
||||
if ( 403 == status )
|
||||
{
|
||||
gIMMgr->showSessionEventError(
|
||||
"mute",
|
||||
"not_a_moderator",
|
||||
mSessionID);
|
||||
}
|
||||
else
|
||||
{
|
||||
gIMMgr->showSessionEventError(
|
||||
"mute",
|
||||
"generic",
|
||||
mSessionID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private:
|
||||
LLUUID mSessionID;
|
||||
};
|
||||
|
||||
LLHTTPClient::post(
|
||||
url,
|
||||
data,
|
||||
new MuteVoiceResponder(speaker_mgr->getSessionID()));
|
||||
}
|
||||
|
||||
closeFloater();
|
||||
|
||||
}
|
||||
|
||||
void LLInspectAvatar::updateVolumeSlider()
|
||||
{
|
||||
bool voice_enabled = LLVoiceClient::getInstance()->getVoiceEnabled(mAvatarID);
|
||||
|
||||
// Do not display volume slider and mute button if it
|
||||
// is ourself or we are not in a voice channel together
|
||||
if (!voice_enabled || (mAvatarID == gAgent.getID()))
|
||||
{
|
||||
getChild<LLUICtrl>("mute_btn")->setVisible(false);
|
||||
getChild<LLUICtrl>("volume_slider")->setVisible(false);
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
getChild<LLUICtrl>("mute_btn")->setVisible(true);
|
||||
getChild<LLUICtrl>("volume_slider")->setVisible(true);
|
||||
|
||||
// By convention, we only display and toggle voice mutes, not all mutes
|
||||
bool is_muted = LLMuteList::getInstance()->
|
||||
isMuted(mAvatarID, LLMute::flagVoiceChat);
|
||||
|
||||
LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
|
||||
|
||||
bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden");
|
||||
|
||||
mute_btn->setEnabled( !is_linden);
|
||||
mute_btn->setValue( is_muted );
|
||||
|
||||
LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
|
||||
volume_slider->setEnabled( !is_muted );
|
||||
|
||||
F32 volume;
|
||||
|
||||
if (is_muted)
|
||||
{
|
||||
// it's clearer to display their volume as zero
|
||||
volume = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// actual volume
|
||||
volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID);
|
||||
}
|
||||
volume_slider->setValue( (F64)volume );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickMuteVolume()
|
||||
{
|
||||
// By convention, we only display and toggle voice mutes, not all mutes
|
||||
LLMuteList* mute_list = LLMuteList::getInstance();
|
||||
bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat);
|
||||
|
||||
LLMute mute(mAvatarID, mAvatarName.getLegacyName(), LLMute::AGENT);
|
||||
if (!is_muted)
|
||||
{
|
||||
mute_list->add(mute, LLMute::flagVoiceChat);
|
||||
}
|
||||
else
|
||||
{
|
||||
mute_list->remove(mute, LLMute::flagVoiceChat);
|
||||
}
|
||||
|
||||
updateVolumeSlider();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onVolumeChange(const LLSD& data)
|
||||
{
|
||||
F32 volume = (F32)data.asReal();
|
||||
LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume);
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onAvatarNameCache(
|
||||
const LLUUID& agent_id,
|
||||
const LLAvatarName& av_name)
|
||||
|
|
@ -640,215 +284,6 @@ void LLInspectAvatar::onAvatarNameCache(
|
|||
}
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickAddFriend()
|
||||
{
|
||||
LLAvatarActions::requestFriendshipDialog(mAvatarID, mAvatarName.getLegacyName());
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickViewProfile()
|
||||
{
|
||||
LLAvatarActions::showProfile(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::isNotFriend()
|
||||
{
|
||||
return !LLAvatarActions::isFriend(mAvatarID);
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::onVisibleFindOnMap()
|
||||
{
|
||||
return gAgent.isGodlike() || is_agent_mappable(mAvatarID);
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::onVisibleEject()
|
||||
{
|
||||
return enable_freeze_eject( LLSD(mAvatarID) );
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::onVisibleFreeze()
|
||||
{
|
||||
// either user is a god and can do long distance freeze
|
||||
// or check for target proximity and permissions
|
||||
return gAgent.isGodlike() || enable_freeze_eject(LLSD(mAvatarID));
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::onVisibleZoomIn()
|
||||
{
|
||||
return gObjectList.findObject(mAvatarID);
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickIM()
|
||||
{
|
||||
LLAvatarActions::startIM(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickCall()
|
||||
{
|
||||
LLAvatarActions::startCall(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickTeleport()
|
||||
{
|
||||
LLAvatarActions::offerTeleport(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickInviteToGroup()
|
||||
{
|
||||
LLAvatarActions::inviteToGroup(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickPay()
|
||||
{
|
||||
LLAvatarActions::pay(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickShare()
|
||||
{
|
||||
LLAvatarActions::share(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onToggleMute()
|
||||
{
|
||||
LLMute mute(mAvatarID, mAvatarName.mDisplayName, LLMute::AGENT);
|
||||
|
||||
if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
|
||||
{
|
||||
LLMuteList::getInstance()->remove(mute);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLMuteList::getInstance()->add(mute);
|
||||
}
|
||||
|
||||
LLPanelBlockedList::showPanelAndSelect(mute.mID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickReport()
|
||||
{
|
||||
LLFloaterReporter::showFromAvatar(mAvatarID, mAvatarName.getCompleteName());
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
bool godlike_freeze(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
LLUUID avatar_id = notification["payload"]["avatar_id"].asUUID();
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
|
||||
switch (option)
|
||||
{
|
||||
case 0:
|
||||
LLAvatarActions::freeze(avatar_id);
|
||||
break;
|
||||
case 1:
|
||||
LLAvatarActions::unfreeze(avatar_id);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickFreeze()
|
||||
{
|
||||
if (gAgent.isGodlike())
|
||||
{
|
||||
// use godlike freeze-at-a-distance, with confirmation
|
||||
LLNotificationsUtil::add("FreezeAvatar",
|
||||
LLSD(),
|
||||
LLSD().with("avatar_id", mAvatarID),
|
||||
godlike_freeze);
|
||||
}
|
||||
else
|
||||
{
|
||||
// use default "local" version of freezing that requires avatar to be in range
|
||||
handle_avatar_freeze( LLSD(mAvatarID) );
|
||||
}
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickEject()
|
||||
{
|
||||
handle_avatar_eject( LLSD(mAvatarID) );
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickKick()
|
||||
{
|
||||
LLAvatarActions::kick(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickCSR()
|
||||
{
|
||||
std::string name;
|
||||
gCacheName->getFullName(mAvatarID, name);
|
||||
LLAvatarActions::csr(mAvatarID, name);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickZoomIn()
|
||||
{
|
||||
handle_zoom_to_object(mAvatarID);
|
||||
closeFloater();
|
||||
}
|
||||
|
||||
void LLInspectAvatar::onClickFindOnMap()
|
||||
{
|
||||
gFloaterWorldMap->trackAvatar(mAvatarID, mAvatarName.mDisplayName);
|
||||
LLFloaterReg::showInstance("world_map");
|
||||
}
|
||||
|
||||
|
||||
bool LLInspectAvatar::enableMute()
|
||||
{
|
||||
bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden");
|
||||
bool is_self = mAvatarID == gAgent.getID();
|
||||
|
||||
if (!is_linden && !is_self && !LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::enableUnmute()
|
||||
{
|
||||
bool is_linden = LLStringUtil::endsWith(mAvatarName.getLegacyName(), " Linden");
|
||||
bool is_self = mAvatarID == gAgent.getID();
|
||||
|
||||
if (!is_linden && !is_self && LLMuteList::getInstance()->isMuted(mAvatarID, mAvatarName.getLegacyName()))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::enableTeleportOffer()
|
||||
{
|
||||
return LLAvatarActions::canOfferTeleport(mAvatarID);
|
||||
}
|
||||
|
||||
bool LLInspectAvatar::godModeEnabled()
|
||||
{
|
||||
return gAgent.isGodlike();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// LLInspectAvatarUtil
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class LLContextMenu;
|
|||
/**
|
||||
* Context menu for single or multiple list items.
|
||||
*
|
||||
* Derived classes must implement contextMenu().
|
||||
* Derived classes must implement createMenu().
|
||||
*
|
||||
* Typical usage:
|
||||
* <code>
|
||||
|
|
|
|||
|
|
@ -445,10 +445,8 @@ void LLNearbyChatScreenChannel::arrangeToasts()
|
|||
//-----------------------------------------------------------------------------------------------
|
||||
boost::scoped_ptr<LLEventPump> LLNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat"));
|
||||
|
||||
LLNearbyChatHandler::LLNearbyChatHandler(e_notification_type type, const LLSD& id)
|
||||
LLNearbyChatHandler::LLNearbyChatHandler()
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
LLNearbyChatScreenChannel::Params p;
|
||||
p.id = LLUUID(gSavedSettings.getString("NearByChatChannelUUID"));
|
||||
|
|
@ -617,10 +615,6 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg,
|
|||
}
|
||||
}
|
||||
|
||||
void LLNearbyChatHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// LLNearbyChatToast
|
||||
|
|
|
|||
|
|
@ -37,14 +37,13 @@ namespace LLNotificationsUI{
|
|||
class LLNearbyChatHandler : public LLChatHandler
|
||||
{
|
||||
public:
|
||||
LLNearbyChatHandler(e_notification_type type,const LLSD& id);
|
||||
LLNearbyChatHandler();
|
||||
virtual ~LLNearbyChatHandler();
|
||||
|
||||
|
||||
virtual void processChat(const LLChat& chat_msg, const LLSD &args);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
|
||||
static boost::scoped_ptr<LLEventPump> sChatWatcher;
|
||||
|
|
|
|||
|
|
@ -40,10 +40,10 @@
|
|||
using namespace LLNotificationsUI;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLAlertHandler::LLAlertHandler(e_notification_type type, const LLSD& id) : mIsModal(false)
|
||||
LLAlertHandler::LLAlertHandler(const std::string& name, const std::string& notification_type, bool is_modal)
|
||||
: LLSysHandler(name, notification_type),
|
||||
mIsModal(is_modal)
|
||||
{
|
||||
mType = type;
|
||||
|
||||
LLScreenChannelBase::Params p;
|
||||
p.id = LLUUID(gSavedSettings.getString("AlertChannelUUID"));
|
||||
p.display_toasts_always = true;
|
||||
|
|
@ -68,27 +68,20 @@ void LLAlertHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLAlertHandler::processNotification(const LLSD& notify)
|
||||
bool LLAlertHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if (notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "load")
|
||||
{
|
||||
if (LLHandlerUtil::canSpawnSessionAndLogToIM(notification))
|
||||
if (notification->canLogToIM() && notification->hasFormElements())
|
||||
{
|
||||
const std::string name = LLHandlerUtil::getSubstitutionName(notification);
|
||||
|
||||
|
|
@ -119,28 +112,14 @@ bool LLAlertHandler::processNotification(const LLSD& notify)
|
|||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->addToast(p);
|
||||
}
|
||||
else if (notify["sigtype"].asString() == "change")
|
||||
{
|
||||
LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->modifyToastByNotificationID(notification->getID(), (LLToastPanel*)alert_dialog);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->killToastByNotificationID(notification->getID());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void LLAlertHandler::onDeleteToast(LLToast* toast)
|
||||
void LLAlertHandler::onChange( LLNotificationPtr notification )
|
||||
{
|
||||
LLToastAlertPanel* alert_dialog = new LLToastAlertPanel(notification, mIsModal);
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->modifyToastByNotificationID(notification->getID(), (LLToastPanel*)alert_dialog);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -37,15 +37,13 @@
|
|||
using namespace LLNotificationsUI;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLGroupHandler::LLGroupHandler(e_notification_type type, const LLSD& id)
|
||||
LLGroupHandler::LLGroupHandler()
|
||||
: LLSysHandler("Group Notifications", "groupnotify")
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
|
||||
if(channel)
|
||||
{
|
||||
channel->setOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
|
||||
channel->addOnRejectToastCallback(boost::bind(&LLGroupHandler::onRejectToast, this, _1));
|
||||
mChannel = channel->getHandle();
|
||||
}
|
||||
}
|
||||
|
|
@ -64,68 +62,43 @@ void LLGroupHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLGroupHandler::processNotification(const LLSD& notify)
|
||||
bool LLGroupHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
|
||||
{
|
||||
LLHandlerUtil::logGroupNoticeToIMGroup(notification);
|
||||
LLHandlerUtil::logGroupNoticeToIMGroup(notification);
|
||||
|
||||
LLPanel* notify_box = new LLToastGroupNotifyPanel(notification);
|
||||
LLToast::Params p;
|
||||
p.notif_id = notification->getID();
|
||||
p.notification = notification;
|
||||
p.panel = notify_box;
|
||||
p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
|
||||
LLPanel* notify_box = new LLToastGroupNotifyPanel(notification);
|
||||
LLToast::Params p;
|
||||
p.notif_id = notification->getID();
|
||||
p.notification = notification;
|
||||
p.panel = notify_box;
|
||||
p.on_delete_toast = boost::bind(&LLGroupHandler::onDeleteToast, this, _1);
|
||||
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->addToast(p);
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->addToast(p);
|
||||
|
||||
// send a signal to the counter manager
|
||||
mNewNotificationSignal();
|
||||
LLGroupActions::refresh_notices();
|
||||
|
||||
LLGroupActions::refresh_notices();
|
||||
}
|
||||
else if (notify["sigtype"].asString() == "delete")
|
||||
{
|
||||
mChannel.get()->killToastByNotificationID(notification->getID());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLGroupHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
// send a signal to the counter manager
|
||||
mDelNotificationSignal();
|
||||
|
||||
// send a signal to a listener to let him perform some action
|
||||
// in this case listener is a SysWellWindow and it will remove a corresponding item from its list
|
||||
mNotificationIDSignal(toast->getNotificationID());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLGroupHandler::onRejectToast(LLUUID& id)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(id);
|
||||
|
||||
if (notification && LLNotificationManager::getInstance()->getHandlerForNotification(notification->getType()) == this)
|
||||
if (notification && mItems.find(notification) != mItems.end())
|
||||
{
|
||||
LLNotifications::instance().cancel(notification);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
#include "llwindow.h"
|
||||
|
||||
//#include "llnotificationsutil.h"
|
||||
#include "llnotifications.h"
|
||||
#include "llchannelmanager.h"
|
||||
#include "llchat.h"
|
||||
#include "llinstantmessage.h"
|
||||
|
|
@ -40,20 +40,6 @@ class LLIMFloater;
|
|||
|
||||
namespace LLNotificationsUI
|
||||
{
|
||||
// ENotificationType enumerates all possible types of notifications that could be met
|
||||
//
|
||||
typedef enum e_notification_type
|
||||
{
|
||||
NT_NOTIFY,
|
||||
NT_NOTIFYTIP,
|
||||
NT_GROUPNOTIFY,
|
||||
NT_IMCHAT,
|
||||
NT_GROUPCHAT,
|
||||
NT_NEARBYCHAT,
|
||||
NT_ALERT,
|
||||
NT_ALERTMODAL,
|
||||
NT_OFFER
|
||||
} ENotificationType;
|
||||
|
||||
/**
|
||||
* Handler of notification events.
|
||||
|
|
@ -81,21 +67,8 @@ class LLEventHandler
|
|||
public:
|
||||
virtual ~LLEventHandler() {};
|
||||
|
||||
// callbacks for counters
|
||||
typedef boost::function<void (void)> notification_callback_t;
|
||||
typedef boost::signals2::signal<void (void)> notification_signal_t;
|
||||
notification_signal_t mNewNotificationSignal;
|
||||
notification_signal_t mDelNotificationSignal;
|
||||
boost::signals2::connection setNewNotificationCallback(notification_callback_t cb) { return mNewNotificationSignal.connect(cb); }
|
||||
boost::signals2::connection setDelNotification(notification_callback_t cb) { return mDelNotificationSignal.connect(cb); }
|
||||
// callback for notification/toast
|
||||
typedef boost::function<void (const LLUUID id)> notification_id_callback_t;
|
||||
typedef boost::signals2::signal<void (const LLUUID id)> notification_id_signal_t;
|
||||
notification_id_signal_t mNotificationIDSignal;
|
||||
boost::signals2::connection setNotificationIDCallback(notification_id_callback_t cb) { return mNotificationIDSignal.connect(cb); }
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast)=0;
|
||||
virtual void onDeleteToast(LLToast* toast) {}
|
||||
|
||||
// arrange handler's channel on a screen
|
||||
// is necessary to unbind a moment of creation of a channel and a moment of positioning of it
|
||||
|
|
@ -104,8 +77,6 @@ protected:
|
|||
virtual void initChannel()=0;
|
||||
|
||||
LLHandle<LLScreenChannelBase> mChannel;
|
||||
e_notification_type mType;
|
||||
|
||||
};
|
||||
|
||||
// LLSysHandler and LLChatHandler are more specific base classes
|
||||
|
|
@ -115,13 +86,18 @@ protected:
|
|||
/**
|
||||
* Handler for system notifications.
|
||||
*/
|
||||
class LLSysHandler : public LLEventHandler
|
||||
class LLSysHandler : public LLEventHandler, public LLNotificationChannel
|
||||
{
|
||||
public:
|
||||
LLSysHandler();
|
||||
LLSysHandler(const std::string& name, const std::string& notification_type);
|
||||
virtual ~LLSysHandler() {};
|
||||
|
||||
virtual bool processNotification(const LLSD& notify)=0;
|
||||
// base interface functions
|
||||
/*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onDelete(LLNotificationPtr p) { if (mChannel) mChannel->killToastByNotificationID(p->getID());}
|
||||
|
||||
virtual bool processNotification(const LLNotificationPtr& notify)=0;
|
||||
|
||||
protected :
|
||||
static void init();
|
||||
|
|
@ -149,15 +125,12 @@ public:
|
|||
class LLIMHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLIMHandler(e_notification_type type, const LLSD& id);
|
||||
LLIMHandler();
|
||||
virtual ~LLIMHandler();
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
bool processNotification(const LLNotificationPtr& p);
|
||||
/*virtual*/ void initChannel();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -167,16 +140,16 @@ protected:
|
|||
class LLTipHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLTipHandler(e_notification_type type, const LLSD& id);
|
||||
LLTipHandler();
|
||||
virtual ~LLTipHandler();
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void onRejectToast(const LLUUID& id);
|
||||
virtual void initChannel();
|
||||
/*virtual*/ void onRejectToast(const LLUUID& id);
|
||||
/*virtual*/ void initChannel();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -186,15 +159,16 @@ protected:
|
|||
class LLScriptHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLScriptHandler(e_notification_type type, const LLSD& id);
|
||||
LLScriptHandler();
|
||||
virtual ~LLScriptHandler();
|
||||
|
||||
/*virtual*/ void onDelete(LLNotificationPtr p);
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
/*virtual*/ void onDeleteToast(LLToast* toast);
|
||||
/*virtual*/ void initChannel();
|
||||
|
||||
// own handlers
|
||||
void onRejectToast(LLUUID& id);
|
||||
|
|
@ -207,14 +181,14 @@ protected:
|
|||
class LLGroupHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLGroupHandler(e_notification_type type, const LLSD& id);
|
||||
LLGroupHandler();
|
||||
virtual ~LLGroupHandler();
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
|
||||
// own handlers
|
||||
|
|
@ -227,16 +201,14 @@ protected:
|
|||
class LLAlertHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLAlertHandler(e_notification_type type, const LLSD& id);
|
||||
LLAlertHandler(const std::string& name, const std::string& notification_type, bool is_modal);
|
||||
virtual ~LLAlertHandler();
|
||||
|
||||
void setAlertMode(bool is_modal) { mIsModal = is_modal; }
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ void onChange(LLNotificationPtr p);
|
||||
/*virtual*/ void onLoad(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
|
||||
bool mIsModal;
|
||||
|
|
@ -249,15 +221,16 @@ protected:
|
|||
class LLOfferHandler : public LLSysHandler
|
||||
{
|
||||
public:
|
||||
LLOfferHandler(e_notification_type type, const LLSD& id);
|
||||
LLOfferHandler();
|
||||
virtual ~LLOfferHandler();
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onDelete(LLNotificationPtr notification);
|
||||
/*virtual*/ bool processNotification(const LLNotificationPtr& p);
|
||||
|
||||
protected:
|
||||
virtual void onDeleteToast(LLToast* toast);
|
||||
virtual void initChannel();
|
||||
/*virtual*/ void initChannel();
|
||||
|
||||
// own handlers
|
||||
void onRejectToast(LLUUID& id);
|
||||
|
|
@ -266,84 +239,55 @@ protected:
|
|||
/**
|
||||
* Handler for UI hints.
|
||||
*/
|
||||
class LLHintHandler : public LLSingleton<LLHintHandler>
|
||||
class LLHintHandler : public LLNotificationChannel
|
||||
{
|
||||
public:
|
||||
LLHintHandler();
|
||||
virtual ~LLHintHandler();
|
||||
LLHintHandler() : LLNotificationChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"))
|
||||
{}
|
||||
virtual ~LLHintHandler() {}
|
||||
|
||||
// base interface functions
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
/*virtual*/ void onAdd(LLNotificationPtr p);
|
||||
/*virtual*/ void onLoad(LLNotificationPtr p);
|
||||
/*virtual*/ void onDelete(LLNotificationPtr p);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handler for browser notifications
|
||||
*/
|
||||
class LLBrowserNotification : public LLSingleton<LLBrowserNotification>
|
||||
class LLBrowserNotification : public LLNotificationChannel
|
||||
{
|
||||
public:
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
LLBrowserNotification()
|
||||
: LLNotificationChannel("Browser", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "browser"))
|
||||
{}
|
||||
/*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
|
||||
bool processNotification(const LLNotificationPtr& p);
|
||||
};
|
||||
|
||||
/**
|
||||
* Handler for outbox notifications
|
||||
*/
|
||||
class LLOutboxNotification : public LLSingleton<LLOutboxNotification>
|
||||
class LLOutboxNotification : public LLNotificationChannel
|
||||
{
|
||||
public:
|
||||
virtual bool processNotification(const LLSD& notify);
|
||||
LLOutboxNotification()
|
||||
: LLNotificationChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"))
|
||||
{}
|
||||
/*virtual*/ void onAdd(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onChange(LLNotificationPtr p) { processNotification(p); }
|
||||
/*virtual*/ void onDelete(LLNotificationPtr p);
|
||||
bool processNotification(const LLNotificationPtr& p);
|
||||
};
|
||||
|
||||
class LLHandlerUtil
|
||||
{
|
||||
public:
|
||||
/**
|
||||
* Checks sufficient conditions to log notification message to IM session.
|
||||
*/
|
||||
static bool canLogToIM(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks sufficient conditions to log notification message to nearby chat session.
|
||||
*/
|
||||
static bool canLogToNearbyChat(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks sufficient conditions to spawn IM session.
|
||||
*/
|
||||
static bool canSpawnIMSession(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks sufficient conditions to add notification toast panel IM floater.
|
||||
*/
|
||||
static bool canAddNotifPanelToIM(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks whether notification can be used multiple times or not.
|
||||
*/
|
||||
static bool isNotificationReusable(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks if passed notification can create IM session and be written into it.
|
||||
*
|
||||
* This method uses canLogToIM() & canSpawnIMSession().
|
||||
*/
|
||||
static bool canSpawnSessionAndLogToIM(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Checks if passed notification can create toast.
|
||||
*/
|
||||
static bool canSpawnToast(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Determines whether IM floater is opened.
|
||||
*/
|
||||
static bool isIMFloaterOpened(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Determines whether IM floater is focused.
|
||||
*/
|
||||
static bool isIMFloaterFocused(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Writes notification message to IM session.
|
||||
*/
|
||||
|
|
@ -355,12 +299,7 @@ public:
|
|||
/**
|
||||
* Writes notification message to IM p2p session.
|
||||
*/
|
||||
static void logToIMP2P(const LLNotificationPtr& notification);
|
||||
|
||||
/**
|
||||
* Writes notification message to IM p2p session.
|
||||
*/
|
||||
static void logToIMP2P(const LLNotificationPtr& notification, bool to_file_only);
|
||||
static void logToIMP2P(const LLNotificationPtr& notification, bool to_file_only = false);
|
||||
|
||||
/**
|
||||
* Writes group notice notification message to IM group session.
|
||||
|
|
@ -406,13 +345,6 @@ public:
|
|||
*/
|
||||
static void decIMMesageCounter(const LLNotificationPtr& notification);
|
||||
|
||||
private:
|
||||
|
||||
/**
|
||||
* Find IM floater based on "from_id"
|
||||
*/
|
||||
static LLIMFloater* findIMFloater(const LLNotificationPtr& notification);
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,8 @@ void LLSysHandler::init()
|
|||
sExclusiveNotificationGroups.push_back(online_offline_group);
|
||||
}
|
||||
|
||||
LLSysHandler::LLSysHandler()
|
||||
LLSysHandler::LLSysHandler(const std::string& name, const std::string& notification_type)
|
||||
: LLNotificationChannel(name, "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, notification_type))
|
||||
{
|
||||
if(sExclusiveNotificationGroups.empty())
|
||||
{
|
||||
|
|
@ -110,131 +111,15 @@ void LLSysHandler::removeExclusiveNotifications(const LLNotificationPtr& notif)
|
|||
}
|
||||
}
|
||||
|
||||
const static std::string GRANTED_MODIFY_RIGHTS("GrantedModifyRights"),
|
||||
REVOKED_MODIFY_RIGHTS("RevokedModifyRights"),
|
||||
OBJECT_GIVE_ITEM("ObjectGiveItem"),
|
||||
OBJECT_GIVE_ITEM_UNKNOWN_USER("ObjectGiveItemUnknownUser"),
|
||||
PAYMENT_RECEIVED("PaymentReceived"),
|
||||
PAYMENT_SENT("PaymentSent"),
|
||||
ADD_FRIEND_WITH_MESSAGE("AddFriendWithMessage"),
|
||||
USER_GIVE_ITEM("UserGiveItem"),
|
||||
INVENTORY_ACCEPTED("InventoryAccepted"),
|
||||
INVENTORY_DECLINED("InventoryDeclined"),
|
||||
OFFER_FRIENDSHIP("OfferFriendship"),
|
||||
FRIENDSHIP_ACCEPTED("FriendshipAccepted"),
|
||||
FRIENDSHIP_OFFERED("FriendshipOffered"),
|
||||
FRIENDSHIP_ACCEPTED_BYME("FriendshipAcceptedByMe"),
|
||||
FRIENDSHIP_DECLINED_BYME("FriendshipDeclinedByMe"),
|
||||
FRIEND_ONLINE("FriendOnline"), FRIEND_OFFLINE("FriendOffline"),
|
||||
SERVER_OBJECT_MESSAGE("ServerObjectMessage"),
|
||||
TELEPORT_OFFERED("TeleportOffered"),
|
||||
TELEPORT_OFFER_SENT("TeleportOfferSent"),
|
||||
IM_SYSTEM_MESSAGE_TIP("IMSystemMessageTip");
|
||||
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canLogToIM(const LLNotificationPtr& notification)
|
||||
{
|
||||
return GRANTED_MODIFY_RIGHTS == notification->getName()
|
||||
|| REVOKED_MODIFY_RIGHTS == notification->getName()
|
||||
|| PAYMENT_RECEIVED == notification->getName()
|
||||
|| PAYMENT_SENT == notification->getName()
|
||||
|| OFFER_FRIENDSHIP == notification->getName()
|
||||
|| FRIENDSHIP_OFFERED == notification->getName()
|
||||
|| FRIENDSHIP_ACCEPTED == notification->getName()
|
||||
|| FRIENDSHIP_ACCEPTED_BYME == notification->getName()
|
||||
|| FRIENDSHIP_DECLINED_BYME == notification->getName()
|
||||
|| SERVER_OBJECT_MESSAGE == notification->getName()
|
||||
|| INVENTORY_ACCEPTED == notification->getName()
|
||||
|| INVENTORY_DECLINED == notification->getName()
|
||||
|| USER_GIVE_ITEM == notification->getName()
|
||||
|| TELEPORT_OFFERED == notification->getName()
|
||||
|| TELEPORT_OFFER_SENT == notification->getName()
|
||||
|| IM_SYSTEM_MESSAGE_TIP == notification->getName();
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canLogToNearbyChat(const LLNotificationPtr& notification)
|
||||
{
|
||||
return notification->getType() == "notifytip"
|
||||
&& FRIEND_ONLINE != notification->getName()
|
||||
&& FRIEND_OFFLINE != notification->getName()
|
||||
&& INVENTORY_ACCEPTED != notification->getName()
|
||||
&& INVENTORY_DECLINED != notification->getName()
|
||||
&& IM_SYSTEM_MESSAGE_TIP != notification->getName();
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canSpawnIMSession(const LLNotificationPtr& notification)
|
||||
{
|
||||
return OFFER_FRIENDSHIP == notification->getName()
|
||||
|| USER_GIVE_ITEM == notification->getName()
|
||||
|| TELEPORT_OFFERED == notification->getName();
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canAddNotifPanelToIM(const LLNotificationPtr& notification)
|
||||
{
|
||||
return OFFER_FRIENDSHIP == notification->getName()
|
||||
|| USER_GIVE_ITEM == notification->getName()
|
||||
|| TELEPORT_OFFERED == notification->getName();
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::isNotificationReusable(const LLNotificationPtr& notification)
|
||||
{
|
||||
return OFFER_FRIENDSHIP == notification->getName()
|
||||
|| USER_GIVE_ITEM == notification->getName()
|
||||
|| TELEPORT_OFFERED == notification->getName();
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canSpawnSessionAndLogToIM(const LLNotificationPtr& notification)
|
||||
{
|
||||
return canLogToIM(notification) && canSpawnIMSession(notification);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::canSpawnToast(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(INVENTORY_DECLINED == notification->getName()
|
||||
|| INVENTORY_ACCEPTED == notification->getName())
|
||||
{
|
||||
// return false for inventory accepted/declined notifications if respective IM window is open (EXT-5909)
|
||||
return ! isIMFloaterOpened(notification);
|
||||
}
|
||||
|
||||
if(FRIENDSHIP_ACCEPTED == notification->getName())
|
||||
{
|
||||
// don't show FRIENDSHIP_ACCEPTED if IM window is opened and focused - EXT-6441
|
||||
return ! isIMFloaterFocused(notification);
|
||||
}
|
||||
|
||||
if(OFFER_FRIENDSHIP == notification->getName()
|
||||
|| USER_GIVE_ITEM == notification->getName()
|
||||
|| TELEPORT_OFFERED == notification->getName())
|
||||
{
|
||||
// When ANY offer arrives, show toast, unless IM window is already open - EXT-5904
|
||||
return ! isIMFloaterOpened(notification);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// static
|
||||
LLIMFloater* LLHandlerUtil::findIMFloater(const LLNotificationPtr& notification)
|
||||
{
|
||||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
|
||||
return LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id);
|
||||
}
|
||||
|
||||
// static
|
||||
bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification)
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
LLIMFloater* im_floater = findIMFloater(notification);
|
||||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
|
||||
LLIMFloater* im_floater = LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id);
|
||||
|
||||
if (im_floater != NULL)
|
||||
{
|
||||
res = im_floater->getVisible() == TRUE;
|
||||
|
|
@ -243,19 +128,6 @@ bool LLHandlerUtil::isIMFloaterOpened(const LLNotificationPtr& notification)
|
|||
return res;
|
||||
}
|
||||
|
||||
bool LLHandlerUtil::isIMFloaterFocused(const LLNotificationPtr& notification)
|
||||
{
|
||||
bool res = false;
|
||||
|
||||
LLIMFloater* im_floater = findIMFloater(notification);
|
||||
if (im_floater != NULL)
|
||||
{
|
||||
res = im_floater->hasFocus() == TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
// static
|
||||
void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
|
||||
const std::string& session_name, const std::string& from_name,
|
||||
|
|
@ -317,12 +189,6 @@ void LLHandlerUtil::logToIM(const EInstantMessage& session_type,
|
|||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification)
|
||||
{
|
||||
logToIMP2P(notification, false);
|
||||
}
|
||||
|
||||
void log_name_callback(const std::string& full_name, const std::string& from_name,
|
||||
const std::string& message, const LLUUID& from_id)
|
||||
|
||||
|
|
@ -334,9 +200,6 @@ void log_name_callback(const std::string& full_name, const std::string& from_nam
|
|||
// static
|
||||
void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_file_only)
|
||||
{
|
||||
// don't create IM p2p session with objects, it's necessary condition to log
|
||||
if (notification->getName() != OBJECT_GIVE_ITEM)
|
||||
{
|
||||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
|
||||
if (from_id.isNull())
|
||||
|
|
@ -354,7 +217,6 @@ void LLHandlerUtil::logToIMP2P(const LLNotificationPtr& notification, bool to_fi
|
|||
gCacheName->get(from_id, false, boost::bind(&log_name_callback, _2, INTERACTIVE_SYSTEM_FROM, notification->getMessage(), from_id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// static
|
||||
void LLHandlerUtil::logGroupNoticeToIMGroup(
|
||||
|
|
@ -489,14 +351,10 @@ void LLHandlerUtil::decIMMesageCounter(const LLNotificationPtr& notification)
|
|||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, from_id);
|
||||
|
||||
LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession(
|
||||
session_id);
|
||||
LLIMModel::LLIMSession * session = LLIMModel::getInstance()->findIMSession(session_id);
|
||||
|
||||
if (session == NULL)
|
||||
if (session)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLSD arg;
|
||||
arg["session_id"] = session_id;
|
||||
session->mNumUnread--;
|
||||
|
|
@ -505,3 +363,5 @@ void LLHandlerUtil::decIMMesageCounter(const LLNotificationPtr& notification)
|
|||
arg["participant_unread"] = session->mParticipantUnreadMessageCount;
|
||||
LLIMModel::getInstance()->mNewMsgSignal(arg);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -33,26 +33,6 @@
|
|||
|
||||
using namespace LLNotificationsUI;
|
||||
|
||||
LLHintHandler::LLHintHandler()
|
||||
{
|
||||
}
|
||||
|
||||
LLHintHandler::~LLHintHandler()
|
||||
{
|
||||
}
|
||||
|
||||
bool LLHintHandler::processNotification(const LLSD& notify)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
std::string sigtype = notify["sigtype"].asString();
|
||||
if (sigtype == "add" || sigtype == "load")
|
||||
{
|
||||
LLHints::show(notification);
|
||||
}
|
||||
else if (sigtype == "delete")
|
||||
{
|
||||
LLHints::hide(notification);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
void LLHintHandler::onAdd(LLNotificationPtr p) { LLHints::show(p); }
|
||||
void LLHintHandler::onLoad(LLNotificationPtr p) { LLHints::show(p); }
|
||||
void LLHintHandler::onDelete(LLNotificationPtr p) { LLHints::hide(p); }
|
||||
|
|
|
|||
|
|
@ -42,107 +42,35 @@ using namespace LLNotificationsUI;
|
|||
//--------------------------------------------------------------------------
|
||||
LLNotificationManager::LLNotificationManager()
|
||||
{
|
||||
mNotifyHandlers.clear();
|
||||
init();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLNotificationManager::~LLNotificationManager()
|
||||
{
|
||||
BOOST_FOREACH(listener_pair_t& pair, mChannelListeners)
|
||||
{
|
||||
pair.second.disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLNotificationManager::init()
|
||||
{
|
||||
LLNotificationChannel::buildChannel("Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notify"));
|
||||
LLNotificationChannel::buildChannel("NotificationTips", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytip"));
|
||||
LLNotificationChannel::buildChannel("Group Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "groupnotify"));
|
||||
LLNotificationChannel::buildChannel("Alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert"));
|
||||
LLNotificationChannel::buildChannel("AlertModal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
|
||||
LLNotificationChannel::buildChannel("IM Notifications", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "notifytoast"));
|
||||
LLNotificationChannel::buildChannel("Offer", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "offer"));
|
||||
LLNotificationChannel::buildChannel("Hints", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "hint"));
|
||||
LLNotificationChannel::buildChannel("Browser", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "browser"));
|
||||
LLNotificationChannel::buildChannel("Outbox", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "outbox"));
|
||||
mChannels.push_back(new LLScriptHandler());
|
||||
mChannels.push_back(new LLTipHandler());
|
||||
mChannels.push_back(new LLGroupHandler());
|
||||
mChannels.push_back(new LLAlertHandler("Alerts", "alert", false));
|
||||
mChannels.push_back(new LLAlertHandler("AlertModal", "alertmodal", true));
|
||||
mChannels.push_back(new LLOfferHandler());
|
||||
mChannels.push_back(new LLHintHandler());
|
||||
mChannels.push_back(new LLBrowserNotification());
|
||||
mChannels.push_back(new LLOutboxNotification());
|
||||
mChannels.push_back(new LLIMHandler());
|
||||
|
||||
mChannelListeners["Notifications"] = LLNotifications::instance().getChannel("Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["NotificationTips"] = LLNotifications::instance().getChannel("NotificationTips")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["Group Notifications"] = LLNotifications::instance().getChannel("Group Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["Alerts"] = LLNotifications::instance().getChannel("Alerts")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["AlertModal"] = LLNotifications::instance().getChannel("AlertModal")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["IM Notifications"] = LLNotifications::instance().getChannel("IM Notifications")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["Offer"] = LLNotifications::instance().getChannel("Offer")->connectChanged(boost::bind(&LLNotificationManager::onNotification, this, _1));
|
||||
mChannelListeners["Hints"] = LLNotifications::instance().getChannel("Hints")->connectChanged(boost::bind(&LLHintHandler::processNotification, LLHintHandler::getInstance(), _1));
|
||||
mChannelListeners["Browser"] = LLNotifications::instance().getChannel("Browser")->connectChanged(boost::bind(&LLBrowserNotification::processNotification, LLBrowserNotification::getInstance(), _1));
|
||||
mChannelListeners["Outbox"] = LLNotifications::instance().getChannel("Outbox")->connectChanged(boost::bind(&LLOutboxNotification::processNotification, LLOutboxNotification::getInstance(), _1));
|
||||
|
||||
mNotifyHandlers["notify"] = boost::shared_ptr<LLEventHandler>(new LLScriptHandler(NT_NOTIFY, LLSD()));
|
||||
mNotifyHandlers["notifytip"] = boost::shared_ptr<LLEventHandler>(new LLTipHandler(NT_NOTIFY, LLSD()));
|
||||
mNotifyHandlers["groupnotify"] = boost::shared_ptr<LLEventHandler>(new LLGroupHandler(NT_GROUPNOTIFY, LLSD()));
|
||||
mNotifyHandlers["alert"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD()));
|
||||
mNotifyHandlers["alertmodal"] = boost::shared_ptr<LLEventHandler>(new LLAlertHandler(NT_ALERT, LLSD()));
|
||||
static_cast<LLAlertHandler*>(mNotifyHandlers["alertmodal"].get())->setAlertMode(true);
|
||||
mNotifyHandlers["notifytoast"] = boost::shared_ptr<LLEventHandler>(new LLIMHandler(NT_IMCHAT, LLSD()));
|
||||
|
||||
mNotifyHandlers["nearbychat"] = boost::shared_ptr<LLEventHandler>(new LLNearbyChatHandler(NT_NEARBYCHAT, LLSD()));
|
||||
mNotifyHandlers["offer"] = boost::shared_ptr<LLEventHandler>(new LLOfferHandler(NT_OFFER, LLSD()));
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLNotificationManager::onNotification(const LLSD& notify)
|
||||
{
|
||||
LLSysHandler* handle = NULL;
|
||||
|
||||
if (LLNotifications::destroyed())
|
||||
return false;
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if (!notification)
|
||||
return false;
|
||||
|
||||
std::string notification_type = notification->getType();
|
||||
handle = static_cast<LLSysHandler*>(mNotifyHandlers[notification_type].get());
|
||||
|
||||
if(!handle)
|
||||
return false;
|
||||
|
||||
return handle->processNotification(notify);
|
||||
mChatHandler = boost::shared_ptr<LLNearbyChatHandler>(new LLNearbyChatHandler());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLNotificationManager::onChat(const LLChat& msg, const LLSD &args)
|
||||
{
|
||||
// check ENotificationType argument
|
||||
switch(args["type"].asInteger())
|
||||
{
|
||||
case NT_NEARBYCHAT:
|
||||
{
|
||||
LLNearbyChatHandler* handle = dynamic_cast<LLNearbyChatHandler*>(mNotifyHandlers["nearbychat"].get());
|
||||
|
||||
if(handle)
|
||||
handle->processChat(msg, args);
|
||||
}
|
||||
break;
|
||||
default: //no need to handle all enum types
|
||||
break;
|
||||
}
|
||||
if(mChatHandler)
|
||||
mChatHandler->processChat(msg, args);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLEventHandler* LLNotificationManager::getHandlerForNotification(std::string notification_type)
|
||||
{
|
||||
std::map<std::string, boost::shared_ptr<LLEventHandler> >::iterator it = mNotifyHandlers.find(notification_type);
|
||||
|
||||
if(it != mNotifyHandlers.end())
|
||||
return (*it).second.get();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
|
|
|
|||
|
|
@ -28,8 +28,6 @@
|
|||
#ifndef LL_LLNOTIFICATIONMANAGER_H
|
||||
#define LL_LLNOTIFICATIONMANAGER_H
|
||||
|
||||
#include "llevents.h"
|
||||
|
||||
#include "lluictrl.h"
|
||||
#include "llnotificationhandler.h"
|
||||
|
||||
|
|
@ -49,7 +47,6 @@ class LLToast;
|
|||
class LLNotificationManager : public LLSingleton<LLNotificationManager>
|
||||
{
|
||||
typedef std::pair<std::string, LLEventHandler*> eventhandlers;
|
||||
typedef std::pair<const std::string, LLBoundListener> listener_pair_t;
|
||||
public:
|
||||
LLNotificationManager();
|
||||
virtual ~LLNotificationManager();
|
||||
|
|
@ -59,22 +56,12 @@ public:
|
|||
void init(void);
|
||||
//TODO: combine processing and storage (*)
|
||||
|
||||
// this method reacts on system notifications and calls an appropriate handler
|
||||
bool onNotification(const LLSD& notification);
|
||||
|
||||
// this method reacts on chat notifications and calls an appropriate handler
|
||||
void onChat(const LLChat& msg, const LLSD &args);
|
||||
|
||||
// get a handler for a certain type of notification
|
||||
LLEventHandler* getHandlerForNotification(std::string notification_type);
|
||||
|
||||
|
||||
private:
|
||||
//TODO (*)
|
||||
std::map<std::string, boost::shared_ptr<LLEventHandler> > mNotifyHandlers;
|
||||
// cruft std::map<std::string, LLChatHandler*> mChatHandlers;
|
||||
|
||||
std::map<std::string, LLBoundListener> mChannelListeners;
|
||||
boost::shared_ptr<class LLNearbyChatHandler> mChatHandler;
|
||||
std::vector<LLNotificationChannelPtr> mChannels;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -40,10 +40,9 @@
|
|||
using namespace LLNotificationsUI;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLOfferHandler::LLOfferHandler(e_notification_type type, const LLSD& id)
|
||||
LLOfferHandler::LLOfferHandler()
|
||||
: LLSysHandler("Offer", "offer")
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
|
||||
if(channel)
|
||||
|
|
@ -68,52 +67,40 @@ void LLOfferHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLOfferHandler::processNotification(const LLSD& notify)
|
||||
bool LLOfferHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
|
||||
{
|
||||
|
||||
|
||||
if( notification->getPayload().has("give_inventory_notification")
|
||||
&& !notification->getPayload()["give_inventory_notification"] )
|
||||
&& notification->getPayload()["give_inventory_notification"].asBoolean() == false)
|
||||
{
|
||||
// This is an original inventory offer, so add a script floater
|
||||
LLScriptFloaterManager::instance().onAddNotification(notification->getID());
|
||||
}
|
||||
else
|
||||
{
|
||||
notification->setReusable(LLHandlerUtil::isNotificationReusable(notification));
|
||||
bool add_notif_to_im = notification->canLogToIM() && notification->hasFormElements();
|
||||
|
||||
notification->setReusable(add_notif_to_im);
|
||||
|
||||
LLUUID session_id;
|
||||
if (LLHandlerUtil::canSpawnIMSession(notification))
|
||||
if (add_notif_to_im)
|
||||
{
|
||||
const std::string name = LLHandlerUtil::getSubstitutionName(notification);
|
||||
|
||||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
|
||||
session_id = LLHandlerUtil::spawnIMSession(name, from_id);
|
||||
}
|
||||
|
||||
bool show_toast = LLHandlerUtil::canSpawnToast(notification);
|
||||
bool add_notid_to_im = LLHandlerUtil::canAddNotifPanelToIM(notification);
|
||||
if (add_notid_to_im)
|
||||
{
|
||||
LLHandlerUtil::addNotifPanelToIM(notification);
|
||||
}
|
||||
|
||||
|
|
@ -122,46 +109,35 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
|
|||
{
|
||||
LLNotificationsUtil::cancel(notification);
|
||||
}
|
||||
else if(show_toast)
|
||||
else if(!notification->canLogToIM() || !LLHandlerUtil::isIMFloaterOpened(notification))
|
||||
{
|
||||
LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification);
|
||||
// don't close notification on panel destroy since it will be used by IM floater
|
||||
notify_box->setCloseNotificationOnDestroy(!add_notid_to_im);
|
||||
notify_box->setCloseNotificationOnDestroy(!add_notif_to_im);
|
||||
LLToast::Params p;
|
||||
p.notif_id = notification->getID();
|
||||
p.notification = notification;
|
||||
p.panel = notify_box;
|
||||
p.on_delete_toast = boost::bind(&LLOfferHandler::onDeleteToast, this, _1);
|
||||
// we not save offer notifications to the syswell floater that should be added to the IM floater
|
||||
p.can_be_stored = !add_notid_to_im;
|
||||
p.can_be_stored = !add_notif_to_im;
|
||||
|
||||
LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel.get());
|
||||
if(channel)
|
||||
channel->addToast(p);
|
||||
|
||||
// if we not add notification to IM - add it to notification well
|
||||
if (!add_notid_to_im)
|
||||
{
|
||||
// send a signal to the counter manager
|
||||
mNewNotificationSignal();
|
||||
}
|
||||
}
|
||||
|
||||
if (LLHandlerUtil::canLogToIM(notification))
|
||||
if (notification->canLogToIM())
|
||||
{
|
||||
// log only to file if notif panel can be embedded to IM and IM is opened
|
||||
if (add_notid_to_im && LLHandlerUtil::isIMFloaterOpened(notification))
|
||||
{
|
||||
LLHandlerUtil::logToIMP2P(notification, true);
|
||||
bool file_only = add_notif_to_im && LLHandlerUtil::isIMFloaterOpened(notification);
|
||||
LLHandlerUtil::logToIMP2P(notification, file_only);
|
||||
}
|
||||
else
|
||||
{
|
||||
LLHandlerUtil::logToIMP2P(notification);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (notify["sigtype"].asString() == "delete")
|
||||
|
||||
/*virtual*/ void LLOfferHandler::onDelete(LLNotificationPtr notification)
|
||||
{
|
||||
if( notification->getPayload().has("give_inventory_notification")
|
||||
&& !notification->getPayload()["give_inventory_notification"] )
|
||||
|
|
@ -171,7 +147,8 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (LLHandlerUtil::canAddNotifPanelToIM(notification)
|
||||
if (notification->canLogToIM()
|
||||
&& notification->hasFormElements()
|
||||
&& !LLHandlerUtil::isIMFloaterOpened(notification))
|
||||
{
|
||||
LLHandlerUtil::decIMMesageCounter(notification);
|
||||
|
|
@ -180,34 +157,15 @@ bool LLOfferHandler::processNotification(const LLSD& notify)
|
|||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void LLOfferHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
if (!LLHandlerUtil::canAddNotifPanelToIM(toast->getNotification()))
|
||||
{
|
||||
// send a signal to the counter manager
|
||||
mDelNotificationSignal();
|
||||
}
|
||||
|
||||
// send a signal to a listener to let him perform some action
|
||||
// in this case listener is a SysWellWindow and it will remove a corresponding item from its list
|
||||
mNotificationIDSignal(toast->getNotificationID());
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLOfferHandler::onRejectToast(LLUUID& id)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(id);
|
||||
|
||||
if (notification
|
||||
&& LLNotificationManager::getInstance()->getHandlerForNotification(
|
||||
notification->getType()) == this
|
||||
&& mItems.find(notification) != mItems.end()
|
||||
// don't delete notification since it may be used by IM floater
|
||||
&& !LLHandlerUtil::canAddNotifPanelToIM(notification))
|
||||
&& (!notification->canLogToIM() || !notification->hasFormElements()))
|
||||
{
|
||||
LLNotifications::instance().cancel(notification);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,21 +37,16 @@
|
|||
|
||||
using namespace LLNotificationsUI;
|
||||
|
||||
static const std::string SCRIPT_DIALOG ("ScriptDialog");
|
||||
static const std::string SCRIPT_DIALOG_GROUP ("ScriptDialogGroup");
|
||||
static const std::string SCRIPT_LOAD_URL ("LoadWebPage");
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLScriptHandler::LLScriptHandler(e_notification_type type, const LLSD& id)
|
||||
LLScriptHandler::LLScriptHandler()
|
||||
: LLSysHandler("Notifications", "notify")
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
|
||||
if(channel)
|
||||
{
|
||||
channel->setControlHovering(true);
|
||||
channel->setOnRejectToastCallback(boost::bind(&LLScriptHandler::onRejectToast, this, _1));
|
||||
channel->addOnRejectToastCallback(boost::bind(&LLScriptHandler::onRejectToast, this, _1));
|
||||
mChannel = channel->getHandle();
|
||||
}
|
||||
}
|
||||
|
|
@ -70,32 +65,25 @@ void LLScriptHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLScriptHandler::processNotification(const LLSD& notify)
|
||||
bool LLScriptHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if(notify["sigtype"].asString() == "add")
|
||||
{
|
||||
if (LLHandlerUtil::canLogToIM(notification))
|
||||
if (notification->canLogToIM())
|
||||
{
|
||||
LLHandlerUtil::logToIMP2P(notification);
|
||||
}
|
||||
|
||||
if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
|
||||
if(notification->hasFormElements())
|
||||
{
|
||||
LLScriptFloaterManager::getInstance()->onAddNotification(notification->getID());
|
||||
}
|
||||
|
|
@ -114,14 +102,15 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
|
|||
{
|
||||
channel->addToast(p);
|
||||
}
|
||||
|
||||
// send a signal to the counter manager
|
||||
mNewNotificationSignal();
|
||||
}
|
||||
}
|
||||
else if (notify["sigtype"].asString() == "delete")
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void LLScriptHandler::onDelete( LLNotificationPtr notification )
|
||||
{
|
||||
if(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName() || SCRIPT_LOAD_URL == notification->getName())
|
||||
if(notification->hasFormElements())
|
||||
{
|
||||
LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
|
||||
}
|
||||
|
|
@ -130,24 +119,17 @@ bool LLScriptHandler::processNotification(const LLSD& notify)
|
|||
mChannel.get()->killToastByNotificationID(notification->getID());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void LLScriptHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
// send a signal to the counter manager
|
||||
mDelNotificationSignal();
|
||||
|
||||
// send a signal to a listener to let him perform some action
|
||||
// in this case listener is a SysWellWindow and it will remove a corresponding item from its list
|
||||
mNotificationIDSignal(toast->getNotificationID());
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::getInstance()->find(toast->getNotificationID());
|
||||
|
||||
if( notification &&
|
||||
(SCRIPT_DIALOG == notification->getName() || SCRIPT_DIALOG_GROUP == notification->getName()) )
|
||||
if( notification && notification->hasFormElements())
|
||||
{
|
||||
LLScriptFloaterManager::getInstance()->onRemoveNotification(notification->getID());
|
||||
}
|
||||
|
|
@ -158,9 +140,7 @@ void LLScriptHandler::onRejectToast(LLUUID& id)
|
|||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(id);
|
||||
|
||||
if (notification
|
||||
&& LLNotificationManager::getInstance()->getHandlerForNotification(
|
||||
notification->getType()) == this)
|
||||
if (notification && mItems.find(notification) != mItems.end())
|
||||
{
|
||||
LLNotifications::instance().cancel(notification);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,15 +41,14 @@
|
|||
using namespace LLNotificationsUI;
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
LLTipHandler::LLTipHandler(e_notification_type type, const LLSD& id)
|
||||
LLTipHandler::LLTipHandler()
|
||||
: LLSysHandler("NotificationTips", "notifytip")
|
||||
{
|
||||
mType = type;
|
||||
|
||||
// Getting a Channel for our notifications
|
||||
LLScreenChannel* channel = LLChannelManager::getInstance()->createNotificationChannel();
|
||||
if(channel)
|
||||
{
|
||||
channel->setOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1));
|
||||
channel->addOnRejectToastCallback(boost::bind(&LLTipHandler::onRejectToast, this, _1));
|
||||
mChannel = channel->getHandle();
|
||||
}
|
||||
}
|
||||
|
|
@ -68,28 +67,21 @@ void LLTipHandler::initChannel()
|
|||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
bool LLTipHandler::processNotification(const LLSD& notify)
|
||||
bool LLTipHandler::processNotification(const LLNotificationPtr& notification)
|
||||
{
|
||||
if(mChannel.isDead())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(notify["id"].asUUID());
|
||||
|
||||
if(!notification)
|
||||
return false;
|
||||
|
||||
// arrange a channel on a screen
|
||||
if(!mChannel.get()->getVisible())
|
||||
{
|
||||
initChannel();
|
||||
}
|
||||
|
||||
if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change")
|
||||
{
|
||||
// archive message in nearby chat
|
||||
if (LLHandlerUtil::canLogToNearbyChat(notification))
|
||||
if (notification->canLogToChat())
|
||||
{
|
||||
LLHandlerUtil::logToNearbyChat(notification, CHAT_SOURCE_SYSTEM);
|
||||
|
||||
|
|
@ -109,19 +101,18 @@ bool LLTipHandler::processNotification(const LLSD& notify)
|
|||
session_name = name;
|
||||
}
|
||||
LLUUID from_id = notification->getPayload()["from_id"];
|
||||
if (LLHandlerUtil::canLogToIM(notification))
|
||||
if (notification->canLogToIM())
|
||||
{
|
||||
LLHandlerUtil::logToIM(IM_NOTHING_SPECIAL, session_name, name,
|
||||
notification->getMessage(), from_id, from_id);
|
||||
}
|
||||
|
||||
if (LLHandlerUtil::canSpawnIMSession(notification))
|
||||
if (notification->canLogToIM() && notification->hasFormElements())
|
||||
{
|
||||
LLHandlerUtil::spawnIMSession(name, from_id);
|
||||
}
|
||||
|
||||
// don't spawn toast for inventory accepted/declined offers if respective IM window is open (EXT-5909)
|
||||
if (!LLHandlerUtil::canSpawnToast(notification))
|
||||
if (notification->canLogToIM() && LLHandlerUtil::isIMFloaterOpened(notification))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -144,25 +135,18 @@ bool LLTipHandler::processNotification(const LLSD& notify)
|
|||
}
|
||||
else if (notify["sigtype"].asString() == "delete")
|
||||
{
|
||||
mChannel.get()->killToastByNotificationID(notification->getID());
|
||||
mChannel->killToastByNotificationID(notification->getID());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
void LLTipHandler::onDeleteToast(LLToast* toast)
|
||||
{
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
||||
void LLTipHandler::onRejectToast(const LLUUID& id)
|
||||
{
|
||||
LLNotificationPtr notification = LLNotifications::instance().find(id);
|
||||
|
||||
if (notification
|
||||
&& LLNotificationManager::getInstance()->getHandlerForNotification(
|
||||
notification->getType()) == this)
|
||||
if (notification && mItems.find(notification) != mItems.end())
|
||||
{
|
||||
LLNotifications::instance().cancel(notification);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "lloutputmonitorctrl.h"
|
||||
|
||||
// library includes
|
||||
#include "llfloaterreg.h"
|
||||
#include "llui.h"
|
||||
|
||||
// viewer includes
|
||||
|
|
@ -241,6 +242,17 @@ void LLOutputMonitorCtrl::draw()
|
|||
gl_rect_2d(0, monh, monw, 0, sColorBound, FALSE);
|
||||
}
|
||||
|
||||
// virtual
|
||||
BOOL LLOutputMonitorCtrl::handleMouseUp(S32 x, S32 y, MASK mask)
|
||||
{
|
||||
if (mSpeakerId != gAgentID)
|
||||
{
|
||||
LLFloaterReg::showInstance("floater_voice_volume", LLSD().with("avatar_id", mSpeakerId));
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id, const LLUUID& session_id/* = LLUUID::null*/)
|
||||
{
|
||||
if (speaker_id.isNull() && mSpeakerId.notNull())
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public:
|
|||
|
||||
// llview overrides
|
||||
virtual void draw();
|
||||
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
|
||||
|
||||
void setPower(F32 val);
|
||||
F32 getPower(F32 val) const { return mPower; }
|
||||
|
|
|
|||
|
|
@ -69,8 +69,6 @@ BOOL LLPanelBlockedList::postBuild()
|
|||
mBlockedList = getChild<LLScrollListCtrl>("blocked");
|
||||
mBlockedList->setCommitOnSelectionChange(TRUE);
|
||||
|
||||
childSetCommitCallback("back", boost::bind(&LLPanelBlockedList::onBackBtnClick, this), NULL);
|
||||
|
||||
LLMuteList::getInstance()->addObserver(this);
|
||||
|
||||
refreshBlockedList();
|
||||
|
|
@ -99,7 +97,8 @@ void LLPanelBlockedList::selectBlocked(const LLUUID& mute_id)
|
|||
|
||||
void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect)
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD().with(BLOCKED_PARAM_NAME, idToSelect));
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_people",
|
||||
LLSD().with("people_panel_tab_name", "blocked_panel").with(BLOCKED_PARAM_NAME, idToSelect));
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -130,17 +129,6 @@ void LLPanelBlockedList::updateButtons()
|
|||
getChildView("Unblock")->setEnabled(hasSelected);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void LLPanelBlockedList::onBackBtnClick()
|
||||
{
|
||||
LLSideTrayPanelContainer* parent = dynamic_cast<LLSideTrayPanelContainer*>(getParent());
|
||||
if(parent)
|
||||
{
|
||||
parent->openPreviousPanel();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelBlockedList::onRemoveBtnClick()
|
||||
{
|
||||
std::string name = mBlockedList->getSelectedItemLabel();
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ private:
|
|||
void updateButtons();
|
||||
|
||||
// UI callbacks
|
||||
void onBackBtnClick();
|
||||
void onRemoveBtnClick();
|
||||
void onPickBtnClick();
|
||||
void onBlockByNameClick();
|
||||
|
|
|
|||
|
|
@ -738,15 +738,7 @@ const std::string& LLTaskCategoryBridge::getDisplayName() const
|
|||
|
||||
if (cat)
|
||||
{
|
||||
// Localize "Contents" folder.
|
||||
if (cat->getParentUUID().isNull() && cat->getName() == "Contents")
|
||||
{
|
||||
mDisplayName.assign(LLTrans::getString("ViewerObjectContents"));
|
||||
}
|
||||
else
|
||||
{
|
||||
mDisplayName.assign(cat->getName());
|
||||
}
|
||||
mDisplayName.assign(cat->getName());
|
||||
}
|
||||
|
||||
return mDisplayName;
|
||||
|
|
@ -1552,6 +1544,7 @@ void LLPanelObjectInventory::reset()
|
|||
p.parent_panel = this;
|
||||
p.tool_tip= LLTrans::getString("PanelContentsTooltip");
|
||||
p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL);
|
||||
p.folder_indentation = -14; // subtract space normally reserved for folder expanders
|
||||
mFolders = LLUICtrlFactory::create<LLFolderView>(p);
|
||||
// this ensures that we never say "searching..." or "no items found"
|
||||
mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS);
|
||||
|
|
@ -1630,10 +1623,11 @@ void LLPanelObjectInventory::updateInventory()
|
|||
LLInventoryObject* inventory_root = objectp->getInventoryRoot();
|
||||
LLInventoryObject::object_list_t contents;
|
||||
objectp->getInventoryContents(contents);
|
||||
if (inventory_root)
|
||||
mHaveInventory = TRUE;
|
||||
|
||||
if (inventory_root && !contents.empty())
|
||||
{
|
||||
createFolderViews(inventory_root, contents);
|
||||
mHaveInventory = TRUE;
|
||||
mIsInventoryEmpty = FALSE;
|
||||
mFolders->setEnabled(TRUE);
|
||||
}
|
||||
|
|
@ -1641,7 +1635,6 @@ void LLPanelObjectInventory::updateInventory()
|
|||
{
|
||||
// TODO: create an empty inventory
|
||||
mIsInventoryEmpty = TRUE;
|
||||
mHaveInventory = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -1693,19 +1686,19 @@ void LLPanelObjectInventory::createFolderViews(LLInventoryObject* inventory_root
|
|||
bridge = LLTaskInvFVBridge::createObjectBridge(this, inventory_root);
|
||||
if(bridge)
|
||||
{
|
||||
LLFolderViewFolder* new_folder = NULL;
|
||||
LLFolderViewFolder::Params p;
|
||||
p.name = inventory_root->getName();
|
||||
p.icon = LLUI::getUIImage("Inv_FolderClosed");
|
||||
p.icon_open = LLUI::getUIImage("Inv_FolderOpen");
|
||||
p.root = mFolders;
|
||||
p.listener = bridge;
|
||||
p.tool_tip = p.name;
|
||||
new_folder = LLUICtrlFactory::create<LLFolderViewFolder>(p);
|
||||
new_folder->addToFolder(mFolders, mFolders);
|
||||
new_folder->toggleOpen();
|
||||
//LLFolderViewFolder* new_folder = NULL;
|
||||
//LLFolderViewFolder::Params p;
|
||||
//p.name = inventory_root->getName();
|
||||
//p.icon = LLUI::getUIImage("Inv_FolderClosed");
|
||||
//p.icon_open = LLUI::getUIImage("Inv_FolderOpen");
|
||||
//p.root = mFolders;
|
||||
//p.listener = bridge;
|
||||
//p.tool_tip = p.name;
|
||||
//new_folder = LLUICtrlFactory::create<LLFolderViewFolder>(p);
|
||||
//new_folder->addToFolder(mFolders, mFolders);
|
||||
//new_folder->toggleOpen();
|
||||
|
||||
createViewsForCategory(&contents, inventory_root, new_folder);
|
||||
createViewsForCategory(&contents, inventory_root, mFolders);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@ static const std::string NEARBY_TAB_NAME = "nearby_panel";
|
|||
static const std::string FRIENDS_TAB_NAME = "friends_panel";
|
||||
static const std::string GROUP_TAB_NAME = "groups_panel";
|
||||
static const std::string RECENT_TAB_NAME = "recent_panel";
|
||||
static const std::string BLOCKED_TAB_NAME = "blocked_panel"; // blocked avatars
|
||||
|
||||
static const std::string COLLAPSED_BY_USER = "collapsed_by_user";
|
||||
|
||||
|
|
@ -492,26 +493,37 @@ public:
|
|||
|
||||
LLPanelPeople::LLPanelPeople()
|
||||
: LLPanel(),
|
||||
mFilterSubString(LLStringUtil::null),
|
||||
mFilterSubStringOrig(LLStringUtil::null),
|
||||
mFilterEditor(NULL),
|
||||
mTabContainer(NULL),
|
||||
mOnlineFriendList(NULL),
|
||||
mAllFriendList(NULL),
|
||||
mNearbyList(NULL),
|
||||
mRecentList(NULL),
|
||||
mGroupList(NULL),
|
||||
mNearbyGearButton(NULL),
|
||||
mFriendsGearButton(NULL),
|
||||
mGroupsGearButton(NULL),
|
||||
mRecentGearButton(NULL),
|
||||
mMiniMap(NULL)
|
||||
{
|
||||
mFriendListUpdater = new LLFriendListUpdater(boost::bind(&LLPanelPeople::updateFriendList, this));
|
||||
mNearbyListUpdater = new LLNearbyListUpdater(boost::bind(&LLPanelPeople::updateNearbyList, this));
|
||||
mRecentListUpdater = new LLRecentListUpdater(boost::bind(&LLPanelPeople::updateRecentList, this));
|
||||
mButtonsUpdater = new LLButtonsUpdater(boost::bind(&LLPanelPeople::updateButtons, this));
|
||||
mCommitCallbackRegistrar.add("People.addFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
|
||||
|
||||
mCommitCallbackRegistrar.add("People.AddFriend", boost::bind(&LLPanelPeople::onAddFriendButtonClicked, this));
|
||||
mCommitCallbackRegistrar.add("People.AddFriendWizard", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this));
|
||||
mCommitCallbackRegistrar.add("People.DelFriend", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this));
|
||||
mCommitCallbackRegistrar.add("People.Group.Minus", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this));
|
||||
mCommitCallbackRegistrar.add("People.Chat", boost::bind(&LLPanelPeople::onChatButtonClicked, this));
|
||||
mCommitCallbackRegistrar.add("People.Gear", boost::bind(&LLPanelPeople::onGearButtonClicked, this, _1));
|
||||
|
||||
mCommitCallbackRegistrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2));
|
||||
mCommitCallbackRegistrar.add("People.Friends.ViewSort.Action", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2));
|
||||
mCommitCallbackRegistrar.add("People.Nearby.ViewSort.Action", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2));
|
||||
mCommitCallbackRegistrar.add("People.Groups.ViewSort.Action", boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2));
|
||||
mCommitCallbackRegistrar.add("People.Recent.ViewSort.Action", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2));
|
||||
|
||||
mEnableCallbackRegistrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2));
|
||||
mEnableCallbackRegistrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2));
|
||||
mEnableCallbackRegistrar.add("People.Nearby.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemCheck, this, _2));
|
||||
|
||||
mEnableCallbackRegistrar.add("People.Group.Plus.Validate", boost::bind(&LLPanelPeople::onGroupPlusButtonValidate, this));
|
||||
}
|
||||
|
||||
LLPanelPeople::~LLPanelPeople()
|
||||
|
|
@ -525,13 +537,6 @@ LLPanelPeople::~LLPanelPeople()
|
|||
{
|
||||
LLVoiceClient::getInstance()->removeObserver(this);
|
||||
}
|
||||
|
||||
if (mGroupPlusMenuHandle.get()) mGroupPlusMenuHandle.get()->die();
|
||||
if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
|
||||
if (mNearbyViewSortMenuHandle.get()) mNearbyViewSortMenuHandle.get()->die();
|
||||
if (mGroupsViewSortMenuHandle.get()) mGroupsViewSortMenuHandle.get()->die();
|
||||
if (mRecentViewSortMenuHandle.get()) mRecentViewSortMenuHandle.get()->die();
|
||||
|
||||
}
|
||||
|
||||
void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LLSD& param, LLAvatarList* avatar_list)
|
||||
|
|
@ -553,11 +558,15 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(LLUICtrl* ctrl, const LL
|
|||
|
||||
BOOL LLPanelPeople::postBuild()
|
||||
{
|
||||
mFilterEditor = getChild<LLFilterEditor>("filter_input");
|
||||
mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
|
||||
getChild<LLFilterEditor>("nearby_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
|
||||
getChild<LLFilterEditor>("friends_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
|
||||
getChild<LLFilterEditor>("groups_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
|
||||
getChild<LLFilterEditor>("recent_filter_input")->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
|
||||
|
||||
mTabContainer = getChild<LLTabContainer>("tabs");
|
||||
mTabContainer->setCommitCallback(boost::bind(&LLPanelPeople::onTabSelected, this, _2));
|
||||
mSavedFilters.resize(mTabContainer->getTabCount());
|
||||
mSavedOriginalFilters.resize(mTabContainer->getTabCount());
|
||||
|
||||
LLPanel* friends_tab = getChild<LLPanel>(FRIENDS_TAB_NAME);
|
||||
// updater is active only if panel is visible to user.
|
||||
|
|
@ -601,14 +610,6 @@ BOOL LLPanelPeople::postBuild()
|
|||
setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false);
|
||||
setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false);
|
||||
|
||||
LLPanel* groups_panel = getChild<LLPanel>(GROUP_TAB_NAME);
|
||||
groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked, this));
|
||||
groups_panel->childSetAction("plus_btn", boost::bind(&LLPanelPeople::onGroupPlusButtonClicked, this));
|
||||
|
||||
LLPanel* friends_panel = getChild<LLPanel>(FRIENDS_TAB_NAME);
|
||||
friends_panel->childSetAction("add_btn", boost::bind(&LLPanelPeople::onAddFriendWizButtonClicked, this));
|
||||
friends_panel->childSetAction("del_btn", boost::bind(&LLPanelPeople::onDeleteFriendButtonClicked, this));
|
||||
|
||||
mOnlineFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
|
||||
mAllFriendList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
|
||||
mNearbyList->setItemDoubleClickCallback(boost::bind(&LLPanelPeople::onAvatarListDoubleClicked, this, _1));
|
||||
|
|
@ -637,70 +638,9 @@ BOOL LLPanelPeople::postBuild()
|
|||
accordion_tab->setDropDownStateChangedCallback(
|
||||
boost::bind(&LLPanelPeople::onFriendsAccordionExpandedCollapsed, this, _1, _2, mOnlineFriendList));
|
||||
|
||||
buttonSetAction("view_profile_btn", boost::bind(&LLPanelPeople::onViewProfileButtonClicked, this));
|
||||
buttonSetAction("group_info_btn", boost::bind(&LLPanelPeople::onGroupInfoButtonClicked, this));
|
||||
buttonSetAction("chat_btn", boost::bind(&LLPanelPeople::onChatButtonClicked, this));
|
||||
buttonSetAction("im_btn", boost::bind(&LLPanelPeople::onImButtonClicked, this));
|
||||
buttonSetAction("call_btn", boost::bind(&LLPanelPeople::onCallButtonClicked, this));
|
||||
buttonSetAction("group_call_btn", boost::bind(&LLPanelPeople::onGroupCallButtonClicked, this));
|
||||
buttonSetAction("teleport_btn", boost::bind(&LLPanelPeople::onTeleportButtonClicked, this));
|
||||
buttonSetAction("share_btn", boost::bind(&LLPanelPeople::onShareButtonClicked, this));
|
||||
|
||||
// Must go after setting commit callback and initializing all pointers to children.
|
||||
mTabContainer->selectTabByName(NEARBY_TAB_NAME);
|
||||
|
||||
// Create menus.
|
||||
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
|
||||
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
|
||||
|
||||
registrar.add("People.Group.Plus.Action", boost::bind(&LLPanelPeople::onGroupPlusMenuItemClicked, this, _2));
|
||||
registrar.add("People.Group.Minus.Action", boost::bind(&LLPanelPeople::onGroupMinusButtonClicked, this));
|
||||
registrar.add("People.Friends.ViewSort.Action", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemClicked, this, _2));
|
||||
registrar.add("People.Nearby.ViewSort.Action", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemClicked, this, _2));
|
||||
registrar.add("People.Groups.ViewSort.Action", boost::bind(&LLPanelPeople::onGroupsViewSortMenuItemClicked, this, _2));
|
||||
registrar.add("People.Recent.ViewSort.Action", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemClicked, this, _2));
|
||||
|
||||
enable_registrar.add("People.Group.Minus.Enable", boost::bind(&LLPanelPeople::isRealGroup, this));
|
||||
enable_registrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2));
|
||||
enable_registrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2));
|
||||
enable_registrar.add("People.Nearby.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemCheck, this, _2));
|
||||
|
||||
mNearbyGearButton = getChild<LLMenuButton>("nearby_view_sort_btn");
|
||||
mFriendsGearButton = getChild<LLMenuButton>("friends_viewsort_btn");
|
||||
mGroupsGearButton = getChild<LLMenuButton>("groups_viewsort_btn");
|
||||
mRecentGearButton = getChild<LLMenuButton>("recent_viewsort_btn");
|
||||
|
||||
LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
mGroupPlusMenuHandle = plus_menu->getHandle();
|
||||
|
||||
LLToggleableMenu* nearby_view_sort = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_nearby_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if(nearby_view_sort)
|
||||
{
|
||||
mNearbyViewSortMenuHandle = nearby_view_sort->getHandle();
|
||||
mNearbyGearButton->setMenu(nearby_view_sort);
|
||||
}
|
||||
|
||||
LLToggleableMenu* friend_view_sort = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_friends_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if(friend_view_sort)
|
||||
{
|
||||
mFriendsViewSortMenuHandle = friend_view_sort->getHandle();
|
||||
mFriendsGearButton->setMenu(friend_view_sort);
|
||||
}
|
||||
|
||||
LLToggleableMenu* group_view_sort = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_groups_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if(group_view_sort)
|
||||
{
|
||||
mGroupsViewSortMenuHandle = group_view_sort->getHandle();
|
||||
mGroupsGearButton->setMenu(group_view_sort);
|
||||
}
|
||||
|
||||
LLToggleableMenu* recent_view_sort = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_recent_view_sort.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
|
||||
if(recent_view_sort)
|
||||
{
|
||||
mRecentViewSortMenuHandle = recent_view_sort->getHandle();
|
||||
mRecentGearButton->setMenu(recent_view_sort);
|
||||
}
|
||||
|
||||
LLVoiceClient::getInstance()->addObserver(this);
|
||||
|
||||
// call this method in case some list is empty and buttons can be in inconsistent state
|
||||
|
|
@ -735,9 +675,11 @@ void LLPanelPeople::updateFriendListHelpText()
|
|||
if (no_friends_text->getVisible())
|
||||
{
|
||||
//update help text for empty lists
|
||||
std::string message_name = mFilterSubString.empty() ? "no_friends_msg" : "no_filtered_friends_msg";
|
||||
const std::string& filter = mSavedOriginalFilters[mTabContainer->getCurrentPanelIndex()];
|
||||
|
||||
std::string message_name = filter.empty() ? "no_friends_msg" : "no_filtered_friends_msg";
|
||||
LLStringUtil::format_map_t args;
|
||||
args["[SEARCH_TERM]"] = LLURI::escape(mFilterSubStringOrig);
|
||||
args["[SEARCH_TERM]"] = LLURI::escape(filter);
|
||||
no_friends_text->setText(getString(message_name, args));
|
||||
}
|
||||
}
|
||||
|
|
@ -821,31 +763,9 @@ void LLPanelPeople::updateRecentList()
|
|||
mRecentList->setDirty();
|
||||
}
|
||||
|
||||
void LLPanelPeople::buttonSetVisible(std::string btn_name, BOOL visible)
|
||||
{
|
||||
// To make sure we're referencing the right widget (a child of the button bar).
|
||||
LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name);
|
||||
button->setVisible(visible);
|
||||
}
|
||||
|
||||
void LLPanelPeople::buttonSetEnabled(const std::string& btn_name, bool enabled)
|
||||
{
|
||||
// To make sure we're referencing the right widget (a child of the button bar).
|
||||
LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name);
|
||||
button->setEnabled(enabled);
|
||||
}
|
||||
|
||||
void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb)
|
||||
{
|
||||
// To make sure we're referencing the right widget (a child of the button bar).
|
||||
LLButton* button = getChild<LLView>("button_bar")->getChild<LLButton>(btn_name);
|
||||
button->setClickedCallback(cb);
|
||||
}
|
||||
|
||||
void LLPanelPeople::updateButtons()
|
||||
{
|
||||
std::string cur_tab = getActiveTabName();
|
||||
bool nearby_tab_active = (cur_tab == NEARBY_TAB_NAME);
|
||||
bool friends_tab_active = (cur_tab == FRIENDS_TAB_NAME);
|
||||
bool group_tab_active = (cur_tab == GROUP_TAB_NAME);
|
||||
//bool recent_tab_active = (cur_tab == RECENT_TAB_NAME);
|
||||
|
|
@ -856,28 +776,15 @@ void LLPanelPeople::updateButtons()
|
|||
bool item_selected = (selected_uuids.size() == 1);
|
||||
bool multiple_selected = (selected_uuids.size() >= 1);
|
||||
|
||||
buttonSetVisible("group_info_btn", group_tab_active);
|
||||
buttonSetVisible("chat_btn", group_tab_active);
|
||||
buttonSetVisible("view_profile_btn", !group_tab_active);
|
||||
buttonSetVisible("im_btn", !group_tab_active);
|
||||
buttonSetVisible("call_btn", !group_tab_active);
|
||||
buttonSetVisible("group_call_btn", group_tab_active);
|
||||
buttonSetVisible("teleport_btn", friends_tab_active);
|
||||
buttonSetVisible("share_btn", nearby_tab_active || friends_tab_active);
|
||||
|
||||
if (group_tab_active)
|
||||
{
|
||||
bool cur_group_active = true;
|
||||
|
||||
if (item_selected)
|
||||
{
|
||||
selected_id = mGroupList->getSelectedUUID();
|
||||
cur_group_active = (gAgent.getGroupID() == selected_id);
|
||||
}
|
||||
|
||||
LLPanel* groups_panel = mTabContainer->getCurrentPanel();
|
||||
groups_panel->getChildView("activate_btn")->setEnabled(item_selected && !cur_group_active); // "none" or a non-active group selected
|
||||
groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull());
|
||||
groups_panel->getChildView("minus_btn")->setEnabled(item_selected && selected_id.notNull()); // a real group selected
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -893,26 +800,20 @@ void LLPanelPeople::updateButtons()
|
|||
LLPanel* cur_panel = mTabContainer->getCurrentPanel();
|
||||
if (cur_panel)
|
||||
{
|
||||
cur_panel->getChildView("add_friend_btn")->setEnabled(!is_friend);
|
||||
if (cur_panel->hasChild("add_friend_btn", TRUE))
|
||||
cur_panel->getChildView("add_friend_btn")->setEnabled(item_selected && !is_friend);
|
||||
|
||||
if (friends_tab_active)
|
||||
{
|
||||
cur_panel->getChildView("del_btn")->setEnabled(multiple_selected);
|
||||
cur_panel->getChildView("friends_del_btn")->setEnabled(multiple_selected);
|
||||
}
|
||||
|
||||
if (!group_tab_active)
|
||||
{
|
||||
cur_panel->getChildView("gear_btn")->setEnabled(multiple_selected);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool enable_calls = LLVoiceClient::getInstance()->isVoiceWorking() && LLVoiceClient::getInstance()->voiceEnabled();
|
||||
|
||||
buttonSetEnabled("view_profile_btn",item_selected);
|
||||
buttonSetEnabled("share_btn", item_selected);
|
||||
buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection
|
||||
buttonSetEnabled("call_btn", multiple_selected && enable_calls);
|
||||
buttonSetEnabled("teleport_btn", multiple_selected && LLAvatarActions::canOfferTeleport(selected_uuids));
|
||||
|
||||
bool none_group_selected = item_selected && selected_id.isNull();
|
||||
buttonSetEnabled("group_info_btn", !none_group_selected);
|
||||
buttonSetEnabled("group_call_btn", !none_group_selected && enable_calls);
|
||||
buttonSetEnabled("chat_btn", !none_group_selected);
|
||||
}
|
||||
|
||||
std::string LLPanelPeople::getActiveTabName() const
|
||||
|
|
@ -943,6 +844,9 @@ LLUUID LLPanelPeople::getCurrentItemID() const
|
|||
if (cur_tab == GROUP_TAB_NAME)
|
||||
return mGroupList->getSelectedUUID();
|
||||
|
||||
if (cur_tab == BLOCKED_TAB_NAME)
|
||||
return LLUUID::null; // FIXME?
|
||||
|
||||
llassert(0 && "unknown tab selected");
|
||||
return LLUUID::null;
|
||||
}
|
||||
|
|
@ -963,6 +867,8 @@ void LLPanelPeople::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
|
|||
mRecentList->getSelectedUUIDs(selected_uuids);
|
||||
else if (cur_tab == GROUP_TAB_NAME)
|
||||
mGroupList->getSelectedUUIDs(selected_uuids);
|
||||
else if (cur_tab == BLOCKED_TAB_NAME)
|
||||
selected_uuids.clear(); // FIXME?
|
||||
else
|
||||
llassert(0 && "unknown tab selected");
|
||||
|
||||
|
|
@ -1031,49 +937,60 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save
|
|||
}
|
||||
}
|
||||
|
||||
bool LLPanelPeople::isRealGroup()
|
||||
{
|
||||
return getCurrentItemID() != LLUUID::null;
|
||||
}
|
||||
|
||||
void LLPanelPeople::onFilterEdit(const std::string& search_string)
|
||||
{
|
||||
mFilterSubStringOrig = search_string;
|
||||
LLStringUtil::trimHead(mFilterSubStringOrig);
|
||||
const S32 cur_tab_idx = mTabContainer->getCurrentPanelIndex();
|
||||
std::string& filter = mSavedOriginalFilters[cur_tab_idx];
|
||||
std::string& saved_filter = mSavedFilters[cur_tab_idx];
|
||||
|
||||
filter = search_string;
|
||||
LLStringUtil::trimHead(filter);
|
||||
|
||||
// Searches are case-insensitive
|
||||
std::string search_upper = mFilterSubStringOrig;
|
||||
std::string search_upper = filter;
|
||||
LLStringUtil::toUpper(search_upper);
|
||||
|
||||
if (mFilterSubString == search_upper)
|
||||
if (saved_filter == search_upper)
|
||||
return;
|
||||
|
||||
mFilterSubString = search_upper;
|
||||
saved_filter = search_upper;
|
||||
|
||||
//store accordion tabs state before any manipulation with accordion tabs
|
||||
if(!mFilterSubString.empty())
|
||||
// Apply new filter to the current tab.
|
||||
const std::string cur_tab = getActiveTabName();
|
||||
if (cur_tab == NEARBY_TAB_NAME)
|
||||
{
|
||||
mNearbyList->setNameFilter(filter);
|
||||
}
|
||||
else if (cur_tab == FRIENDS_TAB_NAME)
|
||||
{
|
||||
// store accordion tabs opened/closed state before any manipulation with accordion tabs
|
||||
if (!saved_filter.empty())
|
||||
{
|
||||
notifyChildren(LLSD().with("action","store_state"));
|
||||
}
|
||||
|
||||
|
||||
// Apply new filter.
|
||||
mNearbyList->setNameFilter(mFilterSubStringOrig);
|
||||
mOnlineFriendList->setNameFilter(mFilterSubStringOrig);
|
||||
mAllFriendList->setNameFilter(mFilterSubStringOrig);
|
||||
mRecentList->setNameFilter(mFilterSubStringOrig);
|
||||
mGroupList->setNameFilter(mFilterSubStringOrig);
|
||||
mOnlineFriendList->setNameFilter(filter);
|
||||
mAllFriendList->setNameFilter(filter);
|
||||
|
||||
setAccordionCollapsedByUser("tab_online", false);
|
||||
setAccordionCollapsedByUser("tab_all", false);
|
||||
|
||||
showFriendsAccordionsIfNeeded();
|
||||
|
||||
//restore accordion tabs state _after_ all manipulations...
|
||||
if(mFilterSubString.empty())
|
||||
// restore accordion tabs state _after_ all manipulations
|
||||
if(saved_filter.empty())
|
||||
{
|
||||
notifyChildren(LLSD().with("action","restore_state"));
|
||||
}
|
||||
}
|
||||
else if (cur_tab == GROUP_TAB_NAME)
|
||||
{
|
||||
mGroupList->setNameFilter(filter);
|
||||
}
|
||||
else if (cur_tab == RECENT_TAB_NAME)
|
||||
{
|
||||
mRecentList->setNameFilter(filter);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPeople::onTabSelected(const LLSD& param)
|
||||
{
|
||||
|
|
@ -1081,11 +998,6 @@ void LLPanelPeople::onTabSelected(const LLSD& param)
|
|||
updateButtons();
|
||||
|
||||
showFriendsAccordionsIfNeeded();
|
||||
|
||||
if (GROUP_TAB_NAME == tab_name)
|
||||
mFilterEditor->setLabel(getString("groups_filter_label"));
|
||||
else
|
||||
mFilterEditor->setLabel(getString("people_filter_label"));
|
||||
}
|
||||
|
||||
void LLPanelPeople::onAvatarListDoubleClicked(LLUICtrl* ctrl)
|
||||
|
|
@ -1127,12 +1039,6 @@ void LLPanelPeople::onAvatarListCommitted(LLAvatarList* list)
|
|||
updateButtons();
|
||||
}
|
||||
|
||||
void LLPanelPeople::onViewProfileButtonClicked()
|
||||
{
|
||||
LLUUID id = getCurrentItemID();
|
||||
LLAvatarActions::showProfile(id);
|
||||
}
|
||||
|
||||
void LLPanelPeople::onAddFriendButtonClicked()
|
||||
{
|
||||
LLUUID id = getCurrentItemID();
|
||||
|
|
@ -1191,11 +1097,6 @@ void LLPanelPeople::onDeleteFriendButtonClicked()
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGroupInfoButtonClicked()
|
||||
{
|
||||
LLGroupActions::show(getCurrentItemID());
|
||||
}
|
||||
|
||||
void LLPanelPeople::onChatButtonClicked()
|
||||
{
|
||||
LLUUID group_id = getCurrentItemID();
|
||||
|
|
@ -1203,6 +1104,14 @@ void LLPanelPeople::onChatButtonClicked()
|
|||
LLGroupActions::startIM(group_id);
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGearButtonClicked(LLUICtrl* btn)
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
getCurrentItemIDs(selected_uuids);
|
||||
// Spawn at bottom left corner of the button.
|
||||
LLPanelPeopleMenus::gNearbyMenu.show(btn, selected_uuids, 0, 0);
|
||||
}
|
||||
|
||||
void LLPanelPeople::onImButtonClicked()
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
|
|
@ -1219,11 +1128,6 @@ void LLPanelPeople::onImButtonClicked()
|
|||
}
|
||||
}
|
||||
|
||||
void LLPanelPeople::onActivateButtonClicked()
|
||||
{
|
||||
LLGroupActions::activate(mGroupList->getSelectedUUID());
|
||||
}
|
||||
|
||||
// static
|
||||
void LLPanelPeople::onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAvatarName> names)
|
||||
{
|
||||
|
|
@ -1231,19 +1135,15 @@ void LLPanelPeople::onAvatarPicked(const uuid_vec_t& ids, const std::vector<LLAv
|
|||
LLAvatarActions::requestFriendshipDialog(ids[0], names[0].getCompleteName());
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGroupPlusButtonClicked()
|
||||
bool LLPanelPeople::onGroupPlusButtonValidate()
|
||||
{
|
||||
if (!gAgent.canJoinGroups())
|
||||
{
|
||||
LLNotificationsUtil::add("JoinedTooManyGroups");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get();
|
||||
if (!plus_menu)
|
||||
return;
|
||||
|
||||
showGroupMenu(plus_menu);
|
||||
return true;
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGroupMinusButtonClicked()
|
||||
|
|
@ -1288,10 +1188,6 @@ void LLPanelPeople::onFriendsViewSortMenuItemClicked(const LLSD& userdata)
|
|||
mAllFriendList->showPermissions(show_permissions);
|
||||
mOnlineFriendList->showPermissions(show_permissions);
|
||||
}
|
||||
else if (chosen_item == "panel_block_list_sidetray")
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD());
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGroupsViewSortMenuItemClicked(const LLSD& userdata)
|
||||
|
|
@ -1324,10 +1220,6 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata)
|
|||
{
|
||||
setSortOrder(mNearbyList, E_SORT_BY_DISTANCE);
|
||||
}
|
||||
else if (chosen_item == "panel_block_list_sidetray")
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD());
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelPeople::onNearbyViewSortMenuItemCheck(const LLSD& userdata)
|
||||
|
|
@ -1361,10 +1253,6 @@ void LLPanelPeople::onRecentViewSortMenuItemClicked(const LLSD& userdata)
|
|||
{
|
||||
mRecentList->toggleIcons();
|
||||
}
|
||||
else if (chosen_item == "panel_block_list_sidetray")
|
||||
{
|
||||
LLFloaterSidePanelContainer::showPanel("people", "panel_block_list_sidetray", LLSD());
|
||||
}
|
||||
}
|
||||
|
||||
bool LLPanelPeople::onFriendsViewSortMenuItemCheck(const LLSD& userdata)
|
||||
|
|
@ -1393,40 +1281,6 @@ bool LLPanelPeople::onRecentViewSortMenuItemCheck(const LLSD& userdata)
|
|||
return false;
|
||||
}
|
||||
|
||||
void LLPanelPeople::onCallButtonClicked()
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
getCurrentItemIDs(selected_uuids);
|
||||
|
||||
if (selected_uuids.size() == 1)
|
||||
{
|
||||
// initiate a P2P voice chat with the selected user
|
||||
LLAvatarActions::startCall(getCurrentItemID());
|
||||
}
|
||||
else if (selected_uuids.size() > 1)
|
||||
{
|
||||
// initiate an ad-hoc voice chat with multiple users
|
||||
LLAvatarActions::startAdhocCall(selected_uuids);
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelPeople::onGroupCallButtonClicked()
|
||||
{
|
||||
LLGroupActions::startCall(getCurrentItemID());
|
||||
}
|
||||
|
||||
void LLPanelPeople::onTeleportButtonClicked()
|
||||
{
|
||||
uuid_vec_t selected_uuids;
|
||||
getCurrentItemIDs(selected_uuids);
|
||||
LLAvatarActions::offerTeleport(selected_uuids);
|
||||
}
|
||||
|
||||
void LLPanelPeople::onShareButtonClicked()
|
||||
{
|
||||
LLAvatarActions::share(getCurrentItemID());
|
||||
}
|
||||
|
||||
void LLPanelPeople::onMoreButtonClicked()
|
||||
{
|
||||
// *TODO: not implemented yet
|
||||
|
|
|
|||
|
|
@ -80,31 +80,22 @@ private:
|
|||
std::string getActiveTabName() const;
|
||||
LLUUID getCurrentItemID() const;
|
||||
void getCurrentItemIDs(uuid_vec_t& selected_uuids) const;
|
||||
void buttonSetVisible(std::string btn_name, BOOL visible);
|
||||
void buttonSetEnabled(const std::string& btn_name, bool enabled);
|
||||
void buttonSetAction(const std::string& btn_name, const commit_signal_t::slot_type& cb);
|
||||
void showGroupMenu(LLMenuGL* menu);
|
||||
void setSortOrder(LLAvatarList* list, ESortOrder order, bool save = true);
|
||||
|
||||
// UI callbacks
|
||||
void onFilterEdit(const std::string& search_string);
|
||||
void onTabSelected(const LLSD& param);
|
||||
void onViewProfileButtonClicked();
|
||||
void onAddFriendButtonClicked();
|
||||
void onAddFriendWizButtonClicked();
|
||||
void onDeleteFriendButtonClicked();
|
||||
void onGroupInfoButtonClicked();
|
||||
void onChatButtonClicked();
|
||||
void onGearButtonClicked(LLUICtrl* btn);
|
||||
void onImButtonClicked();
|
||||
void onCallButtonClicked();
|
||||
void onGroupCallButtonClicked();
|
||||
void onTeleportButtonClicked();
|
||||
void onShareButtonClicked();
|
||||
void onMoreButtonClicked();
|
||||
void onActivateButtonClicked();
|
||||
void onAvatarListDoubleClicked(LLUICtrl* ctrl);
|
||||
void onAvatarListCommitted(LLAvatarList* list);
|
||||
void onGroupPlusButtonClicked();
|
||||
bool onGroupPlusButtonValidate();
|
||||
void onGroupMinusButtonClicked();
|
||||
void onGroupPlusMenuItemClicked(const LLSD& userdata);
|
||||
|
||||
|
|
@ -113,8 +104,6 @@ private:
|
|||
void onGroupsViewSortMenuItemClicked(const LLSD& userdata);
|
||||
void onRecentViewSortMenuItemClicked(const LLSD& userdata);
|
||||
|
||||
//returns false only if group is "none"
|
||||
bool isRealGroup();
|
||||
bool onFriendsViewSortMenuItemCheck(const LLSD& userdata);
|
||||
bool onRecentViewSortMenuItemCheck(const LLSD& userdata);
|
||||
bool onNearbyViewSortMenuItemCheck(const LLSD& userdata);
|
||||
|
|
@ -135,7 +124,6 @@ private:
|
|||
bool isAccordionCollapsedByUser(LLUICtrl* acc_tab);
|
||||
bool isAccordionCollapsedByUser(const std::string& name);
|
||||
|
||||
LLFilterEditor* mFilterEditor;
|
||||
LLTabContainer* mTabContainer;
|
||||
LLAvatarList* mOnlineFriendList;
|
||||
LLAvatarList* mAllFriendList;
|
||||
|
|
@ -144,24 +132,13 @@ private:
|
|||
LLGroupList* mGroupList;
|
||||
LLNetMap* mMiniMap;
|
||||
|
||||
LLHandle<LLView> mGroupPlusMenuHandle;
|
||||
LLHandle<LLView> mNearbyViewSortMenuHandle;
|
||||
LLHandle<LLView> mFriendsViewSortMenuHandle;
|
||||
LLHandle<LLView> mGroupsViewSortMenuHandle;
|
||||
LLHandle<LLView> mRecentViewSortMenuHandle;
|
||||
std::vector<std::string> mSavedOriginalFilters;
|
||||
std::vector<std::string> mSavedFilters;
|
||||
|
||||
Updater* mFriendListUpdater;
|
||||
Updater* mNearbyListUpdater;
|
||||
Updater* mRecentListUpdater;
|
||||
Updater* mButtonsUpdater;
|
||||
|
||||
LLMenuButton* mNearbyGearButton;
|
||||
LLMenuButton* mFriendsGearButton;
|
||||
LLMenuButton* mGroupsGearButton;
|
||||
LLMenuButton* mRecentGearButton;
|
||||
|
||||
std::string mFilterSubString;
|
||||
std::string mFilterSubStringOrig;
|
||||
};
|
||||
|
||||
#endif //LL_LLPANELPEOPLE_H
|
||||
|
|
|
|||
|
|
@ -305,7 +305,11 @@ BOOL LLFloaterScriptSearch::handleKeyHere(KEY key, MASK mask)
|
|||
{
|
||||
if (mEditorCore)
|
||||
{
|
||||
return mEditorCore->handleKeyHere(key, mask);
|
||||
BOOL handled = mEditorCore->handleKeyHere(key, mask);
|
||||
if (!handled)
|
||||
{
|
||||
LLFloater::handleKeyHere(key, mask);
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
|
|||
|
|
@ -253,7 +253,14 @@ void LLScreenChannel::addToast(const LLToast::Params& p)
|
|||
{
|
||||
bool store_toast = false, show_toast = false;
|
||||
|
||||
mDisplayToastsAlways ? show_toast = true : show_toast = mWasStartUpToastShown && (mShowToasts || p.force_show);
|
||||
if (mDisplayToastsAlways)
|
||||
{
|
||||
show_toast = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
show_toast = mWasStartUpToastShown && (mShowToasts || p.force_show);
|
||||
}
|
||||
store_toast = !show_toast && p.can_be_stored && mCanStoreToasts;
|
||||
|
||||
if(!show_toast && !store_toast)
|
||||
|
|
@ -371,7 +378,7 @@ void LLScreenChannel::storeToast(ToastElem& toast_elem)
|
|||
const LLToast* toast = toast_elem.getToast();
|
||||
if (toast)
|
||||
{
|
||||
mStoredToastList.push_back(toast_elem);
|
||||
mStoredToastList.push_back(toast_elem);
|
||||
mOnStoreToast(toast->getPanel(), toast->getNotificationID());
|
||||
}
|
||||
}
|
||||
|
|
@ -410,14 +417,14 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
|
|||
LLToast* toast = it->getToast();
|
||||
if (toast)
|
||||
{
|
||||
if(toast->getVisible())
|
||||
{
|
||||
// toast is already in channel
|
||||
return;
|
||||
}
|
||||
if(toast->getVisible())
|
||||
{
|
||||
// toast is already in channel
|
||||
return;
|
||||
}
|
||||
|
||||
toast->setIsHidden(false);
|
||||
toast->startTimer();
|
||||
toast->setIsHidden(false);
|
||||
toast->startTimer();
|
||||
mToastList.push_back(*it);
|
||||
}
|
||||
|
||||
|
|
@ -444,7 +451,7 @@ void LLScreenChannel::removeStoredToastByNotificationID(LLUUID id)
|
|||
it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
|
||||
if (it != mStoredToastList.end())
|
||||
{
|
||||
mStoredToastList.erase(it);
|
||||
mStoredToastList.erase(it);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -480,16 +487,16 @@ void LLScreenChannel::killToastByNotificationID(LLUUID id)
|
|||
// searching among stored toasts
|
||||
it = find(mStoredToastList.begin(), mStoredToastList.end(), id);
|
||||
|
||||
if (it != mStoredToastList.end())
|
||||
if( it != mStoredToastList.end() )
|
||||
{
|
||||
LLToast* toast = it->getToast();
|
||||
if (toast)
|
||||
{
|
||||
// send signal to a listener to let him perform some action on toast rejecting
|
||||
mRejectToastSignal(toast->getNotificationID());
|
||||
deleteToast(toast);
|
||||
}
|
||||
// send signal to a listener to let him perform some action on toast rejecting
|
||||
mRejectToastSignal(toast->getNotificationID());
|
||||
deleteToast(toast);
|
||||
}
|
||||
}
|
||||
|
||||
// Call find() once more, because the mStoredToastList could have been changed
|
||||
// in mRejectToastSignal callback and the iterator could have become invalid.
|
||||
|
|
@ -521,11 +528,11 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel)
|
|||
LLToast* toast = it->getToast();
|
||||
if (toast)
|
||||
{
|
||||
LLPanel* old_panel = toast->getPanel();
|
||||
toast->removeChild(old_panel);
|
||||
delete old_panel;
|
||||
toast->insertPanel(panel);
|
||||
toast->startTimer();
|
||||
LLPanel* old_panel = toast->getPanel();
|
||||
toast->removeChild(old_panel);
|
||||
delete old_panel;
|
||||
toast->insertPanel(panel);
|
||||
toast->startTimer();
|
||||
}
|
||||
redrawToasts();
|
||||
}
|
||||
|
|
@ -679,7 +686,7 @@ void LLScreenChannel::showToastsCentre()
|
|||
return;
|
||||
}
|
||||
|
||||
LLRect toast_rect;
|
||||
LLRect toast_rect;
|
||||
S32 bottom = (getRect().mTop - getRect().mBottom)/2 + toast->getRect().getHeight()/2;
|
||||
std::vector<ToastElem>::reverse_iterator it;
|
||||
|
||||
|
|
|
|||
|
|
@ -227,16 +227,16 @@ public:
|
|||
|
||||
// Channel's signals
|
||||
// signal on storing of faded toasts event
|
||||
typedef boost::function<void (LLPanel* info_panel, const LLUUID id)> store_tost_callback_t;
|
||||
typedef boost::signals2::signal<void (LLPanel* info_panel, const LLUUID id)> store_tost_signal_t;
|
||||
store_tost_signal_t mOnStoreToast;
|
||||
boost::signals2::connection setOnStoreToastCallback(store_tost_callback_t cb) { return mOnStoreToast.connect(cb); }
|
||||
typedef boost::signals2::signal<void (LLPanel* info_panel, const LLUUID id)> store_toast_signal_t;
|
||||
boost::signals2::connection addOnStoreToastCallback(store_toast_signal_t::slot_type cb) { return mOnStoreToast.connect(cb); }
|
||||
// signal on rejecting of a toast event
|
||||
typedef boost::function<void (LLUUID id)> reject_tost_callback_t;
|
||||
typedef boost::signals2::signal<void (LLUUID id)> reject_tost_signal_t;
|
||||
reject_tost_signal_t mRejectToastSignal; boost::signals2::connection setOnRejectToastCallback(reject_tost_callback_t cb) { return mRejectToastSignal.connect(cb); }
|
||||
typedef boost::signals2::signal<void (LLUUID id)> reject_toast_signal_t;
|
||||
boost::signals2::connection addOnRejectToastCallback(reject_toast_signal_t::slot_type cb) { return mRejectToastSignal.connect(cb); }
|
||||
|
||||
private:
|
||||
store_toast_signal_t mOnStoreToast;
|
||||
reject_toast_signal_t mRejectToastSignal;
|
||||
|
||||
class ToastElem
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -2774,7 +2774,7 @@ void renderVisibility(LLSpatialGroup* group, LLCamera* camera)
|
|||
|
||||
void renderCrossHairs(LLVector3 position, F32 size, LLColor4 color)
|
||||
{
|
||||
gGL.diffuseColor4fv(color.mV);
|
||||
gGL.color4fv(color.mV);
|
||||
gGL.begin(LLRender::LINES);
|
||||
{
|
||||
gGL.vertex3fv((position - LLVector3(size, 0.f, 0.f)).mV);
|
||||
|
|
@ -3904,7 +3904,7 @@ void renderAgentTarget(LLVOAvatar* avatar)
|
|||
if (avatar->isSelf())
|
||||
{
|
||||
renderCrossHairs(avatar->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
|
||||
renderCrossHairs(avatar->mDrawable->getPositionAgent(), 0.2f, LLColor4(1, 0, 0, 0.8f));
|
||||
renderCrossHairs(avatar->mDrawable->getPositionAgent(), 0.2f, LLColor4(0, 1, 0, 0.8f));
|
||||
renderCrossHairs(avatar->mRoot.getWorldPosition(), 0.2f, LLColor4(1, 1, 1, 0.8f));
|
||||
renderCrossHairs(avatar->mPelvisp->getWorldPosition(), 0.2f, LLColor4(0, 0, 1, 0.8f));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,13 +433,19 @@ BOOL LLIMWellWindow::ObjectRowPanel::handleRightMouseDown(S32 x, S32 y, MASK mas
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// PUBLIC METHODS
|
||||
LLNotificationWellWindow::LLNotificationWellWindow(const LLSD& key)
|
||||
: LLSysWellWindow(key)
|
||||
LLNotificationWellWindow::WellNotificationChannel::WellNotificationChannel(LLNotificationWellWindow* well_window)
|
||||
: LLNotificationChannel(LLNotificationChannel::Params().name(well_window->getPathname())),
|
||||
mWellWindow(well_window)
|
||||
{
|
||||
// init connections to the list's update events
|
||||
connectListUpdaterToSignal("notify");
|
||||
connectListUpdaterToSignal("groupnotify");
|
||||
connectListUpdaterToSignal("offer");
|
||||
connectToChannel("Notifications");
|
||||
connectToChannel("Group Notifications");
|
||||
connectToChannel("Offer");
|
||||
}
|
||||
|
||||
LLNotificationWellWindow::LLNotificationWellWindow(const LLSD& key)
|
||||
: LLSysWellWindow(key)
|
||||
{
|
||||
mNotificationUpdates.reset(new WellNotificationChannel(this));
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -519,7 +525,7 @@ void LLNotificationWellWindow::initChannel()
|
|||
LLSysWellWindow::initChannel();
|
||||
if(mChannel)
|
||||
{
|
||||
mChannel->setOnStoreToastCallback(boost::bind(&LLNotificationWellWindow::onStoreToast, this, _1, _2));
|
||||
mChannel->addOnStoreToastCallback(boost::bind(&LLNotificationWellWindow::onStoreToast, this, _1, _2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -546,20 +552,6 @@ void LLNotificationWellWindow::onStoreToast(LLPanel* info_panel, LLUUID id)
|
|||
addItem(p);
|
||||
}
|
||||
|
||||
void LLNotificationWellWindow::connectListUpdaterToSignal(std::string notification_type)
|
||||
{
|
||||
LLNotificationsUI::LLNotificationManager* manager = LLNotificationsUI::LLNotificationManager::getInstance();
|
||||
LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type);
|
||||
if(n_handler)
|
||||
{
|
||||
n_handler->setNotificationIDCallback(boost::bind(&LLNotificationWellWindow::removeItemByID, this, _1));
|
||||
}
|
||||
else
|
||||
{
|
||||
llwarns << "LLSysWellWindow::connectListUpdaterToSignal() - could not get a handler for '" << notification_type <<"' type of notifications" << llendl;
|
||||
}
|
||||
}
|
||||
|
||||
void LLNotificationWellWindow::onItemClick(LLSysWellItem* item)
|
||||
{
|
||||
LLUUID id = item->getID();
|
||||
|
|
@ -574,6 +566,12 @@ void LLNotificationWellWindow::onItemClose(LLSysWellItem* item)
|
|||
mChannel->killToastByNotificationID(id);
|
||||
}
|
||||
|
||||
void LLNotificationWellWindow::onAdd( LLNotificationPtr notify )
|
||||
{
|
||||
removeItemByID(notify->getID());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/************************************************************************/
|
||||
|
|
@ -867,4 +865,4 @@ bool LLIMWellWindow::confirmCloseAll(const LLSD& notification, const LLSD& respo
|
|||
return false;
|
||||
}
|
||||
|
||||
// EOF
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@
|
|||
#include "llscreenchannel.h"
|
||||
#include "llscrollcontainer.h"
|
||||
#include "llimview.h"
|
||||
#include "llnotifications.h"
|
||||
|
||||
#include "boost/shared_ptr.hpp"
|
||||
|
||||
|
|
@ -111,7 +112,7 @@ public:
|
|||
|
||||
/*virtual*/ BOOL postBuild();
|
||||
/*virtual*/ void setVisible(BOOL visible);
|
||||
|
||||
/*virtual*/ void onAdd(LLNotificationPtr notify);
|
||||
// Operating with items
|
||||
void addItem(LLSysWellItem::Params p);
|
||||
|
||||
|
|
@ -119,6 +120,18 @@ public:
|
|||
void closeAll();
|
||||
|
||||
protected:
|
||||
struct WellNotificationChannel : public LLNotificationChannel
|
||||
{
|
||||
WellNotificationChannel(LLNotificationWellWindow*);
|
||||
void onDelete(LLNotificationPtr notify)
|
||||
{
|
||||
mWellWindow->removeItemByID(notify->getID());
|
||||
}
|
||||
|
||||
LLNotificationWellWindow* mWellWindow;
|
||||
};
|
||||
|
||||
LLNotificationChannelPtr mNotificationUpdates;
|
||||
/*virtual*/ const std::string& getAnchorViewName() { return NOTIFICATION_WELL_ANCHOR_NAME; }
|
||||
|
||||
private:
|
||||
|
|
@ -126,12 +139,8 @@ private:
|
|||
void initChannel();
|
||||
void clearScreenChannels();
|
||||
|
||||
|
||||
void onStoreToast(LLPanel* info_panel, LLUUID id);
|
||||
|
||||
// connect counter and list updaters to the corresponding signals
|
||||
void connectListUpdaterToSignal(std::string notification_type);
|
||||
|
||||
// Handlers
|
||||
void onItemClick(LLSysWellItem* item);
|
||||
void onItemClose(LLSysWellItem* item);
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
const S32 LLToastGroupNotifyPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 7;
|
||||
|
||||
LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification)
|
||||
LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(const LLNotificationPtr& notification)
|
||||
: LLToastPanel(notification),
|
||||
mInventoryOffer(NULL)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -47,13 +47,10 @@ class LLToastGroupNotifyPanel
|
|||
public:
|
||||
void close();
|
||||
|
||||
static bool onNewNotification(const LLSD& notification);
|
||||
|
||||
|
||||
// Non-transient messages. You can specify non-default button
|
||||
// layouts (like one for script dialogs) by passing various
|
||||
// numbers in for "layout".
|
||||
LLToastGroupNotifyPanel(LLNotificationPtr& notification);
|
||||
LLToastGroupNotifyPanel(const LLNotificationPtr& notification);
|
||||
|
||||
/*virtual*/ ~LLToastGroupNotifyPanel();
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ const LLFontGL* LLToastNotifyPanel::sFontSmall = NULL;
|
|||
|
||||
LLToastNotifyPanel::button_click_signal_t LLToastNotifyPanel::sButtonClickSignal;
|
||||
|
||||
LLToastNotifyPanel::LLToastNotifyPanel(LLNotificationPtr& notification, const LLRect& rect, bool show_images) :
|
||||
LLToastNotifyPanel::LLToastNotifyPanel(const LLNotificationPtr& notification, const LLRect& rect, bool show_images) :
|
||||
LLToastPanel(notification),
|
||||
mTextBox(NULL),
|
||||
mInfoPanel(NULL),
|
||||
|
|
@ -536,7 +536,7 @@ void LLToastNotifyPanel::onToastPanelButtonClicked(const LLUUID& notification_id
|
|||
}
|
||||
}
|
||||
|
||||
void LLToastNotifyPanel::disableRespondedOptions(LLNotificationPtr& notification)
|
||||
void LLToastNotifyPanel::disableRespondedOptions(const LLNotificationPtr& notification)
|
||||
{
|
||||
LLSD response = notification->getResponse();
|
||||
for (LLSD::map_const_iterator response_it = response.beginMap();
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ public:
|
|||
* @deprecated if you intend to instantiate LLToastNotifyPanel - it's point to
|
||||
* implement right class for desired toast panel. @see LLGenericTipPanel as example.
|
||||
*/
|
||||
LLToastNotifyPanel(LLNotificationPtr& pNotification, const LLRect& rect = LLRect::null, bool show_images = true);
|
||||
LLToastNotifyPanel(const LLNotificationPtr& pNotification, const LLRect& rect = LLRect::null, bool show_images = true);
|
||||
virtual ~LLToastNotifyPanel();
|
||||
LLPanel * getControlPanel() { return mControlPanel; }
|
||||
|
||||
|
|
@ -118,7 +118,7 @@ protected:
|
|||
/**
|
||||
* Process response data. Will disable selected options
|
||||
*/
|
||||
void disableRespondedOptions(LLNotificationPtr& notification);
|
||||
void disableRespondedOptions(const LLNotificationPtr& notification);
|
||||
|
||||
bool mIsTip;
|
||||
bool mAddedDefaultBtn;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,6 @@ class LLToastScriptTextbox
|
|||
public:
|
||||
void close();
|
||||
|
||||
static bool onNewNotification(const LLSD& notification);
|
||||
|
||||
// Non-transient messages. You can specify non-default button
|
||||
// layouts (like one for script dialogs) by passing various
|
||||
// numbers in for "layout".
|
||||
|
|
|
|||
|
|
@ -110,6 +110,7 @@
|
|||
#include "llfloatertranslationsettings.h"
|
||||
#include "llfloateruipreview.h"
|
||||
#include "llfloatervoiceeffect.h"
|
||||
#include "llfloatervoicevolume.h"
|
||||
#include "llfloaterwhitelistentry.h"
|
||||
#include "llfloaterwindowsize.h"
|
||||
#include "llfloaterworldmap.h"
|
||||
|
|
@ -220,6 +221,7 @@ void LLViewerFloaterReg::registerFloaters()
|
|||
LLInspectGroupUtil::registerFloater();
|
||||
LLInspectObjectUtil::registerFloater();
|
||||
LLInspectRemoteObjectUtil::registerFloater();
|
||||
LLFloaterVoiceVolumeUtil::registerFloater();
|
||||
LLNotificationsUI::registerFloater();
|
||||
LLFloaterDisplayNameUtil::registerFloater();
|
||||
|
||||
|
|
|
|||
|
|
@ -3190,15 +3190,6 @@ bool enable_freeze_eject(const LLSD& avatar_id)
|
|||
return new_value;
|
||||
}
|
||||
|
||||
|
||||
void login_done(S32 which, void *user)
|
||||
{
|
||||
llinfos << "Login done " << which << llendl;
|
||||
|
||||
LLPanelLogin::closePanel();
|
||||
}
|
||||
|
||||
|
||||
bool callback_leave_group(const LLSD& notification, const LLSD& response)
|
||||
{
|
||||
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
|
||||
|
|
|
|||
|
|
@ -1148,7 +1148,7 @@ bool check_offer_throttle(const std::string& from_name, bool check_only)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Return "true" if we have a preview method for that asset type, "false" otherwise
|
||||
bool check_asset_previewable(const LLAssetType::EType asset_type)
|
||||
{
|
||||
|
|
@ -2373,7 +2373,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
LL_INFOS("Messaging") << "process_improved_im: session_id( " << session_id << " ), from_id( " << from_id << " )" << LL_ENDL;
|
||||
|
||||
bool mute_im = is_muted;
|
||||
if (accept_im_from_only_friend && !is_friend)
|
||||
if(accept_im_from_only_friend&&!is_friend)
|
||||
{
|
||||
if (!gIMMgr->isNonFriendSessionNotified(session_id))
|
||||
{
|
||||
|
|
@ -2796,7 +2796,6 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
|
|||
chat.mOwnerID = from_id;
|
||||
LLSD args;
|
||||
args["slurl"] = location;
|
||||
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
|
||||
|
||||
// Look for IRC-style emotes here so object name formatting is correct
|
||||
std::string prefix = message.substr(0, 4);
|
||||
|
|
@ -3399,7 +3398,6 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data)
|
|||
// pass owner_id to chat so that we can display the remote
|
||||
// object inspect for an object that is chatting with you
|
||||
LLSD args;
|
||||
args["type"] = LLNotificationsUI::NT_NEARBYCHAT;
|
||||
chat.mOwnerID = owner_id;
|
||||
|
||||
if (gSavedSettings.getBOOL("TranslateChat") && chat.mSourceType != CHAT_SOURCE_SYSTEM)
|
||||
|
|
|
|||
|
|
@ -610,7 +610,7 @@ public:
|
|||
addText(xpos, ypos, llformat("%d/%d Mesh HTTP Requests/Retries", LLMeshRepository::sHTTPRequestCount,
|
||||
LLMeshRepository::sHTTPRetryCount));
|
||||
ypos += y_inc;
|
||||
|
||||
|
||||
addText(xpos, ypos, llformat("%d/%d Mesh LOD Pending/Processing", LLMeshRepository::sLODPending, LLMeshRepository::sLODProcessing));
|
||||
ypos += y_inc;
|
||||
|
||||
|
|
@ -1542,13 +1542,14 @@ LLViewerWindow::LLViewerWindow(const Params& p)
|
|||
// pass its value right now. Instead, pass it a nullary function that
|
||||
// will, when we later need it, return the value of gKeyboard.
|
||||
// boost::lambda::var() constructs such a functor on the fly.
|
||||
mWindowListener.reset(new LLWindowListener(this, boost::lambda::var(gKeyboard)));
|
||||
mViewerWindowListener.reset(new LLViewerWindowListener(this));
|
||||
LLNotificationChannel::buildChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert"));
|
||||
LLNotificationChannel::buildChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal"));
|
||||
mWindowListener(new LLWindowListener(this, boost::lambda::var(gKeyboard))),
|
||||
mViewerWindowListener(new LLViewerWindowListener(this)),
|
||||
|
||||
LLNotifications::instance().getChannel("VW_alerts")->connectChanged(&LLViewerWindow::onAlert);
|
||||
LLNotifications::instance().getChannel("VW_alertmodal")->connectChanged(&LLViewerWindow::onAlert);
|
||||
LLNotificationChannelPtr vw_alerts_channel(new LLNotificationChannel("VW_alerts", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alert")));
|
||||
LLNotificationChannelPtr vw_alerts_modal_channel(new LLNotificationChannel("VW_alertmodal", "Visible", LLNotificationFilters::filterBy<std::string>(&LLNotification::getType, "alertmodal")));
|
||||
|
||||
vw_alerts_channel->connectChanged(&LLViewerWindow::onAlert);
|
||||
vw_alerts_modal_channel->connectChanged(&LLViewerWindow::onAlert);
|
||||
LLNotifications::instance().setIgnoreAllNotifications(gSavedSettings.getBOOL("IgnoreAllNotifications"));
|
||||
llinfos << "NOTE: ALL NOTIFICATIONS THAT OCCUR WILL GET ADDED TO IGNORE LIST FOR LATER RUNS." << llendl;
|
||||
|
||||
|
|
@ -1969,12 +1970,12 @@ void LLViewerWindow::shutdownViews()
|
|||
gMorphView->setVisible(FALSE);
|
||||
}
|
||||
llinfos << "Global views cleaned." << llendl ;
|
||||
|
||||
|
||||
// DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open
|
||||
// will crump with LL_ERRS.
|
||||
LLModalDialog::shutdownModals();
|
||||
llinfos << "LLModalDialog shut down." << llendl;
|
||||
|
||||
|
||||
// destroy the nav bar, not currently part of gViewerWindow
|
||||
// *TODO: Make LLNavigationBar part of gViewerWindow
|
||||
if (LLNavigationBar::instanceExists())
|
||||
|
|
@ -1982,17 +1983,17 @@ void LLViewerWindow::shutdownViews()
|
|||
delete LLNavigationBar::getInstance();
|
||||
}
|
||||
llinfos << "LLNavigationBar destroyed." << llendl ;
|
||||
|
||||
|
||||
// destroy menus after instantiating navbar above, as it needs
|
||||
// access to gMenuHolder
|
||||
cleanup_menus();
|
||||
llinfos << "menus destroyed." << llendl ;
|
||||
|
||||
|
||||
// Delete all child views.
|
||||
delete mRootView;
|
||||
mRootView = NULL;
|
||||
llinfos << "RootView deleted." << llendl ;
|
||||
|
||||
|
||||
// Automatically deleted as children of mRootView. Fix the globals.
|
||||
gStatusBar = NULL;
|
||||
gIMMgr = NULL;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -66,8 +66,9 @@ class LLVoiceVisualizer;
|
|||
class LLHUDNameTag;
|
||||
class LLHUDEffectSpiral;
|
||||
class LLTexGlobalColor;
|
||||
class LLVOAvatarBoneInfo;
|
||||
class LLVOAvatarSkeletonInfo;
|
||||
struct LLVOAvatarBoneInfo;
|
||||
struct LLVOAvatarChildJoint;
|
||||
struct LLVOAvatarSkeletonInfo;
|
||||
|
||||
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
// LLVOAvatar
|
||||
|
|
@ -232,7 +233,7 @@ public:
|
|||
void idleUpdateWindEffect();
|
||||
void idleUpdateNameTag(const LLVector3& root_pos_last);
|
||||
void idleUpdateNameTagText(BOOL new_name);
|
||||
LLVector3 idleUpdateNameTagPosition(const LLVector3& root_pos_last);
|
||||
void idleUpdateNameTagPosition(const LLVector3& root_pos_last);
|
||||
void idleUpdateNameTagAlpha(BOOL new_name, F32 alpha);
|
||||
LLColor4 getNameTagColor(bool is_friend);
|
||||
void clearNameTag();
|
||||
|
|
@ -317,6 +318,8 @@ public:
|
|||
F32 mLastPelvisToFoot;
|
||||
F32 mPelvisFixup;
|
||||
F32 mLastPelvisFixup;
|
||||
LLVector3 mCurRootToHeadOffset;
|
||||
LLVector3 mTargetRootToHeadOffset;
|
||||
|
||||
LLVector3 mHeadOffset; // current head position
|
||||
LLViewerJoint mRoot;
|
||||
|
|
@ -325,7 +328,7 @@ protected:
|
|||
void buildCharacter();
|
||||
virtual BOOL loadAvatar();
|
||||
|
||||
BOOL setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
BOOL setupBone(const LLVOAvatarChildJoint& info, LLViewerJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num);
|
||||
BOOL buildSkeleton(const LLVOAvatarSkeletonInfo *info);
|
||||
private:
|
||||
BOOL mIsBuilt; // state of deferred character building
|
||||
|
|
@ -369,7 +372,7 @@ public:
|
|||
//--------------------------------------------------------------------
|
||||
private:
|
||||
static LLXmlTree sXMLTree; // avatar config file
|
||||
static LLXmlTree sSkeletonXMLTree; // avatar skeleton file
|
||||
static LLXMLNodePtr sSkeletonXMLTree; // avatar skeleton file
|
||||
|
||||
/** Skeleton
|
||||
** **
|
||||
|
|
@ -387,7 +390,6 @@ public:
|
|||
U32 renderRigid();
|
||||
U32 renderSkinned(EAvatarRenderPass pass);
|
||||
F32 getLastSkinTime() { return mLastSkinTime; }
|
||||
U32 renderSkinnedAttachments();
|
||||
U32 renderTransparent(BOOL first_pass);
|
||||
void renderCollisionVolumes();
|
||||
static void deleteCachedImages(bool clearAll=true);
|
||||
|
|
@ -735,7 +737,6 @@ public:
|
|||
public:
|
||||
BOOL hasHUDAttachment() const;
|
||||
LLBBox getHUDBBox() const;
|
||||
void rebuildHUD();
|
||||
void resetHUDAttachments();
|
||||
BOOL canAttachMoreObjects() const;
|
||||
BOOL canAttachMoreObjects(U32 n) const;
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -42,7 +42,11 @@
|
|||
#ifndef LL_VOICE_VISUALIZER_H
|
||||
#define LL_VOICE_VISUALIZER_H
|
||||
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
#include "llhudeffect.h"
|
||||
#else // XXX_STINSON_CHUI_REWORK
|
||||
#include "llpointer.h"
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
|
||||
//-----------------------------------------------------------------------------------------------
|
||||
// The values of voice gesticulation represent energy levels for avatar animation, based on
|
||||
|
|
@ -60,34 +64,45 @@ enum VoiceGesticulationLevel
|
|||
NUM_VOICE_GESTICULATION_LEVELS
|
||||
};
|
||||
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
const static int NUM_VOICE_SYMBOL_WAVES = 7;
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
|
||||
//----------------------------------------------------
|
||||
// LLVoiceVisualizer class
|
||||
//----------------------------------------------------
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
class LLVoiceVisualizer : public LLHUDEffect
|
||||
#else // XXX_STINSON_CHUI_REWORK
|
||||
class LLVoiceVisualizer : public LLRefCount
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
{
|
||||
//---------------------------------------------------
|
||||
// public methods
|
||||
//---------------------------------------------------
|
||||
public:
|
||||
LLVoiceVisualizer ( const U8 type ); //constructor
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
LLVoiceVisualizer( const U8 type ); //constructor
|
||||
#else // XXX_STINSON_CHUI_REWORK
|
||||
LLVoiceVisualizer(); //constructor
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
~LLVoiceVisualizer(); //destructor
|
||||
|
||||
friend class LLHUDObject;
|
||||
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
void setVoiceSourceWorldPosition( const LLVector3 &p ); // this should be the position of the speaking avatar's head
|
||||
void setMinGesticulationAmplitude( F32 ); // the lower range of meaningful amplitude for setting gesticulation level
|
||||
void setMaxGesticulationAmplitude( F32 ); // the upper range of meaningful amplitude for setting gesticulation level
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
void setStartSpeaking(); // tell me when the av starts speaking
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
void setVoiceEnabled( bool ); // tell me whether or not the user is voice enabled
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
void setSpeakingAmplitude( F32 ); // tell me how loud the av is speaking (ranges from 0 to 1)
|
||||
void setStopSpeaking(); // tell me when the av stops speaking
|
||||
bool getCurrentlySpeaking(); // the get for the above set
|
||||
VoiceGesticulationLevel getCurrentGesticulationLevel(); // based on voice amplitude, I'll give you the current "energy level" of avatar speech
|
||||
static void setPreferences( );
|
||||
static void lipStringToF32s ( std::string& in_string, F32*& out_F32s, U32& count_F32s ); // convert a string of digits to an array of floats
|
||||
void lipSyncOohAah( F32& ooh, F32& aah );
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
void render(); // inherited from HUD Effect
|
||||
void packData(LLMessageSystem *mesgsys); // inherited from HUD Effect
|
||||
void unpackData(LLMessageSystem *mesgsys, S32 blocknum); // inherited from HUD Effect
|
||||
|
|
@ -103,12 +118,17 @@ class LLVoiceVisualizer : public LLHUDEffect
|
|||
//----------------------------------------------------------------------------------------------
|
||||
void setMaxGesticulationAmplitude();
|
||||
void setMinGesticulationAmplitude();
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
|
||||
//---------------------------------------------------
|
||||
// private members
|
||||
//---------------------------------------------------
|
||||
private:
|
||||
|
||||
static bool handleVoiceVisualizerPrefsChanged(const LLSD& newvalue);
|
||||
static void setPreferences( );
|
||||
static void lipStringToF32s ( std::string& in_string, F32*& out_F32s, U32& count_F32s ); // convert a string of digits to an array of floats
|
||||
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
struct SoundSymbol
|
||||
{
|
||||
F32 mWaveExpansion [ NUM_VOICE_SYMBOL_WAVES ];
|
||||
|
|
@ -119,15 +139,20 @@ class LLVoiceVisualizer : public LLHUDEffect
|
|||
bool mActive;
|
||||
LLVector3 mPosition;
|
||||
};
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
|
||||
LLFrameTimer mTimer; // so I can ask the current time in seconds
|
||||
F64 mStartTime; // time in seconds when speaking started
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
F64 mCurrentTime; // current time in seconds, captured every step
|
||||
F64 mPreviousTime; // copy of "current time" from last frame
|
||||
SoundSymbol mSoundSymbol; // the sound symbol that appears over the avatar's head
|
||||
bool mVoiceEnabled; // if off, no rendering should happen
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
bool mCurrentlySpeaking; // is the user currently speaking?
|
||||
#ifdef XXX_STINSON_CHUI_REWORK
|
||||
LLVector3 mVoiceSourceWorldPosition; // give this to me every step - I need it to update the sound symbol
|
||||
#endif // XXX_STINSON_CHUI_REWORK
|
||||
F32 mSpeakingAmplitude; // this should be set as often as possible when the user is speaking
|
||||
F32 mMaxGesticulationAmplitude; // this is the upper-limit of the envelope of detectable gesticulation leves
|
||||
F32 mMinGesticulationAmplitude; // this is the lower-limit of the envelope of detectable gesticulation leves
|
||||
|
|
|
|||
|
|
@ -4664,11 +4664,6 @@ void LLPipeline::rebuildPools()
|
|||
}
|
||||
max_count--;
|
||||
}
|
||||
|
||||
if (isAgentAvatarValid())
|
||||
{
|
||||
gAgentAvatarp->rebuildHUD();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPipeline::addToQuickLookup( LLDrawPool* new_poolp )
|
||||
|
|
@ -6184,7 +6179,7 @@ void LLPipeline::resetVertexBuffers(LLDrawable* drawable)
|
|||
}
|
||||
|
||||
void LLPipeline::resetVertexBuffers()
|
||||
{
|
||||
{
|
||||
mResetVertexBuffers = true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,20 +7,20 @@
|
|||
height="570"
|
||||
help_topic="sidebar_people"
|
||||
min_height="440"
|
||||
min_width="333"
|
||||
min_width="390"
|
||||
layout="topleft"
|
||||
name="floater_people"
|
||||
save_rect="true"
|
||||
single_instance="true"
|
||||
reuse_instance="true"
|
||||
title="PEOPLE"
|
||||
width="333">
|
||||
width="390">
|
||||
<panel_container
|
||||
default_panel_name="panel_people"
|
||||
follows="all"
|
||||
height="570"
|
||||
name="main_panel"
|
||||
width="333">
|
||||
width="390">
|
||||
<panel
|
||||
class="panel_people"
|
||||
name="panel_people"
|
||||
|
|
@ -31,11 +31,5 @@
|
|||
filename="panel_group_info_sidetray.xml"
|
||||
label="Group Profile"
|
||||
font="SansSerifBold"/>
|
||||
<panel
|
||||
class="panel_block_list_sidetray"
|
||||
name="panel_block_list_sidetray"
|
||||
filename="panel_block_list_sidetray.xml"
|
||||
label="Blocked Residents & Objects"
|
||||
font="SansSerifBold"/>
|
||||
</panel_container>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,59 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<!--
|
||||
Not can_close / no title to avoid window chrome
|
||||
Single instance - only have one at a time, recycle it each spawn
|
||||
-->
|
||||
<floater
|
||||
legacy_header_height="25"
|
||||
bevel_style="in"
|
||||
bg_opaque_image="Inspector_Background"
|
||||
can_close="false"
|
||||
can_minimize="false"
|
||||
height="90"
|
||||
layout="topleft"
|
||||
name="floater_voice_volume"
|
||||
single_instance="true"
|
||||
sound_flags="0"
|
||||
title="VOICE VOLUME"
|
||||
visible="true"
|
||||
width="245">
|
||||
<text
|
||||
follows="top|left|right"
|
||||
font="SansSerifSmall"
|
||||
height="21"
|
||||
left="10"
|
||||
name="avatar_name"
|
||||
parse_urls="false"
|
||||
top="35"
|
||||
text_color="White"
|
||||
translate="false"
|
||||
use_ellipses="true"
|
||||
value="TestString PleaseIgnore"
|
||||
width="225" />
|
||||
<slider
|
||||
follows="top|left"
|
||||
height="23"
|
||||
increment="0.01"
|
||||
left="1"
|
||||
max_val="0.95"
|
||||
min_val="0.05"
|
||||
name="volume_slider"
|
||||
show_text="false"
|
||||
tool_tip="Voice volume"
|
||||
top_pad="0"
|
||||
value="0.5"
|
||||
width="200" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="16"
|
||||
image_disabled="Audio_Off"
|
||||
image_disabled_selected="AudioMute_Off"
|
||||
image_hover_selected="AudioMute_Over"
|
||||
image_selected="AudioMute_Off"
|
||||
image_unselected="Audio_Off"
|
||||
is_toggle="true"
|
||||
left_pad="0"
|
||||
top_delta="4"
|
||||
name="mute_btn"
|
||||
width="16" />
|
||||
</floater>
|
||||
|
|
@ -9,7 +9,7 @@
|
|||
bg_opaque_image="Inspector_Background"
|
||||
can_close="false"
|
||||
can_minimize="false"
|
||||
height="164"
|
||||
height="130"
|
||||
layout="topleft"
|
||||
name="inspect_avatar"
|
||||
single_instance="true"
|
||||
|
|
@ -94,32 +94,17 @@
|
|||
use_ellipses="true"
|
||||
width="220">This is my second life description and I really think it is great. But for some reason my description is super extra long because I like to talk a whole lot
|
||||
</text>
|
||||
<slider
|
||||
follows="top|left"
|
||||
height="23"
|
||||
increment="0.01"
|
||||
left="1"
|
||||
max_val="0.95"
|
||||
min_val="0.05"
|
||||
name="volume_slider"
|
||||
show_text="false"
|
||||
tool_tip="Voice volume"
|
||||
top_pad="0"
|
||||
value="0.5"
|
||||
width="200" />
|
||||
<button
|
||||
<text
|
||||
follows="top|left"
|
||||
height="16"
|
||||
image_disabled="Audio_Off"
|
||||
image_disabled_selected="AudioMute_Off"
|
||||
image_hover_selected="AudioMute_Over"
|
||||
image_selected="AudioMute_Off"
|
||||
image_unselected="Audio_Off"
|
||||
is_toggle="true"
|
||||
left_pad="0"
|
||||
top_delta="4"
|
||||
name="mute_btn"
|
||||
width="16" />
|
||||
left="8"
|
||||
name="avatar_profile_link"
|
||||
font="SansSerifSmall"
|
||||
text_color="White"
|
||||
top_pad="5"
|
||||
translate="false"
|
||||
value="[[LINK] View full profile]"
|
||||
width="175" />
|
||||
<avatar_icon
|
||||
follows="top|left"
|
||||
height="38"
|
||||
|
|
@ -130,83 +115,4 @@
|
|||
name="avatar_icon"
|
||||
top="10"
|
||||
width="38" />
|
||||
<!-- Overlapping buttons for default actions
|
||||
llinspectavatar.cpp makes visible the most likely default action
|
||||
-->
|
||||
<button
|
||||
follows="top|left"
|
||||
height="20"
|
||||
label="Add Friend"
|
||||
left="8"
|
||||
top="135"
|
||||
name="add_friend_btn"
|
||||
width="90" />
|
||||
<button
|
||||
follows="top|left"
|
||||
height="20"
|
||||
label="IM"
|
||||
left_delta="0"
|
||||
top_delta="0"
|
||||
name="im_btn"
|
||||
width="80"
|
||||
commit_callback.function="InspectAvatar.IM"/>
|
||||
<button
|
||||
follows="top|left"
|
||||
height="20"
|
||||
label="Profile"
|
||||
layout="topleft"
|
||||
name="view_profile_btn"
|
||||
left_delta="96"
|
||||
top_delta="0"
|
||||
tab_stop="false"
|
||||
width="80" />
|
||||
<!-- gear buttons here -->
|
||||
<menu_button
|
||||
follows="top|left"
|
||||
height="20"
|
||||
layout="topleft"
|
||||
image_overlay="OptionsMenu_Off"
|
||||
menu_filename="menu_inspect_avatar_gear.xml"
|
||||
name="gear_btn"
|
||||
right="-5"
|
||||
top_delta="0"
|
||||
width="35" />
|
||||
<menu_button
|
||||
follows="top|left"
|
||||
height="20"
|
||||
image_overlay="OptionsMenu_Off"
|
||||
menu_filename="menu_inspect_self_gear.xml"
|
||||
name="gear_self_btn"
|
||||
right="-5"
|
||||
top_delta="0"
|
||||
width="35" />
|
||||
<panel
|
||||
follows="top|left"
|
||||
top="164"
|
||||
left="0"
|
||||
height="60"
|
||||
width="228"
|
||||
visible="false"
|
||||
background_visible="true"
|
||||
name="moderator_panel"
|
||||
background_opaque="true"
|
||||
bg_opaque_color="MouseGray">
|
||||
<button
|
||||
name="disable_voice"
|
||||
label="Disable Voice"
|
||||
top="20"
|
||||
width="95"
|
||||
height="20"
|
||||
left="10"
|
||||
commit_callback.function="InspectAvatar.DisableVoice"/>
|
||||
<button
|
||||
name="enable_voice"
|
||||
label="Enable Voice"
|
||||
top="20"
|
||||
width="95"
|
||||
height="20"
|
||||
left="10"
|
||||
visible="false"
|
||||
commit_callback.function="InspectAvatar.EnableVoice"/>
|
||||
</panel>
|
||||
</floater>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<menu name="menu_group_plus"
|
||||
<toggleable_menu name="menu_group_plus"
|
||||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false">
|
||||
<menu_item_call name="item_join" label="Join Group...">
|
||||
|
|
@ -8,4 +8,4 @@
|
|||
<menu_item_call name="item_new" label="New Group...">
|
||||
<menu_item_call.on_click function="People.Group.Plus.Action" userdata="new_group" />
|
||||
</menu_item_call>
|
||||
</menu>
|
||||
</toggleable_menu>
|
||||
|
|
|
|||
|
|
@ -1,143 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<toggleable_menu
|
||||
create_jump_keys="true"
|
||||
layout="topleft"
|
||||
mouse_opaque="false"
|
||||
visible="false"
|
||||
name="Gear Menu">
|
||||
<menu_item_call
|
||||
label="View Profile"
|
||||
enabled="true"
|
||||
name="view_profile">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.ViewProfile"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Add Friend"
|
||||
name="add_friend">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.AddFriend"/>
|
||||
<menu_item_call.on_enable
|
||||
function="InspectAvatar.Gear.Enable"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="IM"
|
||||
name="im">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.IM"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Call"
|
||||
enabled="true"
|
||||
name="call">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Call"/>
|
||||
<menu_item_call.on_enable
|
||||
function="InspectAvatar.Gear.EnableCall"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Teleport"
|
||||
name="teleport">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Teleport"/>
|
||||
<menu_item_call.on_enable
|
||||
function="InspectAvatar.Gear.EnableTeleportOffer"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Invite to Group"
|
||||
name="invite_to_group">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.InviteToGroup"/>
|
||||
</menu_item_call>
|
||||
<menu_item_separator />
|
||||
<menu_item_call
|
||||
label="Block"
|
||||
name="block">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.ToggleMute"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.EnableMute" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Unblock"
|
||||
name="unblock">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.ToggleMute"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.EnableUnmute" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Report"
|
||||
name="report">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Report"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Freeze"
|
||||
name="freeze">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Freeze"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.VisibleFreeze"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Eject"
|
||||
name="eject">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Eject"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.VisibleEject"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Kick"
|
||||
name="kick">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Kick"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.EnableGod"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="CSR"
|
||||
name="csr">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.CSR" />
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.EnableGod" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Debug Textures"
|
||||
name="debug">
|
||||
<menu_item_call.on_click
|
||||
function="Avatar.Debug"/>
|
||||
<menu_item_call.on_visible
|
||||
function="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Find On Map"
|
||||
name="find_on_map">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.FindOnMap"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.VisibleFindOnMap"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Zoom In"
|
||||
name="zoom_in">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.ZoomIn"/>
|
||||
<menu_item_call.on_visible
|
||||
function="InspectAvatar.VisibleZoomIn"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Pay"
|
||||
name="pay">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Pay"/>
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Share"
|
||||
name="share">
|
||||
<menu_item_call.on_click
|
||||
function="InspectAvatar.Share"/>
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu
|
||||
layout="topleft"
|
||||
name="Self Pie">
|
||||
<menu_item_call
|
||||
label="Sit Down"
|
||||
layout="topleft"
|
||||
name="Sit Down Here">
|
||||
<menu_item_call.on_click
|
||||
function="Self.SitDown"
|
||||
parameter="" />
|
||||
<menu_item_call.on_enable
|
||||
function="Self.EnableSitDown" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Stand Up"
|
||||
layout="topleft"
|
||||
name="Stand Up">
|
||||
<menu_item_call.on_click
|
||||
function="Self.StandUp"
|
||||
parameter="" />
|
||||
<menu_item_call.on_enable
|
||||
function="Self.EnableStandUp" />
|
||||
</menu_item_call>
|
||||
<context_menu
|
||||
label="Take Off"
|
||||
layout="topleft"
|
||||
name="Take Off >">
|
||||
<context_menu
|
||||
label="Clothes"
|
||||
layout="topleft"
|
||||
name="Clothes >">
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Shirt"
|
||||
layout="topleft"
|
||||
name="Shirt">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="shirt" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="shirt" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Pants"
|
||||
layout="topleft"
|
||||
name="Pants">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="pants" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="pants" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Skirt"
|
||||
layout="topleft"
|
||||
name="Skirt">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="skirt" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="skirt" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Shoes"
|
||||
layout="topleft"
|
||||
name="Shoes">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="shoes" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="shoes" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Socks"
|
||||
layout="topleft"
|
||||
name="Socks">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="socks" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="socks" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Jacket"
|
||||
layout="topleft"
|
||||
name="Jacket">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="jacket" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="jacket" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Gloves"
|
||||
layout="topleft"
|
||||
name="Gloves">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="gloves" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="gloves" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Undershirt"
|
||||
layout="topleft"
|
||||
name="Self Undershirt">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="undershirt" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="undershirt" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Underpants"
|
||||
layout="topleft"
|
||||
name="Self Underpants">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="underpants" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="underpants" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Tattoo"
|
||||
layout="topleft"
|
||||
name="Self Tattoo">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="tattoo" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="tattoo" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
enabled="false"
|
||||
label="Alpha"
|
||||
layout="topleft"
|
||||
name="Self Alpha">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="alpha" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableTakeOff"
|
||||
parameter="alpha" />
|
||||
</menu_item_call>
|
||||
<menu_item_separator
|
||||
layout="topleft" />
|
||||
<menu_item_call
|
||||
label="All Clothes"
|
||||
layout="topleft"
|
||||
name="All Clothes">
|
||||
<menu_item_call.on_click
|
||||
function="Edit.TakeOff"
|
||||
parameter="all" />
|
||||
</menu_item_call>
|
||||
</context_menu>
|
||||
<context_menu
|
||||
label="HUD"
|
||||
layout="topleft"
|
||||
name="Object Detach HUD" />
|
||||
<context_menu
|
||||
label="Detach"
|
||||
layout="topleft"
|
||||
name="Object Detach" />
|
||||
<menu_item_call
|
||||
label="Detach All"
|
||||
layout="topleft"
|
||||
name="Detach All">
|
||||
<menu_item_call.on_click
|
||||
function="Self.RemoveAllAttachments"
|
||||
parameter="" />
|
||||
<menu_item_call.on_enable
|
||||
function="Self.EnableRemoveAllAttachments" />
|
||||
</menu_item_call>
|
||||
</context_menu>
|
||||
<menu_item_call
|
||||
label="Change Outfit"
|
||||
layout="topleft"
|
||||
name="Chenge Outfit">
|
||||
<menu_item_call.on_click
|
||||
function="CustomizeAvatar" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit My Outfit"
|
||||
layout="topleft"
|
||||
name="Edit Outfit">
|
||||
<menu_item_call.on_click
|
||||
function="EditOutfit" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableCustomizeAvatar" />
|
||||
</menu_item_call>
|
||||
<menu_item_call label="Edit My Shape"
|
||||
layout="topleft"
|
||||
name="Edit My Shape">
|
||||
<menu_item_call.on_click
|
||||
function="EditShape" />
|
||||
<menu_item_call.on_enable
|
||||
function="Edit.EnableEditShape" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="My Friends"
|
||||
layout="topleft"
|
||||
name="Friends...">
|
||||
<menu_item_call.on_click
|
||||
function="SideTray.PanelPeopleTab"
|
||||
parameter="friends_panel" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="My Groups"
|
||||
layout="topleft"
|
||||
name="Groups...">
|
||||
<menu_item_call.on_click
|
||||
function="SideTray.PanelPeopleTab"
|
||||
parameter="groups_panel" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="My Profile"
|
||||
layout="topleft"
|
||||
name="Profile...">
|
||||
<menu_item_call.on_click
|
||||
function="ShowAgentProfile"
|
||||
parameter="agent" />
|
||||
</menu_item_call>
|
||||
<menu_item_call
|
||||
label="Debug Textures"
|
||||
name="Debug...">
|
||||
<menu_item_call.on_click
|
||||
function="Avatar.Debug" />
|
||||
<menu_item_call.on_visible
|
||||
function="IsGodCustomerService"/>
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
@ -40,8 +40,4 @@
|
|||
function="CheckControl"
|
||||
parameter="FriendsListShowPermissions" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator layout="topleft" />
|
||||
<menu_item_call name="show_blocked_list" label="Show Blocked Residents & Objects">
|
||||
<menu_item_call.on_click function="People.Friends.ViewSort.Action" parameter="panel_block_list_sidetray" />
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<menu name="menu_group_plus"
|
||||
<toggleable_menu name="menu_group_plus"
|
||||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false" opaque="true" color="MenuDefaultBgColor">
|
||||
<menu_item_call
|
||||
|
|
@ -54,4 +54,4 @@
|
|||
function="People.Groups.Enable"
|
||||
parameter="leave" />
|
||||
</menu_item_call>
|
||||
</menu>
|
||||
</toggleable_menu>
|
||||
|
|
|
|||
|
|
@ -14,13 +14,4 @@
|
|||
function="CheckControl"
|
||||
parameter="GroupListShowIcons" />
|
||||
</menu_item_check>
|
||||
<menu_item_call
|
||||
label="Leave Selected Group"
|
||||
layout="topleft"
|
||||
name="Leave Selected Group">
|
||||
<menu_item_call.on_click
|
||||
function="People.Group.Minus.Action"/>
|
||||
<menu_item_call.on_enable
|
||||
function="People.Group.Minus.Enable"/>
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu
|
||||
name="menu_group_plus"
|
||||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false">
|
||||
<menu_item_check
|
||||
label="Sort by Recent Speakers"
|
||||
name="sort_by_recent_speakers">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_by_recent_speakers"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_by_recent_speakers"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by Name"
|
||||
name="sort_name">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_name"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_name"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by Distance"
|
||||
name="sort_distance">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_distance"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_distance"/>
|
||||
</menu_item_check>
|
||||
<menu_item_separator layout="topleft" />
|
||||
<menu_item_check name="view_icons" label="View People Icons">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="view_icons" />
|
||||
<menu_item_check.on_check
|
||||
function="CheckControl"
|
||||
parameter="NearbyListShowIcons" />
|
||||
</menu_item_check>
|
||||
<menu_item_check name ="view_map" label="View Map">
|
||||
<menu_item_check.on_check
|
||||
function="CheckControl"
|
||||
parameter="NearbyListShowMap" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="NearbyListShowMap" />
|
||||
</menu_item_check>
|
||||
</toggleable_menu>
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
|
||||
<toggleable_menu
|
||||
name="menu_group_plus"
|
||||
left="0" bottom="0" visible="false"
|
||||
mouse_opaque="false">
|
||||
<menu_item_check
|
||||
label="Sort by Recent Speakers"
|
||||
name="sort_by_recent_speakers">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_by_recent_speakers"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_by_recent_speakers"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by Name"
|
||||
name="sort_name">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_name"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_name"/>
|
||||
</menu_item_check>
|
||||
<menu_item_check
|
||||
label="Sort by Distance"
|
||||
name="sort_distance">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="sort_distance"/>
|
||||
<menu_item_check.on_check
|
||||
function="People.Nearby.ViewSort.CheckItem"
|
||||
parameter="sort_distance"/>
|
||||
</menu_item_check>
|
||||
<menu_item_separator layout="topleft" />
|
||||
<menu_item_check name="view_icons" label="View People Icons">
|
||||
<menu_item_check.on_click
|
||||
function="People.Nearby.ViewSort.Action"
|
||||
parameter="view_icons" />
|
||||
<menu_item_check.on_check
|
||||
function="CheckControl"
|
||||
parameter="NearbyListShowIcons" />
|
||||
</menu_item_check>
|
||||
<menu_item_check name ="view_map" label="View Map">
|
||||
<menu_item_check.on_check
|
||||
function="CheckControl"
|
||||
parameter="NearbyListShowMap" />
|
||||
<menu_item_check.on_click
|
||||
function="ToggleControl"
|
||||
parameter="NearbyListShowMap" />
|
||||
</menu_item_check>
|
||||
<menu_item_separator layout="topleft" />
|
||||
<menu_item_call name="show_blocked_list" label="Show Blocked Residents & Objects">
|
||||
<menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="panel_block_list_sidetray" />
|
||||
</menu_item_call>
|
||||
</toggleable_menu>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue