From 4f6badf216144a37dc86c578d832c3a8f84df73e Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 12 Jul 2010 16:34:38 +0300 Subject: EXT-8124 FIXED Avoided saving processed notifications that spawns script floater. Details: 1 Avoided memory leak in LLScriptFloaterManager caused not destroying processed notifications. 2 Provided destroying notification if user initiate closing script floater and not destroying if viewer exit. reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/721/ --HG-- branch : product-engine --- indra/newview/llchiclet.cpp | 4 ++-- indra/newview/llscriptfloater.cpp | 27 +++++++++++++++++++++++---- indra/newview/llscriptfloater.h | 5 +++++ indra/newview/llsyswellwindow.cpp | 4 ++-- 4 files changed, 32 insertions(+), 8 deletions(-) (limited to 'indra') diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index 6897f4ee8e..2826899cb0 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -1886,7 +1886,7 @@ void LLScriptChiclet::onMenuItemClicked(const LLSD& user_data) if("end" == action) { - LLScriptFloaterManager::instance().onRemoveNotification(getSessionId()); + LLScriptFloaterManager::instance().removeNotification(getSessionId()); } } @@ -1969,7 +1969,7 @@ void LLInvOfferChiclet::onMenuItemClicked(const LLSD& user_data) if("end" == action) { - LLScriptFloaterManager::instance().onRemoveNotification(getSessionId()); + LLScriptFloaterManager::instance().removeNotification(getSessionId()); } } diff --git a/indra/newview/llscriptfloater.cpp b/indra/newview/llscriptfloater.cpp index b68fc3b002..75797dae81 100644 --- a/indra/newview/llscriptfloater.cpp +++ b/indra/newview/llscriptfloater.cpp @@ -176,7 +176,15 @@ void LLScriptFloater::onClose(bool app_quitting) if(getNotificationId().notNull()) { - LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); + // we shouldn't kill notification on exit since it may be used as persistent. + if (app_quitting) + { + LLScriptFloaterManager::getInstance()->onRemoveNotification(getNotificationId()); + } + else + { + LLScriptFloaterManager::getInstance()->removeNotification(getNotificationId()); + } } } @@ -352,7 +360,7 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) set_new_message |= !floater->hasFocus(); } - onRemoveNotification(it->first); + removeNotification(it->first); } } @@ -379,6 +387,17 @@ void LLScriptFloaterManager::onAddNotification(const LLUUID& notification_id) toggleScriptFloater(notification_id, set_new_message); } +void LLScriptFloaterManager::removeNotification(const LLUUID& notification_id) +{ + LLNotificationPtr notification = LLNotifications::instance().find(notification_id); + if (notification != NULL && !notification->isCancelled()) + { + LLNotificationsUtil::cancel(notification); + } + + onRemoveNotification(notification_id); +} + void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) { if(notification_id.isNull()) @@ -392,6 +411,8 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) LLIMWellWindow::getInstance()->removeObjectRow(notification_id); + mNotifications.erase(notification_id); + // close floater LLScriptFloater* floater = LLFloaterReg::findTypedInstance("script_floater", notification_id); if(floater) @@ -400,8 +421,6 @@ void LLScriptFloaterManager::onRemoveNotification(const LLUUID& notification_id) floater->setNotificationId(LLUUID::null); floater->closeFloater(); } - - mNotifications.erase(notification_id); } void LLScriptFloaterManager::toggleScriptFloater(const LLUUID& notification_id, bool set_new_message) diff --git a/indra/newview/llscriptfloater.h b/indra/newview/llscriptfloater.h index dc0cfc2400..6990234fd7 100644 --- a/indra/newview/llscriptfloater.h +++ b/indra/newview/llscriptfloater.h @@ -64,6 +64,11 @@ public: */ void onAddNotification(const LLUUID& notification_id); + /** + * Removes notification. + */ + void removeNotification(const LLUUID& notification_id); + /** * Handles notification removal. * Removes script notification toast, removes script chiclet, closes script floater diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp index e6b4aeb6c2..1a8c2b8fc0 100644 --- a/indra/newview/llsyswellwindow.cpp +++ b/indra/newview/llsyswellwindow.cpp @@ -371,7 +371,7 @@ LLIMWellWindow::ObjectRowPanel::~ObjectRowPanel() //--------------------------------------------------------------------------------- void LLIMWellWindow::ObjectRowPanel::onClosePanel() { - LLScriptFloaterManager::getInstance()->onRemoveNotification(mChiclet->getSessionId()); + LLScriptFloaterManager::getInstance()->removeNotification(mChiclet->getSessionId()); } void LLIMWellWindow::ObjectRowPanel::initChiclet(const LLUUID& notification_id, bool new_message/* = false*/) @@ -832,7 +832,7 @@ void LLIMWellWindow::closeAllImpl() ObjectRowPanel* obj_panel = dynamic_cast (panel); if (obj_panel) { - LLScriptFloaterManager::instance().onRemoveNotification(*iter); + LLScriptFloaterManager::instance().removeNotification(*iter); } } } -- cgit v1.2.3 From 15c944cd47359931d897f4734991d8849ee77ffe Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 12 Jul 2010 17:22:29 +0300 Subject: EXT-8209 FIXED Avoid escaping human-readable location when copying text from the location input. Reason: LLSLURL constructor failed to determine invalid SLURLs (see EXT-8335). It's late to try fixing it, so I introduced a workaround. By the way, fixed a regression with SLURLs not being shown unescaped in the location input. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/726/ --HG-- branch : product-engine --- indra/newview/lllocationinputctrl.cpp | 2 +- indra/newview/llurllineeditorctrl.cpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'indra') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index b8590d838e..46ebb54786 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -1052,7 +1052,7 @@ void LLLocationInputCtrl::changeLocationPresentation() //needs unescaped one LLSLURL slurl; LLAgentUI::buildSLURL(slurl, false); - mTextEntry->setText(slurl.getSLURLString()); + mTextEntry->setText(LLURI::unescape(slurl.getSLURLString())); mTextEntry->selectAll(); mMaturityButton->setVisible(FALSE); diff --git a/indra/newview/llurllineeditorctrl.cpp b/indra/newview/llurllineeditorctrl.cpp index 8488527185..333f682e8f 100644 --- a/indra/newview/llurllineeditorctrl.cpp +++ b/indra/newview/llurllineeditorctrl.cpp @@ -89,9 +89,10 @@ void LLURLLineEditor::copyEscapedURLToClipboard() const std::string unescaped_text = wstring_to_utf8str(mText.getWString().substr(left_pos, length)); LLWString text_to_copy; - if (LLSLURL(unescaped_text).isValid()) + // *HACK: Because LLSLURL is currently broken we cannot use it to check if unescaped_text is a valid SLURL (see EXT-8335). + if (LLStringUtil::startsWith(unescaped_text, "http://")) // SLURL text_to_copy = utf8str_to_wstring(LLWeb::escapeURL(unescaped_text)); - else + else // human-readable location text_to_copy = utf8str_to_wstring(unescaped_text); gClipboard.copyFromString( text_to_copy ); -- cgit v1.2.3 From cbf5dc148c7a3fa0669d31c71a0f9701edf08318 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Mon, 12 Jul 2010 17:44:17 +0300 Subject: EXT-8323 FIXED added "name" attributes to facilitate translation Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/733/ --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_nearby_media.xml | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra') diff --git a/indra/newview/skins/default/xui/en/panel_nearby_media.xml b/indra/newview/skins/default/xui/en/panel_nearby_media.xml index d8675b3512..584ca8b3b5 100644 --- a/indra/newview/skins/default/xui/en/panel_nearby_media.xml +++ b/indra/newview/skins/default/xui/en/panel_nearby_media.xml @@ -104,6 +104,7 @@ follows="top|left" font="SansSerif" left="10" + name="nearby_media_title" width="100"> Nearby Media @@ -114,6 +115,7 @@ font="SansSerif" top_pad="15" left="10" + name="show_text" width="40"> Show: -- cgit v1.2.3 From 38d763b34fe8411684c0f73627dc018ff9171c87 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Mon, 12 Jul 2010 16:46:50 +0300 Subject: EXT-5403 FIXED Disabled auto selecting first filtered item because it takes away selection from the item set by LLTextureCtrl owning the texture picker floater. Reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/679/. --HG-- branch : product-engine --- indra/newview/llfolderview.h | 1 + indra/newview/lltexturectrl.cpp | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'indra') diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 55eb543f5f..3944fa53c9 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -262,6 +262,7 @@ public: BOOL needsAutoSelect() { return mNeedsAutoSelect && !mAutoSelectOverride; } BOOL needsAutoRename() { return mNeedsAutoRename; } void setNeedsAutoRename(BOOL val) { mNeedsAutoRename = val; } + void setAutoSelectOverride(BOOL val) { mAutoSelectOverride = val; } void setCallbackRegistrar(LLUICtrl::CommitCallbackRegistry::ScopedRegistrar* registrar) { mCallbackRegistrar = registrar; } diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index fcb9deb20b..0b02861b75 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -423,6 +423,10 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); mInventoryPanel->setAllowMultiSelect(FALSE); + // Disable auto selecting first filtered item because it takes away + // selection from the item set by LLTextureCtrl owning this floater. + mInventoryPanel->getRootFolder()->setAutoSelectOverride(TRUE); + // Commented out to scroll to currently selected texture. See EXT-5403. // // store this filter as the default one // mInventoryPanel->getRootFolder()->getFilter()->markDefault(); -- cgit v1.2.3 From dcf21a1287ed20806260aa38959b6fb585ee139a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Mon, 12 Jul 2010 16:52:34 +0300 Subject: Fixed Linux build. --HG-- branch : product-engine --- indra/llui/lluictrlfactory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h index ff99712c5f..dc43b311a7 100644 --- a/indra/llui/lluictrlfactory.h +++ b/indra/llui/lluictrlfactory.h @@ -182,7 +182,7 @@ public: void popFactoryFunctions(); template - static T* createWidget(typename const T::Params& params, LLView* parent = NULL) + static T* createWidget(const typename T::Params& params, LLView* parent = NULL) { T* widget = NULL; -- cgit v1.2.3 From 1cdf970d10198c0f50790226c78e16d2a809a3d3 Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Mon, 12 Jul 2010 17:49:46 +0300 Subject: EXT-8274 FIXED Avoided message truncation on tip toasts. Details: Made max message line count configurable and by default 10 lines. reviewed by Vadim Savchuk at https://codereview.productengine.com/secondlife/r/730/ --HG-- branch : product-engine --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llpanelgenerictip.cpp | 6 ++++-- indra/newview/llpanelonlinestatus.cpp | 5 +++-- 3 files changed, 18 insertions(+), 4 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index d51498f6d1..1c32f33290 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -11857,5 +11857,16 @@ Value 1 + TipToastMessageLineCount + + Comment + Max line count of text message on tip toast. + Persist + 1 + Type + S32 + Value + 10 + diff --git a/indra/newview/llpanelgenerictip.cpp b/indra/newview/llpanelgenerictip.cpp index e0658554a4..8ba2e6d01c 100644 --- a/indra/newview/llpanelgenerictip.cpp +++ b/indra/newview/llpanelgenerictip.cpp @@ -35,6 +35,7 @@ #include "llpanelgenerictip.h" #include "llnotifications.h" +#include "llviewercontrol.h" // for gSavedSettings LLPanelGenericTip::LLPanelGenericTip( @@ -45,7 +46,8 @@ LLPanelGenericTip::LLPanelGenericTip( childSetValue("message", notification->getMessage()); - // set line max count to 3 in case of a very long name - snapToMessageHeight(getChild ("message"), 3); + + S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); + snapToMessageHeight(getChild ("message"), max_line_count); } diff --git a/indra/newview/llpanelonlinestatus.cpp b/indra/newview/llpanelonlinestatus.cpp index 6ba015b11c..b21fd7d385 100644 --- a/indra/newview/llpanelonlinestatus.cpp +++ b/indra/newview/llpanelonlinestatus.cpp @@ -34,6 +34,7 @@ #include "llnotifications.h" #include "llpanelonlinestatus.h" +#include "llviewercontrol.h" // for gSavedSettings LLPanelOnlineStatus::LLPanelOnlineStatus( const LLNotificationPtr& notification) : @@ -54,7 +55,7 @@ LLPanelOnlineStatus::LLPanelOnlineStatus( notification, notification->getResponseTemplate())); } - // set line max count to 3 in case of a very long name - snapToMessageHeight(getChild ("message"), 3); + S32 max_line_count = gSavedSettings.getS32("TipToastMessageLineCount"); + snapToMessageHeight(getChild ("message"), max_line_count); } -- cgit v1.2.3