diff options
Diffstat (limited to 'indra')
402 files changed, 12344 insertions, 5537 deletions
diff --git a/indra/cmake/ExamplePlugin.cmake b/indra/cmake/ExamplePlugin.cmake new file mode 100644 index 0000000000..599787ad21 --- /dev/null +++ b/indra/cmake/ExamplePlugin.cmake @@ -0,0 +1,16 @@ +# -*- cmake -*- +include(Linking) +include(Prebuilt) + +if (STANDALONE) + set(EXAMPLEPLUGIN OFF CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +else (STANDALONE) + set(EXAMPLEPLUGIN ON CACHE BOOL + "EXAMPLEPLUGIN support for the llplugin/llmedia test apps.") +endif (STANDALONE) + +if (WINDOWS) +elseif (DARWIN) +elseif (LINUX) +endif (WINDOWS) diff --git a/indra/integration_tests/llui_libtest/llui_libtest.cpp b/indra/integration_tests/llui_libtest/llui_libtest.cpp index 3631761c93..abd8f7dbde 100644 --- a/indra/integration_tests/llui_libtest/llui_libtest.cpp +++ b/indra/integration_tests/llui_libtest/llui_libtest.cpp @@ -84,12 +84,12 @@ class LLTexture ; class TestImageProvider : public LLImageProviderInterface { public: - /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name) + /*virtual*/ LLPointer<LLUIImage> getUIImage(const std::string& name, S32 priority) { return makeImage(); } - /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id) + /*virtual*/ LLPointer<LLUIImage> getUIImageByID(const LLUUID& id, S32 priority) { return makeImage(); } diff --git a/indra/llcharacter/llvisualparam.cpp b/indra/llcharacter/llvisualparam.cpp index 9e4957342c..6232c7588b 100644 --- a/indra/llcharacter/llvisualparam.cpp +++ b/indra/llcharacter/llvisualparam.cpp @@ -173,7 +173,8 @@ LLVisualParam::LLVisualParam() mTargetWeight( 0.f ), mIsAnimating( FALSE ), mID( -1 ), - mInfo( 0 ) + mInfo( 0 ), + mIsDummy(FALSE) { } @@ -251,6 +252,13 @@ void LLVisualParam::setWeight(F32 weight, BOOL set_by_user) //----------------------------------------------------------------------------- void LLVisualParam::setAnimationTarget(F32 target_value, BOOL set_by_user) { + // don't animate dummy parameters + if (mIsDummy) + { + setWeight(target_value, set_by_user); + return; + } + if (mInfo) { if (getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) diff --git a/indra/llcharacter/llvisualparam.h b/indra/llcharacter/llvisualparam.h index 0b516b9374..affc49debf 100644 --- a/indra/llcharacter/llvisualparam.h +++ b/indra/llcharacter/llvisualparam.h @@ -148,15 +148,19 @@ public: LLVisualParam* getNextParam() { return mNext; } void setNextParam( LLVisualParam *next ); - virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating; } + virtual void setAnimating(BOOL is_animating) { mIsAnimating = is_animating && !mIsDummy; } BOOL getAnimating() const { return mIsAnimating; } + void setIsDummy(BOOL is_self) { mIsDummy = is_self; } + protected: F32 mCurWeight; // current weight F32 mLastWeight; // last weight LLVisualParam* mNext; // next param in a shared chain F32 mTargetWeight; // interpolation target BOOL mIsAnimating; // this value has been given an interpolation target + BOOL mIsDummy; // this is used to prevent dummy visual params from animating + S32 mID; // id for storing weight/morphtarget compares compactly LLVisualParamInfo *mInfo; diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f2edd5c559..c027aa7bdd 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -671,9 +671,9 @@ std::string ll_convert_wide_to_string(const wchar_t* in) } #endif // LL_WINDOWS -long LLStringOps::sltOffset; -long LLStringOps::localTimeOffset; -bool LLStringOps::daylightSavings; +long LLStringOps::sPacificTimeOffset = 0; +long LLStringOps::sLocalTimeOffset = 0; +bool LLStringOps::sPacificDaylightTime = 0; std::map<std::string, std::string> LLStringOps::datetimeToCodes; S32 LLStringOps::collate(const llwchar* a, const llwchar* b) @@ -700,11 +700,11 @@ void LLStringOps::setupDatetimeInfo (bool daylight) tmpT = gmtime (&nowT); gmtT = mktime (tmpT); - localTimeOffset = (long) (gmtT - localT); + sLocalTimeOffset = (long) (gmtT - localT); - daylightSavings = daylight; - sltOffset = (daylightSavings? 7 : 8 ) * 60 * 60; + sPacificDaylightTime = daylight; + sPacificTimeOffset = (sPacificDaylightTime? 7 : 8 ) * 60 * 60; datetimeToCodes["wkday"] = "%a"; // Thu datetimeToCodes["weekday"] = "%A"; // Thursday @@ -957,36 +957,35 @@ bool LLStringUtil::formatDatetime(std::string& replacement, std::string token, } else if (param != "utc") // slt { - secFromEpoch -= LLStringOps::getSltOffset(); + secFromEpoch -= LLStringOps::getPacificTimeOffset(); } // if never fell into those two ifs above, param must be utc if (secFromEpoch < 0) secFromEpoch = 0; - LLDate * datetime = new LLDate((F64)secFromEpoch); + LLDate datetime((F64)secFromEpoch); std::string code = LLStringOps::getDatetimeCode (token); // special case to handle timezone if (code == "%Z") { if (param == "utc") + { replacement = "GMT"; - else if (param == "slt") - replacement = "SLT"; - else if (param != "local") // *TODO Vadim: not local? then what? - replacement = LLStringOps::getDaylightSavings() ? "PDT" : "PST"; - - return true; - } - replacement = datetime->toHTTPDateString(code); - - if (code.empty()) - { - return false; - } - else - { + } + else if (param == "local") + { + replacement = ""; // user knows their own timezone + } + else + { + // "slt" = Second Life Time, which is deprecated. + // If not utc or user local time, fallback to Pacific time + replacement = LLStringOps::getPacificDaylightTime() ? "PDT" : "PST"; + } return true; } + replacement = datetime.toHTTPDateString(code); + return !code.empty(); } // LLStringUtil::format recogizes the following patterns. diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 0f2f05a0d8..edbb007f61 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -151,9 +151,9 @@ struct char_traits<U16> class LL_COMMON_API LLStringOps
{
private:
- static long sltOffset;
- static long localTimeOffset;
- static bool daylightSavings;
+ static long sPacificTimeOffset;
+ static long sLocalTimeOffset;
+ static bool sPacificDaylightTime;
static std::map<std::string, std::string> datetimeToCodes;
public:
@@ -184,10 +184,13 @@ public: static S32 collate(const char* a, const char* b) { return strcoll(a, b); }
static S32 collate(const llwchar* a, const llwchar* b);
- static void setupDatetimeInfo (bool daylight);
- static long getSltOffset (void) {return sltOffset;}
- static long getLocalTimeOffset (void) {return localTimeOffset;}
- static bool getDaylightSavings (void) {return daylightSavings;}
+ static void setupDatetimeInfo(bool pacific_daylight_time);
+ static long getPacificTimeOffset(void) { return sPacificTimeOffset;}
+ static long getLocalTimeOffset(void) { return sLocalTimeOffset;}
+ // Is the Pacific time zone (aka server time zone)
+ // currently in daylight savings time?
+ static bool getPacificDaylightTime(void) { return sPacificDaylightTime;}
+
static std::string getDatetimeCode (std::string key);
};
diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index fc58b48a7b..457c074ef1 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -112,6 +112,8 @@ void LLPluginClassMedia::reset() mLowPrioritySizeLimit = LOW_PRIORITY_TEXTURE_SIZE_DEFAULT; mAllowDownsample = false; mPadding = 0; + mLastMouseX = 0; + mLastMouseY = 0; mStatus = LLPluginClassMediaOwner::MEDIA_NONE; mSleepTime = 1.0f / 100.0f; mCanCut = false; @@ -412,8 +414,20 @@ std::string LLPluginClassMedia::translateModifiers(MASK modifiers) return result; } -void LLPluginClassMedia::mouseEvent(EMouseEventType type, int x, int y, MASK modifiers) +void LLPluginClassMedia::mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers) { + if(type == MOUSE_EVENT_MOVE) + { + if((x == mLastMouseX) && (y == mLastMouseY)) + { + // Don't spam unnecessary mouse move events. + return; + } + + mLastMouseX = x; + mLastMouseY = y; + } + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "mouse_event"); std::string temp; switch(type) @@ -425,6 +439,8 @@ void LLPluginClassMedia::mouseEvent(EMouseEventType type, int x, int y, MASK mod } message.setValue("event", temp); + message.setValueS32("button", button); + message.setValueS32("x", x); // Incoming coordinates are OpenGL-style ((0,0) = lower left), so flip them here if the plugin has requested it. @@ -515,11 +531,12 @@ void LLPluginClassMedia::scrollEvent(int x, int y, MASK modifiers) sendMessage(message); } -bool LLPluginClassMedia::textInput(const std::string &text) +bool LLPluginClassMedia::textInput(const std::string &text, MASK modifiers) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "text_event"); message.setValue("text", text); + message.setValue("modifiers", translateModifiers(modifiers)); sendMessage(message); @@ -535,6 +552,23 @@ void LLPluginClassMedia::loadURI(const std::string &uri) sendMessage(message); } +const char* LLPluginClassMedia::priorityToString(EPriority priority) +{ + const char* result = "UNKNOWN"; + switch(priority) + { + case PRIORITY_UNLOADED: result = "unloaded"; break; + case PRIORITY_STOPPED: result = "stopped"; break; + case PRIORITY_HIDDEN: result = "hidden"; break; + case PRIORITY_SLIDESHOW: result = "slideshow"; break; + case PRIORITY_LOW: result = "low"; break; + case PRIORITY_NORMAL: result = "normal"; break; + case PRIORITY_HIGH: result = "high"; break; + } + + return result; +} + void LLPluginClassMedia::setPriority(EPriority priority) { if(mPriority != priority) @@ -543,35 +577,28 @@ void LLPluginClassMedia::setPriority(EPriority priority) LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "set_priority"); - std::string priority_string; + std::string priority_string = priorityToString(priority); switch(priority) { case PRIORITY_UNLOADED: - priority_string = "unloaded"; mSleepTime = 1.0f; break; case PRIORITY_STOPPED: - priority_string = "stopped"; mSleepTime = 1.0f; break; case PRIORITY_HIDDEN: - priority_string = "hidden"; mSleepTime = 1.0f; break; case PRIORITY_SLIDESHOW: - priority_string = "slideshow"; mSleepTime = 1.0f; break; case PRIORITY_LOW: - priority_string = "low"; mSleepTime = 1.0f / 50.0f; break; case PRIORITY_NORMAL: - priority_string = "normal"; mSleepTime = 1.0f / 100.0f; break; case PRIORITY_HIGH: - priority_string = "high"; mSleepTime = 1.0f / 100.0f; break; } @@ -777,6 +804,10 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) { mStatus = LLPluginClassMediaOwner::MEDIA_PAUSED; } + else if(status == "done") + { + mStatus = LLPluginClassMediaOwner::MEDIA_DONE; + } else { // empty string or any unknown string @@ -1112,6 +1143,11 @@ void LLPluginClassMedia::setVolume(float volume) } } +float LLPluginClassMedia::getVolume() +{ + return mRequestedVolume; +} + void LLPluginClassMedia::initializeUrlHistory(const LLSD& url_history) { // Send URL history to plugin diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 697deec353..90ecd1e073 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -101,7 +101,7 @@ public: MOUSE_EVENT_DOUBLE_CLICK }EMouseEventType; - void mouseEvent(EMouseEventType type, int x, int y, MASK modifiers); + void mouseEvent(EMouseEventType type, int button, int x, int y, MASK modifiers); typedef enum { @@ -115,7 +115,7 @@ public: void scrollEvent(int x, int y, MASK modifiers); // Text may be unicode (utf8 encoded) - bool textInput(const std::string &text); + bool textInput(const std::string &text, MASK modifiers); void loadURI(const std::string &uri); @@ -150,6 +150,7 @@ public: PRIORITY_HIGH // media has user focus and/or is taking up most of the screen }EPriority; + static const char* priorityToString(EPriority priority); void setPriority(EPriority priority); void setLowPrioritySizeLimit(int size); @@ -227,6 +228,7 @@ public: void seek(float time); void setLoop(bool loop); void setVolume(float volume); + float getVolume(); F64 getCurrentTime(void) const { return mCurrentTime; }; F64 getDuration(void) const { return mDuration; }; @@ -310,6 +312,8 @@ protected: std::string translateModifiers(MASK modifiers); std::string mCursorName; + int mLastMouseX; + int mLastMouseY; LLPluginClassMediaOwner::EMediaStatus mStatus; diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index 4690f09172..c798af29ca 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -70,7 +70,8 @@ public: MEDIA_ERROR, // navigation/preroll failed MEDIA_PLAYING, // playing (only for time-based media) MEDIA_PAUSED, // paused (only for time-based media) - + MEDIA_DONE // finished playing (only for time-based media) + } EMediaStatus; virtual ~LLPluginClassMediaOwner() {}; diff --git a/indra/llplugin/llpluginprocessparent.cpp b/indra/llplugin/llpluginprocessparent.cpp index f3b4c6bdc6..39f9438fb3 100644 --- a/indra/llplugin/llpluginprocessparent.cpp +++ b/indra/llplugin/llpluginprocessparent.cpp @@ -55,6 +55,11 @@ LLPluginProcessParent::LLPluginProcessParent(LLPluginProcessParentOwner *owner) mBoundPort = 0; mState = STATE_UNINITIALIZED; mDisableTimeout = false; + + // initialize timer - heartbeat test (mHeartbeat.hasExpired()) + // can sometimes return true immediately otherwise and plugins + // fail immediately because it looks like + mHeartbeat.setTimerExpirySec(PLUGIN_LOCKED_UP_SECONDS); } LLPluginProcessParent::~LLPluginProcessParent() diff --git a/indra/llrender/lltexture.h b/indra/llrender/lltexture.h index c18917b663..0cd9667644 100644 --- a/indra/llrender/lltexture.h +++ b/indra/llrender/lltexture.h @@ -61,6 +61,8 @@ public: // //interfaces to access LLViewerTexture // + virtual S8 getType() const = 0 ; + virtual void setKnownDrawSize(S32 width, S32 height) = 0 ; virtual bool bindDefaultImage(const S32 stage = 0) const = 0 ; virtual void forceImmediateUpdate() = 0 ; virtual void setActive() = 0 ; diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index fd369730d6..a7946cacf5 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -486,6 +486,11 @@ void LLButton::onMouseLeave(S32 x, S32 y, MASK mask) mNeedsHighlight = FALSE; } +void LLButton::setHighlight(bool b) +{ + mNeedsHighlight = b; +} + BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) { if (!childrenHandleHover(x, y, mask)) diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 7fc4997133..85580a98bf 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -176,6 +176,7 @@ public: BOOL getToggleState() const; void setToggleState(BOOL b); + void setHighlight(bool b); void setFlashing( BOOL b ); BOOL getFlashing() const { return mFlashing; } @@ -241,8 +242,8 @@ public: void setForcePressedState(BOOL b) { mForcePressedState = b; } protected: - const LLPointer<LLUIImage>& getImageUnselected() const { return mImageUnselected; } - const LLPointer<LLUIImage>& getImageSelected() const { return mImageSelected; } + LLPointer<LLUIImage> getImageUnselected() const { return mImageUnselected; } + LLPointer<LLUIImage> getImageSelected() const { return mImageSelected; } LLFrameTimer mMouseDownTimer; diff --git a/indra/llui/lldraghandle.cpp b/indra/llui/lldraghandle.cpp index 8eccd709ce..d9b98b1c28 100644 --- a/indra/llui/lldraghandle.cpp +++ b/indra/llui/lldraghandle.cpp @@ -49,9 +49,9 @@ #include "lluictrlfactory.h" const S32 LEADING_PAD = 5; -const S32 TITLE_PAD = 8; +const S32 TITLE_HPAD = 8; const S32 BORDER_PAD = 1; -const S32 LEFT_PAD = BORDER_PAD + TITLE_PAD + LEADING_PAD; +const S32 LEFT_PAD = BORDER_PAD + TITLE_HPAD + LEADING_PAD; const S32 RIGHT_PAD = BORDER_PAD + 32; // HACK: space for close btn and minimize btn S32 LLDragHandle::sSnapMargin = 5; @@ -240,19 +240,20 @@ void LLDragHandleLeft::draw() void LLDragHandleTop::reshapeTitleBox() { + static LLUICachedControl<S32> title_vpad("UIFloaterTitleVPad", 0); if( ! mTitleBox) { return; } const LLFontGL* font = LLFontGL::getFontSansSerif(); - S32 title_width = font->getWidth( mTitleBox->getText() ) + TITLE_PAD; + S32 title_width = font->getWidth( mTitleBox->getText() ) + TITLE_HPAD; if (getMaxTitleWidth() > 0) title_width = llmin(title_width, getMaxTitleWidth()); S32 title_height = llround(font->getLineHeight()); LLRect title_rect; title_rect.setLeftTopAndSize( LEFT_PAD, - getRect().getHeight() - BORDER_PAD, + getRect().getHeight() - title_vpad, getRect().getWidth() - LEFT_PAD - RIGHT_PAD, title_height); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 021e2e94ac..8c72b079ee 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -189,11 +189,14 @@ LLFloater::Params::Params() can_close("can_close", true), can_drag_on_left("can_drag_on_left", false), can_tear_off("can_tear_off", true), + save_dock_state("save_dock_state", false), save_rect("save_rect", false), save_visibility("save_visibility", false), + can_dock("can_dock", false), + header_height("header_height", 0), + legacy_header_height("legacy_header_height", 0), open_callback("open_callback"), - close_callback("close_callback"), - can_dock("can_dock", false) + close_callback("close_callback") { visible = false; } @@ -219,7 +222,7 @@ void LLFloater::initClass() static LLWidgetNameRegistry::StaticRegistrar sRegisterFloaterParams(&typeid(LLFloater::Params), "floater"); LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) -: LLPanel(), +: LLPanel(), // intentionally do not pass params here, see initFromParams mDragHandle(NULL), mTitle(p.title), mShortTitle(p.short_title), @@ -233,6 +236,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mResizable(p.can_resize), mMinWidth(p.min_width), mMinHeight(p.min_height), + mHeaderHeight(p.header_height), + mLegacyHeaderHeight(p.legacy_header_height), mMinimized(FALSE), mForeground(FALSE), mFirstLook(TRUE), @@ -263,11 +268,8 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mButtonsEnabled[i] = FALSE; mButtons[i] = NULL; } - for (S32 i = 0; i < 4; i++) - { - mResizeBar[i] = NULL; - mResizeHandle[i] = NULL; - } + addDragHandle(); + addResizeCtrls(); initFromParams(p); @@ -280,10 +282,6 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) // Note: Floaters constructed from XML call init() twice! void LLFloater::initFloater() { - addDragHandle(); - - addResizeCtrls(); - // Close button. if (mCanClose) { @@ -323,9 +321,6 @@ void LLFloater::initFloater() void LLFloater::addDragHandle() { - static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); - S32 close_box_size = mCanClose ? floater_close_box_size : 0; - if (!mDragHandle) { if (mDragOnLeft) @@ -346,6 +341,14 @@ void LLFloater::addDragHandle() } addChild(mDragHandle); } + layoutDragHandle(); +} + +void LLFloater::layoutDragHandle() +{ + static LLUICachedControl<S32> floater_close_box_size ("UIFloaterCloseBoxSize", 0); + S32 close_box_size = mCanClose ? floater_close_box_size : 0; + LLRect rect; if (mDragOnLeft) { @@ -361,40 +364,17 @@ void LLFloater::addDragHandle() } void LLFloater::addResizeCtrls() -{ - for (S32 i = 0; i < 4; i++) - { - if (mResizeBar[i]) - { - removeChild(mResizeBar[i]); - delete mResizeBar[i]; - mResizeBar[i] = NULL; - } - if (mResizeHandle[i]) - { - removeChild(mResizeHandle[i]); - delete mResizeHandle[i]; - mResizeHandle[i] = NULL; - } - } - if( !mResizable ) - { - return; - } - +{ // Resize bars (sides) - const S32 RESIZE_BAR_THICKNESS = 3; LLResizeBar::Params p; p.name("resizebar_left"); p.resizing_view(this); - p.rect(LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0)); p.min_size(mMinWidth); p.side(LLResizeBar::LEFT); mResizeBar[LLResizeBar::LEFT] = LLUICtrlFactory::create<LLResizeBar>(p); addChild( mResizeBar[LLResizeBar::LEFT] ); p.name("resizebar_top"); - p.rect(LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS)); p.min_size(mMinHeight); p.side(LLResizeBar::TOP); @@ -402,15 +382,12 @@ void LLFloater::addResizeCtrls() addChild( mResizeBar[LLResizeBar::TOP] ); p.name("resizebar_right"); - p.rect(LLRect(getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0)); p.min_size(mMinWidth); - p.side(LLResizeBar::RIGHT); - + p.side(LLResizeBar::RIGHT); mResizeBar[LLResizeBar::RIGHT] = LLUICtrlFactory::create<LLResizeBar>(p); addChild( mResizeBar[LLResizeBar::RIGHT] ); p.name("resizebar_bottom"); - p.rect(LLRect(0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0)); p.min_size(mMinHeight); p.side(LLResizeBar::BOTTOM); mResizeBar[LLResizeBar::BOTTOM] = LLUICtrlFactory::create<LLResizeBar>(p); @@ -421,27 +398,69 @@ void LLFloater::addResizeCtrls() // handles must not be mouse-opaque, otherwise they block hover events // to other buttons like the close box. JC handle_p.mouse_opaque(false); - handle_p.rect(LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0)); handle_p.min_width(mMinWidth); handle_p.min_height(mMinHeight); handle_p.corner(LLResizeHandle::RIGHT_BOTTOM); mResizeHandle[0] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); addChild(mResizeHandle[0]); - handle_p.rect(LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT)); handle_p.corner(LLResizeHandle::RIGHT_TOP); mResizeHandle[1] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); addChild(mResizeHandle[1]); - handle_p.rect(LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 )); handle_p.corner(LLResizeHandle::LEFT_BOTTOM); mResizeHandle[2] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); addChild(mResizeHandle[2]); - handle_p.rect(LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT )); handle_p.corner(LLResizeHandle::LEFT_TOP); mResizeHandle[3] = LLUICtrlFactory::create<LLResizeHandle>(handle_p); addChild(mResizeHandle[3]); + + layoutResizeCtrls(); +} + +void LLFloater::layoutResizeCtrls() +{ + LLRect rect; + + // Resize bars (sides) + const S32 RESIZE_BAR_THICKNESS = 3; + rect = LLRect( 0, getRect().getHeight(), RESIZE_BAR_THICKNESS, 0); + mResizeBar[LLResizeBar::LEFT]->setRect(rect); + + rect = LLRect( 0, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_BAR_THICKNESS); + mResizeBar[LLResizeBar::TOP]->setRect(rect); + + rect = LLRect(getRect().getWidth() - RESIZE_BAR_THICKNESS, getRect().getHeight(), getRect().getWidth(), 0); + mResizeBar[LLResizeBar::RIGHT]->setRect(rect); + + rect = LLRect(0, RESIZE_BAR_THICKNESS, getRect().getWidth(), 0); + mResizeBar[LLResizeBar::BOTTOM]->setRect(rect); + + // Resize handles (corners) + rect = LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, RESIZE_HANDLE_HEIGHT, getRect().getWidth(), 0); + mResizeHandle[0]->setRect(rect); + + rect = LLRect( getRect().getWidth() - RESIZE_HANDLE_WIDTH, getRect().getHeight(), getRect().getWidth(), getRect().getHeight() - RESIZE_HANDLE_HEIGHT); + mResizeHandle[1]->setRect(rect); + + rect = LLRect( 0, RESIZE_HANDLE_HEIGHT, RESIZE_HANDLE_WIDTH, 0 ); + mResizeHandle[2]->setRect(rect); + + rect = LLRect( 0, getRect().getHeight(), RESIZE_HANDLE_WIDTH, getRect().getHeight() - RESIZE_HANDLE_HEIGHT ); + mResizeHandle[3]->setRect(rect); +} + +void LLFloater::enableResizeCtrls(bool enable) +{ + for (S32 i = 0; i < 4; ++i) + { + mResizeBar[i]->setVisible(enable); + mResizeBar[i]->setEnabled(enable); + + mResizeHandle[i]->setVisible(enable); + mResizeHandle[i]->setEnabled(enable); + } } // virtual @@ -483,6 +502,7 @@ LLFloater::~LLFloater() storeRectControl(); setVisible(false); // We're not visible if we're destroyed storeVisibilityControl(); + storeDockStateControl(); } void LLFloater::storeRectControl() @@ -501,6 +521,15 @@ void LLFloater::storeVisibilityControl() } } +void LLFloater::storeDockStateControl() +{ + if( !sQuitting && mDocStateControl.size() > 1 ) + { + LLUI::sSettingGroups["floater"]->setBOOL( mDocStateControl, isDocked() ); + } +} + + void LLFloater::setVisible( BOOL visible ) { LLPanel::setVisible(visible); // calls handleVisibilityChange() @@ -759,6 +788,16 @@ void LLFloater::applyRectControl() } } +void LLFloater::applyDockState() +{ + if (mDocStateControl.size() > 1) + { + bool dockState = LLUI::sSettingGroups["floater"]->getBOOL(mDocStateControl); + setDocked(dockState); + } + +} + void LLFloater::applyTitle() { if (!mDragHandle) @@ -909,7 +948,8 @@ void LLFloater::handleReshape(const LLRect& new_rect, bool by_user) void LLFloater::setMinimized(BOOL minimize) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& default_params = LLFloater::getDefaultParams(); + S32 floater_header_size = default_params.header_height; static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0); if (minimize == mMinimized) return; @@ -1082,7 +1122,8 @@ void LLFloater::setFocus( BOOL b ) void LLFloater::setRect(const LLRect &rect) { LLPanel::setRect(rect); - addDragHandle(); // re-add drag handle, sized based on rect + layoutDragHandle(); + layoutResizeCtrls(); } // virtual @@ -1376,7 +1417,10 @@ void LLFloater::setDocked(bool docked, bool pop_on_undock) mButtonsEnabled[BUTTON_DOCK] = !mDocked; mButtonsEnabled[BUTTON_UNDOCK] = mDocked; updateButtons(); + + storeDockStateControl(); } + } // static @@ -1389,9 +1433,9 @@ void LLFloater::onClickMinimize(LLFloater* self) void LLFloater::onClickTearOff(LLFloater* self) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); if (!self) return; + S32 floater_header_size = self->mHeaderHeight; LLMultiFloater* host_floater = self->getHost(); if (host_floater) //Tear off { @@ -1548,26 +1592,42 @@ void LLFloater::draw() shadow_color % alpha, llround(shadow_offset)); - // No transparent windows in simple UI + LLUIImage* image = NULL; + LLColor4 color; if (isBackgroundOpaque()) { - gl_rect_2d( left, top, right, bottom, getBackgroundColor() % alpha ); + // NOTE: image may not be set + image = getBackgroundImage(); + color = getBackgroundColor(); } else { - gl_rect_2d( left, top, right, bottom, getTransparentColor() % alpha ); + image = getTransparentImage(); + color = getTransparentColor(); } - if(hasFocus() - && !getIsChrome() - && !getCurrentTitle().empty()) + if (image) + { + // We're using images for this floater's backgrounds + image->draw(getLocalRect(), UI_VERTEX_COLOR % alpha); + } + else { - static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor"); + // We're not using images, use old-school flat colors + gl_rect_2d( left, top, right, bottom, color % alpha ); + // draw highlight on title bar to indicate focus. RDW - const LLFontGL* font = LLFontGL::getFontSansSerif(); - LLRect r = getRect(); - gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, - titlebar_focus_color % alpha, 0, TRUE); + if(hasFocus() + && !getIsChrome() + && !getCurrentTitle().empty()) + { + static LLUIColor titlebar_focus_color = LLUIColorTable::instance().getColor("TitleBarFocusColor"); + + const LLFontGL* font = LLFontGL::getFontSansSerif(); + LLRect r = getRect(); + gl_rect_2d_offset_local(0, r.getHeight(), r.getWidth(), r.getHeight() - (S32)font->getLineHeight() - 1, + titlebar_focus_color % alpha, 0, TRUE); + } } } @@ -1617,18 +1677,6 @@ void LLFloater::draw() drawChild(focused_child); } - if( isBackgroundVisible() ) - { - // add in a border to improve spacialized visual aclarity ;) - // use lines instead of gl_rect_2d so we can round the edges as per james' recommendation - static LLUIColor focus_border_color = LLUIColorTable::instance().getColor("FloaterFocusBorderColor"); - static LLUIColor unfocus_border_color = LLUIColorTable::instance().getColor("FloaterUnfocusBorderColor"); - LLUI::setLineWidth(1.5f); - LLColor4 outlineColor = gFocusMgr.childHasKeyboardFocus(this) ? focus_border_color : unfocus_border_color; - gl_rect_2d_offset_local(0, getRect().getHeight() + 1, getRect().getWidth() + 1, 0, outlineColor % alpha, -LLPANEL_BORDER_WIDTH, FALSE); - LLUI::setLineWidth(1.f); - } - // update tearoff button for torn off floaters // when last host goes away if (mCanTearOff && !getHost()) @@ -1677,7 +1725,7 @@ void LLFloater::setCanTearOff(BOOL can_tear_off) void LLFloater::setCanResize(BOOL can_resize) { mResizable = can_resize; - addResizeCtrls(); + enableResizeCtrls(can_resize); } void LLFloater::setCanDrag(BOOL can_drag) @@ -2113,7 +2161,8 @@ void LLFloaterView::focusFrontFloater() void LLFloaterView::getMinimizePosition(S32 *left, S32 *bottom) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& default_params = LLFloater::getDefaultParams(); + S32 floater_header_size = default_params.header_height; static LLUICachedControl<S32> minimized_width ("UIMinimizedWidth", 0); S32 col = 0; LLRect snap_rect_local = getLocalSnapRect(); @@ -2488,6 +2537,11 @@ void LLFloater::setInstanceName(const std::string& name) { mVisibilityControl = LLFloaterReg::declareVisibilityControl(mInstanceName); } + if(!mDocStateControl.empty()) + { + mDocStateControl = LLFloaterReg::declareDockStateControl(mInstanceName); + } + } } @@ -2528,6 +2582,9 @@ void LLFloater::setupParamsForExport(Params& p, LLView* parent) void LLFloater::initFromParams(const LLFloater::Params& p) { + // *NOTE: We have too many classes derived from LLFloater to retrofit them + // all to pass in params via constructors. So we use this method. + // control_name, tab_stop, focus_lost_callback, initial_value, rect, enabled, visible LLPanel::initFromParams(p); @@ -2539,11 +2596,12 @@ void LLFloater::initFromParams(const LLFloater::Params& p) setCanMinimize(p.can_minimize); setCanClose(p.can_close); setCanDock(p.can_dock); + setCanResize(p.can_resize); + setResizeLimits(p.min_width, p.min_height); mDragOnLeft = p.can_drag_on_left; - mResizable = p.can_resize; - mMinWidth = p.min_width; - mMinHeight = p.min_height; + mHeaderHeight = p.header_height; + mLegacyHeaderHeight = p.legacy_header_height; mSingleInstance = p.single_instance; mAutoTile = p.auto_tile; @@ -2555,6 +2613,11 @@ void LLFloater::initFromParams(const LLFloater::Params& p) { mVisibilityControl = "t"; // flag to build mVisibilityControl name once mInstanceName is set } + + if(p.save_dock_state) + { + mDocStateControl = "t"; // flag to build mDocStateControl name once mInstanceName is set + } // open callback if (p.open_callback.isProvided()) @@ -2599,6 +2662,23 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o LLFloater::setFloaterHost(last_host); } + // HACK: When we changed the header height to 25 pixels in Viewer 2, rather + // than re-layout all the floaters we use this value in pixels to make the + // whole floater bigger and change the top-left coordinate for widgets. + // The goal is to eventually set mLegacyHeaderHeight to zero, which would + // make the top-left corner for widget layout the same as the top-left + // corner of the window's content area. James + S32 header_stretch = (mHeaderHeight - mLegacyHeaderHeight); + if (header_stretch > 0) + { + // Stretch the floater vertically, don't move widgets + LLRect rect = getRect(); + rect.mTop += header_stretch; + + // This will also update drag handle, title bar, close box, etc. + setRect(rect); + } + BOOL result; { LLFastTimer ft(POST_BUILD); @@ -2616,6 +2696,8 @@ bool LLFloater::initFloaterXML(LLXMLNodePtr node, LLView *parent, LLXMLNodePtr o moveResizeHandlesToFront(); + applyDockState(); + return true; // *TODO: Error checking } diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 2fdaecf59a..ef0d06a58e 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -124,7 +124,10 @@ public: can_tear_off, save_rect, save_visibility, + save_dock_state, can_dock; + Optional<S32> header_height, + legacy_header_height; // HACK see initFromXML() Optional<CommitCallbackParam> open_callback, close_callback; @@ -209,6 +212,7 @@ public: bool isDragOnLeft() const{ return mDragOnLeft; } S32 getMinWidth() const{ return mMinWidth; } S32 getMinHeight() const{ return mMinHeight; } + S32 getHeaderHeight() const { return mHeaderHeight; } virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); @@ -277,8 +281,10 @@ protected: void setRectControl(const std::string& rectname) { mRectControl = rectname; }; void applyRectControl(); + void applyDockState(); void storeRectControl(); void storeVisibilityControl(); + void storeDockStateControl(); void setKey(const LLSD& key); void setInstanceName(const std::string& name); @@ -302,7 +308,10 @@ private: void buildButtons(); BOOL offerClickToButton(S32 x, S32 y, MASK mask, EFloaterButtons index); void addResizeCtrls(); + void layoutResizeCtrls(); + void enableResizeCtrls(bool enable); void addDragHandle(); + void layoutDragHandle(); // repair layout public: // Called when floater is opened, passes mKey @@ -316,6 +325,7 @@ public: protected: std::string mRectControl; std::string mVisibilityControl; + std::string mDocStateControl; LLSD mKey; // Key used for retrieving instances; set (for now) by LLFLoaterReg LLDragHandle* mDragHandle; @@ -340,6 +350,8 @@ private: S32 mMinWidth; S32 mMinHeight; + S32 mHeaderHeight; // height in pixels of header for title, drag bar + S32 mLegacyHeaderHeight;// HACK see initFloaterXML() BOOL mMinimized; BOOL mForeground; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 3c5a8a6921..aca4dc56ee 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -127,7 +127,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) bool success = LLUICtrlFactory::getInstance()->buildFloater(res, xui_file, NULL); if (!success) { - llwarns << "Failed to buid floater type: '" << name << "'." << llendl; + llwarns << "Failed to build floater type: '" << name << "'." << llendl; return NULL; } @@ -135,6 +135,7 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) res->mKey = key; res->setInstanceName(name); res->applyRectControl(); // Can't apply rect control until setting instance name + res->applyDockState();//same... if (res->mAutoTile && !res->getHost() && index > 0) { const LLRect& cur_rect = res->getRect(); @@ -364,6 +365,26 @@ std::string LLFloaterReg::declareVisibilityControl(const std::string& name) } //static +std::string LLFloaterReg::declareDockStateControl(const std::string& name) +{ + std::string controlname = getDockStateControlName(name); + LLUI::sSettingGroups["floater"]->declareBOOL(controlname, FALSE, + llformat("Window Docking state for %s", name.c_str()), + TRUE); + return controlname; + +} + +//static +std::string LLFloaterReg::getDockStateControlName(const std::string& name) +{ + std::string res = std::string("floater_dock_") + name; + LLStringUtil::replaceChar( res, ' ', '_' ); + return res; +} + + +//static void LLFloaterReg::registerControlVariables() { // Iterate through alll registered instance names and register rect and visibility control variables diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 451bd1dbe3..634a235926 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -121,6 +121,10 @@ public: static std::string declareRectControl(const std::string& name); static std::string getVisibilityControlName(const std::string& name); static std::string declareVisibilityControl(const std::string& name); + + static std::string declareDockStateControl(const std::string& name); + static std::string getDockStateControlName(const std::string& name); + static void registerControlVariables(); // Callback wrappers diff --git a/indra/llui/lliconctrl.cpp b/indra/llui/lliconctrl.cpp index 66c2ba682f..1e2353b488 100644 --- a/indra/llui/lliconctrl.cpp +++ b/indra/llui/lliconctrl.cpp @@ -57,7 +57,9 @@ LLIconCtrl::LLIconCtrl(const LLIconCtrl::Params& p) : LLUICtrl(p), mColor(p.color()), mImagep(p.image), - mPriority(0) + mPriority(0), + mDrawWidth(0), + mDrawHeight(0) { if (mImagep.notNull()) { @@ -100,6 +102,8 @@ void LLIconCtrl::setValue(const LLSD& value ) { mImagep = LLUI::getUIImage(tvalue.asString(), mPriority); } + + setIconImageDrawSize(); } std::string LLIconCtrl::getImageName() const @@ -109,3 +113,16 @@ std::string LLIconCtrl::getImageName() const else return std::string(); } + +void LLIconCtrl::setIconImageDrawSize() +{ + if(mImagep.notNull() && mDrawWidth && mDrawHeight) + { + if(mImagep->getImage().notNull()) + { + mImagep->getImage()->setKnownDrawSize(mDrawWidth, mDrawHeight) ; + } + } +} + + diff --git a/indra/llui/lliconctrl.h b/indra/llui/lliconctrl.h index 90f1693060..66368f979b 100644 --- a/indra/llui/lliconctrl.h +++ b/indra/llui/lliconctrl.h @@ -60,6 +60,7 @@ public: protected: LLIconCtrl(const Params&); friend class LLUICtrlFactory; + public: virtual ~LLIconCtrl(); @@ -73,9 +74,16 @@ public: void setColor(const LLColor4& color) { mColor = color; } +private: + void setIconImageDrawSize() ; + protected: S32 mPriority; + //the output size of the icon image if set. + S32 mDrawWidth ; + S32 mDrawHeight ; + private: LLUIColor mColor; LLPointer<LLUIImage> mImagep; diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index e053477d58..75905d0927 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1544,18 +1544,24 @@ void LLLineEditor::drawBackground() image = mBgImage; } + F32 alpha = getDrawContext().mAlpha; // optionally draw programmatic border if (has_focus) { + LLColor4 tmp_color = gFocusMgr.getFocusColor(); + tmp_color.setAlpha(alpha); image->drawBorder(0, 0, getRect().getWidth(), getRect().getHeight(), - gFocusMgr.getFocusColor(), + tmp_color, gFocusMgr.getFocusFlashWidth()); } - image->draw(getLocalRect()); + LLColor4 tmp_color = UI_VERTEX_COLOR; + tmp_color.setAlpha(alpha); + image->draw(getLocalRect(), tmp_color); } void LLLineEditor::draw() { + F32 alpha = getDrawContext().mAlpha; S32 text_len = mText.length(); static LLUICachedControl<S32> lineeditor_cursor_thickness ("UILineEditorCursorThickness", 0); static LLUICachedControl<S32> lineeditor_v_pad ("UILineEditorVPad", 0); @@ -1608,8 +1614,10 @@ void LLLineEditor::draw() { text_color = mReadOnlyFgColor.get(); } + text_color.setAlpha(alpha); LLColor4 label_color = mTentativeFgColor.get(); - + label_color.setAlpha(alpha); + if (hasPreeditString()) { // Draw preedit markers. This needs to be before drawing letters. @@ -1632,7 +1640,7 @@ void LLLineEditor::draw() preedit_pixels_right - preedit_standout_gap - 1, background.mBottom + preedit_standout_position - preedit_standout_thickness, (text_color * preedit_standout_brightness - + mPreeditBgColor * (1 - preedit_standout_brightness)).setAlpha(1.0f)); + + mPreeditBgColor * (1 - preedit_standout_brightness)).setAlpha(alpha/*1.0f*/)); } else { @@ -1641,7 +1649,7 @@ void LLLineEditor::draw() preedit_pixels_right - preedit_marker_gap - 1, background.mBottom + preedit_marker_position - preedit_marker_thickness, (text_color * preedit_marker_brightness - + mPreeditBgColor * (1 - preedit_marker_brightness)).setAlpha(1.0f)); + + mPreeditBgColor * (1 - preedit_marker_brightness)).setAlpha(alpha/*1.0f*/)); } } } @@ -1684,15 +1692,17 @@ void LLLineEditor::draw() if( (rendered_pixels_right < (F32)mMaxHPixels) && (rendered_text < text_len) ) { LLColor4 color = mHighlightColor; + color.setAlpha(alpha); // selected middle S32 width = mGLFont->getWidth(mText.getWString().c_str(), mScrollHPos + rendered_text, select_right - mScrollHPos - rendered_text); width = llmin(width, mMaxHPixels - llround(rendered_pixels_right)); gl_rect_2d(llround(rendered_pixels_right), cursor_top, llround(rendered_pixels_right)+width, cursor_bottom, color); + LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); rendered_text += mGLFont->render( mText, mScrollHPos + rendered_text, rendered_pixels_right, text_bottom, - LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ), + tmp_color, LLFontGL::LEFT, LLFontGL::BOTTOM, 0, LLFontGL::NO_SHADOW, @@ -1758,8 +1768,9 @@ void LLLineEditor::draw() cursor_right, cursor_bottom, text_color); if (LL_KIM_OVERWRITE == gKeyboard->getInsertMode() && !hasSelection()) { + LLColor4 tmp_color( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], alpha ); mGLFont->render(mText, getCursor(), (F32)(cursor_left + lineeditor_cursor_thickness / 2), text_bottom, - LLColor4( 1.f - text_color.mV[0], 1.f - text_color.mV[1], 1.f - text_color.mV[2], 1 ), + tmp_color, LLFontGL::LEFT, LLFontGL::BOTTOM, 0, LLFontGL::NO_SHADOW, diff --git a/indra/llui/llmenubutton.cpp b/indra/llui/llmenubutton.cpp index 8dbcd6e229..a657ed039a 100644 --- a/indra/llui/llmenubutton.cpp +++ b/indra/llui/llmenubutton.cpp @@ -85,6 +85,8 @@ void LLMenuButton::toggleMenu() void LLMenuButton::hideMenu() { + if(!mMenu) + return; mMenu->setVisible(FALSE); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index cf013efca0..91e7e46195 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -2894,8 +2894,8 @@ void hide_top_view( LLView* view ) } -// x and y are the desired location for the popup, NOT necessarily the -// mouse location +// x and y are the desired location for the popup, in the spawning_view's +// coordinate frame, NOT necessarily the mouse location // static void LLMenuGL::showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y) { @@ -3435,7 +3435,7 @@ void LLMenuHolderGL::setActivatedItem(LLMenuItemGL* item) LLTearOffMenu::LLTearOffMenu(LLMenuGL* menup) : LLFloater(LLSD()) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + S32 floater_header_size = getHeaderHeight(); setName(menup->getName()); setTitle(menup->getLabel()); @@ -3479,7 +3479,6 @@ LLTearOffMenu::~LLTearOffMenu() void LLTearOffMenu::draw() { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); mMenu->setBackgroundVisible(isBackgroundOpaque()); mMenu->needsArrange(); diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 48887ec352..09d9e407c7 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -505,7 +505,7 @@ public: void buildDrawLabels(); void createJumpKeys(); - // Show popup at a specific location. + // Show popup at a specific location, in the spawn_view's coordinate frame static void showPopup(LLView* spawning_view, LLMenuGL* menu, S32 x, S32 y); // Whether to drop shadow menu bar diff --git a/indra/llui/llmultifloater.cpp b/indra/llui/llmultifloater.cpp index e8ce1a8d97..78738c826d 100644 --- a/indra/llui/llmultifloater.cpp +++ b/indra/llui/llmultifloater.cpp @@ -54,7 +54,8 @@ LLMultiFloater::LLMultiFloater(const LLSD& key, const LLFloater::Params& params) void LLMultiFloater::buildTabContainer() { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& default_params = LLFloater::getDefaultParams(); + S32 floater_header_size = default_params.header_height; LLTabContainer::Params p; p.name(std::string("Preview Tabs")); @@ -131,7 +132,8 @@ BOOL LLMultiFloater::closeAllFloaters() void LLMultiFloater::growToFit(S32 content_width, S32 content_height) { static LLUICachedControl<S32> tabcntr_close_btn_size ("UITabCntrCloseBtnSize", 0); - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& default_params = LLFloater::getDefaultParams(); + S32 floater_header_size = default_params.header_height; S32 tabcntr_header_height = LLPANEL_BORDER_WIDTH + tabcntr_close_btn_size; S32 new_width = llmax(getRect().getWidth(), content_width + LLPANEL_BORDER_WIDTH * 2); S32 new_height = llmax(getRect().getHeight(), content_height + floater_header_size + tabcntr_header_height); @@ -432,6 +434,7 @@ void LLMultiFloater::onTabSelected() void LLMultiFloater::setCanResize(BOOL can_resize) { LLFloater::setCanResize(can_resize); + if (!mTabContainer) return; if (isResizable() && mTabContainer->getTabPosition() == LLTabContainer::BOTTOM) { mTabContainer->setRightTabBtnOffset(RESIZE_HANDLE_WIDTH); @@ -455,13 +458,16 @@ BOOL LLMultiFloater::postBuild() } mTabContainer = getChild<LLTabContainer>("Preview Tabs"); + + setCanResize(mResizable); return TRUE; } void LLMultiFloater::updateResizeLimits() { static LLUICachedControl<S32> tabcntr_close_btn_size ("UITabCntrCloseBtnSize", 0); - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& default_params = LLFloater::getDefaultParams(); + S32 floater_header_size = default_params.header_height; S32 tabcntr_header_height = LLPANEL_BORDER_WIDTH + tabcntr_close_btn_size; // initialize minimum size constraint to the original xml values. S32 new_min_width = mOrigMinWidth; diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 095200ddc3..07c0f3ce84 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -71,10 +71,12 @@ const LLPanel::Params& LLPanel::getDefaultParams() LLPanel::Params::Params() : has_border("border", false), border(""), - bg_opaque_color("bg_opaque_color"), - bg_alpha_color("bg_alpha_color"), background_visible("background_visible", false), background_opaque("background_opaque", false), + bg_opaque_color("bg_opaque_color"), + bg_alpha_color("bg_alpha_color"), + bg_opaque_image("bg_opaque_image"), + bg_alpha_image("bg_alpha_image"), min_width("min_width", 100), min_height("min_height", 100), strings("string"), @@ -92,10 +94,12 @@ LLPanel::Params::Params() LLPanel::LLPanel(const LLPanel::Params& p) : LLUICtrl(p), - mBgColorAlpha(p.bg_alpha_color()), - mBgColorOpaque(p.bg_opaque_color()), mBgVisible(p.background_visible), mBgOpaque(p.background_opaque), + mBgOpaqueColor(p.bg_opaque_color()), + mBgAlphaColor(p.bg_alpha_color()), + mBgOpaqueImage(p.bg_opaque_image()), + mBgAlphaImage(p.bg_alpha_image()), mDefaultBtn(NULL), mBorder(NULL), mLabel(p.label), @@ -103,9 +107,9 @@ LLPanel::LLPanel(const LLPanel::Params& p) mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename) + // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too + // many classes derived from LLPanel to retrofit them all to pass in params. { - setIsChrome(FALSE); - if (p.has_border) { addBorder(p.border); @@ -178,19 +182,31 @@ void LLPanel::draw() // draw background if( mBgVisible ) { - //RN: I don't see the point of this - S32 left = 0;//LLPANEL_BORDER_WIDTH; - S32 top = getRect().getHeight();// - LLPANEL_BORDER_WIDTH; - S32 right = getRect().getWidth();// - LLPANEL_BORDER_WIDTH; - S32 bottom = 0;//LLPANEL_BORDER_WIDTH; - + LLRect local_rect = getLocalRect(); if (mBgOpaque ) { - gl_rect_2d( left, top, right, bottom, mBgColorOpaque.get() % alpha); + // opaque, in-front look + if (mBgOpaqueImage.notNull()) + { + mBgOpaqueImage->draw( local_rect, UI_VERTEX_COLOR % alpha ); + } + else + { + // fallback to flat colors when there are no images + gl_rect_2d( local_rect, mBgOpaqueColor.get() % alpha); + } } else { - gl_rect_2d( left, top, right, bottom, mBgColorAlpha.get() % alpha); + // transparent, in-back look + if (mBgAlphaImage.notNull()) + { + mBgAlphaImage->draw( local_rect, UI_VERTEX_COLOR % alpha ); + } + else + { + gl_rect_2d( local_rect, mBgAlphaColor.get() % alpha ); + } } } @@ -443,7 +459,8 @@ void LLPanel::initFromParams(const LLPanel::Params& p) setBackgroundOpaque(p.background_opaque); setBackgroundColor(p.bg_opaque_color().get()); setTransparentColor(p.bg_alpha_color().get()); - + mBgOpaqueImage = p.bg_opaque_image(); + mBgAlphaImage = p.bg_alpha_image(); } static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index e8db68ffbb..c213809d68 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -48,6 +48,7 @@ const BOOL BORDER_YES = TRUE; const BOOL BORDER_NO = FALSE; class LLButton; +class LLUIImage; /* * General purpose concrete view base class. @@ -72,12 +73,15 @@ public: Optional<bool> has_border; Optional<LLViewBorder::Params> border; - Optional<LLUIColor> bg_opaque_color, - bg_alpha_color; - Optional<bool> background_visible, background_opaque; + Optional<LLUIColor> bg_opaque_color, + bg_alpha_color; + // opaque image is for "panel in foreground" look + Optional<LLUIImage*> bg_opaque_image, + bg_alpha_image; + Optional<S32> min_width, min_height; @@ -127,10 +131,12 @@ public: BOOL hasBorder() const { return mBorder != NULL; } void setBorderVisible( BOOL b ); - void setBackgroundColor( const LLColor4& color ) { mBgColorOpaque = color; } - const LLColor4& getBackgroundColor() const { return mBgColorOpaque; } - void setTransparentColor(const LLColor4& color) { mBgColorAlpha = color; } - const LLColor4& getTransparentColor() const { return mBgColorAlpha; } + void setBackgroundColor( const LLColor4& color ) { mBgOpaqueColor = color; } + const LLColor4& getBackgroundColor() const { return mBgOpaqueColor; } + void setTransparentColor(const LLColor4& color) { mBgAlphaColor = color; } + const LLColor4& getTransparentColor() const { return mBgAlphaColor; } + LLPointer<LLUIImage> getBackgroundImage() const { return mBgOpaqueImage; } + LLPointer<LLUIImage> getTransparentImage() const { return mBgAlphaImage; } void setBackgroundVisible( BOOL b ) { mBgVisible = b; } BOOL isBackgroundVisible() const { return mBgVisible; } void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } @@ -248,10 +254,12 @@ protected: std::string mHelpTopic; // the name of this panel's help topic to display in the Help Viewer private: - LLUIColor mBgColorAlpha; - LLUIColor mBgColorOpaque; - BOOL mBgVisible; - BOOL mBgOpaque; + BOOL mBgVisible; // any background at all? + BOOL mBgOpaque; // use opaque color or image + LLUIColor mBgOpaqueColor; + LLUIColor mBgAlphaColor; + LLPointer<LLUIImage> mBgOpaqueImage; // "panel in front" look + LLPointer<LLUIImage> mBgAlphaImage; // "panel in back" look LLViewBorder* mBorder; LLButton* mDefaultBtn; LLUIString mLabel; diff --git a/indra/llui/llradiogroup.cpp b/indra/llui/llradiogroup.cpp index f9f0307d17..86bd2f05ce 100644 --- a/indra/llui/llradiogroup.cpp +++ b/indra/llui/llradiogroup.cpp @@ -106,7 +106,7 @@ void LLRadioGroup::setIndexEnabled(S32 index, BOOL enabled) child->setEnabled(enabled); if (index == mSelectedIndex && enabled == FALSE) { - mSelectedIndex = -1; + setSelectedIndex(-1); } break; } diff --git a/indra/llui/llscrollcontainer.cpp b/indra/llui/llscrollcontainer.cpp index d8606c6889..5e17372fe9 100644 --- a/indra/llui/llscrollcontainer.cpp +++ b/indra/llui/llscrollcontainer.cpp @@ -432,7 +432,7 @@ void LLScrollContainer::draw() LLLocalClipRect clip(LLRect(mInnerRect.mLeft, mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) + visible_height, - visible_width, + mInnerRect.mRight - (show_v_scrollbar ? scrollbar_size: 0), mInnerRect.mBottom + (show_h_scrollbar ? scrollbar_size : 0) )); drawChild(mScrolledView); diff --git a/indra/llui/llscrolllistcolumn.cpp b/indra/llui/llscrolllistcolumn.cpp index 073e14386f..ba53f84877 100644 --- a/indra/llui/llscrolllistcolumn.cpp +++ b/indra/llui/llscrolllistcolumn.cpp @@ -47,6 +47,21 @@ const S32 MIN_COLUMN_WIDTH = 20; //--------------------------------------------------------------------------- // LLScrollColumnHeader //--------------------------------------------------------------------------- +LLScrollColumnHeader::Params::Params() +: column("column") +{ + name = "column_header"; + image_unselected.name("square_btn_32x128.tga"); + image_selected.name("square_btn_selected_32x128.tga"); + image_disabled.name("square_btn_32x128.tga"); + image_disabled_selected.name("square_btn_selected_32x128.tga"); + image_overlay.name("combobox_arrow.tga"); + image_overlay_alignment("right"); + font_halign = LLFontGL::LEFT; + tab_stop(false); + scale_image(true); +} + LLScrollColumnHeader::LLScrollColumnHeader(const LLScrollColumnHeader::Params& p) : LLButton(p), // use combobox params to steal images diff --git a/indra/llui/llscrolllistcolumn.h b/indra/llui/llscrolllistcolumn.h index 23318fd7c4..5aef6e8e94 100644 --- a/indra/llui/llscrolllistcolumn.h +++ b/indra/llui/llscrolllistcolumn.h @@ -50,20 +50,7 @@ public: { Mandatory<LLScrollListColumn*> column; - Params() - : column("column") - { - name = "column_header"; - image_unselected.name("square_btn_32x128.tga"); - image_selected.name("square_btn_selected_32x128.tga"); - image_disabled.name("square_btn_32x128.tga"); - image_disabled_selected.name("square_btn_selected_32x128.tga"); - image_overlay.name("combobox_arrow.tga"); - image_overlay_alignment("right"); - font_halign = LLFontGL::LEFT; - tab_stop(false); - scale_image(true); - } + Params(); }; LLScrollColumnHeader(const Params&); ~LLScrollColumnHeader(); diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp index 732c01614b..cde4c75518 100644 --- a/indra/llui/lltabcontainer.cpp +++ b/indra/llui/lltabcontainer.cpp @@ -44,6 +44,7 @@ #include "lluictrlfactory.h" #include "llrender.h" #include "llfloater.h" +#include "lltrans.h" //---------------------------------------------------------------------------- @@ -153,6 +154,8 @@ LLTabContainer::LLTabContainer(const LLTabContainer::Params& p) mRightTabBtnOffset(p.tab_padding_right), mTotalTabWidth(0), mTabPosition(p.tab_position), + mFontHalign(p.font_halign), + mFont(p.font.isProvided() ? p.font() : (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall())), mFirstTabParams(p.first_tab), mMiddleTabParams(p.middle_tab), mLastTabParams(p.last_tab) @@ -401,12 +404,6 @@ void LLTabContainer::draw() } } } - LLUI::pushMatrix(); - { - LLUI::translate((F32)tuple->mButton->getRect().mLeft, (F32)tuple->mButton->getRect().mBottom, 0.f); - tuple->mButton->draw(); - } - LLUI::popMatrix(); idx++; } @@ -641,12 +638,6 @@ BOOL LLTabContainer::handleToolTip( S32 x, S32 y, MASK mask) } } } - - for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter) - { - LLTabTuple* tuple = *iter; - tuple->mButton->setVisible( FALSE ); - } } return handled; } @@ -836,8 +827,6 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // already a child of mine return; } - const LLFontGL* font = - (mIsVertical ? LLFontGL::getFontSansSerif() : LLFontGL::getFontSansSerifSmall()); // Store the original label for possible xml export. child->setLabel(label); @@ -847,7 +836,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) S32 button_width = mMinTabWidth; if (!mIsVertical) { - button_width = llclamp(font->getWidth(trimmed_label) + tab_padding, mMinTabWidth, mMaxTabWidth); + button_width = llclamp(mFont->getWidth(trimmed_label) + tab_padding, mMinTabWidth, mMaxTabWidth); } // Tab panel @@ -934,7 +923,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) params.name(trimmed_label); params.rect(btn_rect); params.initial_value(trimmed_label); - params.font(font); + params.font(mFont); textbox = LLUICtrlFactory::create<LLTextBox> (params); LLButton::Params p; @@ -950,12 +939,12 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) p.rect(btn_rect); p.follows.flags(FOLLOWS_TOP | FOLLOWS_LEFT); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); - p.font(font); + p.font(mFont); p.label(trimmed_label); p.image_unselected(mMiddleTabParams.tab_left_image_unselected); p.image_selected(mMiddleTabParams.tab_left_image_selected); p.scale_image(true); - p.font_halign = LLFontGL::LEFT; + p.font_halign = mFontHalign; p.tab_stop(false); if (indent) { @@ -965,18 +954,13 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) } else { - std::string tooltip = trimmed_label; - tooltip += "\nAlt-Left arrow for previous tab"; - tooltip += "\nAlt-Right arrow for next tab"; - LLButton::Params p; p.name(std::string(child->getName()) + " tab"); p.rect(btn_rect); p.click_callback.function(boost::bind(&LLTabContainer::onTabBtn, this, _2, child)); - p.font(font); + p.font(mFont); p.label(trimmed_label); p.visible(false); - p.tool_tip(tooltip); p.scale_image(true); p.image_unselected(tab_img); p.image_selected(tab_selected_img); @@ -984,7 +968,7 @@ void LLTabContainer::addTabPanel(const TabPanelParams& panel) // Try to squeeze in a bit more text p.pad_left(4); p.pad_right(2); - p.font_halign = LLFontGL::LEFT; + p.font_halign = mFontHalign; p.follows.flags = FOLLOWS_LEFT; p.follows.flags = FOLLOWS_LEFT; @@ -1505,7 +1489,6 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L if (!mIsVertical) { - const LLFontGL* fontp = LLFontGL::getFontSansSerifSmall(); // remove current width from total tab strip width mTotalTabWidth -= tuple->mButton->getRect().getWidth(); @@ -1516,7 +1499,7 @@ void LLTabContainer::setTabImage(LLPanel* child, std::string image_name, const L tuple->mPadding = image_overlay_width; tuple->mButton->setRightHPad(6); - tuple->mButton->reshape(llclamp(fontp->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), + tuple->mButton->reshape(llclamp(mFont->getWidth(tuple->mButton->getLabelSelected()) + tab_padding + tuple->mPadding, mMinTabWidth, mMaxTabWidth), tuple->mButton->getRect().getHeight()); // add back in button width to total tab strip width mTotalTabWidth += tuple->mButton->getRect().getWidth(); diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h index a81974cd42..be9c6c7d06 100644 --- a/indra/llui/lltabcontainer.h +++ b/indra/llui/lltabcontainer.h @@ -262,6 +262,9 @@ private: S32 mTabHeight; LLFrameTimer mDragAndDropDelayTimer; + + LLFontGL::HAlign mFontHalign; + const LLFontGL* mFont; TabParams mFirstTabParams; TabParams mMiddleTabParams; diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 22cce755b0..9a26f0b472 100644 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -232,7 +232,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) createDefaultSegment(); - updateTextRect(); + updateRects(); } LLTextBase::~LLTextBase() @@ -419,9 +419,6 @@ void LLTextBase::drawCursor() return; } - if (!mTextRect.contains(cursor_rect)) - return; - // Draw the cursor // (Flash the cursor every half second starting a fixed time after the last keystroke) F32 elapsed = mCursorBlinkTimer.getElapsedTimeF32(); @@ -538,10 +535,6 @@ void LLTextBase::drawText() next_start = getLineStart(cur_line + 1); line_end = next_start; } - if ( text[line_end-1] == '\n' ) - { - --line_end; - } LLRect text_rect(line.mRect.mLeft + mTextRect.mLeft - scrolled_view_rect.mLeft, line.mRect.mTop - scrolled_view_rect.mBottom + mTextRect.mBottom, @@ -940,13 +933,16 @@ BOOL LLTextBase::handleToolTip(S32 x, S32 y, MASK mask) void LLTextBase::reshape(S32 width, S32 height, BOOL called_from_parent) { - LLUICtrl::reshape( width, height, called_from_parent ); + if (width != getRect().getWidth() || height != getRect().getHeight()) + { + LLUICtrl::reshape( width, height, called_from_parent ); - // do this first after reshape, because other things depend on - // up-to-date mTextRect - updateTextRect(); - - needsReflow(); + // do this first after reshape, because other things depend on + // up-to-date mTextRect + updateRects(); + + needsReflow(); + } } void LLTextBase::draw() @@ -957,17 +953,27 @@ void LLTextBase::draw() // then update scroll position, as cursor may have moved updateScrollFromCursor(); + LLRect doc_rect; + if (mScroller) + { + mScroller->localRectToOtherView(mScroller->getContentWindowRect(), &doc_rect, this); + } + else + { + doc_rect = getLocalRect(); + } + if (mBGVisible) { // clip background rect against extents, if we support scrolling - LLLocalClipRect clip(getLocalRect(), mScroller != NULL); + LLLocalClipRect clip(doc_rect, mScroller != NULL); LLColor4 bg_color = mReadOnly ? mReadOnlyBgColor.get() : hasFocus() ? mFocusBgColor.get() : mWriteableBgColor.get(); - gl_rect_2d(mDocumentView->getRect(), bg_color, TRUE); + gl_rect_2d(mTextRect, bg_color, TRUE); } // draw document view @@ -975,7 +981,7 @@ void LLTextBase::draw() { // only clip if we support scrolling (mScroller != NULL) - LLLocalClipRect clip(mTextRect, mScroller != NULL); + LLLocalClipRect clip(doc_rect, mScroller != NULL); drawSelectionBackground(); drawText(); drawCursor(); @@ -1028,13 +1034,13 @@ S32 LLTextBase::getLeftOffset(S32 width) switch (mHAlign) { case LLFontGL::LEFT: - return 0; + return mHPad; case LLFontGL::HCENTER: - return (mTextRect.getWidth() - width) / 2; + return mHPad + (mTextRect.getWidth() - width - mHPad) / 2; case LLFontGL::RIGHT: return mTextRect.getWidth() - width; default: - return 0; + return mHPad; } } @@ -1042,8 +1048,6 @@ S32 LLTextBase::getLeftOffset(S32 width) static LLFastTimer::DeclareTimer FTM_TEXT_REFLOW ("Text Reflow"); void LLTextBase::reflow(S32 start_index) { - if (!mReflowNeeded) return; - LLFastTimer ft(FTM_TEXT_REFLOW); updateSegments(); @@ -1072,7 +1076,7 @@ void LLTextBase::reflow(S32 start_index) segment_set_t::iterator seg_iter = mSegments.begin(); S32 seg_offset = 0; S32 line_start_index = 0; - const S32 text_width = mTextRect.getWidth(); // optionally reserve room for margin + const S32 text_width = mTextRect.getWidth() - mHPad; // reserve room for margin S32 remaining_pixels = text_width; LLWString text(getWText()); S32 line_count = 0; @@ -1154,60 +1158,8 @@ void LLTextBase::reflow(S32 start_index) } } - if (mLineInfoList.empty()) - { - mContentsRect = LLRect(0, mVPad, mHPad, 0); - } - else - { - - mContentsRect = mLineInfoList.begin()->mRect; - for (line_list_t::const_iterator line_iter = ++mLineInfoList.begin(); - line_iter != mLineInfoList.end(); - ++line_iter) - { - mContentsRect.unionWith(line_iter->mRect); - } - - mContentsRect.mRight += mHPad; - mContentsRect.mTop += mVPad; - // get around rounding errors when clipping text against rectangle - mContentsRect.stretch(1); - } - - // change mDocumentView size to accomodate reflowed text - LLRect document_rect; - if (mScroller) - { - // document is size of scroller or size of text contents, whichever is larger - document_rect.setOriginAndSize(0, 0, - mScroller->getContentWindowRect().getWidth(), - llmax(mScroller->getContentWindowRect().getHeight(), mContentsRect.getHeight())); - } - else - { - // document size is just extents of reflowed text, reset to origin 0,0 - document_rect.set(0, - getLocalRect().getHeight(), - getLocalRect().getWidth(), - llmin(0, getLocalRect().getHeight() - mContentsRect.getHeight())); - } - mDocumentView->setShape(document_rect); - - // after making document big enough to hold all the text, move the text to fit in the document - if (!mLineInfoList.empty()) - { - S32 delta_pos = mDocumentView->getRect().getHeight() - mLineInfoList.begin()->mRect.mTop - mVPad; - // move line segments to fit new document rect - for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) - { - it->mRect.translate(0, delta_pos); - } - mContentsRect.translate(0, delta_pos); - } - // calculate visible region for diplaying text - updateTextRect(); + updateRects(); for (segment_set_t::iterator segment_it = mSegments.begin(); segment_it != mSegments.end(); @@ -1244,11 +1196,10 @@ void LLTextBase::reflow(S32 start_index) //llassert_always(getLocalRectFromDocIndex(mScrollIndex).mBottom == first_char_rect.mBottom); } } - } - - // reset desired x cursor position - updateCursorXPos(); + // reset desired x cursor position + updateCursorXPos(); + } } LLRect LLTextBase::getContentsRect() @@ -2075,8 +2026,44 @@ S32 LLTextBase::getEditableIndex(S32 index, bool increasing_direction) } } -void LLTextBase::updateTextRect() +void LLTextBase::updateRects() { + if (mLineInfoList.empty()) + { + mContentsRect = LLRect(0, mVPad, mHPad, 0); + } + else + { + mContentsRect = mLineInfoList.begin()->mRect; + for (line_list_t::const_iterator line_iter = ++mLineInfoList.begin(); + line_iter != mLineInfoList.end(); + ++line_iter) + { + mContentsRect.unionWith(line_iter->mRect); + } + + mContentsRect.mLeft = 0; + mContentsRect.mTop += mVPad; + + S32 delta_pos = -mContentsRect.mBottom; + // move line segments to fit new document rect + for (line_list_t::iterator it = mLineInfoList.begin(); it != mLineInfoList.end(); ++it) + { + it->mRect.translate(0, delta_pos); + } + mContentsRect.translate(0, delta_pos); + } + + // update document container dimensions according to text contents + LLRect doc_rect = mContentsRect; + // use old mTextRect constraint document to width of viewable region + doc_rect.mRight = doc_rect.mLeft + mTextRect.getWidth(); + + mDocumentView->setShape(doc_rect); + + //update mTextRect *after* mDocumentView has been resized + // so that scrollbars are added if document needs to scroll + // since mTextRect does not include scrollbars LLRect old_text_rect = mTextRect; mTextRect = mScroller ? mScroller->getContentWindowRect() : getLocalRect(); //FIXME: replace border with image? @@ -2084,12 +2071,14 @@ void LLTextBase::updateTextRect() { mTextRect.stretch(-1); } - mTextRect.mLeft += mHPad; - mTextRect.mTop -= mVPad; if (mTextRect != old_text_rect) { needsReflow(); } + + // update document container again, using new mTextRect + doc_rect.mRight = doc_rect.mLeft + mTextRect.getWidth(); + mDocumentView->setShape(doc_rect); } @@ -2121,9 +2110,12 @@ LLRect LLTextBase::getVisibleDocumentRect() const } else { - // entire document rect when not scrolling + // entire document rect is visible when not scrolling + // but offset according to height of widget LLRect doc_rect = mDocumentView->getLocalRect(); - doc_rect.translate(-mDocumentView->getRect().mLeft, -mDocumentView->getRect().mBottom); + doc_rect.mLeft -= mDocumentView->getRect().mLeft; + // adjust for height of text above widget baseline + doc_rect.mBottom = llmin(0, doc_rect.getHeight() - mTextRect.getHeight()); return doc_rect; } } @@ -2218,6 +2210,11 @@ F32 LLNormalTextSegment::drawClippedSegment(S32 seg_start, S32 seg_end, S32 sele const LLWString &text = mEditor.getWText(); + if ( text[seg_end-1] == '\n' ) + { + --seg_end; + } + F32 right_x = rect.mLeft; if (!mStyle->isVisible()) { @@ -2362,16 +2359,7 @@ void LLNormalTextSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt { LLWString text = mEditor.getWText(); - // look for any printable character, then return the font height - height = 0; - for (S32 index = mStart + first_char; index < mStart + first_char + num_chars; ++index) - { - if (text[index] != '\n') - { - height = mFontHeight; - break; - } - } + height = mFontHeight; width = mStyle->getFont()->getWidth(text.c_str(), mStart + first_char, num_chars); } @@ -2393,7 +2381,10 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin S32 last_char = mStart + segment_offset; for (; last_char != mEnd; ++last_char) { - if (text[last_char] == '\n') break; + if (text[last_char] == '\n') + { + break; + } } // set max characters to length of segment, or to first newline @@ -2411,12 +2402,13 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin // If at the beginning of a line, and a single character won't fit, draw it anyway num_chars = 1; } - if (mStart + segment_offset + num_chars == mEditor.getLength()) - { - // include terminating NULL - num_chars++; - } - else if (text[mStart + segment_offset + num_chars] == '\n') + + // include *either* the EOF or newline character in this run of text + // but not both + S32 last_char_in_run = mStart + segment_offset + num_chars; + // check length first to avoid indexing off end of string + if (last_char_in_run >= mEditor.getLength() + || text[last_char_in_run] == '\n') { num_chars++; } @@ -2439,12 +2431,14 @@ void LLNormalTextSegment::dump() const // LLInlineViewSegment // -LLInlineViewSegment::LLInlineViewSegment(LLView* view, S32 start, S32 end, bool force_new_line, S32 hpad, S32 vpad) +LLInlineViewSegment::LLInlineViewSegment(const Params& p, S32 start, S32 end) : LLTextSegment(start, end), - mView(view), - mForceNewLine(force_new_line), - mHPad(hpad), // one sided padding (applied to left and right) - mVPad(vpad) + mView(p.view), + mForceNewLine(p.force_newline), + mLeftPad(p.left_pad), + mRightPad(p.right_pad), + mTopPad(p.top_pad), + mBottomPad(p.bottom_pad) { } @@ -2464,8 +2458,8 @@ void LLInlineViewSegment::getDimensions(S32 first_char, S32 num_chars, S32& widt } else { - width = mHPad * 2 + mView->getRect().getWidth(); - height = mVPad * 2 + mView->getRect().getHeight(); + width = mLeftPad + mRightPad + mView->getRect().getWidth(); + height = mBottomPad + mTopPad + mView->getRect().getHeight(); } } @@ -2488,14 +2482,14 @@ S32 LLInlineViewSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin void LLInlineViewSegment::updateLayout(const LLTextBase& editor) { LLRect start_rect = editor.getDocRectFromDocIndex(mStart); - mView->setOrigin(start_rect.mLeft + mHPad, start_rect.mBottom + mVPad); + mView->setOrigin(start_rect.mLeft + mLeftPad, start_rect.mBottom + mBottomPad); } F32 LLInlineViewSegment::draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect) { // return padded width of widget // widget is actually drawn during mDocumentView's draw() - return (F32)(draw_rect.mLeft + mView->getRect().getWidth() + mHPad * 2); + return (F32)(draw_rect.mLeft + mView->getRect().getWidth() + mLeftPad + mRightPad); } void LLInlineViewSegment::unlinkFromDocument(LLTextBase* editor) diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index f0b8878491..4cca522a23 100644 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -154,6 +154,9 @@ public: LLRect getContentsRect(); LLRect getVisibleDocumentRect() const; + S32 getVPad() { return mVPad; } + S32 getHPad() { return mHPad; } + S32 getDocIndexFromLocalCoord( S32 local_x, S32 local_y, BOOL round ) const; LLRect getLocalRectFromDocIndex(S32 pos) const; @@ -294,7 +297,7 @@ protected: void endSelection(); // misc - void updateTextRect(); + void updateRects(); void needsReflow() { mReflowNeeded = TRUE; } void needsScroll() { mScrollNeeded = TRUE; } void replaceUrlLabel(const std::string &url, const std::string &label); @@ -459,7 +462,17 @@ public: class LLInlineViewSegment : public LLTextSegment { public: - LLInlineViewSegment(LLView* widget, S32 start, S32 end, bool force_new_line, S32 hpad = 0, S32 vpad = 0); + struct Params : public LLInitParam::Block<Params> + { + Mandatory<LLView*> view; + Optional<bool> force_newline; + Optional<S32> left_pad, + right_pad, + bottom_pad, + top_pad; + }; + + LLInlineViewSegment(const Params& p, S32 start, S32 end); ~LLInlineViewSegment(); /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const; /*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const; @@ -470,8 +483,10 @@ public: /*virtual*/ void linkToDocument(class LLTextBase* editor); private: - S32 mHPad; - S32 mVPad; + S32 mLeftPad; + S32 mRightPad; + S32 mTopPad; + S32 mBottomPad; LLView* mView; bool mForceNewLine; }; diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index d507cf7ce4..3ce5a0320b 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -63,6 +63,7 @@ #include "llpanel.h" #include "llurlregistry.h" #include "lltooltip.h" +#include "llmenugl.h" #include <queue> #include "llcombobox.h" @@ -252,7 +253,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : mHandleEditKeysDirectly( p.handle_edit_keys_directly ), mMouseDownX(0), mMouseDownY(0), - mTabsToNextField(p.ignore_tab) + mTabsToNextField(p.ignore_tab), + mContextMenu(NULL) { mDefaultFont = p.font; @@ -273,7 +275,7 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) : if (mShowLineNumbers) { mHPad += UI_TEXTEDITOR_LINE_NUMBER_MARGIN; - updateTextRect(); + updateRects(); } } @@ -301,6 +303,8 @@ LLTextEditor::~LLTextEditor() // Scrollbar is deleted by LLView std::for_each(mUndoStack.begin(), mUndoStack.end(), DeletePointer()); + + delete mContextMenu; } //////////////////////////////////////////////////////////// @@ -648,6 +652,13 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; + // set focus first, in case click callbacks want to change it + // RN: do we really need to have a tab stop? + if (hasTabStop()) + { + setFocus( TRUE ); + } + // Let scrollbar have first dibs handled = LLTextBase::handleMouseDown(x, y, mask); @@ -690,30 +701,40 @@ BOOL LLTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) handled = TRUE; } - if (hasTabStop()) - { - setFocus( TRUE ); - handled = TRUE; - } - // Delay cursor flashing resetCursorBlink(); return handled; } +BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) +{ + if (hasTabStop()) + { + setFocus(TRUE); + } + if (!LLTextBase::handleRightMouseDown(x, y, mask)) + { + showContextMenu(x, y); + } + return TRUE; +} + + BOOL LLTextEditor::handleMiddleMouseDown(S32 x, S32 y, MASK mask) { - BOOL handled = FALSE; - handled = LLTextBase::handleMouseDown(x, y, mask); + if (hasTabStop()) + { + setFocus(TRUE); + } - if (!handled) + if (!LLTextBase::handleMouseDown(x, y, mask)) { - setFocus( TRUE ); if( canPastePrimary() ) { setCursorAtLocalPos( x, y, true ); + // does not rely on focus being set pastePrimary(); } } @@ -736,7 +757,6 @@ BOOL LLTextEditor::handleHover(S32 x, S32 y, MASK mask) setCursorAtLocalPos( clamped_x, clamped_y, true ); mSelectionEnd = mCursorPos; } - lldebugst(LLERR_USER_INPUT) << "hover handled by " << getName() << " (active)" << llendl; getWindow()->setCursor(UI_CURSOR_IBEAM); handled = TRUE; @@ -1991,6 +2011,21 @@ void LLTextEditor::setEnabled(BOOL enabled) } } +void LLTextEditor::showContextMenu(S32 x, S32 y) +{ + if (!mContextMenu) + { + mContextMenu = LLUICtrlFactory::instance().createFromFile<LLContextMenu>("menu_text_editor.xml", + LLMenuGL::sMenuContainer, + LLMenuHolderGL::child_registry_t::instance()); + } + + S32 screen_x, screen_y; + localPointToScreen(x, y, &screen_x, &screen_y); + mContextMenu->show(screen_x, screen_y); +} + + void LLTextEditor::drawPreeditMarker() { static LLUICachedControl<F32> preedit_marker_brightness ("UIPreeditMarkerBrightness", 0); @@ -2276,7 +2311,7 @@ void LLTextEditor::insertText(const std::string &new_text) setEnabled( enabled ); } -void LLTextEditor::appendWidget(LLView* widget, const std::string &widget_text, bool allow_undo, bool force_new_line, S32 hpad, S32 vpad) +void LLTextEditor::appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo) { // Save old state S32 selection_start = mSelectionStart; @@ -2290,12 +2325,9 @@ void LLTextEditor::appendWidget(LLView* widget, const std::string &widget_text, setCursorPos(old_length); - LLWString widget_wide_text; - - // Add carriage return if not first line - widget_wide_text = utf8str_to_wstring(widget_text); + LLWString widget_wide_text = utf8str_to_wstring(text); - LLTextSegmentPtr segment = new LLInlineViewSegment(widget, old_length, old_length + widget_text.size(), force_new_line, hpad, vpad); + LLTextSegmentPtr segment = new LLInlineViewSegment(params, old_length, old_length + widget_wide_text.size()); insert(getLength(), widget_wide_text, FALSE, segment); needsReflow(); @@ -2318,7 +2350,7 @@ void LLTextEditor::appendWidget(LLView* widget, const std::string &widget_text, setCursorPos(cursor_pos); } - if( !allow_undo ) + if (!allow_undo) { blockUndo(); } diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h index 481a4d1a78..10fc94dedc 100644 --- a/indra/llui/lltexteditor.h +++ b/indra/llui/lltexteditor.h @@ -99,6 +99,7 @@ public: // mousehandler overrides virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); virtual BOOL handleHover(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask ); virtual BOOL handleMiddleMouseDown(S32 x,S32 y,MASK mask); @@ -165,7 +166,7 @@ public: // inserts text at cursor void insertText(const std::string &text); - void appendWidget(LLView* widget, const std::string &widget_text, bool allow_undo, bool force_newline, S32 hpad, S32 vpad); + void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo); // Non-undoable void setText(const LLStringExplicit &utf8str); @@ -201,6 +202,7 @@ public: void getSelectedSegments(segment_vec_t& segments) const; protected: + void showContextMenu(S32 x, S32 y); void drawPreeditMarker(); void assignEmbedded(const std::string &s); @@ -328,6 +330,8 @@ private: LLCoordGL mLastIMEPosition; // Last position of the IME editor keystroke_signal_t mKeystrokeSignal; + + LLContextMenu* mContextMenu; }; // end class LLTextEditor diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index c8094f9c7c..23c87c7522 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -38,10 +38,11 @@ // Library includes #include "lltextbox.h" #include "lliconctrl.h" +#include "llbutton.h" #include "llmenugl.h" // hideMenus() #include "llui.h" // positionViewNearMouse() #include "llwindow.h" - +#include "lltrans.h" // // Constants // @@ -155,19 +156,23 @@ LLToolTip::Params::Params() visible_time_near("visible_time_near", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeNear" )), visible_time_far("visible_time_far", LLUI::sSettingGroups["config"]->getF32( "ToolTipVisibleTimeFar" )), sticky_rect("sticky_rect"), - image("image") + image("image"), + time_based_media("time_based_media", false), + web_based_media("web_based_media", false), + media_playing("media_playing", false) { - name = "tooltip"; - font = LLFontGL::getFontSansSerif(); - bg_opaque_color = LLUIColorTable::instance().getColor( "ToolTipBgColor" ); - background_visible = true; + chrome = true; } LLToolTip::LLToolTip(const LLToolTip::Params& p) : LLPanel(p), mMaxWidth(p.max_width), mHasClickCallback(p.click_callback.isProvided()), - mPadding(p.padding) + mPadding(p.padding), + mTextBox(NULL), + mInfoButton(NULL), + mPlayMediaButton(NULL), + mHomePageButton(NULL) { LLTextBox::Params params; params.initial_value = "tip_text"; @@ -186,25 +191,80 @@ LLToolTip::LLToolTip(const LLToolTip::Params& p) params.allow_html = false; // disallow hyperlinks in tooltips, as they want to spawn their own explanatory tooltips mTextBox = LLUICtrlFactory::create<LLTextBox> (params); addChild(mTextBox); - + + S32 TOOLTIP_ICON_SIZE = 0; + S32 TOOLTIP_PLAYBUTTON_SIZE = 0; if (p.image.isProvided()) { - LLIconCtrl::Params icon_params; - icon_params.name = "tooltip_icon"; + LLButton::Params icon_params; + icon_params.name = "tooltip_info"; LLRect icon_rect; LLUIImage* imagep = p.image; - const S32 TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); + TOOLTIP_ICON_SIZE = (imagep ? imagep->getWidth() : 16); icon_rect.setOriginAndSize(mPadding, mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); icon_params.rect = icon_rect; - icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; - icon_params.image = p.image; - icon_params.mouse_opaque = false; - addChild(LLUICtrlFactory::create<LLIconCtrl>(icon_params)); - + //icon_params.follows.flags = FOLLOWS_LEFT | FOLLOWS_BOTTOM; + icon_params.image_unselected(imagep); + icon_params.image_selected(imagep); + icon_params.scale_image(true); + icon_params.flash_color(icon_params.highlight_color()); + mInfoButton = LLUICtrlFactory::create<LLButton>(icon_params); + if (p.click_callback.isProvided()) + { + mInfoButton->setCommitCallback(boost::bind(p.click_callback())); + } + addChild(mInfoButton); + // move text over to fit image in mTextBox->translate(TOOLTIP_ICON_SIZE + mPadding, 0); } - + + if (p.time_based_media) + { + LLButton::Params p_button; + p_button.name(std::string("play_media")); + TOOLTIP_PLAYBUTTON_SIZE = 16; + LLRect button_rect; + button_rect.setOriginAndSize((mPadding +TOOLTIP_ICON_SIZE+ mPadding ), mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); + p_button.rect = button_rect; + p_button.image_selected.name("button_anim_pause.tga"); + p_button.image_unselected.name("button_anim_play.tga"); + p_button.scale_image(true); + + mPlayMediaButton = LLUICtrlFactory::create<LLButton>(p_button); + if(p.click_playmedia_callback.isProvided()) + { + mPlayMediaButton->setCommitCallback(boost::bind(p.click_playmedia_callback())); + } + mPlayMediaButton->setToggleState(p.media_playing); + addChild(mPlayMediaButton); + + // move text over to fit image in + mTextBox->translate(TOOLTIP_PLAYBUTTON_SIZE + mPadding, 0); + } + + if (p.web_based_media) + { + LLButton::Params p_w_button; + p_w_button.name(std::string("home_page")); + TOOLTIP_PLAYBUTTON_SIZE = 16; + LLRect button_rect; + button_rect.setOriginAndSize((mPadding +TOOLTIP_ICON_SIZE+ mPadding ), mPadding, TOOLTIP_ICON_SIZE, TOOLTIP_ICON_SIZE); + p_w_button.rect = button_rect; + p_w_button.image_unselected.name("map_home.tga"); + p_w_button.scale_image(true); + + mHomePageButton = LLUICtrlFactory::create<LLButton>(p_w_button); + if(p.click_homepage_callback.isProvided()) + { + mHomePageButton->setCommitCallback(boost::bind(p.click_homepage_callback())); + } + addChild(mHomePageButton); + + // move text over to fit image in + mTextBox->translate(TOOLTIP_PLAYBUTTON_SIZE + mPadding, 0); + } + if (p.click_callback.isProvided()) { setMouseUpCallback(boost::bind(p.click_callback())); @@ -255,6 +315,10 @@ void LLToolTip::setVisible(BOOL visible) BOOL LLToolTip::handleHover(S32 x, S32 y, MASK mask) { + //mInfoButton->setFlashing(true); + if(mInfoButton) + mInfoButton->setHighlight(true); + LLPanel::handleHover(x, y, mask); if (mHasClickCallback) { @@ -263,6 +327,14 @@ BOOL LLToolTip::handleHover(S32 x, S32 y, MASK mask) return TRUE; } +void LLToolTip::onMouseLeave(S32 x, S32 y, MASK mask) +{ + //mInfoButton->setFlashing(true); + if(mInfoButton) + mInfoButton->setHighlight(false); + LLUICtrl::onMouseLeave(x, y, mask); +} + void LLToolTip::draw() { F32 alpha = 1.f; @@ -378,7 +450,10 @@ void LLToolTipMgr::show(const std::string& msg) void LLToolTipMgr::show(const LLToolTip::Params& params) { - if (!params.validateBlock()) + // fill in default tooltip params from tool_tip.xml + LLToolTip::Params params_with_defaults(params); + params_with_defaults.fillFrom(LLUICtrlFactory::instance().getDefaultParams<LLToolTip>()); + if (!params_with_defaults.validateBlock()) { llwarns << "Could not display tooltip!" << llendl; return; @@ -390,10 +465,12 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) // are we ready to show the tooltip? if (!mToolTipsBlocked // we haven't hit a key, moved the mouse, etc. - && LLUI::getMouseIdleTime() > params.delay_time) // the mouse has been still long enough + && LLUI::getMouseIdleTime() > params_with_defaults.delay_time) // the mouse has been still long enough { - bool tooltip_changed = mLastToolTipParams.message() != params.message() - || mLastToolTipParams.pos() != params.pos(); + bool tooltip_changed = mLastToolTipParams.message() != params_with_defaults.message() + || mLastToolTipParams.pos() != params_with_defaults.pos() + || mLastToolTipParams.time_based_media() != params_with_defaults.time_based_media() + || mLastToolTipParams.web_based_media() != params_with_defaults.web_based_media(); bool tooltip_shown = mToolTip && mToolTip->getVisible() @@ -401,7 +478,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) mNeedsToolTip = tooltip_changed || !tooltip_shown; // store description of tooltip for later creation - mNextToolTipParams = params; + mNextToolTipParams = params_with_defaults; } } diff --git a/indra/llui/lltooltip.h b/indra/llui/lltooltip.h index 63e7249a12..30d251266c 100644 --- a/indra/llui/lltooltip.h +++ b/indra/llui/lltooltip.h @@ -78,9 +78,13 @@ public: visible_time_far; // time for which tooltip is visible while mouse moved away Optional<LLRect> sticky_rect; Optional<const LLFontGL*> font; - - Optional<click_callback_t> click_callback; Optional<LLUIImage*> image; + Optional<bool> time_based_media, + web_based_media, + media_playing; + Optional<click_callback_t> click_callback, + click_playmedia_callback, + click_homepage_callback; Optional<S32> max_width; Optional<S32> padding; Optional<bool> wrap; @@ -89,7 +93,7 @@ public: }; /*virtual*/ void draw(); /*virtual*/ BOOL handleHover(S32 x, S32 y, MASK mask); - + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); /*virtual*/ void setValue(const LLSD& value); /*virtual*/ void setVisible(BOOL visible); @@ -101,6 +105,10 @@ public: private: class LLTextBox* mTextBox; + class LLButton* mInfoButton; + class LLButton* mPlayMediaButton; + class LLButton* mHomePageButton; + LLFrameTimer mFadeTimer; LLFrameTimer mVisibleTimer; S32 mMaxWidth; diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 48504a1e54..a82e6eb372 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -1953,11 +1953,6 @@ namespace LLInitParam } } - if (mData.mValue == NULL) - { - mData.mValue = LLFontGL::getFontDefault(); - } - // default to current value return mData.mValue; } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index efb1b0a36f..5ec07f1941 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -404,6 +404,20 @@ namespace LLInitParam LLUIColor getValueFromBlock() const; }; + // provide a better default for Optional<const LLFontGL*> than NULL + template <> + struct DefaultInitializer<const LLFontGL*> + { + // return reference to a single default instance of T + // built-in types will be initialized to zero, default constructor otherwise + static const LLFontGL* get() + { + static const LLFontGL* sDefaultFont = LLFontGL::getFontDefault(); + return sDefaultFont; + } + }; + + template<> class TypedParam<const LLFontGL*> : public BlockValue<const LLFontGL*> diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 0faff5eff6..08fc8fb784 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -42,6 +42,7 @@ static LLDefaultChildRegistry::Register<LLUICtrl> r("ui_ctrl"); LLUICtrl::Params::Params() : tab_stop("tab_stop", true), + chrome("chrome", false), label("label"), initial_value("value"), init_callback("init_callback"), @@ -86,6 +87,7 @@ void LLUICtrl::initFromParams(const Params& p) { LLView::initFromParams(p); + setIsChrome(p.chrome); setControlName(p.control_name); if(p.enabled_controls.isProvided()) { @@ -582,7 +584,6 @@ void LLUICtrl::setIsChrome(BOOL is_chrome) // virtual BOOL LLUICtrl::getIsChrome() const { - LLView* parent_ctrl = getParent(); while(parent_ctrl) { diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index 45fe47772b..dd22851100 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -126,7 +126,8 @@ public: struct Params : public LLInitParam::Block<Params, LLView::Params> { Optional<std::string> label; - Optional<bool> tab_stop; + Optional<bool> tab_stop, + chrome; Optional<LLSD> initial_value; Optional<CommitCallbackParam> init_callback, diff --git a/indra/media_plugins/CMakeLists.txt b/indra/media_plugins/CMakeLists.txt index d35afd8cbd..cc03d9cb72 100644 --- a/indra/media_plugins/CMakeLists.txt +++ b/indra/media_plugins/CMakeLists.txt @@ -9,3 +9,5 @@ add_subdirectory(gstreamer010) if (WINDOWS OR DARWIN) add_subdirectory(quicktime) endif (WINDOWS OR DARWIN) + +add_subdirectory(example) diff --git a/indra/media_plugins/base/media_plugin_base.cpp b/indra/media_plugins/base/media_plugin_base.cpp index 0b7092fad6..6acac07423 100644 --- a/indra/media_plugins/base/media_plugin_base.cpp +++ b/indra/media_plugins/base/media_plugin_base.cpp @@ -64,6 +64,7 @@ std::string MediaPluginBase::statusString() case STATUS_ERROR: result = "error"; break; case STATUS_PLAYING: result = "playing"; break; case STATUS_PAUSED: result = "paused"; break; + case STATUS_DONE: result = "done"; break; default: // keep the empty string break; diff --git a/indra/media_plugins/base/media_plugin_base.h b/indra/media_plugins/base/media_plugin_base.h index 8f600cb8d6..f1e96335f9 100644 --- a/indra/media_plugins/base/media_plugin_base.h +++ b/indra/media_plugins/base/media_plugin_base.h @@ -56,6 +56,7 @@ protected: STATUS_ERROR, STATUS_PLAYING, STATUS_PAUSED, + STATUS_DONE } EStatus; class SharedSegmentInfo diff --git a/indra/media_plugins/example/CMakeLists.txt b/indra/media_plugins/example/CMakeLists.txt new file mode 100644 index 0000000000..4d82f2747c --- /dev/null +++ b/indra/media_plugins/example/CMakeLists.txt @@ -0,0 +1,74 @@ +# -*- cmake -*- + +project(media_plugin_example) + +include(00-Common) +include(LLCommon) +include(LLImage) +include(LLPlugin) +include(LLMath) +include(LLRender) +include(LLWindow) +include(Linking) +include(PluginAPI) +include(MediaPluginBase) +include(FindOpenGL) + +include(ExamplePlugin) + +include_directories( + ${LLPLUGIN_INCLUDE_DIRS} + ${MEDIA_PLUGIN_BASE_INCLUDE_DIRS} + ${LLCOMMON_INCLUDE_DIRS} + ${LLMATH_INCLUDE_DIRS} + ${LLIMAGE_INCLUDE_DIRS} + ${LLRENDER_INCLUDE_DIRS} + ${LLWINDOW_INCLUDE_DIRS} +) + + +### media_plugin_example + +set(media_plugin_example_SOURCE_FILES + media_plugin_example.cpp + ) + +add_library(media_plugin_example + SHARED + ${media_plugin_example_SOURCE_FILES} +) + +target_link_libraries(media_plugin_example + ${LLPLUGIN_LIBRARIES} + ${MEDIA_PLUGIN_BASE_LIBRARIES} + ${LLCOMMON_LIBRARIES} + ${EXAMPLE_PLUGIN_LIBRARIES} + ${PLUGIN_API_WINDOWS_LIBRARIES} +) + +add_dependencies(media_plugin_example + ${LLPLUGIN_LIBRARIES} + ${MEDIA_PLUGIN_BASE_LIBRARIES} + ${LLCOMMON_LIBRARIES} +) + +if (WINDOWS) + set_target_properties( + media_plugin_example + PROPERTIES + LINK_FLAGS "/MANIFEST:NO" + ) +endif (WINDOWS) + +if (DARWIN) + # Don't prepend 'lib' to the executable name, and don't embed a full path in the library's install name + set_target_properties( + media_plugin_example + PROPERTIES + PREFIX "" + BUILD_WITH_INSTALL_RPATH 1 + INSTALL_NAME_DIR "@executable_path" + LINK_FLAGS "-exported_symbols_list ${CMAKE_CURRENT_SOURCE_DIR}/../base/media_plugin_base.exp" + ) + +endif (DARWIN)
\ No newline at end of file diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp new file mode 100644 index 0000000000..99e0199a29 --- /dev/null +++ b/indra/media_plugins/example/media_plugin_example.cpp @@ -0,0 +1,488 @@ +/** + * @file media_plugin_example.cpp + * @brief Example plugin for LLMedia API plugin system + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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 "linden_common.h" + +#include "llgl.h" +#include "llplugininstance.h" +#include "llpluginmessage.h" +#include "llpluginmessageclasses.h" +#include "media_plugin_base.h" + +#include <time.h> + +//////////////////////////////////////////////////////////////////////////////// +// +class MediaPluginExample : + public MediaPluginBase +{ + public: + MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data ); + ~MediaPluginExample(); + + /*virtual*/ void receiveMessage( const char* message_string ); + + private: + bool init(); + void update( F64 milliseconds ); + void write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b ); + bool mFirstTime; + + time_t mLastUpdateTime; + enum Constants { ENumObjects = 10 }; + unsigned char* mBackgroundPixels; + int mColorR[ ENumObjects ]; + int mColorG[ ENumObjects ]; + int mColorB[ ENumObjects ]; + int mXpos[ ENumObjects ]; + int mYpos[ ENumObjects ]; + int mXInc[ ENumObjects ]; + int mYInc[ ENumObjects ]; + int mBlockSize[ ENumObjects ]; + bool mMouseButtonDown; + bool mStopAction; +}; + +//////////////////////////////////////////////////////////////////////////////// +// +MediaPluginExample::MediaPluginExample( LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data ) : + MediaPluginBase( host_send_func, host_user_data ) +{ + mFirstTime = true; + mWidth = 0; + mHeight = 0; + mDepth = 4; + mPixels = 0; + mMouseButtonDown = false; + mStopAction = false; + mLastUpdateTime = 0; +} + +//////////////////////////////////////////////////////////////////////////////// +// +MediaPluginExample::~MediaPluginExample() +{ +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::receiveMessage( const char* message_string ) +{ + LLPluginMessage message_in; + + if ( message_in.parse( message_string ) >= 0 ) + { + std::string message_class = message_in.getClass(); + std::string message_name = message_in.getName(); + + if ( message_class == LLPLUGIN_MESSAGE_CLASS_BASE ) + { + if ( message_name == "init" ) + { + LLPluginMessage message( "base", "init_response" ); + LLSD versions = LLSD::emptyMap(); + versions[ LLPLUGIN_MESSAGE_CLASS_BASE ] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; + versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION; + versions[ LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION; + message.setValueLLSD( "versions", versions ); + + std::string plugin_version = "Example media plugin, Example Version 1.0.0.0"; + message.setValue( "plugin_version", plugin_version ); + sendMessage( message ); + + // Plugin gets to decide the texture parameters to use. + message.setMessage( LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params" ); + message.setValueS32( "default_width", mWidth ); + message.setValueS32( "default_height", mHeight ); + message.setValueS32( "depth", mDepth ); + message.setValueU32( "internalformat", GL_RGBA ); + message.setValueU32( "format", GL_RGBA ); + message.setValueU32( "type", GL_UNSIGNED_BYTE ); + message.setValueBoolean( "coords_opengl", false ); + sendMessage( message ); + } + else + if ( message_name == "idle" ) + { + // no response is necessary here. + F64 time = message_in.getValueReal( "time" ); + + // Convert time to milliseconds for update() + update( time ); + } + else + if ( message_name == "cleanup" ) + { + // clean up here + } + else + if ( message_name == "shm_added" ) + { + SharedSegmentInfo info; + info.mAddress = message_in.getValuePointer( "address" ); + info.mSize = ( size_t )message_in.getValueS32( "size" ); + std::string name = message_in.getValue( "name" ); + + mSharedSegments.insert( SharedSegmentMap::value_type( name, info ) ); + + } + else + if ( message_name == "shm_remove" ) + { + std::string name = message_in.getValue( "name" ); + + SharedSegmentMap::iterator iter = mSharedSegments.find( name ); + if( iter != mSharedSegments.end() ) + { + if ( mPixels == iter->second.mAddress ) + { + // This is the currently active pixel buffer. + // Make sure we stop drawing to it. + mPixels = NULL; + mTextureSegmentName.clear(); + }; + mSharedSegments.erase( iter ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown shared memory region!" << std::endl; + }; + + // Send the response so it can be cleaned up. + LLPluginMessage message( "base", "shm_remove_response" ); + message.setValue( "name", name ); + sendMessage( message ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown base message: " << message_name << std::endl; + }; + } + else + if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA ) + { + if ( message_name == "size_change" ) + { + std::string name = message_in.getValue( "name" ); + S32 width = message_in.getValueS32( "width" ); + S32 height = message_in.getValueS32( "height" ); + S32 texture_width = message_in.getValueS32( "texture_width" ); + S32 texture_height = message_in.getValueS32( "texture_height" ); + + if ( ! name.empty() ) + { + // Find the shared memory region with this name + SharedSegmentMap::iterator iter = mSharedSegments.find( name ); + if ( iter != mSharedSegments.end() ) + { + mPixels = ( unsigned char* )iter->second.mAddress; + mWidth = width; + mHeight = height; + + mTextureWidth = texture_width; + mTextureHeight = texture_height; + + init(); + }; + }; + + LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response" ); + message.setValue( "name", name ); + message.setValueS32( "width", width ); + message.setValueS32( "height", height ); + message.setValueS32( "texture_width", texture_width ); + message.setValueS32( "texture_height", texture_height ); + sendMessage( message ); + } + else + if ( message_name == "load_uri" ) + { + std::string uri = message_in.getValue( "uri" ); + if ( ! uri.empty() ) + { + }; + } + else + if ( message_name == "mouse_event" ) + { + std::string event = message_in.getValue( "event" ); + S32 button = message_in.getValueS32( "button" ); + + // left mouse button + if ( button == 0 ) + { + int mouse_x = message_in.getValueS32( "x" ); + int mouse_y = message_in.getValueS32( "y" ); + std::string modifiers = message_in.getValue( "modifiers" ); + + if ( event == "move" ) + { + if ( mMouseButtonDown ) + write_pixel( mouse_x, mouse_y, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80, rand() % 0x80 + 0x80 ); + } + else + if ( event == "down" ) + { + mMouseButtonDown = true; + } + else + if ( event == "up" ) + { + mMouseButtonDown = false; + } + else + if ( event == "double_click" ) + { + }; + }; + } + else + if ( message_name == "key_event" ) + { + std::string event = message_in.getValue( "event" ); + S32 key = message_in.getValueS32( "key" ); + std::string modifiers = message_in.getValue( "modifiers" ); + + if ( event == "down" ) + { + if ( key == ' ') + { + mLastUpdateTime = 0; + update( 0.0f ); + }; + }; + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown media message: " << message_string << std::endl; + }; + } + else + if ( message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER ) + { + if ( message_name == "browse_reload" ) + { + mLastUpdateTime = 0; + mFirstTime = true; + mStopAction = false; + update( 0.0f ); + } + else + if ( message_name == "browse_stop" ) + { + for( int n = 0; n < ENumObjects; ++n ) + mXInc[ n ] = mYInc[ n ] = 0; + + mStopAction = true; + update( 0.0f ); + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown media_browser message: " << message_string << std::endl; + }; + } + else + { + //std::cerr << "MediaPluginExample::receiveMessage: unknown message class: " << message_class << std::endl; + }; + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::write_pixel( int x, int y, unsigned char r, unsigned char g, unsigned char b ) +{ + // make sure we don't write outside the buffer + if ( ( x < 0 ) || ( x >= mWidth ) || ( y < 0 ) || ( y >= mHeight ) ) + return; + + if ( mBackgroundPixels != NULL ) + { + unsigned char *pixel = mBackgroundPixels; + pixel += y * mWidth * mDepth; + pixel += ( x * mDepth ); + pixel[ 0 ] = b; + pixel[ 1 ] = g; + pixel[ 2 ] = r; + + setDirty( x, y, x + 1, y + 1 ); + }; +} + +//////////////////////////////////////////////////////////////////////////////// +// +void MediaPluginExample::update( F64 milliseconds ) +{ + if ( mWidth < 1 || mWidth > 2048 || mHeight < 1 || mHeight > 2048 ) + return; + + if ( mPixels == 0 ) + return; + + if ( mFirstTime ) + { + for( int n = 0; n < ENumObjects; ++n ) + { + mXpos[ n ] = ( mWidth / 2 ) + rand() % ( mWidth / 16 ) - ( mWidth / 32 ); + mYpos[ n ] = ( mHeight / 2 ) + rand() % ( mHeight / 16 ) - ( mHeight / 32 ); + + mColorR[ n ] = rand() % 0x60 + 0x60; + mColorG[ n ] = rand() % 0x60 + 0x60; + mColorB[ n ] = rand() % 0x60 + 0x60; + + mXInc[ n ] = 0; + while ( mXInc[ n ] == 0 ) + mXInc[ n ] = rand() % 7 - 3; + + mYInc[ n ] = 0; + while ( mYInc[ n ] == 0 ) + mYInc[ n ] = rand() % 9 - 4; + + mBlockSize[ n ] = rand() % 0x30 + 0x10; + }; + + delete [] mBackgroundPixels; + + mBackgroundPixels = new unsigned char[ mWidth * mHeight * mDepth ]; + + mFirstTime = false; + }; + + if ( mStopAction ) + return; + + if ( time( NULL ) > mLastUpdateTime + 3 ) + { + const int num_squares = rand() % 20 + 4; + int sqr1_r = rand() % 0x80 + 0x20; + int sqr1_g = rand() % 0x80 + 0x20; + int sqr1_b = rand() % 0x80 + 0x20; + int sqr2_r = rand() % 0x80 + 0x20; + int sqr2_g = rand() % 0x80 + 0x20; + int sqr2_b = rand() % 0x80 + 0x20; + + for ( int y1 = 0; y1 < num_squares; ++y1 ) + { + for ( int x1 = 0; x1 < num_squares; ++x1 ) + { + int px_start = mWidth * x1 / num_squares; + int px_end = ( mWidth * ( x1 + 1 ) ) / num_squares; + int py_start = mHeight * y1 / num_squares; + int py_end = ( mHeight * ( y1 + 1 ) ) / num_squares; + + for( int y2 = py_start; y2 < py_end; ++y2 ) + { + for( int x2 = px_start; x2 < px_end; ++x2 ) + { + int rowspan = mWidth * mDepth; + + if ( ( y1 % 2 ) ^ ( x1 % 2 ) ) + { + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr1_r; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr1_g; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr1_b; + } + else + { + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 0 ] = sqr2_r; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 1 ] = sqr2_g; + mBackgroundPixels[ y2 * rowspan + x2 * mDepth + 2 ] = sqr2_b; + }; + }; + }; + }; + }; + + time( &mLastUpdateTime ); + }; + + memcpy( mPixels, mBackgroundPixels, mWidth * mHeight * mDepth ); + + for( int n = 0; n < ENumObjects; ++n ) + { + if ( rand() % 50 == 0 ) + { + mXInc[ n ] = 0; + while ( mXInc[ n ] == 0 ) + mXInc[ n ] = rand() % 7 - 3; + + mYInc[ n ] = 0; + while ( mYInc[ n ] == 0 ) + mYInc[ n ] = rand() % 9 - 4; + }; + + if ( mXpos[ n ] + mXInc[ n ] < 0 || mXpos[ n ] + mXInc[ n ] >= mWidth - mBlockSize[ n ] ) + mXInc[ n ] =- mXInc[ n ]; + + if ( mYpos[ n ] + mYInc[ n ] < 0 || mYpos[ n ] + mYInc[ n ] >= mHeight - mBlockSize[ n ] ) + mYInc[ n ] =- mYInc[ n ]; + + mXpos[ n ] += mXInc[ n ]; + mYpos[ n ] += mYInc[ n ]; + + for( int y = 0; y < mBlockSize[ n ]; ++y ) + { + for( int x = 0; x < mBlockSize[ n ]; ++x ) + { + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 0 ] = mColorR[ n ]; + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 1 ] = mColorG[ n ]; + mPixels[ ( mXpos[ n ] + x ) * mDepth + ( mYpos[ n ] + y ) * mDepth * mWidth + 2 ] = mColorB[ n ]; + }; + }; + }; + + setDirty( 0, 0, mWidth, mHeight ); +}; + +//////////////////////////////////////////////////////////////////////////////// +// +bool MediaPluginExample::init() +{ + LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text" ); + message.setValue( "name", "Example Plugin" ); + sendMessage( message ); + + return true; +}; + +//////////////////////////////////////////////////////////////////////////////// +// +int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func, + void* host_user_data, + LLPluginInstance::sendMessageFunction *plugin_send_func, + void **plugin_user_data ) +{ + MediaPluginExample* self = new MediaPluginExample( host_send_func, host_user_data ); + *plugin_send_func = MediaPluginExample::staticReceiveMessage; + *plugin_user_data = ( void* )self; + + return 0; +} diff --git a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp index 7100d03f05..fb6d5b2905 100644 --- a/indra/media_plugins/quicktime/media_plugin_quicktime.cpp +++ b/indra/media_plugins/quicktime/media_plugin_quicktime.cpp @@ -79,6 +79,7 @@ private: const int mMinHeight;
const int mMaxHeight;
F64 mPlayRate;
+ std::string mNavigateURL;
enum ECommand {
COMMAND_NONE,
@@ -179,6 +180,11 @@ private: setStatus(STATUS_ERROR);
return;
};
+
+ mNavigateURL = url;
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin");
+ message.setValue("uri", mNavigateURL);
+ sendMessage(message);
// do pre-roll actions (typically fired for streaming movies but not always)
PrePrerollMovie( mMovieHandle, 0, getPlayRate(), moviePrePrerollCompleteCallback, ( void * )this );
@@ -389,11 +395,18 @@ private: static void moviePrePrerollCompleteCallback( Movie movie, OSErr preroll_err, void *ref )
{
- //MediaPluginQuickTime* self = ( MediaPluginQuickTime* )ref;
+ MediaPluginQuickTime* self = ( MediaPluginQuickTime* )ref;
// TODO:
//LLMediaEvent event( self );
//self->mEventEmitter.update( &LLMediaObserver::onMediaPreroll, event );
+
+ // Send a "navigate complete" event.
+ LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete");
+ message.setValue("uri", self->mNavigateURL);
+ message.setValueS32("result_code", 200);
+ message.setValue("result_string", "OK");
+ self->sendMessage(message);
};
@@ -407,7 +420,7 @@ private: {
if ( mCommand == COMMAND_PLAY )
{
- if ( mStatus == STATUS_LOADED || mStatus == STATUS_PAUSED || mStatus == STATUS_PLAYING )
+ if ( mStatus == STATUS_LOADED || mStatus == STATUS_PAUSED || mStatus == STATUS_PLAYING || mStatus == STATUS_DONE )
{
long state = GetMovieLoadState( mMovieHandle );
@@ -433,7 +446,7 @@ private: else
if ( mCommand == COMMAND_STOP )
{
- if ( mStatus == STATUS_PLAYING || mStatus == STATUS_PAUSED )
+ if ( mStatus == STATUS_PLAYING || mStatus == STATUS_PAUSED || mStatus == STATUS_DONE )
{
if ( GetMovieLoadState( mMovieHandle ) >= kMovieLoadStatePlaythroughOK )
{
@@ -534,12 +547,12 @@ private: // see if title arrived and if so, update member variable with contents
checkTitle();
-
- // special code for looping - need to rewind at the end of the movie
- if ( mIsLooping )
+
+ // QT call to see if we are at the end - can't do with controller
+ if ( IsMovieDone( mMovieHandle ) )
{
- // QT call to see if we are at the end - can't do with controller
- if ( IsMovieDone( mMovieHandle ) )
+ // special code for looping - need to rewind at the end of the movie
+ if ( mIsLooping )
{
// go back to start
rewind();
@@ -552,8 +565,16 @@ private: // set the volume
MCDoAction( mMovieController, mcActionSetVolume, (void*)mCurVolume );
};
- };
- };
+ }
+ else
+ {
+ if(mStatus == STATUS_PLAYING)
+ {
+ setStatus(STATUS_DONE);
+ }
+ }
+ }
+
};
int getDataWidth() const
diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 6c54f63859..3ce8ff3deb 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1,842 +1,871 @@ -/**
- * @file media_plugin_webkit.cpp
- * @brief Webkit plugin for LLMedia API plugin system
- *
- * $LicenseInfo:firstyear=2008&license=viewergpl$
- *
- * Copyright (c) 2008, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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 "llqtwebkit.h"
-
-#include "linden_common.h"
-#include "indra_constants.h" // for indra keyboard codes
-
-#include "llgl.h"
-
-#include "llplugininstance.h"
-#include "llpluginmessage.h"
-#include "llpluginmessageclasses.h"
-#include "media_plugin_base.h"
-
-#if LL_WINDOWS
-#include <direct.h>
-#else
-#include <unistd.h>
-#include <stdlib.h>
-#endif
-
-#if LL_WINDOWS
- // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below
- // to get the path to this dll for webkit initialization.
- // I don't know how/if this can be done with apr...
- namespace { HMODULE gModuleHandle;};
- BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- {
- gModuleHandle = (HMODULE) hinstDLL;
- return TRUE;
- }
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-//
-class MediaPluginWebKit :
- public MediaPluginBase,
- public LLEmbeddedBrowserWindowObserver
-{
-public:
- MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data);
- ~MediaPluginWebKit();
-
- /*virtual*/ void receiveMessage(const char *message_string);
-
-private:
-
- int mBrowserWindowId;
- bool mBrowserInitialized;
- bool mNeedsUpdate;
-
- bool mCanCut;
- bool mCanCopy;
- bool mCanPaste;
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void update(int milliseconds)
- {
- LLQtWebKit::getInstance()->pump( milliseconds );
-
- checkEditState();
-
- if ( mNeedsUpdate )
- {
- const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId );
-
- unsigned int buffer_size = LLQtWebKit::getInstance()->getBrowserRowSpan( mBrowserWindowId ) * LLQtWebKit::getInstance()->getBrowserHeight( mBrowserWindowId );
-
-// std::cerr << "webkit plugin: updating" << std::endl;
-
- // TODO: should get rid of this memcpy if possible
- if ( mPixels && browser_pixels )
- {
-// std::cerr << " memcopy of " << buffer_size << " bytes" << std::endl;
- memcpy( mPixels, browser_pixels, buffer_size );
- }
-
- if ( mWidth > 0 && mHeight > 0 )
- {
-// std::cerr << "Setting dirty, " << mWidth << " x " << mHeight << std::endl;
- setDirty( 0, 0, mWidth, mHeight );
- }
-
- mNeedsUpdate = false;
- };
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- bool initBrowser()
- {
- // already initialized
- if ( mBrowserInitialized )
- return true;
-
- // not enough information to initialize the browser yet.
- if ( mWidth < 0 || mHeight < 0 || mDepth < 0 ||
- mTextureWidth < 0 || mTextureHeight < 0 )
- {
- return false;
- };
-
- // set up directories
- char cwd[ FILENAME_MAX ]; // I *think* this is defined on all platforms we use
- if (NULL == getcwd( cwd, FILENAME_MAX - 1 ))
- {
- llwarns << "Couldn't get cwd - probably too long - failing to init." << llendl;
- return false;
- }
- std::string application_dir = std::string( cwd );
-
-#if LL_WINDOWS
- //*NOTE:Mani - On windows, at least, the component path is the
- // location of this dll's image file.
- std::string component_dir;
- char dll_path[_MAX_PATH];
- DWORD len = GetModuleFileNameA(gModuleHandle, (LPCH)&dll_path, _MAX_PATH);
- while(len && dll_path[ len ] != ('\\') )
- {
- len--;
- }
- if(len >= 0)
- {
- dll_path[len] = 0;
- component_dir = dll_path;
- }
- else
- {
- // *NOTE:Mani - This case should be an rare exception.
- // GetModuleFileNameA should always give you a full path, no?
- component_dir = application_dir;
- }
-#else
- std::string component_dir = application_dir;
-#endif
- std::string profileDir = application_dir + "/" + "browser_profile"; // cross platform?
-
- // window handle - needed on Windows and must be app window.
-#if LL_WINDOWS
- char window_title[ MAX_PATH ];
- GetConsoleTitleA( window_title, MAX_PATH );
- void* native_window_handle = (void*)FindWindowA( NULL, window_title );
-#else
- void* native_window_handle = 0;
-#endif
-
- // main browser initialization
- bool result = LLQtWebKit::getInstance()->init( application_dir, component_dir, profileDir, native_window_handle );
- if ( result )
- {
- // create single browser window
- mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight );
-
-#if LL_WINDOWS
- // Enable plugins
- LLQtWebKit::getInstance()->enablePlugins(true);
-#elif LL_DARWIN
- // Disable plugins
- LLQtWebKit::getInstance()->enablePlugins(false);
-#elif LL_LINUX
- // Disable plugins
- LLQtWebKit::getInstance()->enablePlugins(false);
-#endif
-
- // tell LLQtWebKit about the size of the browser window
- LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight );
-
- // observer events that LLQtWebKit emits
- LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this );
-
- // append details to agent string
- LLQtWebKit::getInstance()->setBrowserAgentId( "LLPluginMedia Web Browser" );
-
- // don't flip bitmap
- LLQtWebKit::getInstance()->flipWindow( mBrowserWindowId, true );
-
- // Set the background color to black
- LLQtWebKit::getInstance()->
- // set background color to be black - mostly for initial login page
- LLQtWebKit::getInstance()->setBackgroundColor( mBrowserWindowId, 0x00, 0x00, 0x00 );
-
- // go to the "home page"
- // Don't do this here -- it causes the dreaded "white flash" when loading a browser instance.
-// LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, "about:blank" );
-
- // set flag so we don't do this again
- mBrowserInitialized = true;
-
- return true;
- };
-
- return false;
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onCursorChanged(const EventType& event)
- {
- LLQtWebKit::ECursor llqt_cursor = (LLQtWebKit::ECursor)event.getIntValue();
- std::string name;
-
- switch(llqt_cursor)
- {
- case LLQtWebKit::C_ARROW:
- name = "arrow";
- break;
- case LLQtWebKit::C_IBEAM:
- name = "ibeam";
- break;
- case LLQtWebKit::C_SPLITV:
- name = "splitv";
- break;
- case LLQtWebKit::C_SPLITH:
- name = "splith";
- break;
- case LLQtWebKit::C_POINTINGHAND:
- name = "hand";
- break;
-
- default:
- llwarns << "Unknown cursor ID: " << (int)llqt_cursor << llendl;
- break;
- }
-
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "cursor_changed");
- message.setValue("name", name);
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onPageChanged( const EventType& event )
- {
- // flag that an update is required
- mNeedsUpdate = true;
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onNavigateBegin(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin");
- message.setValue("uri", event.getEventUri());
- sendMessage(message);
-
- setStatus(STATUS_LOADING);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onNavigateComplete(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete");
- message.setValue("uri", event.getEventUri());
- message.setValueS32("result_code", event.getIntValue());
- message.setValue("result_string", event.getStringValue());
- message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK));
- message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD));
- sendMessage(message);
-
- setStatus(STATUS_LOADED);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onUpdateProgress(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "progress");
- message.setValueS32("percent", event.getIntValue());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onStatusTextChange(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text");
- message.setValue("status", event.getStringValue());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onTitleChange(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text");
- message.setValue("name", event.getStringValue());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onLocationChange(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed");
- message.setValue("uri", event.getEventUri());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onClickLinkHref(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href");
- message.setValue("uri", event.getStringValue());
- message.setValue("target", event.getStringValue2());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- // virtual
- void onClickLinkNoFollow(const EventType& event)
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow");
- message.setValue("uri", event.getStringValue());
- sendMessage(message);
- }
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void mouseDown( int x, int y )
- {
- LLQtWebKit::getInstance()->mouseDown( mBrowserWindowId, x, y );
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void mouseUp( int x, int y )
- {
- LLQtWebKit::getInstance()->mouseUp( mBrowserWindowId, x, y );
- LLQtWebKit::getInstance()->focusBrowser( mBrowserWindowId, true );
- checkEditState();
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void mouseMove( int x, int y )
- {
- LLQtWebKit::getInstance()->mouseMove( mBrowserWindowId, x, y );
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void keyPress( int key )
- {
- int llqt_key;
-
- // The incoming values for 'key' will be the ones from indra_constants.h
- // the outgoing values are the ones from llqtwebkit.h
-
- switch((KEY)key)
- {
- // This is the list that the llqtwebkit implementation actually maps into Qt keys.
-// case KEY_XXX: llqt_key = LL_DOM_VK_CANCEL; break;
-// case KEY_XXX: llqt_key = LL_DOM_VK_HELP; break;
- case KEY_BACKSPACE: llqt_key = LL_DOM_VK_BACK_SPACE; break;
- case KEY_TAB: llqt_key = LL_DOM_VK_TAB; break;
-// case KEY_XXX: llqt_key = LL_DOM_VK_CLEAR; break;
- case KEY_RETURN: llqt_key = LL_DOM_VK_RETURN; break;
- case KEY_PAD_RETURN: llqt_key = LL_DOM_VK_ENTER; break;
- case KEY_SHIFT: llqt_key = LL_DOM_VK_SHIFT; break;
- case KEY_CONTROL: llqt_key = LL_DOM_VK_CONTROL; break;
- case KEY_ALT: llqt_key = LL_DOM_VK_ALT; break;
-// case KEY_XXX: llqt_key = LL_DOM_VK_PAUSE; break;
- case KEY_CAPSLOCK: llqt_key = LL_DOM_VK_CAPS_LOCK; break;
- case KEY_ESCAPE: llqt_key = LL_DOM_VK_ESCAPE; break;
- case KEY_PAGE_UP: llqt_key = LL_DOM_VK_PAGE_UP; break;
- case KEY_PAGE_DOWN: llqt_key = LL_DOM_VK_PAGE_DOWN; break;
- case KEY_END: llqt_key = LL_DOM_VK_END; break;
- case KEY_HOME: llqt_key = LL_DOM_VK_HOME; break;
- case KEY_LEFT: llqt_key = LL_DOM_VK_LEFT; break;
- case KEY_UP: llqt_key = LL_DOM_VK_UP; break;
- case KEY_RIGHT: llqt_key = LL_DOM_VK_RIGHT; break;
- case KEY_DOWN: llqt_key = LL_DOM_VK_DOWN; break;
-// case KEY_XXX: llqt_key = LL_DOM_VK_PRINTSCREEN; break;
- case KEY_INSERT: llqt_key = LL_DOM_VK_INSERT; break;
- case KEY_DELETE: llqt_key = LL_DOM_VK_DELETE; break;
-// case KEY_XXX: llqt_key = LL_DOM_VK_CONTEXT_MENU; break;
-
- default:
- if(key < KEY_SPECIAL)
- {
- // Pass the incoming key through -- it should be regular ASCII, which should be correct for webkit.
- llqt_key = key;
- }
- else
- {
- // Don't pass through untranslated special keys -- they'll be all wrong.
- llqt_key = 0;
- }
- break;
- }
-
-// std::cerr << "keypress, original code = 0x" << std::hex << key << ", converted code = 0x" << std::hex << llqt_key << std::dec << std::endl;
-
- if(llqt_key != 0)
- {
- LLQtWebKit::getInstance()->keyPress( mBrowserWindowId, llqt_key );
- }
-
- checkEditState();
- };
-
- ////////////////////////////////////////////////////////////////////////////////
- //
- void unicodeInput( const std::string &utf8str )
- {
- LLWString wstr = utf8str_to_wstring(utf8str);
-
- unsigned int i;
- for(i=0; i < wstr.size(); i++)
- {
-// std::cerr << "unicode input, code = 0x" << std::hex << (unsigned long)(wstr[i]) << std::dec << std::endl;
-
- LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i]);
- }
-
- checkEditState();
- };
-
- void checkEditState(void)
- {
- bool can_cut = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_CUT);
- bool can_copy = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_COPY);
- bool can_paste = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_PASTE);
-
- if((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste))
- {
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state");
-
- if(can_cut != mCanCut)
- {
- mCanCut = can_cut;
- message.setValueBoolean("cut", can_cut);
- }
-
- if(can_copy != mCanCopy)
- {
- mCanCopy = can_copy;
- message.setValueBoolean("copy", can_copy);
- }
-
- if(can_paste != mCanPaste)
- {
- mCanPaste = can_paste;
- message.setValueBoolean("paste", can_paste);
- }
-
- sendMessage(message);
-
- }
- }
-
-};
-
-MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data) :
- MediaPluginBase(host_send_func, host_user_data)
-{
-// std::cerr << "MediaPluginWebKit constructor" << std::endl;
-
- mBrowserWindowId = 0;
- mBrowserInitialized = false;
- mNeedsUpdate = true;
- mCanCut = false;
- mCanCopy = false;
- mCanPaste = false;
-}
-
-MediaPluginWebKit::~MediaPluginWebKit()
-{
- // unhook observer
- LLQtWebKit::getInstance()->remObserver( mBrowserWindowId, this );
-
- // clean up
- LLQtWebKit::getInstance()->reset();
-
-// std::cerr << "MediaPluginWebKit destructor" << std::endl;
-}
-
-void MediaPluginWebKit::receiveMessage(const char *message_string)
-{
-// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl;
- LLPluginMessage message_in;
-
- if(message_in.parse(message_string) >= 0)
- {
- std::string message_class = message_in.getClass();
- std::string message_name = message_in.getName();
- if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE)
- {
- if(message_name == "init")
- {
- LLPluginMessage message("base", "init_response");
- LLSD versions = LLSD::emptyMap();
- versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION;
- versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION;
- versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION;
- message.setValueLLSD("versions", versions);
-
- std::string plugin_version = "Webkit media plugin, Webkit version ";
- plugin_version += LLQtWebKit::getInstance()->getVersion();
- message.setValue("plugin_version", plugin_version);
- sendMessage(message);
-
- // Plugin gets to decide the texture parameters to use.
- mDepth = 4;
-
- message.setMessage(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params");
- message.setValueS32("default_width", 1024);
- message.setValueS32("default_height", 1024);
- message.setValueS32("depth", mDepth);
- message.setValueU32("internalformat", GL_RGBA);
- message.setValueU32("format", GL_RGBA);
- message.setValueU32("type", GL_UNSIGNED_BYTE);
- message.setValueBoolean("coords_opengl", true);
- sendMessage(message);
- }
- else if(message_name == "idle")
- {
- // no response is necessary here.
- F64 time = message_in.getValueReal("time");
-
- // Convert time to milliseconds for update()
- update((int)(time * 1000.0f));
- }
- else if(message_name == "cleanup")
- {
- // TODO: clean up here
- }
- else if(message_name == "shm_added")
- {
- SharedSegmentInfo info;
- info.mAddress = message_in.getValuePointer("address");
- info.mSize = (size_t)message_in.getValueS32("size");
- std::string name = message_in.getValue("name");
-
-
-// std::cerr << "MediaPluginWebKit::receiveMessage: shared memory added, name: " << name
-// << ", size: " << info.mSize
-// << ", address: " << info.mAddress
-// << std::endl;
-
- mSharedSegments.insert(SharedSegmentMap::value_type(name, info));
-
- }
- else if(message_name == "shm_remove")
- {
- std::string name = message_in.getValue("name");
-
-// std::cerr << "MediaPluginWebKit::receiveMessage: shared memory remove, name = " << name << std::endl;
-
- SharedSegmentMap::iterator iter = mSharedSegments.find(name);
- if(iter != mSharedSegments.end())
- {
- if(mPixels == iter->second.mAddress)
- {
- // This is the currently active pixel buffer. Make sure we stop drawing to it.
- mPixels = NULL;
- mTextureSegmentName.clear();
- }
- mSharedSegments.erase(iter);
- }
- else
- {
-// std::cerr << "MediaPluginWebKit::receiveMessage: unknown shared memory region!" << std::endl;
- }
-
- // Send the response so it can be cleaned up.
- LLPluginMessage message("base", "shm_remove_response");
- message.setValue("name", name);
- sendMessage(message);
- }
- else
- {
-// std::cerr << "MediaPluginWebKit::receiveMessage: unknown base message: " << message_name << std::endl;
- }
- }
- else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA)
- {
- if(message_name == "size_change")
- {
- std::string name = message_in.getValue("name");
- S32 width = message_in.getValueS32("width");
- S32 height = message_in.getValueS32("height");
- S32 texture_width = message_in.getValueS32("texture_width");
- S32 texture_height = message_in.getValueS32("texture_height");
-
- if(!name.empty())
- {
- // Find the shared memory region with this name
- SharedSegmentMap::iterator iter = mSharedSegments.find(name);
- if(iter != mSharedSegments.end())
- {
- mPixels = (unsigned char*)iter->second.mAddress;
- mWidth = width;
- mHeight = height;
-
- // initialize (only gets called once)
- initBrowser();
-
- // size changed so tell the browser
- LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight );
-
-// std::cerr << "webkit plugin: set size to " << mWidth << " x " << mHeight
-// << ", rowspan is " << LLQtWebKit::getInstance()->getBrowserRowSpan(mBrowserWindowId) << std::endl;
-
- S32 real_width = LLQtWebKit::getInstance()->getBrowserRowSpan(mBrowserWindowId) / LLQtWebKit::getInstance()->getBrowserDepth(mBrowserWindowId);
-
- // The actual width the browser will be drawing to is probably smaller... let the host know by modifying texture_width in the response.
- if(real_width <= texture_width)
- {
- texture_width = real_width;
- }
- else
- {
- // This won't work -- it'll be bigger than the allocated memory. This is a fatal error.
-// std::cerr << "Fatal error: browser rowbytes greater than texture width" << std::endl;
- mDeleteMe = true;
- return;
- }
-
- mTextureWidth = texture_width;
- mTextureHeight = texture_height;
-
- };
- };
-
- LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response");
- message.setValue("name", name);
- message.setValueS32("width", width);
- message.setValueS32("height", height);
- message.setValueS32("texture_width", texture_width);
- message.setValueS32("texture_height", texture_height);
- sendMessage(message);
-
- }
- else if(message_name == "load_uri")
- {
- std::string uri = message_in.getValue("uri");
-
-// std::cout << "loading URI: " << uri << std::endl;
-
- if(!uri.empty())
- {
- LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, uri );
- }
- }
- else if(message_name == "mouse_event")
- {
- std::string event = message_in.getValue("event");
- S32 x = message_in.getValueS32("x");
- S32 y = message_in.getValueS32("y");
- // std::string modifiers = message.getValue("modifiers");
-
- if(event == "down")
- {
- mouseDown(x, y);
- //std::cout << "Mouse down at " << x << " x " << y << std::endl;
- }
- else if(event == "up")
- {
- mouseUp(x, y);
- //std::cout << "Mouse up at " << x << " x " << y << std::endl;
- }
- else if(event == "move")
- {
- mouseMove(x, y);
- //std::cout << ">>>>>>>>>>>>>>>>>>>> Mouse move at " << x << " x " << y << std::endl;
- }
- }
- else if(message_name == "scroll_event")
- {
- // S32 x = message_in.getValueS32("x");
- S32 y = message_in.getValueS32("y");
- // std::string modifiers = message.getValue("modifiers");
-
- // We currently ignore horizontal scrolling.
- // The scroll values are roughly 1 per wheel click, so we need to magnify them by some factor.
- // Arbitrarily, I choose 16.
- y *= 16;
- LLQtWebKit::getInstance()->scrollByLines(mBrowserWindowId, y);
- }
- else if(message_name == "key_event")
- {
- std::string event = message_in.getValue("event");
-
- // act on "key down" or "key repeat"
- if ( (event == "down") || (event == "repeat") )
- {
- S32 key = message_in.getValueS32("key");
- keyPress( key );
- };
- }
- else if(message_name == "text_event")
- {
- std::string text = message_in.getValue("text");
-
- unicodeInput(text);
- }
- if(message_name == "edit_cut")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_CUT );
- }
- if(message_name == "edit_copy")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_COPY );
- }
- if(message_name == "edit_paste")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_PASTE );
- }
- else
- {
-// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl;
- };
- }
- else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER)
- {
- if(message_name == "focus")
- {
- bool val = message_in.getValueBoolean("focused");
- LLQtWebKit::getInstance()->focusBrowser( mBrowserWindowId, val );
- }
- else if(message_name == "clear_cache")
- {
- LLQtWebKit::getInstance()->clearCache();
- }
- else if(message_name == "clear_cookies")
- {
- LLQtWebKit::getInstance()->clearAllCookies();
- }
- else if(message_name == "enable_cookies")
- {
- bool val = message_in.getValueBoolean("enable");
- LLQtWebKit::getInstance()->enableCookies( val );
- }
- else if(message_name == "proxy_setup")
- {
- bool val = message_in.getValueBoolean("enable");
- std::string host = message_in.getValue("host");
- int port = message_in.getValueS32("port");
- LLQtWebKit::getInstance()->enableProxy( val, host, port );
- }
- else if(message_name == "browse_stop")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_STOP );
- }
- else if(message_name == "browse_reload")
- {
- // foo = message_in.getValueBoolean("ignore_cache");
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_RELOAD );
- }
- else if(message_name == "browse_forward")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD );
- }
- else if(message_name == "browse_back")
- {
- LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK );
- }
- else if(message_name == "set_status_redirect")
- {
- int code = message_in.getValueS32("code");
- std::string url = message_in.getValue("url");
- if ( 404 == code ) // browser lib only supports 404 right now
- {
- LLQtWebKit::getInstance()->set404RedirectUrl( mBrowserWindowId, url );
- };
- }
- else if(message_name == "set_user_agent")
- {
- std::string user_agent = message_in.getValue("user_agent");
- LLQtWebKit::getInstance()->setBrowserAgentId( user_agent );
- }
- else if(message_name == "init_history")
- {
- // Initialize browser history
- LLSD history = message_in.getValueLLSD("history");
- // First, clear the URL history
- LLQtWebKit::getInstance()->clearHistory(mBrowserWindowId);
- // Then, add the history items in order
- LLSD::array_iterator iter_history = history.beginArray();
- LLSD::array_iterator end_history = history.endArray();
- for(; iter_history != end_history; ++iter_history)
- {
- std::string url = (*iter_history).asString();
- if(! url.empty()) {
- LLQtWebKit::getInstance()->prependHistoryUrl(mBrowserWindowId, url);
- }
- }
- }
- else
- {
-// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media_browser message: " << message_string << std::endl;
- };
- }
- else
- {
-// std::cerr << "MediaPluginWebKit::receiveMessage: unknown message class: " << message_class << std::endl;
- };
- }
-}
-
-int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data)
-{
- MediaPluginWebKit *self = new MediaPluginWebKit(host_send_func, host_user_data);
- *plugin_send_func = MediaPluginWebKit::staticReceiveMessage;
- *plugin_user_data = (void*)self;
-
- return 0;
-}
-
+/** + * @file media_plugin_webkit.cpp + * @brief Webkit plugin for LLMedia API plugin system + * + * $LicenseInfo:firstyear=2008&license=viewergpl$ + * + * Copyright (c) 2008, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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 "llqtwebkit.h" + +#include "linden_common.h" +#include "indra_constants.h" // for indra keyboard codes + +#include "llgl.h" + +#include "llplugininstance.h" +#include "llpluginmessage.h" +#include "llpluginmessageclasses.h" +#include "media_plugin_base.h" + +#if LL_WINDOWS +#include <direct.h> +#else +#include <unistd.h> +#include <stdlib.h> +#endif + +#if LL_WINDOWS + // *NOTE:Mani - This captures the module handle fo rthe dll. This is used below + // to get the path to this dll for webkit initialization. + // I don't know how/if this can be done with apr... + namespace { HMODULE gModuleHandle;}; + BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) + { + gModuleHandle = (HMODULE) hinstDLL; + return TRUE; + } +#endif + +//////////////////////////////////////////////////////////////////////////////// +// +class MediaPluginWebKit : + public MediaPluginBase, + public LLEmbeddedBrowserWindowObserver +{ +public: + MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data); + ~MediaPluginWebKit(); + + /*virtual*/ void receiveMessage(const char *message_string); + +private: + + int mBrowserWindowId; + bool mBrowserInitialized; + bool mNeedsUpdate; + + bool mCanCut; + bool mCanCopy; + bool mCanPaste; + int mLastMouseX; + int mLastMouseY; + bool mFirstFocus; + + //////////////////////////////////////////////////////////////////////////////// + // + void update(int milliseconds) + { + LLQtWebKit::getInstance()->pump( milliseconds ); + + checkEditState(); + + if ( mNeedsUpdate ) + { + const unsigned char* browser_pixels = LLQtWebKit::getInstance()->grabBrowserWindow( mBrowserWindowId ); + + unsigned int buffer_size = LLQtWebKit::getInstance()->getBrowserRowSpan( mBrowserWindowId ) * LLQtWebKit::getInstance()->getBrowserHeight( mBrowserWindowId ); + +// std::cerr << "webkit plugin: updating" << std::endl; + + // TODO: should get rid of this memcpy if possible + if ( mPixels && browser_pixels ) + { +// std::cerr << " memcopy of " << buffer_size << " bytes" << std::endl; + memcpy( mPixels, browser_pixels, buffer_size ); + } + + if ( mWidth > 0 && mHeight > 0 ) + { +// std::cerr << "Setting dirty, " << mWidth << " x " << mHeight << std::endl; + setDirty( 0, 0, mWidth, mHeight ); + } + + mNeedsUpdate = false; + }; + }; + + //////////////////////////////////////////////////////////////////////////////// + // + bool initBrowser() + { + // already initialized + if ( mBrowserInitialized ) + return true; + + // not enough information to initialize the browser yet. + if ( mWidth < 0 || mHeight < 0 || mDepth < 0 || + mTextureWidth < 0 || mTextureHeight < 0 ) + { + return false; + }; + + // set up directories + char cwd[ FILENAME_MAX ]; // I *think* this is defined on all platforms we use + if (NULL == getcwd( cwd, FILENAME_MAX - 1 )) + { + llwarns << "Couldn't get cwd - probably too long - failing to init." << llendl; + return false; + } + std::string application_dir = std::string( cwd ); + +#if LL_WINDOWS + //*NOTE:Mani - On windows, at least, the component path is the + // location of this dll's image file. + std::string component_dir; + char dll_path[_MAX_PATH]; + DWORD len = GetModuleFileNameA(gModuleHandle, (LPCH)&dll_path, _MAX_PATH); + while(len && dll_path[ len ] != ('\\') ) + { + len--; + } + if(len >= 0) + { + dll_path[len] = 0; + component_dir = dll_path; + } + else + { + // *NOTE:Mani - This case should be an rare exception. + // GetModuleFileNameA should always give you a full path, no? + component_dir = application_dir; + } +#else + std::string component_dir = application_dir; +#endif + std::string profileDir = application_dir + "/" + "browser_profile"; // cross platform? + + // window handle - needed on Windows and must be app window. +#if LL_WINDOWS + char window_title[ MAX_PATH ]; + GetConsoleTitleA( window_title, MAX_PATH ); + void* native_window_handle = (void*)FindWindowA( NULL, window_title ); +#else + void* native_window_handle = 0; +#endif + + // main browser initialization + bool result = LLQtWebKit::getInstance()->init( application_dir, component_dir, profileDir, native_window_handle ); + if ( result ) + { + // create single browser window + mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight ); + +#if LL_WINDOWS + // Enable plugins + LLQtWebKit::getInstance()->enablePlugins(true); +#elif LL_DARWIN + // Disable plugins + LLQtWebKit::getInstance()->enablePlugins(false); +#elif LL_LINUX + // Disable plugins + LLQtWebKit::getInstance()->enablePlugins(false); +#endif + + // tell LLQtWebKit about the size of the browser window + LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); + + // observer events that LLQtWebKit emits + LLQtWebKit::getInstance()->addObserver( mBrowserWindowId, this ); + + // append details to agent string + LLQtWebKit::getInstance()->setBrowserAgentId( "LLPluginMedia Web Browser" ); + + // 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 ); + + // 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" ); + + // set flag so we don't do this again + mBrowserInitialized = true; + + return true; + }; + + return false; + }; + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onCursorChanged(const EventType& event) + { + LLQtWebKit::ECursor llqt_cursor = (LLQtWebKit::ECursor)event.getIntValue(); + std::string name; + + switch(llqt_cursor) + { + case LLQtWebKit::C_ARROW: + name = "arrow"; + break; + case LLQtWebKit::C_IBEAM: + name = "ibeam"; + break; + case LLQtWebKit::C_SPLITV: + name = "splitv"; + break; + case LLQtWebKit::C_SPLITH: + name = "splith"; + break; + case LLQtWebKit::C_POINTINGHAND: + name = "hand"; + break; + + default: + llwarns << "Unknown cursor ID: " << (int)llqt_cursor << llendl; + break; + } + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "cursor_changed"); + message.setValue("name", name); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onPageChanged( const EventType& event ) + { + // flag that an update is required + mNeedsUpdate = true; + }; + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onNavigateBegin(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); + message.setValue("uri", event.getEventUri()); + sendMessage(message); + + setStatus(STATUS_LOADING); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onNavigateComplete(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_complete"); + message.setValue("uri", event.getEventUri()); + message.setValueS32("result_code", event.getIntValue()); + message.setValue("result_string", event.getStringValue()); + message.setValueBoolean("history_back_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK)); + message.setValueBoolean("history_forward_available", LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD)); + sendMessage(message); + + setStatus(STATUS_LOADED); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onUpdateProgress(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "progress"); + message.setValueS32("percent", event.getIntValue()); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onStatusTextChange(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "status_text"); + message.setValue("status", event.getStringValue()); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onTitleChange(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text"); + message.setValue("name", event.getStringValue()); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onLocationChange(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "location_changed"); + message.setValue("uri", event.getEventUri()); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onClickLinkHref(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_href"); + message.setValue("uri", event.getStringValue()); + message.setValue("target", event.getStringValue2()); + sendMessage(message); + } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onClickLinkNoFollow(const EventType& event) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "click_nofollow"); + message.setValue("uri", event.getStringValue()); + sendMessage(message); + } + + LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers) + { + int result = 0; + + if(modifiers.find("shift") != std::string::npos) + result |= LLQtWebKit::KM_MODIFIER_SHIFT; + + if(modifiers.find("alt") != std::string::npos) + result |= LLQtWebKit::KM_MODIFIER_ALT; + + if(modifiers.find("control") != std::string::npos) + result |= LLQtWebKit::KM_MODIFIER_CONTROL; + + if(modifiers.find("meta") != std::string::npos) + result |= LLQtWebKit::KM_MODIFIER_META; + + return (LLQtWebKit::EKeyboardModifier)result; + } + + + //////////////////////////////////////////////////////////////////////////////// + // + void keyEvent(LLQtWebKit::EKeyEvent key_event, int key, LLQtWebKit::EKeyboardModifier modifiers) + { + int llqt_key; + + // The incoming values for 'key' will be the ones from indra_constants.h + // the outgoing values are the ones from llqtwebkit.h + + switch((KEY)key) + { + // This is the list that the llqtwebkit implementation actually maps into Qt keys. +// case KEY_XXX: llqt_key = LL_DOM_VK_CANCEL; break; +// case KEY_XXX: llqt_key = LL_DOM_VK_HELP; break; + case KEY_BACKSPACE: llqt_key = LL_DOM_VK_BACK_SPACE; break; + case KEY_TAB: llqt_key = LL_DOM_VK_TAB; break; +// case KEY_XXX: llqt_key = LL_DOM_VK_CLEAR; break; + case KEY_RETURN: llqt_key = LL_DOM_VK_RETURN; break; + case KEY_PAD_RETURN: llqt_key = LL_DOM_VK_ENTER; break; + case KEY_SHIFT: llqt_key = LL_DOM_VK_SHIFT; break; + case KEY_CONTROL: llqt_key = LL_DOM_VK_CONTROL; break; + case KEY_ALT: llqt_key = LL_DOM_VK_ALT; break; +// case KEY_XXX: llqt_key = LL_DOM_VK_PAUSE; break; + case KEY_CAPSLOCK: llqt_key = LL_DOM_VK_CAPS_LOCK; break; + case KEY_ESCAPE: llqt_key = LL_DOM_VK_ESCAPE; break; + case KEY_PAGE_UP: llqt_key = LL_DOM_VK_PAGE_UP; break; + case KEY_PAGE_DOWN: llqt_key = LL_DOM_VK_PAGE_DOWN; break; + case KEY_END: llqt_key = LL_DOM_VK_END; break; + case KEY_HOME: llqt_key = LL_DOM_VK_HOME; break; + case KEY_LEFT: llqt_key = LL_DOM_VK_LEFT; break; + case KEY_UP: llqt_key = LL_DOM_VK_UP; break; + case KEY_RIGHT: llqt_key = LL_DOM_VK_RIGHT; break; + case KEY_DOWN: llqt_key = LL_DOM_VK_DOWN; break; +// case KEY_XXX: llqt_key = LL_DOM_VK_PRINTSCREEN; break; + case KEY_INSERT: llqt_key = LL_DOM_VK_INSERT; break; + case KEY_DELETE: llqt_key = LL_DOM_VK_DELETE; break; +// case KEY_XXX: llqt_key = LL_DOM_VK_CONTEXT_MENU; break; + + default: + if(key < KEY_SPECIAL) + { + // Pass the incoming key through -- it should be regular ASCII, which should be correct for webkit. + llqt_key = key; + } + else + { + // Don't pass through untranslated special keys -- they'll be all wrong. + llqt_key = 0; + } + break; + } + +// std::cerr << "keypress, original code = 0x" << std::hex << key << ", converted code = 0x" << std::hex << llqt_key << std::dec << std::endl; + + if(llqt_key != 0) + { + LLQtWebKit::getInstance()->keyEvent( mBrowserWindowId, key_event, llqt_key, modifiers); + } + + checkEditState(); + }; + + //////////////////////////////////////////////////////////////////////////////// + // + void unicodeInput( const std::string &utf8str, LLQtWebKit::EKeyboardModifier modifiers) + { + LLWString wstr = utf8str_to_wstring(utf8str); + + unsigned int i; + for(i=0; i < wstr.size(); i++) + { +// std::cerr << "unicode input, code = 0x" << std::hex << (unsigned long)(wstr[i]) << std::dec << std::endl; + + LLQtWebKit::getInstance()->unicodeInput(mBrowserWindowId, wstr[i], modifiers); + } + + checkEditState(); + }; + + void checkEditState(void) + { + bool can_cut = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_CUT); + bool can_copy = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_COPY); + bool can_paste = LLQtWebKit::getInstance()->userActionIsEnabled( mBrowserWindowId, LLQtWebKit::UA_EDIT_PASTE); + + if((can_cut != mCanCut) || (can_copy != mCanCopy) || (can_paste != mCanPaste)) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "edit_state"); + + if(can_cut != mCanCut) + { + mCanCut = can_cut; + message.setValueBoolean("cut", can_cut); + } + + if(can_copy != mCanCopy) + { + mCanCopy = can_copy; + message.setValueBoolean("copy", can_copy); + } + + if(can_paste != mCanPaste) + { + mCanPaste = can_paste; + message.setValueBoolean("paste", can_paste); + } + + sendMessage(message); + + } + } + +}; + +MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data) : + MediaPluginBase(host_send_func, host_user_data) +{ +// std::cerr << "MediaPluginWebKit constructor" << std::endl; + + mBrowserWindowId = 0; + mBrowserInitialized = false; + mNeedsUpdate = true; + mCanCut = false; + mCanCopy = false; + mCanPaste = false; + mLastMouseX = 0; + mLastMouseY = 0; + mFirstFocus = true; +} + +MediaPluginWebKit::~MediaPluginWebKit() +{ + // unhook observer + LLQtWebKit::getInstance()->remObserver( mBrowserWindowId, this ); + + // clean up + LLQtWebKit::getInstance()->reset(); + +// std::cerr << "MediaPluginWebKit destructor" << std::endl; +} + +void MediaPluginWebKit::receiveMessage(const char *message_string) +{ +// std::cerr << "MediaPluginWebKit::receiveMessage: received message: \"" << message_string << "\"" << std::endl; + LLPluginMessage message_in; + + if(message_in.parse(message_string) >= 0) + { + std::string message_class = message_in.getClass(); + std::string message_name = message_in.getName(); + if(message_class == LLPLUGIN_MESSAGE_CLASS_BASE) + { + if(message_name == "init") + { + LLPluginMessage message("base", "init_response"); + LLSD versions = LLSD::emptyMap(); + versions[LLPLUGIN_MESSAGE_CLASS_BASE] = LLPLUGIN_MESSAGE_CLASS_BASE_VERSION; + versions[LLPLUGIN_MESSAGE_CLASS_MEDIA] = LLPLUGIN_MESSAGE_CLASS_MEDIA_VERSION; + versions[LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER] = LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER_VERSION; + message.setValueLLSD("versions", versions); + + std::string plugin_version = "Webkit media plugin, Webkit version "; + plugin_version += LLQtWebKit::getInstance()->getVersion(); + message.setValue("plugin_version", plugin_version); + sendMessage(message); + + // Plugin gets to decide the texture parameters to use. + mDepth = 4; + + message.setMessage(LLPLUGIN_MESSAGE_CLASS_MEDIA, "texture_params"); + message.setValueS32("default_width", 1024); + message.setValueS32("default_height", 1024); + message.setValueS32("depth", mDepth); + message.setValueU32("internalformat", GL_RGBA); + message.setValueU32("format", GL_RGBA); + message.setValueU32("type", GL_UNSIGNED_BYTE); + message.setValueBoolean("coords_opengl", true); + sendMessage(message); + } + else if(message_name == "idle") + { + // no response is necessary here. + F64 time = message_in.getValueReal("time"); + + // Convert time to milliseconds for update() + update((int)(time * 1000.0f)); + } + else if(message_name == "cleanup") + { + // TODO: clean up here + } + else if(message_name == "shm_added") + { + SharedSegmentInfo info; + info.mAddress = message_in.getValuePointer("address"); + info.mSize = (size_t)message_in.getValueS32("size"); + std::string name = message_in.getValue("name"); + + +// std::cerr << "MediaPluginWebKit::receiveMessage: shared memory added, name: " << name +// << ", size: " << info.mSize +// << ", address: " << info.mAddress +// << std::endl; + + mSharedSegments.insert(SharedSegmentMap::value_type(name, info)); + + } + else if(message_name == "shm_remove") + { + std::string name = message_in.getValue("name"); + +// std::cerr << "MediaPluginWebKit::receiveMessage: shared memory remove, name = " << name << std::endl; + + SharedSegmentMap::iterator iter = mSharedSegments.find(name); + if(iter != mSharedSegments.end()) + { + if(mPixels == iter->second.mAddress) + { + // This is the currently active pixel buffer. Make sure we stop drawing to it. + mPixels = NULL; + mTextureSegmentName.clear(); + } + mSharedSegments.erase(iter); + } + else + { +// std::cerr << "MediaPluginWebKit::receiveMessage: unknown shared memory region!" << std::endl; + } + + // Send the response so it can be cleaned up. + LLPluginMessage message("base", "shm_remove_response"); + message.setValue("name", name); + sendMessage(message); + } + else + { +// std::cerr << "MediaPluginWebKit::receiveMessage: unknown base message: " << message_name << std::endl; + } + } + else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA) + { + if(message_name == "size_change") + { + std::string name = message_in.getValue("name"); + S32 width = message_in.getValueS32("width"); + S32 height = message_in.getValueS32("height"); + S32 texture_width = message_in.getValueS32("texture_width"); + S32 texture_height = message_in.getValueS32("texture_height"); + + if(!name.empty()) + { + // Find the shared memory region with this name + SharedSegmentMap::iterator iter = mSharedSegments.find(name); + if(iter != mSharedSegments.end()) + { + mPixels = (unsigned char*)iter->second.mAddress; + mWidth = width; + mHeight = height; + + // initialize (only gets called once) + initBrowser(); + + // size changed so tell the browser + LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); + +// std::cerr << "webkit plugin: set size to " << mWidth << " x " << mHeight +// << ", rowspan is " << LLQtWebKit::getInstance()->getBrowserRowSpan(mBrowserWindowId) << std::endl; + + S32 real_width = LLQtWebKit::getInstance()->getBrowserRowSpan(mBrowserWindowId) / LLQtWebKit::getInstance()->getBrowserDepth(mBrowserWindowId); + + // The actual width the browser will be drawing to is probably smaller... let the host know by modifying texture_width in the response. + if(real_width <= texture_width) + { + texture_width = real_width; + } + else + { + // This won't work -- it'll be bigger than the allocated memory. This is a fatal error. +// std::cerr << "Fatal error: browser rowbytes greater than texture width" << std::endl; + mDeleteMe = true; + return; + } + + mTextureWidth = texture_width; + mTextureHeight = texture_height; + + }; + }; + + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "size_change_response"); + message.setValue("name", name); + message.setValueS32("width", width); + message.setValueS32("height", height); + message.setValueS32("texture_width", texture_width); + message.setValueS32("texture_height", texture_height); + sendMessage(message); + + } + else if(message_name == "load_uri") + { + std::string uri = message_in.getValue("uri"); + +// std::cout << "loading URI: " << uri << std::endl; + + if(!uri.empty()) + { + LLQtWebKit::getInstance()->navigateTo( mBrowserWindowId, uri ); + } + } + else if(message_name == "mouse_event") + { + std::string event = message_in.getValue("event"); + S32 button = message_in.getValueS32("button"); + mLastMouseX = message_in.getValueS32("x"); + mLastMouseY = message_in.getValueS32("y"); + std::string modifiers = message_in.getValue("modifiers"); + + // Treat unknown mouse events as mouse-moves. + LLQtWebKit::EMouseEvent mouse_event = LLQtWebKit::ME_MOUSE_MOVE; + if(event == "down") + { + mouse_event = LLQtWebKit::ME_MOUSE_DOWN; + } + else if(event == "up") + { + mouse_event = LLQtWebKit::ME_MOUSE_UP; + } + else if(event == "double_click") + { + mouse_event = LLQtWebKit::ME_MOUSE_DOUBLE_CLICK; + } + + LLQtWebKit::getInstance()->mouseEvent( mBrowserWindowId, mouse_event, button, mLastMouseX, mLastMouseY, decodeModifiers(modifiers)); + checkEditState(); + } + else if(message_name == "scroll_event") + { + S32 x = message_in.getValueS32("x"); + S32 y = message_in.getValueS32("y"); + std::string modifiers = message_in.getValue("modifiers"); + + // Incoming scroll events are adjusted so that 1 detent is approximately 1 unit. + // Qt expects 1 detent to be 120 units. + // It also seems that our y scroll direction is inverted vs. what Qt expects. + + x *= 120; + y *= -120; + + LLQtWebKit::getInstance()->scrollWheelEvent(mBrowserWindowId, mLastMouseX, mLastMouseY, x, y, decodeModifiers(modifiers)); + } + else if(message_name == "key_event") + { + std::string event = message_in.getValue("event"); + S32 key = message_in.getValueS32("key"); + std::string modifiers = message_in.getValue("modifiers"); + + // Treat unknown events as key-up for safety. + LLQtWebKit::EKeyEvent key_event = LLQtWebKit::KE_KEY_UP; + if(event == "down") + { + key_event = LLQtWebKit::KE_KEY_DOWN; + } + else if(event == "repeat") + { + key_event = LLQtWebKit::KE_KEY_REPEAT; + } + + keyEvent(key_event, key, decodeModifiers(modifiers)); + } + else if(message_name == "text_event") + { + std::string text = message_in.getValue("text"); + std::string modifiers = message_in.getValue("modifiers"); + + unicodeInput(text, decodeModifiers(modifiers)); + } + if(message_name == "edit_cut") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_CUT ); + checkEditState(); + } + if(message_name == "edit_copy") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_COPY ); + checkEditState(); + } + if(message_name == "edit_paste") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_EDIT_PASTE ); + checkEditState(); + } + else + { +// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media message: " << message_string << std::endl; + }; + } + else if(message_class == LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER) + { + if(message_name == "focus") + { + bool val = message_in.getValueBoolean("focused"); + LLQtWebKit::getInstance()->focusBrowser( mBrowserWindowId, val ); + + if(mFirstFocus && val) + { + // On the first focus, post a tab key event. This fixes a problem with initial focus. + std::string empty; + keyEvent(LLQtWebKit::KE_KEY_DOWN, KEY_TAB, decodeModifiers(empty)); + keyEvent(LLQtWebKit::KE_KEY_UP, KEY_TAB, decodeModifiers(empty)); + mFirstFocus = false; + } + } + else if(message_name == "clear_cache") + { + LLQtWebKit::getInstance()->clearCache(); + } + else if(message_name == "clear_cookies") + { + LLQtWebKit::getInstance()->clearAllCookies(); + } + else if(message_name == "enable_cookies") + { + bool val = message_in.getValueBoolean("enable"); + LLQtWebKit::getInstance()->enableCookies( val ); + } + else if(message_name == "proxy_setup") + { + bool val = message_in.getValueBoolean("enable"); + std::string host = message_in.getValue("host"); + int port = message_in.getValueS32("port"); + LLQtWebKit::getInstance()->enableProxy( val, host, port ); + } + else if(message_name == "browse_stop") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_STOP ); + } + else if(message_name == "browse_reload") + { + // foo = message_in.getValueBoolean("ignore_cache"); + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_RELOAD ); + } + else if(message_name == "browse_forward") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_FORWARD ); + } + else if(message_name == "browse_back") + { + LLQtWebKit::getInstance()->userAction( mBrowserWindowId, LLQtWebKit::UA_NAVIGATE_BACK ); + } + else if(message_name == "set_status_redirect") + { + int code = message_in.getValueS32("code"); + std::string url = message_in.getValue("url"); + if ( 404 == code ) // browser lib only supports 404 right now + { + LLQtWebKit::getInstance()->set404RedirectUrl( mBrowserWindowId, url ); + }; + } + else if(message_name == "set_user_agent") + { + std::string user_agent = message_in.getValue("user_agent"); + LLQtWebKit::getInstance()->setBrowserAgentId( user_agent ); + } + else if(message_name == "init_history") + { + // Initialize browser history + LLSD history = message_in.getValueLLSD("history"); + // First, clear the URL history + LLQtWebKit::getInstance()->clearHistory(mBrowserWindowId); + // Then, add the history items in order + LLSD::array_iterator iter_history = history.beginArray(); + LLSD::array_iterator end_history = history.endArray(); + for(; iter_history != end_history; ++iter_history) + { + std::string url = (*iter_history).asString(); + if(! url.empty()) { + LLQtWebKit::getInstance()->prependHistoryUrl(mBrowserWindowId, url); + } + } + } + else + { +// std::cerr << "MediaPluginWebKit::receiveMessage: unknown media_browser message: " << message_string << std::endl; + }; + } + else + { +// std::cerr << "MediaPluginWebKit::receiveMessage: unknown message class: " << message_class << std::endl; + }; + } +} + +int init_media_plugin(LLPluginInstance::sendMessageFunction host_send_func, void *host_user_data, LLPluginInstance::sendMessageFunction *plugin_send_func, void **plugin_user_data) +{ + MediaPluginWebKit *self = new MediaPluginWebKit(host_send_func, host_user_data); + *plugin_send_func = MediaPluginWebKit::staticReceiveMessage; + *plugin_user_data = (void*)self; + + return 0; +} + diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index dd3937a6ef..0133d2222d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -63,13 +63,13 @@ include_directories( ) set(viewer_SOURCE_FILES - llaccordionctrltab.cpp llaccordionctrl.cpp + llaccordionctrltab.cpp llagent.cpp - llagentlistener.cpp llagentaccess.cpp llagentdata.cpp llagentlanguage.cpp + llagentlistener.cpp llagentpicksinfo.cpp llagentpilot.cpp llagentui.cpp @@ -78,8 +78,8 @@ set(viewer_SOURCE_FILES llappearancemgr.cpp llappviewer.cpp llappviewerlistener.cpp - llassetuploadresponders.cpp llassetuploadqueue.cpp + llassetuploadresponders.cpp llaudiosourcevo.cpp llavataractions.cpp llavatariconctrl.cpp @@ -95,8 +95,8 @@ set(viewer_SOURCE_FILES llcaphttpsender.cpp llchannelmanager.cpp llchatbar.cpp - llchatitemscontainerctrl.cpp llchathistory.cpp + llchatitemscontainerctrl.cpp llchatmsgbox.cpp llchiclet.cpp llclassifiedinfo.cpp @@ -116,10 +116,10 @@ set(viewer_SOURCE_FILES lldirpicker.cpp lldndbutton.cpp lldrawable.cpp + lldrawpool.cpp lldrawpoolalpha.cpp lldrawpoolavatar.cpp lldrawpoolbump.cpp - lldrawpool.cpp lldrawpoolground.cpp lldrawpoolsimple.cpp lldrawpoolsky.cpp @@ -151,8 +151,8 @@ set(viewer_SOURCE_FILES llfloaterbuildoptions.cpp llfloaterbulkpermission.cpp llfloaterbump.cpp - llfloaterbuycontents.cpp llfloaterbuy.cpp + llfloaterbuycontents.cpp llfloaterbuycurrency.cpp llfloaterbuyland.cpp llfloatercall.cpp @@ -163,8 +163,8 @@ set(viewer_SOURCE_FILES llfloatercustomize.cpp llfloaterdaycycle.cpp llfloaterenvsettings.cpp - llfloaterfriends.cpp llfloaterfonttest.cpp + llfloaterfriends.cpp llfloatergesture.cpp llfloatergodtools.cpp llfloatergroupinvite.cpp @@ -172,8 +172,6 @@ set(viewer_SOURCE_FILES llfloaterhandler.cpp llfloaterhardwaresettings.cpp llfloaterhelpbrowser.cpp - llfloatermediabrowser.cpp - llfloatermediasettings.cpp llfloaterhud.cpp llfloaterimagepreview.cpp llfloaterinspect.cpp @@ -183,8 +181,11 @@ set(viewer_SOURCE_FILES llfloaterland.cpp llfloaterlandholdings.cpp llfloatermap.cpp + llfloatermediabrowser.cpp + llfloatermediasettings.cpp llfloatermemleak.cpp llfloaternamedesc.cpp + llfloaternearbymedia.cpp llfloaternotificationsconsole.cpp llfloateropenobject.cpp llfloaterparcel.cpp @@ -227,8 +228,8 @@ set(viewer_SOURCE_FILES llgroupmgr.cpp llgroupnotify.cpp llhomelocationresponder.cpp - llhudeffectbeam.cpp llhudeffect.cpp + llhudeffectbeam.cpp llhudeffectlookat.cpp llhudeffectpointat.cpp llhudeffecttrail.cpp @@ -238,11 +239,11 @@ set(viewer_SOURCE_FILES llhudrender.cpp llhudtext.cpp llhudview.cpp + llimcontrolpanel.cpp llimfloater.cpp llimhandler.cpp llimpanel.cpp llimview.cpp - llimcontrolpanel.cpp llinspect.cpp llinspectavatar.cpp llinspectgroup.cpp @@ -260,7 +261,6 @@ set(viewer_SOURCE_FILES lllocaltextureobject.cpp lllocationhistory.cpp lllocationinputctrl.cpp - llurllineeditorctrl.cpp lllogchat.cpp llloginhandler.cpp lllogininstance.cpp @@ -312,8 +312,8 @@ set(viewer_SOURCE_FILES llpanelgrouplandmoney.cpp llpanelgroupnotices.cpp llpanelgrouproles.cpp - llpanelinventory.cpp llpanelimcontrolpanel.cpp + llpanelinventory.cpp llpanelland.cpp llpanellandaudio.cpp llpanellandmarks.cpp @@ -322,11 +322,10 @@ set(viewer_SOURCE_FILES llpanellookinfo.cpp llpanellooks.cpp llpanelmedia.cpp - llpanelmediahud.cpp - llpanelmeprofile.cpp llpanelmediasettingsgeneral.cpp - llpanelmediasettingssecurity.cpp llpanelmediasettingspermissions.cpp + llpanelmediasettingssecurity.cpp + llpanelmeprofile.cpp llpanelobject.cpp llpanelpeople.cpp llpanelpeoplemenus.cpp @@ -335,11 +334,12 @@ set(viewer_SOURCE_FILES llpanelpicks.cpp llpanelplace.cpp llpanelplaceinfo.cpp - llpanelshower.cpp llpanelplaces.cpp llpanelplacestab.cpp + llpanelprimmediacontrols.cpp llpanelprofile.cpp llpanelprofileview.cpp + llpanelshower.cpp llpanelteleporthistory.cpp llpanelvolume.cpp llparcelselection.cpp @@ -348,8 +348,8 @@ set(viewer_SOURCE_FILES llplacesinventorybridge.cpp llpolymesh.cpp llpolymorph.cpp - llpreviewanim.cpp llpreview.cpp + llpreviewanim.cpp llpreviewgesture.cpp llpreviewnotecard.cpp llpreviewscript.cpp @@ -371,6 +371,7 @@ set(viewer_SOURCE_FILES llsky.cpp llslurl.cpp llspatialpartition.cpp + llspeakers.cpp llsplitbutton.cpp llsprite.cpp llstartup.cpp @@ -397,10 +398,10 @@ set(viewer_SOURCE_FILES lltoastimpanel.cpp lltoastnotifypanel.cpp lltoastpanel.cpp + lltool.cpp lltoolbar.cpp lltoolbrush.cpp lltoolcomp.cpp - lltool.cpp lltooldraganddrop.cpp lltoolface.cpp lltoolfocus.cpp @@ -424,6 +425,7 @@ set(viewer_SOURCE_FILES llurl.cpp llurldispatcher.cpp llurlhistory.cpp + llurllineeditorctrl.cpp llurlsimstring.cpp llurlwhitelist.cpp llvectorperfoptions.cpp @@ -440,18 +442,18 @@ set(viewer_SOURCE_FILES llviewerhelp.cpp llviewerhelputil.cpp llviewerinventory.cpp - llviewerjointattachment.cpp llviewerjoint.cpp + llviewerjointattachment.cpp llviewerjointmesh.cpp - llviewerjointmesh_sse2.cpp llviewerjointmesh_sse.cpp + llviewerjointmesh_sse2.cpp llviewerjointmesh_vec.cpp llviewerjoystick.cpp llviewerkeyboard.cpp llviewerlayer.cpp llviewermedia.cpp - llviewermediafocus.cpp llviewermedia_streamingaudio.cpp + llviewermediafocus.cpp llviewermenu.cpp llviewermenufile.cpp llviewermessage.cpp @@ -484,10 +486,11 @@ set(viewer_SOURCE_FILES llvoclouds.cpp llvograss.cpp llvoground.cpp + llvoicechannel.cpp llvoiceclient.cpp + llvoicecontrolpanel.cpp llvoiceremotectrl.cpp llvoicevisualizer.cpp - llvoicecontrolpanel.cpp llvoinventorylistener.cpp llvopartgroup.cpp llvosky.cpp @@ -538,25 +541,25 @@ endif (LINUX) set(viewer_HEADER_FILES CMakeLists.txt ViewerInstall.cmake - llaccordionctrltab.h llaccordionctrl.h + llaccordionctrltab.h llagent.h - llagentlistener.h llagentaccess.h llagentdata.h llagentlanguage.h + llagentlistener.h llagentpicksinfo.h llagentpilot.h llagentui.h llagentwearables.h llanimstatelabels.h llappearance.h + llappearancemgr.h llappviewer.h llappviewerlistener.h - llassetuploadresponders.h llassetuploadqueue.h + llassetuploadresponders.h llaudiosourcevo.h - llappearancemgr.h llavataractions.h llavatariconctrl.h llavatarlist.h @@ -572,8 +575,8 @@ set(viewer_HEADER_FILES llcaphttpsender.h llchannelmanager.h llchatbar.h - llchatitemscontainerctrl.h llchathistory.h + llchatitemscontainerctrl.h llchatmsgbox.h llchiclet.h llclassifiedinfo.h @@ -650,8 +653,6 @@ set(viewer_HEADER_FILES llfloaterhandler.h llfloaterhardwaresettings.h llfloaterhelpbrowser.h - llfloatermediabrowser.h - llfloatermediasettings.h llfloaterhud.h llfloaterimagepreview.h llfloaterinspect.h @@ -661,16 +662,19 @@ set(viewer_HEADER_FILES llfloaterland.h llfloaterlandholdings.h llfloatermap.h + llfloatermediabrowser.h + llfloatermediasettings.h llfloatermemleak.h llfloaternamedesc.h + llfloaternearbymedia.h llfloaternotificationsconsole.h llfloateropenobject.h llfloaterparcel.h llfloaterpay.h + llfloaterperms.h llfloaterpostcard.h llfloaterpostprocess.h llfloaterpreference.h - llfloaterperms.h llfloaterproperties.h llfloaterregioninfo.h llfloaterreporter.h @@ -716,12 +720,12 @@ set(viewer_HEADER_FILES llhudrender.h llhudtext.h llhudview.h + llimcontrolpanel.h llimfloater.h llimpanel.h llimview.h - llimcontrolpanel.h - llinspectavatar.h llinspect.h + llinspectavatar.h llinspectgroup.h llinspectobject.h llinventorybridge.h @@ -738,7 +742,6 @@ set(viewer_HEADER_FILES lllocaltextureobject.h lllocationhistory.h lllocationinputctrl.h - llurllineeditorctrl.h lllogchat.h llloginhandler.h lllogininstance.h @@ -747,6 +750,7 @@ set(viewer_HEADER_FILES llmanipscale.h llmaniptranslate.h llmapresponders.h + llmediactrl.h llmediadataclient.h llmediaremotectrl.h llmemoryview.h @@ -786,8 +790,8 @@ set(viewer_HEADER_FILES llpanelgrouplandmoney.h llpanelgroupnotices.h llpanelgrouproles.h - llpanelinventory.h llpanelimcontrolpanel.h + llpanelinventory.h llpanelland.h llpanellandaudio.h llpanellandmarks.h @@ -796,11 +800,10 @@ set(viewer_HEADER_FILES llpanellookinfo.h llpanellooks.h llpanelmedia.h - llpanelmediahud.h - llpanelmeprofile.h llpanelmediasettingsgeneral.h - llpanelmediasettingssecurity.h llpanelmediasettingspermissions.h + llpanelmediasettingssecurity.h + llpanelmeprofile.h llpanelobject.h llpanelpeople.h llpanelpeoplemenus.h @@ -809,11 +812,12 @@ set(viewer_HEADER_FILES llpanelpicks.h llpanelplace.h llpanelplaceinfo.h - llpanelshower.h llpanelplaces.h llpanelplacestab.h + llpanelprimmediacontrols.h llpanelprofile.h llpanelprofileview.h + llpanelshower.h llpanelteleporthistory.h llpanelvolume.h llparcelselection.h @@ -836,9 +840,9 @@ set(viewer_HEADER_FILES llremoteparcelrequest.h llresourcedata.h llrootview.h + llsavedsettingsglue.h llscreenchannel.h llscrollingpanelparam.h - llsavedsettingsglue.h llsearchcombobox.h llsearchhistory.h llselectmgr.h @@ -847,6 +851,7 @@ set(viewer_HEADER_FILES llsky.h llslurl.h llspatialpartition.h + llspeakers.h llsplitbutton.h llsprite.h llstartup.h @@ -902,6 +907,7 @@ set(viewer_HEADER_FILES llurl.h llurldispatcher.h llurlhistory.h + llurllineeditorctrl.h llurlsimstring.h llurlwhitelist.h llvectorperfoptions.h @@ -925,8 +931,8 @@ set(viewer_HEADER_FILES llviewerkeyboard.h llviewerlayer.h llviewermedia.h - llviewermediaobserver.h llviewermediafocus.h + llviewermediaobserver.h llviewermenu.h llviewermenufile.h llviewermessage.h @@ -960,10 +966,11 @@ set(viewer_HEADER_FILES llvoclouds.h llvograss.h llvoground.h + llvoicechannel.h llvoiceclient.h + llvoicecontrolpanel.h llvoiceremotectrl.h llvoicevisualizer.h - llvoicecontrolpanel.h llvoinventorylistener.h llvopartgroup.h llvosky.h @@ -981,7 +988,6 @@ set(viewer_HEADER_FILES llwearabledictionary.h llwearablelist.h llweb.h - llmediactrl.h llwind.h llwindebug.h llwlanimator.h diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index eb045349c2..c4722b772e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3631,6 +3631,17 @@ <key>Value</key> <integer>1</integer> </map> + <key>IMShowControlPanel</key> + <map> + <key>Comment</key> + <string>Show IM Control Panel</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>IgnoreAllNotifications</key> <map> <key>Comment</key> @@ -4875,7 +4886,7 @@ <key>Value</key> <integer>10</integer> </map> - <key>ToastOpaqueTime</key> + <key>ToastFadingTime</key> <map> <key>Comment</key> <string>Number of seconds while a toast is fading </string> @@ -4887,6 +4898,29 @@ <integer>1</integer> </map> <key>StartUpToastLifeTime</key> + <key>NearbyToastFadingTime</key> + <map> + <key>Comment</key> + <string>Number of seconds while a nearby chat toast is fading </string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>3</integer> + </map> + <key>NearbyToastLifeTime</key> + <map> + <key>Comment</key> + <string>Number of seconds while a nearby chat toast exists</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>23</integer> + </map> + <key>StartUpToastLifeTime</key> <map> <key>Comment</key> <string>Number of seconds while a StartUp toast exist</string> @@ -7340,17 +7374,6 @@ <key>Value</key> <integer>0</integer> </map> - <key>ScriptErrorsAsChat</key> - <map> - <key>Comment</key> - <string>Display script errors and warning in chat history</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>Boolean</string> - <key>Value</key> - <integer>0</integer> - </map> <key>ScriptHelpFollowsCursor</key> <map> <key>Comment</key> @@ -7665,6 +7688,28 @@ <key>Value</key> <integer>1</integer> </map> + <key>ShowScriptErrors</key> + <map> + <key>Comment</key> + <string>Show script errors</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>ShowScriptErrorsLocation</key> + <map> + <key>Comment</key> + <string>Show script error in chat or window</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>S32</string> + <key>Value</key> + <integer>0</integer> + </map> <key>ShowSnapshotButton</key> <map> <key>Comment</key> @@ -7731,6 +7776,39 @@ <key>Value</key> <integer>1</integer> </map> + <key>FriendsListShowIcons</key> + <map> + <key>Comment</key> + <string>Show/hide online and all friends icons in the friend list</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>NearbyListShowIcons</key> + <map> + <key>Comment</key> + <string>Show/hide people icons in nearby list</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> + <key>RecentListShowIcons</key> + <map> + <key>Comment</key> + <string>Show/hide people icons in recent list</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>1</integer> + </map> <key>FriendsSortOrder</key> <map> <key>Comment</key> @@ -8768,13 +8846,13 @@ <key>UICloseBoxFromTop</key> <map> <key>Comment</key> - <string>Size of UI floater close box from top</string> + <string>Distance from top of floater to top of close box icon, pixels</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <real>1</real> + <real>5</real> </map> <key>UIExtraTriangleHeight</key> <map> @@ -8809,17 +8887,6 @@ <key>Value</key> <real>16</real> </map> - <key>UIFloaterHeaderSize</key> - <map> - <key>Comment</key> - <string>Size of UI floater header size</string> - <key>Persist</key> - <integer>1</integer> - <key>Type</key> - <string>S32</string> - <key>Value</key> - <real>18</real> - </map> <key>UIFloaterHPad</key> <map> <key>Comment</key> @@ -8842,16 +8909,16 @@ <key>Value</key> <integer>0</integer> </map> - <key>UIFloaterVPad</key> + <key>UIFloaterTitleVPad</key> <map> <key>Comment</key> - <string>Size of UI floater vertical pad</string> + <string>Distance from top of floater to top of title string, pixels</string> <key>Persist</key> <integer>1</integer> <key>Type</key> <string>S32</string> <key>Value</key> - <real>6</real> + <real>7</real> </map> <key>UIImgDefaultEyesUUID</key> <map> @@ -8963,17 +9030,6 @@ <key>Value</key> <string>5748decc-f629-461c-9a36-a35a221fe21f</string> </map> - <key>UIImgDefaultTattooUUID</key> - <map> - <key>Comment</key> - <string /> - <key>Persist</key> - <integer>0</integer> - <key>Type</key> - <string>String</string> - <key>Value</key> - <string>5748decc-f629-461c-9a36-a35a221fe21f</string> - </map> <key>UIImgDefaultUnderwearUUID</key> <map> <key>Comment</key> @@ -10449,6 +10505,17 @@ <key>Value</key> <real>90.0</real> </map> + <key>YouAreHereDistance</key> + <map> + <key>Comment</key> + <string>Radius of distance for banner that indicates if the resident is "on" the Place.(meters from avatar to requested place)</string> + <key>Persist</key> + <integer>1</integer> + <key>Type</key> + <string>F32</string> + <key>Value</key> + <real>10.0</real> + </map> <key>YieldTime</key> <map> <key>Comment</key> diff --git a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl index 8bd702a8da..28908a311d 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/blurLightF.glsl @@ -46,11 +46,15 @@ void main() dlt /= max(-pos.z*dist_factor, 1.0); - vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' + vec2 defined_weight = kern[0].xy; // special case the kern[0] (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' vec4 col = defined_weight.xyxx * ccol; + + float center_e = 1.0 - (texture2DRect(edgeMap, vary_fragcoord.xy).a+ + texture2DRect(edgeMap, vary_fragcoord.xy+dlt*0.333).a+ + texture2DRect(edgeMap, vary_fragcoord.xy-dlt*0.333).a); - float e = 1.0; - for (int i = 0; i < 4; i++) + float e = center_e; + for (int i = 1; i < 4; i++) { vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; @@ -67,10 +71,8 @@ void main() texture2DRect(edgeMap, tc.xy-dlt*0.333).a; } - - e = 1.0; - - for (int i = 0; i < 4; i++) + e = center_e; + for (int i = 1; i < 4; i++) { vec2 tc = vary_fragcoord.xy - kern[i].z*dlt; diff --git a/indra/newview/character/avatar_lad.xml b/indra/newview/character/avatar_lad.xml index f3bfa37cea..c43ba27984 100644 --- a/indra/newview/character/avatar_lad.xml +++ b/indra/newview/character/avatar_lad.xml @@ -5589,6 +5589,13 @@ </layer> <layer + name="hair texture alpha layer" + visibility_mask="TRUE"> + <texture + local_texture="hair_grain" /> + </layer> + + <layer name="hair alpha" visibility_mask="TRUE"> <texture diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index f62606cc50..75a72e5b17 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -42,7 +42,7 @@ #include "lldrawable.h" #include "llfirstuse.h" #include "llfloaterreg.h" -#include "llfloateractivespeakers.h" +#include "llspeakers.h" #include "llfloatercamera.h" #include "llfloatercustomize.h" @@ -5391,12 +5391,6 @@ void update_group_floaters(const LLUUID& group_id) //*TODO Implement group update for Profile View // still actual as of July 31, 2009 (DZ) - if (gIMMgr) - { - // update the talk view - gIMMgr->refresh(); - } - gAgent.fireEvent(new LLOldEvents::LLEvent(&gAgent, "new group"), ""); } diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 1a69f1d975..09f7c49f23 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -89,6 +89,11 @@ std::string LLAgentUI::buildSLURL(const bool escaped /*= true*/) return slurl; } +//static +BOOL LLAgentUI::checkAgentDistance(const LLVector3& pole, F32 radius) +{ + return (gAgent.getPositionAgent() - pole).length() < radius; +} BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const LLVector3& agent_pos_region) { LLViewerRegion* region = gAgent.getRegion(); diff --git a/indra/newview/llagentui.h b/indra/newview/llagentui.h index 47ecb04547..c7aafb71e7 100644 --- a/indra/newview/llagentui.h +++ b/indra/newview/llagentui.h @@ -52,6 +52,11 @@ public: static BOOL buildLocationString(std::string& str, ELocationFormat fmt = LOCATION_FORMAT_LANDMARK); //build location string using a region position of the avatar. static BOOL buildLocationString(std::string& str, ELocationFormat fmt,const LLVector3& agent_pos_region); + /** + * @brief Check whether the agent is in neighborhood of the pole Within same region + * @return true if the agent is in neighborhood. + */ + static BOOL checkAgentDistance(const LLVector3& local_pole, F32 radius); }; #endif //LLAGENTUI_H diff --git a/indra/newview/llagentwearables.cpp b/indra/newview/llagentwearables.cpp index b976e6b2bd..380469f5b3 100644 --- a/indra/newview/llagentwearables.cpp +++ b/indra/newview/llagentwearables.cpp @@ -649,6 +649,7 @@ void LLAgentWearables::setWearable(const EWearableType type, U32 index, LLWearab else { wearable_vec[index] = wearable; + mAvatarObject->wearableUpdated(wearable->getType()); } } @@ -663,6 +664,7 @@ U32 LLAgentWearables::pushWearable(const EWearableType type, LLWearable *wearabl if (type < WT_COUNT || mWearableDatas[type].size() < MAX_WEARABLES_PER_TYPE) { mWearableDatas[type].push_back(wearable); + mAvatarObject->wearableUpdated(wearable->getType()); return mWearableDatas[type].size()-1; } return MAX_WEARABLES_PER_TYPE; @@ -687,9 +689,11 @@ void LLAgentWearables::popWearable(LLWearable *wearable) void LLAgentWearables::popWearable(const EWearableType type, U32 index) { - if (getWearable(type, index)) + LLWearable *wearable = getWearable(type, index); + if (wearable) { mWearableDatas[type].erase(mWearableDatas[type].begin() + index); + mAvatarObject->wearableUpdated(wearable->getType()); } } @@ -1981,6 +1985,17 @@ bool LLAgentWearables::canWearableBeRemoved(const LLWearable* wearable) const return !(((type == WT_SHAPE) || (type == WT_SKIN) || (type == WT_HAIR) || (type == WT_EYES)) && (getWearableCount(type) <= 1) ); } +void LLAgentWearables::animateAllWearableParams(F32 delta, BOOL set_by_user) +{ + for( S32 type = 0; type < WT_COUNT; ++type ) + { + for (S32 count = 0; count < (S32)getWearableCount((EWearableType)type); ++count) + { + LLWearable *wearable = getWearable((EWearableType)type,count); + wearable->animateParams(delta, set_by_user); + } + } +} void LLAgentWearables::updateServer() { diff --git a/indra/newview/llagentwearables.h b/indra/newview/llagentwearables.h index 8e1bef88c3..97de785c87 100644 --- a/indra/newview/llagentwearables.h +++ b/indra/newview/llagentwearables.h @@ -79,6 +79,8 @@ public: // Note: False for shape, skin, eyes, and hair, unless you have MORE than 1. bool canWearableBeRemoved(const LLWearable* wearable) const; + + void animateAllWearableParams(F32 delta, BOOL set_by_user); //-------------------------------------------------------------------- // Accessors @@ -114,6 +116,7 @@ public: void setWearableName(const LLUUID& item_id, const std::string& new_name); void addLocalTextureObject(const EWearableType wearable_type, const LLVOAvatarDefines::ETextureIndex texture_type, U32 wearable_index); U32 getWearableIndex(LLWearable *wearable); + protected: void setWearableFinal(LLInventoryItem* new_item, LLWearable* new_wearable, bool do_append = false); static bool onSetWearableDialog(const LLSD& notification, const LLSD& response, LLWearable* wearable); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 923a66ee8e..873215169e 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -49,7 +49,6 @@ #include "llviewerstats.h" #include "llmd5.h" #include "llpumpio.h" -#include "llimpanel.h" #include "llmimetypes.h" #include "llslurl.h" #include "llstartup.h" @@ -76,6 +75,7 @@ #include "llteleporthistory.h" #include "lllocationhistory.h" #include "llfasttimerview.h" +#include "llvoicechannel.h" #include "llweb.h" #include "llsecondlifeurls.h" @@ -227,7 +227,6 @@ const F32 DEFAULT_AFK_TIMEOUT = 5.f * 60.f; // time with no input before user fl F32 gSimLastTime; // Used in LLAppViewer::init and send_stats() F32 gSimFrames; -BOOL gAllowTapTapHoldRun = TRUE; BOOL gShowObjectUpdates = FALSE; BOOL gUseQuickTime = TRUE; @@ -239,8 +238,6 @@ U32 gFrameCount = 0; U32 gForegroundFrameCount = 0; // number of frames that app window was in foreground LLPumpIO* gServicePump = NULL; -BOOL gPacificDaylightTime = FALSE; - U64 gFrameTime = 0; F32 gFrameTimeSeconds = 0.f; F32 gFrameIntervalSeconds = 0.f; @@ -421,7 +418,6 @@ static void settings_to_globals() gAgent.setHideGroupTitle(gSavedSettings.getBOOL("RenderHideGroupTitle")); gDebugWindowProc = gSavedSettings.getBOOL("DebugWindowProc"); - gAllowTapTapHoldRun = gSavedSettings.getBOOL("AllowTapTapHoldRun"); gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); gMapScale = gSavedSettings.getF32("MapScale"); @@ -1350,7 +1346,11 @@ bool LLAppViewer::cleanup() // Destroy the UI if( gViewerWindow) gViewerWindow->shutdownViews(); - + + // Cleanup Inventory after the UI since it will delete any remaining observers + // (Deleted observers should have already removed themselves) + gInventory.cleanupInventory(); + // Clean up selection managers after UI is destroyed, as UI may be observing them. // Clean up before GL is shut down because we might be holding on to objects with texture references LLSelectMgr::cleanupGlobals(); @@ -2400,7 +2400,6 @@ void LLAppViewer::cleanupSavedSettings() gSavedSettings.setBOOL("DebugWindowProc", gDebugWindowProc); - gSavedSettings.setBOOL("AllowTapTapHoldRun", gAllowTapTapHoldRun); gSavedSettings.setBOOL("ShowObjectUpdates", gShowObjectUpdates); if (!gNoRender) diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index f95d7cb412..73256a8fe6 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -282,8 +282,6 @@ const S32 AGENT_UPDATES_PER_SECOND = 10; // "// llstartup" indicates that llstartup is the only client for this global. extern LLSD gDebugInfo; - -extern BOOL gAllowTapTapHoldRun; extern BOOL gShowObjectUpdates; typedef enum @@ -303,10 +301,6 @@ extern U32 gForegroundFrameCount; extern LLPumpIO* gServicePump; -// Is the Pacific time zone (aka server time zone) -// currently in daylight savings time? -extern BOOL gPacificDaylightTime; - extern U64 gFrameTime; // The timestamp of the most-recently-processed frame extern F32 gFrameTimeSeconds; // Loses msec precision after ~4.5 hours... extern F32 gFrameIntervalSeconds; // Elapsed time between current and previous gFrameTimeSeconds diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index ebcda13dd4..b56e8d1ec2 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -155,6 +155,8 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) mPriority = LLViewerFetchedTexture::BOOST_ICON; LLRect rect = p.rect; + mDrawWidth = llmax(32, rect.getWidth()) ; + mDrawHeight = llmax(32, rect.getHeight()) ; static LLUICachedControl<S32> llavatariconctrl_symbol_hpad("UIAvatariconctrlSymbolHPad", 2); static LLUICachedControl<S32> llavatariconctrl_symbol_vpad("UIAvatariconctrlSymbolVPad", 2); @@ -193,7 +195,6 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) LLIconCtrl::setValue("default_profile_picture.j2c"); } - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; registrar.add("AvatarIcon.Action", boost::bind(&LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked, this, _2)); diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 426fcec514..65b5c86ed5 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -103,6 +103,8 @@ public: const std::string& getFirstName() const { return mFirstName; } const std::string& getLastName() const { return mLastName; } + void setDrawTooltip(bool value) { mDrawTooltip = value;} + protected: LLUUID mAvatarId; std::string mFirstName; diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 3a07c6e5ef..7b2dc02864 100644 --- a/indra/newview/llavatarlist.cpp +++ b/indra/newview/llavatarlist.cpp @@ -37,14 +37,34 @@ // newview #include "llcallingcard.h" // for LLAvatarTracker #include "llcachename.h" +#include "llrecentpeople.h" #include "llvoiceclient.h" +#include "llviewercontrol.h" // for gSavedSettings static LLDefaultChildRegistry::Register<LLAvatarList> r("avatar_list"); +// Last interaction time update period. +static const F32 LIT_UPDATE_PERIOD = 5; + // Maximum number of avatars that can be added to a list in one pass. // Used to limit time spent for avatar list update per frame. static const unsigned ADD_LIMIT = 50; +void LLAvatarList::toggleIcons() +{ + // Save the new value for new items to use. + mShowIcons = !mShowIcons; + gSavedSettings.setBOOL(mIconParamName, mShowIcons); + + // Show/hide icons for all existing items. + std::vector<LLPanel*> items; + getItems(items); + for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) + { + static_cast<LLAvatarListItem*>(*it)->setAvatarIconVisible(mShowIcons); + } +} + static bool findInsensitive(std::string haystack, const std::string& needle_upper) { LLStringUtil::toUpper(haystack); @@ -58,28 +78,63 @@ static const LLFlatListView::ItemReverseComparator REVERSE_NAME_COMPARATOR(NAME_ LLAvatarList::Params::Params() : ignore_online_status("ignore_online_status", false) +, show_last_interaction_time("show_last_interaction_time", false) +, show_info_btn("show_info_btn", true) +, show_profile_btn("show_profile_btn", true) { } LLAvatarList::LLAvatarList(const Params& p) : LLFlatListView(p) , mIgnoreOnlineStatus(p.ignore_online_status) +, mShowLastInteractionTime(p.show_last_interaction_time) , mContextMenu(NULL) , mDirty(true) // to force initial update +, mLITUpdateTimer(NULL) +, mShowIcons(true) +, mShowInfoBtn(p.show_info_btn) +, mShowProfileBtn(p.show_profile_btn) { setCommitOnSelectionChange(true); // Set default sort order. setComparator(&NAME_COMPARATOR); + + if (mShowLastInteractionTime) + { + mLITUpdateTimer = new LLTimer(); + mLITUpdateTimer->setTimerExpirySec(0); // zero to force initial update + mLITUpdateTimer->start(); + } +} + +LLAvatarList::~LLAvatarList() +{ + delete mLITUpdateTimer; +} + +void LLAvatarList::setShowIcons(std::string param_name) +{ + mIconParamName= param_name; + mShowIcons = gSavedSettings.getBOOL(mIconParamName); } // virtual void LLAvatarList::draw() { + // *NOTE dzaporozhan + // Call refresh() after draw() to avoid flickering of avatar list items. + + LLFlatListView::draw(); + if (mDirty) refresh(); - LLFlatListView::draw(); + if (mShowLastInteractionTime && mLITUpdateTimer->hasExpired()) + { + updateLastInteractionTimes(); + mLITUpdateTimer->setTimerExpirySec(LIT_UPDATE_PERIOD); // restart the timer + } } void LLAvatarList::setNameFilter(const std::string& filter) @@ -193,15 +248,18 @@ void LLAvatarList::refresh() void LLAvatarList::addNewItem(const LLUUID& id, const std::string& name, BOOL is_online, EAddPosition pos) { LLAvatarListItem* item = new LLAvatarListItem(); - item->showStatus(false); item->showInfoBtn(true); item->showSpeakingIndicator(true); item->setName(name); item->setAvatarId(id, mIgnoreOnlineStatus); item->setOnline(mIgnoreOnlineStatus ? true : is_online); + item->showLastInteractionTime(mShowLastInteractionTime); item->setContextMenu(mContextMenu); item->childSetVisible("info_btn", false); + item->setAvatarIconVisible(mShowIcons); + item->setShowInfoBtn(mShowInfoBtn); + item->setShowProfileBtn(mShowProfileBtn); addItem(item, id, pos); } @@ -253,6 +311,54 @@ void LLAvatarList::computeDifference( vadded.erase(it, vadded.end()); } +static std::string format_secs(S32 secs) +{ + // *TODO: reinventing the wheel? + // *TODO: i18n + static const int LL_AL_MIN = 60; + static const int LL_AL_HOUR = LL_AL_MIN * 60; + static const int LL_AL_DAY = LL_AL_HOUR * 24; + static const int LL_AL_WEEK = LL_AL_DAY * 7; + static const int LL_AL_MONTH = LL_AL_DAY * 31; + static const int LL_AL_YEAR = LL_AL_DAY * 365; + + std::string s; + + if (secs >= LL_AL_YEAR) + s = llformat("%dy", secs / LL_AL_YEAR); + else if (secs >= LL_AL_MONTH) + s = llformat("%dmon", secs / LL_AL_MONTH); + else if (secs >= LL_AL_WEEK) + s = llformat("%dw", secs / LL_AL_WEEK); + else if (secs >= LL_AL_DAY) + s = llformat("%dd", secs / LL_AL_DAY); + else if (secs >= LL_AL_HOUR) + s = llformat("%dh", secs / LL_AL_HOUR); + else if (secs >= LL_AL_MIN) + s = llformat("%dm", secs / LL_AL_MIN); + else + s = llformat("%ds", secs); + + return s; +} + +// Refresh shown time of our last interaction with all listed avatars. +void LLAvatarList::updateLastInteractionTimes() +{ + S32 now = (S32) LLDate::now().secondsSinceEpoch(); + std::vector<LLPanel*> items; + getItems(items); + + for( std::vector<LLPanel*>::const_iterator it = items.begin(); it != items.end(); it++) + { + // *TODO: error handling + LLAvatarListItem* item = static_cast<LLAvatarListItem*>(*it); + S32 secs_since = now - (S32) LLRecentPeople::instance().getDate(item->getAvatarId()).secondsSinceEpoch(); + if (secs_since >= 0) + item->setLastInteractionTime(format_secs(secs_since)); + } +} + bool LLAvatarItemComparator::compare(const LLPanel* item1, const LLPanel* item2) const { const LLAvatarListItem* avatar_item1 = dynamic_cast<const LLAvatarListItem*>(item1); diff --git a/indra/newview/llavatarlist.h b/indra/newview/llavatarlist.h index a83a72b26c..51d3760d39 100644 --- a/indra/newview/llavatarlist.h +++ b/indra/newview/llavatarlist.h @@ -37,6 +37,8 @@ #include "llavatarlistitem.h" +class LLTimer; + /** * Generic list of avatars. * @@ -56,11 +58,14 @@ public: struct Params : public LLInitParam::Block<Params, LLFlatListView::Params> { Optional<bool> ignore_online_status; // show all items as online + Optional<bool> show_last_interaction_time; // show most recent interaction time. *HACK: move this to a derived class + Optional<bool> show_info_btn; + Optional<bool> show_profile_btn; Params(); }; LLAvatarList(const Params&); - virtual ~LLAvatarList() {} + virtual ~LLAvatarList(); virtual void draw(); // from LLView @@ -70,7 +75,11 @@ public: void setContextMenu(LLAvatarListItem::ContextMenu* menu) { mContextMenu = menu; } + void toggleIcons(); void sortByName(); + void setShowIcons(std::string param_name); + bool getIconsVisible() const { return mShowIcons; } + const std::string getIconParamName() const{return mIconParamName;} virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); protected: @@ -81,12 +90,19 @@ protected: const std::vector<LLUUID>& vnew, std::vector<LLUUID>& vadded, std::vector<LLUUID>& vremoved); + void updateLastInteractionTimes(); private: bool mIgnoreOnlineStatus; + bool mShowLastInteractionTime; bool mDirty; + bool mShowIcons; + bool mShowInfoBtn; + bool mShowProfileBtn; + LLTimer* mLITUpdateTimer; // last interaction time update timer + std::string mIconParamName; std::string mNameFilter; uuid_vector_t mIDs; diff --git a/indra/newview/llavatarlistitem.cpp b/indra/newview/llavatarlistitem.cpp index ebc79aae48..a7ac14c948 100644 --- a/indra/newview/llavatarlistitem.cpp +++ b/indra/newview/llavatarlistitem.cpp @@ -42,19 +42,26 @@ #include "llavatariconctrl.h" #include "llbutton.h" - LLAvatarListItem::LLAvatarListItem() : LLPanel(), mAvatarIcon(NULL), mAvatarName(NULL), - mStatus(NULL), + mLastInteractionTime(NULL), mSpeakingIndicator(NULL), mInfoBtn(NULL), mProfileBtn(NULL), mContextMenu(NULL), - mOnlineStatus(E_UNKNOWN) + mOnlineStatus(E_UNKNOWN), + mShowInfoBtn(true), + mShowProfileBtn(true) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_avatar_list_item.xml"); + // Remember avatar icon width including its padding from the name text box, + // so that we can hide and show the icon again later. + + mIconWidth = mAvatarName->getRect().mLeft - mAvatarIcon->getRect().mLeft; + mInfoBtnWidth = mInfoBtn->getRect().mRight - mSpeakingIndicator->getRect().mRight; + mProfileBtnWidth = mProfileBtn->getRect().mRight - mInfoBtn->getRect().mRight; } LLAvatarListItem::~LLAvatarListItem() @@ -67,8 +74,8 @@ BOOL LLAvatarListItem::postBuild() { mAvatarIcon = getChild<LLAvatarIconCtrl>("avatar_icon"); mAvatarName = getChild<LLTextBox>("avatar_name"); - mStatus = getChild<LLTextBox>("avatar_status"); - + mLastInteractionTime = getChild<LLTextBox>("last_interaction"); + mSpeakingIndicator = getChild<LLOutputMonitorCtrl>("speaking_indicator"); mInfoBtn = getChild<LLButton>("info_btn"); mProfileBtn = getChild<LLButton>("profile_btn"); @@ -90,12 +97,6 @@ BOOL LLAvatarListItem::postBuild() rect.setLeftTopAndSize(mName->getRect().mLeft, mName->getRect().mTop, mName->getRect().getWidth() + 30, mName->getRect().getHeight()); mName->setRect(rect); - if(mStatus) - { - rect.setLeftTopAndSize(mStatus->getRect().mLeft + 30, mStatus->getRect().mTop, mStatus->getRect().getWidth(), mStatus->getRect().getHeight()); - mStatus->setRect(rect); - } - if(mLocator) { rect.setLeftTopAndSize(mLocator->getRect().mLeft + 30, mLocator->getRect().mTop, mLocator->getRect().getWidth(), mLocator->getRect().getHeight()); @@ -115,8 +116,8 @@ BOOL LLAvatarListItem::postBuild() void LLAvatarListItem::onMouseEnter(S32 x, S32 y, MASK mask) { childSetVisible("hovered_icon", true); - mInfoBtn->setVisible(true); - mProfileBtn->setVisible(true); + mInfoBtn->setVisible(mShowInfoBtn); + mProfileBtn->setVisible(mShowProfileBtn); LLPanel::onMouseEnter(x, y, mask); } @@ -130,11 +131,6 @@ void LLAvatarListItem::onMouseLeave(S32 x, S32 y, MASK mask) LLPanel::onMouseLeave(x, y, mask); } -void LLAvatarListItem::setStatus(const std::string& status) -{ - mStatus->setValue(status); -} - // virtual, called by LLAvatarTracker void LLAvatarListItem::changed(U32 mask) { @@ -188,6 +184,67 @@ void LLAvatarListItem::setAvatarId(const LLUUID& id, bool ignore_status_changes) gCacheName->get(id, FALSE, boost::bind(&LLAvatarListItem::onNameCache, this, _2, _3)); } +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); +} + +void LLAvatarListItem::setLastInteractionTime(const std::string& val) +{ + mLastInteractionTime->setValue(val); +} + +void LLAvatarListItem::setShowInfoBtn(bool show) +{ + // Already done? Then do nothing. + if(mShowInfoBtn == show) + return; + mShowInfoBtn = show; + S32 width_delta = show ? - mInfoBtnWidth : mInfoBtnWidth; + + //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) +{ + // Already done? Then do nothing. + if(mShowProfileBtn == show) + return; + mShowProfileBtn = show; + S32 width_delta = show ? - mProfileBtnWidth : mProfileBtnWidth; + + //Translating speaking indicator + mSpeakingIndicator->translate(width_delta, 0); + //Reshaping avatar name + mAvatarName->reshape(mAvatarName->getRect().getWidth() + width_delta, mAvatarName->getRect().getHeight()); +} + +void LLAvatarListItem::setAvatarIconVisible(bool visible) +{ + // Already done? Then do nothing. + if (mAvatarIcon->getVisible() == (BOOL)visible) + return; + + // 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 ? mIconWidth : -mIconWidth; + mAvatarName->setRect(name_rect); +} + void LLAvatarListItem::onInfoBtnClick() { LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarId)); @@ -218,21 +275,6 @@ void LLAvatarListItem::onProfileBtnClick() LLAvatarActions::showProfile(mAvatarId); } -void LLAvatarListItem::showStatus(bool show_status) -{ - // *HACK: dirty hack until we can determine correct avatar status (EXT-1076). - - if (show_status) - return; - - LLRect name_rect = mAvatarName->getRect(); - LLRect status_rect = mStatus->getRect(); - - mStatus->setVisible(show_status); - name_rect.mRight += (status_rect.mRight - name_rect.mRight); - mAvatarName->setRect(name_rect); -} - void LLAvatarListItem::setValue( const LLSD& value ) { if (!value.isMap()) return;; diff --git a/indra/newview/llavatarlistitem.h b/indra/newview/llavatarlistitem.h index b9cfed4b7b..cd7a85c3dc 100644 --- a/indra/newview/llavatarlistitem.h +++ b/indra/newview/llavatarlistitem.h @@ -60,10 +60,14 @@ public: virtual void setValue(const LLSD& value); virtual void changed(U32 mask); // from LLFriendObserver - void setStatus(const std::string& status); void setOnline(bool online); void setName(const std::string& name); void setAvatarId(const LLUUID& id, bool ignore_status_changes = false); + void setLastInteractionTime(const std::string& val); + //Show/hide profile/info btn, translating speaker indicator and avatar name coordinates accordingly + void setShowProfileBtn(bool hide); + void setShowInfoBtn(bool hide); + void setAvatarIconVisible(bool visible); const LLUUID& getAvatarId() const; const std::string getAvatarName() const; @@ -73,7 +77,7 @@ public: void showSpeakingIndicator(bool show) { mSpeakingIndicator->setVisible(show); } void showInfoBtn(bool show_info_btn) {mInfoBtn->setVisible(show_info_btn); } - void showStatus(bool show_status); + void showLastInteractionTime(bool show); void setContextMenu(ContextMenu* menu) { mContextMenu = menu; } @@ -87,9 +91,9 @@ private: void onNameCache(const std::string& first_name, const std::string& last_name); - LLAvatarIconCtrl*mAvatarIcon; + LLAvatarIconCtrl* mAvatarIcon; LLTextBox* mAvatarName; - LLTextBox* mStatus; + LLTextBox* mLastInteractionTime; LLOutputMonitorCtrl* mSpeakingIndicator; LLButton* mInfoBtn; @@ -98,6 +102,13 @@ private: LLUUID mAvatarId; EOnlineStatus mOnlineStatus; + //Flag indicating that info/profile button shouldn't be shown at all. + //Speaker indicator and avatar name coords are translated accordingly + bool mShowInfoBtn; + bool mShowProfileBtn; + S32 mIconWidth; // icon width + padding + S32 mInfoBtnWidth; //info btn width + padding + S32 mProfileBtnWidth; //profile btn width + padding }; #endif //LL_LLAVATARLISTITEM_H diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 7a81d0c4a1..e8812d87ee 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -62,7 +62,6 @@ #include "llviewerwindow.h" #include "llvoavatar.h" #include "llimview.h" -#include "llimpanel.h" ///---------------------------------------------------------------------------- /// Local function declarations, constants, enums, and typedefs @@ -719,18 +718,8 @@ void LLAvatarTracker::processNotify(LLMessageSystem* msg, bool online) // If there's an open IM session with this agent, send a notification there too. LLUUID session_id = LLIMMgr::computeSessionID(IM_NOTHING_SPECIAL, agent_id); - LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); - if (floater) - { - std::string notifyMsg = notification->getMessage(); - if (!notifyMsg.empty()) - { - floater->addHistoryLine(notifyMsg,LLUIColorTable::instance().getColor("SystemChatColor")); - } - } - - //*TODO instead of adding IM message about online/offline status - //do something like graying avatar icon on messages from a user that went offline, and make it colored when online. + std::string notify_msg = notification->getMessage(); + LLIMModel::instance().proccessOnlineOfflineNotification(session_id, notify_msg); } mModifyMask |= LLFriendObserver::ONLINE; diff --git a/indra/newview/llchannelmanager.cpp b/indra/newview/llchannelmanager.cpp index 77f941eef0..6427422572 100644 --- a/indra/newview/llchannelmanager.cpp +++ b/indra/newview/llchannelmanager.cpp @@ -40,6 +40,8 @@ #include "llbottomtray.h" #include "llviewerwindow.h" #include "llrootview.h" +#include "llsyswellwindow.h" +#include "llfloaterreg.h" #include <algorithm> @@ -128,7 +130,7 @@ void LLChannelManager::onLoginCompleted() S32 channel_right_bound = gViewerWindow->getWorldViewRect().mRight - gSavedSettings.getS32("NotificationChannelRightMargin"); S32 channel_width = gSavedSettings.getS32("NotifyBoxWidth"); mStartUpChannel->init(channel_right_bound - channel_width, channel_right_bound); - mStartUpChannel->setShowToasts(true); + mStartUpChannel->setMouseDownCallback(boost::bind(&LLSysWellWindow::onStartUpToastClick, LLFloaterReg::getTypedInstance<LLSysWellWindow>("syswell_window"), _2, _3, _4)); mStartUpChannel->setCommitCallback(boost::bind(&LLChannelManager::onStartUpToastClose, this)); mStartUpChannel->createStartUpToast(away_notifications, gSavedSettings.getS32("StartUpToastLifeTime")); diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ebf46a6e3f..e561507e69 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -38,9 +38,251 @@ #include "llscrollcontainer.h" #include "llavatariconctrl.h" +#include "llimview.h" +#include "llcallingcard.h" //for LLAvatarTracker +#include "llagentdata.h" +#include "llavataractions.h" +#include "lltrans.h" +#include "llfloaterreg.h" +#include "llmutelist.h" + static LLDefaultChildRegistry::Register<LLChatHistory> r("chat_history"); static const std::string MESSAGE_USERNAME_DATE_SEPARATOR(" ----- "); +std::string formatCurrentTime() +{ + time_t utc_time; + utc_time = time_corrected(); + std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" + +LLTrans::getString("TimeMin")+"] "; + + LLSD substitution; + + substitution["datetime"] = (S32) utc_time; + LLStringUtil::format (timeStr, substitution); + + return timeStr; +} + +class LLChatHistoryHeader: public LLPanel +{ +public: + static LLChatHistoryHeader* createInstance(const std::string& file_name) + { + LLChatHistoryHeader* pInstance = new LLChatHistoryHeader; + LLUICtrlFactory::getInstance()->buildPanel(pInstance, file_name); + return pInstance; + } + + BOOL handleMouseUp(S32 x, S32 y, MASK mask) + { + return LLPanel::handleMouseUp(x,y,mask); + } + + void onObjectIconContextMenuItemClicked(const LLSD& userdata) + { + std::string level = userdata.asString(); + + if (level == "profile") + { + } + else if (level == "block") + { + LLMuteList::getInstance()->add(LLMute(getAvatarId(), mFrom, LLMute::OBJECT)); + } + } + + void onAvatarIconContextMenuItemClicked(const LLSD& userdata) + { + std::string level = userdata.asString(); + + if (level == "profile") + { + LLAvatarActions::showProfile(getAvatarId()); + } + else if (level == "im") + { + LLAvatarActions::startIM(getAvatarId()); + } + else if (level == "add") + { + std::string name; + name.assign(getFirstName()); + name.append(" "); + name.append(getLastName()); + + LLAvatarActions::requestFriendshipDialog(getAvatarId(), name); + } + else if (level == "remove") + { + LLAvatarActions::removeFriendDialog(getAvatarId()); + } + } + + BOOL postBuild() + { + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + + registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2)); + registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2)); + + LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mPopupMenuHandleAvatar = menu->getHandle(); + + menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_object_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mPopupMenuHandleObject = menu->getHandle(); + + LLPanel* visible_panel = getChild<LLPanel>("im_header"); + visible_panel->setMouseDownCallback(boost::bind(&LLChatHistoryHeader::onHeaderPanelClick, this, _2, _3, _4)); + + return LLPanel::postBuild(); + } + + bool pointInChild(const std::string& name,S32 x,S32 y) + { + LLUICtrl* child = findChild<LLUICtrl>(name); + if(!child) + return false; + + LLView* parent = child->getParent(); + if(parent!=this) + { + x-=parent->getRect().mLeft; + y-=parent->getRect().mBottom; + } + + S32 local_x = x - child->getRect().mLeft ; + S32 local_y = y - child->getRect().mBottom ; + return child->pointInView(local_x, local_y); + } + + BOOL handleRightMouseDown(S32 x, S32 y, MASK mask) + { + if(pointInChild("avatar_icon",x,y) || pointInChild("user_name",x,y)) + { + showContextMenu(x,y); + return TRUE; + } + + return LLPanel::handleRightMouseDown(x,y,mask); + } + + void onHeaderPanelClick(S32 x, S32 y, MASK mask) + { + LLFloaterReg::showInstance("inspect_avatar", LLSD().insert("avatar_id", mAvatarID)); + } + + const LLUUID& getAvatarId () const { return mAvatarID;} + const std::string& getFirstName() const { return mFirstName; } + const std::string& getLastName () const { return mLastName; } + + void setup(const LLChat& chat) + { + mAvatarID = chat.mFromID; + mSourceType = chat.mSourceType; + gCacheName->get(mAvatarID, FALSE, boost::bind(&LLChatHistoryHeader::nameUpdatedCallback, this, _1, _2, _3, _4)); + if(chat.mFromID.isNull()) + { + mSourceType = CHAT_SOURCE_SYSTEM; + } + + + LLTextBox* userName = getChild<LLTextBox>("user_name"); + + if(!chat.mFromName.empty()) + { + userName->setValue(chat.mFromName); + mFrom = chat.mFromName; + } + else + { + std::string SL = LLTrans::getString("SECOND_LIFE"); + userName->setValue(SL); + } + + LLTextBox* timeBox = getChild<LLTextBox>("time_box"); + timeBox->setValue(formatCurrentTime()); + + LLAvatarIconCtrl* icon = getChild<LLAvatarIconCtrl>("avatar_icon"); + + if(mSourceType != CHAT_SOURCE_AGENT) + icon->setDrawTooltip(false); + + if(!chat.mFromID.isNull()) + { + icon->setValue(chat.mFromID); + } + + } + + void nameUpdatedCallback(const LLUUID& id,const std::string& first,const std::string& last,BOOL is_group) + { + if (id != mAvatarID) + return; + mFirstName = first; + mLastName = last; + } +protected: + void showContextMenu(S32 x,S32 y) + { + if(mSourceType == CHAT_SOURCE_SYSTEM) + showSystemContextMenu(x,y); + if(mSourceType == CHAT_SOURCE_AGENT) + showAvatarContextMenu(x,y); + if(mSourceType == CHAT_SOURCE_OBJECT) + showObjectContextMenu(x,y); + } + + void showSystemContextMenu(S32 x,S32 y) + { + } + + void showObjectContextMenu(S32 x,S32 y) + { + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleObject.get(); + if(menu) + LLMenuGL::showPopup(this, menu, x, y); + } + + void showAvatarContextMenu(S32 x,S32 y) + { + LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandleAvatar.get(); + + if(menu) + { + bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarID) != NULL; + + menu->setItemEnabled("Add Friend", !is_friend); + menu->setItemEnabled("Remove Friend", is_friend); + + if(gAgentID == mAvatarID) + { + menu->setItemEnabled("Add Friend", false); + menu->setItemEnabled("Send IM", false); + menu->setItemEnabled("Remove Friend", false); + } + + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLMenuGL::showPopup(this, menu, x, y); + } + } + + + +protected: + LLHandle<LLView> mPopupMenuHandleAvatar; + LLHandle<LLView> mPopupMenuHandleObject; + + LLUUID mAvatarID; + EChatSourceType mSourceType; + std::string mFirstName; + std::string mLastName; + std::string mFrom; + +}; + + LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) : LLTextEditor(p), mMessageHeaderFilename(p.message_header), @@ -48,7 +290,7 @@ mMessageSeparatorFilename(p.message_separator), mLeftTextPad(p.left_text_pad), mRightTextPad(p.right_text_pad), mLeftWidgetPad(p.left_widget_pad), -mRightWidgetPad(p.rigth_widget_pad) +mRightWidgetPad(p.right_widget_pad) { } @@ -78,49 +320,49 @@ LLView* LLChatHistory::getSeparator() return separator; } -LLView* LLChatHistory::getHeader(const LLUUID& avatar_id, std::string& from, std::string& time) +LLView* LLChatHistory::getHeader(const LLChat& chat) { - LLPanel* header = LLUICtrlFactory::getInstance()->createFromFile<LLPanel>(mMessageHeaderFilename, NULL, LLPanel::child_registry_t::instance()); - LLTextBox* userName = header->getChild<LLTextBox>("user_name"); - userName->setValue(from); - LLTextBox* timeBox = header->getChild<LLTextBox>("time_box"); - timeBox->setValue(time); - if(!avatar_id.isNull()) - { - LLAvatarIconCtrl* icon = header->getChild<LLAvatarIconCtrl>("avatar_icon"); - icon->setValue(avatar_id); - } + LLChatHistoryHeader* header = LLChatHistoryHeader::createInstance(mMessageHeaderFilename); + header->setup(chat); return header; } -void LLChatHistory::appendWidgetMessage(const LLUUID& avatar_id, std::string& from, std::string& time, std::string& message, LLStyle::Params& style_params) +void LLChatHistory::appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params) { LLView* view = NULL; std::string view_text; - if (mLastFromName == from) + if (mLastFromName == chat.mFromName) { view = getSeparator(); - view_text = " "; + view_text = "\n"; } else { - view = getHeader(avatar_id, from, time); - view_text = "\n" + from + MESSAGE_USERNAME_DATE_SEPARATOR + time; + view = getHeader(chat); + view_text = chat.mFromName + MESSAGE_USERNAME_DATE_SEPARATOR + formatCurrentTime() + '\n'; } //Prepare the rect for the view LLRect target_rect = getDocumentView()->getRect(); - target_rect.mLeft += mLeftWidgetPad; + // squeeze down the widget by subtracting padding off left and right + target_rect.mLeft += mLeftWidgetPad + mHPad; target_rect.mRight -= mRightWidgetPad; view->reshape(target_rect.getWidth(), view->getRect().getHeight()); view->setOrigin(target_rect.mLeft, view->getRect().mBottom); - appendWidget(view, view_text, FALSE, TRUE, mLeftWidgetPad, 0); + LLInlineViewSegment::Params p; + p.view = view; + p.force_newline = true; + p.left_pad = mLeftWidgetPad; + p.right_pad = mRightWidgetPad; + + appendWidget(p, view_text, false); //Append the text message - appendText(message, TRUE, style_params); + std::string message = chat.mText + '\n'; + appendText(message, FALSE, style_params); - mLastFromName = from; + mLastFromName = chat.mFromName; blockUndo(); setCursorAndScrollToEnd(); } diff --git a/indra/newview/llchathistory.h b/indra/newview/llchathistory.h index d6eccf896a..92dcfdd958 100644 --- a/indra/newview/llchathistory.h +++ b/indra/newview/llchathistory.h @@ -34,6 +34,7 @@ #define LLCHATHISTORY_H_ #include "lltexteditor.h" +#include "llchat.h" //Chat log widget allowing addition of a message as a widget class LLChatHistory : public LLTextEditor @@ -52,7 +53,7 @@ class LLChatHistory : public LLTextEditor //Widget left padding from the scroll rect Optional<S32> left_widget_pad; //Widget right padding from the scroll rect - Optional<S32> rigth_widget_pad; + Optional<S32> right_widget_pad; Params() : message_header("message_header"), @@ -60,7 +61,7 @@ class LLChatHistory : public LLTextEditor left_text_pad("left_text_pad"), right_text_pad("right_text_pad"), left_widget_pad("left_widget_pad"), - rigth_widget_pad("rigth_widget_pad") + right_widget_pad("right_widget_pad") { } @@ -85,7 +86,7 @@ class LLChatHistory : public LLTextEditor * @param time time of a message. * @return pointer to LLView header object. */ - LLView* getHeader(const LLUUID& avatar_id, std::string& from, std::string& time); + LLView* getHeader(const LLChat& chat); public: ~LLChatHistory(); @@ -94,11 +95,11 @@ class LLChatHistory : public LLTextEditor * Appends a widget message. * If last user appended message, concurs with current user, * separator is added before the message, otherwise header is added. - * @param from owner of a message. + * @param chat - base chat message. * @param time time of a message. * @param message message itself. */ - void appendWidgetMessage(const LLUUID& avatar_id, std::string& from, std::string& time, std::string& message, LLStyle::Params& style_params); + void appendWidgetMessage(const LLChat& chat, LLStyle::Params& style_params); private: std::string mLastFromName; diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 61a60a24be..bad61101c1 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -37,7 +37,6 @@ #include "llbottomtray.h" #include "llgroupactions.h" #include "lliconctrl.h" -#include "llimpanel.h" // LLFloaterIMPanel #include "llimfloater.h" #include "llimview.h" #include "llfloaterreg.h" @@ -58,8 +57,6 @@ static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t4("chiclet_im_p2p"); static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t5("chiclet_im_group"); S32 LLNotificationChiclet::mUreadSystemNotifications = 0; -S32 LLNotificationChiclet::mUreadIMNotifications = 0; - boost::signals2::signal<LLChiclet* (const LLUUID&), LLIMChiclet::CollectChicletCombiner<std::list<LLChiclet*> > > @@ -100,7 +97,6 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) // connect counter handlers to the signals connectCounterUpdatersToSignal("notify"); connectCounterUpdatersToSignal("groupnotify"); - connectCounterUpdatersToSignal("notifytoast"); } LLNotificationChiclet::~LLNotificationChiclet() @@ -114,16 +110,8 @@ void LLNotificationChiclet::connectCounterUpdatersToSignal(std::string notificat LLNotificationsUI::LLEventHandler* n_handler = manager->getHandlerForNotification(notification_type); if(n_handler) { - if(notification_type == "notifytoast") - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::updateUreadIMNotifications, this)); - } - else - { - n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); - n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); - } + n_handler->setNewNotificationCallback(boost::bind(&LLNotificationChiclet::incUreadSystemNotifications, this)); + n_handler->setDelNotification(boost::bind(&LLNotificationChiclet::decUreadSystemNotifications, this)); } } @@ -148,12 +136,6 @@ void LLNotificationChiclet::setToggleState(BOOL toggled) { mButton->setToggleState(toggled); } -void LLNotificationChiclet::updateUreadIMNotifications() -{ - mUreadIMNotifications = gIMMgr->getNumberOfUnreadIM(); - setCounter(mUreadSystemNotifications + mUreadIMNotifications); -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -1398,7 +1380,7 @@ void LLTalkButton::onClick_ShowBtn() LLAvatarListItem* item = new LLAvatarListItem(); - item->showStatus(true); + item->showLastInteractionTime(false); item->showInfoBtn(true); item->showSpeakingIndicator(true); item->reshape(mPrivateCallPanel->getRect().getWidth(), item->getRect().getHeight(), FALSE); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index d1153a075d..6eefd9829f 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -608,10 +608,9 @@ public: /*virtual*/ ~ LLNotificationChiclet(); - // methods for updating a number of unread System or IM notifications - void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications + mUreadIMNotifications); } - void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications + mUreadIMNotifications); } - void updateUreadIMNotifications(); + // methods for updating a number of unread System notifications + void incUreadSystemNotifications() { setCounter(++mUreadSystemNotifications); } + void decUreadSystemNotifications() { setCounter(--mUreadSystemNotifications); } void setToggleState(BOOL toggled); protected: @@ -622,7 +621,6 @@ protected: friend class LLUICtrlFactory; static S32 mUreadSystemNotifications; - static S32 mUreadIMNotifications; protected: LLButton* mButton; diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index 979a1a9a60..c4bfd71999 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -35,6 +35,8 @@ #include "lluictrlfactory.h" #include "lltextbox.h" #include "lllineeditor.h" +#include "llviewercontrol.h" +#include "llversionviewer.h" #include "llcurrencyuimanager.h" @@ -156,6 +158,11 @@ void LLCurrencyUIManager::Impl::updateCurrencyInfo() "secureSessionId", gAgent.getSecureSessionID().asString()); keywordArgs.appendInt("currencyBuy", mUserCurrencyBuy); + keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName")); + keywordArgs.appendInt("viewerMajorVersion", LL_VERSION_MAJOR); + keywordArgs.appendInt("viewerMinorVersion", LL_VERSION_MINOR); + keywordArgs.appendInt("viewerPatchVersion", LL_VERSION_PATCH); + keywordArgs.appendInt("viewerBuildVersion", LL_VERSION_BUILD); LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); @@ -209,7 +216,12 @@ void LLCurrencyUIManager::Impl::startCurrencyBuy(const std::string& password) { keywordArgs.appendString("password", password); } - + keywordArgs.appendString("viewerChannel", gSavedSettings.getString("VersionChannelName")); + keywordArgs.appendInt("viewerMajorVersion", LL_VERSION_MAJOR); + keywordArgs.appendInt("viewerMinorVersion", LL_VERSION_MINOR); + keywordArgs.appendInt("viewerPatchVersion", LL_VERSION_PATCH); + keywordArgs.appendInt("viewerBuildVersion", LL_VERSION_BUILD); + LLXMLRPCValue params = LLXMLRPCValue::createArray(); params.append(keywordArgs); diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index 976f02eeb7..d8c34581d5 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -442,6 +442,7 @@ void LLRenderPass::renderTexture(U32 type, U32 mask) void LLRenderPass::pushBatches(U32 type, U32 mask, BOOL texture) { + llpushcallstacks ; for (LLCullResult::drawinfo_list_t::iterator i = gPipeline.beginRenderMap(type); i != gPipeline.endRenderMap(type); ++i) { LLDrawInfo* pparams = *i; diff --git a/indra/newview/lldriverparam.cpp b/indra/newview/lldriverparam.cpp index 45f4b4fbd0..527656ab6b 100644 --- a/indra/newview/lldriverparam.cpp +++ b/indra/newview/lldriverparam.cpp @@ -224,6 +224,7 @@ void LLDriverParam::setAvatar(LLVOAvatar *avatarp) } } *new_param = *this; + new_param->setIsDummy(FALSE); return new_param; } diff --git a/indra/newview/lleventinfo.cpp b/indra/newview/lleventinfo.cpp index 9be45d18fb..aabd7ed997 100644 --- a/indra/newview/lleventinfo.cpp +++ b/indra/newview/lleventinfo.cpp @@ -33,7 +33,6 @@ #include "llviewerprecompiledheaders.h" #include "lleventinfo.h" -#include "llappviewer.h" // for gPacificDaylightTime #include "lluuid.h" #include "message.h" diff --git a/indra/newview/llexpandabletextbox.cpp b/indra/newview/llexpandabletextbox.cpp index 48b5fc11b7..7bc48185e6 100644 --- a/indra/newview/llexpandabletextbox.cpp +++ b/indra/newview/llexpandabletextbox.cpp @@ -51,7 +51,7 @@ public: /*virtual*/ void getDimensions(S32 first_char, S32 num_chars, S32& width, S32& height) const { // more label always spans width of text box - width = mEditor.getTextRect().getWidth(); + width = mEditor.getTextRect().getWidth() - mEditor.getHPad(); height = llceil(mStyle->getFont()->getLineHeight()); } /*virtual*/ S32 getOffset(S32 segment_local_x_coord, S32 start_offset, S32 num_chars, bool round) const @@ -153,6 +153,11 @@ void LLExpandableTextBox::LLTextBoxEx::showExpandText() { if (!mExpanderVisible) { + // make sure we're scrolled to top when collapsing + if (mScroller) + { + mScroller->goToTop(); + } // get fully visible lines std::pair<S32, S32> visible_lines = getVisibleLines(true); S32 last_line = visible_lines.second - 1; diff --git a/indra/newview/llexpandabletextbox.h b/indra/newview/llexpandabletextbox.h index d45527aabb..3fe646c29c 100644 --- a/indra/newview/llexpandabletextbox.h +++ b/indra/newview/llexpandabletextbox.h @@ -69,16 +69,6 @@ protected: virtual S32 getVerticalTextDelta(); /** - * Returns text vertical padding - */ - virtual S32 getVPad() { return mVPad; } - - /** - * Returns text horizontal padding - */ - virtual S32 getHPad() { return mHPad; } - - /** * Shows "More" link */ void showExpandText(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 4246cbc27f..09b3ce1e86 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -856,6 +856,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, const LLMatrix4& mat_vert, const LLMatrix3& mat_normal, const U16 &index_offset) { + llpushcallstacks ; const LLVolumeFace &vf = volume.getVolumeFace(f); S32 num_vertices = (S32)vf.mVertices.size(); S32 num_indices = (S32)vf.mIndices.size(); @@ -864,7 +865,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, { if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices()) { - llwarns << "Index buffer overflow!" << llendl; + llwarns << "Index buffer overflow!" << llendl; + llwarns << "Indices Count: " << mIndicesCount + << " VF Num Indices: " << num_indices + << " Indices Index: " << mIndicesIndex + << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl; + llwarns << "Last Indices Count: " << mLastIndicesCount + << " Last Indices Index: " << mLastIndicesIndex + << " Face Index: " << f + << " Pool Type: " << mPoolType << llendl; return FALSE; } diff --git a/indra/newview/llface.h b/indra/newview/llface.h index d734b327d9..2b134c8c31 100644 --- a/indra/newview/llface.h +++ b/indra/newview/llface.h @@ -246,7 +246,7 @@ protected: //atlas LLPointer<LLTextureAtlasSlot> mAtlasInfop ; - BOOL mUsingAtlas ; + BOOL mUsingAtlas ; protected: static BOOL sSafeRenderSelect; diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 3b5b7f570e..a6afbc05be 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -503,13 +503,15 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con return; } + LLPointer<LLViewerInventoryItem> viewer_item = new LLViewerInventoryItem(item); + if (dest) { - insertBeforeItem(mItems, dest->getLandmarkId(), item->getUUID()); + insertBeforeItem(mItems, dest->getLandmarkId(), viewer_item); } else { - mItems.push_back(gInventory.getItem(item->getUUID())); + mItems.push_back(viewer_item); } int sortField = 0; @@ -534,13 +536,22 @@ void LLFavoritesBarCtrl::handleNewFavoriteDragAndDrop(LLInventoryItem *item, con } } - copy_inventory_item( - gAgent.getID(), - item->getPermissions().getOwner(), - item->getUUID(), - favorites_id, - std::string(), - cb); + LLToolDragAndDrop* tool_dad = LLToolDragAndDrop::getInstance(); + if (tool_dad->getSource() == LLToolDragAndDrop::SOURCE_NOTECARD) + { + viewer_item->setType(LLAssetType::AT_FAVORITE); + copy_inventory_from_notecard(tool_dad->getObjectID(), tool_dad->getSourceID(), viewer_item.get(), gInventoryCallbacks.registerCB(cb)); + } + else + { + copy_inventory_item( + gAgent.getID(), + item->getPermissions().getOwner(), + item->getUUID(), + favorites_id, + std::string(), + cb); + } llinfos << "Copied inventory item #" << item->getUUID() << " to favorites." << llendl; } @@ -1263,10 +1274,9 @@ void LLFavoritesBarCtrl::updateItemsOrder(LLInventoryModel::item_array_t& items, items.insert(findItemByUUID(items, destItem->getUUID()), srcItem); } -void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, const LLUUID& insertedItemId) +void LLFavoritesBarCtrl::insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem) { LLViewerInventoryItem* beforeItem = gInventory.getItem(beforeItemId); - LLViewerInventoryItem* insertedItem = gInventory.getItem(insertedItemId); items.insert(findItemByUUID(items, beforeItem->getUUID()), insertedItem); } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index ea2a3d08e2..e90d13f9d5 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -141,7 +141,7 @@ private: * inserts an item identified by insertedItemId BEFORE an item identified by beforeItemId. * this function assumes that an item identified by insertedItemId doesn't exist in items array. */ - void insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, const LLUUID& insertedItemId); + void insertBeforeItem(LLInventoryModel::item_array_t& items, const LLUUID& beforeItemId, LLViewerInventoryItem* insertedItem); // finds an item by it's UUID in the items array LLInventoryModel::item_array_t::iterator findItemByUUID(LLInventoryModel::item_array_t& items, const LLUUID& id); diff --git a/indra/newview/llflexibleobject.cpp b/indra/newview/llflexibleobject.cpp index 216bca8262..fc8790c172 100644 --- a/indra/newview/llflexibleobject.cpp +++ b/indra/newview/llflexibleobject.cpp @@ -704,7 +704,7 @@ BOOL LLVolumeImplFlexible::doUpdateGeometry(LLDrawable *drawable) } if (volume->mLODChanged || volume->mFaceMappingChanged || - volume->mVolumeChanged) + volume->mVolumeChanged || drawable->isState(LLDrawable::REBUILD_MATERIAL)) { volume->regenFaces(); volume->mDrawable->setState(LLDrawable::REBUILD_VOLUME); diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 92ad28a105..88658f7b9f 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -39,6 +39,7 @@ #include "llagent.h"
#include "llappviewer.h"
#include "llsecondlifeurls.h"
+#include "llvoiceclient.h"
#include "lluictrlfactory.h"
#include "llviewertexteditor.h"
#include "llviewercontrol.h"
@@ -61,6 +62,9 @@ #include "lluri.h"
#include "v3dmath.h"
#include "llwindow.h"
+#include "stringize.h"
+#include "llsdutil_math.h"
+#include "lleventdispatcher.h"
#if LL_WINDOWS
#include "lldxhardware.h"
@@ -85,6 +89,10 @@ private: public:
/*virtual*/ BOOL postBuild();
+
+ /// Obtain the data used to fill out the contents string. This is
+ /// separated so that we can programmatically access the same info.
+ static LLSD getInfo();
void onClickCopyToClipboard();
};
@@ -114,25 +122,117 @@ BOOL LLFloaterAbout::postBuild() getChild<LLUICtrl>("copy_btn")->setCommitCallback(
boost::bind(&LLFloaterAbout::onClickCopyToClipboard, this));
- // Version string
- std::string version = LLTrans::getString("APP_NAME")
- + llformat(" %d.%d.%d (%d) %s %s (%s)\n",
- LL_VERSION_MAJOR, LL_VERSION_MINOR, LL_VERSION_PATCH, LL_VIEWER_BUILD,
- __DATE__, __TIME__,
- gSavedSettings.getString("VersionChannelName").c_str());
+#if LL_WINDOWS
+ getWindow()->incBusyCount();
+ getWindow()->setCursor(UI_CURSOR_ARROW);
+#endif
+ LLSD info(getInfo());
+#if LL_WINDOWS
+ getWindow()->decBusyCount();
+ getWindow()->setCursor(UI_CURSOR_ARROW);
+#endif
- std::string support;
- support.append(version);
- support.append("[" + get_viewer_release_notes_url() + " " +
- LLTrans::getString("ReleaseNotes") + "]");
- support.append("\n\n");
+ std::ostringstream support;
-#if LL_MSVC
- support.append(llformat("Built with MSVC version %d\n\n", _MSC_VER));
-#endif
+ // Render the LLSD from getInfo() as a format_map_t
+ LLStringUtil::format_map_t args;
+ // For reasons I don't yet understand, [ReleaseNotes] is not part of the
+ // default substitution strings whereas [APP_NAME] is. But it works to
+ // simply copy it into these specific args.
+ args["ReleaseNotes"] = LLTrans::getString("ReleaseNotes");
+ for (LLSD::map_const_iterator ii(info.beginMap()), iend(info.endMap());
+ ii != iend; ++ii)
+ {
+ if (! ii->second.isArray())
+ {
+ // Scalar value
+ if (ii->second.isUndefined())
+ {
+ args[ii->first] = getString("none");
+ }
+ else
+ {
+ // don't forget to render value asString()
+ args[ii->first] = ii->second.asString();
+ }
+ }
+ else
+ {
+ // array value: build KEY_0, KEY_1 etc. entries
+ for (LLSD::Integer n(0), size(ii->second.size()); n < size; ++n)
+ {
+ args[STRINGIZE(ii->first << '_' << n)] = ii->second[n].asString();
+ }
+ }
+ }
+
+ // Now build the various pieces
+ support << getString("AboutHeader", args);
+ if (info.has("COMPILER"))
+ {
+ support << "\n\n" << getString("AboutCompiler", args);
+ }
+ if (info.has("REGION"))
+ {
+ support << "\n\n" << getString("AboutPosition", args);
+ }
+ support << "\n\n" << getString("AboutSystem", args);
+ if (info.has("GRAPHICS_DRIVER_VERSION"))
+ {
+ support << "\n\n" << getString("AboutDriver", args);
+ }
+ support << "\n\n" << getString("AboutLibs", args);
+ if (info.has("PACKETS_IN"))
+ {
+ support << '\n' << getString("AboutTraffic", args);
+ }
-#if LL_GNUC
- support.append(llformat("Built with GCC version %d\n\n", GCC_VERSION));
+ support_widget->appendText(support.str(),
+ FALSE,
+ LLStyle::Params()
+ .color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
+ support_widget->blockUndo();
+
+ // Fix views
+ support_widget->setCursorPos(0);
+ support_widget->setEnabled(FALSE);
+
+ credits_widget->setCursorPos(0);
+ credits_widget->setEnabled(FALSE);
+
+ return TRUE;
+}
+
+// static
+LLSD LLFloaterAbout::getInfo()
+{
+ // The point of having one method build an LLSD info block and the other
+ // construct the user-visible About string is to ensure that the same info
+ // is available to a getInfo() caller as to the user opening
+ // LLFloaterAbout.
+ LLSD info;
+ LLSD version;
+ version.append(LL_VERSION_MAJOR);
+ version.append(LL_VERSION_MINOR);
+ version.append(LL_VERSION_PATCH);
+ version.append(LL_VERSION_BUILD);
+ info["VIEWER_VERSION"] = version;
+ info["VIEWER_VERSION_STR"] = STRINGIZE(version[0].asInteger() << '.' <<
+ version[1].asInteger() << '.' <<
+ version[2].asInteger() << '.' <<
+ version[3].asInteger());
+ info["BUILD_DATE"] = __DATE__;
+ info["BUILD_TIME"] = __TIME__;
+ info["CHANNEL"] = gSavedSettings.getString("VersionChannelName");
+
+ info["VIEWER_RELEASE_NOTES_URL"] = get_viewer_release_notes_url();
+
+#if LL_MSVC
+ info["COMPILER"] = "MSVC";
+ info["COMPILER_VERSION"] = _MSC_VER;
+#elif LL_GNUC
+ info["COMPILER"] = "GCC";
+ info["COMPILER_VERSION"] = GCC_VERSION;
#endif
// Position
@@ -140,120 +240,50 @@ BOOL LLFloaterAbout::postBuild() if (region)
{
const LLVector3d &pos = gAgent.getPositionGlobal();
- LLUIString pos_text = getString("you_are_at");
- pos_text.setArg("[POSITION]",
- llformat("%.1f, %.1f, %.1f ", pos.mdV[VX], pos.mdV[VY], pos.mdV[VZ]));
- support.append(pos_text);
-
- LLUIString region_text = getString ("in_region") + " ";
- region_text.setArg("[REGION]", llformat ("%s", gAgent.getRegion()->getName().c_str()));
- support.append(region_text);
-
- std::string buffer;
- buffer = gAgent.getRegion()->getHost().getHostName();
- support.append(buffer);
- support.append(" (");
- buffer = gAgent.getRegion()->getHost().getString();
- support.append(buffer);
- support.append(")\n");
- support.append(gLastVersionChannel);
- support.append("\n");
- support.append("[" + LLWeb::escapeURL(region->getCapability("ServerReleaseNotes")) +
- " " + LLTrans::getString("ReleaseNotes") + "]");
- support.append("\n\n");
+ info["POSITION"] = ll_sd_from_vector3d(pos);
+ info["REGION"] = gAgent.getRegion()->getName();
+ info["HOSTNAME"] = gAgent.getRegion()->getHost().getHostName();
+ info["HOSTIP"] = gAgent.getRegion()->getHost().getString();
+ info["SERVER_VERSION"] = gLastVersionChannel;
+ info["SERVER_RELEASE_NOTES_URL"] = LLWeb::escapeURL(region->getCapability("ServerReleaseNotes"));
}
- // *NOTE: Do not translate text like GPU, Graphics Card, etc -
- // Most PC users that know what these mean will be used to the english versions,
- // and this info sometimes gets sent to support
-
// CPU
- support.append(getString("CPU") + " ");
- support.append( gSysCPU.getCPUString() );
- support.append("\n");
-
- U32 memory = gSysMemory.getPhysicalMemoryKB() / 1024;
+ info["CPU"] = gSysCPU.getCPUString();
+ info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB() / 1024);
// Moved hack adjustment to Windows memory size into llsys.cpp
-
- LLStringUtil::format_map_t args;
- args["[MEM]"] = llformat ("%u", memory);
- support.append(getString("Memory", args) + "\n");
-
- support.append(getString("OSVersion") + " ");
- support.append( LLAppViewer::instance()->getOSInfo().getOSString() );
- support.append("\n");
-
- support.append(getString("GraphicsCardVendor") + " ");
- support.append( (const char*) glGetString(GL_VENDOR) );
- support.append("\n");
-
- support.append(getString("GraphicsCard") + " ");
- support.append( (const char*) glGetString(GL_RENDERER) );
- support.append("\n");
+ info["OS_VERSION"] = LLAppViewer::instance()->getOSInfo().getOSString();
+ info["GRAPHICS_CARD_VENDOR"] = (const char*)(glGetString(GL_VENDOR));
+ info["GRAPHICS_CARD"] = (const char*)(glGetString(GL_RENDERER));
#if LL_WINDOWS
- getWindow()->incBusyCount();
- getWindow()->setCursor(UI_CURSOR_ARROW);
- support.append("Windows Graphics Driver Version: ");
LLSD driver_info = gDXHardware.getDisplayInfo();
if (driver_info.has("DriverVersion"))
{
- support.append(driver_info["DriverVersion"]);
+ info["GRAPHICS_DRIVER_VERSION"] = driver_info["DriverVersion"];
}
- support.append("\n");
- getWindow()->decBusyCount();
- getWindow()->setCursor(UI_CURSOR_ARROW);
#endif
- support.append(getString("OpenGLVersion") + " ");
- support.append( (const char*) glGetString(GL_VERSION) );
- support.append("\n");
-
- support.append("\n");
-
- support.append(getString("LibCurlVersion") + " ");
- support.append( LLCurl::getVersionString() );
- support.append("\n");
-
- support.append(getString("J2CDecoderVersion") + " ");
- support.append( LLImageJ2C::getEngineInfo() );
- support.append("\n");
-
- support.append(getString("AudioDriverVersion") + " ");
+ info["OPENGL_VERSION"] = (const char*)(glGetString(GL_VERSION));
+ info["LIBCURL_VERSION"] = LLCurl::getVersionString();
+ info["J2C_VERSION"] = LLImageJ2C::getEngineInfo();
bool want_fullname = true;
- support.append( gAudiop ? gAudiop->getDriverName(want_fullname) : getString("none") );
- support.append("\n");
+ info["AUDIO_DRIVER_VERSION"] = gAudiop ? LLSD(gAudiop->getDriverName(want_fullname)) : LLSD();
+ info["VIVOX_VERSION"] = gVoiceClient ? gVoiceClient->getAPIVersion() : "Unknown";
// TODO: Implement media plugin version query
-
- support.append(getString("LLQtWebkitVersion") + " ");
- support.append("\n");
+ info["QT_WEBKIT_VERSION"] = "4.5.2";
if (gPacketsIn > 0)
{
- args["[LOST]"] = llformat ("%.0f", LLViewerStats::getInstance()->mPacketsLostStat.getCurrent());
- args["[IN]"] = llformat ("%.0f", F32(gPacketsIn));
- args["[PCT]"] = llformat ("%.1f", 100.f*LLViewerStats::getInstance()->mPacketsLostStat.getCurrent() / F32(gPacketsIn) );
- support.append(getString ("PacketsLost", args) + "\n");
+ info["PACKETS_LOST"] = LLViewerStats::getInstance()->mPacketsLostStat.getCurrent();
+ info["PACKETS_IN"] = F32(gPacketsIn);
+ info["PACKETS_PCT"] = 100.f*info["PACKETS_LOST"].asReal() / info["PACKETS_IN"].asReal();
}
- support_widget->appendText(support,
- FALSE,
- LLStyle::Params()
- .color(LLUIColorTable::instance().getColor("TextFgReadOnlyColor")));
- support_widget->blockUndo();
-
- // Fix views
- support_widget->setCursorPos(0);
- support_widget->setEnabled(FALSE);
-
- credits_widget->setCursorPos(0);
- credits_widget->setEnabled(FALSE);
-
- return TRUE;
+ return info;
}
-
static std::string get_viewer_release_notes_url()
{
std::ostringstream version;
@@ -272,6 +302,27 @@ static std::string get_viewer_release_notes_url() return LLWeb::escapeURL(url.str());
}
+class LLFloaterAboutListener: public LLDispatchListener
+{
+public:
+ LLFloaterAboutListener():
+ LLDispatchListener("LLFloaterAbout", "op")
+ {
+ add("getInfo", &LLFloaterAboutListener::getInfo, LLSD().insert("reply", LLSD()));
+ }
+
+private:
+ void getInfo(const LLSD& request) const
+ {
+ LLReqID reqid(request);
+ LLSD reply(LLFloaterAbout::getInfo());
+ reqid.stamp(reply);
+ LLEventPumps::instance().obtain(request["reply"]).post(reply);
+ }
+};
+
+static LLFloaterAboutListener floaterAboutListener;
+
void LLFloaterAbout::onClickCopyToClipboard()
{
LLViewerTextEditor *support_widget =
diff --git a/indra/newview/llfloateravatarpicker.cpp b/indra/newview/llfloateravatarpicker.cpp index ccfe7d4b64..8ac7f3fd7e 100644 --- a/indra/newview/llfloateravatarpicker.cpp +++ b/indra/newview/llfloateravatarpicker.cpp @@ -35,6 +35,7 @@ // Viewer includes #include "llagent.h" +#include "llcallingcard.h" #include "llfocusmgr.h" #include "llfloaterreg.h" #include "llviewercontrol.h" @@ -76,6 +77,7 @@ LLFloaterAvatarPicker::LLFloaterAvatarPicker(const LLSD& key) mCloseOnSelect(FALSE) { // LLUICtrlFactory::getInstance()->buildFloater(this, "floater_avatar_picker.xml"); + mCommitCallbackRegistrar.add("Refresh.FriendList", boost::bind(&LLFloaterAvatarPicker::populateFriend, this)); } BOOL LLFloaterAvatarPicker::postBuild() @@ -95,7 +97,11 @@ BOOL LLFloaterAvatarPicker::postBuild() LLScrollListCtrl* nearme = getChild<LLScrollListCtrl>("NearMe"); nearme->setDoubleClickCallback(onBtnSelect, this); childSetCommitCallback("NearMe", onList, this); - + + LLScrollListCtrl* friends = getChild<LLScrollListCtrl>("Friends"); + friends->setDoubleClickCallback(onBtnSelect, this); + childSetCommitCallback("Friends", onList, this); + childSetAction("Select", onBtnSelect, this); childDisable("Select"); @@ -119,6 +125,8 @@ BOOL LLFloaterAvatarPicker::postBuild() center(); + populateFriend(); + return TRUE; } @@ -159,25 +167,37 @@ void LLFloaterAvatarPicker::onBtnSelect(void* userdata) if(self->mCallback) { + std::string acvtive_panel_name; + LLScrollListCtrl* list = NULL; LLPanel* active_panel = self->childGetVisibleTab("ResidentChooserTabs"); - - if(active_panel == self->getChild<LLPanel>("SearchPanel")) + if(active_panel) { - std::vector<std::string> avatar_names; - std::vector<LLUUID> avatar_ids; - getSelectedAvatarData(self->getChild<LLScrollListCtrl>("SearchResults"), avatar_names, avatar_ids); - self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); + acvtive_panel_name = active_panel->getName(); + } + if(acvtive_panel_name == "SearchPanel") + { + list = self->getChild<LLScrollListCtrl>("SearchResults"); + } + else if(acvtive_panel_name == "NearMePanel") + { + list =self->getChild<LLScrollListCtrl>("NearMe"); + } + else if (acvtive_panel_name == "FriendsPanel") + { + list =self->getChild<LLScrollListCtrl>("Friends"); } - else if(active_panel == self->getChild<LLPanel>("NearMePanel")) + + if(list) { std::vector<std::string> avatar_names; std::vector<LLUUID> avatar_ids; - getSelectedAvatarData(self->getChild<LLScrollListCtrl>("NearMe"), avatar_names, avatar_ids); + getSelectedAvatarData(list, avatar_names, avatar_ids); self->mCallback(avatar_names, avatar_ids, self->mCallbackUserdata); } } self->getChild<LLScrollListCtrl>("SearchResults")->deselectAllItems(TRUE); self->getChild<LLScrollListCtrl>("NearMe")->deselectAllItems(TRUE); + self->getChild<LLScrollListCtrl>("Friends")->deselectAllItems(TRUE); if(self->mCloseOnSelect) { self->mCloseOnSelect = FALSE; @@ -268,6 +288,26 @@ void LLFloaterAvatarPicker::populateNearMe() } } +void LLFloaterAvatarPicker::populateFriend() +{ + LLScrollListCtrl* friends_scroller = getChild<LLScrollListCtrl>("Friends"); + friends_scroller->deleteAllItems(); + LLCollectAllBuddies collector; + LLAvatarTracker::instance().applyFunctor(collector); + LLCollectAllBuddies::buddy_map_t::iterator it; + + + for(it = collector.mOnline.begin(); it!=collector.mOnline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + for(it = collector.mOffline.begin(); it!=collector.mOffline.end(); it++) + { + friends_scroller->addStringUUIDItem(it->first, it->second); + } + friends_scroller->sortByColumnIndex(0, TRUE); +} + void LLFloaterAvatarPicker::draw() { LLFloater::draw(); @@ -289,6 +329,10 @@ BOOL LLFloaterAvatarPicker::visibleItemsSelected() const { return getChild<LLScrollListCtrl>("NearMe")->getFirstSelectedIndex() >= 0; } + else if(active_panel == getChild<LLPanel>("FriendsPanel")) + { + return getChild<LLScrollListCtrl>("Friends")->getFirstSelectedIndex() >= 0; + } return FALSE; } @@ -321,6 +365,7 @@ void LLFloaterAvatarPicker::setAllowMultiple(BOOL allow_multiple) { getChild<LLScrollListCtrl>("SearchResults")->setAllowMultipleSelection(allow_multiple); getChild<LLScrollListCtrl>("NearMe")->setAllowMultipleSelection(allow_multiple); + getChild<LLScrollListCtrl>("Friends")->setAllowMultipleSelection(allow_multiple); } // static diff --git a/indra/newview/llfloateravatarpicker.h b/indra/newview/llfloateravatarpicker.h index 85aacb68a5..b8ace985d9 100644 --- a/indra/newview/llfloateravatarpicker.h +++ b/indra/newview/llfloateravatarpicker.h @@ -67,6 +67,7 @@ private: void onTabChanged(); void populateNearMe(); + void populateFriend(); BOOL visibleItemsSelected() const; // Returns true if any items in the current tab are selected. void find(); diff --git a/indra/newview/llfloaterbump.cpp b/indra/newview/llfloaterbump.cpp index 8b64f913e0..68f06b1e5b 100644 --- a/indra/newview/llfloaterbump.cpp +++ b/indra/newview/llfloaterbump.cpp @@ -40,7 +40,6 @@ #include "llsd.h" #include "lluictrlfactory.h" #include "llviewermessage.h" -#include "llappviewer.h" // gPacificDaylightTime ///---------------------------------------------------------------------------- /// Class LLFloaterBump diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index dca0773139..d1317f7c36 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -268,8 +268,8 @@ void LLFloaterCamera::updateState() LLRect controls_rect; if (childGetRect(CONTROLS, controls_rect)) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); - static S32 height = controls_rect.getHeight() - floater_header_size; + S32 floater_header_size = getHeaderHeight(); + S32 height = controls_rect.getHeight() - floater_header_size; S32 newHeight = rect.getHeight(); if (showControls) diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp index 6d2e959352..ed14079ae9 100644 --- a/indra/newview/llfloaterchat.cpp +++ b/indra/newview/llfloaterchat.cpp @@ -182,13 +182,7 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& void log_chat_text(const LLChat& chat) { - std::string histstr; - if (gSavedPerAccountSettings.getBOOL("LogTimestamp")) - histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + chat.mText; - else - histstr = chat.mText; - - LLLogChat::saveHistory(std::string("chat"),histstr); + LLLogChat::saveHistory(std::string("chat"), chat.mFromName, chat.mFromID, chat.mText); } // static void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) @@ -204,12 +198,14 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file) if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { - LLFloaterScriptDebug::addScriptLine(chat.mText, - chat.mFromName, - color, - chat.mFromID); - if (!gSavedSettings.getBOOL("ScriptErrorsAsChat")) + if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) + return; + if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1) { + LLFloaterScriptDebug::addScriptLine(chat.mText, + chat.mFromName, + color, + chat.mFromID); return; } } @@ -315,9 +311,9 @@ void LLFloaterChat::addChat(const LLChat& chat, { LLColor4 text_color = get_text_color(chat); - BOOL invisible_script_debug_chat = - chat.mChatType == CHAT_TYPE_DEBUG_MSG - && !gSavedSettings.getBOOL("ScriptErrorsAsChat"); + BOOL invisible_script_debug_chat = ((gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) || + (chat.mChatType == CHAT_TYPE_DEBUG_MSG + && (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1))); if (!invisible_script_debug_chat && !chat.mMuted @@ -474,7 +470,7 @@ void LLFloaterChat::loadHistory() } //static -void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string line, void* userdata) +void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , const LLSD& line, void* userdata) { switch (type) { @@ -483,9 +479,10 @@ void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , std::string l // *TODO: nice message from XML file here break; case LLLogChat::LOG_LINE: + case LLLogChat::LOG_LLSD: { LLChat chat; - chat.mText = line; + chat.mText = line["message"].asString(); get_text_color(chat); addChatHistory(chat, FALSE); } diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h index 6ba3165d6a..aed82a6781 100644 --- a/indra/newview/llfloaterchat.h +++ b/indra/newview/llfloaterchat.h @@ -78,7 +78,7 @@ public: static void onClickMute(void *data); static void onClickToggleShowMute(LLUICtrl* caller, void *data); static void onClickToggleActiveSpeakers(void* userdata); - static void chatFromLogFile(LLLogChat::ELogLineType type,std::string line, void* userdata); + static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& line, void* userdata); static void loadHistory(); static void* createSpeakersPanel(void* data); static void* createChatPanel(void* data); diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp index dea656b0e4..fbf09207fe 100644 --- a/indra/newview/llfloaterchatterbox.cpp +++ b/indra/newview/llfloaterchatterbox.cpp @@ -42,7 +42,7 @@ #include "llfloaterfriends.h" #include "llfloatergroups.h" #include "llviewercontrol.h" -#include "llimview.h" +#include "llvoicechannel.h" #include "llimpanel.h" // diff --git a/indra/newview/llfloatercolorpicker.cpp b/indra/newview/llfloatercolorpicker.cpp index 8e385fca78..73b79d8e13 100644 --- a/indra/newview/llfloatercolorpicker.cpp +++ b/indra/newview/llfloatercolorpicker.cpp @@ -561,7 +561,7 @@ void LLFloaterColorPicker::draw() // create rgb area outline gl_rect_2d ( mRGBViewerImageLeft, mRGBViewerImageTop - mRGBViewerImageHeight, - mRGBViewerImageLeft + mRGBViewerImageWidth, + mRGBViewerImageLeft + mRGBViewerImageWidth + 1, mRGBViewerImageTop, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE ); @@ -591,7 +591,7 @@ void LLFloaterColorPicker::draw() // draw luminance slider outline gl_rect_2d ( mLumRegionLeft, mLumRegionTop - mLumRegionHeight, - mLumRegionLeft + mLumRegionWidth, + mLumRegionLeft + mLumRegionWidth + 1, mLumRegionTop, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE ); @@ -607,7 +607,7 @@ void LLFloaterColorPicker::draw() // draw selected color swatch outline gl_rect_2d ( mSwatchRegionLeft, mSwatchRegionTop - mSwatchRegionHeight, - mSwatchRegionLeft + mSwatchRegionWidth, + mSwatchRegionLeft + mSwatchRegionWidth + 1, mSwatchRegionTop, LLColor4 ( 0.0f, 0.0f, 0.0f, 1.0f ), FALSE ); diff --git a/indra/newview/llfloatergroupinvite.cpp b/indra/newview/llfloatergroupinvite.cpp index 3598479305..bf484c6343 100644 --- a/indra/newview/llfloatergroupinvite.cpp +++ b/indra/newview/llfloatergroupinvite.cpp @@ -81,7 +81,7 @@ void LLFloaterGroupInvite::impl::closeFloater(void* data) LLFloaterGroupInvite::LLFloaterGroupInvite(const LLUUID& group_id) : LLFloater(group_id) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + S32 floater_header_size = getHeaderHeight(); LLRect contents; mImpl = new impl(group_id); @@ -114,7 +114,8 @@ LLFloaterGroupInvite::~LLFloaterGroupInvite() // static void LLFloaterGroupInvite::showForGroup(const LLUUID& group_id, std::vector<LLUUID> *agent_ids) { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& floater_params = LLFloater::getDefaultParams(); + S32 floater_header_size = floater_params.header_height; LLRect contents; // Make sure group_id isn't null diff --git a/indra/newview/llfloaterinventory.cpp b/indra/newview/llfloaterinventory.cpp index c890f9f122..a47916b7d7 100644 --- a/indra/newview/llfloaterinventory.cpp +++ b/indra/newview/llfloaterinventory.cpp @@ -1438,7 +1438,11 @@ void LLInventoryPanel::modelChanged(U32 mask) } LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolders->getItemByID(model_item->getParentUUID()); - if (view_item->getParentFolder() != new_parent) + + // added check against NULL for cases when Inventory panel contains startFolder. + // in this case parent is LLFolderView (LLInventoryPanel::mFolders) itself. + // this check is a fix for bug EXT-1859. + if (NULL != new_parent && view_item->getParentFolder() != new_parent) { view_item->getParentFolder()->extractItem(view_item); view_item->addToFolder(new_parent, mFolders); diff --git a/indra/newview/llfloaternotificationsconsole.cpp b/indra/newview/llfloaternotificationsconsole.cpp index f2dff55044..f20fca1258 100644 --- a/indra/newview/llfloaternotificationsconsole.cpp +++ b/indra/newview/llfloaternotificationsconsole.cpp @@ -221,7 +221,8 @@ void LLFloaterNotificationConsole::removeChannel(const std::string& name) //static void LLFloaterNotificationConsole::updateResizeLimits() { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& floater_params = LLFloater::getDefaultParams(); + S32 floater_header_size = floater_params.header_height; LLLayoutStack& stack = getChildRef<LLLayoutStack>("notification_channels"); setResizeLimits(getMinWidth(), floater_header_size + HEADER_PADDING + ((NOTIFICATION_PANEL_HEADER_HEIGHT + 3) * stack.getNumPanels())); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index dbee9ea309..8b3391726a 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -843,10 +843,7 @@ void LLFloaterPreference::refreshEnabledState() bool bumpshiny = gGLManager.mHasCubeMap && LLCubeMap::sUseCubeMaps && LLFeatureManager::getInstance()->isFeatureAvailable("RenderObjectBump"); getChild<LLCheckBoxCtrl>("BumpShiny")->setEnabled(bumpshiny ? TRUE : FALSE); - for (S32 i = 0; i < radio_reflection_detail->getItemCount(); ++i) - { - radio_reflection_detail->setIndexEnabled(i, ctrl_reflections->get() && reflections); - } + radio_reflection_detail->setEnabled(ctrl_reflections->get() && reflections); // Avatar Mode // Enable Avatar Shaders @@ -880,20 +877,10 @@ void LLFloaterPreference::refreshEnabledState() { mRadioTerrainDetail->setValue(1); mRadioTerrainDetail->setEnabled(FALSE); - for (S32 i = 0; i < mRadioTerrainDetail->getItemCount(); ++i) - { - mRadioTerrainDetail->setIndexEnabled(i, FALSE); - } } else { - mRadioTerrainDetail->setEnabled(TRUE); - - for (S32 i = 0; i < mRadioTerrainDetail->getItemCount(); ++i) - { - mRadioTerrainDetail->setIndexEnabled(i, TRUE); - } - + mRadioTerrainDetail->setEnabled(TRUE); } // WindLight diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index 4c83530f43..bd9798c18e 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -34,6 +34,7 @@ #include "llviewerprecompiledheaders.h" #include "llfloatersearch.h" #include "llmediactrl.h" +#include "llagent.h" LLFloaterSearch::LLFloaterSearch(const LLSD& key) : @@ -117,6 +118,14 @@ void LLFloaterSearch::search(const LLSD &key) std::string search_text = key.has("id") ? key["id"].asString() : ""; url += std::string("?q=") + search_text; + // append the maturity and teen capabilities for this agent + BOOL godlike = gAgent.isGodlike(); + bool mature_enabled = gAgent.canAccessMature() || godlike; + bool adult_enabled = gAgent.canAccessAdult() || godlike; + std::string mature = (mature_enabled) ? "True" : "False"; + std::string teen = (!adult_enabled) ? "True" : "False"; + url += "&t=" + teen + "&m=" + mature; + // and load the URL in the web view mBrowser->navigateTo(url); } diff --git a/indra/newview/llfloatertools.cpp b/indra/newview/llfloatertools.cpp index 92980c22c7..5fee84190b 100644 --- a/indra/newview/llfloatertools.cpp +++ b/indra/newview/llfloatertools.cpp @@ -49,6 +49,7 @@ #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llmediaentry.h" +#include "llmediactrl.h" #include "llmenugl.h" #include "llpanelcontents.h" #include "llpanelface.h" @@ -221,6 +222,7 @@ BOOL LLFloaterTools::postBuild() mRadioGroupMove = getChild<LLRadioGroup>("move_radio_group"); mRadioGroupEdit = getChild<LLRadioGroup>("edit_radio_group"); mBtnGridOptions = getChild<LLButton>("Options..."); + mTitleMedia = getChild<LLMediaCtrl>("title_media"); mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts"); childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); @@ -304,6 +306,7 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mCheckSnapToGrid(NULL), mBtnGridOptions(NULL), + mTitleMedia(NULL), mTextGridMode(NULL), mComboGridMode(NULL), mCheckStretchUniform(NULL), @@ -335,7 +338,8 @@ LLFloaterTools::LLFloaterTools(const LLSD& key) mPanelLandInfo(NULL), mTabLand(NULL), - mDirty(TRUE) + mDirty(TRUE), + mNeedMediaTitle(TRUE) { gFloaterTools = this; @@ -440,6 +444,9 @@ void LLFloaterTools::draw() mDirty = FALSE; } + // grab media name/title and update the UI widget + updateMediaTitle(); + // mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); LLFloater::draw(); } @@ -736,6 +743,10 @@ void LLFloaterTools::onClose(bool app_quitting) LLViewerJoystick::getInstance()->moveAvatar(false); + // destroy media source used to grab media title + if( mTitleMedia ) + mTitleMedia->unloadMediaSource(); + // Different from handle_reset_view in that it doesn't actually // move the camera if EditCameraMovement is not set. gAgent.resetView(gSavedSettings.getBOOL("EditCameraMovement")); @@ -1108,6 +1119,7 @@ void LLFloaterTools::getMediaState() std::string multi_media_info_str = LLTrans::getString("Multiple Media"); std::string media_title = ""; + mNeedMediaTitle = false; // update UI depending on whether "object" (prim or face) has media // and whether or not you are allowed to edit it. @@ -1123,25 +1135,26 @@ void LLFloaterTools::getMediaState() // Media data is valid if(media_data_get!=default_media_data) { - //TODO: get media title - //media_title = media_data_get->getTitle(); - //LLFloaterMediaSettings::getInstance()->mIdenticalValidMedia = true; + // initial media title is the media URL (until we get the name) media_title = media_data_get.getHomeURL(); + + // kick off a navigate and flag that we need to update the title + navigateToTitleMedia( media_data_get.getHomeURL() ); + mNeedMediaTitle = true; } // else all faces might be empty. - - } else // there' re Different Medias' been set on on the faces. { media_title = multi_media_info_str; + mNeedMediaTitle = false; } childSetEnabled("media_tex", bool_has_media & editable); childSetEnabled( "edit_media", bool_has_media & editable ); childSetEnabled( "delete_media", bool_has_media & editable ); childSetEnabled( "add_media", ( ! bool_has_media ) & editable ); - media_info->setEnabled(bool_has_media & editable); + media_info->setEnabled(false); // TODO: display a list of all media on the face - use 'identical' flag } else // not all face has media but at least one does. @@ -1152,20 +1165,23 @@ void LLFloaterTools::getMediaState() if(LLFloaterMediaSettings::getInstance()->mMultipleValidMedia) { media_title = multi_media_info_str; + mNeedMediaTitle = false; } else { // Media data is valid if(media_data_get!=default_media_data) { - //TODO: get media title - //media_title = media_data_get->getTitle(); + // initial media title is the media URL (until we get the name) media_title = media_data_get.getHomeURL(); + + // kick off a navigate and flag that we need to update the title + navigateToTitleMedia( media_data_get.getHomeURL() ); + mNeedMediaTitle = true; } - } - media_info->setEnabled(TRUE); + media_info->setEnabled(false); media_info->setTentative(true); childSetEnabled("media_tex", TRUE); childSetEnabled( "edit_media", TRUE); @@ -1253,12 +1269,63 @@ bool LLFloaterTools::deleteMediaConfirm(const LLSD& notification, const LLSD& re return false; } +////////////////////////////////////////////////////////////////////////////// +// void LLFloaterTools::clearMediaSettings() { LLFloaterMediaSettings::getInstance(); LLFloaterMediaSettings::clearValues(false); } + +////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterTools::navigateToTitleMedia( const std::string url ) +{ + if ( mTitleMedia ) + { + LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin(); + if ( media_plugin ) + { + // if it's a movie, we don't want to hear it + media_plugin->setVolume( 0 ); + }; + mTitleMedia->navigateTo( url ); + }; +} + +////////////////////////////////////////////////////////////////////////////// +// +void LLFloaterTools::updateMediaTitle() +{ + // only get the media name if we need it + if ( ! mNeedMediaTitle ) + return; + + // get plugin impl + LLPluginClassMedia* media_plugin = mTitleMedia->getMediaPlugin(); + if ( media_plugin ) + { + // get the media name (asynchronous - must call repeatedly) + std::string media_title = media_plugin->getMediaName(); + + // only replace the title if what we get contains something + if ( ! media_title.empty() ) + { + // update the UI widget + LLLineEditor* media_title_field = getChild<LLLineEditor>("media_info"); + if ( media_title_field ) + { + media_title_field->setText( media_title ); + + // stop looking for a title when we get one + // FIXME: check this is the right approach + mNeedMediaTitle = false; + }; + }; + }; +} + ////////////////////////////////////////////////////////////////////////////// // void LLFloaterTools::updateMediaSettings() diff --git a/indra/newview/llfloatertools.h b/indra/newview/llfloatertools.h index 59acef6071..a3e0cac034 100644 --- a/indra/newview/llfloatertools.h +++ b/indra/newview/llfloatertools.h @@ -51,6 +51,7 @@ class LLRadioGroup; class LLSlider; class LLTabContainer; class LLTextBox; +class LLMediaCtrl; class LLTool; class LLParcelSelection; class LLObjectSelection; @@ -107,6 +108,8 @@ public: void onClickBtnAddMedia(); void onClickBtnEditMedia(); void clearMediaSettings(); + void updateMediaTitle(); + void navigateToTitleMedia( const std::string url ); bool selectedMediaEditable(); private: @@ -182,6 +185,9 @@ public: LLParcelSelectionHandle mParcelSelection; LLObjectSelectionHandle mObjectSelection; + LLMediaCtrl *mTitleMedia; + bool mNeedMediaTitle; + private: BOOL mDirty; diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index ac743df4f1..2fe21f28de 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -865,7 +865,8 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) } else // if it is a panel... { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + const LLFloater::Params& floater_params = LLFloater::getDefaultParams(); + S32 floater_header_size = floater_params.header_height; LLPanel::Params panel_params; LLPanel* panel = LLUICtrlFactory::create<LLPanel>(panel_params); // create a new panel diff --git a/indra/newview/llfloatervoicedevicesettings.cpp b/indra/newview/llfloatervoicedevicesettings.cpp index b64257b11d..aca9198f59 100644 --- a/indra/newview/llfloatervoicedevicesettings.cpp +++ b/indra/newview/llfloatervoicedevicesettings.cpp @@ -43,7 +43,7 @@ #include "llsliderctrl.h" #include "llviewercontrol.h" #include "llvoiceclient.h" -#include "llimpanel.h" +#include "llvoicechannel.h" // Library includes (after viewer) #include "lluictrlfactory.h" diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index a20b5ea66c..dee86f4a22 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -42,7 +42,6 @@ #include "llchiclet.h" #include "llfloaterchat.h" #include "llfloaterreg.h" -#include "llimview.h" #include "lllineeditor.h" #include "lllogchat.h" #include "llpanelimcontrolpanel.h" @@ -50,7 +49,9 @@ #include "lltrans.h" #include "llchathistory.h" #include "llviewerwindow.h" +#include "llvoicechannel.h" #include "lltransientfloatermgr.h" +#include "llinventorymodel.h" @@ -61,7 +62,14 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) mLastMessageIndex(-1), mDialog(IM_NOTHING_SPECIAL), mChatHistory(NULL), - mInputEditor(NULL), + mInputEditor(NULL), + mSavedTitle(), + mTypingStart(), + mShouldSendTypingState(false), + mMeTyping(false), + mOtherTyping(false), + mTypingTimer(), + mTypingTimeoutTimer(), mPositioned(false), mSessionInitialized(false) { @@ -71,12 +79,15 @@ LLIMFloater::LLIMFloater(const LLUUID& session_id) mSessionInitialized = im_session->mSessionInitialized; mDialog = im_session->mType; - if (IM_NOTHING_SPECIAL == mDialog || IM_SESSION_P2P_INVITE == mDialog) - { + switch(mDialog){ + case IM_NOTHING_SPECIAL: + case IM_SESSION_P2P_INVITE: mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelIMControl, this); - } - else - { + break; + case IM_SESSION_CONFERENCE_START: + mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelAdHocControl, this); + break; + default: mFactoryMap["panel_im_control_panel"] = LLCallbackMap(createPanelGroupControl, this); } } @@ -95,6 +106,7 @@ void LLIMFloater::onFocusReceived() // virtual void LLIMFloater::onClose(bool app_quitting) { + setTyping(false); gIMMgr->leaveSession(mSessionID); } @@ -141,6 +153,7 @@ void LLIMFloater::onSendMsg( LLUICtrl* ctrl, void* userdata ) { LLIMFloater* self = (LLIMFloater*) userdata; self->sendMsg(); + self->setTyping(false); } void LLIMFloater::sendMsg() @@ -193,9 +206,10 @@ BOOL LLIMFloater::postBuild() if (other_party_id.notNull()) { mOtherParticipantUUID = other_party_id; - mControlPanel->setID(mOtherParticipantUUID); } + mControlPanel->setSessionId(mSessionID); + LLButton* slide_left = getChild<LLButton>("slide_left_btn"); slide_left->setVisible(mControlPanel->getVisible()); slide_left->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this)); @@ -222,10 +236,16 @@ BOOL LLIMFloater::postBuild() setTitle(LLIMModel::instance().getName(mSessionID)); setDocked(true); - - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) + + mTypingStart = LLTrans::getString("IM_typing_start_string"); + + // Disable input editor if session cannot accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(mSessionID); + if( im_session && !im_session->mTextIMPossible ) { - LLLogChat::loadHistory(getTitle(), &chatFromLogFile, (void *)this); + mInputEditor->setEnabled(FALSE); + mInputEditor->setLabel(LLTrans::getString("IM_unavailable_text_label")); } //*TODO if session is not initialized yet, add some sort of a warning message like "starting session...blablabla" @@ -234,6 +254,20 @@ BOOL LLIMFloater::postBuild() return LLDockableFloater::postBuild(); } +// virtual +void LLIMFloater::draw() +{ + if ( mMeTyping ) + { + // Time out if user hasn't typed for a while. + if ( mTypingTimeoutTimer.getElapsedTimeF32() > LLAgent::TYPING_TIMEOUT_SECS ) + { + setTyping(false); + } + } + + LLTransientDockableFloater::draw(); +} // static @@ -255,11 +289,22 @@ void* LLIMFloater::createPanelGroupControl(void* userdata) return self->mControlPanel; } +// static +void* LLIMFloater::createPanelAdHocControl(void* userdata) +{ + LLIMFloater *self = (LLIMFloater*)userdata; + self->mControlPanel = new LLPanelAdHocControlPanel(self->mSessionID); + self->mControlPanel->setXMLFilename("panel_adhoc_control_panel.xml"); + return self->mControlPanel; +} + void LLIMFloater::onSlide() { LLPanel* im_control_panel = getChild<LLPanel>("panel_im_control_panel"); im_control_panel->setVisible(!im_control_panel->getVisible()); + gSavedSettings.setBOOL("IMShowControlPanel", im_control_panel->getVisible()); + getChild<LLButton>("slide_left_btn")->setVisible(im_control_panel->getVisible()); getChild<LLButton>("slide_right_btn")->setVisible(!im_control_panel->getVisible()); } @@ -302,6 +347,8 @@ LLIMFloater* LLIMFloater::show(const LLUUID& session_id) LLDockControl::TOP, boost::bind(&LLIMFloater::getAllowedRect, floater, _1))); } + floater->childSetVisible("panel_im_control_panel", gSavedSettings.getBOOL("IMShowControlPanel")); + return floater; } @@ -363,8 +410,6 @@ bool LLIMFloater::toggle(const LLUUID& session_id) { // ensure the list of messages is updated when floater is made visible show(session_id); - // update number of unread notifications in the SysWell - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); return true; } } @@ -379,10 +424,12 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) { mSessionInitialized = true; + //will be different only for an ad-hoc im session if (mSessionID != im_session_id) { mSessionID = im_session_id; setKey(im_session_id); + mControlPanel->setSessionId(im_session_id); } //*TODO here we should remove "starting session..." warning message if we added it in postBuild() (IB) @@ -402,10 +449,8 @@ void LLIMFloater::sessionInitReplyReceived(const LLUUID& im_session_id) void LLIMFloater::updateMessages() { - std::list<LLSD> messages = LLIMModel::instance().getMessages(mSessionID, mLastMessageIndex+1); - std::string agent_name; - - gCacheName->getFullName(gAgentID, agent_name); + std::list<LLSD> messages; + LLIMModel::instance().getMessages(mSessionID, messages, mLastMessageIndex+1); if (messages.size()) { @@ -414,21 +459,22 @@ void LLIMFloater::updateMessages() std::ostringstream message; std::list<LLSD>::const_reverse_iterator iter = messages.rbegin(); std::list<LLSD>::const_reverse_iterator iter_end = messages.rend(); - for (; iter != iter_end; ++iter) + for (; iter != iter_end; ++iter) { LLSD msg = *iter; - std::string from = msg["from"].asString(); std::string time = msg["time"].asString(); LLUUID from_id = msg["from_id"].asUUID(); + std::string from = from_id != gAgentID ? msg["from"].asString() : LLTrans::getString("You"); std::string message = msg["message"].asString(); LLStyle::Params style_params; style_params.color(chat_color); - if (from == agent_name) - from = LLTrans::getString("You"); + LLChat chat(message); + chat.mFromID = from_id; + chat.mFromName = from; - mChatHistory->appendWidgetMessage(from_id, from, time, message, style_params); + mChatHistory->appendWidgetMessage(chat, style_params); mLastMessageIndex = msg["index"].asInteger(); } @@ -440,9 +486,14 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* { LLIMFloater* self= (LLIMFloater*) userdata; - //in disconnected state IM input editor should be disabled - self->mInputEditor->setEnabled(!gDisconnected); - + // Allow enabling the LLIMFloater input editor only if session can accept text + LLIMModel::LLIMSession* im_session = + LLIMModel::instance().findIMSession(self->mSessionID); + if( im_session && im_session->mTextIMPossible ) + { + //in disconnected state IM input editor should be disabled + self->mInputEditor->setEnabled(!gDisconnected); + } self->mChatHistory->setCursorAndScrollToEnd(); } @@ -450,7 +501,7 @@ void LLIMFloater::onInputEditorFocusReceived( LLFocusableElement* caller, void* void LLIMFloater::onInputEditorFocusLost(LLFocusableElement* caller, void* userdata) { LLIMFloater* self = (LLIMFloater*) userdata; - self->setTyping(FALSE); + self->setTyping(false); } // static @@ -460,53 +511,297 @@ void LLIMFloater::onInputEditorKeystroke(LLLineEditor* caller, void* userdata) std::string text = self->mInputEditor->getText(); if (!text.empty()) { - self->setTyping(TRUE); + self->setTyping(true); } else { // Deleting all text counts as stopping typing. - self->setTyping(FALSE); + self->setTyping(false); } } +void LLIMFloater::setTyping(bool typing) +{ + if ( typing ) + { + // Started or proceeded typing, reset the typing timeout timer + mTypingTimeoutTimer.reset(); + } -//just a stub for now -void LLIMFloater::setTyping(BOOL typing) + if ( mMeTyping != typing ) + { + // Typing state is changed + mMeTyping = typing; + // So, should send current state + mShouldSendTypingState = true; + // In case typing is started, send state after some delay + mTypingTimer.reset(); + } + + // Don't want to send typing indicators to multiple people, potentially too + // much network traffic. Only send in person-to-person IMs. + if ( mShouldSendTypingState && mDialog == IM_NOTHING_SPECIAL ) + { + if ( mMeTyping ) + { + if ( mTypingTimer.getElapsedTimeF32() > 1.f ) + { + // Still typing, send 'start typing' notification + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, TRUE); + mShouldSendTypingState = false; + } + } + else + { + // Send 'stop typing' notification immediately + LLIMModel::instance().sendTypingState(mSessionID, mOtherParticipantUUID, FALSE); + mShouldSendTypingState = false; + } + } + + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if (speaker_mgr) + speaker_mgr->setSpeakerTyping(gAgent.getID(), FALSE); + +} + +void LLIMFloater::processIMTyping(const LLIMInfo* im_info, BOOL typing) { + if ( typing ) + { + // other user started typing + addTypingIndicator(im_info); + } + else + { + // other user stopped typing + removeTypingIndicator(im_info); + } } -void LLIMFloater::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata) +void LLIMFloater::processSessionUpdate(const LLSD& session_update) { - if (!userdata) return; + // *TODO : verify following code when moderated mode will be implemented + if ( false && session_update.has("moderated_mode") && + session_update["moderated_mode"].has("voice") ) + { + BOOL voice_moderated = session_update["moderated_mode"]["voice"]; + const std::string session_label = LLIMModel::instance().getName(mSessionID); - LLIMFloater* self = (LLIMFloater*) userdata; - std::string message = line; - S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); - switch (type) + if (voice_moderated) + { + setTitle(session_label + std::string(" ") + LLTrans::getString("IM_moderated_chat_label")); + } + else + { + setTitle(session_label); + } + + // *TODO : uncomment this when/if LLPanelActiveSpeakers panel will be added + //update the speakers dropdown too + //mSpeakerPanel->setVoiceModerationCtrlMode(voice_moderated); + } +} + +BOOL LLIMFloater::handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL drop, EDragAndDropType cargo_type, + void *cargo_data, EAcceptance *accept, + std::string& tooltip_msg) +{ + + if (mDialog == IM_NOTHING_SPECIAL) + { + LLToolDragAndDrop::handleGiveDragAndDrop(mOtherParticipantUUID, mSessionID, drop, + cargo_type, cargo_data, accept); + } + + // handle case for dropping calling cards (and folders of calling cards) onto invitation panel for invites + else if (isInviteAllowed()) + { + *accept = ACCEPT_NO; + + if (cargo_type == DAD_CALLINGCARD) + { + if (dropCallingCard((LLInventoryItem*)cargo_data, drop)) + { + *accept = ACCEPT_YES_MULTI; + } + } + else if (cargo_type == DAD_CATEGORY) + { + if (dropCategory((LLInventoryCategory*)cargo_data, drop)) + { + *accept = ACCEPT_YES_MULTI; + } + } + } + return TRUE; +} + +BOOL LLIMFloater::dropCallingCard(LLInventoryItem* item, BOOL drop) +{ + BOOL rv = isInviteAllowed(); + if(rv && item && item->getCreatorUUID().notNull()) { - case LLLogChat::LOG_EMPTY: - // add warning log enabled message - if (im_log_option!=LOG_CHAT) + if(drop) { - message = LLTrans::getString("IM_logging_string"); + std::vector<LLUUID> ids; + ids.push_back(item->getCreatorUUID()); + inviteToSession(ids); } - break; - case LLLogChat::LOG_END: - // add log end message - if (im_log_option!=LOG_CHAT) + } + else + { + // set to false if creator uuid is null. + rv = FALSE; + } + return rv; +} + +BOOL LLIMFloater::dropCategory(LLInventoryCategory* category, BOOL drop) +{ + BOOL rv = isInviteAllowed(); + if(rv && category) + { + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + LLUniqueBuddyCollector buddies; + gInventory.collectDescendentsIf(category->getUUID(), + cats, + items, + LLInventoryModel::EXCLUDE_TRASH, + buddies); + S32 count = items.count(); + if(count == 0) { - message = LLTrans::getString("IM_logging_string"); + rv = FALSE; } - break; - case LLLogChat::LOG_LINE: - // just add normal lines from file - break; - default: - // nothing - break; + else if(drop) + { + std::vector<LLUUID> ids; + ids.reserve(count); + for(S32 i = 0; i < count; ++i) + { + ids.push_back(items.get(i)->getCreatorUUID()); + } + inviteToSession(ids); + } + } + return rv; +} + +BOOL LLIMFloater::isInviteAllowed() const +{ + + return ( (IM_SESSION_CONFERENCE_START == mDialog) + || (IM_SESSION_INVITE == mDialog) ); +} + +class LLSessionInviteResponder : public LLHTTPClient::Responder +{ +public: + LLSessionInviteResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + void error(U32 statusNum, const std::string& reason) + { + llinfos << "Error inviting all agents to session" << llendl; + //throw something back to the viewer here? } - self->mChatHistory->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor"))); - self->mChatHistory->blockUndo(); +private: + LLUUID mSessionID; +}; + +BOOL LLIMFloater::inviteToSession(const std::vector<LLUUID>& ids) +{ + LLViewerRegion* region = gAgent.getRegion(); + if (!region) + { + return FALSE; + } + + S32 count = ids.size(); + + if( isInviteAllowed() && (count > 0) ) + { + llinfos << "LLIMFloater::inviteToSession() - inviting participants" << llendl; + + std::string url = region->getCapability("ChatSessionRequest"); + + LLSD data; + + data["params"] = LLSD::emptyArray(); + for (int i = 0; i < count; i++) + { + data["params"].append(ids[i]); + } + + data["method"] = "invite"; + data["session-id"] = mSessionID; + LLHTTPClient::post( + url, + data, + new LLSessionInviteResponder( + mSessionID)); + } + else + { + llinfos << "LLIMFloater::inviteToSession -" + << " no need to invite agents for " + << mDialog << llendl; + // successful add, because everyone that needed to get added + // was added. + } + + return TRUE; +} + +void LLIMFloater::addTypingIndicator(const LLIMInfo* im_info) +{ + // We may have lost a "stop-typing" packet, don't add it twice + if ( im_info && !mOtherTyping ) + { + mOtherTyping = true; + + // Create typing is started title string + LLUIString typing_start(mTypingStart); + typing_start.setArg("[NAME]", im_info->mName); + + // Save and set new title + mSavedTitle = getTitle(); + setTitle (typing_start); + + // Update speaker + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if ( speaker_mgr ) + { + speaker_mgr->setSpeakerTyping(im_info->mFromID, TRUE); + } + } +} + +void LLIMFloater::removeTypingIndicator(const LLIMInfo* im_info) +{ + if ( mOtherTyping ) + { + mOtherTyping = false; + + // Revert the title to saved one + setTitle(mSavedTitle); + + if ( im_info ) + { + // Update speaker + LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(mSessionID); + if ( speaker_mgr ) + { + speaker_mgr->setSpeakerTyping(im_info->mFromID, FALSE); + } + } + + } } diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h index 99810b6d6d..f5edb3188a 100644 --- a/indra/newview/llimfloater.h +++ b/indra/newview/llimfloater.h @@ -35,11 +35,13 @@ #include "lltransientdockablefloater.h" #include "lllogchat.h" +#include "lltooldraganddrop.h" class LLLineEditor; class LLPanelChatControlPanel; class LLChatHistory; - +class LLInventoryItem; +class LLInventoryCategory; /** * Individual IM window that appears at the bottom of the screen, @@ -55,6 +57,8 @@ public: // LLView overrides /*virtual*/ BOOL postBuild(); /*virtual*/ void setVisible(BOOL visible); + // Check typing timeout timer. + /*virtual*/ void draw(); // LLFloater overrides /*virtual*/ void onClose(bool app_quitting); @@ -85,24 +89,41 @@ public: void setPositioned(bool b) { mPositioned = b; }; void onVisibilityChange(const LLSD& new_visibility); + void processIMTyping(const LLIMInfo* im_info, BOOL typing); + void processSessionUpdate(const LLSD& session_update); + + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, + BOOL drop, EDragAndDropType cargo_type, + void *cargo_data, EAcceptance *accept, + std::string& tooltip_msg); private: // process focus events to set a currently active session /* virtual */ void onFocusLost(); /* virtual */ void onFocusReceived(); + + BOOL dropCallingCard(LLInventoryItem* item, BOOL drop); + BOOL dropCategory(LLInventoryCategory* category, BOOL drop); + + BOOL isInviteAllowed() const; + BOOL inviteToSession(const std::vector<LLUUID>& agent_ids); static void onInputEditorFocusReceived( LLFocusableElement* caller, void* userdata ); static void onInputEditorFocusLost(LLFocusableElement* caller, void* userdata); static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata); - void setTyping(BOOL typing); + void setTyping(bool typing); void onSlide(); static void* createPanelIMControl(void* userdata); static void* createPanelGroupControl(void* userdata); + static void* createPanelAdHocControl(void* userdata); // gets a rect that bounds possible positions for the LLIMFloater on a screen (EXT-1111) void getAllowedRect(LLRect& rect); - static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); + // Add the "User is typing..." indicator. + void addTypingIndicator(const LLIMInfo* im_info); + // Remove the "User is typing..." indicator. + void removeTypingIndicator(const LLIMInfo* im_info = NULL); LLPanelChatControlPanel* mControlPanel; LLUUID mSessionID; @@ -114,6 +135,14 @@ private: LLLineEditor* mInputEditor; bool mPositioned; + std::string mSavedTitle; + LLUIString mTypingStart; + bool mMeTyping; + bool mOtherTyping; + bool mShouldSendTypingState; + LLFrameTimer mTypingTimer; + LLFrameTimer mTypingTimeoutTimer; + bool mSessionInitialized; LLSD mQueuedMsgsForInit; }; diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp index 163984f740..c4beb666ea 100644 --- a/indra/newview/llimpanel.cpp +++ b/indra/newview/llimpanel.cpp @@ -54,6 +54,7 @@ #include "llconsole.h" #include "llgroupactions.h" #include "llfloater.h" +#include "llfloateractivespeakers.h" #include "llfloatercall.h" #include "llavataractions.h" #include "llimview.h" @@ -77,6 +78,7 @@ #include "llviewercontrol.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" +#include "llvoicechannel.h" #include "lllogchat.h" #include "llweb.h" #include "llhttpclient.h" @@ -90,7 +92,6 @@ const S32 LINE_HEIGHT = 16; const S32 MIN_WIDTH = 200; const S32 MIN_HEIGHT = 130; -const U32 DEFAULT_RETRIES_COUNT = 3; // // Statics @@ -100,831 +101,6 @@ static std::string sTitleString = "Instant Message with [NAME]"; static std::string sTypingStartString = "[NAME]: ..."; static std::string sSessionStartString = "Starting session with [NAME] please wait."; -LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; -LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; -LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; -LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; - -BOOL LLVoiceChannel::sSuspended = FALSE; - - - -class LLVoiceCallCapResponder : public LLHTTPClient::Responder -{ -public: - LLVoiceCallCapResponder(const LLUUID& session_id) : mSessionID(session_id) {}; - - virtual void error(U32 status, const std::string& reason); // called with bad status codes - virtual void result(const LLSD& content); - -private: - LLUUID mSessionID; -}; - - -void LLVoiceCallCapResponder::error(U32 status, const std::string& reason) -{ - llwarns << "LLVoiceCallCapResponder::error(" - << status << ": " << reason << ")" - << llendl; - LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); - if ( channelp ) - { - if ( 403 == status ) - { - //403 == no ability - LLNotifications::instance().add( - "VoiceNotAllowed", - channelp->getNotifyArgs()); - } - else - { - LLNotifications::instance().add( - "VoiceCallGenericError", - channelp->getNotifyArgs()); - } - channelp->deactivate(); - } -} - -void LLVoiceCallCapResponder::result(const LLSD& content) -{ - LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); - if (channelp) - { - //*TODO: DEBUG SPAM - LLSD::map_const_iterator iter; - for(iter = content.beginMap(); iter != content.endMap(); ++iter) - { - llinfos << "LLVoiceCallCapResponder::result got " - << iter->first << llendl; - } - - channelp->setChannelInfo( - content["voice_credentials"]["channel_uri"].asString(), - content["voice_credentials"]["channel_credentials"].asString()); - } -} - -// -// LLVoiceChannel -// -LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& session_name) : - mSessionID(session_id), - mState(STATE_NO_CHANNEL_INFO), - mSessionName(session_name), - mIgnoreNextSessionLeave(FALSE) -{ - mNotifyArgs["VOICE_CHANNEL_NAME"] = mSessionName; - - if (!sVoiceChannelMap.insert(std::make_pair(session_id, this)).second) - { - // a voice channel already exists for this session id, so this instance will be orphaned - // the end result should simply be the failure to make voice calls - llwarns << "Duplicate voice channels registered for session_id " << session_id << llendl; - } - - LLVoiceClient::getInstance()->addObserver(this); -} - -LLVoiceChannel::~LLVoiceChannel() -{ - // Don't use LLVoiceClient::getInstance() here -- this can get called during atexit() time and that singleton MAY have already been destroyed. - if(gVoiceClient) - { - gVoiceClient->removeObserver(this); - } - - sVoiceChannelMap.erase(mSessionID); - sVoiceChannelURIMap.erase(mURI); -} - -void LLVoiceChannel::setChannelInfo( - const std::string& uri, - const std::string& credentials) -{ - setURI(uri); - - mCredentials = credentials; - - if (mState == STATE_NO_CHANNEL_INFO) - { - if (mURI.empty()) - { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); - llwarns << "Received empty URI for channel " << mSessionName << llendl; - deactivate(); - } - else if (mCredentials.empty()) - { - LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); - llwarns << "Received empty credentials for channel " << mSessionName << llendl; - deactivate(); - } - else - { - setState(STATE_READY); - - // if we are supposed to be active, reconnect - // this will happen on initial connect, as we request credentials on first use - if (sCurrentVoiceChannel == this) - { - // just in case we got new channel info while active - // should move over to new channel - activate(); - } - } - } -} - -void LLVoiceChannel::onChange(EStatusType type, const std::string &channelURI, bool proximal) -{ - if (channelURI != mURI) - { - return; - } - - if (type < BEGIN_ERROR_STATUS) - { - handleStatusChange(type); - } - else - { - handleError(type); - } -} - -void LLVoiceChannel::handleStatusChange(EStatusType type) -{ - // status updates - switch(type) - { - case STATUS_LOGIN_RETRY: - //mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); - LLNotifications::instance().add("VoiceLoginRetry"); - break; - case STATUS_LOGGED_IN: - //if (!mLoginNotificationHandle.isDead()) - //{ - // LLNotifyBox* notifyp = (LLNotifyBox*)mLoginNotificationHandle.get(); - // if (notifyp) - // { - // notifyp->close(); - // } - // mLoginNotificationHandle.markDead(); - //} - break; - case STATUS_LEFT_CHANNEL: - if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) - { - // if forceably removed from channel - // update the UI and revert to default channel - LLNotifications::instance().add("VoiceChannelDisconnected", mNotifyArgs); - deactivate(); - } - mIgnoreNextSessionLeave = FALSE; - break; - case STATUS_JOINING: - if (callStarted()) - { - setState(STATE_RINGING); - } - break; - case STATUS_JOINED: - if (callStarted()) - { - setState(STATE_CONNECTED); - } - default: - break; - } -} - -// default behavior is to just deactivate channel -// derived classes provide specific error messages -void LLVoiceChannel::handleError(EStatusType type) -{ - deactivate(); - setState(STATE_ERROR); -} - -BOOL LLVoiceChannel::isActive() -{ - // only considered active when currently bound channel matches what our channel - return callStarted() && LLVoiceClient::getInstance()->getCurrentChannel() == mURI; -} - -BOOL LLVoiceChannel::callStarted() -{ - return mState >= STATE_CALL_STARTED; -} - -void LLVoiceChannel::deactivate() -{ - if (mState >= STATE_RINGING) - { - // ignore session leave event - mIgnoreNextSessionLeave = TRUE; - } - - if (callStarted()) - { - setState(STATE_HUNG_UP); - // mute the microphone if required when returning to the proximal channel - if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this) - { - gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); - } - } - - if (sCurrentVoiceChannel == this) - { - // default channel is proximal channel - sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance(); - sCurrentVoiceChannel->activate(); - } -} - -void LLVoiceChannel::activate() -{ - if (callStarted()) - { - return; - } - - // deactivate old channel and mark ourselves as the active one - if (sCurrentVoiceChannel != this) - { - // mark as current before deactivating the old channel to prevent - // activating the proximal channel between IM calls - LLVoiceChannel* old_channel = sCurrentVoiceChannel; - sCurrentVoiceChannel = this; - if (old_channel) - { - old_channel->deactivate(); - } - } - - if (mState == STATE_NO_CHANNEL_INFO) - { - // responsible for setting status to active - getChannelInfo(); - } - else - { - setState(STATE_CALL_STARTED); - } -} - -void LLVoiceChannel::getChannelInfo() -{ - // pretend we have everything we need - if (sCurrentVoiceChannel == this) - { - setState(STATE_CALL_STARTED); - } -} - -//static -LLVoiceChannel* LLVoiceChannel::getChannelByID(const LLUUID& session_id) -{ - voice_channel_map_t::iterator found_it = sVoiceChannelMap.find(session_id); - if (found_it == sVoiceChannelMap.end()) - { - return NULL; - } - else - { - return found_it->second; - } -} - -//static -LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri) -{ - voice_channel_map_uri_t::iterator found_it = sVoiceChannelURIMap.find(uri); - if (found_it == sVoiceChannelURIMap.end()) - { - return NULL; - } - else - { - return found_it->second; - } -} - -void LLVoiceChannel::updateSessionID(const LLUUID& new_session_id) -{ - sVoiceChannelMap.erase(sVoiceChannelMap.find(mSessionID)); - mSessionID = new_session_id; - sVoiceChannelMap.insert(std::make_pair(mSessionID, this)); -} - -void LLVoiceChannel::setURI(std::string uri) -{ - sVoiceChannelURIMap.erase(mURI); - mURI = uri; - sVoiceChannelURIMap.insert(std::make_pair(mURI, this)); -} - -void LLVoiceChannel::setState(EState state) -{ - switch(state) - { - case STATE_RINGING: - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); - break; - case STATE_CONNECTED: - gIMMgr->addSystemMessage(mSessionID, "connected", mNotifyArgs); - break; - case STATE_HUNG_UP: - gIMMgr->addSystemMessage(mSessionID, "hang_up", mNotifyArgs); - break; - default: - break; - } - - mState = state; -} - -void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) -{ - if (state == STATE_CONNECTED) - { - LLFloaterReg::showInstance("voice_call", mSessionID); - } - // By checking that current state is CONNECTED we make sure that the call window - // has been shown, hence there's something to hide. This helps when user presses - // the "End call" button right after initiating the call. - // *TODO: move this check to LLFloaterCall? - else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) - { - LLFloaterReg::hideInstance("voice_call", mSessionID); - } -} - -//static -void LLVoiceChannel::initClass() -{ - sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance(); -} - - -//static -void LLVoiceChannel::suspend() -{ - if (!sSuspended) - { - sSuspendedVoiceChannel = sCurrentVoiceChannel; - sSuspended = TRUE; - } -} - -//static -void LLVoiceChannel::resume() -{ - if (sSuspended) - { - if (gVoiceClient->voiceEnabled()) - { - if (sSuspendedVoiceChannel) - { - sSuspendedVoiceChannel->activate(); - } - else - { - LLVoiceChannelProximal::getInstance()->activate(); - } - } - sSuspended = FALSE; - } -} - - -// -// LLVoiceChannelGroup -// - -LLVoiceChannelGroup::LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name) : - LLVoiceChannel(session_id, session_name) -{ - mRetries = DEFAULT_RETRIES_COUNT; - mIsRetrying = FALSE; -} - -void LLVoiceChannelGroup::deactivate() -{ - if (callStarted()) - { - LLVoiceClient::getInstance()->leaveNonSpatialChannel(); - } - LLVoiceChannel::deactivate(); -} - -void LLVoiceChannelGroup::activate() -{ - if (callStarted()) return; - - LLVoiceChannel::activate(); - - if (callStarted()) - { - // we have the channel info, just need to use it now - LLVoiceClient::getInstance()->setNonSpatialChannel( - mURI, - mCredentials); - -#if 0 // *TODO - if (!gAgent.isInGroup(mSessionID)) // ad-hoc channel - { - // Add the party to the list of people with which we've recently interacted. - for (/*people in the chat*/) - LLRecentPeople::instance().add(buddy_id); - } -#endif - } -} - -void LLVoiceChannelGroup::getChannelInfo() -{ - LLViewerRegion* region = gAgent.getRegion(); - if (region) - { - std::string url = region->getCapability("ChatSessionRequest"); - LLSD data; - data["method"] = "call"; - data["session-id"] = mSessionID; - LLHTTPClient::post(url, - data, - new LLVoiceCallCapResponder(mSessionID)); - } -} - -void LLVoiceChannelGroup::setChannelInfo( - const std::string& uri, - const std::string& credentials) -{ - setURI(uri); - - mCredentials = credentials; - - if (mState == STATE_NO_CHANNEL_INFO) - { - if(!mURI.empty() && !mCredentials.empty()) - { - setState(STATE_READY); - - // if we are supposed to be active, reconnect - // this will happen on initial connect, as we request credentials on first use - if (sCurrentVoiceChannel == this) - { - // just in case we got new channel info while active - // should move over to new channel - activate(); - } - } - else - { - //*TODO: notify user - llwarns << "Received invalid credentials for channel " << mSessionName << llendl; - deactivate(); - } - } - else if ( mIsRetrying ) - { - // we have the channel info, just need to use it now - LLVoiceClient::getInstance()->setNonSpatialChannel( - mURI, - mCredentials); - } -} - -void LLVoiceChannelGroup::handleStatusChange(EStatusType type) -{ - // status updates - switch(type) - { - case STATUS_JOINED: - mRetries = 3; - mIsRetrying = FALSE; - default: - break; - } - - LLVoiceChannel::handleStatusChange(type); -} - -void LLVoiceChannelGroup::handleError(EStatusType status) -{ - std::string notify; - switch(status) - { - case ERROR_CHANNEL_LOCKED: - case ERROR_CHANNEL_FULL: - notify = "VoiceChannelFull"; - break; - case ERROR_NOT_AVAILABLE: - //clear URI and credentials - //set the state to be no info - //and activate - if ( mRetries > 0 ) - { - mRetries--; - mIsRetrying = TRUE; - mIgnoreNextSessionLeave = TRUE; - - getChannelInfo(); - return; - } - else - { - notify = "VoiceChannelJoinFailed"; - mRetries = DEFAULT_RETRIES_COUNT; - mIsRetrying = FALSE; - } - - break; - - case ERROR_UNKNOWN: - default: - break; - } - - // notification - if (!notify.empty()) - { - LLNotificationPtr notification = LLNotifications::instance().add(notify, mNotifyArgs); - // echo to im window - gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); - } - - LLVoiceChannel::handleError(status); -} - -void LLVoiceChannelGroup::setState(EState state) -{ - // HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - - switch(state) - { - case STATE_RINGING: - if ( !mIsRetrying ) - { - gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); - } - - mState = state; - break; - default: - LLVoiceChannel::setState(state); - } -} - -// -// LLVoiceChannelProximal -// -LLVoiceChannelProximal::LLVoiceChannelProximal() : - LLVoiceChannel(LLUUID::null, LLStringUtil::null) -{ - activate(); -} - -BOOL LLVoiceChannelProximal::isActive() -{ - return callStarted() && LLVoiceClient::getInstance()->inProximalChannel(); -} - -void LLVoiceChannelProximal::activate() -{ - if (callStarted()) return; - - LLVoiceChannel::activate(); - - if (callStarted()) - { - // this implicitly puts you back in the spatial channel - LLVoiceClient::getInstance()->leaveNonSpatialChannel(); - } -} - -void LLVoiceChannelProximal::onChange(EStatusType type, const std::string &channelURI, bool proximal) -{ - if (!proximal) - { - return; - } - - if (type < BEGIN_ERROR_STATUS) - { - handleStatusChange(type); - } - else - { - handleError(type); - } -} - -void LLVoiceChannelProximal::handleStatusChange(EStatusType status) -{ - // status updates - switch(status) - { - case STATUS_LEFT_CHANNEL: - // do not notify user when leaving proximal channel - return; - case STATUS_VOICE_DISABLED: - gIMMgr->addSystemMessage(LLUUID::null, "unavailable", mNotifyArgs); - return; - default: - break; - } - LLVoiceChannel::handleStatusChange(status); -} - - -void LLVoiceChannelProximal::handleError(EStatusType status) -{ - std::string notify; - switch(status) - { - case ERROR_CHANNEL_LOCKED: - case ERROR_CHANNEL_FULL: - notify = "ProximalVoiceChannelFull"; - break; - default: - break; - } - - // notification - if (!notify.empty()) - { - LLNotifications::instance().add(notify, mNotifyArgs); - } - - LLVoiceChannel::handleError(status); -} - -void LLVoiceChannelProximal::deactivate() -{ - if (callStarted()) - { - setState(STATE_HUNG_UP); - } -} - - -// -// LLVoiceChannelP2P -// -LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id) : - LLVoiceChannelGroup(session_id, session_name), - mOtherUserID(other_user_id), - mReceivedCall(FALSE) -{ - // make sure URI reflects encoded version of other user's agent id - setURI(LLVoiceClient::getInstance()->sipURIFromID(other_user_id)); -} - -void LLVoiceChannelP2P::handleStatusChange(EStatusType type) -{ - // status updates - switch(type) - { - case STATUS_LEFT_CHANNEL: - if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) - { - if (mState == STATE_RINGING) - { - // other user declined call - LLNotifications::instance().add("P2PCallDeclined", mNotifyArgs); - } - else - { - // other user hung up - LLNotifications::instance().add("VoiceChannelDisconnectedP2P", mNotifyArgs); - } - deactivate(); - } - mIgnoreNextSessionLeave = FALSE; - return; - default: - break; - } - - LLVoiceChannel::handleStatusChange(type); -} - -void LLVoiceChannelP2P::handleError(EStatusType type) -{ - switch(type) - { - case ERROR_NOT_AVAILABLE: - LLNotifications::instance().add("P2PCallNoAnswer", mNotifyArgs); - break; - default: - break; - } - - LLVoiceChannel::handleError(type); -} - -void LLVoiceChannelP2P::activate() -{ - if (callStarted()) return; - - LLVoiceChannel::activate(); - - if (callStarted()) - { - // no session handle yet, we're starting the call - if (mSessionHandle.empty()) - { - mReceivedCall = FALSE; - LLVoiceClient::getInstance()->callUser(mOtherUserID); - } - // otherwise answering the call - else - { - LLVoiceClient::getInstance()->answerInvite(mSessionHandle); - - // using the session handle invalidates it. Clear it out here so we can't reuse it by accident. - mSessionHandle.clear(); - } - - // Add the party to the list of people with which we've recently interacted. - LLRecentPeople::instance().add(mOtherUserID); - } -} - -void LLVoiceChannelP2P::getChannelInfo() -{ - // pretend we have everything we need, since P2P doesn't use channel info - if (sCurrentVoiceChannel == this) - { - setState(STATE_CALL_STARTED); - } -} - -// receiving session from other user who initiated call -void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::string &inURI) -{ - BOOL needs_activate = FALSE; - if (callStarted()) - { - // defer to lower agent id when already active - if (mOtherUserID < gAgent.getID()) - { - // pretend we haven't started the call yet, so we can connect to this session instead - deactivate(); - needs_activate = TRUE; - } - else - { - // we are active and have priority, invite the other user again - // under the assumption they will join this new session - mSessionHandle.clear(); - LLVoiceClient::getInstance()->callUser(mOtherUserID); - return; - } - } - - mSessionHandle = handle; - - // The URI of a p2p session should always be the other end's SIP URI. - if(!inURI.empty()) - { - setURI(inURI); - } - else - { - setURI(LLVoiceClient::getInstance()->sipURIFromID(mOtherUserID)); - } - - mReceivedCall = TRUE; - - if (needs_activate) - { - activate(); - } -} - -void LLVoiceChannelP2P::setState(EState state) -{ - // HACK: Open/close the call window if needed. - toggleCallWindowIfNeeded(state); - - // you only "answer" voice invites in p2p mode - // so provide a special purpose message here - if (mReceivedCall && state == STATE_RINGING) - { - gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); - mState = state; - return; - } - LLVoiceChannel::setState(state); -} - // // LLFloaterIMPanel @@ -1005,13 +181,6 @@ LLFloaterIMPanel::LLFloaterIMPanel(const std::string& session_label, // enable line history support for instant message bar mInputEditor->setEnableLineHistory(TRUE); - if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) - { - LLLogChat::loadHistory(mSessionLabel, - &chatFromLogFile, - (void *)this); - } - //*TODO we probably need the same "awaiting message" thing in LLIMFloater LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(mSessionUUID); if (!im_session) @@ -1801,110 +970,8 @@ void LLFloaterIMPanel::removeTypingIndicator(const LLIMInfo* im_info) } } -//static -void LLFloaterIMPanel::chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata) -{ - LLFloaterIMPanel* self = (LLFloaterIMPanel*)userdata; - std::string message = line; - S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); - switch (type) - { - case LLLogChat::LOG_EMPTY: - // add warning log enabled message - if (im_log_option!=LOG_CHAT) - { - message = LLTrans::getString("IM_logging_string"); - } - break; - case LLLogChat::LOG_END: - // add log end message - if (im_log_option!=LOG_CHAT) - { - message = LLTrans::getString("IM_logging_string"); - } - break; - case LLLogChat::LOG_LINE: - // just add normal lines from file - break; - default: - // nothing - break; - } - - //self->addHistoryLine(line, LLColor4::grey, FALSE); - self->mHistoryEditor->appendText(message, true, LLStyle::Params().color(LLUIColorTable::instance().getColor("ChatHistoryTextColor"))); - self->mHistoryEditor->blockUndo(); -} - -void LLFloaterIMPanel::showSessionStartError( - const std::string& error_string) -{ - LLSD args; - args["REASON"] = LLTrans::getString(error_string); - args["RECIPIENT"] = getTitle(); - - LLSD payload; - payload["session_id"] = mSessionUUID; - - LLNotifications::instance().add( - "ChatterBoxSessionStartError", - args, - payload, - onConfirmForceCloseError); -} - -void LLFloaterIMPanel::showSessionEventError( - const std::string& event_string, - const std::string& error_string) -{ - LLSD args; - args["REASON"] = - LLTrans::getString(error_string); - args["EVENT"] = - LLTrans::getString(event_string); - args["RECIPIENT"] = getTitle(); - - LLNotifications::instance().add( - "ChatterBoxSessionEventError", - args); -} - -void LLFloaterIMPanel::showSessionForceClose( - const std::string& reason_string) -{ - LLSD args; - - args["NAME"] = getTitle(); - args["REASON"] = LLTrans::getString(reason_string); - - LLSD payload; - payload["session_id"] = mSessionUUID; - - LLNotifications::instance().add( - "ForceCloseChatterBoxSession", - args, - payload, - LLFloaterIMPanel::onConfirmForceCloseError); - -} - //static void LLFloaterIMPanel::onKickSpeaker(void* user_data) { } - -bool LLFloaterIMPanel::onConfirmForceCloseError(const LLSD& notification, const LLSD& response) -{ - //only 1 option really - LLUUID session_id = notification["payload"]["session_id"]; - - if ( gIMMgr ) - { - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession( - session_id); - - if ( floaterp ) floaterp->closeFloater(FALSE); - } - return false; -} diff --git a/indra/newview/llimpanel.h b/indra/newview/llimpanel.h index 4e306c7fab..b8f99d45c9 100644 --- a/indra/newview/llimpanel.h +++ b/indra/newview/llimpanel.h @@ -50,133 +50,6 @@ class LLIMSpeakerMgr; class LLPanelActiveSpeakers; class LLPanelChatControlPanel; -class LLVoiceChannel : public LLVoiceClientStatusObserver -{ -public: - typedef enum e_voice_channel_state - { - STATE_NO_CHANNEL_INFO, - STATE_ERROR, - STATE_HUNG_UP, - STATE_READY, - STATE_CALL_STARTED, - STATE_RINGING, - STATE_CONNECTED - } EState; - - LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); - virtual ~LLVoiceChannel(); - - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - - virtual void handleStatusChange(EStatusType status); - virtual void handleError(EStatusType status); - virtual void deactivate(); - virtual void activate(); - virtual void setChannelInfo( - const std::string& uri, - const std::string& credentials); - virtual void getChannelInfo(); - virtual BOOL isActive(); - virtual BOOL callStarted(); - const std::string& getSessionName() const { return mSessionName; } - - const LLUUID getSessionID() { return mSessionID; } - EState getState() { return mState; } - - void updateSessionID(const LLUUID& new_session_id); - const LLSD& getNotifyArgs() { return mNotifyArgs; } - - static LLVoiceChannel* getChannelByID(const LLUUID& session_id); - static LLVoiceChannel* getChannelByURI(std::string uri); - static LLVoiceChannel* getCurrentVoiceChannel() { return sCurrentVoiceChannel; } - static void initClass(); - - static void suspend(); - static void resume(); - -protected: - virtual void setState(EState state); - void toggleCallWindowIfNeeded(EState state); - void setURI(std::string uri); - - std::string mURI; - std::string mCredentials; - LLUUID mSessionID; - EState mState; - std::string mSessionName; - LLSD mNotifyArgs; - BOOL mIgnoreNextSessionLeave; - LLHandle<LLPanel> mLoginNotificationHandle; - - typedef std::map<LLUUID, LLVoiceChannel*> voice_channel_map_t; - static voice_channel_map_t sVoiceChannelMap; - - typedef std::map<std::string, LLVoiceChannel*> voice_channel_map_uri_t; - static voice_channel_map_uri_t sVoiceChannelURIMap; - - static LLVoiceChannel* sCurrentVoiceChannel; - static LLVoiceChannel* sSuspendedVoiceChannel; - static BOOL sSuspended; -}; - -class LLVoiceChannelGroup : public LLVoiceChannel -{ -public: - LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name); - - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ void activate(); - /*virtual*/ void deactivate(); - /*vritual*/ void setChannelInfo( - const std::string& uri, - const std::string& credentials); - /*virtual*/ void getChannelInfo(); - -protected: - virtual void setState(EState state); - -private: - U32 mRetries; - BOOL mIsRetrying; -}; - -class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoiceChannelProximal> -{ -public: - LLVoiceChannelProximal(); - - /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ BOOL isActive(); - /*virtual*/ void activate(); - /*virtual*/ void deactivate(); - -}; - -class LLVoiceChannelP2P : public LLVoiceChannelGroup -{ -public: - LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id); - - /*virtual*/ void handleStatusChange(EStatusType status); - /*virtual*/ void handleError(EStatusType status); - /*virtual*/ void activate(); - /*virtual*/ void getChannelInfo(); - - void setSessionHandle(const std::string& handle, const std::string &inURI); - -protected: - virtual void setState(EState state); - -private: - std::string mSessionHandle; - LLUUID mOtherUserID; - BOOL mReceivedCall; -}; - class LLFloaterIMPanel : public LLFloater { public: @@ -254,16 +127,6 @@ public: // Handle other participant in the session typing. void processIMTyping(const LLIMInfo* im_info, BOOL typing); - static void chatFromLogFile(LLLogChat::ELogLineType type, std::string line, void* userdata); - - //show error statuses to the user - void showSessionStartError(const std::string& error_string); - void showSessionEventError( - const std::string& event_string, - const std::string& error_string); - void showSessionForceClose(const std::string& reason); - - static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); private: // Called by UI methods. diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index b631c991ae..66a3e3e85c 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -70,6 +70,7 @@ #include "llviewerwindow.h" #include "llnotify.h" #include "llviewerregion.h" +#include "llvoicechannel.h" #include "lltrans.h" #include "llrecentpeople.h" @@ -88,9 +89,6 @@ LLIMMgr* gIMMgr = NULL; const static std::string IM_SEPARATOR(": "); -std::map<LLUUID, LLIMModel::LLIMSession*> LLIMModel::sSessionsMap; - - void toast_callback(const LLSD& msg){ // do not show toast in busy mode or it goes from agent @@ -104,7 +102,13 @@ void toast_callback(const LLSD& msg){ { return; } - + + // Skip toasting for system messages + if (msg["from_id"].asUUID() == LLUUID::null) + { + return; + } + LLSD args; args["MESSAGE"] = msg["message"]; args["TIME"] = msg["time"]; @@ -134,7 +138,6 @@ LLIMModel::LLIMModel() addNewMsgCallback(toast_callback); } - LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const std::vector<LLUUID>& ids) : mSessionID(session_id), mName(name), @@ -144,7 +147,10 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& mInitialTargetIDs(ids), mVoiceChannel(NULL), mSpeakers(NULL), - mSessionInitialized(false) + mSessionInitialized(false), + mCallBackEnabled(true), + mTextIMPossible(true), + mOtherParticipantIsAvatar(true) { if (IM_NOTHING_SPECIAL == type || IM_SESSION_P2P_INVITE == type) { @@ -168,6 +174,16 @@ LLIMModel::LLIMSession::LLIMSession(const LLUUID& session_id, const std::string& //so we're already initialized mSessionInitialized = true; } + + if (IM_NOTHING_SPECIAL == type) + { + mCallBackEnabled = LLVoiceClient::getInstance()->isSessionCallBackPossible(mSessionID); + mTextIMPossible = LLVoiceClient::getInstance()->isSessionTextIMPossible(mSessionID); + mOtherParticipantIsAvatar = LLVoiceClient::getInstance()->isParticipantAvatar(mSessionID); + } + + if ( gSavedPerAccountSettings.getBOOL("LogShowHistory") ) + LLLogChat::loadHistory(mName, &chatFromLogFile, (void *)this); } LLIMModel::LLIMSession::~LLIMSession() @@ -209,14 +225,47 @@ void LLIMModel::LLIMSession::sessionInitReplyReceived(const LLUUID& new_session_ } } +void LLIMModel::LLIMSession::addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time) +{ + LLSD message; + message["from"] = from; + message["from_id"] = from_id; + message["message"] = utf8_text; + message["time"] = time; + message["index"] = (LLSD::Integer)mMsgs.size(); + + mMsgs.push_front(message); + + if (mSpeakers && from_id.notNull()) + { + mSpeakers->speakerChatted(from_id); + mSpeakers->setSpeakerTyping(from_id, FALSE); + } +} + +void LLIMModel::LLIMSession::chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata) +{ + if (!userdata) return; + + LLIMSession* self = (LLIMSession*) userdata; + + if (type == LLLogChat::LOG_LINE) + { + self->addMessage("", LLSD(), msg["message"].asString(), ""); + } + else if (type == LLLogChat::LOG_LLSD) + { + self->addMessage(msg["from"].asString(), msg["from_id"].asUUID(), msg["message"].asString(), msg["time"].asString()); + } +} + LLIMModel::LLIMSession* LLIMModel::findIMSession(const LLUUID& session_id) const { - return get_if_there(LLIMModel::instance().sSessionsMap, session_id, + return get_if_there(mId2SessionMap, session_id, (LLIMModel::LLIMSession*) NULL); } -//*TODO change name to represent session initialization aspect (IB) -void LLIMModel::updateSessionID(const LLUUID& old_session_id, const LLUUID& new_session_id) +void LLIMModel::processSessionInitializedReply(const LLUUID& old_session_id, const LLUUID& new_session_id) { LLIMSession* session = findIMSession(old_session_id); if (session) @@ -225,8 +274,8 @@ void LLIMModel::updateSessionID(const LLUUID& old_session_id, const LLUUID& new_ if (old_session_id != new_session_id) { - sSessionsMap.erase(old_session_id); - sSessionsMap[new_session_id] = session; + mId2SessionMap.erase(old_session_id); + mId2SessionMap[new_session_id] = session; gIMMgr->notifyObserverSessionIDUpdated(old_session_id, new_session_id); } @@ -272,16 +321,17 @@ void LLIMModel::testMessages() } -bool LLIMModel::newSession(LLUUID session_id, std::string name, EInstantMessage type, LLUUID other_participant_id, const std::vector<LLUUID>& ids) +bool LLIMModel::newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, + const LLUUID& other_participant_id, const std::vector<LLUUID>& ids) { - if (is_in_map(sSessionsMap, session_id)) + if (findIMSession(session_id)) { llwarns << "IM Session " << session_id << " already exists" << llendl; return false; } LLIMSession* session = new LLIMSession(session_id, name, type, other_participant_id, ids); - sSessionsMap[session_id] = session; + mId2SessionMap[session_id] = session; LLIMMgr::getInstance()->notifyObserverSessionAdded(session_id, name, other_participant_id); @@ -289,24 +339,21 @@ bool LLIMModel::newSession(LLUUID session_id, std::string name, EInstantMessage } -bool LLIMModel::clearSession(LLUUID session_id) +bool LLIMModel::clearSession(const LLUUID& session_id) { - if (sSessionsMap.find(session_id) == sSessionsMap.end()) return false; - delete (sSessionsMap[session_id]); - sSessionsMap.erase(session_id); + if (mId2SessionMap.find(session_id) == mId2SessionMap.end()) return false; + delete (mId2SessionMap[session_id]); + mId2SessionMap.erase(session_id); return true; } -//*TODO remake it, instead of returing the list pass it as as parameter (IB) -std::list<LLSD> LLIMModel::getMessages(LLUUID session_id, int start_index) +void LLIMModel::getMessages(const LLUUID& session_id, std::list<LLSD>& messages, int start_index) { - std::list<LLSD> return_list; - LLIMSession* session = findIMSession(session_id); if (!session) { llwarns << "session " << session_id << "does not exist " << llendl; - return return_list; + return; } int i = session->mMsgs.size() - start_index; @@ -317,7 +364,7 @@ std::list<LLSD> LLIMModel::getMessages(LLUUID session_id, int start_index) { LLSD msg; msg = *iter; - return_list.push_back(*iter); + messages.push_back(*iter); i--; } @@ -327,14 +374,9 @@ std::list<LLSD> LLIMModel::getMessages(LLUUID session_id, int start_index) arg["session_id"] = session_id; arg["num_unread"] = 0; mNoUnreadMsgsSignal(arg); - - // TODO: in the future is there a more efficient way to return these - //of course there is - return as parameter (IB) - return return_list; - } -bool LLIMModel::addToHistory(LLUUID session_id, std::string from, LLUUID from_id, std::string utf8_text) { +bool LLIMModel::addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { LLIMSession* session = findIMSession(session_id); @@ -344,47 +386,49 @@ bool LLIMModel::addToHistory(LLUUID session_id, std::string from, LLUUID from_id return false; } - LLSD message; - message["from"] = from; - message["from_id"] = from_id; - message["message"] = utf8_text; - message["time"] = LLLogChat::timestamp(false); //might want to add date separately - message["index"] = (LLSD::Integer)session->mMsgs.size(); - - session->mMsgs.push_front(message); + session->addMessage(from, from_id, utf8_text, LLLogChat::timestamp(false)); //might want to add date separately return true; - } -//*TODO rewrite chat history persistence using LLSD serialization (IB) -bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, const std::string& utf8_text) +bool LLIMModel::logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text) { S32 im_log_option = gSavedPerAccountSettings.getS32("IMLogOptions"); if (im_log_option != LOG_CHAT) { - std::string histstr; - if (gSavedPerAccountSettings.getBOOL("LogTimestamp")) - histstr = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")) + from + IM_SEPARATOR + utf8_text; - else - histstr = from + IM_SEPARATOR + utf8_text; - if(im_log_option == LOG_BOTH_TOGETHER) { - LLLogChat::saveHistory(std::string("chat"), histstr); + LLLogChat::saveHistory(std::string("chat"), from, from_id, utf8_text); return true; } else { - LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), histstr); + LLLogChat::saveHistory(LLIMModel::getInstance()->getName(session_id), from, from_id, utf8_text); return true; } } return false; } -//*TODO add const qualifier and pass by references (IB) -bool LLIMModel::addMessage(LLUUID session_id, std::string from, LLUUID from_id, std::string utf8_text, bool log2file /* = true */) { +bool LLIMModel::proccessOnlineOfflineNotification( + const LLUUID& session_id, + const std::string& utf8_text) +{ + // Add message to old one floater + LLFloaterIMPanel *floater = gIMMgr->findFloaterBySession(session_id); + if ( floater ) + { + if ( !utf8_text.empty() ) + { + floater->addHistoryLine(utf8_text, LLUIColorTable::instance().getColor("SystemChatColor")); + } + } + // Add system message to history + return addMessage(session_id, SYSTEM_FROM, LLUUID::null, utf8_text); +} + +bool LLIMModel::addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, + const std::string& utf8_text, bool log2file /* = true */) { LLIMSession* session = findIMSession(session_id); if (!session) @@ -394,7 +438,7 @@ bool LLIMModel::addMessage(LLUUID session_id, std::string from, LLUUID from_id, } addToHistory(session_id, from, from_id, utf8_text); - if (log2file) logToFile(session_id, from, utf8_text); + if (log2file) logToFile(session_id, from, from_id, utf8_text); session->mNumUnread++; @@ -506,7 +550,7 @@ void LLIMModel::sendTypingState(LLUUID session_id, LLUUID other_participant_id, gAgent.sendReliableMessage(); } -void LLIMModel::sendLeaveSession(LLUUID session_id, LLUUID other_participant_id) +void LLIMModel::sendLeaveSession(const LLUUID& session_id, const LLUUID& other_participant_id) { if(session_id.notNull()) { @@ -527,8 +571,7 @@ void LLIMModel::sendLeaveSession(LLUUID session_id, LLUUID other_participant_id) } } - -//*TODO update list of messages in a LLIMSession (IB) +//*TODO this method is better be moved to the LLIMMgr void LLIMModel::sendMessage(const std::string& utf8_text, const LLUUID& im_session_id, const LLUUID& other_participant_id, @@ -890,20 +933,11 @@ public: { gIMMgr->clearPendingAgentListUpdates(mSessionID); gIMMgr->clearPendingInvitation(mSessionID); - - LLFloaterIMPanel* floaterp = - gIMMgr->findFloaterBySession(mSessionID); - - if ( floaterp ) + if ( 404 == statusNum ) { - if ( 404 == statusNum ) - { - std::string error_string; - error_string = "does not exist"; - - floaterp->showSessionStartError( - error_string); - } + std::string error_string; + error_string = "does not exist"; + gIMMgr->showSessionStartError(error_string, mSessionID); } } } @@ -955,6 +989,106 @@ LLUUID LLIMMgr::computeSessionID( return session_id; } +inline LLFloater* getFloaterBySessionID(const LLUUID session_id) +{ + LLFloater* floater = NULL; + if ( gIMMgr ) + { + floater = dynamic_cast < LLFloater* > + ( gIMMgr->findFloaterBySession(session_id) ); + } + if ( !floater ) + { + floater = dynamic_cast < LLFloater* > + ( LLIMFloater::findInstance(session_id) ); + } + return floater; +} + +void +LLIMMgr::showSessionStartError( + const std::string& error_string, + const LLUUID session_id) +{ + const LLFloater* floater = getFloaterBySessionID (session_id); + if (!floater) return; + + LLSD args; + args["REASON"] = LLTrans::getString(error_string); + args["RECIPIENT"] = floater->getTitle(); + + LLSD payload; + payload["session_id"] = session_id; + + LLNotifications::instance().add( + "ChatterBoxSessionStartError", + args, + payload, + LLIMMgr::onConfirmForceCloseError); +} + +void +LLIMMgr::showSessionEventError( + const std::string& event_string, + const std::string& error_string, + const LLUUID session_id) +{ + const LLFloater* floater = getFloaterBySessionID (session_id); + if (!floater) return; + + LLSD args; + args["REASON"] = + LLTrans::getString(error_string); + args["EVENT"] = + LLTrans::getString(event_string); + args["RECIPIENT"] = floater->getTitle(); + + LLNotifications::instance().add( + "ChatterBoxSessionEventError", + args); +} + +void +LLIMMgr::showSessionForceClose( + const std::string& reason_string, + const LLUUID session_id) +{ + const LLFloater* floater = getFloaterBySessionID (session_id); + if (!floater) return; + + LLSD args; + + args["NAME"] = floater->getTitle(); + args["REASON"] = LLTrans::getString(reason_string); + + LLSD payload; + payload["session_id"] = session_id; + + LLNotifications::instance().add( + "ForceCloseChatterBoxSession", + args, + payload, + LLIMMgr::onConfirmForceCloseError); +} + +//static +bool +LLIMMgr::onConfirmForceCloseError( + const LLSD& notification, + const LLSD& response) +{ + //only 1 option really + LLUUID session_id = notification["payload"]["session_id"]; + + LLFloater* floater = getFloaterBySessionID (session_id); + if ( floater ) + { + floater->closeFloater(FALSE); + } + return false; +} + + //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLIncomingCallDialog //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -1114,29 +1248,6 @@ void LLIncomingCallDialog::processCallResponse(S32 response) } } -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -// Class LLIMViewFriendObserver -// -// Bridge to suport knowing when the inventory has changed. -//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -class LLIMViewFriendObserver : public LLFriendObserver -{ -public: - LLIMViewFriendObserver(LLIMMgr* tv) : mTV(tv) {} - virtual ~LLIMViewFriendObserver() {} - virtual void changed(U32 mask) - { - if(mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE)) - { - mTV->refresh(); - } - } -protected: - LLIMMgr* mTV; -}; - - bool inviteUserResponse(const LLSD& notification, const LLSD& response) { const LLSD& payload = notification["payload"]; @@ -1237,7 +1348,6 @@ bool inviteUserResponse(const LLSD& notification, const LLSD& response) // LLIMMgr::LLIMMgr() : - mFriendObserver(NULL), mIMReceived(FALSE) { static bool registered_dialog = false; @@ -1246,21 +1356,11 @@ LLIMMgr::LLIMMgr() : LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); registered_dialog = true; } - - mFriendObserver = new LLIMViewFriendObserver(this); - LLAvatarTracker::instance().addObserver(mFriendObserver); mPendingInvitations = LLSD::emptyMap(); mPendingAgentListUpdates = LLSD::emptyMap(); } -LLIMMgr::~LLIMMgr() -{ - LLAvatarTracker::instance().removeObserver(mFriendObserver); - delete mFriendObserver; - // Children all cleaned up by default view destructor. -} - // Add a message to a session. void LLIMMgr::addMessage( const LLUUID& session_id, @@ -1299,9 +1399,10 @@ void LLIMMgr::addMessage( fixed_session_name = session_name; } - if (!LLIMModel::getInstance()->findIMSession(new_session_id)) + bool new_session = !hasSession(new_session_id); + if (new_session) { - LLIMModel::getInstance()->newSession(session_id, fixed_session_name, dialog, other_participant_id); + LLIMModel::getInstance()->newSession(new_session_id, fixed_session_name, dialog, other_participant_id); } floater = findFloaterBySession(new_session_id); @@ -1318,15 +1419,16 @@ void LLIMMgr::addMessage( // create IM window as necessary if(!floater) { - - floater = createFloater( new_session_id, other_participant_id, fixed_session_name, dialog, FALSE); + } + if (new_session) + { // When we get a new IM, and if you are a god, display a bit // of information about the source. This is to help liaisons // when answering questions. @@ -1336,7 +1438,7 @@ void LLIMMgr::addMessage( std::ostringstream bonus_info; bonus_info << LLTrans::getString("***")+ " "+ LLTrans::getString("IMParentEstate") + ":" + " " << parent_estate_id - << ((parent_estate_id == 1) ? "," + LLTrans::getString("IMMainland") : "") + << ((parent_estate_id == 1) ? "," + LLTrans::getString("IMMainland") : "") << ((parent_estate_id == 5) ? "," + LLTrans::getString ("IMTeen") : ""); // once we have web-services (or something) which returns @@ -1364,14 +1466,6 @@ void LLIMMgr::addMessage( else { floater->addHistoryLine(msg, color, true, other_participant_id, from); // Insert linked name to front of message - - //*TODO consider moving that speaker management stuff into model (IB) - LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(new_session_id); - if (speaker_mgr) - { - speaker_mgr->speakerChatted(gAgentID); - speaker_mgr->setSpeakerTyping(gAgentID, FALSE); - } } LLIMModel::instance().addMessage(new_session_id, from, other_participant_id, msg); @@ -1437,12 +1531,9 @@ S32 LLIMMgr::getNumberOfUnreadIM() std::map<LLUUID, LLIMModel::LLIMSession*>::iterator it; S32 num = 0; - for(it = LLIMModel::sSessionsMap.begin(); it != LLIMModel::sSessionsMap.end(); ++it) + for(it = LLIMModel::getInstance()->mId2SessionMap.begin(); it != LLIMModel::getInstance()->mId2SessionMap.end(); ++it) { - if((*it).first != mBeingRemovedSessionID) - { - num += (*it).second->mNumUnread; - } + num += (*it).second->mNumUnread; } return num; @@ -1458,15 +1549,6 @@ BOOL LLIMMgr::getIMReceived() const return mIMReceived; } -// This method returns TRUE if the local viewer has a session -// currently open keyed to the uuid. -BOOL LLIMMgr::isIMSessionOpen(const LLUUID& uuid) -{ - LLFloaterIMPanel* floater = findFloaterBySession(uuid); - if(floater) return TRUE; - return FALSE; -} - LLUUID LLIMMgr::addP2PSession(const std::string& name, const LLUUID& other_participant_id, const std::string& voice_session_handle, @@ -1515,7 +1597,9 @@ LLUUID LLIMMgr::addSession( LLUUID session_id = computeSessionID(dialog,other_participant_id); - if (!LLIMModel::getInstance()->findIMSession(session_id)) + bool new_session = !LLIMModel::getInstance()->findIMSession(session_id); + + if (new_session) { LLIMModel::getInstance()->newSession(session_id, name, dialog, other_participant_id, ids); } @@ -1537,6 +1621,9 @@ LLUUID LLIMMgr::addSession( ids); } + //we don't need to show notes about online/offline, mute/unmute users' statuses for existing sessions + if (!new_session) return session_id; + noteOfflineUsers(session_id, floater, ids); // Only warn for regular IMs - not group IMs @@ -1545,8 +1632,6 @@ LLUUID LLIMMgr::addSession( noteMutedUsers(session_id, floater, ids); } - - return session_id; } @@ -1560,41 +1645,25 @@ bool LLIMMgr::leaveSession(const LLUUID& session_id) return true; } -// This removes the panel referenced by the uuid, and then restores -// internal consistency. The internal pointer is not deleted? Did you mean -// a pointer to the corresponding LLIMSession? Session data is cleared now. -// Put a copy of UUID to avoid problem when passed reference becames invalid -// if it has been come from the object removed in observer. -void LLIMMgr::removeSession(LLUUID session_id) +// Removes data associated with a particular session specified by session_id +void LLIMMgr::removeSession(const LLUUID& session_id) { - if (mBeingRemovedSessionID == session_id) - { - return; - } + llassert_always(hasSession(session_id)); + //*TODO remove this floater thing when Communicate Floater is being deleted (IB) LLFloaterIMPanel* floater = findFloaterBySession(session_id); if(floater) { mFloaters.erase(floater->getHandle()); LLFloaterChatterBox::getInstance()->removeFloater(floater); - //mTabContainer->removeTabPanel(floater); - - clearPendingInvitation(session_id); - clearPendingAgentListUpdates(session_id); } - // for some purposes storing ID of a sessios that is being removed - mBeingRemovedSessionID = session_id; - notifyObserverSessionRemoved(session_id); + clearPendingInvitation(session_id); + clearPendingAgentListUpdates(session_id); - //if we don't clear session data on removing the session - //we can't use LLBottomTray as observer of session creation/delettion and - //creating chiclets only on session created even, we need to handle chiclets creation - //the same way as LLFloaterIMPanels were managed. LLIMModel::getInstance()->clearSession(session_id); - // now this session is completely removed - mBeingRemovedSessionID.setNull(); + notifyObserverSessionRemoved(session_id); } void LLIMMgr::inviteToSession( @@ -1723,10 +1792,6 @@ void LLIMMgr::onInviteNameLookup(LLSD payload, const LLUUID& id, const std::stri } } -void LLIMMgr::refresh() -{ -} - void LLIMMgr::disconnectAllSessions() { LLFloaterIMPanel* floater = NULL; @@ -1966,7 +2031,7 @@ void LLIMMgr::noteOfflineUsers( { const LLRelationship* info = NULL; LLAvatarTracker& at = LLAvatarTracker::instance(); - LLIMModel* im_model = LLIMModel::getInstance(); + LLIMModel& im_model = LLIMModel::instance(); for(S32 i = 0; i < count; ++i) { info = at.getBuddyInfo(ids.get(i)); @@ -1977,13 +2042,7 @@ void LLIMMgr::noteOfflineUsers( LLUIString offline = LLTrans::getString("offline_message"); offline.setArg("[FIRST]", first); offline.setArg("[LAST]", last); - - if (floater) - { - floater->addHistoryLine(offline, LLUIColorTable::instance().getColor("SystemChatColor")); - } - - im_model->addMessage(session_id, SYSTEM_FROM, LLUUID::null, offline); + im_model.proccessOnlineOfflineNotification(session_id, offline); } } } @@ -2038,6 +2097,12 @@ void LLIMMgr::processIMTypingCore(const LLIMInfo* im_info, BOOL typing) { floater->processIMTyping(im_info, typing); } + + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + im_floater->processIMTyping(im_info, typing); + } } class LLViewerChatterBoxSessionStartReply : public LLHTTPNode @@ -2069,7 +2134,7 @@ public: { session_id = body["session_id"].asUUID(); - LLIMModel::getInstance()->updateSessionID(temp_session_id, session_id); + LLIMModel::getInstance()->processSessionInitializedReply(temp_session_id, session_id); LLIMSpeakerMgr* speaker_mgr = LLIMModel::getInstance()->getSpeakerManager(session_id); if (speaker_mgr) @@ -2087,19 +2152,21 @@ public: } } + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + if ( body.has("session_info") ) + { + im_floater->processSessionUpdate(body["session_info"]); + } + } + gIMMgr->clearPendingAgentListUpdates(session_id); } else { - //throw an error dialog and close the temp session's - //floater - LLFloaterIMPanel* floater = - gIMMgr->findFloaterBySession(temp_session_id); - - if ( floater ) - { - floater->showSessionStartError(body["error"].asString()); - } + //throw an error dialog and close the temp session's floater + gIMMgr->showSessionStartError(body["error"].asString(), temp_session_id); } gIMMgr->clearPendingAgentListUpdates(session_id); @@ -2132,15 +2199,10 @@ public: if ( !success ) { //throw an error dialog - LLFloaterIMPanel* floater = - gIMMgr->findFloaterBySession(session_id); - - if (floater) - { - floater->showSessionEventError( - body["event"].asString(), - body["error"].asString()); - } + gIMMgr->showSessionEventError( + body["event"].asString(), + body["error"].asString(), + session_id); } } }; @@ -2158,13 +2220,7 @@ public: session_id = input["body"]["session_id"].asUUID(); reason = input["body"]["reason"].asString(); - LLFloaterIMPanel* floater = - gIMMgr ->findFloaterBySession(session_id); - - if ( floater ) - { - floater->showSessionForceClose(reason); - } + gIMMgr->showSessionForceClose(reason, session_id); } }; @@ -2202,11 +2258,17 @@ public: const LLSD& context, const LLSD& input) const { - LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(input["body"]["session_id"].asUUID()); + LLUUID session_id = input["body"]["session_id"].asUUID(); + LLFloaterIMPanel* floaterp = gIMMgr->findFloaterBySession(session_id); if (floaterp) { floaterp->processSessionUpdate(input["body"]["info"]); } + LLIMFloater* im_floater = LLIMFloater::findInstance(session_id); + if ( im_floater ) + { + im_floater->processSessionUpdate(input["body"]["info"]); + } } }; diff --git a/indra/newview/llimview.h b/indra/newview/llimview.h index 68beb29034..f986d9dcdb 100644 --- a/indra/newview/llimview.h +++ b/indra/newview/llimview.h @@ -34,12 +34,13 @@ #define LL_LLIMVIEW_H #include "lldarray.h" -#include "llfloateractivespeakers.h" //for LLIMSpeakerMgr +#include "llspeakers.h" //for LLIMSpeakerMgr #include "llimpanel.h" //for voice channels #include "llmodaldialog.h" #include "llinstantmessage.h" #include "lluuid.h" #include "llmultifloater.h" +#include "lllogchat.h" class LLFloaterChatterBox; class LLUUID; @@ -57,6 +58,8 @@ public: virtual ~LLIMSession(); void sessionInitReplyReceived(const LLUUID& new_session_id); + void addMessage(const std::string& from, const LLUUID& from_id, const std::string& utf8_text, const std::string& time); + static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& msg, void* userdata); LLUUID mSessionID; std::string mName; @@ -70,6 +73,13 @@ public: LLIMSpeakerMgr* mSpeakers; bool mSessionInitialized; + + //true if calling back the session URI after the session has closed is possible. + //Currently this will be false only for PSTN P2P calls. + bool mCallBackEnabled; + + bool mTextIMPossible; + bool mOtherParticipantIsAvatar; }; @@ -82,8 +92,8 @@ public: void resetActiveSessionID() { mActiveSessionID.setNull(); } LLUUID getActiveSessionID() { return mActiveSessionID; } - //*TODO make it non-static as LLIMMOdel is a singleton (IB) - static std::map<LLUUID, LLIMSession*> sSessionsMap; //mapping session_id to session + /** Session id to session object */ + std::map<LLUUID, LLIMSession*> mId2SessionMap; typedef boost::signals2::signal<void(const LLSD&)> session_signal_t; typedef boost::function<void(const LLSD&)> session_callback_t; @@ -99,23 +109,45 @@ public: /** * Rebind session data to a new session id. */ - void updateSessionID(const LLUUID& old_session_id, const LLUUID& new_session_id); + void processSessionInitializedReply(const LLUUID& old_session_id, const LLUUID& new_session_id); boost::signals2::connection addNewMsgCallback( session_callback_t cb ) { return mNewMsgSignal.connect(cb); } boost::signals2::connection addNoUnreadMsgsCallback( session_callback_t cb ) { return mNoUnreadMsgsSignal.connect(cb); } - bool newSession(LLUUID session_id, std::string name, EInstantMessage type, LLUUID other_participant_id, + /** + * Create new session object in a model + */ + bool newSession(const LLUUID& session_id, const std::string& name, const EInstantMessage& type, const LLUUID& other_participant_id, const std::vector<LLUUID>& ids = std::vector<LLUUID>()); - bool clearSession(LLUUID session_id); - std::list<LLSD> getMessages(LLUUID session_id, int start_index = 0); - bool addMessage(LLUUID session_id, std::string from, LLUUID other_participant_id, std::string utf8_text, bool log2file = true); - bool addToHistory(LLUUID session_id, std::string from, LLUUID from_id, std::string utf8_text); + /** + * Remove all session data associated with a session specified by session_id + */ + bool clearSession(const LLUUID& session_id); + + /** + * Populate supplied std::list with messages starting from index specified by start_index + */ + void getMessages(const LLUUID& session_id, std::list<LLSD>& messages, int start_index = 0); + + /** + * Add a message to an IM Model - the message is saved in a message store associated with a session specified by session_id + * and also saved into a file if log2file is specified. + * It sends new message signal for each added message. + */ + bool addMessage(const LLUUID& session_id, const std::string& from, const LLUUID& other_participant_id, const std::string& utf8_text, bool log2file = true); - bool logToFile(const LLUUID& session_id, const std::string& from, const std::string& utf8_text); + /** + * Add a system message to an IM Model + */ + bool proccessOnlineOfflineNotification(const LLUUID& session_id, const std::string& utf8_text); - //used to get the name of the session, for use as the title - //currently just the other avatar name + /** + * Get a session's name. + * For a P2P chat - it's an avatar's name, + * For a group chat - it's a group's name + * For an ad-hoc chat - is received from the server and is in a from of "<Avatar's name> conference" + */ const std::string& getName(const LLUUID& session_id) const; /** @@ -150,7 +182,7 @@ public: */ LLIMSpeakerMgr* getSpeakerManager(const LLUUID& session_id) const; - static void sendLeaveSession(LLUUID session_id, LLUUID other_participant_id); + static void sendLeaveSession(const LLUUID& session_id, const LLUUID& other_participant_id); static bool sendStartSession(const LLUUID& temp_session_id, const LLUUID& other_participant_id, const std::vector<LLUUID>& ids, EInstantMessage dialog); static void sendTypingState(LLUUID session_id, LLUUID other_participant_id, BOOL typing); @@ -158,6 +190,18 @@ public: const LLUUID& other_participant_id, EInstantMessage dialog); void testMessages(); + +private: + + /** + * Add message to a list of message associated with session specified by session_id + */ + bool addToHistory(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); + + /** + * Save an IM message into a file + */ + bool logToFile(const LLUUID& session_id, const std::string& from, const LLUUID& from_id, const std::string& utf8_text); }; class LLIMSessionObserver @@ -183,7 +227,7 @@ public: }; LLIMMgr(); - virtual ~LLIMMgr(); + virtual ~LLIMMgr() {}; // Add a message to a session. The session can keyed to sesion id // or agent id. @@ -200,11 +244,6 @@ public: void addSystemMessage(const LLUUID& session_id, const std::string& message_name, const LLSD& args); - // This method returns TRUE if the local viewer has a session - // currently open keyed to the uuid. The uuid can be keyed by - // either session id or agent id. - BOOL isIMSessionOpen(const LLUUID& uuid); - // This adds a session to the talk view. The name is the local // name of the session, dialog specifies the type of // session. Since sessions can be keyed off of first recipient or @@ -250,9 +289,6 @@ public: void processIMTypingStart(const LLIMInfo* im_info); void processIMTypingStop(const LLIMInfo* im_info); - // Rebuild stuff - void refresh(); - void notifyNewIM(); void clearNewIMNotification(); @@ -268,10 +304,6 @@ public: // good connection. void disconnectAllSessions(); - // This is a helper function to determine what kind of im session - // should be used for the given agent. - static EInstantMessage defaultIMTypeForAgent(const LLUUID& agent_id); - BOOL hasSession(const LLUUID& session_id); // This method returns the im panel corresponding to the uuid @@ -290,11 +322,18 @@ public: void clearPendingAgentListUpdates(const LLUUID& session_id); //HACK: need a better way of enumerating existing session, or listening to session create/destroy events + //@deprecated, is used only by LLToolBox, which is not used anywhere, right? (IB) const std::set<LLHandle<LLFloater> >& getIMFloaterHandles() { return mFloaters; } void addSessionObserver(LLIMSessionObserver *); void removeSessionObserver(LLIMSessionObserver *); + //show error statuses to the user + void showSessionStartError(const std::string& error_string, const LLUUID session_id); + void showSessionEventError(const std::string& event_string, const std::string& error_string, const LLUUID session_id); + void showSessionForceClose(const std::string& reason, const LLUUID session_id); + static bool onConfirmForceCloseError(const LLSD& notification, const LLSD& response); + /** * Start call in a session * @return false if voice channel doesn't exist @@ -308,10 +347,11 @@ public: bool endCall(const LLUUID& session_id); private: - // This removes the panel referenced by the uuid, and then - // restores internal consistency. The internal pointer is not - // deleted. - void removeSession(LLUUID session_id); + + /** + * Remove data associated with a particular session specified by session_id + */ + void removeSession(const LLUUID& session_id); // create a panel and update internal representation for // consistency. Returns the pointer, caller (the class instance @@ -340,8 +380,9 @@ private: void notifyObserverSessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id); private: + + //*TODO should be deleted when Communicate Floater is being deleted std::set<LLHandle<LLFloater> > mFloaters; - LLFriendObserver* mFriendObserver; typedef std::list <LLIMSessionObserver *> session_observers_list_t; session_observers_list_t mSessionObservers; @@ -351,9 +392,6 @@ private: LLSD mPendingInvitations; LLSD mPendingAgentListUpdates; - // ID of a session that is being removed: observers are already told - // that this session is being removed, but it is still present in the sessions' map - LLUUID mBeingRemovedSessionID; }; class LLIncomingCallDialog : public LLModalDialog diff --git a/indra/newview/llinspectobject.cpp b/indra/newview/llinspectobject.cpp index 29cca14a7b..050a61c79b 100644 --- a/indra/newview/llinspectobject.cpp +++ b/indra/newview/llinspectobject.cpp @@ -35,10 +35,12 @@ // Viewer #include "llinspect.h" +#include "llmediaentry.h" #include "llnotifications.h" // *TODO: Eliminate, add LLNotificationsUtil wrapper #include "llselectmgr.h" #include "llslurl.h" #include "llviewermenu.h" // handle_object_touch(), handle_buy() +#include "llviewermedia.h" #include "llviewerobjectlist.h" // to select the requested object // Linden libraries @@ -92,8 +94,10 @@ private: void updateName(LLSelectNode* nodep); void updateDescription(LLSelectNode* nodep); void updatePrice(LLSelectNode* nodep); - void updateCreator(LLSelectNode* nodep); + + void updateMediaCurrentURL(); + void updateSecureBrowsing(); void onClickBuy(); void onClickPay(); @@ -106,13 +110,17 @@ private: private: LLUUID mObjectID; + S32 mObjectFace; + viewer_media_t mMediaImpl; LLSafeHandle<LLObjectSelection> mObjectSelection; }; LLInspectObject::LLInspectObject(const LLSD& sd) : LLInspect( LLSD() ), // single_instance, doesn't really need key - mObjectID(), // set in onOpen() - mObjectSelection() + mObjectID(NULL), // set in onOpen() + mObjectFace(0), + mObjectSelection(NULL), + mMediaImpl(NULL) { // can't make the properties request until the widgets are constructed // as it might return immediately, so do it in postBuild. @@ -139,7 +147,7 @@ BOOL LLInspectObject::postBuild(void) getChild<LLUICtrl>("object_name")->setValue(""); getChild<LLUICtrl>("object_creator")->setValue(""); getChild<LLUICtrl>("object_description")->setValue(""); - + getChild<LLUICtrl>("object_media_url")->setValue(""); // Set buttons invisible until we know what this object can do hideButtons(); @@ -182,7 +190,11 @@ void LLInspectObject::onOpen(const LLSD& data) // Extract appropriate avatar id mObjectID = data["object_id"]; - + + if(data.has("object_face")) + { + mObjectFace = data["object_face"]; + } // Position the inspector relative to the mouse cursor // Similar to how tooltips are positioned // See LLToolTipMgr::createToolTip @@ -213,6 +225,17 @@ void LLInspectObject::onOpen(const LLSD& data) } } functor; mObjectSelection->applyToNodes(&functor); + + // Does this face have media? + const LLTextureEntry* tep = obj->getTE(mObjectFace); + if (!tep) + return; + + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + if(!mep) + return; + + mMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); } } @@ -243,6 +266,30 @@ void LLInspectObject::update() updateDescription(nodep); updateCreator(nodep); updatePrice(nodep); + + LLViewerObject* obj = nodep->getObject(); + if(!obj) + return; + + if ( mObjectFace < 0 + || mObjectFace >= obj->getNumTEs() ) + { + return; + } + + // Does this face have media? + const LLTextureEntry* tep = obj->getTE(mObjectFace); + if (!tep) + return; + + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + if(!mep) + return; + + mMediaImpl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + + updateMediaCurrentURL(); + updateSecureBrowsing(); } void LLInspectObject::hideButtons() @@ -381,6 +428,40 @@ void LLInspectObject::updateDescription(LLSelectNode* nodep) } } +void LLInspectObject::updateMediaCurrentURL() +{ + LLTextBox* textbox = getChild<LLTextBox>("object_media_url"); + std::string media_url = ""; + textbox->setValue(media_url); + textbox->setToolTip(media_url); + + if(mMediaImpl.notNull() && mMediaImpl->hasMedia()) + { + LLStringUtil::format_map_t args; + LLPluginClassMedia* media_plugin = NULL; + media_plugin = mMediaImpl->getMediaPlugin(); + if(media_plugin) + { + if(media_plugin->pluginSupportsMediaTime()) + { + args["[CurrentURL]"] = mMediaImpl->getMediaURL(); + } + else + { + args["[CurrentURL]"] = media_plugin->getLocation(); + } + media_url = LLTrans::getString("CurrentURL", args); + textbox->setText(media_url); + textbox->setToolTip(media_url); + } + } + else + { + textbox->setText(media_url); + textbox->setToolTip(media_url); + } +} + void LLInspectObject::updateCreator(LLSelectNode* nodep) { // final information for display @@ -453,6 +534,40 @@ void LLInspectObject::updatePrice(LLSelectNode* nodep) getChild<LLUICtrl>("price_icon")->setVisible(show_price_icon); } +void LLInspectObject::updateSecureBrowsing() +{ + bool is_secure_browsing = false; + + if(mMediaImpl.notNull() + && mMediaImpl->hasMedia()) + { + LLPluginClassMedia* media_plugin = NULL; + std::string current_url = ""; + media_plugin = mMediaImpl->getMediaPlugin(); + if(media_plugin) + { + if(media_plugin->pluginSupportsMediaTime()) + { + current_url = mMediaImpl->getMediaURL(); + } + else + { + current_url = media_plugin->getLocation(); + } + } + + std::string prefix = std::string("https://"); + std::string test_prefix = current_url.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + if(test_prefix == prefix) + { + is_secure_browsing = true; + } + } + getChild<LLUICtrl>("secure_browsing")->setVisible(is_secure_browsing); +} + + void LLInspectObject::onClickBuy() { handle_buy(); diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 3aa35d98f8..59f70ea1bd 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -1,11 +1,11 @@ -/** +/** * @file llinventorybridge.cpp * @brief Implementation of the Inventory-Folder-View-Bridge classes. * * $LicenseInfo:firstyear=2001&license=viewergpl$ - * + * * Copyright (c) 2001-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 @@ -13,17 +13,17 @@ * ("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. @@ -83,7 +83,7 @@ #include "llvoavatar.h" #include "llwearable.h" #include "llwearablelist.h" -#include "llviewermessage.h" +#include "llviewermessage.h" #include "llviewerregion.h" #include "llvoavatarself.h" #include "lltabcontainer.h" @@ -147,8 +147,8 @@ std::string ICON_NAME[ICON_NAME_COUNT] = "Inv_Undershirt", "Inv_Underpants", "Inv_Skirt", - "inv_item_alpha.tga", - "inv_item_tattoo.tga", + "Inv_Alpha", + "Inv_Tattoo", "Inv_Animation", "Inv_Gesture", @@ -237,7 +237,7 @@ void LLInvFVBridge::renameLinkedItems(const LLUUID &item_id, const std::string& { return; } - + LLInventoryModel::item_array_t item_array = model->collectLinkedItems(item_id); for (LLInventoryModel::item_array_t::iterator iter = item_array.begin(); iter != item_array.end(); @@ -245,7 +245,7 @@ void LLInvFVBridge::renameLinkedItems(const LLUUID &item_id, const std::string& { LLViewerInventoryItem *linked_item = (*iter); if (linked_item->getUUID() == item_id) continue; - + LLPointer<LLViewerInventoryItem> new_item = new LLViewerInventoryItem(linked_item); new_item->rename(new_name); new_item->updateServer(FALSE); @@ -290,7 +290,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc S32 count = batch.count(); S32 i,j; for(i = 0; i < count; ++i) - { + { bridge = (LLInvFVBridge*)(batch.get(i)); if(!bridge || !bridge->isItemRemovable()) continue; item = (LLViewerInventoryItem*)model->getItem(bridge->getUUID()); @@ -303,7 +303,7 @@ void LLInvFVBridge::removeBatch(LLDynamicArray<LLFolderViewEventListener*>& batc } } for(i = 0; i < count; ++i) - { + { bridge = (LLInvFVBridge*)(batch.get(i)); if(!bridge || !bridge->isItemRemovable()) continue; cat = (LLViewerInventoryCategory*)model->getCategory(bridge->getUUID()); @@ -506,7 +506,7 @@ BOOL LLInvFVBridge::isClipboardPasteableAsLink() const return TRUE; } -void hideContextEntries(LLMenuGL& menu, +void hideContextEntries(LLMenuGL& menu, const std::vector<std::string> &entries_to_show, const std::vector<std::string> &disabled_entries) { @@ -523,8 +523,8 @@ void hideContextEntries(LLMenuGL& menu, { hideContextEntries(*branchp->getBranch(), entries_to_show, disabled_entries); } - - + + bool found = false; std::vector<std::string>::const_iterator itor2; for (itor2 = entries_to_show.begin(); itor2 != entries_to_show.end(); ++itor2) @@ -552,8 +552,8 @@ void hideContextEntries(LLMenuGL& menu, } // Helper for commonly-used entries -void LLInvFVBridge::getClipboardEntries(bool show_asset_id, - std::vector<std::string> &items, +void LLInvFVBridge::getClipboardEntries(bool show_asset_id, + std::vector<std::string> &items, std::vector<std::string> &disabled_items, U32 flags) { items.push_back(std::string("Rename")); @@ -565,7 +565,7 @@ void LLInvFVBridge::getClipboardEntries(bool show_asset_id, if (show_asset_id) { items.push_back(std::string("Copy Asset UUID")); - if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) + if ( (! ( isItemPermissive() || gAgent.isGodlike() ) ) || (flags & FIRST_SELECTED_ITEM) == 0) { disabled_items.push_back(std::string("Copy Asset UUID")); @@ -638,7 +638,7 @@ BOOL LLInvFVBridge::startDrag(EDragAndDropType* type, LLUUID* id) const { return FALSE; } - + *id = obj->getUUID(); //object_ids.put(obj->getUUID()); @@ -808,7 +808,7 @@ LLInvFVBridge* LLInvFVBridge::createBridge(LLAssetType::EType asset_type, } new_listener = new LLLandmarkBridge(inventory, uuid, flags); break; - + case LLAssetType::AT_CALLINGCARD: if(!(inv_type == LLInventoryType::IT_CALLINGCARD)) { @@ -1100,7 +1100,7 @@ PermissionMask LLItemBridge::getPermissionMask() const { LLViewerInventoryItem* item = getItem(); PermissionMask perm_mask = 0; - if(item) + if(item) { BOOL copy = item->getPermissions().allowCopyBy(gAgent.getID()); BOOL mod = item->getPermissions().allowModifyBy(gAgent.getID()); @@ -1126,9 +1126,9 @@ const std::string& LLItemBridge::getDisplayName() const void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) { - if(item) + if(item) { - name.assign(item->getName()); + name.assign(item->getName()); } else { @@ -1137,9 +1137,9 @@ void LLItemBridge::buildDisplayName(LLInventoryItem* item, std::string& name) } LLFontGL::StyleFlags LLItemBridge::getLabelStyle() const -{ +{ U8 font = LLFontGL::NORMAL; - + if( gAgentWearables.isWearingItem( mUUID ) ) { // llinfos << "BOLD" << llendl; @@ -1165,7 +1165,7 @@ std::string LLItemBridge::getLabelSuffix() const static std::string BROKEN_LINK = LLTrans::getString("broken_link"); std::string suffix; LLInventoryItem* item = getItem(); - if(item) + if(item) { // it's a bit confusing to put nocopy/nomod/etc on calling cards. if(LLAssetType::AT_CALLINGCARD != item->getType() @@ -1294,9 +1294,9 @@ BOOL LLItemBridge::isItemCopyable() const { return FALSE; } - + // All items can be copied, not all can be pasted. - // The only time an item can't be copied is if it's a link + // The only time an item can't be copied is if it's a link // return (item->getPermissions().allowCopyBy(gAgent.getID())); if (item->getIsLinkType()) { @@ -1348,7 +1348,7 @@ BOOL LLItemBridge::isItemPermissive() const LLFolderBridge* LLFolderBridge::sSelf=NULL; // Can be moved to another folder -BOOL LLFolderBridge::isItemMovable() const +BOOL LLFolderBridge::isItemMovable() const { LLInventoryObject* obj = getInventoryObject(); if(obj) @@ -1367,7 +1367,7 @@ void LLFolderBridge::selectItem() BOOL LLFolderBridge::isItemRemovable() { LLInventoryModel* model = getInventoryModel(); - if(!model) + if(!model) { return FALSE; } @@ -1478,7 +1478,7 @@ BOOL LLFolderBridge::isClipboardPasteable() const LLInventoryClipboard::instance().retrieve(objects); const LLViewerInventoryCategory *current_cat = getCategory(); - // Search for the direct descendent of current Friends subfolder among all pasted items, + // Search for the direct descendent of current Friends subfolder among all pasted items, // and return false if is found. for(S32 i = objects.count() - 1; i >= 0; --i) { @@ -1500,7 +1500,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const { return FALSE; } - + const LLInventoryModel* model = getInventoryModel(); if (!model) { @@ -1523,7 +1523,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const { const LLUUID &cat_id = cat->getUUID(); // Don't allow recursive pasting - if ((cat_id == current_cat_id) || + if ((cat_id == current_cat_id) || model->isObjectDescendentOf(current_cat_id, cat_id)) { return FALSE; @@ -1549,7 +1549,7 @@ BOOL LLFolderBridge::isClipboardPasteableAsLink() const BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, BOOL drop) { - // This should never happen, but if an inventory item is incorrectly parented, + // This should never happen, but if an inventory item is incorrectly parented, // the UI will get confused and pass in a NULL. if(!inv_cat) return FALSE; @@ -1611,7 +1611,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, break; } } - + if( is_movable ) { if( move_is_into_trash ) @@ -1642,7 +1642,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } - + accept = is_movable && (mUUID != cat_id) // Can't move a folder into itself && (mUUID != inv_cat->getParentUUID()) // Avoid moves that would change nothing @@ -1663,7 +1663,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } } // if target is an outfit or current outfit folder we use link - if (move_is_into_current_outfit || move_is_into_outfit) + if (move_is_into_current_outfit || move_is_into_outfit) { #if SUPPORT_ENSEMBLES // BAP - should skip if dup. @@ -1686,7 +1686,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, } else { - + // Reparent the folder and restamp children if it's moving // into trash. LLInvFVBridge::changeCategoryParent( @@ -1723,7 +1723,7 @@ void warn_move_inventory(LLViewerObject* object, LLMoveInv* move_inv) // Move/copy all inventory items from the Contents folder of an in-world // object to the agent's inventory, inside a given category. -BOOL move_inv_category_world_to_agent(const LLUUID& object_id, +BOOL move_inv_category_world_to_agent(const LLUUID& object_id, const LLUUID& category_id, BOOL drop, void (*callback)(S32, void*), @@ -1750,7 +1750,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, llinfos << "Object contents not found for drop." << llendl; return FALSE; } - + BOOL accept = TRUE; BOOL is_move = FALSE; @@ -1836,7 +1836,7 @@ bool LLFindCOFValidItems::operator()(LLInventoryCategory* cat, { LLViewerInventoryCategory *linked_category = ((LLViewerInventoryItem*)item)->getLinkedCategory(); // BAP - safe? // BAP remove AT_NONE support after ensembles are fully working? - return (linked_category && + return (linked_category && ((linked_category->getPreferredType() == LLAssetType::AT_NONE) || (LLAssetType::lookupIsEnsembleCategoryType(linked_category->getPreferredType())))); } @@ -1878,7 +1878,7 @@ public: gInventory.removeObserver(this); delete this; } - + protected: LLUUID mCatID; @@ -1973,7 +1973,7 @@ void LLRightClickInventoryFetchDescendentsObserver::done() //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Class LLInventoryWearObserver // -// Observer for "copy and wear" operation to support knowing +// Observer for "copy and wear" operation to support knowing // when the all of the contents have been added to inventory. //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLInventoryCopyAndWearObserver : public LLInventoryObserver @@ -1995,7 +1995,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) { if((mask & (LLInventoryObserver::ADD)) != 0) { - if (!mFolderAdded) + if (!mFolderAdded) { const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); @@ -2003,7 +2003,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) std::set<LLUUID>::const_iterator id_end = changed_items.end(); for (;id_it != id_end; ++id_it) { - if ((*id_it) == mCatID) + if ((*id_it) == mCatID) { mFolderAdded = TRUE; break; @@ -2011,7 +2011,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) } } - if (mFolderAdded) + if (mFolderAdded) { LLViewerInventoryCategory* category = gInventory.getCategory(mCatID); @@ -2029,7 +2029,7 @@ void LLInventoryCopyAndWearObserver::changed(U32 mask) LLAppearanceManager::wearInventoryCategory(category, FALSE, TRUE); delete this; } - } + } } } @@ -2091,12 +2091,12 @@ void LLFolderBridge::performAction(LLFolderView* folder, LLInventoryModel* model if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - + remove_inventory_category_from_avatar ( cat ); return; - } + } else if ("purge" == action) - { + { purgeItem(model, mUUID); return; } @@ -2270,7 +2270,7 @@ void LLFolderBridge::pasteFromClipboard() { if(LLInventoryClipboard::instance().isCutMode()) { - // move_inventory_item() is not enough, + // move_inventory_item() is not enough, //we have to update inventory locally too changeItemParent(model, dynamic_cast<LLViewerInventoryItem*>(item), parent_id, FALSE); } @@ -2347,7 +2347,7 @@ void LLFolderBridge::folderOptionsMenu() // BAP change once we're no longer treating regular categories as ensembles. const bool is_ensemble = category && (type == LLAssetType::AT_NONE || LLAssetType::lookupIsEnsembleCategoryType(type)); - + // calling card related functionality for folders. // Only enable calling-card related options for non-default folders. @@ -2361,7 +2361,7 @@ void LLFolderBridge::folderOptionsMenu() mItems.push_back(std::string("IM All Contacts In Folder")); } } - + // wearables related functionality for folders. //is_wearable LLFindWearables is_wearable; @@ -2416,7 +2416,7 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLUUID lost_and_found_id = model->findCategoryUUIDForType(LLAssetType::AT_LOST_AND_FOUND); mItems.clear(); //adding code to clear out member Items (which means Items should not have other data here at this point) - mDisabledItems.clear(); //adding code to clear out disabled members from previous + mDisabledItems.clear(); //adding code to clear out disabled members from previous if (lost_and_found_id == mUUID) { // This is the lost+found folder. @@ -2458,13 +2458,13 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) mItems.push_back(std::string("New Clothes")); mItems.push_back(std::string("New Body Parts")); mItems.push_back(std::string("Change Type")); - + LLViewerInventoryCategory *cat = getCategory(); if (cat && LLAssetType::lookupIsProtectedCategoryType(cat->getPreferredType())) { mDisabledItems.push_back(std::string("Change Type")); } - + getClipboardEntries(false, mItems, mDisabledItems, flags); } else @@ -2479,24 +2479,24 @@ void LLFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) //Added by spatters to force inventory pull on right-click to display folder options correctly. 07-17-06 mCallingCards = mWearables = FALSE; - + LLIsType is_callingcard(LLAssetType::AT_CALLINGCARD); if (checkFolderForContentsOfType(model, is_callingcard)) { mCallingCards=TRUE; } - + LLFindWearables is_wearable; LLIsType is_object( LLAssetType::AT_OBJECT ); LLIsType is_gesture( LLAssetType::AT_GESTURE ); - + if (checkFolderForContentsOfType(model, is_wearable) || checkFolderForContentsOfType(model, is_object) || checkFolderForContentsOfType(model, is_gesture) ) { mWearables=TRUE; } - + mMenu = &menu; sSelf = this; LLRightClickInventoryFetchDescendentsObserver* fetch = new LLRightClickInventoryFetchDescendentsObserver(FALSE); @@ -2709,7 +2709,7 @@ void LLFolderBridge::modifyOutfit(BOOL append) if(!model) return; LLViewerInventoryCategory* cat = getCategory(); if(!cat) return; - + // BAP - was: // wear_inventory_category_on_avatar( cat, append ); LLAppearanceManager::wearInventoryCategory( cat, FALSE, append ); @@ -2735,8 +2735,8 @@ bool move_task_inventory_callback(const LLSD& notification, const LLSD& response } two_uuids_list_t::iterator move_it; - for (move_it = move_inv->mMoveList.begin(); - move_it != move_inv->mMoveList.end(); + for (move_it = move_inv->mMoveList.begin(); + move_it != move_inv->mMoveList.end(); ++move_it) { object->moveInventory(move_it->first, move_it->second); @@ -2845,7 +2845,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLUUID current_outfit_id = model->findCategoryUUIDForType(LLAssetType::AT_CURRENT_OUTFIT); BOOL move_is_into_current_outfit = (mUUID == current_outfit_id); BOOL move_is_into_outfit = (getCategory() && getCategory()->getPreferredType()==LLAssetType::AT_OUTFIT); - + if(is_movable && move_is_into_trash) { switch(inv_item->getType()) @@ -2873,7 +2873,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, is_movable = ! LLFriendCardsManager::instance() .isObjDirectDescendentOfCategory (inv_item, getCategory()); } - + LLUUID favorites_id = model->findCategoryUUIDForType(LLAssetType::AT_FAVORITE); // we can move item inside a folder only if this folder is Favorites. See EXT-719 @@ -2979,7 +2979,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if((perm.allowCopyBy(gAgent.getID(), gAgent.getGroupID()) && perm.allowTransferTo(gAgent.getID()))) // || gAgent.isGodlike()) - + { accept = TRUE; } @@ -3010,7 +3010,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, LLNotifications::instance().forceResponse(params, 0); } } - + } else if(LLToolDragAndDrop::SOURCE_NOTECARD == source) { @@ -3063,11 +3063,11 @@ LLUIImagePtr LLTextureBridge::getIcon() const { return get_item_icon(LLAssetType::AT_TEXTURE, mInvType, 0, FALSE); } - + void LLTextureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3086,7 +3086,7 @@ LLUIImagePtr LLSoundBridge::getIcon() const void LLSoundBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3155,7 +3155,7 @@ void LLSoundBridge::buildContextMenu(LLMenuGL& menu, U32 flags) // +=================================================+ LLLandmarkBridge::LLLandmarkBridge(LLInventoryPanel* inventory, const LLUUID& uuid, U32 flags/* = 0x00*/) : -LLItemBridge(inventory, uuid) +LLItemBridge(inventory, uuid) { mVisited = FALSE; if (flags & LLInventoryItem::II_FLAGS_LANDMARK_VISITED) @@ -3244,7 +3244,7 @@ void LLLandmarkBridge::performAction(LLFolderView* folder, LLInventoryModel* mod LLSideTray::getInstance()->showPanel("panel_places", key); } } - else + else { LLItemBridge::performAction(folder, model, action); } @@ -3268,7 +3268,7 @@ static LLNotificationFunctorRegistration open_landmark_callback_reg("TeleportFro void LLLandmarkBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3376,7 +3376,7 @@ std::string LLCallingCardBridge::getLabelSuffix() const void LLCallingCardBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3515,7 +3515,7 @@ BOOL LLCallingCardBridge::removeItem() LLAvatarActions::removeFriendDialog(getItem()->getCreatorUUID()); return FALSE; } - else + else { return LLItemBridge::removeItem(); } @@ -3532,7 +3532,7 @@ LLUIImagePtr LLNotecardBridge::getIcon() const void LLNotecardBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3614,7 +3614,7 @@ void LLGestureBridge::performAction(LLFolderView* folder, LLInventoryModel* mode void LLGestureBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3716,7 +3716,7 @@ void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* mo LLPreviewAnim::e_activation_type activate = LLPreviewAnim::NONE; if ("playworld" == action) activate = LLPreviewAnim::PLAY; if ("playlocal" == action) activate = LLPreviewAnim::AUDITION; - + LLPreviewAnim* preview = LLFloaterReg::showTypedInstance<LLPreviewAnim>("preview_anim", LLSD(mUUID)); if (preview) { @@ -3733,7 +3733,7 @@ void LLAnimationBridge::performAction(LLFolderView* folder, LLInventoryModel* mo void LLAnimationBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3841,7 +3841,7 @@ void LLObjectBridge::performAction(LLFolderView* folder, LLInventoryModel* model void LLObjectBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -3853,7 +3853,7 @@ void LLObjectBridge::openItem() } LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const -{ +{ U8 font = LLFontGL::NORMAL; LLVOAvatarSelf* avatar = gAgent.getAvatarObject(); @@ -3867,7 +3867,7 @@ LLFontGL::StyleFlags LLObjectBridge::getLabelStyle() const { font |= LLFontGL::ITALIC; } - + return (LLFontGL::StyleFlags)font; } @@ -3878,7 +3878,7 @@ std::string LLObjectBridge::getLabelSuffix() const { std::string attachment_point_name = avatar->getAttachedPointName(mUUID); LLStringUtil::toLower(attachment_point_name); - + LLStringUtil::format_map_t args; args["[ATTACHMENT_POINT]"] = attachment_point_name.c_str(); return LLItemBridge::getLabelSuffix() + LLTrans::getString("WornOnAttachmentPoint", args); @@ -3925,7 +3925,7 @@ void rez_attachment(LLViewerInventoryItem* item, LLViewerJointAttachment* attach bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& response) { LLVOAvatar *avatarp = gAgent.getAvatarObject(); - + if (!avatarp->canAttachMoreObjects()) { LLSD args; @@ -3938,7 +3938,7 @@ bool confirm_replace_attachment_rez(const LLSD& notification, const LLSD& respon if (option == 0/*YES*/) { LLViewerInventoryItem* itemp = gInventory.getItem(notification["payload"]["item_id"].asUUID()); - + if (itemp) { LLMessageSystem* msg = gMessageSystem; @@ -3999,7 +3999,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) { return; } - + if( avatarp->isWearingAttachment( mUUID ) ) { items.push_back(std::string("Detach From Yourself")); @@ -4023,13 +4023,13 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) LLMenuGL* attach_menu = menu.findChildMenuByName("Attach To", TRUE); LLMenuGL* attach_hud_menu = menu.findChildMenuByName("Attach To HUD", TRUE); LLVOAvatar *avatarp = gAgent.getAvatarObject(); - if (attach_menu - && (attach_menu->getChildCount() == 0) - && attach_hud_menu - && (attach_hud_menu->getChildCount() == 0) + if (attach_menu + && (attach_menu->getChildCount() == 0) + && attach_hud_menu + && (attach_hud_menu->getChildCount() == 0) && avatarp) { - for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); + for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); iter != avatarp->mAttachmentPoints.end(); ) { LLVOAvatar::attachment_map_t::iterator curiter = iter++; @@ -4110,7 +4110,7 @@ LLUIImagePtr LLLSLTextBridge::getIcon() const void LLLSLTextBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -4146,7 +4146,7 @@ void wear_add_inventory_item_on_avatar( LLInventoryItem* item ) { lldebugs << "wear_add_inventory_item_on_avatar( " << item->getName() << " )" << llendl; - + LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), @@ -4160,8 +4160,8 @@ void remove_inventory_category_from_avatar( LLInventoryCategory* category ) if(!category) return; lldebugs << "remove_inventory_category_from_avatar( " << category->getName() << " )" << llendl; - - + + if( gFloaterCustomize ) { gFloaterCustomize->askToSaveIfDirty( @@ -4236,8 +4236,8 @@ void remove_inventory_category_from_avatar_step2( BOOL proceed, LLUUID category_ } } } - - + + if (obj_count > 0) { for(i = 0; i < obj_count; ++i) @@ -4332,7 +4332,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod { LLViewerInventoryItem* item = getItem(); if (item) - { + { LLWearableList::instance().getAsset(item->getAssetUUID(), item->getName(), item->getType(), @@ -4347,7 +4347,7 @@ void LLWearableBridge::performAction(LLFolderView* folder, LLInventoryModel* mod void LLWearableBridge::openItem() { LLViewerInventoryItem* item = getItem(); - + if (item) { LLInvFVBridgeAction::doAction(item->getType(),mUUID,getInventoryModel()); @@ -4431,7 +4431,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) getClipboardEntries(true, items, disabled_items, flags); items.push_back(std::string("Wearable Separator")); - + items.push_back(std::string("Wearable Wear")); items.push_back(std::string("Wearable Add")); items.push_back(std::string("Wearable Edit")); @@ -4462,7 +4462,7 @@ void LLWearableBridge::buildContextMenu(LLMenuGL& menu, U32 flags) disabled_items.push_back(std::string("Wearable Add")); } else - { + { disabled_items.push_back(std::string("Take Off")); } break; @@ -4501,7 +4501,7 @@ void LLWearableBridge::wearOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4532,7 +4532,7 @@ void LLWearableBridge::wearAddOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4620,7 +4620,7 @@ BOOL LLWearableBridge::canEditOnAvatar(void* user_data) return (gAgentWearables.isWearingItem(self->mUUID)); } -// static +// static void LLWearableBridge::onEditOnAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; @@ -4658,7 +4658,7 @@ BOOL LLWearableBridge::canRemoveFromAvatar(void* user_data) return FALSE; } -// static +// static void LLWearableBridge::onRemoveFromAvatar(void* user_data) { LLWearableBridge* self = (LLWearableBridge*)user_data; @@ -4689,7 +4689,7 @@ void LLWearableBridge::onRemoveFromAvatarArrived(LLWearable* wearable, if( gAgentWearables.isWearingItem( item_id ) ) { EWearableType type = wearable->getType(); - + if( !(type==WT_SHAPE || type==WT_SKIN || type==WT_HAIR || type==WT_EYES ) ) //&& //!((!gAgent.isTeen()) && ( type==WT_UNDERPANTS || type==WT_UNDERSHIRT )) ) { @@ -4733,7 +4733,7 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ case LLAssetType::AT_LANDMARK: action = new LLLandmarkBridgeAction(uuid,model); break; - + case LLAssetType::AT_CALLINGCARD: action = new LLCallingCardBridgeAction(uuid,model); break; @@ -4770,7 +4770,7 @@ LLInvFVBridgeAction* LLInvFVBridgeAction::createAction(LLAssetType::EType asset_ return action; } -//static +//static void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, const LLUUID& uuid,LLInventoryModel* model) { @@ -4782,7 +4782,7 @@ void LLInvFVBridgeAction::doAction(LLAssetType::EType asset_type, } } -//static +//static void LLInvFVBridgeAction::doAction(const LLUUID& uuid, LLInventoryModel* model) { LLAssetType::EType asset_type = model->getItem(uuid)->getType(); @@ -4801,8 +4801,8 @@ LLViewerInventoryItem* LLInvFVBridgeAction::getItem() const return NULL; } -//virtual -void LLTextureBridgeAction::doIt() +//virtual +void LLTextureBridgeAction::doIt() { if (getItem()) { @@ -4813,20 +4813,20 @@ void LLTextureBridgeAction::doIt() } //virtual -void LLSoundBridgeAction::doIt() +void LLSoundBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if(item) { LLFloaterReg::showInstance("preview_sound", LLSD(mUUID), TAKE_FOCUS_YES); } - + LLInvFVBridgeAction::doIt(); } -//virtual -void LLLandmarkBridgeAction::doIt() +//virtual +void LLLandmarkBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if( item ) @@ -4842,8 +4842,8 @@ void LLLandmarkBridgeAction::doIt() } -//virtual -void LLCallingCardBridgeAction::doIt() +//virtual +void LLCallingCardBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if(item && item->getCreatorUUID().notNull()) @@ -4854,9 +4854,9 @@ void LLCallingCardBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void -LLNotecardBridgeAction::doIt() +//virtual +void +LLNotecardBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4867,8 +4867,8 @@ LLNotecardBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void LLGestureBridgeAction::doIt() +//virtual +void LLGestureBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4880,8 +4880,8 @@ void LLGestureBridgeAction::doIt() LLInvFVBridgeAction::doIt(); } -//virtual -void LLAnimationBridgeAction::doIt() +//virtual +void LLAnimationBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4893,7 +4893,7 @@ void LLAnimationBridgeAction::doIt() } -//virtual +//virtual void LLObjectBridgeAction::doIt() { LLFloaterReg::showInstance("properties", mUUID); @@ -4902,8 +4902,8 @@ void LLObjectBridgeAction::doIt() } -//virtual -void LLLSLTextBridgeAction::doIt() +//virtual +void LLLSLTextBridgeAction::doIt() { LLViewerInventoryItem* item = getItem(); if (item) @@ -4933,7 +4933,7 @@ void LLWearableBridgeAction::wearOnAvatar() { // Don't wear anything until initial wearables are loaded, can // destroy clothing items. - if (!gAgentWearables.areWearablesLoaded()) + if (!gAgentWearables.areWearablesLoaded()) { LLNotifications::instance().add("CanNotChangeAppearanceUntilLoaded"); return; @@ -4960,7 +4960,7 @@ void LLWearableBridgeAction::wearOnAvatar() } } -//virtual +//virtual void LLWearableBridgeAction::doIt() { if(isInTrash()) @@ -5036,7 +5036,7 @@ void LLLinkItemBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Restore Item")); } else - { + { items.push_back(std::string("Delete")); if (!isItemRemovable()) { @@ -5086,7 +5086,7 @@ void LLLinkFolderBridge::buildContextMenu(LLMenuGL& menu, U32 flags) items.push_back(std::string("Restore Item")); } else - { + { items.push_back(std::string("Goto Link")); items.push_back(std::string("Delete")); if (!isItemRemovable()) diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index d5a527773c..1d7cbde0d5 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -176,12 +176,21 @@ LLInventoryModel::LLInventoryModel() // Destroys the object LLInventoryModel::~LLInventoryModel() { + cleanupInventory(); +} + +void LLInventoryModel::cleanupInventory() +{ empty(); - for (observer_list_t::iterator iter = mObservers.begin(); - iter != mObservers.end(); ++iter) + // Deleting one observer might erase others from the list, so always pop off the front + while (!mObservers.empty()) { - delete *iter; + observer_list_t::iterator iter = mObservers.begin(); + LLInventoryObserver* observer = *iter; + mObservers.erase(iter); + delete observer; } + mObservers.clear(); } // This is a convenience function to check if one object has a parent diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 7d4f3372e9..d51460b374 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -112,7 +112,9 @@ public: // construction & destruction LLInventoryModel(); ~LLInventoryModel(); - + + void cleanupInventory(); + class fetchInventoryResponder : public LLHTTPClient::Responder { public: diff --git a/indra/newview/lllandmarkactions.cpp b/indra/newview/lllandmarkactions.cpp index b36b7cf50e..0b07dd4f21 100644 --- a/indra/newview/lllandmarkactions.cpp +++ b/indra/newview/lllandmarkactions.cpp @@ -133,6 +133,33 @@ public: } }; +// Returns true if the given inventory item is a landmark pointing to the current parcel. +// Used to find out if there is at least one landmark from current parcel. +class LLFistAgentParcelLandmark : public LLInventoryCollectFunctor +{ +private: + bool mFounded;// to avoid unnecessary check + +public: + LLFistAgentParcelLandmark(): mFounded(false){} + + /*virtual*/ bool operator()(LLInventoryCategory* cat, LLInventoryItem* item) + { + if (mFounded || !item || item->getType() != LLAssetType::AT_LANDMARK) + return false; + + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID()); + if (!landmark) // the landmark not been loaded yet + return false; + + LLVector3d landmark_global_pos; + if (!landmark->getGlobalPos(landmark_global_pos)) + return false; + mFounded = LLViewerParcelMgr::getInstance()->inAgentParcel(landmark_global_pos); + return mFounded; + } +}; + static void fetch_landmarks(LLInventoryModel::cat_array_t& cats, LLInventoryModel::item_array_t& items, LLInventoryCollectFunctor& add) @@ -172,6 +199,16 @@ bool LLLandmarkActions::landmarkAlreadyExists() return findLandmarkForAgentPos() != NULL; } +//static +bool LLLandmarkActions::hasParcelLandmark() +{ + LLFistAgentParcelLandmark get_first_agent_landmark; + LLInventoryModel::cat_array_t cats; + LLInventoryModel::item_array_t items; + fetch_landmarks(cats, items, get_first_agent_landmark); + return !items.empty(); + +} // *TODO: This could be made more efficient by only fetching the FIRST // landmark that meets the criteria @@ -348,7 +385,7 @@ LLLandmark* LLLandmarkActions::getLandmark(const LLUUID& landmarkInventoryItemID { LLViewerInventoryItem* item = gInventory.getItem(landmarkInventoryItemID); if (NULL == item) - return false; + return NULL; const LLUUID& asset_id = item->getAssetUUID(); return gLandmarkList.getAsset(asset_id, NULL); diff --git a/indra/newview/lllandmarkactions.h b/indra/newview/lllandmarkactions.h index d651259790..312426cab0 100644 --- a/indra/newview/lllandmarkactions.h +++ b/indra/newview/lllandmarkactions.h @@ -50,9 +50,14 @@ public: */ static LLInventoryModel::item_array_t fetchLandmarksByName(std::string& name, BOOL if_use_substring); /** - * @brief Checks whether landmark exists for current parcel. + * @brief Checks whether landmark exists for current agent position. */ static bool landmarkAlreadyExists(); + + /** + * @brief Checks whether landmark exists for current parcel. + */ + static bool hasParcelLandmark(); /** * @brief Searches landmark for global position. @@ -108,7 +113,7 @@ public: /** * @brief Retrieve a landmark from gLandmarkList by inventory item's id * - * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist. + * @return pointer to loaded landmark from gLandmarkList or NULL if landmark does not exist or wasn't loaded. */ static LLLandmark* getLandmark(const LLUUID& landmarkInventoryItemID); diff --git a/indra/newview/lllandmarklist.cpp b/indra/newview/lllandmarklist.cpp index 2e8084759a..83e694951b 100644 --- a/indra/newview/lllandmarklist.cpp +++ b/indra/newview/lllandmarklist.cpp @@ -37,6 +37,7 @@ #include "message.h" #include "llassetstorage.h" +#include "llappviewer.h" #include "llagent.h" #include "llnotify.h" #include "llvfile.h" @@ -63,20 +64,32 @@ LLLandmark* LLLandmarkList::getAsset(const LLUUID& asset_uuid, loaded_callback_t } else { - if ( gLandmarkList.mBadList.find(asset_uuid) == gLandmarkList.mBadList.end() ) + if ( mBadList.find(asset_uuid) != mBadList.end() ) { - if (cb) + return NULL; + } + + landmark_requested_list_t::iterator iter = mRequestedList.find(asset_uuid); + if (iter != mRequestedList.end()) + { + const F32 rerequest_time = 30.f; // 30 seconds between requests + if (gFrameTimeSeconds - iter->second < rerequest_time) { - loaded_callback_map_t::value_type vt(asset_uuid, cb); - mLoadedCallbackMap.insert(vt); + return NULL; } - - gAssetStorage->getAssetData( - asset_uuid, - LLAssetType::AT_LANDMARK, - LLLandmarkList::processGetAssetReply, - NULL); } + + if (cb) + { + loaded_callback_map_t::value_type vt(asset_uuid, cb); + mLoadedCallbackMap.insert(vt); + } + + gAssetStorage->getAssetData(asset_uuid, + LLAssetType::AT_LANDMARK, + LLLandmarkList::processGetAssetReply, + NULL); + mRequestedList[asset_uuid] = gFrameTimeSeconds; } return NULL; } @@ -103,7 +116,8 @@ void LLLandmarkList::processGetAssetReply( if (landmark) { gLandmarkList.mList[ uuid ] = landmark; - + gLandmarkList.mRequestedList.erase(uuid); + LLVector3d pos; if(!landmark->getGlobalPos(pos)) { diff --git a/indra/newview/lllandmarklist.h b/indra/newview/lllandmarklist.h index ebf1b65e97..d9c3267142 100644 --- a/indra/newview/lllandmarklist.h +++ b/indra/newview/lllandmarklist.h @@ -74,7 +74,10 @@ protected: typedef std::set<LLUUID> landmark_bad_list_t; landmark_bad_list_t mBadList; - + + typedef std::map<LLUUID,F32> landmark_requested_list_t; + landmark_requested_list_t mRequestedList; + // *TODO: make the callback multimap a template class and make use of it // here and in LLLandmark. typedef std::multimap<LLUUID, loaded_callback_t> loaded_callback_map_t; diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 00f12ae2eb..8fe317a292 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -294,6 +294,11 @@ void LLLocationInputCtrl::hideList() BOOL LLLocationInputCtrl::handleToolTip(S32 x, S32 y, MASK mask) { + + if(mAddLandmarkBtn->parentPointInView(x,y)) + { + updateAddLandmarkTooltip(); + } // Let the buttons show their tooltips. if (LLUICtrl::handleToolTip(x, y, mask)) { @@ -602,11 +607,12 @@ void LLLocationInputCtrl::enableAddLandmarkButton(bool val) // depending on whether current parcel has been landmarked. void LLLocationInputCtrl::updateAddLandmarkButton() { - bool landmark_exists = LLLandmarkActions::landmarkAlreadyExists(); - enableAddLandmarkButton(!landmark_exists); - + enableAddLandmarkButton(LLLandmarkActions::hasParcelLandmark()); +} +void LLLocationInputCtrl::updateAddLandmarkTooltip() +{ std::string tooltip; - if(landmark_exists) + if(LLLandmarkActions::landmarkAlreadyExists()) { tooltip = mEditLandmarkTooltip; } diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index c74a294ca3..44dc0cb251 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -107,6 +107,7 @@ private: bool findTeleportItemsByTitle(const LLTeleportHistoryItem& item, const std::string& filter); void setText(const LLStringExplicit& text); void updateAddLandmarkButton(); + void updateAddLandmarkTooltip(); void updateContextMenu(); void updateWidgetlayout(); void changeLocationPresentation(); diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 69214b5cab..a16ffe19c6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -36,6 +36,8 @@ #include "llappviewer.h" #include "llfloaterchat.h" #include "lltrans.h" +#include "llviewercontrol.h" +#include "llsdserialize.h" const S32 LOG_RECALL_SIZE = 2048; @@ -89,41 +91,53 @@ std::string LLLogChat::timestamp(bool withdate) //static -void LLLogChat::saveHistory(std::string filename, std::string line) +void LLLogChat::saveHistory(const std::string& filename, + const std::string& from, + const LLUUID& from_id, + const std::string& line) { + if (!gSavedPerAccountSettings.getBOOL("LogInstantMessages")) + return; + if(!filename.size()) { llinfos << "Filename is Empty!" << llendl; return; } - LLFILE* fp = LLFile::fopen(LLLogChat::makeLogFileName(filename), "a"); /*Flawfinder: ignore*/ - if (!fp) + llofstream file (LLLogChat::makeLogFileName(filename), std::ios_base::app); + if (!file.is_open()) { llinfos << "Couldn't open chat history log!" << llendl; + return; } - else - { - fprintf(fp, "%s\n", line.c_str()); - - fclose (fp); - } + + LLSD item; + + if (gSavedPerAccountSettings.getBOOL("LogTimestamp")) + item["time"] = LLLogChat::timestamp(gSavedPerAccountSettings.getBOOL("LogTimestampDate")); + + item["from"] = from; + item["from_id"] = from_id; + item["message"] = line; + + file << LLSDOStreamer <LLSDNotationFormatter>(item) << std::endl; + + file.close(); } -void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType,std::string,void*), void* userdata) +void LLLogChat::loadHistory(const std::string& filename, void (*callback)(ELogLineType, const LLSD&, void*), void* userdata) { if(!filename.size()) { llwarns << "Filename is Empty!" << llendl; return ; } - + LLFILE* fptr = LLFile::fopen(makeLogFileName(filename), "r"); /*Flawfinder: ignore*/ if (!fptr) { - //LLUIString message = LLTrans::getString("IM_logging_string"); - //callback(LOG_EMPTY,"IM_logging_string",userdata); - callback(LOG_EMPTY,LLStringUtil::null,userdata); + callback(LOG_EMPTY, LLSD(), userdata); return; //No previous conversation with this name. } else @@ -143,6 +157,9 @@ void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType } } + // the parser's destructor is protected so we cannot create in the stack. + LLPointer<LLSDParser> parser = new LLSDNotationParser(); + while ( fgets(buffer, LOG_RECALL_SIZE, fptr) && !feof(fptr) ) { len = strlen(buffer) - 1; /*Flawfinder: ignore*/ @@ -150,14 +167,25 @@ void LLLogChat::loadHistory(std::string filename , void (*callback)(ELogLineType if (!firstline) { - callback(LOG_LINE,std::string(buffer),userdata); + LLSD item; + std::string line(buffer); + std::istringstream iss(line); + if (parser->parse(iss, item, line.length()) == LLSDParser::PARSE_FAILURE) + { + item["message"] = line; + callback(LOG_LINE, item, userdata); + } + else + { + callback(LOG_LLSD, item, userdata); + } } else { firstline = FALSE; } } - callback(LOG_END,LLStringUtil::null,userdata); + callback(LOG_END, LLSD(), userdata); fclose(fptr); } diff --git a/indra/newview/lllogchat.h b/indra/newview/lllogchat.h index ad903b66fe..e252cd7d41 100644 --- a/indra/newview/lllogchat.h +++ b/indra/newview/lllogchat.h @@ -41,13 +41,18 @@ public: enum ELogLineType { LOG_EMPTY, LOG_LINE, + LOG_LLSD, LOG_END }; static std::string timestamp(bool withdate = false); static std::string makeLogFileName(std::string(filename)); - static void saveHistory(std::string filename, std::string line); - static void loadHistory(std::string filename, - void (*callback)(ELogLineType,std::string,void*), + static void saveHistory(const std::string& filename, + const std::string& from, + const LLUUID& from_id, + const std::string& line); + + static void loadHistory(const std::string& filename, + void (*callback)(ELogLineType, const LLSD&, void*), void* userdata); private: static std::string cleanFileName(std::string filename); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 15efd0100a..8f29f908e5 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -51,6 +51,7 @@ #include "llpluginclassmedia.h" #include "llslurl.h" #include "lluictrlfactory.h" // LLDefaultChildRegistry +#include "llkeyboard.h" // linden library includes #include "llfocusmgr.h" @@ -193,7 +194,7 @@ BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask ) if (mMediaSource) { - mMediaSource->mouseMove(x, y); + mMediaSource->mouseMove(x, y, mask); gViewerWindow->setCursor(mMediaSource->getLastSetCursor()); } @@ -205,7 +206,7 @@ BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask ) BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks ) { if (mMediaSource && mMediaSource->hasMedia()) - mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, MASK_NONE); + mMediaSource->getMediaPlugin()->scrollEvent(0, clicks, gKeyboard->currentMask(TRUE)); return TRUE; } @@ -218,7 +219,7 @@ BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) if (mMediaSource) { - mMediaSource->mouseUp(x, y); + mMediaSource->mouseUp(x, y, mask); // *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup, // in addition to the onFocusReceived() call below. Undo this. JC @@ -241,7 +242,50 @@ BOOL LLMediaCtrl::handleMouseDown( S32 x, S32 y, MASK mask ) convertInputCoords(x, y); if (mMediaSource) - mMediaSource->mouseDown(x, y); + mMediaSource->mouseDown(x, y, mask); + + gFocusMgr.setMouseCapture( this ); + + if (mTakeFocusOnClick) + { + setFocus( TRUE ); + } + + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////////// +// +BOOL LLMediaCtrl::handleRightMouseUp( S32 x, S32 y, MASK mask ) +{ + convertInputCoords(x, y); + + if (mMediaSource) + { + mMediaSource->mouseUp(x, y, mask, 1); + + // *HACK: LLMediaImplLLMozLib automatically takes focus on mouseup, + // in addition to the onFocusReceived() call below. Undo this. JC + if (!mTakeFocusOnClick) + { + mMediaSource->focus(false); + gViewerWindow->focusClient(); + } + } + + gFocusMgr.setMouseCapture( NULL ); + + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////////// +// +BOOL LLMediaCtrl::handleRightMouseDown( S32 x, S32 y, MASK mask ) +{ + convertInputCoords(x, y); + + if (mMediaSource) + mMediaSource->mouseDown(x, y, mask, 1); gFocusMgr.setMouseCapture( this ); @@ -260,7 +304,7 @@ BOOL LLMediaCtrl::handleDoubleClick( S32 x, S32 y, MASK mask ) convertInputCoords(x, y); if (mMediaSource) - mMediaSource->mouseLeftDoubleClick( x, y ); + mMediaSource->mouseDoubleClick( x, y, mask); gFocusMgr.setMouseCapture( this ); diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 5ea03f1e6c..76ddc61ebf 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -86,6 +86,8 @@ public: virtual BOOL handleHover( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseUp( S32 x, S32 y, MASK mask ); virtual BOOL handleMouseDown( S32 x, S32 y, MASK mask ); + virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleRightMouseUp(S32 x, S32 y, MASK mask); virtual BOOL handleDoubleClick( S32 x, S32 y, MASK mask ); virtual BOOL handleScrollWheel( S32 x, S32 y, S32 clicks ); diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 6ae42d23d3..512104a2f4 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -367,8 +367,9 @@ BOOL LLMediaDataClient::QueueTimer::tick() // Peel one off of the items from the queue, and execute request request_ptr_t request = queue.top(); llassert(!request.isNull()); - const LLMediaDataClientObject *object = request->getObject(); + const LLMediaDataClientObject *object = (request.isNull()) ? NULL : request->getObject(); bool performed_request = false; + bool error = false; llassert(NULL != object); if (NULL != object && object->hasMedia()) { @@ -387,7 +388,11 @@ BOOL LLMediaDataClient::QueueTimer::tick() } } else { - if (NULL == object) + if (request.isNull()) + { + LL_WARNS("LLMediaDataClient") << "Not Sending request: NULL request!" << LL_ENDL; + } + else if (NULL == object) { LL_WARNS("LLMediaDataClient") << "Not Sending request for " << *request << " NULL object!" << LL_ENDL; } @@ -395,9 +400,10 @@ BOOL LLMediaDataClient::QueueTimer::tick() { LL_WARNS("LLMediaDataClient") << "Not Sending request for " << *request << " hasMedia() is false!" << LL_ENDL; } + error = true; } bool exceeded_retries = request->getRetryCount() > mMDC->mMaxNumRetries; - if (performed_request || exceeded_retries) // Try N times before giving up + if (performed_request || exceeded_retries || error) // Try N times before giving up { if (exceeded_retries) { diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index 2b4e35208a..14da35594f 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -280,6 +280,14 @@ void LLFloaterMove::setMovementMode(const EMovementMode mode) mCurrentMode = mode; gAgent.setFlying(MM_FLY == mode); + // attempts to set avatar flying can not set it real flying in some cases. + // For ex. when avatar fell down & is standing up. + // So, no need to continue processing FLY mode. See EXT-1079 + if (MM_FLY == mode && !gAgent.getFlying()) + { + return; + } + switch (mode) { case MM_RUN: diff --git a/indra/newview/llmutelist.cpp b/indra/newview/llmutelist.cpp index ff7f08bf97..36cf2c1aa8 100644 --- a/indra/newview/llmutelist.cpp +++ b/indra/newview/llmutelist.cpp @@ -65,7 +65,6 @@ #include "llworld.h" //for particle system banning #include "llchat.h" #include "llfloaterchat.h" -#include "llimpanel.h" #include "llimview.h" #include "llnotifications.h" #include "lluistring.h" diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index b91e23eace..e63daac4af 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -164,17 +164,6 @@ TODO: - Load navbar height from saved settings (as it's done for status bar) or think of a better way. */ -S32 NAVIGATION_BAR_HEIGHT = 60; // *HACK -LLNavigationBar* LLNavigationBar::sInstance = 0; - -LLNavigationBar* LLNavigationBar::getInstance() -{ - if (!sInstance) - sInstance = new LLNavigationBar(); - - return sInstance; -} - LLNavigationBar::LLNavigationBar() : mTeleportHistoryMenu(NULL), mBtnBack(NULL), @@ -198,8 +187,6 @@ LLNavigationBar::LLNavigationBar() LLNavigationBar::~LLNavigationBar() { mTeleportFinishConnection.disconnect(); - sInstance = 0; - LLSearchHistory::getInstance()->save(); } @@ -272,6 +259,15 @@ void LLNavigationBar::draw() onTeleportHistoryChanged(); mPurgeTPHistoryItems = false; } + + if (isBackgroundVisible()) + { + static LLUICachedControl<S32> drop_shadow_floater ("DropShadowFloater", 0); + static LLUIColor color_drop_shadow = LLUIColorTable::instance().getColor("ColorDropShadow"); + gl_drop_shadow(0, getRect().getHeight(), getRect().getWidth(), 0, + color_drop_shadow, drop_shadow_floater ); + } + LLPanel::draw(); } @@ -521,8 +517,8 @@ void LLNavigationBar::showTeleportHistoryMenu() // *TODO: why to draw/update anything before showing the menu? mTeleportHistoryMenu->buildDrawLabels(); mTeleportHistoryMenu->updateParent(LLMenuGL::sMenuContainer); - LLRect btnBackRect = mBtnBack->getRect(); - LLMenuGL::showPopup(this, mTeleportHistoryMenu, btnBackRect.mLeft, btnBackRect.mBottom); + const S32 MENU_SPAWN_PAD = -1; + LLMenuGL::showPopup(mBtnBack, mTeleportHistoryMenu, 0, MENU_SPAWN_PAD); // *HACK pass the mouse capturing to the drop-down menu gFocusMgr.setMouseCapture( NULL ); @@ -547,6 +543,15 @@ void LLNavigationBar::clearHistoryCache() mPurgeTPHistoryItems= true; } +int LLNavigationBar::getDefNavBarHeight() +{ + return mDefaultNbRect.getHeight(); +} +int LLNavigationBar::getDefFavBarHeight() +{ + return mDefaultFpRect.getHeight(); +} + void LLNavigationBar::showNavigationPanel(BOOL visible) { bool fpVisible = gSavedSettings.getBOOL("ShowNavbarFavoritesPanel"); diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index 8a65cd24fa..8b625e7fa6 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -35,8 +35,6 @@ #include "llpanel.h" -extern S32 NAVIGATION_BAR_HEIGHT; - class LLButton; class LLLocationInputCtrl; class LLMenuGL; @@ -47,12 +45,12 @@ class LLSearchComboBox; * Web browser-like navigation bar. */ class LLNavigationBar -: public LLPanel + : public LLPanel, public LLSingleton<LLNavigationBar> { LOG_CLASS(LLNavigationBar); - + public: - static LLNavigationBar* getInstance(); + LLNavigationBar(); virtual ~LLNavigationBar(); /*virtual*/ void draw(); @@ -63,9 +61,11 @@ public: void showNavigationPanel(BOOL visible); void showFavoritesPanel(BOOL visible); + + int getDefNavBarHeight(); + int getDefFavBarHeight(); private: - LLNavigationBar(); void rebuildTeleportHistoryMenu(); void showTeleportHistoryMenu(); @@ -91,8 +91,6 @@ private: void fillSearchComboBox(); - static LLNavigationBar *sInstance; - LLMenuGL* mTeleportHistoryMenu; LLButton* mBtnBack; LLButton* mBtnForward; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index bbab9944f3..12638ab855 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -170,22 +170,6 @@ LLColor4 nearbychat_get_text_color(const LLChat& chat) return text_color; } -std::string formatCurrentTime() -{ - time_t utc_time; - utc_time = time_corrected(); - std::string timeStr ="["+ LLTrans::getString("TimeHour")+"]:[" - +LLTrans::getString("TimeMin")+"] "; - - LLSD substitution; - - substitution["datetime"] = (S32) utc_time; - LLStringUtil::format (timeStr, substitution); - - return timeStr; -} - - void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& color) { S32 font_size = gSavedSettings.getS32("ChatFontSize"); @@ -210,24 +194,24 @@ void LLNearbyChat::add_timestamped_line(const LLChat& chat, const LLColor4& colo style_params.font(fontp); LLUUID uuid = chat.mFromID; std::string from = chat.mFromName; - std::string time = formatCurrentTime(); std::string message = chat.mText; - mChatHistory->appendWidgetMessage(uuid, from, time, message, style_params); + mChatHistory->appendWidgetMessage(chat, style_params); } void LLNearbyChat::addMessage(const LLChat& chat) { LLColor4 color = nearbychat_get_text_color(chat); - if (chat.mChatType == CHAT_TYPE_DEBUG_MSG) { - LLFloaterScriptDebug::addScriptLine(chat.mText, - chat.mFromName, - color, - chat.mFromID); - if (!gSavedSettings.getBOOL("ScriptErrorsAsChat")) + if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) + return; + if (gSavedSettings.getS32("ShowScriptErrorsLocation")== 1)// show error in window //("ScriptErrorsAsChat")) { + LLFloaterScriptDebug::addScriptLine(chat.mText, + chat.mFromName, + color, + chat.mFromID); return; } } diff --git a/indra/newview/llnearbychatbar.cpp b/indra/newview/llnearbychatbar.cpp index 5fa97926a5..32dc5e5927 100644 --- a/indra/newview/llnearbychatbar.cpp +++ b/indra/newview/llnearbychatbar.cpp @@ -45,6 +45,7 @@ #include "llviewerstats.h" #include "llcommandhandler.h" #include "llviewercontrol.h" +#include "llnavigationbar.h" S32 LLNearbyChatBar::sLastSpecialChatChannel = 0; @@ -177,6 +178,31 @@ void LLGestureComboBox::draw() LLComboBox::draw(); } +//virtual +void LLGestureComboBox::showList() +{ + LLComboBox::showList(); + + // Calculating amount of space between the navigation bar and gestures combo + LLNavigationBar* nb = LLNavigationBar::getInstance(); + S32 x, nb_bottom; + nb->localPointToScreen(0, 0, &x, &nb_bottom); + + S32 list_bottom; + mList->localPointToScreen(0, 0, &x, &list_bottom); + + S32 max_height = nb_bottom - list_bottom; + + LLRect rect = mList->getRect(); + // List overlapped navigation bar, downsize it + if (rect.getHeight() > max_height) + { + rect.setOriginAndSize(rect.mLeft, rect.mBottom, rect.getWidth(), max_height); + mList->setRect(rect); + mList->reshape(rect.getWidth(), rect.getHeight()); + } +} + LLNearbyChatBar::LLNearbyChatBar() : LLPanel() , mChatBox(NULL) @@ -198,7 +224,6 @@ BOOL LLNearbyChatBar::postBuild() mChatBox->setIgnoreTab(TRUE); mChatBox->setPassDelete(TRUE); mChatBox->setReplaceNewlinesWithSpaces(FALSE); - mChatBox->setMaxTextLength(1023); mChatBox->setEnableLineHistory(TRUE); mOutputMonitor = getChild<LLOutputMonitorCtrl>("chat_zone_indicator"); diff --git a/indra/newview/llnearbychatbar.h b/indra/newview/llnearbychatbar.h index b902ff86cc..06204e6367 100644 --- a/indra/newview/llnearbychatbar.h +++ b/indra/newview/llnearbychatbar.h @@ -40,7 +40,7 @@ #include "llchiclet.h" #include "llvoiceclient.h" #include "lloutputmonitorctrl.h" -#include "llfloateractivespeakers.h" +#include "llspeakers.h" class LLGestureComboBox : public LLComboBox @@ -62,6 +62,9 @@ public: virtual void changed() { refreshGestures(); } protected: + + virtual void showList(); + LLFrameTimer mGestureLabelTimer; std::vector<LLMultiGesture*> mGestures; std::string mLabel; diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index 4aefbd1a33..8a8ad9d073 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -162,6 +162,8 @@ bool LLNearbyChatScreenChannel::createPoolToast() LLToast::Params p; p.panel = panel; + p.lifetime_secs = gSavedSettings.getS32("NearbyToastLifeTime"); + p.fading_time_secs = gSavedSettings.getS32("NearbyToastFadingTime"); LLToast* toast = new LLToast(p); @@ -188,6 +190,17 @@ void LLNearbyChatScreenChannel::addNotification(LLSD& notification) return; } + int chat_type = notification["chat_type"].asInteger(); + + if( ((EChatType)chat_type == CHAT_TYPE_DEBUG_MSG)) + { + if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE) + return; + if(gSavedSettings.getS32("ShowScriptErrorsLocation")== 1) + return; + } + + //take 1st element from pool, (re)initialize it, put it in active toasts LLToast* toast = m_toast_pool.back(); @@ -249,8 +262,9 @@ void LLNearbyChatScreenChannel::showToastsBottom() toast_rect.setLeftTopAndSize(getRect().mLeft , toast_top, toast_rect.getWidth() ,toast_rect.getHeight()); toast->setRect(toast_rect); - + toast->setIsHidden(false); toast->setVisible(TRUE); + bottom = toast->getRect().mTop; } } @@ -315,6 +329,12 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) initChannel(); } + //only messages from AGENTS + if(CHAT_SOURCE_OBJECT == chat_msg.mSourceType) + { + return;//dn't show toast for messages from objects + } + LLUUID id; id.generate(); @@ -330,6 +350,7 @@ void LLNearbyChatHandler::processChat(const LLChat& chat_msg) notification["from_id"] = chat_msg.mFromID; notification["time"] = chat_msg.mTime; notification["source"] = (S32)chat_msg.mSourceType; + notification["chat_type"] = (S32)chat_msg.mChatType; channel->addNotification(notification); } diff --git a/indra/newview/llnotificationtiphandler.cpp b/indra/newview/llnotificationtiphandler.cpp index 7239f49b7f..543198c1d2 100644 --- a/indra/newview/llnotificationtiphandler.cpp +++ b/indra/newview/llnotificationtiphandler.cpp @@ -86,6 +86,20 @@ bool LLTipHandler::processNotification(const LLSD& notify) if(notify["sigtype"].asString() == "add" || notify["sigtype"].asString() == "change") { + // archive message in nearby chat + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + LLChat chat_msg(notification->getMessage()); + nearby_chat->addMessage(chat_msg); + + // don't show toast if Nearby Chat is opened + if (nearby_chat->getVisible()) + { + return true; + } + } + LLToastNotifyPanel* notify_box = new LLToastNotifyPanel(notification); LLToast::Params p; @@ -99,14 +113,6 @@ bool LLTipHandler::processNotification(const LLSD& notify) LLScreenChannel* channel = dynamic_cast<LLScreenChannel*>(mChannel); if(channel) channel->addToast(p); - - // archive message in nearby chat - LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); - if(nearby_chat) - { - LLChat chat_msg(notification->getMessage()); - nearby_chat->addMessage(chat_msg); - } } else if (notify["sigtype"].asString() == "delete") { diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 6eed956eb8..b54975b76b 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -34,6 +34,7 @@ #include "llpanelimcontrolpanel.h" +#include "llagent.h" #include "llavataractions.h" #include "llavatariconctrl.h" #include "llbutton.h" @@ -41,6 +42,61 @@ #include "llavatarlist.h" #include "llparticipantlist.h" #include "llimview.h" +#include "llvoicechannel.h" + +void LLPanelChatControlPanel::onCallButtonClicked() +{ + gIMMgr->startCall(mSessionId); +} + +void LLPanelChatControlPanel::onEndCallButtonClicked() +{ + gIMMgr->endCall(mSessionId); +} + +void LLPanelChatControlPanel::onOpenVoiceControlsClicked() +{ + // TODO: implement Voice Control Panel opening +} + +BOOL LLPanelChatControlPanel::postBuild() +{ + childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); + childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); + childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this)); + + return TRUE; +} + +void LLPanelChatControlPanel::draw() +{ + // hide/show start call and end call buttons + bool voice_enabled = LLVoiceClient::voiceEnabled(); + + LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId); + if (!session) return; + + LLVoiceChannel* voice_channel = session->mVoiceChannel; + if (voice_channel && voice_enabled) + { + bool is_call_started = ( voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED ); + childSetVisible("end_call_btn", is_call_started); + childSetVisible("voice_ctrls_btn", is_call_started); + childSetVisible("call_btn", ! is_call_started); + } + + bool session_initialized = session->mSessionInitialized; + bool callback_enabled = session->mCallBackEnabled; + LLViewerRegion* region = gAgent.getRegion(); + + BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") + && session_initialized + && voice_enabled + && callback_enabled; + childSetEnabled("call_btn", enable_connect); + + LLPanel::draw(); +} LLPanelIMControlPanel::LLPanelIMControlPanel() { @@ -54,11 +110,11 @@ BOOL LLPanelIMControlPanel::postBuild() { childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this)); childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this)); - childSetAction("call_btn", boost::bind(&LLPanelIMControlPanel::onCallButtonClicked, this)); + childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(getChild<LLAvatarIconCtrl>("avatar_icon")->getAvatarId())); - - return TRUE; + + return LLPanelChatControlPanel::postBuild(); } void LLPanelIMControlPanel::onViewProfileButtonClicked() @@ -73,22 +129,29 @@ void LLPanelIMControlPanel::onAddFriendButtonClicked() LLAvatarActions::requestFriendshipDialog(avatar_icon->getAvatarId(), full_name); } -void LLPanelIMControlPanel::onCallButtonClicked() -{ - // *TODO: Implement -} - void LLPanelIMControlPanel::onShareButtonClicked() { // *TODO: Implement } -void LLPanelIMControlPanel::setID(const LLUUID& avatar_id) +void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) { + LLPanelChatControlPanel::setSessionId(session_id); + + LLIMModel& im_model = LLIMModel::instance(); + + LLUUID avatar_id = im_model.getOtherParticipantID(session_id); + // Disable "Add friend" button for friends. childSetEnabled("add_friend_btn", !LLAvatarActions::isFriend(avatar_id)); getChild<LLAvatarIconCtrl>("avatar_icon")->setValue(avatar_id); + + // Disable profile button if participant is not realy SL avatar + LLIMModel::LLIMSession* im_session = + im_model.findIMSession(session_id); + if( im_session && !im_session->mOtherParticipantIsAvatar ) + childSetEnabled("view_profile_btn", FALSE); } @@ -100,12 +163,11 @@ LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id) BOOL LLPanelGroupControlPanel::postBuild() { childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); - childSetAction("call_btn", boost::bind(&LLPanelGroupControlPanel::onCallButtonClicked, this)); mAvatarList = getChild<LLAvatarList>("speakers_list"); mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - return TRUE; + return LLPanelChatControlPanel::postBuild(); } LLPanelGroupControlPanel::~LLPanelGroupControlPanel() @@ -127,13 +189,23 @@ void LLPanelGroupControlPanel::onGroupInfoButtonClicked() } -void LLPanelGroupControlPanel::onCallButtonClicked() +void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) { - // *TODO: Implement + LLPanelChatControlPanel::setSessionId(session_id); + + mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); } -void LLPanelGroupControlPanel::setID(const LLUUID& id) +LLPanelAdHocControlPanel::LLPanelAdHocControlPanel(const LLUUID& session_id):LLPanelGroupControlPanel(session_id) { - mGroupID = id; } + +BOOL LLPanelAdHocControlPanel::postBuild() +{ + mAvatarList = getChild<LLAvatarList>("speakers_list"); + mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); + + return LLPanelChatControlPanel::postBuild(); +} + diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 138b1630c4..d25f33935a 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -45,8 +45,17 @@ public: LLPanelChatControlPanel() {}; ~LLPanelChatControlPanel() {}; - // sets the group or avatar UUID - virtual void setID(const LLUUID& avatar_id)= 0; + virtual BOOL postBuild(); + virtual void draw(); + + void onCallButtonClicked(); + void onEndCallButtonClicked(); + void onOpenVoiceControlsClicked(); + + virtual void setSessionId(const LLUUID& session_id) { mSessionId = session_id; } + +private: + LLUUID mSessionId; }; @@ -58,13 +67,14 @@ public: BOOL postBuild(); - void setID(const LLUUID& avatar_id); + void setSessionId(const LLUUID& session_id); private: void onViewProfileButtonClicked(); void onAddFriendButtonClicked(); - void onCallButtonClicked(); void onShareButtonClicked(); + + LLUUID mAvatarID; }; @@ -76,19 +86,26 @@ public: BOOL postBuild(); - void setID(const LLUUID& id); + void setSessionId(const LLUUID& session_id); /*virtual*/ void draw(); -private: - void onGroupInfoButtonClicked(); - void onCallButtonClicked(); - +protected: LLUUID mGroupID; LLSpeakerMgr* mSpeakerManager; LLAvatarList* mAvatarList; LLParticipantList* mParticipantList; + +private: + void onGroupInfoButtonClicked(); }; +class LLPanelAdHocControlPanel : public LLPanelGroupControlPanel +{ +public: + LLPanelAdHocControlPanel(const LLUUID& session_id); + + BOOL postBuild(); +}; #endif // LL_LLPANELIMCONTROLPANEL_H diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 83fb147a49..c9598a2576 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -38,10 +38,12 @@ #include "llsdutil.h" #include "llsdutil_math.h" +#include "llaccordionctrl.h" #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentpicksinfo.h" #include "llagentui.h" +#include "llcallbacklist.h" #include "lldndbutton.h" #include "llfloaterworldmap.h" #include "llfolderviewitem.h" @@ -56,7 +58,7 @@ //static LLRegisterPanelClassWrapper<LLLandmarksPanel> t_landmarks("panel_landmarks"); static const std::string OPTIONS_BUTTON_NAME = "options_gear_btn"; -static const std::string ADD_LANDMARK_BUTTON_NAME = "add_landmark_btn"; +static const std::string ADD_BUTTON_NAME = "add_btn"; static const std::string ADD_FOLDER_BUTTON_NAME = "add_folder_btn"; static const std::string TRASH_BUTTON_NAME = "trash_btn"; @@ -75,6 +77,7 @@ LLLandmarksPanel::LLLandmarksPanel() , mListCommands(NULL) , mGearFolderMenu(NULL) , mGearLandmarkMenu(NULL) + , mDirtyFilter(false) { LLUICtrlFactory::getInstance()->buildPanel(this, "panel_landmarks.xml"); } @@ -98,16 +101,40 @@ BOOL LLLandmarksPanel::postBuild() initMyInventroyPanel(); initLibraryInventroyPanel(); + gIdleCallbacks.addFunction(LLLandmarksPanel::doIdle, this); return TRUE; } // virtual void LLLandmarksPanel::onSearchEdit(const std::string& string) { + static std::string prev_string(""); + + if (prev_string == string) return; + + // show all folders in Landmarks Accordion for empty filter + mLandmarksInventoryPanel->setShowFolderState(string.empty() ? + LLInventoryFilter::SHOW_ALL_FOLDERS : + LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS + ); + filter_list(mFavoritesInventoryPanel, string); filter_list(mLandmarksInventoryPanel, string); filter_list(mMyInventoryPanel, string); filter_list(mLibraryInventoryPanel, string); + + prev_string = string; + mDirtyFilter = true; + + // give FolderView a chance to be refreshed. So, made all accordions visible + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + LLAccordionCtrlTab* tab = *iter; + tab->setVisible(true); + + // expand accordion to see matched items in all ones. See EXT-2014. + tab->changeOpenClose(false); + } } // virtual @@ -157,9 +184,9 @@ void LLLandmarksPanel::updateVerbs() if (!isTabVisible()) return; - BOOL enabled = isLandmarkSelected(); - mTeleportBtn->setEnabled(enabled); - mShowOnMapBtn->setEnabled(enabled); + bool landmark_selected = isLandmarkSelected(); + mTeleportBtn->setEnabled(landmark_selected && isActionEnabled("teleport")); + mShowOnMapBtn->setEnabled(landmark_selected && isActionEnabled("show_on_map")); // TODO: mantipov: Uncomment when mShareBtn is supported // Share button should be enabled when neither a folder nor a landmark is selected @@ -300,6 +327,8 @@ void LLLandmarksPanel::processParcelInfo(const LLParcelData& parcel_data) panel_pick, panel_places,params)); panel_pick->setSaveCallback(boost::bind(&LLLandmarksPanel::onPickPanelExit,this, panel_pick, panel_places,params)); + panel_pick->setCancelCallback(boost::bind(&LLLandmarksPanel::onPickPanelExit,this, + panel_pick, panel_places,params)); } } } @@ -389,6 +418,7 @@ void LLLandmarksPanel::initLandmarksPanel(LLInventorySubTreePanel* inventory_lis void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLInventorySubTreePanel* inventory_list) { LLAccordionCtrlTab* accordion_tab = getChild<LLAccordionCtrlTab>(accordion_tab_name); + mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); } @@ -433,11 +463,11 @@ void LLLandmarksPanel::initListCommandsHandlers() mListCommands = getChild<LLPanel>("bottom_panel"); mListCommands->childSetAction(OPTIONS_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onActionsButtonClick, this)); - mListCommands->childSetAction(ADD_LANDMARK_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onAddLandmarkButtonClick, this)); - mListCommands->childSetAction(ADD_FOLDER_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onAddFolderButtonClick, this)); mListCommands->childSetAction(TRASH_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onTrashButtonClick, this)); + mListCommands->getChild<LLButton>(ADD_BUTTON_NAME)->setHeldDownCallback(boost::bind(&LLLandmarksPanel::onAddButtonHeldDown, this)); + static const LLSD add_landmark_command("add_landmark"); + mListCommands->childSetAction(ADD_BUTTON_NAME, boost::bind(&LLLandmarksPanel::onAddAction, this, add_landmark_command)); - LLDragAndDropButton* trash_btn = mListCommands->getChild<LLDragAndDropButton>(TRASH_BUTTON_NAME); trash_btn->setDragAndDropHandler(boost::bind(&LLLandmarksPanel::handleDragAndDropToTrash, this , _4 // BOOL drop @@ -453,6 +483,7 @@ void LLLandmarksPanel::initListCommandsHandlers() mEnableCallbackRegistrar.add("Places.LandmarksGear.Enable", boost::bind(&LLLandmarksPanel::isActionEnabled, this, _2)); mGearLandmarkMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_places_gear_landmark.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGearFolderMenu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_places_gear_folder.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + mMenuAdd = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_place_add_button.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); } @@ -488,52 +519,26 @@ void LLLandmarksPanel::onActionsButtonClick() mGearFolderMenu->getChild<LLMenuItemCallGL>("collapse")->setVisible(cur_item->isOpen()); menu = mGearFolderMenu; } - if(menu) - { - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLView* actions_btn = getChild<LLView>(OPTIONS_BUTTON_NAME); - S32 menu_x, menu_y; - actions_btn->localPointToOtherView(0,actions_btn->getRect().getHeight(),&menu_x,&menu_y, this); - menu_y += menu->getRect().getHeight(); - LLMenuGL::showPopup(this, menu, menu_x,menu_y); - } + showActionMenu(menu,OPTIONS_BUTTON_NAME); } -void LLLandmarksPanel::onAddLandmarkButtonClick() const +void LLLandmarksPanel::onAddButtonHeldDown() { - if(LLLandmarkActions::landmarkAlreadyExists()) - { - std::string location; - LLAgentUI::buildLocationString(location, LLAgentUI::LOCATION_FORMAT_FULL); - llwarns<<" Landmark already exists at location: "<< location<<llendl; - return; - } - LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); + showActionMenu(mMenuAdd,ADD_BUTTON_NAME); } -void LLLandmarksPanel::onAddFolderButtonClick() const +void LLLandmarksPanel::showActionMenu(LLMenuGL* menu, std::string spawning_view_name) { - LLFolderViewItem* item = getCurSelectedItem(); - if(item && mCurrentSelectedList == mLandmarksInventoryPanel) + if (menu) { - LLFolderViewEventListener* folder_bridge = NULL; - if(item-> getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK) - { - // for a landmark get parent folder bridge - folder_bridge = item->getParentFolder()->getListener(); - } - else if (item-> getListener()->getInventoryType() == LLInventoryType::IT_CATEGORY) - { - // for a folder get its own bridge - folder_bridge = item->getListener(); - } - - menu_create_inventory_item(mCurrentSelectedList->getRootFolder() - , dynamic_cast<LLFolderBridge*>(folder_bridge) - , LLSD("category") - , gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK) - ); + menu->buildDrawLabels(); + menu->updateParent(LLMenuGL::sMenuContainer); + LLView* spawning_view = getChild<LLView> (spawning_view_name); + S32 menu_x, menu_y; + //show menu in co-ordinates of panel + spawning_view->localPointToOtherView(0, spawning_view->getRect().getHeight(), &menu_x, &menu_y, this); + menu_y += menu->getRect().getHeight(); + LLMenuGL::showPopup(this, menu, menu_x, menu_y); } } @@ -547,11 +552,39 @@ void LLLandmarksPanel::onAddAction(const LLSD& userdata) const std::string command_name = userdata.asString(); if("add_landmark" == command_name) { - onAddLandmarkButtonClick(); + if(LLLandmarkActions::landmarkAlreadyExists()) + { + std::string location; + LLAgentUI::buildLocationString(location, LLAgentUI::LOCATION_FORMAT_FULL); + llwarns<<" Landmark already exists at location: "<< location<<llendl; + return; + } + LLSideTray::getInstance()->showPanel("panel_places", LLSD().insert("type", "create_landmark")); } else if ("category" == command_name) { - onAddFolderButtonClick(); + LLFolderViewItem* item = getCurSelectedItem(); + if (item && mCurrentSelectedList == mLandmarksInventoryPanel) + { + LLFolderViewEventListener* folder_bridge = NULL; + if (item-> getListener()->getInventoryType() + == LLInventoryType::IT_LANDMARK) + { + // for a landmark get parent folder bridge + folder_bridge = item->getParentFolder()->getListener(); + } + else if (item-> getListener()->getInventoryType() + == LLInventoryType::IT_CATEGORY) + { + // for a folder get its own bridge + folder_bridge = item->getListener(); + } + + menu_create_inventory_item(mCurrentSelectedList->getRootFolder(), + dynamic_cast<LLFolderBridge*> (folder_bridge), LLSD( + "category"), gInventory.findCategoryUUIDForType( + LLAssetType::AT_LANDMARK)); + } } } @@ -853,6 +886,43 @@ bool LLLandmarksPanel::handleDragAndDropToTrash(BOOL drop, EDragAndDropType carg return true; } +// static +void LLLandmarksPanel::doIdle(void* landmarks_panel) +{ + LLLandmarksPanel* panel = (LLLandmarksPanel* ) landmarks_panel; + + if (panel->mDirtyFilter) + { + panel->updateFilteredAccordions(); + } + +} + +void LLLandmarksPanel::updateFilteredAccordions() +{ + LLInventoryPanel* inventory_list = NULL; + LLAccordionCtrlTab* accordion_tab = NULL; + for (accordion_tabs_t::const_iterator iter = mAccordionTabs.begin(); iter != mAccordionTabs.end(); ++iter) + { + accordion_tab = *iter; + inventory_list = dynamic_cast<LLInventorySubTreePanel*> (accordion_tab->getAccordionView()); + if (NULL == inventory_list) continue; + LLFolderView* fv = inventory_list->getRootFolder(); + + bool has_visible_children = fv->hasVisibleChildren(); + + accordion_tab->setVisible(has_visible_children); + } + + // we have to arrange accordion tabs for cases when filter string is less restrictive but + // all items are still filtered. + static LLAccordionCtrl* accordion = getChild<LLAccordionCtrl>("landmarks_accordion"); + accordion->arrange(); + + // now filter state is applied to accordion tabs + mDirtyFilter = false; +} + ////////////////////////////////////////////////////////////////////////// // HELPER FUNCTIONS diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 47c9f7647c..0e7abb4865 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -41,6 +41,7 @@ #include "llpanelpick.h" #include "llremoteparcelrequest.h" +class LLAccordionCtrlTab; class LLFolderViewItem; class LLMenuGL; class LLInventoryPanel; @@ -90,8 +91,8 @@ private: void initListCommandsHandlers(); void updateListCommands(); void onActionsButtonClick(); - void onAddLandmarkButtonClick() const; - void onAddFolderButtonClick() const; + void showActionMenu(LLMenuGL* menu, std::string spawning_view_name); + void onAddButtonHeldDown(); void onTrashButtonClick() const; void onAddAction(const LLSD& command_name) const; void onClipboardAction(const LLSD& command_name) const; @@ -114,6 +115,18 @@ private: */ bool handleDragAndDropToTrash(BOOL drop, EDragAndDropType cargo_type, EAcceptance* accept); + /** + * Static callback for gIdleCallbacks to perform actions out of drawing + */ + static void doIdle(void* landmarks_panel); + + /** + * Updates accordions according to filtered items in lists. + * + * It hides accordion for empty lists + */ + void updateFilteredAccordions(); + private: LLInventorySubTreePanel* mFavoritesInventoryPanel; LLInventorySubTreePanel* mLandmarksInventoryPanel; @@ -121,10 +134,15 @@ private: LLInventorySubTreePanel* mLibraryInventoryPanel; LLMenuGL* mGearLandmarkMenu; LLMenuGL* mGearFolderMenu; + LLMenuGL* mMenuAdd; LLInventorySubTreePanel* mCurrentSelectedList; LLPanel* mListCommands; bool mSortByDate; + bool mDirtyFilter; + + typedef std::vector<LLAccordionCtrlTab*> accordion_tabs_t; + accordion_tabs_t mAccordionTabs; }; #endif //LL_LLPANELLANDMARKS_H diff --git a/indra/newview/llpanelmediasettingsgeneral.cpp b/indra/newview/llpanelmediasettingsgeneral.cpp index f9dde03451..a198499b47 100644 --- a/indra/newview/llpanelmediasettingsgeneral.cpp +++ b/indra/newview/llpanelmediasettingsgeneral.cpp @@ -134,6 +134,11 @@ void LLPanelMediaSettingsGeneral::draw() LLPluginClassMedia* media_plugin = mPreviewMedia->getMediaPlugin();
if( media_plugin )
{
+ // turn off volume (if we can) for preview. Note: this really only
+ // works for QuickTime movies right now - no way to control the
+ // volume of a flash app embedded in a page for example
+ media_plugin->setVolume( 0 );
+
// some controls are only appropriate for time or browser type plugins
// so we selectively enable/disable them - need to do it in draw
// because the information from plugins arrives assynchronously
@@ -207,7 +212,7 @@ void LLPanelMediaSettingsGeneral::clearValues( void* userdata, bool editable) self->mHeightPixels ->setEnabled(editable);
self->mHomeURL ->setEnabled(editable);
self->mWidthPixels ->setEnabled(editable);
- self->mPreviewMedia->unloadMediaSource();
+ self->updateMediaPreview();
}
////////////////////////////////////////////////////////////////////////////////
@@ -312,10 +317,10 @@ void LLPanelMediaSettingsGeneral::updateMediaPreview() mPreviewMedia->navigateTo( mHomeURL->getValue().asString() );
}
else
- // new home URL will be empty if media is deleted but
- // we still need to clean out the preview.
+ // new home URL will be empty if media is deleted so display a
+ // "preview goes here" data url page
{
- mPreviewMedia->unloadMediaSource();
+ mPreviewMedia->navigateTo( "data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%22100%%22 height=%22100%%22 %3E%3Cdefs%3E%3Cpattern id=%22checker%22 patternUnits=%22userSpaceOnUse%22 x=%220%22 y=%220%22 width=%22128%22 height=%22128%22 viewBox=%220 0 128 128%22 %3E%3Crect x=%220%22 y=%220%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3Crect x=%2264%22 y=%2264%22 width=%2264%22 height=%2264%22 fill=%22#ddddff%22 /%3E%3C/pattern%3E%3C/defs%3E%3Crect x=%220%22 y=%220%22 width=%22100%%22 height=%22100%%22 fill=%22url(#checker)%22 /%3E%3C/svg%3E" );
};
}
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index 61d66873ea..4580eeb336 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -413,13 +413,17 @@ BOOL LLPanelPeople::postBuild() mOnlineFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_online"); mAllFriendList = getChild<LLPanel>(FRIENDS_TAB_NAME)->getChild<LLAvatarList>("avatars_all"); mOnlineFriendList->setNoItemsCommentText(getString("no_friends_online")); + mOnlineFriendList->setShowIcons("FriendsListShowIcons"); mAllFriendList->setNoItemsCommentText(getString("no_friends")); + mAllFriendList->setShowIcons("FriendsListShowIcons"); mNearbyList = getChild<LLPanel>(NEARBY_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); mNearbyList->setNoItemsCommentText(getString("no_one_near")); + mNearbyList->setShowIcons("NearbyListShowIcons"); mRecentList = getChild<LLPanel>(RECENT_TAB_NAME)->getChild<LLAvatarList>("avatar_list"); mRecentList->setNoItemsCommentText(getString("no_people")); + mRecentList->setShowIcons("RecentListShowIcons"); mGroupList = getChild<LLGroupList>("group_list"); mGroupList->setNoItemsCommentText(getString("no_groups")); @@ -611,6 +615,10 @@ void LLPanelPeople::updateButtons() bool recent_tab_active = (cur_tab == RECENT_TAB_NAME); LLUUID selected_id; + std::vector<LLUUID> selected_uuids; + getCurrentItemIDs(selected_uuids); + bool item_selected = (selected_uuids.size() == 1); + buttonSetVisible("group_info_btn", group_tab_active); buttonSetVisible("chat_btn", group_tab_active); buttonSetVisible("add_friend_btn", nearby_tab_active || recent_tab_active); @@ -621,7 +629,6 @@ void LLPanelPeople::updateButtons() if (group_tab_active) { - bool item_selected = mGroupList->getSelectedItem() != NULL; bool cur_group_active = true; if (item_selected) @@ -629,7 +636,7 @@ void LLPanelPeople::updateButtons() selected_id = mGroupList->getSelectedUUID(); cur_group_active = (gAgent.getGroupID() == selected_id); } - + 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); @@ -640,18 +647,18 @@ void LLPanelPeople::updateButtons() bool is_friend = true; // Check whether selected avatar is our friend. - if ((selected_id = getCurrentItemID()).notNull()) + if (item_selected) { + selected_id = selected_uuids.front(); is_friend = LLAvatarTracker::instance().getBuddyInfo(selected_id) != NULL; } childSetEnabled("add_friend_btn", !is_friend); } - bool item_selected = selected_id.notNull(); buttonSetEnabled("teleport_btn", friends_tab_active && item_selected); buttonSetEnabled("view_profile_btn", item_selected); - buttonSetEnabled("im_btn", item_selected); + buttonSetEnabled("im_btn", (selected_uuids.size() >= 1)); // allow starting the friends conference for multiple selection buttonSetEnabled("call_btn", item_selected && false); // not implemented yet buttonSetEnabled("share_btn", item_selected && false); // not implemented yet buttonSetEnabled("group_info_btn", item_selected); @@ -877,7 +884,17 @@ void LLPanelPeople::onAddFriendWizButtonClicked() void LLPanelPeople::onDeleteFriendButtonClicked() { - LLAvatarActions::removeFriendDialog(getCurrentItemID()); + std::vector<LLUUID> selected_uuids; + getCurrentItemIDs(selected_uuids); + + if (selected_uuids.size() == 1) + { + LLAvatarActions::removeFriendDialog( selected_uuids.front() ); + } + else if (selected_uuids.size() > 1) + { + LLAvatarActions::removeFriendsDialog( selected_uuids ); + } } void LLPanelPeople::onGroupInfoButtonClicked() @@ -963,6 +980,8 @@ void LLPanelPeople::onFriendsViewSortMenuItemClicked(const LLSD& userdata) } else if (chosen_item == "view_icons") { + mAllFriendList->toggleIcons(); + mOnlineFriendList->toggleIcons(); } else if (chosen_item == "organize_offline") { @@ -992,6 +1011,7 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) } else if (chosen_item == "view_icons") { + mNearbyList->toggleIcons(); } else if (chosen_item == "sort_distance") { @@ -1011,7 +1031,7 @@ void LLPanelPeople::onRecentViewSortMenuItemClicked(const LLSD& userdata) } else if (chosen_item == "view_icons") { - // *TODO: implement showing/hiding icons + mRecentList->toggleIcons(); } } diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index aa6909560d..6181531f82 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -73,10 +73,10 @@ LLPanelPicks::LLPanelPicks() mPopupMenu(NULL), mProfilePanel(NULL), mPickPanel(NULL), - mPicksList(NULL) - , mPanelPickInfo(NULL) - , mPanelPickEdit(NULL) - , mOverflowMenu(NULL) + mPicksList(NULL), + mPanelPickInfo(NULL), + mPanelPickEdit(NULL), + mOverflowMenu(NULL) { } diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index cb9f7184f0..34644cfe42 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -54,7 +54,10 @@ #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentui.h" +#include "llappviewer.h" #include "llavatarpropertiesprocessor.h" +#include "llcallbacklist.h" +#include "llexpandabletextbox.h" #include "llfloaterworldmap.h" #include "llfloaterbuycurrency.h" #include "llinventorymodel.h" @@ -65,6 +68,7 @@ #include "llviewerinventory.h" #include "llviewerparcelmgr.h" #include "llviewerregion.h" +#include "llviewercontrol.h" #include "llviewertexteditor.h" #include "llworldmap.h" #include "llsdutil_math.h" @@ -76,7 +80,6 @@ typedef std::pair<LLUUID, std::string> folder_pair_t; static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right); -static std::string getFullFolderName(const LLViewerInventoryCategory* cat); static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats); static LLRegisterPanelClassWrapper<LLPanelPlaceInfo> t_place_info("panel_place_info"); @@ -111,7 +114,7 @@ BOOL LLPanelPlaceInfo::postBuild() mForSalePanel = getChild<LLPanel>("for_sale_panel"); mYouAreHerePanel = getChild<LLPanel>("here_panel"); - LLViewerParcelMgr::getInstance()->addAgentParcelChangedCallback(boost::bind(&LLPanelPlaceInfo::updateYouAreHereBanner,this)); + gIdleCallbacks.addFunction(&LLPanelPlaceInfo::updateYouAreHereBanner, this); //Icon value should contain sale price of last selected parcel. mForSalePanel->getChild<LLIconCtrl>("icon_for_sale")-> @@ -120,7 +123,7 @@ BOOL LLPanelPlaceInfo::postBuild() mSnapshotCtrl = getChild<LLTextureCtrl>("logo"); mRegionName = getChild<LLTextBox>("region_title"); mParcelName = getChild<LLTextBox>("parcel_title"); - mDescEditor = getChild<LLTextEditor>("description"); + mDescEditor = getChild<LLExpandableTextBox>("description"); mMaturityRatingText = getChild<LLTextBox>("maturity_value"); mParcelOwner = getChild<LLTextBox>("owner_value"); @@ -456,13 +459,13 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) mSnapshotCtrl->setImageAssetID(parcel_data.snapshot_id); } - if(!parcel_data.name.empty()) + if(!parcel_data.sim_name.empty()) { - mParcelName->setText(parcel_data.name); + mRegionName->setText(parcel_data.sim_name); } else { - mParcelName->setText(LLStringUtil::null); + mRegionName->setText(LLStringUtil::null); } if(!parcel_data.desc.empty()) @@ -509,19 +512,22 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) region_z = llround(mPosRegion.mV[VZ]); } - std::string name = getString("not_available"); - if (!parcel_data.sim_name.empty()) + if (!parcel_data.name.empty()) { - name = llformat("%s (%d, %d, %d)", - parcel_data.sim_name.c_str(), region_x, region_y, region_z); - mRegionName->setText(name); + mParcelName->setText(llformat("%s (%d, %d, %d)", + parcel_data.name.c_str(), region_x, region_y, region_z)); + } + else + { + mParcelName->setText(getString("not_available")); } if (mInfoType == CREATE_LANDMARK) { if (parcel_data.name.empty()) { - mTitleEditor->setText(name); + mTitleEditor->setText(llformat("%s (%d, %d, %d)", + parcel_data.sim_name.c_str(), region_x, region_y, region_z)); } else { @@ -610,6 +616,9 @@ void LLPanelPlaceInfo::displaySelectedParcelInfo(LLParcel* parcel, parcel_data.name = parcel->getName(); parcel_data.sim_name = region->getName(); parcel_data.snapshot_id = parcel->getSnapshotID(); + mPosRegion.setVec((F32)fmod(pos_global.mdV[VX], (F64)REGION_WIDTH_METERS), + (F32)fmod(pos_global.mdV[VY], (F64)REGION_WIDTH_METERS), + (F32)pos_global.mdV[VZ]); parcel_data.global_x = pos_global.mdV[VX]; parcel_data.global_y = pos_global.mdV[VY]; parcel_data.global_z = pos_global.mdV[VZ]; @@ -986,18 +995,24 @@ void LLPanelPlaceInfo::populateFoldersList() mFolderCombo->add(it->second, LLSD(it->first)); } -void LLPanelPlaceInfo::updateYouAreHereBanner() +//static +void LLPanelPlaceInfo::updateYouAreHereBanner(void* userdata) { //YouAreHere Banner should be displayed only for selected places, // If you want to display it for landmark or teleport history item, you should check by mParcelId - bool is_you_are_here = false; - if (mSelectedParcelID != S32(-1) && !mLastSelectedRegionID.isNull()) + LLPanelPlaceInfo* self = static_cast<LLPanelPlaceInfo*>(userdata); + if(!self->getVisible()) + return; + if(!gDisconnected) { - is_you_are_here = gAgent.getRegion()->getRegionID()== mLastSelectedRegionID && - mSelectedParcelID == LLViewerParcelMgr::getInstance()->getAgentParcel()->getLocalID(); + static F32 radius = gSavedSettings.getF32("YouAreHereDistance"); + + BOOL display_banner = gAgent.getRegion()->getRegionID() == self->mLastSelectedRegionID && + LLAgentUI::checkAgentDistance(self->mPosRegion, radius); + + self->mYouAreHerePanel->setVisible(display_banner); } - mYouAreHerePanel->setVisible(is_you_are_here); } void LLPanelPlaceInfo::onForSaleBannerClick() @@ -1028,14 +1043,9 @@ void LLPanelPlaceInfo::onForSaleBannerClick() } - -static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right) -{ - return left.second < right.second; -} - -static std::string getFullFolderName(const LLViewerInventoryCategory* cat) +/*static*/ +std::string LLPanelPlaceInfo::getFullFolderName(const LLViewerInventoryCategory* cat) { std::string name = cat->getName(); LLUUID parent_id; @@ -1057,6 +1067,11 @@ static std::string getFullFolderName(const LLViewerInventoryCategory* cat) return name; } +static bool cmp_folders(const folder_pair_t& left, const folder_pair_t& right) +{ + return left.second < right.second; +} + static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats) { LLUUID landmarks_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index 7b3a8f050b..07a2434d59 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -43,6 +43,7 @@ class LLButton; class LLComboBox; +class LLExpandableTextBox; class LLInventoryItem; class LLLineEditor; class LLPanelPickEdit; @@ -52,6 +53,7 @@ class LLTextBox; class LLTextEditor; class LLTextureCtrl; class LLViewerRegion; +class LLViewerInventoryCategory; class LLPanelPlaceInfo : public LLPanel, LLRemoteParcelInfoObserver { @@ -131,11 +133,13 @@ public: /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); /*virtual*/ void handleVisibilityChange (BOOL new_visibility); + + static std::string getFullFolderName(const LLViewerInventoryCategory* cat); private: void populateFoldersList(); - void updateYouAreHereBanner(); + static void updateYouAreHereBanner(void*);// added to gIdleCallbacks void onForSaleBannerClick(); /** @@ -161,7 +165,7 @@ private: LLTextureCtrl* mSnapshotCtrl; LLTextBox* mRegionName; LLTextBox* mParcelName; - LLTextEditor* mDescEditor; + LLExpandableTextBox*mDescEditor; LLTextBox* mMaturityRatingText; LLTextBox* mParcelOwner; LLTextBox* mLastVisited; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 5ab823b6e5..b2e9110e96 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -351,7 +351,16 @@ void LLPanelPlaces::setItem(LLInventoryItem* item) if (is_landmark_editable) { - mPlaceInfo->setLandmarkFolder(mItem->getParentUUID()); + if(!mPlaceInfo->setLandmarkFolder(mItem->getParentUUID()) && !mItem->getParentUUID().isNull()) + { + const LLViewerInventoryCategory* cat = gInventory.getCategory(mItem->getParentUUID()); + if(cat) + { + std::string cat_fullname = LLPanelPlaceInfo::getFullFolderName(cat); + LLComboBox* folderList = mPlaceInfo->getChild<LLComboBox>("folder_combo"); + folderList->add(cat_fullname, cat->getUUID(),ADD_TOP); + } + } } mPlaceInfo->displayItemInfo(mItem); diff --git a/indra/newview/llpanelprimmediacontrols.cpp b/indra/newview/llpanelprimmediacontrols.cpp new file mode 100644 index 0000000000..e4b32c4820 --- /dev/null +++ b/indra/newview/llpanelprimmediacontrols.cpp @@ -0,0 +1,1102 @@ +/** + * @file llpanelprimmediacontrols.cpp + * @brief media controls popup panel + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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" + +//LLPanelPrimMediaControls +#include "llagent.h" +#include "llparcel.h" +#include "llpanel.h" +#include "llselectmgr.h" +#include "llmediaentry.h" +#include "llrender.h" +#include "lldrawable.h" +#include "llviewerwindow.h" +#include "lluictrlfactory.h" +#include "llbutton.h" +#include "llface.h" +#include "llcombobox.h" +#include "llslider.h" +#include "llhudview.h" +#include "lliconctrl.h" +#include "lltoolpie.h" +#include "llviewercamera.h" +#include "llviewerobjectlist.h" +#include "llpanelprimmediacontrols.h" +#include "llpluginclassmedia.h" +#include "llprogressbar.h" +#include "llviewercontrol.h" +#include "llviewerparcelmgr.h" +#include "llviewermedia.h" +#include "llviewermediafocus.h" +#include "llvovolume.h" +#include "llweb.h" +#include "llwindow.h" + +glh::matrix4f glh_get_current_modelview(); +glh::matrix4f glh_get_current_projection(); + +const F32 ZOOM_NEAR_PADDING = 1.0f; +const F32 ZOOM_MEDIUM_PADDING = 1.15f; +const F32 ZOOM_FAR_PADDING = 1.5f; + +// Warning: make sure these two match! +const LLPanelPrimMediaControls::EZoomLevel LLPanelPrimMediaControls::kZoomLevels[] = { ZOOM_NONE, ZOOM_MEDIUM }; +const int LLPanelPrimMediaControls::kNumZoomLevels = 2; + +// +// LLPanelPrimMediaControls +// + +LLPanelPrimMediaControls::LLPanelPrimMediaControls() : + mAlpha(1.f), + mCurrentURL(""), + mPreviousURL(""), + mPauseFadeout(false), + mUpdateSlider(true), + mClearFaceOnFade(false), + mCurrentRate(0.0), + mMovieDuration(0.0), + mUpdatePercent(0) +{ + mCommitCallbackRegistrar.add("MediaCtrl.Close", boost::bind(&LLPanelPrimMediaControls::onClickClose, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Back", boost::bind(&LLPanelPrimMediaControls::onClickBack, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Forward", boost::bind(&LLPanelPrimMediaControls::onClickForward, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Home", boost::bind(&LLPanelPrimMediaControls::onClickHome, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Stop", boost::bind(&LLPanelPrimMediaControls::onClickStop, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Reload", boost::bind(&LLPanelPrimMediaControls::onClickReload, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Play", boost::bind(&LLPanelPrimMediaControls::onClickPlay, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Pause", boost::bind(&LLPanelPrimMediaControls::onClickPause, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Open", boost::bind(&LLPanelPrimMediaControls::onClickOpen, this)); + mCommitCallbackRegistrar.add("MediaCtrl.Zoom", boost::bind(&LLPanelPrimMediaControls::onClickZoom, this)); + mCommitCallbackRegistrar.add("MediaCtrl.CommitURL", boost::bind(&LLPanelPrimMediaControls::onCommitURL, this)); + mCommitCallbackRegistrar.add("MediaCtrl.JumpProgress", boost::bind(&LLPanelPrimMediaControls::onCommitSlider, this)); + mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeUp", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeUp, this)); + mCommitCallbackRegistrar.add("MediaCtrl.CommitVolumeDown", boost::bind(&LLPanelPrimMediaControls::onCommitVolumeDown, this)); + mCommitCallbackRegistrar.add("MediaCtrl.ToggleMute", boost::bind(&LLPanelPrimMediaControls::onToggleMute, this)); + + LLUICtrlFactory::getInstance()->buildPanel(this, "panel_prim_media_controls.xml"); + mInactivityTimer.reset(); + mFadeTimer.stop(); + mCurrentZoom = ZOOM_NONE; + mScrollState = SCROLL_NONE; + + mPanelHandle.bind(this); +} +LLPanelPrimMediaControls::~LLPanelPrimMediaControls() +{ +} + +BOOL LLPanelPrimMediaControls::postBuild() +{ + LLButton* scroll_up_ctrl = getChild<LLButton>("scrollup"); + scroll_up_ctrl->setClickedCallback(onScrollUp, this); + scroll_up_ctrl->setHeldDownCallback(onScrollUpHeld, this); + scroll_up_ctrl->setMouseUpCallback(onScrollStop, this); + LLButton* scroll_left_ctrl = getChild<LLButton>("scrollleft"); + scroll_left_ctrl->setClickedCallback(onScrollLeft, this); + scroll_left_ctrl->setHeldDownCallback(onScrollLeftHeld, this); + scroll_left_ctrl->setMouseUpCallback(onScrollStop, this); + LLButton* scroll_right_ctrl = getChild<LLButton>("scrollright"); + scroll_right_ctrl->setClickedCallback(onScrollRight, this); + scroll_right_ctrl->setHeldDownCallback(onScrollRightHeld, this); + scroll_right_ctrl->setMouseUpCallback(onScrollStop, this); + LLButton* scroll_down_ctrl = getChild<LLButton>("scrolldown"); + scroll_down_ctrl->setClickedCallback(onScrollDown, this); + scroll_down_ctrl->setHeldDownCallback(onScrollDownHeld, this); + scroll_down_ctrl->setMouseUpCallback(onScrollStop, this); + + LLUICtrl* media_address = getChild<LLUICtrl>("media_address"); + media_address->setFocusReceivedCallback(boost::bind(&LLPanelPrimMediaControls::onInputURL, _1, this )); + mInactiveTimeout = gSavedSettings.getF32("MediaControlTimeout"); + mControlFadeTime = gSavedSettings.getF32("MediaControlFadeTime"); + + mCurrentZoom = ZOOM_NONE; + // clicks on HUD buttons do not remove keyboard focus from media + setIsChrome(TRUE); + return TRUE; +} + +void LLPanelPrimMediaControls::setMediaFace(LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal) +{ + if (media_impl.notNull() && objectp.notNull()) + { + mTargetImplID = media_impl->getMediaTextureID(); + mTargetObjectID = objectp->getID(); + mTargetObjectFace = face; + mTargetObjectNormal = pick_normal; + mClearFaceOnFade = false; + } + else + { + // This happens on a timer now. +// mTargetImplID = LLUUID::null; +// mTargetObjectID = LLUUID::null; +// mTargetObjectFace = 0; + mClearFaceOnFade = true; + } + + updateShape(); +} + +void LLPanelPrimMediaControls::focusOnTarget() +{ + // Sets the media focus to the current target of the LLPanelPrimMediaControls. + // This is how we transition from hover to focus when the user clicks on a control. + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if(media_impl) + { + if(!media_impl->hasFocus()) + { + // The current target doesn't have media focus -- focus on it. + LLViewerObject* objectp = getTargetObject(); + LLViewerMediaFocus::getInstance()->setFocusFace(objectp, mTargetObjectFace, media_impl, mTargetObjectNormal); + } + } +} + +LLViewerMediaImpl* LLPanelPrimMediaControls::getTargetMediaImpl() +{ + return LLViewerMedia::getMediaImplFromTextureID(mTargetImplID); +} + +LLViewerObject* LLPanelPrimMediaControls::getTargetObject() +{ + return gObjectList.findObject(mTargetObjectID); +} + +LLPluginClassMedia* LLPanelPrimMediaControls::getTargetMediaPlugin() +{ + LLViewerMediaImpl* impl = getTargetMediaImpl(); + if(impl && impl->hasMedia()) + { + return impl->getMediaPlugin(); + } + + return NULL; +} + +void LLPanelPrimMediaControls::updateShape() +{ + const S32 MIN_HUD_WIDTH=400; + const S32 MIN_HUD_HEIGHT=120; + + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + LLViewerObject* objectp = getTargetObject(); + + if(!media_impl) + { + setVisible(FALSE); + return; + } + + LLPluginClassMedia* media_plugin = NULL; + if(media_impl->hasMedia()) + { + media_plugin = media_impl->getMediaPlugin(); + } + + LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + bool can_navigate = parcel->getMediaAllowNavigate(); + bool enabled = false; + bool has_focus = media_impl->hasFocus(); + setVisible(enabled); + + if (objectp) + { + bool mini_controls = false; + LLMediaEntry *media_data = objectp->getTE(mTargetObjectFace)->getMediaData(); + if (media_data && NULL != dynamic_cast<LLVOVolume*>(objectp)) + { + // Don't show the media HUD if we do not have permissions + enabled = dynamic_cast<LLVOVolume*>(objectp)->hasMediaPermission(media_data, LLVOVolume::MEDIA_PERM_CONTROL); + mini_controls = (LLMediaEntry::MINI == media_data->getControls()); + } + + // + // Set the state of the buttons + // + LLUICtrl* back_ctrl = getChild<LLUICtrl>("back"); + LLUICtrl* fwd_ctrl = getChild<LLUICtrl>("fwd"); + LLUICtrl* reload_ctrl = getChild<LLUICtrl>("reload"); + LLUICtrl* play_ctrl = getChild<LLUICtrl>("play"); + LLUICtrl* pause_ctrl = getChild<LLUICtrl>("pause"); + LLUICtrl* stop_ctrl = getChild<LLUICtrl>("stop"); + LLUICtrl* media_stop_ctrl = getChild<LLUICtrl>("media_stop"); + LLUICtrl* home_ctrl = getChild<LLUICtrl>("home"); + LLUICtrl* close_ctrl = getChild<LLUICtrl>("close"); + LLUICtrl* open_ctrl = getChild<LLUICtrl>("new_window"); + LLUICtrl* zoom_ctrl = getChild<LLUICtrl>("zoom_frame"); + LLPanel* media_loading_panel = getChild<LLPanel>("media_progress_indicator"); + LLUICtrl* media_address_ctrl = getChild<LLUICtrl>("media_address"); + LLUICtrl* media_play_slider_panel = getChild<LLUICtrl>("media_play_position"); + LLUICtrl* media_play_slider_ctrl = getChild<LLUICtrl>("media_play_slider"); + LLUICtrl* volume_ctrl = getChild<LLUICtrl>("media_volume"); + LLButton* volume_btn = getChild<LLButton>("media_volume_button"); + LLUICtrl* volume_up_ctrl = getChild<LLUICtrl>("volume_up"); + LLUICtrl* volume_down_ctrl = getChild<LLUICtrl>("volume_down"); + LLIconCtrl* whitelist_icon = getChild<LLIconCtrl>("media_whitelist_flag"); + LLIconCtrl* secure_lock_icon = getChild<LLIconCtrl>("media_secure_lock_flag"); + + LLUICtrl* media_panel_scroll = getChild<LLUICtrl>("media_panel_scroll"); + LLUICtrl* scroll_up_ctrl = getChild<LLUICtrl>("scrollup"); + LLUICtrl* scroll_left_ctrl = getChild<LLUICtrl>("scrollleft"); + LLUICtrl* scroll_right_ctrl = getChild<LLUICtrl>("scrollright"); + LLUICtrl* scroll_down_ctrl = getChild<LLUICtrl>("scrolldown"); + + // XXX RSP: TODO: FIXME: clean this up so that it is clearer what mode we are in, + // and that only the proper controls get made visible/enabled according to that mode. + back_ctrl->setVisible(has_focus); + fwd_ctrl->setVisible(has_focus); + reload_ctrl->setVisible(has_focus); + stop_ctrl->setVisible(false); + home_ctrl->setVisible(has_focus); + close_ctrl->setVisible(has_focus); + open_ctrl->setVisible(true); + media_address_ctrl->setVisible(has_focus && !mini_controls); + media_play_slider_panel->setVisible(has_focus && !mini_controls); + volume_ctrl->setVisible(false); + volume_up_ctrl->setVisible(false); + volume_down_ctrl->setVisible(false); + + whitelist_icon->setVisible(!mini_controls && (media_data)?media_data->getWhiteListEnable():false); + // Disable zoom if HUD + zoom_ctrl->setEnabled(!objectp->isHUDAttachment()); + secure_lock_icon->setVisible(false); + mCurrentURL = media_impl->getCurrentMediaURL(); + + back_ctrl->setEnabled((media_impl != NULL) && media_impl->canNavigateBack() && can_navigate); + fwd_ctrl->setEnabled((media_impl != NULL) && media_impl->canNavigateForward() && can_navigate); + stop_ctrl->setEnabled(has_focus && can_navigate); + home_ctrl->setEnabled(has_focus && can_navigate); + LLPluginClassMediaOwner::EMediaStatus result = ((media_impl != NULL) && media_impl->hasMedia()) ? media_plugin->getStatus() : LLPluginClassMediaOwner::MEDIA_NONE; + + if(media_plugin && media_plugin->pluginSupportsMediaTime()) + { + reload_ctrl->setEnabled(FALSE); + reload_ctrl->setVisible(FALSE); + media_stop_ctrl->setVisible(has_focus); + home_ctrl->setVisible(FALSE); + back_ctrl->setEnabled(has_focus); + fwd_ctrl->setEnabled(has_focus); + media_address_ctrl->setVisible(false); + media_address_ctrl->setEnabled(false); + media_play_slider_panel->setVisible(!mini_controls); + media_play_slider_panel->setEnabled(!mini_controls); + + volume_ctrl->setVisible(has_focus); + volume_up_ctrl->setVisible(has_focus); + volume_down_ctrl->setVisible(has_focus); + volume_ctrl->setEnabled(has_focus); + + whitelist_icon->setVisible(false); + secure_lock_icon->setVisible(false); + scroll_up_ctrl->setVisible(false); + scroll_left_ctrl->setVisible(false); + scroll_right_ctrl->setVisible(false); + scroll_down_ctrl->setVisible(false); + media_panel_scroll->setVisible(false); + + F32 volume = media_impl->getVolume(); + // movie's url changed + if(mCurrentURL!=mPreviousURL) + { + mMovieDuration = media_plugin->getDuration(); + mPreviousURL = mCurrentURL; + } + + if(mMovieDuration == 0) + { + mMovieDuration = media_plugin->getDuration(); + media_play_slider_ctrl->setValue(0); + media_play_slider_ctrl->setEnabled(false); + } + // TODO: What if it's not fully loaded + + if(mUpdateSlider && mMovieDuration!= 0) + { + F64 current_time = media_plugin->getCurrentTime(); + F32 percent = current_time / mMovieDuration; + media_play_slider_ctrl->setValue(percent); + media_play_slider_ctrl->setEnabled(true); + } + + // video vloume + if(volume <= 0.0) + { + volume_up_ctrl->setEnabled(TRUE); + volume_down_ctrl->setEnabled(FALSE); + media_impl->setVolume(0.0); + volume_btn->setToggleState(true); + } + else if (volume >= 1.0) + { + volume_up_ctrl->setEnabled(FALSE); + volume_down_ctrl->setEnabled(TRUE); + media_impl->setVolume(1.0); + volume_btn->setToggleState(false); + } + else + { + volume_up_ctrl->setEnabled(TRUE); + volume_down_ctrl->setEnabled(TRUE); + } + + switch(result) + { + case LLPluginClassMediaOwner::MEDIA_PLAYING: + play_ctrl->setEnabled(FALSE); + play_ctrl->setVisible(FALSE); + pause_ctrl->setEnabled(TRUE); + pause_ctrl->setVisible(has_focus); + media_stop_ctrl->setEnabled(TRUE); + + break; + case LLPluginClassMediaOwner::MEDIA_PAUSED: + default: + pause_ctrl->setEnabled(FALSE); + pause_ctrl->setVisible(FALSE); + play_ctrl->setEnabled(TRUE); + play_ctrl->setVisible(has_focus); + media_stop_ctrl->setEnabled(FALSE); + break; + } + } + else // web based + { + if(media_plugin) + { + mCurrentURL = media_plugin->getLocation(); + } + else + { + mCurrentURL.clear(); + } + + play_ctrl->setVisible(FALSE); + pause_ctrl->setVisible(FALSE); + media_stop_ctrl->setVisible(FALSE); + media_address_ctrl->setVisible(has_focus && !mini_controls); + media_address_ctrl->setEnabled(has_focus && !mini_controls); + media_play_slider_panel->setVisible(FALSE); + media_play_slider_panel->setEnabled(FALSE); + + volume_ctrl->setVisible(FALSE); + volume_up_ctrl->setVisible(FALSE); + volume_down_ctrl->setVisible(FALSE); + volume_ctrl->setEnabled(FALSE); + volume_up_ctrl->setEnabled(FALSE); + volume_down_ctrl->setEnabled(FALSE); + + scroll_up_ctrl->setVisible(has_focus); + scroll_left_ctrl->setVisible(has_focus); + scroll_right_ctrl->setVisible(has_focus); + scroll_down_ctrl->setVisible(has_focus); + media_panel_scroll->setVisible(has_focus); + // TODO: get the secure lock bool from media plug in + std::string prefix = std::string("https://"); + std::string test_prefix = mCurrentURL.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + if(test_prefix == prefix) + { + secure_lock_icon->setVisible(has_focus); + } + + if(mCurrentURL!=mPreviousURL) + { + setCurrentURL(); + mPreviousURL = mCurrentURL; + } + + if(result == LLPluginClassMediaOwner::MEDIA_LOADING) + { + reload_ctrl->setEnabled(FALSE); + reload_ctrl->setVisible(FALSE); + stop_ctrl->setEnabled(TRUE); + stop_ctrl->setVisible(has_focus); + } + else + { + reload_ctrl->setEnabled(TRUE); + reload_ctrl->setVisible(has_focus); + stop_ctrl->setEnabled(FALSE); + stop_ctrl->setVisible(FALSE); + } + } + + + if(media_plugin) + { + // + // Handle progress bar + // + mUpdatePercent = media_plugin->getProgressPercent(); + if(mUpdatePercent<100.0f) + { + media_loading_panel->setVisible(true); + getChild<LLProgressBar>("media_progress_bar")->setPercent(mUpdatePercent); + gFocusMgr.setTopCtrl(media_loading_panel); + } + else + { + media_loading_panel->setVisible(false); + gFocusMgr.setTopCtrl(NULL); + } + } + + if(media_impl) + { + // + // Handle Scrolling + // + switch (mScrollState) + { + case SCROLL_UP: + media_impl->scrollWheel(0, -1, MASK_NONE); + break; + case SCROLL_DOWN: + media_impl->scrollWheel(0, 1, MASK_NONE); + break; + case SCROLL_LEFT: + media_impl->scrollWheel(1, 0, MASK_NONE); +// media_impl->handleKeyHere(KEY_LEFT, MASK_NONE); + break; + case SCROLL_RIGHT: + media_impl->scrollWheel(-1, 0, MASK_NONE); +// media_impl->handleKeyHere(KEY_RIGHT, MASK_NONE); + break; + case SCROLL_NONE: + default: + break; + } + } + + setVisible(enabled); + + // + // Calculate position and shape of the controls + // + glh::matrix4f mat = glh_get_current_projection()*glh_get_current_modelview(); + std::vector<LLVector3>::iterator vert_it; + std::vector<LLVector3>::iterator vert_end; + std::vector<LLVector3> vect_face; + + LLVolume* volume = objectp->getVolume(); + + if (volume) + { + const LLVolumeFace& vf = volume->getVolumeFace(mTargetObjectFace); + + const LLVector3* ext = vf.mExtents; + + LLVector3 center = (ext[0]+ext[1])*0.5f; + LLVector3 size = (ext[1]-ext[0])*0.5f; + LLVector3 vert[] = + { + center + size.scaledVec(LLVector3(1,1,1)), + center + size.scaledVec(LLVector3(-1,1,1)), + center + size.scaledVec(LLVector3(1,-1,1)), + center + size.scaledVec(LLVector3(-1,-1,1)), + center + size.scaledVec(LLVector3(1,1,-1)), + center + size.scaledVec(LLVector3(-1,1,-1)), + center + size.scaledVec(LLVector3(1,-1,-1)), + center + size.scaledVec(LLVector3(-1,-1,-1)), + }; + + LLVOVolume* vo = (LLVOVolume*) objectp; + + for (U32 i = 0; i < 8; i++) + { + vect_face.push_back(vo->volumePositionToAgent(vert[i])); + } + } + vert_it = vect_face.begin(); + vert_end = vect_face.end(); + + LLVector3 min = LLVector3(1,1,1); + LLVector3 max = LLVector3(-1,-1,-1); + for(; vert_it != vert_end; ++vert_it) + { + // project silhouette vertices into screen space + glh::vec3f screen_vert = glh::vec3f(vert_it->mV); + mat.mult_matrix_vec(screen_vert); + + // add to screenspace bounding box + update_min_max(min, max, LLVector3(screen_vert.v)); + } + + LLCoordGL screen_min; + screen_min.mX = llround((F32)gViewerWindow->getWorldViewWidth() * (min.mV[VX] + 1.f) * 0.5f); + screen_min.mY = llround((F32)gViewerWindow->getWorldViewHeight() * (min.mV[VY] + 1.f) * 0.5f); + + LLCoordGL screen_max; + screen_max.mX = llround((F32)gViewerWindow->getWorldViewWidth() * (max.mV[VX] + 1.f) * 0.5f); + screen_max.mY = llround((F32)gViewerWindow->getWorldViewHeight() * (max.mV[VY] + 1.f) * 0.5f); + + // grow panel so that screenspace bounding box fits inside "media_region" element of HUD + LLRect media_controls_rect; + getParent()->screenRectToLocal(LLRect(screen_min.mX, screen_max.mY, screen_max.mX, screen_min.mY), &media_controls_rect); + LLView* media_region = getChild<LLView>("media_region"); + media_controls_rect.mLeft -= media_region->getRect().mLeft; + media_controls_rect.mBottom -= media_region->getRect().mBottom; + media_controls_rect.mTop += getRect().getHeight() - media_region->getRect().mTop; + media_controls_rect.mRight += getRect().getWidth() - media_region->getRect().mRight; + + LLRect old_hud_rect = media_controls_rect; + // keep all parts of HUD on-screen + media_controls_rect.intersectWith(getParent()->getLocalRect()); + + // clamp to minimum size, keeping centered + media_controls_rect.setCenterAndSize(media_controls_rect.getCenterX(), media_controls_rect.getCenterY(), + llmax(MIN_HUD_WIDTH, media_controls_rect.getWidth()), llmax(MIN_HUD_HEIGHT, media_controls_rect.getHeight())); + + setShape(media_controls_rect, true); + + // Test mouse position to see if the cursor is stationary + LLCoordWindow cursor_pos_window; + getWindow()->getCursorPosition(&cursor_pos_window); + + // If last pos is not equal to current pos, the mouse has moved + // We need to reset the timer, and make sure the panel is visible + if(cursor_pos_window.mX != mLastCursorPos.mX || + cursor_pos_window.mY != mLastCursorPos.mY || + mScrollState != SCROLL_NONE) + { + mInactivityTimer.start(); + mLastCursorPos = cursor_pos_window; + } + + if(isMouseOver() || hasFocus()) + { + // Never fade the controls if the mouse is over them or they have keyboard focus. + mFadeTimer.stop(); + } + else if(!mClearFaceOnFade && (mInactivityTimer.getElapsedTimeF32() < mInactiveTimeout)) + { + // Mouse is over the object, but has not been stationary for long enough to fade the UI + mFadeTimer.stop(); + } + else if(! mFadeTimer.getStarted() ) + { + // we need to start fading the UI (and we have not already started) + mFadeTimer.reset(); + mFadeTimer.start(); + } + else + { + // I don't think this is correct anymore. This is done in draw() after the fade has completed. +// setVisible(FALSE); + } + } +} + +/*virtual*/ +void LLPanelPrimMediaControls::draw() +{ + F32 alpha = 1.f; + if(mFadeTimer.getStarted()) + { + F32 time = mFadeTimer.getElapsedTimeF32(); + alpha = llmax(lerp(1.0, 0.0, time / mControlFadeTime), 0.0f); + + if(mFadeTimer.getElapsedTimeF32() >= mControlFadeTime) + { + if(mClearFaceOnFade) + { + // Hiding this object makes scroll events go missing after it fades out + // (see DEV-41755 for a full description of the train wreck). + // Only hide the controls when we're untargeting. + setVisible(FALSE); + + mClearFaceOnFade = false; + mTargetImplID = LLUUID::null; + mTargetObjectID = LLUUID::null; + mTargetObjectFace = 0; + } + } + } + + { + LLViewDrawContext context(alpha); + LLPanel::draw(); + } +} + +BOOL LLPanelPrimMediaControls::handleScrollWheel(S32 x, S32 y, S32 clicks) +{ + mInactivityTimer.start(); + return LLViewerMediaFocus::getInstance()->handleScrollWheel(x, y, clicks); +} + +BOOL LLPanelPrimMediaControls::handleMouseDown(S32 x, S32 y, MASK mask) +{ + mInactivityTimer.start(); + return LLPanel::handleMouseDown(x, y, mask); +} + +BOOL LLPanelPrimMediaControls::handleMouseUp(S32 x, S32 y, MASK mask) +{ + mInactivityTimer.start(); + return LLPanel::handleMouseUp(x, y, mask); +} + +BOOL LLPanelPrimMediaControls::handleKeyHere( KEY key, MASK mask ) +{ + mInactivityTimer.start(); + return LLPanel::handleKeyHere(key, mask); +} + +bool LLPanelPrimMediaControls::isMouseOver() +{ + bool result = false; + + if( getVisible() ) + { + LLCoordWindow cursor_pos_window; + LLCoordScreen cursor_pos_screen; + LLCoordGL cursor_pos_gl; + S32 x, y; + getWindow()->getCursorPosition(&cursor_pos_window); + getWindow()->convertCoords(cursor_pos_window, &cursor_pos_gl); + + LLPanel* controls_panel = NULL; + controls_panel = getChild<LLPanel>("media_hover_controls"); + if(controls_panel && !controls_panel->getVisible()) + { + // The hover controls aren't visible -- use the focused controls instead. + controls_panel = getChild<LLPanel>("media_focused_controls"); + } + + if(controls_panel && controls_panel->getVisible()) + { + controls_panel->screenPointToLocal(cursor_pos_gl.mX, cursor_pos_gl.mY, &x, &y); + + LLView *hit_child = controls_panel->childFromPoint(x, y); + if(hit_child) + { + // This was useful for debugging both coordinate translation and view hieararchy problems... +// llinfos << "mouse coords: " << x << ", " << y << " hit child " << hit_child->getName() << llendl; + result = true; + } + } + } + + return result; +} + + +void LLPanelPrimMediaControls::onClickClose() +{ + close(); +} + +void LLPanelPrimMediaControls::close() +{ + LLViewerMediaFocus::getInstance()->clearFocus(); + resetZoomLevel(); + setVisible(FALSE); +} + + +void LLPanelPrimMediaControls::onClickBack() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl =getTargetMediaImpl(); + + if (impl) + { + impl->navigateBack(); + } +} + +void LLPanelPrimMediaControls::onClickForward() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if (impl) + { + impl->navigateForward(); + } +} + +void LLPanelPrimMediaControls::onClickHome() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if(impl) + { + impl->navigateHome(); + } +} + +void LLPanelPrimMediaControls::onClickOpen() +{ + LLViewerMediaImpl* impl = getTargetMediaImpl(); + if(impl) + { + LLWeb::loadURL(impl->getCurrentMediaURL()); + } +} + +void LLPanelPrimMediaControls::onClickReload() +{ + focusOnTarget(); + + //LLViewerMedia::navigateHome(); + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if(impl) + { + impl->navigateReload(); + } +} + +void LLPanelPrimMediaControls::onClickPlay() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if(impl) + { + impl->play(); + } +} + +void LLPanelPrimMediaControls::onClickPause() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if(impl) + { + impl->pause(); + } +} + +void LLPanelPrimMediaControls::onClickStop() +{ + focusOnTarget(); + + LLViewerMediaImpl* impl = getTargetMediaImpl(); + + if(impl) + { + impl->stop(); + } +} + +void LLPanelPrimMediaControls::onClickZoom() +{ + focusOnTarget(); + + nextZoomLevel(); +} +void LLPanelPrimMediaControls::nextZoomLevel() +{ + int index = 0; + while (index < kNumZoomLevels) + { + if (kZoomLevels[index] == mCurrentZoom) + { + index++; + break; + } + index++; + } + mCurrentZoom = kZoomLevels[index % kNumZoomLevels]; + updateZoom(); +} + +void LLPanelPrimMediaControls::resetZoomLevel() +{ + if(mCurrentZoom != ZOOM_NONE) + { + mCurrentZoom = ZOOM_NONE; + updateZoom(); + } +} + +void LLPanelPrimMediaControls::updateZoom() +{ + F32 zoom_padding = 0.0f; + switch (mCurrentZoom) + { + case ZOOM_NONE: + { + gAgent.setFocusOnAvatar(TRUE, ANIMATE); + break; + } + case ZOOM_FAR: + { + zoom_padding = ZOOM_FAR_PADDING; + break; + } + case ZOOM_MEDIUM: + { + zoom_padding = ZOOM_MEDIUM_PADDING; + break; + } + case ZOOM_NEAR: + { + zoom_padding = ZOOM_NEAR_PADDING; + break; + } + default: + { + gAgent.setFocusOnAvatar(TRUE, ANIMATE); + break; + } + } + + if (zoom_padding > 0.0f) + LLViewerMediaFocus::setCameraZoom(getTargetObject(), mTargetObjectNormal, zoom_padding); +} +void LLPanelPrimMediaControls::onScrollUp(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->focusOnTarget(); + + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); + + if(impl) + { + impl->scrollWheel(0, -1, MASK_NONE); + } +} +void LLPanelPrimMediaControls::onScrollUpHeld(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->mScrollState = SCROLL_UP; +} +void LLPanelPrimMediaControls::onScrollRight(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->focusOnTarget(); + + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); + + if(impl) + { + impl->scrollWheel(-1, 0, MASK_NONE); +// impl->handleKeyHere(KEY_RIGHT, MASK_NONE); + } +} +void LLPanelPrimMediaControls::onScrollRightHeld(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->mScrollState = SCROLL_RIGHT; +} + +void LLPanelPrimMediaControls::onScrollLeft(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->focusOnTarget(); + + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); + + if(impl) + { + impl->scrollWheel(1, 0, MASK_NONE); +// impl->handleKeyHere(KEY_LEFT, MASK_NONE); + } +} +void LLPanelPrimMediaControls::onScrollLeftHeld(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->mScrollState = SCROLL_LEFT; +} + +void LLPanelPrimMediaControls::onScrollDown(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->focusOnTarget(); + + LLViewerMediaImpl* impl = this_panel->getTargetMediaImpl(); + + if(impl) + { + impl->scrollWheel(0, 1, MASK_NONE); + } +} +void LLPanelPrimMediaControls::onScrollDownHeld(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->mScrollState = SCROLL_DOWN; +} + +void LLPanelPrimMediaControls::onScrollStop(void* user_data) +{ + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (user_data); + this_panel->mScrollState = SCROLL_NONE; +} + +void LLPanelPrimMediaControls::onCommitURL() +{ + focusOnTarget(); + + LLUICtrl *media_address_ctrl = getChild<LLUICtrl>("media_address_url"); + std::string url = media_address_ctrl->getValue().asString(); + if(getTargetMediaImpl() && !url.empty()) + { + getTargetMediaImpl()->navigateTo( url, "", true); + + // Make sure keyboard focus is set to the media focus object. + gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance()); + + } + mPauseFadeout = false; + mFadeTimer.start(); +} + + +void LLPanelPrimMediaControls::onInputURL(LLFocusableElement* caller, void *userdata) +{ + + LLPanelPrimMediaControls* this_panel = static_cast<LLPanelPrimMediaControls*> (userdata); + this_panel->focusOnTarget(); + + this_panel->mPauseFadeout = true; + this_panel->mFadeTimer.stop(); + this_panel->mFadeTimer.reset(); + +} + +void LLPanelPrimMediaControls::setCurrentURL() +{ +#ifdef USE_COMBO_BOX_FOR_MEDIA_URL + LLComboBox* media_address_combo = getChild<LLComboBox>("media_address_combo"); + // redirects will navigate momentarily to about:blank, don't add to history + if (media_address_combo && mCurrentURL != "about:blank") + { + media_address_combo->remove(mCurrentURL); + media_address_combo->add(mCurrentURL, ADD_SORTED); + media_address_combo->selectByValue(mCurrentURL); + } +#else // USE_COMBO_BOX_FOR_MEDIA_URL + LLLineEditor* media_address_url = getChild<LLLineEditor>("media_address_url"); + if (media_address_url && mCurrentURL != "about:blank") + { + media_address_url->setValue(mCurrentURL); + } +#endif // USE_COMBO_BOX_FOR_MEDIA_URL +} + +void LLPanelPrimMediaControls::onCommitSlider() +{ + focusOnTarget(); + + LLSlider* media_play_slider_ctrl = getChild<LLSlider>("media_play_slider"); + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if (media_impl) + { + // get slider value + F64 slider_value = media_play_slider_ctrl->getValue().asReal(); + if(slider_value <= 0.0) + { + media_impl->stop(); + } + else + { + media_impl->seek(slider_value*mMovieDuration); + //mUpdateSlider= false; + } + } +} + +void LLPanelPrimMediaControls::onCommitVolumeUp() +{ + focusOnTarget(); + + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if (media_impl) + { + F32 volume = media_impl->getVolume(); + + volume += 0.1f; + if(volume >= 1.0f) + { + volume = 1.0f; + } + + media_impl->setVolume(volume); + getChild<LLButton>("media_volume")->setToggleState(false); + } +} + +void LLPanelPrimMediaControls::onCommitVolumeDown() +{ + focusOnTarget(); + + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if (media_impl) + { + F32 volume = media_impl->getVolume(); + + volume -= 0.1f; + if(volume <= 0.0f) + { + volume = 0.0f; + } + + media_impl->setVolume(volume); + getChild<LLButton>("media_volume")->setToggleState(false); + } +} + + +void LLPanelPrimMediaControls::onToggleMute() +{ + focusOnTarget(); + + LLViewerMediaImpl* media_impl = getTargetMediaImpl(); + if (media_impl) + { + F32 volume = media_impl->getVolume(); + + if(volume > 0.0) + { + media_impl->setVolume(0.0); + } + else + { + media_impl->setVolume(0.5); + } + } +} + diff --git a/indra/newview/llpanelprimmediacontrols.h b/indra/newview/llpanelprimmediacontrols.h new file mode 100644 index 0000000000..3ec7aa2356 --- /dev/null +++ b/indra/newview/llpanelprimmediacontrols.h @@ -0,0 +1,148 @@ +/** + * @file llpanelprimmediacontrols.h + * @brief Pop-up media controls panel + * + * $LicenseInfo:firstyear=2003&license=viewergpl$ + * + * Copyright (c) 2003-2007, 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://secondlife.com/developers/opensource/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://secondlife.com/developers/opensource/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_PANELPRIMMEDIACONTROLS_H +#define LL_PANELPRIMMEDIACONTROLS_H + +#include "llpanel.h" +#include "llviewermedia.h" + +class LLCoordWindow; +class LLViewerMediaImpl; + +class LLPanelPrimMediaControls : public LLPanel +{ +public: + LLPanelPrimMediaControls(); + virtual ~LLPanelPrimMediaControls(); + /*virtual*/ BOOL postBuild(); + virtual void draw(); + virtual BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); + + virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); + virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); + virtual BOOL handleKeyHere(KEY key, MASK mask); + + void updateShape(); + bool isMouseOver(); + void nextZoomLevel(); + void resetZoomLevel(); + void close(); + + LLHandle<LLPanelPrimMediaControls> getHandle() const { return mPanelHandle; } + void setMediaFace(LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl, LLVector3 pick_normal = LLVector3::zero); + + + enum EZoomLevel + { + ZOOM_NONE = 0, + ZOOM_FAR, + ZOOM_MEDIUM, + ZOOM_NEAR + }; + static const EZoomLevel kZoomLevels[]; + static const int kNumZoomLevels; + + enum EScrollDir + { + SCROLL_UP = 0, + SCROLL_DOWN, + SCROLL_LEFT, + SCROLL_RIGHT, + SCROLL_NONE + }; + +private: + void onClickClose(); + void onClickBack(); + void onClickForward(); + void onClickHome(); + void onClickOpen(); + void onClickReload(); + void onClickPlay(); + void onClickPause(); + void onClickStop(); + void onClickZoom(); + void onCommitURL(); + + void updateZoom(); + void setCurrentURL(); + void onCommitSlider(); + + void onCommitVolumeUp(); + void onCommitVolumeDown(); + void onToggleMute(); + + static void onScrollUp(void* user_data); + static void onScrollUpHeld(void* user_data); + static void onScrollLeft(void* user_data); + static void onScrollLeftHeld(void* user_data); + static void onScrollRight(void* user_data); + static void onScrollRightHeld(void* user_data); + static void onScrollDown(void* user_data); + static void onScrollDownHeld(void* user_data); + static void onScrollStop(void* user_data); + + static void onInputURL(LLFocusableElement* caller, void *userdata); + static bool hasControlsPermission(LLViewerObject *obj, const LLMediaEntry *media_entry); + + void focusOnTarget(); + + LLViewerMediaImpl* getTargetMediaImpl(); + LLViewerObject* getTargetObject(); + LLPluginClassMedia* getTargetMediaPlugin(); + bool mPauseFadeout; + bool mUpdateSlider; + bool mClearFaceOnFade; + + LLMatrix4 mLastCameraMat; + EZoomLevel mCurrentZoom; + EScrollDir mScrollState; + LLCoordWindow mLastCursorPos; + LLFrameTimer mInactivityTimer; + LLFrameTimer mFadeTimer; + F32 mInactiveTimeout; + F32 mControlFadeTime; + LLRootHandle<LLPanelPrimMediaControls> mPanelHandle; + F32 mAlpha; + std::string mCurrentURL; + std::string mPreviousURL; + F64 mCurrentRate; + F64 mMovieDuration; + int mUpdatePercent; + + LLUUID mTargetObjectID; + S32 mTargetObjectFace; + LLUUID mTargetImplID; + LLVector3 mTargetObjectNormal; +}; + +#endif // LL_PANELPRIMMEDIACONTROLS_H diff --git a/indra/newview/llpanelprofileview.cpp b/indra/newview/llpanelprofileview.cpp index 1d16c4ef5e..d4ab5013f9 100644 --- a/indra/newview/llpanelprofileview.cpp +++ b/indra/newview/llpanelprofileview.cpp @@ -32,10 +32,12 @@ #include "llviewerprecompiledheaders.h" +#include "llavatarconstants.h" #include "lluserrelations.h" #include "llpanelprofileview.h" +#include "llavatarpropertiesprocessor.h" #include "llcallingcard.h" #include "llpanelavatar.h" #include "llpanelpicks.h" @@ -48,14 +50,46 @@ static std::string PANEL_NOTES = "panel_notes"; static const std::string PANEL_PROFILE = "panel_profile"; static const std::string PANEL_PICKS = "panel_picks"; + +class AvatarStatusObserver : public LLAvatarPropertiesObserver +{ +public: + AvatarStatusObserver(LLPanelProfileView* profile_view) + { + mProfileView = profile_view; + } + + void processProperties(void* data, EAvatarProcessorType type) + { + if(APT_PROPERTIES != type) return; + const LLAvatarData* avatar_data = static_cast<const LLAvatarData*>(data); + if(avatar_data && mProfileView->getAvatarId() == avatar_data->avatar_id) + { + mProfileView->processOnlineStatus(avatar_data->flags & AVATAR_ONLINE); + LLAvatarPropertiesProcessor::instance().removeObserver(mProfileView->getAvatarId(), this); + } + } + + void subscribe() + { + LLAvatarPropertiesProcessor::instance().addObserver(mProfileView->getAvatarId(), this); + } + +private: + LLPanelProfileView* mProfileView; +}; + LLPanelProfileView::LLPanelProfileView() : LLPanelProfile() , mStatusText(NULL) +, mAvatarStatusObserver(NULL) { + mAvatarStatusObserver = new AvatarStatusObserver(this); } LLPanelProfileView::~LLPanelProfileView(void) { + delete mAvatarStatusObserver; } /*virtual*/ @@ -66,6 +100,9 @@ void LLPanelProfileView::onOpen(const LLSD& key) { id = key["id"]; } + + // subscribe observer to get online status. Request will be sent by LLPanelAvatarProfile itself + mAvatarStatusObserver->subscribe(); if(id.notNull() && getAvatarId() != id) { setAvatarId(id); @@ -74,10 +111,12 @@ void LLPanelProfileView::onOpen(const LLSD& key) // Update the avatar name. gCacheName->get(getAvatarId(), FALSE, boost::bind(&LLPanelProfileView::onAvatarNameCached, this, _1, _2, _3, _4)); - +/* +// disable this part of code according to EXT-2022. See processOnlineStatus // status should only show if viewer has permission to view online/offline. EXT-453 mStatusText->setVisible(isGrantedToSeeOnlineStatus()); updateOnlineStatus(); +*/ LLPanelProfile::onOpen(key); } @@ -93,6 +132,7 @@ BOOL LLPanelProfileView::postBuild() getTabContainer()[PANEL_PROFILE]->childSetVisible("status_combo", FALSE); mStatusText = getChild<LLTextBox>("status"); + mStatusText->setVisible(false); childSetCommitCallback("back",boost::bind(&LLPanelProfileView::onBackBtnClick,this),NULL); @@ -135,13 +175,18 @@ void LLPanelProfileView::updateOnlineStatus() return; bool online = relationship->isOnline(); -// std::string statusName(); std::string status = getString(online ? "status_online" : "status_offline"); mStatusText->setValue(status); } +void LLPanelProfileView::processOnlineStatus(bool online) +{ + mAvatarIsOnline = online; + mStatusText->setVisible(online); +} + void LLPanelProfileView::onAvatarNameCached(const LLUUID& id, const std::string& first_name, const std::string& last_name, BOOL is_group) { llassert(getAvatarId() == id); @@ -155,7 +200,7 @@ void LLPanelProfileView::togglePanel(LLPanel* panel) { // LLPanelProfile::togglePanel shows/hides all children, // we don't want to display online status for non friends, so re-hide it here - mStatusText->setVisible(isGrantedToSeeOnlineStatus()); + mStatusText->setVisible(mAvatarIsOnline); } } diff --git a/indra/newview/llpanelprofileview.h b/indra/newview/llpanelprofileview.h index 07a6c3a9a0..b59d1d42f3 100644 --- a/indra/newview/llpanelprofileview.h +++ b/indra/newview/llpanelprofileview.h @@ -40,6 +40,7 @@ class LLPanelProfile; class LLPanelProfileTab; class LLTextBox; +class AvatarStatusObserver; /** * Panel for displaying Avatar's profile. It consists of three sub panels - Profile, @@ -49,6 +50,7 @@ class LLPanelProfileView : public LLPanelProfile { LOG_CLASS(LLPanelProfileView); friend class LLUICtrlFactory; + friend class AvatarStatusObserver; public: @@ -65,8 +67,9 @@ public: protected: void onBackBtnClick(); - bool isGrantedToSeeOnlineStatus(); - void updateOnlineStatus(); + bool isGrantedToSeeOnlineStatus(); // deprecated after EXT-2022 is implemented + void updateOnlineStatus(); // deprecated after EXT-2022 is implemented + void processOnlineStatus(bool online); private: // LLCacheName will call this function when avatar name is loaded from server. @@ -78,6 +81,8 @@ private: BOOL is_group); LLTextBox* mStatusText; + AvatarStatusObserver* mAvatarStatusObserver; + bool mAvatarIsOnline; }; #endif //LL_LLPANELPROFILEVIEW_H diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 25e773e8b8..e97eb1df2b 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -34,7 +34,7 @@ #include "llparticipantlist.h" #include "llavatarlist.h" -#include "llfloateractivespeakers.h" +#include "llspeakers.h" //LLParticipantList retrieves add, clear and remove events and updates view accordingly LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list): @@ -48,6 +48,18 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mSpeakerMgr->addListener(mSpeakerAddListener, "add"); mSpeakerMgr->addListener(mSpeakerRemoveListener, "remove"); mSpeakerMgr->addListener(mSpeakerClearListener, "clear"); + + //Lets fill avatarList with existing speakers + LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); + + LLSpeakerMgr::speaker_list_t speaker_list; + mSpeakerMgr->getSpeakerList(&speaker_list, true); + for(LLSpeakerMgr::speaker_list_t::iterator it = speaker_list.begin(); it != speaker_list.end(); it++) + { + group_members.push_back((*it)->mID); + } + mAvatarList->setDirty(); + mAvatarList->sortByName(); } LLParticipantList::~LLParticipantList() @@ -87,8 +99,12 @@ bool LLParticipantList::SpeakerAddListener::handleEvent(LLPointer<LLOldEvents::L bool LLParticipantList::SpeakerRemoveListener::handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata) { LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); - group_members.erase(std::find(group_members.begin(), group_members.end(), event->getValue().asUUID())); - mAvatarList->setDirty(); + LLAvatarList::uuid_vector_t::iterator pos = std::find(group_members.begin(), group_members.end(), event->getValue().asUUID()); + if(pos != group_members.end()) + { + group_members.erase(pos); + mAvatarList->setDirty(); + } return true; } diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 1683d113a9..e4dbcbd219 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -44,7 +44,6 @@ #include "lltrans.h" #include "lldockablefloater.h" -#include "llimpanel.h" #include "llsyswellwindow.h" #include "llimfloater.h" @@ -191,19 +190,22 @@ void LLScreenChannel::onToastFade(LLToast* toast) { std::vector<ToastElem>::iterator it = find(mToastList.begin(), mToastList.end(), static_cast<LLPanel*>(toast)); - bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored(); - if(delete_toast) - { - mToastList.erase(it); - deleteToast(toast); - } - else + if(it != mToastList.end()) { - storeToast((*it)); - mToastList.erase(it); - } + bool delete_toast = !mCanStoreToasts || !toast->getCanBeStored(); + if(delete_toast) + { + mToastList.erase(it); + deleteToast(toast); + } + else + { + storeToast((*it)); + mToastList.erase(it); + } - redrawToasts(); + redrawToasts(); + } } //-------------------------------------------------------------------------- @@ -247,6 +249,7 @@ void LLScreenChannel::loadStoredToastsToChannel() for(it = mStoredToastList.begin(); it != mStoredToastList.end(); ++it) { + (*it).toast->setIsHidden(false); (*it).toast->resetTimer(); mToastList.push_back((*it)); } @@ -266,6 +269,7 @@ void LLScreenChannel::loadStoredToastByNotificationIDToChannel(LLUUID id) mOverflowToastHidden = false; LLToast* toast = (*it).toast; + toast->setIsHidden(false); toast->resetTimer(); mToastList.push_back((*it)); mStoredToastList.erase(it); @@ -519,6 +523,7 @@ void LLScreenChannel::createStartUpToast(S32 notif_num, F32 timer) LLRect toast_rect; LLToast::Params p; p.lifetime_secs = timer; + p.enable_hide_btn = false; mStartUpToastPanel = new LLToast(p); if(!mStartUpToastPanel) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp new file mode 100644 index 0000000000..2341fcfc6d --- /dev/null +++ b/indra/newview/llspeakers.cpp @@ -0,0 +1,639 @@ +/** + * @file llspeakers.cpp + * @brief Management interface for muting and controlling volume of residents currently speaking + * + * $LicenseInfo:firstyear=2005&license=viewergpl$ + * + * Copyright (c) 2005-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" + +#include "llspeakers.h" + +#include "llagent.h" +#include "llappviewer.h" +#include "llmutelist.h" +#include "llsdutil.h" +#include "lluicolortable.h" +#include "llviewerobjectlist.h" +#include "llvoavatar.h" +#include "llworld.h" + +const F32 SPEAKER_TIMEOUT = 10.f; // seconds of not being on voice channel before removed from list of active speakers +const LLColor4 INACTIVE_COLOR(0.3f, 0.3f, 0.3f, 0.5f); +const LLColor4 ACTIVE_COLOR(0.5f, 0.5f, 0.5f, 1.f); + +LLSpeaker::LLSpeaker(const LLUUID& id, const std::string& name, const ESpeakerType type) : + mStatus(LLSpeaker::STATUS_TEXT_ONLY), + mLastSpokeTime(0.f), + mSpeechVolume(0.f), + mHasSpoken(FALSE), + mHasLeftCurrentCall(FALSE), + mDotColor(LLColor4::white), + mID(id), + mTyping(FALSE), + mSortIndex(0), + mType(type), + mIsModerator(FALSE), + mModeratorMutedVoice(FALSE), + mModeratorMutedText(FALSE) +{ + if (name.empty() && type == SPEAKER_AGENT) + { + lookupName(); + } + else + { + mDisplayName = name; + } + + gVoiceClient->setUserVolume(id, LLMuteList::getInstance()->getSavedResidentVolume(id)); + + mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT); +} + + +void LLSpeaker::lookupName() +{ + gCacheName->get(mID, FALSE, boost::bind(&LLSpeaker::onAvatarNameLookup, this, _1, _2, _3, _4)); +} + +void LLSpeaker::onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group) +{ + mDisplayName = first + " " + last; +} + +LLSpeakerTextModerationEvent::LLSpeakerTextModerationEvent(LLSpeaker* source) +: LLEvent(source, "Speaker text moderation event") +{ +} + +LLSD LLSpeakerTextModerationEvent::getValue() +{ + return std::string("text"); +} + + +LLSpeakerVoiceModerationEvent::LLSpeakerVoiceModerationEvent(LLSpeaker* source) +: LLEvent(source, "Speaker voice moderation event") +{ +} + +LLSD LLSpeakerVoiceModerationEvent::getValue() +{ + return std::string("voice"); +} + +LLSpeakerListChangeEvent::LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id) +: LLEvent(source, "Speaker added/removed from speaker mgr"), + mSpeakerID(speaker_id) +{ +} + +LLSD LLSpeakerListChangeEvent::getValue() +{ + return mSpeakerID; +} + +// helper sort class +struct LLSortRecentSpeakers +{ + bool operator()(const LLPointer<LLSpeaker> lhs, const LLPointer<LLSpeaker> rhs) const; +}; + +bool LLSortRecentSpeakers::operator()(const LLPointer<LLSpeaker> lhs, const LLPointer<LLSpeaker> rhs) const +{ + // Sort first on status + if (lhs->mStatus != rhs->mStatus) + { + return (lhs->mStatus < rhs->mStatus); + } + + // and then on last speaking time + if(lhs->mLastSpokeTime != rhs->mLastSpokeTime) + { + return (lhs->mLastSpokeTime > rhs->mLastSpokeTime); + } + + // and finally (only if those are both equal), on name. + return( lhs->mDisplayName.compare(rhs->mDisplayName) < 0 ); +} + + +// +// LLSpeakerMgr +// + +LLSpeakerMgr::LLSpeakerMgr(LLVoiceChannel* channelp) : + mVoiceChannel(channelp) +{ +} + +LLSpeakerMgr::~LLSpeakerMgr() +{ +} + +LLPointer<LLSpeaker> LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::string& name, LLSpeaker::ESpeakerStatus status, LLSpeaker::ESpeakerType type) +{ + if (id.isNull()) return NULL; + + LLPointer<LLSpeaker> speakerp; + if (mSpeakers.find(id) == mSpeakers.end()) + { + speakerp = new LLSpeaker(id, name, type); + speakerp->mStatus = status; + mSpeakers.insert(std::make_pair(speakerp->mID, speakerp)); + mSpeakersSorted.push_back(speakerp); + fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "add"); + } + else + { + speakerp = findSpeaker(id); + if (speakerp.notNull()) + { + // keep highest priority status (lowest value) instead of overriding current value + speakerp->mStatus = llmin(speakerp->mStatus, status); + speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT); + // RN: due to a weird behavior where IMs from attached objects come from the wearer's agent_id + // we need to override speakers that we think are objects when we find out they are really + // residents + if (type == LLSpeaker::SPEAKER_AGENT) + { + speakerp->mType = LLSpeaker::SPEAKER_AGENT; + speakerp->lookupName(); + } + } + } + + return speakerp; +} + +void LLSpeakerMgr::update(BOOL resort_ok) +{ + if (!gVoiceClient) + { + return; + } + + LLColor4 speaking_color = LLUIColorTable::instance().getColor("SpeakingColor"); + LLColor4 overdriven_color = LLUIColorTable::instance().getColor("OverdrivenColor"); + + if(resort_ok) // only allow list changes when user is not interacting with it + { + updateSpeakerList(); + } + + // update status of all current speakers + BOOL voice_channel_active = (!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()); + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end();) + { + LLUUID speaker_id = speaker_it->first; + LLSpeaker* speakerp = speaker_it->second; + + speaker_map_t::iterator cur_speaker_it = speaker_it++; + + if (voice_channel_active && gVoiceClient->getVoiceEnabled(speaker_id)) + { + speakerp->mSpeechVolume = gVoiceClient->getCurrentPower(speaker_id); + BOOL moderator_muted_voice = gVoiceClient->getIsModeratorMuted(speaker_id); + if (moderator_muted_voice != speakerp->mModeratorMutedVoice) + { + speakerp->mModeratorMutedVoice = moderator_muted_voice; + speakerp->fireEvent(new LLSpeakerVoiceModerationEvent(speakerp)); + } + + if (gVoiceClient->getOnMuteList(speaker_id) || speakerp->mModeratorMutedVoice) + { + speakerp->mStatus = LLSpeaker::STATUS_MUTED; + } + else if (gVoiceClient->getIsSpeaking(speaker_id)) + { + // reset inactivity expiration + if (speakerp->mStatus != LLSpeaker::STATUS_SPEAKING) + { + speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); + speakerp->mHasSpoken = TRUE; + } + speakerp->mStatus = LLSpeaker::STATUS_SPEAKING; + // interpolate between active color and full speaking color based on power of speech output + speakerp->mDotColor = speaking_color; + if (speakerp->mSpeechVolume > LLVoiceClient::OVERDRIVEN_POWER_LEVEL) + { + speakerp->mDotColor = overdriven_color; + } + } + else + { + speakerp->mSpeechVolume = 0.f; + speakerp->mDotColor = ACTIVE_COLOR; + + if (speakerp->mHasSpoken) + { + // have spoken once, not currently speaking + speakerp->mStatus = LLSpeaker::STATUS_HAS_SPOKEN; + } + else + { + // default state for being in voice channel + speakerp->mStatus = LLSpeaker::STATUS_VOICE_ACTIVE; + } + } + } + // speaker no longer registered in voice channel, demote to text only + else if (speakerp->mStatus != LLSpeaker::STATUS_NOT_IN_CHANNEL) + { + if(speakerp->mType == LLSpeaker::SPEAKER_EXTERNAL) + { + // external speakers should be timed out when they leave the voice channel (since they only exist via SLVoice) + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + } + else + { + speakerp->mStatus = LLSpeaker::STATUS_TEXT_ONLY; + speakerp->mSpeechVolume = 0.f; + speakerp->mDotColor = ACTIVE_COLOR; + } + } + } + + if(resort_ok) // only allow list changes when user is not interacting with it + { + // sort by status then time last spoken + std::sort(mSpeakersSorted.begin(), mSpeakersSorted.end(), LLSortRecentSpeakers()); + } + + // for recent speakers who are not currently speaking, show "recent" color dot for most recent + // fading to "active" color + + S32 recent_speaker_count = 0; + S32 sort_index = 0; + speaker_list_t::iterator sorted_speaker_it; + for(sorted_speaker_it = mSpeakersSorted.begin(); + sorted_speaker_it != mSpeakersSorted.end(); ) + { + LLPointer<LLSpeaker> speakerp = *sorted_speaker_it; + + // color code recent speakers who are not currently speaking + if (speakerp->mStatus == LLSpeaker::STATUS_HAS_SPOKEN) + { + speakerp->mDotColor = lerp(speaking_color, ACTIVE_COLOR, clamp_rescale((F32)recent_speaker_count, -2.f, 3.f, 0.f, 1.f)); + recent_speaker_count++; + } + + // stuff sort ordinal into speaker so the ui can sort by this value + speakerp->mSortIndex = sort_index++; + + // remove speakers that have been gone too long + if (speakerp->mStatus == LLSpeaker::STATUS_NOT_IN_CHANNEL && speakerp->mActivityTimer.hasExpired()) + { + fireEvent(new LLSpeakerListChangeEvent(this, speakerp->mID), "remove"); + + mSpeakers.erase(speakerp->mID); + sorted_speaker_it = mSpeakersSorted.erase(sorted_speaker_it); + } + else + { + ++sorted_speaker_it; + } + } +} + +void LLSpeakerMgr::updateSpeakerList() +{ + // are we bound to the currently active voice channel? + if ((!mVoiceChannel && gVoiceClient->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + { + LLVoiceClient::participantMap* participants = gVoiceClient->getParticipantList(); + if(participants) + { + LLVoiceClient::participantMap::iterator participant_it; + + // add new participants to our list of known speakers + for (participant_it = participants->begin(); participant_it != participants->end(); ++participant_it) + { + LLVoiceClient::participantState* participantp = participant_it->second; + setSpeaker(participantp->mAvatarID, participantp->mDisplayName, LLSpeaker::STATUS_VOICE_ACTIVE, (participantp->isAvatar()?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL)); + } + } + } +} + +LLPointer<LLSpeaker> LLSpeakerMgr::findSpeaker(const LLUUID& speaker_id) +{ + speaker_map_t::iterator found_it = mSpeakers.find(speaker_id); + if (found_it == mSpeakers.end()) + { + return NULL; + } + return found_it->second; +} + +void LLSpeakerMgr::getSpeakerList(speaker_list_t* speaker_list, BOOL include_text) +{ + speaker_list->clear(); + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) + { + LLPointer<LLSpeaker> speakerp = speaker_it->second; + // what about text only muted or inactive? + if (include_text || speakerp->mStatus != LLSpeaker::STATUS_TEXT_ONLY) + { + speaker_list->push_back(speakerp); + } + } +} + +const LLUUID LLSpeakerMgr::getSessionID() +{ + return mVoiceChannel->getSessionID(); +} + + +void LLSpeakerMgr::setSpeakerTyping(const LLUUID& speaker_id, BOOL typing) +{ + LLPointer<LLSpeaker> speakerp = findSpeaker(speaker_id); + if (speakerp.notNull()) + { + speakerp->mTyping = typing; + } +} + +// speaker has chatted via either text or voice +void LLSpeakerMgr::speakerChatted(const LLUUID& speaker_id) +{ + LLPointer<LLSpeaker> speakerp = findSpeaker(speaker_id); + if (speakerp.notNull()) + { + speakerp->mLastSpokeTime = mSpeechTimer.getElapsedTimeF32(); + speakerp->mHasSpoken = TRUE; + } +} + +BOOL LLSpeakerMgr::isVoiceActive() +{ + // mVoiceChannel = NULL means current voice channel, whatever it is + return LLVoiceClient::voiceEnabled() && mVoiceChannel && mVoiceChannel->isActive(); +} + + +// +// LLIMSpeakerMgr +// +LLIMSpeakerMgr::LLIMSpeakerMgr(LLVoiceChannel* channel) : LLSpeakerMgr(channel) +{ +} + +void LLIMSpeakerMgr::updateSpeakerList() +{ + // don't do normal updates which are pulled from voice channel + // rely on user list reported by sim + + // We need to do this to allow PSTN callers into group chats to show in the list. + LLSpeakerMgr::updateSpeakerList(); + + return; +} + +void LLIMSpeakerMgr::setSpeakers(const LLSD& speakers) +{ + if ( !speakers.isMap() ) return; + + if ( speakers.has("agent_info") && speakers["agent_info"].isMap() ) + { + LLSD::map_const_iterator speaker_it; + for(speaker_it = speakers["agent_info"].beginMap(); + speaker_it != speakers["agent_info"].endMap(); + ++speaker_it) + { + LLUUID agent_id(speaker_it->first); + + LLPointer<LLSpeaker> speakerp = setSpeaker( + agent_id, + LLStringUtil::null, + LLSpeaker::STATUS_TEXT_ONLY); + + if ( speaker_it->second.isMap() ) + { + speakerp->mIsModerator = speaker_it->second["is_moderator"]; + speakerp->mModeratorMutedText = + speaker_it->second["mutes"]["text"]; + } + } + } + else if ( speakers.has("agents" ) && speakers["agents"].isArray() ) + { + //older, more decprecated way. Need here for + //using older version of servers + LLSD::array_const_iterator speaker_it; + for(speaker_it = speakers["agents"].beginArray(); + speaker_it != speakers["agents"].endArray(); + ++speaker_it) + { + const LLUUID agent_id = (*speaker_it).asUUID(); + + LLPointer<LLSpeaker> speakerp = setSpeaker( + agent_id, + LLStringUtil::null, + LLSpeaker::STATUS_TEXT_ONLY); + } + } +} + +void LLIMSpeakerMgr::updateSpeakers(const LLSD& update) +{ + if ( !update.isMap() ) return; + + if ( update.has("agent_updates") && update["agent_updates"].isMap() ) + { + LLSD::map_const_iterator update_it; + for( + update_it = update["agent_updates"].beginMap(); + update_it != update["agent_updates"].endMap(); + ++update_it) + { + LLUUID agent_id(update_it->first); + LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id); + + LLSD agent_data = update_it->second; + + if (agent_data.isMap() && agent_data.has("transition")) + { + if (agent_data["transition"].asString() == "LEAVE" && speakerp.notNull()) + { + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + speakerp->mDotColor = INACTIVE_COLOR; + speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT); + } + else if (agent_data["transition"].asString() == "ENTER") + { + // add or update speaker + speakerp = setSpeaker(agent_id); + } + else + { + llwarns << "bad membership list update " << ll_print_sd(agent_data["transition"]) << llendl; + } + } + + if (speakerp.isNull()) continue; + + // should have a valid speaker from this point on + if (agent_data.isMap() && agent_data.has("info")) + { + LLSD agent_info = agent_data["info"]; + + if (agent_info.has("is_moderator")) + { + speakerp->mIsModerator = agent_info["is_moderator"]; + } + + if (agent_info.has("mutes")) + { + speakerp->mModeratorMutedText = agent_info["mutes"]["text"]; + } + } + } + } + else if ( update.has("updates") && update["updates"].isMap() ) + { + LLSD::map_const_iterator update_it; + for ( + update_it = update["updates"].beginMap(); + update_it != update["updates"].endMap(); + ++update_it) + { + LLUUID agent_id(update_it->first); + LLPointer<LLSpeaker> speakerp = findSpeaker(agent_id); + + std::string agent_transition = update_it->second.asString(); + if (agent_transition == "LEAVE" && speakerp.notNull()) + { + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + speakerp->mDotColor = INACTIVE_COLOR; + speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT); + } + else if ( agent_transition == "ENTER") + { + // add or update speaker + speakerp = setSpeaker(agent_id); + } + else + { + llwarns << "bad membership list update " + << agent_transition << llendl; + } + } + } +} + + +// +// LLActiveSpeakerMgr +// + +LLActiveSpeakerMgr::LLActiveSpeakerMgr() : LLSpeakerMgr(NULL) +{ +} + +void LLActiveSpeakerMgr::updateSpeakerList() +{ + // point to whatever the current voice channel is + mVoiceChannel = LLVoiceChannel::getCurrentVoiceChannel(); + + // always populate from active voice channel + if (LLVoiceChannel::getCurrentVoiceChannel() != mVoiceChannel) + { + fireEvent(new LLSpeakerListChangeEvent(this, LLUUID::null), "clear"); + mSpeakers.clear(); + mSpeakersSorted.clear(); + mVoiceChannel = LLVoiceChannel::getCurrentVoiceChannel(); + } + LLSpeakerMgr::updateSpeakerList(); + + // clean up text only speakers + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) + { + LLUUID speaker_id = speaker_it->first; + LLSpeaker* speakerp = speaker_it->second; + if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) + { + // automatically flag text only speakers for removal + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + } + } + +} + + + +// +// LLLocalSpeakerMgr +// + +LLLocalSpeakerMgr::LLLocalSpeakerMgr() : LLSpeakerMgr(LLVoiceChannelProximal::getInstance()) +{ +} + +LLLocalSpeakerMgr::~LLLocalSpeakerMgr () +{ +} + +void LLLocalSpeakerMgr::updateSpeakerList() +{ + // pull speakers from voice channel + LLSpeakerMgr::updateSpeakerList(); + + if (gDisconnected)//the world is cleared. + { + return ; + } + + // pick up non-voice speakers in chat range + std::vector<LLUUID> avatar_ids; + std::vector<LLVector3d> positions; + LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, gAgent.getPositionGlobal(), CHAT_NORMAL_RADIUS); + for(U32 i=0; i<avatar_ids.size(); i++) + { + setSpeaker(avatar_ids[i]); + } + + // check if text only speakers have moved out of chat range + for (speaker_map_t::iterator speaker_it = mSpeakers.begin(); speaker_it != mSpeakers.end(); ++speaker_it) + { + LLUUID speaker_id = speaker_it->first; + LLSpeaker* speakerp = speaker_it->second; + if (speakerp->mStatus == LLSpeaker::STATUS_TEXT_ONLY) + { + LLVOAvatar* avatarp = (LLVOAvatar*)gObjectList.findObject(speaker_id); + if (!avatarp || dist_vec(avatarp->getPositionAgent(), gAgent.getPositionAgent()) > CHAT_NORMAL_RADIUS) + { + speakerp->mStatus = LLSpeaker::STATUS_NOT_IN_CHANNEL; + speakerp->mDotColor = INACTIVE_COLOR; + speakerp->mActivityTimer.resetWithExpiry(SPEAKER_TIMEOUT); + } + } + } +} diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h new file mode 100644 index 0000000000..e0f22bff4f --- /dev/null +++ b/indra/newview/llspeakers.h @@ -0,0 +1,172 @@ +/** + * @file llspeakers.h + * @brief Management interface for muting and controlling volume of residents currently speaking + * + * $LicenseInfo:firstyear=2005&license=viewergpl$ + * + * Copyright (c) 2005-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_LLSPEAKERS_H +#define LL_LLSPEAKERS_H + +#include "llevent.h" +#include "llspeakers.h" +#include "llvoicechannel.h" + +class LLSpeakerMgr; + +// data for a given participant in a voice channel +class LLSpeaker : public LLRefCount, public LLOldEvents::LLObservable, public LLHandleProvider<LLSpeaker>, public boost::signals2::trackable +{ +public: + typedef enum e_speaker_type + { + SPEAKER_AGENT, + SPEAKER_OBJECT, + SPEAKER_EXTERNAL // Speaker that doesn't map to an avatar or object (i.e. PSTN caller in a group) + } ESpeakerType; + + typedef enum e_speaker_status + { + STATUS_SPEAKING, + STATUS_HAS_SPOKEN, + STATUS_VOICE_ACTIVE, + STATUS_TEXT_ONLY, + STATUS_NOT_IN_CHANNEL, + STATUS_MUTED + } ESpeakerStatus; + + + LLSpeaker(const LLUUID& id, const std::string& name = LLStringUtil::null, const ESpeakerType type = SPEAKER_AGENT); + ~LLSpeaker() {}; + void lookupName(); + + void onAvatarNameLookup(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group); + + 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?) + std::string mDisplayName; // cache user name for this speaker + LLFrameTimer mActivityTimer; // time out speakers when they are not part of current voice channel + BOOL mHasSpoken; // has this speaker said anything this session? + BOOL mHasLeftCurrentCall; // has this speaker left the current voice call? + LLColor4 mDotColor; + LLUUID mID; + BOOL mTyping; + S32 mSortIndex; + ESpeakerType mType; + BOOL mIsModerator; + BOOL mModeratorMutedVoice; + BOOL mModeratorMutedText; +}; + +class LLSpeakerTextModerationEvent : public LLOldEvents::LLEvent +{ +public: + LLSpeakerTextModerationEvent(LLSpeaker* source); + /*virtual*/ LLSD getValue(); +}; + +class LLSpeakerVoiceModerationEvent : public LLOldEvents::LLEvent +{ +public: + LLSpeakerVoiceModerationEvent(LLSpeaker* source); + /*virtual*/ LLSD getValue(); +}; + +class LLSpeakerListChangeEvent : public LLOldEvents::LLEvent +{ +public: + LLSpeakerListChangeEvent(LLSpeakerMgr* source, const LLUUID& speaker_id); + /*virtual*/ LLSD getValue(); + +private: + const LLUUID& mSpeakerID; +}; + +class LLSpeakerMgr : public LLOldEvents::LLObservable +{ +public: + LLSpeakerMgr(LLVoiceChannel* channelp); + virtual ~LLSpeakerMgr(); + + LLPointer<LLSpeaker> findSpeaker(const LLUUID& avatar_id); + void update(BOOL resort_ok); + void setSpeakerTyping(const LLUUID& speaker_id, BOOL typing); + void speakerChatted(const LLUUID& speaker_id); + LLPointer<LLSpeaker> setSpeaker(const LLUUID& id, + const std::string& name = LLStringUtil::null, + LLSpeaker::ESpeakerStatus status = LLSpeaker::STATUS_TEXT_ONLY, + LLSpeaker::ESpeakerType = LLSpeaker::SPEAKER_AGENT); + + BOOL isVoiceActive(); + + typedef std::vector<LLPointer<LLSpeaker> > speaker_list_t; + void getSpeakerList(speaker_list_t* speaker_list, BOOL include_text); + LLVoiceChannel* getVoiceChannel() { return mVoiceChannel; } + const LLUUID getSessionID(); + +protected: + virtual void updateSpeakerList(); + + typedef std::map<LLUUID, LLPointer<LLSpeaker> > speaker_map_t; + speaker_map_t mSpeakers; + + speaker_list_t mSpeakersSorted; + LLFrameTimer mSpeechTimer; + LLVoiceChannel* mVoiceChannel; +}; + +class LLIMSpeakerMgr : public LLSpeakerMgr +{ +public: + LLIMSpeakerMgr(LLVoiceChannel* channel); + + void updateSpeakers(const LLSD& update); + void setSpeakers(const LLSD& speakers); +protected: + virtual void updateSpeakerList(); +}; + +class LLActiveSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLActiveSpeakerMgr> +{ +public: + LLActiveSpeakerMgr(); +protected: + virtual void updateSpeakerList(); +}; + +class LLLocalSpeakerMgr : public LLSpeakerMgr, public LLSingleton<LLLocalSpeakerMgr> +{ +public: + LLLocalSpeakerMgr(); + ~LLLocalSpeakerMgr (); +protected: + virtual void updateSpeakerList(); +}; + +#endif // LL_LLSPEAKERS_H diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 43b039f94e..9aa74e8b9f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -1149,7 +1149,8 @@ bool idle_startup() } //setup map of datetime strings to codes and slt & local time offset from utc - LLStringOps::setupDatetimeInfo (gPacificDaylightTime); + // *TODO: Does this need to be here? + LLStringOps::setupDatetimeInfo (false); transition_back_to_login_panel(emsg.str()); show_connect_box = true; } @@ -3037,14 +3038,15 @@ bool process_login_success_response() gAgent.setGenderChosen(TRUE); } + bool pacific_daylight_time = false; flag = login_flags["daylight_savings"].asString(); if(flag == "Y") { - gPacificDaylightTime = (flag == "Y") ? TRUE : FALSE; + pacific_daylight_time = (flag == "Y"); } //setup map of datetime strings to codes and slt & local time offset from utc - LLStringOps::setupDatetimeInfo (gPacificDaylightTime); + LLStringOps::setupDatetimeInfo(pacific_daylight_time); } LLSD initial_outfit = response["initial-outfit"][0]; diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index 86290e6695..c255418429 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -113,6 +113,12 @@ void LLSysWellWindow::connectListUpdaterToSignal(std::string notification_type) } //--------------------------------------------------------------------------------- +void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask) +{ + onChicletClick(); +} + +//--------------------------------------------------------------------------------- void LLSysWellWindow::onChicletClick() { // 1 - remove StartUp toast and channel if present @@ -403,7 +409,6 @@ bool LLSysWellWindow::isWindowEmpty() void LLSysWellWindow::sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) { - //*TODO get rid of get_session_value, session_id's are unique, cause performance degradation with lots chiclets (IB) if (mMessageList->getItemByValue(session_id) == NULL) { S32 chicletCounter = LLIMModel::getInstance()->getNumUnread(session_id); @@ -421,7 +426,6 @@ void LLSysWellWindow::sessionRemoved(const LLUUID& sessionId) { delIMRow(sessionId); reshapeWindow(); - LLBottomTray::getInstance()->getSysWell()->updateUreadIMNotifications(); } void LLSysWellWindow::sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) diff --git a/indra/newview/llsyswellwindow.h b/indra/newview/llsyswellwindow.h index fa6a1abea4..cbc5f7358f 100644 --- a/indra/newview/llsyswellwindow.h +++ b/indra/newview/llsyswellwindow.h @@ -76,6 +76,7 @@ public: void onItemClose(LLSysWellItem* item); void onStoreToast(LLPanel* info_panel, LLUUID id); void onChicletClick(); + void onStartUpToastClick(S32 x, S32 y, MASK mask); // size constants for the window and for its elements static const S32 MAX_WINDOW_HEIGHT = 200; diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index 17547cae39..5d9046ac90 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -804,8 +804,9 @@ void LLTexLayerSet::renderAlphaMaskTextures(S32 x, S32 y, S32 width, S32 height, gGL.setColorMask(false, true); gGL.setSceneBlendType(LLRender::BT_REPLACE); + // (Optionally) replace alpha with a single component image from a tga file. - if (!info->mStaticAlphaFileName.empty() && mMaskLayerList.empty()) + if (!info->mStaticAlphaFileName.empty()) { LLGLSNoAlphaTest gls_no_alpha_test; gGL.flush(); diff --git a/indra/newview/lltexlayerparams.cpp b/indra/newview/lltexlayerparams.cpp index ca888899ed..74e0fa077e 100644 --- a/indra/newview/lltexlayerparams.cpp +++ b/indra/newview/lltexlayerparams.cpp @@ -175,22 +175,28 @@ void LLTexLayerParamAlpha::setWeight(F32 weight, BOOL set_by_user) { mCurWeight = new_weight; - LLVOAvatar* avatar = mTexLayer->getTexLayerSet()->getAvatar(); - if (avatar->getSex() & getSex()) + if ((mAvatar->getSex() & getSex()) && (mAvatar->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { if (gAgent.cameraCustomizeAvatar()) { set_by_user = FALSE; } - avatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user); + mAvatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user); mTexLayer->invalidateMorphMasks(); - avatar->updateMeshTextures(); + mAvatar->updateMeshTextures(); } } } void LLTexLayerParamAlpha::setAnimationTarget(F32 target_value, BOOL set_by_user) { + // do not animate dummy parameters + if (mIsDummy) + { + setWeight(target_value, set_by_user); + return; + } + mTargetWeight = target_value; setWeight(target_value, set_by_user); mIsAnimating = TRUE; @@ -467,14 +473,16 @@ void LLTexLayerParamColor::setWeight(F32 weight, BOOL set_by_user) return; } - if (mAvatar->getSex() & getSex()) + if ((mAvatar->getSex() & getSex()) && (mAvatar->isSelf() && !mIsDummy)) // only trigger a baked texture update if we're changing a wearable's visual param. { onGlobalColorChanged(set_by_user); if (mTexLayer) { mAvatar->invalidateComposite(mTexLayer->getTexLayerSet(), set_by_user); + mAvatar->updateMeshTextures(); } } + // llinfos << "param " << mName << " = " << new_weight << llendl; } } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index b5aec1b80b..4940d9b5bb 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -458,7 +458,7 @@ BOOL LLFloaterTexturePicker::postBuild() // virtual void LLFloaterTexturePicker::draw() { - static LLUICachedControl<S32> floater_header_size ("UIFloaterHeaderSize", 0); + S32 floater_header_size = getHeaderHeight(); if (mOwner) { // draw cone of context pointing back to texture swatch diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index eba43d76a6..903df21e78 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -49,13 +49,15 @@ LLToast::Params::Params() enable_hide_btn("enable_hide_btn", true), force_show("force_show", false), force_store("force_store", false), + fading_time_secs("fading_time_secs", gSavedSettings.getS32("ToastFadingTime")), lifetime_secs("lifetime_secs", gSavedSettings.getS32("NotificationToastLifeTime")) {}; LLToast::LLToast(const LLToast::Params& p) : LLModalDialog(LLSD(), p.is_modal), mPanel(p.panel), - mToastLifetime(p.lifetime_secs), + mToastLifetime(p.lifetime_secs), + mToastFadingTime(p.fading_time_secs), mNotificationID(p.notif_id), mSessionID(p.session_id), mCanFade(p.can_fade), @@ -63,6 +65,7 @@ LLToast::LLToast(const LLToast::Params& p) mHideBtnEnabled(p.enable_hide_btn), mHideBtn(NULL), mNotification(p.notification), + mIsHidden(false), mHideBtnPressed(false) { LLUICtrlFactory::getInstance()->buildFloater(this, "panel_toast.xml", NULL); @@ -126,7 +129,7 @@ bool LLToast::lifetimeHasExpired() if (mTimer.getStarted()) { F32 elapsed_time = mTimer.getElapsedTimeF32(); - if ((mToastLifetime - elapsed_time) <= gSavedSettings.getS32("ToastOpaqueTime")) + if ((mToastLifetime - elapsed_time) <= mToastFadingTime) { setBackgroundOpaque(FALSE); } @@ -143,7 +146,8 @@ void LLToast::hide() { setVisible(FALSE); mTimer.stop(); - mOnFadeSignal(this); + mIsHidden = true; + mOnFadeSignal(this); } //-------------------------------------------------------------------------- @@ -159,9 +163,7 @@ void LLToast::tick() { if(mCanFade) { - setVisible(FALSE); - mTimer.stop(); - mOnFadeSignal(this); + hide(); } } @@ -206,6 +208,16 @@ void LLToast::draw() //-------------------------------------------------------------------------- void LLToast::setVisible(BOOL show) { + if(mIsHidden) + { + // this toast is invisible after fade until its ScreenChannel will allow it + // + // (EXT-1849) according to this bug a toast can be resurrected from + // invisible state if it faded during a teleportation + // then it fades a second time and causes a crash + return; + } + if(show) { setBackgroundOpaque(TRUE); diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index 1826c13ebc..b670f47045 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -63,7 +63,8 @@ public: Optional<LLUUID> notif_id, //notification ID session_id; //im session ID Optional<LLNotificationPtr> notification; - Optional<F32> lifetime_secs; + Optional<F32> lifetime_secs, + fading_time_secs; // Number of seconds while a toast is fading Optional<toast_callback_t> on_delete_toast, on_mouse_enter; Optional<bool> can_fade, @@ -125,6 +126,8 @@ public: void setCanBeStored(bool can_be_stored) { mCanBeStored = can_be_stored; } // bool getCanBeStored() { return mCanBeStored; } + // set whether this toast considered as hidden or not + void setIsHidden( bool is_toast_hidden ) { mIsHidden = is_toast_hidden; } // Registers signals/callbacks for events @@ -155,6 +158,7 @@ private: // timer counts a lifetime of a toast LLTimer mTimer; F32 mToastLifetime; // in seconds + F32 mToastFadingTime; // in seconds LLPanel* mPanel; LLButton* mHideBtn; @@ -164,6 +168,7 @@ private: bool mCanBeStored; bool mHideBtnEnabled; bool mHideBtnPressed; + bool mIsHidden; // this flag is TRUE when a toast has faded or was hidden with (x) button (EXT-1849) }; } diff --git a/indra/newview/lltoastimpanel.cpp b/indra/newview/lltoastimpanel.cpp index c2cd63900b..c02fd7a5ef 100644 --- a/indra/newview/lltoastimpanel.cpp +++ b/indra/newview/lltoastimpanel.cpp @@ -32,7 +32,6 @@ #include "llviewerprecompiledheaders.h" #include "lltoastimpanel.h" -#include "llimpanel.h" const S32 LLToastIMPanel::DEFAULT_MESSAGE_MAX_LINE_COUNT = 6; diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index b035fd53fd..304f1dffaf 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -48,6 +48,7 @@ #include "lltooltip.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" +#include "llkeyboard.h" #include "llmediaentry.h" #include "llmenugl.h" #include "llmutelist.h" @@ -731,7 +732,47 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) { tooltip_msg.append( nodep->mName ); } - + + bool is_time_based_media = false; + bool is_web_based_media = false; + bool is_media_playing = false; + + // Does this face have media? + const LLTextureEntry* tep = hover_object->getTE(mHoverPick.mObjectFace); + + if(tep) + { + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + if (mep) + { + viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; + LLPluginClassMedia* media_plugin = NULL; + + if (media_impl.notNull() && (media_impl->hasMedia())) + { + LLStringUtil::format_map_t args; + + media_plugin = media_impl->getMediaPlugin(); + if(media_plugin) + { if(media_plugin->pluginSupportsMediaTime()) + { + is_time_based_media = true; + is_web_based_media = false; + args["[CurrentURL]"] = media_impl->getMediaURL(); + is_media_playing = media_impl->isMediaPlaying(); + } + else + { + is_time_based_media = false; + is_web_based_media = true; + args["[CurrentURL]"] = media_plugin->getLocation(); + } + //tooltip_msg.append(LLTrans::getString("CurrentURL", args)); + } + } + } + } + bool needs_tip = needs_tooltip(nodep); if (show_all_object_tips || needs_tip) @@ -740,8 +781,13 @@ BOOL LLToolPie::handleToolTip(S32 local_x, S32 local_y, MASK mask) mPick = mHoverPick; LLToolTipMgr::instance().show(LLToolTip::Params() .message(tooltip_msg) - .image(LLUI::getUIImage("Info")) - .click_callback(boost::bind(showObjectInspector, hover_object->getID())) + .image(LLUI::getUIImage("Info_Off")) + .click_callback(boost::bind(showObjectInspector, hover_object->getID(), mHoverPick.mObjectFace)) + .time_based_media(is_time_based_media) + .web_based_media(is_web_based_media) + .media_playing(is_media_playing) + .click_playmedia_callback(boost::bind(playCurrentMedia, mHoverPick)) + .click_homepage_callback(boost::bind(VisitHomePage, mHoverPick)) .visible_time_near(6.f) .visible_time_far(3.f) .wrap(false)); @@ -924,6 +970,20 @@ static void show_inspector(const char* inspector, const char* param, const LLUUI LLFloaterReg::showInstance(inspector, params); } + +static void show_inspector(const char* inspector, LLSD& params) +{ + if (LLToolTipMgr::instance().toolTipVisible()) + { + LLRect rect = LLToolTipMgr::instance().getToolTipRect(); + params["pos"]["x"] = rect.mLeft; + params["pos"]["y"] = rect.mTop; + } + + LLFloaterReg::showInstance(inspector, params); +} + + // static void LLToolPie::showAvatarInspector(const LLUUID& avatar_id) { @@ -936,6 +996,114 @@ void LLToolPie::showObjectInspector(const LLUUID& object_id) show_inspector("inspect_object", "object_id", object_id); } + +// static +void LLToolPie::showObjectInspector(const LLUUID& object_id, const S32& object_face) +{ + LLSD params; + params["object_id"] = object_id; + params["object_face"] = object_face; + show_inspector("inspect_object", params); +} + +// static +void LLToolPie::playCurrentMedia(const LLPickInfo& info) +{ + //FIXME: how do we handle object in different parcel than us? + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!parcel) return; + + LLPointer<LLViewerObject> objectp = info.getObject(); + + // Early out cases. Must clear media hover. + // did not hit an object or did not hit a valid face + if ( objectp.isNull() || + info.mObjectFace < 0 || + info.mObjectFace >= objectp->getNumTEs() ) + { + return; + } + + // Does this face have media? + const LLTextureEntry* tep = objectp->getTE(info.mObjectFace); + if (!tep) + return; + + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + if(!mep) + return; + + LLPluginClassMedia* media_plugin = NULL; + +// if (gSavedSettings.getBOOL("MediaOnAPrimUI")) +// { + viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + + if(media_impl.notNull() && media_impl->hasMedia()) + { + media_plugin = media_impl->getMediaPlugin(); + + if (media_plugin && media_plugin->pluginSupportsMediaTime()) + { + if(media_impl->isMediaPlaying()) + { + media_impl->pause(); + } + else //if(media_impl->isMediaPaused()) + { + media_impl->play(); + } + + } + + } +// } + +} + +// static +void LLToolPie::VisitHomePage(const LLPickInfo& info) +{ + //FIXME: how do we handle object in different parcel than us? + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if (!parcel) return; + + LLPointer<LLViewerObject> objectp = info.getObject(); + + // Early out cases. Must clear media hover. + // did not hit an object or did not hit a valid face + if ( objectp.isNull() || + info.mObjectFace < 0 || + info.mObjectFace >= objectp->getNumTEs() ) + { + return; + } + + // Does this face have media? + const LLTextureEntry* tep = objectp->getTE(info.mObjectFace); + if (!tep) + return; + + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; + if(!mep) + return; + + LLPluginClassMedia* media_plugin = NULL; + + viewer_media_t media_impl = LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()); + + if(media_impl.notNull() && media_impl->hasMedia()) + { + media_plugin = media_impl->getMediaPlugin(); + + if (media_plugin && !(media_plugin->pluginSupportsMediaTime())) + { + media_impl->navigateHome(); + } + } +} + + void LLToolPie::handleDeselect() { if( hasMouseCapture() ) @@ -1034,12 +1202,17 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) // Does this face have media? const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace); + if(!tep) + return false; + LLMediaEntry* mep = (tep->hasMedia()) ? tep->getMediaData() : NULL; + + if(!mep) + return false; + viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; - if (tep - && mep - && gSavedSettings.getBOOL("MediaOnAPrimUI") + if (gSavedSettings.getBOOL("MediaOnAPrimUI") && media_impl.notNull()) { if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) ) @@ -1048,7 +1221,10 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) } else { - media_impl->mouseDown(pick.mUVCoords); + // Make sure keyboard focus is set to the media focus object. + gFocusMgr.setKeyboardFocus(LLViewerMediaFocus::getInstance()); + + media_impl->mouseDown(pick.mUVCoords, gKeyboard->currentMask(TRUE)); mMediaMouseCaptureID = mep->getMediaID(); setMouseCapture(TRUE); // This object will send a mouse-up to the media when it loses capture. } @@ -1081,6 +1257,9 @@ bool LLToolPie::handleMediaHover(const LLPickInfo& pick) // Does this face have media? const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace); + if(!tep) + return false; + const LLMediaEntry* mep = tep->hasMedia() ? tep->getMediaData() : NULL; if (mep && gSavedSettings.getBOOL("MediaOnAPrimUI")) @@ -1098,7 +1277,7 @@ bool LLToolPie::handleMediaHover(const LLPickInfo& pick) // If this is the focused media face, send mouse move events. if (LLViewerMediaFocus::getInstance()->isFocusedOnFace(objectp, pick.mObjectFace)) { - media_impl->mouseMove(pick.mUVCoords); + media_impl->mouseMove(pick.mUVCoords, gKeyboard->currentMask(TRUE)); gViewerWindow->setCursor(media_impl->getLastSetCursor()); } else diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 5faedbec5a..3660c68552 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -78,6 +78,10 @@ public: static void showAvatarInspector(const LLUUID& avatar_id); static void showObjectInspector(const LLUUID& object_id); + static void showObjectInspector(const LLUUID& object_id, const S32& object_face); + static void playCurrentMedia(const LLPickInfo& info); + static void VisitHomePage(const LLPickInfo& info); + private: BOOL outsideSlop (S32 x, S32 y, S32 start_x, S32 start_y); BOOL pickLeftMouseDownCallback(); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index b71291f834..35226a1632 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -511,13 +511,34 @@ bool toggle_show_snapshot_button(const LLSD& newvalue) bool toggle_show_navigation_panel(const LLSD& newvalue) { - LLNavigationBar::getInstance()->showNavigationPanel(newvalue.asBoolean()); + LLRect floater_view_rect = gFloaterView->getRect(); + LLRect notify_view_rect = gNotifyBoxView->getRect(); + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + + //if newvalue contains 0 => navbar should turn invisible, so floater_view_rect should get higher, + //and to do this pm=1, else if navbar becomes visible pm=-1 so floater_view_rect gets lower. + int pm=newvalue.asBoolean()?-1:1; + floater_view_rect.mTop += pm*(navbar->getDefNavBarHeight()-navbar->getDefFavBarHeight()); + notify_view_rect.mTop += pm*(navbar->getDefNavBarHeight()-navbar->getDefFavBarHeight()); + gFloaterView->setRect(floater_view_rect); + floater_view_rect = gFloaterView->getRect(); + navbar->showNavigationPanel(newvalue.asBoolean()); return true; } bool toggle_show_favorites_panel(const LLSD& newvalue) { - LLNavigationBar::getInstance()->showFavoritesPanel(newvalue.asBoolean()); + LLRect floater_view_rect = gFloaterView->getRect(); + LLRect notify_view_rect = gNotifyBoxView->getRect(); + LLNavigationBar* navbar = LLNavigationBar::getInstance(); + + //if newvalue contains 0 => favbar should turn invisible, so floater_view_rect should get higher, + //and to do this pm=1, else if favbar becomes visible pm=-1 so floater_view_rect gets lower. + int pm=newvalue.asBoolean()?-1:1; + floater_view_rect.mTop += pm*navbar->getDefFavBarHeight(); + notify_view_rect.mTop += pm*navbar->getDefFavBarHeight(); + gFloaterView->setRect(floater_view_rect); + navbar->showFavoritesPanel(newvalue.asBoolean()); return true; } diff --git a/indra/newview/llviewercontrol.h b/indra/newview/llviewercontrol.h index b1f14eca7b..9b4e80cae0 100644 --- a/indra/newview/llviewercontrol.h +++ b/indra/newview/llviewercontrol.h @@ -43,6 +43,9 @@ extern BOOL gHackGodmode; #endif +bool toggle_show_navigation_panel(const LLSD& newvalue); +bool toggle_show_favorites_panel(const LLSD& newvalue); + // These functions found in llcontroldef.cpp *TODO: clean this up! //setting variables are declared in this function void settings_setup_listeners(); diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index dace3f875f..9ca2d3f61d 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -80,6 +80,7 @@ #include "llfloatermap.h" #include "llfloatermemleak.h" #include "llfloaternamedesc.h" +#include "llfloaternearbymedia.h" #include "llfloaternotificationsconsole.h" #include "llfloateropenobject.h" #include "llfloaterpay.h" @@ -187,6 +188,8 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("mute_object_by_name", "floater_mute_object.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterGetBlockedObjectName>); LLFloaterReg::add("mini_map", "floater_map.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterMap>); LLFloaterReg::add("syswell_window", "floater_sys_well.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLSysWellWindow>); + + LLFloaterReg::add("nearby_media", "floater_nearby_media.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNearbyMedia>); LLFloaterReg::add("notifications_console", "floater_notifications_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterNotificationConsole>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 57a4117d5d..366e5602bd 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -42,7 +42,6 @@ #include "llconsole.h" #include "llinventorymodel.h" #include "llnotify.h" -#include "llimview.h" #include "llgesturemgr.h" #include "llinventorybridge.h" diff --git a/indra/newview/llviewerkeyboard.cpp b/indra/newview/llviewerkeyboard.cpp index 2dc317e067..8fd646ee93 100644 --- a/indra/newview/llviewerkeyboard.cpp +++ b/indra/newview/llviewerkeyboard.cpp @@ -99,7 +99,7 @@ static void agent_handle_doubletap_run(EKeystate s, LLAgent::EDoubleTapRunMode m gAgent.sendWalkRun(gAgent.getRunning()); } } - else if (gAllowTapTapHoldRun && + else if (gSavedSettings.getBOOL("AllowTapTapHoldRun") && KEYSTATE_DOWN == s && !gAgent.getRunning()) { diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 0b6ac0e2e2..55e4f28e75 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -48,6 +48,8 @@ #include "llevent.h" // LLSimpleListener #include "llnotifications.h" #include "lluuid.h" +#include "llkeyboard.h" +#include "llmutelist.h" #include <boost/bind.hpp> // for SkinFolder listener #include <boost/signals2.hpp> @@ -154,10 +156,10 @@ public: { if(!mInitialized && ! mime_type.empty()) { - if (mMediaImpl->initializeMedia(mime_type)) + if(mMediaImpl->initializeMedia(mime_type)) { mInitialized = true; - mMediaImpl->play(); + mMediaImpl->loadURI(); } } } @@ -166,10 +168,10 @@ public: viewer_media_t mMediaImpl; bool mInitialized; }; -typedef std::vector<LLViewerMediaImpl*> impl_list; -static impl_list sViewerMediaImplList; +static LLViewerMedia::impl_list sViewerMediaImplList; static LLTimer sMediaCreateTimer; static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f; +static F32 sGlobalVolume = 1.0f; ////////////////////////////////////////////////////////////////////////////////////////// static void add_media_impl(LLViewerMediaImpl* media) @@ -180,8 +182,8 @@ static void add_media_impl(LLViewerMediaImpl* media) ////////////////////////////////////////////////////////////////////////////////////////// static void remove_media_impl(LLViewerMediaImpl* media) { - impl_list::iterator iter = sViewerMediaImplList.begin(); - impl_list::iterator end = sViewerMediaImplList.end(); + LLViewerMedia::impl_list::iterator iter = sViewerMediaImplList.begin(); + LLViewerMedia::impl_list::iterator end = sViewerMediaImplList.end(); for(; iter != end; iter++) { @@ -193,6 +195,15 @@ static void remove_media_impl(LLViewerMediaImpl* media) } } +class LLViewerMediaMuteListObserver : public LLMuteListObserver +{ + /* virtual */ void onChange() { LLViewerMedia::muteListChanged();} +}; + +static LLViewerMediaMuteListObserver sViewerMediaMuteListObserver; +static bool sViewerMediaMuteListObserverInitialized = false; +static bool sInWorldMediaDisabled = false; + ////////////////////////////////////////////////////////////////////////////////////////// // LLViewerMedia @@ -256,10 +267,6 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s { needs_navigate = (media_entry->getCurrentURL() != previous_url); } - else if(!media_entry->getHomeURL().empty()) - { - needs_navigate = (media_entry->getHomeURL() != previous_url); - } } } else @@ -282,8 +289,6 @@ viewer_media_t LLViewerMedia::updateMediaImpl(LLMediaEntry* media_entry, const s if(media_impl && needs_navigate) { std::string url = media_entry->getCurrentURL(); - if(url.empty()) - url = media_entry->getHomeURL(); media_impl->navigateTo(url, "", true, true); } @@ -387,20 +392,75 @@ bool LLViewerMedia::textureHasMedia(const LLUUID& texture_id) // static void LLViewerMedia::setVolume(F32 volume) { + if(volume != sGlobalVolume) + { + sGlobalVolume = volume; + impl_list::iterator iter = sViewerMediaImplList.begin(); + impl_list::iterator end = sViewerMediaImplList.end(); + + for(; iter != end; iter++) + { + LLViewerMediaImpl* pimpl = *iter; + pimpl->updateVolume(); + } + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +F32 LLViewerMedia::getVolume() +{ + return sGlobalVolume; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::muteListChanged() +{ + // When the mute list changes, we need to check mute status on all impls. impl_list::iterator iter = sViewerMediaImplList.begin(); impl_list::iterator end = sViewerMediaImplList.end(); for(; iter != end; iter++) { LLViewerMediaImpl* pimpl = *iter; - pimpl->setVolume(volume); + pimpl->mNeedsMuteCheck = true; } } +////////////////////////////////////////////////////////////////////////////////////////// +// static +void LLViewerMedia::setInWorldMediaDisabled(bool disabled) +{ + sInWorldMediaDisabled = disabled; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::getInWorldMediaDisabled() +{ + return sInWorldMediaDisabled; +} + +LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() +{ + return sViewerMediaImplList; +} + // This is the predicate function used to sort sViewerMediaImplList by priority. -static inline bool compare_impl_interest(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) +bool LLViewerMedia::priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2) { - if(i1->hasFocus()) + if(i1->isForcedUnloaded()) + { + // Muted or failed items always go to the end of the list, period. + return false; + } + else if(i2->isForcedUnloaded()) + { + // Muted or failed items always go to the end of the list, period. + return true; + } + else if(i1->hasFocus()) { // The item with user focus always comes to the front of the list, period. return true; @@ -442,7 +502,7 @@ void LLViewerMedia::updateMedia() } // Sort the static instance list using our interest criteria - std::stable_sort(sViewerMediaImplList.begin(), sViewerMediaImplList.end(), compare_impl_interest); + std::stable_sort(sViewerMediaImplList.begin(), sViewerMediaImplList.end(), priorityComparitor); // Go through the list again and adjust according to priority. iter = sViewerMediaImplList.begin(); @@ -452,6 +512,7 @@ void LLViewerMedia::updateMedia() int impl_count_total = 0; int impl_count_interest_low = 0; int impl_count_interest_normal = 0; + int i = 0; #if 0 LL_DEBUGS("PluginPriority") << "Sorted impls:" << llendl; @@ -474,8 +535,9 @@ void LLViewerMedia::updateMedia() LLPluginClassMedia::EPriority new_priority = LLPluginClassMedia::PRIORITY_NORMAL; - if(impl_count_total > (int)max_instances) + if(pimpl->isForcedUnloaded() || (impl_count_total > (int)max_instances)) { + // Never load muted or failed impls. // Hard limit on the number of instances that will be loaded at one time new_priority = LLPluginClassMedia::PRIORITY_UNLOADED; } @@ -535,7 +597,23 @@ void LLViewerMedia::updateMedia() } } + if(new_priority != LLPluginClassMedia::PRIORITY_UNLOADED) + { + impl_count_total++; + } + pimpl->setPriority(new_priority); + + if(pimpl->getUsedInUI()) + { + // Any impls used in the UI should not be in the proximity list. + pimpl->mProximity = -1; + } + else + { + // Other impls just get the same ordering as the priority list (for now). + pimpl->mProximity = i; + } #if 0 LL_DEBUGS("PluginPriority") << " " << pimpl @@ -548,7 +626,8 @@ void LLViewerMedia::updateMedia() #endif total_cpu += pimpl->getCPUUsage(); - impl_count_total++; + + i++; } LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << llendl; @@ -587,12 +666,25 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id, mUsedInUI(false), mHasFocus(false), mPriority(LLPluginClassMedia::PRIORITY_UNLOADED), - mDoNavigateOnLoad(false), - mDoNavigateOnLoadRediscoverType(false), - mDoNavigateOnLoadServerRequest(false), - mMediaSourceFailedInit(false), + mNavigateRediscoverType(false), + mNavigateServerRequest(false), + mMediaSourceFailed(false), + mRequestedVolume(1.0f), + mIsMuted(false), + mNeedsMuteCheck(false), + mPreviousMediaState(MEDIA_NONE), + mPreviousMediaTime(0.0f), + mIsDisabled(false), + mProximity(-1), mIsUpdated(false) { + + // Set up the mute list observer if it hasn't been set up already. + if(!sViewerMediaMuteListObserverInitialized) + { + LLMuteList::getInstance()->addObserver(&sViewerMediaMuteListObserver); + sViewerMediaMuteListObserverInitialized = true; + } add_media_impl(this); @@ -654,7 +746,6 @@ bool LLViewerMediaImpl::initializeMedia(const std::string& mime_type) mMimeType = mime_type; } - // play(); return (mMediaSource != NULL); } @@ -667,16 +758,13 @@ void LLViewerMediaImpl::createMediaSource() return; } - if(mDoNavigateOnLoad) + if(! mMediaURL.empty()) { - if(! mMediaURL.empty()) - { - navigateTo(mMediaURL, mMimeType, mDoNavigateOnLoadRediscoverType, mDoNavigateOnLoadServerRequest); - } - else if(! mMimeType.empty()) - { - initializeMedia(mMimeType); - } + navigateInternal(); + } + else if(! mMimeType.empty()) + { + initializeMedia(mMimeType); } } @@ -782,7 +870,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) } // If we got here, we want to ignore previous init failures. - mMediaSourceFailedInit = false; + mMediaSourceFailed = false; LLPluginClassMedia* media_source = newSourceFromMediaType(mMimeType, this, mMediaWidth, mMediaHeight); @@ -792,17 +880,61 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) media_source->setLoop(mMediaLoop); media_source->setAutoScale(mMediaAutoScale); media_source->setBrowserUserAgent(LLViewerMedia::getCurrentUserAgent()); + media_source->focus(mHasFocus); mMediaSource = media_source; + + updateVolume(); + return true; } // Make sure the timer doesn't try re-initing this plugin repeatedly until something else changes. - mMediaSourceFailedInit = true; + mMediaSourceFailed = true; return false; } +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::loadURI() +{ + if(mMediaSource) + { + mMediaSource->loadURI( mMediaURL ); + + if(mPreviousMediaState == MEDIA_PLAYING) + { + // This media was playing before this instance was unloaded. + + if(mPreviousMediaTime != 0.0f) + { + // Seek back to where we left off, if possible. + seek(mPreviousMediaTime); + } + + start(); + } + else if(mPreviousMediaState == MEDIA_PAUSED) + { + // This media was paused before this instance was unloaded. + + if(mPreviousMediaTime != 0.0f) + { + // Seek back to where we left off, if possible. + seek(mPreviousMediaTime); + } + + pause(); + } + else + { + // No relevant previous media play state -- if we're loading the URL, we want to start playing. + start(); + } + } +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::setSize(int width, int height) { mMediaWidth = width; @@ -816,24 +948,21 @@ void LLViewerMediaImpl::setSize(int width, int height) ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::play() { - // first stop any previously playing media - // stop(); - - // mMediaSource->addObserver( this ); + // If the media source isn't there, try to initialize it and load an URL. if(mMediaSource == NULL) { - if(!initializePlugin(mMimeType)) + if(!initializeMedia(mMimeType)) { // This may be the case where the plugin's priority is PRIORITY_UNLOADED return; } + + // Only do this if the media source was just loaded. + loadURI(); } - mMediaSource->loadURI( mMediaURL ); - if(/*mMediaSource->pluginSupportsMediaTime()*/ true) - { - start(); - } + // always start the media + start(); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -884,13 +1013,26 @@ void LLViewerMediaImpl::seek(F32 time) ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::setVolume(F32 volume) { + mRequestedVolume = volume; + updateVolume(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::updateVolume() +{ if(mMediaSource) { - mMediaSource->setVolume(volume); + mMediaSource->setVolume(mRequestedVolume * LLViewerMedia::getVolume()); } } ////////////////////////////////////////////////////////////////////////////////////////// +F32 LLViewerMediaImpl::getVolume() +{ + return mRequestedVolume; +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::focus(bool focus) { mHasFocus = focus; @@ -916,8 +1058,18 @@ bool LLViewerMediaImpl::hasFocus() const return mHasFocus; } +std::string LLViewerMediaImpl::getCurrentMediaURL() +{ + if(!mCurrentMediaURL.empty()) + { + return mCurrentMediaURL; + } + + return mMediaURL; +} + ////////////////////////////////////////////////////////////////////////////////////////// -void LLViewerMediaImpl::mouseDown(S32 x, S32 y) +void LLViewerMediaImpl::mouseDown(S32 x, S32 y, MASK mask, S32 button) { scaleMouse(&x, &y); mLastMouseX = x; @@ -925,12 +1077,12 @@ void LLViewerMediaImpl::mouseDown(S32 x, S32 y) // llinfos << "mouse down (" << x << ", " << y << ")" << llendl; if (mMediaSource) { - mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, x, y, 0); + mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOWN, button, x, y, mask); } } ////////////////////////////////////////////////////////////////////////////////////////// -void LLViewerMediaImpl::mouseUp(S32 x, S32 y) +void LLViewerMediaImpl::mouseUp(S32 x, S32 y, MASK mask, S32 button) { scaleMouse(&x, &y); mLastMouseX = x; @@ -938,12 +1090,12 @@ void LLViewerMediaImpl::mouseUp(S32 x, S32 y) // llinfos << "mouse up (" << x << ", " << y << ")" << llendl; if (mMediaSource) { - mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, x, y, 0); + mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, button, x, y, mask); } } ////////////////////////////////////////////////////////////////////////////////////////// -void LLViewerMediaImpl::mouseMove(S32 x, S32 y) +void LLViewerMediaImpl::mouseMove(S32 x, S32 y, MASK mask) { scaleMouse(&x, &y); mLastMouseX = x; @@ -951,50 +1103,65 @@ void LLViewerMediaImpl::mouseMove(S32 x, S32 y) // llinfos << "mouse move (" << x << ", " << y << ")" << llendl; if (mMediaSource) { - mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_MOVE, x, y, 0); + mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, x, y, mask); } } ////////////////////////////////////////////////////////////////////////////////////////// -void LLViewerMediaImpl::mouseDown(const LLVector2& texture_coords) +void LLViewerMediaImpl::mouseDown(const LLVector2& texture_coords, MASK mask, S32 button) { if(mMediaSource) { mouseDown( llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight())); + llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), + mask, button); } } -void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords) +void LLViewerMediaImpl::mouseUp(const LLVector2& texture_coords, MASK mask, S32 button) { if(mMediaSource) { mouseUp( llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight())); + llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), + mask, button); } } -void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords) +void LLViewerMediaImpl::mouseMove(const LLVector2& texture_coords, MASK mask) { if(mMediaSource) { mouseMove( llround(texture_coords.mV[VX] * mMediaSource->getTextureWidth()), - llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight())); + llround((1.0f - texture_coords.mV[VY]) * mMediaSource->getTextureHeight()), + mask); } } ////////////////////////////////////////////////////////////////////////////////////////// -void LLViewerMediaImpl::mouseLeftDoubleClick(S32 x, S32 y) +void LLViewerMediaImpl::mouseDoubleClick(S32 x, S32 y, MASK mask, S32 button) { scaleMouse(&x, &y); mLastMouseX = x; mLastMouseY = y; if (mMediaSource) { - mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOUBLE_CLICK, x, y, 0); + mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_DOUBLE_CLICK, button, x, y, mask); + } +} + +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::scrollWheel(S32 x, S32 y, MASK mask) +{ + scaleMouse(&x, &y); + mLastMouseX = x; + mLastMouseY = y; + if (mMediaSource) + { + mMediaSource->scrollEvent(x, y, mask); } } @@ -1003,7 +1170,7 @@ void LLViewerMediaImpl::onMouseCaptureLost() { if (mMediaSource) { - mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, mLastMouseX, mLastMouseY, 0); + mMediaSource->mouseEvent(LLPluginClassMedia::MOUSE_EVENT_UP, 0, mLastMouseX, mLastMouseY, 0); } } @@ -1023,6 +1190,17 @@ BOOL LLViewerMediaImpl::handleMouseUp(S32 x, S32 y, MASK mask) } ////////////////////////////////////////////////////////////////////////////////////////// +std::string LLViewerMediaImpl::getName() const +{ + if (mMediaSource) + { + return mMediaSource->getMediaName(); + } + + return LLStringUtil::null; +}; + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateBack() { if (mMediaSource) @@ -1071,7 +1249,7 @@ void LLViewerMediaImpl::navigateForward() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateReload() { - navigateTo(mMediaURL, "", true, false); + navigateTo(getCurrentMediaURL(), "", true, false); } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1083,39 +1261,57 @@ void LLViewerMediaImpl::navigateHome() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mime_type, bool rediscover_type, bool server_request) { - // Helpful to have media urls in log file. Shouldn't be spammy. - llinfos << "url=" << url << " mime_type=" << mime_type << llendl; - - if(server_request) - { - setNavState(MEDIANAVSTATE_SERVER_SENT); - } - else + if(mMediaURL != url) { - setNavState(MEDIANAVSTATE_NONE); + // Don't carry media play state across distinct URLs. + resetPreviousMediaState(); } // Always set the current URL and MIME type. mMediaURL = url; mMimeType = mime_type; - // If the current URL is not null, make the instance do a navigate on load. - mDoNavigateOnLoad = !mMediaURL.empty(); - + // Clear the current media URL, since it will no longer be correct. + mCurrentMediaURL.clear(); + // if mime type discovery was requested, we'll need to do it when the media loads - mDoNavigateOnLoadRediscoverType = rediscover_type; + mNavigateRediscoverType = rediscover_type; // and if this was a server request, the navigate on load will also need to be one. - mDoNavigateOnLoadServerRequest = server_request; + mNavigateServerRequest = server_request; + + // An explicit navigate resets the "failed" flag. + mMediaSourceFailed = false; if(mPriority == LLPluginClassMedia::PRIORITY_UNLOADED) { + // Helpful to have media urls in log file. Shouldn't be spammy. + llinfos << "NOT LOADING media id= " << mTextureId << " url=" << url << " mime_type=" << mime_type << llendl; + // This impl should not be loaded at this time. LL_DEBUGS("PluginPriority") << this << "Not loading (PRIORITY_UNLOADED)" << LL_ENDL; return; } - + + navigateInternal(); +} + +////////////////////////////////////////////////////////////////////////////////////////// +void LLViewerMediaImpl::navigateInternal() +{ + // Helpful to have media urls in log file. Shouldn't be spammy. + llinfos << "media id= " << mTextureId << " url=" << mMediaURL << " mime_type=" << mMimeType << llendl; + + if(mNavigateServerRequest) + { + setNavState(MEDIANAVSTATE_SERVER_SENT); + } + else + { + setNavState(MEDIANAVSTATE_NONE); + } + // If the caller has specified a non-empty MIME type, look that up in our MIME types list. // If we have a plugin for that MIME type, use that instead of attempting auto-discovery. // This helps in supporting legacy media content where the server the media resides on returns a bogus MIME type @@ -1127,11 +1323,11 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi if(!plugin_basename.empty()) { // We have a plugin for this mime type - rediscover_type = false; + mNavigateRediscoverType = false; } } - if(rediscover_type) + if(mNavigateRediscoverType) { LLURI uri(mMediaURL); @@ -1147,7 +1343,7 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi // We use "data" internally for a text/html url for loading the login screen if(initializeMedia("text/html")) { - mMediaSource->loadURI( mMediaURL ); + loadURI(); } } else @@ -1155,24 +1351,18 @@ void LLViewerMediaImpl::navigateTo(const std::string& url, const std::string& mi // This catches 'rtsp://' urls if(initializeMedia(scheme)) { - mMediaSource->loadURI( mMediaURL ); + loadURI(); } } } - else if (mMediaSource) - { - mMediaSource->loadURI( mMediaURL ); - } - else if(initializeMedia(mime_type) && mMediaSource) + else if(initializeMedia(mMimeType)) { - mMediaSource->loadURI( mMediaURL ); + loadURI(); } else { - LL_WARNS("Media") << "Couldn't navigate to: " << url << " as there is no media type for: " << mime_type << LL_ENDL; - return; + LL_WARNS("Media") << "Couldn't navigate to: " << mMediaURL << " as there is no media type for: " << mMimeType << LL_ENDL; } - } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1223,6 +1413,8 @@ bool LLViewerMediaImpl::handleKeyHere(KEY key, MASK mask) if(!result) { result = mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_DOWN ,key, mask); + // Since the viewer internal event dispatching doesn't give us key-up events, simulate one here. + (void)mMediaSource->keyEvent(LLPluginClassMedia::KEY_EVENT_UP ,key, mask); } } @@ -1240,7 +1432,7 @@ bool LLViewerMediaImpl::handleUnicodeCharHere(llwchar uni_char) if (uni_char >= 32 // discard 'control' characters && uni_char != 127) // SDL thinks this is 'delete' - yuck. { - mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char))); + mMediaSource->textInput(wstring_to_utf8str(LLWString(1, uni_char)), gKeyboard->currentMask(FALSE)); } } @@ -1272,7 +1464,7 @@ bool LLViewerMediaImpl::canNavigateBack() ////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::update() { - if(mMediaSource == NULL && !mMediaSourceFailedInit) + if(mMediaSource == NULL) { if(mPriority != LLPluginClassMedia::PRIORITY_UNLOADED) { @@ -1299,6 +1491,7 @@ void LLViewerMediaImpl::update() if(mMediaSource->isPluginExited()) { + resetPreviousMediaState(); destroyMediaSource(); return; } @@ -1415,7 +1608,7 @@ LLViewerMediaTexture* LLViewerMediaImpl::updatePlaceholderImage() ////////////////////////////////////////////////////////////////////////////////////////// -LLUUID LLViewerMediaImpl::getMediaTextureID() +LLUUID LLViewerMediaImpl::getMediaTextureID() const { return mTextureId; } @@ -1495,6 +1688,35 @@ bool LLViewerMediaImpl::hasMedia() } ////////////////////////////////////////////////////////////////////////////////////////// +// +void LLViewerMediaImpl::resetPreviousMediaState() +{ + mPreviousMediaState = MEDIA_NONE; + mPreviousMediaTime = 0.0f; +} + +////////////////////////////////////////////////////////////////////////////////////////// +// +bool LLViewerMediaImpl::isForcedUnloaded() const +{ + if(mIsMuted || mMediaSourceFailed || mIsDisabled) + { + return true; + } + + if(sInWorldMediaDisabled) + { + // When inworld media is disabled, all instances that aren't marked as "used in UI" will not be loaded. + if(!mUsedInUI) + { + return true; + } + } + + return false; +} + +////////////////////////////////////////////////////////////////////////////////////////// void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginClassMediaOwner::EMediaEvent event) { switch(event) @@ -1502,7 +1724,11 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla case MEDIA_EVENT_PLUGIN_FAILED_LAUNCH: { // The plugin failed to load properly. Make sure the timer doesn't retry. - mMediaSourceFailedInit = true; + // TODO: maybe mark this plugin as not loadable somehow? + mMediaSourceFailed = true; + + // Reset the last known state of the media to defaults. + resetPreviousMediaState(); // TODO: may want a different message for this case? LLSD args; @@ -1513,6 +1739,12 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla case MEDIA_EVENT_PLUGIN_FAILED: { + // The plugin crashed. + mMediaSourceFailed = true; + + // Reset the last known state of the media to defaults. + resetPreviousMediaState(); + LLSD args; args["PLUGIN"] = LLMIMETypes::implType(mMimeType); // SJB: This is getting called every frame if the plugin fails to load, continuously respawining the alert! @@ -1562,10 +1794,12 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla if(getNavState() == MEDIANAVSTATE_BEGUN) { + mCurrentMediaURL = plugin->getNavigateURI(); setNavState(MEDIANAVSTATE_COMPLETE_BEFORE_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { + mCurrentMediaURL = plugin->getNavigateURI(); setNavState(MEDIANAVSTATE_SERVER_COMPLETE_BEFORE_LOCATION_CHANGED); } else @@ -1581,10 +1815,12 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla if(getNavState() == MEDIANAVSTATE_BEGUN) { + mCurrentMediaURL = plugin->getLocation(); setNavState(MEDIANAVSTATE_FIRST_LOCATION_CHANGED); } else if(getNavState() == MEDIANAVSTATE_SERVER_BEGUN) { + mCurrentMediaURL = plugin->getLocation(); setNavState(MEDIANAVSTATE_SERVER_FIRST_LOCATION_CHANGED); } else @@ -1687,6 +1923,32 @@ void LLViewerMediaImpl::calculateInterest() // This will be a relatively common case now, since it will always be true for unloaded media. mInterest = 0.0f; } + + if(mNeedsMuteCheck) + { + // Check all objects this instance is associated with, and those objects' owners, against the mute list + mIsMuted = false; + + std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; + for(; iter != mObjectList.end() ; ++iter) + { + LLVOVolume *obj = *iter; + if(LLMuteList::getInstance()->isMuted(obj->getID())) + mIsMuted = true; + else + { + // We won't have full permissions data for all objects. Attempt to mute objects when we can tell their owners are muted. + LLPermissions* obj_perm = LLSelectMgr::getInstance()->findObjectPermissions(obj); + if(obj_perm) + { + if(LLMuteList::getInstance()->isMuted(obj_perm->getOwner())) + mIsMuted = true; + } + } + } + + mNeedsMuteCheck = false; + } } F64 LLViewerMediaImpl::getApproximateTextureInterest() @@ -1712,11 +1974,11 @@ void LLViewerMediaImpl::setUsedInUI(bool used_in_ui) { if(getVisible()) { - mPriority = LLPluginClassMedia::PRIORITY_NORMAL; + setPriority(LLPluginClassMedia::PRIORITY_NORMAL); } else { - mPriority = LLPluginClassMedia::PRIORITY_HIDDEN; + setPriority(LLPluginClassMedia::PRIORITY_HIDDEN); } createMediaSource(); @@ -1737,6 +1999,15 @@ F64 LLViewerMediaImpl::getCPUUsage() const void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority) { + if(mPriority != priority) + { + LL_INFOS("PluginPriority") + << "changing priority of media id " << mTextureId + << " from " << LLPluginClassMedia::priorityToString(mPriority) + << " to " << LLPluginClassMedia::priorityToString(priority) + << LL_ENDL; + } + mPriority = priority; if(priority == LLPluginClassMedia::PRIORITY_UNLOADED) @@ -1744,6 +2015,11 @@ void LLViewerMediaImpl::setPriority(LLPluginClassMedia::EPriority priority) if(mMediaSource) { // Need to unload the media source + + // First, save off previous media state + mPreviousMediaState = mMediaSource->getStatus(); + mPreviousMediaTime = mMediaSource->getCurrentTime(); + destroyMediaSource(); } } @@ -1794,11 +2070,13 @@ void LLViewerMediaImpl::addObject(LLVOVolume* obj) } mObjectList.push_back(obj) ; + mNeedsMuteCheck = true; } void LLViewerMediaImpl::removeObject(LLVOVolume* obj) { mObjectList.remove(obj) ; + mNeedsMuteCheck = true; } const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const @@ -1806,6 +2084,19 @@ const std::list< LLVOVolume* >* LLViewerMediaImpl::getObjectList() const return &mObjectList ; } +LLVOVolume *LLViewerMediaImpl::getSomeObject() +{ + LLVOVolume *result = NULL; + + std::list< LLVOVolume* >::iterator iter = mObjectList.begin() ; + if(iter != mObjectList.end()) + { + result = *iter; + } + + return result; +} + ////////////////////////////////////////////////////////////////////////////////////////// //static void LLViewerMedia::toggleMusicPlay(void*) diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index fc2776ee91..517a76ce3d 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -66,10 +66,15 @@ private: observerListType mObservers; }; +class LLViewerMediaImpl; + class LLViewerMedia { LOG_CLASS(LLViewerMedia); public: + + typedef std::vector<LLViewerMediaImpl*> impl_list; + // Special case early init for just web browser component // so we can show login screen. See .cpp file for details. JC @@ -95,6 +100,16 @@ class LLViewerMedia static void toggleMusicPlay(void*); static void toggleMediaPlay(void*); static void mediaStop(void*); + static F32 getVolume(); + static void muteListChanged(); + static void setInWorldMediaDisabled(bool disabled); + static bool getInWorldMediaDisabled(); + + // Returns the priority-sorted list of all media impls. + static impl_list &getPriorityList(); + + // This is the comparitor used to sort the list. + static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2); }; // Implementation functions not exported into header file @@ -121,6 +136,7 @@ public: void setMediaType(const std::string& media_type); bool initializeMedia(const std::string& mime_type); bool initializePlugin(const std::string& media_type); + void loadURI(); LLPluginClassMedia* getMediaPlugin() { return mMediaSource; } void setSize(int width, int height); @@ -130,16 +146,19 @@ public: void start(); void seek(F32 time); void setVolume(F32 volume); + void updateVolume(); + F32 getVolume(); void focus(bool focus); // True if the impl has user focus. bool hasFocus() const; - void mouseDown(S32 x, S32 y); - void mouseUp(S32 x, S32 y); - void mouseMove(S32 x, S32 y); - void mouseDown(const LLVector2& texture_coords); - void mouseUp(const LLVector2& texture_coords); - void mouseMove(const LLVector2& texture_coords); - void mouseLeftDoubleClick(S32 x,S32 y ); + void mouseDown(S32 x, S32 y, MASK mask, S32 button = 0); + void mouseUp(S32 x, S32 y, MASK mask, S32 button = 0); + void mouseMove(S32 x, S32 y, MASK mask); + void mouseDown(const LLVector2& texture_coords, MASK mask, S32 button = 0); + void mouseUp(const LLVector2& texture_coords, MASK mask, S32 button = 0); + void mouseMove(const LLVector2& texture_coords, MASK mask); + void mouseDoubleClick(S32 x,S32 y, MASK mask, S32 button = 0); + void scrollWheel(S32 x, S32 y, MASK mask); void mouseCapture(); void navigateBack(); @@ -147,12 +166,14 @@ public: void navigateReload(); void navigateHome(); void navigateTo(const std::string& url, const std::string& mime_type = "", bool rediscover_type = false, bool server_request = false); + void navigateInternal(); void navigateStop(); bool handleKeyHere(KEY key, MASK mask); bool handleUnicodeCharHere(llwchar uni_char); bool canNavigateForward(); bool canNavigateBack(); - std::string getMediaURL() { return mMediaURL; } + std::string getMediaURL() const { return mMediaURL; } + std::string getCurrentMediaURL(); std::string getHomeURL() { return mHomeURL; } void setHomeURL(const std::string& home_url) { mHomeURL = home_url; }; std::string getMimeType() { return mMimeType; } @@ -160,7 +181,7 @@ public: void update(); void updateImagesMediaStreams(); - LLUUID getMediaTextureID(); + LLUUID getMediaTextureID() const; void suspendUpdates(bool suspend) { mSuspendUpdates = suspend; }; void setVisible(bool visible); @@ -169,6 +190,14 @@ public: bool isMediaPlaying(); bool isMediaPaused(); bool hasMedia(); + bool isMediaFailed() { return mMediaSourceFailed; }; + void resetPreviousMediaState(); + + void setDisabled(bool disabled) { mIsDisabled = disabled; }; + bool isMediaDisabled() { return mIsDisabled; }; + + // returns true if this instance should not be loaded (disabled, muted object, crashed, etc.) + bool isForcedUnloaded() const; ECursorType getLastSetCursor() { return mLastSetCursor; }; @@ -199,7 +228,7 @@ public: /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseDown(S32 x, S32 y, MASK mask) { return FALSE; }; /*virtual*/ BOOL handleMiddleMouseUp(S32 x, S32 y, MASK mask) {return FALSE; }; - /*virtual*/ std::string getName() const { return LLStringUtil::null; }; + /*virtual*/ std::string getName() const; /*virtual*/ void screenPointToLocal(S32 screen_x, S32 screen_y, S32* local_x, S32* local_y) const {}; /*virtual*/ void localPointToScreen(S32 local_x, S32 local_y, S32* screen_x, S32* screen_y) const {}; @@ -221,6 +250,7 @@ public: void addObject(LLVOVolume* obj) ; void removeObject(LLVOVolume* obj) ; const std::list< LLVOVolume* >* getObjectList() const ; + LLVOVolume *getSomeObject(); void setUpdated(BOOL updated) ; BOOL isUpdated() ; @@ -228,6 +258,7 @@ public: void calculateInterest(); F64 getInterest() const { return mInterest; }; F64 getApproximateTextureInterest(); + S32 getProximity() { return mProximity; }; // Mark this object as being used in a UI panel instead of on a prim // This will be used as part of the interest sorting algorithm. @@ -264,9 +295,10 @@ public: LLPluginClassMedia* mMediaSource; LLUUID mTextureId; bool mMovieImageHasMips; - std::string mMediaURL; + std::string mMediaURL; // The last media url set with NavigateTo std::string mHomeURL; std::string mMimeType; + std::string mCurrentMediaURL; // The most current media url from the plugin (via the "location changed" or "navigate complete" events). S32 mLastMouseX; // save the last mouse coord we get, so when we lose capture we can simulate a mouseup at that point. S32 mLastMouseY; S32 mMediaWidth; @@ -282,11 +314,16 @@ public: bool mUsedInUI; bool mHasFocus; LLPluginClassMedia::EPriority mPriority; - bool mDoNavigateOnLoad; - bool mDoNavigateOnLoadRediscoverType; - bool mDoNavigateOnLoadServerRequest; - bool mMediaSourceFailedInit; - + bool mNavigateRediscoverType; + bool mNavigateServerRequest; + bool mMediaSourceFailed; + F32 mRequestedVolume; + bool mIsMuted; + bool mNeedsMuteCheck; + int mPreviousMediaState; + F64 mPreviousMediaTime; + bool mIsDisabled; + S32 mProximity; private: BOOL mIsUpdated ; diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index cad8b5f0ce..2f7040aaa3 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -35,7 +35,7 @@ //LLViewerMediaFocus #include "llviewerobjectlist.h" -#include "llpanelmediahud.h" +#include "llpanelprimmediacontrols.h" #include "llpluginclassmedia.h" #include "llagent.h" #include "lltoolpie.h" @@ -48,6 +48,10 @@ #include "llviewerparcelmgr.h" #include "llweb.h" #include "llmediaentry.h" +#include "llkeyboard.h" +#include "lltoolmgr.h" +#include "llvovolume.h" + // // LLViewerMediaFocus // @@ -77,7 +81,6 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac if (media_impl.notNull() && objectp.notNull()) { bool face_auto_zoom = false; - media_impl->focus(true); mFocusedImplID = media_impl->getMediaTextureID(); mFocusedObjectID = objectp->getID(); @@ -101,26 +104,30 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac llwarns << "Can't find media entry for focused face" << llendl; } + media_impl->focus(true); gFocusMgr.setKeyboardFocus(this); // We must do this before processing the media HUD zoom, or it may zoom to the wrong face. update(); - if(mMediaHUD.get() && face_auto_zoom && ! parcel->getMediaPreventCameraZoom()) + if(mMediaControls.get() && face_auto_zoom && ! parcel->getMediaPreventCameraZoom()) { - mMediaHUD.get()->resetZoomLevel(); - mMediaHUD.get()->nextZoomLevel(); + mMediaControls.get()->resetZoomLevel(); + mMediaControls.get()->nextZoomLevel(); } } else { - if(hasFocus()) + if(mFocusedImplID.notNull()) { - if(mMediaHUD.get()) + if(mMediaControls.get()) { - mMediaHUD.get()->resetZoomLevel(); + mMediaControls.get()->resetZoomLevel(); } + } + if(hasFocus()) + { gFocusMgr.setKeyboardFocus(NULL); } @@ -249,20 +256,18 @@ void LLViewerMediaFocus::setCameraZoom(LLViewerObject* object, LLVector3 normal, } void LLViewerMediaFocus::onFocusReceived() { - // Don't do this here -- this doesn't change "inworld media focus", it just changes whether the viewer's input is focused on the media. -// LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); -// if(media_impl.notNull()) -// media_impl->focus(true); + LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); + if(media_impl) + media_impl->focus(true); LLFocusableElement::onFocusReceived(); } void LLViewerMediaFocus::onFocusLost() { - // Don't do this here -- this doesn't change "inworld media focus", it just changes whether the viewer's input is focused on the media. -// LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); -// if(media_impl.notNull()) -// media_impl->focus(false); + LLViewerMediaImpl* media_impl = getFocusedMediaImpl(); + if(media_impl) + media_impl->focus(false); gViewerWindow->focusClient(); LLFocusableElement::onFocusLost(); @@ -300,8 +305,9 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks) // the scrollEvent() API's x and y are not the same as handleScrollWheel's x and y. // The latter is the position of the mouse at the time of the event // The former is the 'scroll amount' in x and y, respectively. - // All we have for 'scroll amount' here is 'clicks', and no mask. - media_impl->getMediaPlugin()->scrollEvent(0, clicks, /*mask*/0); + // All we have for 'scroll amount' here is 'clicks'. + // We're also not passed the keyboard modifier mask, but we can get that from gKeyboard. + media_impl->getMediaPlugin()->scrollEvent(0, clicks, gKeyboard->currentMask(TRUE)); retval = TRUE; } return retval; @@ -309,6 +315,30 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks) void LLViewerMediaFocus::update() { + if(mFocusedImplID.notNull() || mFocusedObjectID.notNull()) + { + // We have a focused impl/face. + if(!getFocus()) + { + // We've lost keyboard focus -- check to see whether the media controls have it + if(mMediaControls.get() && mMediaControls.get()->hasFocus()) + { + // the media controls have focus -- don't clear. + } + else + { + // Someone else has focus -- back off. + clearFocus(); + } + } + else if(LLToolMgr::getInstance()->inBuildMode()) + { + // Build tools are selected -- clear focus. + clearFocus(); + } + } + + LLViewerMediaImpl *media_impl = getFocusedMediaImpl(); LLViewerObject *viewer_object = getFocusedObject(); S32 face = mFocusedObjectFace; @@ -329,20 +359,20 @@ void LLViewerMediaFocus::update() // We have an object and impl to point at. // Make sure the media HUD object exists. - if(! mMediaHUD.get()) + if(! mMediaControls.get()) { - LLPanelMediaHUD* media_hud = new LLPanelMediaHUD(); - mMediaHUD = media_hud->getHandle(); - gHUDView->addChild(media_hud); + LLPanelPrimMediaControls* media_controls = new LLPanelPrimMediaControls(); + mMediaControls = media_controls->getHandle(); + gHUDView->addChild(media_controls); } - mMediaHUD.get()->setMediaFace(viewer_object, face, media_impl, normal); + mMediaControls.get()->setMediaFace(viewer_object, face, media_impl, normal); } else { // The media HUD is no longer needed. - if(mMediaHUD.get()) + if(mMediaControls.get()) { - mMediaHUD.get()->setMediaFace(NULL, 0, NULL); + mMediaControls.get()->setMediaFace(NULL, 0, NULL); } } } @@ -444,3 +474,46 @@ LLViewerObject* LLViewerMediaFocus::getHoverObject() { return gObjectList.findObject(mHoverObjectID); } + +void LLViewerMediaFocus::focusZoomOnMedia(LLUUID media_id) +{ + LLViewerMediaImpl* impl = LLViewerMedia::getMediaImplFromTextureID(media_id); + + if(impl) + { + // Get the first object from the media impl's object list. This is completely arbitrary, but should suffice. + LLVOVolume *obj = impl->getSomeObject(); + if(obj) + { + // This media is attached to at least one object. Figure out which face it's on. + S32 face = obj->getFaceIndexWithMediaImpl(impl, -1); + + // We don't have a proper pick normal here, and finding a face's real normal is... complicated. + // For now, use +z to look at the top of the object. + LLVector3 normal(0.0f, 0.0f, 1.0f); + + // Attempt to focus/zoom on that face. + setFocusFace(obj, face, impl, normal); + + if(mMediaControls.get()) + { + mMediaControls.get()->resetZoomLevel(); + mMediaControls.get()->nextZoomLevel(); + } + } + } +} + +LLUUID LLViewerMediaFocus::getControlsMediaID() +{ + if(getFocusedMediaImpl()) + { + return mFocusedImplID; + } + else if(getHoverMediaImpl()) + { + return mHoverImplID; + } + + return LLUUID::null; +} diff --git a/indra/newview/llviewermediafocus.h b/indra/newview/llviewermediafocus.h index c77533ba5a..e5f36d341c 100644 --- a/indra/newview/llviewermediafocus.h +++ b/indra/newview/llviewermediafocus.h @@ -40,7 +40,7 @@ #include "llselectmgr.h" class LLViewerMediaImpl; -class LLPanelMediaHUD; +class LLPanelPrimMediaControls; class LLViewerMediaFocus : public LLFocusableElement, @@ -81,6 +81,12 @@ public: LLViewerMediaImpl* getHoverMediaImpl(); LLViewerObject* getHoverObject(); S32 getHoverFace() { return mHoverObjectFace; } + + // Try to focus/zoom on the specified media (if it's on an object in world). + void focusZoomOnMedia(LLUUID media_id); + + // Return the ID of the media instance the controls are currently attached to (either focus or hover). + LLUUID getControlsMediaID(); protected: /*virtual*/ void onFocusReceived(); @@ -88,7 +94,7 @@ protected: private: - LLHandle<LLPanelMediaHUD> mMediaHUD; + LLHandle<LLPanelPrimMediaControls> mMediaControls; LLUUID mFocusedObjectID; S32 mFocusedObjectFace; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a1c15d9d0f..864cf9d57b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -1678,34 +1678,6 @@ class LLAdvancedTogglePG : public view_listener_t }; - -//////////////////////////// -// ALLOW TAP-TAP-HOLD RUN // -//////////////////////////// - - -class LLAdvancedToggleAllowTapTapHoldRun : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - gAllowTapTapHoldRun = !(gAllowTapTapHoldRun); - return true; - } -}; - -class LLAdvancedCheckAllowTapTapHoldRun : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - bool new_value = gAllowTapTapHoldRun; - return new_value; - } -}; - - - - - class LLAdvancedForceParamsToDefault : public view_listener_t { bool handleEvent(const LLSD& userdata) @@ -3511,7 +3483,6 @@ void set_god_level(U8 god_level) { U8 old_god_level = gAgent.getGodLevel(); gAgent.setGodLevel( god_level ); - gIMMgr->refresh(); LLViewerParcelMgr::getInstance()->notifyObservers(); // God mode changes sim visibility @@ -7966,8 +7937,6 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedTogglePG(), "Advanced.TogglePG"); // Advanced > Character (toplevel) - view_listener_t::addMenu(new LLAdvancedToggleAllowTapTapHoldRun(), "Advanced.ToggleAllowTapTapHoldRun"); - view_listener_t::addMenu(new LLAdvancedCheckAllowTapTapHoldRun(), "Advanced.CheckAllowTapTapHoldRun"); view_listener_t::addMenu(new LLAdvancedForceParamsToDefault(), "Advanced.ForceParamsToDefault"); view_listener_t::addMenu(new LLAdvancedReloadVertexShader(), "Advanced.ReloadVertexShader"); view_listener_t::addMenu(new LLAdvancedToggleAnimationInfo(), "Advanced.ToggleAnimationInfo"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 791ec07349..5fd762ab3d 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -72,7 +72,6 @@ #include "llviewercontrol.h" #include "lldrawpool.h" #include "llfirstuse.h" -#include "llfloateractivespeakers.h" #include "llfloateranimpreview.h" #include "llfloaterbuycurrency.h" #include "llfloaterbuyland.h" @@ -89,7 +88,6 @@ #include "llhudeffect.h" #include "llhudeffecttrail.h" #include "llhudmanager.h" -#include "llimpanel.h" #include "llinventorymodel.h" #include "llfloaterinventory.h" #include "llmenugl.h" @@ -1597,8 +1595,12 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) // Claim to be from a local agent so it doesn't go into // console. chat.mText = name + separator_string + message.substr(message_offset); - BOOL local_agent = TRUE; - LLFloaterChat::addChat(chat, FALSE, local_agent); + + LLNearbyChat* nearby_chat = LLFloaterReg::getTypedInstance<LLNearbyChat>("nearby_chat", LLSD()); + if(nearby_chat) + { + nearby_chat->addMessage(chat); + } } else { @@ -2378,7 +2380,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) switch(chat.mChatType) { case CHAT_TYPE_WHISPER: - verb = "(" + LLTrans::getString("whisper") + ")"; + verb = LLTrans::getString("whisper") + " "; break; case CHAT_TYPE_DEBUG_MSG: case CHAT_TYPE_OWNER: @@ -2386,7 +2388,7 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) verb = ""; break; case CHAT_TYPE_SHOUT: - verb = "(" + LLTrans::getString("shout") + ")"; + verb = LLTrans::getString("shout") + " "; break; case CHAT_TYPE_START: case CHAT_TYPE_STOP: @@ -5680,7 +5682,7 @@ void onCovenantLoadComplete(LLVFS *vfs, LLPanelLandCovenant::updateCovenantText(covenant_text); LLFloaterBuyLand::updateCovenantText(covenant_text, asset_uuid); - LLPanelPlaceInfo* panel = dynamic_cast<LLPanelPlaceInfo*>(LLSideTray::getInstance()->showPanel("panel_place_info", LLSD())); + LLPanelPlaceInfo* panel = LLSideTray::getInstance()->findChild<LLPanelPlaceInfo>("panel_place_info"); if (panel) { panel->updateCovenantText(covenant_text); diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 77b023f6dd..aa0987aa7d 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -843,8 +843,11 @@ void LLViewerParcelMgr::renderParcelCollision() if (mRenderCollision && gSavedSettings.getBOOL("ShowBanLines")) { LLViewerRegion* regionp = gAgent.getRegion(); - BOOL use_pass = mCollisionParcel->getParcelFlag(PF_USE_PASS_LIST); - renderCollisionSegments(mCollisionSegments, use_pass, regionp); + if (regionp) + { + BOOL use_pass = mCollisionParcel->getParcelFlag(PF_USE_PASS_LIST); + renderCollisionSegments(mCollisionSegments, use_pass, regionp); + } } } diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 65994dfb30..5c40f2a540 100644 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -44,6 +44,9 @@ #include "llinventory.h" #include "llinventorybridge.h" #include "llinventorymodel.h" +#include "lllandmark.h" +#include "lllandmarkactions.h" +#include "lllandmarklist.h" #include "llmemorystream.h" #include "llmenugl.h" #include "llnotecard.h" @@ -64,10 +67,47 @@ #include "llviewertexturelist.h" #include "llviewerwindow.h" -#include "llappviewer.h" // for gPacificDaylightTime - static LLDefaultChildRegistry::Register<LLViewerTextEditor> r("text_editor"); +///----------------------------------------------------------------------- +/// Class LLEmbeddedLandmarkCopied +///----------------------------------------------------------------------- +class LLEmbeddedLandmarkCopied: public LLInventoryCallback +{ +public: + + LLEmbeddedLandmarkCopied(){} + void fire(const LLUUID& inv_item) + { + showInfo(inv_item); + } + static void showInfo(const LLUUID& landmark_inv_id) + { + LLSD key; + key["type"] = "landmark"; + key["id"] = landmark_inv_id; + LLSideTray::getInstance()->showPanel("panel_places", key); + } + static void processForeignLandmark(LLLandmark* landmark, + const LLUUID& object_id, const LLUUID& notecard_inventory_id, + LLInventoryItem* item) + { + LLVector3d global_pos; + landmark->getGlobalPos(global_pos); + LLViewerInventoryItem* agent_lanmark = + LLLandmarkActions::findLandmarkForGlobalPos(global_pos); + + if (agent_lanmark) + { + showInfo(agent_lanmark->getUUID()); + } + else + { + LLPointer<LLEmbeddedLandmarkCopied> cb = new LLEmbeddedLandmarkCopied(); + copy_inventory_from_notecard(object_id, notecard_inventory_id, item, gInventoryCallbacks.registerCB(cb)); + } + } +}; ///---------------------------------------------------------------------------- /// Class LLEmbeddedNotecardOpener ///---------------------------------------------------------------------------- @@ -1099,14 +1139,12 @@ void LLViewerTextEditor::openEmbeddedLandmark( LLInventoryItem* item, llwchar wc if (!item) return; - LLSD key; - key["type"] = "landmark"; - key["id"] = item->getUUID(); - - LLPanelPlaces *panel = dynamic_cast<LLPanelPlaces*>(LLSideTray::getInstance()->showPanel("panel_places", key)); - if (panel) + LLLandmark* landmark = gLandmarkList.getAsset(item->getAssetUUID(), + boost::bind(&LLEmbeddedLandmarkCopied::processForeignLandmark, _1, mObjectID, mNotecardInventoryID, item)); + if (landmark) { - panel->setItem(item); + LLEmbeddedLandmarkCopied::processForeignLandmark(landmark, mObjectID, + mNotecardInventoryID, item); } } diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index e5c53c91c9..758bf8c1aa 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -93,6 +93,7 @@ BOOL LLViewerTexture::sUseTextureAtlas = FALSE ; const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve image quality by const F32 desired_discard_bias_max = 1.5f; // max number of levels to reduce image quality by +const F64 log_2 = log(2.0); //---------------------------------------------------------------------------------------------- //namespace: LLViewerTextureAccess @@ -134,7 +135,7 @@ LLViewerMediaTexture* LLViewerTextureManager::getMediaTexture(const LLUUID& id, return tex ; } -LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLViewerTexture* tex, BOOL report_error) +LLViewerFetchedTexture* LLViewerTextureManager::staticCastToFetchedTexture(LLTexture* tex, BOOL report_error) { if(!tex) { @@ -415,6 +416,7 @@ void LLViewerTexture::init(bool firstinit) mDontDiscard = FALSE; mMaxVirtualSize = 0.f; mNeedsResetMaxVirtualSize = FALSE ; + mParcelMedia = NULL ; } //virtual @@ -522,6 +524,12 @@ F32 LLViewerTexture::getMaxVirtualSize() return mMaxVirtualSize ; } +//virtual +void LLViewerTexture::setKnownDrawSize(S32 width, S32 height) +{ + //nothing here. +} + //virtual void LLViewerTexture::addFace(LLFace* facep) { @@ -852,6 +860,7 @@ void LLViewerFetchedTexture::init(bool firstinit) mKnownDrawWidth = 0; mKnownDrawHeight = 0; + mKnownDrawSizeChanged = FALSE ; if (firstinit) { @@ -1084,10 +1093,17 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) } // Call with 0,0 to turn this feature off. +//virtual void LLViewerFetchedTexture::setKnownDrawSize(S32 width, S32 height) { - mKnownDrawWidth = width; - mKnownDrawHeight = height; + if(mKnownDrawWidth != width || mKnownDrawHeight != height) + { + mKnownDrawWidth = width; + mKnownDrawHeight = height; + + mKnownDrawSizeChanged = TRUE ; + mFullyLoaded = FALSE ; + } addTextureStats((F32)(width * height)); } @@ -1104,13 +1120,26 @@ void LLViewerFetchedTexture::processTextureStats() mDesiredDiscardLevel = getMaxDiscardLevel() ; } else - { - mDesiredDiscardLevel = 0; - if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) + { + if(!mKnownDrawWidth || !mKnownDrawHeight || mFullWidth <= mKnownDrawWidth || mFullHeight <= mKnownDrawHeight) { - mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 + if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT) + { + mDesiredDiscardLevel = 1; // MAX_IMAGE_SIZE_DEFAULT = 1024 and max size ever is 2048 + } + else + { + mDesiredDiscardLevel = 0; + } } - + else if(mKnownDrawSizeChanged)//known draw size is set + { + mDesiredDiscardLevel = (S8)llmin(log((F32)mFullWidth / mKnownDrawWidth) / log_2, + log((F32)mFullHeight / mKnownDrawHeight) / log_2) ; + mDesiredDiscardLevel = llclamp(mDesiredDiscardLevel, (S8)0, (S8)getMaxDiscardLevel()) ; + } + mKnownDrawSizeChanged = FALSE ; + if(getDiscardLevel() >= 0 && (getDiscardLevel() <= mDesiredDiscardLevel)) { mFullyLoaded = TRUE ; @@ -1121,8 +1150,6 @@ void LLViewerFetchedTexture::processTextureStats() //texture does not have any data, so we don't know the size of the image, treat it like 32 * 32. F32 LLViewerFetchedTexture::calcDecodePriorityForUnknownTexture(F32 pixel_priority) { - static const F64 log_2 = log(2.0); - F32 desired = (F32)(log(32.0/pixel_priority) / log_2); S32 ddiscard = MAX_DISCARD_LEVEL - (S32)desired + 1; ddiscard = llclamp(ddiscard, 1, 9); @@ -1169,7 +1196,7 @@ F32 LLViewerFetchedTexture::calcDecodePriority() // Don't decode anything we don't need priority = -1.0f; } - else if (mBoostLevel == LLViewerTexture::BOOST_UI && !have_all_data) + else if ((mBoostLevel == LLViewerTexture::BOOST_UI || mBoostLevel == LLViewerTexture::BOOST_ICON) && !have_all_data) { priority = 1.f; } @@ -2121,22 +2148,29 @@ void LLViewerMediaTexture::updateClass() { static const F32 MAX_INACTIVE_TIME = 30.f ; +#if 0 + //force to play media. + gSavedSettings.setBOOL("AudioSteamingMedia", true) ; + gSavedSettings.setBOOL("AudioStreamingVideo", true) ; +#endif + for(media_map_t::iterator iter = sMediaMap.begin() ; iter != sMediaMap.end(); ) { LLViewerMediaTexture* mediap = iter->second; - - // - //Note: delay some time to delete the media textures to stop endlessly creating and immediately removing media texture. - // - if(mediap->getNumRefs() == 1 && mediap->getLastReferencedTimer()->getElapsedTimeF32() > MAX_INACTIVE_TIME) //one by sMediaMap - { - media_map_t::iterator cur = iter++ ; - sMediaMap.erase(cur) ; - } - else + + if(mediap->getNumRefs() == 1) //one reference by sMediaMap { - ++iter ; + // + //Note: delay some time to delete the media textures to stop endlessly creating and immediately removing media texture. + // + if(mediap->getLastReferencedTimer()->getElapsedTimeF32() > MAX_INACTIVE_TIME) + { + media_map_t::iterator cur = iter++ ; + sMediaMap.erase(cur) ; + continue ; + } } + ++iter ; } } @@ -2189,11 +2223,22 @@ LLViewerMediaTexture::LLViewerMediaTexture(const LLUUID& id, BOOL usemipmaps, LL mIsPlaying = FALSE ; setMediaImpl() ; + + LLViewerTexture* tex = gTextureList.findImage(mID) ; + if(tex) //this media is a parcel media for tex. + { + tex->setParcelMedia(this) ; + } } //virtual LLViewerMediaTexture::~LLViewerMediaTexture() { + LLViewerTexture* tex = gTextureList.findImage(mID) ; + if(tex) //this media is a parcel media for tex. + { + tex->setParcelMedia(NULL) ; + } } void LLViewerMediaTexture::reinit(BOOL usemipmaps /* = TRUE */) @@ -2244,10 +2289,9 @@ BOOL LLViewerMediaTexture::findFaces() mMediaFaceList.clear() ; BOOL ret = TRUE ; - - //for parcel media - LLViewerTexture* tex = gTextureList.findImage(mID) ; - if(tex) + + LLViewerTexture* tex = gTextureList.findImage(mID) ; + if(tex) //this media is a parcel media for tex. { const ll_face_list_t* face_list = tex->getFaceList() ; for(ll_face_list_t::const_iterator iter = face_list->begin(); iter != face_list->end(); ++iter) @@ -2358,7 +2402,7 @@ void LLViewerMediaTexture::addFace(LLFace* facep) mTextureList.push_back(facep->getTexture()) ; //a parcel media. return ; } - + llerrs << "The face does not have a valid texture before media texture." << llendl ; } diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 480e1c1cbc..020478beef 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -163,6 +163,7 @@ public: S32 getFullWidth() const { return mFullWidth; } S32 getFullHeight() const { return mFullHeight; } + /*virtual*/ void setKnownDrawSize(S32 width, S32 height); virtual void addFace(LLFace* facep) ; virtual void removeFace(LLFace* facep) ; @@ -220,6 +221,10 @@ public: BOOL getDontDiscard() const { return mDontDiscard; } //----------------- + void setParcelMedia(LLViewerMediaTexture* media) {mParcelMedia = media;} + BOOL hasParcelMedia() const { return mParcelMedia != NULL;} + LLViewerMediaTexture* getParcelMedia() const { return mParcelMedia;} + /*virtual*/ void updateBindStatsForTester() ; protected: void cleanup() ; @@ -246,6 +251,9 @@ protected: LLPointer<LLImageGL> mGLTexturep ; S8 mDontDiscard; // Keep full res version of this image (for UI, etc) + //do not use LLPointer here. + LLViewerMediaTexture* mParcelMedia ; + protected: typedef enum { @@ -357,7 +365,7 @@ public: // Override the computation of discard levels if we know the exact output // size of the image. Used for UI textures to not decode, even if we have // more data. - void setKnownDrawSize(S32 width, S32 height); + /*virtual*/ void setKnownDrawSize(S32 width, S32 height); void setIsMissingAsset(); /*virtual*/ BOOL isMissingAsset() const { return mIsMissingAsset; } @@ -406,6 +414,8 @@ private: BOOL mFullyLoaded; protected: + std::string mLocalFileName; + S32 mOrigWidth; S32 mOrigHeight; @@ -413,8 +423,7 @@ protected: // Used for UI textures to not decode, even if we have more data. S32 mKnownDrawWidth; S32 mKnownDrawHeight; - - std::string mLocalFileName; + BOOL mKnownDrawSizeChanged ; S8 mDesiredDiscardLevel; // The discard level we'd LIKE to have - if we have it and there's space S8 mMinDesiredDiscardLevel; // The minimum discard level we'd like to have @@ -570,7 +579,7 @@ public: static LLTexturePipelineTester* sTesterp ; //returns NULL if tex is not a LLViewerFetchedTexture nor derived from LLViewerFetchedTexture. - static LLViewerFetchedTexture* staticCastToFetchedTexture(LLViewerTexture* tex, BOOL report_error = FALSE) ; + static LLViewerFetchedTexture* staticCastToFetchedTexture(LLTexture* tex, BOOL report_error = FALSE) ; // //"find-texture" just check if the texture exists, if yes, return it, otherwise return null. diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c659e58e47..b574a9c110 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -142,7 +142,6 @@ #include "llstatview.h" #include "llsurface.h" #include "llsurfacepatch.h" -#include "llimview.h" #include "lltexlayer.h" #include "lltextbox.h" #include "lltexturecache.h" @@ -1519,11 +1518,12 @@ void LLViewerWindow::initWorldUI() getRootView()->addChild(gMorphView); // Make space for nav bar. + LLNavigationBar* navbar = LLNavigationBar::getInstance(); LLRect floater_view_rect = gFloaterView->getRect(); LLRect notify_view_rect = gNotifyBoxView->getRect(); - floater_view_rect.mTop -= NAVIGATION_BAR_HEIGHT; + floater_view_rect.mTop -= navbar->getDefNavBarHeight(); floater_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); - notify_view_rect.mTop -= NAVIGATION_BAR_HEIGHT; + notify_view_rect.mTop -= navbar->getDefNavBarHeight(); notify_view_rect.mBottom += LLBottomTray::getInstance()->getRect().getHeight(); gFloaterView->setRect(floater_view_rect); gNotifyBoxView->setRect(notify_view_rect); @@ -1550,20 +1550,19 @@ void LLViewerWindow::initWorldUI() gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor().get() ); // Navigation bar - - LLNavigationBar* navbar = LLNavigationBar::getInstance(); navbar->reshape(root_rect.getWidth(), navbar->getRect().getHeight(), TRUE); // *TODO: redundant? navbar->translate(0, root_rect.getHeight() - menu_bar_height - navbar->getRect().getHeight()); // FIXME navbar->setBackgroundColor(gMenuBarView->getBackgroundColor().get()); + if (!gSavedSettings.getBOOL("ShowNavbarNavigationPanel")) { - navbar->showNavigationPanel(FALSE); + toggle_show_navigation_panel(LLSD(0)); } if (!gSavedSettings.getBOOL("ShowNavbarFavoritesPanel")) { - navbar->showFavoritesPanel(FALSE); + toggle_show_favorites_panel(LLSD(0)); } if (!gSavedSettings.getBOOL("ShowCameraButton")) @@ -1637,7 +1636,11 @@ void LLViewerWindow::shutdownViews() // DEV-40930: Clear sModalStack. Otherwise, any LLModalDialog left open // will crump with LL_ERRS. LLModalDialog::shutdownModals(); - + + // destroy the nav bar, not currently part of gViewerWindow + // *TODO: Make LLNavigationBar part of gViewerWindow + delete LLNavigationBar::getInstance(); + // Delete all child views. delete mRootView; mRootView = NULL; @@ -2421,19 +2424,35 @@ void LLViewerWindow::updateUI() BOOL handled_by_top_ctrl = FALSE; LLUICtrl* top_ctrl = gFocusMgr.getTopCtrl(); LLMouseHandler* mouse_captor = gFocusMgr.getMouseCapture(); + LLView* captor_view = dynamic_cast<LLView*>(mouse_captor); + + //FIXME: only include captor and captor's ancestors if mouse is truly over them --RN //build set of views containing mouse cursor by traversing UI hierarchy and testing //screen rect against mouse cursor view_handle_set_t mouse_hover_set; - // start at current mouse captor (if is a view) or UI root - LLView* root_view = NULL; - root_view = dynamic_cast<LLView*>(mouse_captor); + // constraint mouse enter events to children of mouse captor + LLView* root_view = captor_view; + + // if mouse captor doesn't exist or isn't a LLView + // then allow mouse enter events on entire UI hierarchy if (!root_view) { root_view = mRootView; } + // include all ancestors of captor_view as automatically having mouse + if (captor_view) + { + LLView* captor_parent_view = captor_view->getParent(); + while(captor_parent_view) + { + mouse_hover_set.insert(captor_parent_view->getHandle()); + captor_parent_view = captor_parent_view->getParent(); + } + } + // aggregate visible views that contain mouse cursor in display order // while the top_ctrl contains the mouse cursor, only it and its descendants will receive onMouseEnter events diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index a402aff8ab..4bf66ba17e 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -2448,28 +2448,20 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } else { - F32 blend_frac = calc_bouncy_animation(appearance_anim_time / APPEARANCE_MORPH_TIME); - F32 last_blend_frac = calc_bouncy_animation(mLastAppearanceBlendTime / APPEARANCE_MORPH_TIME); - F32 morph_amt; - if (last_blend_frac == 1.f) - { - morph_amt = 1.f; - } - else - { - morph_amt = (blend_frac - last_blend_frac) / (1.f - last_blend_frac); - } - + F32 morph_amt = calcMorphAmount(); LLVisualParam *param; - // animate only top level params - for (param = getFirstVisualParam(); - param; - param = getNextVisualParam()) + if (!isSelf()) { - if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + // animate only top level params for non-self avatars + for (param = getFirstVisualParam(); + param; + param = getNextVisualParam()) { - param->animate(morph_amt, mAppearanceAnimSetByUser); + if (param->getGroup() == VISUAL_PARAM_GROUP_TWEAKABLE) + { + param->animate(morph_amt, mAppearanceAnimSetByUser); + } } } @@ -2487,6 +2479,25 @@ void LLVOAvatar::idleUpdateAppearanceAnimation() } } +F32 LLVOAvatar::calcMorphAmount() +{ + F32 appearance_anim_time = mAppearanceMorphTimer.getElapsedTimeF32(); + F32 blend_frac = calc_bouncy_animation(appearance_anim_time / APPEARANCE_MORPH_TIME); + F32 last_blend_frac = calc_bouncy_animation(mLastAppearanceBlendTime / APPEARANCE_MORPH_TIME); + + F32 morph_amt; + if (last_blend_frac == 1.f) + { + morph_amt = 1.f; + } + else + { + morph_amt = (blend_frac - last_blend_frac) / (1.f - last_blend_frac); + } + + return morph_amt; +} + void LLVOAvatar::idleUpdateLipSync(bool voice_enabled) { // Use the Lipsync_Ooh and Lipsync_Aah morphs for lip sync @@ -6400,6 +6411,11 @@ LLBBox LLVOAvatar::getHUDBBox() const ++attachment_iter) { const LLViewerObject* attached_object = (*attachment_iter); + if (attached_object == NULL) + { + llwarns << "HUD attached object is NULL!" << llendl; + continue; + } // initialize bounding box to contain identity orientation and center point for attached object bbox.addPointLocal(attached_object->getPosition()); // add rotated bounding box for attached object diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index e3add8aa78..f7c794defe 100644 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -205,7 +205,7 @@ public: virtual BOOL updateCharacter(LLAgent &agent); void idleUpdateVoiceVisualizer(bool voice_enabled); void idleUpdateMisc(bool detailed_update); - void idleUpdateAppearanceAnimation(); + virtual void idleUpdateAppearanceAnimation(); void idleUpdateLipSync(bool voice_enabled); void idleUpdateLoadingEffect(); void idleUpdateWindEffect(); @@ -250,6 +250,7 @@ protected: virtual BOOL updateIsFullyLoaded(); BOOL processFullyLoadedChange(bool loading); void updateRuthTimer(bool loading); + F32 calcMorphAmount(); private: BOOL mFullyLoaded; BOOL mPreviousFullyLoaded; @@ -276,7 +277,7 @@ public: protected: static BOOL parseSkeletonFile(const std::string& filename); void buildCharacter(); - BOOL loadAvatar(); + virtual BOOL loadAvatar(); BOOL setupBone(const LLVOAvatarBoneInfo* info, LLViewerJoint* parent, S32 ¤t_volume_num, S32 ¤t_joint_num); BOOL buildSkeleton(const LLVOAvatarSkeletonInfo *info); diff --git a/indra/newview/llvoavatardefines.cpp b/indra/newview/llvoavatardefines.cpp index 17b502ae80..5624f19c8d 100644 --- a/indra/newview/llvoavatardefines.cpp +++ b/indra/newview/llvoavatardefines.cpp @@ -68,9 +68,9 @@ LLVOAvatarDictionary::Textures::Textures() addEntry(TEX_EYES_ALPHA, new TextureEntry("eyes_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); addEntry(TEX_HAIR_ALPHA, new TextureEntry("hair_alpha", TRUE, BAKED_NUM_INDICES, "UIImgDefaultAlphaUUID", WT_ALPHA)); - addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); - addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); - addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "UIImgDefaultTattooUUID", WT_TATTOO)); + addEntry(TEX_HEAD_TATTOO, new TextureEntry("head_tattoo", TRUE, BAKED_NUM_INDICES, "", WT_TATTOO)); + addEntry(TEX_UPPER_TATTOO, new TextureEntry("upper_tattoo", TRUE, BAKED_NUM_INDICES, "", WT_TATTOO)); + addEntry(TEX_LOWER_TATTOO, new TextureEntry("lower_tattoo", TRUE, BAKED_NUM_INDICES, "", WT_TATTOO)); addEntry(TEX_HEAD_BAKED, new TextureEntry("head-baked", FALSE, BAKED_HEAD)); addEntry(TEX_UPPER_BAKED, new TextureEntry("upper-baked", FALSE, BAKED_UPPER)); @@ -248,8 +248,6 @@ EBakedTextureIndex LLVOAvatarDictionary::findBakedByRegionName(std::string name) //static const LLUUID LLVOAvatarDictionary::getDefaultTextureImageID(ETextureIndex index) { - /* switch( index ) - case TEX_UPPER_SHIRT: return LLUUID( gSavedSettings.getString("UIImgDefaultShirtUUID") ); */ const TextureEntry *texture_dict = getInstance()->getTexture(index); const std::string &default_image_name = texture_dict->mDefaultImageName; if (default_image_name == "") @@ -265,9 +263,6 @@ const LLUUID LLVOAvatarDictionary::getDefaultTextureImageID(ETextureIndex index) // static EWearableType LLVOAvatarDictionary::getTEWearableType(ETextureIndex index ) { - /* switch(index) - case TEX_UPPER_SHIRT: - return WT_SHIRT; */ return getInstance()->getTexture(index)->mWearableType; } diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 2b2ac81487..758db538a2 100644 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -193,6 +193,25 @@ void LLVOAvatarSelf::markDead() LLVOAvatar::markDead(); } +/*virtual*/ BOOL LLVOAvatarSelf::loadAvatar() +{ + BOOL success = LLVOAvatar::loadAvatar(); + + // set all parameters sotred directly in the avatar to have + // the isSelfParam to be TRUE - this is used to prevent + // them from being animated or trigger accidental rebakes + // when we copy params from the wearable to the base avatar. + for (LLViewerVisualParam* param = (LLViewerVisualParam*) getFirstVisualParam(); + param; + param = (LLViewerVisualParam*) getNextVisualParam()) + { + param->setIsDummy(TRUE); + } + + return success; +} + + BOOL LLVOAvatarSelf::loadAvatarSelf() { BOOL success = TRUE; @@ -704,16 +723,23 @@ void LLVOAvatarSelf::updateVisualParams() } } - LLWearable *shape = gAgentWearables.getWearable(WT_SHAPE,0); - if (shape) - { - F32 gender = shape->getVisualParamWeight(80); // param 80 == gender - setVisualParamWeight("male",gender ,TRUE); - } - LLVOAvatar::updateVisualParams(); } +/*virtual*/ +void LLVOAvatarSelf::idleUpdateAppearanceAnimation() +{ + // Animate all top-level wearable visual parameters + gAgentWearables.animateAllWearableParams(calcMorphAmount(), mAppearanceAnimSetByUser); + + // apply wearable visual params to avatar + updateVisualParams(); + + //allow avatar to process updates + LLVOAvatar::idleUpdateAppearanceAnimation(); + +} + // virtual void LLVOAvatarSelf::requestStopMotion(LLMotion* motion) { @@ -973,8 +999,7 @@ void LLVOAvatarSelf::wearableUpdated( EWearableType type ) { if (mBakedTextureDatas[index].mTexLayerSet) { - mBakedTextureDatas[index].mTexLayerSet->requestUpdate(); - mBakedTextureDatas[index].mTexLayerSet->requestUpload(); + invalidateComposite(mBakedTextureDatas[index].mTexLayerSet, TRUE); } break; } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index a555d04a63..6e52b33634 100644 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -57,6 +57,7 @@ public: virtual void markDead(); virtual void initInstance(); // Called after construction to initialize the class. protected: + /*virtual*/ BOOL loadAvatar(); BOOL loadAvatarSelf(); BOOL buildSkeletonSelf(const LLVOAvatarSkeletonInfo *info); BOOL buildMenus(); @@ -89,6 +90,7 @@ public: /*virtual*/ BOOL setVisualParamWeight(const char* param_name, F32 weight, BOOL set_by_user = FALSE ); /*virtual*/ BOOL setVisualParamWeight(S32 index, F32 weight, BOOL set_by_user = FALSE ); /*virtual*/ void updateVisualParams(); + /*virtual*/ void idleUpdateAppearanceAnimation(); private: // helper function. Passed in param is assumed to be in avatar's parameter list. diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp new file mode 100644 index 0000000000..96fcf61e62 --- /dev/null +++ b/indra/newview/llvoicechannel.cpp @@ -0,0 +1,872 @@ +/** + * @file llvoicechannel.cpp + * @brief Voice Channel related classes + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-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" + +#include "llagent.h" +#include "llfloaterreg.h" +#include "llimview.h" +#include "llnotifications.h" +#include "llpanel.h" +#include "llrecentpeople.h" +#include "llviewercontrol.h" +#include "llvoicechannel.h" + + +LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; +LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; +LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; +LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; + +BOOL LLVoiceChannel::sSuspended = FALSE; + +// +// Constants +// +const U32 DEFAULT_RETRIES_COUNT = 3; + + +class LLVoiceCallCapResponder : public LLHTTPClient::Responder +{ +public: + LLVoiceCallCapResponder(const LLUUID& session_id) : mSessionID(session_id) {}; + + virtual void error(U32 status, const std::string& reason); // called with bad status codes + virtual void result(const LLSD& content); + +private: + LLUUID mSessionID; +}; + + +void LLVoiceCallCapResponder::error(U32 status, const std::string& reason) +{ + llwarns << "LLVoiceCallCapResponder::error(" + << status << ": " << reason << ")" + << llendl; + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); + if ( channelp ) + { + if ( 403 == status ) + { + //403 == no ability + LLNotifications::instance().add( + "VoiceNotAllowed", + channelp->getNotifyArgs()); + } + else + { + LLNotifications::instance().add( + "VoiceCallGenericError", + channelp->getNotifyArgs()); + } + channelp->deactivate(); + } +} + +void LLVoiceCallCapResponder::result(const LLSD& content) +{ + LLVoiceChannel* channelp = LLVoiceChannel::getChannelByID(mSessionID); + if (channelp) + { + //*TODO: DEBUG SPAM + LLSD::map_const_iterator iter; + for(iter = content.beginMap(); iter != content.endMap(); ++iter) + { + llinfos << "LLVoiceCallCapResponder::result got " + << iter->first << llendl; + } + + channelp->setChannelInfo( + content["voice_credentials"]["channel_uri"].asString(), + content["voice_credentials"]["channel_credentials"].asString()); + } +} + +// +// LLVoiceChannel +// +LLVoiceChannel::LLVoiceChannel(const LLUUID& session_id, const std::string& session_name) : + mSessionID(session_id), + mState(STATE_NO_CHANNEL_INFO), + mSessionName(session_name), + mIgnoreNextSessionLeave(FALSE) +{ + mNotifyArgs["VOICE_CHANNEL_NAME"] = mSessionName; + + if (!sVoiceChannelMap.insert(std::make_pair(session_id, this)).second) + { + // a voice channel already exists for this session id, so this instance will be orphaned + // the end result should simply be the failure to make voice calls + llwarns << "Duplicate voice channels registered for session_id " << session_id << llendl; + } + + LLVoiceClient::getInstance()->addObserver(this); +} + +LLVoiceChannel::~LLVoiceChannel() +{ + // Don't use LLVoiceClient::getInstance() here -- this can get called during atexit() time and that singleton MAY have already been destroyed. + if(gVoiceClient) + { + gVoiceClient->removeObserver(this); + } + + sVoiceChannelMap.erase(mSessionID); + sVoiceChannelURIMap.erase(mURI); +} + +void LLVoiceChannel::setChannelInfo( + const std::string& uri, + const std::string& credentials) +{ + setURI(uri); + + mCredentials = credentials; + + if (mState == STATE_NO_CHANNEL_INFO) + { + if (mURI.empty()) + { + LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + llwarns << "Received empty URI for channel " << mSessionName << llendl; + deactivate(); + } + else if (mCredentials.empty()) + { + LLNotifications::instance().add("VoiceChannelJoinFailed", mNotifyArgs); + llwarns << "Received empty credentials for channel " << mSessionName << llendl; + deactivate(); + } + else + { + setState(STATE_READY); + + // if we are supposed to be active, reconnect + // this will happen on initial connect, as we request credentials on first use + if (sCurrentVoiceChannel == this) + { + // just in case we got new channel info while active + // should move over to new channel + activate(); + } + } + } +} + +void LLVoiceChannel::onChange(EStatusType type, const std::string &channelURI, bool proximal) +{ + if (channelURI != mURI) + { + return; + } + + if (type < BEGIN_ERROR_STATUS) + { + handleStatusChange(type); + } + else + { + handleError(type); + } +} + +void LLVoiceChannel::handleStatusChange(EStatusType type) +{ + // status updates + switch(type) + { + case STATUS_LOGIN_RETRY: + //mLoginNotificationHandle = LLNotifyBox::showXml("VoiceLoginRetry")->getHandle(); + LLNotifications::instance().add("VoiceLoginRetry"); + break; + case STATUS_LOGGED_IN: + //if (!mLoginNotificationHandle.isDead()) + //{ + // LLNotifyBox* notifyp = (LLNotifyBox*)mLoginNotificationHandle.get(); + // if (notifyp) + // { + // notifyp->close(); + // } + // mLoginNotificationHandle.markDead(); + //} + break; + case STATUS_LEFT_CHANNEL: + if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) + { + // if forceably removed from channel + // update the UI and revert to default channel + LLNotifications::instance().add("VoiceChannelDisconnected", mNotifyArgs); + deactivate(); + } + mIgnoreNextSessionLeave = FALSE; + break; + case STATUS_JOINING: + if (callStarted()) + { + setState(STATE_RINGING); + } + break; + case STATUS_JOINED: + if (callStarted()) + { + setState(STATE_CONNECTED); + } + default: + break; + } +} + +// default behavior is to just deactivate channel +// derived classes provide specific error messages +void LLVoiceChannel::handleError(EStatusType type) +{ + deactivate(); + setState(STATE_ERROR); +} + +BOOL LLVoiceChannel::isActive() +{ + // only considered active when currently bound channel matches what our channel + return callStarted() && LLVoiceClient::getInstance()->getCurrentChannel() == mURI; +} + +BOOL LLVoiceChannel::callStarted() +{ + return mState >= STATE_CALL_STARTED; +} + +void LLVoiceChannel::deactivate() +{ + if (mState >= STATE_RINGING) + { + // ignore session leave event + mIgnoreNextSessionLeave = TRUE; + } + + if (callStarted()) + { + setState(STATE_HUNG_UP); + // mute the microphone if required when returning to the proximal channel + if (gSavedSettings.getBOOL("AutoDisengageMic") && sCurrentVoiceChannel == this) + { + gSavedSettings.setBOOL("PTTCurrentlyEnabled", true); + } + } + + if (sCurrentVoiceChannel == this) + { + // default channel is proximal channel + sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance(); + sCurrentVoiceChannel->activate(); + } +} + +void LLVoiceChannel::activate() +{ + if (callStarted()) + { + return; + } + + // deactivate old channel and mark ourselves as the active one + if (sCurrentVoiceChannel != this) + { + // mark as current before deactivating the old channel to prevent + // activating the proximal channel between IM calls + LLVoiceChannel* old_channel = sCurrentVoiceChannel; + sCurrentVoiceChannel = this; + if (old_channel) + { + old_channel->deactivate(); + } + } + + if (mState == STATE_NO_CHANNEL_INFO) + { + // responsible for setting status to active + getChannelInfo(); + } + else + { + setState(STATE_CALL_STARTED); + } +} + +void LLVoiceChannel::getChannelInfo() +{ + // pretend we have everything we need + if (sCurrentVoiceChannel == this) + { + setState(STATE_CALL_STARTED); + } +} + +//static +LLVoiceChannel* LLVoiceChannel::getChannelByID(const LLUUID& session_id) +{ + voice_channel_map_t::iterator found_it = sVoiceChannelMap.find(session_id); + if (found_it == sVoiceChannelMap.end()) + { + return NULL; + } + else + { + return found_it->second; + } +} + +//static +LLVoiceChannel* LLVoiceChannel::getChannelByURI(std::string uri) +{ + voice_channel_map_uri_t::iterator found_it = sVoiceChannelURIMap.find(uri); + if (found_it == sVoiceChannelURIMap.end()) + { + return NULL; + } + else + { + return found_it->second; + } +} + +void LLVoiceChannel::updateSessionID(const LLUUID& new_session_id) +{ + sVoiceChannelMap.erase(sVoiceChannelMap.find(mSessionID)); + mSessionID = new_session_id; + sVoiceChannelMap.insert(std::make_pair(mSessionID, this)); +} + +void LLVoiceChannel::setURI(std::string uri) +{ + sVoiceChannelURIMap.erase(mURI); + mURI = uri; + sVoiceChannelURIMap.insert(std::make_pair(mURI, this)); +} + +void LLVoiceChannel::setState(EState state) +{ + switch(state) + { + case STATE_RINGING: + gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + break; + case STATE_CONNECTED: + gIMMgr->addSystemMessage(mSessionID, "connected", mNotifyArgs); + break; + case STATE_HUNG_UP: + gIMMgr->addSystemMessage(mSessionID, "hang_up", mNotifyArgs); + break; + default: + break; + } + + mState = state; +} + +void LLVoiceChannel::toggleCallWindowIfNeeded(EState state) +{ + if (state == STATE_CONNECTED) + { + LLFloaterReg::showInstance("voice_call", mSessionID); + } + // By checking that current state is CONNECTED we make sure that the call window + // has been shown, hence there's something to hide. This helps when user presses + // the "End call" button right after initiating the call. + // *TODO: move this check to LLFloaterCall? + else if (state == STATE_HUNG_UP && mState == STATE_CONNECTED) + { + LLFloaterReg::hideInstance("voice_call", mSessionID); + } +} + +//static +void LLVoiceChannel::initClass() +{ + sCurrentVoiceChannel = LLVoiceChannelProximal::getInstance(); +} + + +//static +void LLVoiceChannel::suspend() +{ + if (!sSuspended) + { + sSuspendedVoiceChannel = sCurrentVoiceChannel; + sSuspended = TRUE; + } +} + +//static +void LLVoiceChannel::resume() +{ + if (sSuspended) + { + if (gVoiceClient->voiceEnabled()) + { + if (sSuspendedVoiceChannel) + { + sSuspendedVoiceChannel->activate(); + } + else + { + LLVoiceChannelProximal::getInstance()->activate(); + } + } + sSuspended = FALSE; + } +} + + +// +// LLVoiceChannelGroup +// + +LLVoiceChannelGroup::LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name) : + LLVoiceChannel(session_id, session_name) +{ + mRetries = DEFAULT_RETRIES_COUNT; + mIsRetrying = FALSE; +} + +void LLVoiceChannelGroup::deactivate() +{ + if (callStarted()) + { + LLVoiceClient::getInstance()->leaveNonSpatialChannel(); + } + LLVoiceChannel::deactivate(); +} + +void LLVoiceChannelGroup::activate() +{ + if (callStarted()) return; + + LLVoiceChannel::activate(); + + if (callStarted()) + { + // we have the channel info, just need to use it now + LLVoiceClient::getInstance()->setNonSpatialChannel( + mURI, + mCredentials); + +#if 0 // *TODO + if (!gAgent.isInGroup(mSessionID)) // ad-hoc channel + { + // Add the party to the list of people with which we've recently interacted. + for (/*people in the chat*/) + LLRecentPeople::instance().add(buddy_id); + } +#endif + } +} + +void LLVoiceChannelGroup::getChannelInfo() +{ + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + std::string url = region->getCapability("ChatSessionRequest"); + LLSD data; + data["method"] = "call"; + data["session-id"] = mSessionID; + LLHTTPClient::post(url, + data, + new LLVoiceCallCapResponder(mSessionID)); + } +} + +void LLVoiceChannelGroup::setChannelInfo( + const std::string& uri, + const std::string& credentials) +{ + setURI(uri); + + mCredentials = credentials; + + if (mState == STATE_NO_CHANNEL_INFO) + { + if(!mURI.empty() && !mCredentials.empty()) + { + setState(STATE_READY); + + // if we are supposed to be active, reconnect + // this will happen on initial connect, as we request credentials on first use + if (sCurrentVoiceChannel == this) + { + // just in case we got new channel info while active + // should move over to new channel + activate(); + } + } + else + { + //*TODO: notify user + llwarns << "Received invalid credentials for channel " << mSessionName << llendl; + deactivate(); + } + } + else if ( mIsRetrying ) + { + // we have the channel info, just need to use it now + LLVoiceClient::getInstance()->setNonSpatialChannel( + mURI, + mCredentials); + } +} + +void LLVoiceChannelGroup::handleStatusChange(EStatusType type) +{ + // status updates + switch(type) + { + case STATUS_JOINED: + mRetries = 3; + mIsRetrying = FALSE; + default: + break; + } + + LLVoiceChannel::handleStatusChange(type); +} + +void LLVoiceChannelGroup::handleError(EStatusType status) +{ + std::string notify; + switch(status) + { + case ERROR_CHANNEL_LOCKED: + case ERROR_CHANNEL_FULL: + notify = "VoiceChannelFull"; + break; + case ERROR_NOT_AVAILABLE: + //clear URI and credentials + //set the state to be no info + //and activate + if ( mRetries > 0 ) + { + mRetries--; + mIsRetrying = TRUE; + mIgnoreNextSessionLeave = TRUE; + + getChannelInfo(); + return; + } + else + { + notify = "VoiceChannelJoinFailed"; + mRetries = DEFAULT_RETRIES_COUNT; + mIsRetrying = FALSE; + } + + break; + + case ERROR_UNKNOWN: + default: + break; + } + + // notification + if (!notify.empty()) + { + LLNotificationPtr notification = LLNotifications::instance().add(notify, mNotifyArgs); + // echo to im window + gIMMgr->addMessage(mSessionID, LLUUID::null, SYSTEM_FROM, notification->getMessage()); + } + + LLVoiceChannel::handleError(status); +} + +void LLVoiceChannelGroup::setState(EState state) +{ + // HACK: Open/close the call window if needed. + toggleCallWindowIfNeeded(state); + + switch(state) + { + case STATE_RINGING: + if ( !mIsRetrying ) + { + gIMMgr->addSystemMessage(mSessionID, "ringing", mNotifyArgs); + } + + mState = state; + break; + default: + LLVoiceChannel::setState(state); + } +} + +// +// LLVoiceChannelProximal +// +LLVoiceChannelProximal::LLVoiceChannelProximal() : + LLVoiceChannel(LLUUID::null, LLStringUtil::null) +{ + activate(); +} + +BOOL LLVoiceChannelProximal::isActive() +{ + return callStarted() && LLVoiceClient::getInstance()->inProximalChannel(); +} + +void LLVoiceChannelProximal::activate() +{ + if (callStarted()) return; + + LLVoiceChannel::activate(); + + if (callStarted()) + { + // this implicitly puts you back in the spatial channel + LLVoiceClient::getInstance()->leaveNonSpatialChannel(); + } +} + +void LLVoiceChannelProximal::onChange(EStatusType type, const std::string &channelURI, bool proximal) +{ + if (!proximal) + { + return; + } + + if (type < BEGIN_ERROR_STATUS) + { + handleStatusChange(type); + } + else + { + handleError(type); + } +} + +void LLVoiceChannelProximal::handleStatusChange(EStatusType status) +{ + // status updates + switch(status) + { + case STATUS_LEFT_CHANNEL: + // do not notify user when leaving proximal channel + return; + case STATUS_VOICE_DISABLED: + gIMMgr->addSystemMessage(LLUUID::null, "unavailable", mNotifyArgs); + return; + default: + break; + } + LLVoiceChannel::handleStatusChange(status); +} + + +void LLVoiceChannelProximal::handleError(EStatusType status) +{ + std::string notify; + switch(status) + { + case ERROR_CHANNEL_LOCKED: + case ERROR_CHANNEL_FULL: + notify = "ProximalVoiceChannelFull"; + break; + default: + break; + } + + // notification + if (!notify.empty()) + { + LLNotifications::instance().add(notify, mNotifyArgs); + } + + LLVoiceChannel::handleError(status); +} + +void LLVoiceChannelProximal::deactivate() +{ + if (callStarted()) + { + setState(STATE_HUNG_UP); + } +} + + +// +// LLVoiceChannelP2P +// +LLVoiceChannelP2P::LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id) : + LLVoiceChannelGroup(session_id, session_name), + mOtherUserID(other_user_id), + mReceivedCall(FALSE) +{ + // make sure URI reflects encoded version of other user's agent id + setURI(LLVoiceClient::getInstance()->sipURIFromID(other_user_id)); +} + +void LLVoiceChannelP2P::handleStatusChange(EStatusType type) +{ + // status updates + switch(type) + { + case STATUS_LEFT_CHANNEL: + if (callStarted() && !mIgnoreNextSessionLeave && !sSuspended) + { + if (mState == STATE_RINGING) + { + // other user declined call + LLNotifications::instance().add("P2PCallDeclined", mNotifyArgs); + } + else + { + // other user hung up + LLNotifications::instance().add("VoiceChannelDisconnectedP2P", mNotifyArgs); + } + deactivate(); + } + mIgnoreNextSessionLeave = FALSE; + return; + default: + break; + } + + LLVoiceChannel::handleStatusChange(type); +} + +void LLVoiceChannelP2P::handleError(EStatusType type) +{ + switch(type) + { + case ERROR_NOT_AVAILABLE: + LLNotifications::instance().add("P2PCallNoAnswer", mNotifyArgs); + break; + default: + break; + } + + LLVoiceChannel::handleError(type); +} + +void LLVoiceChannelP2P::activate() +{ + if (callStarted()) return; + + LLVoiceChannel::activate(); + + if (callStarted()) + { + // no session handle yet, we're starting the call + if (mSessionHandle.empty()) + { + mReceivedCall = FALSE; + LLVoiceClient::getInstance()->callUser(mOtherUserID); + } + // otherwise answering the call + else + { + LLVoiceClient::getInstance()->answerInvite(mSessionHandle); + + // using the session handle invalidates it. Clear it out here so we can't reuse it by accident. + mSessionHandle.clear(); + } + + // Add the party to the list of people with which we've recently interacted. + LLRecentPeople::instance().add(mOtherUserID); + } +} + +void LLVoiceChannelP2P::getChannelInfo() +{ + // pretend we have everything we need, since P2P doesn't use channel info + if (sCurrentVoiceChannel == this) + { + setState(STATE_CALL_STARTED); + } +} + +// receiving session from other user who initiated call +void LLVoiceChannelP2P::setSessionHandle(const std::string& handle, const std::string &inURI) +{ + BOOL needs_activate = FALSE; + if (callStarted()) + { + // defer to lower agent id when already active + if (mOtherUserID < gAgent.getID()) + { + // pretend we haven't started the call yet, so we can connect to this session instead + deactivate(); + needs_activate = TRUE; + } + else + { + // we are active and have priority, invite the other user again + // under the assumption they will join this new session + mSessionHandle.clear(); + LLVoiceClient::getInstance()->callUser(mOtherUserID); + return; + } + } + + mSessionHandle = handle; + + // The URI of a p2p session should always be the other end's SIP URI. + if(!inURI.empty()) + { + setURI(inURI); + } + else + { + setURI(LLVoiceClient::getInstance()->sipURIFromID(mOtherUserID)); + } + + mReceivedCall = TRUE; + + if (needs_activate) + { + activate(); + } +} + +void LLVoiceChannelP2P::setState(EState state) +{ + // HACK: Open/close the call window if needed. + toggleCallWindowIfNeeded(state); + + // you only "answer" voice invites in p2p mode + // so provide a special purpose message here + if (mReceivedCall && state == STATE_RINGING) + { + gIMMgr->addSystemMessage(mSessionID, "answering", mNotifyArgs); + mState = state; + return; + } + LLVoiceChannel::setState(state); +} diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h new file mode 100644 index 0000000000..9966bdd5ab --- /dev/null +++ b/indra/newview/llvoicechannel.h @@ -0,0 +1,168 @@ +/** + * @file llvoicechannel.h + * @brief Voice channel related classes + * + * $LicenseInfo:firstyear=2001&license=viewergpl$ + * + * Copyright (c) 2001-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_VOICECHANNEL_H +#define LL_VOICECHANNEL_H + +#include "llhandle.h" +#include "llvoiceclient.h" + +class LLPanel; + +class LLVoiceChannel : public LLVoiceClientStatusObserver +{ +public: + typedef enum e_voice_channel_state + { + STATE_NO_CHANNEL_INFO, + STATE_ERROR, + STATE_HUNG_UP, + STATE_READY, + STATE_CALL_STARTED, + STATE_RINGING, + STATE_CONNECTED + } EState; + + LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); + virtual ~LLVoiceChannel(); + + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + + virtual void handleStatusChange(EStatusType status); + virtual void handleError(EStatusType status); + virtual void deactivate(); + virtual void activate(); + virtual void setChannelInfo( + const std::string& uri, + const std::string& credentials); + virtual void getChannelInfo(); + virtual BOOL isActive(); + virtual BOOL callStarted(); + const std::string& getSessionName() const { return mSessionName; } + + const LLUUID getSessionID() { return mSessionID; } + EState getState() { return mState; } + + void updateSessionID(const LLUUID& new_session_id); + const LLSD& getNotifyArgs() { return mNotifyArgs; } + + static LLVoiceChannel* getChannelByID(const LLUUID& session_id); + static LLVoiceChannel* getChannelByURI(std::string uri); + static LLVoiceChannel* getCurrentVoiceChannel() { return sCurrentVoiceChannel; } + static void initClass(); + + static void suspend(); + static void resume(); + +protected: + virtual void setState(EState state); + void toggleCallWindowIfNeeded(EState state); + void setURI(std::string uri); + + std::string mURI; + std::string mCredentials; + LLUUID mSessionID; + EState mState; + std::string mSessionName; + LLSD mNotifyArgs; + BOOL mIgnoreNextSessionLeave; + LLHandle<LLPanel> mLoginNotificationHandle; + + typedef std::map<LLUUID, LLVoiceChannel*> voice_channel_map_t; + static voice_channel_map_t sVoiceChannelMap; + + typedef std::map<std::string, LLVoiceChannel*> voice_channel_map_uri_t; + static voice_channel_map_uri_t sVoiceChannelURIMap; + + static LLVoiceChannel* sCurrentVoiceChannel; + static LLVoiceChannel* sSuspendedVoiceChannel; + static BOOL sSuspended; +}; + +class LLVoiceChannelGroup : public LLVoiceChannel +{ +public: + LLVoiceChannelGroup(const LLUUID& session_id, const std::string& session_name); + + /*virtual*/ void handleStatusChange(EStatusType status); + /*virtual*/ void handleError(EStatusType status); + /*virtual*/ void activate(); + /*virtual*/ void deactivate(); + /*vritual*/ void setChannelInfo( + const std::string& uri, + const std::string& credentials); + /*virtual*/ void getChannelInfo(); + +protected: + virtual void setState(EState state); + +private: + U32 mRetries; + BOOL mIsRetrying; +}; + +class LLVoiceChannelProximal : public LLVoiceChannel, public LLSingleton<LLVoiceChannelProximal> +{ +public: + LLVoiceChannelProximal(); + + /*virtual*/ void onChange(EStatusType status, const std::string &channelURI, bool proximal); + /*virtual*/ void handleStatusChange(EStatusType status); + /*virtual*/ void handleError(EStatusType status); + /*virtual*/ BOOL isActive(); + /*virtual*/ void activate(); + /*virtual*/ void deactivate(); + +}; + +class LLVoiceChannelP2P : public LLVoiceChannelGroup +{ +public: + LLVoiceChannelP2P(const LLUUID& session_id, const std::string& session_name, const LLUUID& other_user_id); + + /*virtual*/ void handleStatusChange(EStatusType status); + /*virtual*/ void handleError(EStatusType status); + /*virtual*/ void activate(); + /*virtual*/ void getChannelInfo(); + + void setSessionHandle(const std::string& handle, const std::string &inURI); + +protected: + virtual void setState(EState state); + +private: + std::string mSessionHandle; + LLUUID mOtherUserID; + BOOL mReceivedCall; +}; + +#endif // LL_VOICECHANNEL_H diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index 02f63a848b..df5481c874 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -57,13 +57,13 @@ #include "llagent.h" #include "llcachename.h" #include "llimview.h" // for LLIMMgr -#include "llimpanel.h" // for LLVoiceChannel #include "llparcel.h" #include "llviewerparcelmgr.h" #include "llfirstuse.h" #include "llviewerwindow.h" #include "llviewercamera.h" #include "llvoavatarself.h" +#include "llvoicechannel.h" #include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel #include "llfloaterchat.h" // for LLFloaterChat::addChat() @@ -254,6 +254,7 @@ protected: std::string nameString; std::string audioMediaString; std::string displayNameString; + std::string deviceString; int participantType; bool isLocallyMuted; bool isModeratorMuted; @@ -485,6 +486,14 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) { gVoiceClient->clearRenderDevices(); } + else if (!stricmp("CaptureDevice", tag)) + { + deviceString.clear(); + } + else if (!stricmp("RenderDevice", tag)) + { + deviceString.clear(); + } else if (!stricmp("Buddies", tag)) { gVoiceClient->deleteAllBuddies(); @@ -508,7 +517,6 @@ void LLVivoxProtocolParser::StartTag(const char *tag, const char **attr) void LLVivoxProtocolParser::EndTag(const char *tag) { const std::string& string = textBuffer; - bool clearbuffer = true; responseDepth--; @@ -580,6 +588,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag) nameString = string; else if (!stricmp("DisplayName", tag)) displayNameString = string; + else if (!stricmp("Device", tag)) + deviceString = string; else if (!stricmp("AccountName", tag)) nameString = string; else if (!stricmp("ParticipantType", tag)) @@ -596,18 +606,13 @@ void LLVivoxProtocolParser::EndTag(const char *tag) uriString = string; else if (!stricmp("Presence", tag)) statusString = string; - else if (!stricmp("Device", tag)) - { - // This closing tag shouldn't clear the accumulated text. - clearbuffer = false; - } else if (!stricmp("CaptureDevice", tag)) { - gVoiceClient->addCaptureDevice(textBuffer); + gVoiceClient->addCaptureDevice(deviceString); } else if (!stricmp("RenderDevice", tag)) { - gVoiceClient->addRenderDevice(textBuffer); + gVoiceClient->addRenderDevice(deviceString); } else if (!stricmp("Buddy", tag)) { @@ -648,12 +653,8 @@ void LLVivoxProtocolParser::EndTag(const char *tag) else if (!stricmp("SubscriptionType", tag)) subscriptionType = string; - - if(clearbuffer) - { - textBuffer.clear(); - accumulateText= false; - } + textBuffer.clear(); + accumulateText= false; if (responseDepth == 0) { @@ -1160,7 +1161,8 @@ LLVoiceClient::LLVoiceClient() : mVoiceEnabled(false), mWriteInProgress(false), - mLipSyncEnabled(false) + mLipSyncEnabled(false), + mAPIVersion("Unknown") { gVoiceClient = this; @@ -3749,6 +3751,7 @@ void LLVoiceClient::connectorCreateResponse(int statusCode, std::string &statusS { // Connector created, move forward. LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL; + mAPIVersion = versionID; mConnectorHandle = connectorHandle; if(getState() == stateConnectorStarting) { diff --git a/indra/newview/llvoiceclient.h b/indra/newview/llvoiceclient.h index bddd18dee8..9df96d9a52 100644 --- a/indra/newview/llvoiceclient.h +++ b/indra/newview/llvoiceclient.h @@ -204,6 +204,9 @@ static void updatePosition(void); void keyDown(KEY key, MASK mask); void keyUp(KEY key, MASK mask); void middleMouseState(bool down); + + // Return the version of the Vivox library + std::string getAPIVersion() const { return mAPIVersion; } ///////////////////////////// // Accessors for data related to nearby speakers @@ -739,6 +742,8 @@ static std::string nameFromsipURI(const std::string &uri); BOOL mLipSyncEnabled; + std::string mAPIVersion; + typedef std::set<LLVoiceClientParticipantObserver*> observer_set_t; observer_set_t mParticipantObservers; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 7585842623..143cd2d9c6 100644 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -249,6 +249,12 @@ BOOL LLVOPartGroup::updateGeometry(LLDrawable *drawable) facep->mCenterLocal = part->mPosAgent; facep->setFaceColor(part->mColor); facep->setTexture(part->mImagep); + + //check if this particle texture is replaced by a parcel media texture. + if(part->mImagep.notNull() && part->mImagep->hasParcelMedia()) + { + part->mImagep->getParcelMedia()->addMediaToFace(facep) ; + } mPixelArea = tot_area * pixel_meter_ratio; const F32 area_scale = 10.f; // scale area to increase priority a bit diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index d896e1f7db..7d4bef3f7d 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -2988,6 +2988,7 @@ static LLFastTimer::DeclareTimer FTM_REBUILD_VBO("VBO Rebuilt"); void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) { + llpushcallstacks ; if (group->changeLOD()) { group->mLastUpdateDistance = group->mDistance; @@ -3218,6 +3219,7 @@ void LLVolumeGeometryManager::rebuildGeom(LLSpatialGroup* group) static LLFastTimer::DeclareTimer FTM_VOLUME_GEOM("Volume Geometry"); void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) { + llpushcallstacks ; if (group->isState(LLSpatialGroup::MESH_DIRTY) && !group->isState(LLSpatialGroup::GEOM_DIRTY)) { LLFastTimer tm(FTM_VOLUME_GEOM); @@ -3308,6 +3310,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort) { + llpushcallstacks ; //calculate maximum number of vertices to store in a single buffer U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcStride(group->mSpatialPartition->mVertexDataMask); max_vertices = llmin(max_vertices, (U32) 65535); diff --git a/indra/newview/llwearable.cpp b/indra/newview/llwearable.cpp index 8f74ea29ac..4cd29bb838 100644 --- a/indra/newview/llwearable.cpp +++ b/indra/newview/llwearable.cpp @@ -185,7 +185,9 @@ void LLWearable::createVisualParams() { delete mVisualParamIndexMap[param->getID()]; } - mVisualParamIndexMap[param->getID()] = param->cloneParam(this); + LLViewerVisualParam *new_param = param->cloneParam(this); + new_param->setIsDummy(FALSE); + mVisualParamIndexMap[param->getID()] = new_param; } } @@ -545,7 +547,7 @@ BOOL LLWearable::isDirty() const else { // image found in current image list but not saved image list - return FALSE; + return TRUE; } } } @@ -668,21 +670,7 @@ void LLWearable::writeToAvatar( BOOL set_by_user, BOOL update_customize_floater if( gFloaterCustomize && update_customize_floater ) { - LLViewerInventoryItem* item; - // MULTI_WEARABLE: - item = (LLViewerInventoryItem*)gInventory.getItem(gAgentWearables.getWearableItemID(mType,0)); - U32 perm_mask = PERM_NONE; - BOOL is_complete = FALSE; - if(item) - { - perm_mask = item->getPermissions().getMaskOwner(); - is_complete = item->isComplete(); - if(!is_complete) - { - item->fetchFromServer(); - } - } - gFloaterCustomize->setWearable(mType, this, perm_mask, is_complete); + gFloaterCustomize->setWearable(mType, 0); gFloaterCustomize->setCurrentWearableType( mType ); } @@ -935,6 +923,17 @@ void LLWearable::getVisualParams(visual_param_vec_t &list) } } +void LLWearable::animateParams(F32 delta, BOOL set_by_user) +{ + for(visual_param_index_map_t::iterator iter = mVisualParamIndexMap.begin(); + iter != mVisualParamIndexMap.end(); + ++iter) + { + LLVisualParam *param = (LLVisualParam*) iter->second; + param->animate(delta, set_by_user); + } +} + LLColor4 LLWearable::getClothesColor(S32 te) const { LLColor4 color; diff --git a/indra/newview/llwearable.h b/indra/newview/llwearable.h index 01bd9652a5..96631811c5 100644 --- a/indra/newview/llwearable.h +++ b/indra/newview/llwearable.h @@ -119,6 +119,7 @@ public: F32 getVisualParamWeight(S32 index) const; LLVisualParam* getVisualParam(S32 index) const; void getVisualParams(visual_param_vec_t &list); + void animateParams(F32 delta, BOOL set_by_user); LLColor4 getClothesColor(S32 te) const; void setClothesColor( S32 te, const LLColor4& new_color, BOOL set_by_user ); diff --git a/indra/newview/llworldmap.cpp b/indra/newview/llworldmap.cpp index 829d631473..f198f3a0cf 100644 --- a/indra/newview/llworldmap.cpp +++ b/indra/newview/llworldmap.cpp @@ -37,7 +37,6 @@ #include "llregionhandle.h" #include "message.h" -#include "llappviewer.h" // for gPacificDaylightTime #include "llagent.h" #include "llmapresponders.h" #include "llviewercontrol.h" diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b50e71bf48..0dc1a88ee8 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1797,6 +1797,7 @@ void LLPipeline::rebuildPriorityGroups() void LLPipeline::rebuildGroups() { + llpushcallstacks ; // Iterate through some drawables on the non-priority build queue S32 size = (S32) mGroupQ2.size(); S32 min_count = llclamp((S32) ((F32) (size * size)/4096*0.25f), 1, size); @@ -7907,6 +7908,7 @@ void LLPipeline::generateHighlight(LLCamera& camera) mHighlight.flush(); gGL.setColorMask(true, false); + gViewerWindow->setup3DViewport(); } } diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 287c997c65..1e0da13162 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -66,6 +66,9 @@ name="Blue" value="0 0 1 1" /> <color + name="Yellow" + value="1 1 0 1" /> + <color name="Unused?" value="1 0 1 1" /> <color @@ -408,10 +411,10 @@ reference="White" /> <color name="MapAvatarColor" - reference="White" /> + reference="Green" /> <color name="MapAvatarFriendColor" - reference="Unused?" /> + reference="Yellow" /> <color name="MapAvatarSelfColor" value="0.53125 0 0.498047 1" /> diff --git a/indra/newview/skins/default/textures/containers/Accordion_Selected.png b/indra/newview/skins/default/textures/containers/Accordion_Selected.png Binary files differnew file mode 100644 index 0000000000..0616dea6a3 --- /dev/null +++ b/indra/newview/skins/default/textures/containers/Accordion_Selected.png diff --git a/indra/newview/skins/default/textures/icons/ForSale_Badge.png b/indra/newview/skins/default/textures/icons/ForSale_Badge.png Binary files differnew file mode 100644 index 0000000000..5bee570cee --- /dev/null +++ b/indra/newview/skins/default/textures/icons/ForSale_Badge.png diff --git a/indra/newview/skins/default/textures/icons/Generic_Object.png b/indra/newview/skins/default/textures/icons/Generic_Object.png Binary files differnew file mode 100644 index 0000000000..e3a80b2aef --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Generic_Object.png diff --git a/indra/newview/skins/default/textures/icons/Generic_Object_Small.png b/indra/newview/skins/default/textures/icons/Generic_Object_Small.png Binary files differnew file mode 100644 index 0000000000..223874e631 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Generic_Object_Small.png diff --git a/indra/newview/skins/default/textures/icons/Info_Over.png b/indra/newview/skins/default/textures/icons/Info_Over.png Binary files differnew file mode 100644 index 0000000000..be1cd0706f --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Info_Over.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Animation.png b/indra/newview/skins/default/textures/icons/Inv_Animation.png Binary files differindex 8b69434066..ab42c61a92 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Animation.png +++ b/indra/newview/skins/default/textures/icons/Inv_Animation.png diff --git a/indra/newview/skins/default/textures/icons/Inv_BodyShape.png b/indra/newview/skins/default/textures/icons/Inv_BodyShape.png Binary files differindex 9d98bfaa7d..97e874d70d 100644 --- a/indra/newview/skins/default/textures/icons/Inv_BodyShape.png +++ b/indra/newview/skins/default/textures/icons/Inv_BodyShape.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Clothing.png b/indra/newview/skins/default/textures/icons/Inv_Clothing.png Binary files differindex 49a54b82e1..e8d246c6fa 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Clothing.png +++ b/indra/newview/skins/default/textures/icons/Inv_Clothing.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Eye.png b/indra/newview/skins/default/textures/icons/Inv_Eye.png Binary files differindex 6d0321dde9..e619f56c2b 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Eye.png +++ b/indra/newview/skins/default/textures/icons/Inv_Eye.png diff --git a/indra/newview/skins/default/textures/icons/Inv_FolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_FolderClosed.png Binary files differindex 30aa6e04ac..342a973d00 100644 --- a/indra/newview/skins/default/textures/icons/Inv_FolderClosed.png +++ b/indra/newview/skins/default/textures/icons/Inv_FolderClosed.png diff --git a/indra/newview/skins/default/textures/icons/Inv_FolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_FolderOpen.png Binary files differindex 792ef446e8..0507c2cbaf 100644 --- a/indra/newview/skins/default/textures/icons/Inv_FolderOpen.png +++ b/indra/newview/skins/default/textures/icons/Inv_FolderOpen.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Gesture.png b/indra/newview/skins/default/textures/icons/Inv_Gesture.png Binary files differindex c49ae523c8..52695ec19b 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Gesture.png +++ b/indra/newview/skins/default/textures/icons/Inv_Gesture.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Gloves.png b/indra/newview/skins/default/textures/icons/Inv_Gloves.png Binary files differindex d81bc961d4..d6a2113aaf 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Gloves.png +++ b/indra/newview/skins/default/textures/icons/Inv_Gloves.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Hair.png b/indra/newview/skins/default/textures/icons/Inv_Hair.png Binary files differindex 5e68f1ffea..ae941b0dd5 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Hair.png +++ b/indra/newview/skins/default/textures/icons/Inv_Hair.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Jacket.png b/indra/newview/skins/default/textures/icons/Inv_Jacket.png Binary files differindex 0e28f45f19..3859666f7c 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Jacket.png +++ b/indra/newview/skins/default/textures/icons/Inv_Jacket.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Landmark.png b/indra/newview/skins/default/textures/icons/Inv_Landmark.png Binary files differindex 6648a23393..f8ce765c50 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Landmark.png +++ b/indra/newview/skins/default/textures/icons/Inv_Landmark.png diff --git a/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png b/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png Binary files differnew file mode 100644 index 0000000000..f2ae828efc --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LookFolderClosed.png diff --git a/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png b/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png Binary files differnew file mode 100644 index 0000000000..d454d4cd48 --- /dev/null +++ b/indra/newview/skins/default/textures/icons/Inv_LookFolderOpen.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Notecard.png b/indra/newview/skins/default/textures/icons/Inv_Notecard.png Binary files differindex 830a71311f..4645ab8e91 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Notecard.png +++ b/indra/newview/skins/default/textures/icons/Inv_Notecard.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Object.png b/indra/newview/skins/default/textures/icons/Inv_Object.png Binary files differindex a88d0dc4b3..f883696a82 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Object.png +++ b/indra/newview/skins/default/textures/icons/Inv_Object.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Pants.png b/indra/newview/skins/default/textures/icons/Inv_Pants.png Binary files differindex 2527f7f9c3..fe2389f074 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Pants.png +++ b/indra/newview/skins/default/textures/icons/Inv_Pants.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Script.png b/indra/newview/skins/default/textures/icons/Inv_Script.png Binary files differindex e9c9b163fd..0fba27a7aa 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Script.png +++ b/indra/newview/skins/default/textures/icons/Inv_Script.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Shirt.png b/indra/newview/skins/default/textures/icons/Inv_Shirt.png Binary files differindex 7cc880a124..81c1538dd2 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Shirt.png +++ b/indra/newview/skins/default/textures/icons/Inv_Shirt.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Shoe.png b/indra/newview/skins/default/textures/icons/Inv_Shoe.png Binary files differindex 0b148647eb..51e1c7bbb7 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Shoe.png +++ b/indra/newview/skins/default/textures/icons/Inv_Shoe.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Skin.png b/indra/newview/skins/default/textures/icons/Inv_Skin.png Binary files differindex 8e20638bba..b7da922046 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Skin.png +++ b/indra/newview/skins/default/textures/icons/Inv_Skin.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Skirt.png b/indra/newview/skins/default/textures/icons/Inv_Skirt.png Binary files differindex 40860a3599..246e9a87aa 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Skirt.png +++ b/indra/newview/skins/default/textures/icons/Inv_Skirt.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Snapshot.png b/indra/newview/skins/default/textures/icons/Inv_Snapshot.png Binary files differindex 17e710a843..39efd2be1b 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Snapshot.png +++ b/indra/newview/skins/default/textures/icons/Inv_Snapshot.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Socks.png b/indra/newview/skins/default/textures/icons/Inv_Socks.png Binary files differindex b8169dcb36..30d7d7c239 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Socks.png +++ b/indra/newview/skins/default/textures/icons/Inv_Socks.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Sound.png b/indra/newview/skins/default/textures/icons/Inv_Sound.png Binary files differindex 1a50dd17da..44c271c868 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Sound.png +++ b/indra/newview/skins/default/textures/icons/Inv_Sound.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Texture.png b/indra/newview/skins/default/textures/icons/Inv_Texture.png Binary files differindex 2d6d1b54bb..dbc41c5e99 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Texture.png +++ b/indra/newview/skins/default/textures/icons/Inv_Texture.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Underpants.png b/indra/newview/skins/default/textures/icons/Inv_Underpants.png Binary files differindex 77f56c574f..b1e7c2a55f 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Underpants.png +++ b/indra/newview/skins/default/textures/icons/Inv_Underpants.png diff --git a/indra/newview/skins/default/textures/icons/Inv_Undershirt.png b/indra/newview/skins/default/textures/icons/Inv_Undershirt.png Binary files differindex 954eab7660..9340dbb975 100644 --- a/indra/newview/skins/default/textures/icons/Inv_Undershirt.png +++ b/indra/newview/skins/default/textures/icons/Inv_Undershirt.png diff --git a/indra/newview/skins/default/textures/icons/YouAreHere_Badge.png b/indra/newview/skins/default/textures/icons/YouAreHere_Badge.png Binary files differnew file mode 100644 index 0000000000..c057e9743d --- /dev/null +++ b/indra/newview/skins/default/textures/icons/YouAreHere_Badge.png diff --git a/indra/newview/skins/default/textures/map_avatar_8.tga b/indra/newview/skins/default/textures/map_avatar_8.tga Binary files differindex 47c8cbed6f..28552f2237 100644 --- a/indra/newview/skins/default/textures/map_avatar_8.tga +++ b/indra/newview/skins/default/textures/map_avatar_8.tga diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png Binary files differindex 7c10aaaead..41cb88628a 100644 --- a/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png +++ b/indra/newview/skins/default/textures/navbar/BuyArrow_Over.png diff --git a/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png b/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png Binary files differindex 9d7716c6de..a02675502a 100644 --- a/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png +++ b/indra/newview/skins/default/textures/navbar/BuyArrow_Press.png diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 01976c9a5c..f7b0bb4629 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -6,6 +6,8 @@ <texture name="Accordion_ArrowOpened_Press" file_name="containers/Accordion_ArrowOpened_Press.png" preload="false" /> <texture name="Accordion_Off" file_name="containers/Accordion_Off.png" preload="false" /> <texture name="Accordion_Press" file_name="containers/Accordion_Press.png" preload="false" /> + <texture name="Accordion_Over" file_name="containers/Accordion_Over.png" preload="false" /> + <texture name="Accordion_Selected" file_name="containers/Accordion_Selected.png" preload="false" /> <texture name="Activate_Checkmark" file_name="taskpanel/Activate_Checkmark.png" preload="false" /> @@ -27,9 +29,9 @@ <texture name="BottomTray_BG" file_name="bottomtray/BottomTray_BG.png" preload="false" /> - <texture name="BuyArrow_Off" file_name="navbar/BuyArrow_Off.png" preload="false" /> - <texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="false" /> - <texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="false" /> + <texture name="BuyArrow_Off" file_name="navbar/BuyArrow_Off.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> + <texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> + <texture name="BuyArrow_Press" file_name="navbar/BuyArrow_Press.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> <texture name="Cam_Avatar_Disabled" file_name="bottomtray/Cam_Avatar_Disabled.png" preload="false" /> <texture name="Cam_Avatar_Over" file_name="bottomtray/Cam_Avatar_Over.png" preload="false" /> @@ -54,11 +56,6 @@ <texture name="CameraView_Off" file_name="bottomtray/CameraView_Off.png" preload="false" /> <texture name="CameraView_Over" file_name="bottomtray/CameraView_Over.png" preload="false" /> - <texture name="CameraPreset_Rear" file_name="camera_presets/camera_presets_rear.png" preload="false" /> - <texture name="CameraPreset_3_4" file_name="camera_presets/camera_presets_3_4.png" preload="false" /> - <texture name="CameraPreset_Front" file_name="camera_presets/camera_presets_front.png" preload="false" /> - <texture name="CameraPreset_Mouselook" file_name="camera_presets/camera_presets_mouselook.png" preload="false" /> - <texture name="Checkbox_Off_Disabled" file_name="widgets/Checkbox_Disabled.png" preload="true" /> <texture name="Checkbox_On_Disabled" file_name="widgets/Checkbox_On_Disabled.png" preload="true" /> <texture name="Checkbox_Off" file_name="widgets/Checkbox_Off.png" preload="true" /> @@ -71,7 +68,6 @@ <texture name="ComboButton_Press" file_name="widgets/ComboButton_Press.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_Selected" file_name="widgets/ComboButton_Selected.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> <texture name="ComboButton_Off" file_name="widgets/ComboButton_Off.png" preload="true" scale.left="2" scale.top="19" scale.right="18" scale.bottom="2" /> - <texture name="Container" file_name="containers/Container.png" preload="false" /> <texture name="DisclosureArrow_Closed_Off" file_name="widgets/DisclosureArrow_Closed_Off.png" preload="true" /> @@ -94,14 +90,18 @@ <texture name="Favorite_Star_Press" file_name="navbar/Favorite_Star_Press.png" preload="false" /> <texture name="Favorite_Star_Over" file_name="navbar/Favorite_Star_Over.png" preload="false" /> - <texture name="FileMenu_BarSelect" file_name="navbar/FileMenu_BarSelect.png" preload="false" /> + <texture name="FileMenu_BarSelect" file_name="navbar/FileMenu_BarSelect.png" preload="false" scale.left="2" scale.top="0" scale.right="2" scale.bottom="0" /> <texture name="FileMenu_BG" file_name="navbar/FileMenu_BG.png" 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" /> <texture name="Generic_Group" file_name="icons/Generic_Group.png" preload="false" /> <texture name="Generic_Group_Large" file_name="icons/Generic_Group_Large.png" preload="false" /> + <texture name="Generic_Object_Medium" file_name="icons/Generic_Object_Medium.png" preload="false" /> + <texture name="Generic_Object_Small" file_name="icons/ Generic_Object_Small.png" preload="false" /> + <texture name="Generic_Object_Large" file_name="icons/Generic_Object_Large.png" preload="false" /> <texture name="Generic_Person" file_name="icons/Generic_Person.png" preload="false" /> <texture name="Generic_Person_Large" file_name="icons/Generic_Person_Large.png" preload="false" /> @@ -123,8 +123,6 @@ <texture name="Icon_Dock_Press" file_name="windows/Icon_Dock_Press.png" preload="true" /> <texture name="Icon_For_Sale" file_name="icons/Icon_For_sale.png" preload="false" /> - <texture name="Banner_ForSale" file_name="Banner_ForSale.png" preload="false" /> - <texture name="Banner_YouAreHere" file_name="Banner_YouAreHere.png" preload="false" /> <texture name="Icon_Gear_Background" file_name="windows/Icon_Gear_Background.png" preload="false" /> <texture name="Icon_Gear_Foreground" file_name="windows/Icon_Gear_Foreground.png" preload="false" /> @@ -146,12 +144,15 @@ <texture name="Info" file_name="icons/Info.png" preload="false" /> <texture name="Info_Small" file_name="icons/Info_Small.png" preload="false" /> <texture name="Info_Off" file_name="navbar/Info_Off.png" preload="false" /> + <texture name="Info_Over" file_name="icons/Info_Over.png" preload="false" /> <texture name="Info_Press" file_name="navbar/Info_Press.png" preload="false" /> - <texture name="Inspector_Background" file_name="windows/Inspector_Background.png" preload="false" /> + <texture name="Inspector_Background" file_name="windows/Inspector_Background.png" preload="false" + scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> <texture name="Inspector_Hover" file_name="windows/Inspector_Hover.png" preload="false" /> - <texture name="Inv_Acessories" file_name="icons/Inv_Acessories.png" preload="false" /> + <texture name="Inv_Acessories" file_name="icons/Inv_Accessories.png" preload="false" /> + <texture name="Inv_Alpha" file_name="icons/Inv_Alpha.png" preload="false" /> <texture name="Inv_Animation" file_name="icons/Inv_Animation.png" preload="false" /> <texture name="Inv_BodyShape" file_name="icons/Inv_BodyShape.png" preload="false" /> <texture name="Inv_CallingCard" file_name="icons/Inv_CallingCard.png" preload="false" /> @@ -164,6 +165,8 @@ <texture name="Inv_Gloves" file_name="icons/Inv_Gloves.png" preload="false" /> <texture name="Inv_Hair" file_name="icons/Inv_Hair.png" preload="false" /> <texture name="Inv_Jacket" file_name="icons/Inv_Jacket.png" preload="false" /> + <texture name="Inv_LookFolderOpen" file_name="icons/Inv_LookFolderOpen.png" preload="false" /> + <texture name="Inv_LookFolderClosed" file_name="icons/Inv_LookFolderClosed.png" preload="false" /> <texture name="Inv_Landmark" file_name="icons/Inv_Landmark.png" preload="false" /> <texture name="Inv_Notecard" file_name="icons/Inv_Notecard.png" preload="false" /> <texture name="Inv_Object" file_name="icons/Inv_Object.png" preload="false" /> @@ -176,6 +179,7 @@ <texture name="Inv_Snapshot" file_name="icons/Inv_Snapshot.png" preload="false" /> <texture name="Inv_Socks" file_name="icons/Inv_Socks.png" preload="false" /> <texture name="Inv_Sound" file_name="icons/Inv_Sound.png" preload="false" /> + <texture name="Inv_Tattoo" file_name="icons/Inv_Tattoo.png" preload="false" /> <texture name="Inv_Texture" file_name="icons/Inv_Texture.png" preload="false" /> <texture name="Inv_Trash" file_name="icons/Inv_Trash.png" preload="false" /> <texture name="Inv_Underpants" file_name="icons/Inv_Underpants.png" preload="false" /> @@ -256,6 +260,42 @@ <texture name="Overhead_M" file_name="world/Overhead_M.png" preload="false" /> <texture name="Overhead_S" file_name="world/Overhead_S.png" preload="false" /> + <texture name="parcel_drk_Build" file_name="icons/parcel_drk_Build.png" preload="false" /> + <texture name="parcel_drk_BuildNo" file_name="icons/parcel_drk_BuildNo.png" preload="false" /> + <texture name="parcel_drk_Damage" file_name="icons/parcel_drk_Damage.png" preload="false" /> + <texture name="parcel_drk_DamageNo" file_name="icons/parcel_drk_DamageNo.png" preload="false" /> + <texture name="parcel_drk_Fly" file_name="icons/parcel_drk_Fly.png" preload="false" /> + <texture name="parcel_drk_FlyNo" file_name="icons/parcel_drk_FlyNo.png" preload="false" /> + <texture name="parcel_drk_ForSale" file_name="icons/parcel_drk_ForSale.png" preload="false" /> + <texture name="parcel_drk_ForSaleNo" file_name="icons/parcel_drk_ForSaleNo.png" preload="false" /> + <texture name="parcel_drk_M" file_name="icons/parcel_drk_M.png" preload="false" /> + <texture name="parcel_drk_PG" file_name="icons/parcel_drk_PG.png" preload="false" /> + <texture name="parcel_drk_Push" file_name="icons/parcel_drk_Push.png" preload="false" /> + <texture name="parcel_drk_PushNo" file_name="icons/parcel_drk_PushNo.png" preload="false" /> + <texture name="parcel_drk_R" file_name="icons/parcel_drk_R.png" preload="false" /> + <texture name="parcel_drk_Scripts" file_name="icons/parcel_drk_Scripts.png" preload="false" /> + <texture name="parcel_drk_ScriptsNo" file_name="icons/parcel_drk_ScriptsNo.png" preload="false" /> + <texture name="parcel_drk_Voice" file_name="icons/parcel_drk_Voice.png" preload="false" /> + <texture name="parcel_drk_VoiceNo" file_name="icons/parcel_drk_VoiceNo.png" preload="false" /> + + <texture name="parcel_lght_Build" file_name="icons/parcel_lght_Build.png" preload="false" /> + <texture name="parcel_lght_BuildNo" file_name="icons/parcel_lght_BuildNo.png" preload="false" /> + <texture name="parcel_lght_Damage" file_name="icons/parcel_lght_Damage.png" preload="false" /> + <texture name="parcel_lght_DamageNo" file_name="icons/parcel_lght_DamageNo.png" preload="false" /> + <texture name="parcel_lght_Fly" file_name="icons/parcel_lght_Fly.png" preload="false" /> + <texture name="parcel_lght_FlyNo" file_name="icons/parcel_lght_FlyNo.png" preload="false" /> + <texture name="parcel_lght_ForSale" file_name="icons/parcel_lght_ForSale.png" preload="false" /> + <texture name="parcel_lght_ForSaleNo" file_name="icons/parcel_lght_ForSaleNo.png" preload="false" /> + <texture name="parcel_lght_M" file_name="icons/parcel_lght_M.png" preload="false" /> + <texture name="parcel_lght_PG" file_name="icons/parcel_lght_PG.png" preload="false" /> + <texture name="parcel_lght_Push" file_name="icons/parcel_lght_Push.png" preload="false" /> + <texture name="parcel_lght_PushNo" file_name="icons/parcel_lght_PushNo.png" preload="false" /> + <texture name="parcel_lght_R" file_name="icons/parcel_lght_R.png" preload="false" /> + <texture name="parcel_lght_Scripts" file_name="icons/parcel_lght_Scripts.png" preload="false" /> + <texture name="parcel_lght_ScriptsNo" file_name="icons/parcel_lght_ScriptsNo.png" preload="false" /> + <texture name="parcel_lght_Voice" file_name="icons/parcel_lght_Voice.png" preload="false" /> + <texture name="parcel_lght_VoiceNo" file_name="icons/parcel_lght_VoiceNo.png" preload="false" /> + <texture name="Progress_1" file_name="icons/Progress_1.png" preload="false" /> <texture name="Progress_2" file_name="icons/Progress_2.png" preload="false" /> <texture name="Progress_3" file_name="icons/Progress_3.png" preload="false" /> @@ -336,7 +376,7 @@ <texture name="SliderThumb_Disabled" file_name="widgets/SliderThumb_Disabled.png" /> <texture name="SliderThumb_Press" file_name="widgets/SliderThumb_Press.png" /> - <texture name="Snapshot_Off" file_name="bottomtray/Snapshot_Off.png" preload="false" /> + <texture name="Snapshot_Off" file_name="bottomtray/Snapshot_Off.png" preload="true" scale.left="4" scale.top="19" scale.right="22" scale.bottom="4" /> <texture name="Snapshot_Over" file_name="bottomtray/Snapshot_Over.png" preload="false" /> <texture name="Snapshot_Press" file_name="bottomtray/Snapshot_Press.png" preload="false" /> @@ -399,7 +439,8 @@ <texture name="TextField_Active" file_name="widgets/TextField_Active.png" preload="true" scale.left="9" scale.top="12" scale.right="248" scale.bottom="12" /> <texture name="Toast_CloseBtn" file_name="windows/Toast_CloseBtn.png" preload="true" /> - <texture name="Toast" file_name="windows/Toast.png" preload="true" /> + <texture name="Toast_Background" file_name="windows/Toast_Background.png" preload="true" + scale.left="4" scale.top="28" scale.right="60" scale.bottom="4" /> <texture name="Tool_Create" file_name="build/Tool_Create.png" preload="false" /> <texture name="Tool_Dozer" file_name="build/Tool_Dozer.png" preload="false" /> @@ -432,16 +473,24 @@ <texture name="VoicePTT_On" file_name="bottomtray/VoicePTT_On.png" preload="false" /> <texture name="Widget_DownArrow" file_name="icons/Widget_DownArrow.png" preload="true" /> + <texture name="Widget_UpArrow" file_name="icons/Widget_UpArrow.png" preload="true" /> - <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" /> - <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" /> - - - + <texture name="Window_Background" file_name="windows/Window_Background.png" preload="true" + scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> + <texture name="Window_Foreground" file_name="windows/Window_Foreground.png" preload="true" + scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> + <texture name="Window_NoTitle_Background" file_name="windows/Window_NoTitle_Background.png" preload="true" + scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> + <texture name="Window_NoTitle_Foreground" file_name="windows/Window_NoTitle_Foreground.png" preload="true" + scale.left="4" scale.top="24" scale.right="26" scale.bottom="4" /> + <texture name="YouAreHere_Badge" file_name="icons/YouAreHere_Badge.png" preload="false" /> <!--WARNING OLD ART *do not use*--> + <texture name="Banner_ForSale" file_name="Banner_ForSale.png" preload="false" /> + <texture name="Banner_YouAreHere" file_name="Banner_YouAreHere.png" preload="false" /> + <texture name="btn_chatbar.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0" /> <texture name="btn_chatbar_selected.tga" scale.left="20" scale.top="24" scale.right="44" scale.bottom="0" /> diff --git a/indra/newview/skins/default/textures/windows/Inspector_Background.png b/indra/newview/skins/default/textures/windows/Inspector_Background.png Binary files differindex 807e8e553c..4c2a728ac5 100644 --- a/indra/newview/skins/default/textures/windows/Inspector_Background.png +++ b/indra/newview/skins/default/textures/windows/Inspector_Background.png diff --git a/indra/newview/skins/default/textures/windows/Toast_Background.png b/indra/newview/skins/default/textures/windows/Toast_Background.png Binary files differnew file mode 100644 index 0000000000..f27d1a12ec --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Toast_Background.png diff --git a/indra/newview/skins/default/textures/windows/Window_Background.png b/indra/newview/skins/default/textures/windows/Window_Background.png Binary files differindex e9f15e76b9..db253900af 100644 --- a/indra/newview/skins/default/textures/windows/Window_Background.png +++ b/indra/newview/skins/default/textures/windows/Window_Background.png diff --git a/indra/newview/skins/default/textures/windows/Window_Foreground.png b/indra/newview/skins/default/textures/windows/Window_Foreground.png Binary files differindex e76e9f3c79..b81ec5b43c 100644 --- a/indra/newview/skins/default/textures/windows/Window_Foreground.png +++ b/indra/newview/skins/default/textures/windows/Window_Foreground.png diff --git a/indra/newview/skins/default/textures/windows/Window_NoTitle_Background.png b/indra/newview/skins/default/textures/windows/Window_NoTitle_Background.png Binary files differnew file mode 100644 index 0000000000..a570ac06bd --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Window_NoTitle_Background.png diff --git a/indra/newview/skins/default/textures/windows/Window_NoTitle_Foreground.png b/indra/newview/skins/default/textures/windows/Window_NoTitle_Foreground.png Binary files differnew file mode 100644 index 0000000000..d573e8c69a --- /dev/null +++ b/indra/newview/skins/default/textures/windows/Window_NoTitle_Foreground.png diff --git a/indra/newview/skins/default/xui/en/floater_aaa.xml b/indra/newview/skins/default/xui/en/floater_aaa.xml index 6d64d13db7..3789369e74 100644 --- a/indra/newview/skins/default/xui/en/floater_aaa.xml +++ b/indra/newview/skins/default/xui/en/floater_aaa.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="440" layout="topleft" name="floater_aaa" diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index b194b533af..3f2636ae52 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="440" layout="topleft" name="floater_about" @@ -7,66 +8,57 @@ save_rect="true" title="About [APP_NAME]" width="470"> - <floater.string - name="you_are_at"> - You are at [POSITION] - </floater.string> - <floater.string - name="in_region"> - in [REGION] located at - </floater.string> - <floater.string - name="CPU"> - CPU: - </floater.string> - <floater.string - name="Memory"> - Memory: [MEM] MB - </floater.string> - <floater.string - name="OSVersion"> - OS Version: - </floater.string> - <floater.string - name="GraphicsCardVendor"> - Graphics Card Vendor: - </floater.string> - <floater.string - name="GraphicsCard"> - Graphics Card: - </floater.string> - <floater.string - name="OpenGLVersion"> - OpenGL Version: - </floater.string> - <floater.string - name="LibCurlVersion"> - libcurl Version: - </floater.string> - <floater.string - name="J2CDecoderVersion"> - J2C Decoder Version: - </floater.string> - <floater.string - name="AudioDriverVersion"> - Audio Driver Version: - </floater.string> - <floater.string - name="none"> - (none) - </floater.string> - <floater.string - name="LLMozLibVersion"> - LLMozLib Version: - </floater.string> <floater.string - name="LLQtWebkitVersion"> - Qt Webkit Version: 4.5.2 + name="AboutHeader"> +[APP_NAME] [VIEWER_VERSION_0].[VIEWER_VERSION_1].[VIEWER_VERSION_2] ([VIEWER_VERSION_3]) [BUILD_DATE] [BUILD_TIME] ([CHANNEL]) +[[VIEWER_RELEASE_NOTES_URL] [ReleaseNotes]] + +</floater.string> + <floater.string + name="AboutCompiler"> +Built with [COMPILER] version [COMPILER_VERSION] + +</floater.string> + <floater.string + name="AboutPosition"> +You are at [POSITION_0,number,1], [POSITION_1,number,1], [POSITION_2,number,1] in [REGION] located at [HOSTNAME] ([HOSTIP]) +[SERVER_VERSION] +[[SERVER_RELEASE_NOTES_URL] [ReleaseNotes]] + +</floater.string> + <!-- *NOTE: Do not translate text like GPU, Graphics Card, etc - + Most PC users who know what these mean will be used to the English versions, + and this info sometimes gets sent to support. --> + <floater.string + name="AboutSystem"> +CPU: [CPU] +Memory: [MEMORY_MB] MB +OS Version: [OS_VERSION] +Graphics Card Vendor: [GRAPHICS_CARD_VENDOR] +Graphics Card: [GRAPHICS_CARD] +</floater.string> + <floater.string + name="AboutDriver"> +Windows Graphics Driver Version: [GRAPHICS_DRIVER_VERSION] +</floater.string> + <floater.string + name="AboutLibs"> +OpenGL Version: [OPENGL_VERSION] + +libcurl Version: [LIBCURL_VERSION] +J2C Decoder Version: [J2C_VERSION] +Audio Driver Version: [AUDIO_DRIVER_VERSION] +Qt Webkit Version: [QT_WEBKIT_VERSION] +Vivox Version: [VIVOX_VERSION] +</floater.string> + <floater.string + name="none"> + (none) </floater.string> <floater.string - name="PacketsLost"> - Packets Lost: [LOST]/[IN] ([PCT]%) - </floater.string> + name="AboutTraffic"> +Packets Lost: [PACKETS_LOST,number,0]/[PACKETS_IN,number,0] ([PACKETS_PCT,number,1]%) +</floater.string> <tab_container follows="all" top="25" diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 072fafd06e..e13aa610e5 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_tear_off="false" height="420" layout="topleft" @@ -25,24 +26,28 @@ remaining </floater.string> <tab_container - follows="left|top|right|bottom" + follows="all" height="400" + halign="center" layout="topleft" + font="SansSerifSmall" left="1" + tab_padding_right="5" + tab_height="20" name="landtab" tab_position="top" top="20" width="459"> - <panel + <panel border="true" - follows="left|top|right|bottom" + follows="all" height="380" label="General" layout="topleft" left="1" help_topic="land_general_tab" name="land_general_panel" - top="-31" + top="0" width="458"> <panel.string name="new users only"> @@ -531,7 +536,7 @@ Go to World menu > About Land or select another parcel to show its details. </panel> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="380" label="Covenant" layout="topleft" @@ -627,7 +632,7 @@ Go to World menu > About Land or select another parcel to show its details. length="1" enabled="false" follows="left|top|right|bottom" - handle_edit_keys_directly="true" + handle_edit_keys_directly="true" height="115" layout="topleft" left_delta="0" @@ -798,7 +803,7 @@ Go to World menu > About Land or select another parcel to show its details. </panel> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="380" label="Objects" layout="topleft" @@ -1164,7 +1169,7 @@ Go to World menu > About Land or select another parcel to show its details. </panel> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="333" label="Options" layout="topleft" @@ -1600,16 +1605,15 @@ Only large parcels can be listed in search. value="Anywhere" /> </combo_box> </panel> - <panel + <panel border="true" - follows="left|top|right|bottom" + follows="all" height="363" label="Media" layout="topleft" left_delta="0" help_topic="land_media_tab" name="land_media_panel" - top_delta="1" width="458"> <text type="string" @@ -1620,24 +1624,22 @@ Only large parcels can be listed in search. left="10" name="with media:" top="9" - width="65"> + width="100"> Type: </text> <combo_box - height="18" + height="20" layout="topleft" - left_pad="5" + left_pad="10" name="media type" tool_tip="Specify if the URL is a movie, web page, or other media" - top_delta="-2" - width="120" /> + width="150" /> <text follows="left|top" height="16" layout="topleft" left_pad="10" name="mime_type" - top_delta="2" width="200" /> <text type="string" @@ -1647,32 +1649,30 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="at URL:" - top="29" - width="65"> + top_pad="10" + width="100"> Home URL: </text> <line_editor - bottom_delta="0" follows="left|top" - height="16" + height="20" layout="topleft" - left="80" + left_pad="10" max_length="255" name="media_url" - right="-80" select_on_focus="true" - text_readonly_color="0.576471 0.662745 0.835294 1" /> + width="270" + /> <button follows="left|top" font="SansSerifSmall" - height="16" - label="Set..." - label_selected="Set..." + height="20" + label="Set" + label_selected="Set" layout="topleft" - left_pad="8" + left_pad="5" name="set_media_url" - top_delta="0" - width="60" /> + width="50" /> <text type="string" length="1" @@ -1681,37 +1681,34 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="CurrentURL:" - top="49" - width="65"> + top_pad="10" + width="100"> Current URL: </text> <text follows="left|top" height="16" layout="topleft" - left_pad="5" + left_pad="10" name="current_url" - top_delta="0" - width="300" /> + width="260">http://</text> <button follows="left|top" - font="SansSerifSmall" - height="16" - label="Reset..." - label_selected="Reset..." + height="20" + label="Reset" + label_selected="Reset" layout="topleft" left_pad="6" name="reset_media_url" - top_delta="0" width="60" /> <check_box height="16" label="Hide URL" layout="topleft" - left="100" + left="120" name="hide_media_url" tool_tip="Checking this option will hide the media url to any non-authorized viewers of this parcel information. Note this is not available for HTML types." - top="89" + top_pad="2" width="200" /> <text type="string" @@ -1721,23 +1718,20 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="Description:" - top="49" - width="364"> + top_pad="10" + width="100"> Description: </text> <line_editor - border_style="line" - border_thickness="1" - bottom_delta="0" follows="left|top" - height="16" + height="35" layout="topleft" - left="80" - max_length="255" name="url_description" - right="-80" + left_pad="10" select_on_focus="true" - tool_tip="Text displayed next to play/load button" /> + tool_tip="Text displayed next to play/load button" + top_delta="0" + width="270" /> <text type="string" length="1" @@ -1746,10 +1740,9 @@ Only large parcels can be listed in search. layout="topleft" left="10" name="Media texture:" - top="69" - width="364"> - Replace -Texture: + top_pad="10" + width="100"> + Replace Texture: </text> <texture_picker allow_no_texture="true" @@ -1757,7 +1750,7 @@ Texture: follows="left|top" height="80" layout="topleft" - left_delta="70" + left_pad="10" name="media texture" tool_tip="Click to choose a picture" top_delta="0" @@ -1766,25 +1759,22 @@ Texture: type="string" length="1" follows="left|top" - height="16" + height="50" layout="topleft" - left_delta="75" + left_pad="10" name="replace_texture_help" - top="85" - width="270"> - Objects using this texture will show the movie or - web page after you click the play arrow. - - Select the thumbnail to choose a different texture. + top_delta="0" + word_wrap="true" + width="240"> + Objects using this texture will show the movie or web page after you click the play arrow. </text> <check_box height="16" label="Auto scale" layout="topleft" - left_delta="70" name="media_auto_scale" tool_tip="Checking this option will scale the content for this parcel automatically. It may be slightly slower and lower quality visually but no other texture scaling or alignment will be required." - top_delta="0" + top_pad="3" width="200" /> <text type="string" @@ -1792,11 +1782,11 @@ Texture: follows="left|top" height="16" layout="topleft" - left="85" + left="10" + top_pad="10" name="media_size" tool_tip="Size to render Web media, leave 0 for default." - top="185" - width="85"> + width="100"> Size: </text> <spinner @@ -1808,12 +1798,22 @@ Texture: increment="1" initial_value="0" layout="topleft" - left_delta="65" + left_pad="10" max_val="1024" name="media_size_width" tool_tip="Size to render Web media, leave 0 for default." top_delta="0" width="64" /> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left_pad="5" + name="pixels"> + px wide + </text> <spinner decimal_digits="0" enabled="false" @@ -1823,23 +1823,21 @@ Texture: increment="1" initial_value="0" layout="topleft" - left_pad="16" + left="120" + top_pad="3" max_val="1024" name="media_size_height" tool_tip="Size to render Web media, leave 0 for default." - top_delta="0" width="64" /> <text type="string" length="1" - bottom_delta="0" follows="left|top" height="16" layout="topleft" - left_delta="70" - name="pixels" - right="-10"> - pixels + left_pad="5" + name="pixels"> + px high </text> <text type="string" @@ -1849,15 +1847,15 @@ Texture: layout="topleft" left="10" name="Options:" - top="237" - width="292"> + top_pad="10" + width="100"> Options: </text> <check_box height="16" label="Loop" layout="topleft" - left_delta="70" + left_pad="10" name="media_loop" tool_tip="Play media in a loop. When the media has finished playing, it will restart from the beginning." top_delta="0" @@ -1865,9 +1863,9 @@ Texture: </panel> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="363" - label="Audio" + label="Sound" layout="topleft" left_delta="0" help_topic="land_audio_tab" @@ -1969,7 +1967,7 @@ Texture: </panel> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="333" label="Access" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_activeim.xml b/indra/newview/skins/default/xui/en/floater_activeim.xml index f81250e7b9..1bc9cde044 100644 --- a/indra/newview/skins/default/xui/en/floater_activeim.xml +++ b/indra/newview/skins/default/xui/en/floater_activeim.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" name="floater_activeim" help_topic="floater_activeim" title="ACTIVE IM" diff --git a/indra/newview/skins/default/xui/en/floater_animation_preview.xml b/indra/newview/skins/default/xui/en/floater_animation_preview.xml index 11773c34dc..ab3d5722f0 100644 --- a/indra/newview/skins/default/xui/en/floater_animation_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_animation_preview.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="556" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_auction.xml b/indra/newview/skins/default/xui/en/floater_auction.xml index fb0994b4cd..aae6508041 100644 --- a/indra/newview/skins/default/xui/en/floater_auction.xml +++ b/indra/newview/skins/default/xui/en/floater_auction.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="412" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml index 0542d4509e..1fd9b95318 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_picker.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="350" layout="topleft" @@ -85,6 +86,52 @@ top="52" width="132" /> </panel> + <panel + border="none" + height="150" + label="Friends" + layout="topleft" + left="6" + help_topic="avatarpicker_friends_tab" + name="FriendsPanel" + top="150" + width="132"> + <text + type="string" + length="1" + follows="left|top" + height="16" + layout="topleft" + left="10" + name="InstructSelectFriend" + top="5" + width="200"> + Select a person: + </text> + <button + follows="top|right" + layout="topleft" + right="-5" + top ="5" + height="20" + width="20" + name="RefreshFriends" + picture_style="true" + image_overlay="Refresh_Off"> + <button.commit_callback + function="Refresh.FriendList"/> + </button> + <scroll_list + follows="all" + height="100" + border="false" + layout="topleft" + left="0" + name="Friends" + sort_column="0" + top_pad="5" + width="132" /> + </panel> <panel border="none" diff --git a/indra/newview/skins/default/xui/en/floater_avatar_textures.xml b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml index e677426ee5..4f2a36e518 100644 --- a/indra/newview/skins/default/xui/en/floater_avatar_textures.xml +++ b/indra/newview/skins/default/xui/en/floater_avatar_textures.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="950" layout="topleft" name="avatar_texture_debug" diff --git a/indra/newview/skins/default/xui/en/floater_beacons.xml b/indra/newview/skins/default/xui/en/floater_beacons.xml index a60064fb37..1c83799e72 100644 --- a/indra/newview/skins/default/xui/en/floater_beacons.xml +++ b/indra/newview/skins/default/xui/en/floater_beacons.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="225" layout="topleft" name="beacons" diff --git a/indra/newview/skins/default/xui/en/floater_build_options.xml b/indra/newview/skins/default/xui/en/floater_build_options.xml index 3e6845cfa5..bddbbdd3b2 100644 --- a/indra/newview/skins/default/xui/en/floater_build_options.xml +++ b/indra/newview/skins/default/xui/en/floater_build_options.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" follows="right" height="170" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml index ef6af28786..02958bee74 100644 --- a/indra/newview/skins/default/xui/en/floater_bulk_perms.xml +++ b/indra/newview/skins/default/xui/en/floater_bulk_perms.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_tear_off="false" height="310" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_bumps.xml b/indra/newview/skins/default/xui/en/floater_bumps.xml index d1f6706875..2917096f3c 100644 --- a/indra/newview/skins/default/xui/en/floater_bumps.xml +++ b/indra/newview/skins/default/xui/en/floater_bumps.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="180" layout="topleft" name="floater_bumps" diff --git a/indra/newview/skins/default/xui/en/floater_buy_contents.xml b/indra/newview/skins/default/xui/en/floater_buy_contents.xml index 718f83c9a2..aacc3ad8d0 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_contents.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_contents.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="290" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 9b0b56d9cf..88712bda5e 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -1,12 +1,13 @@ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <floater + legacy_header_height="18" can_minimize="false" height="275" layout="topleft" + title="Buy L$" name="buy currency" help_topic="buy_linden_dollars" single_instance="true" - title="Buy L$" width="350"> <floater.string name="buy_currency"> diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index 6d1c2c1cb9..8314549132 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="484" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_buy_object.xml b/indra/newview/skins/default/xui/en/floater_buy_object.xml index 7930622e54..49ea3f5dd1 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_object.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_object.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="290" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 520249c2a2..1b69418013 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -1,17 +1,18 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_dock="true" - can_minimize="true" - can_close="true" + can_minimize="false" + can_close="true" center_horiz="true" - follows="top" - height="110" + follows="bottom" + height="152" layout="topleft" name="camera_floater" help_topic="camera_floater" save_rect="true" save_visibility="true" - width="105"> + width="150"> <floater.string name="rotate_tooltip"> Rotate Camera Around Focus @@ -25,69 +26,71 @@ Move Camera Up and Down, Left and Right </floater.string> <panel - border="true" - height="79" + border="false" + height="110" layout="topleft" - left="0" + left="2" top="0" - mouse_opaque="false" + mouse_opaque="false" name="controls" - width="105"> - <joystick_rotate - follows="top|left" - height="64" - image_selected="cam_rotate_in.tga" - image_unselected="cam_rotate_out.tga" - layout="topleft" - left="2" - name="cam_rotate_stick" - picture_style="true" - quadrant="left" - scale_image="false" - sound_flags="3" - tool_tip="Orbit camera around focus" - top="15" - width="64" /> + width="148"> <joystick_track follows="top|left" - height="64" - image_selected="cam_tracking_in.tga" - image_unselected="cam_tracking_out.tga" + height="78" + image_selected="Cam_Tracking_In" + image_unselected="Cam_Tracking_Out" layout="topleft" - left="2" + left="45" name="cam_track_stick" picture_style="true" quadrant="left" scale_image="false" sound_flags="3" tool_tip="Move camera up and down, left and right" - top="15" + top="22" visible="false" - width="64" /> + width="78" /> + <!--TODO: replace with slider, + - images --> <joystick_zoom follows="top|left" - height="64" - image_unselected="cam_zoom_out.tga" + height="78" + image_unselected="ScrollThumb_Vert" layout="topleft" - left_delta="70" - minus_image="cam_zoom_minus_in.tga" + left="7" + minus_image="ScrollThumb_Vert" name="zoom" picture_style="true" - plus_image="cam_zoom_plus_in.tga" + plus_image="ScrollThumb_Vert" quadrant="left" scale_image="false" sound_flags="3" tool_tip="Zoom camera toward focus" - top_delta="0" - width="16" /> + top="22" + width="20" /> + <joystick_rotate + follows="top|left" + height="78" + image_selected="Cam_Rotate_In" + image_unselected="Cam_Rotate_Out" + layout="topleft" + left="45" + name="cam_rotate_stick" + picture_style="true" + quadrant="left" + scale_image="false" + sound_flags="3" + visible="true" + tool_tip="Orbit camera around focus" + top="22" + width="78" /> <panel - height="70" + height="78" layout="topleft" - left="15" + left="36" name="camera_presets" - top="15" + top="30" visible="false" - width="75"> + width="78"> <button height="30" image_selected="CameraPreset_Rear" @@ -127,7 +130,7 @@ name="front_view" picture_style="true" tool_tip="Front View" - top_pad="2" + top_pad="5" width="30"> <click_callback function="CameraPresets.ChangeView" @@ -151,21 +154,21 @@ </panel> </panel> <panel - border="true" - height="25" + border="false" + height="42" layout="topleft" - left="0" - top_pad="1" + left="2" + top_pad="0" name="buttons" - width="105"> + width="148"> <button height="23" label="" layout="topleft" - left="2" + left="23" is_toggle="true" image_overlay="Cam_Orbit_Off" - image_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" name="orbit_btn" tab_stop="false" tool_tip="Orbit camera" @@ -179,7 +182,7 @@ left_pad="0" is_toggle="true" image_overlay="Cam_Pan_Off" - image_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" name="pan_btn" tab_stop="false" tool_tip="Pan camera" @@ -191,7 +194,7 @@ layout="topleft" left_pad="0" image_overlay="Cam_Avatar_Off" - image_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" name="avatarview_btn" tab_stop="false" tool_tip="See as avatar" @@ -204,12 +207,11 @@ left_pad="0" is_toggle="true" image_overlay="Cam_FreeCam_Off" - image_selected="PushButton_Selected_Press" + image_selected="PushButton_Selected_Press" name="freecamera_btn" tab_stop="false" tool_tip="View object" width="25"> </button> - </panel> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_choose_group.xml b/indra/newview/skins/default/xui/en/floater_choose_group.xml index 371e239fdb..8b34fda96c 100644 --- a/indra/newview/skins/default/xui/en/floater_choose_group.xml +++ b/indra/newview/skins/default/xui/en/floater_choose_group.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="258" layout="topleft" name="groups" diff --git a/indra/newview/skins/default/xui/en/floater_color_picker.xml b/indra/newview/skins/default/xui/en/floater_color_picker.xml index f2146339a7..686b8dc40f 100644 --- a/indra/newview/skins/default/xui/en/floater_color_picker.xml +++ b/indra/newview/skins/default/xui/en/floater_color_picker.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="380" diff --git a/indra/newview/skins/default/xui/en/floater_critical.xml b/indra/newview/skins/default/xui/en/floater_critical.xml index 5475a1cf6a..7b5451553f 100644 --- a/indra/newview/skins/default/xui/en/floater_critical.xml +++ b/indra/newview/skins/default/xui/en/floater_critical.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_close="false" can_minimize="false" height="500" diff --git a/indra/newview/skins/default/xui/en/floater_customize.xml b/indra/newview/skins/default/xui/en/floater_customize.xml index 57f5800f2c..07d76f4810 100644 --- a/indra/newview/skins/default/xui/en/floater_customize.xml +++ b/indra/newview/skins/default/xui/en/floater_customize.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="540" diff --git a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml index b044cd41e6..b8fa104352 100644 --- a/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml +++ b/indra/newview/skins/default/xui/en/floater_day_cycle_options.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="275" layout="topleft" name="Day Cycle Floater" diff --git a/indra/newview/skins/default/xui/en/floater_device_settings.xml b/indra/newview/skins/default/xui/en/floater_device_settings.xml index 8901608374..2b23980423 100644 --- a/indra/newview/skins/default/xui/en/floater_device_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_device_settings.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="260" layout="topleft" name="floater_device_settings" diff --git a/indra/newview/skins/default/xui/en/floater_env_settings.xml b/indra/newview/skins/default/xui/en/floater_env_settings.xml index cecd6c4ef7..7c22311f66 100644 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="150" layout="topleft" name="Environment Editor Floater" diff --git a/indra/newview/skins/default/xui/en/floater_first_time_tip.xml b/indra/newview/skins/default/xui/en/floater_first_time_tip.xml index 4975111111..e4ac8fed77 100644 --- a/indra/newview/skins/default/xui/en/floater_first_time_tip.xml +++ b/indra/newview/skins/default/xui/en/floater_first_time_tip.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_close="true" can_minimize="false" height="250" diff --git a/indra/newview/skins/default/xui/en/floater_font_test.xml b/indra/newview/skins/default/xui/en/floater_font_test.xml index 66c207603b..8b14f691d6 100644 --- a/indra/newview/skins/default/xui/en/floater_font_test.xml +++ b/indra/newview/skins/default/xui/en/floater_font_test.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="800" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_gesture.xml b/indra/newview/skins/default/xui/en/floater_gesture.xml index 7346c81e79..128d518e12 100644 --- a/indra/newview/skins/default/xui/en/floater_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_gesture.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="465" name="gestures" diff --git a/indra/newview/skins/default/xui/en/floater_god_tools.xml b/indra/newview/skins/default/xui/en/floater_god_tools.xml index 02754b25dd..97cb6e259c 100644 --- a/indra/newview/skins/default/xui/en/floater_god_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_god_tools.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="384" layout="topleft" name="godtools floater" diff --git a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml index fe04d1f627..cd98f21918 100644 --- a/indra/newview/skins/default/xui/en/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_hardware_settings.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="224" layout="topleft" name="Hardware Settings Floater" @@ -131,7 +132,7 @@ layout="topleft" left="10" max_val="4096" - name="GrapicsCardTextureMemory" + name="GraphicsCardTextureMemory" tool_tip="Amount of memory to allocate for textures. Defaults to video card memory. Reducing this may improve performance but may also make textures blurry." top_pad="10" width="300" /> diff --git a/indra/newview/skins/default/xui/en/floater_help_browser.xml b/indra/newview/skins/default/xui/en/floater_help_browser.xml index 512b4c85a1..d2fe8d0e6d 100644 --- a/indra/newview/skins/default/xui/en/floater_help_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_help_browser.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_hud.xml b/indra/newview/skins/default/xui/en/floater_hud.xml index 23e0ef50fd..6e8950c49a 100644 --- a/indra/newview/skins/default/xui/en/floater_hud.xml +++ b/indra/newview/skins/default/xui/en/floater_hud.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="292" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml index 0037c6ef04..26d2f4e497 100644 --- a/indra/newview/skins/default/xui/en/floater_im_session.xml +++ b/indra/newview/skins/default/xui/en/floater_im_session.xml @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" background_visible="true" follows="left|top|right|bottom" - height="250" + height="270" layout="topleft" left="0" name="panel_im" @@ -16,7 +17,7 @@ min_width="200" min_height="150"> <layout_stack follows="left|top|right|bottom" - height="235" + height="255" width="365" layout="topleft" orientation="horizontal" @@ -28,11 +29,11 @@ layout="topleft" top_delta="-3" width="146" - height="225" + height="255" follows="left" label="IM Control Panel" user_resize="false" /> - <layout_panel height="235" + <layout_panel height="255" width="200" left_delta="146" top="0" @@ -55,7 +56,7 @@ length="1" follows="left|top|right|bottom" font="SansSerif" - height="185" + height="205" layout="topleft" name="chat_history" parse_highlights="true" diff --git a/indra/newview/skins/default/xui/en/floater_image_preview.xml b/indra/newview/skins/default/xui/en/floater_image_preview.xml index 4e4fe97e62..2562daf4b3 100644 --- a/indra/newview/skins/default/xui/en/floater_image_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_image_preview.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="440" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_incoming_call.xml b/indra/newview/skins/default/xui/en/floater_incoming_call.xml index 95e4247a05..dcb93c6e2f 100644 --- a/indra/newview/skins/default/xui/en/floater_incoming_call.xml +++ b/indra/newview/skins/default/xui/en/floater_incoming_call.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_close="false" can_minimize="false" can_tear_off="false" diff --git a/indra/newview/skins/default/xui/en/floater_inspect.xml b/indra/newview/skins/default/xui/en/floater_inspect.xml index 339604e658..9f7723c51b 100644 --- a/indra/newview/skins/default/xui/en/floater_inspect.xml +++ b/indra/newview/skins/default/xui/en/floater_inspect.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="300" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_inventory.xml b/indra/newview/skins/default/xui/en/floater_inventory.xml index 0f06558dd1..dfa6c83b4e 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_resize="true" height="563" @@ -41,13 +42,15 @@ top="34" width="455" /> <tab_container - follows="left|top|right|bottom" + follows="all" height="508" + halign="center" layout="topleft" left_delta="-4" name="inventory filter tabs" tab_position="top" - top_pad="4" + tab_height="20" + top_pad="5" width="463"> <inventory_panel follows="left|top|right|bottom" diff --git a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml index e3e2decef7..4f0609c7f8 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_item_properties.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" height="340" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml index 6556a14730..0042f97a8e 100644 --- a/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml +++ b/indra/newview/skins/default/xui/en/floater_inventory_view_finder.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="408" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_joystick.xml b/indra/newview/skins/default/xui/en/floater_joystick.xml index c0bcfd2271..e2da059ace 100644 --- a/indra/newview/skins/default/xui/en/floater_joystick.xml +++ b/indra/newview/skins/default/xui/en/floater_joystick.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="500" layout="topleft" name="Joystick" diff --git a/indra/newview/skins/default/xui/en/floater_lagmeter.xml b/indra/newview/skins/default/xui/en/floater_lagmeter.xml index 2966b47232..d98fdc5118 100644 --- a/indra/newview/skins/default/xui/en/floater_lagmeter.xml +++ b/indra/newview/skins/default/xui/en/floater_lagmeter.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="150" layout="topleft" name="floater_lagmeter" diff --git a/indra/newview/skins/default/xui/en/floater_land_holdings.xml b/indra/newview/skins/default/xui/en/floater_land_holdings.xml index dbafa56035..46d74b6aff 100644 --- a/indra/newview/skins/default/xui/en/floater_land_holdings.xml +++ b/indra/newview/skins/default/xui/en/floater_land_holdings.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="400" layout="topleft" name="land holdings floater" diff --git a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml index dc6c8302a0..93bbb0107e 100644 --- a/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml +++ b/indra/newview/skins/default/xui/en/floater_live_lsleditor.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" bevel_style="none" border_style="line" can_resize="true" diff --git a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml index fd2ee6ce5c..4dcf168605 100644 --- a/indra/newview/skins/default/xui/en/floater_lsl_guide.xml +++ b/indra/newview/skins/default/xui/en/floater_lsl_guide.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" follows="left|top" height="400" diff --git a/indra/newview/skins/default/xui/en/floater_map.xml b/indra/newview/skins/default/xui/en/floater_map.xml index a2b2e1ddf3..7b4c5f38a1 100644 --- a/indra/newview/skins/default/xui/en/floater_map.xml +++ b/indra/newview/skins/default/xui/en/floater_map.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" follows="top|right" height="225" diff --git a/indra/newview/skins/default/xui/en/floater_media_browser.xml b/indra/newview/skins/default/xui/en/floater_media_browser.xml index ad2c50c6d9..b11892be74 100644 --- a/indra/newview/skins/default/xui/en/floater_media_browser.xml +++ b/indra/newview/skins/default/xui/en/floater_media_browser.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="440" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_media_settings.xml b/indra/newview/skins/default/xui/en/floater_media_settings.xml index b96573b32a..4218c15408 100644 --- a/indra/newview/skins/default/xui/en/floater_media_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_media_settings.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<floater +<floater + legacy_header_height="18" bottom="-666" can_close="true" can_drag_on_left="false" diff --git a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml index bd83da02aa..560acafd4f 100644 --- a/indra/newview/skins/default/xui/en/floater_mem_leaking.xml +++ b/indra/newview/skins/default/xui/en/floater_mem_leaking.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="175" diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml index 745385f153..02cbef5987 100644 --- a/indra/newview/skins/default/xui/en/floater_moveview.xml +++ b/indra/newview/skins/default/xui/en/floater_moveview.xml @@ -1,8 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_dock="true" can_close="true" - can_minimize="true" + can_minimize="false" center_horiz="true" follows="bottom" height="110" @@ -37,7 +38,7 @@ Fly Backwards (press Down Arrow or S) </string> <panel - border="true" + border="false" height="83" follows="left|top" layout="topleft" @@ -135,7 +136,7 @@ </panel> <!-- Width and height of this panel should be synchronized with panel_stand_stop_flying.xml --> <panel - border="true" + border="false" height="27" layout="topleft" left="0" diff --git a/indra/newview/skins/default/xui/en/floater_mute_object.xml b/indra/newview/skins/default/xui/en/floater_mute_object.xml index 06a03ff340..33b1dac8a5 100644 --- a/indra/newview/skins/default/xui/en/floater_mute_object.xml +++ b/indra/newview/skins/default/xui/en/floater_mute_object.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="130" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_my_friends.xml b/indra/newview/skins/default/xui/en/floater_my_friends.xml index 0ca4fc825a..689221b9c7 100644 --- a/indra/newview/skins/default/xui/en/floater_my_friends.xml +++ b/indra/newview/skins/default/xui/en/floater_my_friends.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_close="false" can_resize="true" height="390" diff --git a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml index 25d337ccec..e7c5bf8585 100644 --- a/indra/newview/skins/default/xui/en/floater_nearby_chat.xml +++ b/indra/newview/skins/default/xui/en/floater_nearby_chat.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater +<floater + legacy_header_height="18" can_minimize="true" can_tear_off="false" can_resize="false" @@ -13,7 +14,9 @@ help_topic="nearby_chat" save_rect="true" title="Nearby Chat" + save_dock_state="true" save_visibility="true" + single_instance="true" width="320"> <chat_history allow_html="true" diff --git a/indra/newview/skins/default/xui/en/floater_notification.xml b/indra/newview/skins/default/xui/en/floater_notification.xml index cd88ec2f3f..f9cb22055a 100644 --- a/indra/newview/skins/default/xui/en/floater_notification.xml +++ b/indra/newview/skins/default/xui/en/floater_notification.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="200" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_notifications_console.xml b/indra/newview/skins/default/xui/en/floater_notifications_console.xml index 3783417cdb..03a2aad96d 100644 --- a/indra/newview/skins/default/xui/en/floater_notifications_console.xml +++ b/indra/newview/skins/default/xui/en/floater_notifications_console.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="500" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_openobject.xml b/indra/newview/skins/default/xui/en/floater_openobject.xml index 17f7e9bf67..cc50f43339 100644 --- a/indra/newview/skins/default/xui/en/floater_openobject.xml +++ b/indra/newview/skins/default/xui/en/floater_openobject.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" default_tab_group="1" height="350" diff --git a/indra/newview/skins/default/xui/en/floater_pay.xml b/indra/newview/skins/default/xui/en/floater_pay.xml index 5f70f09a34..b4becfa022 100644 --- a/indra/newview/skins/default/xui/en/floater_pay.xml +++ b/indra/newview/skins/default/xui/en/floater_pay.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="185" layout="topleft" @@ -34,7 +35,7 @@ type="string" length="1" follows="left|top" - font="SansSerif" + font="SansSerifSmall" height="16" layout="topleft" left_pad="7" @@ -44,6 +45,7 @@ </text> <button height="23" + font="SansSerifSmall" label="L$1" label_selected="L$1" layout="topleft" @@ -53,7 +55,8 @@ width="80" /> <button height="23" - label="L$5" + label="L$1" + font="SansSerif" label_selected="L$5" layout="topleft" left_pad="15" @@ -62,6 +65,7 @@ <button height="23" label="L$10" + font="SansSerifHuge" label_selected="L$10" layout="topleft" left="25" diff --git a/indra/newview/skins/default/xui/en/floater_pay_object.xml b/indra/newview/skins/default/xui/en/floater_pay_object.xml index acff55386b..8d230023cc 100644 --- a/indra/newview/skins/default/xui/en/floater_pay_object.xml +++ b/indra/newview/skins/default/xui/en/floater_pay_object.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="220" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_perm_prefs.xml b/indra/newview/skins/default/xui/en/floater_perm_prefs.xml index f65bb6f32f..eb0c22b9c4 100644 --- a/indra/newview/skins/default/xui/en/floater_perm_prefs.xml +++ b/indra/newview/skins/default/xui/en/floater_perm_prefs.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="180" layout="topleft" name="perm prefs" diff --git a/indra/newview/skins/default/xui/en/floater_post_process.xml b/indra/newview/skins/default/xui/en/floater_post_process.xml index 571f4149f0..46554beede 100644 --- a/indra/newview/skins/default/xui/en/floater_post_process.xml +++ b/indra/newview/skins/default/xui/en/floater_post_process.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="400" layout="topleft" name="Post-Process Floater" diff --git a/indra/newview/skins/default/xui/en/floater_postcard.xml b/indra/newview/skins/default/xui/en/floater_postcard.xml index d93cad6dbd..b13bd1740c 100644 --- a/indra/newview/skins/default/xui/en/floater_postcard.xml +++ b/indra/newview/skins/default/xui/en/floater_postcard.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_minimize="false" can_resize="true" diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index 285045f2c8..d2a2a7ce02 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" center_horiz="true" center_vert="true" default_tab_group="1" @@ -12,32 +13,32 @@ width="620"> <button follows="right|bottom" - height="20" + height="23" label="OK" label_selected="OK" layout="topleft" - left="427" + right="-105" name="OK" - top="435" + top="433" width="90"> <button.commit_callback function="Pref.OK" /> </button> <button follows="right|bottom" - height="20" + height="23" label="Cancel" label_selected="Cancel" layout="topleft" - left_pad="3" + left_pad="5" name="Cancel" - top_delta="0" + right="-10" width="90" > <button.commit_callback function="Pref.Cancel" /> </button> <tab_container - follows="left|top|right|bottom" + follows="all" height="410" layout="topleft" left="0" @@ -48,14 +49,14 @@ top="21" width="620"> <panel - class="panel_preference" + class="panel_preference" filename="panel_preferences_general.xml" label="General" layout="topleft" help_topic="preferences_general_tab" name="general" /> <panel - class="panel_preference" + class="panel_preference" filename="panel_preferences_graphics1.xml" label="Graphics" layout="topleft" @@ -103,13 +104,6 @@ layout="topleft" help_topic="preferences_advanced1_tab" name="advanced1" /> - <panel - class="panel_preference" - filename="panel_preferences_advanced2.xml" - label="Move or Kill" - layout="topleft" - help_topic="preferences_advanced2_tab" - name="advanced2" /> </tab_container> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_preview_animation.xml b/indra/newview/skins/default/xui/en/floater_preview_animation.xml index e34b87dbba..3b84358484 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_animation.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_animation.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" height="85" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_preview_classified.xml b/indra/newview/skins/default/xui/en/floater_preview_classified.xml index 07167c3ae4..7c8c6d7207 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_classified.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_classified.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" height="510" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_preview_event.xml b/indra/newview/skins/default/xui/en/floater_preview_event.xml index 77fbe7c060..f5ab8c95d7 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_event.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_event.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" height="510" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml index a523f40bb8..4f3978a5e3 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" - height="800" + height="460" layout="topleft" name="gesture_preview" help_topic="gesture_preview" @@ -46,10 +47,11 @@ height="10" layout="topleft" left="10" - name="Name" + name="desc_label" top="25" + font.style="BOLD" width="100"> - Name (not working yet): + Description: </text> <line_editor follows="left|top" @@ -67,70 +69,270 @@ height="10" layout="topleft" left="10" - name="desc_label" + font.style="BOLD" + name="trigger_label" top_pad="10" width="100"> - Description: + Trigger: </text> <line_editor follows="left|top" - height="40" + height="20" + layout="topleft" + left_delta="84" + max_length="31" + name="trigger_editor" + top_delta="-4" + width="180" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifSmall" + height="10" + layout="topleft" + left="10" + font.style="BOLD" + name="replace_text" + tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture!" + top_pad="10" + width="200"> + Replace with: + </text> + <line_editor + follows="left|top" + height="20" + layout="topleft" + left_delta="84" + max_length="31" + name="replace_editor" + tool_tip="Replace the trigger word(s) with these words. For example, trigger 'hello' replace with 'howdy' will turn the chat 'I wanted to say hello' into 'I wanted to say howdy' as well as playing the gesture" + top_delta="-4" + width="180" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifSmall" + height="10" + layout="topleft" + left="10" + font.style="BOLD" + name="key_label" + top_pad="10" + width="100"> + Shortcut Key: + </text> + <combo_box + height="20" + label="None" layout="topleft" left_delta="84" - name="desc2" + name="modifier_combo" top_delta="-4" + width="75" /> + <combo_box + height="20" + label="None" + layout="topleft" + left_pad="10" + name="key_combo" + top_delta="0" + width="75" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifSmall" + height="10" + layout="topleft" + left="10" + font.style="BOLD" + name="library_label" + top="135" + width="100"> + Library: + </text> + <scroll_list + follows="top|left" + height="60" + layout="topleft" + left="10" + name="library_list" + top="150" + width="180"> + <scroll_list.rows + value="Animation" /> + <scroll_list.rows + value="Sound" /> + <scroll_list.rows + value="Chat" /> + <scroll_list.rows + value="Wait" /> + </scroll_list> + <button + follows="top|left" + height="20" + font="SansSerifSmall" + label="Add >>" + layout="topleft" + left_pad="10" + name="add_btn" + top_delta="0" + width="70" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifSmall" + height="10" + layout="topleft" + left="10" + font.style="BOLD" + name="steps_label" + top_pad="50" + width="100"> + Steps: + </text> + <scroll_list + follows="top|left" + height="85" + layout="topleft" + left="10" + name="step_list" + top_pad="5" width="180" /> - - <accordion - layout="topleft" - left="2" - width="276" - top="95" - height="580" - follows="all" - name="group_accordion"> - <accordion_tab - min_height="90" - title="Shortcuts" - name="snapshot_destination_tab" - an_resize="false"> - <panel - class="floater_preview_shortcut" - filename="floater_preview_gesture_shortcut.xml" - name="floater_preview_shortcut"/> - </accordion_tab> - <accordion_tab - min_height="400" - title="Steps" - name="snapshot_file_settings_tab" - can_resize="false"> - <panel - class="floater_preview_steps" - filename="floater_preview_gesture_steps.xml" - name="floater_preview_steps"/> - </accordion_tab> - <accordion_tab - min_height="155" - title="Info" - name="snapshot_capture_tab" - can_resize="false"> - <panel - class="floater_preview_info" - filename="floater_preview_gesture_info.xml" - name="floater_preview_info"/> - </accordion_tab> - <!--accordion_tab - min_height="100" - title="Permissions" - name="snapshot_capture_tab2" - can_resize="false"> - <panel - class="floater_snapshot_capture" - filename="floater_snapshot_Permissions.xml" - name="snapshot_capture_panel2"/> - </accordion_tab--> - </accordion> - <!--check_box + <button + follows="top|left" + height="20" + font="SansSerifSmall" + label="Up" + layout="topleft" + left_pad="10" + name="up_btn" + top_delta="0" + width="70" /> + <button + follows="top|left" + height="20" + font="SansSerifSmall" + label="Down" + layout="topleft" + left_delta="0" + name="down_btn" + top_pad="10" + width="70" /> + <button + follows="top|left" + height="20" + font="SansSerifSmall" + label="Remove" + layout="topleft" + left_delta="0" + name="delete_btn" + top_pad="10" + width="70" /> + <text + follows="top|left" + height="60" + layout="topleft" + left="15" + name="options_text" + top="330" + width="205" /> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="15" + name="animation_list" + top="345" + width="100" /> + <combo_box + follows="top|left" + height="20" + layout="topleft" + left_delta="0" + name="sound_list" + top_delta="0" + width="100" /> + <line_editor + follows="top|left" + height="20" + layout="topleft" + left_delta="0" + max_length="127" + name="chat_editor" + top_delta="0" + width="100" /> + <radio_group + draw_border="false" + follows="top|left" + height="40" + layout="topleft" + left_pad="8" + name="animation_trigger_type" + top_delta="0" + width="80"> + <radio_item + height="16" + label="Start" + layout="topleft" + left="3" + name="start" + top="-11" + width="80" /> + <radio_item + height="16" + label="Stop" + layout="topleft" + left_delta="0" + name="stop" + top_pad="10" + width="80" /> + </radio_group> + <check_box + follows="top|left" + height="20" + label="until animations are done" + layout="topleft" + left="16" + name="wait_anim_check" + top="340" + width="100" /> + <check_box + follows="top|left" + height="20" + label="time in seconds" + layout="topleft" + left_delta="0" + name="wait_time_check" + top_delta="20" + width="100" /> + <line_editor + follows="top|left" + height="20" + layout="topleft" + left_pad="5" + max_length="15" + name="wait_time_editor" + top_delta="0" + width="50" /> + <text + type="string" + length="1" + follows="top|left" + font="SansSerifSmall" + height="30" + layout="topleft" + left="10" + name="help_label" + top_pad="20" + word_wrap="true" + width="265"> + All steps happen simultaneously, unless you add wait steps. + </text> + <check_box follows="top|left" height="20" label="Active" @@ -138,35 +340,24 @@ left="20" name="active_check" tool_tip="Active gestures can be triggered by chatting their trigger phrases or pressing their hot keys. Gestures usually become inactive when there is a key binding conflict." - top="365" - width="100" /--> - + top_pad="0" + width="100" /> <button - follows="bottom|left" + follows="top|left" height="20" label="Preview" layout="topleft" - left="20" + left_delta="75" name="preview_btn" - top_pad="30" + top_delta="2" width="80" /> <button follows="top|left" height="20" label="Save" layout="topleft" - left_pad="5" + left_pad="10" name="save_btn" top_delta="0" width="80" /> - <button - follows="top|left" - height="20" - label="Cancel (not working)" - layout="topleft" - left_pad="5" - name="cancel_btn" - top_delta="0" - width="80" /> - </floater>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture_info.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture_info.xml index 43e4f8a348..fc838f27b4 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture_info.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture_info.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="155" diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture_shortcut.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture_shortcut.xml index 606ae1a82a..b489ae2e77 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture_shortcut.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture_shortcut.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="90" diff --git a/indra/newview/skins/default/xui/en/floater_preview_gesture_steps.xml b/indra/newview/skins/default/xui/en/floater_preview_gesture_steps.xml index 4b4f611b59..8a07f3ad1e 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_gesture_steps.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_gesture_steps.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="155" diff --git a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml index 8cdafe110a..3797055054 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_notecard.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_notecard.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_resize="true" default_tab_group="1" @@ -83,7 +84,7 @@ Loading... </text_editor> <button - follows="left|bottom" + follows="right|bottom" height="22" label="Save" label_selected="Save" diff --git a/indra/newview/skins/default/xui/en/floater_preview_sound.xml b/indra/newview/skins/default/xui/en/floater_preview_sound.xml index 7a868a1fe9..95347f0dff 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_sound.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_sound.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" height="85" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_preview_texture.xml b/indra/newview/skins/default/xui/en/floater_preview_texture.xml index 32f71da61a..e7abfb075a 100644 --- a/indra/newview/skins/default/xui/en/floater_preview_texture.xml +++ b/indra/newview/skins/default/xui/en/floater_preview_texture.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_resize="true" follows="left|bottom" diff --git a/indra/newview/skins/default/xui/en/floater_region_info.xml b/indra/newview/skins/default/xui/en/floater_region_info.xml index 3fadc15616..ae01d0bdf4 100644 --- a/indra/newview/skins/default/xui/en/floater_region_info.xml +++ b/indra/newview/skins/default/xui/en/floater_region_info.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="512" help_topic="regioninfo" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_report_abuse.xml b/indra/newview/skins/default/xui/en/floater_report_abuse.xml index abde4ba5fa..88f09b521c 100644 --- a/indra/newview/skins/default/xui/en/floater_report_abuse.xml +++ b/indra/newview/skins/default/xui/en/floater_report_abuse.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="580" layout="topleft" name="floater_report_abuse" @@ -14,19 +15,19 @@ allow_no_texture="true" default_image_name="None" follows="left|top" - height="125" + height="150" layout="topleft" - left="10" - name="screenshot" - top="23" - width="160" /> + left="60" + name="" + top="15" + width="220" /> <check_box height="15" label="Use this screenshot" layout="topleft" - left_pad="5" + left="8" name="screen_check" - top="120" + top_pad="-12" width="116" /> <text type="string" @@ -38,8 +39,8 @@ layout="topleft" left="10" name="reporter_title" - top="140" - width="60"> + top_pad="0" + width="100"> Reporter: </text> <text @@ -48,24 +49,25 @@ follows="left|top" height="16" layout="topleft" - left_pad="10" + left_pad="5" name="reporter_field" top_delta="0" - width="193"> - Loremipsum Dolorsitamut + use_ellipses="true" + width="200"> + Loremipsum Dolorsitamut Longnamez </text> <text type="string" length="1" follows="left|top" height="16" - font.name="SansSerif" + font.name="SansSerif" font.style="BOLD" layout="topleft" left="10" name="sim_title" - top_pad="5" - width="60"> + top_pad="2" + width="100"> Region: </text> <text @@ -74,10 +76,11 @@ follows="left|top" height="16" layout="topleft" - left_pad="2" + left_pad="5" name="sim_field" top_delta="0" - width="193"> + use_ellipses="true" + width="200"> Region Name </text> <text @@ -85,13 +88,13 @@ length="1" follows="left|top" height="16" - font.name="SansSerif" + font.name="SansSerif" font.style="BOLD" layout="topleft" left="10" name="pos_title" - top_pad="5" - width="50"> + top_pad="2" + width="100"> Position: </text> <text @@ -100,10 +103,10 @@ follows="left|top" height="16" layout="topleft" - left_pad="12" + left_pad="5" name="pos_field" top_delta="0" - width="193"> + width="200"> {128.1, 128.1, 15.4} </text> <text @@ -114,7 +117,7 @@ layout="topleft" left="10" name="select_object_label" - top_pad="5" + top_pad="2" width="310"> Click the button, then the abusive object: </text> @@ -133,13 +136,13 @@ length="1" follows="left|top" height="16" - font.name="SansSerif" + font.name="SansSerif" font.style="BOLD" layout="topleft" left="48" name="object_name_label" top_delta="0" - width="60"> + width="80"> Object: </text> <text @@ -151,7 +154,8 @@ left_pad="6" name="object_name" top_delta="0" - width="157"> + use_ellipses="true" + width="185"> Consetetur Sadipscing </text> <text @@ -159,13 +163,13 @@ length="1" follows="left|top" height="16" - font.name="SansSerif" + font.name="SansSerif" font.style="BOLD" layout="topleft" left="48" name="owner_name_label" top_pad="0" - width="60"> + width="80"> Owner: </text> <text @@ -177,8 +181,9 @@ left_pad="6" name="owner_name" top_delta="0" - width="157"> - Hendrerit Vulputate + use_ellipses="true" + width="185"> + Hendrerit Vulputate Kamawashi Longname </text> <combo_box height="23" @@ -349,8 +354,8 @@ type="string" length="1" follows="left|top" - height="16" - font.name="SansSerif" + height="14" + font.name="SansSerif" font.style="BOLD" layout="topleft" left_delta="0" @@ -368,11 +373,10 @@ left_delta="0" max_length="32" name="abuser_name_edit" - top_pad="2" + top_pad="0" width="195" /> <button height="23" - font="SansSerifSmall" label="Choose" layout="topleft" left_pad="5" @@ -394,13 +398,13 @@ type="string" length="1" follows="left|top" - height="16" - font.name="SansSerif" + height="14" + font.name="SansSerif" font.style="BOLD" layout="topleft" left="10" name="abuser_name_title2" - top_pad="5" + top_pad="2" width="313"> Location of Abuse: </text> @@ -413,19 +417,19 @@ left="10" max_length="256" name="abuse_location_edit" - top_pad="2" + top_pad="0" width="313" /> <text type="string" length="1" follows="left|top" height="16" - font.name="SansSerif" + font.name="SansSerif" font.style="BOLD" layout="topleft" left_delta="0" name="sum_title" - top_pad="5" + top_pad="2" width="313"> Summary: </text> @@ -438,14 +442,14 @@ left_delta="0" max_length="64" name="summary_edit" - top_pad="2" + top_pad="0" width="313" /> <text type="string" length="1" follows="left|top" - height="16" - font.name="SansSerif" + height="14" + font.name="SansSerif" font.style="BOLD" layout="topleft" left_delta="0" @@ -461,9 +465,9 @@ height="16" layout="topleft" name="bug_aviso" - left_pad="0" + left_pad="10" width="200"> - Please be as specific as possible. + Please be as specific as possible </text> <text_editor follows="left|top" @@ -479,16 +483,15 @@ type="string" length="1" follows="left|top" - height="50" + height="30" layout="topleft" left="10" - font.name="SansSerif" - font.style="BOLD" + font.name="SansSerifSmall" name="incomplete_title" - top_pad="5" + top_pad="2" word_wrap="true" width="313"> - Note: Incomplete reports won't be investigated. + * Incomplete reports won't be investigated </text> <button left="80" diff --git a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml index 2085b74a55..0029fcb09b 100644 --- a/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml +++ b/indra/newview/skins/default/xui/en/floater_script_debug_panel.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" follows="left|top|right|bottom" height="200" diff --git a/indra/newview/skins/default/xui/en/floater_script_preview.xml b/indra/newview/skins/default/xui/en/floater_script_preview.xml index a415239867..c29a2f4516 100644 --- a/indra/newview/skins/default/xui/en/floater_script_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_script_preview.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_resize="true" height="550" diff --git a/indra/newview/skins/default/xui/en/floater_script_queue.xml b/indra/newview/skins/default/xui/en/floater_script_queue.xml index 467dcfae20..8a44252426 100644 --- a/indra/newview/skins/default/xui/en/floater_script_queue.xml +++ b/indra/newview/skins/default/xui/en/floater_script_queue.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" auto_tile="true" can_resize="true" height="400" diff --git a/indra/newview/skins/default/xui/en/floater_script_search.xml b/indra/newview/skins/default/xui/en/floater_script_search.xml index 545abc39a2..79c4438dd6 100644 --- a/indra/newview/skins/default/xui/en/floater_script_search.xml +++ b/indra/newview/skins/default/xui/en/floater_script_search.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" default_tab_group="1" height="120" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 296cde92e3..2f4d7c50a1 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_select_key.xml b/indra/newview/skins/default/xui/en/floater_select_key.xml index b89af0ef3e..31d133ff9b 100644 --- a/indra/newview/skins/default/xui/en/floater_select_key.xml +++ b/indra/newview/skins/default/xui/en/floater_select_key.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" border="true" can_close="false" can_minimize="false" diff --git a/indra/newview/skins/default/xui/en/floater_sell_land.xml b/indra/newview/skins/default/xui/en/floater_sell_land.xml index 652ed96192..8fedd0a89f 100644 --- a/indra/newview/skins/default/xui/en/floater_sell_land.xml +++ b/indra/newview/skins/default/xui/en/floater_sell_land.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="450" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_settings_debug.xml b/indra/newview/skins/default/xui/en/floater_settings_debug.xml index b7779687ec..02b3cee97c 100644 --- a/indra/newview/skins/default/xui/en/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/en/floater_settings_debug.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="215" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_snapshot.xml b/indra/newview/skins/default/xui/en/floater_snapshot.xml index 551f570b52..4f2be37ade 100644 --- a/indra/newview/skins/default/xui/en/floater_snapshot.xml +++ b/indra/newview/skins/default/xui/en/floater_snapshot.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" follows="left|top" height="526" diff --git a/indra/newview/skins/default/xui/en/floater_sound_preview.xml b/indra/newview/skins/default/xui/en/floater_sound_preview.xml index 3b1eae9293..6145b722f1 100644 --- a/indra/newview/skins/default/xui/en/floater_sound_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_sound_preview.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="190" layout="topleft" name="Sound Preview" diff --git a/indra/newview/skins/default/xui/en/floater_statistics.xml b/indra/newview/skins/default/xui/en/floater_statistics.xml index 653bc942e5..ab783b0735 100644 --- a/indra/newview/skins/default/xui/en/floater_statistics.xml +++ b/indra/newview/skins/default/xui/en/floater_statistics.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" follows="right|top" height="392" diff --git a/indra/newview/skins/default/xui/en/floater_stats.xml b/indra/newview/skins/default/xui/en/floater_stats.xml index 205e6efe70..bdc2874281 100644 --- a/indra/newview/skins/default/xui/en/floater_stats.xml +++ b/indra/newview/skins/default/xui/en/floater_stats.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" follows="top|right" height="400" diff --git a/indra/newview/skins/default/xui/en/floater_sys_well.xml b/indra/newview/skins/default/xui/en/floater_sys_well.xml index aef5707fd4..e1f07a49e7 100644 --- a/indra/newview/skins/default/xui/en/floater_sys_well.xml +++ b/indra/newview/skins/default/xui/en/floater_sys_well.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> -<floater +<floater + legacy_header_height="18" bevel_style="in" left="0" top="0" diff --git a/indra/newview/skins/default/xui/en/floater_telehub.xml b/indra/newview/skins/default/xui/en/floater_telehub.xml index 95de27e0ea..faf1a378f2 100644 --- a/indra/newview/skins/default/xui/en/floater_telehub.xml +++ b/indra/newview/skins/default/xui/en/floater_telehub.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="250" layout="topleft" name="telehub" diff --git a/indra/newview/skins/default/xui/en/floater_test_button.xml b/indra/newview/skins/default/xui/en/floater_test_button.xml index ce17873a67..89a1ddda99 100644 --- a/indra/newview/skins/default/xui/en/floater_test_button.xml +++ b/indra/newview/skins/default/xui/en/floater_test_button.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="500" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_checkbox.xml b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml index 66a5b9267d..9977e85a9d 100644 --- a/indra/newview/skins/default/xui/en/floater_test_checkbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_checkbox.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_combobox.xml b/indra/newview/skins/default/xui/en/floater_test_combobox.xml index 956d5669b8..317d8f5ba8 100644 --- a/indra/newview/skins/default/xui/en/floater_test_combobox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_combobox.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml index ce20b03919..c954607ffe 100644 --- a/indra/newview/skins/default/xui/en/floater_test_inspectors.xml +++ b/indra/newview/skins/default/xui/en/floater_test_inspectors.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="false" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_layout.xml b/indra/newview/skins/default/xui/en/floater_test_layout.xml index 209859bb29..c6acb7c96e 100644 --- a/indra/newview/skins/default/xui/en/floater_test_layout.xml +++ b/indra/newview/skins/default/xui/en/floater_test_layout.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="500" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml index 251ca4c9bf..e017d404c6 100644 --- a/indra/newview/skins/default/xui/en/floater_test_line_editor.xml +++ b/indra/newview/skins/default/xui/en/floater_test_line_editor.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_list_view.xml b/indra/newview/skins/default/xui/en/floater_test_list_view.xml index 98d6d5bda7..1d2086d9bc 100644 --- a/indra/newview/skins/default/xui/en/floater_test_list_view.xml +++ b/indra/newview/skins/default/xui/en/floater_test_list_view.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_navigation_bar.xml b/indra/newview/skins/default/xui/en/floater_test_navigation_bar.xml index dd551b6d51..c6b4cca6b9 100644 --- a/indra/newview/skins/default/xui/en/floater_test_navigation_bar.xml +++ b/indra/newview/skins/default/xui/en/floater_test_navigation_bar.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="200" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml b/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml index 35190c0e1a..7ef2d97cdc 100644 --- a/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml +++ b/indra/newview/skins/default/xui/en/floater_test_radiogroup.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_slider.xml b/indra/newview/skins/default/xui/en/floater_test_slider.xml index 3545f88df7..57d8e686ce 100644 --- a/indra/newview/skins/default/xui/en/floater_test_slider.xml +++ b/indra/newview/skins/default/xui/en/floater_test_slider.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_spinner.xml b/indra/newview/skins/default/xui/en/floater_test_spinner.xml index c4e5bc9e99..3c44a4884d 100644 --- a/indra/newview/skins/default/xui/en/floater_test_spinner.xml +++ b/indra/newview/skins/default/xui/en/floater_test_spinner.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_test_textbox.xml b/indra/newview/skins/default/xui/en/floater_test_textbox.xml index 8305452c85..f39d27761c 100644 --- a/indra/newview/skins/default/xui/en/floater_test_textbox.xml +++ b/indra/newview/skins/default/xui/en/floater_test_textbox.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="400" layout="topleft" @@ -114,16 +115,59 @@ Escaped greater than > </text> <text - type="string" - length="1" - bottom="390" - label="N" - layout="topleft" - left="10" - name="floater_map_north" - right="30" - text_color="1 1 1 0.7" - top="370"> - N - </text> + type="string" + length="1" + bottom="390" + label="N" + layout="topleft" + left="10" + name="right_aligned_text" + width="380" + halign="right" + text_color="1 1 1 0.7" + top_pad="10"> + Right aligned text + </text> + <text + type="string" + length="1" + bottom="390" + label="N" + layout="topleft" + left="10" + name="centered_text" + width="380" + halign="center" + text_color="1 1 1 0.7" + top_pad="10"> + Centered text + </text> + <text + type="string" + length="1" + bottom="390" + label="N" + layout="topleft" + left="10" + name="centered_text" + width="380" + halign="left" + text_color="1 1 1 0.7" + top_pad="10"> + Left aligned text + </text> + <text + type="string" + length="1" + bottom="390" + label="N" + layout="topleft" + left="10" + name="floater_map_north" + right="30" + text_color="1 1 1 0.7" + top="370"> + N + </text> + </floater> diff --git a/indra/newview/skins/default/xui/en/floater_test_widgets.xml b/indra/newview/skins/default/xui/en/floater_test_widgets.xml index cc0fc34dd5..129fd863dd 100644 --- a/indra/newview/skins/default/xui/en/floater_test_widgets.xml +++ b/indra/newview/skins/default/xui/en/floater_test_widgets.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<!-- Sample "floater" window with examples of common widgets. +<!-- Sample "floater" window with examples of common widgets. Notes: XML UI (XUI) files use spaces for indentation, not tabs. @@ -15,17 +15,18 @@ Otherwise specify location with left and top attributes. --> <floater - can_dock="true" + legacy_header_height="18" + can_dock="true" can_resize="true" title="Test Floater" height="500" - min_width="850" - min_height="500" + min_width="850" + min_height="500" layout="topleft" name="floater_test_widgets" help_topic="floater_test_widgets" width="850"> - + <!-- Strings are used by C++ code for localization. They are not visible unless the C++ code uses them to fill in another widget. --> <floater.string @@ -34,15 +35,15 @@ <floater.string name="other_string" value="Other String" /> - + <!-- Floaters can contain drop-down menus. The menu_bar widget contains the inividual menus. The width is automatically computed to fit the labels. --> <menu_bar height="18" layout="topleft" - follows="top|left" - tool_tip="menu" + follows="top|left" + tool_tip="menu" left="2" name="test_menu_bar" top="16"> @@ -70,7 +71,7 @@ name="test_menu_item_2" /> </menu> </menu_bar> - + <!-- "text" is one or more read-only lines of text. It can be made clickable but this requires C++ code support. URLs are not automatically underlined. --> @@ -84,27 +85,27 @@ </text> <!-- First column --> - + <button height="20" - follows="top|left" + follows="top|left" label="Button" layout="topleft" left_delta="0" name="test_button" - tool_tip="button" + tool_tip="button" top="80" - width="100" /> + width="100" /> <!-- "flyout_button" is a button that can spawn a menu --> <flyout_button - follows="top|left" + follows="top|left" height="20" label="Flyout" layout="topleft" left_delta="0" name="fly_btn" top_pad="15" - tool_tip="flyout button" + tool_tip="flyout button" width="100"> <flyout_button.item label="Item 1" @@ -120,19 +121,19 @@ bottom_delta="35" label="Checkbox" layout="topleft" - tool_tip="checkbox" + tool_tip="checkbox" name="test_checkbox" /> <!-- "combo_box" is a pop-menu of items. Optionally the box itself can contain a general purpose line input editor, allowing the user to provide input that is not a list item. --> <combo_box bottom_delta="35" - follows="top|left" + follows="top|left" height="16" width="150" label="Combobox" layout="topleft" - tool_tip="combo box" + tool_tip="combo box" name="test_combo_box"> <combo_box.item name="item1" @@ -148,21 +149,21 @@ image_name="icon_avatar_online.tga" layout="topleft" left_delta="0" - tool_tip="icon" + tool_tip="icon" name="test_icon" top_pad="40" width="16" /> - <!-- "line_editor" allows a single line of editable text input. + <!-- "line_editor" allows a single line of editable text input. The contents of this XML node are used as the initial value for the text. --> <line_editor height="20" - follows="top|left" + follows="top|left" layout="topleft" left_delta="0" name="test_line_editor" top_pad="20" - tool_tip="line editor" + tool_tip="line editor" width="200"> Line Editor Sample Text </line_editor> @@ -175,18 +176,18 @@ layout="topleft" left_delta="0" name="search editor" - tool_tip="search editor" + tool_tip="search editor" top_pad="30" width="200" /> <!-- "progress_bar" percent completed gets set in C++ code --> <progress_bar height="16" - follows="top|left" + follows="top|left" layout="topleft" left_delta="0" name="test_progress_bar" top_pad="30" - tool_tip="progress bar" + tool_tip="progress bar" width="200" /> <!-- "stat_view" is a container for statistics graphs. It is only used for debugging/diagnostic displays. --> @@ -198,10 +199,10 @@ name="axis_view" show_label="true" top_pad="30" - tool_tip="stat view" + tool_tip="stat view" width="200"> <stat_bar - width="100" + width="100" bar_max="100" bottom_delta="30" label="Test Stat" @@ -210,9 +211,9 @@ bar_min="20" name="test_stat_bar" /> </stat_view> - + <!-- New column --> - + <!-- "radio_group" is a set of mutually exclusive choices, like the buttons on a car radio that allow a single radio station to be chosen. --> <radio_group @@ -220,7 +221,7 @@ layout="topleft" left_pad="90" name="size_radio_group" - tool_tip="radio group" + tool_tip="radio group" top="80" width="200"> <radio_item @@ -236,10 +237,10 @@ <!-- "scroll_list" is a scrolling list of columnar data. --> <scroll_list bottom_delta="100" - follows="top|left" + follows="top|left" height="80" draw_heading="true" - tool_tip="scroll list" + tool_tip="scroll list" layout="topleft"> <scroll_list.columns dynamic_width="true" @@ -261,29 +262,29 @@ <!-- "slider" is a horizontal input widget for numerical data. --> <slider bottom_delta="45" - follows="top|left" + follows="top|left" layout="topleft" min_val="0" max_val="100" initial_value="20" label="Slider" name="test_slider" - tool_tip="slider" + tool_tip="slider" width="200" /> <!-- "spinner" is a numerical input widget with an up and down arrow to change the value. --> <spinner bottom_delta="35" - follows="top|left" + follows="top|left" label="Spinner" layout="topleft" - label_width="45" - name="test_spinner" + label_width="45" + name="test_spinner" tool_tip="spinner"/> <text bottom_delta="50" - follows="top|left" - font.name="SansSerifSmall" + follows="top|left" + font.name="SansSerifSmall" font.style = "UNDERLINE" layout="topleft" name="test_text" @@ -292,23 +293,23 @@ </text> <text top_pad="10" - follows="top|left" + follows="top|left" layout="topleft" - width="60" - use_ellipses="true" + width="60" + use_ellipses="true" name="test_text" tool_tip="text"> Truncated text here </text> - <!-- "text_editor" is a multi-line text input widget, similar to + <!-- "text_editor" is a multi-line text input widget, similar to textarea in HTML. --> <text_editor height="40" - follows="top|left|bottom" + follows="top|left|bottom" layout="topleft" left_delta="0" name="test_text_editor" - tool_tip="text editor" + tool_tip="text editor" top_pad="25" width="200"> Text Editor @@ -329,17 +330,19 @@ many line to actually fit </text> <!-- And a third column --> - + <!-- "tab_container" is a holder for multiple panels of UI widgets. Tabs can appear at the top, bottom, or left of the container. --> <tab_container follows="all" height="400" + halign="center" layout="topleft" left="575" name="group_tab_container" tab_position="top" - tool_tip="tab container" + tab_height="20" + tool_tip="tab container" top="80" width="250"> <!-- "panel" is a container for widgets. It is automatically resized to diff --git a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml index f2b701b88d..0a1f6e0e29 100644 --- a/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml +++ b/indra/newview/skins/default/xui/en/floater_texture_ctrl.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" can_resize="true" height="290" diff --git a/indra/newview/skins/default/xui/en/floater_tools.xml b/indra/newview/skins/default/xui/en/floater_tools.xml index 8cdcee6927..ca12538302 100644 --- a/indra/newview/skins/default/xui/en/floater_tools.xml +++ b/indra/newview/skins/default/xui/en/floater_tools.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" follows="left|top|right" height="570" layout="topleft" + bg_opaque_image="Window_NoTitle_Foreground" + bg_alpha_image="Window_NoTitle_Background" name="toolbox floater" help_topic="toolbox_floater" save_rect="true" @@ -746,6 +749,7 @@ <tab_container follows="left|top" height="400" + halign="center" left="0" name="Object Info Tabs" tab_max_width="55" @@ -2735,8 +2739,19 @@ <button.commit_callback function="BuildTool.EditMedia"/> </button> - - <button + <web_browser + visible="false" + enabled="false" + border_visible="true" + bottom_delta="0" + follows="top|left" + left="0" + name="title_media" + width="4" + height="4" + start_url="about:blank" + decouple_texture_size="true" /> + <button follows="left|top" font="SansSerifSmall" height="19" @@ -2836,8 +2851,8 @@ <button follows="left|top" height="20" - label="Land profile" - label_selected="Land profile" + label="About Land" + label_selected="About Land" layout="topleft" left_delta="0" name="button about land" diff --git a/indra/newview/skins/default/xui/en/floater_top_objects.xml b/indra/newview/skins/default/xui/en/floater_top_objects.xml index 07ffc204f9..2f53422d51 100644 --- a/indra/newview/skins/default/xui/en/floater_top_objects.xml +++ b/indra/newview/skins/default/xui/en/floater_top_objects.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="350" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_tos.xml b/indra/newview/skins/default/xui/en/floater_tos.xml index 54facbb659..4e2cce1428 100644 --- a/indra/newview/skins/default/xui/en/floater_tos.xml +++ b/indra/newview/skins/default/xui/en/floater_tos.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_close="false" can_minimize="false" height="500" diff --git a/indra/newview/skins/default/xui/en/floater_ui_preview.xml b/indra/newview/skins/default/xui/en/floater_ui_preview.xml index acd770cd38..380e51977f 100644 --- a/indra/newview/skins/default/xui/en/floater_ui_preview.xml +++ b/indra/newview/skins/default/xui/en/floater_ui_preview.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" height="640" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_url_entry.xml b/indra/newview/skins/default/xui/en/floater_url_entry.xml index 6c1fb65bdd..1ab42cb140 100644 --- a/indra/newview/skins/default/xui/en/floater_url_entry.xml +++ b/indra/newview/skins/default/xui/en/floater_url_entry.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="87" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_water.xml b/indra/newview/skins/default/xui/en/floater_water.xml index a860b1038c..af3606fd1c 100644 --- a/indra/newview/skins/default/xui/en/floater_water.xml +++ b/indra/newview/skins/default/xui/en/floater_water.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="240" layout="topleft" name="Water Floater" @@ -61,10 +62,12 @@ <tab_container follows="left|top" height="180" + halign="center" layout="topleft" left="0" name="Water Tabs" tab_position="top" + tab_height="20" top="60" width="700"> <panel diff --git a/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml b/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml index ee67989d33..9a95e3dfef 100644 --- a/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml +++ b/indra/newview/skins/default/xui/en/floater_wearable_save_as.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" border="true" can_close="false" can_minimize="false" diff --git a/indra/newview/skins/default/xui/en/floater_whitelist_entry.xml b/indra/newview/skins/default/xui/en/floater_whitelist_entry.xml index 4f501b65f3..ef68d03a45 100644 --- a/indra/newview/skins/default/xui/en/floater_whitelist_entry.xml +++ b/indra/newview/skins/default/xui/en/floater_whitelist_entry.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_minimize="false" height="108" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/floater_windlight_options.xml b/indra/newview/skins/default/xui/en/floater_windlight_options.xml index 2b3bc5f11a..2c09e82f08 100644 --- a/indra/newview/skins/default/xui/en/floater_windlight_options.xml +++ b/indra/newview/skins/default/xui/en/floater_windlight_options.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" height="220" layout="topleft" name="WindLight floater" @@ -70,10 +71,12 @@ <tab_container follows="left|top" height="160" + halign="center" layout="topleft" left="0" name="WindLight Tabs" tab_position="top" + tab_height="20" top="60" width="700"> <panel diff --git a/indra/newview/skins/default/xui/en/floater_world_map.xml b/indra/newview/skins/default/xui/en/floater_world_map.xml index f37c0e9022..93755fa253 100644 --- a/indra/newview/skins/default/xui/en/floater_world_map.xml +++ b/indra/newview/skins/default/xui/en/floater_world_map.xml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <floater + legacy_header_height="18" can_resize="true" center_horiz="true" center_vert="true" diff --git a/indra/newview/skins/default/xui/en/fonts.xml b/indra/newview/skins/default/xui/en/fonts.xml index b261281c64..65dfb13f4a 100644 --- a/indra/newview/skins/default/xui/en/fonts.xml +++ b/indra/newview/skins/default/xui/en/fonts.xml @@ -18,7 +18,7 @@ </os> </font> - <font name="SansSerifBold" + <font name="SansSerifBold" comment="Name of bold sans-serif font"> <file>DejaVuSans-Bold.ttf</file> <os name="Windows"> @@ -39,20 +39,20 @@ </os> </font> - <font name="SansSerif" - comment="Name of bold sans-serif font" + <font name="SansSerif" + comment="Name of bold sans-serif font" font_style="BOLD"> <file>DejaVuSans-Bold.ttf</file> </font> - <font name="SansSerif" - comment="Name of italic sans-serif font" + <font name="SansSerif" + comment="Name of italic sans-serif font" font_style="ITALIC"> <file>DejaVuSans-Oblique.ttf</file> </font> - <font name="SansSerif" - comment="Name of bold italic sans-serif font" + <font name="SansSerif" + comment="Name of bold italic sans-serif font" font_style="BOLD|ITALIC"> <file>DejaVuSans-BoldOblique.ttf</file> </font> @@ -140,11 +140,11 @@ <font_size name="Monospace" comment="Size for monospaced font (points, or 1/72 of an inch)" - size="9.0" + size="8.0" /> <font_size name="Huge" comment="Size of huge font (points, or 1/72 of an inch)" - size="16.0" + size="15.0" /> <font_size name="Large" comment="Size of large font (points, or 1/72 of an inch)" @@ -158,7 +158,6 @@ /> <font_size name="Small" comment="Size of small font (points, or 1/72 of an inch)" - size="8.0" + size="7.8" /> </fonts> - diff --git a/indra/newview/skins/default/xui/en/inspect_avatar.xml b/indra/newview/skins/default/xui/en/inspect_avatar.xml index 181c80ebc7..6b13e2f1c7 100644 --- a/indra/newview/skins/default/xui/en/inspect_avatar.xml +++ b/indra/newview/skins/default/xui/en/inspect_avatar.xml @@ -4,8 +4,9 @@ Single instance - only have one at a time, recycle it each spawn --> <floater + legacy_header_height="18" bevel_style="in" - bg_opaque_color="MouseGray" + bg_opaque_image="Inspector_Background" can_close="false" can_minimize="false" height="138" diff --git a/indra/newview/skins/default/xui/en/inspect_group.xml b/indra/newview/skins/default/xui/en/inspect_group.xml index 5b166e83b8..db12daa6e0 100644 --- a/indra/newview/skins/default/xui/en/inspect_group.xml +++ b/indra/newview/skins/default/xui/en/inspect_group.xml @@ -4,8 +4,9 @@ Single instance - only have one at a time, recycle it each spawn --> <floater + legacy_header_height="18" bevel_style="in" - bg_opaque_color="MouseGray" + bg_opaque_image="Inspector_Background" can_close="false" can_minimize="false" height="138" diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index 73a7bef77d..fe492e0ae8 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -4,8 +4,9 @@ Single instance - only have one at a time, recycle it each spawn --> <floater + legacy_header_height="18" bevel_style="in" - bg_opaque_color="MouseGray" + bg_opaque_image="Inspector_Background" can_close="false" can_minimize="false" height="145" @@ -70,7 +71,7 @@ owner James Linden width="150"> L$300,000 </text> - <text + <text follows="all" height="30" left="8" @@ -83,24 +84,35 @@ This is a really long description for an object being as how it is at least 80 c </text> <!-- Overlapping buttons for all default actions. Show "Buy" if for sale, "Sit" if can sit, etc. --> + <text + follows="all" + height="15" + left_delta="0" + name="object_media_url" + top_pad="-5" + width="291" + max_length = "50" + use_ellipses="true" + word_wrap="true"/> + <button - follows="top|left" - font="SansSerif" - height="23" - label="Buy" - left="10" - name="buy_btn" - top="114" - width="100" /> + follows="top|left" + font="SansSerif" + height="20" + label="Buy" + left="10" + name="buy_btn" + top="114" + width="75" /> <button follows="top|left" font="SansSerif" - height="23" + height="20" label="Pay" left_delta="0" name="pay_btn" top_delta="0" - width="100" /> + width="75" /> <button follows="top|left" font="SansSerif" @@ -109,16 +121,16 @@ This is a really long description for an object being as how it is at least 80 c left_delta="0" name="take_free_copy_btn" top_delta="0" - width="100" /> + width="75" /> <button follows="top|left" font="SansSerifSmall" - height="23" + height="20" label="Touch" left_delta="0" name="touch_btn" top_delta="0" - width="100" /> + width="75" /> <button follows="top|left" font="SansSerif" @@ -127,17 +139,27 @@ This is a really long description for an object being as how it is at least 80 c left_delta="0" name="sit_btn" top_delta="0" - width="100" /> + width="75" /> <button follows="top|left" font="SansSerifSmall" - height="23" + height="20" label="Open" left_delta="0" name="open_btn" top_delta="0" - width="100" /> - <!-- non-overlapping buttons here --> + width="75" /> + <icon + name="secure_browsing" + image_name="map_infohub.tga" + left_delta="80" + width="16" + height="16" + top_delta="2" + tool_tip="Secure Browsing" + follows="left|top"/> + + <!-- non-overlapping buttons here --> <menu_button follows="top|left" height="18" diff --git a/indra/newview/skins/default/xui/en/menu_object_icon.xml b/indra/newview/skins/default/xui/en/menu_object_icon.xml new file mode 100644 index 0000000000..0c8a2af002 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_object_icon.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + height="101" + layout="topleft" + left="100" + mouse_opaque="false" + name="Object Icon Menu" + top="724" + visible="false" + width="128"> + <menu_item_call + label="Object Profile..." + layout="topleft" + name="Object Profile"> + <menu_item_call.on_click + function="ObjectIcon.Action" + parameter="profile" /> + </menu_item_call> + <menu_item_call + label="Block..." + layout="topleft" + name="Block"> + <menu_item_call.on_click + function="ObjectIcon.Action" + parameter="block" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml index cc17e9dd4b..eedb4383bb 100644 --- a/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_friends_view_sort.xml @@ -23,9 +23,14 @@ parameter="sort_status" /> </menu_item_check> <menu_item_separator layout="topleft" /> - <menu_item_call name="view_icons" label="View People Icons"> - <menu_item_call.on_click function="People.Friends.ViewSort.Action" userdata="view_icons" /> - </menu_item_call> + <menu_item_check name="view_icons" label="View People Icons"> + <menu_item_check.on_click + function="People.Friends.ViewSort.Action" + parameter="view_icons" /> + <menu_item_check.on_check + function="CheckControl" + parameter="FriendsListShowIcons" /> + </menu_item_check> <menu_item_call name="organize_offline" label="Organize Offline Friends"> <menu_item_call.on_click function="People.Friends.ViewSort.Action" userdata="organize_offline" /> </menu_item_call> diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml index f91a961388..c002cd078f 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -12,9 +12,14 @@ <menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="sort_distance" /> </menu_item_call> <menu_item_separator layout="topleft" /> - <menu_item_call name="view_icons" label="View People Icons"> - <menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="view_icons" /> - </menu_item_call> + <menu_item_check name="view_icons" label="View People Icons"> + <menu_item_check.on_click + function="People.Nearby.ViewSort.Action" + parameter="view_icons" /> + <menu_item_check.on_check + function="CheckControl" + parameter="NearbyListShowIcons" /> + </menu_item_check> <menu_item_separator layout="topleft" /> <menu_item_call name="show_blocked_list" label="Show Blocked Residents & Objects"> <menu_item_call.on_click function="SideTray.ShowPanel" userdata="panel_block_list_sidetray" /> diff --git a/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml index d09871cff3..cfd6dc78b6 100644 --- a/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_recent_view_sort.xml @@ -23,9 +23,14 @@ parameter="sort_name" /> </menu_item_check> <menu_item_separator layout="topleft" /> - <menu_item_call name="view_icons" label="View People Icons"> - <menu_item_call.on_click function="People.Recent.ViewSort.Action" userdata="view_icons" /> - </menu_item_call> + <menu_item_check name="view_icons" label="View People Icons"> + <menu_item_check.on_click + function="People.Recent.ViewSort.Action" + parameter="view_icons" /> + <menu_item_check.on_check + function="CheckControl" + parameter="RecentListShowIcons" /> + </menu_item_check> <menu_item_separator layout="topleft" /> <menu_item_call name="show_blocked_list" label="Show Blocked Residents & Objects"> <menu_item_call.on_click function="SideTray.ShowPanel" userdata="panel_block_list_sidetray" /> diff --git a/indra/newview/skins/default/xui/en/menu_place_add_button.xml b/indra/newview/skins/default/xui/en/menu_place_add_button.xml new file mode 100644 index 0000000000..e3a39a1242 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_place_add_button.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<menu + layout="topleft" + left="0" + mouse_opaque="false" + name="menu_folder_gear" + visible="false"> + <menu_item_call + label="Add Folder" + layout="topleft" + name="add_folder"> + <on_click + function="Places.LandmarksGear.Add.Action" + parameter="category" /> + <on_enable + function="Places.LandmarksGear.Enable" + parameter="category" /> + </menu_item_call> + <menu_item_call + label="Add Landmark" + layout="topleft" + name="add_landmark"> + <on_click + function="Places.LandmarksGear.Add.Action" + parameter="add_landmark" /> + </menu_item_call> +</menu> diff --git a/indra/newview/skins/default/xui/en/menu_text_editor.xml b/indra/newview/skins/default/xui/en/menu_text_editor.xml new file mode 100644 index 0000000000..7c9e6f0796 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_text_editor.xml @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu + name="Text editor context menu"> + <menu_item_call + label="Cut" + layout="topleft" + name="Cut" + shortcut="control|X"> + <menu_item_call.on_click + function="Edit.Cut" /> + <menu_item_call.on_enable + function="Edit.EnableCut" /> + </menu_item_call> + <menu_item_call + label="Copy" + layout="topleft" + name="Copy" + shortcut="control|C"> + <menu_item_call.on_click + function="Edit.Copy" /> + <menu_item_call.on_enable + function="Edit.EnableCopy" /> + </menu_item_call> + <menu_item_call + label="Paste" + layout="topleft" + name="Paste" + shortcut="control|V"> + <menu_item_call.on_click + function="Edit.Paste" /> + <menu_item_call.on_enable + function="Edit.EnablePaste" /> + </menu_item_call> + <menu_item_call + label="Delete" + layout="topleft" + name="Delete" + shortcut="Del"> + <menu_item_call.on_click + function="Edit.Delete" /> + <menu_item_call.on_enable + function="Edit.EnableDelete" /> + </menu_item_call> + <menu_item_call + label="Select All" + layout="topleft" + name="Select All" + shortcut="control|A"> + <menu_item_call.on_click + function="Edit.SelectAll" /> + <menu_item_call.on_enable + function="Edit.EnableSelectAll" /> + </menu_item_call> +</context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 34d0498180..3f63f493b1 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -167,6 +167,18 @@ function="Floater.Toggle" parameter="active_speakers" /> </menu_item_check> + <menu_item_check + label="Nearby Media" + layout="topleft" + name="Nearby Media" + shortcut="control|alt|N"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="nearby_media" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="nearby_media" /> + </menu_item_check> <!--menu_item_check label="Block List" layout="topleft" @@ -232,7 +244,7 @@ <menu_item_separator layout="topleft" /> <menu_item_call - label="Place Profile" + label="About Land" layout="topleft" name="About Land"> <menu_item_call.on_click @@ -1620,6 +1632,234 @@ </menu_item_check> <menu_item_separator layout="topleft" /> + <menu + label="Shortcuts" + layout="topleft" + name="Shortcuts" + tear_off="true" + visible="false"> + <menu_item_check + label="Search" + layout="topleft" + name="Search" + shortcut="control|F"> + <menu_item_check.on_check + function="Floater.Visible" + parameter="search" /> + <menu_item_check.on_click + function="Floater.Toggle" + parameter="search" /> + </menu_item_check> + <menu_item_call + enabled="false" + label="Release Keys" + layout="topleft" + name="Release Keys"> + <menu_item_call.on_click + function="Tools.ReleaseKeys" + parameter="" /> + <menu_item_call.on_enable + function="Tools.EnableReleaseKeys" + parameter="" /> + </menu_item_call> + <menu_item_call + label="Set UI Size to Default" + layout="topleft" + name="Set UI Size to Default"> + <menu_item_call.on_click + function="View.DefaultUISize" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_check + label="Always Run" + layout="topleft" + name="Always Run" + shortcut="control|R"> + <menu_item_check.on_check + function="World.CheckAlwaysRun" /> + <menu_item_check.on_click + function="World.AlwaysRun" /> + </menu_item_check> + <menu_item_check + label="Fly" + layout="topleft" + name="Fly" + shortcut="Home"> + <menu_item_check.on_click + function="Agent.toggleFlying" /> + <menu_item_check.on_enable + function="Agent.enableFlying" /> + </menu_item_check> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Close Window" + layout="topleft" + name="Close Window" + shortcut="control|W"> + <menu_item_call.on_click + function="File.CloseWindow" /> + <menu_item_call.on_enable + function="File.EnableCloseWindow" /> + </menu_item_call> + <menu_item_call + label="Close All Windows" + layout="topleft" + name="Close All Windows" + shortcut="control|shift|W"> + <menu_item_call.on_click + function="File.CloseAllWindows" /> + <menu_item_call.on_enable + function="File.EnableCloseAllWindows" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Snapshot to Disk" + layout="topleft" + name="Snapshot to Disk" + shortcut="control|`" + use_mac_ctrl="true"> + <menu_item_call.on_click + function="File.TakeSnapshotToDisk" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Mouselook" + layout="topleft" + name="Mouselook" + shortcut="M"> + <menu_item_call.on_click + function="View.Mouselook" /> + <menu_item_call.on_enable + function="View.EnableMouselook" /> + </menu_item_call> + <menu_item_check + label="Joystick Flycam" + layout="topleft" + name="Joystick Flycam" + shortcut="alt|shift|F"> + <menu_item_check.on_check + function="View.CheckJoystickFlycam" /> + <menu_item_check.on_click + function="View.JoystickFlycam" /> + <menu_item_check.on_enable + function="View.EnableJoystickFlycam" /> + </menu_item_check> + <menu_item_call + label="Reset View" + layout="topleft" + name="Reset View" + shortcut="Esc"> + <menu_item_call.on_click + function="View.ResetView" /> + </menu_item_call> + <menu_item_call + label="Look at Last Chatter" + layout="topleft" + name="Look at Last Chatter" + shortcut="control|\"> + <menu_item_call.on_click + function="View.LookAtLastChatter" /> + <menu_item_call.on_enable + function="View.EnableLastChatter" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu + create_jump_keys="true" + label="Select Build Tool" + layout="topleft" + name="Select Tool" + tear_off="true"> + <menu_item_call + label="Focus Tool" + layout="topleft" + name="Focus" + shortcut="control|1"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="focus" /> + </menu_item_call> + <menu_item_call + label="Move Tool" + layout="topleft" + name="Move" + shortcut="control|2"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="move" /> + </menu_item_call> + <menu_item_call + label="Edit Tool" + layout="topleft" + name="Edit" + shortcut="control|3"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="edit" /> + </menu_item_call> + <menu_item_call + label="Create Tool" + layout="topleft" + name="Create" + shortcut="control|4"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="create" /> + </menu_item_call> + <menu_item_call + label="Land Tool" + layout="topleft" + name="Land" + shortcut="control|5"> + <menu_item_call.on_click + function="Tools.SelectTool" + parameter="land" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Zoom In" + layout="topleft" + name="Zoom In" + shortcut="control|0"> + <menu_item_call.on_click + function="View.ZoomIn" /> + </menu_item_call> + <menu_item_call + label="Zoom Default" + layout="topleft" + name="Zoom Default" + shortcut="control|9"> + <menu_item_call.on_click + function="View.ZoomDefault" /> + </menu_item_call> + <menu_item_call + label="Zoom Out" + layout="topleft" + name="Zoom Out" + shortcut="control|8"> + <menu_item_call.on_click + function="View.ZoomOut" /> + </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Toggle Fullscreen" + layout="topleft" + name="Toggle Fullscreen" + > + <!-- Note: shortcut="alt|Enter" was deleted from the preceding node--> + <menu_item_call.on_click + function="View.Fullscreen" /> + </menu_item_call> + </menu> + <menu_item_separator + layout="topleft" /> <menu_item_call label="Show Debug Settings" layout="topleft" @@ -2416,232 +2656,6 @@ parameter="stop record" /> </menu_item_call> </menu> - <menu - label="Shortcuts" - layout="topleft" - name="Shortcuts" - tear_off="true" - visible="false"> - <menu_item_check - label="Search" - layout="topleft" - name="Search" - shortcut="control|F"> - <menu_item_check.on_check - function="Floater.Visible" - parameter="search" /> - <menu_item_check.on_click - function="Floater.Toggle" - parameter="search" /> - </menu_item_check> - <menu_item_call - enabled="false" - label="Release Keys" - layout="topleft" - name="Release Keys"> - <menu_item_call.on_click - function="Tools.ReleaseKeys" - parameter="" /> - <menu_item_call.on_enable - function="Tools.EnableReleaseKeys" - parameter="" /> - </menu_item_call> - <menu_item_call - label="Set UI Size to Default" - layout="topleft" - name="Set UI Size to Default"> - <menu_item_call.on_click - function="View.DefaultUISize" /> - </menu_item_call> - <menu_item_separator - layout="topleft" /> - <menu_item_check - label="Always Run" - layout="topleft" - name="Always Run" - shortcut="control|R"> - <menu_item_check.on_check - function="World.CheckAlwaysRun" /> - <menu_item_check.on_click - function="World.AlwaysRun" /> - </menu_item_check> - <menu_item_check - label="Fly" - layout="topleft" - name="Fly" - shortcut="Home"> - <menu_item_check.on_click - function="Agent.toggleFlying" /> - <menu_item_check.on_enable - function="Agent.enableFlying" /> - </menu_item_check> - <menu_item_separator - layout="topleft" /> - <menu_item_call - label="Close Window" - layout="topleft" - name="Close Window" - shortcut="control|W"> - <menu_item_call.on_click - function="File.CloseWindow" /> - <menu_item_call.on_enable - function="File.EnableCloseWindow" /> - </menu_item_call> - <menu_item_call - label="Close All Windows" - layout="topleft" - name="Close All Windows" - shortcut="control|shift|W"> - <menu_item_call.on_click - function="File.CloseAllWindows" /> - <menu_item_call.on_enable - function="File.EnableCloseAllWindows" /> - </menu_item_call> - <menu_item_separator - layout="topleft" /> - <menu_item_call - label="Snapshot to Disk" - layout="topleft" - name="Snapshot to Disk" - shortcut="control|`" - use_mac_ctrl="true"> - <menu_item_call.on_click - function="File.TakeSnapshotToDisk" /> - </menu_item_call> - <menu_item_separator - layout="topleft" /> - <menu_item_call - label="Mouselook" - layout="topleft" - name="Mouselook" - shortcut="M"> - <menu_item_call.on_click - function="View.Mouselook" /> - <menu_item_call.on_enable - function="View.EnableMouselook" /> - </menu_item_call> - <menu_item_check - label="Joystick Flycam" - layout="topleft" - name="Joystick Flycam" - shortcut="alt|shift|F"> - <menu_item_check.on_check - function="View.CheckJoystickFlycam" /> - <menu_item_check.on_click - function="View.JoystickFlycam" /> - <menu_item_check.on_enable - function="View.EnableJoystickFlycam" /> - </menu_item_check> - <menu_item_call - label="Reset View" - layout="topleft" - name="Reset View" - shortcut="Esc"> - <menu_item_call.on_click - function="View.ResetView" /> - </menu_item_call> - <menu_item_call - label="Look at Last Chatter" - layout="topleft" - name="Look at Last Chatter" - shortcut="control|\"> - <menu_item_call.on_click - function="View.LookAtLastChatter" /> - <menu_item_call.on_enable - function="View.EnableLastChatter" /> - </menu_item_call> - <menu_item_separator - layout="topleft" /> - <menu - create_jump_keys="true" - label="Select Build Tool" - layout="topleft" - name="Select Tool" - tear_off="true"> - <menu_item_call - label="Focus Tool" - layout="topleft" - name="Focus" - shortcut="control|1"> - <menu_item_call.on_click - function="Tools.SelectTool" - parameter="focus" /> - </menu_item_call> - <menu_item_call - label="Move Tool" - layout="topleft" - name="Move" - shortcut="control|2"> - <menu_item_call.on_click - function="Tools.SelectTool" - parameter="move" /> - </menu_item_call> - <menu_item_call - label="Edit Tool" - layout="topleft" - name="Edit" - shortcut="control|3"> - <menu_item_call.on_click - function="Tools.SelectTool" - parameter="edit" /> - </menu_item_call> - <menu_item_call - label="Create Tool" - layout="topleft" - name="Create" - shortcut="control|4"> - <menu_item_call.on_click - function="Tools.SelectTool" - parameter="create" /> - </menu_item_call> - <menu_item_call - label="Land Tool" - layout="topleft" - name="Land" - shortcut="control|5"> - <menu_item_call.on_click - function="Tools.SelectTool" - parameter="land" /> - </menu_item_call> - </menu> - <menu_item_separator - layout="topleft" /> - <menu_item_call - label="Zoom In" - layout="topleft" - name="Zoom In" - shortcut="control|0"> - <menu_item_call.on_click - function="View.ZoomIn" /> - </menu_item_call> - <menu_item_call - label="Zoom Default" - layout="topleft" - name="Zoom Default" - shortcut="control|9"> - <menu_item_call.on_click - function="View.ZoomDefault" /> - </menu_item_call> - <menu_item_call - label="Zoom Out" - layout="topleft" - name="Zoom Out" - shortcut="control|8"> - <menu_item_call.on_click - function="View.ZoomOut" /> - </menu_item_call> - <menu_item_separator - layout="topleft" /> - <menu_item_call - label="Toggle Fullscreen" - layout="topleft" - name="Toggle Fullscreen" - > - <!-- Note: shortcut="alt|Enter" was deleted from the preceding node--> - <menu_item_call.on_click - function="View.Fullscreen" /> - </menu_item_call> - </menu> <menu create_jump_keys="true" diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 7d2ef4923e..d51cb13093 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -13,7 +13,7 @@ <global name="implicitclosebutton"> Close </global> - + <template name="okbutton"> <form> <button @@ -154,7 +154,7 @@ No tutorial is currently available. icon="alertmodal.tga" name="BadInstallation" type="alertmodal"> - An error occurred while updating [APP_NAME]. Please download the latest version of the Viewer. http://get.secondlife.com + An error occurred while updating [APP_NAME]. Please [http://get.secondlife.com download the latest version] of the Viewer. <usetemplate name="okbutton" yestext="Ok"/> @@ -507,7 +507,7 @@ For L$[COST] you can enter this land ('[PARCEL_NAME]') for [TIME] hour notext="Cancel" yestext="OK"/> </notification> - + <notification icon="alertmodal.tga" name="SalePriceRestriction" @@ -664,7 +664,7 @@ Scripts must be allowed to run for weapons to work. icon="alertmodal.tga" name="MultipleFacesSelected" type="alertmodal"> -Multiple faces are currently selected. +Multiple faces are currently selected. If you continue this action, separate instances of media will be set on multiple faces of the object. To place the media on only one face, choose Select Texture and click on the desired face of that object then click Add. <usetemplate @@ -791,7 +791,7 @@ Oops! Something was left blank. You need to enter both the First and Last name of your avatar. You need an account to enter [SECOND_LIFE]. Would you like to create one now? - <url + <url option="0" name="url" openexternally = "1"> @@ -808,7 +808,7 @@ You need an account to enter [SECOND_LIFE]. Would you like to create one now? icon="alertmodal.tga" name="AddClassified" type="alertmodal"> -Classified ads appear in the 'Classified' section of the Search directory and on www.secondlife.com for one week. +Classified ads appear in the 'Classified' section of the Search directory and on [http://www.secondlife.com secondlife.com] for one week. Fill out your ad, then click 'Publish...' to add it to the directory. You'll be asked for a price to pay when clicking Publish. Paying more makes your ad appear higher in the list, and also appear higher when people search for keywords. @@ -1060,13 +1060,13 @@ There was a problem saving a compiled script due to the following reason: [REASO icon="alertmodal.tga" name="StartRegionEmpty" type="alertmodal"> -Oops, Your Start Region is not defined. -Please type the Region name in Start Location box or choose My Last Location or My Home as your Start Location. +Oops, Your Start Region is not defined. +Please type the Region name in Start Location box or choose My Last Location or My Home as your Start Location. <usetemplate name="okbutton" yestext="OK"/> </notification> - + <notification icon="alertmodal.tga" name="CouldNotStartStopScript" @@ -2409,7 +2409,7 @@ You can use [SECOND_LIFE] normally and other people will see you correctly. [APP_NAME] installation is complete. If this is your first time using [SECOND_LIFE], you will need to create an account before you can log in. -Return to www.secondlife.com to create a new account? +Return to [http://join.secondlife.com secondlife.com] to create a new account? <usetemplate name="okcancelbuttons" notext="Continue" @@ -2426,7 +2426,7 @@ You can either check your Internet connection and try again in a few minutes, cl <url option="1" name="url"> http://secondlife.com/support/ - </url> + </url> <form name="form"> <button default="true" @@ -2801,7 +2801,7 @@ Do you want to open your Web browser to view this content? icon="alertmodal.tga" name="WebLaunchJoinNow" type="alertmodal"> -Go to secondlife.com to manage your account? +Go to your [http://secondlife.com/account/ Dashboard] to manage your account? <usetemplate ignoretext="Launch my browser to manage my account" name="okcancelignore" @@ -3163,7 +3163,7 @@ Teleport to [PICK]? notext="Cancel" yestext="Teleport"/> </notification> - + <notification icon="alert.tga" label="Message everyone in your Estate" @@ -3657,7 +3657,7 @@ Default: off label="Bulk Change Content Permissions" name="HelpBulkPermission" type="alertmodal"> -The Bulk Permissions tool helps you to quickly change the permissions on multiple items in the contents of the selected object(s). However, please note that you are only setting permissions on the items in the Contents of the selected objects -- not permissions on the container object(s) themselves. +The Bulk Permissions tool helps you to quickly change the permissions on multiple items in the contents of the selected object(s). However, please note that you are only setting permissions on the items in the Contents of the selected objects -- not permissions on the container object(s) themselves. Also note, the permissions are not applied to the nested contents of any of the contained items. Your request only operates on items exactly one level deep. @@ -4251,7 +4251,7 @@ There are no items in this object that you are allowed to copy. icon="alertmodal.tga" name="WebLaunchAccountHistory" type="alertmodal"> -Go to secondlife.com to see your account history? +Go to your [http://secondlife.com/account/ Dashboard] to see your account history? <usetemplate ignoretext="Launch my browser to see my account history" name="okcancelignore" @@ -4288,14 +4288,9 @@ Are you sure you want to quit? icon="alertmodal.tga" name="HelpReportAbuseEmailLL" type="alertmodal"> -Use this tool to report violations of the Terms of Service and Community Standards. See: +Use this tool to report violations of the [http://secondlife.com/corporate/tos.php Terms of Service] and [http://secondlife.com/corporate/cs.php Community Standards]. -http://secondlife.com/corporate/tos.php -http://secondlife.com/corporate/cs.php - -All reported abuses of the Terms of Service and Community Standards are investigated and resolved. You can view the incident resolution on the Incident Report at: - -http://secondlife.com/support/incidentreport.php +All reported abuses are investigated and resolved. You can view the resolution by reading the [http://secondlife.com/support/incidentreport.php Incident Report]. <unique/> </notification> @@ -4363,9 +4358,9 @@ Dear Resident, You appear to be reporting intellectual property infringement. Please make sure you are reporting it correctly: -(1) The Abuse Process. You may submit an abuse report if you believe a Resident is exploiting the [SECOND_LIFE] permissions system, for example, by using CopyBot or similar copying tools, to infringe intellectual property rights. The Abuse Team investigates and issues appropriate disciplinary action for behavior that violates the [SECOND_LIFE] Community Standards or Terms of Service. However, the Abuse Team does not handle and will not respond to requests to remove content from the [SECOND_LIFE] world. +(1) The Abuse Process. You may submit an abuse report if you believe a Resident is exploiting the [SECOND_LIFE] permissions system, for example, by using CopyBot or similar copying tools, to infringe intellectual property rights. The Abuse Team investigates and issues appropriate disciplinary action for behavior that violates the [SECOND_LIFE] [http://secondlife.com/corporate/tos.php Terms of Service] or [http://secondlife.com/corporate/cs.php Community Standards]. However, the Abuse Team does not handle and will not respond to requests to remove content from the [SECOND_LIFE] world. -(2) The DMCA or Content Removal Process. To request removal of content from [SECOND_LIFE], you MUST submit a valid notification of infringement as provided in our DMCA Policy at http://secondlife.com/corporate/dmca.php. +(2) The DMCA or Content Removal Process. To request removal of content from [SECOND_LIFE], you MUST submit a valid notification of infringement as provided in our [http://secondlife.com/corporate/dmca.php DMCA Policy]. If you still wish to continue with the abuse process, please close this window and finish submitting your report. You may need to select the specific category 'CopyBot or Permissions Exploit'. @@ -5463,7 +5458,7 @@ Deactivated gestures with same trigger: name="NoQuickTime" type="notify"> Apple's QuickTime software does not appear to be installed on your system. -If you want to view streaming media on parcels that support it you should go to the QuickTime site (http://www.apple.com/quicktime) and install the QuickTime Player. +If you want to view streaming media on parcels that support it you should go to the [http://www.apple.com/quicktime QuickTime site] and install the QuickTime Player. </notification> <notification icon="notify.tga" @@ -5527,7 +5522,7 @@ The objects on the selected parcel that are NOT owned by you have been returned type="notify"> [MSG] </notification> - + <notification icon="notify.tga" name="NotSafe" @@ -5837,15 +5832,11 @@ An object named [OBJECTFROMNAME] owned by (an unknown Resident) has given you a <button index="0" name="Keep" - text="OK"/> + text="Accept"/> <button index="1" name="Discard" - text="Cancel"/> - <button - index="2" - name="Mute" - text="Block"/> + text="No, thanks"/> </form> </notification> @@ -6151,10 +6142,9 @@ Your L$ balance is shown in the upper-right. type="notify"> Thank you for your payment! -When the processing completes, your L$ balance will be updated at the top of your screen. -If processing your payment takes more than 20 minutes to complete, the purchase amount will be credited to your account for use on your next purchase. +Your L$ balance will be updated when processing completes. If processing takes more than 20 mins, your transaction may be cancelled. In that case, the purchase amount will be credited to your US$ balance. -The status of your payment can be checked on your Transaction History page at Me > My Dashboard, or http://secondlife.com/account/ +The status of your payment can be checked on your Transaction History page on your [http://secondlife.com/account/ Dashboard] </notification> <notification icon="notify.tga" @@ -6608,12 +6598,11 @@ Yes <global name="PermNo"> No </global> -<!-- this is alert string from server. the name needs to match entire the server string, and needs to be changed - whenever the server string changes --> +<!-- this is alert string from server. the name needs to match entire the server string, and needs to be changed + whenever the server string changes --> <global name="You can only set your 'Home Location' on your land or at a mainland Infohub."> -If you own a piece of land, you can make it your home location. +If you own a piece of land, you can make it your home location. Otherwise, you can look at the Map and find places marked "Infohub". - </global> - -</notifications> + </global> +</notifications> diff --git a/indra/newview/skins/default/xui/en/panel_activeim_row.xml b/indra/newview/skins/default/xui/en/panel_activeim_row.xml index 4dc4a9ff46..8b815b0f71 100644 --- a/indra/newview/skins/default/xui/en/panel_activeim_row.xml +++ b/indra/newview/skins/default/xui/en/panel_activeim_row.xml @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<panel +<panel name="panel_activeim_row" layout="topleft" follows="left|right" @@ -7,56 +7,51 @@ left="0" height="35" width="318" - background_visible="true" - bevel_style="in" - bg_alpha_color="0 0 0 0"> + background_visible="false"> <chiclet_im_p2p name="p2p_chiclet" layout="topleft" follows="left" - top="5" + top="3" left="5" height="25" - width="45"> + width="25"> </chiclet_im_p2p> <chiclet_im_group name="group_chiclet" layout="topleft" follows="left" - top="5" + top="3" left="5" height="25" - width="45"> + width="25"> </chiclet_im_group> <text type="string" name="contact_name" layout="topleft" - top="8" - left_pad="6" - height="28" - width="235" + top="10" + left_pad="0" + height="14" + width="245" length="1" follows="right|left" - font="SansSerifBold" - text_color="White"> - Contact Name + use_ellipses="true" + font="SansSerifBold"> + Grumpity ProductEngine </text> <button - top="5" - left_pad="5" - width="15" - height="15" + top="10" + right="-5" + width="17" + height="17" layout="topleft" follows="right" name="hide_btn" mouse_opaque="true" label="" tab_stop="false" - image_unselected="toast_hide_btn.tga" - image_disabled="toast_hide_btn.tga" - image_selected="toast_hide_btn.tga" - image_hover_selected="toast_hide_btn.tga" - image_disabled_selected="toast_hide_btn.tga" + image_unselected="Toast_CloseBtn" + image_selected="Toast_CloseBtn" /> </panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml new file mode 100644 index 0000000000..f50acc224f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_adhoc_control_panel.xml @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + name="panel_im_control_panel" + width="146" + height="215" + border="false"> + <avatar_list + color="DkGray2" + follows="left|top|right|bottom" + height="130" + ignore_online_status="true" + layout="topleft" + left="3" + name="speakers_list" + opaque="false" + show_info_btn="false" + show_profile_btn="false" + top="10" + width="140" /> + <button + name="call_btn" + label="Call" + width="125" + height="20" /> + <button + name="end_call_btn" + label="End Call" + width="125" + height="20" + visible="false"/> + <button + enabled="false" + name="voice_ctrls_btn" + label="Open Voice Controls" + width="125" + height="20" + visible="false"/> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml index f747c557e2..18761c3bb9 100644 --- a/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_avatar_list_item.xml @@ -39,7 +39,6 @@ <text follows="left|right" font="SansSerifSmall" - font.style="BOLD" height="15" layout="topleft" left_pad="5" @@ -47,17 +46,17 @@ top="6" use_ellipses="true" value="Unknown" - width="166" /> + width="182" /> <text - follows="left" + follows="right" font="SansSerifSmall" height="15" layout="topleft" - left_pad="10" - name="avatar_status" + left_pad="8" + name="last_interaction" text_color="LtGray_50" - value="Away" - width="50" /> + value="0s" + width="24" /> <output_monitor auto_update="true" follows="right" @@ -69,27 +68,26 @@ name="speaking_indicator" visible="true" width="20" /> - <button + <button follows="right" height="16" image_pressed="Info_Press" - image_hover="Info_Over" - image_unselected="Info_Off" + image_unselected="Info_Over" left_pad="3" - right="-25" + right="-31" name="info_btn" picture_style="true" + top_delta="-2" width="16" /> <button follows="right" - height="16" - image_selected="BuyArrow_Press" - image_pressed="BuyArrow_Press" - image_unselected="BuyArrow_Press" + height="20" + image_overlay="ForwardArrow_Off" layout="topleft" left_pad="5" - right="-5" + right="-3" name="profile_btn" picture_style="true" - width="16" /> + top_delta="-2" + width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 1196d788e4..9bf3458d29 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -2,21 +2,22 @@ <panel mouse_opaque="true" background_visible="true" - bg_alpha_color="0.25 0.25 0.25 1" - bg_opaque_color="0.25 0.25 0.25 1" + bg_alpha_color="DkGray" + bg_opaque_color="DkGray" follows="left|bottom|right" - height="28" + height="33" layout="topleft" left="0" name="bottom_tray" top="28" - border_visible="true" + chrome="true" + border_visible="false" width="1000"> <layout_stack - mouse_opaque="false" + mouse_opaque="false" border_size="0" - clip="false" - follows="left|right|bottom|top" + clip="false" + follows="all" height="28" layout="topleft" left="0" @@ -26,39 +27,27 @@ width="1000"> <icon auto_resize="false" - color="0 0 0 0" follows="left|right" height="10" image_name="spacer24.tga" layout="topleft" left="0" top="0" - width="5"/> + width="4" /> <layout_panel - mouse_opaque="false" + mouse_opaque="false" auto_resize="false" follows="left|right" height="28" layout="topleft" - left="5" - min_height="28" + left="0" + min_height="23" width="310" top="0" min_width="300" name="chat_bar" user_resize="false" filename="panel_nearby_chat_bar.xml"/> - <icon - auto_resize="false" - color="0 0 0 0" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - left="0" - name="DUMMY" - top="0" - width="3"/> <layout_panel mouse_opaque="false" auto_resize="false" @@ -66,26 +55,25 @@ height="28" layout="topleft" min_height="28" - width="100" - top_delta="-10" - min_width="100" + width="96" + top_delta="0" + min_width="96" name="speak_panel" user_resize="false"> <chiclet_talk follows="right" - height="20" + height="23" speak_button.font="SansSerifMedium" speak_button.tab_stop="true" show_button.tab_stop="true" layout="topleft" left="0" name="talk" - top="6" - width="100" /> - </layout_panel> + top="3" + width="96" /> + </layout_panel> <icon auto_resize="false" - color="0 0 0 0" follows="left|right" height="10" image_name="spacer24.tga" @@ -93,7 +81,7 @@ left="0" name="DUMMY" top="0" - width="5"/> + width="4"/> <layout_panel mouse_opaque="false" auto_resize="false" @@ -101,20 +89,21 @@ height="28" layout="topleft" min_height="28" - width="90" - top_delta="-10" - min_width="90" + width="76" + top_delta="0" + min_width="76" name="gesture_panel" user_resize="false"> <gesture_combo_box follows="right" - height="20" - label="Gestures" + height="23" + label="Gesture" layout="topleft" name="Gesture" left="0" - top="6" - width="90" /> + top="3" + use_ellipses="true" + width="76" /> </layout_panel> <icon auto_resize="false" @@ -126,29 +115,28 @@ left="0" name="DUMMY" top="0" - width="5"/> + width="4"/> <layout_panel - mouse_opaque="false" + mouse_opaque="false" auto_resize="false" follows="right" height="28" layout="topleft" min_height="28" name="movement_panel" - width="70" - top_delta="-10" - min_width="70"> + width="76" + min_width="76"> <button follows="left|right" - height="20" + height="23" use_ellipses="true" is_toggle="true" label="Move" layout="topleft" name="movement_btn" - tool_tip="Shows/hides movement controls" - top="6" - width="70"> + tool_tip="Show/hide movement controls" + top="3" + width="76"> <button.init_callback function="Button.SetDockableFloaterToggle" parameter="moveview" /> @@ -164,75 +152,81 @@ left="0" name="DUMMY" top="0" - width="8"/> + width="4"/> <layout_panel - mouse_opaque="false" + mouse_opaque="false" auto_resize="false" follows="left|right" height="28" layout="topleft" min_height="28" - min_width="100" + min_width="76" name="cam_panel" top_delta="-10" width="100"> <button follows="left|right" - height="20" + height="23" use_ellipses="true" is_toggle="true" label="View" layout="topleft" left="0" - tool_tip="Shows/hides camera controls" - top="6" + tool_tip="Show/hide camera controls" + top="3" name="camera_btn" - width="70"> + width="76"> <button.init_callback function="Button.SetDockableFloaterToggle" parameter="camera" /> </button> </layout_panel> + <icon + auto_resize="false" + color="0 0 0 0" + follows="left|right" + height="10" + image_name="spacer24.tga" + layout="topleft" + left="0" + name="DUMMY" + top="0" + width="4"/> <layout_panel - mouse_opaque="false" + mouse_opaque="false" auto_resize="false" - follows="right" + follows="left|right" height="28" layout="topleft" - min_height="28" - min_width="35" name="snapshot_panel" - top_delta="-10" - width="35"> + width="35"> <split_button arrow_position="right" - follows="right" - height="18" + follows="left|right" + height="23" left="0" - layout="topleft" + layout="topleft" name="snapshots" - top="6" - width="35"> - <split_button.arrow_button - image_selected="camera_presets/camera_presets_arrow_right.png" - image_unselected="camera_presets/camera_presets_arrow_right.png" - image_disabled_selected="camera_presets/camera_presets_arrow_right.png" - image_disabled="camera_presets/camera_presets_arrow_right.png" - name="snapshot_settings" - tool_tip="Snapshot settings" /> + width="46" + top="3"> <split_button.item - image_selected="camera_presets/camera_presets_snapshot.png" - image_unselected="camera_presets/camera_presets_snapshot.png" + image_overlay="Snapshot_Off" name="snapshot" - tool_tip="Take snapshot" /> - </split_button> + tool_tip="Take snapshot" + /> + <split_button.arrow_button + name="snapshot_settings" + image_overlay="Widget_UpArrow" + tool_tip="Snapshot and Preset Views" + width="18" + /> + </split_button> </layout_panel> <layout_panel mouse_opaque="false" follows="left|right" height="28" layout="topleft" - min_height="28" top="0" name="chiclet_list_panel" width="189" @@ -240,13 +234,13 @@ user_resize="false" auto_resize="true"> <chiclet_panel - mouse_opaque="false" + mouse_opaque="false" follows="left|right" - height="25" + height="28" layout="topleft" left="0" name="chiclet_list" - top="1" + top="0" chiclet_padding="3" scrolling_offset="40" width="189" /> @@ -261,36 +255,6 @@ left="0" top="0" width="5"/> - <icon - auto_resize="false" - color="0 0 0 0" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - left="0" - top="0" - width="10"/> - <view_border - auto_resize="false" - bevel_style="in" - follows="left|right" - height="28" - layout="topleft" - left="270" - name="well_separator" - top="0" - width="1" /> - <icon - auto_resize="false" - color="0 0 0 0" - follows="left|right" - height="10" - image_name="spacer24.tga" - layout="topleft" - left="0" - top="0" - width="10"/> <layout_panel auto_resize="false" follows="right" @@ -299,8 +263,8 @@ min_height="28" top="0" name="sys_well_panel" - width="48" - min_width="48" + width="34" + min_width="34" user_resize="false"> <chiclet_notification follows="right" @@ -308,24 +272,25 @@ layout="topleft" left="0" name="sys_well" - top="2" - width="48"> + top="3" + width="34"> <button - image_selected="bottom_tray_sys_notifications_selected.tga" - image_unselected="bottom_tray_sys_notifications.tga"/> - <unread_notifications - width="20" - height="20" + auto_resize="true" + halign="right" + height="23" + follows="right" + flash_color="EmphasisColor" + name="Unread" + picture_style="true" + image_overlay="Widget_UpArrow" /> + <unread_notifications + width="34" + height="23" left="22" - top="23"/> -<!-- - <chiclet_notification.commit_callback - function="Notification.Show" - parameter="ClickUnimplemented" /> - --> - </chiclet_notification> + top="23" /> + </chiclet_notification> </layout_panel> - <icon + <icon auto_resize="false" color="0 0 0 0" follows="left|right" @@ -334,6 +299,6 @@ layout="topleft" left="0" top="0" - width="5"/> + width="10"/> </layout_stack> </panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_chat_item.xml b/indra/newview/skins/default/xui/en/panel_chat_item.xml index 78f53562cd..05b04bbf8e 100644 --- a/indra/newview/skins/default/xui/en/panel_chat_item.xml +++ b/indra/newview/skins/default/xui/en/panel_chat_item.xml @@ -5,10 +5,10 @@ name="instant_message" width="300" height="180" - background_opaque="false" - background_visible="true" + background_opaque="true" + background_visible="false" follows="left|top|right|bottom" - bg_alpha_color="0.3 0.3 0.3 1.0"> + bg_alpha_color="0.3 0.3 0.3 0"> <panel width="250" height="30" background_visible="true" background_opaque="false" bg_alpha_color="0.0 0.0 0.0 1.0" name="msg_caption"> <avatar_icon top="25" left="10" width="20" height="20" follows="left|top" diff --git a/indra/newview/skins/default/xui/en/panel_edit_profile.xml b/indra/newview/skins/default/xui/en/panel_edit_profile.xml index b002034a08..fedc49ae87 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_profile.xml @@ -136,6 +136,7 @@ layout="topleft" left="120" top="18" + max_length="512" name="sl_description_edit" width="173" word_wrap="true"> @@ -188,6 +189,7 @@ height="100" layout="topleft" left="120" + max_length="512" top="142" name="fl_description_edit" width="173" diff --git a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml index 9767a673f6..9ed510dff3 100644 --- a/indra/newview/skins/default/xui/en/panel_group_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_group_control_panel.xml @@ -2,26 +2,43 @@ <panel name="panel_im_control_panel" width="146" - height="215" + height="238" border="false"> <avatar_list color="DkGray2" follows="left|top|right|bottom" - height="150" + height="130" + ignore_online_status="true" layout="topleft" left="3" name="speakers_list" + opaque="false" + show_info_btn="false" + show_profile_btn="false" top="10" - width="140"/> + width="140" /> <button name="group_info_btn" label="Group Info" left_delta="3" - width="90" + width="125" height="20" /> <button name="call_btn" label="Call" - width="90" + width="125" height="20" /> + <button + name="end_call_btn" + label="End Call" + width="125" + height="20" + visible="false"/> + <button + enabled="false" + name="voice_ctrls_btn" + label="Open Voice Controls" + width="125" + height="20" + visible="false"/> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_general.xml b/indra/newview/skins/default/xui/en/panel_group_general.xml index 9bd240eccc..a85c55f9b2 100644 --- a/indra/newview/skins/default/xui/en/panel_group_general.xml +++ b/indra/newview/skins/default/xui/en/panel_group_general.xml @@ -1,15 +1,14 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - border="true" follows="all" - height="445" + height="412" label="General" class="panel_group_general" layout="topleft" - left="1" + left="0" + top="0" name="general_tab" - top="500" - width="280"> + width="313"> <panel.string name="help_text"> The General tab contains general information about this group, a list of members, general Group Preferences and member options. @@ -18,7 +17,7 @@ Hover your mouse over the options for more help. </panel.string> <panel.string name="group_info_unchanged"> - General group information has changed. + General group information has changed </panel.string> <panel.string name="incomplete_member_data_str"> @@ -28,42 +27,28 @@ Hover your mouse over the options for more help. type="string" follows="left|top" left="5" - height="75" + height="60" layout="topleft" max_length="511" name="charter" top="5" - width="260" + width="303" word_wrap="true"> - Group Charter + Group Charter </text_editor> - <text - follows="left|top" - type="string" - font="SansSerifBig" - tool_tip="Owners are shown in bold." - height="16" - layout="topleft" - left="5" - name="text_owners_and_visible_members" - text_color="EmphasisColor" - top_pad="10" - width="270"> - Members - </text> <name_list column_padding="0" draw_heading="true" follows="left|top" - heading_height="14" - height="80" + heading_height="16" + height="160" layout="topleft" left_delta="0" name="visible_members" top_pad="0" - width="263"> + width="303"> <name_list.columns - label="Member Name" + label="Member" name="name" relative_width="0.6" /> <name_list.columns @@ -71,27 +56,16 @@ Hover your mouse over the options for more help. name="title" relative_width="0.4" /> </name_list> - <text - follows="left|top" - height="16" - type="string" - text_color="EmphasisColor" - top_pad="10" - font="SansSerifBig" - layout="topleft" - name="text_group_preferences"> - Group Preferences - </text> <text follows="left|top" type="string" - height="16" + height="14" layout="topleft" left_delta="0" name="active_title_label" - top_pad="8" - width="240"> - My Active Title + top_pad="5" + width="303"> + My Title </text> <combo_box follows="left|top" @@ -100,58 +74,58 @@ Hover your mouse over the options for more help. left_delta="0" name="active_title" tool_tip="Sets the title that appears in your avatar's name tag when this group is active." - top_pad="0" - width="240" /> + top_pad="2" + width="303" /> <check_box height="16" font="SansSerifSmall" label="Receive notices" layout="topleft" - left_delta="0" + left="5" name="receive_notices" tool_tip="Sets whether you want to receive Notices from this group. Uncheck this box if this group is spamming you." top_pad="5" - width="240" /> + width="303" /> <check_box height="16" label="Show in my profile" layout="topleft" - left_delta="0" + left="5" name="list_groups_in_profile" tool_tip="Sets whether you want to show this group in your profile" top_pad="5" - width="240" /> + width="303" /> <panel background_visible="true" bevel_style="in" border="true" bg_alpha_color="FloaterUnfocusBorderColor" follows="left|top" - height="125" + height="93" layout="topleft" - left_delta="0" + left="5" name="preferences_container" - top_pad="10" - width="263"> + top_pad="5" + width="303"> <check_box follows="right|top" height="16" label="Open enrollment" layout="topleft" - left_delta="0" + left="10" name="open_enrollement" tool_tip="Sets whether this group allows new members to join without being invited." top_pad="5" width="90" /> <check_box height="16" - label="Enrollment fee:" + label="Enrollment fee" layout="topleft" left_delta="0" name="check_enrollment_fee" tool_tip="Sets whether to require an enrollment fee to join the group" top_pad="5" - width="90" /> + width="300" /> <spinner decimal_digits="0" follows="left|top" @@ -161,43 +135,38 @@ Hover your mouse over the options for more help. label_width="20" label="L$" layout="topleft" - left="25" + right="-10" max_val="99999" - top_pad="5" + left_pad="2" name="spin_enrollment_fee" tool_tip="New members must pay this fee to join the group when Enrollment Fee is checked." - top_delta="-2" width="105" /> <check_box height="16" initial_value="true" label="Show in search" layout="topleft" - left="4" + left="10" name="show_in_group_list" tool_tip="Let people see this group in search results" top_pad="4" - width="90" /> + width="300" /> <combo_box height="20" layout="topleft" left_delta="0" name="group_mature_check" tool_tip="Sets whether your group information is considered mature" - top_pad="10" - width="240"> - <combo_box.item - label="- Select Mature -" - name="select_mature" - value="Select" /> - <combo_box.item - label="Mature Content" - name="mature" - value="Mature" /> + top_pad="5" + width="190"> <combo_box.item label="PG Content" name="pg" value="Not Mature" /> - </combo_box> + <combo_box.item + label="Mature Content" + name="mature" + value="Mature" /> + </combo_box> </panel> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml index da6cf8891a..d8d47c4008 100644 --- a/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml +++ b/indra/newview/skins/default/xui/en/panel_group_info_sidetray.xml @@ -1,20 +1,22 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> - <panel - follows="left|top|right|bottom" - height="660" - label="Group Info" - layout="topleft" - name="panel_group_info" - border="false" - width="300"> +background_visible="true" + follows="all" + height="570" + label="Group Info" + layout="topleft" + min_height="350" + left="0" + top="20" + name="GroupInfo" + width="333"> <panel.string name="default_needs_apply_text"> - There are unapplied changes on the current tab. + There are unsaved changes to the current tab </panel.string> <panel.string name="want_apply_text"> - Do you want to apply these changes? + Do you want to save these changes? </panel.string> <panel.string name="group_join_btn"> @@ -25,34 +27,34 @@ Free </panel.string> <button - layout="topleft" - name="back" - right="-9" - top="0" - width="25" - height="25" - label="" follows="top|right" + height="23" image_overlay="BackArrow_Off" - tab_stop="false" /> - <text layout="topleft" - top="0" + name="back" + picture_style="true" left="10" - width="250" - height="20" + tab_stop="false" + top="2" + width="23" /> + <text + follows="top|left|right" font="SansSerifHugeBold" + height="26" + layout="topleft" + left_pad="10" + name="group_name" text_color="white" - follows="top|left|right" - mouse_opaque="true" - use_ellipses="true" - name="group_name">(Loading...)</text> + top="0" + value="(Loading...)" + use_elipsis="true" + width="300" /> <line_editor follows="left|top" font="SansSerif" label="Type your new group name here" layout="topleft" - left_delta="0" + left_delta="10" max_length="35" name="group_name_editor" top_delta="5" @@ -64,7 +66,7 @@ height="113" label="" layout="topleft" - left="10" + left="20" name="insignia" tool_tip="Click to choose a picture" top_pad="5" @@ -79,7 +81,7 @@ name="prepend_founded_by" top_delta="0" width="140"> - Founded by: + Founder: </text> <name_box follows="left|top" @@ -88,10 +90,12 @@ layout="topleft" left_delta="0" name="founder_name" - top_pad="10" + top_pad="2" use_ellipses="true" width="140" /> <text + font="SansSerifBig" + text_color="EmphasisColor" type="string" follows="left|top" height="16" @@ -106,22 +110,84 @@ <button follows="left|top" left_delta="0" - top_pad="10" - height="20" + top_pad="6" + height="23" label="Join now!" label_selected="Join now!" name="btn_join" visible="true" - width="85" /> - <button - top="632" - height="20" - font="SansSerifSmall" - label="Save" - label_selected="Save" - name="btn_apply" - left="5" - width="65" /> + width="120" /> + <accordion + follows="all" + height="405" + layout="topleft" + left="0" + name="groups_accordion" + top_pad="20" + width="333"> + <accordion_tab + can_resize="false" + layout="topleft" + name="tab_general" + title="General"> + <panel + border="false" + filename="panel_group_general.xml" + layout="topleft" + left="0" + help_topic="group_general_tab" + name="general_tab" + top="0" + width="333" /> + </accordion_tab> + <accordion_tab + can_resize="false" + expanded="false" + layout="topleft" + name="tab_roles" + title="Roles"> + <panel + border="false" + filename="panel_group_roles.xml" + layout="topleft" + left="0" + help_topic="group_roles_tab" + name="roles_tab" + top="0" + width="333" /> + </accordion_tab> + <accordion_tab + can_resize="false" + expanded="false" + layout="topleft" + name="tab_notices" + title="Notices"> + <panel + filename="panel_group_notices.xml" + layout="topleft" + left="0" + help_topic="group_notices_tab" + name="notices_tab" + top="0" + width="333" /> + </accordion_tab> + <accordion_tab + can_resize="false" + expanded="false" + layout="topleft" + name="tab_notices" + title="Land/Assets"> + <panel + border="false" + filename="panel_group_land_money.xml" + layout="topleft" + left="0" + help_topic="group_land_money_tab" + name="land_money_tab" + top="0" + width="333" /> + </accordion_tab> + </accordion> <button follows="top|left" height="20" @@ -129,41 +195,31 @@ layout="topleft" name="btn_refresh" picture_style="true" - top="632" - left="75" + left="5" width="20" /> + <button + height="20" + font="SansSerifSmall" + label="Save" + label_selected="Save" + name="btn_apply" + left_pad="5" + width="65" /> <button - top="632" height="20" label="Create" label_selected="Create" name="btn_create" - left="5" + left_pad="5" visible="false" width="65" /> <button - top="632" - left="75" + left_pad="5" height="20" label="Cancel" label_selected="Cancel" name="btn_cancel" visible="false" width="65" /> - <accordion layout="topleft" left="2" width="296" top="135" height="500" follows="all" name="group_accordion"> - <accordion_tab min_height="445" title="General" name="group_general_tab"> - <panel class="panel_group_general" filename="panel_group_general.xml" name="group_general_tab_panel"/> - </accordion_tab> - <accordion_tab min_height="380" title="Members & Roles" name="group_roles_tab" expanded="False" can_resize="false"> - <panel class="panel_group_roles" filename="panel_group_roles.xml" name="group_roles_tab_panel"/> - </accordion_tab> - <accordion_tab min_height="530" title="Notices" name="group_notices_tab" expanded="False" can_resize="false"> - <panel class="panel_group_notices" filename="panel_group_notices.xml" name="group_notices_tab_panel"/> - </accordion_tab> - <accordion_tab min_height="270" title="Land & L$" name="group_land_tab" expanded="False" can_resize="false"> - <panel class="panel_group_land_money" filename="panel_group_land_money.xml" name="group_land_tab_panel"/> - </accordion_tab> - </accordion> - </panel>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_group_land_money.xml b/indra/newview/skins/default/xui/en/panel_group_land_money.xml index 0845ec014e..04e0ad3be8 100644 --- a/indra/newview/skins/default/xui/en/panel_group_land_money.xml +++ b/indra/newview/skins/default/xui/en/panel_group_land_money.xml @@ -230,7 +230,7 @@ top_delta="0" width="250"> Group members must contribute more land credits to support land in use. - </text> + </text> <text type="string" follows="left|top" @@ -247,15 +247,17 @@ <tab_container follows="all" height="200" + halign="center" layout="topleft" left="10" name="group_money_tab_container" tab_position="top" + tab_height="20" top_pad="10" width="265"> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="180" label="Planning" layout="topleft" @@ -305,7 +307,7 @@ width="250" word_wrap="true"> Computing... - </text_editor> + </text_editor> <button height="20" label="< Earlier" @@ -325,7 +327,7 @@ name="later_details_button" tool_tip="Go forward in time" top_delta="0" - width="125" /> + width="125" /> </panel> <panel border="true" @@ -375,4 +377,4 @@ width="125" /> </panel> </tab_container> -</panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_list_item.xml b/indra/newview/skins/default/xui/en/panel_group_list_item.xml index 7bdcaafe31..ffa485051c 100644 --- a/indra/newview/skins/default/xui/en/panel_group_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_group_list_item.xml @@ -28,13 +28,11 @@ visible="false" width="320" /> <icon - follows="top|left" height="20" image_name="Generic_Group" name="group_icon" - layout="topleft" - left="5" mouse_opaque="true" + left="5" top="2" width="20" /> <text @@ -47,28 +45,28 @@ top="6" use_ellipses="true" value="Unknown" - width="246" /> + width="242" /> <button follows="right" height="16" image_pressed="Info_Press" - image_hover="Info_Over" - image_unselected="Info_Off" + image_unselected="Info_Over" left_pad="3" - right="-25" + right="-31" name="info_btn" picture_style="true" + top_delta="-2" width="16" /> + <!--*TODO: Should only appear on rollover--> <button follows="right" - height="16" - image_selected="BuyArrow_Press" - image_pressed="BuyArrow_Press" - image_unselected="BuyArrow_Press" + height="20" + image_overlay="ForwardArrow_Off" layout="topleft" left_pad="5" - right="-5" + right="-3" name="profile_btn" picture_style="true" - width="16" /> + top_delta="-2" + width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_group_roles.xml b/indra/newview/skins/default/xui/en/panel_group_roles.xml index 75ded4f249..909c3f4577 100644 --- a/indra/newview/skins/default/xui/en/panel_group_roles.xml +++ b/indra/newview/skins/default/xui/en/panel_group_roles.xml @@ -1,20 +1,20 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - border="true" - height="490" + border="false" + height="412" label="Members & Roles" layout="topleft" - left="1" + left="0" + top="0" name="roles_tab" - top="490" - width="280"> + width="313"> <panel.string name="default_needs_apply_text"> - There are unapplied changes on the current sub-tab. + There are unsaved changes to the current tab </panel.string> <panel.string name="want_apply_text"> - Do you want to apply these changes? + Do you want to save these changes? </panel.string> <panel.string name="help_text" /> @@ -160,17 +160,20 @@ </text> </panel> --> <tab_container + border="true" follows="left|top" - height="180" + height="260" + halign="center" layout="topleft" left="5" name="roles_tab_container" tab_position="top" - top="10" - width="265"> + tab_height="20" + top="0" + width="303"> <panel - border="true" - height="165" + border="false" + height="260" label="Members" layout="topleft" left="1" @@ -179,7 +182,7 @@ tool_tip="Members" top="17" class="panel_group_members_subtab" - width="265"> + width="300"> <panel.string name="help_text"> You can add or remove Roles assigned to Members. @@ -190,77 +193,56 @@ clicking on their names. layout="topleft" top="10" left="4" - width="255" + width="280" height="20" follows="left|top|right" max_length="250" label="Filter Members" name="filter_input" font="SansSerif" /> - <!--<line_editor - border_style="line" - border_thickness="1" - follows="left|top" - height="16" - layout="topleft" - left="4" - max_length="63" - name="search_text" - top="10" - width="90" /> - <button - font="SansSerifSmall" - height="20" - label="Search" - layout="topleft" - left_pad="5" - name="search_button" - top_delta="-2" - width="80" /> - <button + <!-- <button enabled="false" font="SansSerifSmall" height="20" label="Show All" layout="topleft" - left_pad="0" + left_pad="-90" name="show_all_button" - top_delta="0" - width="80" /> --> + top_delta="-6" + width="80" />--> <name_list column_padding="0" draw_heading="true" - heading_height="14" - height="100" + heading_height="20" + height="160" follows="left|top" layout="topleft" - left="4" + left="0" multi_select="true" name="member_list" - top_pad="6" - width="255"> + top_pad="2" + width="300"> <name_list.columns label="Member" name="name" - width="90" /> + relative_width="0.45" /> <name_list.columns label="Donations" name="donated" - width="95" /> + relative_width="0.3" /> <name_list.columns label="Online" name="online" - width="80" /> + relative_width="0.2" /> </name_list> <button height="20" font="SansSerifSmall" label="Invite" layout="topleft" - left_delta="0" name="member_invite" - top_pad="6" - width="125" /> + top_pad="3" + width="100" /> <button height="20" font="SansSerifSmall" @@ -268,18 +250,17 @@ clicking on their names. layout="topleft" left_pad="5" name="member_eject" - top_delta="0" - width="125" /> + width="100" /> <icon height="16" - image_name="inv_folder_plain_closed.tga" + image_name="Inv_FolderClosed" layout="topleft" name="power_folder_icon" visible="false" width="16" /> </panel> <panel - border="true" + border="false" height="164" label="Roles" layout="topleft" @@ -292,7 +273,7 @@ clicking on their names. <panel.string name="help_text"> Roles have a title and an allowed list of Abilities -that Members can perform. Members can belong to +that Members can perform. Members can belong to one or more Roles. A group can have up to 10 Roles, including the Everyone and Owner Roles. </panel.string> @@ -302,7 +283,7 @@ including the Everyone and Owner Roles. </panel.string> <panel.string name="power_folder_icon"> - inv_folder_plain_closed.tga + Inv_FolderClosed </panel.string> <panel.string name="power_all_have_icon"> @@ -316,7 +297,7 @@ including the Everyone and Owner Roles. layout="topleft" top="10" left="4" - width="255" + width="260" height="20" follows="left|top|right" max_length="250" @@ -357,13 +338,13 @@ including the Everyone and Owner Roles. column_padding="0" draw_heading="true" follows="left|top" - heading_height="14" - height="100" + heading_height="20" + height="150" layout="topleft" left="4" name="role_list" top_pad="4" - width="255"> + width="300"> <scroll_list.columns label="Role" name="name" @@ -397,7 +378,7 @@ including the Everyone and Owner Roles. width="125" /> </panel> <panel - border="true" + border="false" height="164" label="Abilities" layout="topleft" @@ -407,7 +388,7 @@ including the Everyone and Owner Roles. class="panel_group_actions_subtab" top="17" tool_tip="You can view an Ability's Description and which Roles and Members can execute the Ability." - width="265"> + width="300"> <panel.string name="help_text"> Abilities allow Members in Roles to do specific @@ -486,13 +467,13 @@ things in this group. There's a broad variety of Abilities. </panel> </tab_container> <panel - height="170" + height="150" layout="topleft" follows="left|top" left="10" name="members_footer" - top_pad="10" - width="265"> + top_pad="2" + width="300"> <text type="string" font="SansSerif" @@ -556,7 +537,7 @@ things in this group. There's a broad variety of Abilities. </scroll_list> </panel> <panel - height="215" + height="252" layout="topleft" left_delta="0" name="roles_footer" diff --git a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml index 7dc94d1141..c4cdaa41f9 100644 --- a/indra/newview/skins/default/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/default/xui/en/panel_im_control_panel.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel name="panel_im_control_panel" - width="96" - height="215" + width="125" + height="248" border="false"> <avatar_icon name="avatar_icon" @@ -11,22 +11,37 @@ <button name="view_profile_btn" label="View Profile" left_delta="3" - width="90" + width="125" height="20" /> <button name="add_friend_btn" label="Add Friend" - width="90" + width="125" height="20" /> <button name="call_btn" label="Call" - width="90" + width="125" height="20" /> + <button + height="20" + label="End Call" + name="end_call_btn" + visible="false" + width="125" /> + + <button + enabled="false" + name="voice_ctrls_btn" + label="Open Voice Controls" + width="125" + height="20" + visible="false"/> + <button name="share_btn" label="Share" - width="90" + width="125" height="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_instant_message.xml b/indra/newview/skins/default/xui/en/panel_instant_message.xml index 00ede1fb2c..26d8304551 100644 --- a/indra/newview/skins/default/xui/en/panel_instant_message.xml +++ b/indra/newview/skins/default/xui/en/panel_instant_message.xml @@ -1,15 +1,14 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel background_visible="true" - bevel_style="in" bg_alpha_color="0.3 0.3 0.3 0" - height="140" + height="175" label="im_panel" layout="topleft" left="0" name="im_panel" top="0" - width="350"> + width="305"> <string name="message_max_lines_count"> 6 @@ -19,50 +18,52 @@ bevel_style="in" bg_alpha_color="black" follows="top" - height="30" + height="20" label="im_header" layout="topleft" left="5" name="im_header" top="5" - width="340"> + width="295"> <avatar_icon follows="right" height="20" image_name="icon_avatar_online.tga" layout="topleft" - left="5" + left="0" mouse_opaque="true" name="avatar_icon" - top="5" + top="0" width="20" /> <icon follows="right" height="20" image_name="icon_top_pick.tga" layout="topleft" - left="5" + left="0" mouse_opaque="true" name="sys_msg_icon" - top="5" + top="0" width="20" /> <text follows="left|right" - font="SansSerifBigBold" + font="SansSerifBold" height="20" layout="topleft" - left_pad="10" + left_pad="5" name="user_name" text_color="white" top="5" value="Darth Vader" - width="250" /> + width="295" /> + <!-- TIME STAMP --> <text follows="right" - font="SansSerifBig" + font="SansSerif" height="20" layout="topleft" - left_pad="10" + halign="right" + left="245" name="time_box" text_color="white" top="5" @@ -71,25 +72,25 @@ </panel> <text follows="left|top|bottom|right" - height="60" + height="86" layout="topleft" left="10" name="message" text_color="white" - top="40" + top="33" use_ellipses="true" value="MESSAGE" - width="330" + width="285" word_wrap="true" max_length="350" /> <button follows="bottom" - font="SansSerifBigBold" + font="SansSerifBold" height="25" - label="reply" + label="Reply" layout="topleft" - left="120" + left="97" name="reply" - top="110" + top="137" width="110" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_landmarks.xml b/indra/newview/skins/default/xui/en/panel_landmarks.xml index c33f68eaf7..5293043ba7 100644 --- a/indra/newview/skins/default/xui/en/panel_landmarks.xml +++ b/indra/newview/skins/default/xui/en/panel_landmarks.xml @@ -114,22 +114,10 @@ image_disabled="AddItem_Disabled" layout="topleft" left_pad="5" - name="add_landmark_btn" + name="add_btn" picture_style="true" tool_tip="Add new landmark" width="18" /> - <button - follows="bottom|left" - height="18" - image_selected="AddItem_Press" - image_unselected="AddItem_Off" - image_disabled="AddItem_Disabled" - layout="topleft" - left_pad="5" - name="add_folder_btn" - picture_style="true" - tool_tip="Add new folder" - width="18" /> <dnd_button follows="bottom|right" height="18" diff --git a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml index f9e4b9e7c0..cc47e99c2c 100644 --- a/indra/newview/skins/default/xui/en/panel_media_settings_general.xml +++ b/indra/newview/skins/default/xui/en/panel_media_settings_general.xml @@ -32,6 +32,27 @@ <!-- <line_editor.commit_callback function="Media.CommitHomeURL"/> --> </line_editor> + + <web_browser + border_visible="true" + bottom_delta="-133" + follows="top|left" + left="120" + name="preview_media" + width="128" + height="128" + start_url="about:blank" + decouple_texture_size="true" /> + + <text + bottom_delta="-15" + follows="top|left" + height="15" + left="164" + name=""> + Preview + </text> + <text bottom_delta="-20" follows="top|left" @@ -62,27 +83,6 @@ <button.commit_callback function="Media.ResetCurrentUrl"/> </button> - - <web_browser - border_visible="false" - bottom_delta="-133" - follows="top|left" - left="120" - name="preview_media" - width="128" - height="128" - start_url="about:blank" - decouple_texture_size="true" /> - - <text - bottom_delta="-15" - follows="top|left" - height="15" - left="164" - name=""> - Preview - </text> - <text bottom_delta="-5" follows="top|left" diff --git a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml index 2fd82d8f3d..2182163da5 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_chat_bar.xml @@ -6,7 +6,7 @@ layout="topleft" left="0" name="chat_bar" - top="24" + top="21" width="310"> <string name="min_width"> 310 @@ -18,20 +18,20 @@ border_style="line" border_thickness="1" follows="left|right" - height="20" + height="23" label="Click here to chat." layout="topleft" left_delta="7" left="0" + max_length="254" name="chat_box" tool_tip="Press Enter to say, Ctrl+Enter to shout" - top="3" + top="0" width="250" /> <output_monitor auto_update="true" follows="right" draw_border="false" - halign="left" height="16" layout="topleft" left_pad="-24" @@ -40,15 +40,15 @@ top="4" visible="true" width="20" /> - <button - follows="right" + <button + follows="right" width="45" - top="3" - layout="topleft" - left_pad="5" - label="Log" - height="20" - tool_tip="Shows/hides nearby chat log"> + top="0" + layout="topleft" + left_pad="8" + label="Log" + height="23" + tool_tip="Show/hide nearby chat log"> <button.commit_callback function="Floater.Toggle" parameter="nearby_chat"/> </button> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_notification.xml b/indra/newview/skins/default/xui/en/panel_notification.xml index 9c2829d92d..0d34aa0f08 100644 --- a/indra/newview/skins/default/xui/en/panel_notification.xml +++ b/indra/newview/skins/default/xui/en/panel_notification.xml @@ -1,37 +1,51 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel - background_opaque="true" - background_visible="false" + background_opaque="false" + border_visible="false" + border = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" + background_visible="true" bg_alpha_color="0.3 0.3 0.3 0" - height="140" + bg_opaque_color="0.3 0.3 0.3 0" label="notification_panel" layout="topleft" left="0" name="notification_panel" top="0" - width="350"> + height="10" + width="305"> + <!-- THIS PANEL CONTROLS TOAST HEIGHT? --> <panel + border_visible="false" + drop_shadow="false" + bevel_style="none" + border_style="none" + border = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" background_visible="true" - bg_alpha_color="0.3 0.3 0.3 0" + bg_alpha_color="0.3 0.3 0.3 0" + bg_opaque_color="0.3 0.3 0.3 0" follows="left|right|top" - height="100" + height="10" label="info_panel" layout="topleft" left="0" name="info_panel" top="0" - width="350"> - <text + width="305"> + <!-- <text border_visible="false" follows="left|right|top|bottom" font="SansSerif" height="90" layout="topleft" - left="45" + left="10" name="text_box" read_only="true" text_color="white" - top="5" + top="10" visible="false" width="300" wrap="true"/> @@ -47,40 +61,43 @@ top="5" visible="false" width="300" - wrap="true"/> + wrap="true"/> --> <text_editor + h_pad="0" + v_pad="0" bg_readonly_color="0.0 0.0 0.0 0" border_visible="false" + border = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" embedded_items="false" enabled="false" follows="left|right|top|bottom" font="SansSerif" - height="90" layout="topleft" - left="45" + left="10" mouse_opaque="false" name="text_editor_box" read_only="true" tab_stop="false" text_color="white" text_readonly_color="white" - top="5" + top="10" visible="false" - width="300" + width="285" wrap="true"/> </panel> <panel - background_visible="true" - bg_alpha_color="0.3 0.3 0.3 0" + background_visible="false" follows="left|right|bottom" - height="40" label="control_panel" layout="topleft" left="0" + left_delta="-38" name="control_panel" - top_pad="0" - width="350"> + top="20"> </panel> + <!-- <icon follows="left|top" height="32" @@ -90,5 +107,5 @@ mouse_opaque="false" name="info_icon" top="20" - width="32" /> + width="32" /> --> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 7b19ab1a1c..e234a7b358 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -34,7 +34,6 @@ background_visible="true" value="Filter Groups" /> <filter_editor follows="left|top|right" - font="SansSerif" height="23" layout="topleft" left="15" @@ -54,11 +53,12 @@ background_visible="true" tab_height="30" tab_position="top" top_pad="10" + halign="center" width="313"> <panel follows="all" height="500" - label="Nearby" + label="NEARBY" layout="topleft" left="0" help_topic="people_nearby_tab" @@ -98,17 +98,30 @@ background_visible="true" picture_style="true" top="5" width="18" /> + <button + follows="bottom|left" + height="18" + image_selected="AddItem_Press" + image_unselected="AddItem_Off" + image_disabled="AddItem_Disabled" + layout="topleft" + left_pad="5" + name="add_friend_btn" + picture_style="true" + top_delta="0" + tool_tip="Add selected resident to your friends List" + width="18" /> </panel> </panel> <panel follows="all" height="500" - left="0" - top="0" - label="Friends" + label="FRIENDS" layout="topleft" + left="0" help_topic="people_friends_tab" name="friends_panel" + top="0" width="313"> <accordion follows="all" @@ -121,14 +134,13 @@ background_visible="true" <accordion_tab can_resize="false" layout="topleft" - height="230" + height="235" min_height="150" name="tab_online" title="Online"> <avatar_list allow_select="true" follows="all" - height="150" layout="topleft" left="0" multi_select="true" @@ -139,13 +151,12 @@ background_visible="true" <accordion_tab can_resize="false" layout="topleft" - height="230" + height="235" name="tab_all" title="All"> <avatar_list allow_select="true" follows="all" - height="230" layout="topleft" left="0" multi_select="true" @@ -207,11 +218,12 @@ background_visible="true" <panel follows="all" height="500" - label="Groups" - top="0" + label="GROUPS" layout="topleft" + left="0" help_topic="people_groups_tab" name="groups_panel" + top="0" width="313"> <group_list follows="all" @@ -285,13 +297,14 @@ background_visible="true" </panel> </panel> <panel - top="0" follows="all" height="500" - label="Recent" + label="RECENT" layout="topleft" + left="0" help_topic="people_recent_tab" name="recent_panel" + top="0" width="313"> <avatar_list allow_select="true" @@ -301,11 +314,10 @@ background_visible="true" left="0" multi_select="true" name="avatar_list" - top="2" + show_last_interaction_time="true" + top="0" width="313" /> <panel - background_visible="true" - bevel_style="none" top_pad="0" follows="left|right|bottom" height="30" @@ -327,6 +339,19 @@ background_visible="true" picture_style="true" top="7" width="18" /> + <button + follows="bottom|left" + height="18" + image_selected="AddItem_Press" + image_unselected="AddItem_Off" + image_disabled="AddItem_Disabled" + layout="topleft" + left_pad="5" + name="add_friend_btn" + picture_style="true" + top_delta="0" + tool_tip="Add selected resident to your friends List" + width="18" /> </panel> </panel> </tab_container> @@ -342,104 +367,88 @@ background_visible="true" width="313"> <layout_panel default_tab_group="1" - follows="left|top|right" + follows="left|top" height="25" layout="topleft" left="0" name="view_profile_btn_panel" top="-25" - width="65"> + width="100"> <button - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" label="Profile" layout="topleft" name="view_profile_btn" tool_tip="Show picture, groups, and other residents information" - width="65" /> - </layout_panel> - <layout_panel - default_tab_group="1" - follows="left|top|right" - height="25" - layout="topleft" - left_delta="0" - min_width="85" - name="add_friend_btn_panel" - top_delta="0" - width="50"> - <button - follows="top|left|right" - font="SansSerifSmall" - height="19" - label="Add" - layout="topleft" - name="add_friend_btn" - tool_tip="Add selected resident to your friends List" - width="50" /> + width="100" /> </layout_panel> <layout_panel default_tab_group="1" - follows="left|top|right" + follows="left|top" height="19" layout="topleft" + left="0" min_width="80" name="group_info_btn_panel" - width="80"> + width="100"> <button - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" label="Group Profile" layout="topleft" name="group_info_btn" tool_tip="Show group information" - width="80" /> + width="100" /> </layout_panel> <layout_panel default_tab_group="1" - follows="left|top|right" + follows="left|top" height="25" layout="topleft" + left_pad="5" min_width="45" name="chat_btn_panel" top_delta="0" - width="45"> + width="100"> <button - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" - label="Chat" + label="Group Chat" layout="topleft" name="chat_btn" tool_tip="Open chat session" - width="45" /> + width="100" /> </layout_panel> <layout_panel default_tab_group="1" - follows="left|top|right" + follows="left|top|" height="25" layout="topleft" + left_pad="5" min_width="35" name="im_btn_panel" top_delta="0" - width="35"> + width="50"> <button - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" label="IM" layout="topleft" name="im_btn" tool_tip="Open instant message session" - width="35" /> + width="50" /> </layout_panel> <layout_panel default_tab_group="1" follows="left|top|right" height="25" layout="topleft" + left_pad="5" min_width="40" name="call_btn_panel" top_delta="0" @@ -447,53 +456,55 @@ background_visible="true" width="40"> <button enabled="false" - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" label="Call" layout="topleft" name="call_btn" - width="40" /> + width="50" /> </layout_panel> <layout_panel default_tab_group="1" - follows="left|top|right" + follows="left|top" height="25" layout="topleft" + left_pad="5" min_width="65" name="teleport_btn_panel" top_delta="0" - width="65"> + width="100"> <button - follows="left|top|right" + follows="left|top" font="SansSerifSmall" height="19" label="Teleport" layout="topleft" name="teleport_btn" tool_tip="Offer teleport" - width="65" /> + width="100" /> </layout_panel> <layout_panel default_tab_group="1" enabled="false" - follows="left|top|right" + follows="left|top" height="25" layout="topleft" + left_pad="5" min_width="50" name="share_btn_panel" top_delta="0" visible="false" - width="50"> + width="80"> <button enabled="false" - follows="top|left|right" + follows="top|left" font="SansSerifSmall" height="19" label="Share" layout="topleft" name="share_btn" - width="50" /> + width="80" /> </layout_panel> </layout_stack> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 1074dd4627..38ea6b6196 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -57,7 +57,7 @@ use_ellipses="false" width="197" word_wrap="false" /> - <text + <expandable_text follows="top|left|right" font="SansSerifSmall" height="40" diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index 50108aa21f..5aa53ab46b 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -12,10 +12,10 @@ background_visible="true" width="333"> <string name="landmarks_tab_title" - value="My Landmarks" /> + value="MY LANDMARKS" /> <string name="teleport_history_tab_title" - value="Teleport History" /> + value="TELEPORT HISTORY" /> <filter_editor follows="left|top|right" font="SansSerif" @@ -29,11 +29,12 @@ background_visible="true" width="303" /> <tab_container follows="all" + halign="center" height="500" layout="topleft" left="10" name="Places Tabs" - tab_min_width="70" + tab_min_width="80" tab_height="30" tab_position="top" top_pad="10" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 16fdbd7045..91dcdce23b 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -20,8 +20,9 @@ </panel.string> <check_box control_name="UseChatBubbles" + follows="left|top" height="16" - label="Bubble Chat" + label="Bubble chat" layout="topleft" left="30" top="10" @@ -30,6 +31,7 @@ <slider control_name="ChatBubbleOpacity" + follows="left|top" height="16" increment="0.05" initial_value="1" @@ -40,40 +42,24 @@ label_width="50" name="bubble_chat_opacity" width="200" /> - - <!-- <check_box - control_name="UIAutoScale" - height="16" - label="Resolution independent scale" - layout="topleft" - left="30" - name="ui_auto_scale" - top_pad="10" - width="256" />--> - <!-- - <combo_box - height="18" - layout="topleft" - left_pad="5" - name="fullscreen combo" - top_delta="-1" - width="150" /--> <text + follows="left|top" type="string" length="1" height="25" layout="topleft" left="30" - top_pad="20" + top_pad="5" name="AspectRatioLabel1" tool_tip="width / height" label_width="50" width="120"> - Aspect Ratio + Aspect ratio </text> <combo_box allow_text_entry="true" height="20" + follows="left|top" layout="topleft" left_pad="0" max_chars="100" @@ -104,6 +90,7 @@ </combo_box> <check_box control_name="FullScreenAutoDetectAspectRatio" + follows="left|top" height="25" label="Auto-detect" layout="topleft" @@ -113,14 +100,14 @@ <check_box.commit_callback function="Pref.AutoDetectAspect" /> </check_box> - <text + follows="left|top" type="string" length="1" height="10" left="30" name="heading1" - top_pad="10" + top_pad="5" width="270"> Camera: </text> @@ -128,7 +115,7 @@ Camera: can_edit_text="true" control_name="CameraAngle" decimal_digits="2" - top_pad="10" + top_pad="5" follows="left|top" height="16" increment="0.025" @@ -159,56 +146,62 @@ Camera: name="camera_offset_scale" show_text="false" width="240" - top_pad="10"/> + top_pad="5"/> <text + follows="left|top" type="string" length="1" height="10" left="30" name="heading2" - width="270"> + width="270" + top_pad="5"> Automatic positioning for: </text> <check_box control_name="EditCameraMovement" height="20" + follows="left|top" label="Build/Edit" layout="topleft" left_delta="50" name="edit_camera_movement" tool_tip="Use automatic camera positioning when entering and exiting edit mode" width="280" - top_pad="10" /> + top_pad="5" /> <check_box control_name="AppearanceCameraMovement" + follows="left|top" height="16" label="Appearance" layout="topleft" name="appearance_camera_movement" tool_tip="Use automatic camera positioning while in edit mode" width="242" /> - <text + follows="left|top" type="string" length="1" height="10" left="30" name="heading3" - top_pad="10" + top_pad="5" width="270"> Avatars: </text> <check_box control_name="FirstPersonAvatarVisible" + follows="left|top" height="20" label="Show me in Mouselook" layout="topleft" left_delta="50" name="first_person_avatar_visible" width="256" - top_pad="10"/> + top_pad="0"/> <check_box control_name="ArrowKeysMoveAvatar" + follows="left|top" height="20" label="Arrow keys always move me" layout="topleft" @@ -218,6 +211,7 @@ Avatars: top_pad="0"/> <check_box control_name="AllowTapTapHoldRun" + follows="left|top" height="20" label="Tap-tap-hold to run" layout="topleft" @@ -227,6 +221,7 @@ Avatars: top_pad="0"/> <check_box control_name="LipSyncEnabled" + follows="left|top" height="20" label="Move avatar lips when speaking" layout="topleft" @@ -235,17 +230,19 @@ Avatars: width="237" top_pad="0" /> <check_box - control_name="test" + control_name="ShowScriptErrors" + follows="left|top" height="20" label="Show script errors" layout="topleft" left="30" name="show_script_errors" width="256" - top_pad="10"/> + top_pad="5"/> <radio_group - enabled_control="EnableShowScriptErrors" + enabled_control="ShowScriptErrors" control_name="ShowScriptErrorsLocation" + follows="top|left" draw_border="false" height="40" layout="topleft" @@ -259,17 +256,53 @@ Avatars: layout="topleft" left="3" name="0" - top="3" + top="0" width="315" /> <radio_item height="16" label="In window" layout="topleft" - left_delta="0" + left_delta="175" name="1" - top_delta="16" + top_delta="0" width="315" /> </radio_group> - - + <check_box + follows="top|left" + height="20" + label="Use Push-to-talk in toggle mode" + layout="topleft" + left="30" + name="push_to_talk_toggle_check" + width="237" + top_pad="-25" + tool_tip="When in toggle mode, press and release the push-to-talk trigger to switch your microphone on and off. When not in toggle mode, the microphone is active only when the trigger is held down."/> + <line_editor + follows="top|left" + height="19" + left_delta="50" + max_length="254" + name="modifier_combo" + label="Push-to-talk trigger" + top_pad="0" + width="280" /> + <button + follows="top|left" + height="20" + label="Set Key" + left_delta="0" + name="set_voice_hotkey_button" + width="115" + top_pad="5" /> + <button + bottom_delta="0" + follows="left" + font="SansSerif" + halign="center" + height="20" + label="Middle Mouse Button" + left_delta="120" + mouse_opaque="true" + name="set_voice_middlemouse_button" + width="160" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index 8a28719d98..832c9775ce 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <panel border="true" - follows="left|top|right|bottom" + follows="all" height="408" - label="Audio & Video" + label="Sounds" layout="topleft" left="102" name="Preference Media panel" @@ -12,18 +12,20 @@ <slider control_name="AudioLevelMaster" follows="left|top" + font.style="BOLD" height="15" increment="0.05" initial_value="0.5" label="Master volume" - label_width="125" + label_width="160" layout="topleft" - left="30" + left="0" name="System Volume" show_text="false" + slider_label.halign="right" top_pad="5" volume="true" - width="425"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" parameter="MuteAudio" /> @@ -31,43 +33,44 @@ <button control_name="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" + left_pad="16" name="mute_audio" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> + top_delta="-2" + width="22" /> <check_box control_name="MuteWhenMinimized" - height="16" + height="15" initial_value="true" label="Mute if minimized" layout="topleft" - left="165" + left="167" name="mute_when_minimized" top_pad="5" width="215" /> <slider control_name="AudioLevelAmbient" disabled_control="MuteAudio" - follows="left|topt" + follows="left|top" height="15" increment="0.05" initial_value="0.5" label="Ambient" - label_width="125" + label_width="160" layout="topleft" - left="30" + left="0" name="Wind Volume" show_text="false" - top_pad="5" + slider_label.halign="right" + top_pad="7" volume="true" - width="300"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" parameter="MuteAmbient" /> @@ -76,53 +79,54 @@ control_name="MuteAmbient" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" + left_pad="16" name="mute_wind" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> - <slider - control_name="AudioLevelSFX" + top_delta="-2" + width="22" /> + <slider + control_name="AudioLevelUI" disabled_control="MuteAudio" follows="left|top" height="15" increment="0.05" initial_value="0.5" - label="Sounds" - label_width="125" + label="Buttons" + label_width="160" layout="topleft" - left="30" - name="SFX Volume" + left="0" + name="UI Volume" show_text="false" - top_pad="5" + slider_label.halign="right" + top_pad="7" volume="true" - width="300"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" - parameter="MuteSounds" /> + parameter="MuteUI" /> </slider> <button - control_name="MuteSounds" + control_name="MuteUI" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" - name="mute_sfx" + left_pad="16" + name="mute_ui" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> - <slider + top_delta="-2" + width="22" /> + <slider control_name="AudioLevelMedia" disabled_control="MuteAudio" follows="left|top" @@ -130,14 +134,15 @@ increment="0.05" initial_value="0.5" label="Media" - label_width="125" + label_width="160" layout="topleft" - left="30" + left="0" name="Media Volume" show_text="false" - top_pad="5" + slider_label.halign="right" + top_pad="7" volume="true" - width="300"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" parameter="MuteMedia" /> @@ -146,52 +151,53 @@ control_name="MuteMedia" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" + left_pad="16" name="mute_media" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> + top_delta="-2" + width="22" /> <slider - control_name="AudioLevelUI" + control_name="AudioLevelSFX" disabled_control="MuteAudio" follows="left|top" height="15" increment="0.05" initial_value="0.5" - label="UI" - label_width="125" + label="Sound effects" + label_width="160" + slider_label.halign="right" layout="topleft" - left="30" - name="UI Volume" + left="0" + name="SFX Volume" show_text="false" - top_pad="5" + top_pad="7" volume="true" - width="300"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" - parameter="MuteUI" /> + parameter="MuteSounds" /> </slider> <button - control_name="MuteUI" + control_name="MuteSounds" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" - name="mute_ui" + left_pad="16" + name="mute_sfx" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> + top_delta="-2" + width="22" /> <slider control_name="AudioLevelMusic" disabled_control="MuteAudio" @@ -199,15 +205,16 @@ height="15" increment="0.05" initial_value="0.5" - label="Music" - label_width="125" + label="Streaming music" + label_width="160" layout="topleft" - left="30" + left="0" name="Music Volume" + slider_label.halign="right" show_text="false" - top_pad="5" + top_pad="7" volume="true" - width="300"> + width="350"> <slider.commit_callback function="Pref.setControlFalse" parameter="MuteMusic" /> @@ -216,199 +223,206 @@ control_name="MuteMusic" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" + left_pad="16" name="mute_music" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> + top_delta="-2" + width="22" /> + <check_box + height="16" + control_name ="EnableVoiceChat" + disabled_control="CmdLineDisableVoice" + label="Enable Voice" + layout="topleft" + left="22" + name="enable_voice_check" + width="100"> + </check_box> <slider control_name="AudioLevelVoice" + enabled_control="EnableVoiceChat" disabled_control="MuteAudio" follows="left|top" height="15" increment="0.05" initial_value="0.5" - label="Voice" - label_width="125" + label="Voice" + label_width="60" layout="topleft" - left="30" + left="100" name="Voice Volume" show_text="false" - top_pad="5" + slider_label.halign="right" + top_pad="-15" volume="true" - width="300"> + width="250"> <slider.commit_callback function="Pref.setControlFalse" parameter="MuteVoice" /> </slider> <button control_name="MuteVoice" + enabled_control="EnableVoiceChat" disabled_control="MuteAudio" follows="top|right" - height="16" - image_selected="icn_speaker-muted_dark.tga" - image_unselected="icn_speaker_dark.tga" + height="18" + image_selected="parcel_drk_VoiceNo" + image_unselected="parcel_drk_Voice" is_toggle="true" layout="topleft" - left_pad="30" + left_pad="16" name="mute_voice" picture_style="true" tab_stop="false" - top_delta="-1" - width="25" /> + top_delta="-2" + width="22" /> <text type="string" length="1" follows="left|top" - height="16" + height="13" layout="topleft" - left="30" + left="170" name="Listen from" - top_pad="5" - width="100"> + width="200"> Listen from: </text> - <radio_group - enabled_control="EnableVoiceChat" - control_name="VoiceEarLocation" + <icon + follows="left" + height="18" + image_name="CameraView_Off" + name="camera_icon" + mouse_opaque="false" + visible="true" + width="18" /> + <icon + follows="left" + height="18" + image_name="Move_Walk_Off" + name="avatar_icon" + mouse_opaque="false" + visible="true" + width="18" /> + <radio_group + enabled_control="EnableVoiceChat" + control_name="VoiceEarLocation" draw_border="false" - height="40" - layout="topleft" - left_delta="50" - name="ear_location" - top_pad="0" - width="364"> + follows="left" + left_delta="20" + top = "210" + width="221" + height="38" + name="ear_location"> <radio_item height="16" - label="Listen from camera position" - layout="topleft" - left="3" + label="Camera position" + left_pad="1" + follows="topleft" name="0" - top="3" - width="315" /> + top_delta="-30" + width="200" /> <radio_item height="16" - label="Listen from avatar position" - layout="topleft" + follows="topleft" + label="Avatar position" left_delta="0" name="1" - top_delta="16" - width="315" /> + top_delta="19" + width="200" /> </radio_group> - <text - type="string" - length="1" - follows="left|top" - height="16" - layout="topleft" - left="30" - name="Sound out/in" - top_pad="2" - width="100"> - Sound out/in: - </text> <button control_name="ShowDeviceSettings" - follows="left|top" - height="20" + follows="left|bottom" + height="19" is_toggle="true" - label="Device settings" + label="Input / Output Devices" layout="topleft" - left_delta="55" + left="165" + top_pad="12" name="device_settings_btn" - top_pad="0" - width="155" /> + width="190" /> <panel + background_visible="true" + bg_alpha_color="DkGray" visiblity_control="ShowDeviceSettings" border="false" - follows="top|left" - height="260" + follows="top|left" + height="145" label="DeviceSettings" layout="topleft" left="0" name="Device Settings" - top_pad="5" - width="485"> + width="501"> + <icon + height="18" + image_name="Microphone_On" + left="80" + name="microphone_icon" + mouse_opaque="false" + top="7" + visible="true" + width="18" /> <text type="string" length="1" + font.style="BOLD" follows="left|top" height="16" layout="topleft" - left="30" - name="Input device (microphone):" - top_pad="0" + left_pad="3" + name="Input" width="200"> - Input device (microphone): + Input </text> <combo_box - height="18" + height="19" layout="topleft" - left_delta="55" + left="165" max_chars="128" name="voice_input_device" - top_pad="2" - width="225" /> - <text - type="string" - length="1" - follows="left|top" - height="16" - layout="topleft" - left="30" - name="Output device (speakers):" - top_pad="5" - width="200"> - Output device (speakers): - </text> - <combo_box - height="18" - layout="topleft" - left_delta="55" - max_chars="128" - name="voice_output_device" - top_pad="2" - width="225" /> - <text + top_pad="0" + width="200" /> + <text type="string" length="1" follows="left|top" height="16" layout="topleft" - left="30" - name="Input level:" + left="165" + name="My volume label" top_pad="10" width="200"> - Input level + My volume: </text> - <slider_bar + <slider follows="left|top" height="17" increment="0.05" initial_value="1.0" layout="topleft" - left_delta="125" + left="160" max_val="2" name="mic_volume_slider" tool_tip="Change the volume using this slider" - top_delta="-1" - width="175" /> + top_pad="0" + width="220" /> <text type="string" + text_color="EmphasisColor" length="1" follows="left|top" - height="20" + height="18" layout="topleft" left_pad="5" name="wait_text" - top_delta="1" - width="200"> + top_delta="0" + width="110"> Please wait </text> <locate @@ -446,16 +460,57 @@ name="bar4" top_delta="0" width="20" /> - <text + <!-- <text type="string" - height="40" + height="37" left="30" name="voice_intro_text1" top_pad="-4" - width="480" + width="410" word_wrap="true"> - Adjust the slider to control how loud you sound to other Residents. To test the input level, simply speak into your microphone. + Adjust the slider to control how loud you sound to other people. To test your volume, simply speak into your microphone + </text>--> + <icon + height="18" + image_name="parcel_lght_Voice" + left="80" + name="speaker_icon" + mouse_opaque="false" + top_pad="-8" + visible="true" + width="22" /> + <text + font.style="BOLD" + type="string" + length="1" + follows="left|top" + height="15" + layout="topleft" + left_pad="0" + name="Output" + width="200"> + Output </text> + <combo_box + height="19" + layout="topleft" + left="165" + max_chars="128" + name="voice_output_device" + top_pad="0" + width="200" /> + </panel> + <!-- Until new panel is hooked up to code, we need to be able to get to + the old window to change input devices. James --> + <button + follows="left|bottom" + label="Old" + name="legacy_device_window_btn" + height="16" + left="20" + top="-270" + width="40" + commit_callback.function="Floater.Show" + commit_callback.parameter="pref_voicedevicesettings" + /> </panel> - -</panel> diff --git a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml new file mode 100644 index 0000000000..b21fbc1795 --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -0,0 +1,594 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + follows="left|right|top|bottom" + name="MediaControls" + bg_alpha_color="1 1 1 0" + height="160" + layout="topleft" + mouse_opaque="false" + width="800"> + <panel + name="media_region" + bottom="125" + follows="left|right|top|bottom" + layout="topleft" + left="20" + mouse_opaque="false" + right="-20" + top="20" /> + <layout_stack + follows="left|right|bottom" + height="32" + layout="topleft" + animate="false" + left="0" + orientation="horizontal" + top="96"> + <!-- outer layout_panels center the inner one --> + <layout_panel + width="0" + layout="topleft" + user_resize="false" /> + <panel + name="media_progress_indicator" + height="22" + layout="topleft" + left="0" + top="0" + auto_resize="false" + user_resize="false" + min_width="100" + width="200"> + <progress_bar + name="media_progress_bar" + color_bar="1 1 1 0.96" + follows="left|right|top" + height="16" + layout="topleft" + left="0" + tool_tip="Media is Loading"/> + </panel> + <layout_panel + width="0" + layout="topleft" + user_resize="false" /> + </layout_stack> + <layout_stack + name="media_controls" + follows="left|right" + animate="false" + height="32" + layout="topleft" + left="0" + orientation="horizontal" + top="128"> + <!-- outer layout_panels center the inner one --> + <layout_panel + width="0" + layout="topleft" + user_resize="false" /> + <layout_panel + name="back" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="22" + width="22" + top="4"> + <button + auto_resize="false" + height="22" + image_selected="media_btn_back.png" + image_unselected="media_btn_back.png" + layout="topleft" + tool_tip="Step back" + picture_style="true" + width="22" + top_delta="4"> + <button.commit_callback + function="MediaCtrl.Back" /> + </button> + </layout_panel> + <layout_panel + name="fwd" + auto_resize="false" + user_resize="false" + layout="topleft" + top="10" + min_width="17" + width="17"> + <button + height="22" + image_selected="media_btn_forward.png" + image_unselected="media_btn_forward.png" + layout="topleft" + tool_tip="Step forward" + picture_style="true" + top_delta="0" + min_width="17" + width="17"> + <button.commit_callback + function="MediaCtrl.Forward" /> + </button> + </layout_panel> +<!-- + <panel + height="22" + layout="topleft" + auto_resize="false" + min_width="3" + width="3"> + <icon + height="22" + image_name="media_panel_divider.png" + layout="topleft" + top="0" + min_width="3" + width="3" /> + </panel> +--> + <layout_panel + name="home" + auto_resize="false" + user_resize="false" + layout="topleft" + top="-2" + min_width="22" + width="22"> + <button + height="22" + image_selected="media_btn_home.png" + image_unselected="media_btn_home.png" + layout="topleft" + tool_tip="Home page" + picture_style="true" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Home" /> + </button> + </layout_panel> + <layout_panel + name="media_stop" + auto_resize="false" + user_resize="false" + layout="topleft" + top="2" + min_width="22" + width="22"> + <button + height="22" + image_selected="button_anim_stop.tga" + image_unselected="button_anim_stop.tga" + layout="topleft" + tool_tip="Stop media" + picture_style="true" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Stop" /> + </button> + </layout_panel> +<!-- + <panel + height="22" + layout="topleft" + auto_resize="false" + min_width="3" + width="3"> + <icon + height="22" + image_name="media_panel_divider.png" + layout="topleft" + top="0" + min_width="3" + width="3" /> + </panel> +--> + <layout_panel + name="reload" + auto_resize="false" + user_resize="false" + layout="topleft" + top="6" + min_width="22" + width="22"> + <button + height="22" + image_selected="media_btn_reload.png" + image_unselected="media_btn_reload.png" + layout="topleft" + tool_tip="Reload" + picture_style="true" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Reload" /> + </button> + </layout_panel> + <layout_panel + name="stop" + auto_resize="false" + user_resize="false" + layout="topleft" + top="10" + min_width="22" + width="22"> + <button + height="22" + image_selected="media_btn_stoploading.png" + image_unselected="media_btn_stoploading.png" + layout="topleft" + picture_style="true" + tool_tip = "Stop loading" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Stop" /> + </button> + </layout_panel> + <layout_panel + name="play" + auto_resize="false" + user_resize="false" + layout="topleft" + top="14" + min_width="22" + width="22"> + <button + height="22" + image_selected="button_anim_play.tga" + image_unselected="button_anim_play.tga" + layout="topleft" + tool_tip = "Play media" + picture_style="true" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Play" /> + </button> + </layout_panel> + <layout_panel + name="pause" + auto_resize="false" + user_resize="false" + layout="topleft" + top="18" + min_width="22" + width="22"> + <button + height="22" + image_selected="button_anim_pause.tga" + image_unselected="button_anim_pause.tga" + layout="topleft" + tool_tip = "Pause media" + picture_style="true"> + <button.commit_callback + function="MediaCtrl.Pause" /> + </button> + </layout_panel> + <!-- media URL entry --> + <layout_panel + name="media_address" + auto_resize="true" + user_resize="false" + height="22" + follows="left|right|bottom" + layout="topleft" + width="190" + min_width="90"> + <!-- + RE-ENABLE THIS WHEN WE HAVE A HISTORY DROP-DOWN AGAIN + +<combo_box +name="media_address_url" +allow_text_entry="true" +height="22" +layout="topleft" +max_chars="1024" +tool_tip = "Media URL" +<combo_box.commit_callback +function="MediaCtrl.CommitURL" /> +</combo_box> + --> + <line_editor + name="media_address_url" + follows="left|right" + height="22" + top="0" + tool_tip="Media URL" + text_pad_right="16"> + <line_editor.commit_callback + function="MediaCtrl.CommitURL"/> + </line_editor> + <layout_stack + animate="false" + follows="right" + width="32" + min_width="32" + height="16" + top="3" + orientation="horizontal" + left_pad="-38"> + <icon + name="media_whitelist_flag" + follows="top|right" + height="16" + image_name="smicon_warn.tga" + layout="topleft" + tool_tip="White List enabled" + min_width="16" + width="16" /> + <icon + name="media_secure_lock_flag" + height="16" + image_name="inv_item_eyes.tga" + layout="topleft" + tool_tip="Secured Browsing" + min_width="16" + width="16" /> + </layout_stack> + </layout_panel> + <layout_panel + name="media_play_position" + auto_resize="true" + user_resize="false" + follows="left|right|top|bottom" + layout="topleft" + min_width="100" + width="200"> + <slider_bar + name="media_play_slider" + follows="left|right|top" + height="22" + increment="0.05" + initial_value="0.5" + layout="topleft" + tool_tip="Movie play progress" + min_width="100" + width="200"> + <slider_bar.commit_callback + function="MediaCtrl.JumpProgress" /> + </slider_bar> + </layout_panel> + <layout_panel + name="media_volume" + auto_resize="false" + user_resize="false" + layout="topleft" + height="24" + min_width="24" + width="24"> + <button + name="media_volume_button" + height="22" + image_selected="icn_speaker-muted_dark.tga" + image_unselected="icn_speaker_dark.tga" + is_toggle="true" + layout="topleft" + scale_image="false" + picture_style="true" + tool_tip="Mute This Media" + top_delta="22" + min_width="24" + width="24" > + <button.commit_callback + function="MediaCtrl.ToggleMute" /> + </button> + </layout_panel> + <layout_panel + name="volume_up" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="20" + height="14" + width="20"> + <button + top="-3" + height="14" + image_selected="media_btn_scrollup.png" + image_unselected="media_btn_scrollup.png" + layout="topleft" + tool_tip="Volume up" + picture_style="true" + scale_image="true" + min_width="20" + width="20" > + <button.commit_callback + function="MediaCtrl.CommitVolumeUp" /> + </button> + </layout_panel> + <layout_panel + name="volume_down" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="20" + height="14" + width="20"> + <button + top="-5" + height="14" + image_selected="media_btn_scrolldown.png" + image_unselected="media_btn_scrolldown.png" + layout="topleft" + tool_tip="Volume down" + picture_style="true" + scale_image="true" + min_width="20" + width="20"> + <button.commit_callback + function="MediaCtrl.CommitVolumeDown" /> + </button> + </layout_panel> + <!-- Scroll pad --> + <layout_panel + name="media_panel_scroll" + auto_resize="false" + user_resize="false" + height="32" + follows="left|right|top|bottom" + layout="topleft" + min_width="32" + width="32"> + <icon + height="32" + image_name="media_panel_scrollbg.png" + layout="topleft" + top="0" + min_width="32" + width="32" /> + <button + name="scrollup" + height="8" + image_selected="media_btn_scrollup.png" + image_unselected="media_btn_scrollup.png" + layout="topleft" + tool_tip="Scroll up" + picture_style="true" + scale_image="false" + left="12" + top_delta="4" + min_width="8" + width="8" /> + <button + name="scrollleft" + height="8" + image_selected="media_btn_scrollleft.png" + image_unselected="media_btn_scrollleft.png" + layout="topleft" + left="3" + tool_tip="Scroll left" + picture_style="true" + scale_image="false" + top="12" + min_width="8" + width="8" /> + <button + name="scrollright" + height="8" + image_selected="media_btn_scrollright.png" + image_unselected="media_btn_scrollright.png" + layout="topleft" + left_pad="9" + tool_tip="Scroll right" + picture_style="true" + scale_image="false" + top_delta="0" + min_width="8" + width="8" /> + <button + name="scrolldown" + height="8" + image_selected="media_btn_scrolldown.png" + image_unselected="media_btn_scrolldown.png" + layout="topleft" + left="12" + tool_tip="Scroll down" + picture_style="true" + scale_image="false" + top="20" + min_width="8" + width="8" /> + </layout_panel> + <layout_panel + name="zoom_frame" + auto_resize="false" + user_resize="false" + layout="topleft" + height="28" + min_width="22" + width="22"> + <button + height="22" + image_selected="media_btn_optimalzoom.png" + image_unselected="media_btn_optimalzoom.png" + layout="topleft" + tool_tip="Zoom" + picture_style="true" + min_width="22" + width="22"> + <button.commit_callback + function="MediaCtrl.Zoom" /> + </button> + </layout_panel> +<!-- + <panel + height="22" + layout="topleft" + auto_resize="false" + min_width="3" + width="3"> + <icon + height="22" + image_name="media_panel_divider.png" + layout="topleft" + top="0" + min_width="3" + width="3" /> + </panel> +--> + <layout_panel + name="new_window" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="22" + width="22"> + <button + height="22" + image_selected="media_btn_newwindow.png" + image_unselected="media_btn_newwindow.png" + layout="topleft" + tool_tip = "Open URL in browser" + picture_style="true" + top_delta="-3" + min_width="24" + width="24" > + <button.commit_callback + function="MediaCtrl.Open" /> + </button> + </layout_panel> +<!-- + <panel + height="22" + layout="topleft" + auto_resize="false" + min_width="3" + width="3"> + <icon + height="22" + image_name="media_panel_divider.png" + layout="topleft" + top="0" + min_width="3" + width="3" /> + </panel> +--> + <layout_panel + name="close" + auto_resize="false" + user_resize="false" + layout="topleft" + min_width="21" + width="21" > + <button + height="22" + image_selected="media_btn_done.png" + image_unselected="media_btn_done.png" + layout="topleft" + tool_tip ="Close media control" + picture_style="true" + top_delta="-4" + width="21" > + <button.commit_callback + function="MediaCtrl.Close" /> + </button> + </layout_panel> + <layout_panel + width="0" + layout="topleft" + user_resize="false" /> + </layout_stack> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_profile.xml b/indra/newview/skins/default/xui/en/panel_profile.xml index 73a759a8ba..5af7d7d674 100644 --- a/indra/newview/skins/default/xui/en/panel_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_profile.xml @@ -81,6 +81,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="sl_description_edit" top_pad="-3" width="173" @@ -123,6 +124,7 @@ height="95" layout="topleft" left="107" + max_length="512" name="fl_description_edit" top_pad="-3" width="173" diff --git a/indra/newview/skins/default/xui/en/panel_profile_view.xml b/indra/newview/skins/default/xui/en/panel_profile_view.xml index 7a5781651d..195b731531 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -50,6 +50,7 @@ <tab_container follows="all" height="535" + halign="center" layout="topleft" left="10" min_width="333" diff --git a/indra/newview/skins/default/xui/en/panel_status_bar.xml b/indra/newview/skins/default/xui/en/panel_status_bar.xml index 795e0ffc0d..7b9c9f47a2 100644 --- a/indra/newview/skins/default/xui/en/panel_status_bar.xml +++ b/indra/newview/skins/default/xui/en/panel_status_bar.xml @@ -41,20 +41,18 @@ </panel.string> <button auto_resize="true" - halign="right" + halign="right" follows="right|bottom" font="SansSerifSmall" - image_color="White_05" - flash_color="EmphasisColor" - image_overlay="BuyArrow_Over" - height="18" - layout="topleft" - left="-225" + image_selected="BuyArrow_Over" + image_unselected="BuyArrow_Off" + image_pressed="BuyArrow_Press" + height="16" + left="-220" name="buycurrency" - pad_right="23px" - picture_style="true" + pad_right="22px" tool_tip="My Balance: Click to buy more L$" - top="0" + top="1" width="117" /> <text type="string" @@ -65,148 +63,21 @@ height="16" top="3" layout="topleft" - left_pad="20" + left_pad="15" name="TimeText" text_color="TimeTextColor" tool_tip="Current time (Pacific)" width="80"> 12:00 AM </text> - <button - follows="right|bottom" - height="16" - layout="topleft" - left_delta="-537" - image_selected="Inv_DangerousScript" - image_unselected="Inv_DangerousScript" - name="scriptout" - picture_style="true" - scale_image="false" - tool_tip="Script warnings and errors" - top="0" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="16" - image_selected="Health" - image_unselected="Health" - layout="topleft" - left_pad="7" - name="health" - picture_style="true" - scale_image="false" - tool_tip="Health" - top="0" - visible="false" - width="16" /> - <text - bg_visible="false" - text_readonly_color="HealthTextColor" - follows="rsight|bottom" - font_shadow="none" - height="16" - layout="topleft" - left_pad="18" - name="HealthText" - text_color="HealthTextColor" - tool_tip="Health" - top="0" - visible="false" - width="31"> - 100% - </text> - <button - follows="right|bottom" - height="16" - image_selected="Move_Fly_Disabled" - image_unselected="Move_Fly_Disabled" - layout="topleft" - left_pad="7" - name="no_fly" - picture_style="true" - scale_image="false" - tool_tip="Flying not allowed" - top="3" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="16" - image_selected="Tool_Create" - image_unselected="Tool_Create" - layout="topleft" - left_pad="7" - name="no_build" - picture_style="true" - scale_image="false" - tool_tip="Building/rezzing not allowed" - top="0" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="16" - image_selected="Inv_Script" - image_unselected="Inv_Script" - layout="topleft" - left_pad="7" - name="no_scripts" - picture_style="true" - scale_image="false" - tool_tip="Scripts not allowed" - top="0" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="16" - image_selected="Inv_Gesture" - image_unselected="Inv_Gesture" - layout="topleft" - left_pad="7" - name="restrictpush" - picture_style="true" - scale_image="false" - tool_tip="No pushing" - top="0" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="18" - image_selected="Microphone_Mute" - image_unselected="Microphone_Mute" - layout="topleft" - left_pad="7" - name="status_no_voice" - picture_style="true" - scale_image="false" - tool_tip="Voice not available here" - top="1" - visible="false" - width="16" /> - <button - follows="right|bottom" - height="16" - image_selected="Icon_For_Sale" - image_unselected="Icon_For_Sale" - layout="topleft" - left_pad="7" - name="buyland" - picture_style="true" - tool_tip="Buy this parcel" - top="0" - visible="false" - width="16" /> <text enabled="true" follows="right|bottom" halign="center" height="12" layout="topleft" - left_delta="-4" + left_delta="0" name="stat_btn" - top_delta="3" - width="20" /> + top_delta="0" + width="20"/> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml index 53ee0d159d..7722583ce2 100644 --- a/indra/newview/skins/default/xui/en/panel_sys_well_item.xml +++ b/indra/newview/skins/default/xui/en/panel_sys_well_item.xml @@ -1,65 +1,40 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- All our XML is utf-8 encoded. --> - <panel - name="sys_well_item" - title="sys_well_item" + name="sys_well_item" + title="sys_well_item" visible="true" - top="0" - left="0" - width="318" - height="35" + top="0" + left="0" + width="300" + height="35" layout="topleft" - follows="left|right" - background_opaque="false" - background_visible="true" - bg_alpha_color="0.0 0.0 0.0 0.0" > - - <icon - top="8" - left="8" - width="20" - height="20" - layout="topleft" - follows="left" - name="icon" - label="" - mouse_opaque="false" - image_name="lag_status_warning.tga" - /> - + follows="left|right"> <text - top="2" - left_pad="8" - width="255" - height="28" + top="2" + left="10" + width="267" + height="28" layout="topleft" follows="right|left" - font="SansSerifBold" text_color="white" - use_ellipses="true" + use_ellipses="true" word_wrap="true" mouse_opaque="false" name="title" > - Select your streaming media preference. Select your streaming media preference. - </text> - + Beware the trout. BEWARE! THE! TROUT! + </text> <button - top="5" - left_pad="5" - width="15" - height="15" + top="5" + right="-5" + width="17" + height="17" layout="topleft" follows="right" - name="close_btn" + name="close_btn" mouse_opaque="true" - label="" tab_stop="false" - image_unselected="toast_hide_btn.tga" - image_disabled="toast_hide_btn.tga" - image_selected="toast_hide_btn.tga" - image_hover_selected="toast_hide_btn.tga" - image_disabled_selected="toast_hide_btn.tga" + image_unselected="Icon_Close_Toast" + image_selected="Icon_Close_Toast" /> - -</panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml index 63c2d4538e..f559343b34 100644 --- a/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/panel_teleport_history_item.xml @@ -18,7 +18,7 @@ visible="false" width="380" /> <icon - height="20" + height="24" follows="top|right|left" image_name="ListItem_Select" layout="topleft" @@ -26,17 +26,16 @@ name="selected_icon" top="0" visible="false" - width="380" /> + width="320" /> <icon - height="20" - follows="top|right|left" - image_name="ListItem_Select" + height="16" + follows="top|left" + image_name="Inv_Landmark" layout="topleft" left="0" name="landmark_icon" top="0" - visible="false" - width="20" /> + width="16" /> <text follows="left|right" height="20" @@ -46,21 +45,28 @@ name="region" text_color="white" top="4" - value="Unknown" - width="330" /> + value="..." + width="242" /> <button follows="right" - height="18" - image_disabled="Info" - image_disabled_selected="Info" - image_hover_selected="Info" - image_selected="Info" - image_unselected="Info" - layout="topleft" + height="16" + image_pressed="Info_Press" + image_unselected="Info_Over" + left_pad="3" + right="-31" name="info_btn" picture_style="true" - visible="false" - right="-5" - top="2" - width="18" /> + top_delta="-2" + width="16" /> + <button + follows="right" + height="20" + image_overlay="ForwardArrow_Off" + layout="topleft" + left_pad="5" + right="-3" + name="profile_btn" + picture_style="true" + top_delta="-2" + width="20" /> </panel> diff --git a/indra/newview/skins/default/xui/en/panel_toast.xml b/indra/newview/skins/default/xui/en/panel_toast.xml index 2e500fc2aa..7f7777586c 100644 --- a/indra/newview/skins/default/xui/en/panel_toast.xml +++ b/indra/newview/skins/default/xui/en/panel_toast.xml @@ -1,70 +1,75 @@ <?xml version="1.0" encoding="utf-8" standalone="yes"?> <!-- All our XML is utf-8 encoded. --> +<!-- All this does is establish the position of the "close" button on the toast. --> + <floater + legacy_header_height="18" name="toast" title="" visible="false" layout="topleft" - width="350" - height="40" - left="100" - top="500" - follows="right|bottom" - bevel_style="in" + width="305" + left="0" + top="0" + follows="right|bottom" + bg_opaque_image="Toast_Background" + bg_alpha_image="Toast_Background" can_minimize="false" can_tear_off="false" can_resize="false" can_drag_on_left="false" can_close="false" - can_dock="false" + can_dock="false" + border_visible = "false" + border_drop_shadow_visible = "false" + drop_shadow_visible = "false" + border = "false" > + <!-- <text visible="false" follows="left|top|right|bottom" font="SansSerifBold" - height="28" + height="40" layout="topleft" left="60" name="toast_text" word_wrap="true" text_color="white" - top="10" + top="20" width="290"> Toast text; </text> <icon - top="4" - left="10" - width="32" + top="20" + left="10" + width="32" height="32" follows="top|left" layout="topleft" visible="false" - color="1 1 1 1" - enabled="true" + color="1 1 1 1" + enabled="true" image_name="notify_tip_icon.tga" - mouse_opaque="true" + mouse_opaque="true" name="icon" - /> + />--> <button layout="topleft" - top="-5" - left="335" - width="20" - height="20" + top="-6" + left="293" + width="17" + height="17" follows="top|right" - visible="false" - enabled="true" - mouse_opaque="true" - name="hide_btn" - label="" + visible="false" + enabled="true" + mouse_opaque="false" + name="hide_btn" + label="" tab_stop="false" - image_unselected="toast_hide_btn.tga" - image_disabled="toast_hide_btn.tga" - image_selected="toast_hide_btn.tga" - image_hover_selected="toast_hide_btn.tga" - image_disabled_selected="toast_hide_btn.tga" + image_unselected="Toast_CloseBtn" + image_selected="Toast_CloseBtn" /> -</floater> +</floater> diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 4c19b22ac5..e842517853 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -61,9 +61,7 @@ <string name="TooltipFlagGroupScripts">Group Scripts</string> <string name="TooltipFlagNoScripts">No Scripts</string> <string name="TooltipLand">Land:</string> - <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> - <string name="TooltipAltLeft">Alt+← for previous tab</string> - <string name="TooltipAltRight">Alt+→ for next tab</string> + <string name="TooltipMustSingleDrop">Only a single item can be dragged here</string> <!-- tooltips for Urls --> <string name="TooltipHttpUrl">Click to view this web page</string> @@ -76,6 +74,7 @@ <string name="TooltipTeleportUrl">Click to teleport to this location</string> <string name="TooltipObjectIMUrl">Click to view this object's description</string> <string name="TooltipSLAPP">Click to run the secondlife:// command</string> + <string name="CurrentURL" value=" CurrentURL: [CurrentURL]" /> <!-- ButtonToolTips, llfloater.cpp --> <string name="BUTTON_CLOSE_DARWIN">Close (⌘W)</string> @@ -264,10 +263,6 @@ <string name="TrackYourCamera">Track your camera</string> <string name="ControlYourCamera">Control your camera</string> - <!-- IM --> - <string name="IM_logging_string">-- Instant message logging enabled --</string> - <string name="Unnamed">(Unnamed)</string> - <!-- Sim Access labels --> <string name="SIM_ACCESS_PG">PG</string> <string name="SIM_ACCESS_MATURE">Mature</string> @@ -642,7 +637,7 @@ Sets the script timer to zero float llGetAndResetTime() Returns the script time in seconds and then resets the script timer to zero </string> - <string name="LSLTipText_llSound" translate="false"> + <string name="LSLTipText_llSoplayund" translate="false"> llSound(string sound, float volume, integer queue, integer loop) Plays sound at volume and whether it should loop or not </string> @@ -1819,7 +1814,7 @@ this texture in your inventory <string name="broken_link" value=" (broken_link)" /> <string name="LoadingContents">Loading contents...</string> <string name="NoContents">No contents</string> - <string name="WornOnAttachmentPoint"> (worn on [ATTACHMENT_POINT])</string> + <string name="WornOnAttachmentPoint" value=" (worn on [ATTACHMENT_POINT])" /> <!-- Gestures labels --> <!-- use value="" because they have preceding spaces --> @@ -2022,15 +2017,14 @@ this texture in your inventory <string name="IMTeen">teen</string> <!-- floater region info --> + <!-- The following will replace variable [ALL_ESTATES] in notifications EstateAllowed*, EstateBanned*, EstateManager* --> <string name="RegionInfoError">error</string> <string name="RegionInfoAllEstatesOwnedBy"> - all estates -owned by [OWNER] + all estates owned by [OWNER] </string> - <string name="RegionInfoAllEstatesYouOwn">all estates you owned</string> + <string name="RegionInfoAllEstatesYouOwn">all estates that you own</string> <string name="RegionInfoAllEstatesYouManage"> - all estates that -you managed for [OWNER] + all estates that you manage for [OWNER] </string> <string name="RegionInfoAllowedResidents">Allowed residents: ([ALLOWEDAGENTS], max [MAXACCESS])</string> <string name="RegionInfoAllowedGroups">Allowed groups: ([ALLOWEDGROUPS], max [MAXACCESS])</string> @@ -2194,6 +2188,7 @@ Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh <!-- media --> <string name="Multiple Media">Multiple Media</string> + <string name="Play Media">Play/Pause Media</string> <!-- OSMessageBox messages --> <string name="MBCmdLineError"> @@ -2884,7 +2879,14 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. Failed to start viewer </string> - <!-- IM system messages --> + <!-- IM system messages --> + <string name="IM_logging_string">-- Instant message logging enabled --</string> + <string name="IM_typing_start_string">[NAME] is typing...</string> + <string name="Unnamed">(Unnamed)</string> + <string name="IM_moderated_chat_label">(Moderated: Voices off by default)</string> + <string name="IM_unavailable_text_label">Text chat is not available for this call.</string> + + <string name="ringing-im"> Joining Voice Chat... </string> diff --git a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml index dabcb1038b..fcfe89c653 100644 --- a/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml +++ b/indra/newview/skins/default/xui/en/widgets/accordion_tab.xml @@ -9,4 +9,5 @@ header_image="Accordion_Off" header_image_over="Accordion_Over" header_image_pressed="Accordion_Press" + header_image_selected="Accordion_Selected" /> diff --git a/indra/newview/skins/default/xui/en/widgets/chat_history.xml b/indra/newview/skins/default/xui/en/widgets/chat_history.xml index b72d59524e..ea6997ebd5 100644 --- a/indra/newview/skins/default/xui/en/widgets/chat_history.xml +++ b/indra/newview/skins/default/xui/en/widgets/chat_history.xml @@ -4,8 +4,8 @@ message_separator="panel_chat_separator.xml" left_text_pad="10" right_text_pad="15" - left_widget_pad="5" - rigth_widget_pad="10" + left_widget_pad="0" + right_widget_pad="10" max_length="2147483647" enabled="false" track_bottom="true" diff --git a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml index 319beac291..f59c46b2f5 100644 --- a/indra/newview/skins/default/xui/en/widgets/expandable_text.xml +++ b/indra/newview/skins/default/xui/en/widgets/expandable_text.xml @@ -3,7 +3,7 @@ max_height="300" > <textbox more_label="More" - follows="left|top" + follows="left|top|right" name="text" allow_scroll="true" use_ellipses="true" diff --git a/indra/newview/skins/default/xui/en/widgets/floater.xml b/indra/newview/skins/default/xui/en/widgets/floater.xml index 4a866c2eb2..6660fbf1a8 100644 --- a/indra/newview/skins/default/xui/en/widgets/floater.xml +++ b/indra/newview/skins/default/xui/en/widgets/floater.xml @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- See also settings.xml UIFloater* settings for configuration --> <floater name="floater" bg_opaque_color="FloaterFocusBackgroundColor" bg_alpha_color="FloaterDefaultBackgroundColor" + bg_opaque_image="Window_Foreground" + bg_alpha_image="Window_Background" background_visible="true" - background_opaque="false"/> + background_opaque="false" + header_height="25" /> diff --git a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml index 89e442baec..ab4ad94089 100644 --- a/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml +++ b/indra/newview/skins/default/xui/en/widgets/gesture_combo_box.xml @@ -23,7 +23,8 @@ image_selected="DropDown_Selected" image_disabled="DropDown_Disabled" image_disabled_selected="DropDown_Disabled_Selected" /> - <gesture_combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" /> + <gesture_combo_box.combo_list bg_writeable_color="MenuDefaultBgColor" + scroll_bar_bg_visible="true" /> <gesture_combo_box.combo_editor name="Combo Text Entry" select_on_focus="true" font="SansSerifSmall" /> diff --git a/indra/newview/skins/default/xui/en/widgets/output_monitor.xml b/indra/newview/skins/default/xui/en/widgets/output_monitor.xml index 505c7ba936..98b3e2faaa 100644 --- a/indra/newview/skins/default/xui/en/widgets/output_monitor.xml +++ b/indra/newview/skins/default/xui/en/widgets/output_monitor.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <output_monitor - image_mute="mute_icon.tga" + image_mute="parcel_lght_VoiceNo" image_off="VoicePTT_Off" image_on="VoicePTT_On" image_level_1="VoicePTT_Lvl1" diff --git a/indra/newview/skins/default/xui/en/widgets/panel.xml b/indra/newview/skins/default/xui/en/widgets/panel.xml index b81a70b845..7262c0dc5c 100644 --- a/indra/newview/skins/default/xui/en/widgets/panel.xml +++ b/indra/newview/skins/default/xui/en/widgets/panel.xml @@ -1,5 +1,11 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- Optional parameters: + border - show border around panel + bg_opaque_image - image name for "in-front" panel look + bg_alpha_image - image name for "in-back" or transparent panel look +--> <panel bg_opaque_color="PanelFocusBackgroundColor" bg_alpha_color="PanelDefaultBackgroundColor" background_visible="false" - background_opaque="false"/>
\ No newline at end of file + background_opaque="false" + chrome="false"/>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/widgets/split_button.xml b/indra/newview/skins/default/xui/en/widgets/split_button.xml index c0d3c6d7f6..2ff9ada90a 100644 --- a/indra/newview/skins/default/xui/en/widgets/split_button.xml +++ b/indra/newview/skins/default/xui/en/widgets/split_button.xml @@ -1,24 +1,25 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> -<split_button +<split_button font="SansSerifSmall" arrow_position="left" follows="right|top"> - <split_button.arrow_button - name="Arrow Button" - label="" - font="SansSerifSmall" - scale_image="true" - image_selected="camera_presets/camera_presets_arrow.png" - image_unselected="camera_presets/camera_presets_arrow.png" - image_disabled_selected="camera_presets/camera_presets_arrow.png" - image_disabled="camera_presets/camera_presets_arrow.png" - width="10"/> <split_button.items_panel background_visible="true" border="true" bg_alpha_color="1 1 1 1" bg_opaq_color="1 1 1 1" + scale_image="false" + image_selected="SegmentedBtn_Left_Selected" + image_unselected="SegmentedBtn_Left_Off" layout="topleft" name="item_buttons" /> + <split_button.arrow_button + name="Arrow Button" + label="" + font="SansSerifSmall" + scale_image="false" + image_selected="SegmentedBtn_Right_Selected" + image_unselected="SegmentedBtn_Right_Off" + /> </split_button> diff --git a/indra/newview/skins/default/xui/en/widgets/tab_container.xml b/indra/newview/skins/default/xui/en/widgets/tab_container.xml index 2fe5f517a2..fe2f1423b7 100644 --- a/indra/newview/skins/default/xui/en/widgets/tab_container.xml +++ b/indra/newview/skins/default/xui/en/widgets/tab_container.xml @@ -1,7 +1,8 @@ <?xml version="1.0" encoding="utf-8" standalone="yes" ?> <tab_container tab_min_width="60" tab_max_width="150" - tab_height="16"> + font_halign="center" + tab_height="21"> <first_tab tab_top_image_unselected="TabTop_Left_Off" tab_top_image_selected="TabTop_Left_Selected" tab_bottom_image_unselected="Toolbar_Left_Off" diff --git a/indra/newview/skins/default/xui/en/widgets/tool_tip.xml b/indra/newview/skins/default/xui/en/widgets/tool_tip.xml new file mode 100644 index 0000000000..6b49f832fd --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/tool_tip.xml @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<!-- See also settings.xml UIFloater* settings for configuration --> +<tool_tip name="tooltip" + max_width="200" + padding="4" + wrap="true" + font="SansSerif" + bg_opaque_color="ToolTipBgColor" + background_visible="true" + /> diff --git a/indra/test_apps/llplugintest/CMakeLists.txt b/indra/test_apps/llplugintest/CMakeLists.txt index 88c4ba8ad9..53b981cccd 100644 --- a/indra/test_apps/llplugintest/CMakeLists.txt +++ b/indra/test_apps/llplugintest/CMakeLists.txt @@ -293,6 +293,7 @@ add_dependencies(llmediaplugintest SLPlugin media_plugin_quicktime media_plugin_webkit + media_plugin_example ${LLPLUGIN_LIBRARIES} ${LLMESSAGE_LIBRARIES} ${LLCOMMON_LIBRARIES} @@ -369,6 +370,12 @@ if (DARWIN OR WINDOWS) DEPENDS ${BUILT_QUICKTIME_PLUGIN} ) + get_target_property(BUILT_EXAMPLE_PLUGIN media_plugin_example LOCATION) + add_custom_command(TARGET llmediaplugintest POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy ${BUILT_EXAMPLE_PLUGIN} ${PLUGINS_DESTINATION_DIR} + DEPENDS ${BUILT_EXAMPLE_PLUGIN} + ) + # copy over bookmarks file if llmediaplugintest gets built get_target_property(BUILT_LLMEDIAPLUGINTEST llmediaplugintest LOCATION) add_custom_command(TARGET llmediaplugintest POST_BUILD diff --git a/indra/test_apps/llplugintest/bookmarks.txt b/indra/test_apps/llplugintest/bookmarks.txt index e5268fcac9..b8b83df386 100644 --- a/indra/test_apps/llplugintest/bookmarks.txt +++ b/indra/test_apps/llplugintest/bookmarks.txt @@ -8,6 +8,7 @@ (WK) Canvas Paint (DHTML version of MS Paint),http://www.canvaspaint.org (WK) DHTML Lemmings!,http://www.elizium.nu/scripts/lemmings/ (WK) DHTML graphics demos,http://www.dhteumeuleu.com/ +(WK) Shared paint app,http://colorillo.com/ac79?1l0q6cp (Flash) YouTube,http://youtube.com (Flash) Vimeo,http://www.vimeo.com/1778399 (Flash) Simple whiteboard,http://www.imaginationcubed.com/ @@ -33,3 +34,4 @@ (QT) Movie - The Informers,http://movies.apple.com/movies/independent/theinformers/theinformers_h.320.mov (QT) Animated GIF,http://upload.wikimedia.org/wikipedia/commons/4/44/Optical.greysquares.arp-animated.gif (QT) Apple Text Descriptors,http://ubrowser.com/tmp/apple_text.txt +(EX) Example Plugin,example://blah diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index 234422b68a..d987915bb8 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -138,8 +138,6 @@ LLMediaPluginTest::LLMediaPluginTest( int app_window, int window_width, int wind mMediaBrowserControlBackButtonFlag( true ), mMediaBrowserControlForwardButtonFlag( true ), mHomeWebUrl( "http://www.google.com/" ) - //mHomeWebUrl( "file:///C|/Program Files/QuickTime/Sample.mov" ) - //mHomeWebUrl( "http://movies.apple.com/movies/wb/watchmen/watchmen-tlr2_480p.mov" ) { // debugging spam std::cout << std::endl << " GLUT version: " << "3.7.6" << std::endl; // no way to get real version from GLUT @@ -277,8 +275,6 @@ void LLMediaPluginTest::bindTexture(GLuint texture, GLint row_length, GLint alig { glEnable( GL_TEXTURE_2D ); -// std::cerr << "binding texture " << texture << std::endl; - glBindTexture( GL_TEXTURE_2D, texture ); glPixelStorei( GL_UNPACK_ROW_LENGTH, row_length ); glPixelStorei( GL_UNPACK_ALIGNMENT, alignment ); @@ -410,7 +406,7 @@ void LLMediaPluginTest::draw( int draw_type ) // only bother with pick if we have something to render // Actually, we need to pick even if we're not ready to render. // Otherwise you can't select and remove a panel which has gone bad. -// if ( mMediaPanels[ panel ]->mReadyToRender ) + //if ( mMediaPanels[ panel ]->mReadyToRender ) { glMatrixMode( GL_TEXTURE ); glPushMatrix(); @@ -621,10 +617,10 @@ void LLMediaPluginTest::idle() if ( mSelectedPanel ) { // set volume based on slider if we have time media -// if ( mGluiMediaTimeControlWindowFlag ) -// { -// mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f ); -// }; + //if ( mGluiMediaTimeControlWindowFlag ) + //{ + // mSelectedPanel->mMediaSource->setVolume( (float)mMediaTimeControlVolume / 100.0f ); + //}; // NOTE: it is absurd that we need cache the state of GLUI controls // but enabling/disabling controls drags framerate from 500+ @@ -1190,7 +1186,7 @@ void LLMediaPluginTest::mouseButton( int button, int state, int x, int y ) windowPosToTexturePos( x, y, media_x, media_y, id ); if ( mSelectedPanel ) - mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_DOWN, media_x, media_y, 0 ); + mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_DOWN, 0, media_x, media_y, 0 ); } else if ( state == GLUT_UP ) @@ -1206,7 +1202,7 @@ void LLMediaPluginTest::mouseButton( int button, int state, int x, int y ) selectPanelById( id ); if ( mSelectedPanel ) - mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_UP, media_x, media_y, 0 ); + mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_UP, 0, media_x, media_y, 0 ); }; }; }; @@ -1220,7 +1216,7 @@ void LLMediaPluginTest::mousePassive( int x, int y ) windowPosToTexturePos( x, y, media_x, media_y, id ); if ( mSelectedPanel ) - mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, media_x, media_y, 0 ); + mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, media_x, media_y, 0 ); } //////////////////////////////////////////////////////////////////////////////// @@ -1231,7 +1227,7 @@ void LLMediaPluginTest::mouseMove( int x, int y ) windowPosToTexturePos( x, y, media_x, media_y, id ); if ( mSelectedPanel ) - mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, media_x, media_y, 0 ); + mSelectedPanel->mMediaSource->mouseEvent( LLPluginClassMedia::MOUSE_EVENT_MOVE, 0, media_x, media_y, 0 ); } //////////////////////////////////////////////////////////////////////////////// @@ -1463,6 +1459,9 @@ std::string LLMediaPluginTest::mimeTypeFromUrl( std::string& url ) else if ( url.find( ".txt" ) != std::string::npos ) // Apple Text descriptors mime_type = "video/quicktime"; + else + if ( url.find( "example://" ) != std::string::npos ) // Example plugin + mime_type = "example/example"; return mime_type; } @@ -1487,6 +1486,9 @@ std::string LLMediaPluginTest::pluginNameFromMimeType( std::string& mime_type ) else if ( mime_type == "text/html" ) plugin_name = "media_plugin_webkit.dll"; + else + if ( mime_type == "example/example" ) + plugin_name = "media_plugin_example.dll"; #elif LL_LINUX std::string plugin_name( "libmedia_plugin_null.so" ); @@ -1799,7 +1801,7 @@ void LLMediaPluginTest::getRandomMediaSize( int& width, int& height, std::string // adjust this random size if it's a browser so we get // a more useful size for testing.. - if ( mime_type == "text/html" ) + if ( mime_type == "text/html" || mime_type == "example/example" ) { width = ( ( rand() % 100 ) + 100 ) * 4; height = ( width * ( ( rand() % 400 ) + 1000 ) ) / 1000; |