From 18e8d57b210fd5a7ca1bb8fc114a3e4faf8bf537 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 11 Jul 2011 17:45:29 -0700 Subject: EXP-995 FIX -- New icon scrolls into Received Items panel heading EXP-903 FIX -- Newness/Freshness number does not decrease as items are opened in Inbox * Brought back freshness with the freshness * New badge and label color from Gibson * Inventory Panel now allows display of badges with proper clipping Reviewed by Richard. --- indra/llui/CMakeLists.txt | 2 + indra/llui/llbadge.cpp | 24 ++++++++- indra/llui/llbadge.h | 10 +++- indra/llui/llbadgeholder.cpp | 45 +++++++++++++++++ indra/llui/llbadgeholder.h | 56 +++++++++++++++++++++ indra/llui/llbadgeowner.cpp | 25 +++++---- indra/llui/llbadgeowner.h | 2 +- indra/llui/llpanel.cpp | 6 +-- indra/llui/llpanel.h | 6 +-- indra/newview/llinventorypanel.cpp | 12 +++++ indra/newview/llinventorypanel.h | 3 ++ indra/newview/llpanelmarketplaceinbox.cpp | 9 ++-- indra/newview/llpanelmarketplaceinboxinventory.cpp | 20 ++++++-- indra/newview/llpanelmarketplaceinboxinventory.h | 4 ++ indra/newview/skins/default/colors.xml | 2 +- .../textures/widgets/Badge_Background_New.png | Bin 0 -> 1369 bytes .../newview/skins/default/xui/en/widgets/badge.xml | 3 ++ .../xui/en/widgets/inbox_folder_view_folder.xml | 11 +++- 18 files changed, 208 insertions(+), 32 deletions(-) create mode 100644 indra/llui/llbadgeholder.cpp create mode 100644 indra/llui/llbadgeholder.h create mode 100644 indra/newview/skins/default/textures/widgets/Badge_Background_New.png diff --git a/indra/llui/CMakeLists.txt b/indra/llui/CMakeLists.txt index 0bbdcfd6ff..673494820f 100644 --- a/indra/llui/CMakeLists.txt +++ b/indra/llui/CMakeLists.txt @@ -29,6 +29,7 @@ set(llui_SOURCE_FILES llaccordionctrl.cpp llaccordionctrltab.cpp llbadge.cpp + llbadgeholder.cpp llbadgeowner.cpp llbutton.cpp llcheckboxctrl.cpp @@ -123,6 +124,7 @@ set(llui_HEADER_FILES llaccordionctrl.h llaccordionctrltab.h llbadge.h + llbadgeholder.h llbadgeowner.h llbutton.h llcallbackmap.h diff --git a/indra/llui/llbadge.cpp b/indra/llui/llbadge.cpp index c28a947a7f..fde3c53a65 100644 --- a/indra/llui/llbadge.cpp +++ b/indra/llui/llbadge.cpp @@ -43,6 +43,8 @@ LLBadge::Params::Params() , image_color("image_color") , label("label") , label_color("label_color") + , label_offset_horiz("label_offset_horiz") + , label_offset_vert("label_offset_vert") , location("location", LLRelPos::TOP_LEFT) , location_percent_hcenter("location_percent_hcenter") , location_percent_vcenter("location_percent_vcenter") @@ -65,6 +67,8 @@ bool LLBadge::Params::equals(const Params& a) const comp &= (image_color() == a.image_color()); comp &= (label() == a.label()); comp &= (label_color() == a.label_color()); + comp &= (label_offset_horiz() == a.label_offset_horiz()); + comp &= (label_offset_vert() == a.label_offset_vert()); comp &= (location() == a.location()); comp &= (location_percent_hcenter() == a.location_percent_hcenter()); comp &= (location_percent_vcenter() == a.location_percent_vcenter()); @@ -84,6 +88,8 @@ LLBadge::LLBadge(const LLBadge::Params& p) , mImageColor(p.image_color) , mLabel(p.label) , mLabelColor(p.label_color) + , mLabelOffsetHoriz(p.label_offset_horiz) + , mLabelOffsetVert(p.label_offset_vert) , mLocation(p.location) , mLocationPercentHCenter(0.5f) , mLocationPercentVCenter(0.5f) @@ -131,6 +137,18 @@ LLBadge::~LLBadge() { } +bool LLBadge::addToView(LLView * view) +{ + bool child_added = view->addChild(this); + + if (child_added) + { + setShape(view->getLocalRect()); + } + + return child_added; +} + void LLBadge::setLabel(const LLStringExplicit& label) { mLabel = label; @@ -241,8 +259,10 @@ void LLBadge::draw() // Draw the label // - mGLFont->render(badge_label_wstring, badge_label_begin_offset, - badge_center_x, badge_center_y, + mGLFont->render(badge_label_wstring, + badge_label_begin_offset, + badge_center_x + mLabelOffsetHoriz, + badge_center_y + mLabelOffsetVert, mLabelColor % alpha, LLFontGL::HCENTER, LLFontGL::VCENTER, // centered around the position LLFontGL::NORMAL, // normal text (not bold, italics, etc.) diff --git a/indra/llui/llbadge.h b/indra/llui/llbadge.h index 0f923ef01b..f81ccdf0cd 100644 --- a/indra/llui/llbadge.h +++ b/indra/llui/llbadge.h @@ -104,6 +104,9 @@ public: Optional< std::string > label; Optional< LLUIColor > label_color; + Optional< S32 > label_offset_horiz; + Optional< S32 > label_offset_vert; + Optional< LLRelPos::Location > location; Optional< U32 > location_percent_hcenter; Optional< U32 > location_percent_vcenter; @@ -123,7 +126,9 @@ protected: public: ~LLBadge(); - + + bool addToView(LLView * view); + virtual void draw(); const std::string getLabel() const { return wstring_to_utf8str(mLabel); } @@ -141,6 +146,9 @@ private: LLUIString mLabel; LLUIColor mLabelColor; + S32 mLabelOffsetHoriz; + S32 mLabelOffsetVert; + LLRelPos::Location mLocation; F32 mLocationPercentHCenter; F32 mLocationPercentVCenter; diff --git a/indra/llui/llbadgeholder.cpp b/indra/llui/llbadgeholder.cpp new file mode 100644 index 0000000000..1f786f36ae --- /dev/null +++ b/indra/llui/llbadgeholder.cpp @@ -0,0 +1,45 @@ +/** + * @file llbadgeholder.cpp + * @brief Source for badge holders + * + * $LicenseInfo:firstyear=2001&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 "llbadgeholder.h" + +#include "llbadge.h" +#include "llview.h" + + +bool LLBadgeHolder::addBadge(LLBadge * badge) +{ + bool badge_added = false; + + LLView * this_view = dynamic_cast(this); + + if (this_view && mAcceptsBadge) + { + badge_added = badge->addToView(this_view); + } + + return badge_added; +} diff --git a/indra/llui/llbadgeholder.h b/indra/llui/llbadgeholder.h new file mode 100644 index 0000000000..2538eaae91 --- /dev/null +++ b/indra/llui/llbadgeholder.h @@ -0,0 +1,56 @@ +/** + * @file llbadgeholder.h + * @brief Header for badge holders + * + * $LicenseInfo:firstyear=2001&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_LLBADGEHOLDER_H +#define LL_LLBADGEHOLDER_H + +// +// Classes +// + +class LLBadge; + +class LLBadgeHolder +{ +public: + + LLBadgeHolder(bool acceptsBadge) + : mAcceptsBadge(acceptsBadge) + { + } + + void setAcceptsBadge(bool acceptsBadge) { mAcceptsBadge = acceptsBadge; } + bool acceptsBadge() const { return mAcceptsBadge; } + + virtual bool addBadge(LLBadge * badge); + +private: + + bool mAcceptsBadge; + +}; + +#endif // LL_LLBADGEHOLDER_H diff --git a/indra/llui/llbadgeowner.cpp b/indra/llui/llbadgeowner.cpp index 77f15567bf..1860a05edd 100644 --- a/indra/llui/llbadgeowner.cpp +++ b/indra/llui/llbadgeowner.cpp @@ -26,6 +26,7 @@ #include "linden_common.h" +#include "llbadgeholder.h" #include "llbadgeowner.h" #include "llpanel.h" @@ -81,40 +82,44 @@ void LLBadgeOwner::setBadgeVisibility(bool visible) } } -void LLBadgeOwner::addBadgeToParentPanel() +bool LLBadgeOwner::addBadgeToParentPanel() { + bool badge_added = false; + LLView * owner_view = mBadgeOwnerView.get(); if (mBadge && owner_view) { - // Badge parent is badge owner by default - LLView * badge_parent = owner_view; + LLBadgeHolder * badge_holder = NULL; - // Find the appropriate parent for the badge + // Find the appropriate holder for the badge LLView * parent = owner_view->getParent(); while (parent) { - LLPanel * parent_panel = dynamic_cast(parent); + LLBadgeHolder * badge_holder_panel = dynamic_cast(parent); - if (parent_panel && parent_panel->acceptsBadge()) + if (badge_holder_panel && badge_holder_panel->acceptsBadge()) { - badge_parent = parent; + badge_holder = badge_holder_panel; break; } parent = parent->getParent(); } - if (badge_parent) + if (badge_holder) { - badge_parent->addChild(mBadge); + badge_added = badge_holder->addBadge(mBadge); } else { - llwarns << "Unable to find parent panel for badge " << mBadge->getName() << " on " << owner_view->getName() << llendl; + // Badge parent is fallback badge owner if no valid holder exists in the hierarchy + badge_added = mBadge->addToView(owner_view); } } + + return badge_added; } LLBadge* LLBadgeOwner::createBadge(const LLBadge::Params& p) diff --git a/indra/llui/llbadgeowner.h b/indra/llui/llbadgeowner.h index a2399189a5..8d03e30645 100644 --- a/indra/llui/llbadgeowner.h +++ b/indra/llui/llbadgeowner.h @@ -41,7 +41,7 @@ public: LLBadgeOwner(LLHandle< LLView > viewHandle); void initBadgeParams(const LLBadge::Params& p); - void addBadgeToParentPanel(); + bool addBadgeToParentPanel(); bool badgeHasParent() const { return (mBadge && mBadge->getParent()); } diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index 1dcdd79efa..775db6bc9d 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -99,6 +99,7 @@ LLPanel::Params::Params() LLPanel::LLPanel(const LLPanel::Params& p) : LLUICtrl(p), + LLBadgeHolder(p.accepts_badge), mBgVisible(p.background_visible), mBgOpaque(p.background_opaque), mBgOpaqueColor(p.bg_opaque_color()), @@ -114,8 +115,7 @@ LLPanel::LLPanel(const LLPanel::Params& p) mCommitCallbackRegistrar(false), mEnableCallbackRegistrar(false), mXMLFilename(p.filename), - mVisibleSignal(NULL), - mAcceptsBadge(p.accepts_badge) + mVisibleSignal(NULL) // *NOTE: Be sure to also change LLPanel::initFromParams(). We have too // many classes derived from LLPanel to retrofit them all to pass in params. { @@ -488,7 +488,7 @@ void LLPanel::initFromParams(const LLPanel::Params& p) mBgOpaqueImageOverlay = p.bg_opaque_image_overlay; mBgAlphaImageOverlay = p.bg_alpha_image_overlay; - mAcceptsBadge = p.accepts_badge; + setAcceptsBadge(p.accepts_badge); } static LLFastTimer::DeclareTimer FTM_PANEL_SETUP("Panel Setup"); diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 67674fab7e..1b777ee1cb 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -35,6 +35,7 @@ #include "lluiimage.h" #include "lluistring.h" #include "v4color.h" +#include "llbadgeholder.h" #include #include @@ -51,7 +52,7 @@ class LLUIImage; * With or without border, * Can contain LLUICtrls. */ -class LLPanel : public LLUICtrl +class LLPanel : public LLUICtrl, public LLBadgeHolder { public: struct LocalizedString : public LLInitParam::Block @@ -252,8 +253,6 @@ public: boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb ); - bool acceptsBadge() const { return mAcceptsBadge; } - protected: // Override to set not found list LLButton* getDefaultButton() { return mDefaultBtn; } @@ -268,7 +267,6 @@ protected: static factory_stack_t sFactoryStack; private: - bool mAcceptsBadge; BOOL mBgVisible; // any background at all? BOOL mBgOpaque; // use opaque color or image LLUIColor mBgOpaqueColor; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 702e8d5a1f..d5d40ca65d 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -902,6 +902,18 @@ void LLInventoryPanel::onFocusReceived() LLPanel::onFocusReceived(); } +bool LLInventoryPanel::addBadge(LLBadge * badge) +{ + bool badge_added = false; + + if (acceptsBadge()) + { + badge_added = badge->addToView(mFolderRoot); + } + + return badge_added; +} + void LLInventoryPanel::openAllFolders() { mFolderRoot->setOpenArrangeRecursively(TRUE, LLFolderViewFolder::RECURSE_DOWN); diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index a4287a438e..7676bbb6d7 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -125,6 +125,9 @@ public: /*virtual*/ void onFocusLost(); /*virtual*/ void onFocusReceived(); + // LLBadgeHolder methods + bool addBadge(LLBadge * badge); + // Call this method to set the selection. void openAllFolders(); void setSelection(const LLUUID& obj_id, BOOL take_keyboard_focus); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 28025f58d4..3accc43ab6 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -27,6 +27,7 @@ #include "llviewerprecompiledheaders.h" #include "llpanelmarketplaceinbox.h" +#include "llpanelmarketplaceinboxinventory.h" #include "llappviewer.h" #include "llbutton.h" @@ -36,7 +37,7 @@ #include "llviewercontrol.h" -#define SUPPORTING_FRESH_ITEM_COUNT 0 +#define SUPPORTING_FRESH_ITEM_COUNT 1 static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); @@ -159,10 +160,10 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const for (; folders_it != folders_end; ++folders_it) { - const LLFolderViewFolder * folder = *folders_it; + const LLFolderViewFolder * folder_view = *folders_it; + const LLInboxFolderViewFolder * inbox_folder_view = dynamic_cast(folder_view); - // TODO: Replace this check with new "fresh" flag - if (folder->getCreationDate() > 1500) + if (inbox_folder_view && inbox_folder_view->isFresh()) { fresh_item_count++; } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 5dff73ee6a..8542ea2ae4 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -141,7 +141,7 @@ LLFolderViewFolder * LLInboxInventoryPanel::createFolderViewFolder(LLInvFVBridge LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) : LLFolderViewFolder(p) , LLBadgeOwner(getHandle()) - , mFresh(false) + , mFresh(true) { initBadgeParams(p.new_badge()); } @@ -150,6 +150,19 @@ LLInboxFolderViewFolder::~LLInboxFolderViewFolder() { } +// virtual +time_t LLInboxFolderViewFolder::getCreationDate() const +{ + time_t ret_val = LLFolderViewFolder::getCreationDate(); + + if (!mCreationDate) + { + updateFlag(); + } + + return ret_val; +} + // virtual void LLInboxFolderViewFolder::draw() { @@ -166,10 +179,7 @@ void LLInboxFolderViewFolder::draw() void LLInboxFolderViewFolder::updateFlag() const { LLDate saved_freshness_date = LLDate(gSavedSettings.getString("InboxFreshnessDate")); - if (getCreationDate() > saved_freshness_date.secondsSinceEpoch()) - { - mFresh = true; - } + mFresh = (mCreationDate > saved_freshness_date.secondsSinceEpoch()); } void LLInboxFolderViewFolder::selectItem() diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 7b124fdccc..899e459896 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -66,12 +66,16 @@ public: LLInboxFolderViewFolder(const Params& p); ~LLInboxFolderViewFolder(); + + time_t getCreationDate() const; void draw(); void updateFlag() const; void selectItem(); void toggleOpen(); + + bool isFresh() const { return mFresh; } protected: void setCreationDate(time_t creation_date_utc) const; diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index 76965ad14b..31b6fc77f5 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -134,7 +134,7 @@ reference="AvatarListItemIconOfflineColor" /> + value="1.0 0.40 0.0 1.0" /> diff --git a/indra/newview/skins/default/textures/widgets/Badge_Background_New.png b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png new file mode 100644 index 0000000000..9f114f2e4a Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge_Background_New.png differ diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml index f77c4b7178..2d4c02b092 100644 --- a/indra/newview/skins/default/xui/en/widgets/badge.xml +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -7,11 +7,14 @@ image="Badge_Background" image_color="BadgeImageColor" label_color="BadgeLabelColor" + label_offset_horiz="0" + label_offset_vert="0" location="top_left" location_percent_hcenter="85" location_percent_vcenter="85" padding_horiz="7" padding_vert="4" requests_front="true" + mouse_opaque="false" > diff --git a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml index c34aec1bf0..95f5cf2ecd 100644 --- a/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml +++ b/indra/newview/skins/default/xui/en/widgets/inbox_folder_view_folder.xml @@ -6,5 +6,14 @@ item_top_pad="4" selection_image="Rounded_Square" > - + -- cgit v1.2.3 From babeae140225c6ce39a42bae09e38285b63744bf Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 12 Jul 2011 15:12:54 -0700 Subject: EXP-941 FIX Text and URL change to the Age Verification dialog --- indra/newview/skins/default/xui/en/notifications.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 4ef64269e8..3ff2d1e657 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4991,19 +4991,19 @@ Would you like to automatically wear the clothing you are about to create? name="NotAgeVerified" type="alertmodal"> fail -You must be age-verified to visit this area. Do you want to go to the [SECOND_LIFE] website and verify your age? + To access adult content and areas in Second Life you must be at least 18 years old. Please visit our age verification page to confirm you are over 18. +Note this will launch your web browser. -[_URL] + [_URL] confirm - https://secondlife.com/account/verification.php + notext="Cancel" + yestext="Go to Age Verification"/> Date: Tue, 12 Jul 2011 15:23:46 -0700 Subject: EXP-941 FIX Text and URL change to the Age Verification dialog fixed some formatting --- indra/newview/skins/default/xui/en/notifications.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 3ff2d1e657..d790908659 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4991,10 +4991,10 @@ Would you like to automatically wear the clothing you are about to create? name="NotAgeVerified" type="alertmodal"> fail - To access adult content and areas in Second Life you must be at least 18 years old. Please visit our age verification page to confirm you are over 18. +To access adult content and areas in Second Life you must be at least 18 years old. Please visit our age verification page to confirm you are over 18. Note this will launch your web browser. - [_URL] +[_URL] confirm https://secondlife.com/account/verification.php -- cgit v1.2.3 From fa3f4d11665af44234f8e0ae3e8d8c0ce31d356d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 12 Jul 2011 20:58:30 -0700 Subject: EXP-880 FIX Enable navigation chrome for Search floater search floater derives from floater_web_content all web content now uses floater_web_content instead of media_browser --- indra/llui/llfloater.h | 2 +- indra/llui/llsdparam.h | 8 ++ indra/newview/llavataractions.cpp | 6 +- indra/newview/llfloatersearch.cpp | 60 +++++------ indra/newview/llfloatersearch.h | 19 ++-- indra/newview/llfloaterwebcontent.cpp | 110 ++++++++++++--------- indra/newview/llfloaterwebcontent.h | 23 ++++- indra/newview/llnavigationbar.cpp | 2 +- indra/newview/llviewerfloaterreg.cpp | 2 +- indra/newview/llweb.cpp | 31 +++--- indra/newview/llworldmapview.cpp | 4 +- .../skins/default/xui/en/floater_search.xml | 71 ------------- 12 files changed, 154 insertions(+), 184 deletions(-) delete mode 100644 indra/newview/skins/default/xui/en/floater_search.xml diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 5b7b020881..9aae1afc62 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -253,7 +253,7 @@ public: LLHandle getHandle() const { return mHandle; } const LLSD& getKey() { return mKey; } - BOOL matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } + virtual bool matchesKey(const LLSD& key) { return mSingleInstance || KeyCompare::equate(key, mKey); } const std::string& getInstanceName() { return mInstanceName; } diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 69dab2b411..827b8c8584 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -93,6 +93,14 @@ class LLSDParamAdapter : public T LLParamSDParser parser; parser.readSD(sd, *this); } + + operator LLSD() const + { + LLParamSDParser parser; + LLSD sd; + parser.writeSD(sd, *this); + return sd; + } LLSDParamAdapter(const T& val) { diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index 8344b08bfb..48827676cd 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -316,7 +316,11 @@ static void on_avatar_name_show_profile(const LLUUID& agent_id, const LLAvatarNa // PROFILES: open in webkit window const bool show_chrome = false; static LLCachedControl profile_rect(gSavedSettings, "WebProfileRect"); - LLFloaterWebContent::create(url, "", agent_id.asString(), show_chrome, profile_rect); + LLFloaterWebContent::create(LLFloaterWebContent::Params(). + url(url). + id(agent_id). + show_chrome(show_chrome). + preferred_media_size(profile_rect)); } // static diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index d5806e375c..e9710c41a1 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -70,21 +70,25 @@ public: } // create the LLSD arguments for the search floater - LLSD args; - args["category"] = category; - args["id"] = LLURI::unescape(search_text); + LLFloaterSearch::Params p; + p.category = category; + p.query = LLURI::unescape(search_text); // open the search floater and perform the requested search - LLFloaterReg::showInstance("search", args); + LLFloaterReg::showInstance("search", p); return true; } }; LLSearchHandler gSearchHandler; +LLFloaterSearch::_Params::_Params() +: category("category", ""), + query("query") +{} + + LLFloaterSearch::LLFloaterSearch(const LLSD& key) : - LLFloater(key), - LLViewerMediaObserver(), - mBrowser(NULL), + LLFloaterWebContent(key), mSearchGodLevel(0) { // declare a map that transforms a category name into @@ -102,53 +106,43 @@ LLFloaterSearch::LLFloaterSearch(const LLSD& key) : BOOL LLFloaterSearch::postBuild() { - mBrowser = getChild("browser"); - mBrowser->addObserver(this); + LLFloaterWebContent::postBuild(); + mWebBrowser->addObserver(this); return TRUE; } void LLFloaterSearch::onOpen(const LLSD& key) { + LLFloaterWebContent::onOpen(key); search(key); } void LLFloaterSearch::onClose(bool app_quitting) { + LLFloaterWebContent::onClose(app_quitting); // tear down the web view so we don't show the previous search // result when the floater is opened next time destroy(); } -void LLFloaterSearch::handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event) -{ - switch (event) - { - case MEDIA_EVENT_NAVIGATE_BEGIN: - getChild("status_text")->setValue(getString("loading_text")); - break; - - case MEDIA_EVENT_NAVIGATE_COMPLETE: - getChild("status_text")->setValue(getString("done_text")); - break; - - default: - break; - } -} - void LLFloaterSearch::godLevelChanged(U8 godlevel) { // search results can change based upon god level - if the user // changes god level, then give them a warning (we don't refresh // the search as this might undo any page navigation or // AJAX-driven changes since the last search). - getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); + + //FIXME: set status bar text + + //getChildView("refresh_search")->setVisible( (godlevel != mSearchGodLevel)); } void LLFloaterSearch::search(const LLSD &key) { - if (! mBrowser) + Params p(key); + + if (! mWebBrowser || !p.validateBlock()) { return; } @@ -159,10 +153,9 @@ void LLFloaterSearch::search(const LLSD &key) // work out the subdir to use based on the requested category LLSD subs; - std::string category = key.has("category") ? key["category"].asString() : ""; - if (mCategoryPaths.has(category)) + if (mCategoryPaths.has(p.category)) { - subs["CATEGORY"] = mCategoryPaths[category].asString(); + subs["CATEGORY"] = mCategoryPaths[p.category].asString(); } else { @@ -170,8 +163,7 @@ void LLFloaterSearch::search(const LLSD &key) } // add the search query string - std::string search_text = key.has("id") ? key["id"].asString() : ""; - subs["QUERY"] = LLURI::escape(search_text); + subs["QUERY"] = LLURI::escape(p.query); // add the permissions token that login.cgi gave us // We use "search_token", and fallback to "auth_token" if not present. @@ -207,5 +199,5 @@ void LLFloaterSearch::search(const LLSD &key) url = LLWeb::expandURLSubstitutions(url, subs); // and load the URL in the web view - mBrowser->navigateTo(url, "text/html"); + mWebBrowser->navigateTo(url, "text/html"); } diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index ba4dc4c0fa..2c59fa6d5d 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -28,7 +28,7 @@ #ifndef LL_LLFLOATERSEARCH_H #define LL_LLFLOATERSEARCH_H -#include "llfloater.h" +#include "llfloaterwebcontent.h" #include "llviewermediaobserver.h" #include @@ -43,10 +43,19 @@ class LLMediaCtrl; /// so that the user can click on teleport links in search results. /// class LLFloaterSearch : - public LLFloater, - public LLViewerMediaObserver + public LLFloaterWebContent { public: + struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::_Params> + { + Optional category; + Optional query; + + _Params(); + }; + + typedef LLSDParamAdapter<_Params> Params; + LLFloaterSearch(const LLSD& key); /// show the search floater with a new search @@ -70,10 +79,6 @@ public: private: /*virtual*/ BOOL postBuild(); - // inherited from LLViewerMediaObserver - /*virtual*/ void handleMediaEvent(LLPluginClassMedia *self, EMediaEvent event); - - LLMediaCtrl *mBrowser; LLSD mCategoryPaths; U8 mSearchGodLevel; }; diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 43eecbf048..4cc29267da 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -40,8 +40,16 @@ #include "llfloaterwebcontent.h" +LLFloaterWebContent::_Params::_Params() +: url("url"), + target("target"), + id("id"), + show_chrome("show_chrome", true), + preferred_media_size("preferred_media_size") +{} + LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) - : LLFloater( key ) +: LLFloater( key ) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); mCommitCallbackRegistrar.add( "WebContent.Forward", boost::bind( &LLFloaterWebContent::onClickForward, this )); @@ -75,6 +83,12 @@ BOOL LLFloaterWebContent::postBuild() return TRUE; } +bool LLFloaterWebContent::matchesKey(const LLSD& key) +{ + return key["target"].asString() == mKey["target"].asString(); +} + + void LLFloaterWebContent::initializeURLHistory() { // start with an empty list @@ -99,30 +113,23 @@ void LLFloaterWebContent::initializeURLHistory() } //static -void LLFloaterWebContent::create( const std::string &url, const std::string& target, const std::string& uuid, bool show_chrome, const LLRect& preferred_media_size) +void LLFloaterWebContent::create( Params p) { - lldebugs << "url = " << url << ", target = " << target << ", uuid = " << uuid << llendl; + lldebugs << "url = " << p.url() << ", target = " << p.target() << ", uuid = " << p.id().asString() << llendl; - std::string tag = target; + if (!p.id.isProvided()) + { + p.id = LLUUID::generateNewID(); + } - if(target.empty() || target == "_blank") + if(!p.target.isProvided() || p.target() == "_blank") { - if(!uuid.empty()) - { - tag = uuid; - } - else - { - // create a unique tag for this instance - LLUUID id; - id.generate(); - tag = id.asString(); - } + p.target = p.id().asString(); } S32 browser_window_limit = gSavedSettings.getS32("WebContentWindowLimit"); - if(LLFloaterReg::findInstance("web_content", tag) != NULL) + if(LLFloaterReg::findInstance("web_content", p.target()) != NULL) { // There's already a web browser for this tag, so we won't be opening a new window. } @@ -136,7 +143,7 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar for(LLFloaterReg::const_instance_list_t::const_iterator iter = instances.begin(); iter != instances.end(); iter++) { - lldebugs << " " << (*iter)->getKey() << llendl; + lldebugs << " " << (*iter)->getKey()["target"] << llendl; } if(instances.size() >= (size_t)browser_window_limit) @@ -146,30 +153,7 @@ void LLFloaterWebContent::create( const std::string &url, const std::string& tar } } - 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); - - browser->getChild("status_bar")->setVisible(show_chrome); - browser->getChild("nav_controls")->setVisible(show_chrome); - - if (!show_chrome) - { - browser->setResizeLimits(100, 100); - } - - if (!preferred_media_size.isEmpty()) - { - //ignore x, y for now - browser->geometryChanged(browser->getRect().mLeft, browser->getRect().mBottom, preferred_media_size.getWidth(), preferred_media_size.getHeight()); - } - } + LLFloaterReg::showInstance("web_content", p); } //static @@ -227,13 +211,45 @@ void LLFloaterWebContent::geometryChanged(S32 x, S32 y, S32 width, S32 height) setShape(geom); } -void LLFloaterWebContent::open_media(const std::string& web_url, const std::string& target) +void LLFloaterWebContent::open_media(const Params& p) { // 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, "text/html"); - set_current_url(web_url); + LLViewerMedia::proxyWindowOpened(p.target(), p.id().asString()); + mWebBrowser->setHomePageUrl(p.url, "text/html"); + mWebBrowser->setTarget(p.target); + mWebBrowser->navigateTo(p.url, "text/html"); + set_current_url(p.url); + + getChild("status_bar")->setVisible(p.show_chrome); + getChild("nav_controls")->setVisible(p.show_chrome); + + if (!p.show_chrome) + { + setResizeLimits(100, 100); + } + + if (!p.preferred_media_size().isEmpty()) + { + //ignore x, y for now + geometryChanged(getRect().mLeft, getRect().mBottom, p.preferred_media_size().getWidth(), p.preferred_media_size().getHeight()); + } + +} + +void LLFloaterWebContent::onOpen(const LLSD& key) +{ + Params params(key); + + if (!params.validateBlock()) + { + closeFloater(); + return; + } + + mUUID = params.id().asString(); + + // tell the browser instance to load the specified URL + open_media(params); } //virtual diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 56b6ef12c8..2cb6bd0831 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -29,6 +29,7 @@ #include "llfloater.h" #include "llmediactrl.h" +#include "llsdparam.h" class LLMediaCtrl; class LLComboBox; @@ -42,20 +43,37 @@ class LLFloaterWebContent : { public: LOG_CLASS(LLFloaterWebContent); + + struct _Params : public LLInitParam::Block<_Params> + { + Optional url, + target; + Optional id; + Optional show_chrome; + Optional preferred_media_size; + + _Params(); + }; + + typedef LLSDParamAdapter<_Params> Params; + LLFloaterWebContent(const LLSD& key); void initializeURLHistory(); - static void create(const std::string &url, const std::string& target, const std::string& uuid = LLStringUtil::null, bool show_chrome = true, const LLRect& preferred_media_size = LLRect() ); + static void create(Params); 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 onOpen(const LLSD& key); + /* virtual */ bool matchesKey(const LLSD& key); /* virtual */ void onClose(bool app_quitting); /* virtual */ void draw(); +protected: // inherited from LLViewerMediaObserver /*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event); @@ -66,8 +84,7 @@ public: void onEnterAddress(); void onPopExternal(); -private: - void open_media(const std::string& media_url, const std::string& target); + void open_media(const Params& ); void set_current_url(const std::string& url); LLMediaCtrl* mWebBrowser; diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index b8832dfd8e..9d54ad7463 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -716,7 +716,7 @@ void LLNavigationBar::handleLoginComplete() void LLNavigationBar::invokeSearch(std::string search_text) { - LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("id", LLSD(search_text))); + LLFloaterReg::showInstance("search", LLSD().with("category", "all").with("query", LLSD(search_text))); } void LLNavigationBar::clearHistoryCache() diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 6ae8e79be4..0e58f54f8b 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -274,7 +274,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("start_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("stop_queue", "floater_script_queue.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("snapshot", "floater_snapshot.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); - LLFloaterReg::add("search", "floater_search.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); + LLFloaterReg::add("search", "floater_web_content.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterUIPreviewUtil::registerFloater(); LLFloaterReg::add("upload_anim", "floater_animation_preview.xml", (LLFloaterBuildFunc)&LLFloaterReg::build, "upload"); diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp index b73017a51a..e4cdfaaaaf 100644 --- a/indra/newview/llweb.cpp +++ b/indra/newview/llweb.cpp @@ -81,19 +81,20 @@ void LLWeb::initClass() // static void LLWeb::loadURL(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. - loadURLInternal(url, "", uuid); - } - else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) - { - loadURLExternal(url); - } - else - { - loadURLInternal(url, target, uuid); - } + loadWebURL(url, target, uuid); + //if(target == "_internal") + //{ + // // Force load in the internal browser, as if with a blank target. + // loadURLInternal(url, "", uuid); + //} + //else if (gSavedSettings.getBOOL("UseExternalBrowser") || (target == "_external")) + //{ + // loadURLExternal(url); + //} + //else + //{ + // loadURLInternal(url, target, uuid); + //} } // static @@ -124,17 +125,15 @@ void LLWeb::loadURLInternal(const std::string &url, const std::string& target, c // Explicitly open a Web URL using the Web content floater void LLWeb::loadWebURLInternal(const std::string &url, const std::string& target, const std::string& uuid) { - LLFloaterWebContent::create(url, target, uuid); + LLFloaterWebContent::create(LLFloaterWebContent::Params().url(url).target(target).id(LLUUID(uuid))); } - // static void LLWeb::loadURLExternal(const std::string& url, const std::string& uuid) { loadURLExternal(url, true, uuid); } - // static void LLWeb::loadURLExternal(const std::string& url, bool async, const std::string& uuid) { diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index 8cdb615686..265d5dc801 100644 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1752,13 +1752,13 @@ BOOL LLWorldMapView::handleDoubleClick( S32 x, S32 y, MASK mask ) case MAP_ITEM_LAND_FOR_SALE_ADULT: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "destinations").with("query", id)); break; } case MAP_ITEM_CLASSIFIED: { LLFloaterReg::hideInstance("world_map"); - LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("id", id)); + LLFloaterReg::showInstance("search", LLSD().with("category", "classifieds").with("query", id)); break; } default: diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml deleted file mode 100644 index 8770ede7e9..0000000000 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ /dev/null @@ -1,71 +0,0 @@ - - - - Loading... - - - Done - - - - - - - Redo search to reflect current God level - - - - -- cgit v1.2.3 From ce45e5542a9d717caae83fe608ee5644e231d6a3 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 13 Jul 2011 11:48:09 -0700 Subject: Disabled the fresh item count. The badge on the suitcase button now once again reflects the total item count in the Received Items folder and the New badge is no longer initialized and will not be displayed. Reviewed by Richard. --- indra/newview/llpanelmarketplaceinbox.cpp | 3 --- indra/newview/llpanelmarketplaceinboxinventory.cpp | 4 ++++ indra/newview/llpanelmarketplaceinboxinventory.h | 5 +++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 3accc43ab6..dd3daf5fbb 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -37,9 +37,6 @@ #include "llviewercontrol.h" -#define SUPPORTING_FRESH_ITEM_COUNT 1 - - static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() diff --git a/indra/newview/llpanelmarketplaceinboxinventory.cpp b/indra/newview/llpanelmarketplaceinboxinventory.cpp index 8542ea2ae4..4ea6e98070 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.cpp +++ b/indra/newview/llpanelmarketplaceinboxinventory.cpp @@ -143,7 +143,9 @@ LLInboxFolderViewFolder::LLInboxFolderViewFolder(const Params& p) , LLBadgeOwner(getHandle()) , mFresh(true) { +#if SUPPORTING_FRESH_ITEM_COUNT initBadgeParams(p.new_badge()); +#endif } LLInboxFolderViewFolder::~LLInboxFolderViewFolder() @@ -166,12 +168,14 @@ time_t LLInboxFolderViewFolder::getCreationDate() const // virtual void LLInboxFolderViewFolder::draw() { +#if SUPPORTING_FRESH_ITEM_COUNT if (!badgeHasParent()) { addBadgeToParentPanel(); } setBadgeVisibility(mFresh); +#endif LLFolderViewFolder::draw(); } diff --git a/indra/newview/llpanelmarketplaceinboxinventory.h b/indra/newview/llpanelmarketplaceinboxinventory.h index 899e459896..e12508cff4 100644 --- a/indra/newview/llpanelmarketplaceinboxinventory.h +++ b/indra/newview/llpanelmarketplaceinboxinventory.h @@ -32,6 +32,11 @@ #include "llinventorypanel.h" #include "llfolderviewitem.h" + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + + + class LLInboxInventoryPanel : public LLInventoryPanel { public: -- cgit v1.2.3 From 42c6949e304b1a0ba19251ba889132796adb1295 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 13 Jul 2011 16:06:31 -0700 Subject: EXP-941 FIX text and url change to the age verification dialog tweaked url --- 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 d790908659..2ba9393eec 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -4997,7 +4997,7 @@ Note this will launch your web browser. [_URL] confirm - https://secondlife.com/account/verification.php + https://secondlife.com/my/account/verification.php Date: Wed, 13 Jul 2011 17:59:53 -0700 Subject: EXP-1009 WIP Teleport links from Search floater and destination guide in viewer fail with intrusted browser error in viewer --- indra/llui/llfloaterreg.cpp | 7 +++++-- indra/llui/llsdparam.h | 1 + indra/newview/llfloatersearch.cpp | 7 +++++-- indra/newview/llfloatersearch.h | 4 ++-- indra/newview/llfloaterwebcontent.cpp | 9 +++++++-- indra/newview/llfloaterwebcontent.h | 6 ++++-- indra/newview/llmediactrl.cpp | 9 +++++++++ indra/newview/llmediactrl.h | 4 +++- indra/newview/skins/default/xui/en/floater_web_content.xml | 5 +++++ 9 files changed, 41 insertions(+), 11 deletions(-) diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 4677d535db..f5e6444287 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -129,7 +129,10 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) } // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe - res->mKey = key; + if (res->mKey.isUndefined()) + { + res->mKey = key; + } res->setInstanceName(name); res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) @@ -221,7 +224,7 @@ LLFloater* LLFloaterReg::showInstance(const std::string& name, const LLSD& key, LLFloater* instance = getInstance(name, key); if (instance) { - instance->openFloater(key); + instance->openFloater(instance->mKey); if (focus) instance->setFocus(TRUE); } diff --git a/indra/llui/llsdparam.h b/indra/llui/llsdparam.h index 827b8c8584..f776c781b3 100644 --- a/indra/llui/llsdparam.h +++ b/indra/llui/llsdparam.h @@ -103,6 +103,7 @@ class LLSDParamAdapter : public T } LLSDParamAdapter(const T& val) + : T(val) { T::operator=(val); } diff --git a/indra/newview/llfloatersearch.cpp b/indra/newview/llfloatersearch.cpp index e9710c41a1..ce0bba802d 100644 --- a/indra/newview/llfloatersearch.cpp +++ b/indra/newview/llfloatersearch.cpp @@ -84,10 +84,13 @@ LLSearchHandler gSearchHandler; LLFloaterSearch::_Params::_Params() : category("category", ""), query("query") -{} +{ + trusted_content = true; + allow_address_entry = false; +} -LLFloaterSearch::LLFloaterSearch(const LLSD& key) : +LLFloaterSearch::LLFloaterSearch(const Params& key) : LLFloaterWebContent(key), mSearchGodLevel(0) { diff --git a/indra/newview/llfloatersearch.h b/indra/newview/llfloatersearch.h index 2c59fa6d5d..a4043b2353 100644 --- a/indra/newview/llfloatersearch.h +++ b/indra/newview/llfloatersearch.h @@ -46,7 +46,7 @@ class LLFloaterSearch : public LLFloaterWebContent { public: - struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::_Params> + struct _Params : public LLInitParam::Block<_Params, LLFloaterWebContent::Params> { Optional category; Optional query; @@ -56,7 +56,7 @@ public: typedef LLSDParamAdapter<_Params> Params; - LLFloaterSearch(const LLSD& key); + LLFloaterSearch(const Params& key); /// show the search floater with a new search /// see search() for details on the key parameter. diff --git a/indra/newview/llfloaterwebcontent.cpp b/indra/newview/llfloaterwebcontent.cpp index 4cc29267da..c7c6857a47 100644 --- a/indra/newview/llfloaterwebcontent.cpp +++ b/indra/newview/llfloaterwebcontent.cpp @@ -45,10 +45,12 @@ LLFloaterWebContent::_Params::_Params() target("target"), id("id"), show_chrome("show_chrome", true), - preferred_media_size("preferred_media_size") + allow_address_entry("allow_address_entry", true), + preferred_media_size("preferred_media_size"), + trusted_content("trusted_content", false) {} -LLFloaterWebContent::LLFloaterWebContent( const LLSD& key ) +LLFloaterWebContent::LLFloaterWebContent( const Params& key ) : LLFloater( key ) { mCommitCallbackRegistrar.add( "WebContent.Back", boost::bind( &LLFloaterWebContent::onClickBack, this )); @@ -218,10 +220,12 @@ void LLFloaterWebContent::open_media(const Params& p) mWebBrowser->setHomePageUrl(p.url, "text/html"); mWebBrowser->setTarget(p.target); mWebBrowser->navigateTo(p.url, "text/html"); + set_current_url(p.url); getChild("status_bar")->setVisible(p.show_chrome); getChild("nav_controls")->setVisible(p.show_chrome); + getChild("address")->setEnabled(p.allow_address_entry && !p.trusted_content); if (!p.show_chrome) { @@ -247,6 +251,7 @@ void LLFloaterWebContent::onOpen(const LLSD& key) } mUUID = params.id().asString(); + mWebBrowser->setTrustedContent(params.trusted_content); // tell the browser instance to load the specified URL open_media(params); diff --git a/indra/newview/llfloaterwebcontent.h b/indra/newview/llfloaterwebcontent.h index 2cb6bd0831..3a99d49b5a 100644 --- a/indra/newview/llfloaterwebcontent.h +++ b/indra/newview/llfloaterwebcontent.h @@ -49,7 +49,9 @@ public: Optional url, target; Optional id; - Optional show_chrome; + Optional show_chrome, + allow_address_entry, + trusted_content; Optional preferred_media_size; _Params(); @@ -57,7 +59,7 @@ public: typedef LLSDParamAdapter<_Params> Params; - LLFloaterWebContent(const LLSD& key); + LLFloaterWebContent(const Params& key); void initializeURLHistory(); diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp index 03ccabc994..1eb786f433 100644 --- a/indra/newview/llmediactrl.cpp +++ b/indra/newview/llmediactrl.cpp @@ -1164,3 +1164,12 @@ void LLMediaCtrl::hideNotification() mWindowShade->hide(); } } + +void LLMediaCtrl::setTrustedContent(bool trusted) +{ + mTrusted = trusted; + if (mMediaSource) + { + mMediaSource->setTrustedBrowser(trusted); + } +} diff --git a/indra/newview/llmediactrl.h b/indra/newview/llmediactrl.h index 28666e620f..6833453616 100644 --- a/indra/newview/llmediactrl.h +++ b/indra/newview/llmediactrl.h @@ -149,6 +149,8 @@ public: void showNotification(boost::shared_ptr notify); void hideNotification(); + void setTrustedContent(bool trusted); + // over-rides virtual BOOL handleKeyHere( KEY key, MASK mask); virtual void handleVisibilityChange ( BOOL new_visibility ); @@ -176,7 +178,7 @@ public: LLViewBorder* mBorder; bool mFrequentUpdates; bool mForceUpdate; - const bool mTrusted; + bool mTrusted; std::string mHomePageUrl; std::string mHomePageMimeType; std::string mCurrentNavUrl; 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 69e6057556..0eda9ae62a 100644 --- a/indra/newview/skins/default/xui/en/floater_web_content.xml +++ b/indra/newview/skins/default/xui/en/floater_web_content.xml @@ -40,6 +40,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" hover_glow_amount="0.15" tool_tip="Navigate back" follows="left|top" @@ -58,6 +59,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Navigate forward" follows="left|top" height="22" @@ -75,6 +77,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Stop navigation" enabled="true" follows="left|top" @@ -93,6 +96,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Reload page" follows="left|top" height="22" @@ -137,6 +141,7 @@ image_disabled_selected="PushButton_Disabled" image_selected="PushButton_Selected" image_unselected="PushButton_Off" + chrome="true" tool_tip="Open current URL in your desktop browser" follows="right|top" enabled="true" -- cgit v1.2.3 From d668270c13fcad8ae6e0fdfdf063a16be6083243 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 13 Jul 2011 18:24:48 -0700 Subject: EXP-880 FIX Enable navigation chrome in search floater fixed regression where preferred content size was no longer being respected --- indra/llxuixml/llinitparam.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h index 35c889b69f..7c4d4c8a43 100644 --- a/indra/llxuixml/llinitparam.h +++ b/indra/llxuixml/llinitparam.h @@ -1775,8 +1775,8 @@ namespace LLInitParam void serializeBlock(Parser& parser, Parser::name_stack_t name_stack = Parser::name_stack_t(), const BaseBlock* diff_block = NULL) const { - const self_t& typed_param = static_cast(*this); - const self_t* diff_param = static_cast(diff_block); + const derived_t& typed_param = static_cast(*this); + const derived_t* diff_param = static_cast(diff_block); std::string key = typed_param.getValueName(); @@ -1801,6 +1801,8 @@ namespace LLInitParam // be exported as , since it was probably the intent of the user to // be specific about the RGB color values. This also fixes an issue where we distinguish // between rect.left not being provided and rect.left being explicitly set to 0 (same as default) + const_cast(typed_param).updateBlockFromValue(); + block_t::serializeBlock(parser, name_stack, NULL); } } @@ -1863,7 +1865,7 @@ namespace LLInitParam mValueAge = VALUE_AUTHORITATIVE; mValue = val; typed_param.clearValueName(); - static_cast(const_cast(this))->updateBlockFromValue(); + static_cast(this)->updateBlockFromValue(); } value_assignment_t getValue() const -- cgit v1.2.3