From 6294d4f7bf809de91c910ff56391bcf9fa78b124 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 1 Feb 2010 15:24:38 -0800 Subject: Use "standard" llsd::equals --- indra/llprimitive/tests/llmediaentry_test.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp index 277e370ca4..88cd96ebe4 100644 --- a/indra/llprimitive/tests/llmediaentry_test.cpp +++ b/indra/llprimitive/tests/llmediaentry_test.cpp @@ -157,14 +157,9 @@ namespace namespace tut { - bool llsd_equals(const LLSD& a, const LLSD& b) { - // cheesy, brute force, but it works - return std::string(ll_pretty_print_sd(a)) == std::string(ll_pretty_print_sd(b)); - } - void ensure_llsd_equals(const std::string& msg, const LLSD& expected, const LLSD& actual) { - if (!tut::llsd_equals(expected, actual)) + if (!llsd_equals(expected, actual)) { std::string message = msg; message += ": actual: "; -- cgit v1.2.3 From f7120956f50afb3ffae269819ffbd7f07b1ac85b Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 4 Feb 2010 09:21:02 +0000 Subject: EXT-4898: Convert "en-us" to "en" for url substitutions. The correct and general fix is to change English.lproj/language.txt. This fix here is a more targeted and less risky fix at this stage of the release cycle. --- indra/newview/llweb.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 7866f735c5..3def17f33c 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -145,11 +145,20 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, substitution["VERSION_PATCH"] = LLVersionInfo::getPatch(); substitution["VERSION_BUILD"] = LLVersionInfo::getBuild(); substitution["CHANNEL"] = LLVersionInfo::getChannel(); - substitution["LANGUAGE"] = LLUI::getLanguage(); substitution["GRID"] = LLViewerLogin::getInstance()->getGridLabel(); substitution["OS"] = LLAppViewer::instance()->getOSInfo().getOSStringSimple(); substitution["SESSION_ID"] = gAgent.getSessionID(); + // work out the current language + std::string lang = LLUI::getLanguage(); + if (lang == "en-us") + { + // *HACK: the correct fix is to change English.lproj/language.txt, + // but we're late in the release cycle and this is a less risky fix + lang = "en"; + } + substitution["LANGUAGE"] = lang; + // find the region ID LLUUID region_id; LLViewerRegion *region = gAgent.getRegion(); -- cgit v1.2.3 From 6c992c95a98ec69e77455129098338dce2f092aa Mon Sep 17 00:00:00 2001 From: Lynx Linden Date: Thu, 4 Feb 2010 10:23:24 +0000 Subject: EXT-3681: Send Parcel "Local ID" (S32) to web pages. This is instead of sending the Parcel ID (LLUUID), which it turns out the server never sends to the viewer (LLParcel::getID() always returns NULL). --- indra/newview/llweb.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index 3def17f33c..100ec0bb69 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -168,14 +168,14 @@ std::string LLWeb::expandURLSubstitutions(const std::string &url, } substitution["REGION_ID"] = region_id; - // find the parcel ID - LLUUID parcel_id; + // find the parcel local ID + S32 parcel_id = 0; LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); if (parcel) { - parcel_id = parcel->getID(); + parcel_id = parcel->getLocalID(); } - substitution["PARCEL_ID"] = parcel_id; + substitution["PARCEL_ID"] = llformat("%d", parcel_id); // expand all of the substitution strings and escape the url std::string expanded_url = url; -- cgit v1.2.3 From 482eefcba94dac0e6a0e6f9985f582e724b02523 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Thu, 4 Feb 2010 12:39:13 +0200 Subject: fix for task EXT-4750 Disable "Join" dialog for free groups also add group name to notification - more informative... --HG-- branch : product-engine --- indra/newview/llgroupactions.cpp | 7 ++++++- indra/newview/skins/default/xui/en/notifications.xml | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/indra/newview/llgroupactions.cpp b/indra/newview/llgroupactions.cpp index 3653371d76..00e2365ffd 100644 --- a/indra/newview/llgroupactions.cpp +++ b/indra/newview/llgroupactions.cpp @@ -161,12 +161,17 @@ void LLGroupActions::join(const LLUUID& group_id) S32 cost = gdatap->mMembershipFee; LLSD args; args["COST"] = llformat("%d", cost); + args["NAME"] = gdatap->mName; LLSD payload; payload["group_id"] = group_id; if (can_afford_transaction(cost)) { - LLNotificationsUtil::add("JoinGroupCanAfford", args, payload, onJoinGroup); + if(cost > 0) + LLNotificationsUtil::add("JoinGroupCanAfford", args, payload, onJoinGroup); + else + LLNotificationsUtil::add("JoinGroupNoCost", args, payload, onJoinGroup); + } else { diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 636db2b59b..7cc4af53f8 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -411,6 +411,19 @@ Do you wish to proceed? yestext="Join"/> + +You are Joining group [NAME]. +Do you wish to proceed? + + + + Date: Thu, 4 Feb 2010 12:55:52 +0200 Subject: Fixed critical bug EXT-4823 - [NUX] Default My Profile to Edit Mode --HG-- branch : product-engine --- indra/newview/llpanelme.cpp | 14 ++++++++++++++ indra/newview/llpanelprofile.cpp | 16 +++++++++++----- indra/newview/llpanelprofile.h | 2 ++ 3 files changed, 27 insertions(+), 5 deletions(-) diff --git a/indra/newview/llpanelme.cpp b/indra/newview/llpanelme.cpp index ea66ef7d2c..a68552a91e 100644 --- a/indra/newview/llpanelme.cpp +++ b/indra/newview/llpanelme.cpp @@ -69,6 +69,20 @@ BOOL LLPanelMe::postBuild() void LLPanelMe::onOpen(const LLSD& key) { LLPanelProfile::onOpen(key); + + if(key.isUndefined() || key.has("edit_my_profile")) + { + // Open Edit My Profile panel by default (through Side Tray -> My Profile) (EXT-4823) + buildEditPanel(); + openPanel(mEditPanel, getAvatarId()); + } + else if(mEditPanel) + { + // When opening Me Panel through Side Tray LLPanelMe::onOpen() is called twice. + // First time key can be undefined and second time - key may contain some data. + // Lets close Edit Panel if key does contain some data on second call. + closePanel(mEditPanel); + } } bool LLPanelMe::notifyChildren(const LLSD& info) diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index c73ade53c8..b5d85dfd4b 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -197,11 +197,7 @@ void LLPanelProfile::togglePanel(LLPanel* panel, const LLSD& key) } else { - panel->setVisible(FALSE); - if (panel->getParent() == this) - { - removeChild(panel); - } + closePanel(panel); getTabCtrl()->getCurrentPanel()->onOpen(getAvatarId()); } @@ -248,6 +244,16 @@ void LLPanelProfile::openPanel(LLPanel* panel, const LLSD& params) panel->setRect(new_rect); } +void LLPanelProfile::closePanel(LLPanel* panel) +{ + panel->setVisible(FALSE); + + if (panel->getParent() == this) + { + removeChild(panel); + } +} + S32 LLPanelProfile::notifyParent(const LLSD& info) { std::string action = info["action"]; diff --git a/indra/newview/llpanelprofile.h b/indra/newview/llpanelprofile.h index bcf4bdd0ec..f1aa3f10f8 100644 --- a/indra/newview/llpanelprofile.h +++ b/indra/newview/llpanelprofile.h @@ -55,6 +55,8 @@ public: virtual void openPanel(LLPanel* panel, const LLSD& params); + virtual void closePanel(LLPanel* panel); + S32 notifyParent(const LLSD& info); protected: -- cgit v1.2.3 From 14d942f16b284ca5180b29f3c912d158c0d0cdd0 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 4 Feb 2010 11:08:49 +0000 Subject: A flag+assert to help track bad behaviour in LLEventTimer, especially EXT-4754 --- indra/llcommon/lltimer.cpp | 6 ++++++ indra/llcommon/lltimer.h | 1 + 2 files changed, 7 insertions(+) diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index ef3e8dbc94..63634117b5 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -565,19 +565,23 @@ LLEventTimer::LLEventTimer(F32 period) : mEventTimer() { mPeriod = period; + mBusy = false; } LLEventTimer::LLEventTimer(const LLDate& time) : mEventTimer() { mPeriod = (F32)(time.secondsSinceEpoch() - LLDate::now().secondsSinceEpoch()); + mBusy = false; } LLEventTimer::~LLEventTimer() { + llassert(!mBusy); // this LLEventTimer was destroyed from its own tick() function - bad. } +//static void LLEventTimer::updateClass() { std::list completed_timers; @@ -587,10 +591,12 @@ void LLEventTimer::updateClass() F32 et = timer.mEventTimer.getElapsedTimeF32(); if (timer.mEventTimer.getStarted() && et > timer.mPeriod) { timer.mEventTimer.reset(); + timer.mBusy = true; if ( timer.tick() ) { completed_timers.push_back( &timer ); } + timer.mBusy = false; } } diff --git a/indra/llcommon/lltimer.h b/indra/llcommon/lltimer.h index d009c0f5f7..4d995d5bba 100644 --- a/indra/llcommon/lltimer.h +++ b/indra/llcommon/lltimer.h @@ -188,6 +188,7 @@ public: protected: LLTimer mEventTimer; F32 mPeriod; + bool mBusy; }; U64 LL_COMMON_API totalTime(); // Returns current system time in microseconds -- cgit v1.2.3 From 2c30ccf34d518ccedd0b3ffdeb2ba1da8d140a1d Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 4 Feb 2010 11:24:14 +0000 Subject: EXT-4754 Crash in LLEventTimer::updateClass --- indra/llcommon/lltimer.cpp | 2 +- indra/newview/llcallfloater.cpp | 3 ++- indra/newview/llspeakers.cpp | 17 ++++++++++------- indra/newview/llspeakers.h | 4 ++-- 4 files changed, 15 insertions(+), 11 deletions(-) diff --git a/indra/llcommon/lltimer.cpp b/indra/llcommon/lltimer.cpp index 63634117b5..21e165ebc9 100644 --- a/indra/llcommon/lltimer.cpp +++ b/indra/llcommon/lltimer.cpp @@ -578,7 +578,7 @@ LLEventTimer::LLEventTimer(const LLDate& time) LLEventTimer::~LLEventTimer() { - llassert(!mBusy); // this LLEventTimer was destroyed from its own tick() function - bad. + llassert(!mBusy); // this LLEventTimer was destroyed from within its own tick() function - bad. if you want tick() to cause destruction of its own timer, make it return true. } //static diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp index 8cb240c7c2..bd4fae6ab6 100644 --- a/indra/newview/llcallfloater.cpp +++ b/indra/newview/llcallfloater.cpp @@ -678,7 +678,8 @@ void LLCallFloater::resetVoiceRemoveTimers() void LLCallFloater::removeVoiceRemoveTimer(const LLUUID& voice_speaker_id) { - mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id); + bool delete_it = true; + mSpeakerDelayRemover->unsetActionTimer(voice_speaker_id, delete_it); } bool LLCallFloater::validateSpeaker(const LLUUID& speaker_id) diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 6f9a1ccdbe..786fa24e65 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -205,7 +205,7 @@ void LLSpeakersDelayActionsStorage::setActionTimer(const LLUUID& speaker_id) } } -void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id) +void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id, bool delete_it) { if (mActionTimersMap.size() == 0) return; @@ -213,7 +213,10 @@ void LLSpeakersDelayActionsStorage::unsetActionTimer(const LLUUID& speaker_id) if (it_speaker != mActionTimersMap.end()) { - delete it_speaker->second; + if (delete_it) + { + delete it_speaker->second; + } mActionTimersMap.erase(it_speaker); } } @@ -230,16 +233,15 @@ void LLSpeakersDelayActionsStorage::removeAllTimers() bool LLSpeakersDelayActionsStorage::onTimerActionCallback(const LLUUID& speaker_id) { - unsetActionTimer(speaker_id); + bool delete_it = false; // we're *in* this timer, return true to delete it, don't manually delete it + unsetActionTimer(speaker_id, delete_it); if (mActionCallback) { mActionCallback(speaker_id); } - // do not return true to avoid deleting of an timer twice: - // in LLSpeakersDelayActionsStorage::unsetActionTimer() & LLEventTimer::updateClass() - return false; + return true; } @@ -291,7 +293,8 @@ LLPointer LLSpeakerMgr::setSpeaker(const LLUUID& id, const std::strin } } - mSpeakerDelayRemover->unsetActionTimer(speakerp->mID); + bool delete_it = true; + mSpeakerDelayRemover->unsetActionTimer(speakerp->mID, delete_it); return speakerp; } diff --git a/indra/newview/llspeakers.h b/indra/newview/llspeakers.h index 63237204c8..ddc3632f07 100644 --- a/indra/newview/llspeakers.h +++ b/indra/newview/llspeakers.h @@ -176,11 +176,11 @@ public: void setActionTimer(const LLUUID& speaker_id); /** - * Removes stored LLSpeakerActionTimer for passed speaker UUID from internal map and deletes it. + * Removes stored LLSpeakerActionTimer for passed speaker UUID from internal map and optionally deletes it. * * @see onTimerActionCallback() */ - void unsetActionTimer(const LLUUID& speaker_id); + void unsetActionTimer(const LLUUID& speaker_id, bool delete_it); void removeAllTimers(); private: -- cgit v1.2.3 From 56ca1aebb866b7d7e1526e31797dd7e07fcb74a8 Mon Sep 17 00:00:00 2001 From: Tofu Linden Date: Thu, 4 Feb 2010 11:40:33 +0000 Subject: remove linux linking stats from build process - I added them to help optimize linking time, but they're noisy and inaccurate in reality. --- indra/cmake/00-Common.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 1f578eec5f..592e9fc901 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -171,8 +171,8 @@ if (LINUX) if (NOT STANDALONE) # this stops us requiring a really recent glibc at runtime add_definitions(-fno-stack-protector) - # linking can be so slow - give us a chance to figure out why - set(CMAKE_CXX_LINK_FLAGS "-Wl,--stats,--no-keep-memory") + # linking can be very memory-hungry, especially the final viewer link + set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") endif (NOT STANDALONE) endif (VIEWER) -- cgit v1.2.3 From 667ae0b9a31318d43d36cb6c8cb73a83e1470009 Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 4 Feb 2010 15:54:56 +0200 Subject: Fixed critical bug EXT-4845 (Create padding around text messages in the side tray panels) - moved "No Items" textbox params to widget (flat_list_view.xml) - set default vertical/horizontal padding to 10 px - they can be overridden in panel's xml if necessary. --HG-- branch : product-engine --- indra/llui/llflatlistview.cpp | 47 ++++++++++++++-------- indra/llui/llflatlistview.h | 5 ++- .../newview/skins/default/xui/en/panel_people.xml | 2 + .../default/xui/en/widgets/flat_list_view.xml | 10 ++++- 4 files changed, 45 insertions(+), 19 deletions(-) diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 92993650a7..2481249f91 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -42,8 +42,6 @@ static const LLDefaultChildRegistry::Register flat_list_view("fl const LLSD SELECTED_EVENT = LLSD().with("selected", true); const LLSD UNSELECTED_EVENT = LLSD().with("selected", false); -static const std::string COMMENT_TEXTBOX = "comment_text"; - //forward declaration bool llsds_are_equal(const LLSD& llsd_1, const LLSD& llsd_2); @@ -51,7 +49,8 @@ LLFlatListView::Params::Params() : item_pad("item_pad"), allow_select("allow_select"), multi_select("multi_select"), - keep_one_selected("keep_one_selected") + keep_one_selected("keep_one_selected"), + no_items_text("no_items_text") {}; void LLFlatListView::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) @@ -295,19 +294,6 @@ void LLFlatListView::resetSelection(bool no_commit_on_deselection /*= false*/) void LLFlatListView::setNoItemsCommentText(const std::string& comment_text) { - if (NULL == mNoItemsCommentTextbox) - { - LLRect comment_rect = getRect(); - comment_rect.setOriginAndSize(0, 0, comment_rect.getWidth(), comment_rect.getHeight()); - comment_rect.stretch(-getBorderWidth()); - LLTextBox::Params text_p; - text_p.name(COMMENT_TEXTBOX); - text_p.border_visible(false); - text_p.rect(comment_rect); - text_p.follows.flags(FOLLOWS_ALL); - mNoItemsCommentTextbox = LLUICtrlFactory::create(text_p, this); - } - mNoItemsCommentTextbox->setValue(comment_text); } @@ -361,7 +347,6 @@ bool LLFlatListView::updateValue(const LLSD& old_value, const LLSD& new_value) // PROTECTED STUFF ////////////////////////////////////////////////////////////////////////// - LLFlatListView::LLFlatListView(const LLFlatListView::Params& p) : LLScrollContainer(p) , mItemComparator(NULL) @@ -398,6 +383,25 @@ LLFlatListView::LLFlatListView(const LLFlatListView::Params& p) params.bevel_style(LLViewBorder::BEVEL_IN); mSelectedItemsBorder = LLUICtrlFactory::create (params); mItemsPanel->addChild( mSelectedItemsBorder ); + + { + // create textbox for "No Items" comment text + LLTextBox::Params text_p = p.no_items_text; + if (!text_p.rect.isProvided()) + { + LLRect comment_rect = getRect(); + comment_rect.setOriginAndSize(0, 0, comment_rect.getWidth(), comment_rect.getHeight()); + comment_rect.stretch(-getBorderWidth()); + text_p.rect(comment_rect); + } + text_p.border_visible(false); + + if (!text_p.follows.isProvided()) + { + text_p.follows.flags(FOLLOWS_ALL); + } + mNoItemsCommentTextbox = LLUICtrlFactory::create(text_p, this); + } }; // virtual @@ -861,7 +865,11 @@ void LLFlatListView::notifyParentItemsRectChanged() // take into account comment text height if exists if (mNoItemsCommentTextbox && mNoItemsCommentTextbox->getVisible()) { + // top text padding inside the textbox is included into the height comment_height = mNoItemsCommentTextbox->getTextPixelHeight(); + + // take into account a distance from parent's top border to textbox's top + comment_height += getRect().getHeight() - mNoItemsCommentTextbox->getRect().mTop; } LLRect req_rect = getItemsRect(); @@ -892,6 +900,10 @@ void LLFlatListView::setNoItemsCommentVisible(bool visible) const { if (visible) { +/* +// *NOTE: MA 2010-02-04 +// Deprecated after params of the comment text box were moved into widget (flat_list_view.xml) +// can be removed later if nothing happened. // We have to update child rect here because of issues with rect after reshaping while creating LLTextbox // It is possible to have invalid LLRect if Flat List is in LLAccordionTab LLRect comment_rect = getLocalRect(); @@ -903,6 +915,7 @@ void LLFlatListView::setNoItemsCommentVisible(bool visible) const LLViewBorder* scroll_border = getChild("scroll border"); comment_rect.stretch(-scroll_border->getBorderWidth()); mNoItemsCommentTextbox->setRect(comment_rect); +*/ } mNoItemsCommentTextbox->setVisible(visible); } diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index 949a731507..92cb40332e 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -35,8 +35,8 @@ #include "llpanel.h" #include "llscrollcontainer.h" +#include "lltextbox.h" -class LLTextBox; /** * LLFlatListView represents a flat list ui control that operates on items in a form of LLPanel's. @@ -108,6 +108,9 @@ public: /** padding between items */ Optional item_pad; + /** textbox with info message when list is empty*/ + Optional no_items_text; + Params(); }; diff --git a/indra/newview/skins/default/xui/en/panel_people.xml b/indra/newview/skins/default/xui/en/panel_people.xml index 3b5add33a8..447ac1b123 100644 --- a/indra/newview/skins/default/xui/en/panel_people.xml +++ b/indra/newview/skins/default/xui/en/panel_people.xml @@ -137,6 +137,7 @@ background_visible="true" \ No newline at end of file + opaque="true"> + + \ No newline at end of file -- cgit v1.2.3 From 7b62c80060184690ac28d34e4653472179f0cf13 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Thu, 4 Feb 2010 15:58:49 +0200 Subject: Additional commit for low Bug EXT-4242 . No logic had been affected. code cleaning up. --HG-- branch : product-engine --- indra/newview/llnavigationbar.cpp | 57 ++++++++++++++++++++++----------------- indra/newview/llnavigationbar.h | 37 +++++++++++-------------- 2 files changed, 48 insertions(+), 46 deletions(-) diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 59708fcfb5..46cab0d868 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -185,43 +185,46 @@ void LLTeleportHistoryMenuItem::onMouseLeave(S32 x, S32 y, MASK mask) static LLDefaultChildRegistry::Register menu_button("pull_button"); -LLPullButton::LLPullButton(const LLPullButton::Params& params): - LLButton(params) - , mClickDraggingSignal(NULL) +LLPullButton::LLPullButton(const LLPullButton::Params& params) : + LLButton(params) { setDirectionFromName(params.direction); } -boost::signals2::connection LLPullButton::setClickDraggingCallback( const commit_signal_t::slot_type& cb ) -{ - if (!mClickDraggingSignal) mClickDraggingSignal = new commit_signal_t(); - return mClickDraggingSignal->connect(cb); +boost::signals2::connection LLPullButton::setClickDraggingCallback(const commit_signal_t::slot_type& cb) +{ + return mClickDraggingSignal.connect(cb); } /*virtual*/ void LLPullButton::onMouseLeave(S32 x, S32 y, MASK mask) { LLButton::onMouseLeave(x, y, mask); - - if(mMouseDownTimer.getStarted() ) + + if (mMouseDownTimer.getStarted()) //an user have done a mouse down, if the timer started. see LLButton::handleMouseDown for details { - const LLVector2 cursor_direction = LLVector2(F32(x),F32(y)) - mLastMouseDown; - if( angle_between(mDraggingDirection, cursor_direction) < 0.5 * F_PI_BY_TWO)//call if angle < pi/4 - { - if(mClickDraggingSignal) - { - (*mClickDraggingSignal)(this, LLSD()); - } - } + const LLVector2 cursor_direction = LLVector2(F32(x), F32(y)) - mLastMouseDown; + /* For now cursor_direction points to the direction of mouse movement + * Need to decide whether should we fire a signal. + * We fire if angle between mDraggingDirection and cursor_direction is less that 45 degree + * Note: + * 0.5 * F_PI_BY_TWO equals to PI/4 radian that equals to angle of 45 degrees + */ + if (angle_between(mDraggingDirection, cursor_direction) < 0.5 * F_PI_BY_TWO)//call if angle < pi/4 + { + mClickDraggingSignal(this, LLSD()); + } } } /*virtual*/ BOOL LLPullButton::handleMouseDown(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLButton::handleMouseDown(x, y, mask); + if (handled) { - BOOL handled = LLButton::handleMouseDown(x,y, mask); - if(handled) - { + //if mouse down was handled by button, + //capture mouse position to calculate the direction of mouse move after mouseLeave event mLastMouseDown.set(F32(x), F32(y)); } return handled; @@ -230,27 +233,31 @@ BOOL LLPullButton::handleMouseDown(S32 x, S32 y, MASK mask) /*virtual*/ BOOL LLPullButton::handleMouseUp(S32 x, S32 y, MASK mask) { + // reset data to get ready for next circle mLastMouseDown.clear(); return LLButton::handleMouseUp(x, y, mask); } - +/** + * this function is setting up dragging direction vector. + * Last one is just unit vector. It points to direction of mouse drag that we need to handle + */ void LLPullButton::setDirectionFromName(const std::string& name) { if (name == "left") { - mDraggingDirection.set(F32(-1), F32(0)); + mDraggingDirection.set(F32(-1), F32(0)); } else if (name == "right") { - mDraggingDirection.set(F32(0), F32(1)); + mDraggingDirection.set(F32(0), F32(1)); } else if (name == "down") { - mDraggingDirection.set(F32(0), F32(-1)); + mDraggingDirection.set(F32(0), F32(-1)); } else if (name == "up") { - mDraggingDirection.set(F32(0), F32(1)); + mDraggingDirection.set(F32(0), F32(1)); } } diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h index 9d0abc7a3a..b512f2a79c 100644 --- a/indra/newview/llnavigationbar.h +++ b/indra/newview/llnavigationbar.h @@ -44,46 +44,41 @@ class LLSearchComboBox; /** * This button is able to handle click-dragging mouse event. * It has appropriated signal for this event. - * Dragging direction can be set from xml by attribute called 'direction' + * Dragging direction can be set from xml attribute called 'direction' * * *TODO: move to llui? */ -class LLPullButton : public LLButton +class LLPullButton: public LLButton { LOG_CLASS(LLPullButton); - + public: - - struct Params : public LLInitParam::Block + struct Params: public LLInitParam::Block { - Optional direction; // left, right, down, up - - Params() - : direction("direction","down") - {} + Optional direction; // left, right, down, up + + Params() + : direction("direction", "down") + { + } }; /*virtual*/ BOOL handleMouseDown(S32 x, S32 y, MASK mask); - + /*virtual*/ BOOL handleMouseUp(S32 x, S32 y, MASK mask); - + /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask); - boost::signals2::connection setClickDraggingCallback( const commit_signal_t::slot_type& cb ); - - /* virtual*/ ~LLPullButton() - { - delete mClickDraggingSignal; - } - + boost::signals2::connection setClickDraggingCallback(const commit_signal_t::slot_type& cb); + protected: friend class LLUICtrlFactory; // convert string name into direction vector void setDirectionFromName(const std::string& name); LLPullButton(const LLPullButton::Params& params); - - commit_signal_t* mClickDraggingSignal; + + commit_signal_t mClickDraggingSignal; LLVector2 mLastMouseDown; LLVector2 mDraggingDirection; }; -- cgit v1.2.3 From 8693cf51e5f1645bcb99310700eb530cff5a0373 Mon Sep 17 00:00:00 2001 From: Denis Serdjuk Date: Thu, 4 Feb 2010 16:04:28 +0200 Subject: fixed critical bug EXT-4887 The Label, \"Favorites Bar\" should only appear if you have no favorites Changes: Check for empty favbar has been added to change visibility of favbar label --HG-- branch : product-engine --- indra/newview/llfavoritesbar.cpp | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp index a5b62439f4..90f6438980 100644 --- a/indra/newview/llfavoritesbar.cpp +++ b/indra/newview/llfavoritesbar.cpp @@ -34,7 +34,6 @@ #include "llfavoritesbar.h" -#include "llbutton.h" #include "llfloaterreg.h" #include "llfocusmgr.h" #include "llinventory.h" @@ -48,7 +47,6 @@ #include "llclipboard.h" #include "llinventoryclipboard.h" #include "llinventorybridge.h" -#include "llinventorymodel.h" #include "llfloaterworldmap.h" #include "lllandmarkactions.h" #include "llnotificationsutil.h" @@ -674,7 +672,14 @@ void LLFavoritesBarCtrl::updateButtons() { return; } - + if(mItems.empty()) + { + mBarLabel->setVisible(TRUE); + } + else + { + mBarLabel->setVisible(FALSE); + } const child_list_t* childs = getChildList(); child_list_const_iter_t child_it = childs->begin(); int first_changed_item_index = 0; @@ -720,14 +725,22 @@ void LLFavoritesBarCtrl::updateButtons() } } // we have to remove ChevronButton to make sure that the last item will be LandmarkButton to get the right aligning + // keep in mind that we are cutting all buttons in space between the last visible child of favbar and ChevronButton if (mChevronButton->getParent() == this) { removeChild(mChevronButton); } int last_right_edge = 0; + //calculate new buttons offset if (getChildList()->size() > 0) { - last_right_edge = getChildList()->back()->getRect().mRight; + //find last visible child to get the rightest button offset + child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(), + std::mem_fun(&LLView::getVisible)); + if(last_visible_it != childs->rend()) + { + last_right_edge = (*last_visible_it)->getRect().mRight; + } } //last_right_edge is saving coordinates LLButton* last_new_button = NULL; -- cgit v1.2.3 From 7453aae13e01bd0b055fed8056de8889e878942e Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 4 Feb 2010 15:16:14 +0200 Subject: Fixed normal bug EXT-4862 - Nearby Chat pop-up toasts close affordance displays under prior toasts. Implemented same fix for notification toasts. --HG-- branch : product-engine --- indra/newview/llnearbychathandler.cpp | 7 +++++++ indra/newview/llscreenchannel.cpp | 8 ++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp index c08ca30bab..be48770567 100644 --- a/indra/newview/llnearbychathandler.cpp +++ b/indra/newview/llnearbychathandler.cpp @@ -274,6 +274,13 @@ void LLNearbyChatScreenChannel::showToastsBottom() toast->setRect(toast_rect); toast->setIsHidden(false); toast->setVisible(TRUE); + + if(!toast->hasFocus()) + { + // Fixing Z-order of toasts (EXT-4862) + // Next toast will be positioned under this one. + gFloaterView->sendChildToBack(toast); + } bottom = toast->getRect().mTop; } diff --git a/indra/newview/llscreenchannel.cpp b/indra/newview/llscreenchannel.cpp index 8f36c0e88a..7c2e7e3319 100644 --- a/indra/newview/llscreenchannel.cpp +++ b/indra/newview/llscreenchannel.cpp @@ -533,9 +533,13 @@ void LLScreenChannel::showToastsBottom() // HACK // EXT-2653: it is necessary to prevent overlapping for secondary showed toasts (*it).toast->setVisible(TRUE); - // Show toast behind floaters. (EXT-3089) - gFloaterView->sendChildToBack((*it).toast); } + if(!(*it).toast->hasFocus()) + { + // Fixing Z-order of toasts (EXT-4862) + // Next toast will be positioned under this one. + gFloaterView->sendChildToBack((*it).toast); + } } if(it != mToastList.rend()) -- cgit v1.2.3 From 36a44ba0e9133e78cc66f7d0b65d0890cfeb3db5 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Thu, 4 Feb 2010 15:37:25 +0200 Subject: fix for normal EXT-1888 Apply button remains active after Applying changes --HG-- branch : product-engine --- indra/newview/llfloaterpreference.cpp | 100 +++++++++++++++++++++ indra/newview/llfloaterpreference.h | 16 ++++ .../skins/default/xui/en/floater_preferences.xml | 2 +- 3 files changed, 117 insertions(+), 1 deletion(-) diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index ef444c8ba4..9d9fbacee3 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -571,6 +571,16 @@ void LLFloaterPreference::setHardwareDefaults() { LLFeatureManager::getInstance()->applyRecommendedSettings(); refreshEnabledGraphics(); + LLTabContainer* tabcontainer = getChild("pref core"); + child_list_t::const_iterator iter = tabcontainer->getChildList()->begin(); + child_list_t::const_iterator end = tabcontainer->getChildList()->end(); + for ( ; iter != end; ++iter) + { + LLView* view = *iter; + LLPanelPreference* panel = dynamic_cast(view); + if (panel) + panel->setHardwareDefaults(); + } } //virtual @@ -1525,3 +1535,93 @@ void LLPanelPreference::setControlFalse(const LLSD& user_data) if (control) control->set(LLSD(FALSE)); } + +static LLRegisterPanelClassWrapper t_pref_graph("panel_preference_graphics"); + +BOOL LLPanelPreferenceGraphics::postBuild() +{ + return LLPanelPreference::postBuild(); +} +void LLPanelPreferenceGraphics::draw() +{ + LLPanelPreference::draw(); + + LLButton* button_apply = findChild("Apply"); + + if(button_apply && button_apply->getVisible()) + { + bool enable = hasDirtyChilds(); + + button_apply->setEnabled(enable); + + } +} +bool LLPanelPreferenceGraphics::hasDirtyChilds() +{ + std::list view_stack; + view_stack.push_back(this); + while(!view_stack.empty()) + { + // Process view on top of the stack + LLView* curview = view_stack.front(); + view_stack.pop_front(); + + LLUICtrl* ctrl = dynamic_cast(curview); + if (ctrl) + { + if(ctrl->isDirty()) + return true; + } + // Push children onto the end of the work stack + for (child_list_t::const_iterator iter = curview->getChildList()->begin(); + iter != curview->getChildList()->end(); ++iter) + { + view_stack.push_back(*iter); + } + } + return false; +} + +void LLPanelPreferenceGraphics::resetDirtyChilds() +{ + std::list view_stack; + view_stack.push_back(this); + while(!view_stack.empty()) + { + // Process view on top of the stack + LLView* curview = view_stack.front(); + view_stack.pop_front(); + + LLUICtrl* ctrl = dynamic_cast(curview); + if (ctrl) + { + ctrl->resetDirty(); + } + // Push children onto the end of the work stack + for (child_list_t::const_iterator iter = curview->getChildList()->begin(); + iter != curview->getChildList()->end(); ++iter) + { + view_stack.push_back(*iter); + } + } +} +void LLPanelPreferenceGraphics::apply() +{ + resetDirtyChilds(); + LLPanelPreference::apply(); +} +void LLPanelPreferenceGraphics::cancel() +{ + resetDirtyChilds(); + LLPanelPreference::cancel(); +} +void LLPanelPreferenceGraphics::saveSettings() +{ + resetDirtyChilds(); + LLPanelPreference::saveSettings(); +} +void LLPanelPreferenceGraphics::setHardwareDefaults() +{ + resetDirtyChilds(); + LLPanelPreference::setHardwareDefaults(); +} diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h index 8778d76a5a..0827c7c2b2 100644 --- a/indra/newview/llfloaterpreference.h +++ b/indra/newview/llfloaterpreference.h @@ -161,6 +161,7 @@ public: virtual void apply(); virtual void cancel(); void setControlFalse(const LLSD& user_data); + virtual void setHardwareDefaults(){}; // This function squirrels away the current values of the controls so that // cancel() can restore them. @@ -177,4 +178,19 @@ private: string_color_map_t mSavedColors; }; +class LLPanelPreferenceGraphics : public LLPanelPreference +{ +public: + BOOL postBuild(); + void draw(); + void apply(); + void cancel(); + void saveSettings(); + void setHardwareDefaults(); +protected: + bool hasDirtyChilds(); + void resetDirtyChilds(); + +}; + #endif // LL_LLPREFERENCEFLOATER_H diff --git a/indra/newview/skins/default/xui/en/floater_preferences.xml b/indra/newview/skins/default/xui/en/floater_preferences.xml index 15655a920e..05deca705a 100644 --- a/indra/newview/skins/default/xui/en/floater_preferences.xml +++ b/indra/newview/skins/default/xui/en/floater_preferences.xml @@ -56,7 +56,7 @@ help_topic="preferences_general_tab" name="general" /> Date: Thu, 4 Feb 2010 15:44:45 +0200 Subject: Fixed low bug EXT-4951 - Redundant edit box context menu in list items in Panel Picks/Classifieds --HG-- branch : product-engine --- indra/llui/lltexteditor.cpp | 5 ++++- indra/newview/skins/default/xui/en/panel_pick_list_item.xml | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 62aeb50011..3fdb48b3ca 100644 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -720,7 +720,10 @@ BOOL LLTextEditor::handleRightMouseDown(S32 x, S32 y, MASK mask) } if (!LLTextBase::handleRightMouseDown(x, y, mask)) { - showContextMenu(x, y); + if(getMouseOpaque()) + { + showContextMenu(x, y); + } } return TRUE; } diff --git a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml index 023b1fc81d..e62c1278f9 100644 --- a/indra/newview/skins/default/xui/en/panel_pick_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_pick_list_item.xml @@ -64,6 +64,7 @@ layout="topleft" left="103" name="picture_descr" + textbox.mouse_opaque="false" top_pad="0" width="178" word_wrap="true" /> -- cgit v1.2.3 From a7141017afb8b13fe9d4758dfe502cc28966310f Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 4 Feb 2010 16:27:22 +0200 Subject: =?UTF-8?q?fixed=20EXT-4905=20=E2=80=9CDuplicated=20text=20in=20te?= =?UTF-8?q?leport=20notification=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/notifications.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 5d78cfc9ef..d16474873f 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -1532,7 +1532,7 @@ Your search terms were too short so no search was performed. icon="alertmodal.tga" name="CouldNotTeleportReason" type="alertmodal"> -Could not teleport. +Teleport failed. [REASON] -- cgit v1.2.3 From b1891e2982cc03ccd695eae82989d3e58695616c Mon Sep 17 00:00:00 2001 From: Mike Antipov Date: Thu, 4 Feb 2010 16:43:59 +0200 Subject: Fixed normal bug EXT-4925 (Please make user voice settings compatible with 1.23) - for now volume level is stored in external (vivox) format [0.0 - 1.0] - this fix should be included into the Beta 2 release --HG-- branch : product-engine --- indra/newview/llvoiceclient.cpp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/indra/newview/llvoiceclient.cpp b/indra/newview/llvoiceclient.cpp index b6e7e73b9d..f3bfc2e86c 100644 --- a/indra/newview/llvoiceclient.cpp +++ b/indra/newview/llvoiceclient.cpp @@ -1107,16 +1107,17 @@ public: * Sets internal voluem level for specified user. * * @param[in] speaker_id - LLUUID of user to store volume level for - * @param[in] volume - internal volume level to be stored for user. + * @param[in] volume - external (vivox) volume level to be stored for user. */ - void storeSpeakerVolume(const LLUUID& speaker_id, S32 volume); + void storeSpeakerVolume(const LLUUID& speaker_id, F32 volume); /** - * Gets stored internal volume level for specified speaker. + * Gets stored external (vivox) volume level for specified speaker and + * transforms it into internal (viewer) level. * * If specified user is not found default level will be returned. It is equivalent of * external level 0.5 from the 0.0..1.0 range. - * Default internal level is calculated as: internal = 400 * external^2 + * Internal level is calculated as: internal = 400 * external^2 * Maps 0.0 to 1.0 to internal values 0-400 with default 0.5 == 100 * * @param[in] speaker_id - LLUUID of user to get his volume level @@ -1133,7 +1134,7 @@ private: void load(); void save(); - typedef std::map speaker_data_map_t; + typedef std::map speaker_data_map_t; speaker_data_map_t mSpeakersData; }; @@ -1149,7 +1150,7 @@ LLSpeakerVolumeStorage::~LLSpeakerVolumeStorage() save(); } -void LLSpeakerVolumeStorage::storeSpeakerVolume(const LLUUID& speaker_id, S32 volume) +void LLSpeakerVolumeStorage::storeSpeakerVolume(const LLUUID& speaker_id, F32 volume) { mSpeakersData[speaker_id] = volume; } @@ -1163,7 +1164,10 @@ S32 LLSpeakerVolumeStorage::getSpeakerVolume(const LLUUID& speaker_id) if (it != mSpeakersData.end()) { - ret_val = it->second; + F32 f_val = it->second; + // volume can amplify by as much as 4x! + S32 ivol = (S32)(400.f * f_val * f_val); + ret_val = llclamp(ivol, 0, 400); } return ret_val; } @@ -1184,7 +1188,7 @@ void LLSpeakerVolumeStorage::load() for (LLSD::map_const_iterator iter = settings_llsd.beginMap(); iter != settings_llsd.endMap(); ++iter) { - mSpeakersData.insert(std::make_pair(LLUUID(iter->first), (S32)iter->second.asInteger())); + mSpeakersData.insert(std::make_pair(LLUUID(iter->first), (F32)iter->second.asReal())); } } @@ -6288,14 +6292,14 @@ void LLVoiceClient::setUserVolume(const LLUUID& id, F32 volume) participantState *participant = findParticipantByID(id); if (participant) { + // store this volume setting for future sessions + LLSpeakerVolumeStorage::getInstance()->storeSpeakerVolume(id, volume); + // volume can amplify by as much as 4x! S32 ivol = (S32)(400.f * volume * volume); participant->mUserVolume = llclamp(ivol, 0, 400); participant->mVolumeDirty = TRUE; mAudioSession->mVolumeDirty = TRUE; - - // store this volume setting for future sessions - LLSpeakerVolumeStorage::getInstance()->storeSpeakerVolume(id, participant->mUserVolume); } } } -- cgit v1.2.3 From 32aa9d7deee735d86c88f038f8f6fb7199432ff1 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 4 Feb 2010 16:46:34 +0200 Subject: fixed shout/whisper representation for EXT-4777 Implement saving and loading chat history for Nearby Chat (both plain text and widgeted chat) --HG-- branch : product-engine --- indra/newview/llchathistory.cpp | 13 ++++++++++--- indra/newview/llnearbychat.cpp | 9 +-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index 1dc0e8c0a7..f046e08827 100644 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -585,9 +585,16 @@ void LLChatHistory::appendMessage(const LLChat& chat, const LLSD &args, const LL bool irc_me = prefix == "/me " || prefix == "/me'"; // Delimiter after a name in header copy/past and in plain text mode - std::string delimiter = (chat.mChatType != CHAT_TYPE_SHOUT && chat.mChatType != CHAT_TYPE_WHISPER) - ? ": " - : " "; + std::string delimiter = ": "; + std::string shout = LLTrans::getString("shout"); + std::string whisper = LLTrans::getString("whisper"); + if (chat.mChatType == CHAT_TYPE_SHOUT || + chat.mChatType == CHAT_TYPE_WHISPER || + chat.mText.compare(0, shout.length(), shout) == 0 || + chat.mText.compare(0, whisper.length(), whisper) == 0) + { + delimiter = " "; + } // Don't add any delimiter after name in irc styled messages if (irc_me || chat.mChatStyle == CHAT_STYLE_IRC) diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index 6de47fccd2..acb28bd46f 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -203,14 +203,7 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) if (gSavedPerAccountSettings.getBOOL("LogChat")) { - if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } - else - { - LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText); - } + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } } } -- cgit v1.2.3 From 9a15ee8a91a12020b22625873c280837739f946c Mon Sep 17 00:00:00 2001 From: Chuck Linden Date: Thu, 4 Feb 2010 10:00:33 -0500 Subject: Removed aspect ratio controls. http://jira.secondlife.com/browse/EXT-3908 --- .../default/xui/en/panel_preferences_advanced.xml | 57 ---------------------- 1 file changed, 57 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 4d14d46743..05a3771edf 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -266,61 +266,4 @@ Automatic position for: - - Aspect ratio - - - - - - - - - - -- cgit v1.2.3 From e918089f592da2094e6b23a146e0e30b711562dc Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 4 Feb 2010 17:04:27 +0200 Subject: Fixed critical bug (EXT-4827) [NUX] The Places Panel should default to the Landmarks tab with the Library expanded. - Added Library tab set open by default with Landmarks category fetch from Library. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 22 ++++++++++++++-------- indra/newview/llpanellandmarks.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 47feef496a..7c1b0f6234 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -171,8 +171,6 @@ BOOL LLLandmarksPanel::postBuild() initLandmarksInventoryPanel(); initMyInventoryPanel(); initLibraryInventoryPanel(); - getChild("tab_favorites")->setDisplayChildren(true); - getChild("tab_landmarks")->setDisplayChildren(true); return TRUE; } @@ -462,7 +460,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() initLandmarksPanel(mFavoritesInventoryPanel); mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); - initAccordion("tab_favorites", mFavoritesInventoryPanel); + initAccordion("tab_favorites", mFavoritesInventoryPanel, true); } void LLLandmarksPanel::initLandmarksInventoryPanel() @@ -481,7 +479,7 @@ void LLLandmarksPanel::initLandmarksInventoryPanel() // subscribe to have auto-rename functionality while creating New Folder mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2)); - initAccordion("tab_landmarks", mLandmarksInventoryPanel); + initAccordion("tab_landmarks", mLandmarksInventoryPanel, true); } void LLLandmarksPanel::initMyInventoryPanel() @@ -490,7 +488,7 @@ void LLLandmarksPanel::initMyInventoryPanel() initLandmarksPanel(mMyInventoryPanel); - initAccordion("tab_inventory", mMyInventoryPanel); + initAccordion("tab_inventory", mMyInventoryPanel, false); } void LLLandmarksPanel::initLibraryInventoryPanel() @@ -499,7 +497,15 @@ void LLLandmarksPanel::initLibraryInventoryPanel() initLandmarksPanel(mLibraryInventoryPanel); - initAccordion("tab_library", mLibraryInventoryPanel); + // We want to fetch only "Landmarks" category from the library. + const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true); + if (landmarks_cat.notNull()) + { + gInventory.startBackgroundFetch(landmarks_cat); + } + + // Expanding "Library" tab for new users who have no landmarks in "My Inventory". + initAccordion("tab_library", mLibraryInventoryPanel, true); } void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list) @@ -526,14 +532,14 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list inventory_list->saveFolderState(); } -void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list) +void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab) { LLAccordionCtrlTab* accordion_tab = getChild(accordion_tab_name); mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); - accordion_tab->setDisplayChildren(false); + accordion_tab->setDisplayChildren(expand_tab); } void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list) diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 96b790844c..cbbd10ac26 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -110,7 +110,7 @@ private: void initMyInventoryPanel(); void initLibraryInventoryPanel(); void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); - void initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list); + void initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab); void onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list); void deselectOtherThan(const LLPlacesInventoryPanel* inventory_list); -- cgit v1.2.3 From 41c6155f13dbb9ed8bc136bc3350bc8fc87e7f56 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Thu, 4 Feb 2010 17:11:08 +0200 Subject: fix for normal EXT-3807 ABOUT LAND/OBJECTS: (i) icon is badly positioned --HG-- branch : product-engine --- indra/newview/llnamelistctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 8c875c9b63..d579058c32 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -152,6 +152,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) if (avatar_id.notNull()) { // ...valid avatar id + LLScrollListCell* hit_cell = hit_item->getColumn(column_index); if (hit_cell) { @@ -162,8 +163,8 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) localRectToScreen(cell_rect, &sticky_rect); // Spawn at right side of cell - LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop + (sticky_rect.getHeight()-16)/2 ); LLPointer icon = LLUI::getUIImage("Info_Small"); + LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 ); // Should we show a group or an avatar inspector? bool is_group = hit_item->getValue()["is_group"].asBoolean(); -- cgit v1.2.3 From d2d192060993d938a2fd131f8872a60b678e4a04 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 4 Feb 2010 10:20:31 -0500 Subject: For EXT-4855: Crash on onWearableAssetFetch. Prevent late-arriving wearables from touching a deleted object. --- indra/newview/llappearancemgr.cpp | 47 +++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 585d42f66d..0fe236c056 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -321,7 +321,7 @@ public: ~LLWearableHoldingPattern(); bool pollCompletion(); - bool isDone(); + bool isFetchCompleted(); bool isTimedOut(); typedef std::list found_list_t; @@ -330,10 +330,12 @@ public: LLInventoryModel::item_array_t mGestItems; S32 mResolved; LLTimer mWaitTime; + bool mFired; }; LLWearableHoldingPattern::LLWearableHoldingPattern(): - mResolved(0) + mResolved(0), + mFired(false) { } @@ -341,31 +343,34 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern() { } -bool LLWearableHoldingPattern::isDone() +bool LLWearableHoldingPattern::isFetchCompleted() { - if (mResolved >= (S32)mFoundList.size()) - return true; // have everything we were waiting for - else if (isTimedOut()) - { - llwarns << "Exceeded max wait time, updating appearance based on what has arrived" << llendl; - return true; - } - return false; - + return (mResolved >= (S32)mFoundList.size()); // have everything we were waiting for? } bool LLWearableHoldingPattern::isTimedOut() { - static F32 max_wait_time = 15.0; // give up if wearable fetches haven't completed in max_wait_time seconds. + static F32 max_wait_time = 20.0; // give up if wearable fetches haven't completed in max_wait_time seconds. return mWaitTime.getElapsedTimeF32() > max_wait_time; } bool LLWearableHoldingPattern::pollCompletion() { - bool done = isDone(); - llinfos << "polling, done status: " << done << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; + bool completed = isFetchCompleted(); + bool timed_out = isTimedOut(); + bool done = completed || timed_out; + + llinfos << "polling, done status: " << completed << " timed out? " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; + if (done) { + mFired = true; + + if (timed_out) + { + llwarns << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; + } + // Activate all gestures in this folder if (mGestItems.count() > 0) { @@ -397,7 +402,11 @@ bool LLWearableHoldingPattern::pollCompletion() LLAgentWearables::userUpdateAttachments(mObjItems); } - delete this; + if (completed) + { + // Only safe to delete if all wearable callbacks completed. + delete this; + } } return done; } @@ -432,7 +441,11 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) static void onWearableAssetFetch(LLWearable* wearable, void* data) { LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; - + if (holder->mFired) + { + llwarns << "called after holder fired" << llendl; + } + if(wearable) { for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); -- cgit v1.2.3 From f2bb59300a0f17e10857b3fffebe669878f0fe50 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 4 Feb 2010 17:26:44 +0200 Subject: fixed duplicating of log records for EXT-4777 Implement saving and loading chat history for Nearby Chat (both plain text and widgeted chat) --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index acb28bd46f..8fc11d3929 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -200,11 +200,16 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) mMessageArchive.push_back(chat); if(mMessageArchive.size()>200) mMessageArchive.erase(mMessageArchive.begin()); + } - if (gSavedPerAccountSettings.getBOOL("LogChat")) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } + if (args["do_not_log"].asBoolean()) + { + return; + } + + if (gSavedPerAccountSettings.getBOOL("LogChat")) + { + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } } @@ -275,6 +280,9 @@ void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) void LLNearbyChat::loadHistory() { + LLSD do_not_log; + do_not_log["do_not_log"] = true; + std::list history; LLLogChat::loadAllHistory("chat", history); @@ -295,7 +303,7 @@ void LLNearbyChat::loadHistory() chat.mFromID = from_id; chat.mText = msg[IM_TEXT].asString(); chat.mTimeStr = msg[IM_TIME].asString(); - addMessage(chat); + addMessage(chat, true, do_not_log); it++; } -- cgit v1.2.3 From c99fb12b3d300705dbf6eb68b1a3f22927d4d221 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 4 Feb 2010 17:25:30 +0200 Subject: Update for low bug EXT-4951 - Redundant edit box context menu in list items in Panel Picks/Classifieds Disabled edit box context menu in classified list items. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml index b881719e3a..0c1418fc2d 100644 --- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -64,6 +64,7 @@ layout="topleft" left="103" name="description" + textbox.mouse_opaque="false" top_pad="0" width="178" word_wrap="true" /> -- cgit v1.2.3 From 78200e2c1c1bc2e53f694b2ae086f486a7f0095c Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 4 Feb 2010 19:10:24 +0200 Subject: =?UTF-8?q?fixed=20EXT-4893=20=E2=80=9C'Add=20friend'=20available?= =?UTF-8?q?=20for=20friends=20in=20group/conference=20sessions=E2=80=9D,?= =?UTF-8?q?=20corrected=20condition=20for=20enable=20'add=20friend'=20menu?= =?UTF-8?q?=20item;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index ad47e351ee..1c4004c37a 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -584,7 +584,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& { std::string item = userdata.asString(); if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item - || "can_pay" == item || "can_add" == item) + || "can_pay" == item) { return mUUIDs.front() != gAgentID; } @@ -619,7 +619,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& for (;id != uuids_end; ++id) { - if ( LLAvatarActions::isFriend(*id) ) + if ( *id == gAgentID || LLAvatarActions::isFriend(*id) ) { result = false; break; -- cgit v1.2.3 From 3fa2acc0df76b3dd81e295a28bfb463f863a9e49 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 4 Feb 2010 19:21:12 +0200 Subject: Fixed bug EXT-4806 (Snapshot floater has preview offset). Removed incorrect vertical offset modification in compact mode. --HG-- branch : product-engine --- indra/newview/llfloatersnapshot.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index b6e9fb3f6c..a0031f0193 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2084,10 +2084,6 @@ void LLFloaterSnapshot::draw() S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ; S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ; - if (! gSavedSettings.getBOOL("AdvanceSnapshot")) - { - offset_y += getUIWinHeightShort() - getUIWinHeightLong(); - } glMatrixMode(GL_MODELVIEW); gl_draw_scaled_image(offset_x, offset_y, -- cgit v1.2.3 From 1bc67a9d725b88a0ebdde77cef928abd33fa9cf6 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 4 Feb 2010 10:25:31 -0800 Subject: EXT-4625 - Chat bar doesn't display trailing character on some strings reviewed by Leyla --- indra/llrender/llfontgl.cpp | 24 ++++++++++++++++++++---- indra/llui/lllineeditor.cpp | 6 +++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 1de1d6ded4..b6a6b448ee 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -601,14 +601,20 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ { llwchar wch = wchars[i]; - F32 char_width = mFontFreetype->getXAdvance(wch); + const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); + + // last character uses character width, since the whole character needs to be visible + // other characters just use advance + F32 width = (i == start) + ? (F32)(fgi->mWidth + fgi->mXBearing) // use actual width for last character + : fgi->mXAdvance; // use advance for all other characters - if( scaled_max_pixels < (total_width + char_width) ) + if( scaled_max_pixels < (total_width + width) ) { break; } - total_width += char_width; + total_width += width; drawable_chars++; if( max_chars >= 0 && drawable_chars >= max_chars ) @@ -626,7 +632,17 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ total_width = llround(total_width); } - return start_pos - drawable_chars; + if (drawable_chars == 0) + { + return start_pos; // just draw last character + } + else + { + // if only 1 character is drawable, we want to return start_pos as the first character to draw + // if 2 are drawable, return start_pos and character before start_pos, etc. + return start_pos + 1 - drawable_chars; + } + } S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 target_x, F32 max_pixels, S32 max_chars, BOOL round) const diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index cb5aea272d..2cdcd3345e 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -422,12 +422,16 @@ void LLLineEditor::setCursor( S32 pos ) S32 old_cursor_pos = getCursor(); mCursorPos = llclamp( pos, 0, mText.length()); + // position of end of next character after cursor S32 pixels_after_scroll = findPixelNearestPos(); if( pixels_after_scroll > mTextRightEdge ) { S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos); S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left))); - S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), getCursor()); + // character immediately to left of cursor should be last one visible (SCROLL_INCREMENT_ADD will scroll in more characters) + // or first character if cursor is at beginning + S32 new_last_visible_char = llmax(0, getCursor() - 1); + S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), new_last_visible_char); if (old_cursor_pos == last_visible_char) { mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); -- cgit v1.2.3