From 266b3843b75fb9b8da7d2b3c824224a1b94697a5 Mon Sep 17 00:00:00 2001 From: callum Date: Tue, 21 Sep 2010 16:41:06 -0700 Subject: EXP-94 Disable local file system access --- indra/newview/app_settings/settings.xml | 11 ++++ indra/newview/llfilepicker.cpp | 96 +++++++++++++++++++++++++++++++++ indra/newview/llfilepicker.h | 4 ++ 3 files changed, 111 insertions(+) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index feb5ebc16d..b28a02551e 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4537,6 +4537,17 @@ Value 0 + LocalFileSystemBrowsingEnabled + + Comment + Enable/disable access to the local file system via the file picker + Persist + 1 + Type + Boolean + Value + 1 + LoginSRVTimeout Comment diff --git a/indra/newview/llfilepicker.cpp b/indra/newview/llfilepicker.cpp index c14be89641..f0840774bd 100644 --- a/indra/newview/llfilepicker.cpp +++ b/indra/newview/llfilepicker.cpp @@ -33,6 +33,7 @@ #include "lldir.h" #include "llframetimer.h" #include "lltrans.h" +#include "llviewercontrol.h" #include "llwindow.h" // beforeDialog() #if LL_SDL @@ -104,6 +105,20 @@ LLFilePicker::~LLFilePicker() // nothing } +// utility function to check if access to local file system via file browser +// is enabled and if not, tidy up and indicate we're not allowed to do this. +bool LLFilePicker::check_local_file_access_enabled() +{ + // if local file browsing is turned off, return without opening dialog + bool local_file_system_browsing_enabled = gSavedSettings.getBOOL("LocalFileSystemBrowsingEnabled"); + if ( ! local_file_system_browsing_enabled ) + { + mFiles.clear(); + return false; + } + + return true; +} const std::string LLFilePicker::getFirstFile() { @@ -203,6 +218,12 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) } BOOL success = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + // don't provide default file selection mFilesW[0] = '\0'; @@ -241,6 +262,12 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) } BOOL success = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + // don't provide default file selection mFilesW[0] = '\0'; @@ -304,6 +331,12 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) } BOOL success = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + mOFN.lpstrFile = mFilesW; if (!filename.empty()) { @@ -581,6 +614,12 @@ OSStatus LLFilePicker::doNavChooseDialog(ELoadFilter filter) NavDialogRef navRef = NULL; NavReplyRecord navReply; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + memset(&navReply, 0, sizeof(navReply)); // NOTE: we are passing the address of a local variable here. @@ -809,6 +848,12 @@ BOOL LLFilePicker::getOpenFile(ELoadFilter filter) BOOL success = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + OSStatus error = noErr; reset(); @@ -845,6 +890,12 @@ BOOL LLFilePicker::getMultipleOpenFiles(ELoadFilter filter) BOOL success = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + OSStatus error = noErr; reset(); @@ -876,6 +927,12 @@ BOOL LLFilePicker::getSaveFile(ESaveFilter filter, const std::string& filename) BOOL success = FALSE; OSStatus error = noErr; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + reset(); mNavOptions.optionFlags &= ~kNavAllowMultipleFiles; @@ -1100,6 +1157,12 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename { BOOL rtn = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + gViewerWindow->mWindow->beforeDialog(); reset(); @@ -1189,6 +1252,12 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) { BOOL rtn = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + gViewerWindow->mWindow->beforeDialog(); reset(); @@ -1233,6 +1302,12 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter ) { BOOL rtn = FALSE; + // if local file browsing is turned off, return without opening dialog + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + gViewerWindow->mWindow->beforeDialog(); reset(); @@ -1263,6 +1338,13 @@ BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter ) BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename ) { + // if local file browsing is turned off, return without opening dialog + // (Even though this is a stub, I think we still should not return anything at all) + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + reset(); llinfos << "getSaveFile suggested filename is [" << filename @@ -1277,6 +1359,13 @@ BOOL LLFilePicker::getSaveFile( ESaveFilter filter, const std::string& filename BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) { + // if local file browsing is turned off, return without opening dialog + // (Even though this is a stub, I think we still should not return anything at all) + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + reset(); // HACK: Static filenames for 'open' until we implement filepicker @@ -1295,6 +1384,13 @@ BOOL LLFilePicker::getOpenFile( ELoadFilter filter ) BOOL LLFilePicker::getMultipleOpenFiles( ELoadFilter filter ) { + // if local file browsing is turned off, return without opening dialog + // (Even though this is a stub, I think we still should not return anything at all) + if ( check_local_file_access_enabled() == false ) + { + return FALSE; + } + reset(); return FALSE; } diff --git a/indra/newview/llfilepicker.h b/indra/newview/llfilepicker.h index 5819ac4fd8..596bfa3e69 100644 --- a/indra/newview/llfilepicker.h +++ b/indra/newview/llfilepicker.h @@ -140,6 +140,10 @@ private: //FILENAME_BUFFER_SIZE = 65536 FILENAME_BUFFER_SIZE = 65000 }; + + // utility function to check if access to local file system via file browser + // is enabled and if not, tidy up and indicate we're not allowed to do this. + bool check_local_file_access_enabled(); #if LL_WINDOWS OPENFILENAMEW mOFN; // for open and save dialogs -- cgit v1.2.3 From 7648bb425ae106ce0268c7ff535b054de6f6a318 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 12:25:40 -0700 Subject: EXP-111 WIP Automatically provide default responses to all notifications --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index feb5ebc16d..143574264d 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3914,7 +3914,7 @@ Comment Ignore all notifications so we never need user input on them. Persist - 0 + 1 Type Boolean Value -- cgit v1.2.3 From f8a17515f592a1d759ca2c79f80b2ed032af2ebe Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 12:27:26 -0700 Subject: EXP-109 WIP strip down main_view.xml made menu keyboard access only work when menus are visible dummy widgets are now added with a parent view that is invisible popupview can now be default-built --- indra/llui/llmenugl.cpp | 5 ++++- indra/llui/llview.cpp | 22 ++++++------------- indra/llui/llview.h | 14 +++++------- indra/newview/llpopupview.cpp | 3 ++- indra/newview/llpopupview.h | 2 +- indra/newview/llviewerwindow.cpp | 2 +- indra/newview/skins/minimal/xui/en/main_view.xml | 27 ++++++++++++++++++++++++ 7 files changed, 46 insertions(+), 29 deletions(-) create mode 100644 indra/newview/skins/minimal/xui/en/main_view.xml (limited to 'indra') diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 900a814238..e179f63ee5 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -3066,7 +3066,10 @@ BOOL LLMenuBarGL::handleAcceleratorKey(KEY key, MASK mask) mAltKeyTrigger = FALSE; } - if(!result && (key == KEY_F10 && mask == MASK_CONTROL) && !gKeyboard->getKeyRepeated(key)) + if(!result + && (key == KEY_F10 && mask == MASK_CONTROL) + && !gKeyboard->getKeyRepeated(key) + && isInVisibleChain()) { if (getHighlightedItem()) { diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 3fa86bf0ca..6ac009956d 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -163,8 +163,6 @@ LLView::~LLView() if (mDefaultWidgets) { - std::for_each(mDefaultWidgets->begin(), mDefaultWidgets->end(), - DeletePairedPointer()); delete mDefaultWidgets; mDefaultWidgets = NULL; } @@ -1682,18 +1680,7 @@ BOOL LLView::hasChild(const std::string& childname, BOOL recurse) const //----------------------------------------------------------------------------- LLView* LLView::getChildView(const std::string& name, BOOL recurse) const { - LLView* child = findChildView(name, recurse); - if (!child) - { - child = getDefaultWidget(name); - if (!child) - { - LLView::Params view_params; - view_params.name = name; - child = LLUICtrlFactory::create(view_params); - } - } - return child; + return getChild(name, recurse); } static LLFastTimer::DeclareTimer FTM_FIND_VIEWS("Find Widgets"); @@ -2804,11 +2791,14 @@ LLView::root_to_view_iterator_t LLView::endRootToView() // only create maps on demand, as they incur heap allocation/deallocation cost // when a view is constructed/deconstructed -LLView::default_widget_map_t& LLView::getDefaultWidgetMap() const +LLView& LLView::getDefaultWidgetContainer() const { if (!mDefaultWidgets) { - mDefaultWidgets = new default_widget_map_t(); + LLView::Params p; + p.name = "default widget container"; + p.visible = false; // ensures default widgets can't steal focus, etc. + mDefaultWidgets = new LLView(p); } return *mDefaultWidgets; } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index 6bcee98f26..e6e0a41962 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -461,12 +461,8 @@ public: template T* getDefaultWidget(const std::string& name) const { - default_widget_map_t::const_iterator found_it = getDefaultWidgetMap().find(name); - if (found_it == getDefaultWidgetMap().end()) - { - return NULL; - } - return dynamic_cast(found_it->second); + LLView* widgetp = getDefaultWidgetContainer().findChildView(name); + return dynamic_cast(widgetp); } ////////////////////////////////////////////// @@ -580,9 +576,9 @@ private: typedef std::map default_widget_map_t; // allocate this map no demand, as it is rarely needed - mutable default_widget_map_t* mDefaultWidgets; + mutable LLView* mDefaultWidgets; - default_widget_map_t& getDefaultWidgetMap() const; + LLView& getDefaultWidgetContainer() const; public: // Depth in view hierarchy during rendering @@ -649,7 +645,7 @@ template T* LLView::getChild(const std::string& name, BOOL recurse) co return NULL; } - getDefaultWidgetMap()[name] = result; + getDefaultWidgetContainer().addChild(result); } } return result; diff --git a/indra/newview/llpopupview.cpp b/indra/newview/llpopupview.cpp index 499b6a8f5f..18035c42f4 100644 --- a/indra/newview/llpopupview.cpp +++ b/indra/newview/llpopupview.cpp @@ -40,7 +40,8 @@ bool view_visible(LLView* viewp) } -LLPopupView::LLPopupView() +LLPopupView::LLPopupView(const LLPopupView::Params& p) +: LLPanel(p) { // register ourself as handler of UI popups LLUI::setPopupFuncs(boost::bind(&LLPopupView::addPopup, this, _1), boost::bind(&LLPopupView::removePopup, this, _1), boost::bind(&LLPopupView::clearPopups, this)); diff --git a/indra/newview/llpopupview.h b/indra/newview/llpopupview.h index fec4afd79c..b378f61984 100644 --- a/indra/newview/llpopupview.h +++ b/indra/newview/llpopupview.h @@ -32,7 +32,7 @@ class LLPopupView : public LLPanel { public: - LLPopupView(); + LLPopupView(const Params& p = LLPanel::Params()); ~LLPopupView(); /*virtual*/ void draw(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 7f8b7fba9f..19f51b2bbe 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1524,7 +1524,7 @@ void LLViewerWindow::initBase() mWorldViewPlaceholder = main_view->getChildView("world_view_rect")->getHandle(); mNonSideTrayView = main_view->getChildView("non_side_tray_view")->getHandle(); mFloaterViewHolder = main_view->getChildView("floater_view_holder")->getHandle(); - mPopupView = main_view->findChild("popup_holder"); + mPopupView = main_view->getChild("popup_holder"); mHintHolder = main_view->getChild("hint_holder")->getHandle(); // Constrain floaters to inside the menu and status bar regions. diff --git a/indra/newview/skins/minimal/xui/en/main_view.xml b/indra/newview/skins/minimal/xui/en/main_view.xml new file mode 100644 index 0000000000..c793b1b813 --- /dev/null +++ b/indra/newview/skins/minimal/xui/en/main_view.xml @@ -0,0 +1,27 @@ + + + + + -- cgit v1.2.3 From aa7d505882f07cffea8b7cd145296f3c114c3f50 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 12:27:48 -0700 Subject: EXP-108 FIX Create new "minimal" UI skin --- indra/newview/llappviewer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 333c92e50d..1fd3632b85 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2182,8 +2182,8 @@ bool LLAppViewer::initConfiguration() if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) { // hack to force the skin to default. - //gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); - gDirUtilp->setSkinFolder("default"); + gDirUtilp->setSkinFolder(skinfolder->getValue().asString()); + //gDirUtilp->setSkinFolder("default"); } mYieldTime = gSavedSettings.getS32("YieldTime"); -- cgit v1.2.3 From 18404624e0c9c2544b0ebba2b9758a606d2fe574 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 15:02:23 -0700 Subject: support older use of "IgnoreAllNotifications" by command line option "nonotifications" such that value isn't saved --- indra/newview/llappviewer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 1fd3632b85..02a8c3e674 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2135,7 +2135,7 @@ bool LLAppViewer::initConfiguration() if (clp.hasOption("nonotifications")) { - gSavedSettings.setBOOL("IgnoreAllNotifications", TRUE); + gSavedSettings.getControl("IgnoreAllNotifications")->setValue(true, false); } if (clp.hasOption("debugsession")) -- cgit v1.2.3 From 636c86782b9c8a37996aaf01868f713214c54584 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Sep 2010 16:12:04 -0700 Subject: cleaned up notifications.xml and made global notifications toggle not use or modify saved responses --- indra/llui/llnotifications.cpp | 28 ++++++++++---- indra/newview/app_settings/cmd_line.xml | 2 +- .../newview/skins/default/xui/en/notifications.xml | 44 +++++----------------- 3 files changed, 30 insertions(+), 44 deletions(-) (limited to 'indra') diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index ab9bd12b85..d86b0183fc 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -133,12 +133,6 @@ private: bool filterIgnoredNotifications(LLNotificationPtr notification) { - // filter everything if we are to ignore ALL - if(LLNotifications::instance().getIgnoreAllNotifications()) - { - return false; - } - LLNotificationFormPtr form = notification->getForm(); // Check to see if the user wants to ignore this alert return !notification->getForm()->getIgnored(); @@ -173,6 +167,20 @@ bool handleIgnoredNotification(const LLSD& payload) return false; } +bool defaultResponse(const LLSD& payload) +{ + if (payload["sigtype"].asString() == "add") + { + LLNotificationPtr pNotif = LLNotifications::instance().find(payload["id"].asUUID()); + if (pNotif) + { + // supply default response + pNotif->respond(pNotif->getResponseTemplate(LLNotification::WITH_DEFAULT_BUTTON)); + } + } + return false; +} + namespace LLNotificationFilters { // a sample filter @@ -1187,9 +1195,11 @@ void LLNotifications::createDefaultChannels() { // now construct the various channels AFTER loading the notifications, // because the history channel is going to rewrite the stored notifications file - LLNotificationChannel::buildChannel("Expiration", "", + LLNotificationChannel::buildChannel("Enabled", "", + !boost::bind(&LLNotifications::getIgnoreAllNotifications, this)); + LLNotificationChannel::buildChannel("Expiration", "Enabled", boost::bind(&LLNotifications::expirationFilter, this, _1)); - LLNotificationChannel::buildChannel("Unexpired", "", + LLNotificationChannel::buildChannel("Unexpired", "Enabled", !boost::bind(&LLNotifications::expirationFilter, this, _1)); // use negated bind LLNotificationChannel::buildChannel("Unique", "Unexpired", boost::bind(&LLNotifications::uniqueFilter, this, _1)); @@ -1203,6 +1213,8 @@ void LLNotifications::createDefaultChannels() new LLPersistentNotificationChannel(); // connect action methods to these channels + LLNotifications::instance().getChannel("Enabled")-> + connectFailedFilter(&defaultResponse); LLNotifications::instance().getChannel("Expiration")-> connectChanged(boost::bind(&LLNotifications::expirationHandler, this, _1)); // uniqueHandler slot should be added as first slot of the signal due to diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 00d69f805e..962c4e9d36 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -149,7 +149,7 @@ nonotifications desc - User will not get any notifications. NOTE: All notifications that occur will get added to ignore file for future runs. + User will not get any notifications. map-to IgnoreAllNotifications diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e1aecda151..5966db9d51 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2069,7 +2069,7 @@ Would you be my friend? - - + height="15" + label="Show Developer Menu" + layout="topleft" + left="30" + name="show_develop_menu_check" + top_pad="5" + width="237"/> diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml index 31e160ec33..a1082d9c32 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml @@ -23,7 +23,7 @@ height="30" layout="topleft" left="40" - control_name="ChatFontSize" + control_name="ChatFontSize" name="chat_font_size" top_pad="0" width="440"> @@ -55,259 +55,7 @@ top_delta="0" width="125" /> - - - Font colors: - - - - - - - - Me - - - - - - - Others - - - - - - - IM - - - - - - - System - - - - - - - Errors - - - - - - - Objects - - - - - - - Owner - - - - - - - URLs - + + + top_pad="15"> Show IMs in: + width="130" + text_color="White_25"> (requires restart) + width="150"> + + Enable incoming chat popups: + + + + + + - + \ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 392d50fc42..36f8f99178 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -106,7 +106,7 @@ height="15" layout="topleft" left="30" - top_pad="14" + top_pad="8" name="maturity_desired_prompt" width="200"> I want to access content rated: @@ -177,7 +177,7 @@ layout="topleft" left="30" name="start_location_textbox" - top_pad="15" + top_pad="8" width="394"> Start location: @@ -216,7 +216,7 @@ layout="topleft" left="30" name="name_tags_textbox" - top_pad="14" + top_pad="10" width="400"> Name tags: @@ -224,8 +224,8 @@ control_name="AvatarNameTagMode" height="20" layout="topleft" - left="50" - top_pad="5" + left="35" + top_pad="0" name="Name_Tag_Preference"> @@ -281,72 +281,103 @@ height="16" label="Group titles" layout="topleft" - left="70" + left="35" width="100" name="show_all_title_checkbox1" tool_tip="Show group titles, like Officer or Member" - top_pad="5" /> - - + - + left_pad="50" + name="show_friends" + tool_tip="Highlight the name tags of your friends"/> + + + + + + Pressing letter keys: + + + + + + - My effects: - - - Away timeout: + name="title_afk_text" + top_pad="4" + width="190"> + Away timeout: - - - - + height="23" + layout="topleft" + control_name="AFKTimeout" + left="30" + label="Away timeout:" + top_pad="2" + name="afk" + width="130"> - left="30" mouse_opaque="false" name="text_box3" - top_pad="10" + top_pad="5" width="240"> Busy mode response: @@ -399,11 +419,11 @@ top_pad="20"/> use_ellipses="false" commit_on_focus_lost = "true" follows="left|top" - height="42" + height="29" layout="topleft" left="50" name="busy_response" - width="450" + width="470" word_wrap="true"> log_in_to_change diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index 7d49a671e6..3ceee60927 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -163,536 +163,546 @@ top="76" width="485"> + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="5" + name="ShadersText" + top="3" + width="128"> Shaders: + control_name="RenderTransparentWater" + height="16" + initial_value="true" + label="Transparent Water" + layout="topleft" + left_delta="0" + name="BumpShiny" + top_pad="7" + width="256" /> + control_name="RenderObjectBump" + height="16" + initial_value="true" + label="Bump mapping and shiny" + layout="topleft" + left_delta="0" + name="BumpShiny" + top_pad="1" + width="256" /> + + function="Pref.VertexShaderEnable" /> + control_name="WindLightUseAtmosShaders" + height="16" + initial_value="true" + label="Atmospheric shaders" + layout="topleft" + left_delta="0" + name="WindLightUseAtmosShaders" + top_pad="1" + width="256"> + function="Pref.VertexShaderEnable" /> - - Water Reflections: - - - - - - - - + + Water Reflections: + + + + + + + + + control_name="RenderFarClip" + decimal_digits="0" + follows="left|top" + height="16" + increment="8" + initial_value="160" + label="Draw distance:" + label_width="185" + layout="topleft" + left="200" + max_val="512" + min_val="64" + name="DrawDistance" + top="3" + width="296" /> + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="291" + name="DrawDistanceMeterText2" + top_delta="0" + width="128"> m - + control_name="RenderMaxPartCount" + decimal_digits="0" + follows="left|top" + height="16" + increment="256" + initial_value="4096" + label="Max. particle count:" + label_width="185" + layout="topleft" + left="200" + max_val="8192" + name="MaxParticleCount" + top_pad="7" + width="303" /> + + control_name="RenderGlowResolutionPow" + decimal_digits="0" + follows="left|top" + height="16" + increment="1" + initial_value="8" + label="Post process quality:" + label_width="185" + layout="topleft" + left="200" + max_val="9" + min_val="8" + name="RenderPostProcess" + show_text="false" + top_pad="4" + width="264"> + function="Pref.UpdateSliderText" + parameter="PostProcessText" /> + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="MeshDetailText" + top_pad="5" + width="128"> Mesh detail: + control_name="RenderVolumeLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Objects:" + label_width="185" + layout="topleft" + left_delta="0" + max_val="2" + name="ObjectMeshDetail" + show_text="false" + top_pad="6" + width="264"> + function="Pref.UpdateSliderText" + parameter="ObjectMeshDetailText" /> + control_name="RenderFlexTimeFactor" + follows="left|top" + height="16" + initial_value="160" + label=" Flexiprims:" + label_width="185" + layout="topleft" + left_delta="0" + name="FlexibleMeshDetail" + show_text="false" + top_pad="4" + width="264"> + function="Pref.UpdateSliderText" + parameter="FlexibleMeshDetailText" /> - - + control_name="RenderTreeLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Trees:" + label_width="185" + layout="topleft" + left_delta="0" + name="TreeMeshDetail" + show_text="false" + top_pad="4" + width="264"> + + - + control_name="RenderAvatarLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Avatars:" + label_width="185" + layout="topleft" + left_delta="0" + name="AvatarMeshDetail" + show_text="false" + top_pad="4" + width="264"> + - + control_name="RenderTerrainLODFactor" + follows="left|top" + height="16" + increment="0.125" + initial_value="160" + label=" Terrain:" + label_width="185" + layout="topleft" + left_delta="0" + max_val="2" + min_val="1" + name="TerrainMeshDetail" + show_text="false" + top_pad="4" + width="264"> + - + control_name="WLSkyDetail" + enabled_control="WindLightUseAtmosShaders" + decimal_digits="0" + follows="left|top" + height="16" + increment="8" + initial_value="160" + label=" Sky:" + label_width="185" + layout="topleft" + left_delta="0" + max_val="128" + min_val="16" + name="SkyMeshDetail" + show_text="false" + top_pad="4" + width="264"> + - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left="469" + name="PostProcessText" + top="60" + width="128"> + Low - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="ObjectMeshDetailText" + top_pad="26" + width="128"> + Low - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="FlexibleMeshDetailText" + top_pad="8" + width="128"> + Low - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="TreeMeshDetailText" + top_pad="8" + width="128"> + Low - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="AvatarMeshDetailText" + top_pad="8" + width="128"> + Low - Low + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="TerrainMeshDetailText" + top_pad="8" + width="128"> + Low - Low + enabled_control="WindLightUseAtmosShaders" + type="string" + length="1" + follows="left|top" + height="12" + layout="topleft" + left_delta="0" + name="SkyMeshDetailText" + top_pad="8" + width="128"> + Low - - Avatar rendering: + + Avatar rendering: + control_name="RenderUseImpostors" + height="16" + initial_value="true" + label="Avatar impostors" + layout="topleft" + left_delta="0" + name="AvatarImpostors" + top_pad="7" + width="256" /> - + control_name="RenderAvatarVP" + height="16" + initial_value="true" + label="Hardware skinning" + layout="topleft" + left_delta="0" + name="AvatarVertexProgram" + top_pad="1" + width="256"> + - - Terrain detail: - - - - - --> + control_name="RenderAvatarCloth" + height="16" + initial_value="true" + label="Avatar cloth" + layout="topleft" + left_delta="0" + name="AvatarCloth" + top_pad="1" + width="256" /> + + Terrain detail: + + + + + --> - diff --git a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml index 4ebd4c76f8..2ddb81559f 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_privacy.xml @@ -47,7 +47,7 @@ layout="topleft" left="30" name="online_visibility" - top_pad="20" + top_pad="30" width="350" /> - Logs: + Chat Logs: - + Location of logs: @@ -160,11 +170,25 @@ layout="topleft" left="30" name="block_list" - top_pad="20" + top_pad="35" width="145"> + + (People and/or Objects you have blocked) + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 140d16e37f..584bd1ea9d 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -9,51 +9,6 @@ name="Input panel" top="1" width="517"> - - Mouselook: - - - Mouse sensitivity - - - Network: @@ -187,7 +142,7 @@ layout="topleft" left="80" name="Cache location" - top_delta="20" + top_delta="40" width="300"> Cache location: @@ -386,4 +341,20 @@ name="web_proxy_port" top_delta="0" width="145" /> + + + 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 aa760edad3..da366f30ae 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -9,6 +9,10 @@ name="Preference Media panel" top="1" width="517"> + + Middle Mouse + - + left="25" + width="230"/> + width="180" + top_pad="7"> Voice Chat Settings + width="112"> Listen from: + top_delta="0" /> + + + + + @@ -396,14 +465,14 @@ visiblity_control="ShowDeviceSettings" border="false" follows="top|left" - height="120" + height="100" label="Device Settings" layout="topleft" - left="0" + left_delta="-2" name="device_settings_panel" class="panel_voice_device_settings" - width="501" - top="285"> + width="470" + top_pad="0"> Default @@ -419,7 +488,7 @@ + width="70"> Input My volume: @@ -465,11 +534,11 @@ increment="0.025" initial_value="1.0" layout="topleft" - left="160" + left_delta="-6" max_val="2" name="mic_volume_slider" tool_tip="Change the volume using this slider" - top_pad="-2" + top_pad="-1" width="220" /> Please wait @@ -489,7 +558,7 @@ layout="topleft" left_delta="0" name="bar0" - top_delta="0" + top_delta="-2" width="20" /> + width="70"> Output 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 index b25fd695c9..273c252474 100644 --- a/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml +++ b/indra/newview/skins/default/xui/en/panel_prim_media_controls.xml @@ -319,7 +319,7 @@ min_width="90"> @@ -178,4 +179,13 @@ right="487" name="Save_btn" width="81" /> + + \ No newline at end of file -- cgit v1.2.3 From fc10106f9f5248f043f9abb334ae0a12141b6452 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Wed, 24 Nov 2010 14:21:36 -0800 Subject: CT-633 FIX DA translation for set19, for Viewer 2.4; STORM-531 FIX --- .../skins/default/xui/da/floater_avatar_picker.xml | 8 ++ .../newview/skins/default/xui/da/floater_bumps.xml | 4 +- .../skins/default/xui/da/floater_buy_object.xml | 37 +++--- .../newview/skins/default/xui/da/floater_event.xml | 45 ++----- .../skins/default/xui/da/floater_incoming_call.xml | 2 +- indra/newview/skins/default/xui/da/floater_pay.xml | 2 +- .../newview/skins/default/xui/da/floater_tools.xml | 4 +- .../default/xui/da/floater_voice_controls.xml | 4 +- .../skins/default/xui/da/inspect_avatar.xml | 5 + indra/newview/skins/default/xui/da/menu_viewer.xml | 6 +- .../newview/skins/default/xui/da/notifications.xml | 148 ++++++++++++++++----- .../skins/default/xui/da/panel_edit_profile.xml | 10 +- .../default/xui/da/panel_group_land_money.xml | 1 + indra/newview/skins/default/xui/da/panel_login.xml | 4 +- .../skins/default/xui/da/panel_place_profile.xml | 3 +- .../default/xui/da/panel_preferences_general.xml | 8 +- .../default/xui/da/panel_preferences_setup.xml | 10 +- .../skins/default/xui/da/panel_profile_view.xml | 8 +- .../newview/skins/default/xui/da/role_actions.xml | 91 ++++++------- indra/newview/skins/default/xui/da/strings.xml | 22 ++- 20 files changed, 265 insertions(+), 157 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/da/floater_avatar_picker.xml b/indra/newview/skins/default/xui/da/floater_avatar_picker.xml index a337da9b51..e97089f61e 100644 --- a/indra/newview/skins/default/xui/da/floater_avatar_picker.xml +++ b/indra/newview/skins/default/xui/da/floater_avatar_picker.xml @@ -24,6 +24,10 @@ Indtast en del af beboerens navn: + + + + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 4f982cc8e9..2f47d4e201 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -182,6 +182,13 @@ function="Advanced.WebBrowserTest" parameter="http://join.secondlife.com/"/> + + + - + + + Date: Wed, 1 Dec 2010 14:42:12 -0800 Subject: download progress events. --- indra/newview/llappviewer.cpp | 1 - .../updater/llupdatedownloader.cpp | 44 ++++++++++++++++++++++ indra/viewer_components/updater/llupdaterservice.h | 3 +- 3 files changed, 46 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index b6f52e3e15..aa20ff55b6 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2402,7 +2402,6 @@ namespace { LLNotificationsUtil::add("FailedUpdateInstall"); break; default: - llinfos << "unhandled update event " << evt << llendl; break; } diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index c17a50e242..7b0f960ce4 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -29,6 +29,7 @@ #include #include #include "lldir.h" +#include "llevents.h" #include "llfile.h" #include "llmd5.h" #include "llsd.h" @@ -49,6 +50,7 @@ public: bool isDownloading(void); size_t onHeader(void * header, size_t size); size_t onBody(void * header, size_t size); + int onProgress(double downloadSize, double bytesDownloaded); void resume(void); private: @@ -57,6 +59,7 @@ private: CURL * mCurl; LLSD mDownloadData; llofstream mDownloadStream; + unsigned char mDownloadPercent; std::string mDownloadRecordPath; curl_slist * mHeaderList; @@ -149,6 +152,17 @@ namespace { size_t bytes = blockSize * blocks; return reinterpret_cast(downloader)->onHeader(data, bytes); } + + + int progress_callback(void * downloader, + double dowloadTotal, + double downloadNow, + double uploadTotal, + double uploadNow) + { + return reinterpret_cast(downloader)-> + onProgress(dowloadTotal, downloadNow); + } } @@ -157,6 +171,7 @@ LLUpdateDownloader::Implementation::Implementation(LLUpdateDownloader::Client & mCancelled(false), mClient(client), mCurl(0), + mDownloadPercent(0), mHeaderList(0) { CURLcode code = curl_global_init(CURL_GLOBAL_ALL); // Just in case. @@ -290,6 +305,30 @@ size_t LLUpdateDownloader::Implementation::onBody(void * buffer, size_t size) } +int LLUpdateDownloader::Implementation::onProgress(double downloadSize, double bytesDownloaded) +{ + int downloadPercent = static_cast(100. * (bytesDownloaded / downloadSize)); + if(downloadPercent > mDownloadPercent) { + mDownloadPercent = downloadPercent; + + LLSD event; + event["pump"] = LLUpdaterService::pumpName(); + LLSD payload; + payload["type"] = LLSD(LLUpdaterService::PROGRESS); + payload["download_size"] = downloadSize; + payload["bytes_downloaded"] = bytesDownloaded; + event["payload"] = payload; + LLEventPumps::instance().obtain("mainlooprepeater").post(event); + + LL_INFOS("UpdateDownload") << "progress event " << payload << LL_ENDL; + } else { + ; // Keep events to a reasonalbe number. + } + + return 0; +} + + void LLUpdateDownloader::Implementation::run(void) { CURLcode code = curl_easy_perform(mCurl); @@ -343,6 +382,11 @@ void LLUpdateDownloader::Implementation::initializeCurlGet(std::string const & u } throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_HTTPGET, true)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_URL, url.c_str())); + throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_PROGRESSFUNCTION, &progress_callback)); + throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_PROGRESSDATA, this)); + throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_NOPROGRESS, false)); + + mDownloadPercent = 0; } diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 752a6f834b..1266bcae08 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -48,7 +48,8 @@ public: INVALID, DOWNLOAD_COMPLETE, DOWNLOAD_ERROR, - INSTALL_ERROR + INSTALL_ERROR, + PROGRESS }; LLUpdaterService(); -- cgit v1.2.3 From 765d939956a0c1f67029d44fd29770aabc36d9b4 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 1 Dec 2010 15:51:10 -0800 Subject: state change events for updater service. --- .../viewer_components/updater/llupdaterservice.cpp | 62 +++++++++++++++++++++- indra/viewer_components/updater/llupdaterservice.h | 16 +++++- 2 files changed, 75 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index cc60eaead2..cfda314d43 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -98,6 +98,8 @@ class LLUpdaterServiceImpl : LLUpdaterService::app_exit_callback_t mAppExitCallback; + LLUpdaterService::eUpdaterState mState; + LOG_CLASS(LLUpdaterServiceImpl); public: @@ -115,6 +117,7 @@ public: void startChecking(bool install_if_ready); void stopChecking(); bool isChecking(); + LLUpdaterService::eUpdaterState getState(); void setAppExitCallback(LLUpdaterService::app_exit_callback_t aecb) { mAppExitCallback = aecb;} @@ -139,6 +142,7 @@ public: private: void restartTimer(unsigned int seconds); + void setState(LLUpdaterService::eUpdaterState state); void stopTimer(); }; @@ -149,7 +153,8 @@ LLUpdaterServiceImpl::LLUpdaterServiceImpl() : mIsDownloading(false), mCheckPeriod(0), mUpdateChecker(*this), - mUpdateDownloader(*this) + mUpdateDownloader(*this), + mState(LLUpdaterService::INITIAL) { } @@ -201,10 +206,16 @@ void LLUpdaterServiceImpl::startChecking(bool install_if_ready) if(!mIsDownloading) { + setState(LLUpdaterService::CHECKING_FOR_UPDATE); + // Checking can only occur during the mainloop. // reset the timer to 0 so that the next mainloop event // triggers a check; restartTimer(0); + } + else + { + setState(LLUpdaterService::DOWNLOADING); } } } @@ -222,6 +233,8 @@ void LLUpdaterServiceImpl::stopChecking() mUpdateDownloader.cancel(); mIsDownloading = false; } + + setState(LLUpdaterService::TERMINAL); } bool LLUpdaterServiceImpl::isChecking() @@ -229,6 +242,11 @@ bool LLUpdaterServiceImpl::isChecking() return mIsChecking; } +LLUpdaterService::eUpdaterState LLUpdaterServiceImpl::getState() +{ + return mState; +} + bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) { bool foundInstall = false; // return true if install is found. @@ -266,6 +284,8 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) { if(launchInstaller) { + setState(LLUpdaterService::INSTALLING); + LLFile::remove(update_marker_path()); int result = ll_install_update(install_script_path(), @@ -335,6 +355,8 @@ void LLUpdaterServiceImpl::optionalUpdate(std::string const & newVersion, stopTimer(); mIsDownloading = true; mUpdateDownloader.download(uri, hash); + + setState(LLUpdaterService::DOWNLOADING); } void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, @@ -344,6 +366,8 @@ void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, stopTimer(); mIsDownloading = true; mUpdateDownloader.download(uri, hash); + + setState(LLUpdaterService::DOWNLOADING); } void LLUpdaterServiceImpl::upToDate(void) @@ -352,6 +376,8 @@ void LLUpdaterServiceImpl::upToDate(void) { restartTimer(mCheckPeriod); } + + setState(LLUpdaterService::UP_TO_DATE); } void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) @@ -369,6 +395,8 @@ void LLUpdaterServiceImpl::downloadComplete(LLSD const & data) payload["type"] = LLSD(LLUpdaterService::DOWNLOAD_COMPLETE); event["payload"] = payload; LLEventPumps::instance().obtain("mainlooprepeater").post(event); + + setState(LLUpdaterService::TERMINAL); } void LLUpdaterServiceImpl::downloadError(std::string const & message) @@ -390,6 +418,8 @@ void LLUpdaterServiceImpl::downloadError(std::string const & message) payload["message"] = message; event["payload"] = payload; LLEventPumps::instance().obtain("mainlooprepeater").post(event); + + setState(LLUpdaterService::ERROR); } void LLUpdaterServiceImpl::restartTimer(unsigned int seconds) @@ -402,6 +432,28 @@ void LLUpdaterServiceImpl::restartTimer(unsigned int seconds) sListenerName, boost::bind(&LLUpdaterServiceImpl::onMainLoop, this, _1)); } +void LLUpdaterServiceImpl::setState(LLUpdaterService::eUpdaterState state) +{ + if(state != mState) + { + mState = state; + + LLSD event; + event["pump"] = LLUpdaterService::pumpName(); + LLSD payload; + payload["type"] = LLSD(LLUpdaterService::STATE_CHANGE); + payload["state"] = state; + event["payload"] = payload; + LLEventPumps::instance().obtain("mainlooprepeater").post(event); + + LL_INFOS("UpdaterService") << "setting state to " << state << LL_ENDL; + } + else + { + ; // State unchanged; noop. + } +} + void LLUpdaterServiceImpl::stopTimer() { mTimer.stop(); @@ -425,10 +477,13 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) LLSD event; event["type"] = LLSD(LLUpdaterService::INSTALL_ERROR); LLEventPumps::instance().obtain(LLUpdaterService::pumpName()).post(event); + + setState(LLUpdaterService::TERMINAL); } else { mUpdateChecker.check(mProtocolVersion, mUrl, mPath, mChannel, mVersion); + setState(LLUpdaterService::CHECKING_FOR_UPDATE); } } else @@ -496,6 +551,11 @@ bool LLUpdaterService::isChecking() return mImpl->isChecking(); } +LLUpdaterService::eUpdaterState LLUpdaterService::getState() +{ + return mImpl->getState(); +} + void LLUpdaterService::setImplAppExitCallback(LLUpdaterService::app_exit_callback_t aecb) { return mImpl->setAppExitCallback(aecb); diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 1266bcae08..6ee7060d28 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -44,12 +44,23 @@ public: static std::string const & pumpName(void); // Type codes for events posted by this service. Stored the event's 'type' element. - enum eUpdateEvent { + enum eUpdaterEvent { INVALID, DOWNLOAD_COMPLETE, DOWNLOAD_ERROR, INSTALL_ERROR, - PROGRESS + PROGRESS, + STATE_CHANGE + }; + + enum eUpdaterState { + INITIAL, + CHECKING_FOR_UPDATE, + DOWNLOADING, + INSTALLING, + UP_TO_DATE, + TERMINAL, + ERROR }; LLUpdaterService(); @@ -66,6 +77,7 @@ public: void startChecking(bool install_if_ready = false); void stopChecking(); bool isChecking(); + eUpdaterState getState(); typedef boost::function app_exit_callback_t; template -- cgit v1.2.3 From a2420db5b3b2ed216bcb3f08fce95a05ee7e6dd5 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 1 Dec 2010 16:40:40 -0800 Subject: SOCIAL-249 FIX pressing any of the Alt keys and 0-9 will output the number and symbol instead of just symbol The issue seems to be Mac-only, so I've put the fix inside #if LL_DARWIN. Windows' handling of ALT is very different, so the fix might not be appropriate there. --- indra/llplugin/llpluginclassmedia.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 61d779b98d..e514b5abbe 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -522,7 +522,15 @@ bool LLPluginClassMedia::keyEvent(EKeyEventType type, int key_code, MASK modifie } break; } - + +#if LL_DARWIN + if(modifiers & MASK_ALT) + { + // Option-key modified characters should be handled by the unicode input path instead of this one. + result = false; + } +#endif + if(result) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "key_event"); -- cgit v1.2.3 From 880110eb9303ecb4426e6d3598075c4c12280061 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Wed, 1 Dec 2010 18:15:59 -0800 Subject: OCIAL-231 FIX Enable tooltips (for links and images) Added the necessary plumbing to get link_hovered events from the webkit plugin through to the viewer UI. This requires a llqtwebkit library built from revision 1799a899e06d or later in http://hg.secondlife.com/llqtwebkit to function. The viewer source changes are backwards-compatible with earlier versions of llqtwebkit, it just won't see any link_hovered events with previous revisions. Reviewed by Callum. --- indra/llplugin/llpluginclassmedia.cpp | 9 ++++ indra/llplugin/llpluginclassmedia.h | 4 ++ indra/llplugin/llpluginclassmediaowner.h | 4 +- indra/media_plugins/webkit/media_plugin_webkit.cpp | 14 +++++++ indra/newview/llmediactrl.cpp | 48 +++++++++++++++++++++- indra/newview/llmediactrl.h | 2 + indra/newview/llviewerparcelmedia.cpp | 6 +++ indra/test_apps/llplugintest/llmediaplugintest.cpp | 6 +++ 8 files changed, 90 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e514b5abbe..de4456aa4e 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1047,6 +1047,15 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_GEOMETRY_CHANGE); } + else if(message_name == "link_hovered") + { + // Link and text are not currently used -- the tooltip hover text is taken from the "title". + // message.getValue("link"); + mHoverText = message.getValue("title"); + // message.getValue("text"); + + mediaEvent(LLPluginClassMediaOwner::MEDIA_EVENT_LINK_HOVERED); + } else { LL_WARNS("Plugin") << "Unknown " << message_name << " class message: " << message_name << LL_ENDL; diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index 3720455431..fa4dc2b43f 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -242,6 +242,9 @@ public: std::string getAuthURL() const { return mAuthURL; }; std::string getAuthRealm() const { return mAuthRealm; }; + // This is valid during MEDIA_EVENT_LINK_HOVERED + std::string getHoverText() const { return mHoverText; }; + std::string getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -381,6 +384,7 @@ protected: S32 mGeometryHeight; std::string mAuthURL; std::string mAuthRealm; + std::string mHoverText; ///////////////////////////////////////// // media_time class diff --git a/indra/llplugin/llpluginclassmediaowner.h b/indra/llplugin/llpluginclassmediaowner.h index 42a89baebc..42e93cc6d7 100644 --- a/indra/llplugin/llpluginclassmediaowner.h +++ b/indra/llplugin/llpluginclassmediaowner.h @@ -61,7 +61,9 @@ public: MEDIA_EVENT_PLUGIN_FAILED_LAUNCH, // The plugin failed to launch MEDIA_EVENT_PLUGIN_FAILED, // The plugin died unexpectedly - MEDIA_EVENT_AUTH_REQUEST // The plugin wants to display an auth dialog + MEDIA_EVENT_AUTH_REQUEST, // The plugin wants to display an auth dialog + + 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 8b70c15b27..1666f877e9 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -605,6 +605,20 @@ private: mAuthPassword = message.getValue("password"); } } + + //////////////////////////////////////////////////////////////////////////////// + // virtual + void onLinkHovered(const EventType& event) + { + if(mInitState >= INIT_STATE_NAVIGATE_COMPLETE) + { + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "link_hovered"); + message.setValue("link", event.getEventUri()); + message.setValue("title", event.getStringValue()); + message.setValue("text", event.getStringValue2()); + sendMessage(message); + } + } LLQtWebKit::EKeyboardModifier decodeModifiers(std::string &modifiers) { diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 54c7d361b7..08d07f9540 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -25,7 +25,7 @@ */ #include "llviewerprecompiledheaders.h" - +#include "lltooltip.h" #include "llmediactrl.h" @@ -351,7 +351,8 @@ LLMediaCtrl::LLMediaCtrl( const Params& p) : mClearCache(false), mHomePageMimeType(p.initial_mime_type), mTrusted(p.trusted_content), - mWindowShade(NULL) + mWindowShade(NULL), + mHoverTextChanged(false) { { LLColor4 color = p.caret_color().get(); @@ -433,6 +434,13 @@ BOOL LLMediaCtrl::handleHover( S32 x, S32 y, MASK mask ) mMediaSource->mouseMove(x, y, mask); gViewerWindow->setCursor(mMediaSource->getLastSetCursor()); } + + // TODO: Is this the right way to handle hover text changes driven by the plugin? + if(mHoverTextChanged) + { + mHoverTextChanged = false; + handleToolTip(x, y, mask); + } return TRUE; } @@ -448,6 +456,35 @@ BOOL LLMediaCtrl::handleScrollWheel( S32 x, S32 y, S32 clicks ) return TRUE; } +//////////////////////////////////////////////////////////////////////////////// +// virtual +BOOL LLMediaCtrl::handleToolTip(S32 x, S32 y, MASK mask) +{ + std::string hover_text; + + if (mMediaSource && mMediaSource->hasMedia()) + hover_text = mMediaSource->getMediaPlugin()->getHoverText(); + + if(hover_text.empty()) + { + return FALSE; + } + else + { + S32 screen_x, screen_y; + + localPointToScreen(x, y, &screen_x, &screen_y); + LLRect sticky_rect_screen; + sticky_rect_screen.setCenterAndSize(screen_x, screen_y, 20, 20); + + LLToolTipMgr::instance().show(LLToolTip::Params() + .message(hover_text) + .sticky_rect(sticky_rect_screen)); + } + + return TRUE; +} + //////////////////////////////////////////////////////////////////////////////// // BOOL LLMediaCtrl::handleMouseUp( S32 x, S32 y, MASK mask ) @@ -1270,6 +1307,13 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) LLNotifications::instance().add(auth_request_params); }; break; + + case MEDIA_EVENT_LINK_HOVERED: + { + LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LINK_HOVERED, hover text is: " << self->getHoverText() << LL_ENDL; + mHoverTextChanged = true; + }; + break; }; // chain all events to any potential observers of this object. diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index efb94fa1c1..0c369840bf 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -88,6 +88,7 @@ public: 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 ); + virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); // navigation void navigateTo( std::string url_in, std::string mime_type = ""); @@ -191,6 +192,7 @@ public: S32 mTextureHeight; bool mClearCache; class LLWindowShade* mWindowShade; + bool mHoverTextChanged; }; #endif // LL_LLMediaCtrl_H diff --git a/indra/newview/llviewerparcelmedia.cpp b/indra/newview/llviewerparcelmedia.cpp index 41e59c626d..40f0b43313 100644 --- a/indra/newview/llviewerparcelmedia.cpp +++ b/indra/newview/llviewerparcelmedia.cpp @@ -592,6 +592,12 @@ void LLViewerParcelMedia::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_AUTH_REQUEST, url " << self->getAuthURL() << ", realm " << self->getAuthRealm() << LL_ENDL; } break; + + case MEDIA_EVENT_LINK_HOVERED: + { + LL_DEBUGS("Media") << "Media event: MEDIA_EVENT_LINK_HOVERED, hover text is: " << self->getHoverText() << LL_ENDL; + }; + break; }; } diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index f2a10bc264..f8483225d9 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -2229,6 +2229,12 @@ void LLMediaPluginTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent e self->sendAuthResponse(false, "", ""); } break; + + case MEDIA_EVENT_LINK_HOVERED: + { + std::cerr << "Media event: MEDIA_EVENT_LINK_HOVERED, hover text is: " << self->getHoverText() << std::endl; + }; + break; } } -- cgit v1.2.3 From 88eabbd0776ed0c2ce923b23cda14b9f91445aa4 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 1 Dec 2010 19:02:53 -0800 Subject: SOCIAL-311 PARTIAL FIX (2) Media browser has too many oddities to be useful for viewer web apps Latest traunch of fixes to new Web only content floater Also removed line in test app that fails to build - have a note to fix later --- indra/media_plugins/webkit/media_plugin_webkit.cpp | 4 +- indra/newview/app_settings/settings.xml | 13 +- indra/newview/llfloaterwebcontent.cpp | 585 +++++++++++---------- indra/newview/llfloaterwebcontent.h | 148 +++--- .../skins/default/xui/en/floater_web_content.xml | 275 +++++----- indra/test_apps/llplugintest/llmediaplugintest.cpp | 2 +- 6 files changed, 553 insertions(+), 474 deletions(-) (limited to 'indra') diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 1666f877e9..19244d2d1f 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -407,6 +407,8 @@ private: { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "navigate_begin"); message.setValue("uri", event.getEventUri()); + 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_LOADING); @@ -605,7 +607,7 @@ private: mAuthPassword = message.getValue("password"); } } - + //////////////////////////////////////////////////////////////////////////////// // virtual void onLinkHovered(const EventType& event) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ef45eaa1db..5548abc623 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6626,7 +6626,18 @@ MediaBrowserWindowLimit Comment - Maximum number of media brower windows that can be open at once (0 for no limit) + Maximum number of media brower windows that can be open at once in the media browser floater (0 for no limit) + Persist + 1 + Type + S32 + Value + 5 + + WebContentWindowLimit + + Comment + Maximum number of web brower windows that can be open at once in the Web content floater (0 for no limit) Persist 1 Type diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 138ddeabda..8321b2914f 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -1,276 +1,309 @@ -/** - * @file llfloaterwebcontent.cpp - * @brief floater for displaying web content - e.g. profiles and search (eventually) - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llfloaterwebcontent.h" - -#include "llfloaterreg.h" -#include "llparcel.h" -#include "llpluginclassmedia.h" -#include "lluictrlfactory.h" -#include "llmediactrl.h" -#include "llviewerwindow.h" -#include "llviewercontrol.h" -#include "llviewerparcelmgr.h" -#include "llweb.h" -#include "llui.h" -#include "roles_constants.h" - -#include "llurlhistory.h" -#include "llviewermedia.h" -#include "llviewerparcelmedia.h" -#include "llcombobox.h" -#include "llwindow.h" -#include "lllayoutstack.h" -#include "llcheckboxctrl.h" - -#include "llnotifications.h" - -// TEMP -#include "llsdutil.h" - -LLFloaterWebContent::LLFloaterWebContent(const LLSD& key) - : LLFloater(key) -{ -} - -//static -void LLFloaterWebContent::create(const std::string &url, const std::string& target, const std::string& uuid) -{ - lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; - - std::string tag = target; - - if(target.empty() || target == "_blank") - { - if(!uuid.empty()) - { - tag = uuid; - } - else - { - // create a unique tag for this instance - LLUUID id; - id.generate(); - tag = id.asString(); - } - } - - S32 browser_window_limit = gSavedSettings.getS32("MediaBrowserWindowLimit"); - - if(LLFloaterReg::findInstance("web_content", tag) != NULL) - { - // There's already a web browser for this tag, so we won't be opening a new window. - } - else if(browser_window_limit != 0) - { - // showInstance will open a new window. Figure out how many web browsers are already open, - // and close the least recently opened one if this will put us over the limit. - - LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "total instance count is " << instances.size() << llendl; - - for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) - { - lldebugs << " " << (*iter)->getKey() << llendl; - } - - if(instances.size() >= (size_t)browser_window_limit) - { - // Destroy the least recently opened instance - (*instances.begin())->closeFloater(); - } - } - - LLFloaterWebContent *browser = dynamic_cast (LLFloaterReg::showInstance("web_content", tag)); - llassert(browser); - if(browser) - { - browser->mUUID = uuid; - - // tell the browser instance to load the specified URL - browser->openMedia(url, target); - LLViewerMedia::proxyWindowOpened(target, uuid); - } -} - -//static -void LLFloaterWebContent::closeRequest(const std::string &uuid) -{ - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) - { - LLFloaterWebContent* i = dynamic_cast(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->closeFloater(false); - return; - } - } -} - -//static -void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) -{ - LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); - lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; - for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) - { - LLFloaterWebContent* i = dynamic_cast(*iter); - lldebugs << " " << i->mUUID << llendl; - if (i && i->mUUID == uuid) - { - i->geometryChanged(x, y, width, height); - return; - } - } -} - -void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) -{ - // Make sure the layout of the browser control is updated, so this calculation is correct. - LLLayoutStack::updateClass(); - - // TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc. - LLCoordWindow window_size; - getWindow()->getSize(&window_size); - - // Adjust width and height for the size of the chrome on the web Browser window. - width += getRect().getWidth() - mWebBrowser->getRect().getWidth(); - height += getRect().getHeight() - mWebBrowser->getRect().getHeight(); - - LLRect geom; - geom.setOriginAndSize(x, window_size.mY - (y + height), width, height); - - lldebugs << "geometry change: " << geom << llendl; - - handleReshape(geom,false); -} - -void LLFloaterWebContent::openMedia(const std::string& web_url, const std::string& target) -{ - mWebBrowser->setHomePageUrl(web_url); - mWebBrowser->setTarget(target); - mWebBrowser->navigateTo(web_url); - setCurrentURL(web_url); -} - -void LLFloaterWebContent::draw() -{ -// getChildView("go")->setEnabled(!mAddressCombo->getValue().asString().empty()); - - getChildView("back")->setEnabled(mWebBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mWebBrowser->canNavigateForward()); - - LLFloater::draw(); -} - -BOOL LLFloaterWebContent::postBuild() -{ - mWebBrowser = getChild("webbrowser"); - mWebBrowser->addObserver(this); - - childSetAction("back", onClickBack, this); - childSetAction("forward", onClickForward, this); - childSetAction("reload", onClickRefresh, this); - childSetAction("go", onClickGo, this); - - return TRUE; -} - -//virtual -void LLFloaterWebContent::onClose(bool app_quitting) -{ - LLViewerMedia::proxyWindowClosed(mUUID); - destroy(); -} - -void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) -{ - if(event == MEDIA_EVENT_LOCATION_CHANGED) - { - setCurrentURL(self->getLocation()); - } - else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) - { - // This is the event these flags are sent with. - getChildView("back")->setEnabled(self->getHistoryBackAvailable()); - getChildView("forward")->setEnabled(self->getHistoryForwardAvailable()); - } - else if(event == MEDIA_EVENT_CLOSE_REQUEST) - { - // The browser instance wants its window closed. - closeFloater(); - } - else if(event == MEDIA_EVENT_GEOMETRY_CHANGE) - { - geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight()); - } -} - -void LLFloaterWebContent::setCurrentURL(const std::string& url) -{ - mCurrentURL = url; - - getChildView("back")->setEnabled(mWebBrowser->canNavigateBack()); - getChildView("forward")->setEnabled(mWebBrowser->canNavigateForward()); - getChildView("reload")->setEnabled(TRUE); -} - -//static -void LLFloaterWebContent::onClickRefresh(void* user_data) -{ - LLFloaterWebContent* self = (LLFloaterWebContent*)user_data; - - self->mWebBrowser->navigateTo(self->mCurrentURL); -} - -//static -void LLFloaterWebContent::onClickForward(void* user_data) -{ - LLFloaterWebContent* self = (LLFloaterWebContent*)user_data; - - self->mWebBrowser->navigateForward(); -} - -//static -void LLFloaterWebContent::onClickBack(void* user_data) -{ - LLFloaterWebContent* self = (LLFloaterWebContent*)user_data; - - self->mWebBrowser->navigateBack(); -} - -//static -void LLFloaterWebContent::onClickGo(void* user_data) -{ -// LLFloaterWebContent* self = (LLFloaterWebContent*)user_data; - -// self->mWebBrowser->navigateTo(self->mAddressCombo->getValue().asString()); -} +/** + * @file llfloaterwebcontent.cpp + * @brief floater for displaying web content - e.g. profiles and search (eventually) + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llcombobox.h" +#include "llfloaterreg.h" +#include "lllayoutstack.h" +#include "llpluginclassmedia.h" +#include "llprogressbar.h" +#include "lltextbox.h" +#include "llviewercontrol.h" +#include "llwindow.h" + +#include "llfloaterwebcontent.h" + +LLFloaterWebContent::LLFloaterWebContent(const LLSD& key) + : LLFloater(key) +{ + mCommitCallbackRegistrar.add("WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this)); + mCommitCallbackRegistrar.add("WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this)); + mCommitCallbackRegistrar.add("WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this)); + + mCommitCallbackRegistrar.add("WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this)); + mCommitCallbackRegistrar.add("WebContent.Go", boost::bind( &LLFloaterWebContent::onClickGo, this)); +} + +BOOL LLFloaterWebContent::postBuild() +{ + // these are used in a bunch of places so cache them + mWebBrowser = getChild("webbrowser"); + mAddressCombo = getChild("address"); + mStatusBarText = getChild("statusbartext"); + mStatusBarProgress = getChild("statusbarprogress"); + + // observe browser events + mWebBrowser->addObserver(this); + + // these button are always enabled + getChildView("reload")->setEnabled( true ); + getChildView("go")->setEnabled( true ); + + return TRUE; +} + +//static +void LLFloaterWebContent::create(const std::string &url, const std::string& target, const std::string& uuid) +{ + lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; + + std::string tag = target; + + if(target.empty() || target == "_blank") + { + if(!uuid.empty()) + { + tag = uuid; + } + else + { + // create a unique tag for this instance + LLUUID id; + id.generate(); + tag = id.asString(); + } + } + + S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); + + if(LLFloaterReg::findInstance("web_content", tag) != NULL) + { + // There's already a web browser for this tag, so we won't be opening a new window. + } + else if(browser_window_limit != 0) + { + // showInstance will open a new window. Figure out how many web browsers are already open, + // and close the least recently opened one if this will put us over the limit. + + LLFloaterReg::const_instance_list_t &instances = LLFloaterReg::getFloaterList("web_content"); + lldebugs << "total instance count is " << instances.size() << llendl; + + for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) + { + lldebugs << " " << (*iter)->getKey() << llendl; + } + + if(instances.size() >= (size_t)browser_window_limit) + { + // Destroy the least recently opened instance + (*instances.begin())->closeFloater(); + } + } + + LLFloaterWebContent *browser = dynamic_cast (LLFloaterReg::showInstance("web_content", tag)); + llassert(browser); + if(browser) + { + browser->mUUID = uuid; + + // tell the browser instance to load the specified URL + browser->open_media(url, target); + LLViewerMedia::proxyWindowOpened(target, uuid); + } +} + +//static +void LLFloaterWebContent::closeRequest(const std::string &uuid) +{ + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); + lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + { + LLFloaterWebContent* i = dynamic_cast(*iter); + lldebugs << " " << i->mUUID << llendl; + if (i && i->mUUID == uuid) + { + i->closeFloater(false); + return; + } + } +} + +//static +void LLFloaterWebContent::geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height) +{ + LLFloaterReg::const_instance_list_t& inst_list = LLFloaterReg::getFloaterList("web_content"); + lldebugs << "instance list size is " << inst_list.size() << ", incoming uuid is " << uuid << llendl; + for (LLFloaterReg::const_instance_list_t::const_iterator iter = inst_list.begin(); iter != inst_list.end(); ++iter) + { + LLFloaterWebContent* i = dynamic_cast(*iter); + lldebugs << " " << i->mUUID << llendl; + if (i && i->mUUID == uuid) + { + i->geometryChanged(x, y, width, height); + return; + } + } +} + +void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) +{ + // Make sure the layout of the browser control is updated, so this calculation is correct. + LLLayoutStack::updateClass(); + + // TODO: need to adjust size and constrain position to make sure floaters aren't moved outside the window view, etc. + LLCoordWindow window_size; + getWindow()->getSize(&window_size); + + // Adjust width and height for the size of the chrome on the web Browser window. + width += getRect().getWidth() - mWebBrowser->getRect().getWidth(); + height += getRect().getHeight() - mWebBrowser->getRect().getHeight(); + + LLRect geom; + geom.setOriginAndSize(x, window_size.mY - (y + height), width, height); + + lldebugs << "geometry change: " << geom << llendl; + + handleReshape(geom,false); +} + +void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) +{ + mWebBrowser->setHomePageUrl(web_url); + mWebBrowser->setTarget(target); + mWebBrowser->navigateTo(web_url); + set_current_url(web_url); +} + +//virtual +void LLFloaterWebContent::onClose(bool app_quitting) +{ + LLViewerMedia::proxyWindowClosed(mUUID); + destroy(); +} + +void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) +{ + if(event == MEDIA_EVENT_LOCATION_CHANGED) + { + const std::string url = self->getStatusText(); + + if ( url.length() ) + mStatusBarText->setText( url ); + + set_current_url( url ); + } + else if(event == MEDIA_EVENT_NAVIGATE_BEGIN) + { + // flags are sent with this event + getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); + getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + + // manually decide on the state of this button + getChildView("stop")->setEnabled( true ); + + // turn "on" progress bar now we're loaded + mStatusBarProgress->setVisible( true ); + } + else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) + { + // flags are sent with this event + getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); + getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); + + // manually decide on the state of this button + getChildView("stop")->setEnabled( false ); + + // turn "off" progress bar now we're loaded + mStatusBarProgress->setVisible( false ); + } + else if(event == MEDIA_EVENT_CLOSE_REQUEST) + { + // The browser instance wants its window closed. + closeFloater(); + } + else if(event == MEDIA_EVENT_GEOMETRY_CHANGE) + { + geometryChanged(self->getGeometryX(), self->getGeometryY(), self->getGeometryWidth(), self->getGeometryHeight()); + } + else if(event == MEDIA_EVENT_STATUS_TEXT_CHANGED ) + { + const std::string text = self->getStatusText(); + if ( text.length() ) + mStatusBarText->setText( text ); + } + else if(event == MEDIA_EVENT_PROGRESS_UPDATED ) + { + int percent = (int)self->getProgressPercent(); + mStatusBarProgress->setPercent( percent ); + } + else if(event == MEDIA_EVENT_NAME_CHANGED ) + { + std::string page_title = self->getMediaName(); + setTitle( page_title ); + } +} + +void LLFloaterWebContent::set_current_url(const std::string& url) +{ + mCurrentURL = url; + + // redirects will navigate momentarily to about:blank, don't add to history + if ( mCurrentURL != "about:blank" ) + { + mAddressCombo->remove( mCurrentURL ); + mAddressCombo->add( mCurrentURL ); + mAddressCombo->selectByValue( mCurrentURL ); + } +} + +void LLFloaterWebContent::onClickForward() +{ + mWebBrowser->navigateForward(); +} + +void LLFloaterWebContent::onClickBack() +{ + mWebBrowser->navigateBack(); +} + +void LLFloaterWebContent::onClickReload() +{ + mAddressCombo->remove(0); + + if( mWebBrowser->getMediaPlugin() ) + { + bool ignore_cache = true; + mWebBrowser->getMediaPlugin()->browse_reload( ignore_cache ); + }; +} + +void LLFloaterWebContent::onClickStop() +{ + if( mWebBrowser->getMediaPlugin() ) + mWebBrowser->getMediaPlugin()->stop(); +} + +void LLFloaterWebContent::onEnterAddress() +{ + mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); +} + +void LLFloaterWebContent::onClickGo() +{ + mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); +} diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 71346aa80e..b41da57a6f 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -1,71 +1,77 @@ -/** - * @file llfloaterwebcontent.h - * @brief floater for displaying web content - e.g. profiles and search (eventually) - * - * $LicenseInfo:firstyear=2006&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERWEBCONTENT_H -#define LL_LLFLOATERWEBCONTENT_H - -#include "llfloater.h" -#include "llmediactrl.h" - -class LLMediaCtrl; - -class LLFloaterWebContent : - public LLFloater, - public LLViewerMediaObserver -{ -public: - LOG_CLASS(LLFloaterWebContent); - LLFloaterWebContent(const LLSD& key); - - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); - - static void closeRequest(const std::string &uuid); - static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); - void geometryChanged(S32 x, S32 y, S32 width, S32 height); - - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); - /*virtual*/ void draw(); - - // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); - - void openMedia(const std::string& media_url, const std::string& target); - void setCurrentURL(const std::string& url); - - static void onClickRefresh(void* user_data); - static void onClickBack(void* user_data); - static void onClickForward(void* user_data); - static void onClickGo(void* user_data); - -private: - LLMediaCtrl* mWebBrowser; - std::string mCurrentURL; - std::string mUUID; -}; - -#endif // LL_LLFLOATERWEBCONTENT_H - +/** + * @file llfloaterwebcontent.h + * @brief floater for displaying web content - e.g. profiles and search (eventually) + * + * $LicenseInfo:firstyear=2006&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERWEBCONTENT_H +#define LL_LLFLOATERWEBCONTENT_H + +#include "llfloater.h" +#include "llmediactrl.h" + +class LLMediaCtrl; +class LLComboBox; +class LLTextBox; +class LLProgressBar; + +class LLFloaterWebContent : + public LLFloater, + public LLViewerMediaObserver +{ +public: + LOG_CLASS(LLFloaterWebContent); + LLFloaterWebContent(const LLSD& key); + + static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); + + static void closeRequest(const std::string &uuid); + static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); + void geometryChanged(S32 x, S32 y, S32 width, S32 height); + + /*virtual*/ BOOL postBuild(); + /*virtual*/ void onClose(bool app_quitting); + + // inherited from LLViewerMediaObserver + /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); + + void onClickBack(); + void onClickForward(); + void onClickReload(); + void onClickStop(); + void onEnterAddress(); + void onClickGo(); + +private: + void open_media(const std::string& media_url, const std::string& target); + void set_current_url(const std::string& url); + + LLMediaCtrl* mWebBrowser; + LLComboBox* mAddressCombo; + LLTextBox* mStatusBarText; + LLProgressBar* mStatusBarProgress; + std::string mCurrentURL; + std::string mUUID; +}; + +#endif // LL_LLFLOATERWEBCONTENT_H diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 777c67261a..62df206360 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -1,124 +1,151 @@ - - - - http://www.secondlife.com - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + diff --git a/indra/test_apps/llplugintest/llmediaplugintest.cpp b/indra/test_apps/llplugintest/llmediaplugintest.cpp index f8483225d9..4a2272032b 100644 --- a/indra/test_apps/llplugintest/llmediaplugintest.cpp +++ b/indra/test_apps/llplugintest/llmediaplugintest.cpp @@ -2223,7 +2223,7 @@ void LLMediaPluginTest::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent e case MEDIA_EVENT_AUTH_REQUEST: { - std::cerr << "Media event: MEDIA_EVENT_AUTH_REQUEST, url " << self->getAuthURL() ", realm " << self->getAuthRealm() << std::endl; + //std::cerr << "Media event: MEDIA_EVENT_AUTH_REQUEST, url " << self->getAuthURL() ", realm " << self->getAuthRealm() << std::endl; // TODO: display an auth dialog self->sendAuthResponse(false, "", ""); -- cgit v1.2.3 From adb62e958ff3a4be2eb43fbb1754358ec60a118c Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 1 Dec 2010 22:25:13 -0800 Subject: SOCIAL-311 PARTIAL FIX Media browser has too many oddities to be useful for viewer web apps Added support for graphic browser buttons and laid them out differently --- indra/newview/llfloaterwebcontent.cpp | 13 +--- .../skins/default/xui/en/floater_web_content.xml | 88 +++++++++++----------- 2 files changed, 49 insertions(+), 52 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 8321b2914f..8e5638f549 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -45,7 +45,6 @@ LLFloaterWebContent::LLFloaterWebContent(const LLSD& key) mCommitCallbackRegistrar.add("WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this)); mCommitCallbackRegistrar.add("WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this)); - mCommitCallbackRegistrar.add("WebContent.Go", boost::bind( &LLFloaterWebContent::onClickGo, this)); } BOOL LLFloaterWebContent::postBuild() @@ -61,7 +60,6 @@ BOOL LLFloaterWebContent::postBuild() // these button are always enabled getChildView("reload")->setEnabled( true ); - getChildView("go")->setEnabled( true ); return TRUE; } @@ -214,7 +212,8 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); // manually decide on the state of this button - getChildView("stop")->setEnabled( true ); + getChildView("reload")->setVisible( false ); + getChildView("stop")->setVisible( true ); // turn "on" progress bar now we're loaded mStatusBarProgress->setVisible( true ); @@ -226,7 +225,8 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); // manually decide on the state of this button - getChildView("stop")->setEnabled( false ); + getChildView("reload")->setVisible( true ); + getChildView("stop")->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); @@ -302,8 +302,3 @@ void LLFloaterWebContent::onEnterAddress() { mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); } - -void LLFloaterWebContent::onClickGo() -{ - mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); -} diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 62df206360..97a7a0e737 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -24,7 +24,7 @@ + + width="729"> - + top="0"/> Date: Thu, 2 Dec 2010 11:37:26 -0800 Subject: expose update available method. --- indra/viewer_components/updater/llupdaterservice.cpp | 5 +++++ indra/viewer_components/updater/llupdaterservice.h | 3 +++ 2 files changed, 8 insertions(+) (limited to 'indra') diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index cfda314d43..92a0a09137 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -504,6 +504,11 @@ std::string const & LLUpdaterService::pumpName(void) return name; } +bool LLUpdaterService::updateReadyToInstall(void) +{ + return LLFile::isfile(update_marker_path()); +} + LLUpdaterService::LLUpdaterService() { if(gUpdater.expired()) diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 6ee7060d28..3763fbfde0 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -43,6 +43,9 @@ public: // Name of the event pump through which update events will be delivered. static std::string const & pumpName(void); + // Returns true if an update has been completely downloaded and is now ready to install. + static bool updateReadyToInstall(void); + // Type codes for events posted by this service. Stored the event's 'type' element. enum eUpdaterEvent { INVALID, -- cgit v1.2.3 From 2ea7b1a05e2fd773962bb6495148f900d6640b00 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 Dec 2010 14:05:21 -0800 Subject: STORM-151 : Remove files we have no use of --- indra/llkdu/llblockdata.cpp | 162 -------------------- indra/llkdu/llblockdata.h | 107 ------------- indra/llkdu/llblockdecoder.cpp | 270 -------------------------------- indra/llkdu/llblockdecoder.h | 42 ----- indra/llkdu/llblockencoder.cpp | 340 ----------------------------------------- indra/llkdu/llblockencoder.h | 49 ------ 6 files changed, 970 deletions(-) delete mode 100644 indra/llkdu/llblockdata.cpp delete mode 100644 indra/llkdu/llblockdata.h delete mode 100644 indra/llkdu/llblockdecoder.cpp delete mode 100644 indra/llkdu/llblockdecoder.h delete mode 100644 indra/llkdu/llblockencoder.cpp delete mode 100644 indra/llkdu/llblockencoder.h (limited to 'indra') diff --git a/indra/llkdu/llblockdata.cpp b/indra/llkdu/llblockdata.cpp deleted file mode 100644 index 6a7bc3e6c4..0000000000 --- a/indra/llkdu/llblockdata.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/** - * @file llblockdata.cpp - * @brief Image block structure - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llblockdata.h" -#include "llmath.h" - -LLBlockData::LLBlockData(const U32 type) -{ - mType = type; - mWidth = 0; - mHeight = 0; - mRowStride = 0; - mData = NULL; -} - -void LLBlockData::setData(U8 *data, const U32 width, const U32 height, const U32 row_stride) -{ - mData = data; - mWidth = width; - mHeight = height; - if (row_stride) - { - mRowStride = row_stride; - } - else - { - mRowStride = width * 4; - } -} - -U32 LLBlockData::getType() const -{ - return mType; -} - - -U8 *LLBlockData::getData() const -{ - return mData; -} - -U32 LLBlockData::getSize() const -{ - return mWidth*mHeight; -} - -U32 LLBlockData::getWidth() const -{ - return mWidth; -} -U32 LLBlockData::getHeight() const -{ - return mHeight; -} - -U32 LLBlockData::getRowStride() const -{ - return mRowStride; -} - -LLBlockDataU32::LLBlockDataU32() : LLBlockData(BLOCK_TYPE_U32) -{ - mPrecision = 32; -} - -void LLBlockDataU32::setData(U32 *data, const U32 width, const U32 height, const U32 row_stride) -{ - LLBlockData::setData((U8 *)data, width, height, row_stride); -} - -U32 LLBlockDataU32::getSize() const -{ - return mWidth*mHeight*4; -} - -void LLBlockDataU32::setPrecision(const U32 bits) -{ - mPrecision = bits; -} - -U32 LLBlockDataU32::getPrecision() const -{ - return mPrecision; -} - -void LLBlockDataF32::setPrecision(const U32 bits) -{ - mPrecision = bits; -} - -U32 LLBlockDataF32::getPrecision() const -{ - return mPrecision; -} - -void LLBlockDataF32::setData(F32 *data, const U32 width, const U32 height, const U32 row_stride) -{ - LLBlockData::setData((U8 *)data, width, height, row_stride); -} - -void LLBlockDataF32::setMin(const F32 min) -{ - mMin = min; -} - -void LLBlockDataF32::setMax(const F32 max) -{ - mMax = max; -} - -void LLBlockDataF32::calcMinMax() -{ - U32 x, y; - - mMin = *(F32*)mData; - mMax = mMin; - - for (y = 0; y < mHeight; y++) - { - for (x = 0; x < mWidth; x++) - { - F32 data = *(F32*)(mData + y*mRowStride + x*4); - mMin = llmin(data, mMin); - mMax = llmax(data, mMax); - } - } -} - -F32 LLBlockDataF32::getMin() const -{ - return mMin; -} - -F32 LLBlockDataF32::getMax() const -{ - return mMax; -} diff --git a/indra/llkdu/llblockdata.h b/indra/llkdu/llblockdata.h deleted file mode 100644 index dcc847e7e2..0000000000 --- a/indra/llkdu/llblockdata.h +++ /dev/null @@ -1,107 +0,0 @@ -/** - * @file llblockdata.h - * @brief Image block structure - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLBLOCKDATA_H -#define LL_LLBLOCKDATA_H - -#include "stdtypes.h" - -////////////////////////////////////////////////// -// -// This class stores all of the information about -// a single channel of raw data, either integer -// or floating point. -// -class LLBlockData -{ -protected: - U32 mType; - U32 mWidth; - U32 mHeight; - U32 mRowStride; - U8 *mData; -public: - enum - { - BLOCK_TYPE_U32 = 1, - BLOCK_TYPE_F32 = 2 - }; - - LLBlockData(const U32 type); - virtual ~LLBlockData() {} - - void setData(U8 *data, const U32 width, const U32 height, const U32 row_stride = 0); - - U32 getType() const; - U8 *getData() const; - virtual U32 getSize() const; - U32 getWidth() const; - U32 getHeight() const; - U32 getRowStride() const; -}; - -class LLBlockDataU32 : public LLBlockData -{ -protected: - U32 mPrecision; -public: - LLBlockDataU32(); - - void setData(U32 *data, const U32 width, const U32 height, const U32 row_stride = 0); - void setPrecision(const U32 bits); - - /*virtual*/ U32 getSize() const; - U32 getPrecision() const; -}; - -class LLBlockDataF32 : public LLBlockData -{ -protected: - U32 mPrecision; - F32 mMin; - F32 mMax; -public: - LLBlockDataF32() - : LLBlockData(LLBlockData::BLOCK_TYPE_F32), - mPrecision(0), - mMin(0.f), - mMax(0.f) - {}; - - void setData(F32 *data, const U32 width, const U32 height, const U32 row_stride = 0); - - void setPrecision(const U32 bits); - void setMin(const F32 min); - void setMax(const F32 max); - - void calcMinMax(); - - U32 getPrecision() const; - F32 getMin() const; - F32 getMax() const; -}; - -#endif // LL_LLBLOCKDATA_H diff --git a/indra/llkdu/llblockdecoder.cpp b/indra/llkdu/llblockdecoder.cpp deleted file mode 100644 index 3daa016591..0000000000 --- a/indra/llkdu/llblockdecoder.cpp +++ /dev/null @@ -1,270 +0,0 @@ - /** - * @file llblockdecoder.cpp - * @brief Image block decompression - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llblockdecoder.h" - -// KDU core header files -#include "kdu_elementary.h" -#include "kdu_messaging.h" -#include "kdu_params.h" -#include "kdu_compressed.h" -#include "kdu_sample_processing.h" - -#include "llkdumem.h" - -#include "llblockdata.h" -#include "llerror.h" - - -BOOL LLBlockDecoder::decodeU32(LLBlockDataU32 &block_data, U8 *source_data, const U32 source_size) const -{ - U32 width, height; - - llassert(source_data); - - LLKDUMemSource source(source_data, source_size); - - source.reset(); - - kdu_codestream codestream; - - codestream.create(&source); - codestream.set_fast(); - - kdu_dims dims; - codestream.get_dims(0,dims); - llassert(codestream.get_num_components() == 1); - - width = dims.size.x; - height = dims.size.y; - - // Assumes U32 data. - U8 *output = block_data.getData(); - - kdu_dims tile_indices; - codestream.get_valid_tiles(tile_indices); - - kdu_coords tpos; - tpos.x = 0; - tpos.y = 0; - - // Now we are ready to walk through the tiles processing them one-by-one. - while (tpos.y < tile_indices.size.y) - { - while (tpos.x < tile_indices.size.x) - { - kdu_tile tile = codestream.open_tile(tpos+tile_indices.pos); - - kdu_resolution res = tile.access_component(0).access_resolution(); - kdu_dims tile_dims; - res.get_dims(tile_dims); - kdu_coords offset = tile_dims.pos - dims.pos; - int row_gap = block_data.getRowStride(); // inter-row separation - kdu_byte *buf = output + offset.y*row_gap + offset.x*4; - - kdu_tile_comp tile_comp = tile.access_component(0); - bool reversible = tile_comp.get_reversible(); - U32 precision = tile_comp.get_bit_depth(); - U32 precision_scale = 1 << precision; - llassert(precision >= 8); // Else would have used 16 bit representation - - kdu_resolution comp_res = tile_comp.access_resolution(); // Get top resolution - kdu_dims comp_dims; - comp_res.get_dims(comp_dims); - - bool use_shorts = (tile_comp.get_bit_depth(true) <= 16); - - kdu_line_buf line; - kdu_sample_allocator allocator; - kdu_pull_ifc engine; - - line.pre_create(&allocator, comp_dims.size.x, reversible, use_shorts); - if (res.which() == 0) // No DWT levels used - { - engine = kdu_decoder(res.access_subband(LL_BAND), &allocator, use_shorts); - } - else - { - engine = kdu_synthesis(res, &allocator, use_shorts); - } - allocator.finalize(); // Actually creates buffering resources - - line.create(); // Grabs resources from the allocator. - - // Do the actual processing - while (tile_dims.size.y--) - { - engine.pull(line, true); - int width = line.get_width(); - - llassert(line.get_buf32()); - llassert(!line.is_absolute()); - // Decompressed samples have a 32-bit representation (integer or float) - kdu_sample32 *sp = line.get_buf32(); - // Transferring normalized floating point data. - U32 *dest_u32 = (U32 *)buf; - for (; width > 0; width--, sp++, dest_u32++) - { - if (sp->fval < -0.5f) - { - *dest_u32 = 0; - } - else - { - *dest_u32 = (U32)((sp->fval + 0.5f)*precision_scale); - } - } - buf += row_gap; - } - engine.destroy(); - tile.close(); - tpos.x++; - } - tpos.y++; - tpos.x = 0; - } - codestream.destroy(); - - return TRUE; -} - -BOOL LLBlockDecoder::decodeF32(LLBlockDataF32 &block_data, U8 *source_data, const U32 source_size, const F32 min, const F32 max) const -{ - U32 width, height; - F32 range, range_inv, float_offset; - bool use_shorts = false; - - range = max - min; - range_inv = 1.f / range; - float_offset = 0.5f*(max + min); - - llassert(source_data); - - LLKDUMemSource source(source_data, source_size); - - source.reset(); - - kdu_codestream codestream; - - codestream.create(&source); - codestream.set_fast(); - - kdu_dims dims; - codestream.get_dims(0,dims); - llassert(codestream.get_num_components() == 1); - - width = dims.size.x; - height = dims.size.y; - - // Assumes F32 data. - U8 *output = block_data.getData(); - - kdu_dims tile_indices; - codestream.get_valid_tiles(tile_indices); - - kdu_coords tpos; - tpos.x = 0; - tpos.y = 0; - - // Now we are ready to walk through the tiles processing them one-by-one. - while (tpos.y < tile_indices.size.y) - { - while (tpos.x < tile_indices.size.x) - { - kdu_tile tile = codestream.open_tile(tpos+tile_indices.pos); - - kdu_resolution res = tile.access_component(0).access_resolution(); - kdu_dims tile_dims; - res.get_dims(tile_dims); - kdu_coords offset = tile_dims.pos - dims.pos; - int row_gap = block_data.getRowStride(); // inter-row separation - kdu_byte *buf = output + offset.y*row_gap + offset.x*4; - - kdu_tile_comp tile_comp = tile.access_component(0); - bool reversible = tile_comp.get_reversible(); - - kdu_resolution comp_res = tile_comp.access_resolution(); // Get top resolution - kdu_dims comp_dims; - comp_res.get_dims(comp_dims); - - kdu_line_buf line; - kdu_sample_allocator allocator; - kdu_pull_ifc engine; - - line.pre_create(&allocator, comp_dims.size.x, reversible, use_shorts); - if (res.which() == 0) // No DWT levels used - { - engine = kdu_decoder(res.access_subband(LL_BAND), &allocator, use_shorts); - } - else - { - engine = kdu_synthesis(res, &allocator, use_shorts); - } - allocator.finalize(); // Actually creates buffering resources - - line.create(); // Grabs resources from the allocator. - - // Do the actual processing - while (tile_dims.size.y--) - { - engine.pull(line, true); - int width = line.get_width(); - - llassert(line.get_buf32()); - llassert(!line.is_absolute()); - // Decompressed samples have a 32-bit representation (integer or float) - kdu_sample32 *sp = line.get_buf32(); - // Transferring normalized floating point data. - F32 *dest_f32 = (F32 *)buf; - for (; width > 0; width--, sp++, dest_f32++) - { - if (sp->fval < -0.5f) - { - *dest_f32 = min; - } - else if (sp->fval > 0.5f) - { - *dest_f32 = max; - } - else - { - *dest_f32 = (sp->fval) * range + float_offset; - } - } - buf += row_gap; - } - engine.destroy(); - tile.close(); - tpos.x++; - } - tpos.y++; - tpos.x = 0; - } - codestream.destroy(); - return TRUE; -} diff --git a/indra/llkdu/llblockdecoder.h b/indra/llkdu/llblockdecoder.h deleted file mode 100644 index 97959d338e..0000000000 --- a/indra/llkdu/llblockdecoder.h +++ /dev/null @@ -1,42 +0,0 @@ -/** - * @file llblockdecoder.h - * @brief Image block decompression - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLBLOCKDECODER_H -#define LL_LLBLOCKDECODER_H - -#include "stdtypes.h" - -class LLBlockDataU32; -class LLBlockDataF32; - -class LLBlockDecoder -{ -public: - BOOL decodeU32(LLBlockDataU32 &block_data, U8 *source_data, const U32 source_size) const; - BOOL decodeF32(LLBlockDataF32 &block_data, U8 *source_data, const U32 source_size, const F32 min, const F32 max) const; -}; - -#endif // LL_LLBLOCKDECODER_H diff --git a/indra/llkdu/llblockencoder.cpp b/indra/llkdu/llblockencoder.cpp deleted file mode 100644 index 759eaf65f9..0000000000 --- a/indra/llkdu/llblockencoder.cpp +++ /dev/null @@ -1,340 +0,0 @@ - /** - * @file llblockencoder.cpp - * @brief Image block compression - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "linden_common.h" - -#include "llblockencoder.h" - -// KDU core header files -#include "kdu_elementary.h" -#include "kdu_messaging.h" -#include "kdu_params.h" -#include "kdu_compressed.h" -#include "kdu_sample_processing.h" - -#include "llkdumem.h" - -#include "llblockdata.h" -#include "llerror.h" - -LLBlockEncoder::LLBlockEncoder() -{ - mBPP = 0.f; -} - -U8 *LLBlockEncoder::encode(const LLBlockData &block_data, U32 &output_size) const -{ - switch (block_data.getType()) - { - case LLBlockData::BLOCK_TYPE_U32: - { - LLBlockDataU32 &bd_u32 = (LLBlockDataU32 &)block_data; - return encodeU32(bd_u32, output_size); - } - case LLBlockData::BLOCK_TYPE_F32: - { - LLBlockDataF32 &bd_f32 = (LLBlockDataF32 &)block_data; - return encodeF32(bd_f32, output_size); - } - default: - llerrs << "Unsupported block type!" << llendl; - output_size = 0; - return NULL; - } -} - -U8 *LLBlockEncoder::encodeU32(const LLBlockDataU32 &block_data, U32 &output_size) const -{ - // OK, for now, just use the standard KDU encoder, with a single channel - // integer channel. - - // Collect simple arguments. - bool allow_rate_prediction, allow_shorts, mem, quiet, no_weights; - - allow_rate_prediction = true; - allow_shorts = false; - no_weights = false; - bool use_absolute = false; - mem = false; - quiet = false; - - // Set codestream options - siz_params siz; - S16 precision = block_data.getPrecision(); - - siz.set(Sdims,0,0,(U16)block_data.getHeight()); - siz.set(Sdims,0,1,(U16)block_data.getWidth()); - siz.set(Ssigned,0,0,false); - siz.set(Scomponents,0,0,1); - siz.set(Sprecision,0,0, precision); - - // Construct the `kdu_codestream' object and parse all remaining arguments. - output_size = block_data.getSize(); - if (output_size < 1000) - { - output_size = 1000; - } - - U8 *output_buffer = new U8[output_size]; - - LLKDUMemTarget output(output_buffer, output_size, block_data.getSize()); - - kdu_codestream codestream; - codestream.create(&siz,&output); - - codestream.access_siz()->parse_string("Clayers=1"); - codestream.access_siz()->finalize_all(); - - kdu_tile tile = codestream.open_tile(kdu_coords(0,0)); - - // Open tile-components and create processing engines and resources - kdu_dims dims; - kdu_sample_allocator allocator; - kdu_tile_comp tile_comp; - kdu_line_buf line; - kdu_push_ifc engine; - - tile_comp = tile.access_component(0); - kdu_resolution res = tile_comp.access_resolution(); // Get top resolution - - res.get_dims(dims); - - line.pre_create(&allocator,dims.size.x, use_absolute, allow_shorts); - - if (res.which() == 0) // No DWT levels (should not occur in this example) - { - engine = kdu_encoder(res.access_subband(LL_BAND),&allocator, use_absolute); - } - else - { - engine = kdu_analysis(res,&allocator, use_absolute); - } - - allocator.finalize(); // Actually creates buffering resources - line.create(); // Grabs resources from the allocator. - - // Now walk through the lines of the buffer, pushing them into the - // relevant tile-component processing engines. - - U32 *source_u32 = NULL; - F32 scale_inv = 1.f / (1 << precision); - - S32 y; - for (y = 0; y < dims.size.y; y++) - { - source_u32 = (U32*)(block_data.getData() + y * block_data.getRowStride()); - kdu_sample32 *dest = line.get_buf32(); - for (S32 n=dims.size.x; n > 0; n--, dest++, source_u32++) - { - // Just pack it in, for now. - dest->fval = (F32)(*source_u32) * scale_inv - 0.5f;// - 0.5f; - } - engine.push(line, true); - } - - // Cleanup - engine.destroy(); // engines are interfaces; no default destructors - - // Produce the final compressed output. - kdu_long layer_bytes[1] = {0}; - - layer_bytes[0] = (kdu_long) (mBPP*block_data.getWidth()*block_data.getHeight()); - // Here we are not requesting specific sizes for any of the 12 - // quality layers. As explained in the description of - // "kdu_codestream::flush" (see "kdu_compressed.h"), the rate allocator - // will then assign the layers in such a way as to achieve roughly - // two quality layers per octave change in bit-rate, with the final - // layer reaching true lossless quality. - - codestream.flush(layer_bytes,1); - // You can see how many bytes were assigned - // to each quality layer by looking at the entries of `layer_bytes' here. - // The flush function can do a lot of interesting things which you may - // want to spend some time looking into. In addition to targeting - // specific bit-rates for each quality layer, it can be configured to - // use rate-distortion slope thresholds of your choosing and to return - // the thresholds which it finds to be best for any particular set of - // target layer sizes. This opens the door to feedback-oriented rate - // control for video. You should also look into the - // "kdu_codestream::set_max_bytes" and - // "kdu_codestream::set_min_slope_threshold" functions which can be - // used to significantly speed up compression. - codestream.destroy(); // All done: simple as that. - - // Now that we're done encoding, create the new data buffer for the compressed - // image and stick it there. - - U8 *output_data = new U8[output_size]; - - memcpy(output_data, output_buffer, output_size); - - output.close(); // Not really necessary here. - - return output_data; -} - -U8 *LLBlockEncoder::encodeF32(const LLBlockDataF32 &block_data, U32 &output_size) const -{ - // OK, for now, just use the standard KDU encoder, with a single channel - // integer channel. - - // Collect simple arguments. - bool allow_rate_prediction, allow_shorts, mem, quiet, no_weights; - - allow_rate_prediction = true; - allow_shorts = false; - no_weights = false; - bool use_absolute = false; - mem = false; - quiet = false; - - F32 min, max, range, range_inv, offset; - min = block_data.getMin(); - max = block_data.getMax(); - range = max - min; - range_inv = 1.f / range; - offset = 0.5f*(max + min); - - // Set codestream options - siz_params siz; - S16 precision = block_data.getPrecision(); // Assume precision is always 32 bits for floating point. - - siz.set(Sdims,0,0,(U16)block_data.getHeight()); - siz.set(Sdims,0,1,(U16)block_data.getWidth()); - siz.set(Ssigned,0,0,false); - siz.set(Scomponents,0,0,1); - siz.set(Sprecision,0,0, precision); - - // Construct the `kdu_codestream' object and parse all remaining arguments. - output_size = block_data.getSize(); - if (output_size < 1000) - { - output_size = 1000; - } - - U8 *output_buffer = new U8[output_size*2]; - - LLKDUMemTarget output(output_buffer, output_size, block_data.getSize()); - - kdu_codestream codestream; - codestream.create(&siz,&output); - - codestream.access_siz()->parse_string("Clayers=1"); - codestream.access_siz()->finalize_all(); - - kdu_tile tile = codestream.open_tile(kdu_coords(0,0)); - - // Open tile-components and create processing engines and resources - kdu_dims dims; - kdu_sample_allocator allocator; - kdu_tile_comp tile_comp; - kdu_line_buf line; - kdu_push_ifc engine; - - tile_comp = tile.access_component(0); - kdu_resolution res = tile_comp.access_resolution(); // Get top resolution - - res.get_dims(dims); - - line.pre_create(&allocator,dims.size.x, use_absolute, allow_shorts); - - if (res.which() == 0) // No DWT levels (should not occur in this example) - { - engine = kdu_encoder(res.access_subband(LL_BAND),&allocator, use_absolute); - } - else - { - engine = kdu_analysis(res,&allocator, use_absolute); - } - - allocator.finalize(); // Actually creates buffering resources - line.create(); // Grabs resources from the allocator. - - // Now walk through the lines of the buffer, pushing them into the - // relevant tile-component processing engines. - - F32 *source_f32 = NULL; - - S32 y; - for (y = 0; y < dims.size.y; y++) - { - source_f32 = (F32*)(block_data.getData() + y * block_data.getRowStride()); - kdu_sample32 *dest = line.get_buf32(); - for (S32 n=dims.size.x; n > 0; n--, dest++, source_f32++) - { - dest->fval = ((*source_f32) - offset) * range_inv; - } - engine.push(line, true); - } - - // Cleanup - engine.destroy(); // engines are interfaces; no default destructors - - // Produce the final compressed output. - kdu_long layer_bytes[1] = {0}; - - layer_bytes[0] = (kdu_long) (mBPP*block_data.getWidth()*block_data.getHeight()); - // Here we are not requesting specific sizes for any of the 12 - // quality layers. As explained in the description of - // "kdu_codestream::flush" (see "kdu_compressed.h"), the rate allocator - // will then assign the layers in such a way as to achieve roughly - // two quality layers per octave change in bit-rate, with the final - // layer reaching true lossless quality. - - codestream.flush(layer_bytes,1); - // You can see how many bytes were assigned - // to each quality layer by looking at the entries of `layer_bytes' here. - // The flush function can do a lot of interesting things which you may - // want to spend some time looking into. In addition to targeting - // specific bit-rates for each quality layer, it can be configured to - // use rate-distortion slope thresholds of your choosing and to return - // the thresholds which it finds to be best for any particular set of - // target layer sizes. This opens the door to feedback-oriented rate - // control for video. You should also look into the - // "kdu_codestream::set_max_bytes" and - // "kdu_codestream::set_min_slope_threshold" functions which can be - // used to significantly speed up compression. - codestream.destroy(); // All done: simple as that. - - // Now that we're done encoding, create the new data buffer for the compressed - // image and stick it there. - - U8 *output_data = new U8[output_size]; - - memcpy(output_data, output_buffer, output_size); - - output.close(); // Not really necessary here. - - delete[] output_buffer; - - return output_data; -} - - -void LLBlockEncoder::setBPP(const F32 bpp) -{ - mBPP = bpp; -} diff --git a/indra/llkdu/llblockencoder.h b/indra/llkdu/llblockencoder.h deleted file mode 100644 index 21381a27fa..0000000000 --- a/indra/llkdu/llblockencoder.h +++ /dev/null @@ -1,49 +0,0 @@ -/** - * @file llblockencoder.h - * @brief Image block compression - * - * $LicenseInfo:firstyear=2010&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLBLOCKENCODER_H -#define LL_LLBLOCKENCODER_H - -#include "stdtypes.h" - -class LLBlockData; -class LLBlockDataU32; -class LLBlockDataF32; - -class LLBlockEncoder -{ - F32 mBPP; // bits per point -public: - LLBlockEncoder(); - U8 *encode(const LLBlockData &block_data, U32 &output_size) const; - U8 *encodeU32(const LLBlockDataU32 &block_data, U32 &output_size) const; - U8 *encodeF32(const LLBlockDataF32 &block_data, U32 &output_size) const; - - void setBPP(const F32 bpp); -}; - -#endif // LL_LLBLOCKENCODER_H - -- cgit v1.2.3 From a991bd7f90157a9cc661ef17a6f96e8473e3bd58 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 2 Dec 2010 14:50:57 -0800 Subject: SOCIAL-311 FIX Media browser has too many oddities to be useful for viewer web apps Completes MVP --- indra/llplugin/llpluginclassmedia.cpp | 4 +- indra/llplugin/llpluginclassmedia.h | 4 +- indra/newview/llfloaterwebcontent.cpp | 59 ++++++++++++++++------- indra/newview/llfloaterwebcontent.h | 5 +- indra/newview/skins/default/textures/textures.xml | 4 +- 5 files changed, 52 insertions(+), 24 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index de4456aa4e..e6c901dd5c 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1049,8 +1049,8 @@ void LLPluginClassMedia::receivePluginMessage(const LLPluginMessage &message) } else if(message_name == "link_hovered") { - // Link and text are not currently used -- the tooltip hover text is taken from the "title". - // message.getValue("link"); + // text is not currently used -- the tooltip hover text is taken from the "title". + mHoverLink = message.getValue("link"); mHoverText = message.getValue("title"); // message.getValue("text"); diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index fa4dc2b43f..abc472f501 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -242,8 +242,9 @@ public: std::string getAuthURL() const { return mAuthURL; }; std::string getAuthRealm() const { return mAuthRealm; }; - // This is valid during MEDIA_EVENT_LINK_HOVERED + // These are valid during MEDIA_EVENT_LINK_HOVERED std::string getHoverText() const { return mHoverText; }; + std::string getHoverLink() const { return mHoverLink; }; std::string getMediaName() const { return mMediaName; }; std::string getMediaDescription() const { return mMediaDescription; }; @@ -385,6 +386,7 @@ protected: std::string mAuthURL; std::string mAuthRealm; std::string mHoverText; + std::string mHoverLink; ///////////////////////////////////////// // media_time class diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 8e5638f549..31b6c3fc49 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -37,26 +37,26 @@ #include "llfloaterwebcontent.h" -LLFloaterWebContent::LLFloaterWebContent(const LLSD& key) - : LLFloater(key) +LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) + : LLFloater( key ) { - mCommitCallbackRegistrar.add("WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this)); - mCommitCallbackRegistrar.add("WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this)); - mCommitCallbackRegistrar.add("WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this)); + mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); + mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); + mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this )); - mCommitCallbackRegistrar.add("WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this)); + mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this )); } BOOL LLFloaterWebContent::postBuild() { // these are used in a bunch of places so cache them - mWebBrowser = getChild("webbrowser"); - mAddressCombo = getChild("address"); - mStatusBarText = getChild("statusbartext"); - mStatusBarProgress = getChild("statusbarprogress"); + mWebBrowser = getChild< LLMediaCtrl >( "webbrowser" ); + mAddressCombo = getChild< LLComboBox >( "address" ); + mStatusBarText = getChild< LLTextBox >( "statusbartext" ); + mStatusBarProgress = getChild("statusbarprogress" ); // observe browser events - mWebBrowser->addObserver(this); + mWebBrowser->addObserver( this ); // these button are always enabled getChildView("reload")->setEnabled( true ); @@ -65,7 +65,7 @@ BOOL LLFloaterWebContent::postBuild() } //static -void LLFloaterWebContent::create(const std::string &url, const std::string& target, const std::string& uuid) +void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid ) { lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; @@ -194,11 +194,22 @@ void LLFloaterWebContent::onClose(bool app_quitting) destroy(); } +// virtual +void LLFloaterWebContent::draw() +{ + // this is asychronous so we need to keep checking + getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); + getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + + LLFloater::draw(); +} + +// virtual void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) { if(event == MEDIA_EVENT_LOCATION_CHANGED) { - const std::string url = self->getStatusText(); + const std::string url = self->getLocation(); if ( url.length() ) mStatusBarText->setText( url ); @@ -211,11 +222,11 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); - // manually decide on the state of this button + // toggle visibility of these buttons based on browser state getChildView("reload")->setVisible( false ); getChildView("stop")->setVisible( true ); - // turn "on" progress bar now we're loaded + // turn "on" progress bar now we're about to start loading mStatusBarProgress->setVisible( true ); } else if(event == MEDIA_EVENT_NAVIGATE_COMPLETE) @@ -224,12 +235,16 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent getChildView("back")->setEnabled( self->getHistoryBackAvailable() ); getChildView("forward")->setEnabled( self->getHistoryForwardAvailable() ); - // manually decide on the state of this button + // toggle visibility of these buttons based on browser state getChildView("reload")->setVisible( true ); getChildView("stop")->setVisible( false ); // turn "off" progress bar now we're loaded mStatusBarProgress->setVisible( false ); + + // we populate the status bar with URLs as they change so clear it now we're done + const std::string end_str = ""; + mStatusBarText->setText( end_str ); } else if(event == MEDIA_EVENT_CLOSE_REQUEST) { @@ -256,6 +271,11 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent std::string page_title = self->getMediaName(); setTitle( page_title ); } + else if(event == MEDIA_EVENT_LINK_HOVERED ) + { + const std::string link = self->getHoverLink(); + mStatusBarText->setText( link ); + } } void LLFloaterWebContent::set_current_url(const std::string& url) @@ -300,5 +320,10 @@ void LLFloaterWebContent::onClickStop() void LLFloaterWebContent::onEnterAddress() { - mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); + // make sure there is at least something there. + // (perhaps this test should be for minimum length of a URL) + if ( mAddressCombo->getValue().asString().length() > 0 ) + { + mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); + }; } diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index b41da57a6f..1effa2c4ab 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -49,8 +49,9 @@ public: static void geometryChanged(const std::string &uuid, S32 x, S32 y, S32 width, S32 height); void geometryChanged(S32 x, S32 y, S32 width, S32 height); - /*virtual*/ BOOL postBuild(); - /*virtual*/ void onClose(bool app_quitting); + /* virtual */ BOOL postBuild(); + /* virtual */ void onClose(bool app_quitting); + /* virtual */ void draw(); // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index b2658d2525..0314ef2cff 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -392,7 +392,7 @@ with the same filename but different name - + @@ -468,7 +468,7 @@ with the same filename but different name - + -- cgit v1.2.3 From 1405d198d60081531edeeb996c2fc07841808335 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 2 Dec 2010 14:51:25 -0800 Subject: SOCIAL-315 FIX Update Qt/LLQtWebKit version number in the viewer to 4.7.1 from 4.6 --- indra/newview/llfloaterabout.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterabout.cpp b/indra/newview/llfloaterabout.cpp index 135137069c..36e26d3fea 100644 --- a/indra/newview/llfloaterabout.cpp +++ b/indra/newview/llfloaterabout.cpp @@ -272,7 +272,7 @@ LLSD LLFloaterAbout::getInfo() } // TODO: Implement media plugin version query - info["QT_WEBKIT_VERSION"] = "4.6 (version number hard-coded)"; + info["QT_WEBKIT_VERSION"] = "4.7.1 (version number hard-coded)"; if (gPacketsIn > 0) { -- cgit v1.2.3 From 922b1f26b7279b5f54562c413c333463fe34473b Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 2 Dec 2010 18:42:47 -0500 Subject: ESC-211 Metrics data sink - fix delivery by viewer The TextureFetch thread was still stalling out due to a different path that determines whether there is work or not in the thread (uses getPending()) and that had to be harmonized with the changes to runCondition(). I'm not happy with this solution but a refactor of the LLThread tree isn't in the cards right now. --- indra/llcommon/llqueuedthread.h | 2 +- indra/newview/lltexturefetch.cpp | 89 +++++++++++++++++++++++++++++++++++----- indra/newview/lltexturefetch.h | 1 + 3 files changed, 80 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llcommon/llqueuedthread.h b/indra/llcommon/llqueuedthread.h index c75e0e2bbf..a53b22f6fc 100644 --- a/indra/llcommon/llqueuedthread.h +++ b/indra/llcommon/llqueuedthread.h @@ -179,7 +179,7 @@ public: void waitOnPending(); void printQueueStats(); - S32 getPending(); + virtual S32 getPending(); bool getThreaded() { return mThreaded ? true : false; } // Request accessors diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 3793085e55..dd84290e90 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -568,6 +568,14 @@ public: LLSD * mReportMain; }; +/* + * Count of POST requests outstanding. We maintain the count + * indirectly in the CURL request responder's ctor and dtor and + * use it when determining whether or not to sleep the flag. Can't + * use the LLCurl module's request counter as it isn't thread compatible. + */ +LLAtomic32 curl_post_request_count = 0; + } // end of anonymous namespace @@ -2084,6 +2092,33 @@ bool LLTextureFetch::updateRequestPriority(const LLUUID& id, F32 priority) return res; } +// Replicates and expands upon the base class's +// getPending() implementation. getPending() and +// runCondition() replicate one another's logic to +// an extent and are sometimes used for the same +// function (deciding whether or not to sleep/pause +// a thread). So the implementations need to stay +// in step, at least until this can be refactored and +// the redundancy eliminated. +// +// May be called from any thread + +//virtual +S32 LLTextureFetch::getPending() +{ + S32 res; + lockData(); + { + LLMutexLock lock(&mQueueMutex); + + res = mRequestQueue.size(); + res += curl_post_request_count; + res += mCommands.size(); + } + unlockData(); + return res; +} + // virtual bool LLTextureFetch::runCondition() { @@ -2100,7 +2135,12 @@ bool LLTextureFetch::runCondition() have_no_commands = mCommands.empty(); } - return ! (have_no_commands && mRequestQueue.empty() && mIdleThread); + + bool have_no_curl_requests(0 == curl_post_request_count); + + return ! (have_no_commands + && have_no_curl_requests + && (mRequestQueue.empty() && mIdleThread)); } ////////////////////////////////////////////////////////////////////////////// @@ -2116,7 +2156,7 @@ void LLTextureFetch::commonUpdate() if (processed > 0) { lldebugs << "processed: " << processed << " messages." << llendl; - } + } } @@ -2766,31 +2806,56 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) * the referenced data is part of a pseudo-closure for * this responder rather than being required for correct * operation. + * + * We don't try very hard with the POST request. We give + * it one shot and that's more-or-less it. With a proper + * refactoring of the LLQueuedThread usage, these POSTs + * could be put in a request object and made more reliable. */ class lcl_responder : public LLCurl::Responder { public: - lcl_responder(volatile bool & reporting_break, + lcl_responder(S32 expected_sequence, + volatile const S32 & live_sequence, + volatile bool & reporting_break, volatile bool & reporting_started) - : LLHTTPClient::Responder(), + : LLCurl::Responder(), + mExpectedSequence(expected_sequence), + mLiveSequence(live_sequence), mReportingBreak(reporting_break), mReportingStarted(reporting_started) - {} + { + curl_post_request_count++; + } + + ~lcl_responder() + { + curl_post_request_count--; + } // virtual void error(U32 status_num, const std::string & reason) { - mReportingBreak = true; + if (mLiveSequence == mExpectedSequence) + { + mReportingBreak = true; + } } // virtual void result(const LLSD & content) { - mReportingBreak = false; - mReportingStarted = true; + if (mLiveSequence == mExpectedSequence) + { + mReportingBreak = false; + mReportingStarted = true; + } } + private: + S32 mExpectedSequence; + volatile const S32 & mLiveSequence; volatile bool & mReportingBreak; volatile bool & mReportingStarted; }; @@ -2799,8 +2864,8 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) return true; static volatile bool reporting_started(false); - static S32 report_sequence(0); - + static volatile S32 report_sequence(0); + // We've already taken over ownership of the LLSD at this point // and can do normal LLSD sharing operations at this point. But // still being careful, regardless. @@ -2826,7 +2891,9 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) fetcher->getCurlRequest().post(mCapsURL, headers, thread1_stats, - new lcl_responder(LLTextureFetch::svMetricsDataBreak, + new lcl_responder(report_sequence, + report_sequence, + LLTextureFetch::svMetricsDataBreak, reporting_started)); } else diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index 03e2462058..af30d1bb3b 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -78,6 +78,7 @@ public: S32 getNumHTTPRequests() ; // Public for access by callbacks + S32 getPending(); void lockQueue() { mQueueMutex.lock(); } void unlockQueue() { mQueueMutex.unlock(); } LLTextureFetchWorker* getWorker(const LLUUID& id); -- cgit v1.2.3 From 84a50386be1ef34100e153666389ffacf03e8e8b Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 2 Dec 2010 18:46:26 -0800 Subject: SOCIAL-317 FIX LLWebContentFloater opens popups in the media browser --- indra/newview/llmediactrl.cpp | 13 ++++++++++++- indra/newview/llweb.cpp | 17 +++++++++++++++++ indra/newview/llweb.h | 1 + 3 files changed, 30 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 08d07f9540..eaa2a60938 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -55,6 +55,8 @@ #include "llcheckboxctrl.h" #include "llnotifications.h" #include "lllineeditor.h" +#include "llfloatermediabrowser.h" +#include "llfloaterwebcontent.h" extern BOOL gRestoreGL; @@ -1331,7 +1333,16 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) { if (response["open"]) { - LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); + std::string floater_name = gFloaterView->getParentFloater(this)->getInstanceName(); + if ( floater_name == "media_browser" ) + { + LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); + } + else + if ( floater_name == "web_content" ) + { + LLWeb::loadWebURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); + } } else { diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 91a713be56..2ecab2cbdf 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -96,6 +96,23 @@ void LLWeb::loadURL(const std::string& url, const std::string& target, const std } } +// static +void LLWeb::loadWebURL(const std::string& url, const std::string& target, const std::string& uuid) +{ + if(target == "_internal") + { + // Force load in the internal browser, as if with a blank target. + loadWebURLInternal(url, "", uuid); + } + else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) + { + loadURLExternal(url); + } + else + { + loadWebURLInternal(url, target, uuid); + } +} // static void LLWeb::loadURLInternal(const std::string &url, const std::string& target, const std::string& uuid) diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index 3fe5a4dcad..a74d4b6364 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -58,6 +58,7 @@ public: static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null); // Explicitly open a Web URL using the Web content floater vs. the more general media browser + static void LLWeb::loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); static void loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid); static void loadWebURLInternal(const std::string &url) { loadWebURLInternal(url, LLStringUtil::null, LLStringUtil::null); } -- cgit v1.2.3 From abc13fb12faab4d6198fb4496da9559a8ca1d854 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Thu, 2 Dec 2010 22:26:49 -0800 Subject: STORM-151 : First shot at compression, not optimzed yet --- indra/llkdu/llimagej2ckdu.cpp | 196 +++++++++++++++++++++++++++++++----------- 1 file changed, 146 insertions(+), 50 deletions(-) (limited to 'indra') diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 147b9829c5..21c91be1f7 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -31,6 +31,38 @@ #include "llpointer.h" #include "llkdumem.h" + +class kdc_flow_control { +public: // Member functions + kdc_flow_control(kdu_image_in_base *img_in, kdu_codestream codestream); + ~kdc_flow_control(); + bool advance_components(); + void process_components(); +private: // Data + + struct kdc_component_flow_control { + public: // Data + kdu_image_in_base *reader; + int vert_subsampling; + int ratio_counter; /* Initialized to 0, decremented by `count_delta'; + when < 0, a new line must be processed, after + which it is incremented by `vert_subsampling'. */ + int initial_lines; + int remaining_lines; + kdu_line_buf *line; + }; + + kdu_codestream codestream; + kdu_dims valid_tile_indices; + kdu_coords tile_idx; + kdu_tile tile; + int num_components; + kdc_component_flow_control *components; + int count_delta; // Holds the minimum of the `vert_subsampling' fields. + kdu_multi_analysis engine; + kdu_long max_buffer_memory; +}; + // // Kakadu specific implementation // @@ -38,7 +70,7 @@ void set_default_colour_weights(kdu_params *siz); const char* engineInfoLLImageJ2CKDU() { - return "KDU"; + return "KDU v6.4.1"; } LLImageJ2CKDU* createLLImageJ2CKDU() @@ -474,16 +506,14 @@ BOOL LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time, BOOL reversible) { // Collect simple arguments. -/* bool transpose, vflip, hflip; - bool allow_rate_prediction, allow_shorts, mem, quiet, no_weights; + bool allow_rate_prediction, mem, quiet, no_weights; int cpu_iterations; std::ostream *record_stream; transpose = false; record_stream = NULL; allow_rate_prediction = true; - allow_shorts = true; no_weights = false; cpu_iterations = -1; mem = false; @@ -620,51 +650,24 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co codestream.change_appearance(transpose,vflip,hflip); // Now we are ready for sample data processing. - - int x_tnum; - kdu_dims tile_indices; codestream.get_valid_tiles(tile_indices); - kdc_flow_control **tile_flows = new kdc_flow_control *[tile_indices.size.x]; - for (x_tnum=0; x_tnum < tile_indices.size.x; x_tnum++) - { - tile_flows[x_tnum] = new kdc_flow_control(&mem_in,codestream,x_tnum,allow_shorts); - } - bool done = false; - - while (!done) - { - while (!done) - { // Process a row of tiles line by line. - done = true; - for (x_tnum=0; x_tnum < tile_indices.size.x; x_tnum++) - { - if (tile_flows[x_tnum]->advance_components()) - { - done = false; - tile_flows[x_tnum]->process_components(); - } - } - } - for (x_tnum=0; x_tnum < tile_indices.size.x; x_tnum++) - { - if (tile_flows[x_tnum]->advance_tile()) - { - done = false; - } - } - } - int sample_bytes = 0; - for (x_tnum=0; x_tnum < tile_indices.size.x; x_tnum++) - { - sample_bytes += tile_flows[x_tnum]->get_buffer_memory(); - delete tile_flows[x_tnum]; - } - delete [] tile_flows; - - // Produce the compressed output. - - codestream.flush(layer_bytes,num_layer_specs, NULL, true, false); + kdc_flow_control *tile = new kdc_flow_control(&mem_in,codestream); + bool done = false; + while (!done) + { + // Process line by line + done = true; + if (tile->advance_components()) + { + done = false; + tile->process_components(); + } + } + + // Produce the compressed output + codestream.flush(layer_bytes,num_layer_specs); // Cleanup + delete tile; codestream.destroy(); if (record_stream != NULL) @@ -692,9 +695,6 @@ BOOL LLImageJ2CKDU::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, co } return TRUE; - */ - // Compression not implemented yet - return FALSE; } BOOL LLImageJ2CKDU::getMetadata(LLImageJ2C &base) @@ -1014,3 +1014,99 @@ separation between consecutive rows in the real buffer. */ } return TRUE; } + +// kdc_flow_control + +kdc_flow_control::kdc_flow_control (kdu_image_in_base *img_in, kdu_codestream codestream) +{ + int n; + + this->codestream = codestream; + codestream.get_valid_tiles(valid_tile_indices); + tile_idx = valid_tile_indices.pos; + tile = codestream.open_tile(tile_idx,NULL); + + // Set up the individual components + num_components = codestream.get_num_components(true); + components = new kdc_component_flow_control[num_components]; + count_delta = 0; + kdc_component_flow_control *comp = components; + for (n = 0; n < num_components; n++, comp++) + { + comp->line = NULL; + comp->reader = img_in; + kdu_coords subsampling; + codestream.get_subsampling(n,subsampling,true); + kdu_dims dims; + codestream.get_tile_dims(tile_idx,n,dims,true); + comp->vert_subsampling = subsampling.y; + if ((n == 0) || (comp->vert_subsampling < count_delta)) + { + count_delta = comp->vert_subsampling; + } + comp->ratio_counter = 0; + comp->remaining_lines = comp->initial_lines = dims.size.y; + } + assert(num_components > 0); + + tile.set_components_of_interest(num_components); + max_buffer_memory = engine.create(codestream,tile,false,NULL,false,1,NULL,NULL,false); +} + +kdc_flow_control::~kdc_flow_control() +{ + if (components != NULL) + delete[] components; + if (engine.exists()) + engine.destroy(); +} + +bool kdc_flow_control::advance_components() +{ + bool found_line = false; + while (!found_line) + { + bool all_done = true; + kdc_component_flow_control *comp = components; + for (int n = 0; n < num_components; n++, comp++) + { + assert(comp->ratio_counter >= 0); + if (comp->remaining_lines > 0) + { + all_done = false; + comp->ratio_counter -= count_delta; + if (comp->ratio_counter < 0) + { + found_line = true; + comp->line = engine.exchange_line(n,NULL,NULL); + assert(comp->line != NULL); + if (comp->line->get_width()) + { + comp->reader->get(n,*(comp->line),0); + } + } + } + } + if (all_done) + return false; + } + return true; +} + +void kdc_flow_control::process_components() +{ + kdc_component_flow_control *comp = components; + for (int n = 0; n < num_components; n++, comp++) + { + if (comp->ratio_counter < 0) + { + comp->ratio_counter += comp->vert_subsampling; + assert(comp->ratio_counter >= 0); + assert(comp->remaining_lines > 0); + comp->remaining_lines--; + assert(comp->line != NULL); + engine.exchange_line(n,comp->line,NULL); + comp->line = NULL; + } + } +} -- cgit v1.2.3 From 106134b6950b55a8462fc3444db781104eb6bf5e Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 3 Dec 2010 03:37:37 -0500 Subject: Fix for OK notification being overlaid by Keep/Discard/Block notification --- indra/newview/llscreenchannel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 61f4897ed0..92a06b763f 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -485,7 +485,7 @@ void LLScreenChannel::modifyToastByNotificationID(LLUUID id, LLPanel* panel) //-------------------------------------------------------------------------- void LLScreenChannel::redrawToasts() { - if(mToastList.size() == 0 || isHovering()) + if(mToastList.size() == 0) return; switch(mToastAlignment) -- cgit v1.2.3 From 50b6114862ee105b084975bcc8c455f0a1d411d8 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 3 Dec 2010 07:30:19 -0500 Subject: Tiny change to panel_login.xml so Start Location preferences work under all circumstances --- indra/newview/skins/default/xui/en/panel_login.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_login.xml b/indra/newview/skins/default/xui/en/panel_login.xml index b181ca3bba..89feba7c3c 100644 --- a/indra/newview/skins/default/xui/en/panel_login.xml +++ b/indra/newview/skins/default/xui/en/panel_login.xml @@ -127,7 +127,7 @@ top="20" Date: Fri, 3 Dec 2010 10:34:54 -0800 Subject: SOCIAL-318 FIX Example plugin doesn't render anything --- .../media_plugins/example/media_plugin_example.cpp | 733 +++++++++------------ 1 file changed, 329 insertions(+), 404 deletions(-) (limited to 'indra') diff --git a/indra/media_plugins/example/media_plugin_example.cpp b/indra/media_plugins/example/media_plugin_example.cpp index f8a871930e..da7de01799 100644 --- a/indra/media_plugins/example/media_plugin_example.cpp +++ b/indra/media_plugins/example/media_plugin_example.cpp @@ -6,21 +6,21 @@ * $LicenseInfo:firstyear=2008&license=viewerlgpl$ * Second Life Viewer Source Code * Copyright (C) 2010, Linden Research, Inc. - * + * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; * version 2.1 of the License only. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * + * * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA * $/LicenseInfo$ * @endcond @@ -39,48 +39,48 @@ //////////////////////////////////////////////////////////////////////////////// // class MediaPluginExample : - public MediaPluginBase + 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; + 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 ) + MediaPluginBase( host_send_func, host_user_data ) { - mFirstTime = true; - mWidth = 0; - mHeight = 0; - mDepth = 4; - mPixels = 0; - mMouseButtonDown = false; - mStopAction = false; - mLastUpdateTime = 0; + mFirstTime = true; + mWidth = 0; + mHeight = 0; + mDepth = 4; + mPixels = 0; + mMouseButtonDown = false; + mStopAction = false; + mLastUpdateTime = 0; } //////////////////////////////////////////////////////////////////////////////// @@ -93,395 +93,320 @@ 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 ); - } - 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 == "init" ) - { - // Plugin gets to decide the texture parameters to use. - LLPluginMessage message( 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 == "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; - }; - }; +// 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 = "Example plugin 1.0..0"; + message.setValue("plugin_version", plugin_version); + 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") + { + } + 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 << "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 == "init") + { + // Plugin gets to decide the texture parameters to use. + mDepth = 4; + LLPluginMessage message(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 == "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; + }; + }; + + 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") + { + } + else if(message_name == "mouse_event") + { + std::string event = message_in.getValue("event"); + if(event == "down") + { + + } + else if(event == "up") + { + } + else if(event == "double_click") + { + } + } + } + else + { +// std::cerr << "MediaPluginWebKit::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 ); - }; + // 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 ); + 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 ); + LLPluginMessage message( LLPLUGIN_MESSAGE_CLASS_MEDIA, "name_text" ); + message.setValue( "name", "Example Plugin" ); + sendMessage( message ); - return true; + return true; }; //////////////////////////////////////////////////////////////////////////////// // int init_media_plugin( LLPluginInstance::sendMessageFunction host_send_func, - void* host_user_data, - LLPluginInstance::sendMessageFunction *plugin_send_func, - void **plugin_user_data ) + 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; + MediaPluginExample* self = new MediaPluginExample( host_send_func, host_user_data ); + *plugin_send_func = MediaPluginExample::staticReceiveMessage; + *plugin_user_data = ( void* )self; - return 0; + return 0; } + -- cgit v1.2.3 From 7ed0938226d377e4945e9eea65ef4e4856716fbd Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 3 Dec 2010 20:45:53 +0200 Subject: STORM-579 FIXED SLURLs color for residents and objects names in plain text chat match the user setting for "URLs" in the Color tab in Prefs. Avatar names SLURLs now use the user color setting for "URLs" everywhere across the viewer. --- indra/llui/llurlentry.cpp | 4 ++-- indra/newview/llchathistory.cpp | 14 ++++++-------- 2 files changed, 8 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index 6cc72bad82..f25be55665 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -456,8 +456,8 @@ std::string LLUrlEntryAgent::getLabel(const std::string &url, const LLUrlLabelCa LLStyle::Params LLUrlEntryAgent::getStyle() const { LLStyle::Params style_params = LLUrlEntryBase::getStyle(); - style_params.color = LLUIColorTable::instance().getColor("AgentLinkColor"); - style_params.readonly_color = LLUIColorTable::instance().getColor("AgentLinkColor"); + style_params.color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params.readonly_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); return style_params; } diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 271ee0c4a4..6e778de2d8 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -789,24 +789,22 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL // set the link for the object name to be the objectim SLapp // (don't let object names with hyperlinks override our objectim Url) LLStyle::Params link_params(style_params); - link_params.color.control = "HTMLLinkColor"; + LLColor4 link_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + link_params.color = link_color; + link_params.readonly_color = link_color; link_params.is_link = true; link_params.link_href = url; + mEditor->appendText(chat.mFromName + delimiter, false, link_params); } else if ( chat.mFromName != SYSTEM_FROM && chat.mFromID.notNull() && !message_from_log) { LLStyle::Params link_params(style_params); - - // Setting is_link = true for agent SLURL to avoid applying default style to it. - // See LLTextBase::appendTextImpl(). - link_params.is_link = true; - link_params.link_href = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString(); + link_params.overwriteFrom(LLStyleMap::instance().lookupAgent(chat.mFromID)); // Add link to avatar's inspector and delimiter to message. - mEditor->appendText(chat.mFromName, false, link_params); - mEditor->appendText(delimiter, false, style_params); + mEditor->appendText(std::string(link_params.link_href) + delimiter, false, link_params); } else { -- cgit v1.2.3 From ca76c55847cdaabe662c880c4d744916c8ca71ac Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 3 Dec 2010 12:31:12 -0800 Subject: ESC-211 ESC-222 Viewer/Sim comms and outbound data throttle Cleaned up some of the messaging code that sends the LLSD stats report off to the viewer. Added WARNS-level messages when there's a problem with delivery that will result in a data break. Users probably won't care. Added an outbound data throttle that limits stats to the 10 regions of longest occupancy. Should be a reasonable first cut. --- indra/newview/lltexturefetch.cpp | 75 ++++++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index dd84290e90..b46f338303 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include +#include #include "llstl.h" @@ -446,7 +447,7 @@ namespace * . +-----+ * . | * . +-----+ - * . | CP |--> HTTP PUT + * . | CP |--> HTTP POST * . +-----+ * . . * . . @@ -469,7 +470,7 @@ namespace * new region. * TE - Timer Expired. Metrics timer has expired (on the order * of 10 minutes). - * CP - CURL Put + * CP - CURL Post * MSC - Modify Stats Collector. State change in the thread-local * collector. Typically a region change which affects the * global pointers used to find the 'current stats'. @@ -571,11 +572,23 @@ public: /* * Count of POST requests outstanding. We maintain the count * indirectly in the CURL request responder's ctor and dtor and - * use it when determining whether or not to sleep the flag. Can't + * use it when determining whether or not to sleep the thread. Can't * use the LLCurl module's request counter as it isn't thread compatible. */ LLAtomic32 curl_post_request_count = 0; - + +/* + * Examines the merged viewer metrics report and if found to be too long, + * will attempt to truncate it in some reasonable fashion. + * + * @param max_regions Limit of regions allowed in report. + * + * @param metrics Full, merged viewer metrics report. + * + * @returns If data was truncated, returns true. + */ +bool truncate_viewer_metrics(int max_regions, LLSD & metrics); + } // end of anonymous namespace @@ -2128,7 +2141,9 @@ bool LLTextureFetch::runCondition() // private method which is unfortunate. I want to use it directly // but I'm going to have to re-implement the logic here (or change // declarations, which I don't want to do right now). - + // + // Changes here may need to be reflected in getPending(). + bool have_no_commands(false); { LLMutexLock lock(&mQueueMutex); @@ -2139,8 +2154,8 @@ bool LLTextureFetch::runCondition() bool have_no_curl_requests(0 == curl_post_request_count); return ! (have_no_commands - && have_no_curl_requests - && (mRequestQueue.empty() && mIdleThread)); + && have_no_curl_requests + && (mRequestQueue.empty() && mIdleThread)); // From base class } ////////////////////////////////////////////////////////////////////////////// @@ -2840,6 +2855,8 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) { mReportingBreak = true; } + LL_WARNS("Texture") << "Break in metrics stream due to POST failure to metrics collection service. Reason: " + << reason << LL_ENDL; } // virtual @@ -2851,14 +2868,14 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) mReportingStarted = true; } } - private: S32 mExpectedSequence; volatile const S32 & mLiveSequence; volatile bool & mReportingBreak; volatile bool & mReportingStarted; - }; + + }; // class lcl_responder if (! gViewerAssetStatsThread1) return true; @@ -2884,7 +2901,9 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) // Merge the two LLSDs into a single report LLViewerAssetStatsFF::merge_stats(main_stats, thread1_stats); - // *TODO: Consider putting a report size limiter here. + // Limit the size of the stats report if necessary. + thread1_stats["truncated"] = truncate_viewer_metrics(10, thread1_stats); + if (! mCapsURL.empty()) { LLCurlRequest::headers_t headers; @@ -2912,6 +2931,42 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) return true; } + +bool +truncate_viewer_metrics(int max_regions, LLSD & metrics) +{ + static const LLSD::String reg_tag("regions"); + static const LLSD::String duration_tag("duration"); + + LLSD & reg_map(metrics[reg_tag]); + if (reg_map.size() <= max_regions) + { + return false; + } + + // Build map of region hashes ordered by duration + typedef std::multimap reg_ordered_list_t; + reg_ordered_list_t regions_by_duration; + + LLSD::map_const_iterator it_end(reg_map.endMap()); + for (LLSD::map_const_iterator it(reg_map.beginMap()); it_end != it; ++it) + { + LLSD::Integer duration = (it->second)[duration_tag].asInteger(); + regions_by_duration.insert(reg_ordered_list_t::value_type(duration, it->first)); + } + + // Erase excess region reports selecting shortest duration first + reg_ordered_list_t::const_iterator it2_end(regions_by_duration.end()); + reg_ordered_list_t::const_iterator it2(regions_by_duration.begin()); + int limit(regions_by_duration.size() - max_regions); + for (int i(0); i < limit && it2_end != it2; ++i, ++it2) + { + reg_map.erase(it2->second); + } + + return true; +} + } // end of anonymous namespace -- cgit v1.2.3 From 894db03cfd4fc1720c643db14652a16d86d1ab90 Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Fri, 3 Dec 2010 23:01:10 +0200 Subject: STORM-378 ADDITIONAL FIX Fixed playing snapshot animation and sound when a snapshot is refreshed. --- indra/newview/llfloatersnapshot.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index d55272c558..05f8f9268d 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -908,6 +908,8 @@ BOOL LLSnapshotLivePreview::onIdle( void* snapshot_preview ) previewp->mPosTakenGlobal = gAgentCamera.getCameraPositionGlobal(); previewp->mShineCountdown = 4; // wait a few frames to avoid animation glitch due to readback this frame } + + gViewerWindow->playSnapshotAnimAndSound(); } previewp->getWindow()->decBusyCount(); // only show fullscreen preview when in freeze frame mode @@ -1533,8 +1535,6 @@ void LLFloaterSnapshot::Impl::onClickNewSnapshot(void* data) if (previewp && view) { previewp->updateSnapshot(TRUE); - - gViewerWindow->playSnapshotAnimAndSound(); } } @@ -2204,8 +2204,6 @@ void LLFloaterSnapshot::onOpen(const LLSD& key) gSnapshotFloaterView->setEnabled(TRUE); gSnapshotFloaterView->setVisible(TRUE); gSnapshotFloaterView->adjustToFitScreen(this, FALSE); - - gViewerWindow->playSnapshotAnimAndSound(); } void LLFloaterSnapshot::onClose(bool app_quitting) -- cgit v1.2.3 From 7305adab32f88be2d610234cc32a5781803316fd Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 3 Dec 2010 17:57:46 -0500 Subject: Found and disabled another place where hovered notifications were being handled --- indra/newview/llscreenchannel.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 92a06b763f..8dd5f068b6 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -835,7 +835,6 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter) } } - if(!isHovering()) redrawToasts(); } -- cgit v1.2.3 From 468b44e2831241665e3cc0dfcf358cc2e8d6b389 Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 3 Dec 2010 15:00:32 -0800 Subject: Silly whitespace issue - no code change. --- indra/newview/llfloaterwebcontent.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 31b6c3fc49..b2391cc54c 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -194,15 +194,15 @@ void LLFloaterWebContent::onClose(bool app_quitting) destroy(); } -// virtual -void LLFloaterWebContent::draw() -{ - // this is asychronous so we need to keep checking - getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); - getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); - - LLFloater::draw(); -} +// virtual +void LLFloaterWebContent::draw() +{ + // this is asychronous so we need to keep checking + getChildView( "back" )->setEnabled( mWebBrowser->canNavigateBack() ); + getChildView( "forward" )->setEnabled( mWebBrowser->canNavigateForward() ); + + LLFloater::draw(); +} // virtual void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) -- cgit v1.2.3 From 6924998e85c5637c190c2c97bb94fa421cc6774e Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 3 Dec 2010 15:02:56 -0800 Subject: SOCIAL-333 FIX Order of buttons on Web content floater is wrong --- .../skins/default/xui/en/floater_web_content.xml | 25 +++++++++++----------- 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index 97a7a0e737..d57cfe9cab 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -11,6 +11,7 @@ save_rect="true" auto_tile="true" title="WEB CONTENT" + initial_mime_type="text/html" width="820"> + function="WebContent.Stop" /> + Date: Fri, 3 Dec 2010 15:27:01 -0800 Subject: Fix build break on the mac. --- indra/newview/llweb.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llweb.h b/indra/newview/llweb.h index a74d4b6364..dc5958e57f 100644 --- a/indra/newview/llweb.h +++ b/indra/newview/llweb.h @@ -58,7 +58,7 @@ public: static void loadURLExternal(const std::string& url, bool async, const std::string& uuid = LLStringUtil::null); // Explicitly open a Web URL using the Web content floater vs. the more general media browser - static void LLWeb::loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); + static void loadWebURL(const std::string& url, const std::string& target, const std::string& uuid); static void loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid); static void loadWebURLInternal(const std::string &url) { loadWebURLInternal(url, LLStringUtil::null, LLStringUtil::null); } -- cgit v1.2.3 From a59c43f1adff35107e59fdfc3016d4329324bbaf Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Fri, 3 Dec 2010 18:34:20 -0500 Subject: ESC-210 Non-active regions were getting extra duration time. Metrics were crediting inactive regions (those not current but contributing to the sample) with additional time at the end of the sample interval. Corrected. --- indra/newview/llviewerassetstats.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llviewerassetstats.cpp b/indra/newview/llviewerassetstats.cpp index cc41a95893..d798786277 100644 --- a/indra/newview/llviewerassetstats.cpp +++ b/indra/newview/llviewerassetstats.cpp @@ -240,8 +240,9 @@ LLViewerAssetStats::asLLSD() static const LLSD::String rmean_tag("resp_mean"); const duration_t now = LLViewerAssetStatsFF::get_timestamp(); - LLSD regions = LLSD::emptyMap(); + mCurRegionStats->accumulateTime(now); + LLSD regions = LLSD::emptyMap(); for (PerRegionContainer::iterator it = mRegionStats.begin(); mRegionStats.end() != it; ++it) @@ -253,7 +254,6 @@ LLViewerAssetStats::asLLSD() } PerRegionStats & stats = *it->second; - stats.accumulateTime(now); LLSD reg_stat = LLSD::emptyMap(); -- cgit v1.2.3 From 9dd837f6bb7686213bd204131fb3368e63a55f5e Mon Sep 17 00:00:00 2001 From: callum Date: Fri, 3 Dec 2010 15:35:23 -0800 Subject: SOCIAL-334 FIX Remove link color and action from status bar text in web content window --- indra/newview/skins/default/xui/en/floater_web_content.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index d57cfe9cab..eac1b4e712 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -138,6 +138,8 @@ layout="topleft" left_delta="0" name="statusbartext" + parse_urls="false" + text_color="0.4 0.4 0.4 1" top_pad="5" width="452"/> Date: Fri, 3 Dec 2010 15:47:32 -0800 Subject: SOCIAL-248 FIX Remove HEAD requests from WebKit This change makes LLFloaterWebContent always specify a MIME type of "text/html" when navigating to an URL. This tells the plugin system to skip the MIME type probe (which is what does the HEAD request) and just use the WebKit plugin. This means non-web content (such as QuickTime movies) may not work properly in the web content floater. Hopefully this won't be a problem... --- indra/newview/llfloaterwebcontent.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index b2391cc54c..ed66be165e 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -181,9 +181,10 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) { - mWebBrowser->setHomePageUrl(web_url); + // Specifying a mime type of text/html here causes the plugin system to skip the MIME type probe and just open a browser plugin. + mWebBrowser->setHomePageUrl(web_url, "text/html"); mWebBrowser->setTarget(target); - mWebBrowser->navigateTo(web_url); + mWebBrowser->navigateTo(web_url, "text/html"); set_current_url(web_url); } @@ -324,6 +325,6 @@ void LLFloaterWebContent::onEnterAddress() // (perhaps this test should be for minimum length of a URL) if ( mAddressCombo->getValue().asString().length() > 0 ) { - mWebBrowser->navigateTo( mAddressCombo->getValue().asString() ); + mWebBrowser->navigateTo( mAddressCombo->getValue().asString(), "text/html"); }; } -- cgit v1.2.3 From f70545382382182d7a65ff5c1945f9ef9897e196 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Fri, 3 Dec 2010 17:12:35 -0800 Subject: Fix for coding standard violations and build error on windows. --- indra/viewer_components/updater/llupdatedownloader.cpp | 4 +++- indra/viewer_components/updater/llupdaterservice.cpp | 5 +++-- indra/viewer_components/updater/llupdaterservice.h | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index 7b0f960ce4..ddc14129c2 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -24,6 +24,9 @@ */ #include "linden_common.h" + +#include "llupdatedownloader.h" + #include #include #include @@ -35,7 +38,6 @@ #include "llsd.h" #include "llsdserialize.h" #include "llthread.h" -#include "llupdatedownloader.h" #include "llupdaterservice.h" diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index 92a0a09137..dd93fa2550 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -25,10 +25,11 @@ #include "linden_common.h" +#include "llupdaterservice.h" + #include "llupdatedownloader.h" #include "llevents.h" #include "lltimer.h" -#include "llupdaterservice.h" #include "llupdatechecker.h" #include "llupdateinstaller.h" #include "llversionviewer.h" @@ -419,7 +420,7 @@ void LLUpdaterServiceImpl::downloadError(std::string const & message) event["payload"] = payload; LLEventPumps::instance().obtain("mainlooprepeater").post(event); - setState(LLUpdaterService::ERROR); + setState(LLUpdaterService::FAILURE); } void LLUpdaterServiceImpl::restartTimer(unsigned int seconds) diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 3763fbfde0..8b76a9d1e7 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -63,7 +63,7 @@ public: INSTALLING, UP_TO_DATE, TERMINAL, - ERROR + FAILURE }; LLUpdaterService(); -- cgit v1.2.3 From d0ec374e15c5a5a8edf59441d8b8350daeb8285b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 4 Dec 2010 12:15:47 +0200 Subject: STORM-717 WIP Cleanup: removed unused on_mouse_enter callback from LLToast. --- indra/newview/lltoast.cpp | 5 ----- indra/newview/lltoast.h | 4 +--- 2 files changed, 1 insertion(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltoast.cpp b/indra/newview/lltoast.cpp index 8176b8c1f9..8916469e67 100644 --- a/indra/newview/lltoast.cpp +++ b/indra/newview/lltoast.cpp @@ -141,10 +141,6 @@ LLToast::LLToast(const LLToast::Params& p) // init callbacks if present if(!p.on_delete_toast().empty()) mOnDeleteToastSignal.connect(p.on_delete_toast()); - - // *TODO: This signal doesn't seem to be used at all. - if(!p.on_mouse_enter().empty()) - mOnMouseEnterSignal.connect(p.on_mouse_enter()); } void LLToast::reshape(S32 width, S32 height, BOOL called_from_parent) @@ -402,7 +398,6 @@ void LLToast::onToastMouseEnter() { mHideBtn->setVisible(TRUE); } - mOnMouseEnterSignal(this); mToastMouseEnterSignal(this, getValue()); } } diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index fb534561c9..f88c628631 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -90,8 +90,7 @@ public: fading_time_secs; // Number of seconds while a toast is transparent - Optional on_delete_toast, - on_mouse_enter; + Optional on_delete_toast; Optional can_fade, can_be_stored, enable_hide_btn, @@ -182,7 +181,6 @@ public: // Registers signals/callbacks for events toast_signal_t mOnFadeSignal; - toast_signal_t mOnMouseEnterSignal; toast_signal_t mOnDeleteToastSignal; toast_signal_t mOnToastDestroyedSignal; boost::signals2::connection setOnFadeCallback(toast_callback_t cb) { return mOnFadeSignal.connect(cb); } -- cgit v1.2.3 From b9fa0e9bbe0db5ecdfb5fbdd88474e0d3bb8eed2 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 4 Dec 2010 13:07:51 +0200 Subject: STORM-717 FIXED Made nearby chat toasts respect transparency settings: * Normally toasts are as opaque as specified by "inactive floater opacity" setting. * When mouse is hovering a toast, the toast uses "active floater opacity" setting. * Fading toasts have 1/2 of "inactive floater opacity". --- indra/llui/lluictrl.cpp | 4 ++++ indra/llui/lluictrl.h | 5 +++-- indra/newview/llnearbychathandler.cpp | 39 +++++++++++++++++++++++++++++++++++ indra/newview/lltoast.h | 8 ++++--- 4 files changed, 51 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp index 7e4cb78d80..afd60cbb3e 100644 --- a/indra/llui/lluictrl.cpp +++ b/indra/llui/lluictrl.cpp @@ -944,6 +944,10 @@ F32 LLUICtrl::getCurrentTransparency() case TT_INACTIVE: alpha = sInactiveControlTransparency; break; + + case TT_FADING: + alpha = sInactiveControlTransparency / 2; + break; } return alpha; diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h index a78f98ac76..b37e9f6b1b 100644 --- a/indra/llui/lluictrl.h +++ b/indra/llui/lluictrl.h @@ -123,8 +123,9 @@ public: enum ETypeTransparency { TT_DEFAULT, - TT_ACTIVE, - TT_INACTIVE + TT_ACTIVE, // focused floater + TT_INACTIVE, // other floaters + TT_FADING, // fading toast }; /*virtual*/ ~LLUICtrl(); diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index d2ad78f140..dfbbaa0941 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -165,11 +165,20 @@ public: : LLToast(p), mNearbyChatScreenChannelp(nc_channelp) { + updateTransparency(); + setMouseEnterCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this)); + setMouseLeaveCallback(boost::bind(&LLNearbyChatToast::updateTransparency, this)); } /*virtual*/ void onClose(bool app_quitting); + /*virtual*/ void setBackgroundOpaque(BOOL b); + +protected: + /*virtual*/ void setTransparentState(bool transparent); private: + void updateTransparency(); + LLNearbyChatScreenChannel* mNearbyChatScreenChannelp; }; @@ -597,4 +606,34 @@ void LLNearbyChatToast::onClose(bool app_quitting) mNearbyChatScreenChannelp->onToastDestroyed(this, app_quitting); } +// virtual +void LLNearbyChatToast::setBackgroundOpaque(BOOL b) +{ + // We don't want background changes: transparency is handled differently. + LLToast::setBackgroundOpaque(TRUE); +} + +// virtual +void LLNearbyChatToast::setTransparentState(bool transparent) +{ + LLToast::setTransparentState(transparent); + updateTransparency(); +} + +void LLNearbyChatToast::updateTransparency() +{ + ETypeTransparency transparency_type; + + if (isHovered()) + { + transparency_type = TT_ACTIVE; + } + else + { + transparency_type = getTransparentState() ? TT_FADING : TT_INACTIVE; + } + + LLFloater::updateTransparency(transparency_type); +} + // EOF diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h index f88c628631..d23e858c5c 100644 --- a/indra/newview/lltoast.h +++ b/indra/newview/lltoast.h @@ -141,7 +141,7 @@ public: // virtual void setVisible(BOOL show); - /*virtual*/ void setBackgroundOpaque(BOOL b); + virtual void setBackgroundOpaque(BOOL b); // virtual void hide(); @@ -198,6 +198,10 @@ public: LLHandle getHandle() { mHandle.bind(this); return mHandle; } + bool getTransparentState() const { return mIsTransparent; } + virtual void setTransparentState(bool transparent); + + private: void onToastMouseEnter(); @@ -206,8 +210,6 @@ private: void expire(); - void setTransparentState(bool transparent); - LLUUID mNotificationID; LLUUID mSessionID; LLNotificationPtr mNotification; -- cgit v1.2.3 From 8acc2ec9f633168a3c04ac7aa112c1b12218d7cc Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 6 Dec 2010 15:01:36 +0200 Subject: STORM-690 FIXED Underlying panels were visible in undocked sidepanels. By the way, fixed losing focus when switching between panels in Me and Places SP (which made the floater semi-transparent). --- indra/newview/llpanellandmarkinfo.cpp | 6 ++++++ indra/newview/llpanelpicks.cpp | 2 +- indra/newview/llpanelprofile.cpp | 16 ++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 87acd83b23..c57746ec00 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -180,6 +180,9 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type) populateFoldersList(); + // Prevent the floater from losing focus (if the sidepanel is undocked). + setFocus(TRUE); + LLPanelPlaceInfo::setInfoType(type); } @@ -330,6 +333,9 @@ void LLPanelLandmarkInfo::toggleLandmarkEditMode(BOOL enabled) // when it was enabled/disabled we set the text once again. mNotesEditor->setText(mNotesEditor->getText()); } + + // Prevent the floater from losing focus (if the sidepanel is undocked). + setFocus(TRUE); } const std::string& LLPanelLandmarkInfo::getLandmarkTitle() const diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index ccef563544..4f4b828cca 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -781,7 +781,7 @@ void LLPanelPicks::showAccordion(const std::string& name, bool show) void LLPanelPicks::onPanelPickClose(LLPanel* panel) { - panel->setVisible(FALSE); + getProfilePanel()->closePanel(panel); } void LLPanelPicks::onPanelPickSave(LLPanel* panel) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 4e63563979..6038ab20d8 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -217,6 +217,10 @@ void LLPanelProfile::setAllChildrenVisible(BOOL visible) void LLPanelProfile::openPanel(LLPanel* panel, const LLSD& params) { + // Hide currently visible panel (STORM-690). + setAllChildrenVisible(FALSE); + + // Add the panel or bring it to front. if (panel->getParent() != this) { addChild(panel); @@ -243,6 +247,18 @@ void LLPanelProfile::closePanel(LLPanel* panel) if (panel->getParent() == this) { removeChild(panel); + + // Make the underlying panel visible. + const child_list_t* child_list = getChildList(); + if (child_list->size() > 0) + { + child_list->front()->setVisible(TRUE); + child_list->front()->setFocus(TRUE); // prevent losing focus by the floater + } + else + { + llwarns << "No underlying panel to make visible." << llendl; + } } } -- cgit v1.2.3 From 37c65e371d15bce250a2df3cc7c1a1cd235ec2fa Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 6 Dec 2010 16:14:50 +0200 Subject: STORM-690 ADDITIONAL FIX Hide "Loading..." text that can be seen under transparent Avatar Picks accordion. --- indra/newview/llpanelpicks.cpp | 13 +++++++++---- indra/newview/llpanelpicks.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 4f4b828cca..15e826ac2c 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -212,7 +212,8 @@ void LLPanelPicks::updateData() mNoPicks = false; mNoClassifieds = false; - getChild("picks_panel_text")->setValue(LLTrans::getString("PicksClassifiedsLoadingText")); + mNoItemsLabel->setValue(LLTrans::getString("PicksClassifiedsLoadingText")); + mNoItemsLabel->setVisible(TRUE); mPicksList->clear(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); @@ -314,15 +315,17 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) mNoClassifieds = !mClassifiedsList->size(); } - if (mNoPicks && mNoClassifieds) + bool no_data = mNoPicks && mNoClassifieds; + mNoItemsLabel->setVisible(no_data); + if (no_data) { if(getAvatarId() == gAgentID) { - getChild("picks_panel_text")->setValue(LLTrans::getString("NoPicksClassifiedsText")); + mNoItemsLabel->setValue(LLTrans::getString("NoPicksClassifiedsText")); } else { - getChild("picks_panel_text")->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); + mNoItemsLabel->setValue(LLTrans::getString("NoAvatarPicksClassifiedsText")); } } } @@ -359,6 +362,8 @@ BOOL LLPanelPicks::postBuild() mPicksList->setNoItemsCommentText(getString("no_picks")); mClassifiedsList->setNoItemsCommentText(getString("no_classifieds")); + mNoItemsLabel = getChild("picks_panel_text"); + childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickPlusBtn, this)); childSetAction(XML_BTN_DELETE, boost::bind(&LLPanelPicks::onClickDelete, this)); childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this)); diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 526ba48dcb..a02ed81bb0 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -149,6 +149,7 @@ private: LLPanelClassifiedInfo* mPanelClassifiedInfo; LLPanelPickEdit* mPanelPickEdit; LLToggleableMenu* mPlusMenu; + LLUICtrl* mNoItemsLabel; // typedef std::map panel_classified_edit_map_t; -- cgit v1.2.3 From e03e3257ab2405149c85277e7259dbc2b361dcb0 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 6 Dec 2010 19:19:31 +0200 Subject: STORM-730 FIXED Made Movement Controls, Camera Controls and Nearby Voice floaters use active floater transparency. --- indra/newview/llcallfloater.cpp | 12 ++++++++++++ indra/newview/llcallfloater.h | 1 + indra/newview/llfloatercamera.cpp | 1 + indra/newview/llmoveview.cpp | 1 + 4 files changed, 15 insertions(+) (limited to 'indra') diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index b2e9564f7d..328c326278 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -167,6 +167,7 @@ BOOL LLCallFloater::postBuild() //chrome="true" hides floater caption if (mDragHandle) mDragHandle->setTitleVisible(TRUE); + updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) updateSession(); @@ -205,6 +206,17 @@ void LLCallFloater::draw() LLTransientDockableFloater::draw(); } +// virtual +void LLCallFloater::setFocus( BOOL b ) +{ + LLTransientDockableFloater::setFocus(b); + + // Force using active floater transparency (STORM-730). + // We have to override setFocus() for LLCallFloater because selecting an item + // of the voice morphing combobox causes the floater to lose focus and thus become transparent. + updateTransparency(TT_ACTIVE); +} + // virtual void LLCallFloater::onParticipantsChanged() { diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h index 3bc7043353..00a3f76e56 100644 --- a/indra/newview/llcallfloater.h +++ b/indra/newview/llcallfloater.h @@ -64,6 +64,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); /*virtual*/ void draw(); + /*virtual*/ void setFocus( BOOL b ); /** * Is called by LLVoiceClient::notifyParticipantObservers when voice participant list is changed. diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index ad24c6534a..90a9879949 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -343,6 +343,7 @@ BOOL LLFloaterCamera::postBuild() { setIsChrome(TRUE); setTitleVisible(TRUE); // restore title visibility after chrome applying + updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) mRotate = getChild(ORBIT); mZoom = findChild(ZOOM); diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index d38bb5aa4a..89d551f129 100644 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -94,6 +94,7 @@ BOOL LLFloaterMove::postBuild() { setIsChrome(TRUE); setTitleVisible(TRUE); // restore title visibility after chrome applying + updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) LLDockableFloater::postBuild(); -- cgit v1.2.3 From 2a92d622d710ec4f83b3c9b5568d508067bf7107 Mon Sep 17 00:00:00 2001 From: "Mark Palange (Mani)" Date: Mon, 6 Dec 2010 16:42:06 -0800 Subject: CHOP-257 - programmer XUI for update ready to install. One tip, one alert. Rev. by Brad --- indra/newview/llappviewer.cpp | 2 +- indra/newview/skins/default/xui/en/notifications.xml | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 63b2fcefd7..31115a4218 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2396,7 +2396,7 @@ namespace { switch (evt["type"].asInteger()) { case LLUpdaterService::DOWNLOAD_COMPLETE: - LLNotificationsUtil::add("DownloadBackground"); + LLNotificationsUtil::add("DownloadBackgroundDialog"); break; case LLUpdaterService::INSTALL_ERROR: LLNotificationsUtil::add("FailedUpdateInstall"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 60b876d163..2d635bab76 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2887,12 +2887,29 @@ http://secondlife.com/download. name="okbutton" yestext="OK"/> + An updated version of [APP_NAME] has been downloaded. It will be applied the next time you restart [APP_NAME] + + + + + An updated version of [APP_NAME] has been downloaded. + It will be applied the next time you restart [APP_NAME] + Date: Mon, 6 Dec 2010 17:12:43 -0800 Subject: SOCIAL-342 FIX Rename Web Browser Test option in debug menus to reflect the fact it opens the Media browser --- indra/newview/skins/default/xui/en/menu_login.xml | 2 +- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_login.xml b/indra/newview/skins/default/xui/en/menu_login.xml index 2f47d4e201..271b688be5 100644 --- a/indra/newview/skins/default/xui/en/menu_login.xml +++ b/indra/newview/skins/default/xui/en/menu_login.xml @@ -176,7 +176,7 @@ parameter="message_critical" /> --> Date: Tue, 7 Dec 2010 12:06:35 +0200 Subject: STORM-732 FIXED Voice Morphing floater was opaque on first open. --- indra/llui/llfloater.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 7727e154da..e79e280b20 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1462,6 +1462,9 @@ void LLFloater::setFrontmost(BOOL take_focus) // there are more than one floater view // so we need to query our parent directly ((LLFloaterView*)getParent())->bringToFront(this, take_focus); + + // Make sure we use the active floater transparency settings (STORM-732). + updateTransparency(TT_ACTIVE); } } -- cgit v1.2.3 From 2b70e8e0017846b174baaaea0ca1ca63e871eaba Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Dec 2010 13:45:29 +0200 Subject: STORM-733 FIXED Build Tools floater now has inactive floater transparency when opened (because it's not focused by default). --- indra/llui/llfloater.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e79e280b20..1265733bf5 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -1,4 +1,5 @@ /** + * @file llfloater.cpp * @brief LLFloater base class * @@ -1189,7 +1190,7 @@ void LLFloater::setFocus( BOOL b ) last_focus->setFocus(TRUE); } } - updateTransparency(this, b ? TT_ACTIVE : TT_INACTIVE); + updateTransparency(b ? TT_ACTIVE : TT_INACTIVE); } // virtual @@ -1463,8 +1464,8 @@ void LLFloater::setFrontmost(BOOL take_focus) // so we need to query our parent directly ((LLFloaterView*)getParent())->bringToFront(this, take_focus); - // Make sure we use the active floater transparency settings (STORM-732). - updateTransparency(TT_ACTIVE); + // Make sure to set the appropriate transparency type (STORM-732). + updateTransparency(hasFocus() || getIsChrome() ? TT_ACTIVE : TT_INACTIVE); } } -- cgit v1.2.3 From 3069d8763b933b8b0ca6f35316a73b846341973d Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Dec 2010 14:08:39 +0200 Subject: STORM-735 FIXED Group icons in People -> Groups now follow floater opacity settings. --- indra/newview/skins/default/xui/en/panel_group_list_item.xml | 1 + indra/newview/skins/default/xui/en/widgets/group_icon.xml | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'indra') 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 0b84ac03c5..7d0b0890f0 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 @@ -34,6 +34,7 @@ mouse_opaque="true" left="5" top="2" + use_draw_context_alpha="false" width="20" /> + name="group_icon" + use_draw_context_alpha="false" /> -- cgit v1.2.3 From 91480065ca8bc1f023e41f5afbbc3c12b8463c3b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 7 Dec 2010 16:05:12 +0200 Subject: STORM-710 FIXED Don't show search history dropdown if the history is empty. --- indra/llui/llcombobox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 70014fe4f5..6b06040b8a 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -769,7 +769,8 @@ BOOL LLComboBox::handleKeyHere(KEY key, MASK mask) return FALSE; } // if selection has changed, pop open list - else if ((mList->getLastSelectedItem() != last_selected_item) || (key == KEY_DOWN) || (key == KEY_UP)) + else if (mList->getLastSelectedItem() != last_selected_item || + (key == KEY_DOWN || key == KEY_UP) && !mList->isEmpty()) { showList(); } -- cgit v1.2.3 From 066dfaee2866ff7585387db50ceca391a4ecb519 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Tue, 7 Dec 2010 10:14:07 -0500 Subject: Add + control to Inventory/Recent tab --- indra/newview/llpanelmaininventory.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 17433a557b..c295f93a67 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -506,8 +506,7 @@ void LLPanelMainInventory::onFilterSelected() return; } - BOOL recent_active = ("Recent Items" == mActivePanel->getName()); - getChildView("add_btn_panel")->setVisible( !recent_active); + getChildView("add_btn_panel")->setVisible(true); setFilterSubString(mFilterSubString); LLInventoryFilter* filter = mActivePanel->getFilter(); -- cgit v1.2.3 From 11f2ad21590147e4d426320d1d336a3dac82a34b Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 7 Dec 2010 10:35:37 -0800 Subject: login instance coordinates with updater service --- indra/newview/llappviewer.cpp | 5 + indra/newview/lllogininstance.cpp | 381 ++++++++++++++++++++- indra/newview/lllogininstance.h | 3 + .../newview/skins/default/xui/en/notifications.xml | 13 + indra/newview/tests/lllogininstance_test.cpp | 38 ++ 5 files changed, 439 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 63b2fcefd7..f45bc474fc 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -80,6 +80,7 @@ #include "llfeaturemanager.h" #include "llurlmatch.h" #include "lltextutil.h" +#include "lllogininstance.h" #include "llweb.h" #include "llsecondlifeurls.h" @@ -590,10 +591,14 @@ LLAppViewer::LLAppViewer() : setupErrorHandling(); sInstance = this; gLoggedInTime.stop(); + + LLLoginInstance::instance().setUpdaterService(mUpdater.get()); } LLAppViewer::~LLAppViewer() { + LLLoginInstance::instance().setUpdaterService(0); + destroyMainloopTimeout(); // If we got to this destructor somehow, the app didn't hang. diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index 52ce932241..f6338ac50e 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -55,12 +55,382 @@ #include "llsecapi.h" #include "llstartup.h" #include "llmachineid.h" +#include "llupdaterservice.h" +#include "llevents.h" +#include "llnotificationsutil.h" +#include "llappviewer.h" + +#include + +namespace { + class MandatoryUpdateMachine { + public: + MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService); + + void start(void); + + private: + class State; + class CheckingForUpdate; + class Error; + class ReadyToInstall; + class StartingUpdaterService; + class WaitingForDownload; + + LLLoginInstance & mLoginInstance; + boost::scoped_ptr mState; + LLUpdaterService & mUpdaterService; + + void setCurrentState(State * newState); + }; + + + class MandatoryUpdateMachine::State { + public: + virtual ~State() {} + virtual void enter(void) {} + virtual void exit(void) {} + }; + + + class MandatoryUpdateMachine::CheckingForUpdate: + public MandatoryUpdateMachine::State + { + public: + CheckingForUpdate(MandatoryUpdateMachine & machine); + + virtual void enter(void); + virtual void exit(void); + + private: + LLTempBoundListener mConnection; + MandatoryUpdateMachine & mMachine; + + bool onEvent(LLSD const & event); + }; + + + class MandatoryUpdateMachine::Error: + public MandatoryUpdateMachine::State + { + public: + Error(MandatoryUpdateMachine & machine); + + virtual void enter(void); + virtual void exit(void); + void onButtonClicked(const LLSD &, const LLSD &); + + private: + MandatoryUpdateMachine & mMachine; + }; + + + class MandatoryUpdateMachine::ReadyToInstall: + public MandatoryUpdateMachine::State + { + public: + ReadyToInstall(MandatoryUpdateMachine & machine); + + virtual void enter(void); + virtual void exit(void); + + private: + MandatoryUpdateMachine & mMachine; + }; + + + class MandatoryUpdateMachine::StartingUpdaterService: + public MandatoryUpdateMachine::State + { + public: + StartingUpdaterService(MandatoryUpdateMachine & machine); + + virtual void enter(void); + virtual void exit(void); + void onButtonClicked(const LLSD & uiform, const LLSD & result); + private: + MandatoryUpdateMachine & mMachine; + }; + + + class MandatoryUpdateMachine::WaitingForDownload: + public MandatoryUpdateMachine::State + { + public: + WaitingForDownload(MandatoryUpdateMachine & machine); + + virtual void enter(void); + virtual void exit(void); + + private: + LLTempBoundListener mConnection; + MandatoryUpdateMachine & mMachine; + + bool onEvent(LLSD const & event); + }; +} static const char * const TOS_REPLY_PUMP = "lllogininstance_tos_callback"; static const char * const TOS_LISTENER_NAME = "lllogininstance_tos"; std::string construct_start_string(); + + +// MandatoryUpdateMachine +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::MandatoryUpdateMachine(LLLoginInstance & loginInstance, LLUpdaterService & updaterService): + mLoginInstance(loginInstance), + mUpdaterService(updaterService) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::start(void) +{ + llinfos << "starting manditory update machine" << llendl; + + if(mUpdaterService.isChecking()) { + switch(mUpdaterService.getState()) { + case LLUpdaterService::UP_TO_DATE: + mUpdaterService.stopChecking(); + mUpdaterService.startChecking(); + // Fall through. + case LLUpdaterService::INITIAL: + case LLUpdaterService::CHECKING_FOR_UPDATE: + setCurrentState(new CheckingForUpdate(*this)); + break; + case LLUpdaterService::DOWNLOADING: + setCurrentState(new WaitingForDownload(*this)); + break; + case LLUpdaterService::TERMINAL: + if(LLUpdaterService::updateReadyToInstall()) { + setCurrentState(new ReadyToInstall(*this)); + } else { + setCurrentState(new Error(*this)); + } + break; + case LLUpdaterService::ERROR: + setCurrentState(new Error(*this)); + break; + default: + llassert(!"unpossible case"); + break; + } + } else { + setCurrentState(new StartingUpdaterService(*this)); + } +} + + +void MandatoryUpdateMachine::setCurrentState(State * newStatePointer) +{ + { + boost::scoped_ptr newState(newStatePointer); + if(mState != 0) mState->exit(); + mState.swap(newState); + + // Old state will be deleted on exit from this block before the new state + // is entered. + } + if(mState != 0) mState->enter(); +} + + + +// MandatoryUpdateMachine::CheckingForUpdate +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::CheckingForUpdate::CheckingForUpdate(MandatoryUpdateMachine & machine): + mMachine(machine) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::CheckingForUpdate::enter(void) +{ + llinfos << "entering checking for update" << llendl; + + mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). + listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::CheckingForUpdate::onEvent, this, _1)); +} + + +void MandatoryUpdateMachine::CheckingForUpdate::exit(void) +{ +} + + +bool MandatoryUpdateMachine::CheckingForUpdate::onEvent(LLSD const & event) +{ + if(event["type"].asInteger() == LLUpdaterService::STATE_CHANGE) { + switch(event["state"].asInteger()) { + case LLUpdaterService::DOWNLOADING: + mMachine.setCurrentState(new WaitingForDownload(mMachine)); + break; + case LLUpdaterService::UP_TO_DATE: + case LLUpdaterService::TERMINAL: + case LLUpdaterService::ERROR: + mMachine.setCurrentState(new Error(mMachine)); + break; + case LLUpdaterService::INSTALLING: + llassert(!"can't possibly be installing"); + break; + default: + break; + } + } else { + ; // Ignore. + } + + return false; +} + + + +// MandatoryUpdateMachine::Error +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::Error::Error(MandatoryUpdateMachine & machine): + mMachine(machine) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::Error::enter(void) +{ + llinfos << "entering error" << llendl; + LLNotificationsUtil::add("FailedUpdateInstall", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::Error::onButtonClicked, this, _1, _2)); +} + + +void MandatoryUpdateMachine::Error::exit(void) +{ + LLAppViewer::instance()->forceQuit(); +} + + +void MandatoryUpdateMachine::Error::onButtonClicked(const LLSD &, const LLSD &) +{ + mMachine.setCurrentState(0); +} + + + +// MandatoryUpdateMachine::ReadyToInstall +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::ReadyToInstall::ReadyToInstall(MandatoryUpdateMachine & machine): + mMachine(machine) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::ReadyToInstall::enter(void) +{ + llinfos << "entering ready to install" << llendl; + // Open update ready dialog. +} + + +void MandatoryUpdateMachine::ReadyToInstall::exit(void) +{ + // Restart viewer. +} + + + +// MandatoryUpdateMachine::StartingUpdaterService +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::StartingUpdaterService::StartingUpdaterService(MandatoryUpdateMachine & machine): + mMachine(machine) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::StartingUpdaterService::enter(void) +{ + llinfos << "entering start update service" << llendl; + LLNotificationsUtil::add("UpdaterServiceNotRunning", LLSD(), LLSD(), boost::bind(&MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked, this, _1, _2)); +} + + +void MandatoryUpdateMachine::StartingUpdaterService::exit(void) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked(const LLSD & uiform, const LLSD & result) +{ + if(result["OK_okcancelbuttons"].asBoolean()) { + mMachine.mUpdaterService.startChecking(false); + mMachine.setCurrentState(new CheckingForUpdate(mMachine)); + } else { + LLAppViewer::instance()->forceQuit(); + } +} + + + +// MandatoryUpdateMachine::WaitingForDownload +//----------------------------------------------------------------------------- + + +MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMachine & machine): + mMachine(machine) +{ + ; // No op. +} + + +void MandatoryUpdateMachine::WaitingForDownload::enter(void) +{ + llinfos << "entering waiting for download" << llendl; + mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). + listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::WaitingForDownload::onEvent, this, _1)); +} + + +void MandatoryUpdateMachine::WaitingForDownload::exit(void) +{ +} + + +bool MandatoryUpdateMachine::WaitingForDownload::onEvent(LLSD const & event) +{ + switch(event["type"].asInteger()) { + case LLUpdaterService::DOWNLOAD_COMPLETE: + mMachine.setCurrentState(new ReadyToInstall(mMachine)); + break; + case LLUpdaterService::DOWNLOAD_ERROR: + mMachine.setCurrentState(new Error(mMachine)); + break; + default: + break; + } + + return false; +} + + + +// LLLoginInstance +//----------------------------------------------------------------------------- + + LLLoginInstance::LLLoginInstance() : mLoginModule(new LLLogin()), mNotifications(NULL), @@ -69,7 +439,8 @@ LLLoginInstance::LLLoginInstance() : mSkipOptionalUpdate(false), mAttemptComplete(false), mTransferRate(0.0f), - mDispatcher("LLLoginInstance", "change") + mDispatcher("LLLoginInstance", "change"), + mUpdaterService(0) { mLoginModule->getEventPump().listen("lllogininstance", boost::bind(&LLLoginInstance::handleLoginEvent, this, _1)); @@ -353,6 +724,14 @@ bool LLLoginInstance::handleTOSResponse(bool accepted, const std::string& key) void LLLoginInstance::updateApp(bool mandatory, const std::string& auth_msg) { + if(mandatory) + { + gViewerWindow->setShowProgress(false); + MandatoryUpdateMachine * machine = new MandatoryUpdateMachine(*this, *mUpdaterService); + machine->start(); + return; + } + // store off config state, as we might quit soon gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE); LLUIColorTable::instance().saveUserSettings(); diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 159e05046c..cb1f56a971 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -34,6 +34,7 @@ class LLLogin; class LLEventStream; class LLNotificationsInterface; +class LLUpdaterService; // This class hosts the login module and is used to // negotiate user authentication attempts. @@ -75,6 +76,7 @@ public: typedef boost::function UpdaterLauncherCallback; void setUpdaterLauncher(const UpdaterLauncherCallback& ulc) { mUpdaterLauncher = ulc; } + void setUpdaterService(LLUpdaterService * updaterService) { mUpdaterService = updaterService; } private: void constructAuthParams(LLPointer user_credentials); void updateApp(bool mandatory, const std::string& message); @@ -104,6 +106,7 @@ private: int mLastExecEvent; UpdaterLauncherCallback mUpdaterLauncher; LLEventDispatcher mDispatcher; + LLUpdaterService * mUpdaterService; }; #endif diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 60b876d163..bac1ad18d9 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2887,6 +2887,19 @@ http://secondlife.com/download. name="okbutton" yestext="OK"/> + + +An update is required to log in. May we start the background +updater service to fetch and install the update? + + + functor) { return LLNotificationPtr((LLNotification*)0); } + + +//----------------------------------------------------------------------------- +#include "llupdaterservice.h" + +std::string const & LLUpdaterService::pumpName(void) +{ + static std::string wakka = "wakka wakka wakka"; + return wakka; +} +bool LLUpdaterService::updateReadyToInstall(void) { return false; } +void LLUpdaterService::initialize(const std::string& protocol_version, + const std::string& url, + const std::string& path, + const std::string& channel, + const std::string& version) {} + +void LLUpdaterService::setCheckPeriod(unsigned int seconds) {} +void LLUpdaterService::startChecking(bool install_if_ready) {} +void LLUpdaterService::stopChecking() {} +bool LLUpdaterService::isChecking() { return false; } +LLUpdaterService::eUpdaterState LLUpdaterService::getState() { return INITIAL; } + //----------------------------------------------------------------------------- #include "llnotifications.h" #include "llfloaterreg.h" @@ -435,6 +469,8 @@ namespace tut template<> template<> void lllogininstance_object::test<3>() { + skip(); + set_test_name("Test Mandatory Update User Accepts"); // Part 1 - Mandatory Update, with User accepts response. @@ -462,6 +498,8 @@ namespace tut template<> template<> void lllogininstance_object::test<4>() { + skip(); + set_test_name("Test Mandatory Update User Decline"); // Test connect with update needed. -- cgit v1.2.3 From 6faefa6440e61ade7dae9845757756521be92d7a Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 7 Dec 2010 13:14:53 -0800 Subject: show progress bar while downloading update. --- indra/newview/lllogininstance.cpp | 28 +++++++++++++++++++++++++--- indra/newview/tests/lllogininstance_test.cpp | 7 +++++++ 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lllogininstance.cpp b/indra/newview/lllogininstance.cpp index f6338ac50e..3ff1487286 100644 --- a/indra/newview/lllogininstance.cpp +++ b/indra/newview/lllogininstance.cpp @@ -49,6 +49,7 @@ #include "llnotifications.h" #include "llwindow.h" #include "llviewerwindow.h" +#include "llprogressview.h" #if LL_LINUX || LL_SOLARIS #include "lltrans.h" #endif @@ -105,6 +106,7 @@ namespace { private: LLTempBoundListener mConnection; MandatoryUpdateMachine & mMachine; + LLProgressView * mProgressView; bool onEvent(LLSD const & event); }; @@ -165,6 +167,7 @@ namespace { private: LLTempBoundListener mConnection; MandatoryUpdateMachine & mMachine; + LLProgressView * mProgressView; bool onEvent(LLSD const & event); }; @@ -213,7 +216,7 @@ void MandatoryUpdateMachine::start(void) setCurrentState(new Error(*this)); } break; - case LLUpdaterService::ERROR: + case LLUpdaterService::FAILURE: setCurrentState(new Error(*this)); break; default: @@ -256,6 +259,11 @@ void MandatoryUpdateMachine::CheckingForUpdate::enter(void) { llinfos << "entering checking for update" << llendl; + mProgressView = gViewerWindow->getProgressView(); + mProgressView->setMessage("Looking for update..."); + mProgressView->setText("Update"); + mProgressView->setPercent(0); + mProgressView->setVisible(true); mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::CheckingForUpdate::onEvent, this, _1)); } @@ -275,7 +283,8 @@ bool MandatoryUpdateMachine::CheckingForUpdate::onEvent(LLSD const & event) break; case LLUpdaterService::UP_TO_DATE: case LLUpdaterService::TERMINAL: - case LLUpdaterService::ERROR: + case LLUpdaterService::FAILURE: + mProgressView->setVisible(false); mMachine.setCurrentState(new Error(mMachine)); break; case LLUpdaterService::INSTALLING: @@ -390,7 +399,8 @@ void MandatoryUpdateMachine::StartingUpdaterService::onButtonClicked(const LLSD MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMachine & machine): - mMachine(machine) + mMachine(machine), + mProgressView(0) { ; // No op. } @@ -399,6 +409,11 @@ MandatoryUpdateMachine::WaitingForDownload::WaitingForDownload(MandatoryUpdateMa void MandatoryUpdateMachine::WaitingForDownload::enter(void) { llinfos << "entering waiting for download" << llendl; + mProgressView = gViewerWindow->getProgressView(); + mProgressView->setMessage("Downloading update..."); + mProgressView->setText("Update"); + mProgressView->setPercent(0); + mProgressView->setVisible(true); mConnection = LLEventPumps::instance().obtain(LLUpdaterService::pumpName()). listen("MandatoryUpdateMachine::CheckingForUpdate", boost::bind(&MandatoryUpdateMachine::WaitingForDownload::onEvent, this, _1)); } @@ -406,6 +421,7 @@ void MandatoryUpdateMachine::WaitingForDownload::enter(void) void MandatoryUpdateMachine::WaitingForDownload::exit(void) { + mProgressView->setVisible(false); } @@ -418,6 +434,12 @@ bool MandatoryUpdateMachine::WaitingForDownload::onEvent(LLSD const & event) case LLUpdaterService::DOWNLOAD_ERROR: mMachine.setCurrentState(new Error(mMachine)); break; + case LLUpdaterService::PROGRESS: { + double downloadSize = event["download_size"].asReal(); + double bytesDownloaded = event["bytes_downloaded"].asReal(); + mProgressView->setPercent(100. * bytesDownloaded / downloadSize); + break; + } default: break; } diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index c906b71c37..5f73aa1d3c 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -68,6 +68,7 @@ static bool gDisconnectCalled = false; #include "../llviewerwindow.h" void LLViewerWindow::setShowProgress(BOOL show) {} +LLProgressView * LLViewerWindow::getProgressView(void) const { return 0; } LLViewerWindow* gViewerWindow; @@ -232,6 +233,12 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, return NULL; } +//---------------------------------------------------------------------------- +#include "../llprogressview.h" +void LLProgressView::setText(std::string const &){} +void LLProgressView::setPercent(float){} +void LLProgressView::setMessage(std::string const &){} + //----------------------------------------------------------------------------- // LLNotifications class MockNotifications : public LLNotificationsInterface -- cgit v1.2.3 From 1831c1a9508f858482fd728bb3edc274de401660 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Tue, 7 Dec 2010 16:57:52 -0500 Subject: more merge from viewer-development --- indra/newview/llavataractions.cpp | 6 +++--- indra/newview/llfloaterpreference.cpp | 15 --------------- 2 files changed, 3 insertions(+), 18 deletions(-) (limited to 'indra') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 80a12e68ae..aea7f00222 100755 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -309,10 +309,10 @@ void LLAvatarActions::showProfile(const LLUUID& id) params["open_tab_name"] = "panel_profile"; // PROFILES: open in webkit window - std::string first_name,last_name; - if (gCacheName->getName(id,first_name,last_name)) + std::string full_name; + if (gCacheName->getFullName(id,full_name)) { - std::string agent_name = first_name + "." + last_name; + std::string agent_name = LLCacheName::buildUsername(full_name); llinfos << "opening web profile for " << agent_name << llendl; std::string url = getProfileURL(agent_name); LLWeb::loadURLInternal(url); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index f9b3746ac0..186ec96d9e 100755 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -386,23 +386,15 @@ BOOL LLFloaterPreference::postBuild() LLTabContainer* tabcontainer = getChild("pref core"); if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); -<<<<<<< local - -======= updateDoubleClickControls(); ->>>>>>> other getChild("cache_location")->setEnabled(FALSE); // make it read-only but selectable (STORM-227) std::string cache_location = gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""); setCacheLocation(cache_location); -<<<<<<< local - -======= getChild("language_combobox")->setCommitCallback(boost::bind(&LLFloaterPreference::onLanguageChange, this)); ->>>>>>> other // if floater is opened before login set default localized busy message if (LLStartUp::getStartupState() < STATE_STARTED) { @@ -534,17 +526,14 @@ void LLFloaterPreference::apply() gAgent.sendAgentUpdateUserInfo(new_im_via_email,mDirectoryVisibility); } } -<<<<<<< local saveAvatarProperties(); -======= if (mDoubleClickActionDirty) { updateDoubleClickSettings(); mDoubleClickActionDirty = false; } ->>>>>>> other } void LLFloaterPreference::cancel() @@ -630,14 +619,10 @@ void LLFloaterPreference::onOpen(const LLSD& key) getChild("maturity_desired_textbox")->setValue(maturity_combo->getSelectedItemLabel()); getChildView("maturity_desired_combobox")->setVisible( false); } -<<<<<<< local - -======= // Forget previous language changes. mLanguageChanged = false; ->>>>>>> other // Display selected maturity icons. onChangeMaturity(); -- cgit v1.2.3 From 4d861ef022f6c22837de4c76ee3e7f2b191b8a5e Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 7 Dec 2010 14:32:37 -0800 Subject: push required flag into download data for later use. --- indra/viewer_components/updater/llupdatedownloader.cpp | 13 +++++++------ indra/viewer_components/updater/llupdatedownloader.h | 3 ++- indra/viewer_components/updater/llupdaterservice.cpp | 4 ++-- .../updater/tests/llupdaterservice_test.cpp | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) (limited to 'indra') diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index ddc14129c2..ce6b488ecb 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -48,7 +48,7 @@ public: Implementation(LLUpdateDownloader::Client & client); ~Implementation(); void cancel(void); - void download(LLURI const & uri, std::string const & hash); + void download(LLURI const & uri, std::string const & hash, bool required); bool isDownloading(void); size_t onHeader(void * header, size_t size); size_t onBody(void * header, size_t size); @@ -118,9 +118,9 @@ void LLUpdateDownloader::cancel(void) } -void LLUpdateDownloader::download(LLURI const & uri, std::string const & hash) +void LLUpdateDownloader::download(LLURI const & uri, std::string const & hash, bool required) { - mImplementation->download(uri, hash); + mImplementation->download(uri, hash, required); } @@ -199,12 +199,13 @@ void LLUpdateDownloader::Implementation::cancel(void) } -void LLUpdateDownloader::Implementation::download(LLURI const & uri, std::string const & hash) +void LLUpdateDownloader::Implementation::download(LLURI const & uri, std::string const & hash, bool required) { if(isDownloading()) mClient.downloadError("download in progress"); mDownloadRecordPath = downloadMarkerPath(); mDownloadData = LLSD(); + mDownloadData["required"] = required; try { startDownloading(uri, hash); } catch(DownloadError const & e) { @@ -250,12 +251,12 @@ void LLUpdateDownloader::Implementation::resume(void) resumeDownloading(fileStatus.st_size); } else if(!validateDownload()) { LLFile::remove(filePath); - download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString()); + download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString(), mDownloadData["required"].asBoolean()); } else { mClient.downloadComplete(mDownloadData); } } else { - download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString()); + download(LLURI(mDownloadData["url"].asString()), mDownloadData["hash"].asString(), mDownloadData["required"].asBoolean()); } } catch(DownloadError & e) { mClient.downloadError(e.what()); diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 1b3d7480fd..09ea1676d5 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -52,7 +52,7 @@ public: void cancel(void); // Start a new download. - void download(LLURI const & uri, std::string const & hash); + void download(LLURI const & uri, std::string const & hash, bool required=false); // Returns true if a download is in progress. bool isDownloading(void); @@ -76,6 +76,7 @@ public: // url - source (remote) location // hash - the md5 sum that should match the installer file. // path - destination (local) location + // required - boolean indicating if this is a required update. // size - the size of the installer in bytes virtual void downloadComplete(LLSD const & data) = 0; diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index dd93fa2550..7d180ff649 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -355,7 +355,7 @@ void LLUpdaterServiceImpl::optionalUpdate(std::string const & newVersion, { stopTimer(); mIsDownloading = true; - mUpdateDownloader.download(uri, hash); + mUpdateDownloader.download(uri, hash, false); setState(LLUpdaterService::DOWNLOADING); } @@ -366,7 +366,7 @@ void LLUpdaterServiceImpl::requiredUpdate(std::string const & newVersion, { stopTimer(); mIsDownloading = true; - mUpdateDownloader.download(uri, hash); + mUpdateDownloader.download(uri, hash, true); setState(LLUpdaterService::DOWNLOADING); } diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index 04ed4e6364..050bb774f7 100644 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -48,7 +48,7 @@ void LLUpdateChecker::check(std::string const & protocolVersion, std::string con std::string const & servicePath, std::string channel, std::string version) {} LLUpdateDownloader::LLUpdateDownloader(Client & ) {} -void LLUpdateDownloader::download(LLURI const & , std::string const &){} +void LLUpdateDownloader::download(LLURI const & , std::string const &, bool){} class LLDir_Mock : public LLDir { -- cgit v1.2.3 From 3c3683b884542e5aa85099f4ce0c1b556613795d Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 7 Dec 2010 15:41:31 -0800 Subject: limit dowload bandwidth to 'Maximum bandwidth' setting --- indra/newview/llappviewer.cpp | 9 ++++++++ .../updater/llupdatedownloader.cpp | 26 ++++++++++++++++++++++ .../viewer_components/updater/llupdatedownloader.h | 3 +++ .../viewer_components/updater/llupdaterservice.cpp | 11 +++++++++ indra/viewer_components/updater/llupdaterservice.h | 1 + .../updater/tests/llupdaterservice_test.cpp | 1 + 6 files changed, 51 insertions(+) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 08e40168c3..38422621ef 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2413,6 +2413,12 @@ namespace { // let others also handle this event by default return false; } + + bool on_bandwidth_throttle(LLUpdaterService * updater, LLSD const & evt) + { + updater->setBandwidthLimit(evt.asInteger() * (1024/8)); + return false; // Let others receive this event. + }; }; void LLAppViewer::initUpdater() @@ -2435,6 +2441,9 @@ void LLAppViewer::initUpdater() channel, version); mUpdater->setCheckPeriod(check_period); + mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("ThrottleBandwidthKBPS") * (1024/8)); + gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()-> + connect(boost::bind(&on_bandwidth_throttle, mUpdater.get(), _2)); if(gSavedSettings.getBOOL("UpdaterServiceActive")) { bool install_if_ready = true; diff --git a/indra/viewer_components/updater/llupdatedownloader.cpp b/indra/viewer_components/updater/llupdatedownloader.cpp index ce6b488ecb..d67de1c83b 100644 --- a/indra/viewer_components/updater/llupdatedownloader.cpp +++ b/indra/viewer_components/updater/llupdatedownloader.cpp @@ -54,8 +54,10 @@ public: size_t onBody(void * header, size_t size); int onProgress(double downloadSize, double bytesDownloaded); void resume(void); + void setBandwidthLimit(U64 bytesPerSecond); private: + curl_off_t mBandwidthLimit; bool mCancelled; LLUpdateDownloader::Client & mClient; CURL * mCurl; @@ -136,6 +138,12 @@ void LLUpdateDownloader::resume(void) } +void LLUpdateDownloader::setBandwidthLimit(U64 bytesPerSecond) +{ + mImplementation->setBandwidthLimit(bytesPerSecond); +} + + // LLUpdateDownloader::Implementation //----------------------------------------------------------------------------- @@ -170,6 +178,7 @@ namespace { LLUpdateDownloader::Implementation::Implementation(LLUpdateDownloader::Client & client): LLThread("LLUpdateDownloader"), + mBandwidthLimit(0), mCancelled(false), mClient(client), mCurl(0), @@ -264,6 +273,20 @@ void LLUpdateDownloader::Implementation::resume(void) } +void LLUpdateDownloader::Implementation::setBandwidthLimit(U64 bytesPerSecond) +{ + if((mBandwidthLimit != bytesPerSecond) && isDownloading()) { + llassert(mCurl != 0); + mBandwidthLimit = bytesPerSecond; + CURLcode code = curl_easy_setopt(mCurl, CURLOPT_MAX_RECV_SPEED_LARGE, &mBandwidthLimit); + if(code != CURLE_OK) LL_WARNS("UpdateDownload") << + "unable to change dowload bandwidth" << LL_ENDL; + } else { + mBandwidthLimit = bytesPerSecond; + } +} + + size_t LLUpdateDownloader::Implementation::onHeader(void * buffer, size_t size) { char const * headerPtr = reinterpret_cast (buffer); @@ -388,6 +411,9 @@ void LLUpdateDownloader::Implementation::initializeCurlGet(std::string const & u throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_PROGRESSFUNCTION, &progress_callback)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_PROGRESSDATA, this)); throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_NOPROGRESS, false)); + if(mBandwidthLimit != 0) { + throwOnCurlError(curl_easy_setopt(mCurl, CURLOPT_MAX_RECV_SPEED_LARGE, mBandwidthLimit)); + } mDownloadPercent = 0; } diff --git a/indra/viewer_components/updater/llupdatedownloader.h b/indra/viewer_components/updater/llupdatedownloader.h index 09ea1676d5..4e20b307b8 100644 --- a/indra/viewer_components/updater/llupdatedownloader.h +++ b/indra/viewer_components/updater/llupdatedownloader.h @@ -60,6 +60,9 @@ public: // Resume a partial download. void resume(void); + // Set a limit on the dowload rate. + void setBandwidthLimit(U64 bytesPerSecond); + private: boost::shared_ptr mImplementation; }; diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index 7d180ff649..b29356b968 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -114,6 +114,7 @@ public: const std::string& version); void setCheckPeriod(unsigned int seconds); + void setBandwidthLimit(U64 bytesPerSecond); void startChecking(bool install_if_ready); void stopChecking(); @@ -189,6 +190,11 @@ void LLUpdaterServiceImpl::setCheckPeriod(unsigned int seconds) mCheckPeriod = seconds; } +void LLUpdaterServiceImpl::setBandwidthLimit(U64 bytesPerSecond) +{ + mUpdateDownloader.setBandwidthLimit(bytesPerSecond); +} + void LLUpdaterServiceImpl::startChecking(bool install_if_ready) { if(mUrl.empty() || mChannel.empty() || mVersion.empty()) @@ -541,6 +547,11 @@ void LLUpdaterService::setCheckPeriod(unsigned int seconds) { mImpl->setCheckPeriod(seconds); } + +void LLUpdaterService::setBandwidthLimit(U64 bytesPerSecond) +{ + mImpl->setBandwidthLimit(bytesPerSecond); +} void LLUpdaterService::startChecking(bool install_if_ready) { diff --git a/indra/viewer_components/updater/llupdaterservice.h b/indra/viewer_components/updater/llupdaterservice.h index 8b76a9d1e7..1ffa609019 100644 --- a/indra/viewer_components/updater/llupdaterservice.h +++ b/indra/viewer_components/updater/llupdaterservice.h @@ -76,6 +76,7 @@ public: const std::string& version); void setCheckPeriod(unsigned int seconds); + void setBandwidthLimit(U64 bytesPerSecond); void startChecking(bool install_if_ready = false); void stopChecking(); diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index 050bb774f7..fbdf9a4993 100644 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -101,6 +101,7 @@ std::string LLUpdateDownloader::downloadMarkerPath(void) void LLUpdateDownloader::resume(void) {} void LLUpdateDownloader::cancel(void) {} +void LLUpdateDownloader::setBandwidthLimit(U64 bytesPerSecond) {} int ll_install_update(std::string const &, std::string const &, LLInstallScriptMode) { -- cgit v1.2.3 From ad6392696574e446ccc3e559be39bb094a9a032e Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Tue, 7 Dec 2010 15:57:40 -0800 Subject: sync with viewer-beta 2.4, 12/7/2010 --- .../newview/skins/default/xui/en/floater_buy_currency.xml | 2 ++ indra/newview/skins/default/xui/en/floater_nearby_chat.xml | 3 --- .../newview/skins/default/xui/en/panel_classified_info.xml | 3 ++- .../newview/skins/default/xui/en/panel_edit_classified.xml | 3 ++- indra/newview/skins/default/xui/en/panel_edit_pick.xml | 3 ++- indra/newview/skins/default/xui/en/panel_edit_wearable.xml | 3 ++- .../skins/default/xui/en/panel_group_info_sidetray.xml | 3 ++- indra/newview/skins/default/xui/en/panel_landmark_info.xml | 3 ++- indra/newview/skins/default/xui/en/panel_login.xml | 2 +- indra/newview/skins/default/xui/en/panel_outfit_edit.xml | 3 ++- indra/newview/skins/default/xui/en/panel_pick_info.xml | 3 ++- indra/newview/skins/default/xui/en/panel_place_profile.xml | 3 ++- .../skins/default/xui/en/panel_preferences_colors.xml | 14 +++++++------- .../skins/default/xui/en/panel_preferences_graphics1.xml | 2 +- .../skins/default/xui/en/panel_preferences_privacy.xml | 2 +- indra/newview/skins/default/xui/en/panel_profile_view.xml | 3 ++- indra/newview/skins/default/xui/en/sidepanel_item_info.xml | 3 ++- indra/newview/skins/default/xui/en/sidepanel_task_info.xml | 3 ++- indra/newview/skins/default/xui/en/widgets/avatar_icon.xml | 4 +++- indra/newview/skins/default/xui/en/widgets/button.xml | 3 ++- indra/newview/skins/default/xui/en/widgets/icon.xml | 1 + 21 files changed, 42 insertions(+), 27 deletions(-) (limited to 'indra') 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 cd5922a9a2..49deb9b025 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -20,6 +20,7 @@ left="0" name="normal_background" top="17" + use_draw_context_alpha="false" width="350" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> - Bubble chat: + Bubble chat background: + parameter="NameTagBackground" /> + parameter="NameTagBackground" /> 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 97229c413c..c553a3aba0 100644 --- a/indra/newview/skins/default/xui/en/panel_profile_view.xml +++ b/indra/newview/skins/default/xui/en/panel_profile_view.xml @@ -27,7 +27,8 @@ left="10" tab_stop="false" top="2" - width="30" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> + width="30" + use_draw_context_alpha="false" /> - + diff --git a/indra/newview/skins/default/xui/en/widgets/button.xml b/indra/newview/skins/default/xui/en/widgets/button.xml index 2d0a1728d5..1746a045cf 100644 --- a/indra/newview/skins/default/xui/en/widgets/button.xml +++ b/indra/newview/skins/default/xui/en/widgets/button.xml @@ -24,5 +24,6 @@ halign="center" pad_bottom="3" height="23" - scale_image="true"> + scale_image="true" + use_draw_context_alpha="true"> diff --git a/indra/newview/skins/default/xui/en/widgets/icon.xml b/indra/newview/skins/default/xui/en/widgets/icon.xml index adb743a628..cf8edfcedb 100644 --- a/indra/newview/skins/default/xui/en/widgets/icon.xml +++ b/indra/newview/skins/default/xui/en/widgets/icon.xml @@ -3,5 +3,6 @@ tab_stop="false" mouse_opaque="false" name="icon" + use_draw_context_alpha="true" follows="left|top"> -- cgit v1.2.3 From 337f95f8b92d5efd0aaf4e955244ddbeae437bf1 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Tue, 7 Dec 2010 16:20:19 -0800 Subject: lamo programmer ui for setting downloader bandwidth limit. --- indra/newview/app_settings/settings.xml | 11 ++++++++ indra/newview/llappviewer.cpp | 4 +-- .../default/xui/en/panel_preferences_setup.xml | 32 ++++++++++++++++++++-- 3 files changed, 42 insertions(+), 5 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 7dbb375a20..33a48164b0 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9990,6 +9990,17 @@ Value 500.0 + UpdaterMaximumBandwidth + + Comment + Maximum allowable downstream bandwidth for updater service (kilo bits per second) + Persist + 1 + Type + F32 + Value + 500.0 + ToolTipDelay Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 38422621ef..3943ab0f30 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2441,8 +2441,8 @@ void LLAppViewer::initUpdater() channel, version); mUpdater->setCheckPeriod(check_period); - mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("ThrottleBandwidthKBPS") * (1024/8)); - gSavedSettings.getControl("ThrottleBandwidthKBPS")->getSignal()-> + mUpdater->setBandwidthLimit((int)gSavedSettings.getF32("UpdaterMaximumBandwidth") * (1024/8)); + gSavedSettings.getControl("UpdaterMaximumBandwidth")->getSignal()-> connect(boost::bind(&on_bandwidth_throttle, mUpdater.get(), _2)); if(gSavedSettings.getBOOL("UpdaterServiceActive")) { diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 584bd1ea9d..b551901a56 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -142,7 +142,7 @@ layout="topleft" left="80" name="Cache location" - top_delta="40" + top_delta="20" width="300"> Cache location: @@ -341,7 +341,6 @@ name="web_proxy_port" top_delta="0" width="145" /> - - + +Download bandwidth + + -- cgit v1.2.3 From 32a591d5ed43a94f6a36c16687c48403a4dd9d97 Mon Sep 17 00:00:00 2001 From: Eli Linden Date: Tue, 7 Dec 2010 16:32:43 -0800 Subject: VWR-24079 FIX DE linguistic by Torben Trautman --- indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml | 2 +- indra/newview/skins/default/xui/de/panel_preferences_privacy.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml index ae3c791ab9..abbf87af0c 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_graphics1.xml @@ -46,7 +46,7 @@ - Gitterdetails: + Darstellungsgrad: diff --git a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml index 42a625fbf6..68ceb8da30 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_privacy.xml @@ -16,7 +16,7 @@ - + Protokolle speichern in: -- cgit v1.2.3 From 8d82b79ab43264af48c9e46873e1ccecba60ceda Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 8 Dec 2010 11:23:24 +0200 Subject: STORM-436 WIP Renamed members for consistency. --- indra/newview/llfavoritesbar.cpp | 28 ++++++++++++++-------------- indra/newview/llfavoritesbar.h | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index a1ba370c26..18fb744201 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -368,8 +368,8 @@ LLFavoritesBarCtrl::Params::Params() LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) : LLUICtrl(p), mFont(p.font.isProvided() ? p.font() : LLFontGL::getFontSansSerifSmall()), - mPopupMenuHandle(), - mInventoryItemsPopupMenuHandle(), + mOverflowMenuHandle(), + mContextMenuHandle(), mImageDragIndication(p.image_drag_indication), mShowDragMarker(FALSE), mLandingTab(NULL), @@ -402,8 +402,8 @@ LLFavoritesBarCtrl::~LLFavoritesBarCtrl() { gInventory.removeObserver(this); - LLView::deleteViewByHandle(mPopupMenuHandle); - LLView::deleteViewByHandle(mInventoryItemsPopupMenuHandle); + LLView::deleteViewByHandle(mOverflowMenuHandle); + LLView::deleteViewByHandle(mContextMenuHandle); } BOOL LLFavoritesBarCtrl::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, @@ -520,7 +520,7 @@ void LLFavoritesBarCtrl::handleExistingFavoriteDragAndDrop(S32 x, S32 y) gInventory.saveItemsOrder(mItems); - LLToggleableMenu* menu = (LLToggleableMenu*) mPopupMenuHandle.get(); + LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); if (menu && menu->getVisible()) { @@ -776,7 +776,7 @@ void LLFavoritesBarCtrl::updateButtons() mChevronButton->setVisible(TRUE); } // Update overflow menu - LLToggleableMenu* overflow_menu = static_cast (mPopupMenuHandle.get()); + LLToggleableMenu* overflow_menu = static_cast (mOverflowMenuHandle.get()); if (overflow_menu && overflow_menu->getVisible()) { overflow_menu->setVisible(FALSE); @@ -850,7 +850,7 @@ BOOL LLFavoritesBarCtrl::postBuild() menu = LLUICtrlFactory::getDefaultWidget("inventory_menu"); } menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); - mInventoryItemsPopupMenuHandle = menu->getHandle(); + mContextMenuHandle = menu->getHandle(); return TRUE; } @@ -881,7 +881,7 @@ BOOL LLFavoritesBarCtrl::collectFavoriteItems(LLInventoryModel::item_array_t &it void LLFavoritesBarCtrl::showDropDownMenu() { - if (mPopupMenuHandle.isDead()) + if (mOverflowMenuHandle.isDead()) { LLToggleableMenu::Params menu_p; menu_p.name("favorites menu"); @@ -892,10 +892,10 @@ void LLFavoritesBarCtrl::showDropDownMenu() menu_p.preferred_width = DROP_DOWN_MENU_WIDTH; LLToggleableMenu* menu = LLUICtrlFactory::create(menu_p); - mPopupMenuHandle = menu->getHandle(); + mOverflowMenuHandle = menu->getHandle(); } - LLToggleableMenu* menu = (LLToggleableMenu*)mPopupMenuHandle.get(); + LLToggleableMenu* menu = (LLToggleableMenu*)mOverflowMenuHandle.get(); if (menu) { @@ -973,7 +973,7 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S { mSelectedItemID = item_id; - LLMenuGL* menu = (LLMenuGL*)mInventoryItemsPopupMenuHandle.get(); + LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get(); if (!menu) { return; @@ -1082,7 +1082,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. - LLToggleableMenu* menu = (LLToggleableMenu*) mPopupMenuHandle.get(); + LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); if (menu && !menu->getVisible()) { showDropDownMenu(); @@ -1149,11 +1149,11 @@ void LLFavoritesBarCtrl::pastFromClipboard() const void LLFavoritesBarCtrl::onButtonMouseDown(LLUUID id, LLUICtrl* ctrl, S32 x, S32 y, MASK mask) { // EXT-6997 (Fav bar: Pop-up menu for LM in overflow dropdown is kept after LM was dragged away) - // mInventoryItemsPopupMenuHandle.get() - is a pop-up menu (of items) in already opened dropdown menu. + // mContextMenuHandle.get() - is a pop-up menu (of items) in already opened dropdown menu. // We have to check and set visibility of pop-up menu in such a way instead of using // LLMenuHolderGL::hideMenus() because it will close both menus(dropdown and pop-up), but // we need to close only pop-up menu while dropdown one should be still opened. - LLMenuGL* menu = (LLMenuGL*)mInventoryItemsPopupMenuHandle.get(); + LLMenuGL* menu = (LLMenuGL*)mContextMenuHandle.get(); if(menu && menu->getVisible()) { menu->setVisible(FALSE); diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 37645523f6..234f0bc7de 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -91,8 +91,8 @@ protected: void showDropDownMenu(); - LLHandle mPopupMenuHandle; - LLHandle mInventoryItemsPopupMenuHandle; + LLHandle mOverflowMenuHandle; + LLHandle mContextMenuHandle; LLUUID mFavoriteFolderId; const LLFontGL *mFont; -- cgit v1.2.3 From ebdbe36f28c27e14f579722df8ba4e0faebca2ac Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 8 Dec 2010 11:53:13 +0200 Subject: STORM-436 FIXED Favorites overflow list appeared if you clicked a favorite landmark context menu item. --- indra/newview/llfavoritesbar.cpp | 11 ++++++++++- indra/newview/llfavoritesbar.h | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index 18fb744201..0c0fdd5572 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -376,6 +376,7 @@ LLFavoritesBarCtrl::LLFavoritesBarCtrl(const LLFavoritesBarCtrl::Params& p) mLastTab(NULL), mTabsHighlightEnabled(TRUE) , mUpdateDropDownItems(true) +, mRestoreOverflowMenu(false) { // Register callback for menus with current registrar (will be parent panel's registrar) LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Favorites.DoToSelected", @@ -978,6 +979,14 @@ void LLFavoritesBarCtrl::onButtonRightClick( LLUUID item_id,LLView* fav_button,S { return; } + + // Remember that the context menu was shown simultaneously with the overflow menu, + // so that we can restore the overflow menu when user clicks a context menu item + // (which hides the overflow menu). + { + LLView* overflow_menu = mOverflowMenuHandle.get(); + mRestoreOverflowMenu = overflow_menu && overflow_menu->getVisible(); + } // Release mouse capture so hover events go to the popup menu // because this is happening during a mouse down. @@ -1083,7 +1092,7 @@ void LLFavoritesBarCtrl::doToSelected(const LLSD& userdata) // Pop-up the overflow menu again (it gets hidden whenever the user clicks a context menu item). // See EXT-4217 and STORM-207. LLToggleableMenu* menu = (LLToggleableMenu*) mOverflowMenuHandle.get(); - if (menu && !menu->getVisible()) + if (mRestoreOverflowMenu && menu && !menu->getVisible()) { showDropDownMenu(); } diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h index 234f0bc7de..1a28731c4f 100644 --- a/indra/newview/llfavoritesbar.h +++ b/indra/newview/llfavoritesbar.h @@ -98,6 +98,7 @@ protected: const LLFontGL *mFont; S32 mFirstDropDownItem; bool mUpdateDropDownItems; + bool mRestoreOverflowMenu; LLUUID mSelectedItemID; -- cgit v1.2.3 From 80058f35edddc40c8e435c6b31d437776e632b2b Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 8 Dec 2010 17:51:11 +0200 Subject: STORM-766 FIXED The day cycle icon in environment editor now follows floater transparency settings. --- indra/newview/skins/default/xui/en/floater_env_settings.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') 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 14f9e2db95..8df5e232d9 100644 --- a/indra/newview/skins/default/xui/en/floater_env_settings.xml +++ b/indra/newview/skins/default/xui/en/floater_env_settings.xml @@ -44,6 +44,7 @@ left="85" name="EnvDayCycle" top="30" + use_draw_context_alpha="false" width="200" /> Date: Wed, 8 Dec 2010 09:39:14 -0800 Subject: fix windows build. --- indra/newview/tests/lllogininstance_test.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/tests/lllogininstance_test.cpp b/indra/newview/tests/lllogininstance_test.cpp index 5f73aa1d3c..59a8e40607 100644 --- a/indra/newview/tests/lllogininstance_test.cpp +++ b/indra/newview/tests/lllogininstance_test.cpp @@ -40,6 +40,7 @@ #if defined(LL_WINDOWS) #pragma warning(disable: 4355) // using 'this' in base-class ctor initializer expr +#pragma warning(disable: 4702) // disable 'unreachable code' so we can safely use skip(). #endif // Constants -- cgit v1.2.3 From 6730aacbfa8e1d6c778f514e489b96b29a247153 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 8 Dec 2010 15:41:00 -0500 Subject: Adjusted whitespace in llscreenchannel.cpp --- indra/newview/llscreenchannel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 8dd5f068b6..7254e1b6ca 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -835,7 +835,7 @@ void LLScreenChannel::onToastHover(LLToast* toast, bool mouse_enter) } } - redrawToasts(); + redrawToasts(); } //-------------------------------------------------------------------------- -- cgit v1.2.3 From 115851ce14b7aff83027f9d4d2ec32b3ce448c56 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 8 Dec 2010 13:11:19 -0800 Subject: improved dialog message for required update. --- indra/newview/skins/default/xui/en/notifications.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e333c891a4..e32e28bea3 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2892,12 +2892,11 @@ http://secondlife.com/download. icon="alertmodal.tga" name="UpdaterServiceNotRunning" type="alertmodal"> -An update is required to log in. May we start the background -updater service to fetch and install the update? +There is a required update for your Second Life Installation. + notext="Quit Second Life" + yestext="Download and install now"/> Date: Wed, 8 Dec 2010 23:43:25 +0200 Subject: STORM-584 ADDITIONAL FIX When the user sets the opacity for the name tag the selected opacity is shown in the color swatch to the left. Fixed color swatch label and tooltip. Added toolltip to opacity slider. --- indra/newview/llfloaterpreference.cpp | 12 ++++++++++++ indra/newview/llfloaterpreference.h | 1 + .../skins/default/xui/en/panel_preferences_colors.xml | 7 ++++--- 3 files changed, 17 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 6a7b5171b5..338b6555ff 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -342,6 +342,8 @@ BOOL LLFloaterPreference::postBuild() gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLNearbyChat::processChatHistoryStyleUpdate, _2)); + gSavedSettings.getControl("ChatBubbleOpacity")->getSignal()->connect(boost::bind(&LLFloaterPreference::onNameTagOpacityChange, this, _2)); + LLTabContainer* tabcontainer = getChild("pref core"); if (!tabcontainer->selectTab(gSavedSettings.getS32("LastPrefTab"))) tabcontainer->selectFirstTab(); @@ -745,6 +747,16 @@ void LLFloaterPreference::onLanguageChange() } } +void LLFloaterPreference::onNameTagOpacityChange(const LLSD& newvalue) +{ + LLColorSwatchCtrl* color_swatch = findChild("background"); + if (color_swatch) + { + LLColor4 new_color = color_swatch->get(); + color_swatch->set( new_color.setAlpha(newvalue.asReal()) ); + } +} + void LLFloaterPreference::onClickSetCache() { std::string cur_name(gSavedSettings.getString("CacheLocation")); diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index bb871e7e25..0f51189853 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -84,6 +84,7 @@ protected: void onClickBrowserClearCache(); void onLanguageChange(); + void onNameTagOpacityChange(const LLSD& newvalue); // set value of "BusyResponseChanged" in account settings depending on whether busy response // string differs from default after user changes. diff --git a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml index 5797a63f4e..8a37822413 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_colors.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_colors.xml @@ -275,9 +275,9 @@ height="12" name="bubble_chat" top_pad="20" - width="140" + width="450" > - Bubble chat background: + Name tag background color (also affects Bubble Chat): Date: Wed, 8 Dec 2010 16:49:28 -0500 Subject: CHOP-239: reconcile LL_VERSION_BUNDLE_ID with Info-SecondLife.plist. The bundle ID is found in llversionviewer.h, Info-SecondLife.plist and mac_updater.cpp. The latter two state it as "com.secondlife.indra.viewer". llversionviewer.h stated it as "com.secondlife.snowglobe.viewer". Changing it to "indra" to be consistent. For further discussion, please see the Jira. --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index b209e4aa38..e491b502ab 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -35,7 +35,7 @@ const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; #if LL_DARWIN -const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.snowglobe.viewer"; +const char * const LL_VERSION_BUNDLE_ID = "com.secondlife.indra.viewer"; #endif #endif -- cgit v1.2.3 From 27aebda80f302e77a204f5c1931d3e52c6034edb Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Wed, 8 Dec 2010 13:59:45 -0800 Subject: progress viewer will no longer fade out if toggled quickly from visible to invisible to visible again. --- indra/newview/llprogressview.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llprogressview.cpp b/indra/newview/llprogressview.cpp index e9504cbba0..250dfc5713 100644 --- a/indra/newview/llprogressview.cpp +++ b/indra/newview/llprogressview.cpp @@ -133,13 +133,13 @@ void LLProgressView::setVisible(BOOL visible) mFadeTimer.start(); } // showing progress view - else if (!getVisible() && visible) + else if (visible && (!getVisible() || mFadeTimer.getStarted())) { setFocus(TRUE); mFadeTimer.stop(); mProgressTimer.start(); LLPanel::setVisible(TRUE); - } + } } -- cgit v1.2.3 From 61b675e0afb96d1d46b1f36a8d54bb8146ef27d6 Mon Sep 17 00:00:00 2001 From: callum Date: Wed, 8 Dec 2010 14:38:20 -0800 Subject: SOCIAL-358 FIX Add button to Web Content floater to open current URL in system browser --- indra/newview/llfloaterwebcontent.cpp | 22 ++++++++++++++++++---- indra/newview/llfloaterwebcontent.h | 2 +- .../skins/default/xui/en/floater_web_content.xml | 19 ++++++++++++++++++- 3 files changed, 37 insertions(+), 6 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index ed66be165e..d9748b2235 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -33,6 +33,7 @@ #include "llprogressbar.h" #include "lltextbox.h" #include "llviewercontrol.h" +#include "llweb.h" #include "llwindow.h" #include "llfloaterwebcontent.h" @@ -43,8 +44,8 @@ LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); mCommitCallbackRegistrar.add( "WebContent.Reload", boost::bind( &LLFloaterWebContent::onClickReload, this )); - mCommitCallbackRegistrar.add( "WebContent.EnterAddress", boost::bind( &LLFloaterWebContent::onEnterAddress, this )); + mCommitCallbackRegistrar.add( "WebContent.PopExternal", boost::bind( &LLFloaterWebContent::onPopExternal, this )); } BOOL LLFloaterWebContent::postBuild() @@ -58,8 +59,9 @@ BOOL LLFloaterWebContent::postBuild() // observe browser events mWebBrowser->addObserver( this ); - // these button are always enabled + // these buttons are always enabled getChildView("reload")->setEnabled( true ); + getChildView("popexternal")->setEnabled( true ); return TRUE; } @@ -323,8 +325,20 @@ void LLFloaterWebContent::onEnterAddress() { // make sure there is at least something there. // (perhaps this test should be for minimum length of a URL) - if ( mAddressCombo->getValue().asString().length() > 0 ) + std::string url = mAddressCombo->getValue().asString(); + if ( url.length() > 0 ) + { + mWebBrowser->navigateTo( url, "text/html"); + }; +} + +void LLFloaterWebContent::onPopExternal() +{ + // make sure there is at least something there. + // (perhaps this test should be for minimum length of a URL) + std::string url = mAddressCombo->getValue().asString(); + if ( url.length() > 0 ) { - mWebBrowser->navigateTo( mAddressCombo->getValue().asString(), "text/html"); + LLWeb::loadURLExternal( url ); }; } diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 1effa2c4ab..09b4945b65 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -61,7 +61,7 @@ public: void onClickReload(); void onClickStop(); void onEnterAddress(); - void onClickGo(); + void onPopExternal(); private: void open_media(const std::string& media_url, const std::string& target); diff --git a/indra/newview/skins/default/xui/en/floater_web_content.xml b/indra/newview/skins/default/xui/en/floater_web_content.xml index eac1b4e712..3072ca1b0e 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -110,10 +110,27 @@ name="address" combo_editor.select_on_focus="true" top_delta="0" - width="729"> + width="702"> + Date: Thu, 9 Dec 2010 01:04:57 +0200 Subject: STORM-578 FIXED using the color setting for "URLs" from Preferences for names in Nearby Chat toasts. --- indra/newview/llchatitemscontainerctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llchatitemscontainerctrl.cpp b/indra/newview/llchatitemscontainerctrl.cpp index 3afddc1145..899e0431e7 100644 --- a/indra/newview/llchatitemscontainerctrl.cpp +++ b/indra/newview/llchatitemscontainerctrl.cpp @@ -224,7 +224,8 @@ void LLNearbyChatToastPanel::init(LLSD& notification) href = LLSLURL("object", mFromID, "inspect").getSLURLString(); } - style_params_name.color(textColor); + LLColor4 user_name_color = LLUIColorTable::instance().getColor("HTMLLinkColor"); + style_params_name.color(user_name_color); std::string font_name = LLFontGL::nameFromFont(messageFont); std::string font_style_size = LLFontGL::sizeFromFont(messageFont); -- cgit v1.2.3 From c28b476a6806a426593e6798ea537f13ca354fc8 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 8 Dec 2010 15:26:36 -0800 Subject: EXP-448 FIX Notification not found error for NofileExtension given when uploading file with no file extension during Bulk Upload --- indra/newview/llviewermenufile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 048691696b..b7be3bc5b3 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -505,7 +505,7 @@ void upload_new_resource(const std::string& src_filename, std::string name, "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension", short_name.c_str()); args["FILE"] = short_name; - upload_error(error_message, "NofileExtension", filename, args); + upload_error(error_message, "NoFileExtension", filename, args); return; } else if( exten == "bmp") -- cgit v1.2.3 From d9fad868ed5fb53522dde44f084c299df0429d53 Mon Sep 17 00:00:00 2001 From: brad kittenbrink Date: Wed, 8 Dec 2010 15:54:50 -0800 Subject: Fix for CHOP-262 (update notifications prior to login) and first attempt at CHOP-261 (add handlers for update ready notification buttons) reviewed by mani. --- indra/newview/llappviewer.cpp | 28 ++++++++++++++++++++-- .../newview/skins/default/xui/en/notifications.xml | 4 ++-- 2 files changed, 28 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 3943ab0f30..b852b63cf8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2394,14 +2394,38 @@ bool LLAppViewer::initConfiguration() } namespace { - // *TODO - decide if there's a better place for this function. + // *TODO - decide if there's a better place for these functions. // do we need a file llupdaterui.cpp or something? -brad + + void apply_update_callback(LLSD const & notification, LLSD const & response) + { + lldebugs << "LLUpdate user response: " << response << llendl; + if(response["OK_okcancelbuttons"].asBoolean()) + { + llinfos << "LLUpdate restarting viewer" << llendl; + static const bool install_if_ready = true; + // *HACK - this lets us launch the installer immediately for now + LLUpdaterService().startChecking(install_if_ready); + } + } + bool notify_update(LLSD const & evt) { + std::string notification_name; switch (evt["type"].asInteger()) { case LLUpdaterService::DOWNLOAD_COMPLETE: - LLNotificationsUtil::add("DownloadBackgroundDialog"); + if(LLStartUp::getStartupState() < STATE_STARTED) + { + // CHOP-262 we need to use a different notification + // method prior to login. + notification_name = "DownloadBackgroundDialog"; + } + else + { + notification_name = "DownloadBackgroundTip"; + } + LLNotificationsUtil::add(notification_name, LLSD(), LLSD(), apply_update_callback); break; case LLUpdaterService::INSTALL_ERROR: LLNotificationsUtil::add("FailedUpdateInstall"); diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index e333c891a4..8c76231595 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2901,9 +2901,9 @@ updater service to fetch and install the update? + type="notify"> An updated version of [APP_NAME] has been downloaded. It will be applied the next time you restart [APP_NAME] Date: Wed, 8 Dec 2010 16:40:30 -0800 Subject: CT-634 WIP DE ES FR translation for Viewer 2.4 for viewer-beta --- .../default/xui/de/floater_hardware_settings.xml | 3 ++ .../skins/default/xui/de/floater_preferences.xml | 4 +- .../default/xui/de/menu_inventory_gear_default.xml | 9 +++-- indra/newview/skins/default/xui/de/menu_viewer.xml | 19 ++++----- .../newview/skins/default/xui/de/notifications.xml | 20 +++++++++- .../skins/default/xui/de/panel_edit_gloves.xml | 2 +- .../skins/default/xui/de/panel_edit_jacket.xml | 4 +- .../skins/default/xui/de/panel_edit_pants.xml | 2 +- .../skins/default/xui/de/panel_edit_shirt.xml | 2 +- .../skins/default/xui/de/panel_edit_shoes.xml | 2 +- .../skins/default/xui/de/panel_edit_skirt.xml | 2 +- .../skins/default/xui/de/panel_edit_socks.xml | 2 +- .../skins/default/xui/de/panel_edit_underpants.xml | 2 +- .../skins/default/xui/de/panel_edit_undershirt.xml | 2 +- .../newview/skins/default/xui/de/panel_people.xml | 10 ++--- .../default/xui/de/panel_preferences_advanced.xml | 29 +++----------- .../default/xui/de/panel_preferences_chat.xml | 43 ++++----------------- .../default/xui/de/panel_preferences_general.xml | 12 ++++-- .../default/xui/de/panel_preferences_graphics1.xml | 1 + .../default/xui/de/panel_preferences_privacy.xml | 9 +++-- .../default/xui/de/panel_preferences_setup.xml | 8 +--- .../default/xui/de/panel_preferences_sound.xml | 8 ++++ .../skins/default/xui/de/panel_script_ed.xml | 11 +++--- indra/newview/skins/default/xui/de/strings.xml | 7 +--- .../default/xui/es/floater_hardware_settings.xml | 3 ++ .../skins/default/xui/es/floater_preferences.xml | 4 +- .../default/xui/es/menu_inventory_gear_default.xml | 9 +++-- indra/newview/skins/default/xui/es/menu_viewer.xml | 19 ++++----- .../newview/skins/default/xui/es/notifications.xml | 17 ++++++++ .../skins/default/xui/es/panel_edit_gloves.xml | 2 +- .../skins/default/xui/es/panel_edit_jacket.xml | 4 +- .../skins/default/xui/es/panel_edit_pants.xml | 2 +- .../skins/default/xui/es/panel_edit_shirt.xml | 2 +- .../skins/default/xui/es/panel_edit_shoes.xml | 2 +- .../skins/default/xui/es/panel_edit_skirt.xml | 2 +- .../skins/default/xui/es/panel_edit_socks.xml | 2 +- .../skins/default/xui/es/panel_edit_underpants.xml | 2 +- .../skins/default/xui/es/panel_edit_undershirt.xml | 2 +- .../newview/skins/default/xui/es/panel_people.xml | 10 ++--- .../default/xui/es/panel_preferences_advanced.xml | 29 +++----------- .../default/xui/es/panel_preferences_chat.xml | 45 +++++----------------- .../default/xui/es/panel_preferences_general.xml | 12 ++++-- .../default/xui/es/panel_preferences_graphics1.xml | 1 + .../default/xui/es/panel_preferences_privacy.xml | 9 +++-- .../default/xui/es/panel_preferences_setup.xml | 8 +--- .../default/xui/es/panel_preferences_sound.xml | 8 ++++ .../skins/default/xui/es/panel_script_ed.xml | 11 +++--- indra/newview/skins/default/xui/es/strings.xml | 7 +--- .../default/xui/fr/floater_hardware_settings.xml | 3 ++ .../skins/default/xui/fr/floater_preferences.xml | 4 +- .../default/xui/fr/menu_inventory_gear_default.xml | 9 +++-- indra/newview/skins/default/xui/fr/menu_viewer.xml | 19 ++++----- .../newview/skins/default/xui/fr/notifications.xml | 19 ++++++++- .../skins/default/xui/fr/panel_edit_gloves.xml | 2 +- .../skins/default/xui/fr/panel_edit_jacket.xml | 4 +- .../skins/default/xui/fr/panel_edit_pants.xml | 2 +- .../skins/default/xui/fr/panel_edit_shirt.xml | 2 +- .../skins/default/xui/fr/panel_edit_shoes.xml | 2 +- .../skins/default/xui/fr/panel_edit_skirt.xml | 2 +- .../skins/default/xui/fr/panel_edit_socks.xml | 2 +- .../skins/default/xui/fr/panel_edit_underpants.xml | 2 +- .../skins/default/xui/fr/panel_edit_undershirt.xml | 2 +- .../skins/default/xui/fr/panel_main_inventory.xml | 2 +- .../newview/skins/default/xui/fr/panel_people.xml | 18 ++++----- .../default/xui/fr/panel_preferences_advanced.xml | 29 +++----------- .../default/xui/fr/panel_preferences_chat.xml | 43 ++++----------------- .../default/xui/fr/panel_preferences_general.xml | 12 ++++-- .../default/xui/fr/panel_preferences_graphics1.xml | 5 ++- .../default/xui/fr/panel_preferences_privacy.xml | 9 +++-- .../default/xui/fr/panel_preferences_setup.xml | 8 +--- .../default/xui/fr/panel_preferences_sound.xml | 8 ++++ .../skins/default/xui/fr/panel_script_ed.xml | 11 +++--- .../default/xui/fr/panel_teleport_history.xml | 2 +- indra/newview/skins/default/xui/fr/strings.xml | 13 +++---- 74 files changed, 308 insertions(+), 351 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml index d931596efe..9644bbbaea 100644 --- a/indra/newview/skins/default/xui/de/floater_hardware_settings.xml +++ b/indra/newview/skins/default/xui/de/floater_hardware_settings.xml @@ -14,6 +14,9 @@ + + (Neustart des Viewers erforderlich) + (0 = Standard-Helligkeit, weniger = heller) diff --git a/indra/newview/skins/default/xui/de/floater_preferences.xml b/indra/newview/skins/default/xui/de/floater_preferences.xml index a2712c437b..3624c4c968 100644 --- a/indra/newview/skins/default/xui/de/floater_preferences.xml +++ b/indra/newview/skins/default/xui/de/floater_preferences.xml @@ -5,10 +5,12 @@ - + + + diff --git a/indra/newview/skins/default/xui/de/menu_inventory_gear_default.xml b/indra/newview/skins/default/xui/de/menu_inventory_gear_default.xml index 3fa68a27bd..df86a5cf71 100644 --- a/indra/newview/skins/default/xui/de/menu_inventory_gear_default.xml +++ b/indra/newview/skins/default/xui/de/menu_inventory_gear_default.xml @@ -1,8 +1,9 @@ - + - - + + + @@ -12,4 +13,4 @@ - + diff --git a/indra/newview/skins/default/xui/de/menu_viewer.xml b/indra/newview/skins/default/xui/de/menu_viewer.xml index 489990608f..9eeeaccdea 100644 --- a/indra/newview/skins/default/xui/de/menu_viewer.xml +++ b/indra/newview/skins/default/xui/de/menu_viewer.xml @@ -12,6 +12,12 @@ + + + + + + @@ -47,6 +53,7 @@ + @@ -123,7 +130,6 @@ - @@ -178,8 +184,7 @@ - - + @@ -197,7 +202,6 @@ - @@ -312,8 +316,7 @@ - - + @@ -325,8 +328,6 @@ - - @@ -366,9 +367,9 @@ - + diff --git a/indra/newview/skins/default/xui/de/notifications.xml b/indra/newview/skins/default/xui/de/notifications.xml index a904604b62..06cc02cd84 100644 --- a/indra/newview/skins/default/xui/de/notifications.xml +++ b/indra/newview/skins/default/xui/de/notifications.xml @@ -395,6 +395,9 @@ Hinweis: Der Cache wird dabei gelöscht/geleert. Die neue Benutzeroberfläche wird nach einem Neustart von [APP_NAME] angezeigt. + + Die Sprachänderung tritt nach Neustart von [APP_NAME] in Kraft. + Zur [SECOND_LIFE]-Webseite, um Auktionen anzuzeigen oder ein Gebot abzugeben? @@ -605,6 +608,10 @@ Erwartet wurde [VALIDS] „Daten“-Chunk in WAV-Header nicht gefunden: +[FILE] + + + Falsche Chunk-Größe in WAV-Datei: [FILE] @@ -1343,6 +1350,15 @@ Dieses Update ist nicht erforderlich, für bessere Leistung und Stabilität soll In Ihren Anwendungsordner herunterladen? + + Beim Installieren des Viewer-Updates ist ein Fehler aufgetreten. +Laden Sie den neuesten Viewer von http://secondlife.com/download herunter und installieren Sie ihn. + + + + Eine aktualisierte Version von [APP_NAME] wurde heruntergeladen. +Sie wird beim nächsten Neustart von [APP_NAME] verwendet. + Bei Übertragung dieses Objekts erhält die Gruppe: * An das Objekt bezahlte L$ @@ -2481,8 +2497,8 @@ Versuchen Sie es in einigen Minuten erneut. Ihr Freundschaftsangebot wurde abgelehnt. - [NAME] bietet Ihnen ihre/seine Visitenkarte an. -Ihrem Inventar wird ein Lesezeichen erstellt, damit Sie diesem Einwohner einfach eine IM schicken können. + [NAME] bietet Ihnen eine Visitenkarte an. +In Ihrem Inventar wird ein Lesezeichen erstellt, damit Sie diesem Einwohner schnell IMs senden können.
- @@ -177,8 +183,7 @@ - - + @@ -196,7 +201,6 @@ - @@ -267,16 +271,13 @@ - - +
- - @@ -303,9 +304,9 @@ - + diff --git a/indra/newview/skins/default/xui/es/notifications.xml b/indra/newview/skins/default/xui/es/notifications.xml index 6c5fe6a9eb..2dd7a6b0f5 100644 --- a/indra/newview/skins/default/xui/es/notifications.xml +++ b/indra/newview/skins/default/xui/es/notifications.xml @@ -385,6 +385,9 @@ Nota: esto vaciará la caché. Verás la nueva apariencia cuando reinicies [APP_NAME]. + + El cambio de idioma tendrá efecto cuando reinicies [APP_NAME]. + ¿Ir a la página web de [SECOND_LIFE] para ver los detalles de la subasta o hacer una puja? @@ -597,6 +600,10 @@ Podría ser [VALIDS] No se encontró el fragmento 'data' en la cabecera del WAV: +[FILE] + + + Tamaño de lote erróneo en el archivo WAV: [FILE] @@ -1334,6 +1341,16 @@ Esta actualización no es obligatoria, pero te sugerimos instalarla para mejorar ¿Descargarla a tu carpeta de Programas? + + Se ha producido un error al instalar la actualización del visor. +Descarga e instala el último visor a través de +http://secondlife.com/download. + + + + Se ha descargado una versión actualizada de [APP_NAME]. +Se aplicará la próxima vez que reinicies [APP_NAME] + Transferir este objeto al grupo hará que: * Reciba los L$ pagados en el objeto diff --git a/indra/newview/skins/default/xui/es/panel_edit_gloves.xml b/indra/newview/skins/default/xui/es/panel_edit_gloves.xml index 684a35a830..d536a862f5 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_gloves.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_gloves.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_jacket.xml b/indra/newview/skins/default/xui/es/panel_edit_jacket.xml index 347107d746..22a46a2f75 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_jacket.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_jacket.xml @@ -1,8 +1,8 @@ - - + + diff --git a/indra/newview/skins/default/xui/es/panel_edit_pants.xml b/indra/newview/skins/default/xui/es/panel_edit_pants.xml index e765702343..fb35e0953b 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_pants.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_pants.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_shirt.xml b/indra/newview/skins/default/xui/es/panel_edit_shirt.xml index f763e1b18d..73b712374e 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_shirt.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_shirt.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_shoes.xml b/indra/newview/skins/default/xui/es/panel_edit_shoes.xml index 70f2027398..5e457612d5 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_shoes.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_shoes.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_skirt.xml b/indra/newview/skins/default/xui/es/panel_edit_skirt.xml index 2c7196642c..416d174298 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_skirt.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_skirt.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_socks.xml b/indra/newview/skins/default/xui/es/panel_edit_socks.xml index 28423eaf61..ac9b2a773e 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_socks.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_socks.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_underpants.xml b/indra/newview/skins/default/xui/es/panel_edit_underpants.xml index 6c82bcfedf..aac8af44b9 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_underpants.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_underpants.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_edit_undershirt.xml b/indra/newview/skins/default/xui/es/panel_edit_undershirt.xml index 412bdceddf..c26c554c1a 100644 --- a/indra/newview/skins/default/xui/es/panel_edit_undershirt.xml +++ b/indra/newview/skins/default/xui/es/panel_edit_undershirt.xml @@ -1,7 +1,7 @@ - + diff --git a/indra/newview/skins/default/xui/es/panel_people.xml b/indra/newview/skins/default/xui/es/panel_people.xml index 1773735598..d0c80ebae5 100644 --- a/indra/newview/skins/default/xui/es/panel_people.xml +++ b/indra/newview/skins/default/xui/es/panel_people.xml @@ -22,7 +22,7 @@ - - @@ -177,8 +183,7 @@ - - + @@ -196,7 +201,6 @@ - @@ -311,8 +315,7 @@ - - + @@ -324,8 +327,6 @@ - - @@ -365,9 +366,9 @@ - + diff --git a/indra/newview/skins/default/xui/fr/notifications.xml b/indra/newview/skins/default/xui/fr/notifications.xml index 341cc9830d..ec362d7f22 100644 --- a/indra/newview/skins/default/xui/fr/notifications.xml +++ b/indra/newview/skins/default/xui/fr/notifications.xml @@ -387,6 +387,9 @@ Remarque : cela videra le cache. Le nouveau thème apparaîtra après le redémarrage de [APP_NAME]. + + Le changement de langue sera effectué au redémarrage de [APP_NAME]. + Aller à la page web de [SECOND_LIFE] pour voir le détail des enchères ou enchérir ? @@ -597,6 +600,10 @@ Assurez-vous que le fichier a l'extension correcte. Impossible de trouver les données dans l'en-tête WAV : +[FILE] + + + Taille de fragment incorrecte dans le fichier WAV : [FILE] @@ -1325,6 +1332,16 @@ Cette mise à jour n'est pas requise mais si vous voulez une meilleure perf Télécharger vers le dossier Applications ? + + Une erreur est survenue lors de l'installation de la mise à jour du client. +Veuillez télécharger et installer la dernière version du client à la page Web +http://secondlife.com/download. + + + + Une mise à jour de [APP_NAME] a été téléchargée. +Elle sera appliquée au prochain redémarrage de [APP_NAME]. + Si vous cédez cet objet, le groupe : * recevra les L$ versés pour l'objet ; @@ -2465,7 +2482,7 @@ Veuillez réessayer dans quelques minutes. [NAME] vous offre sa carte de visite. -Cela ajoute un marque-page dans votre inventaire, ce qui vous permet d'envoyer rapidement un IM à ce résident. +Un signet sera ajouté dans votre inventaire afin que vous puissiez envoyer rapidement un IM à ce résident. - @@ -175,8 +181,7 @@ - - + @@ -194,7 +199,6 @@ - @@ -265,16 +269,13 @@ - - + - - @@ -301,9 +302,9 @@ - + diff --git a/indra/newview/skins/default/xui/da/notifications.xml b/indra/newview/skins/default/xui/da/notifications.xml index 63c06ec27e..70299c61b4 100644 --- a/indra/newview/skins/default/xui/da/notifications.xml +++ b/indra/newview/skins/default/xui/da/notifications.xml @@ -247,6 +247,9 @@ Note: This will clear the cache. Den nye hud vil blive vist ved næste genstart af [APP_NAME]. + + Ændring af sprog vil først have effekt efter genstart af [APP_NAME]. + Ups, din start region er ikke angivet. Indtast venligst navn på region i Start lokation feltet eller vælg "Min sidste lokation" eller "Hjem". @@ -287,6 +290,10 @@ og du vil miste dem fra din beholdning hvis du forærer dem væk. Er du sikker p [EXTRA] Gå til [_URL] for information om køb af L$? + + + Fejl i WAV fil (chunk size): +[FILE] Kunne ikke 'forstå' filen: [FILE] @@ -584,6 +591,16 @@ Download til dit Program bibliotek? Denne opdatering er ikke påkrævet, men det anbefales at installere den for at opnå øget hastighed og forbedret stabilitet. Download til dit Program bibliotek? + + + Der opstod en fejl ved installation af opdatering. +Hent og installér venligst den nyeste version fra +http://secondlife.com/download. + + + + En opdateret version af [APP_NAME] er hentet. +Den vil blive anvendt næste gang du genstarter [APP_NAME] @@ -1370,8 +1387,8 @@ Prøv igen om lidt. Tilbud om venskab afvist. - [NAME] tilbyder dig et visitkort. -Dette vil lave et bogmørke i din beholding, så du hurtigt kan sende en IM til denne beboer. + [NAME] tilbyder sit visitkort. +Dette vil tilføje et bogmærke i din beholdning, så du hurtigt kan sende en personlig besked til denne beboer. - @@ -177,8 +183,7 @@ - - + @@ -196,7 +201,6 @@ - @@ -267,16 +271,13 @@ - - + - - @@ -303,9 +304,9 @@ - + diff --git a/indra/newview/skins/default/xui/pt/notifications.xml b/indra/newview/skins/default/xui/pt/notifications.xml index 76399e966c..dc38b740aa 100644 --- a/indra/newview/skins/default/xui/pt/notifications.xml +++ b/indra/newview/skins/default/xui/pt/notifications.xml @@ -385,6 +385,9 @@ Nota: Este procedimento limpa o cache. Reinicie o [APP_NAME] para ativar a pele nova. + + Reinicie o [APP_NAME] para exibir o idioma selecionado. + Ir para a página do [SECOND_LIFE] para ver os detalhes do leilão ou fazer um lance? @@ -592,6 +595,10 @@ Esperada [VALIDS] Não pode ser encontrado bloco de dados no cabeçalho WAV: +[FILE] + + + Pedaço de arquivo WAV de tamanho errado: [FILE] @@ -1316,6 +1323,16 @@ Não é preciso passar para a nova versão, mas ela pode melhorar o desempenho e Salvar na pasta Aplicativos? + + Ocorreu um erro de atualização do visualizador. +Baixe e instale a versão mais recente do visualizador em +http://secondlife.com/download. + + + + Foi baixada uma nova versão do [APP_NAME] +A nova versão será exibida quando o [APP_NAME] for reiniciado. + Delegar este objeto causará ao grupo: * Receber os L$ pagos ao objeto @@ -2448,8 +2465,8 @@ Cada um pode ver o status do outro (definição padrão). Oferta de amizada aceita. - [NAME] estão te oferecendo um cartão de visita. -Ele colocará um item de inventário, para você possa contatá-lo facilmente. + [NOME] está te oferecendo um cartão de visita. +Ele será um item no seu inventário, para você possa contatá-lo facilmente. + + + + + + + + + Date: Thu, 16 Dec 2010 09:34:19 -0800 Subject: Vary install failed message depending on whether it was required or not. --- indra/newview/llappviewer.cpp | 11 ++++++++++- indra/newview/skins/default/xui/en/notifications.xml | 13 +++++++++++++ indra/viewer_components/updater/llupdateinstaller.cpp | 7 ++++++- indra/viewer_components/updater/llupdateinstaller.h | 7 ++++--- indra/viewer_components/updater/llupdaterservice.cpp | 8 ++++++++ .../viewer_components/updater/scripts/darwin/update_install | 2 +- .../viewer_components/updater/scripts/linux/update_install | 2 +- .../updater/scripts/windows/update_install.bat | 2 +- .../updater/tests/llupdaterservice_test.cpp | 2 +- 9 files changed, 45 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5cf7087c71..c9800c9830 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -2475,6 +2475,11 @@ namespace { LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); } + + void install_error_callback(LLSD const & notification, LLSD const & response) + { + LLAppViewer::instance()->forceQuit(); + } bool notify_update(LLSD const & evt) { @@ -2485,7 +2490,11 @@ namespace { on_update_downloaded(evt); break; case LLUpdaterService::INSTALL_ERROR: - LLNotificationsUtil::add("FailedUpdateInstall"); + if(evt["required"].asBoolean()) { + LLNotificationsUtil::add("FailedRequiredUpdateInstall", LLSD(), LLSD(), &install_error_callback); + } else { + LLNotificationsUtil::add("FailedUpdateInstall"); + } break; default: break; diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index b0bb93c13a..fc5479a6f7 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2888,6 +2888,19 @@ http://secondlife.com/download. yestext="OK"/> + +We were unable to install a required update. +You will be unable to log in until [APP_NAME] has been updated. +Please download and install the latest viewer from +http://secondlife.com/download. + + + +#include #include "llapr.h" #include "llprocesslauncher.h" #include "llupdateinstaller.h" @@ -47,7 +48,10 @@ namespace { } -int ll_install_update(std::string const & script, std::string const & updatePath, LLInstallScriptMode mode) +int ll_install_update(std::string const & script, + std::string const & updatePath, + bool required, + LLInstallScriptMode mode) { std::string actualScriptPath; switch(mode) { @@ -73,6 +77,7 @@ int ll_install_update(std::string const & script, std::string const & updatePath launcher.setExecutable(actualScriptPath); launcher.addArgument(updatePath); launcher.addArgument(ll_install_failed_marker_path().c_str()); + launcher.addArgument(boost::lexical_cast(required)); int result = launcher.launch(); launcher.orphan(); diff --git a/indra/viewer_components/updater/llupdateinstaller.h b/indra/viewer_components/updater/llupdateinstaller.h index 6ce08ce6fa..fe5b1d19b5 100644 --- a/indra/viewer_components/updater/llupdateinstaller.h +++ b/indra/viewer_components/updater/llupdateinstaller.h @@ -42,9 +42,10 @@ enum LLInstallScriptMode { // that the current application terminate once this function is called. // int ll_install_update( - std::string const & script, // Script to execute. - std::string const & updatePath, // Path to update file. - LLInstallScriptMode mode=LL_COPY_INSTALL_SCRIPT_TO_TEMP); // Run in place or copy to temp? + std::string const & script, // Script to execute. + std::string const & updatePath, // Path to update file. + bool required, // Is the update required. + LLInstallScriptMode mode=LL_COPY_INSTALL_SCRIPT_TO_TEMP); // Run in place or copy to temp? // diff --git a/indra/viewer_components/updater/llupdaterservice.cpp b/indra/viewer_components/updater/llupdaterservice.cpp index df1a963f81..08f76c26e9 100644 --- a/indra/viewer_components/updater/llupdaterservice.cpp +++ b/indra/viewer_components/updater/llupdaterservice.cpp @@ -305,6 +305,7 @@ bool LLUpdaterServiceImpl::checkForInstall(bool launchInstaller) int result = ll_install_update(install_script_path(), update_info["path"].asString(), + update_info["required"].asBoolean(), install_script_mode()); if((result == 0) && mAppExitCallback) @@ -489,6 +490,12 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) // Check for failed install. if(LLFile::isfile(ll_install_failed_marker_path())) { + int requiredValue = 0; + { + llifstream stream(ll_install_failed_marker_path()); + stream >> requiredValue; + if(!stream) requiredValue = 0; + } // TODO: notify the user. llinfos << "found marker " << ll_install_failed_marker_path() << llendl; llinfos << "last install attempt failed" << llendl; @@ -496,6 +503,7 @@ bool LLUpdaterServiceImpl::onMainLoop(LLSD const & event) LLSD event; event["type"] = LLSD(LLUpdaterService::INSTALL_ERROR); + event["required"] = LLSD(requiredValue); LLEventPumps::instance().obtain(LLUpdaterService::pumpName()).post(event); setState(LLUpdaterService::TERMINAL); diff --git a/indra/viewer_components/updater/scripts/darwin/update_install b/indra/viewer_components/updater/scripts/darwin/update_install index 9df382f119..6a95f96d86 100644 --- a/indra/viewer_components/updater/scripts/darwin/update_install +++ b/indra/viewer_components/updater/scripts/darwin/update_install @@ -6,5 +6,5 @@ # cd "$(dirname "$0")" -../Resources/mac-updater.app/Contents/MacOS/mac-updater -dmg "$1" -name "Second Life Viewer 2" -marker "$2" & +(../Resources/mac-updater.app/Contents/MacOS/mac-updater -dmg "$1" -name "Second Life Viewer 2"; if [ $? -ne 0 ]; then echo $3 >> "$2"; fi;) & exit 0 diff --git a/indra/viewer_components/updater/scripts/linux/update_install b/indra/viewer_components/updater/scripts/linux/update_install index a271926e25..88451340ec 100644 --- a/indra/viewer_components/updater/scripts/linux/update_install +++ b/indra/viewer_components/updater/scripts/linux/update_install @@ -4,7 +4,7 @@ export LD_LIBRARY_PATH="$INSTALL_DIR/lib" bin/linux-updater.bin --file "$1" --dest "$INSTALL_DIR" --name "Second Life Viewer 2" --stringsdir "$INSTALL_DIR/skins/default/xui/en" --stringsfile "strings.xml" if [ $? -ne 0 ] - then touch "$2" + then echo $3 >> "$2" fi rm -f "$1" diff --git a/indra/viewer_components/updater/scripts/windows/update_install.bat b/indra/viewer_components/updater/scripts/windows/update_install.bat index 42e148a707..96687226a8 100644 --- a/indra/viewer_components/updater/scripts/windows/update_install.bat +++ b/indra/viewer_components/updater/scripts/windows/update_install.bat @@ -1,3 +1,3 @@ start /WAIT %1 /SKIP_DIALOGS -IF ERRORLEVEL 1 ECHO %ERRORLEVEL% > %2 +IF ERRORLEVEL 1 ECHO %3 > %2 DEL %1 diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index be5a5da50d..5f8cd28f29 100644 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -103,7 +103,7 @@ void LLUpdateDownloader::resume(void) {} void LLUpdateDownloader::cancel(void) {} void LLUpdateDownloader::setBandwidthLimit(U64 bytesPerSecond) {} -int ll_install_update(std::string const &, std::string const &, LLInstallScriptMode) +int ll_install_update(std::string const &, std::string const &, bool, LLInstallScriptMode) { return 0; } -- cgit v1.2.3 From abda07fb77de69b294eafb65cb1cfb265855365f Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Thu, 16 Dec 2010 20:22:32 +0200 Subject: STORM-796 FIXED Implemented rendering /app/region/ SLapps into human-readable strings. Example: secondlife:///app/region/Ahern/10/20/30/ is displayed as "Ahern (10,20,30)". --- indra/llui/llurlentry.cpp | 63 +++++++++++++++ indra/llui/llurlentry.h | 12 +++ indra/llui/llurlregistry.cpp | 1 + indra/llui/tests/llurlentry_test.cpp | 149 +++++++++++++++++++++++++++++++++++ 4 files changed, 225 insertions(+) (limited to 'indra') diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index e51f28e2e9..4f7b4be526 100644 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -805,6 +805,69 @@ std::string LLUrlEntryPlace::getLocation(const std::string &url) const return ::getStringAfterToken(url, "://"); } +// +// LLUrlEntryRegion Describes secondlife:///app/region/REGION_NAME/X/Y/Z URLs, e.g. +// secondlife:///app/region/Ahern/128/128/0 +// +LLUrlEntryRegion::LLUrlEntryRegion() +{ + mPattern = boost::regex("secondlife:///app/region/[^/\\s]+(/\\d+)?(/\\d+)?(/\\d+)?/?", + boost::regex::perl|boost::regex::icase); + mMenuName = "menu_url_slurl.xml"; + mTooltip = LLTrans::getString("TooltipSLURL"); +} + +std::string LLUrlEntryRegion::getLabel(const std::string &url, const LLUrlLabelCallback &cb) +{ + // + // we handle SLURLs in the following formats: + // - secondlife:///app/region/Place/X/Y/Z + // - secondlife:///app/region/Place/X/Y + // - secondlife:///app/region/Place/X + // - secondlife:///app/region/Place + // + + LLSD path_array = LLURI(url).pathArray(); + S32 path_parts = path_array.size(); + + if (path_parts < 3) // no region name + { + llwarns << "Failed to parse url [" << url << "]" << llendl; + return url; + } + + std::string label = unescapeUrl(path_array[2]); // region name + + if (path_parts > 3) // secondlife:///app/region/Place/X + { + std::string x = path_array[3]; + label += " (" + x; + + if (path_parts > 4) // secondlife:///app/region/Place/X/Y + { + std::string y = path_array[4]; + label += "," + y; + + if (path_parts > 5) // secondlife:///app/region/Place/X/Y/Z + { + std::string z = path_array[5]; + label = label + "," + z; + } + } + + label += ")"; + } + + return label; +} + +std::string LLUrlEntryRegion::getLocation(const std::string &url) const +{ + LLSD path_array = LLURI(url).pathArray(); + std::string region_name = unescapeUrl(path_array[2]); + return region_name; +} + // // LLUrlEntryTeleport Describes a Second Life teleport Url, e.g., // secondlife:///app/teleport/Ahern/50/50/50/ diff --git a/indra/llui/llurlentry.h b/indra/llui/llurlentry.h index 43a667c390..1791739061 100644 --- a/indra/llui/llurlentry.h +++ b/indra/llui/llurlentry.h @@ -301,6 +301,18 @@ public: /*virtual*/ std::string getLocation(const std::string &url) const; }; +/// +/// LLUrlEntryRegion Describes a Second Life location Url, e.g., +/// secondlife:///app/region/Ahern/128/128/0 +/// +class LLUrlEntryRegion : public LLUrlEntryBase +{ +public: + LLUrlEntryRegion(); + /*virtual*/ std::string getLabel(const std::string &url, const LLUrlLabelCallback &cb); + /*virtual*/ std::string getLocation(const std::string &url) const; +}; + /// /// LLUrlEntryTeleport Describes a Second Life teleport Url, e.g., /// secondlife:///app/teleport/Ahern/50/50/50/ diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp index 478b412d5e..523ee5d78c 100644 --- a/indra/llui/llurlregistry.cpp +++ b/indra/llui/llurlregistry.cpp @@ -54,6 +54,7 @@ LLUrlRegistry::LLUrlRegistry() registerUrl(new LLUrlEntryGroup()); registerUrl(new LLUrlEntryParcel()); registerUrl(new LLUrlEntryTeleport()); + registerUrl(new LLUrlEntryRegion()); registerUrl(new LLUrlEntryWorldMap()); registerUrl(new LLUrlEntryObjectIM()); registerUrl(new LLUrlEntryPlace()); diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index 59c0826ad7..d0b2030d12 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -103,6 +103,45 @@ namespace tut ensure_equals(testname, url, expected); } + void dummyCallback(const std::string &url, const std::string &label, const std::string& icon) + { + } + + void testLabel(const std::string &testname, LLUrlEntryBase &entry, + const char *text, const std::string &expected) + { + boost::regex regex = entry.getPattern(); + std::string label = ""; + boost::cmatch result; + bool found = boost::regex_search(text, result, regex); + if (found) + { + S32 start = static_cast(result[0].first - text); + S32 end = static_cast(result[0].second - text); + std::string url = std::string(text+start, end-start); + label = entry.getLabel(url, dummyCallback); + } + ensure_equals(testname, label, expected); + } + + void testLocation(const std::string &testname, LLUrlEntryBase &entry, + const char *text, const std::string &expected) + { + boost::regex regex = entry.getPattern(); + std::string location = ""; + boost::cmatch result; + bool found = boost::regex_search(text, result, regex); + if (found) + { + S32 start = static_cast(result[0].first - text); + S32 end = static_cast(result[0].second - text); + std::string url = std::string(text+start, end-start); + location = entry.getLocation(url); + } + ensure_equals(testname, location, expected); + } + + template<> template<> void object::test<1>() { @@ -697,4 +736,114 @@ namespace tut "My Object", "My Object"); } + + template<> template<> + void object::test<13>() + { + // + // test LLUrlEntryRegion - secondlife:///app/region/ URLs + // + LLUrlEntryRegion url; + + // Regex tests. + testRegex("no valid region", url, + "secondlife:///app/region/", + ""); + + testRegex("invalid coords", url, + "secondlife:///app/region/Korea2/a/b/c", + "secondlife:///app/region/Korea2/"); // don't count invalid coords + + testRegex("Ahern (50,50,50) [1]", url, + "secondlife:///app/region/Ahern/50/50/50/", + "secondlife:///app/region/Ahern/50/50/50/"); + + testRegex("Ahern (50,50,50) [2]", url, + "XXX secondlife:///app/region/Ahern/50/50/50/ XXX", + "secondlife:///app/region/Ahern/50/50/50/"); + + testRegex("Ahern (50,50,50) [3]", url, + "XXX secondlife:///app/region/Ahern/50/50/50 XXX", + "secondlife:///app/region/Ahern/50/50/50"); + + testRegex("Ahern (50,50,50) multicase", url, + "XXX secondlife:///app/region/Ahern/50/50/50/ XXX", + "secondlife:///app/region/Ahern/50/50/50/"); + + testRegex("Ahern (50,50) [1]", url, + "XXX secondlife:///app/region/Ahern/50/50/ XXX", + "secondlife:///app/region/Ahern/50/50/"); + + testRegex("Ahern (50,50) [2]", url, + "XXX secondlife:///app/region/Ahern/50/50 XXX", + "secondlife:///app/region/Ahern/50/50"); + + // DEV-21577: In-world SLURLs containing "(" or ")" are not treated as a hyperlink in chat + testRegex("Region with brackets", url, + "XXX secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30 XXX", + "secondlife:///app/region/Burning%20Life%20(Hyper)/27/210/30"); + + // DEV-35459: SLURLs and teleport Links not parsed properly + testRegex("Region with quote", url, + "XXX secondlife:///app/region/A'ksha%20Oasis/41/166/701 XXX", + "secondlife:///app/region/A%27ksha%20Oasis/41/166/701"); + + // Rendering tests. + testLabel("Render /app/region/Ahern/50/50/50/", url, + "secondlife:///app/region/Ahern/50/50/50/", + "Ahern (50,50,50)"); + + testLabel("Render /app/region/Ahern/50/50/50", url, + "secondlife:///app/region/Ahern/50/50/50", + "Ahern (50,50,50)"); + + testLabel("Render /app/region/Ahern/50/50/", url, + "secondlife:///app/region/Ahern/50/50/", + "Ahern (50,50)"); + + testLabel("Render /app/region/Ahern/50/50", url, + "secondlife:///app/region/Ahern/50/50", + "Ahern (50,50)"); + + testLabel("Render /app/region/Ahern/50/", url, + "secondlife:///app/region/Ahern/50/", + "Ahern (50)"); + + testLabel("Render /app/region/Ahern/50", url, + "secondlife:///app/region/Ahern/50", + "Ahern (50)"); + + testLabel("Render /app/region/Ahern/", url, + "secondlife:///app/region/Ahern/", + "Ahern"); + + testLabel("Render /app/region/Ahern/ within context", url, + "XXX secondlife:///app/region/Ahern/ XXX", + "Ahern"); + + testLabel("Render /app/region/Ahern", url, + "secondlife:///app/region/Ahern", + "Ahern"); + + testLabel("Render /app/region/Ahern within context", url, + "XXX secondlife:///app/region/Ahern XXX", + "Ahern"); + + testLabel("Render /app/region/Product%20Engine/", url, + "secondlife:///app/region/Product%20Engine/", + "Product Engine"); + + testLabel("Render /app/region/Product%20Engine", url, + "secondlife:///app/region/Product%20Engine", + "Product Engine"); + + // Location parsing texts. + testLocation("Location /app/region/Ahern/50/50/50/", url, + "secondlife:///app/region/Ahern/50/50/50/", + "Ahern"); + + testLocation("Location /app/region/Product%20Engine", url, + "secondlife:///app/region/Product%20Engine", + "Product Engine"); + } } -- cgit v1.2.3 From 9148e168575e25922f466055f9a49202f4a33af3 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Thu, 16 Dec 2010 11:09:06 -0800 Subject: clearer message. --- indra/newview/skins/default/xui/en/notifications.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index fc5479a6f7..723c210c5c 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -2894,6 +2894,7 @@ http://secondlife.com/download. type="alertmodal"> We were unable to install a required update. You will be unable to log in until [APP_NAME] has been updated. + Please download and install the latest viewer from http://secondlife.com/download. Date: Thu, 16 Dec 2010 15:34:46 -0800 Subject: SOCIAL-392 FIX Web Content Panel does not save location history between sessions --- indra/newview/llfloaterwebcontent.cpp | 53 +++++++++++++++++++++++++++-------- indra/newview/llfloaterwebcontent.h | 2 ++ 2 files changed, 44 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index ca8533abc5..9eb5d1e883 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -33,6 +33,7 @@ #include "llpluginclassmedia.h" #include "llprogressbar.h" #include "lltextbox.h" +#include "llurlhistory.h" #include "llviewercontrol.h" #include "llweb.h" #include "llwindow.h" @@ -68,9 +69,35 @@ BOOL LLFloaterWebContent::postBuild() // cache image for secure browsing mSecureLockIcon = getChild< LLIconCtrl >("media_secure_lock_flag"); + // initialize the URL history using the system URL History manager + initializeURLHistory(); + return TRUE; } +void LLFloaterWebContent::initializeURLHistory() +{ + // start with an empty list + LLCtrlListInterface* url_list = childGetListInterface("address"); + if (url_list) + { + url_list->operateOnAll(LLCtrlListInterface::OP_DELETE); + } + + // Get all of the entries in the "browser" collection + LLSD browser_history = LLURLHistory::getURLHistory("browser"); + LLSD::array_iterator iter_history = + browser_history.beginArray(); + LLSD::array_iterator end_history = + browser_history.endArray(); + for(; iter_history != end_history; ++iter_history) + { + std::string url = (*iter_history).asString(); + if(! url.empty()) + url_list->addSimpleElement(url); + } +} + //static void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid ) { @@ -255,17 +282,17 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent mStatusBarText->setText( end_str ); // decide if secure browsing icon should be displayed - std::string prefix = std::string("https://"); - std::string test_prefix = mCurrentURL.substr(0, prefix.length()); - LLStringUtil::toLower(test_prefix); - if(test_prefix == prefix) - { - mSecureLockIcon->setVisible(true); - } - else - { - mSecureLockIcon->setVisible(false); - } + std::string prefix = std::string("https://"); + std::string test_prefix = mCurrentURL.substr(0, prefix.length()); + LLStringUtil::toLower(test_prefix); + if(test_prefix == prefix) + { + mSecureLockIcon->setVisible(true); + } + else + { + mSecureLockIcon->setVisible(false); + } } else if(event == MEDIA_EVENT_CLOSE_REQUEST) { @@ -307,6 +334,10 @@ void LLFloaterWebContent::set_current_url(const std::string& url) { mCurrentURL = url; + // serialize url history into the system URL History manager + LLURLHistory::removeURL("browser", mCurrentURL); + LLURLHistory::addURL("browser", mCurrentURL); + mAddressCombo->remove( mCurrentURL ); mAddressCombo->add( mCurrentURL ); mAddressCombo->selectByValue( mCurrentURL ); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 4bd10342fa..001d822ada 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -44,6 +44,8 @@ public: LOG_CLASS(LLFloaterWebContent); LLFloaterWebContent(const LLSD& key); + void initializeURLHistory(); + static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null); static void closeRequest(const std::string &uuid); -- cgit v1.2.3 From 51e53849f0dd7f8ce8439e833d6d99a59c0f2ee0 Mon Sep 17 00:00:00 2001 From: callum Date: Thu, 16 Dec 2010 15:39:19 -0800 Subject: SOCIAL-393 FIX Need a keyboard shortcut to open the Web Content floater --- indra/newview/skins/default/xui/en/menu_viewer.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 20f40d8316..680a9d174f 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2630,11 +2630,12 @@ parameter="http://secondlife.com/app/search/slurls.html"/> + label="Web Content Browser" + name="Web Content Browser" + shortcut="control|alt|W"> + parameter="http://google.com"/> Date: Thu, 16 Dec 2010 15:40:02 -0800 Subject: SOCIAL-370 FIX (2) Links to External Web Pages not working in Floaters such as Search in Webkit 4.7 branch --- indra/newview/llmediactrl.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 5834d0503b..92fb578e81 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1109,14 +1109,15 @@ void LLMediaCtrl::onPopup(const LLSD& notification, const LLSD& response) lldebugs << "No gFloaterView for onPopuup()" << llendl; }; - // open the same kind of floater as parent if possible - if ( floater_name == "media_browser" ) + // (for now) open web content floater if that's our parent, otherwise, open the current media floater + // (this will change soon) + if ( floater_name == "web_content" ) { - LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); + LLWeb::loadWebURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); } else { - LLWeb::loadWebURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); + LLWeb::loadURL(notification["payload"]["url"], notification["payload"]["target"], notification["payload"]["uuid"]); } } else -- cgit v1.2.3 From 3c05ebd28635e867f9726062b08cdbf4a7b53b22 Mon Sep 17 00:00:00 2001 From: Monty Brandenberg Date: Thu, 16 Dec 2010 16:42:26 -0800 Subject: ESC-237 No static init of LLAtomics and move TFRequest out of unnamed namespace. Linux startup crash appears to be due to static/global C++ init of LLAtomic types. The initializer with explicit value makes some runtime calls and it looks like these assume, at least on Linux, that apr_initialize() has been called. So move the static POST count to a member and provide accessors and increment/decrement. Command queue was built on a pointer to a class in anonymous namespace and that's not quite valid. Made it a nested class (really a nested forward declaration) while keeping the derived classes in anonymous. --- indra/newview/lltexturefetch.cpp | 42 ++++++++++++++++++---------------------- indra/newview/lltexturefetch.h | 16 +++++++++++++-- 2 files changed, 33 insertions(+), 25 deletions(-) (limited to 'indra') diff --git a/indra/newview/lltexturefetch.cpp b/indra/newview/lltexturefetch.cpp index 25ad2fe717..4f63abb152 100644 --- a/indra/newview/lltexturefetch.cpp +++ b/indra/newview/lltexturefetch.cpp @@ -388,9 +388,6 @@ private: // Cross-thread messaging for asset metrics. -namespace -{ - /** * @brief Base class for cross-thread requests made of the fetcher * @@ -490,7 +487,7 @@ namespace * (i.e. deep copy) when necessary. * */ -class TFRequest // : public LLQueuedThread::QueuedRequest +class LLTextureFetch::TFRequest // : public LLQueuedThread::QueuedRequest { public: // Default ctors and assignment operator are correct. @@ -505,6 +502,8 @@ public: virtual bool doWork(LLTextureFetch * fetcher) = 0; }; +namespace +{ /** * @brief Implements a 'Set Region' cross-thread command. @@ -517,11 +516,11 @@ public: * * Corresponds to LLTextureFetch::commandSetRegion() */ -class TFReqSetRegion : public TFRequest +class TFReqSetRegion : public LLTextureFetch::TFRequest { public: TFReqSetRegion(U64 region_handle) - : TFRequest(), + : LLTextureFetch::TFRequest(), mRegionHandle(region_handle) {} TFReqSetRegion & operator=(const TFReqSetRegion &); // Not defined @@ -550,7 +549,7 @@ public: * * Corresponds to LLTextureFetch::commandSendMetrics() */ -class TFReqSendMetrics : public TFRequest +class TFReqSendMetrics : public LLTextureFetch::TFRequest { public: /** @@ -574,7 +573,7 @@ public: const LLUUID & session_id, const LLUUID & agent_id, LLViewerAssetStats * main_stats) - : TFRequest(), + : LLTextureFetch::TFRequest(), mCapsURL(caps_url), mSessionID(session_id), mAgentID(agent_id), @@ -593,14 +592,6 @@ public: LLViewerAssetStats * mMainStats; }; -/* - * Count of POST requests outstanding. We maintain the count - * indirectly in the CURL request responder's ctor and dtor and - * use it when determining whether or not to sleep the thread. Can't - * use the LLCurl module's request counter as it isn't thread compatible. - */ -LLAtomic32 curl_post_request_count = 0; - /* * Examines the merged viewer metrics report and if found to be too long, * will attempt to truncate it in some reasonable fashion. @@ -1834,6 +1825,7 @@ LLTextureFetch::LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* image mCurlGetRequest(NULL), mQAMode(qa_mode) { + mCurlPOSTRequestCount = 0; mMaxBandwidth = gSavedSettings.getF32("ThrottleBandwidthKBPS"); mTextureInfo.setUpLogging(gSavedSettings.getBOOL("LogTextureDownloadsToViewerLog"), gSavedSettings.getBOOL("LogTextureDownloadsToSimulator"), gSavedSettings.getU32("TextureLoggingThreshold")); } @@ -2149,7 +2141,7 @@ S32 LLTextureFetch::getPending() LLMutexLock lock(&mQueueMutex); res = mRequestQueue.size(); - res += curl_post_request_count; + res += mCurlPOSTRequestCount; res += mCommands.size(); } unlockData(); @@ -2175,7 +2167,7 @@ bool LLTextureFetch::runCondition() have_no_commands = mCommands.empty(); } - bool have_no_curl_requests(0 == curl_post_request_count); + bool have_no_curl_requests(0 == mCurlPOSTRequestCount); return ! (have_no_commands && have_no_curl_requests @@ -2769,7 +2761,7 @@ void LLTextureFetch::cmdEnqueue(TFRequest * req) unpause(); } -TFRequest * LLTextureFetch::cmdDequeue() +LLTextureFetch::TFRequest * LLTextureFetch::cmdDequeue() { TFRequest * ret = 0; @@ -2856,22 +2848,24 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) class lcl_responder : public LLCurl::Responder { public: - lcl_responder(S32 expected_sequence, + lcl_responder(LLTextureFetch * fetcher, + S32 expected_sequence, volatile const S32 & live_sequence, volatile bool & reporting_break, volatile bool & reporting_started) : LLCurl::Responder(), + mFetcher(fetcher), mExpectedSequence(expected_sequence), mLiveSequence(live_sequence), mReportingBreak(reporting_break), mReportingStarted(reporting_started) { - curl_post_request_count++; + mFetcher->incrCurlPOSTCount(); } ~lcl_responder() { - curl_post_request_count--; + mFetcher->decrCurlPOSTCount(); } // virtual @@ -2896,6 +2890,7 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) } private: + LLTextureFetch * mFetcher; S32 mExpectedSequence; volatile const S32 & mLiveSequence; volatile bool & mReportingBreak; @@ -2939,7 +2934,8 @@ TFReqSendMetrics::doWork(LLTextureFetch * fetcher) fetcher->getCurlRequest().post(mCapsURL, headers, merged_llsd, - new lcl_responder(report_sequence, + new lcl_responder(fetcher, + report_sequence, report_sequence, LLTextureFetch::svMetricsDataBreak, reporting_started)); diff --git a/indra/newview/lltexturefetch.h b/indra/newview/lltexturefetch.h index a8fd3ce244..ad00a7ea36 100644 --- a/indra/newview/lltexturefetch.h +++ b/indra/newview/lltexturefetch.h @@ -33,6 +33,7 @@ #include "llworkerthread.h" #include "llcurl.h" #include "lltextureinfo.h" +#include "llapr.h" class LLViewerTexture; class LLTextureFetchWorker; @@ -42,8 +43,6 @@ class LLImageDecodeThread; class LLHost; class LLViewerAssetStats; -namespace { class TFRequest; } - // Interface class class LLTextureFetch : public LLWorkerThread { @@ -54,6 +53,8 @@ public: LLTextureFetch(LLTextureCache* cache, LLImageDecodeThread* imagedecodethread, bool threaded, bool qa_mode); ~LLTextureFetch(); + class TFRequest; + /*virtual*/ S32 update(U32 max_time_ms); void shutDownTextureCacheThread() ; //called in the main thread after the TextureCacheThread shuts down. void shutDownImageDecodeThread() ; //called in the main thread after the ImageDecodeThread shuts down. @@ -100,6 +101,10 @@ public: bool isQAMode() const { return mQAMode; } + // Curl POST counter maintenance + inline void incrCurlPOSTCount() { mCurlPOSTRequestCount++; } + inline void decrCurlPOSTCount() { mCurlPOSTRequestCount--; } + protected: void addToNetworkQueue(LLTextureFetchWorker* worker); void removeFromNetworkQueue(LLTextureFetchWorker* worker, bool cancel); @@ -187,6 +192,13 @@ private: // If true, modifies some behaviors that help with QA tasks. const bool mQAMode; + + // Count of POST requests outstanding. We maintain the count + // indirectly in the CURL request responder's ctor and dtor and + // use it when determining whether or not to sleep the thread. Can't + // use the LLCurl module's request counter as it isn't thread compatible. + // *NOTE: Don't mix Atomic and static, apr_initialize must be called first. + LLAtomic32 mCurlPOSTRequestCount; public: // A probabilistically-correct indicator that the current -- cgit v1.2.3 From 551bfb88fce8a9cd6faac440e3d89d79213550ed Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Fri, 17 Dec 2010 07:29:27 -0500 Subject: Adjust parameter in call to setFocusOnAvatar to be more efficient (don't animate) --- indra/newview/llagentcamera.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index 15f8e7bf4d..f01d5ff1f5 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -2695,6 +2695,9 @@ void LLAgentCamera::lookAtLastChat() new_camera_pos -= delta_pos * 0.4f; new_camera_pos += left * 0.3f; new_camera_pos += up * 0.2f; + + setFocusOnAvatar(FALSE, FALSE); + if (chatter_av->mHeadp) { setFocusGlobal(gAgent.getPosGlobalFromAgent(chatter_av->mHeadp->getWorldPosition()), gAgent.getLastChatter()); @@ -2705,7 +2708,6 @@ void LLAgentCamera::lookAtLastChat() setFocusGlobal(chatter->getPositionGlobal(), gAgent.getLastChatter()); mCameraFocusOffsetTarget = gAgent.getPosGlobalFromAgent(new_camera_pos) - chatter->getPositionGlobal(); } - setFocusOnAvatar(FALSE, TRUE); } else { @@ -2725,9 +2727,10 @@ void LLAgentCamera::lookAtLastChat() new_camera_pos += left * 0.3f; new_camera_pos += up * 0.2f; + setFocusOnAvatar(FALSE, FALSE); + setFocusGlobal(chatter->getPositionGlobal(), gAgent.getLastChatter()); mCameraFocusOffsetTarget = gAgent.getPosGlobalFromAgent(new_camera_pos) - chatter->getPositionGlobal(); - setFocusOnAvatar(FALSE, TRUE); } } -- cgit v1.2.3 From 1a9b0523de81c9844aeaa13a3191d9881918bfa8 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Fri, 17 Dec 2010 20:11:06 +0200 Subject: STORM-669 FIXED 'Security browsing' icon is overlapped by 'More' button in object info mini-inspector - Moved 'Security browsing' icon before URL. Now icon is in one line with URL. --- .../skins/default/xui/en/inspect_object.xml | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/inspect_object.xml b/indra/newview/skins/default/xui/en/inspect_object.xml index eb2e7ea788..8d14c974b4 100644 --- a/indra/newview/skins/default/xui/en/inspect_object.xml +++ b/indra/newview/skins/default/xui/en/inspect_object.xml @@ -76,13 +76,24 @@ L$30,000 + http://www.superdupertest.com @@ -135,16 +146,6 @@ L$30,000 name="open_btn" top_delta="0" width="80" /> - -- cgit v1.2.3 From b59dad36ba7b6d45c25f596e690df3150d94f1b4 Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Sat, 18 Dec 2010 14:00:47 +0200 Subject: STORM-412 FIXED Resident profile controls aren't reshaped on changing panel width - Added parameters for text boxes to follow right side of panel --- .../newview/skins/default/xui/en/panel_my_profile.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_my_profile.xml b/indra/newview/skins/default/xui/en/panel_my_profile.xml index 1b41f602cd..5b8abaca6f 100644 --- a/indra/newview/skins/default/xui/en/panel_my_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_my_profile.xml @@ -185,7 +185,7 @@ Date: Sat, 18 Dec 2010 18:35:32 +0200 Subject: STORM-796 ADDITIONAL_FIX Fixed Mac build. --- indra/llui/tests/llurlentry_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp index d0b2030d12..8f0a48018f 100644 --- a/indra/llui/tests/llurlentry_test.cpp +++ b/indra/llui/tests/llurlentry_test.cpp @@ -119,7 +119,7 @@ namespace tut S32 start = static_cast(result[0].first - text); S32 end = static_cast(result[0].second - text); std::string url = std::string(text+start, end-start); - label = entry.getLabel(url, dummyCallback); + label = entry.getLabel(url, boost::bind(dummyCallback, _1, _2, _3)); } ensure_equals(testname, label, expected); } -- cgit v1.2.3 From 1718ca48c22999986cd52acec71971bab486b490 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Sat, 18 Dec 2010 20:17:36 +0200 Subject: STORM-511 FIXED Display tooltip for sender name on group notices. Changes: * Set tooltip for sender name. * Overridden handleTooltip() for the tooltip to be of normal (yellow) color. --- indra/newview/llinspecttoast.cpp | 11 +++++++++++ indra/newview/lltoastgroupnotifypanel.cpp | 1 + 2 files changed, 12 insertions(+) (limited to 'indra') diff --git a/indra/newview/llinspecttoast.cpp b/indra/newview/llinspecttoast.cpp index 58b3f0309f..d7b82667d1 100644 --- a/indra/newview/llinspecttoast.cpp +++ b/indra/newview/llinspecttoast.cpp @@ -46,6 +46,7 @@ public: virtual ~LLInspectToast(); /*virtual*/ void onOpen(const LLSD& notification_id); + /*virtual*/ BOOL handleToolTip(S32 x, S32 y, MASK mask); private: void onToastDestroy(LLToast * toast); @@ -73,6 +74,7 @@ LLInspectToast::~LLInspectToast() LLTransientFloaterMgr::getInstance()->removeControlView(this); } +// virtual void LLInspectToast::onOpen(const LLSD& notification_id) { LLInspect::onOpen(notification_id); @@ -103,6 +105,15 @@ void LLInspectToast::onOpen(const LLSD& notification_id) LLUI::positionViewNearMouse(this); } +// virtual +BOOL LLInspectToast::handleToolTip(S32 x, S32 y, MASK mask) +{ + // We don't like the way LLInspect handles tooltips + // (black tooltips look weird), + // so force using the default implementation (STORM-511). + return LLFloater::handleToolTip(x, y, mask); +} + void LLInspectToast::onToastDestroy(LLToast * toast) { closeFloater(false); diff --git a/indra/newview/lltoastgroupnotifypanel.cpp b/indra/newview/lltoastgroupnotifypanel.cpp index 563c27c4d7..75178a6ef8 100644 --- a/indra/newview/lltoastgroupnotifypanel.cpp +++ b/indra/newview/lltoastgroupnotifypanel.cpp @@ -77,6 +77,7 @@ LLToastGroupNotifyPanel::LLToastGroupNotifyPanel(LLNotificationPtr& notification from << from_name << "/" << groupData.mName; LLTextBox* pTitleText = getChild("title"); pTitleText->setValue(from.str()); + pTitleText->setToolTip(from.str()); //message subject const std::string& subject = payload["subject"].asString(); -- cgit v1.2.3 From 09c7d38166e3f5d04ed6321b2ac06c4112bb858b Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Sat, 18 Dec 2010 16:44:51 -0500 Subject: STORM-467 Fix for minimap zoom does not persist to the next session --- indra/newview/llfloatermap.cpp | 2 -- indra/newview/llnetmap.cpp | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 351b9ac5da..da32467423 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -83,7 +83,6 @@ LLFloaterMap::~LLFloaterMap() BOOL LLFloaterMap::postBuild() { mMap = getChild("Net Map"); - mMap->setScale(gSavedSettings.getF32("MiniMapScale")); mMap->setToolTipMsg(getString("ToolTipMsg")); sendChildToBack(mMap); @@ -296,7 +295,6 @@ void LLFloaterMap::handleZoom(const LLSD& userdata) scale = LLNetMap::MAP_SCALE_MIN; if (scale != 0.0f) { - gSavedSettings.setF32("MiniMapScale", scale ); mMap->setScale(scale); } } diff --git a/indra/newview/llnetmap.cpp b/indra/newview/llnetmap.cpp index f084002385..1a8ec4991d 100644 --- a/indra/newview/llnetmap.cpp +++ b/indra/newview/llnetmap.cpp @@ -94,10 +94,12 @@ LLNetMap::LLNetMap (const Params & p) mToolTipMsg() { mDotRadius = llmax(DOT_SCALE * mPixelsPerMeter, MIN_DOT_RADIUS); + setScale(gSavedSettings.getF32("MiniMapScale")); } LLNetMap::~LLNetMap() { + gSavedSettings.setF32("MiniMapScale", mScale); } void LLNetMap::setScale( F32 scale ) -- cgit v1.2.3 From bdd07a7a648dc7e2c290d5aa837c22c20c4af31c Mon Sep 17 00:00:00 2001 From: Paul Guslisty Date: Mon, 20 Dec 2010 18:04:59 +0200 Subject: STORM-411 FIXED The most of additional options in the Teleport History profile are always disabled - Deleted unimplemented menu items from XML - Hide "Make a Landmark" menu item in case "Teleport History Place Profile" panel is opened --- indra/newview/llpanelplaces.cpp | 5 +++++ indra/newview/skins/default/xui/en/menu_place.xml | 22 ---------------------- 2 files changed, 5 insertions(+), 22 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 1869e92c8c..00ac34efa5 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -753,6 +753,11 @@ void LLPanelPlaces::onOverflowButtonClicked() // there is no landmark already pointing to that parcel in agent's inventory. menu->getChild("landmark")->setEnabled(is_agent_place_info_visible && !LLLandmarkActions::landmarkAlreadyExists()); + // STORM-411 + // Creating landmarks for remote locations is impossible. + // So hide menu item "Make a Landmark" in "Teleport History Profile" panel. + menu->setItemVisible("landmark", mPlaceInfoType != TELEPORT_HISTORY_INFO_TYPE); + menu->arrangeAndClear(); } else if (mPlaceInfoType == LANDMARK_INFO_TYPE && mLandmarkMenu != NULL) { diff --git a/indra/newview/skins/default/xui/en/menu_place.xml b/indra/newview/skins/default/xui/en/menu_place.xml index 1b96eb51f0..288811d2f6 100644 --- a/indra/newview/skins/default/xui/en/menu_place.xml +++ b/indra/newview/skins/default/xui/en/menu_place.xml @@ -24,26 +24,4 @@ function="Places.OverflowMenu.Enable" parameter="can_create_pick" /> - - - - - - - - -- cgit v1.2.3 From 2c68cb2c69348522ebb648aa4abd2ca7e4038b80 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 20 Dec 2010 10:38:36 -0800 Subject: fix windows build? --- indra/viewer_components/updater/llupdateinstaller.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/viewer_components/updater/llupdateinstaller.cpp b/indra/viewer_components/updater/llupdateinstaller.cpp index d3347d330a..d450c068ad 100644 --- a/indra/viewer_components/updater/llupdateinstaller.cpp +++ b/indra/viewer_components/updater/llupdateinstaller.cpp @@ -25,7 +25,6 @@ #include "linden_common.h" #include -#include #include "llapr.h" #include "llprocesslauncher.h" #include "llupdateinstaller.h" @@ -35,6 +34,7 @@ #if defined(LL_WINDOWS) #pragma warning(disable: 4702) // disable 'unreachable code' so we can use lexical_cast (really!). #endif +#include namespace { -- cgit v1.2.3 From fdd5348f81d51363a1639de8b3cc4414fc0f4982 Mon Sep 17 00:00:00 2001 From: "Andrew A. de Laix" Date: Mon, 20 Dec 2010 11:34:06 -0800 Subject: Remove unimplemented software updater option. Fix potential double start of updater service. --- indra/newview/llviewercontrol.cpp | 3 ++- indra/newview/skins/default/xui/en/panel_preferences_setup.xml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 2c75551285..8c5a52c187 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -506,7 +506,8 @@ void toggle_updater_service_active(LLControlVariable* control, const LLSD& new_v { if(new_value.asInteger()) { - LLUpdaterService().startChecking(); + LLUpdaterService update_service; + if(!update_service.isChecking()) update_service.startChecking(); } else { diff --git a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml index 542b6bcf6b..901a1257e0 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_setup.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_setup.xml @@ -367,10 +367,12 @@ label="Install automatically" name="Install_automatically" value="3" /> + Date: Mon, 20 Dec 2010 12:02:56 -0800 Subject: Fix for a couple of minor merge issues. --- indra/newview/llfloaterwebcontent.cpp | 2 +- indra/newview/llmediactrl.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 14bd5baba1..51726112a0 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -312,7 +312,7 @@ void LLFloaterWebContent::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent else if(event == MEDIA_EVENT_PROGRESS_UPDATED ) { int percent = (int)self->getProgressPercent(); - mStatusBarProgress->setPercent( percent ); + mStatusBarProgress->setValue( percent ); } else if(event == MEDIA_EVENT_NAME_CHANGED ) { diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index f95592551c..38a74f90d3 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -62,6 +62,7 @@ public: Optional caret_color; Optional initial_mime_type; + Optional media_id; Params(); }; -- cgit v1.2.3 From 36207fcf1a16c66a5b831af31e524fc44060c2c8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 20 Dec 2010 12:59:17 -0800 Subject: STORM-805 : Fix the map URL --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llstartup.cpp | 9 ++++++++- indra/newview/llworldmipmap.cpp | 3 +-- 3 files changed, 20 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 06992d2b52..2bb192474b 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -4747,6 +4747,17 @@ Value http://map.secondlife.com.s3.amazonaws.com/ + CurrentMapServerURL + + Comment + Current Session World map URL + Persist + 0 + Type + String + Value + + MapShowEvents Comment diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index d945af0776..cc2cf0d66f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -3095,7 +3095,14 @@ bool process_login_success_response() std::string map_server_url = response["map-server-url"]; if(!map_server_url.empty()) { - gSavedSettings.setString("MapServerURL", map_server_url); + // We got an answer from the grid -> use that for map for the current session + gSavedSettings.setString("CurrentMapServerURL", map_server_url); + } + else + { + // No answer from the grid -> use the default setting for current session + map_server_url = gSavedSettings.getString("MapServerURL"); + gSavedSettings.setString("CurrentMapServerURL", map_server_url); } // Default male and female avatars allowing the user to choose their avatar on first login. diff --git a/indra/newview/llworldmipmap.cpp b/indra/newview/llworldmipmap.cpp index be8298daab..74ed844376 100644 --- a/indra/newview/llworldmipmap.cpp +++ b/indra/newview/llworldmipmap.cpp @@ -181,8 +181,7 @@ LLPointer LLWorldMipmap::getObjectsTile(U32 grid_x, U32 LLPointer LLWorldMipmap::loadObjectsTile(U32 grid_x, U32 grid_y, S32 level) { // Get the grid coordinates - std::string imageurl = gSavedSettings.getString("MapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); - + std::string imageurl = gSavedSettings.getString("CurrentMapServerURL") + llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y); // DO NOT COMMIT!! DEBUG ONLY!!! // Use a local jpeg for every tile to test map speed without S3 access -- cgit v1.2.3 From d275251138932e8c6c10e4c5a0d05a003ffced90 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Mon, 20 Dec 2010 16:33:25 -0800 Subject: SOCIAL-399 FIX Viewer crash when canceling http auth on a media prim Reviewed by Callum at http://codereview.lindenlab.com/5636001 --- indra/llplugin/llpluginclassmedia.cpp | 4 ++-- indra/newview/llmediactrl.cpp | 2 +- indra/newview/llviewermedia.cpp | 24 ++++++++++++++++-------- indra/newview/llviewermedia.h | 2 +- 4 files changed, 20 insertions(+), 12 deletions(-) (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index e6c901dd5c..217b6e074d 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -682,7 +682,7 @@ void LLPluginClassMedia::sendPickFileResponse(const std::string &file) { LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA, "pick_file_response"); message.setValue("file", file); - if(mPlugin->isBlocked()) + if(mPlugin && mPlugin->isBlocked()) { // If the plugin sent a blocking pick-file request, the response should unblock it. message.setValueBoolean("blocking_response", true); @@ -696,7 +696,7 @@ void LLPluginClassMedia::sendAuthResponse(bool ok, const std::string &username, message.setValueBoolean("ok", ok); message.setValue("username", username); message.setValue("password", password); - if(mPlugin->isBlocked()) + if(mPlugin && mPlugin->isBlocked()) { // If the plugin sent a blocking pick-file request, the response should unblock it. message.setValueBoolean("blocking_response", true); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 8d8f9dbebb..9493fddf50 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1055,7 +1055,7 @@ void LLMediaCtrl::handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event) auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mMediaTextureID); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2, mMediaSource->getMediaPlugin()); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index dacd663f83..60608a2c28 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1046,15 +1046,23 @@ bool LLViewerMedia::isParcelAudioPlaying() return (LLViewerMedia::hasParcelAudio() && gAudiop && LLAudioEngine::AUDIO_PLAYING == gAudiop->isInternetStreamPlaying()); } -void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response, LLPluginClassMedia* media) +void LLViewerMedia::onAuthSubmit(const LLSD& notification, const LLSD& response) { - if (response["ok"]) + LLViewerMediaImpl *impl = LLViewerMedia::getMediaImplFromTextureID(notification["payload"]["media_id"]); + if(impl) { - media->sendAuthResponse(true, response["username"], response["password"]); - } - else - { - media->sendAuthResponse(false, "", ""); + LLPluginClassMedia* media = impl->getMediaPlugin(); + if(media) + { + if (response["ok"]) + { + media->sendAuthResponse(true, response["username"], response["password"]); + } + else + { + media->sendAuthResponse(false, "", ""); + } + } } } @@ -3108,7 +3116,7 @@ void LLViewerMediaImpl::handleMediaEvent(LLPluginClassMedia* plugin, LLPluginCla auth_request_params.substitutions = args; auth_request_params.payload = LLSD().with("media_id", mTextureId); - auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2, plugin); + auth_request_params.functor.function = boost::bind(&LLViewerMedia::onAuthSubmit, _1, _2); LLNotifications::instance().add(auth_request_params); }; break; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 83fe790839..e2e342cc45 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -131,7 +131,7 @@ public: static bool isParcelMediaPlaying(); static bool isParcelAudioPlaying(); - static void onAuthSubmit(const LLSD& notification, const LLSD& response, LLPluginClassMedia* media); + static void onAuthSubmit(const LLSD& notification, const LLSD& response); // Clear all cookies for all plugins static void clearAllCookies(); -- cgit v1.2.3 From a8edb1af21a8c145e68935c30c1707ec8feb34b8 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Mon, 20 Dec 2010 23:09:16 -0800 Subject: STORM-151 : Fix llui_libtest integration test --- indra/integration_tests/llui_libtest/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra') diff --git a/indra/integration_tests/llui_libtest/CMakeLists.txt b/indra/integration_tests/llui_libtest/CMakeLists.txt index 2a00dbee6f..e0772e55ca 100644 --- a/indra/integration_tests/llui_libtest/CMakeLists.txt +++ b/indra/integration_tests/llui_libtest/CMakeLists.txt @@ -10,6 +10,7 @@ include(00-Common) include(LLCommon) include(LLImage) include(LLImageJ2COJ) # ugh, needed for images +include(LLKDU) include(LLMath) include(LLMessage) include(LLRender) @@ -71,7 +72,10 @@ endif (DARWIN) target_link_libraries(llui_libtest llui llmessage + ${LLRENDER_LIBRARIES} ${LLIMAGE_LIBRARIES} + ${LLKDU_LIBRARIES} + ${KDU_LIBRARY} ${LLIMAGEJ2COJ_LIBRARIES} ${OS_LIBRARIES} ${GOOGLE_PERFTOOLS_LIBRARIES} -- cgit v1.2.3 From 5d6ccc5cdeb6e5314aa20f4f52359de57f6e8267 Mon Sep 17 00:00:00 2001 From: Monroe Linden Date: Tue, 21 Dec 2010 16:38:06 -0800 Subject: SOCIAL-374 FIX Avatar images not loading on join.secondlife.com in Webkit 4.7 Reviewed by Callum --- indra/llplugin/llpluginclassmedia.cpp | 4 ++-- indra/llplugin/llpluginclassmedia.h | 2 +- indra/media_plugins/webkit/media_plugin_webkit.cpp | 8 +++---- indra/newview/app_settings/lindenlab.pem | 27 ++++++++++++++++++++++ indra/newview/llviewermedia.cpp | 4 ++-- 5 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 indra/newview/app_settings/lindenlab.pem (limited to 'indra') diff --git a/indra/llplugin/llpluginclassmedia.cpp b/indra/llplugin/llpluginclassmedia.cpp index 217b6e074d..595c470a19 100644 --- a/indra/llplugin/llpluginclassmedia.cpp +++ b/indra/llplugin/llpluginclassmedia.cpp @@ -1236,9 +1236,9 @@ void LLPluginClassMedia::ignore_ssl_cert_errors(bool ignore) sendMessage(message); } -void LLPluginClassMedia::setCertificateFilePath(const std::string& path) +void LLPluginClassMedia::addCertificateFilePath(const std::string& path) { - LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "set_certificate_file_path"); + LLPluginMessage message(LLPLUGIN_MESSAGE_CLASS_MEDIA_BROWSER, "add_certificate_file_path"); message.setValue("path", path); sendMessage(message); } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index abc472f501..c826e13c40 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -203,7 +203,7 @@ public: void proxyWindowOpened(const std::string &target, const std::string &uuid); void proxyWindowClosed(const std::string &uuid); void ignore_ssl_cert_errors(bool ignore); - void setCertificateFilePath(const std::string& path); + void addCertificateFilePath(const std::string& path); // This is valid after MEDIA_EVENT_NAVIGATE_BEGIN or MEDIA_EVENT_NAVIGATE_COMPLETE std::string getNavigateURI() const { return mNavigateURI; }; diff --git a/indra/media_plugins/webkit/media_plugin_webkit.cpp b/indra/media_plugins/webkit/media_plugin_webkit.cpp index 19244d2d1f..d6f8ae3e16 100644 --- a/indra/media_plugins/webkit/media_plugin_webkit.cpp +++ b/indra/media_plugins/webkit/media_plugin_webkit.cpp @@ -1247,12 +1247,12 @@ void MediaPluginWebKit::receiveMessage(const char *message_string) llwarns << "Ignoring ignore_ssl_cert_errors message (llqtwebkit version is too old)." << llendl; #endif } - else if(message_name == "set_certificate_file_path") + else if(message_name == "add_certificate_file_path") { -#if LLQTWEBKIT_API_VERSION >= 3 - LLQtWebKit::getInstance()->setCAFile( message_in.getValue("path") ); +#if LLQTWEBKIT_API_VERSION >= 6 + LLQtWebKit::getInstance()->addCAFile( message_in.getValue("path") ); #else - llwarns << "Ignoring set_certificate_file_path message (llqtwebkit version is too old)." << llendl; + llwarns << "Ignoring add_certificate_file_path message (llqtwebkit version is too old)." << llendl; #endif } else if(message_name == "init_history") diff --git a/indra/newview/app_settings/lindenlab.pem b/indra/newview/app_settings/lindenlab.pem new file mode 100644 index 0000000000..cf88d0e047 --- /dev/null +++ b/indra/newview/app_settings/lindenlab.pem @@ -0,0 +1,27 @@ +-----BEGIN CERTIFICATE----- +MIIEUDCCA7mgAwIBAgIJAN4ppNGwj6yIMA0GCSqGSIb3DQEBBAUAMIHMMQswCQYD +VQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEWMBQGA1UEBxMNU2FuIEZyYW5j +aXNjbzEZMBcGA1UEChMQTGluZGVuIExhYiwgSW5jLjEpMCcGA1UECxMgTGluZGVu +IExhYiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKTAnBgNVBAMTIExpbmRlbiBMYWIg +Q2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZIhvcNAQkBFhBjYUBsaW5kZW5s +YWIuY29tMB4XDTA1MDQyMTAyNDAzMVoXDTI1MDQxNjAyNDAzMVowgcwxCzAJBgNV +BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1TYW4gRnJhbmNp +c2NvMRkwFwYDVQQKExBMaW5kZW4gTGFiLCBJbmMuMSkwJwYDVQQLEyBMaW5kZW4g +TGFiIENlcnRpZmljYXRlIEF1dGhvcml0eTEpMCcGA1UEAxMgTGluZGVuIExhYiBD +ZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgkqhkiG9w0BCQEWEGNhQGxpbmRlbmxh +Yi5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAKXh1MThucdTbMg9bYBO +rAm8yWns32YojB0PRfbq8rUjepEhTm3/13s0u399Uc202v4ejcGhkIDWJZd2NZMF +oKrhmRfxGHSKPCuFaXC3jh0lRECj7k8FoPkcmaPjSyodrDFDUUuv+C06oYJoI+rk +8REyal9NwgHvqCzOrZtiTXAdAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUO1zK2e1f +1wO1fHAjq6DTJobKDrcwggEBBgNVHSMEgfkwgfaAFDtcytntX9cDtXxwI6ug0yaG +yg63oYHSpIHPMIHMMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTEW +MBQGA1UEBxMNU2FuIEZyYW5jaXNjbzEZMBcGA1UEChMQTGluZGVuIExhYiwgSW5j +LjEpMCcGA1UECxMgTGluZGVuIExhYiBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxKTAn +BgNVBAMTIExpbmRlbiBMYWIgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYJKoZI +hvcNAQkBFhBjYUBsaW5kZW5sYWIuY29tggkA3imk0bCPrIgwDAYDVR0TBAUwAwEB +/zANBgkqhkiG9w0BAQQFAAOBgQA/ZkgfvwHYqk1UIAKZS3kMCxz0HvYuEQtviwnu +xA39CIJ65Zozs28Eg1aV9/Y+Of7TnWhW+U3J3/wD/GghaAGiKK6vMn9gJBIdBX/9 +e6ef37VGyiOEFFjnUIbuk0RWty0orN76q/lI/xjCi15XSA/VSq2j4vmnwfZcPTDu +glmQ1A== +-----END CERTIFICATE----- + diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 60608a2c28..d3b6dcd86f 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -1829,7 +1829,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) } // start by assuming the default CA file will be used - std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "CA.pem" ); + std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "lindenlab.pem" ); // default turned off so pick up the user specified path if( ! gSavedSettings.getBOOL("BrowserUseDefaultCAFile")) @@ -1837,7 +1837,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) ca_path = gSavedSettings.getString("BrowserCAFilePath"); } // set the path to the CA.pem file - media_source->setCertificateFilePath( ca_path ); + media_source->addCertificateFilePath( ca_path ); media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort")); -- cgit v1.2.3 From ef5f9ee893bd9840bf3b043ece654a6e786d5170 Mon Sep 17 00:00:00 2001 From: Jonathan Yap Date: Wed, 22 Dec 2010 08:47:43 -0500 Subject: STORM-466 Fix for: minimap cannot be reset to default zoom --- indra/newview/llfloatermap.cpp | 11 ++++++++++- indra/newview/skins/default/xui/en/menu_mini_map.xml | 11 +++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/llfloatermap.cpp b/indra/newview/llfloatermap.cpp index 351b9ac5da..0b629bf0ae 100644 --- a/indra/newview/llfloatermap.cpp +++ b/indra/newview/llfloatermap.cpp @@ -288,7 +288,16 @@ void LLFloaterMap::handleZoom(const LLSD& userdata) std::string level = userdata.asString(); F32 scale = 0.0f; - if (level == std::string("close")) + if (level == std::string("default")) + { + LLControlVariable *pvar = gSavedSettings.getControl("MiniMapScale"); + if(pvar) + { + pvar->resetToDefault(); + scale = gSavedSettings.getF32("MiniMapScale"); + } + } + else if (level == std::string("close")) scale = LLNetMap::MAP_SCALE_MAX; else if (level == std::string("medium")) scale = LLNetMap::MAP_SCALE_MID; diff --git a/indra/newview/skins/default/xui/en/menu_mini_map.xml b/indra/newview/skins/default/xui/en/menu_mini_map.xml index 8fe89d3934..ea263d05ce 100644 --- a/indra/newview/skins/default/xui/en/menu_mini_map.xml +++ b/indra/newview/skins/default/xui/en/menu_mini_map.xml @@ -8,7 +8,7 @@ top="724" visible="false" width="128"> - - + + + + -- cgit v1.2.3 From 0eb491417e8479516b07cc9237242b60d36d10f5 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 22 Dec 2010 21:48:42 +0200 Subject: STORM-806 FIXED Enabled external editor for inventory scripts. Changes: * Moved external editor handling to LLScriptEdCore which is shared between LLLiveLSLEditor (object script editor) and LLPreviewLSL (inventory script editor). * The Edit button is now only enabled when appropriate. --- indra/newview/llpreviewscript.cpp | 349 ++++++++++----------- indra/newview/llpreviewscript.h | 49 ++- .../skins/default/xui/en/panel_script_ed.xml | 1 + 3 files changed, 203 insertions(+), 196 deletions(-) (limited to 'indra') diff --git a/indra/newview/llpreviewscript.cpp b/indra/newview/llpreviewscript.cpp index d0ebf047e8..22ff362b5a 100644 --- a/indra/newview/llpreviewscript.cpp +++ b/indra/newview/llpreviewscript.cpp @@ -123,7 +123,9 @@ static bool have_script_upload_cap(LLUUID& object_id) class LLLiveLSLFile : public LLLiveFile { public: - LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent); + typedef boost::function change_callback_t; + + LLLiveLSLFile(std::string file_path, change_callback_t change_cb); ~LLLiveLSLFile(); void ignoreNextUpdate() { mIgnoreNextUpdate = true; } @@ -131,15 +133,16 @@ public: protected: /*virtual*/ bool loadFile(); - LLLiveLSLEditor* mParent; + change_callback_t mOnChangeCallback; bool mIgnoreNextUpdate; }; -LLLiveLSLFile::LLLiveLSLFile(std::string file_path, LLLiveLSLEditor* parent) -: mParent(parent) +LLLiveLSLFile::LLLiveLSLFile(std::string file_path, change_callback_t change_cb) +: mOnChangeCallback(change_cb) , mIgnoreNextUpdate(false) , LLLiveFile(file_path, 1.0) { + llassert(mOnChangeCallback); } LLLiveLSLFile::~LLLiveLSLFile() @@ -155,14 +158,7 @@ bool LLLiveLSLFile::loadFile() return true; } - if (!mParent->loadScriptText(filename())) - { - return false; - } - - // Disable sync to avoid recursive load->save->load calls. - mParent->saveIfNeeded(false); - return true; + return mOnChangeCallback(filename()); } /// --------------------------------------------------------------------------- @@ -327,11 +323,11 @@ struct LLSECKeywordCompare }; LLScriptEdCore::LLScriptEdCore( + LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, void (*load_callback)(void*), void (*save_callback)(void*, BOOL), - void (*edit_callback)(void*), void (*search_replace_callback) (void* userdata), void* userdata, S32 bottom_pad) @@ -341,19 +337,21 @@ LLScriptEdCore::LLScriptEdCore( mEditor( NULL ), mLoadCallback( load_callback ), mSaveCallback( save_callback ), - mEditCallback( edit_callback ), mSearchReplaceCallback( search_replace_callback ), mUserdata( userdata ), mForceClose( FALSE ), mLastHelpToken(NULL), mLiveHelpHistorySize(0), mEnableSave(FALSE), + mLiveFile(NULL), + mContainer(container), mHasScriptData(FALSE) { setFollowsAll(); setBorderVisible(FALSE); setXMLFilename("panel_script_ed.xml"); + llassert_always(mContainer != NULL); } LLScriptEdCore::~LLScriptEdCore() @@ -367,6 +365,8 @@ LLScriptEdCore::~LLScriptEdCore() script_search->closeFloater(); delete script_search; } + + delete mLiveFile; } BOOL LLScriptEdCore::postBuild() @@ -381,7 +381,7 @@ BOOL LLScriptEdCore::postBuild() childSetCommitCallback("lsl errors", &LLScriptEdCore::onErrorList, this); childSetAction("Save_btn", boost::bind(&LLScriptEdCore::doSave,this,FALSE)); - childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::onEditButtonClick, this)); + childSetAction("Edit_btn", boost::bind(&LLScriptEdCore::openInExternalEditor, this)); initMenu(); @@ -514,6 +514,79 @@ void LLScriptEdCore::setScriptText(const std::string& text, BOOL is_valid) } } +bool LLScriptEdCore::loadScriptText(const std::string& filename) +{ + if (filename.empty()) + { + llwarns << "Empty file name" << llendl; + return false; + } + + LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ + if (!file) + { + llwarns << "Error opening " << filename << llendl; + return false; + } + + // read in the whole file + fseek(file, 0L, SEEK_END); + size_t file_length = (size_t) ftell(file); + fseek(file, 0L, SEEK_SET); + char* buffer = new char[file_length+1]; + size_t nread = fread(buffer, 1, file_length, file); + if (nread < file_length) + { + llwarns << "Short read" << llendl; + } + buffer[nread] = '\0'; + fclose(file); + + mEditor->setText(LLStringExplicit(buffer)); + delete[] buffer; + + return true; +} + +bool LLScriptEdCore::writeToFile(const std::string& filename) +{ + LLFILE* fp = LLFile::fopen(filename, "wb"); + if (!fp) + { + llwarns << "Unable to write to " << filename << llendl; + + LLSD row; + row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; + row["columns"][0]["font"] = "SANSSERIF_SMALL"; + mErrorList->addElement(row); + return false; + } + + std::string utf8text = mEditor->getText(); + + // Special case for a completely empty script - stuff in one space so it can store properly. See SL-46889 + if (utf8text.size() == 0) + { + utf8text = " "; + } + + fputs(utf8text.c_str(), fp); + fclose(fp); + return true; +} + +void LLScriptEdCore::sync() +{ + // Sync with external editor. + std::string tmp_file = mContainer->getTmpFileName(); + llstat s; + if (LLFile::stat(tmp_file, &s) == 0) // file exists + { + if (mLiveFile) mLiveFile->ignoreNextUpdate(); + writeToFile(tmp_file); + } +} + bool LLScriptEdCore::hasChanged() { if (!mEditor) return false; @@ -690,6 +763,12 @@ BOOL LLScriptEdCore::canClose() } } +void LLScriptEdCore::setEnableEditing(bool enable) +{ + mEditor->setEnabled(enable); + getChildView("Edit_btn")->setEnabled(enable); +} + bool LLScriptEdCore::handleSaveChangesDialog(const LLSD& notification, const LLSD& response ) { S32 option = LLNotificationsUtil::getSelectedOption(notification, response); @@ -862,11 +941,31 @@ void LLScriptEdCore::doSave( BOOL close_after_save ) } } -void LLScriptEdCore::onEditButtonClick() +void LLScriptEdCore::openInExternalEditor() { - if (mEditCallback) + delete mLiveFile; // deletes file + + // Save the script to a temporary file. + std::string filename = mContainer->getTmpFileName(); + writeToFile(filename); + + // Start watching file changes. + mLiveFile = new LLLiveLSLFile(filename, boost::bind(&LLScriptEdContainer::onExternalChange, mContainer, _1)); + mLiveFile->addToEventTimer(); + + // Open it in external editor. { - mEditCallback(mUserdata); + LLExternalEditor ed; + + if (!ed.setCommand("LL_SCRIPT_EDITOR")) + { + std::string msg = "Select an editor by setting the environment variable LL_SCRIPT_EDITOR " + "or the ExternalEditor setting"; // *TODO: localize + LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); + return; + } + + ed.run(filename); } } @@ -982,6 +1081,43 @@ BOOL LLScriptEdCore::handleKeyHere(KEY key, MASK mask) return FALSE; } +/// --------------------------------------------------------------------------- +/// LLScriptEdContainer +/// --------------------------------------------------------------------------- + +LLScriptEdContainer::LLScriptEdContainer(const LLSD& key) +: LLPreview(key) +, mScriptEd(NULL) +{ +} + +std::string LLScriptEdContainer::getTmpFileName() +{ + // Take script inventory item id (within the object inventory) + // to consideration so that it's possible to edit multiple scripts + // in the same object inventory simultaneously (STORM-781). + std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); + + // Use MD5 sum to make the file name shorter and not exceed maximum path length. + char script_id_hash_str[33]; /* Flawfinder: ignore */ + LLMD5 script_id_hash((const U8 *)script_id.c_str()); + script_id_hash.hex_digest(script_id_hash_str); + + return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; +} + +bool LLScriptEdContainer::onExternalChange(const std::string& filename) +{ + if (!mScriptEd->loadScriptText(filename)) + { + return false; + } + + // Disable sync to avoid recursive load->save->load calls. + saveIfNeeded(false); + return true; +} + /// --------------------------------------------------------------------------- /// LLPreviewLSL /// --------------------------------------------------------------------------- @@ -1005,11 +1141,11 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) LLPreviewLSL *self = (LLPreviewLSL*)userdata; self->mScriptEd = new LLScriptEdCore( + self, HELLO_LSL, self->getHandle(), LLPreviewLSL::onLoad, LLPreviewLSL::onSave, - NULL, // no edit callback LLPreviewLSL::onSearchReplace, self, 0); @@ -1019,7 +1155,7 @@ void* LLPreviewLSL::createScriptEdPanel(void* userdata) LLPreviewLSL::LLPreviewLSL(const LLSD& key ) - : LLPreview( key ), +: LLScriptEdContainer(key), mPendingUploads(0) { mFactoryMap["script panel"] = LLCallbackMap(LLPreviewLSL::createScriptEdPanel, this); @@ -1110,7 +1246,6 @@ void LLPreviewLSL::loadAsset() { mScriptEd->setScriptText(mScriptEd->getString("can_not_view"), FALSE); mScriptEd->mEditor->makePristine(); - mScriptEd->mEditor->setEnabled(FALSE); mScriptEd->mFunctions->setEnabled(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -1120,6 +1255,7 @@ void LLPreviewLSL::loadAsset() else { mScriptEd->setScriptText(std::string(HELLO_LSL), TRUE); + mScriptEd->setEnableEditing(TRUE); mAssetStatus = PREVIEW_ASSET_LOADED; } } @@ -1166,7 +1302,7 @@ void LLPreviewLSL::onSave(void* userdata, BOOL close_after_save) // Save needs to compile the text in the buffer. If the compile // succeeds, then save both assets out to the database. If the compile // fails, go ahead and save the text anyway. -void LLPreviewLSL::saveIfNeeded() +void LLPreviewLSL::saveIfNeeded(bool sync /*= true*/) { // llinfos << "LLPreviewLSL::saveIfNeeded()" << llendl; if(!mScriptEd->hasChanged()) @@ -1185,23 +1321,13 @@ void LLPreviewLSL::saveIfNeeded() std::string filepath = gDirUtilp->getExpandedFilename(LL_PATH_CACHE,asset_id.asString()); std::string filename = filepath + ".lsl"; - LLFILE* fp = LLFile::fopen(filename, "wb"); - if(!fp) - { - llwarns << "Unable to write to " << filename << llendl; + mScriptEd->writeToFile(filename); - LLSD row; - row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; - row["columns"][0]["font"] = "SANSSERIF_SMALL"; - mScriptEd->mErrorList->addElement(row); - return; + if (sync) + { + mScriptEd->sync(); } - std::string utf8text = mScriptEd->mEditor->getText(); - fputs(utf8text.c_str(), fp); - fclose(fp); - fp = NULL; - const LLInventoryItem *inv_item = getItem(); // save it out to asset server std::string url = gAgent.getRegion()->getCapability("UpdateScriptAgent"); @@ -1433,7 +1559,7 @@ void LLPreviewLSL::onLoadComplete( LLVFS *vfs, const LLUUID& asset_uuid, LLAsset { is_modifiable = TRUE; } - preview->mScriptEd->mEditor->setEnabled(is_modifiable); + preview->mScriptEd->setEnableEditing(is_modifiable); preview->mAssetStatus = PREVIEW_ASSET_LOADED; } else @@ -1474,11 +1600,11 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) LLLiveLSLEditor *self = (LLLiveLSLEditor*)userdata; self->mScriptEd = new LLScriptEdCore( + self, HELLO_LSL, self->getHandle(), &LLLiveLSLEditor::onLoad, &LLLiveLSLEditor::onSave, - &LLLiveLSLEditor::onEdit, &LLLiveLSLEditor::onSearchReplace, self, 0); @@ -1488,14 +1614,12 @@ void* LLLiveLSLEditor::createScriptEdPanel(void* userdata) LLLiveLSLEditor::LLLiveLSLEditor(const LLSD& key) : - LLPreview(key), - mScriptEd(NULL), + LLScriptEdContainer(key), mAskedForRunningInfo(FALSE), mHaveRunningInfo(FALSE), mCloseAfterSave(FALSE), mPendingUploads(0), mIsModifiable(FALSE), - mLiveFile(NULL), mIsNew(false) { mFactoryMap["script ed panel"] = LLCallbackMap(LLLiveLSLEditor::createScriptEdPanel, this); @@ -1519,11 +1643,6 @@ BOOL LLLiveLSLEditor::postBuild() return LLPreview::postBuild(); } -LLLiveLSLEditor::~LLLiveLSLEditor() -{ - delete mLiveFile; -} - // virtual void LLLiveLSLEditor::callbackLSLCompileSucceeded(const LLUUID& task_id, const LLUUID& item_id, @@ -1580,7 +1699,6 @@ void LLLiveLSLEditor::loadAsset() mItem = new LLViewerInventoryItem(item); mScriptEd->setScriptText(getString("not_allowed"), FALSE); mScriptEd->mEditor->makePristine(); - mScriptEd->mEditor->setEnabled(FALSE); mScriptEd->enableSave(FALSE); mAssetStatus = PREVIEW_ASSET_LOADED; } @@ -1618,10 +1736,6 @@ void LLLiveLSLEditor::loadAsset() mIsModifiable = item && gAgent.allowOperation(PERM_MODIFY, item->getPermissions(), GP_OBJECT_MANIPULATE); - if(!mIsModifiable) - { - mScriptEd->mEditor->setEnabled(FALSE); - } // This is commented out, because we don't completely // handle script exports yet. @@ -1677,6 +1791,7 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, if( LL_ERR_NOERR == status ) { instance->loadScriptText(vfs, asset_id, type); + instance->mScriptEd->setEnableEditing(TRUE); instance->mAssetStatus = PREVIEW_ASSET_LOADED; } else @@ -1703,40 +1818,6 @@ void LLLiveLSLEditor::onLoadComplete(LLVFS *vfs, const LLUUID& asset_id, delete xored_id; } - bool LLLiveLSLEditor::loadScriptText(const std::string& filename) - { - if (filename.empty()) - { - llwarns << "Empty file name" << llendl; - return false; - } - - LLFILE* file = LLFile::fopen(filename, "rb"); /*Flawfinder: ignore*/ - if (!file) - { - llwarns << "Error opening " << filename << llendl; - return false; - } - - // read in the whole file - fseek(file, 0L, SEEK_END); - size_t file_length = (size_t) ftell(file); - fseek(file, 0L, SEEK_SET); - char* buffer = new char[file_length+1]; - size_t nread = fread(buffer, 1, file_length, file); - if (nread < file_length) - { - llwarns << "Short read" << llendl; - } - buffer[nread] = '\0'; - fclose(file); - mScriptEd->mEditor->setText(LLStringExplicit(buffer)); - //mScriptEd->mEditor->makePristine(); - delete[] buffer; - - return true; - } - void LLLiveLSLEditor::loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type) { LLVFile file(vfs, uuid, type); @@ -1890,7 +1971,8 @@ LLLiveLSLSaveData::LLLiveLSLSaveData(const LLUUID& id, mItem = new LLViewerInventoryItem(item); } -void LLLiveLSLEditor::saveIfNeeded(bool sync) +// virtual +void LLLiveLSLEditor::saveIfNeeded(bool sync /*= true*/) { LLViewerObject* object = gObjectList.findObject(mObjectUUID); if(!object) @@ -1941,18 +2023,11 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync) mItem->setAssetUUID(asset_id); mItem->setTransactionID(tid); - writeToFile(filename); + mScriptEd->writeToFile(filename); if (sync) { - // Sync with external ed2itor. - std::string tmp_file = getTmpFileName(); - llstat s; - if (LLFile::stat(tmp_file, &s) == 0) // file exists - { - if (mLiveFile) mLiveFile->ignoreNextUpdate(); - writeToFile(tmp_file); - } + mScriptEd->sync(); } // save it out to asset server @@ -1970,83 +2045,6 @@ void LLLiveLSLEditor::saveIfNeeded(bool sync) } } -void LLLiveLSLEditor::openExternalEditor() -{ - LLViewerObject* object = gObjectList.findObject(mObjectUUID); - if(!object) - { - LLNotificationsUtil::add("SaveScriptFailObjectNotFound"); - return; - } - - delete mLiveFile; // deletes file - - // Save the script to a temporary file. - std::string filename = getTmpFileName(); - writeToFile(filename); - - // Start watching file changes. - mLiveFile = new LLLiveLSLFile(filename, this); - mLiveFile->addToEventTimer(); - - // Open it in external editor. - { - LLExternalEditor ed; - - if (!ed.setCommand("LL_SCRIPT_EDITOR")) - { - std::string msg = "Select an editor by setting the environment variable LL_SCRIPT_EDITOR " - "or the ExternalEditor setting"; // *TODO: localize - LLNotificationsUtil::add("GenericAlert", LLSD().with("MESSAGE", msg)); - return; - } - - ed.run(filename); - } -} - -bool LLLiveLSLEditor::writeToFile(const std::string& filename) -{ - LLFILE* fp = LLFile::fopen(filename, "wb"); - if (!fp) - { - llwarns << "Unable to write to " << filename << llendl; - - LLSD row; - row["columns"][0]["value"] = "Error writing to local file. Is your hard drive full?"; - row["columns"][0]["font"] = "SANSSERIF_SMALL"; - mScriptEd->mErrorList->addElement(row); - return false; - } - - std::string utf8text = mScriptEd->mEditor->getText(); - - // Special case for a completely empty script - stuff in one space so it can store properly. See SL-46889 - if (utf8text.size() == 0) - { - utf8text = " "; - } - - fputs(utf8text.c_str(), fp); - fclose(fp); - return true; -} - -std::string LLLiveLSLEditor::getTmpFileName() -{ - // Take script inventory item id (within the object inventory) - // to consideration so that it's possible to edit multiple scripts - // in the same object inventory simultaneously (STORM-781). - std::string script_id = mObjectUUID.asString() + "_" + mItemUUID.asString(); - - // Use MD5 sum to make the file name shorter and not exceed maximum path length. - char script_id_hash_str[33]; /* Flawfinder: ignore */ - LLMD5 script_id_hash((const U8 *)script_id.c_str()); - script_id_hash.hex_digest(script_id_hash_str); - - return std::string(LLFile::tmpdir()) + "sl_script_" + script_id_hash_str + ".lsl"; -} - void LLLiveLSLEditor::uploadAssetViaCaps(const std::string& url, const std::string& filename, const LLUUID& task_id, @@ -2270,13 +2268,6 @@ void LLLiveLSLEditor::onSave(void* userdata, BOOL close_after_save) } -// static -void LLLiveLSLEditor::onEdit(void* userdata) -{ - LLLiveLSLEditor* self = (LLLiveLSLEditor*)userdata; - self->openExternalEditor(); -} - // static void LLLiveLSLEditor::processScriptRunningReply(LLMessageSystem* msg, void**) { diff --git a/indra/newview/llpreviewscript.h b/indra/newview/llpreviewscript.h index d35c6b8528..f86be615c4 100644 --- a/indra/newview/llpreviewscript.h +++ b/indra/newview/llpreviewscript.h @@ -48,6 +48,7 @@ class LLFloaterScriptSearch; class LLKeywordToken; class LLVFS; class LLViewerInventoryItem; +class LLScriptEdContainer; // Inner, implementation class. LLPreviewScript and LLLiveLSLEditor each own one of these. class LLScriptEdCore : public LLPanel @@ -56,17 +57,20 @@ class LLScriptEdCore : public LLPanel friend class LLPreviewLSL; friend class LLLiveLSLEditor; friend class LLFloaterScriptSearch; + friend class LLScriptEdContainer; -public: +protected: + // Supposed to be invoked only by the container. LLScriptEdCore( + LLScriptEdContainer* container, const std::string& sample, const LLHandle& floater_handle, void (*load_callback)(void* userdata), void (*save_callback)(void* userdata, BOOL close_after_save), - void (*edit_callback)(void*), void (*search_replace_callback)(void* userdata), void* userdata, S32 bottom_pad = 0); // pad below bottom row of buttons +public: ~LLScriptEdCore(); void initMenu(); @@ -74,15 +78,19 @@ public: virtual void draw(); /*virtual*/ BOOL postBuild(); BOOL canClose(); + void setEnableEditing(bool enable); void setScriptText(const std::string& text, BOOL is_valid); + bool loadScriptText(const std::string& filename); + bool writeToFile(const std::string& filename); + void sync(); void doSave( BOOL close_after_save ); bool handleSaveChangesDialog(const LLSD& notification, const LLSD& response); bool handleReloadFromServerDialog(const LLSD& notification, const LLSD& response); - void onEditButtonClick(); + void openInExternalEditor(); static void onCheckLock(LLUICtrl*, void*); static void onHelpComboCommit(LLUICtrl* ctrl, void* userdata); @@ -118,7 +126,6 @@ private: LLTextEditor* mEditor; void (*mLoadCallback)(void* userdata); void (*mSaveCallback)(void* userdata, BOOL close_after_save); - void (*mEditCallback)(void* userdata); void (*mSearchReplaceCallback) (void* userdata); void* mUserdata; LLComboBox *mFunctions; @@ -132,11 +139,28 @@ private: S32 mLiveHelpHistorySize; BOOL mEnableSave; BOOL mHasScriptData; + LLLiveLSLFile* mLiveFile; + + LLScriptEdContainer* mContainer; // parent view }; +class LLScriptEdContainer : public LLPreview +{ + friend class LLScriptEdCore; + +public: + LLScriptEdContainer(const LLSD& key); + +protected: + std::string getTmpFileName(); + bool onExternalChange(const std::string& filename); + virtual void saveIfNeeded(bool sync = true) = 0; + + LLScriptEdCore* mScriptEd; +}; // Used to view and edit a LSL from your inventory. -class LLPreviewLSL : public LLPreview +class LLPreviewLSL : public LLScriptEdContainer { public: LLPreviewLSL(const LLSD& key ); @@ -150,7 +174,7 @@ protected: void closeIfNeeded(); virtual void loadAsset(); - void saveIfNeeded(); + /*virtual*/ void saveIfNeeded(bool sync = true); void uploadAssetViaCaps(const std::string& url, const std::string& filename, const LLUUID& item_id); @@ -174,7 +198,6 @@ protected: protected: - LLScriptEdCore* mScriptEd; // Can safely close only after both text and bytecode are uploaded S32 mPendingUploads; @@ -182,12 +205,11 @@ protected: // Used to view and edit an LSL that is attached to an object. -class LLLiveLSLEditor : public LLPreview +class LLLiveLSLEditor : public LLScriptEdContainer { friend class LLLiveLSLFile; public: LLLiveLSLEditor(const LLSD& key); - ~LLLiveLSLEditor(); static void processScriptRunningReply(LLMessageSystem* msg, void**); @@ -208,10 +230,7 @@ private: virtual void loadAsset(); void loadAsset(BOOL is_new); - void saveIfNeeded(bool sync = true); - void openExternalEditor(); - std::string getTmpFileName(); - bool writeToFile(const std::string& filename); + /*virtual*/ void saveIfNeeded(bool sync = true); void uploadAssetViaCaps(const std::string& url, const std::string& filename, const LLUUID& task_id, @@ -227,7 +246,6 @@ private: static void onSearchReplace(void* userdata); static void onLoad(void* userdata); static void onSave(void* userdata, BOOL close_after_save); - static void onEdit(void* userdata); static void onLoadComplete(LLVFS *vfs, const LLUUID& asset_uuid, LLAssetType::EType type, @@ -237,7 +255,6 @@ private: static void onRunningCheckboxClicked(LLUICtrl*, void* userdata); static void onReset(void* userdata); - bool loadScriptText(const std::string& filename); void loadScriptText(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type); static void onErrorList(LLUICtrl*, void* user_data); @@ -248,7 +265,6 @@ private: private: bool mIsNew; - LLScriptEdCore* mScriptEd; //LLUUID mTransmitID; LLCheckBoxCtrl* mRunningCheckbox; BOOL mAskedForRunningInfo; @@ -263,7 +279,6 @@ private: LLCheckBoxCtrl* mMonoCheckbox; BOOL mIsModifiable; - LLLiveLSLFile* mLiveFile; }; #endif // LL_LLPREVIEWSCRIPT_H diff --git a/indra/newview/skins/default/xui/en/panel_script_ed.xml b/indra/newview/skins/default/xui/en/panel_script_ed.xml index a041c9b229..627b12cfe1 100644 --- a/indra/newview/skins/default/xui/en/panel_script_ed.xml +++ b/indra/newview/skins/default/xui/en/panel_script_ed.xml @@ -180,6 +180,7 @@ name="Save_btn" width="81" />