From e84f9acf761bd60a558682e87e053207bc9bc014 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 19 Aug 2011 11:13:11 -0700 Subject: Removing tabs to satisfy coding policy! --- indra/newview/CMakeLists.txt | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 328cbf3936..f3fea87849 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1734,7 +1734,7 @@ endif (WINDOWS) # that they depend upon. -brad target_link_libraries(${VIEWER_BINARY_NAME} ${UPDATER_LIBRARIES} - ${GOOGLE_PERFTOOLS_LIBRARIES} + ${GOOGLE_PERFTOOLS_LIBRARIES} ${LLAUDIO_LIBRARIES} ${LLCHARACTER_LIBRARIES} ${LLIMAGE_LIBRARIES} @@ -1797,14 +1797,14 @@ if (LINUX) # These are the generated targets that are copied to package/ set(COPY_INPUT_DEPENDENCIES - ${VIEWER_BINARY_NAME} - linux-crash-logger - linux-updater - SLPlugin - media_plugin_webkit - media_plugin_gstreamer010 - llcommon - ) + ${VIEWER_BINARY_NAME} + linux-crash-logger + linux-updater + SLPlugin + media_plugin_webkit + media_plugin_gstreamer010 + llcommon + ) add_custom_command( OUTPUT ${product}.tar.bz2 @@ -2053,24 +2053,24 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(llslurl - "${llslurl_test_sources}" + "${llslurl_test_sources}" "${test_libs}" - ) + ) LL_ADD_INTEGRATION_TEST(llviewernetwork - llviewernetwork.cpp + llviewernetwork.cpp "${test_libs}" - ) + ) LL_ADD_INTEGRATION_TEST(llsimplestat - "" + "" "${test_libs}" - ) + ) LL_ADD_INTEGRATION_TEST(llviewerassetstats - llviewerassetstats.cpp + llviewerassetstats.cpp "${test_libs}" - ) + ) #ADD_VIEWER_BUILD_TEST(llmemoryview viewer) #ADD_VIEWER_BUILD_TEST(llagentaccess viewer) -- cgit v1.2.3 From 93645cf55cb276c098232e81b9b548968ab4e4b3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 19 Aug 2011 16:41:53 -0700 Subject: fix for not properly handling nested brackets in string replacement, e.g. [[FOO]] --- indra/llcommon/llstring.cpp | 13 +++++++++---- indra/llcommon/tests/llstring_test.cpp | 8 ++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index f3b48b0156..e7fe656808 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -936,13 +936,18 @@ LLStringUtil::size_type LLStringUtil::getSubstitution(const std::string& instr, { const std::string delims (","); - // Find the first ] - size_type pos2 = instr.find(']', start); + // Find the first [ + size_type pos1 = instr.find('[', start); + if (pos1 == std::string::npos) + return std::string::npos; + + //Find the first ] after the initial [ + size_type pos2 = instr.find(']', pos1); if (pos2 == std::string::npos) return std::string::npos; - // Find the last [ before ] - size_type pos1 = instr.find_last_of('[', pos2-1); + // Find the last [ before ] in case of nested [[]] + pos1 = instr.find_last_of('[', pos2-1); if (pos1 == std::string::npos || pos1 < start) return std::string::npos; diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index 304e91ed92..dd4bc0b039 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -624,6 +624,14 @@ namespace tut subcount = LLStringUtil::format(s, fmt_map); ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "?Am I not a long string?short[A]bbbaaaba[A]"); ensure_equals("LLStringUtil::format: Assorted Test2 result count", 9, subcount); + + // Test on nested brackets + std::string srcs6 = "[[TRICK1]][[A]]"; + s = srcs6; + subcount = LLStringUtil::format(s, fmt_map); + ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "[[A]][a]"); + ensure_equals("LLStringUtil::format: Assorted Test2 result count", 2, subcount); + // Test an assorted substitution std::string srcs8 = "foo[DELETE]bar?"; -- cgit v1.2.3 From 7ff36a724db0765de38370e054ef3393a65443a7 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 19 Aug 2011 16:45:39 -0700 Subject: better unit test for nested brackets in string replacement --- indra/llcommon/tests/llstring_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/tests/llstring_test.cpp b/indra/llcommon/tests/llstring_test.cpp index dd4bc0b039..6a1cbf652a 100644 --- a/indra/llcommon/tests/llstring_test.cpp +++ b/indra/llcommon/tests/llstring_test.cpp @@ -626,11 +626,11 @@ namespace tut ensure_equals("LLStringUtil::format: Assorted Test2 result count", 9, subcount); // Test on nested brackets - std::string srcs6 = "[[TRICK1]][[A]]"; + std::string srcs6 = "[[TRICK1]][[A]][[B]][[AAA]][[BBB]][[TRICK2]][[KEYLONGER]][[KEYSHORTER]]?[[DELETE]]"; s = srcs6; subcount = LLStringUtil::format(s, fmt_map); - ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "[[A]][a]"); - ensure_equals("LLStringUtil::format: Assorted Test2 result count", 2, subcount); + ensure_equals("LLStringUtil::format: Assorted Test2 result", s, "[[A]][a][b][aaa][bbb][[A]][short][Am I not a long string?]?[]"); + ensure_equals("LLStringUtil::format: Assorted Test2 result count", 9, subcount); // Test an assorted substitution -- cgit v1.2.3 From c8712fb180aedf84dc48ade636ec0aae8d905bf7 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 22 Aug 2011 11:34:03 -0700 Subject: converted tabs to spaces --- indra/newview/CMakeLists.txt | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 328cbf3936..0e36b787a2 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1734,7 +1734,7 @@ endif (WINDOWS) # that they depend upon. -brad target_link_libraries(${VIEWER_BINARY_NAME} ${UPDATER_LIBRARIES} - ${GOOGLE_PERFTOOLS_LIBRARIES} + ${GOOGLE_PERFTOOLS_LIBRARIES} ${LLAUDIO_LIBRARIES} ${LLCHARACTER_LIBRARIES} ${LLIMAGE_LIBRARIES} @@ -1796,15 +1796,15 @@ if (LINUX) set(product SecondLife-${ARCH}-${viewer_VERSION}) # These are the generated targets that are copied to package/ - set(COPY_INPUT_DEPENDENCIES - ${VIEWER_BINARY_NAME} - linux-crash-logger - linux-updater - SLPlugin - media_plugin_webkit - media_plugin_gstreamer010 - llcommon - ) + set(COPY_INPUT_DEPENDENCIES + ${VIEWER_BINARY_NAME} + linux-crash-logger + linux-updater + SLPlugin + media_plugin_webkit + media_plugin_gstreamer010 + llcommon + ) add_custom_command( OUTPUT ${product}.tar.bz2 @@ -2063,12 +2063,12 @@ if (LL_TESTS) ) LL_ADD_INTEGRATION_TEST(llsimplestat - "" + "" "${test_libs}" ) LL_ADD_INTEGRATION_TEST(llviewerassetstats - llviewerassetstats.cpp + llviewerassetstats.cpp "${test_libs}" ) -- cgit v1.2.3 From 56453f2982464b6d5c86c23e0e75f5adcdd0edff Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Mon, 22 Aug 2011 13:16:58 -0700 Subject: EXP-1129 FIX SLURLs with only 2 coordinates are interpreted as center of sim reviewed by Leslie --- indra/llmath/tests/v3math_test.cpp | 18 ++++++++++++++++++ indra/newview/llslurl.cpp | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/indra/llmath/tests/v3math_test.cpp b/indra/llmath/tests/v3math_test.cpp index df7a77002f..e4ae1c10ef 100644 --- a/indra/llmath/tests/v3math_test.cpp +++ b/indra/llmath/tests/v3math_test.cpp @@ -564,4 +564,22 @@ namespace tut z1 = U8_to_F32(F32_to_U8(z, lowerz, upperz), lowerz, upperz); ensure("2:quantize8: Fail ", is_approx_equal(x1, vec3a.mV[VX]) && is_approx_equal(y1, vec3a.mV[VY]) && is_approx_equal(z1, vec3a.mV[VZ])); } + + template<> template<> + void v3math_object::test<35>() + { + LLSD sd = LLSD::emptyArray(); + sd[0] = 1.f; + + LLVector3 parsed_1(sd); + ensure("1:LLSD parse: Fail ", is_approx_equal(parsed_1.mV[VX], 1.f) && is_approx_equal(parsed_1.mV[VY], 0.f) && is_approx_equal(parsed_1.mV[VZ], 0.f)); + + sd[1] = 2.f; + LLVector3 parsed_2(sd); + ensure("2:LLSD parse: Fail ", is_approx_equal(parsed_2.mV[VX], 1.f) && is_approx_equal(parsed_2.mV[VY], 2.f) && is_approx_equal(parsed_2.mV[VZ], 0.f)); + + sd[2] = 3.f; + LLVector3 parsed_3(sd); + ensure("3:LLSD parse: Fail ", is_approx_equal(parsed_3.mV[VX], 1.f) && is_approx_equal(parsed_3.mV[VY], 2.f) && is_approx_equal(parsed_3.mV[VZ], 3.f)); + } } diff --git a/indra/newview/llslurl.cpp b/indra/newview/llslurl.cpp index 4cf1df1655..a853726dea 100644 --- a/indra/newview/llslurl.cpp +++ b/indra/newview/llslurl.cpp @@ -273,11 +273,11 @@ LLSLURL::LLSLURL(const std::string& slurl) mRegion = LLURI::unescape(path_array[0].asString()); path_array.erase(0); - // parse the x, y, z - if(path_array.size() >= 3) + // parse the x, y, and optionally z + if(path_array.size() >= 2) { - mPosition = LLVector3(path_array); + mPosition = LLVector3(path_array); // this construction handles LLSD without all components (values default to 0.f) if((F32(mPosition[VX]) < 0.f) || (mPosition[VX] > REGION_WIDTH_METERS) || (F32(mPosition[VY]) < 0.f) || -- cgit v1.2.3 From fea0917fbd9bde846001c00464a66e480ca1baa3 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 23 Aug 2011 12:20:10 -0700 Subject: EXP-1099 FIX Cannot drag item on to empty space in outbox folder corrected bad logic for resizing LLFolderView --- indra/newview/llfolderview.cpp | 5 ++++- indra/newview/llfolderview.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 6461a5525e..9cfb25f207 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -181,6 +181,7 @@ LLFolderView::Params::Params() // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), + mRunningHeight(0), mScrollContainer( NULL ), mPopupMenuHandle(), mAllowMultiSelect(p.allow_multiselect), @@ -479,6 +480,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen target_height = running_height; } + mRunningHeight = running_height; LLRect scroll_rect = mScrollContainer->getContentWindowRect(); reshape( llmax(scroll_rect.getWidth(), total_width), running_height ); @@ -524,10 +526,11 @@ void LLFolderView::reshape(S32 width, S32 height, BOOL called_from_parent) LLRect scroll_rect; if (mScrollContainer) { + LLView::reshape(width, height, called_from_parent); scroll_rect = mScrollContainer->getContentWindowRect(); } width = llmax(mMinWidth, scroll_rect.getWidth()); - height = llmax(height, scroll_rect.getHeight()); + height = llmax(mRunningHeight, scroll_rect.getHeight()); // restrict width with scroll container's width if (mUseEllipses) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 705a76a7b4..8af01e9102 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -314,6 +314,7 @@ protected: signal_t mReshapeSignal; S32 mSignalSelectCallback; S32 mMinWidth; + S32 mRunningHeight; std::map mItemMap; BOOL mDragAndDropThisFrame; -- cgit v1.2.3 From d10a0044320ed3fb2fffd7284e8b139d82c07214 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 26 Aug 2011 14:28:50 -0700 Subject: EXP-1162 FIX We are failing to create the Outfit links from the library initial outfits copied on first login reviewed by Stone --- indra/newview/llappearancemgr.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 1388d9aee0..a0af94ba77 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -2285,7 +2285,9 @@ void LLAppearanceMgr::autopopulateOutfits() void LLAppearanceMgr::onFirstFullyVisible() { gAgentAvatarp->debugAvatarVisible(); - autopopulateOutfits(); + // The auto-populate is failing at the point of generating outfits + // folders, so don't do the library copy until that is resolved. + // autopopulateOutfits(); } bool LLAppearanceMgr::updateBaseOutfit() -- cgit v1.2.3 From 0bf3ee7fa7f09bee0ee12077442fac9e4d0b32cd Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 26 Aug 2011 17:27:15 -0700 Subject: EXP-1111 FIX LLQtWebKit (and related media system) should log events, progress etc. to make debugging problems easier --- indra/llplugin/llpluginclassmedia.cpp | 14 ++++++ indra/llplugin/llpluginclassmedia.h | 9 ++++ indra/llplugin/llpluginclassmediaowner.h | 2 + indra/media_plugins/webkit/media_plugin_webkit.cpp | 52 ++++++++++++++++++++-- indra/newview/app_settings/settings.xml | 11 +++++ indra/newview/llmediactrl.cpp | 6 +++ indra/newview/llviewermedia.cpp | 6 ++- 7 files changed, 95 insertions(+), 5 deletions(-) diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index d081109acc..5a208ece71 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -842,6 +842,14 @@ void LLPluginClassMedia::setJavascriptEnabled(const bool enabled) sendMessage(message); } + +void LLPluginClassMedia::enableMediaPluginDebugging( bool enable ) +{ + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "enable_media_plugin_debugging"); + message.setValueBoolean( "enable", enable ); + sendMessage( message ); +} + void LLPluginClassMedia::setTarget(const std::string &target) { mTarget = target; @@ -1066,6 +1074,12 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mAuthURL = message.getValue("url"); mAuthRealm = message.getValue("realm"); mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_AUTH_REQUEST); + } + else if(message_name == "debug_message") + { + mDebugMessageText = message.getValue("message_text"); + mDebugMessageLevel = message.getValue("message_level"); + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_DEBUG_MESSAGE); } else { diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index e7f303275e..84a3dbed6d 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -118,6 +118,9 @@ public: void scrollEvent(int x, int y, MASK modifiers); + // enable/disable media plugin debugging messages and info spam + void enableMediaPluginDebugging( bool enable ); + // Javascript <-> viewer events void jsEnableObject( bool enable ); void jsAgentLocationEvent( double x, double y, double z ); @@ -243,6 +246,10 @@ public: // This is valid during MEDIA_EVENT_CLICK_LINK_HREF and MEDIA_EVENT_GEOMETRY_CHANGE std::string getClickUUID() const { return mClickUUID; }; + + // These are valid during MEDIA_EVENT_DEBUG_MESSAGE + std::string getDebugMessageText() const { return mDebugMessageText; }; + std::string getDebugMessageLevel() const { return mDebugMessageLevel; }; // This is valid after MEDIA_EVENT_NAVIGATE_ERROR_PAGE S32 getStatusCode() const { return mStatusCode; }; @@ -395,6 +402,8 @@ protected: std::string mClickNavType; std::string mClickTarget; std::string mClickUUID; + std::string mDebugMessageText; + std::string mDebugMessageLevel; S32 mGeometryX; S32 mGeometryY; S32 mGeometryWidth; diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index 5a4fb1ce90..2f3edba7f3 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -64,6 +64,8 @@ public: MEDIA_EVENT_AUTH_REQUEST, // The plugin wants to display an auth dialog + MEDIA_EVENT_DEBUG_MESSAGE, // plugin sending back debug information for host to process + MEDIA_EVENT_LINK_HOVERED // Got a "link hovered" event from the plugin } EMediaEvent; diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 96f642f2a0..b87af85bcf 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -90,6 +90,7 @@ private: bool mCookiesEnabled; bool mJavascriptEnabled; bool mPluginsEnabled; + bool mEnableMediaPluginDebugging; enum { @@ -119,6 +120,17 @@ private: VolumeCatcher mVolumeCatcher; + void postDebugMessage( const std::string& msg ) + { + if ( mEnableMediaPluginDebugging ) + { + LLPluginMessage debug_message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "debug_message"); + debug_message.setValue("message_text", "Media> " + msg); + debug_message.setValue("message_level", "info"); + sendMessage(debug_message); + } + } + void setInitState(int state) { // std::cerr << "changing init state to " << state << std::endl; @@ -252,6 +264,9 @@ private: std::string component_dir = application_dir; #endif + // debug spam sent to viewer and displayed in the log as usual + postDebugMessage( "Component dir set to: " + component_dir ); + // window handle - needed on Windows and must be app window. #if LL_WINDOWS char window_title[ MAX_PATH ]; @@ -266,10 +281,16 @@ private: if ( result ) { mInitState = INIT_STATE_INITIALIZED; - + + // debug spam sent to viewer and displayed in the log as usual + postDebugMessage( "browser initialized okay" ); + return true; }; + // debug spam sent to viewer and displayed in the log as usual + postDebugMessage( "browser nOT initialized." ); + return false; }; @@ -292,20 +313,30 @@ private: if(!mHostLanguage.empty()) { LLQtWebKit::getInstance()->setHostLanguage(mHostLanguage); + postDebugMessage( "Setting language to " + mHostLanguage ); } // turn on/off cookies based on what host app tells us LLQtWebKit::getInstance()->enableCookies( mCookiesEnabled ); - + // turn on/off plugins based on what host app tells us LLQtWebKit::getInstance()->enablePlugins( mPluginsEnabled ); // turn on/off Javascript based on what host app tells us LLQtWebKit::getInstance()->enableJavascript( mJavascriptEnabled ); - + + std::stringstream str; + str << "Cookies enabled = " << mCookiesEnabled << ", plugins enabled = " << mPluginsEnabled << ", Javascript enabled = " << mJavascriptEnabled; + postDebugMessage( str.str() ); + // create single browser window mBrowserWindowId = LLQtWebKit::getInstance()->createBrowserWindow( mWidth, mHeight, mTarget); + str.str(""); + str.clear(); + str << "Setting browser window size to " << mWidth << " x " << mHeight; + postDebugMessage( str.str() ); + // tell LLQtWebKit about the size of the browser window LLQtWebKit::getInstance()->setSize( mBrowserWindowId, mWidth, mHeight ); @@ -314,6 +345,7 @@ private: // append details to agent string LLQtWebKit::getInstance()->setBrowserAgentId( mUserAgent ); + postDebugMessage( "Updating user agent with " + mUserAgent ); #if !LL_QTWEBKIT_USES_PIXMAPS // don't flip bitmap @@ -410,7 +442,10 @@ private: 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); - + + // debug spam sent to viewer and displayed in the log as usual + postDebugMessage( "Navigate begin event at: " + event.getEventUri() ); + setStatus(STATUS_LOADING); } @@ -452,6 +487,8 @@ private: setInitState(INIT_STATE_NAVIGATE_COMPLETE); } + // debug spam sent to viewer and displayed in the log as usual + postDebugMessage( "Navigate complete event at: " + event.getEventUri() ); } //////////////////////////////////////////////////////////////////////////////// @@ -824,6 +861,7 @@ MediaPluginWebKit::MediaPluginWebKit(LLPluginInstance::sendMessageFunction host_ mHostLanguage = "en"; // default to english mJavascriptEnabled = true; // default to on mPluginsEnabled = true; // default to on + mEnableMediaPluginDebugging = false; mUserAgent = "LLPluginMedia Web Browser"; } @@ -1167,6 +1205,12 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) { authResponse(message_in); } + else + if(message_name == "enable_media_plugin_debugging") + { + mEnableMediaPluginDebugging = message_in.getValueBoolean( "enable" ); + } + else if(message_name == "js_enable_object") { diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 33541b559b..c47a0d5912 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -5437,6 +5437,17 @@ Value 60.0 + MediaPluginDebugging + + Comment + Turn on debugging messages that may help diagnosing media issues (WARNING: May reduce performance). + Persist + 1 + Type + Boolean + Value + 0 + MediaControlFadeTime Comment diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 1eb786f433..90267c173c 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1065,6 +1065,12 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) mHoverTextChanged = true; }; break; + + case MEDIA_EVENT_DEBUG_MESSAGE: + { + LL_INFOS("media") << self->getDebugMessageText() << LL_ENDL; + }; + break; }; // chain all events to any potential observers of this object. diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 384f7cd61d..31b22119cb 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1776,6 +1776,7 @@ void LLViewerMediaImpl::createMediaSource() LL_WARNS("Media") << "Failed to initialize media for mime type " << mMimeType << LL_ENDL; } } + } ////////////////////////////////////////////////////////////////////////////////////////// @@ -1880,7 +1881,10 @@ LLPluginClassMedia* LLViewerMediaImpl::newSourceFromMediaType(std::string media_ // collect 'javascript enabled' setting from prefs and send to embedded browser bool javascript_enabled = gSavedSettings.getBOOL( "BrowserJavascriptEnabled" ); media_source->setJavascriptEnabled( javascript_enabled ); - + + bool media_plugin_debugging_enabled = gSavedSettings.getBOOL("MediaPluginDebugging"); + media_source->enableMediaPluginDebugging( media_plugin_debugging_enabled ); + media_source->setTarget(target); const std::string plugin_dir = gDirUtilp->getLLPluginDir(); -- cgit v1.2.3 From 0af17d6e8e9cbbe5e1acb7aed8f296db55522c44 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Fri, 26 Aug 2011 18:28:58 -0700 Subject: EXP-1149 FIX Log in Screen: Replace the new mode selector with the old one --- indra/newview/llpanellogin.cpp | 30 ++++++++++++++++++ indra/newview/llpanellogin.h | 3 +- indra/newview/llstatusbar.cpp | 33 +++++++++++++++++++ indra/newview/llstatusbar.h | 2 ++ indra/newview/skins/default/xui/en/panel_login.xml | 37 ++++++++++++++++------ .../skins/default/xui/en/panel_navigation_bar.xml | 4 +-- .../skins/default/xui/en/panel_status_bar.xml | 31 +++++++++++------- indra/newview/skins/minimal/xui/en/main_view.xml | 4 +-- indra/newview/skins/minimal/xui/en/panel_login.xml | 37 ++++++++++++++++------ .../skins/minimal/xui/en/panel_navigation_bar.xml | 2 +- .../skins/minimal/xui/en/panel_status_bar.xml | 37 ++++++++++++++-------- 11 files changed, 169 insertions(+), 51 deletions(-) diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp index bef809f3a7..5fd0eadf16 100644 --- a/indra/newview/llpanellogin.cpp +++ b/indra/newview/llpanellogin.cpp @@ -154,6 +154,10 @@ LLPanelLogin::LLPanelLogin(const LLRect &rect, } updateLocationCombo(false); + LLUICtrl& mode_combo = getChildRef("mode_combo"); + mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile")); + mode_combo.setCommitCallback(boost::bind(&LLPanelLogin::onModeChange, this, getChild("mode_combo")->getValue(), _2)); + LLComboBox* server_choice_combo = sInstance->getChild("server_combo"); server_choice_combo->setCommitCallback(onSelectServer, NULL); server_choice_combo->setFocusLostCallback(boost::bind(onServerComboLostFocus, _1)); @@ -1021,6 +1025,32 @@ void LLPanelLogin::updateLoginPanelLinks() sInstance->getChildView("forgot_password_text")->setVisible( system_grid); } +void LLPanelLogin::onModeChange(const LLSD& original_value, const LLSD& new_value) +{ + if (original_value.asString() != new_value.asString()) + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLPanelLogin::onModeChangeConfirm, this, original_value, new_value, _1, _2)); + } +} + +void LLPanelLogin::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + switch (option) + { + case 0: + gSavedSettings.getControl("SessionSettingsFile")->set(new_value); + LLAppViewer::instance()->forceQuit(); + break; + case 1: + // revert to original value + getChild("mode_combo")->setValue(original_value); + break; + default: + break; + } +} + std::string canonicalize_username(const std::string& name) { std::string cname = name; diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index b29b3af7ca..7b519df8ef 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -87,6 +87,8 @@ private: void reshapeBrowser(); void addFavoritesToStartLocation(); void addUsersWithFavoritesToUsername(); + void onModeChange(const LLSD& original_value, const LLSD& new_value); + void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response); static void onClickConnect(void*); static void onClickNewAccount(void*); static void onClickVersion(void*); @@ -97,7 +99,6 @@ private: static void onServerComboLostFocus(LLFocusableElement*); static void updateServerCombo(); static void updateStartSLURL(); - static void updateLoginPanelLinks(); private: diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 1b8be7a5b2..f7fb370720 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -162,6 +162,8 @@ BOOL LLStatusBar::handleRightMouseDown(S32 x, S32 y, MASK mask) BOOL LLStatusBar::postBuild() { + LLControlVariablePtr mode_control = gSavedSettings.getControl("SessionSettingsFile"); + gMenuBarView->setRightMouseDownCallback(boost::bind(&show_navbar_context_menu, _1, _2, _3)); mTextTime = getChild("TimeText" ); @@ -233,9 +235,40 @@ BOOL LLStatusBar::postBuild() mScriptOut = getChildView("scriptout"); + LLUICtrl& mode_combo = getChildRef("mode_combo"); + mode_combo.setValue(gSavedSettings.getString("SessionSettingsFile")); + mode_combo.setCommitCallback(boost::bind(&LLStatusBar::onModeChange, this, getChild("mode_combo")->getValue(), _2)); + + return TRUE; } +void LLStatusBar::onModeChange(const LLSD& original_value, const LLSD& new_value) +{ + if (original_value.asString() != new_value.asString()) + { + LLNotificationsUtil::add("ModeChange", LLSD(), LLSD(), boost::bind(&LLStatusBar::onModeChangeConfirm, this, original_value, new_value, _1, _2)); + } +} + +void LLStatusBar::onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotificationsUtil::getSelectedOption(notification, response); + switch (option) + { + case 0: + gSavedSettings.getControl("SessionSettingsFile")->set(new_value); + LLAppViewer::instance()->forceQuit(); + break; + case 1: + // revert to original value + getChild("mode_combo")->setValue(original_value); + break; + default: + break; + } +} + // Per-frame updates of visibility void LLStatusBar::refresh() { diff --git a/indra/newview/llstatusbar.h b/indra/newview/llstatusbar.h index 4ea3183d18..e1e1f5459b 100644 --- a/indra/newview/llstatusbar.h +++ b/indra/newview/llstatusbar.h @@ -92,6 +92,8 @@ private: void onMouseEnterVolume(); void onMouseEnterNearbyMedia(); void onClickScreen(S32 x, S32 y); + void onModeChange(const LLSD& original_value, const LLSD& new_value); + void onModeChangeConfirm(const LLSD& original_value, const LLSD& new_value, const LLSD& notification, const LLSD& response); static void onClickMediaToggle(void* data); static void onClickBalance(void* data); diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index 0bc1be666e..708f74db21 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -117,16 +117,33 @@ label="Remember password" name="connect_btn" top="35" width="90" /> - + + Mode: + + + + + + width="246">