Automated merge up from viewer 2.0 trunk.

Some llvoiceclient changes duplicated changes that had already been
made in the voice modularization refactor, so the refactor versions
were used.
Roxie Linden 2010-02-24 17:04:48 -08:00
commit 6bb43e1369
125 changed files with 2023 additions and 829 deletions

View File

@ -119,6 +119,7 @@ ARGUMENTS=[
On Linux this would try to use Linux_i686Manifest.""",
default=""),
dict(name='build', description='Build directory.', default=DEFAULT_SRCTREE),
dict(name='buildtype', description='Build type (i.e. Debug, Release, RelWithDebInfo).', default=None),
dict(name='configuration',
description="""The build configuration used.""",
default="Release"),

View File

@ -124,7 +124,8 @@ void LLPluginClassMedia::reset()
mCanPaste = false;
mMediaName.clear();
mMediaDescription.clear();
mBackgroundColor = LLColor4::white;
// media_browser class
mNavigateURI.clear();
mNavigateResultCode = -1;
@ -234,6 +235,10 @@ void LLPluginClassMedia::idle(void)
message.setValueS32("height", mRequestedMediaHeight);
message.setValueS32("texture_width", mRequestedTextureWidth);
message.setValueS32("texture_height", mRequestedTextureHeight);
message.setValueReal("background_r", mBackgroundColor.mV[VX]);
message.setValueReal("background_g", mBackgroundColor.mV[VY]);
message.setValueReal("background_b", mBackgroundColor.mV[VZ]);
message.setValueReal("background_a", mBackgroundColor.mV[VW]);
mPlugin->sendMessage(message); // DO NOT just use sendMessage() here -- we want this to jump ahead of the queue.
LL_DEBUGS("Plugin") << "Sending size_change" << LL_ENDL;

View File

@ -39,7 +39,7 @@
#include "llrect.h"
#include "llpluginclassmediaowner.h"
#include <queue>
#include "v4color.h"
class LLPluginClassMedia : public LLPluginProcessParentOwner
{
@ -86,6 +86,8 @@ public:
void setSize(int width, int height);
void setAutoScale(bool auto_scale);
void setBackgroundColor(LLColor4 color) { mBackgroundColor = color; };
// Returns true if all of the texture parameters (depth, format, size, and texture size) are set up and consistent.
// This will initially be false, and will also be false for some time after setSize while the resize is processed.
// Note that if this returns true, it is safe to use all the get() functions above without checking for invalid return values
@ -328,6 +330,8 @@ protected:
std::string mMediaName;
std::string mMediaDescription;
LLColor4 mBackgroundColor;
/////////////////////////////////////////
// media_browser class
std::string mNavigateURI;

View File

@ -1061,17 +1061,20 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
}
}
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLIndices)
if (mGLIndices)
{
if (gDebugSession)
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLIndices)
{
error = TRUE;
gFailLog << "Invalid GL index buffer bound: " << buff << std::endl;
}
else
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
if (gDebugSession)
{
error = TRUE;
gFailLog << "Invalid GL index buffer bound: " << buff << std::endl;
}
else
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
}
}
}
}
@ -1095,17 +1098,20 @@ void LLVertexBuffer::setBuffer(U32 data_mask)
}
}
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLIndices)
if (mGLIndices != 0)
{
if (gDebugSession)
glGetIntegerv(GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB, &buff);
if ((GLuint)buff != mGLIndices)
{
error = TRUE;
gFailLog << "Invalid GL index buffer bound: "<< std::endl;
}
else
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
if (gDebugSession)
{
error = TRUE;
gFailLog << "Invalid GL index buffer bound: "<< std::endl;
}
else
{
llerrs << "Invalid GL index buffer bound: " << buff << llendl;
}
}
}
}

View File

@ -180,7 +180,7 @@ void LLConsole::draw()
// draw remaining lines
F32 y_pos = 0.f;
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
// F32 console_opacity = llclamp(gSavedSettings.getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);
F32 console_opacity = llclamp(LLUI::sSettingGroups["config"]->getF32("ConsoleBackgroundOpacity"), 0.f, 1.f);

View File

@ -2966,7 +2966,7 @@ void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y)
LLUI::getMousePositionLocal(menu->getParent(), &mouse_x, &mouse_y);
LLMenuHolderGL::sContextMenuSpawnPos.set(mouse_x,mouse_y);
const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getMenuRect();
const LLRect menu_region_rect = LLMenuGL::sMenuContainer->getRect();
const S32 HPAD = 2;
LLRect rect = menu->getRect();

View File

@ -490,7 +490,7 @@ void LLMultiSlider::draw()
F32 opacity = getEnabled() ? 1.f : 0.3f;
// Track
LLUIImagePtr thumb_imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImagePtr thumb_imagep = LLUI::getUIImage("Rounded_Square");
static LLUICachedControl<S32> multi_track_height ("UIMultiTrackHeight", 0);
S32 height_offset = (getRect().getHeight() - multi_track_height) / 2;

View File

@ -188,7 +188,7 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p)
// initialize rounded rect image
if (!mRoundedRectImage)
{
mRoundedRectImage = LLUI::getUIImage("rounded_square.tga");
mRoundedRectImage = LLUI::getUIImage("Rounded_Square");
}
}

View File

@ -98,6 +98,9 @@ private:
int mLastMouseX;
int mLastMouseY;
bool mFirstFocus;
F32 mBackgroundR;
F32 mBackgroundG;
F32 mBackgroundB;
void setInitState(int state)
{
@ -237,8 +240,9 @@ private:
// don't flip bitmap
LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );
// set background color to be black - mostly for initial login page
LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, 0x00, 0x00, 0x00 );
// set background color
// convert background color channels from [0.0, 1.0] to [0, 255];
LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, int(mBackgroundR * 255.0f), int(mBackgroundG * 255.0f), int(mBackgroundB * 255.0f) );
// Set state _before_ starting the navigate, since onNavigateBegin might get called before this call returns.
setInitState(INIT_STATE_NAVIGATING);
@ -246,7 +250,21 @@ private:
// Don't do this here -- it causes the dreaded "white flash" when loading a browser instance.
// FIXME: Re-added this because navigating to a "page" initializes things correctly - especially
// for the HTTP AUTH dialog issues (DEV-41731). Will fix at a later date.
LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
// Build a data URL like this: "data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#RRGGBB%22%3E%3C/body%3E%3C/html%3E"
// where RRGGBB is the background color in HTML style
std::stringstream url;
url << "data:text/html,%3Chtml%3E%3Cbody%20bgcolor=%22#";
// convert background color channels from [0.0, 1.0] to [0, 255];
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundR * 255.0f);
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundG * 255.0f);
url << std::setfill('0') << std::setw(2) << std::hex << int(mBackgroundB * 255.0f);
url << "%22%3E%3C/body%3E%3C/html%3E";
lldebugs << "data url is: " << url.str() << llendl;
LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, url.str() );
// LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
return true;
};
@ -318,7 +336,9 @@ private:
if(mInitState == INIT_STATE_NAVIGATE_COMPLETE)
{
setInitState(INIT_STATE_WAIT_REDRAW);
// Skip the WAIT_REDRAW state now -- with the right background color set, it should no longer be necessary.
// setInitState(INIT_STATE_WAIT_REDRAW);
setInitState(INIT_STATE_WAIT_COMPLETE);
}
}
@ -704,7 +724,11 @@ void MediaPluginWebKit::receiveMessage(const char *message_string)
S32 height = message_in.getValueS32("height");
S32 texture_width = message_in.getValueS32("texture_width");
S32 texture_height = message_in.getValueS32("texture_height");
mBackgroundR = message_in.getValueReal("background_r");
mBackgroundG = message_in.getValueReal("background_g");
mBackgroundB = message_in.getValueReal("background_b");
// mBackgroundA = message_in.setValueReal("background_a"); // Ignore any alpha
if(!name.empty())
{
// Find the shared memory region with this name

View File

@ -251,6 +251,7 @@ set(viewer_SOURCE_FILES
llinspectgroup.cpp
llinspectobject.cpp
llinspectremoteobject.cpp
llinspecttoast.cpp
llinventorybridge.cpp
llinventoryclipboard.cpp
llinventoryfilter.cpp
@ -388,6 +389,7 @@ set(viewer_SOURCE_FILES
llspatialpartition.cpp
llspeakbutton.cpp
llspeakers.cpp
llspeakingindicatormanager.cpp
llsplitbutton.cpp
llsprite.cpp
llstartup.cpp
@ -759,6 +761,7 @@ set(viewer_HEADER_FILES
llinspectgroup.h
llinspectobject.h
llinspectremoteobject.h
llinspecttoast.h
llinventorybridge.h
llinventoryclipboard.h
llinventoryfilter.h
@ -894,6 +897,7 @@ set(viewer_HEADER_FILES
llspatialpartition.h
llspeakbutton.h
llspeakers.h
llspeakingindicatormanager.h
llsplitbutton.h
llsprite.h
llstartup.h
@ -1502,6 +1506,7 @@ if (WINDOWS)
--actions=copy
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
--grid=${GRID}
@ -1572,6 +1577,7 @@ if (WINDOWS)
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--channel=${VIEWER_CHANNEL}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
@ -1655,6 +1661,7 @@ if (LINUX)
--arch=${ARCH}
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--channel=${VIEWER_CHANNEL}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/packaged
@ -1700,6 +1707,7 @@ if (DARWIN)
--actions=copy
--artwork=${ARTWORK_DIR}
--build=${CMAKE_CURRENT_BINARY_DIR}
--buildtype=${CMAKE_BUILD_TYPE}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${product}.app
--grid=${GRID}
@ -1720,6 +1728,7 @@ if (DARWIN)
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
--grid=${GRID}
--buildtype=${CMAKE_BUILD_TYPE}
--configuration=${CMAKE_CFG_INTDIR}
--channel=${VIEWER_CHANNEL}
--login_channel=${VIEWER_LOGIN_CHANNEL}
@ -1739,6 +1748,7 @@ if (DARWIN)
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
--grid=${GRID}
--buildtype=${CMAKE_BUILD_TYPE}
--configuration=${CMAKE_CFG_INTDIR}
--channel=${VIEWER_CHANNEL}
--login_channel=${VIEWER_LOGIN_CHANNEL}
@ -1759,6 +1769,7 @@ if (INSTALL)
endif (INSTALL)
if (LL_TESTS)
else (LL_TESTS)
# To add a viewer unit test, just add the test .cpp file below
# This creates a separate test project per file listed.
include(LLAddBuildTest)

View File

@ -3279,17 +3279,6 @@
<key>Value</key>
<real>0.75</real>
</map>
<key>FolderIndentation</key>
<map>
<key>Comment</key>
<string>Number of pixels to indent subfolders in inventory</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>S32</string>
<key>Value</key>
<integer>8</integer>
</map>
<key>FolderLoadingMessageWaitTime</key>
<map>
<key>Comment</key>

View File

@ -5157,6 +5157,11 @@ BOOL LLAgent::setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOO
return FALSE;
}
BOOL LLAgent::canJoinGroups() const
{
return mGroups.count() < MAX_AGENT_GROUPS;
}
LLQuaternion LLAgent::getHeadRotation()
{
if (mAvatarObject.isNull() || !mAvatarObject->mPelvisp || !mAvatarObject->mHeadp)

View File

@ -973,6 +973,7 @@ public:
BOOL setGroupContribution(const LLUUID& group_id, S32 contribution);
BOOL setUserGroupFlags(const LLUUID& group_id, BOOL accept_notices, BOOL list_in_profile);
const std::string &getGroupName() const { return mGroupName; }
BOOL canJoinGroups() const;
private:
std::string mGroupName;
LLUUID mGroupID;

View File

@ -82,7 +82,7 @@ void LLAvatarList::setSpeakingIndicatorsVisible(bool visible)
getItems(items);
for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++)
{
static_cast<LLAvatarListItem*>(*it)->setSpeakingIndicatorVisible(mShowSpeakingIndicator);
static_cast<LLAvatarListItem*>(*it)->showSpeakingIndicator(mShowSpeakingIndicator);
}
}
@ -323,18 +323,15 @@ boost::signals2::connection LLAvatarList::setRefreshCompleteCallback(const commi
void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos)
{
LLAvatarListItem* item = new LLAvatarListItem();
item->showInfoBtn(true);
item->showSpeakingIndicator(true);
item->setName(name);
item->setAvatarId(id, mIgnoreOnlineStatus);
item->setOnline(mIgnoreOnlineStatus ? true : is_online);
item->showLastInteractionTime(mShowLastInteractionTime);
item->childSetVisible("info_btn", false);
item->setAvatarIconVisible(mShowIcons);
item->setShowInfoBtn(mShowInfoBtn);
item->setShowProfileBtn(mShowProfileBtn);
item->setSpeakingIndicatorVisible(mShowSpeakingIndicator);
item->showSpeakingIndicator(mShowSpeakingIndicator);
addItem(item, id, pos);
}

View File

@ -44,10 +44,10 @@
#include "llbutton.h"
bool LLAvatarListItem::sStaticInitialized = false;
S32 LLAvatarListItem::sIconWidth = 0;
S32 LLAvatarListItem::sInfoBtnWidth = 0;
S32 LLAvatarListItem::sProfileBtnWidth = 0;
S32 LLAvatarListItem::sSpeakingIndicatorWidth = 0;
S32 LLAvatarListItem::sLeftPadding = 0;
S32 LLAvatarListItem::sRightNamePadding = 0;
S32 LLAvatarListItem::sChildrenWidths[LLAvatarListItem::ALIC_COUNT];
LLAvatarListItem::LLAvatarListItem(bool not_from_ui_factory/* = true*/)
: LLPanel(),
@ -95,10 +95,7 @@ BOOL LLAvatarListItem::postBuild()
// so that we can hide and show the icon again later.
if (!sStaticInitialized)
{
sIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft;
sInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight;
sProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight;
sSpeakingIndicatorWidth = mSpeakingIndicator->getRect().mRight - mAvatarName->getRect().mRight;
initChildrenWidths(this);
sStaticInitialized = true;
}
@ -130,6 +127,15 @@ BOOL LLAvatarListItem::postBuild()
return TRUE;
}
S32 LLAvatarListItem::notifyParent(const LLSD& info)
{
if (info.has("visibility_changed"))
{
updateChildren();
}
return 0;
}
void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
{
childSetVisible("hovered_icon", true);
@ -137,6 +143,8 @@ void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask)
mProfileBtn->setVisible(mShowProfileBtn);
LLPanel::onMouseEnter(x, y, mask);
updateChildren();
}
void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask)
@ -146,6 +154,8 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask)
mProfileBtn->setVisible(false);
LLPanel::onMouseLeave(x, y, mask);
updateChildren();
}
// virtual, called by LLAvatarTracker
@ -215,12 +225,8 @@ void LLAvatarListItem::showLastInteractionTime(bool show)
if (show)
return;
LLRect name_rect = mAvatarName->getRect();
LLRect time_rect = mLastInteractionTime->getRect();
mLastInteractionTime->setVisible(false);
name_rect.mRight += (time_rect.mRight - name_rect.mRight);
mAvatarName->setRect(name_rect);
updateChildren();
}
void LLAvatarListItem::setLastInteractionTime(U32 secs_since)
@ -234,12 +240,6 @@ void LLAvatarListItem::setShowInfoBtn(bool show)
if(mShowInfoBtn == show)
return;
mShowInfoBtn = show;
S32 width_delta = show ? - sInfoBtnWidth : sInfoBtnWidth;
//Translating speaking indicator
mSpeakingIndicator->translate(width_delta, 0);
//Reshaping avatar name
mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight());
}
void LLAvatarListItem::setShowProfileBtn(bool show)
@ -248,24 +248,17 @@ void LLAvatarListItem::setShowProfileBtn(bool show)
if(mShowProfileBtn == show)
return;
mShowProfileBtn = show;
S32 width_delta = show ? - sProfileBtnWidth : sProfileBtnWidth;
//Translating speaking indicator
mSpeakingIndicator->translate(width_delta, 0);
//Reshaping avatar name
mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight());
}
void LLAvatarListItem::setSpeakingIndicatorVisible(bool visible)
void LLAvatarListItem::showSpeakingIndicator(bool visible)
{
// Already done? Then do nothing.
if (mSpeakingIndicator->getVisible() == (BOOL)visible)
return;
mSpeakingIndicator->setVisible(visible);
S32 width_delta = visible ? - sSpeakingIndicatorWidth : sSpeakingIndicatorWidth;
//Reshaping avatar name
mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight());
// Disabled to not contradict with SpeakingIndicatorManager functionality. EXT-3976
// probably this method should be totally removed.
// mSpeakingIndicator->setVisible(visible);
// updateChildren();
}
void LLAvatarListItem::setAvatarIconVisible(bool visible)
@ -276,11 +269,7 @@ void LLAvatarListItem::setAvatarIconVisible(bool visible)
// Show/hide avatar icon.
mAvatarIcon->setVisible(visible);
// Move the avatar name horizontally by icon size + its distance from the avatar name.
LLRect name_rect = mAvatarName->getRect();
name_rect.mLeft += visible ? sIconWidth : -sIconWidth;
mAvatarName->setRect(name_rect);
updateChildren();
}
void LLAvatarListItem::onInfoBtnClick()
@ -344,21 +333,6 @@ void LLAvatarListItem::onNameCache(const std::string& first_name, const std::str
setName(name);
}
void LLAvatarListItem::reshapeAvatarName()
{
S32 width_delta = 0;
width_delta += mShowProfileBtn ? sProfileBtnWidth : 0;
width_delta += mSpeakingIndicator->getVisible() ? sSpeakingIndicatorWidth : 0;
width_delta += mAvatarIcon->getVisible() ? sIconWidth : 0;
width_delta += mShowInfoBtn ? sInfoBtnWidth : 0;
width_delta += mLastInteractionTime->getVisible() ? mLastInteractionTime->getRect().getWidth() : 0;
S32 height = mAvatarName->getRect().getHeight();
S32 width = getRect().getWidth() - width_delta;
mAvatarName->reshape(width, height);
}
// Convert given number of seconds to a string like "23 minutes", "15 hours" or "3 years",
// taking i18n into account. The format string to use is taken from the panel XML.
std::string LLAvatarListItem::formatSeconds(U32 secs)
@ -492,4 +466,133 @@ LLAvatarListItem::icon_color_map_t& LLAvatarListItem::getItemIconColorMap()
return item_icon_color_map;
}
// static
void LLAvatarListItem::initChildrenWidths(LLAvatarListItem* avatar_item)
{
//profile btn width + padding
S32 profile_btn_width = avatar_item->getRect().getWidth() - avatar_item->mProfileBtn->getRect().mLeft;
//info btn width + padding
S32 info_btn_width = avatar_item->mProfileBtn->getRect().mLeft - avatar_item->mInfoBtn->getRect().mLeft;
//speaking indicator width + padding
S32 speaking_indicator_width = avatar_item->mInfoBtn->getRect().mLeft - avatar_item->mSpeakingIndicator->getRect().mLeft;
// last interaction time textbox width + padding
S32 last_interaction_time_width = avatar_item->mSpeakingIndicator->getRect().mLeft - avatar_item->mLastInteractionTime->getRect().mLeft;
// icon width + padding
S32 icon_width = avatar_item->mAvatarName->getRect().mLeft - avatar_item->mAvatarIcon->getRect().mLeft;
sLeftPadding = avatar_item->mAvatarIcon->getRect().mLeft;
sRightNamePadding = avatar_item->mLastInteractionTime->getRect().mLeft - avatar_item->mAvatarName->getRect().mRight;
S32 index = ALIC_COUNT;
sChildrenWidths[--index] = icon_width;
sChildrenWidths[--index] = 0; // for avatar name we don't need its width, it will be calculated as "left available space"
sChildrenWidths[--index] = last_interaction_time_width;
sChildrenWidths[--index] = speaking_indicator_width;
sChildrenWidths[--index] = info_btn_width;
sChildrenWidths[--index] = profile_btn_width;
}
void LLAvatarListItem::updateChildren()
{
LL_DEBUGS("AvatarItemReshape") << LL_ENDL;
LL_DEBUGS("AvatarItemReshape") << "Updating for: " << getAvatarName() << LL_ENDL;
S32 name_new_width = getRect().getWidth();
S32 ctrl_new_left = name_new_width;
S32 name_new_left = sLeftPadding;
// iterate through all children and set them into correct position depend on each child visibility
// assume that child indexes are in back order: the first in Enum is the last (right) in the item
// iterate & set child views starting from right to left
for (S32 i = 0; i < ALIC_COUNT; ++i)
{
// skip "name" textbox, it will be processed out of loop later
if (ALIC_NAME == i) continue;
LLView* control = getItemChildView((EAvatarListItemChildIndex)i);
LL_DEBUGS("AvatarItemReshape") << "Processing control: " << control->getName() << LL_ENDL;
// skip invisible views
if (!control->getVisible()) continue;
S32 ctrl_width = sChildrenWidths[i]; // including space between current & left controls
// decrease available for
name_new_width -= ctrl_width;
LL_DEBUGS("AvatarItemReshape") << "width: " << ctrl_width << ", name_new_width: " << name_new_width << LL_ENDL;
LLRect control_rect = control->getRect();
LL_DEBUGS("AvatarItemReshape") << "rect before: " << control_rect << LL_ENDL;
if (ALIC_ICON == i)
{
// assume that this is the last iteration,
// so it is not necessary to save "ctrl_new_left" value calculated on previous iterations
ctrl_new_left = sLeftPadding;
name_new_left = ctrl_new_left + ctrl_width;
}
else
{
ctrl_new_left -= ctrl_width;
}
LL_DEBUGS("AvatarItemReshape") << "ctrl_new_left: " << ctrl_new_left << LL_ENDL;
control_rect.setLeftTopAndSize(
ctrl_new_left,
control_rect.mTop,
control_rect.getWidth(),
control_rect.getHeight());
LL_DEBUGS("AvatarItemReshape") << "rect after: " << control_rect << LL_ENDL;
control->setShape(control_rect);
}
// set size and position of the "name" child
LLView* name_view = getItemChildView(ALIC_NAME);
LLRect name_view_rect = name_view->getRect();
LL_DEBUGS("AvatarItemReshape") << "name rect before: " << name_view_rect << LL_ENDL;
// apply paddings
name_new_width -= sLeftPadding;
name_new_width -= sRightNamePadding;
name_view_rect.setLeftTopAndSize(
name_new_left,
name_view_rect.mTop,
name_new_width,
name_view_rect.getHeight());
name_view->setShape(name_view_rect);
LL_DEBUGS("AvatarItemReshape") << "name rect after: " << name_view_rect << LL_ENDL;
}
LLView* LLAvatarListItem::getItemChildView(EAvatarListItemChildIndex child_view_index)
{
LLView* child_view = mAvatarName;
if (child_view_index < 0 || ALIC_COUNT <= child_view_index)
{
LL_WARNS("AvatarItemReshape") << "Child view index is out of range: " << child_view_index << LL_ENDL;
return child_view;
}
switch (child_view_index)
{
case ALIC_ICON: child_view = mAvatarIcon; break;
case ALIC_NAME: child_view = mAvatarName; break;
case ALIC_INTERACTION_TIME: child_view = mLastInteractionTime; break;
case ALIC_SPEAKER_INDICATOR: child_view = mSpeakingIndicator; break;
case ALIC_INFO_BUTTON: child_view = mInfoBtn; break;
case ALIC_PROFILE_BUTTON: child_view = mProfileBtn; break;
default:
LL_WARNS("AvatarItemReshape") << "Unexpected child view index is passed: " << child_view_index << LL_ENDL;
}
return child_view;
}
// EOF

View File

@ -74,6 +74,11 @@ public:
virtual ~LLAvatarListItem();
virtual BOOL postBuild();
/**
* Processes notification from speaker indicator to update children when indicator's visibility is changed.
*/
virtual S32 notifyParent(const LLSD& info);
virtual void onMouseLeave(S32 x, S32 y, MASK mask);
virtual void onMouseEnter(S32 x, S32 y, MASK mask);
virtual void setValue(const LLSD& value);
@ -88,7 +93,8 @@ public:
//Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly
void setShowProfileBtn(bool show);
void setShowInfoBtn(bool show);
void setSpeakingIndicatorVisible(bool visible);
void showSpeakingIndicator(bool show);
void showLastInteractionTime(bool show);
void setAvatarIconVisible(bool visible);
const LLUUID& getAvatarId() const;
@ -97,17 +103,6 @@ public:
void onInfoBtnClick();
void onProfileBtnClick();
void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); }
void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); }
void showLastInteractionTime(bool show);
/**
* This method was added to fix EXT-2364 (Items in group/ad-hoc IM participant list (avatar names) should be reshaped when adding/removing the "(Moderator)" label)
* But this is a *HACK. The real reason of it was in incorrect logic while hiding profile/info/speaker buttons
* *TODO: new reshape method should be provided in lieu of this one to be called when visibility if those buttons is changed
*/
void reshapeAvatarName();
protected:
/**
* Contains indicator to show voice activity.
@ -124,6 +119,23 @@ private:
E_UNKNOWN,
} EOnlineStatus;
/**
* Enumeration of item elements in order from right to left.
*
* updateChildren() assumes that indexes are in the such order to process avatar icon easier.
*
* @see updateChildren()
*/
typedef enum e_avatar_item_child {
ALIC_PROFILE_BUTTON,
ALIC_INFO_BUTTON,
ALIC_SPEAKER_INDICATOR,
ALIC_INTERACTION_TIME,
ALIC_NAME,
ALIC_ICON,
ALIC_COUNT,
} EAvatarListItemChildIndex;
void setNameInternal(const std::string& name, const std::string& highlight);
void onNameCache(const std::string& first_name, const std::string& last_name);
@ -135,6 +147,26 @@ private:
typedef std::map<EItemState, LLColor4> icon_color_map_t;
static icon_color_map_t& getItemIconColorMap();
/**
* Initializes widths of all children to use them while changing visibility of any of them.
*
* @see updateChildren()
*/
static void initChildrenWidths(LLAvatarListItem* self);
/**
* Updates position and rectangle of visible children to fit all available item's width.
*/
void updateChildren();
/**
* Gets child view specified by index.
*
* This method implemented via switch by all EAvatarListItemChildIndex values.
* It is used to not store children in array or vector to avoid of increasing memory usage.
*/
LLView* getItemChildView(EAvatarListItemChildIndex child_index);
LLTextBox* mAvatarName;
LLTextBox* mLastInteractionTime;
LLStyle::Params mAvatarNameStyle;
@ -151,10 +183,17 @@ private:
bool mShowProfileBtn;
static bool sStaticInitialized; // this variable is introduced to improve code readability
static S32 sIconWidth; // icon width + padding
static S32 sInfoBtnWidth; //info btn width + padding
static S32 sProfileBtnWidth; //profile btn width + padding
static S32 sSpeakingIndicatorWidth; //speaking indicator width + padding
static S32 sLeftPadding; // padding to first left visible child (icon or name)
static S32 sRightNamePadding; // right padding from name to next visible child
/**
* Contains widths of each child specified by EAvatarListItemChildIndex
* including padding to the next right one.
*
* @see initChildrenWidths()
*/
static S32 sChildrenWidths[ALIC_COUNT];
};
#endif //LL_LLAVATARLISTITEM_H

View File

@ -161,6 +161,9 @@ void LLBottomTray::sessionAdded(const LLUUID& session_id, const std::string& nam
{
chiclet->setIMSessionName(name);
chiclet->setOtherParticipantId(other_participant_id);
LLIMFloater::onIMChicletCreated(session_id);
}
else
{
@ -251,14 +254,24 @@ void LLBottomTray::setVisible(BOOL visible)
{
LLView* viewp = *child_it;
std::string name = viewp->getName();
if ("chat_bar" == name || "movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name || "gesture_panel" == name)
// Chat bar and gesture button are shown even in mouselook mode. But the move, camera and snapshot buttons shouldn't be displayed. See EXT-3988.
if ("chat_bar" == name || "gesture_panel" == name || (visibility && ("movement_panel" == name || "cam_panel" == name || "snapshot_panel" == name)))
continue;
else
{
viewp->setVisible(visibility);
}
}
// Apply the saved settings when we are not in mouselook mode, see EXT-3988.
if (visibility)
{
showCameraButton(gSavedSettings.getBOOL("ShowCameraButton"));
showSnapshotButton(gSavedSettings.getBOOL("ShowSnapshotButton"));
showMoveButton(gSavedSettings.getBOOL("ShowMoveButton"));
showGestureButton(gSavedSettings.getBOOL("ShowGestureButton"));
}
}
}

View File

@ -481,9 +481,10 @@ void LLCallFloater::updateAgentModeratorState()
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids)
{
// Get a list of participants from VoiceClient
std::vector<LLUUID> participants = LLVoiceClient::getInstance()->getParticipantList();
std::set<LLUUID> participants;
LLVoiceClient::getInstance()->getParticipantList(participants);
for (std::vector<LLUUID>::const_iterator iter = participants.begin();
for (std::set<LLUUID>::const_iterator iter = participants.begin();
iter != participants.end(); ++iter)
{
speakers_uuids.push_back(*iter);

View File

@ -500,11 +500,23 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
style_params.font.size(font_size);
style_params.font.style(input_append_params.font.style);
//whether to show colon after a name in header copy/past and in plain text mode
bool show_colon = chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER;
//IRC styled /me messages.
bool irc_me = false;
std::string prefix = chat.mText.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
{
irc_me = true;
}
if (use_plain_text_chat_history)
{
mEditor->appendText("[" + chat.mTimeStr + "] ", mEditor->getText().size() != 0, style_params);
if (utf8str_trim(chat.mFromName).size() != 0)
if (utf8str_trim(chat.mFromName).size() != 0 && !irc_me)
{
// Don't hotlink any messages from the system (e.g. "Second Life:"), so just add those in plain text.
if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() )
@ -512,11 +524,11 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
LLStyle::Params link_params(style_params);
link_params.fillFrom(LLStyleMap::instance().lookupAgent(chat.mFromID));
// Convert the name to a hotlink and add to message.
mEditor->appendText(chat.mFromName + ": ", false, link_params);
mEditor->appendText(chat.mFromName + (show_colon ? ": " : " "), false, link_params);
}
else
{
mEditor->appendText(chat.mFromName + ": ", false, style_params);
mEditor->appendText(chat.mFromName + (show_colon ? ": " : " "), false, style_params);
}
}
}
@ -562,21 +574,20 @@ void LLChatHistory::appendMessage(const LLChat& chat, const bool use_plain_text_
std::string header_text = "[" + chat.mTimeStr + "] ";
if (utf8str_trim(chat.mFromName).size() != 0 && chat.mFromName != SYSTEM_FROM)
header_text += chat.mFromName + ": ";
header_text += chat.mFromName + (show_colon ? ": " : " ");
mEditor->appendWidget(p, header_text, false);
mLastFromName = chat.mFromName;
mLastFromID = chat.mFromID;
mLastMessageTime = new_message_time;
}
//Handle IRC styled /me messages.
std::string prefix = chat.mText.substr(0, 4);
if (prefix == "/me " || prefix == "/me'")
if (irc_me)
{
style_params.font.style = "ITALIC";
if (chat.mFromName.size() > 0)
mEditor->appendText(chat.mFromName, TRUE, style_params);
mEditor->appendText(chat.mFromName, FALSE, style_params);
// Ensure that message ends with NewLine, to avoid losing of new lines
// while copy/paste from text chat. See EXT-3263.
mEditor->appendText(chat.mText.substr(3) + NEW_LINE, FALSE, style_params);

View File

@ -1149,14 +1149,14 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
if (!LLPipeline::sRenderDeferred)
{
bump->setExplicitFormat(GL_ALPHA8, GL_ALPHA);
bump->createGLTexture(bump->getDiscardLevel(), dst_image);
bump->createGLTexture(0, dst_image);
}
else
{
LLPointer<LLImageRaw> nrm_image = new LLImageRaw(src->getWidth(), src->getHeight(), 4);
generateNormalMapFromAlpha(src, nrm_image);
bump->setExplicitFormat(GL_RGBA, GL_RGBA);
bump->createGLTexture(bump->getDiscardLevel(), nrm_image);
bump->createGLTexture(0, nrm_image);
}

View File

@ -159,15 +159,10 @@ void LLDrawPoolWLSky::renderStars(void) const
// *NOTE: have to have bound the cloud noise texture already since register
// combiners blending below requires something to be bound
// and we might as well only bind once.
//gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);
gPipeline.disableLights();
if (!LLPipeline::sReflectionRender)
{
glPointSize(2.f);
}
// *NOTE: we divide by two here and GL_ALPHA_SCALE by two below to avoid
// clamping and allow the star_alpha param to brighten the stars.
bool error;
@ -175,16 +170,20 @@ void LLDrawPoolWLSky::renderStars(void) const
star_alpha.mV[3] = LLWLParamManager::instance()->mCurParams.getFloat("star_brightness", error) / 2.f;
llassert_always(!error);
gGL.getTexUnit(0)->bind(gSky.mVOSkyp->getBloomTex());
gGL.pushMatrix();
glRotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f);
// gl_FragColor.rgb = gl_Color.rgb;
// gl_FragColor.a = gl_Color.a * star_alpha.a;
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR);
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_PREV_ALPHA, LLTexUnit::TBS_CONST_ALPHA);
gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR);
gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_CONST_ALPHA, LLTexUnit::TBS_TEX_ALPHA);
glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, star_alpha.mV);
gSky.mVOWLSkyp->drawStars();
glPointSize(1.f);
gGL.popMatrix();
// and disable the combiner states
gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT);
}

View File

@ -43,7 +43,7 @@ public:
static const U32 SKY_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_TEXCOORD0;
static const U32 STAR_VERTEX_DATA_MASK = LLVertexBuffer::MAP_VERTEX |
LLVertexBuffer::MAP_COLOR;
LLVertexBuffer::MAP_COLOR | LLVertexBuffer::MAP_TEXCOORD0;
LLDrawPoolWLSky(void);
/*virtual*/ ~LLDrawPoolWLSky();

View File

@ -314,7 +314,7 @@ void LLFastTimerView::draw()
S32 left, top, right, bottom;
S32 x, y, barw, barh, dx, dy;
S32 texth, textw;
LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("rounded_square.tga");
LLPointer<LLUIImage> box_imagep = LLUI::getUIImage("Rounded_Square");
// Draw the window background
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);

View File

@ -190,7 +190,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
{
if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat")))
{
LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT)
{
LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
}
else
{
LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText);
}
}
LLColor4 color = get_text_color(chat);
@ -311,8 +318,10 @@ void LLFloaterChat::addChat(const LLChat& chat, BOOL from_instant_message, BOOL
triggerAlerts(chat.mText);
// Add the sender to the list of people with which we've recently interacted.
if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull())
LLRecentPeople::instance().add(chat.mFromID);
// this is not the best place to add _all_ messages to recent list
// comment this for now, may remove later on code cleanup
//if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull())
// LLRecentPeople::instance().add(chat.mFromID);
bool add_chat = true;
bool log_chat = true;

View File

@ -247,14 +247,7 @@ void LLPanelGroups::enableButtons()
childDisable("IM");
childDisable("Leave");
}
if(gAgent.mGroups.count() < MAX_AGENT_GROUPS)
{
childEnable("Create");
}
else
{
childDisable("Create");
}
childSetEnabled("Create", gAgent.canJoinGroups());
}

View File

@ -1269,18 +1269,15 @@ void LLFloaterTools::getMediaState()
// called when a user wants to add media to a prim or prim face
void LLFloaterTools::onClickBtnAddMedia()
{
// check for the edit tool and now many faces are selected
LLTool *tool = LLToolMgr::getInstance()->getCurrentTool();
if((tool != LLToolFace::getInstance()) || LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected())
// check if multiple faces are selected
if(LLSelectMgr::getInstance()->getSelection()->isMultipleTESelected())
{
LLNotificationsUtil::add("MultipleFacesSelected",LLSD(), LLSD(), multipleFacesSelectedConfirm);
LLNotificationsUtil::add("MultipleFacesSelected", LLSD(), LLSD(), multipleFacesSelectedConfirm);
}
else
{
onClickBtnEditMedia();
}
}
// static

View File

@ -206,7 +206,9 @@ LLFolderView::LLFolderView(const Params& p)
mAutoOpenCandidate = NULL;
mAutoOpenTimer.stop();
mKeyboardSelection = FALSE;
static LLUICachedControl<S32> indentation("FolderIndentation", 0);
const LLFolderViewItem::Params& item_params =
LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
S32 indentation = item_params.folder_indentation();
mIndentation = -indentation; // children start at indentation 0
gIdleCallbacks.addFunction(idle, this);
@ -395,7 +397,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen
getRoot()->getFilter()->getShowFolderState();
S32 total_width = LEFT_PAD;
S32 running_height = mDebugFilters ? llceil(sSmallFont->getLineHeight()) : 0;
S32 running_height = mDebugFilters ? llceil(LLFontGL::getFontMonospace()->getLineHeight()) : 0;
S32 target_height = running_height;
S32 parent_item_height = getRect().getHeight();
@ -867,8 +869,8 @@ void LLFolderView::draw()
{
std::string current_filter_string = llformat("Current Filter: %d, Least Filter: %d, Auto-accept Filter: %d",
mFilter->getCurrentGeneration(), mFilter->getMinRequiredGeneration(), mFilter->getMustPassGeneration());
sSmallFont->renderUTF8(current_filter_string, 0, 2,
getRect().getHeight() - sSmallFont->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f),
LLFontGL::getFontMonospace()->renderUTF8(current_filter_string, 0, 2,
getRect().getHeight() - LLFontGL::getFontMonospace()->getLineHeight(), LLColor4(0.5f, 0.5f, 0.8f, 1.f),
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW, S32_MAX, S32_MAX, NULL, FALSE );
}

View File

@ -51,11 +51,10 @@
/// Class LLFolderViewItem
///----------------------------------------------------------------------------
static LLDefaultChildRegistry::Register<LLFolderViewItem> r("folder_view_item");
// statics
std::map<U8, LLFontGL*> LLFolderViewItem::sFonts; // map of styles to fonts
const LLFontGL* LLFolderViewItem::sSmallFont = NULL;
LLUIImagePtr LLFolderViewItem::sArrowImage;
LLUIImagePtr LLFolderViewItem::sBoxImage;
// only integers can be initialized in header
const F32 LLFolderViewItem::FOLDER_CLOSE_TIME_CONSTANT = 0.02f;
@ -84,33 +83,34 @@ LLFontGL* LLFolderViewItem::getLabelFontForStyle(U8 style)
//static
void LLFolderViewItem::initClass()
{
sSmallFont = LLFontGL::getFontMonospace();
sArrowImage = LLUI::getUIImage("folder_arrow.tga");
sBoxImage = LLUI::getUIImage("rounded_square.tga");
}
//static
void LLFolderViewItem::cleanupClass()
{
sFonts.clear();
sArrowImage = NULL;
sBoxImage = NULL;
}
// NOTE: Optimize this, we call it a *lot* when opening a large inventory
LLFolderViewItem::Params::Params()
: icon("icon"),
folder_arrow_image("folder_arrow_image", LLUI::getUIImage("folder_arrow.tga")),
selection_image("selection_image", LLUI::getUIImage("rounded_square.tga"))
: icon(),
icon_open(),
root(),
listener(),
folder_arrow_image("folder_arrow_image"),
folder_indentation("folder_indentation"),
selection_image("selection_image"),
item_height("item_height"),
item_top_pad("item_top_pad"),
creation_date()
{
mouse_opaque(true);
follows.flags(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_RIGHT);
// JAMESDEBUG tab_stop(false);
}
// Default constructor
LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p)
LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p)
: LLView(p),
mLabelWidth(0),
mLabelWidthDirty(false),
@ -121,6 +121,7 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p)
mLabelStyle( LLFontGL::NORMAL ),
mHasVisibleChildren(FALSE),
mIndentation(0),
mItemHeight(p.item_height),
mNumDescendantsSelected(0),
mPassedFilter(FALSE),
mLastFilterGeneration(-1),
@ -134,8 +135,6 @@ LLFolderViewItem::LLFolderViewItem(LLFolderViewItem::Params p)
mIcon(p.icon),
mIconOpen(p.icon_open),
mListener(p.listener),
mArrowImage(p.folder_arrow_image),
mBoxImage(p.selection_image),
mHidden(false),
mShowLoadStatus(false)
{
@ -392,10 +391,11 @@ BOOL LLFolderViewItem::addToFolder(LLFolderViewFolder* folder, LLFolderView* roo
// makes sure that this view and it's children are the right size.
S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation)
{
static LLUICachedControl<S32> indentation("FolderIndentation", 0);
const Params& p = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
S32 indentation = p.folder_indentation();
// Only indent deeper items in hierarchy
mIndentation = (getParentFolder()
&& getParentFolder()->getParentFolder()
&& getParentFolder()->getParentFolder()->getParentFolder())
&& getParentFolder()->getParentFolder() )
? mParentFolder->getIndentation() + indentation
: 0;
if (mLabelWidthDirty)
@ -421,9 +421,10 @@ S32 LLFolderViewItem::getItemHeight()
{
if (mHidden) return 0;
S32 icon_height = mIcon->getHeight();
S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight());
return llmax( icon_height, label_height ) + ICON_PAD;
//S32 icon_height = mIcon->getHeight();
//S32 label_height = llround(getLabelFontForStyle(mLabelStyle)->getLineHeight());
//return llmax( icon_height, label_height ) + ICON_PAD;
return mItemHeight;
}
void LLFolderViewItem::filter( LLInventoryFilter& filter)
@ -829,11 +830,16 @@ void LLFolderViewItem::draw()
static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE);
static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE);
static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE);
static LLUIColor sFocusOutlineColor =
LLUIColorTable::instance().getColor("InventoryFocusOutlineColor", DEFAULT_WHITE);
static LLUIColor sFilterBGColor = LLUIColorTable::instance().getColor("FilterBackgroundColor", DEFAULT_WHITE);
static LLUIColor sFilterTextColor = LLUIColorTable::instance().getColor("FilterTextColor", DEFAULT_WHITE);
static LLUIColor sSuffixColor = LLUIColorTable::instance().getColor("InventoryItemSuffixColor", DEFAULT_WHITE);
static LLUIColor sSearchStatusColor = LLUIColorTable::instance().getColor("InventorySearchStatusColor", DEFAULT_WHITE);
const Params& default_params = LLUICtrlFactory::getDefaultParams<LLFolderViewItem>();
const S32 TOP_PAD = default_params.item_top_pad;
bool possibly_has_children = false;
bool up_to_date = mListener && mListener->isUpToDate();
if((up_to_date && hasVisibleChildren() ) || // we fetched our children and some of them have passed the filter...
@ -843,11 +849,10 @@ void LLFolderViewItem::draw()
}
if(/*mControlLabel[0] != '\0' && */possibly_has_children)
{
if (sArrowImage)
{
gl_draw_scaled_rotated_image(mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD,
ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, sArrowImage->getImage(), sFgColor);
}
LLUIImage* arrow_image = default_params.folder_arrow_image;
gl_draw_scaled_rotated_image(
mIndentation, getRect().getHeight() - ARROW_SIZE - TEXT_PAD - TOP_PAD,
ARROW_SIZE, ARROW_SIZE, mControlLabelRotation, arrow_image->getImage(), sFgColor);
}
F32 text_left = (F32)(ARROW_SIZE + TEXT_PAD + ICON_WIDTH + ICON_PAD + mIndentation);
@ -857,6 +862,10 @@ void LLFolderViewItem::draw()
// If we have keyboard focus, draw selection filled
BOOL show_context = getRoot()->getShowSelectionContext();
BOOL filled = show_context || (getRoot()->getParentPanel()->hasFocus());
const S32 FOCUS_LEFT = 1;
S32 focus_top = getRect().getHeight();
S32 focus_bottom = getRect().getHeight() - mItemHeight;
bool folder_open = (getRect().getHeight() > mItemHeight + 4);
// always render "current" item, only render other selected items if
// mShowSingleSelection is FALSE
@ -864,7 +873,6 @@ void LLFolderViewItem::draw()
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
LLColor4 bg_color = sHighlightBgColor;
//const S32 TRAILING_PAD = 5; // It just looks better with this.
if (!mIsCurSelection)
{
// do time-based fade of extra objects
@ -882,35 +890,35 @@ void LLFolderViewItem::draw()
}
gl_rect_2d(
0,
getRect().getHeight(),
FOCUS_LEFT,
focus_top,
getRect().getWidth() - 2,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD),
focus_bottom,
bg_color, filled);
if (mIsCurSelection)
{
gl_rect_2d(
0,
getRect().getHeight(),
FOCUS_LEFT,
focus_top,
getRect().getWidth() - 2,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD),
sHighlightFgColor, FALSE);
focus_bottom,
sFocusOutlineColor, FALSE);
}
if (getRect().getHeight() > llround(font->getLineHeight()) + ICON_PAD + 4)
if (folder_open)
{
gl_rect_2d(
0,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4,
FOCUS_LEFT,
focus_bottom + 1, // overlap with bottom edge of above rect
getRect().getWidth() - 2,
2,
sHighlightFgColor, FALSE);
0,
sFocusOutlineColor, FALSE);
if (show_context)
{
gl_rect_2d(
0,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 4,
FOCUS_LEFT,
focus_bottom + 1,
getRect().getWidth() - 2,
2,
0,
sHighlightBgColor, TRUE);
}
}
@ -919,32 +927,32 @@ void LLFolderViewItem::draw()
{
gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
gl_rect_2d(
0,
getRect().getHeight(),
FOCUS_LEFT,
focus_top,
getRect().getWidth() - 2,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD),
focus_bottom,
sHighlightBgColor, FALSE);
if (getRect().getHeight() > llround(font->getLineHeight()) + ICON_PAD + 2)
if (folder_open)
{
gl_rect_2d(
0,
llfloor(getRect().getHeight() - font->getLineHeight() - ICON_PAD) - 2,
FOCUS_LEFT,
focus_bottom + 1, // overlap with bottom edge of above rect
getRect().getWidth() - 2,
2,
0,
sHighlightBgColor, FALSE);
}
mDragAndDropTarget = FALSE;
}
S32 icon_x = mIndentation + ARROW_SIZE + TEXT_PAD;
// First case is used for open folders
if (!mIconOpen.isNull() && (llabs(mControlLabelRotation) > 80))
{
mIconOpen->draw(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight());
mIconOpen->draw(icon_x, getRect().getHeight() - mIconOpen->getHeight() - TOP_PAD + 1);
}
else if(mIcon)
{
mIcon->draw(mIndentation + ARROW_SIZE + TEXT_PAD, getRect().getHeight() - mIcon->getHeight());
mIcon->draw(icon_x, getRect().getHeight() - mIcon->getHeight() - TOP_PAD + 1);
}
if (!mLabel.empty())
@ -953,7 +961,7 @@ void LLFolderViewItem::draw()
BOOL debug_filters = getRoot()->getDebugFilters();
LLColor4 color = ( (mIsSelected && filled) ? sHighlightFgColor : sFgColor );
F32 right_x;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
if (debug_filters)
{
@ -963,7 +971,8 @@ void LLFolderViewItem::draw()
}
LLColor4 filter_color = mLastFilterGeneration >= getRoot()->getFilter()->getCurrentGeneration() ? LLColor4(0.5f, 0.8f, 0.5f, 1.f) : LLColor4(0.8f, 0.5f, 0.5f, 1.f);
sSmallFont->renderUTF8(mStatusText, 0, text_left, y, filter_color,
LLFontGL::getFontMonospace()->renderUTF8(
mStatusText, 0, text_left, y, filter_color,
LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
S32_MAX, S32_MAX, &right_x, FALSE );
text_left = right_x;
@ -1004,7 +1013,7 @@ void LLFolderViewItem::draw()
S32_MAX, S32_MAX, &right_x, FALSE );
}
if (sBoxImage.notNull() && mStringMatchOffset != std::string::npos)
if (mStringMatchOffset != std::string::npos)
{
// don't draw backgrounds for zero-length strings
S32 filter_string_length = getRoot()->getFilterSubString().size();
@ -1013,14 +1022,15 @@ void LLFolderViewItem::draw()
std::string combined_string = mLabel + mLabelSuffix;
S32 left = llround(text_left) + font->getWidth(combined_string, 0, mStringMatchOffset) - 1;
S32 right = left + font->getWidth(combined_string, mStringMatchOffset, filter_string_length) + 2;
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3);
S32 top = getRect().getHeight();
S32 bottom = llfloor(getRect().getHeight() - font->getLineHeight() - 3 - TOP_PAD);
S32 top = getRect().getHeight() - TOP_PAD;
LLUIImage* box_image = default_params.selection_image;
LLRect box_rect(left, top, right, bottom);
sBoxImage->draw(box_rect, sFilterBGColor);
box_image->draw(box_rect, sFilterBGColor);
F32 match_string_left = text_left + font->getWidthF32(combined_string, 0, mStringMatchOffset);
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD;
font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, y,
F32 yy = (F32)getRect().getHeight() - font->getLineHeight() - (F32)TEXT_PAD - (F32)TOP_PAD;
font->renderUTF8( combined_string, mStringMatchOffset, match_string_left, yy,
sFilterTextColor, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::NORMAL, LLFontGL::NO_SHADOW,
filter_string_length, S32_MAX, &right_x, FALSE );
}

View File

@ -101,7 +101,10 @@ public:
Optional<LLFolderViewEventListener*> listener;
Optional<LLUIImage*> folder_arrow_image;
Optional<S32> folder_indentation; // pixels
Optional<LLUIImage*> selection_image;
Optional<S32> item_height; // pixels
Optional<S32> item_top_pad; // pixels
Optional<S32> creation_date; //UTC seconds
@ -110,7 +113,7 @@ public:
// layout constants
static const S32 LEFT_PAD = 5;
// LEFT_INDENTATION is set via settings.xml FolderIndentation
// LEFT_INDENTATION is set via folder_indentation above
static const S32 ICON_PAD = 2;
static const S32 ICON_WIDTH = 16;
static const S32 TEXT_PAD = 1;
@ -127,11 +130,7 @@ protected:
friend class LLUICtrlFactory;
friend class LLFolderViewEventListener;
LLFolderViewItem(Params p = LLFolderViewItem::Params());
static const LLFontGL* sSmallFont;
static LLUIImagePtr sArrowImage;
static LLUIImagePtr sBoxImage;
LLFolderViewItem(const Params& p);
std::string mLabel;
std::string mSearchableLabel;
@ -150,6 +149,7 @@ protected:
LLUIImagePtr mIconOpen;
BOOL mHasVisibleChildren;
S32 mIndentation;
S32 mItemHeight;
S32 mNumDescendantsSelected;
BOOL mPassedFilter;
S32 mLastFilterGeneration;
@ -157,8 +157,6 @@ protected:
F32 mControlLabelRotation;
LLFolderView* mRoot;
BOOL mDragAndDropTarget;
LLUIImagePtr mArrowImage;
LLUIImagePtr mBoxImage;
BOOL mIsLoading;
LLTimer mTimeSinceRequestStart;
bool mHidden;

View File

@ -146,6 +146,12 @@ void LLGroupActions::startCall(const LLUUID& group_id)
// static
void LLGroupActions::join(const LLUUID& group_id)
{
if (!gAgent.canJoinGroups())
{
LLNotificationsUtil::add("JoinedTooManyGroups");
return;
}
LLGroupMgrGroupData* gdatap =
LLGroupMgr::getInstance()->getGroupData(group_id);
@ -226,7 +232,9 @@ void LLGroupActions::activate(const LLUUID& group_id)
static bool isGroupUIVisible()
{
LLPanel* panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray");
static LLPanel* panel = 0;
if(!panel)
panel = LLSideTray::getInstance()->findChild<LLPanel>("panel_group_info_sidetray");
if(!panel)
return false;
return panel->isInVisibleChain();

View File

@ -287,7 +287,7 @@ void LLHUDText::renderText(BOOL for_select)
mOffsetY = lltrunc(mHeight * ((mVertAlignment == ALIGN_VERT_CENTER) ? 0.5f : 1.f));
// *TODO: cache this image
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
// *TODO: make this a per-text setting
LLColor4 bg_color = LLUIColorTable::instance().getColor("BackgroundChatColor");

View File

@ -361,35 +361,7 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
{
if (!gIMMgr->hasSession(session_id)) return NULL;
// we should make sure all related chiclets are in place when the session is a voice call
// chiclets come firts, then comes IM window
if (gIMMgr->isVoiceCall(session_id))
{
LLIMModel* im_model = LLIMModel::getInstance();
LLBottomTray* b_tray = LLBottomTray::getInstance();
//*TODO hide that into Bottom tray
if (!b_tray->getChicletPanel()->findChiclet<LLChiclet>(session_id))
{
LLIMChiclet* chiclet = b_tray->createIMChiclet(session_id);
if(chiclet)
{
chiclet->setIMSessionName(im_model->getName(session_id));
chiclet->setOtherParticipantId(im_model->getOtherParticipantID(session_id));
}
}
LLIMWellWindow::getInstance()->addIMRow(session_id);
}
bool not_existed = true;
if(isChatMultiTab())
{
LLIMFloater* target_floater = findInstance(session_id);
not_existed = NULL == target_floater;
}
else
if(!isChatMultiTab())
{
//hide all
LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("impanel");
@ -404,19 +376,33 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
}
}
LLIMFloater* floater = LLFloaterReg::showTypedInstance<LLIMFloater>("impanel", session_id);
bool exist = findInstance(session_id);
LLIMFloater* floater = getInstance(session_id);
if (!floater) return NULL;
if(isChatMultiTab())
{
LLIMFloaterContainer* floater_container = LLIMFloaterContainer::getInstance();
// do not add existed floaters to avoid adding torn off instances
if (not_existed)
if (!exist)
{
// LLTabContainer::eInsertionPoint i_pt = user_initiated ? LLTabContainer::RIGHT_OF_CURRENT : LLTabContainer::END;
// TODO: mantipov: use LLTabContainer::RIGHT_OF_CURRENT if it exists
LLTabContainer::eInsertionPoint i_pt = LLTabContainer::END;
if (floater_container)
{
floater_container->addFloater(floater, TRUE, i_pt);
}
}
LLIMFloaterContainer* floater_container = LLFloaterReg::showTypedInstance<LLIMFloaterContainer>("im_container");
floater_container->addFloater(floater, TRUE, i_pt);
if (floater_container)
{
//selecting the panel resets a chiclet's counter
floater_container->selectFloater(floater);
floater_container->setVisible(TRUE);
}
}
else
@ -443,8 +429,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id)
}
// window is positioned, now we can show it.
floater->setVisible(true);
}
floater->setVisible(TRUE);
return floater;
}
@ -484,16 +470,6 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
}
}
void LLIMFloater::setTornOff(bool torn_off)
{
// When IM Floater isn't torn off, "close" button should be hidden.
// This call will just disables it, since there is a hack in LLFloater::updateButton,
// which prevents hiding of close button in that case.
setCanClose(torn_off);
LLTransientDockableFloater::setTornOff(torn_off);
}
void LLIMFloater::setVisible(BOOL visible)
{
LLNotificationsUI::LLScreenChannel* channel = dynamic_cast<LLNotificationsUI::LLScreenChannel*>
@ -548,6 +524,11 @@ LLIMFloater* LLIMFloater::findInstance(const LLUUID& session_id)
return LLFloaterReg::findTypedInstance<LLIMFloater>("impanel", session_id);
}
LLIMFloater* LLIMFloater::getInstance(const LLUUID& session_id)
{
return LLFloaterReg::getTypedInstance<LLIMFloater>("impanel", session_id);
}
void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id)
{
mSessionInitialized = true;
@ -1026,3 +1007,20 @@ void LLIMFloater::sRemoveTypingIndicator(const LLSD& data)
floater->removeTypingIndicator();
}
void LLIMFloater::onIMChicletCreated( const LLUUID& session_id )
{
if (isChatMultiTab())
{
LLIMFloaterContainer* im_box = LLIMFloaterContainer::getInstance();
if (!im_box) return;
if (LLIMFloater::findInstance(session_id)) return;
LLIMFloater* new_tab = LLIMFloater::getInstance(session_id);
im_box->addFloater(new_tab, FALSE, LLTabContainer::END);
}
}

View File

@ -64,7 +64,6 @@ public:
// LLFloater overrides
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void setDocked(bool docked, bool pop_on_undock = true);
/*virtual*/ void setTornOff(bool torn_off);
// Make IM conversion visible and update the message history
static LLIMFloater* show(const LLUUID& session_id);
@ -75,6 +74,8 @@ public:
static LLIMFloater* findInstance(const LLUUID& session_id);
static LLIMFloater* getInstance(const LLUUID& session_id);
void sessionInitReplyReceived(const LLUUID& im_session_id);
// get new messages from LLIMModel
@ -113,6 +114,8 @@ public:
//used as a callback on receiving new IM message
static void sRemoveTypingIndicator(const LLSD& data);
static void onIMChicletCreated(const LLUUID& session_id);
private:
// process focus events to set a currently active session
/* virtual */ void onFocusLost();

View File

@ -34,6 +34,7 @@
#include "llviewerprecompiledheaders.h"
#include "llimfloatercontainer.h"
#include "llfloaterreg.h"
//
// LLIMFloaterContainer
@ -93,4 +94,14 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
}
}
LLIMFloaterContainer* LLIMFloaterContainer::findInstance()
{
return LLFloaterReg::findTypedInstance<LLIMFloaterContainer>("im_container");
}
LLIMFloaterContainer* LLIMFloaterContainer::getInstance()
{
return LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container");
}
// EOF

View File

@ -52,7 +52,11 @@ public:
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
static LLFloater* getCurrentVoiceFloater();
static LLIMFloaterContainer* findInstance();
static LLIMFloaterContainer* getInstance();
protected:
LLFloater* mActiveVoiceFloater;

View File

@ -382,10 +382,6 @@ void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& f
mSpeakers->speakerChatted(from_id);
mSpeakers->setSpeakerTyping(from_id, FALSE);
}
if( mSessionType == P2P_SESSION ||
mSessionType == ADHOC_SESSION)
LLRecentPeople::instance().add(from_id);
}
void LLIMModel::LLIMSession::addMessagesFromHistory(const std::list<LLSD>& history)
@ -684,6 +680,12 @@ bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, co
LLIMSession* session = addMessageSilently(session_id, from, from_id, utf8_text, log2file);
if (!session) return false;
//good place to add some1 to recent list
//other places may be called from message history.
if( !from_id.isNull() &&
( session->isP2PSessionType() || session->isAdHocSessionType() ) )
LLRecentPeople::instance().add(from_id);
// notify listeners
LLSD arg;
arg["session_id"] = session_id;
@ -1377,7 +1379,7 @@ void LLCallDialogManager::onVoiceChannelChanged(const LLUUID &session_id)
}
sSession = session;
sSession->mVoiceChannel->setStateChangedCallback(LLCallDialogManager::onVoiceChannelStateChanged);
sSession->mVoiceChannel->setStateChangedCallback(boost::bind(LLCallDialogManager::onVoiceChannelStateChanged, _1, _2, _3));
if(sCurrentSessionlName != session->mName)
{
sPreviousSessionlName = sCurrentSessionlName;
@ -1601,7 +1603,12 @@ void LLOutgoingCallDialog::show(const LLSD& key)
if (!mPayload["disconnected_channel_name"].asString().empty())
{
childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString());
std::string channel_name = mPayload["disconnected_channel_name"].asString();
if (LLIMModel::LLIMSession::AVALINE_SESSION == mPayload["session_type"].asInteger())
{
channel_name = LLTextUtil::formatPhoneNumber(channel_name);
}
childSetTextArg("nearby", "[VOICE_CHANNEL_NAME]", channel_name);
childSetTextArg("nearby_P2P", "[VOICE_CHANNEL_NAME]", mPayload["disconnected_channel_name"].asString());
}

View File

@ -78,6 +78,11 @@ public:
bool isP2P();
bool isOtherParticipantAvaline();
bool isP2PSessionType() const { return mSessionType == P2P_SESSION;}
bool isAdHocSessionType() const { return mSessionType == ADHOC_SESSION;}
bool isGroupSessionType() const { return mSessionType == GROUP_SESSION;}
bool isAvalineSessionType() const { return mSessionType == AVALINE_SESSION;}
LLUUID mSessionID;
std::string mName;
EInstantMessage mType;

View File

@ -403,7 +403,8 @@ void LLInspectAvatar::updateModeratorPanel()
{
bool enable_moderator_panel = false;
if (LLVoiceChannel::getCurrentVoiceChannel())
if (LLVoiceChannel::getCurrentVoiceChannel() &&
mAvatarID != gAgent.getID())
{
LLUUID session_id = LLVoiceChannel::getCurrentVoiceChannel()->getSessionID();
@ -417,6 +418,7 @@ void LLInspectAvatar::updateModeratorPanel()
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);
@ -514,46 +516,57 @@ void LLInspectAvatar::toggleSelectedVoice(bool enabled)
void LLInspectAvatar::updateVolumeSlider()
{
// By convention, we only display and toggle voice mutes, not all mutes
bool is_muted = LLMuteList::getInstance()->
isMuted(mAvatarID, LLMute::flagVoiceChat);
bool voice_enabled = LLVoiceClient::getInstance()->getVoiceEnabled(mAvatarID);
bool is_self = (mAvatarID == gAgent.getID());
LLUICtrl* mute_btn = getChild<LLUICtrl>("mute_btn");
mute_btn->setEnabled( voice_enabled );
mute_btn->setValue( is_muted );
mute_btn->setVisible( voice_enabled && !is_self );
LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
volume_slider->setEnabled( voice_enabled && !is_muted );
volume_slider->setVisible( voice_enabled && !is_self );
const F32 DEFAULT_VOLUME = 0.5f;
F32 volume;
if (is_muted)
// 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()))
{
// it's clearer to display their volume as zero
volume = 0.f;
getChild<LLUICtrl>("mute_btn")->setVisible(false);
getChild<LLUICtrl>("volume_slider")->setVisible(false);
}
else if (!voice_enabled)
{
// use nominal value rather than 0
volume = DEFAULT_VOLUME;
}
else
{
// actual volume
volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID);
// *HACK: Voice client doesn't have any data until user actually
// says something.
if (volume == 0.f)
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, " Linden");
mute_btn->setEnabled( !is_linden);
mute_btn->setValue( is_muted );
LLUICtrl* volume_slider = getChild<LLUICtrl>("volume_slider");
volume_slider->setEnabled( !is_muted );
const F32 DEFAULT_VOLUME = 0.5f;
F32 volume;
if (is_muted)
{
volume = DEFAULT_VOLUME;
// it's clearer to display their volume as zero
volume = 0.f;
}
else
{
// actual volume
volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID);
// *HACK: Voice client doesn't have any data until user actually
// says something.
if (volume == 0.f)
{
volume = DEFAULT_VOLUME;
}
}
volume_slider->setValue( (F64)volume );
}
volume_slider->setValue( (F64)volume );
}
void LLInspectAvatar::onClickMuteVolume()

View File

@ -0,0 +1,119 @@
/**
* @file lltoast.h
* @brief This class implements a placeholder for any notification panel.
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h" // must be first include
#include "llinspecttoast.h"
#include "llinspect.h"
#include "llfloaterreg.h"
#include "llscreenchannel.h"
#include "llchannelmanager.h"
using namespace LLNotificationsUI;
/**
* Represents inspectable toast .
*/
class LLInspectToast: public LLInspect
{
public:
LLInspectToast(const LLSD& notification_idl);
virtual ~LLInspectToast();
/*virtual*/ void onOpen(const LLSD& notification_id);
private:
void onToastDestroy(LLToast * toast);
private:
LLPanel* mPanel;
LLScreenChannel* mScreenChannel;
};
LLInspectToast::LLInspectToast(const LLSD& notification_id) :
LLInspect(LLSD()), mPanel(NULL)
{
LLScreenChannelBase* channel = LLChannelManager::getInstance()->findChannelByID(
LLUUID(gSavedSettings.getString("NotificationChannelUUID")));
mScreenChannel = dynamic_cast<LLScreenChannel*>(channel);
if(NULL == mScreenChannel)
{
llwarns << "Could not get requested screen channel." << llendl;
return;
}
}
LLInspectToast::~LLInspectToast()
{
}
void LLInspectToast::onOpen(const LLSD& notification_id)
{
LLInspect::onOpen(notification_id);
LLToast* toast = mScreenChannel->getToastByNotificationID(notification_id);
if (toast == NULL)
{
llwarns << "Could not get requested toast from screen channel." << llendl;
return;
}
toast->setOnToastDestroyedCallback(boost::bind(&LLInspectToast::onToastDestroy, this, _1));
LLPanel * panel = toast->getPanel();
panel->setVisible(TRUE);
panel->setMouseOpaque(FALSE);
if(mPanel != NULL && mPanel->getParent() == this)
{
removeChild(mPanel);
}
addChild(panel);
panel->setFocus(TRUE);
mPanel = panel;
LLRect panel_rect;
panel_rect = panel->getRect();
reshape(panel_rect.getWidth(), panel_rect.getHeight());
LLUI::positionViewNearMouse(this);
}
void LLInspectToast::onToastDestroy(LLToast * toast)
{
closeFloater(false);
}
void LLNotificationsUI::registerFloater()
{
LLFloaterReg::add("inspect_toast", "inspect_toast.xml",
&LLFloaterReg::build<LLInspectToast>);
}

View File

@ -0,0 +1,41 @@
/**
* @file lltoast.h
* @brief This class implements a placeholder for any notification panel.
*
* $LicenseInfo:firstyear=2003&license=viewergpl$
*
* Copyright (c) 2003-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLINSPECTTOAST_H
#define LL_LLINSPECTTOAST_H
namespace LLNotificationsUI
{
void registerFloater();
}
#endif

View File

@ -98,10 +98,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) :
mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2));
mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this));
setBackgroundColor(LLUIColorTable::instance().getColor("InventoryBackgroundColor"));
setBackgroundVisible(TRUE);
setBackgroundOpaque(TRUE);
if (mStartFolderString != "")
{
mBuildDefaultHierarchy = false;

View File

@ -436,7 +436,7 @@ void LLManip::renderXYZ(const LLVector3 &vec)
glPushMatrix();
{
LLUIImagePtr imagep = LLUI::getUIImage("rounded_square.tga");
LLUIImagePtr imagep = LLUI::getUIImage("Rounded_Square");
gViewerWindow->setup2DRender();
const LLVector2& display_scale = gViewerWindow->getDisplayScale();
glScalef(display_scale.mV[VX], display_scale.mV[VY], 1.f);

View File

@ -632,6 +632,7 @@ bool LLMediaCtrl::ensureMediaSourceExists()
mMediaSource->setHomeURL(mHomePageUrl);
mMediaSource->setVisible( getVisible() );
mMediaSource->addObserver( this );
mMediaSource->setBackgroundColor( getBackgroundColor() );
if(mClearCache)
{
mMediaSource->clearCache();
@ -671,34 +672,12 @@ LLPluginClassMedia* LLMediaCtrl::getMediaPlugin()
//
void LLMediaCtrl::draw()
{
LLPluginClassMedia* media_plugin = NULL;
if(mMediaSource && mMediaSource->hasMedia())
{
media_plugin = mMediaSource->getMediaPlugin();
}
else
{
return;
}
if(!media_plugin || (!media_plugin->textureValid()))
{
// Don't try to draw without a valid texture
return;
}
LLViewerMediaTexture* media_texture = LLViewerTextureManager::findMediaTexture(mMediaTextureID);
if (!media_texture )
return;
if ( gRestoreGL == 1 )
{
LLRect r = getRect();
reshape( r.getWidth(), r.getHeight(), FALSE );
return;
};
}
// NOTE: optimization needed here - probably only need to do this once
// unless tearoffs change the parent which they probably do.
@ -712,125 +691,161 @@ void LLMediaCtrl::draw()
setFrequentUpdates( false );
};
bool draw_media = false;
LLPluginClassMedia* media_plugin = NULL;
LLViewerMediaTexture* media_texture = NULL;
if(mMediaSource && mMediaSource->hasMedia())
{
media_plugin = mMediaSource->getMediaPlugin();
if(media_plugin && (media_plugin->textureValid()))
{
media_texture = LLViewerTextureManager::findMediaTexture(mMediaTextureID);
if(media_texture)
{
draw_media = true;
}
}
}
if(mHidingInitialLoad)
{
// If we're hiding loading, don't draw at all.
return;
draw_media = false;
}
// alpha off for this
LLGLSUIDefault gls_ui;
LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
gGL.pushMatrix();
bool background_visible = isBackgroundVisible();
bool background_opaque = isBackgroundOpaque();
if(draw_media)
{
if (mIgnoreUIScale)
{
glLoadIdentity();
// font system stores true screen origin, need to scale this by UI scale factor
// to get render origin for this view (with unit scale)
gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
LLFontGL::sCurOrigin.mZ);
}
// alpha off for this
LLGLSUIDefault gls_ui;
LLGLDisable gls_alphaTest( GL_ALPHA_TEST );
// scale texture to fit the space using texture coords
gGL.getTexUnit(0)->bind(media_texture);
gGL.color4fv( LLColor4::white.mV );
F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth();
F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight();
LLRect r = getRect();
S32 width, height;
S32 x_offset = 0;
S32 y_offset = 0;
if(mStretchToFill)
gGL.pushMatrix();
{
if(mMaintainAspectRatio)
if (mIgnoreUIScale)
{
F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight());
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
if(media_aspect > view_aspect)
glLoadIdentity();
// font system stores true screen origin, need to scale this by UI scale factor
// to get render origin for this view (with unit scale)
gGL.translatef(floorf(LLFontGL::sCurOrigin.mX * LLUI::sGLScaleFactor.mV[VX]),
floorf(LLFontGL::sCurOrigin.mY * LLUI::sGLScaleFactor.mV[VY]),
LLFontGL::sCurOrigin.mZ);
}
// scale texture to fit the space using texture coords
gGL.getTexUnit(0)->bind(media_texture);
gGL.color4fv( LLColor4::white.mV );
F32 max_u = ( F32 )media_plugin->getWidth() / ( F32 )media_plugin->getTextureWidth();
F32 max_v = ( F32 )media_plugin->getHeight() / ( F32 )media_plugin->getTextureHeight();
LLRect r = getRect();
S32 width, height;
S32 x_offset = 0;
S32 y_offset = 0;
if(mStretchToFill)
{
if(mMaintainAspectRatio)
{
// max width, adjusted height
width = r.getWidth();
height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight());
F32 media_aspect = (F32)(media_plugin->getWidth()) / (F32)(media_plugin->getHeight());
F32 view_aspect = (F32)(r.getWidth()) / (F32)(r.getHeight());
if(media_aspect > view_aspect)
{
// max width, adjusted height
width = r.getWidth();
height = llmin(llmax(llround(width / media_aspect), 0), r.getHeight());
}
else
{
// max height, adjusted width
height = r.getHeight();
width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth());
}
}
else
{
// max height, adjusted width
width = r.getWidth();
height = r.getHeight();
width = llmin(llmax(llround(height * media_aspect), 0), r.getWidth());
}
}
else
{
width = r.getWidth();
height = r.getHeight();
width = llmin(media_plugin->getWidth(), r.getWidth());
height = llmin(media_plugin->getHeight(), r.getHeight());
}
x_offset = (r.getWidth() - width) / 2;
y_offset = (r.getHeight() - height) / 2;
if(mIgnoreUIScale)
{
x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
}
// draw the browser
gGL.setSceneBlendType(LLRender::BT_REPLACE);
gGL.begin( LLRender::QUADS );
if (! media_plugin->getTextureCoordsOpenGL())
{
// render using web browser reported width and height, instead of trying to invert GL scale
gGL.texCoord2f( max_u, 0.f );
gGL.vertex2i( x_offset + width, y_offset + height );
gGL.texCoord2f( 0.f, 0.f );
gGL.vertex2i( x_offset, y_offset + height );
gGL.texCoord2f( 0.f, max_v );
gGL.vertex2i( x_offset, y_offset );
gGL.texCoord2f( max_u, max_v );
gGL.vertex2i( x_offset + width, y_offset );
}
else
{
// render using web browser reported width and height, instead of trying to invert GL scale
gGL.texCoord2f( max_u, max_v );
gGL.vertex2i( x_offset + width, y_offset + height );
gGL.texCoord2f( 0.f, max_v );
gGL.vertex2i( x_offset, y_offset + height );
gGL.texCoord2f( 0.f, 0.f );
gGL.vertex2i( x_offset, y_offset );
gGL.texCoord2f( max_u, 0.f );
gGL.vertex2i( x_offset + width, y_offset );
}
gGL.end();
gGL.setSceneBlendType(LLRender::BT_ALPHA);
}
else
{
width = llmin(media_plugin->getWidth(), r.getWidth());
height = llmin(media_plugin->getHeight(), r.getHeight());
}
x_offset = (r.getWidth() - width) / 2;
y_offset = (r.getHeight() - height) / 2;
if(mIgnoreUIScale)
{
x_offset = llround((F32)x_offset * LLUI::sGLScaleFactor.mV[VX]);
y_offset = llround((F32)y_offset * LLUI::sGLScaleFactor.mV[VY]);
width = llround((F32)width * LLUI::sGLScaleFactor.mV[VX]);
height = llround((F32)height * LLUI::sGLScaleFactor.mV[VY]);
}
// draw the browser
gGL.setSceneBlendType(LLRender::BT_REPLACE);
gGL.begin( LLRender::QUADS );
if (! media_plugin->getTextureCoordsOpenGL())
{
// render using web browser reported width and height, instead of trying to invert GL scale
gGL.texCoord2f( max_u, 0.f );
gGL.vertex2i( x_offset + width, y_offset + height );
gGL.texCoord2f( 0.f, 0.f );
gGL.vertex2i( x_offset, y_offset + height );
gGL.texCoord2f( 0.f, max_v );
gGL.vertex2i( x_offset, y_offset );
gGL.texCoord2f( max_u, max_v );
gGL.vertex2i( x_offset + width, y_offset );
}
else
{
// render using web browser reported width and height, instead of trying to invert GL scale
gGL.texCoord2f( max_u, max_v );
gGL.vertex2i( x_offset + width, y_offset + height );
gGL.texCoord2f( 0.f, max_v );
gGL.vertex2i( x_offset, y_offset + height );
gGL.texCoord2f( 0.f, 0.f );
gGL.vertex2i( x_offset, y_offset );
gGL.texCoord2f( max_u, 0.f );
gGL.vertex2i( x_offset + width, y_offset );
}
gGL.end();
gGL.setSceneBlendType(LLRender::BT_ALPHA);
gGL.popMatrix();
}
gGL.popMatrix();
else
{
// Setting these will make LLPanel::draw draw the opaque background color.
setBackgroundVisible(true);
setBackgroundOpaque(true);
}
// highlight if keyboard focus here. (TODO: this needs some work)
if ( mBorder && mBorder->getVisible() )
mBorder->setKeyboardFocusHighlight( gFocusMgr.childHasKeyboardFocus( this ) );
LLPanel::draw();
// Restore the previous values
setBackgroundVisible(background_visible);
setBackgroundOpaque(background_opaque);
}
////////////////////////////////////////////////////////////////////////////////

View File

@ -52,6 +52,7 @@ LLNameBox::LLNameBox(const Params& p)
: LLTextBox(p)
{
mNameID = LLUUID::null;
mLink = p.link;
LLNameBox::sInstances.insert(this);
setText(LLStringUtil::null);
}
@ -76,7 +77,7 @@ void LLNameBox::setNameID(const LLUUID& name_id, BOOL is_group)
gCacheName->getGroupName(name_id, name);
}
setText(name);
setName(name, is_group);
}
void LLNameBox::refresh(const LLUUID& id, const std::string& firstname,
@ -93,7 +94,7 @@ void LLNameBox::refresh(const LLUUID& id, const std::string& firstname,
{
name = firstname;
}
setText(name);
setName(name, is_group);
}
}
@ -109,3 +110,22 @@ void LLNameBox::refreshAll(const LLUUID& id, const std::string& firstname,
box->refresh(id, firstname, lastname, is_group);
}
}
void LLNameBox::setName(const std::string& name, BOOL is_group)
{
if (mLink)
{
std::string url;
if (is_group)
url = "[secondlife:///app/group/" + LLURI::escape(name) + "/about " + name + "]";
else
url = "[secondlife:///app/agent/" + mNameID.asString() + "/about " + name + "]";
setText(url);
}
else
{
setText(name);
}
}

View File

@ -47,9 +47,11 @@ public:
struct Params : public LLInitParam::Block<Params, LLTextBox::Params>
{
Optional<bool> is_group;
Optional<bool> link;
Params()
: is_group("is_group", false)
, link("link", false)
{}
};
@ -67,10 +69,13 @@ protected:
friend class LLUICtrlFactory;
private:
void setName(const std::string& name, BOOL is_group);
static std::set<LLNameBox*> sInstances;
private:
LLUUID mNameID;
BOOL mLink;
};

View File

@ -83,6 +83,9 @@ LLGestureComboBox::LLGestureComboBox(const LLGestureComboBox::Params& p)
// This forces using of halign from xml, since LLComboBox
// sets it to LLFontGL::LEFT, if text entry is disabled
mButton->setHAlign(p.drop_down_button.font_halign);
// Pressing Gesture button by SPACE/ENTER key should open gestures list
mButton->setCommitCallback(boost::bind(&LLComboBox::onButtonMouseDown, this));
}
LLGestureComboBox::~LLGestureComboBox()

View File

@ -77,7 +77,9 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
mImageLevel3(p.image_level_3),
mAutoUpdate(p.auto_update),
mSpeakerId(p.speaker_id),
mIsAgentControl(false)
mIsAgentControl(false),
mIsSwitchDirty(false),
mShouldSwitchOn(false)
{
//static LLUIColor output_monitor_muted_color = LLUIColorTable::instance().getColor("OutputMonitorMutedColor", LLColor4::orange);
//static LLUIColor output_monitor_overdriven_color = LLUIColorTable::instance().getColor("OutputMonitorOverdrivenColor", LLColor4::red);
@ -108,6 +110,7 @@ LLOutputMonitorCtrl::LLOutputMonitorCtrl(const LLOutputMonitorCtrl::Params& p)
LLOutputMonitorCtrl::~LLOutputMonitorCtrl()
{
LLMuteList::getInstance()->removeObserver(this);
LLSpeakingIndicatorManager::unregisterSpeakingIndicator(mSpeakerId, this);
}
void LLOutputMonitorCtrl::setPower(F32 val)
@ -117,6 +120,26 @@ void LLOutputMonitorCtrl::setPower(F32 val)
void LLOutputMonitorCtrl::draw()
{
// see also switchIndicator()
if (mIsSwitchDirty)
{
mIsSwitchDirty = false;
if (mShouldSwitchOn)
{
// just notify parent visibility may have changed
notifyParentVisibilityChanged();
}
else
{
// make itself invisible and notify parent about this
setVisible(FALSE);
notifyParentVisibilityChanged();
// no needs to render for invisible element
return;
}
}
// Copied from llmediaremotectrl.cpp
// *TODO: Give the LLOutputMonitorCtrl an agent-id to monitor, then
// call directly into LLVoiceClient::getInstance() to ask if that agent-id is muted, is
@ -229,6 +252,7 @@ void LLOutputMonitorCtrl::setSpeakerId(const LLUUID& speaker_id)
if (speaker_id.isNull() || speaker_id == mSpeakerId) return;
mSpeakerId = speaker_id;
LLSpeakingIndicatorManager::registerSpeakingIndicator(mSpeakerId, this);
//mute management
if (mAutoUpdate)
@ -251,3 +275,42 @@ void LLOutputMonitorCtrl::onChange()
// check only blocking on voice. EXT-3542
setIsMuted(LLMuteList::getInstance()->isMuted(mSpeakerId, LLMute::flagVoiceChat));
}
// virtual
void LLOutputMonitorCtrl::switchIndicator(bool switch_on)
{
// ensure indicator is visible in case it is not in visible chain
// to be called when parent became visible next time to notify parent that visibility is changed.
setVisible(TRUE);
// if parent is in visible chain apply switch_on state and notify it immediately
if (getParent() && getParent()->isInVisibleChain())
{
LL_DEBUGS("SpeakingIndicator") << "Indicator is in visible chain, notifying parent: " << mSpeakerId << LL_ENDL;
setVisible((BOOL)switch_on);
notifyParentVisibilityChanged();
}
// otherwise remember necessary state and mark itself as dirty.
// State will be applied i next draw when parents chain became visible.
else
{
LL_DEBUGS("SpeakingIndicator") << "Indicator is not in visible chain, parent won't be notified: " << mSpeakerId << LL_ENDL;
mIsSwitchDirty = true;
mShouldSwitchOn = switch_on;
}
}
//////////////////////////////////////////////////////////////////////////
// PRIVATE SECTION
//////////////////////////////////////////////////////////////////////////
void LLOutputMonitorCtrl::notifyParentVisibilityChanged()
{
LL_DEBUGS("SpeakingIndicator") << "Notify parent that visibility was changed: " << mSpeakerId << " ,new_visibility: " << getVisible() << LL_ENDL;
LLSD params = LLSD().with("visibility_changed", getVisible());
notifyParent(params);
}
// EOF

View File

@ -36,6 +36,7 @@
#include "v4color.h"
#include "llview.h"
#include "llmutelist.h"
#include "llspeakingindicatormanager.h"
class LLTextBox;
class LLUICtrlFactory;
@ -45,7 +46,7 @@ class LLUICtrlFactory;
//
class LLOutputMonitorCtrl
: public LLView, LLMuteListObserver
: public LLView, public LLSpeakingIndicator, LLMuteListObserver
{
public:
struct Params : public LLInitParam::Block<Params, LLView::Params>
@ -90,7 +91,29 @@ public:
//called by mute list
virtual void onChange();
/**
* Implementation of LLSpeakingIndicator interface.
* Behavior is implemented via changing visibility.
*
* If instance is in visible chain now (all parents are visible) it changes visibility
* and notify parent about this.
*
* Otherwise it marks an instance as dirty and stores necessary visibility.
* It will be applied in next draw and parent will be notified.
*/
virtual void switchIndicator(bool switch_on);
private:
/**
* Notifies parent about changed visibility.
*
* Passes LLSD with "visibility_changed" => <current visibility> value.
* For now it is processed by LLAvatarListItem to update (reshape) its children.
* Implemented fo complete EXT-3976
*/
void notifyParentVisibilityChanged();
//static LLColor4 sColorMuted;
//static LLColor4 sColorNormal;
//static LLColor4 sColorOverdriven;
@ -117,6 +140,10 @@ private:
/** uuid of a speaker being monitored */
LLUUID mSpeakerId;
/** indicates if the instance is dirty and should notify parent */
bool mIsSwitchDirty;
bool mShouldSwitchOn;
};
#endif

View File

@ -52,6 +52,7 @@
#include "llfloaterreg.h"
#include "llnotificationsutil.h"
#include "llvoiceclient.h"
#include "llnamebox.h"
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Class LLDropTarget
@ -595,7 +596,10 @@ void LLPanelAvatarProfile::processGroupProperties(const LLAvatarGroups* avatar_g
groups += ", ";
std::string group_name = LLURI::escape(it->first);
std::string group_url="[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]";
std::string group_url= it->second.notNull()
? "[secondlife:///app/group/" + it->second.asString() + "/about " + group_name + "]"
: getString("no_group_text");
groups += group_url;
}
@ -621,19 +625,15 @@ void LLPanelAvatarProfile::fillCommonData(const LLAvatarData* avatar_data)
void LLPanelAvatarProfile::fillPartnerData(const LLAvatarData* avatar_data)
{
LLNameBox* name_box = getChild<LLNameBox>("partner_text");
if (avatar_data->partner_id.notNull())
{
std::string first, last;
BOOL found = gCacheName->getName(avatar_data->partner_id, first, last);
if (found)
{
childSetTextArg("partner_text", "[FIRST]", first);
childSetTextArg("partner_text", "[LAST]", last);
}
name_box->setNameID(avatar_data->partner_id, FALSE);
}
else
{
childSetTextArg("partner_text", "[FIRST]", getString("no_partner_text"));
name_box->setNameID(LLUUID::null, FALSE);
name_box->setText(getString("no_partner_text"));
}
}

View File

@ -151,6 +151,11 @@ BOOL LLPanelGroup::postBuild()
button->setVisible(true);
button->setEnabled(false);
button = getChild<LLButton>("btn_call");
button->setClickedCallback(onBtnGroupCallClicked, this);
button = getChild<LLButton>("btn_chat");
button->setClickedCallback(onBtnGroupChatClicked, this);
button = getChild<LLButton>("btn_join");
button->setVisible(false);
@ -215,6 +220,8 @@ void LLPanelGroup::reposButtons()
reposButton("btn_create");
reposButton("btn_refresh");
reposButton("btn_cancel");
reposButton("btn_chat");
reposButton("btn_call");
}
void LLPanelGroup::reshape(S32 width, S32 height, BOOL called_from_parent )
@ -262,6 +269,18 @@ void LLPanelGroup::onBtnApply(void* user_data)
self->apply();
}
void LLPanelGroup::onBtnGroupCallClicked(void* user_data)
{
LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data);
self->callGroup();
}
void LLPanelGroup::onBtnGroupChatClicked(void* user_data)
{
LLPanelGroup* self = static_cast<LLPanelGroup*>(user_data);
self->chatGroup();
}
void LLPanelGroup::onBtnJoin()
{
lldebugs << "joining group: " << mID << llendl;
@ -349,6 +368,8 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
LLButton* button_create = findChild<LLButton>("btn_create");
LLButton* button_join = findChild<LLButton>("btn_join");
LLButton* button_cancel = findChild<LLButton>("btn_cancel");
LLButton* button_call = findChild<LLButton>("btn_call");
LLButton* button_chat = findChild<LLButton>("btn_chat");
bool is_null_group_id = group_id == LLUUID::null;
@ -362,6 +383,11 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
if(button_cancel)
button_cancel->setVisible(!is_null_group_id);
if(button_call)
button_call->setVisible(!is_null_group_id);
if(button_chat)
button_chat->setVisible(!is_null_group_id);
getChild<LLUICtrl>("prepend_founded_by")->setVisible(!is_null_group_id);
LLAccordionCtrl* tab_ctrl = findChild<LLAccordionCtrl>("group_accordion");
@ -423,12 +449,15 @@ void LLPanelGroup::setGroupID(const LLUUID& group_id)
getChild<LLUICtrl>("group_name")->setVisible(true);
getChild<LLUICtrl>("group_name_editor")->setVisible(false);
if(button_apply)
button_apply->setVisible(is_member);
}
reposButtons();
}
bool LLPanelGroup::apply(LLPanelGroupTab* tab)
bool LLPanelGroup::apply(LLPanelGroupTab* tab)
{
if(!tab)
return false;
@ -471,12 +500,17 @@ void LLPanelGroup::draw()
childEnable("btn_refresh");
}
bool enable = false;
std::string mesg;
for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it)
enable = enable || (*it)->needsApply(mesg);
LLButton* button_apply = findChild<LLButton>("btn_apply");
if(button_apply && button_apply->getVisible())
{
bool enable = false;
std::string mesg;
for(std::vector<LLPanelGroupTab* >::iterator it = mTabs.begin();it!=mTabs.end();++it)
enable = enable || (*it)->needsApply(mesg);
childSetEnabled("btn_apply", enable);
childSetEnabled("btn_apply", enable);
}
}
void LLPanelGroup::refreshData()
@ -491,6 +525,15 @@ void LLPanelGroup::refreshData()
mRefreshTimer.setTimerExpirySec(5);
}
void LLPanelGroup::callGroup()
{
LLGroupActions::startCall(getID());
}
void LLPanelGroup::chatGroup()
{
LLGroupActions::startIM(getID());
}
void LLPanelGroup::showNotice(const std::string& subject,
const std::string& message,

View File

@ -74,6 +74,8 @@ public:
bool apply();
void refreshData();
void callGroup();
void chatGroup();
virtual void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
@ -103,6 +105,8 @@ protected:
static void onBtnApply(void*);
static void onBtnRefresh(void*);
static void onBtnGroupCallClicked(void*);
static void onBtnGroupChatClicked(void*);
void reposButton(const std::string& name);
void reposButtons();

View File

@ -580,7 +580,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
}
}
mComboActiveTitle->resetDirty();
}
// If this was just a titles update, we are done.
@ -595,8 +594,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
{
mCtrlShowInGroupList->set(gdatap->mShowInList);
mCtrlShowInGroupList->setEnabled(mAllowEdit && can_change_ident);
mCtrlShowInGroupList->resetDirty();
}
if (mComboMature)
{
@ -610,19 +607,16 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
}
mComboMature->setEnabled(mAllowEdit && can_change_ident);
mComboMature->setVisible( !gAgent.isTeen() );
mComboMature->resetDirty();
}
if (mCtrlOpenEnrollment)
{
mCtrlOpenEnrollment->set(gdatap->mOpenEnrollment);
mCtrlOpenEnrollment->setEnabled(mAllowEdit && can_change_member_opts);
mCtrlOpenEnrollment->resetDirty();
}
if (mCtrlEnrollmentFee)
{
mCtrlEnrollmentFee->set(gdatap->mMembershipFee > 0);
mCtrlEnrollmentFee->setEnabled(mAllowEdit && can_change_member_opts);
mCtrlEnrollmentFee->resetDirty();
}
if (mSpinEnrollmentFee)
@ -632,7 +626,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mSpinEnrollmentFee->setEnabled( mAllowEdit &&
(fee > 0) &&
can_change_member_opts);
mSpinEnrollmentFee->resetDirty();
}
if (mCtrlReceiveNotices)
{
@ -641,7 +634,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
{
mCtrlReceiveNotices->setEnabled(mAllowEdit);
}
mCtrlReceiveNotices->resetDirty();
}
@ -665,7 +657,6 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
if (mEditCharter)
{
mEditCharter->setText(gdatap->mCharter);
mEditCharter->resetDirty();
}
if (mListVisibleMembers)
@ -693,6 +684,8 @@ void LLPanelGroupGeneral::update(LLGroupChange gc)
mListVisibleMembers->addElement(row);
}
}
resetDirty();
}
void LLPanelGroupGeneral::updateMembers()

View File

@ -460,17 +460,8 @@ LLPanelGroupSubTab::~LLPanelGroupSubTab()
{
}
BOOL LLPanelGroupSubTab::postBuild()
{
// Hook up the search widgets.
bool recurse = true;
mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse);
if (!mSearchEditor)
return FALSE;
mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
BOOL LLPanelGroupSubTab::postBuildSubTab(LLView* root)
{
// Get icons for later use.
mActionIcons.clear();
@ -488,6 +479,19 @@ BOOL LLPanelGroupSubTab::postBuild()
{
mActionIcons["partial"] = getString("power_partial_icon");
}
return TRUE;
}
BOOL LLPanelGroupSubTab::postBuild()
{
// Hook up the search widgets.
bool recurse = true;
mSearchEditor = getChild<LLFilterEditor>("filter_input", recurse);
if (!mSearchEditor)
return FALSE;
mSearchEditor->setCommitCallback(boost::bind(&LLPanelGroupSubTab::setSearchFilter, this, _2));
return LLPanelGroupTab::postBuild();
}
@ -567,7 +571,6 @@ bool LLPanelGroupSubTab::matchesActionSearchFilter(std::string action)
void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl,
U64 allowed_by_some,
U64 allowed_by_all,
icon_map_t& icons,
LLUICtrl::commit_callback_t commit_callback,
BOOL show_all,
BOOL filter,
@ -588,7 +591,6 @@ void LLPanelGroupSubTab::buildActionsList(LLScrollListCtrl* ctrl,
allowed_by_some,
allowed_by_all,
(*ras_it),
icons,
commit_callback,
show_all,
filter,
@ -600,7 +602,6 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
U64 allowed_by_some,
U64 allowed_by_all,
LLRoleActionSet* action_set,
icon_map_t& icons,
LLUICtrl::commit_callback_t commit_callback,
BOOL show_all,
BOOL filter,
@ -614,26 +615,26 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
LLSD row;
row["columns"][0]["column"] = "icon";
icon_map_t::iterator iter = icons.find("folder");
if (iter != icons.end())
row["columns"][0]["type"] = "icon";
icon_map_t::iterator iter = mActionIcons.find("folder");
if (iter != mActionIcons.end())
{
row["columns"][0]["type"] = "icon";
row["columns"][0]["value"] = (*iter).second;
}
row["columns"][1]["column"] = "action";
row["columns"][1]["type"] = "text";
row["columns"][1]["value"] = action_set->mActionSetData->mName;
row["columns"][1]["font"]["name"] = "SANSSERIF_SMALL";
row["columns"][1]["font"]["style"] = "BOLD";
LLScrollListItem* title_row = ctrl->addElement(row, ADD_BOTTOM, action_set->mActionSetData);
LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(1));
LLScrollListText* name_textp = dynamic_cast<LLScrollListText*>(title_row->getColumn(2)); //?? I have no idea fix getColumn(1) return column spacer...
if (name_textp)
name_textp->setFontStyle(LLFontGL::BOLD);
bool category_matches_filter = (filter) ? matchesActionSearchFilter(action_set->mActionSetData->mName) : true;
std::vector<LLRoleAction*>::iterator ra_it = action_set->mActions.begin();
@ -686,8 +687,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
{
if (show_full_strength)
{
icon_map_t::iterator iter = icons.find("full");
if (iter != icons.end())
icon_map_t::iterator iter = mActionIcons.find("full");
if (iter != mActionIcons.end())
{
row["columns"][column_index]["column"] = "checkbox";
row["columns"][column_index]["type"] = "icon";
@ -697,8 +698,8 @@ void LLPanelGroupSubTab::buildActionCategory(LLScrollListCtrl* ctrl,
}
else
{
icon_map_t::iterator iter = icons.find("partial");
if (iter != icons.end())
icon_map_t::iterator iter = mActionIcons.find("partial");
if (iter != mActionIcons.end())
{
row["columns"][column_index]["column"] = "checkbox";
row["columns"][column_index]["type"] = "icon";
@ -792,6 +793,8 @@ LLPanelGroupMembersSubTab::~LLPanelGroupMembersSubTab()
BOOL LLPanelGroupMembersSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@ -888,7 +891,6 @@ void LLPanelGroupMembersSubTab::handleMemberSelect()
buildActionsList(mAllowedActionsList,
allowed_by_some,
allowed_by_all,
mActionIcons,
NULL,
FALSE,
FALSE,
@ -1211,7 +1213,6 @@ void LLPanelGroupMembersSubTab::handleRoleCheck(const LLUUID& role_id,
buildActionsList(mAllowedActionsList,
powers_some_have,
powers_all_have,
mActionIcons,
NULL,
FALSE,
FALSE,
@ -1684,6 +1685,8 @@ LLPanelGroupRolesSubTab::~LLPanelGroupRolesSubTab()
BOOL LLPanelGroupRolesSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@ -1994,7 +1997,6 @@ void LLPanelGroupRolesSubTab::handleRoleSelect()
buildActionsList(mAllowedActionsList,
rd.mRolePowers,
0LL,
mActionIcons,
boost::bind(&LLPanelGroupRolesSubTab::handleActionCheck, this, _1, false),
TRUE,
FALSE,
@ -2381,6 +2383,8 @@ LLPanelGroupActionsSubTab::~LLPanelGroupActionsSubTab()
BOOL LLPanelGroupActionsSubTab::postBuildSubTab(LLView* root)
{
LLPanelGroupSubTab::postBuildSubTab(root);
// Upcast parent so we can ask it for sibling controls.
LLPanelGroupRoles* parent = (LLPanelGroupRoles*) root;
@ -2448,7 +2452,6 @@ void LLPanelGroupActionsSubTab::update(LLGroupChange gc)
buildActionsList(mActionList,
GP_ALL_POWERS,
GP_ALL_POWERS,
mActionIcons,
NULL,
FALSE,
TRUE,

View File

@ -108,7 +108,7 @@ public:
virtual BOOL postBuild();
// This allows sub-tabs to collect child widgets from a higher level in the view hierarchy.
virtual BOOL postBuildSubTab(LLView* root) { return TRUE; }
virtual BOOL postBuildSubTab(LLView* root);
virtual void setSearchFilter( const std::string& filter );
@ -117,10 +117,15 @@ public:
// Helper functions
bool matchesActionSearchFilter(std::string action);
void setFooterEnabled(BOOL enable);
virtual void setGroupID(const LLUUID& id);
protected:
void buildActionsList(LLScrollListCtrl* ctrl,
U64 allowed_by_some,
U64 allowed_by_all,
icon_map_t& icons,
LLUICtrl::commit_callback_t commit_callback,
BOOL show_all,
BOOL filter,
@ -129,15 +134,11 @@ public:
U64 allowed_by_some,
U64 allowed_by_all,
LLRoleActionSet* action_set,
icon_map_t& icons,
LLUICtrl::commit_callback_t commit_callback,
BOOL show_all,
BOOL filter,
BOOL is_owner_role);
void setFooterEnabled(BOOL enable);
virtual void setGroupID(const LLUUID& id);
protected:
LLPanel* mHeader;
LLPanel* mFooter;

View File

@ -35,6 +35,7 @@
// libs
#include "llfloaterreg.h"
#include "llmenugl.h"
#include "llnotificationsutil.h"
#include "llfiltereditor.h"
#include "lltabcontainer.h"
#include "lluictrlfactory.h"
@ -750,7 +751,6 @@ void LLPanelPeople::updateButtons()
LLPanel* groups_panel = mTabContainer->getCurrentPanel();
groups_panel->childSetEnabled("activate_btn", item_selected && !cur_group_active); // "none" or a non-active group selected
groups_panel->childSetEnabled("plus_btn", item_selected);
groups_panel->childSetEnabled("minus_btn", item_selected && selected_id.notNull());
}
else
@ -1138,6 +1138,12 @@ void LLPanelPeople::onAvatarPicked(
void LLPanelPeople::onGroupPlusButtonClicked()
{
if (!gAgent.canJoinGroups())
{
LLNotificationsUtil::add("JoinedTooManyGroups");
return;
}
LLMenuGL* plus_menu = (LLMenuGL*)mGroupPlusMenuHandle.get();
if (!plus_menu)
return;

View File

@ -71,6 +71,10 @@ public:
void setItem(LLInventoryItem* item);
LLInventoryItem* getItem() { return mItem; }
std::string getPlaceInfoType() { return mPlaceInfoType; }
private:
void onLandmarkLoaded(LLLandmark* landmark);
void onFilterEdit(const std::string& search_string, bool force_filter);

View File

@ -550,7 +550,7 @@ void LLTeleportHistoryPanel::updateVerbs()
LLTeleportHistoryFlatItem* itemp = dynamic_cast<LLTeleportHistoryFlatItem *> (mLastSelectedFlatlList->getSelectedItem());
mTeleportBtn->setEnabled(NULL != itemp && itemp->getIndex() < (S32)mTeleportHistory->getItems().size() - 1);
mTeleportBtn->setEnabled(NULL != itemp);
mShowOnMapBtn->setEnabled(NULL != itemp);
}

View File

@ -166,7 +166,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
{
name.erase(found, moderator_indicator_len);
item->setName(name);
item->reshapeAvatarName();
}
}
}
@ -188,7 +187,6 @@ void LLParticipantList::onAvatarListRefreshed(LLUICtrl* ctrl, const LLSD& param)
name += " ";
name += moderator_indicator;
item->setName(name);
item->reshapeAvatarName();
}
}
}
@ -279,6 +277,9 @@ bool LLParticipantList::onModeratorUpdateEvent(LLPointer<LLOldEvents::LLEvent> e
mModeratorList.erase(id);
}
}
// apply changes immediately
onAvatarListRefreshed(mAvatarList, LLSD());
}
}
return true;
@ -591,8 +592,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD&
if (speakerp.notNull())
{
// not in voice participants can not be moderated
return speakerp->mStatus == LLSpeaker::STATUS_VOICE_ACTIVE
|| speakerp->mStatus == LLSpeaker::STATUS_MUTED;
return speakerp->isInVoiceChannel();
}
}
return false;

View File

@ -357,7 +357,6 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id)
toast->setIsHidden(false);
toast->resetTimer();
mToastList.push_back((*it));
mStoredToastList.erase(it);
redrawToasts();
}
@ -778,6 +777,19 @@ void LLScreenChannel::hideToastsFromScreen()
(*it).toast->setVisible(FALSE);
}
//--------------------------------------------------------------------------
void LLScreenChannel::hideToast(const LLUUID& notification_id)
{
std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), notification_id);
if(mToastList.end() != it)
{
ToastElem te = *it;
te.toast->setVisible(FALSE);
te.toast->stopTimer();
mToastList.erase(it);
}
}
//--------------------------------------------------------------------------
void LLScreenChannel::removeToastsFromChannel()
{
@ -896,3 +908,13 @@ void LLScreenChannel::updateShowToastsState()
//--------------------------------------------------------------------------
LLToast* LLScreenChannel::getToastByNotificationID(LLUUID id)
{
std::vector<ToastElem>::iterator it = find(mStoredToastList.begin(),
mStoredToastList.end(), id);
if (it == mStoredToastList.end())
return NULL;
return it->toast;
}

View File

@ -176,6 +176,8 @@ public:
void modifyToastByNotificationID(LLUUID id, LLPanel* panel);
// hide all toasts from screen, but not remove them from a channel
void hideToastsFromScreen();
// hide toast by notification id
void hideToast(const LLUUID& notification_id);
// removes all toasts from a channel
void removeToastsFromChannel();
// show all toasts in a channel
@ -214,6 +216,8 @@ public:
// update number of notifications in the StartUp Toast
void updateStartUpString(S32 num);
LLToast* getToastByNotificationID(LLUUID id);
// Channel's signals
// signal on storing of faded toasts event
typedef boost::function<void (LLPanel* info_panel, const LLUUID id)> store_tost_callback_t;

View File

@ -62,6 +62,7 @@ public:
{
mPanel->inventoryFetched();
gInventory.removeObserver(this);
delete this;
}
private:
LLSidepanelAppearance *mPanel;
@ -94,14 +95,12 @@ LLSidepanelAppearance::LLSidepanelAppearance() :
mLookInfo(NULL),
mCurrOutfitPanel(NULL)
{
//LLUICtrlFactory::getInstance()->buildPanel(this, "panel_appearance.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder()
mFetchWorn = new LLCurrentlyWornFetchObserver(this);
mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this);
}
LLSidepanelAppearance::~LLSidepanelAppearance()
{
gInventory.removeObserver(mOutfitRenameWatcher);
delete mOutfitRenameWatcher;
}
// virtual
@ -156,6 +155,7 @@ BOOL LLSidepanelAppearance::postBuild()
mCurrOutfitPanel = getChild<LLPanel>("panel_currentlook");
mOutfitRenameWatcher = new LLWatchForOutfitRenameObserver(this);
gInventory.addObserver(mOutfitRenameWatcher);
return TRUE;
@ -389,16 +389,17 @@ void LLSidepanelAppearance::fetchInventory()
}
}
mFetchWorn->fetchItems(ids);
LLCurrentlyWornFetchObserver *fetch_worn = new LLCurrentlyWornFetchObserver(this);
fetch_worn->fetchItems(ids);
// If no items to be fetched, done will never be triggered.
// TODO: Change LLInventoryFetchObserver::fetchItems to trigger done() on this condition.
if (mFetchWorn->isEverythingComplete())
if (fetch_worn->isEverythingComplete())
{
mFetchWorn->done();
fetch_worn->done();
}
else
{
gInventory.addObserver(mFetchWorn);
gInventory.addObserver(fetch_worn);
}
}

View File

@ -641,24 +641,51 @@ LLPanel* LLSideTray::showPanel (const std::string& panel_name, const LLSD& para
return NULL;
}
LLPanel* LLSideTray::getPanel (const std::string& panel_name)
// This is just LLView::findChildView specialized to restrict the search to LLPanels.
// Optimization for EXT-4068 to avoid searching down to the individual item level
// when inventories are large.
LLPanel *findChildPanel(LLPanel *panel, const std::string& name, bool recurse)
{
child_vector_const_iter_t child_it;
for ( child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it)
for (LLView::child_list_const_iter_t child_it = panel->beginChild();
child_it != panel->endChild(); ++child_it)
{
LLView* view = (*child_it)->findChildView(panel_name,true);
if(view)
LLPanel *child_panel = dynamic_cast<LLPanel*>(*child_it);
if (!child_panel)
continue;
if (child_panel->getName() == name)
return child_panel;
}
if (recurse)
{
for (LLView::child_list_const_iter_t child_it = panel->beginChild();
child_it != panel->endChild(); ++child_it)
{
LLPanel* panel = dynamic_cast<LLPanel*>(view);
if(panel)
LLPanel *child_panel = dynamic_cast<LLPanel*>(*child_it);
if (!child_panel)
continue;
LLPanel *found_panel = findChildPanel(child_panel,name,recurse);
if (found_panel)
{
return panel;
return found_panel;
}
}
}
return NULL;
}
LLPanel* LLSideTray::getPanel(const std::string& panel_name)
{
for ( child_vector_const_iter_t child_it = mTabs.begin(); child_it != mTabs.end(); ++child_it)
{
LLPanel *panel = findChildPanel(*child_it,panel_name,true);
if(panel)
{
return panel;
}
}
return NULL;
}
LLPanel* LLSideTray::getActivePanel()
{
if (mActiveTab && !mCollapsed)

View File

@ -88,6 +88,11 @@ void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, c
mDisplayName = first + " " + last;
}
bool LLSpeaker::isInVoiceChannel()
{
return mStatus == LLSpeaker::STATUS_VOICE_ACTIVE || mStatus == LLSpeaker::STATUS_MUTED;
}
LLSpeakerUpdateModeratorEvent::LLSpeakerUpdateModeratorEvent(LLSpeaker* source)
: LLEvent(source, "Speaker add moderator event"),
mSpeakerID (source->mID),
@ -343,9 +348,10 @@ void LLSpeakerMgr::updateSpeakerList()
// are we bound to the currently active voice channel?
if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
{
std::vector<LLUUID> participants = LLVoiceClient::getInstance()->getParticipantList();
std::set<LLUUID> participants;
LLVoiceClient::getInstance()->getParticipantList(participants);
// add new participants to our list of known speakers
for (std::vector<LLUUID>::iterator participant_it = participants.begin();
for (std::set<LLUUID>::iterator participant_it = participants.begin();
participant_it != participants.end();
++participant_it)
{

View File

@ -67,6 +67,8 @@ public:
void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group);
bool isInVoiceChannel();
ESpeakerStatus mStatus; // current activity status in speech group
F32 mLastSpokeTime; // timestamp when this speaker last spoke
F32 mSpeechVolume; // current speech amplitude (timea average rms amplitude?)

View File

@ -0,0 +1,254 @@
/**
* @file llspeakingindicatormanager.cpp
* @author Mike Antipov
* @brief Implementation of SpeackerIndicatorManager class to process registered LLSpeackerIndicator
* depend on avatars are in the same voice channel.
*
* $LicenseInfo:firstyear=2010&license=viewergpl$
*
* Copyright (c) 2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#include "llviewerprecompiledheaders.h"
#include "llspeakingindicatormanager.h"
#include "llagentdata.h"
#include "llvoicechannel.h"
#include "llvoiceclient.h"
/**
* This class intended to control visibility of avatar speaking indicators depend on whether avatars
* are in the same voice channel.
*
* Speaking indicator should be visible for avatars in the same voice channel. See EXT-3976.
*
* It stores passed instances of LLOutputMonitorCtrl in a multimap by avatar LLUUID.
* It observes changing of voice channel and changing of participant list in voice channel.
* When voice channel or voice participant list is changed it updates visibility of an appropriate
* speaking indicator.
*
* Several indicators can be registered for the same avatar.
*/
class SpeakingIndicatorManager : public LLSingleton<SpeakingIndicatorManager>, LLVoiceClientParticipantObserver
{
LOG_CLASS(SpeakingIndicatorManager);
public:
/**
* Stores passed speaking indicator to control its visibility.
*
* Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent.
* It ignores instances of Agent's indicator.
*
* @param speaker_id LLUUID of an avatar whose speaking indicator is registered.
* @param speaking_indicator instance of the speaking indicator to be registered.
*/
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
/**
* Removes passed speaking indicator from observing.
*
* @param speaker_id LLUUID of an avatar whose speaking indicator should be unregistered.
* @param speaking_indicator instance of the speaking indicator to be unregistered.
*/
void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator);
private:
typedef std::set<LLUUID> speaker_ids_t;
typedef std::multimap<LLUUID, LLSpeakingIndicator*> speaking_indicators_mmap_t;
typedef speaking_indicators_mmap_t::value_type speaking_indicator_value_t;
typedef speaking_indicators_mmap_t::const_iterator indicator_const_iterator;
typedef std::pair<indicator_const_iterator, indicator_const_iterator> indicator_range_t;
friend class LLSingleton<SpeakingIndicatorManager>;
SpeakingIndicatorManager();
~SpeakingIndicatorManager();
/**
* Callback to determine when voice channel is changed.
*
* It switches all registered speaking indicators off.
* To reduce overheads only switched on indicators are processed.
*/
void sOnCurrentChannelChanged(const LLUUID& session_id);
/**
* Callback of changing voice participant list (from LLVoiceClientParticipantObserver).
*
* Switches off indicators had been switched on and switches on indicators of current participants list.
* There is only a few indicators in lists should be switched off/on.
* So, method does not calculate difference between these list it only switches off already
* switched on indicators and switches on indicators of voice channel participants
*/
void onChange();
/**
* Changes state of indicators specified by LLUUIDs
*
* @param speakers_uuids - avatars' LLUUIDs whose speaking indicators should be switched
* @param switch_on - if TRUE specified indicator will be switched on, off otherwise.
*/
void switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on);
/**
* Multimap with all registered speaking indicators
*/
speaking_indicators_mmap_t mSpeakingIndicators;
/**
* LUUIDs of avatar for which we have speaking indicators switched on.
*
* Is used to switch off all previously ON indicators when voice participant list is changed.
*
* @see onChange()
*/
speaker_ids_t mSwitchedIndicatorsOn;
};
//////////////////////////////////////////////////////////////////////////
// PUBLIC SECTION
//////////////////////////////////////////////////////////////////////////
void SpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
{
if (speaker_id == gAgentID) return;
LL_DEBUGS("SpeakingIndicator") << "Registering indicator: " << speaker_id << LL_ENDL;
speaking_indicator_value_t value_type(speaker_id, speaking_indicator);
mSpeakingIndicators.insert(value_type);
speaker_ids_t speakers_uuids;
BOOL is_in_same_voice = LLVoiceClient::getInstance()->isParticipant(speaker_id);
speakers_uuids.insert(speaker_id);
switchSpeakerIndicators(speakers_uuids, is_in_same_voice);
}
void SpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator)
{
speaking_indicators_mmap_t::iterator it;
it = mSpeakingIndicators.find(speaker_id);
for (;it != mSpeakingIndicators.end(); ++it)
{
if (it->second == speaking_indicator)
{
mSpeakingIndicators.erase(it);
break;
}
}
}
//////////////////////////////////////////////////////////////////////////
// PRIVATE SECTION
//////////////////////////////////////////////////////////////////////////
SpeakingIndicatorManager::SpeakingIndicatorManager()
{
LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&SpeakingIndicatorManager::sOnCurrentChannelChanged, this, _1));
LLVoiceClient::getInstance()->addObserver(this);
}
SpeakingIndicatorManager::~SpeakingIndicatorManager()
{
// Don't use LLVoiceClient::getInstance() here without check
// singleton MAY have already been destroyed.
if(LLVoiceClient::instanceExists())
{
LLVoiceClient::getInstance()->removeObserver(this);
}
}
void SpeakingIndicatorManager::sOnCurrentChannelChanged(const LLUUID& /*session_id*/)
{
switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE);
mSwitchedIndicatorsOn.clear();
}
void SpeakingIndicatorManager::onChange()
{
LL_DEBUGS("SpeakingIndicator") << "Voice participant list was changed, updating indicators" << LL_ENDL;
speaker_ids_t speakers_uuids;
LLVoiceClient::getInstance()->getParticipantList(speakers_uuids);
LL_DEBUGS("SpeakingIndicator") << "Switching all OFF, count: " << mSwitchedIndicatorsOn.size() << LL_ENDL;
// switch all indicators off
switchSpeakerIndicators(mSwitchedIndicatorsOn, FALSE);
mSwitchedIndicatorsOn.clear();
LL_DEBUGS("SpeakingIndicator") << "Switching all ON, count: " << speakers_uuids.size() << LL_ENDL;
// then switch current voice participants indicators on
switchSpeakerIndicators(speakers_uuids, TRUE);
}
void SpeakingIndicatorManager::switchSpeakerIndicators(const speaker_ids_t& speakers_uuids, BOOL switch_on)
{
speaker_ids_t::const_iterator it_uuid = speakers_uuids.begin();
for (; it_uuid != speakers_uuids.end(); ++it_uuid)
{
LL_DEBUGS("SpeakingIndicator") << "Looking for indicator: " << *it_uuid << LL_ENDL;
indicator_range_t it_range = mSpeakingIndicators.equal_range(*it_uuid);
indicator_const_iterator it_indicator = it_range.first;
bool was_found = false;
for (; it_indicator != it_range.second; ++it_indicator)
{
was_found = true;
LLSpeakingIndicator* indicator = (*it_indicator).second;
indicator->switchIndicator(switch_on);
}
if (was_found)
{
LL_DEBUGS("SpeakingIndicator") << mSpeakingIndicators.count(*it_uuid) << " indicators where found" << LL_ENDL;
if (switch_on)
{
// store switched on indicator to be able switch it off
mSwitchedIndicatorsOn.insert(*it_uuid);
}
}
else
{
LL_WARNS("SpeakingIndicator") << "indicator was not found among registered: " << *it_uuid << LL_ENDL;
}
}
}
/************************************************************************/
/* LLSpeakingIndicatorManager namespace implementation */
/************************************************************************/
void LLSpeakingIndicatorManager::registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator)
{
SpeakingIndicatorManager::instance().registerSpeakingIndicator(speaker_id, speaking_indicator);
}
void LLSpeakingIndicatorManager::unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator)
{
SpeakingIndicatorManager::instance().unregisterSpeakingIndicator(speaker_id, speaking_indicator);
}
// EOF

View File

@ -0,0 +1,67 @@
/**
* @file llspeakingindicatormanager.h
* @author Mike Antipov
* @brief Interfeace of LLSpeackerIndicator class to be processed depend on avatars are in the same voice channel.
* Also register/unregister methods for this class are declared
*
* $LicenseInfo:firstyear=2010&license=viewergpl$
*
* Copyright (c) 2010, Linden Research, Inc.
*
* Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
*
* There are special exceptions to the terms and conditions of the GPL as
* it is applied to this Source Code. View the full text of the exception
* in the file doc/FLOSS-exception.txt in this software distribution, or
* online at
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
*
* By copying, modifying or distributing this software, you acknowledge
* that you have read and understood your obligations described above,
* and agree to abide by those obligations.
*
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
* COMPLETENESS OR PERFORMANCE.
* $/LicenseInfo$
*/
#ifndef LL_LLSPEAKINGINDICATORMANAGER_H
#define LL_LLSPEAKINGINDICATORMANAGER_H
class LLSpeakingIndicator
{
public:
virtual void switchIndicator(bool switch_on) = 0;
};
// See EXT-3976.
namespace LLSpeakingIndicatorManager
{
/**
* Stores passed speaking indicator to control its visibility.
*
* Registered indicator is set visible if an appropriate avatar is in the same voice channel with Agent.
* It ignores instances of Agent's indicator.
*
* @param speaker_id LLUUID of an avatar whose speaker indicator is registered.
* @param speaking_indicator instance of the speaker indicator to be registered.
*/
void registerSpeakingIndicator(const LLUUID& speaker_id, LLSpeakingIndicator* const speaking_indicator);
/**
* Removes passed speaking indicator from observing.
*
* @param speaker_id LLUUID of an avatar whose speaker indicator should be unregistered.
* @param speaking_indicator instance of the speaker indicator to be unregistered.
*/
void unregisterSpeakingIndicator(const LLUUID& speaker_id, const LLSpeakingIndicator* const speaking_indicator);
}
#endif // LL_LLSPEAKINGINDICATORMANAGER_H

View File

@ -77,10 +77,11 @@ void LLSysWellItem::onClickCloseBtn()
//---------------------------------------------------------------------------------
BOOL LLSysWellItem::handleMouseDown(S32 x, S32 y, MASK mask)
{
BOOL res = LLPanel::handleMouseDown(x, y, mask);
if(!mCloseBtn->getRect().pointInRect(x, y))
mOnItemClick(this);
return LLPanel::handleMouseDown(x, y, mask);
return res;
}
//---------------------------------------------------------------------------------

View File

@ -700,8 +700,7 @@ void LLNotificationWellWindow::connectListUpdaterToSignal(std::string notificati
void LLNotificationWellWindow::onItemClick(LLSysWellItem* item)
{
LLUUID id = item->getID();
if(mChannel)
mChannel->loadStoredToastByNotificationIDToChannel(id);
LLFloaterReg::showInstance("inspect_toast", id);
}
void LLNotificationWellWindow::onItemClose(LLSysWellItem* item)

View File

@ -162,6 +162,9 @@ private:
void onItemClick(LLSysWellItem* item);
void onItemClose(LLSysWellItem* item);
// ID of a toast loaded by user (by clicking notification well item)
LLUUID mLoadedToastId;
};
/**

View File

@ -246,13 +246,6 @@ void LLTeleportHistoryStorage::goToItem(S32 idx)
dump();
return;
}
if (idx == (S32)mItems.size() - 1)
{
llwarns << "Will not teleport to the same location." << llendl;
dump();
return;
}
// Attempt to teleport to the requested item.
gAgent.teleportViaLocation(mItems[idx].mGlobalPos);

View File

@ -1242,11 +1242,11 @@ void LLTextureCtrl::draw()
(mTexturep->getDiscardLevel() != 1) &&
(mTexturep->getDiscardLevel() != 0))
{
LLFontGL* font = LLFontGL::getFontSansSerifBig();
LLFontGL* font = LLFontGL::getFontSansSerif();
font->renderUTF8(
mLoadingPlaceholderString, 0,
llfloor(interior.mLeft+10),
llfloor(interior.mTop-20),
llfloor(interior.mLeft+3),
llfloor(interior.mTop-25),
LLColor4::white,
LLFontGL::LEFT,
LLFontGL::BASELINE,

View File

@ -179,7 +179,9 @@ void LLToastNotifyPanel::adjustPanelForScriptNotice(const LLNotificationFormPtr
//adjust layout
LLRect button_rect = mControlPanel->getRect();
reshape(getRect().getWidth(), mInfoPanel->getRect().getHeight() + button_panel_height);
button_rect.set(0, button_rect.mBottom + button_panel_height, button_rect.getWidth(), button_rect.mBottom);
mControlPanel->reshape(button_rect.getWidth(), button_panel_height);
mControlPanel->setRect(button_rect);
}
// static
@ -217,7 +219,7 @@ LLButton* LLToastNotifyPanel::addButton(const std::string& name, const std::stri
S32 ignore_pad = 0;
S32 button_index = mNumButtons;
S32 index = button_index;
S32 x = (HPAD * 4) + 32;
S32 x = HPAD * 2; // *2 - to make a nice offset
if (mIsScriptDialog)
{

View File

@ -117,6 +117,7 @@
#include "llinspectgroup.h"
#include "llinspectobject.h"
#include "llinspectremoteobject.h"
#include "llinspecttoast.h"
#include "llmediaremotectrl.h"
#include "llmoveview.h"
#include "llnearbychat.h"
@ -185,6 +186,7 @@ void LLViewerFloaterReg::registerFloaters()
LLInspectGroupUtil::registerFloater();
LLInspectObjectUtil::registerFloater();
LLInspectRemoteObjectUtil::registerFloater();
LLNotificationsUI::registerFloater();
LLFloaterReg::add("lagmeter", "floater_lagmeter.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLagMeter>);
LLFloaterReg::add("land_holdings", "floater_land_holdings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterLandHoldings>);

View File

@ -48,12 +48,15 @@
#include "llviewerwindow.h"
#include "llfocusmgr.h"
#include "llcallbacklist.h"
#include "llparcel.h"
#include "llaudioengine.h" // for gAudiop
#include "llevent.h" // LLSimpleListener
#include "llnotificationsutil.h"
#include "lluuid.h"
#include "llkeyboard.h"
#include "llmutelist.h"
#include "llfirstuse.h"
#include <boost/bind.hpp> // for SkinFolder listener
#include <boost/signals2.hpp>
@ -708,6 +711,8 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
std::vector<LLViewerMediaImpl*> proximity_order;
bool inworld_media_enabled = gSavedSettings.getBOOL("AudioStreamingMedia");
bool needs_first_run = LLViewerMedia::needsMediaFirstRun();
U32 max_instances = gSavedSettings.getU32("PluginInstancesTotal");
U32 max_normal = gSavedSettings.getU32("PluginInstancesNormal");
U32 max_low = gSavedSettings.getU32("PluginInstancesLow");
@ -822,6 +827,21 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
new_priority = LLPluginClassMedia::PRIORITY_LOW;
}
if(!inworld_media_enabled)
{
// If inworld media is locked out, force all inworld media to stay unloaded.
if(!pimpl->getUsedInUI())
{
new_priority = LLPluginClassMedia::PRIORITY_UNLOADED;
if(needs_first_run)
{
// Don't do this more than once in this loop.
needs_first_run = false;
LLViewerMedia::displayMediaFirstRun();
}
}
}
pimpl->setPriority(new_priority);
if(pimpl->getUsedInUI())
@ -888,6 +908,61 @@ void LLViewerMedia::cleanupClass()
gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
bool LLViewerMedia::needsMediaFirstRun()
{
return gWarningSettings.getBOOL("FirstStreamingMedia");
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
void LLViewerMedia::displayMediaFirstRun()
{
gWarningSettings.setBOOL("FirstStreamingMedia", FALSE);
LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(),
boost::bind(firstRunCallback, _1, _2));
}
//////////////////////////////////////////////////////////////////////////////////////////
// static
bool LLViewerMedia::firstRunCallback(const LLSD& notification, const LLSD& response)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
// user has elected to automatically play media.
gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE);
gSavedSettings.setBOOL("AudioStreamingVideo", TRUE);
gSavedSettings.setBOOL("AudioStreamingMusic", TRUE);
gSavedSettings.setBOOL("AudioStreamingMedia", TRUE);
LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
if (parcel)
{
// play media right now, if available
LLViewerParcelMedia::play(parcel);
// play music right now, if available
std::string music_url = parcel->getMusicURL();
if (gAudiop && !music_url.empty())
gAudiop->startInternetStream(music_url);
}
}
else
{
gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, FALSE);
gSavedSettings.setBOOL("AudioStreamingMedia", FALSE);
gSavedSettings.setBOOL("AudioStreamingVideo", FALSE);
gSavedSettings.setBOOL("AudioStreamingMusic", FALSE);
}
return false;
}
//////////////////////////////////////////////////////////////////////////////////////////
// LLViewerMediaImpl
//////////////////////////////////////////////////////////////////////////////////////////
@ -930,6 +1005,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mMediaAutoPlay(false),
mInNearbyMediaList(false),
mClearCache(false),
mBackgroundColor(LLColor4::white),
mIsUpdated(false)
{
@ -1142,6 +1218,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type)
media_source->setAutoScale(mMediaAutoScale);
media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent());
media_source->focus(mHasFocus);
media_source->setBackgroundColor(mBackgroundColor);
if(mClearCache)
{
@ -1908,8 +1985,8 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
|| placeholder_image->getUseMipMaps()
|| (placeholder_image->getWidth() != mMediaSource->getTextureWidth())
|| (placeholder_image->getHeight() != mMediaSource->getTextureHeight())
|| (mTextureUsedWidth > mMediaSource->getWidth())
|| (mTextureUsedHeight > mMediaSource->getHeight())
|| (mTextureUsedWidth != mMediaSource->getWidth())
|| (mTextureUsedHeight != mMediaSource->getHeight())
)
{
LL_DEBUGS("Media") << "initializing media placeholder" << LL_ENDL;
@ -1927,7 +2004,9 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage()
// MEDIAOPT: seems insane that we actually have to make an imageraw then
// immediately discard it
LLPointer<LLImageRaw> raw = new LLImageRaw(texture_width, texture_height, texture_depth);
raw->clear(0x00, 0x00, 0x00, 0xff);
// Clear the texture to the background color, ignoring alpha.
// convert background color channels from [0.0, 1.0] to [0, 255];
raw->clear(int(mBackgroundColor.mV[VX] * 255.0f), int(mBackgroundColor.mV[VY] * 255.0f), int(mBackgroundColor.mV[VZ] * 255.0f), 0xff);
int discard_level = 0;
// ask media source for correct GL image format constants
@ -2398,6 +2477,16 @@ void LLViewerMediaImpl::setUsedInUI(bool used_in_ui)
}
};
void LLViewerMediaImpl::setBackgroundColor(LLColor4 color)
{
mBackgroundColor = color;
if(mMediaSource)
{
mMediaSource->setBackgroundColor(mBackgroundColor);
}
};
F64 LLViewerMediaImpl::getCPUUsage() const
{
F64 result = 0.0f;

View File

@ -42,6 +42,7 @@
#include "llviewermediaobserver.h"
#include "llpluginclassmedia.h"
#include "v4color.h"
class LLViewerMediaImpl;
class LLUUID;
@ -115,6 +116,12 @@ class LLViewerMedia
// This is the comparitor used to sort the list.
static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2);
// For displaying the media first-run dialog.
static bool needsMediaFirstRun();
static void displayMediaFirstRun();
static bool firstRunCallback(const LLSD& notification, const LLSD& response);
};
// Implementation functions not exported into header file
@ -289,6 +296,8 @@ public:
// This will be used as part of the interest sorting algorithm.
void setUsedInUI(bool used_in_ui);
bool getUsedInUI() const { return mUsedInUI; };
void setBackgroundColor(LLColor4 color);
F64 getCPUUsage() const;
@ -362,6 +371,7 @@ private:
std::string mMediaEntryURL;
bool mInNearbyMediaList; // used by LLFloaterNearbyMedia::refreshList() for performance reasons
bool mClearCache;
LLColor4 mBackgroundColor;
private:
BOOL mIsUpdated ;

View File

@ -904,7 +904,19 @@ void open_inventory_offer(const std::vector<LLUUID>& items, const std::string& f
LLPanelPlaces *places_panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", LLSD()));
if (places_panel)
{
places_panel->setItem(item);
// we are creating a landmark
if("create_landmark" == places_panel->getPlaceInfoType() && !places_panel->getItem())
{
places_panel->setItem(item);
}
// we are opening a group notice attachment
else
{
LLSD args;
args["type"] = "landmark";
args["id"] = item_id;
LLSideTray::getInstance()->showPanel("panel_places", args);
}
}
}
}
@ -1098,28 +1110,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
gCacheName->get(mFromID, mFromGroup, boost::bind(&inventory_offer_mute_callback,_1,_2,_3,_4,this));
}
// *NOTE dzaporozhan
// Restored from viewer-1-23 to fix EXT-3520
// Saves Group Notice Attachments to inventory.
LLMessageSystem* msg = gMessageSystem;
msg->newMessageFast(_PREHASH_ImprovedInstantMessage);
msg->nextBlockFast(_PREHASH_AgentData);
msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
msg->nextBlockFast(_PREHASH_MessageBlock);
msg->addBOOLFast(_PREHASH_FromGroup, FALSE);
msg->addUUIDFast(_PREHASH_ToAgentID, mFromID);
msg->addU8Fast(_PREHASH_Offline, IM_ONLINE);
msg->addUUIDFast(_PREHASH_ID, mTransactionID);
msg->addU32Fast(_PREHASH_Timestamp, NO_TIMESTAMP); // no timestamp necessary
std::string name;
LLAgentUI::buildFullname(name);
msg->addStringFast(_PREHASH_FromAgentName, name);
msg->addStringFast(_PREHASH_Message, "");
msg->addU32Fast(_PREHASH_ParentEstateID, 0);
msg->addUUIDFast(_PREHASH_RegionID, LLUUID::null);
msg->addVector3Fast(_PREHASH_Position, gAgent.getPositionAgent());
std::string from_string; // Used in the pop-up.
std::string chatHistory_string; // Used in chat history.
@ -1155,8 +1145,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
}
}
break;
case IM_TASK_INVENTORY_OFFERED:
case IM_GROUP_NOTICE:
send_auto_receive_response();
break;
case IM_TASK_INVENTORY_OFFERED:
case IM_GROUP_NOTICE_REQUESTED:
// This is an offer from a task or group.
// We don't use a new instance of an opener
@ -1171,10 +1163,6 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
// end switch (mIM)
case IOR_ACCEPT:
msg->addU8Fast(_PREHASH_Dialog, (U8)(mIM + 1));
msg->addBinaryDataFast(_PREHASH_BinaryBucket, &(mFolderID.mData), sizeof(mFolderID.mData));
msg->sendReliable(mHost);
//don't spam them if they are getting flooded
if (check_offer_throttle(mFromName, true))
{
@ -1197,7 +1185,10 @@ bool LLOfferInfo::inventory_offer_callback(const LLSD& notification, const LLSD&
{
chat.mMuted = TRUE;
}
LLFloaterChat::addChatHistory(chat);
// *NOTE dzaporozhan
// Disabled logging to old chat floater to fix crash in group notices - EXT-4149
// LLFloaterChat::addChatHistory(chat);
LLInventoryFetchComboObserver::folder_ref_t folders;
LLInventoryFetchComboObserver::item_ref_t items;
@ -1768,10 +1759,9 @@ void process_improved_im(LLMessageSystem *msg, void **user_data)
}
else if (from_id.isNull())
{
// Messages from "Second Life" ID don't go to IM history
// messages which should be routed to IM window come from a user ID with name=SYSTEM_NAME
chat.mText = name + ": " + message;
LLFloaterChat::addChat(chat, FALSE, FALSE);
LLSD args;
args["MESSAGE"] = message;
LLNotificationsUtil::add("SystemMessage", args);
}
else if (to_id.isNull())
{

View File

@ -56,10 +56,6 @@ LLUUID LLViewerParcelMedia::sMediaRegionID;
viewer_media_t LLViewerParcelMedia::sMediaImpl;
// Local functions
bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel);
// static
void LLViewerParcelMedia::initClass()
{
@ -112,12 +108,10 @@ void LLViewerParcelMedia::update(LLParcel* parcel)
// First use warning
if( (!mediaUrl.empty() ||
!parcel->getMusicURL().empty())
&& gWarningSettings.getBOOL("FirstStreamingMedia") )
&& LLViewerMedia::needsMediaFirstRun())
{
LLNotificationsUtil::add("ParcelCanPlayMedia", LLSD(), LLSD(),
boost::bind(callback_play_media, _1, _2, parcel));
LLViewerMedia::displayMediaFirstRun();
return;
}
// if we have a current (link sharing) url, use it instead
@ -591,36 +585,6 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent
};
}
bool callback_play_media(const LLSD& notification, const LLSD& response, LLParcel* parcel)
{
S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
if (option == 0)
{
// user has elected to automatically play media.
gSavedSettings.setBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING, TRUE);
gSavedSettings.setBOOL("AudioStreamingVideo", TRUE);
gSavedSettings.setBOOL("AudioStreamingMusic", TRUE);
if(!gSavedSettings.getBOOL("AudioStreamingMedia"))
gSavedSettings.setBOOL("AudioStreamingMedia", TRUE);
// play media right now, if available
LLViewerParcelMedia::play(parcel);
// play music right now, if available
if (parcel)
{
std::string music_url = parcel->getMusicURL();
if (gAudiop && !music_url.empty())
gAudiop->startInternetStream(music_url);
}
}
else
{
gSavedSettings.setBOOL("AudioStreamingVideo", FALSE);
gSavedSettings.setBOOL("AudioStreamingMusic", FALSE);
}
gWarningSettings.setBOOL("FirstStreamingMedia", FALSE);
return false;
}
// TODO: observer
/*
void LLViewerParcelMediaNavigationObserver::onNavigateComplete( const EventType& event_in )

View File

@ -2535,6 +2535,7 @@ void LLVOAvatar::idleUpdateLoadingEffect()
if (isFullyLoaded())
{
deleteParticleSource();
updateLOD();
}
else
{
@ -6822,7 +6823,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id )
local_tex_iter != baked_dict->mLocalTextures.end();
++local_tex_iter)
{
setBakedReady(*local_tex_iter, TRUE);
if (isSelf()) setBakedReady(*local_tex_iter, TRUE);
}
// ! BACKWARDS COMPATIBILITY !

View File

@ -253,18 +253,28 @@ const LLVoiceDeviceList& LLVoiceClient::getRenderDevices()
//--------------------------------------------------
// participants
std::vector<LLUUID> LLVoiceClient::getParticipantList(void)
void LLVoiceClient::getParticipantList(std::set<LLUUID> &participants)
{
if (mVoiceModule)
{
return mVoiceModule->getParticipantList();
mVoiceModule->getParticipantList(participants);
}
else
{
return std::vector<LLUUID>();
participants = std::set<LLUUID>();
}
}
bool LLVoiceClient::isParticipant(const LLUUID &speaker_id)
{
if(mVoiceModule)
{
return mVoiceModule->isParticipant(speaker_id);
}
return false;
}
//--------------------------------------------------
// text chat

View File

@ -142,7 +142,8 @@ public:
virtual LLVoiceDeviceList& getCaptureDevices()=0;
virtual LLVoiceDeviceList& getRenderDevices()=0;
virtual std::vector<LLUUID> getParticipantList(void)=0;
virtual void getParticipantList(std::set<LLUUID> &participants)=0;
virtual bool isParticipant(const LLUUID& speaker_id)=0;
//@}
////////////////////////////
@ -368,7 +369,8 @@ static const F32 OVERDRIVEN_POWER_LEVEL;
/////////////////////////////
BOOL getAreaVoiceDisabled(); // returns true if the area the avatar is in is speech-disabled.
// Use this to determine whether to show a "no speech" icon in the menu bar.
std::vector<LLUUID> getParticipantList(void);
void getParticipantList(std::set<LLUUID> &participants);
bool isParticipant(const LLUUID& speaker_id);
//////////////////////////
/// @name text chat

View File

@ -4189,19 +4189,26 @@ void LLVivoxVoiceClient::sessionState::removeAllParticipants()
}
}
std::vector<LLUUID> LLVivoxVoiceClient::getParticipantList(void)
void LLVivoxVoiceClient::getParticipantList(std::set<LLUUID> &participants)
{
std::vector<LLUUID> result;
if(mAudioSession)
{
for(participantUUIDMap::iterator iter = mAudioSession->mParticipantsByUUID.begin();
iter != mAudioSession->mParticipantsByUUID.end();
iter++)
{
result.push_back(iter->first);
participants.insert(iter->first);
}
}
return result;
}
bool LLVivoxVoiceClient::isParticipant(const LLUUID &speaker_id)
{
if(mAudioSession)
{
return (mAudioSession->mParticipantsByUUID.find(speaker_id) != mAudioSession->mParticipantsByUUID.end());
}
return false;
}

View File

@ -115,7 +115,9 @@ public:
virtual LLVoiceDeviceList& getRenderDevices();
//@}
virtual std::vector<LLUUID> getParticipantList(void);
virtual void getParticipantList(std::set<LLUUID> &participants);
virtual bool isParticipant(const LLUUID& speaker_id);
// Send a text message to the specified user, initiating the session if necessary.
virtual BOOL sendTextMessage(const LLUUID& participant_id, const std::string& message);

View File

@ -491,7 +491,7 @@ void LLVOWLSky::drawStars(void)
if (mStarsVerts.notNull())
{
mStarsVerts->setBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK);
mStarsVerts->draw(LLRender::POINTS, getStarsNumIndices(), 0);
mStarsVerts->drawArrays(LLRender::QUADS, 0, getStarsNumVerts()*4);
}
}
@ -546,6 +546,7 @@ void LLVOWLSky::initStars()
std::vector<F32>::iterator v_i = mStarIntensities.begin();
U32 i;
for (i = 0; i < getStarsNumVerts(); ++i)
{
v_p->mV[VX] = ll_frand() - 0.5f;
@ -771,17 +772,17 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
{
LLStrider<LLVector3> verticesp;
LLStrider<LLColor4U> colorsp;
LLStrider<U16> indicesp;
LLStrider<LLVector2> texcoordsp;
if (mStarsVerts.isNull())
{
mStarsVerts = new LLVertexBuffer(LLDrawPoolWLSky::STAR_VERTEX_DATA_MASK, GL_DYNAMIC_DRAW);
mStarsVerts->allocateBuffer(getStarsNumVerts(), getStarsNumIndices(), TRUE);
mStarsVerts->allocateBuffer(getStarsNumVerts()*4, 0, TRUE);
}
BOOL success = mStarsVerts->getVertexStrider(verticesp)
&& mStarsVerts->getIndexStrider(indicesp)
&& mStarsVerts->getColorStrider(colorsp);
&& mStarsVerts->getColorStrider(colorsp)
&& mStarsVerts->getTexCoord0Strider(texcoordsp);
if(!success)
{
@ -791,11 +792,37 @@ BOOL LLVOWLSky::updateStarGeometry(LLDrawable *drawable)
// *TODO: fix LLStrider with a real prefix increment operator so it can be
// used as a model of OutputIterator. -Brad
// std::copy(mStarVertices.begin(), mStarVertices.end(), verticesp);
if (mStarVertices.size() < getStarsNumVerts())
{
llerrs << "Star reference geometry insufficient." << llendl;
}
for (U32 vtx = 0; vtx < getStarsNumVerts(); ++vtx)
{
LLVector3 at = mStarVertices[vtx];
at.normVec();
LLVector3 left = at%LLVector3(0,0,1);
LLVector3 up = at%left;
F32 sc = 0.5f+ll_frand()*1.25f;
left *= sc;
up *= sc;
*(verticesp++) = mStarVertices[vtx];
*(verticesp++) = mStarVertices[vtx]+left;
*(verticesp++) = mStarVertices[vtx]+left+up;
*(verticesp++) = mStarVertices[vtx]+up;
*(texcoordsp++) = LLVector2(0,0);
*(texcoordsp++) = LLVector2(0,1);
*(texcoordsp++) = LLVector2(1,1);
*(texcoordsp++) = LLVector2(1,0);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(colorsp++) = LLColor4U(mStarColors[vtx]);
*(indicesp++) = vtx;
}
mStarsVerts->setBuffer(0);

View File

@ -292,7 +292,7 @@
reference="White" />
<color
name="FilterBackgroundColor"
reference="MouseGray" />
reference="Black" />
<color
name="FilterTextColor"
value="0.38 0.69 0.57 1" />
@ -394,7 +394,10 @@
reference="White" />
<color
name="InventoryBackgroundColor"
reference="Unused?" />
reference="DkGray2" />
<color
name="InventoryFocusOutlineColor"
reference="EmphasisColor" />
<color
name="InventoryItemSuffixColor"
reference="White_25" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

After

Width:  |  Height:  |  Size: 582 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 405 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 456 B

After

Width:  |  Height:  |  Size: 653 B

View File

@ -167,6 +167,7 @@ with the same filename but different name
<texture name="Flag" file_name="navbar/Flag.png" preload="false" />
<texture name="Folder_Arrow" file_name="folder_arrow.tga" preload="false" />
<texture name="ForSale_Badge" file_name="icons/ForSale_Badge.png" preload="false" />
<texture name="ForwardArrow_Off" file_name="icons/ForwardArrow_Off.png" preload="false" />
<texture name="ForwardArrow_Press" file_name="icons/ForwardArrow_Press.png" preload="false" />
@ -439,6 +440,7 @@ with the same filename but different name
<texture name="Resize_Corner" file_name="windows/Resize_Corner.png" preload="true" />
<texture name="Rounded_Square" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" />
<texture name="Row_Selection" file_name="navbar/Row_Selection.png" preload="false" />
<texture name="ScrollArrow_Down" file_name="widgets/ScrollArrow_Down.png" preload="true" scale.left="2" scale.top="13" scale.right="13" scale.bottom="2" />
@ -676,7 +678,6 @@ with the same filename but different name
<texture name="toggle_button_selected" file_name="toggle_button_selected.png" preload="true" />
<texture name="sm_rounded_corners_simple.tga" scale.left="4" scale.top="4" scale.bottom="4" scale.right="4" />
<texture name="rounded_square.tga" file_name="rounded_square.j2c" preload="true" scale.left="16" scale.top="16" scale.right="112" scale.bottom="16" />
<texture name="color_swatch_alpha.tga" preload="true" />
<texture name="button_anim_pause.tga" />

View File

@ -287,7 +287,7 @@
<button
follows="left|top"
height="23"
label="Ok"
label="OK"
layout="topleft"
left="65"
name="apply"

View File

@ -222,7 +222,7 @@
width="300"
height="30"
name="currency_links">
[http://www.secondlife.com/ payment method] | [http://www.secondlife.com/ currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
[http://www.secondlife.com/my/account/payment_method_management.php payment method] | [http://www.secondlife.com/my/account/currency.php currency] | [http://www.secondlife.com/my/account/exchange_rates.php exchange rate]
</text>
<text
type="string"

View File

@ -186,8 +186,8 @@
<button
follows="right|bottom"
height="20"
label="Ok"
label_selected="Ok"
label="OK"
label_selected="OK"
layout="topleft"
right="-120"
top_delta="9"

View File

@ -43,7 +43,6 @@
left="0"
name="browser"
top="0"
start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E"
width="590" />
</layout_panel>
</layout_stack>

View File

@ -9,7 +9,7 @@
save_rect="true"
save_visibility="true"
single_instance="true"
title="Instant Messages"
title="CONVERSATIONS"
width="392">
<tab_container
follows="left|right|top|bottom"

View File

@ -8,9 +8,9 @@
min_height="271"
min_width="350"
name="script ed float"
help_topic="script_ed_float"
help_topic="lsl_reference"
save_rect="true"
title="LSL WIKI"
title="LSL REFERENCE"
width="370">
<check_box
follows="top|left"

View File

@ -47,7 +47,7 @@
<button
follows="bottom|left"
height="23"
label="Ok"
label="OK"
layout="topleft"
left="155"
name="OK"

View File

@ -42,7 +42,6 @@
left="0"
name="browser"
top="0"
start_url="data:text/html,%3Chtml%3E%3Cbody bgcolor=%22#2A2A2A%22%3E%3C/body%3E%3C/html%3E"
height="600"
width="650" />
<text

View File

@ -131,8 +131,8 @@
<button
follows="right|bottom"
height="20"
label="Ok"
label_selected="Ok"
label="OK"
label_selected="OK"
layout="topleft"
right="-120"
name="Select"

View File

@ -5,6 +5,9 @@
height="108"
layout="topleft"
name="whitelist_entry"
single_instance="true"
help_topic="whitelist_entry"
title="WHITELIST ENTRY"
width="390">
<text type="string" length="1" bottom="20" follows="top|left" height="15" layout="topleft"

View File

@ -0,0 +1,19 @@
<?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="148"
layout="topleft"
name="inspect_toast"
single_instance="true"
sound_flags="0"
visible="true"
width="228">
</floater>

View File

@ -157,7 +157,7 @@ No tutorial is currently available.
An error occurred while updating [APP_NAME]. Please [http://get.secondlife.com download the latest version] of the Viewer.
<usetemplate
name="okbutton"
yestext="Ok"/>
yestext="OK"/>
</notification>
<notification
@ -169,7 +169,7 @@ Could not connect to the [SECOND_LIFE_GRID].
Make sure your Internet connection is working properly.
<usetemplate
name="okbutton"
yestext="Ok"/>
yestext="OK"/>
</notification>
<notification
@ -179,7 +179,7 @@ Make sure your Internet connection is working properly.
Message Template [PATH] not found.
<usetemplate
name="okbutton"
yestext="Ok"/>
yestext="OK"/>
</notification>
<notification
@ -2978,6 +2978,16 @@ You have reached your maximum number of groups. Please leave another group befor
yestext="Join"/>
</notification>
<notification
icon="alert.tga"
name="JoinedTooManyGroups"
type="alert">
You have reached your maximum number of groups. Please leave some group before joining or creating a new one.
<usetemplate
name="okbutton"
yestext="OK"/>
</notification>
<notification
icon="alert.tga"
name="KickUser"
@ -5856,7 +5866,7 @@ Are you sure you want to close all IMs?
<usetemplate
name="okcancelignore"
notext="Cancel"
yestext="Ok"/>
yestext="OK"/>
</notification>
<notification icon="notifytip.tga"

Some files were not shown because too many files have changed in this diff Show More