From d413799644b8e7fa943fa86c7798634a28ce335d Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 25 Feb 2011 11:33:20 -0800 Subject: ER-350: Viewer / sim camera positioning not working well on login. Viewer now sets the camera before calling send_agent_update(). Reviewed by Kelly. --- indra/newview/llviewermessage.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 103989ee80..4203ba74b2 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3761,10 +3761,22 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) } else { - // This is likely just the initial logging in phase. + // This is initial log-in or a region crossing gAgent.setTeleportState( LLAgent::TELEPORT_NONE ); + + if(LLStartUp::getStartupState() < STATE_STARTED) + { // This is initial log-in, not a region crossing: + // Set the camera looking ahead of the AV so send_agent_update() below + // will report the correct location to the server. + LLVector3 look_at_point = look_at; + look_at_point = agent_pos + look_at_point.rotVec(gAgent.getQuat()); + + static LLVector3 up_direction(0.0f, 0.0f, 1.0f); + LLViewerCamera::getInstance()->lookAt(agent_pos, look_at_point, up_direction); + } } + if ( LLTracker::isTracking(NULL) ) { // Check distance to beacon, if < 5m, remove beacon -- cgit v1.2.3 From 9bfae21706288802f94d642eb252ac78b4d9e85c Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Mon, 2 May 2011 16:35:55 -0700 Subject: ER-858: Add viewer checkbox to toggle parcel privacy settings. Reviewed by Kelly --- indra/newview/llfloaterland.cpp | 13 +++++++++++++ indra/newview/llfloaterland.h | 1 + .../newview/skins/default/xui/en/floater_about_land.xml | 17 +++++++++++++++-- 3 files changed, 29 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 7be4ebc690..1ebcae4e5c 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1817,6 +1817,7 @@ LLPanelLandOptions::LLPanelLandOptions(LLParcelSelectionHandle& parcel) mClearBtn(NULL), mMatureCtrl(NULL), mPushRestrictionCtrl(NULL), + mPrivateParcelCtrl(NULL), mParcel(parcel) { } @@ -1859,6 +1860,9 @@ BOOL LLPanelLandOptions::postBuild() mPushRestrictionCtrl = getChild( "PushRestrictCheck"); childSetCommitCallback("PushRestrictCheck", onCommitAny, this); + mPrivateParcelCtrl = getChild( "PrivateParcelCheck"); + childSetCommitCallback("PrivateParcelCheck", onCommitAny, this); + mCheckShowDirectory = getChild( "ShowDirectoryCheck"); childSetCommitCallback("ShowDirectoryCheck", onCommitAny, this); @@ -1967,6 +1971,9 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->set(FALSE); mPushRestrictionCtrl->setEnabled(FALSE); + mPrivateParcelCtrl->set(FALSE); + mPrivateParcelCtrl->setEnabled(FALSE); + mLandingTypeCombo->setCurrentByIndex(0); mLandingTypeCombo->setEnabled(FALSE); @@ -2026,6 +2033,10 @@ void LLPanelLandOptions::refresh() mPushRestrictionCtrl->setEnabled(can_change_options); } + mPrivateParcelCtrl->set(parcel->getPrivacy()); + mPrivateParcelCtrl->setLabel(getString("private_parcel_text")); + mPrivateParcelCtrl->setEnabled(can_change_options); + BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); mLandingTypeCombo->setCurrentByIndex((S32)parcel->getLandingType()); @@ -2230,6 +2241,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) BOOL allow_publish = FALSE; BOOL mature_publish = self->mMatureCtrl->get(); BOOL push_restriction = self->mPushRestrictionCtrl->get(); + BOOL private_parcel = self->mPrivateParcelCtrl->get(); BOOL show_directory = self->mCheckShowDirectory->get(); // we have to get the index from a lookup, not from the position in the dropdown! S32 category_index = LLParcel::getCategoryFromString(self->mCategoryCombo->getSelectedValue()); @@ -2263,6 +2275,7 @@ void LLPanelLandOptions::onCommitAny(LLUICtrl *ctrl, void *userdata) parcel->setCategory((LLParcel::ECategory)category_index); parcel->setLandingType((LLParcel::ELandingType)landing_type_index); parcel->setSnapshotID(snapshot_id); + parcel->setPrivacy(private_parcel); // Send current parcel data upstream to server LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); diff --git a/indra/newview/llfloaterland.h b/indra/newview/llfloaterland.h index a096fb64cd..ff1fb62041 100644 --- a/indra/newview/llfloaterland.h +++ b/indra/newview/llfloaterland.h @@ -347,6 +347,7 @@ private: LLCheckBoxCtrl *mMatureCtrl; LLCheckBoxCtrl *mPushRestrictionCtrl; + LLCheckBoxCtrl *mPrivateParcelCtrl; LLSafeHandle& mParcel; }; diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 6e985e0476..d2567e8197 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1204,6 +1204,10 @@ Only large parcels can be listed in search. name="push_restrict_region_text"> No Pushing (Region Override) + + Private Parcel + + width="280" /> + width="280" /> + Date: Tue, 3 May 2011 13:14:00 -0700 Subject: Fix minor indentation issue --- indra/newview/llvoavatar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f1934933b5..1dde6fcac9 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -6923,9 +6923,9 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) llinfos << "Re-requesting AvatarAppearance for object: " << getID() << llendl; LLAvatarPropertiesProcessor::getInstance()->sendAvatarTexturesRequest(getID()); mRuthTimer.reset(); - } - else - { + } + else + { llinfos << "That's okay, we already have a non-default shape for object: " << getID() << llendl; // we don't really care. } -- cgit v1.2.3 From b43da6721e538290962cafa7ddd32a8f4c7e21db Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 6 May 2011 18:29:43 -0700 Subject: Viewer UI work to add icons for the nav bar and places profile to indicate parcel privacy settings. Using engineering art icons. --- indra/newview/lllocationinputctrl.cpp | 13 ++++++++ indra/newview/lllocationinputctrl.h | 16 +++++----- indra/newview/llpanelplaceprofile.cpp | 19 ++++++++++++ indra/newview/llpanelplaceprofile.h | 2 ++ indra/newview/llpaneltopinfobar.cpp | 8 +++++ indra/newview/llpaneltopinfobar.h | 13 ++++---- .../textures/icons/Parcel_PrivacyOff_Dark.png | Bin 0 -> 787 bytes .../textures/icons/Parcel_PrivacyOn_Dark.png | Bin 0 -> 833 bytes indra/newview/skins/default/textures/textures.xml | 4 ++- .../newview/skins/default/xui/en/notifications.xml | 11 +++++++ .../skins/default/xui/en/panel_place_profile.xml | 33 +++++++++++++++++++++ .../skins/default/xui/en/panel_topinfo_bar.xml | 10 +++++++ indra/newview/skins/default/xui/en/strings.xml | 1 + .../default/xui/en/widgets/location_input.xml | 9 ++++++ .../minimal/xui/en/widgets/location_input.xml | 9 ++++++ 15 files changed, 134 insertions(+), 14 deletions(-) create mode 100644 indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png create mode 100644 indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png (limited to 'indra/newview') diff --git a/indra/newview/lllocationinputctrl.cpp b/indra/newview/lllocationinputctrl.cpp index 5c65dcec34..c68d1bb845 100644 --- a/indra/newview/lllocationinputctrl.cpp +++ b/indra/newview/lllocationinputctrl.cpp @@ -190,6 +190,7 @@ LLLocationInputCtrl::Params::Params() scripts_icon("scripts_icon"), damage_icon("damage_icon"), damage_text("damage_text"), + privacy_icon("privacy_icon"), maturity_help_topic("maturity_help_topic") { } @@ -342,6 +343,13 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) mDamageText = LLUICtrlFactory::create(damage_text); addChild(mDamageText); + LLIconCtrl::Params privacy_icon = p.privacy_icon; + privacy_icon.tool_tip = LLTrans::getString("LocationCtrlPrivacyTooltip"); + privacy_icon.mouse_opaque = true; + mParcelIcon[PRIVACY_ICON] = LLUICtrlFactory::create(privacy_icon); + mParcelIcon[PRIVACY_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, PRIVACY_ICON)); + addChild(mParcelIcon[PRIVACY_ICON]); + // Register callbacks and load the location field context menu (NB: the order matters). LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Navbar.Action", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemClicked, this, _2)); LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Navbar.EnableMenuItem", boost::bind(&LLLocationInputCtrl::onLocationContextMenuItemEnabled, this, _2)); @@ -810,6 +818,7 @@ void LLLocationInputCtrl::refreshParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool privacy = current_parcel->getPrivacy(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -819,6 +828,7 @@ void LLLocationInputCtrl::refreshParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[PRIVACY_ICON]->setVisible( privacy ); // Padding goes to left of both landmark star and for sale btn x -= mAddLandmarkHPad; @@ -1175,6 +1185,9 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case PRIVACY_ICON: + LLNotificationsUtil::add("PrivateParcel"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/lllocationinputctrl.h b/indra/newview/lllocationinputctrl.h index 6368bf5cf2..ee4e55e829 100644 --- a/indra/newview/lllocationinputctrl.h +++ b/indra/newview/lllocationinputctrl.h @@ -77,7 +77,8 @@ public: push_icon, build_icon, scripts_icon, - damage_icon; + damage_icon, + privacy_icon; Optional damage_text; Params(); }; @@ -109,12 +110,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + PRIVACY_ICON, // 6 + ICON_COUNT // 7 total }; friend class LLUICtrlFactory; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 68ecb0165c..da6a9fbbc6 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -70,6 +70,8 @@ static std::string icon_scripts; static std::string icon_scripts_no; static std::string icon_damage; static std::string icon_damage_no; +static std::string icon_privacy_on; +static std::string icon_privacy_off; LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), @@ -114,6 +116,8 @@ BOOL LLPanelPlaceProfile::postBuild() mScriptsText = getChild("scripts_value"); mDamageIcon = getChild("damage_icon"); mDamageText = getChild("damage_value"); + mPrivacyIcon = getChild("privacy_icon"); + mPrivacyText = getChild("privacy_value"); mRegionNameText = getChild("region_name"); mRegionTypeText = getChild("region_type"); @@ -153,6 +157,8 @@ BOOL LLPanelPlaceProfile::postBuild() icon_scripts_no = getString("icon_ScriptsNo"); icon_damage = getString("icon_Damage"); icon_damage_no = getString("icon_DamageNo"); + icon_privacy_on = getString("icon_PrivacyOn"); + icon_privacy_off = getString("icon_PrivacyOff"); return TRUE; } @@ -182,6 +188,8 @@ void LLPanelPlaceProfile::resetLocation() mScriptsText->setText(loading); mDamageIcon->setValue(loading); mDamageText->setText(loading); + mPrivacyIcon->setValue(loading); + mPrivacyText->setText(loading); mRegionNameText->setValue(loading); mRegionTypeText->setValue(loading); @@ -414,6 +422,17 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, mDamageText->setText(off); } + if (parcel->getPrivacy()) + { + mPrivacyIcon->setValue(icon_privacy_on); + mPrivacyText->setText(on); + } + else + { + mPrivacyIcon->setValue(icon_privacy_off); + mPrivacyText->setText(off); + } + mRegionNameText->setText(region->getName()); mRegionTypeText->setText(region->getSimProductName()); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index f28b3b3832..b20107dc4b 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -91,6 +91,8 @@ private: LLTextBox* mScriptsText; LLIconCtrl* mDamageIcon; LLTextBox* mDamageText; + LLIconCtrl* mPrivacyIcon; + LLTextBox* mPrivacyText; LLTextBox* mRegionNameText; LLTextBox* mRegionTypeText; diff --git a/indra/newview/llpaneltopinfobar.cpp b/indra/newview/llpaneltopinfobar.cpp index 30949f8f02..c2359b8b23 100644 --- a/indra/newview/llpaneltopinfobar.cpp +++ b/indra/newview/llpaneltopinfobar.cpp @@ -102,6 +102,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON] = getChild("build_icon"); mParcelIcon[SCRIPTS_ICON] = getChild("scripts_icon"); mParcelIcon[DAMAGE_ICON] = getChild("damage_icon"); + mParcelIcon[PRIVACY_ICON] = getChild("privacy_icon"); mParcelIcon[VOICE_ICON]->setToolTip(LLTrans::getString("LocationCtrlVoiceTooltip")); mParcelIcon[FLY_ICON]->setToolTip(LLTrans::getString("LocationCtrlFlyTooltip")); @@ -109,6 +110,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setToolTip(LLTrans::getString("LocationCtrlBuildTooltip")); mParcelIcon[SCRIPTS_ICON]->setToolTip(LLTrans::getString("LocationCtrlScriptsTooltip")); mParcelIcon[DAMAGE_ICON]->setToolTip(LLTrans::getString("LocationCtrlDamageTooltip")); + mParcelIcon[PRIVACY_ICON]->setToolTip(LLTrans::getString("LocationCtrlPrivacyTooltip")); mParcelIcon[VOICE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, VOICE_ICON)); mParcelIcon[FLY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, FLY_ICON)); @@ -116,6 +118,7 @@ void LLPanelTopInfoBar::initParcelIcons() mParcelIcon[BUILD_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, BUILD_ICON)); mParcelIcon[SCRIPTS_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, SCRIPTS_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, DAMAGE_ICON)); + mParcelIcon[PRIVACY_ICON]->setMouseDownCallback(boost::bind(&LLPanelTopInfoBar::onParcelIconClick, this, PRIVACY_ICON)); mDamageText->setText(LLStringExplicit("100%")); } @@ -295,6 +298,7 @@ void LLPanelTopInfoBar::updateParcelIcons() bool allow_build = vpm->allowAgentBuild(current_parcel); // true when anyone is allowed to build. See EXT-4610. bool allow_scripts = vpm->allowAgentScripts(agent_region, current_parcel); bool allow_damage = vpm->allowAgentDamage(agent_region, current_parcel); + bool privacy = current_parcel->getPrivacy(); // Most icons are "block this ability" mParcelIcon[VOICE_ICON]->setVisible( !allow_voice ); @@ -304,6 +308,7 @@ void LLPanelTopInfoBar::updateParcelIcons() mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mDamageText->setVisible(allow_damage); + mParcelIcon[PRIVACY_ICON]->setVisible( privacy ); layoutParcelIcons(); } @@ -409,6 +414,9 @@ void LLPanelTopInfoBar::onParcelIconClick(EParcelIcon icon) case DAMAGE_ICON: LLNotificationsUtil::add("NotSafe"); break; + case PRIVACY_ICON: + LLNotificationsUtil::add("PrivateParcel"); + break; case ICON_COUNT: break; // no default to get compiler warning when a new icon gets added diff --git a/indra/newview/llpaneltopinfobar.h b/indra/newview/llpaneltopinfobar.h index db922ef424..f497ce9633 100644 --- a/indra/newview/llpaneltopinfobar.h +++ b/indra/newview/llpaneltopinfobar.h @@ -65,12 +65,13 @@ private: enum EParcelIcon { VOICE_ICON = 0, - FLY_ICON, - PUSH_ICON, - BUILD_ICON, - SCRIPTS_ICON, - DAMAGE_ICON, - ICON_COUNT + FLY_ICON, // 1 + PUSH_ICON, // 2 + BUILD_ICON, // 3 + SCRIPTS_ICON, // 4 + DAMAGE_ICON, // 5 + PRIVACY_ICON, // 6 + ICON_COUNT // 7 total }; /** diff --git a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png new file mode 100644 index 0000000000..5f9fba4447 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png differ diff --git a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png new file mode 100644 index 0000000000..ad93163a85 Binary files /dev/null and b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png differ diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1ca48b01a8..93dab65bcd 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -1,4 +1,4 @@ - diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index 37d60f1671..c818cdfaeb 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -123,6 +123,15 @@ font="SansSerifSmall" text_color="TextFgColor" /> + + Date: Mon, 9 May 2011 11:00:54 -0700 Subject: Clean up parcel privacy icons and locations --- .../default/textures/icons/Parcel_PrivacyOff_Dark.png | Bin 787 -> 730 bytes .../default/textures/icons/Parcel_PrivacyOn_Dark.png | Bin 833 -> 814 bytes .../skins/default/xui/en/widgets/location_input.xml | 7 +++---- .../skins/minimal/xui/en/widgets/location_input.xml | 9 ++++----- 4 files changed, 7 insertions(+), 9 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png index 5f9fba4447..8b3376e514 100644 Binary files a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png and b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOff_Dark.png differ diff --git a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png index ad93163a85..4e474d7f5a 100644 Binary files a/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png and b/indra/newview/skins/default/textures/icons/Parcel_PrivacyOn_Dark.png differ diff --git a/indra/newview/skins/default/xui/en/widgets/location_input.xml b/indra/newview/skins/default/xui/en/widgets/location_input.xml index c818cdfaeb..5a60576b4a 100644 --- a/indra/newview/skins/default/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/default/xui/en/widgets/location_input.xml @@ -125,10 +125,9 @@ /> diff --git a/indra/newview/skins/minimal/xui/en/widgets/location_input.xml b/indra/newview/skins/minimal/xui/en/widgets/location_input.xml index 1292b43605..531e378425 100644 --- a/indra/newview/skins/minimal/xui/en/widgets/location_input.xml +++ b/indra/newview/skins/minimal/xui/en/widgets/location_input.xml @@ -115,12 +115,11 @@ /> Date: Tue, 10 May 2011 17:45:07 -0700 Subject: converted spaces to tabs --- indra/newview/llviewermessage.cpp | 90 +++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index fc11cbc28a..a49545f5e3 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -265,7 +265,7 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ msg->newMessageFast(_PREHASH_MoneyTransferRequest); msg->nextBlockFast(_PREHASH_AgentData); msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); - msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); + msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); msg->nextBlockFast(_PREHASH_MoneyData); msg->addUUIDFast(_PREHASH_SourceID, gAgent.getID() ); msg->addUUIDFast(_PREHASH_DestID, uuid); @@ -337,7 +337,7 @@ void process_logout_reply(LLMessageSystem* msg, void**) LL_INFOS("Messaging") << "process_logout_reply item not found: " << item_id << LL_ENDL; } } - LLAppViewer::instance()->forceQuit(); + LLAppViewer::instance()->forceQuit(); } void process_layer_data(LLMessageSystem *mesgsys, void **user_data) @@ -1868,7 +1868,7 @@ void inventory_offer_handler(LLOfferInfo* info) info->mPersist = true; p.name = "ObjectGiveItem"; // Pop up inv offer chiclet and let the user accept (keep), or reject (and silently delete) the inventory. - LLPostponedNotification::add(p, info->mFromID, info->mFromGroup == TRUE); + LLPostponedNotification::add(p, info->mFromID, info->mFromGroup == TRUE); } else // Agent -> Agent Inventory Offer { @@ -1899,8 +1899,8 @@ void inventory_offer_handler(LLOfferInfo* info) // Inform user that there is a script floater via toast system { payload["give_inventory_notification"] = TRUE; - p.payload = payload; - LLPostponedNotification::add(p, info->mFromID, false); + p.payload = payload; + LLPostponedNotification::add(p, info->mFromID, false); } } @@ -2198,11 +2198,11 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) binary_bucket_size = msg->getSizeFast(_PREHASH_MessageBlock, _PREHASH_BinaryBucket); EInstantMessage dialog = (EInstantMessage)d; - // make sure that we don't have an empty or all-whitespace name + // make sure that we don't have an empty or all-whitespace name LLStringUtil::trim(name); if (name.empty()) { - name = LLTrans::getString("Unnamed"); + name = LLTrans::getString("Unnamed"); } // IDEVO convert new-style "Resident" names for display name = clean_name_from_im(name, dialog); @@ -2240,7 +2240,7 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) params.name = "IMSystemMessageTip"; params.substitutions = args; params.payload = payload; - LLPostponedNotification::add(params, from_id, false); + LLPostponedNotification::add(params, from_id, false); break; case IM_NOTHING_SPECIAL: @@ -2817,10 +2817,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) payload["lure_id"] = session_id; payload["godlike"] = FALSE; - LLNotification::Params params("TeleportOffered"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); + LLNotification::Params params("TeleportOffered"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); } } break; @@ -2884,15 +2884,15 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) if(message.empty()) { //support for frienship offers from clients before July 2008 - LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); + LLNotificationsUtil::add("OfferFriendshipNoMessage", args, payload); } else { args["[MESSAGE]"] = message; - LLNotification::Params params("OfferFriendship"); - params.substitutions = args; - params.payload = payload; - LLPostponedNotification::add( params, from_id, false); + LLNotification::Params params("OfferFriendship"); + params.substitutions = args; + params.payload = payload; + LLPostponedNotification::add( params, from_id, false); } } } @@ -4252,8 +4252,8 @@ void process_time_synch(LLMessageSystem *mesgsys, void **user_data) F32 phase; U64 space_time_usec; - U32 seconds_per_day; - U32 seconds_per_year; + U32 seconds_per_day; + U32 seconds_per_year; // "SimulatorViewerTimeMessage" mesgsys->getU64Fast(_PREHASH_TimeInfo, _PREHASH_UsecSinceStart, space_time_usec); @@ -4420,7 +4420,7 @@ void process_attached_sound_gain_change(LLMessageSystem *mesgsys, void **user_da return; } - mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); + mesgsys->getF32Fast(_PREHASH_DataBlock, _PREHASH_Gain, gain); objectp->adjustAudioGain(gain); } @@ -4548,7 +4548,7 @@ void process_sim_stats(LLMessageSystem *msg, void **user_data) break; default: // Used to be a commented out warning. - LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; + LL_DEBUGS("Messaging") << "Unknown stat id" << stat_id << LL_ENDL; break; } } @@ -5035,7 +5035,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) msg->getStringFast(_PREHASH_MoneyData, _PREHASH_Description, desc); LL_INFOS("Messaging") << "L$, credit, committed: " << balance << " " << credit << " " << committed << LL_ENDL; - + if (gStatusBar) { gStatusBar->setBalance(balance); @@ -5149,9 +5149,9 @@ static void money_balance_group_notify(const LLUUID& group_id, static void money_balance_avatar_notify(const LLUUID& agent_id, const LLAvatarName& av_name, - std::string notification, - LLSD args, - LLSD payload) + std::string notification, + LLSD args, + LLSD payload) { // Message uses name SLURLs, don't actually have to substitute in // the name. We're just making sure it's available. @@ -5161,24 +5161,24 @@ static void money_balance_avatar_notify(const LLUUID& agent_id, static void process_money_balance_reply_extended(LLMessageSystem* msg) { - // Added in server 1.40 and viewer 2.1, support for localization - // and agent ids for name lookup. - S32 transaction_type = 0; - LLUUID source_id; + // Added in server 1.40 and viewer 2.1, support for localization + // and agent ids for name lookup. + S32 transaction_type = 0; + LLUUID source_id; BOOL is_source_group = FALSE; - LLUUID dest_id; + LLUUID dest_id; BOOL is_dest_group = FALSE; - S32 amount = 0; - std::string item_description; + S32 amount = 0; + std::string item_description; - msg->getS32("TransactionInfo", "TransactionType", transaction_type); - msg->getUUID("TransactionInfo", "SourceID", source_id); + msg->getS32("TransactionInfo", "TransactionType", transaction_type); + msg->getUUID("TransactionInfo", "SourceID", source_id); msg->getBOOL("TransactionInfo", "IsSourceGroup", is_source_group); - msg->getUUID("TransactionInfo", "DestID", dest_id); + msg->getUUID("TransactionInfo", "DestID", dest_id); msg->getBOOL("TransactionInfo", "IsDestGroup", is_dest_group); - msg->getS32("TransactionInfo", "Amount", amount); - msg->getString("TransactionInfo", "ItemDescription", item_description); - LL_INFOS("Money") << "MoneyBalanceReply source " << source_id + msg->getS32("TransactionInfo", "Amount", amount); + msg->getString("TransactionInfo", "ItemDescription", item_description); + LL_INFOS("Money") << "MoneyBalanceReply source " << source_id << " dest " << dest_id << " type " << transaction_type << " item " << item_description << LL_ENDL; @@ -6477,10 +6477,10 @@ void process_script_dialog(LLMessageSystem* msg, void**) LLSD payload; LLUUID object_id; - LLUUID owner_id; + LLUUID owner_id; msg->getUUID("Data", "ObjectID", object_id); - msg->getUUID("OwnerData", "OwnerID", owner_id); + msg->getUUID("OwnerData", "OwnerID", owner_id); if (LLMuteList::getInstance()->isMuted(object_id) || LLMuteList::getInstance()->isMuted(owner_id)) { @@ -6630,7 +6630,7 @@ void process_load_url(LLMessageSystem* msg, void**) // Check if object or owner is muted if (LLMuteList::getInstance()->isMuted(object_id, object_name) || - LLMuteList::getInstance()->isMuted(owner_id)) + LLMuteList::getInstance()->isMuted(owner_id)) { LL_INFOS("Messaging")<<"Ignoring load_url from muted object/owner."<incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || - LL_ERR_FILE_EMPTY == status) + LL_ERR_FILE_EMPTY == status) { covenant_text = "Estate covenant notecard is missing from database."; } @@ -6895,7 +6895,7 @@ void invalid_message_callback(LLMessageSystem* msg, void*, EMessageException exception) { - LLAppViewer::instance()->badNetworkHandler(); + LLAppViewer::instance()->badNetworkHandler(); } // Please do not add more message handlers here. This file is huge. -- cgit v1.2.3 From ff3289e2f3a8e87ce33cb267ad30b4a431406f9e Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Fri, 13 May 2011 13:56:49 -0700 Subject: ER-898: Modify llGetParcelDetails() on viewer to support parcel privacy. Reviewed by Kelly. --- indra/newview/app_settings/keywords.ini | 1 + indra/newview/skins/default/xui/en/strings.xml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/keywords.ini b/indra/newview/app_settings/keywords.ini index 263b73ba23..6426d5c2a8 100644 --- a/indra/newview/app_settings/keywords.ini +++ b/indra/newview/app_settings/keywords.ini @@ -498,6 +498,7 @@ PARCEL_DETAILS_OWNER Used with llGetParcelDetails to get the parcel owner id. PARCEL_DETAILS_GROUP Used with llGetParcelDetails to get the parcel group id. PARCEL_DETAILS_AREA Used with llGetParcelDetails to get the parcel area in square meters. PARCEL_DETAILS_ID Used with llGetParcelDetails to get the parcel id. +PARCEL_DETAILS_PRIVACY Used with llGetParcelDetails to get the parcel privacy setting. STRING_TRIM_HEAD Used with llStringTrim to trim leading spaces from a string. STRING_TRIM_TAIL Used with llStringTrim to trim trailing spaces from a string. diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index 6658d6f683..92a2296740 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -1683,7 +1683,7 @@ Returns the maximum number of prims allowed on the parcel at pos list llGetParcelDetails(vector pos, list params) Returns the parcel details specified in params for the parcel at pos. -Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA +Params is one or more of: PARCEL_DETAILS_NAME, _DESC, _OWNER, _GROUP, _AREA, _ID, _PRIVACY llSetLinkPrimitiveParams(integer linknumber, list rules) -- cgit v1.2.3 From 6bafd98ae0b12878cb265645190fc46c919773d3 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 16 May 2011 17:17:56 -0700 Subject: initial sidepanel inventory xml changes --- .../skins/default/xui/en/sidepanel_inventory.xml | 87 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 11 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 8997c1a6d7..5f6ef16cf0 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -19,17 +19,82 @@ height="570" visible="true" width="330"> - + + + + + + + + + + + + + + + + + Date: Mon, 16 May 2011 18:07:26 -0700 Subject: initial commit of llpanelmarketplace files --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llpanelmarketplace.cpp | 46 ++++++++++++++++++++++++++++++++++++ indra/newview/llpanelmarketplace.h | 46 ++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 indra/newview/llpanelmarketplace.cpp create mode 100644 indra/newview/llpanelmarketplace.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 95cfc23ede..f14313cf7d 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,6 +348,7 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp + llpanelmarketplace.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -887,6 +888,7 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h + llpanelmarketplace.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplace.cpp b/indra/newview/llpanelmarketplace.cpp new file mode 100644 index 0000000000..c3d97f9d62 --- /dev/null +++ b/indra/newview/llpanelmarketplace.cpp @@ -0,0 +1,46 @@ +/** + * @file llfloatersounddevices.cpp + * @author Leyla Farazha + * @brief Sound Preferences used for minimal skin + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplace.h" + + +// protected +LLPanelMarketplace::LLPanelMarketplace() +: LLPanel() +{ +} + +LLPanelMarketplace::~LLPanelMarketplace() +{ +} + +// virtual +BOOL LLPanelMarketplace::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplace.h b/indra/newview/llpanelmarketplace.h new file mode 100644 index 0000000000..bd0ef523fc --- /dev/null +++ b/indra/newview/llpanelmarketplace.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaces.h + * @brief Panel for marketplace inbox and outbox + * +* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACE_H +#define LL_LLPANELMARKETPLACE_H + +#include "llpanel.h" + +class LLPanelMarketplace : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplace); + + LLPanelMarketplace(); + ~LLPanelMarketplace(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACE_H + -- cgit v1.2.3 From e8b0db53b2dbfab3fc060fefb6abb2d6dcf31fe9 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 17 May 2011 14:44:23 -0700 Subject: changing llpanelmarketplace to llpanelmarketplaceinventory --- indra/newview/CMakeLists.txt | 4 +-- indra/newview/llpanelmarketplace.cpp | 46 --------------------------- indra/newview/llpanelmarketplace.h | 46 --------------------------- indra/newview/llpanelmarketplaceinventory.cpp | 45 ++++++++++++++++++++++++++ indra/newview/llpanelmarketplaceinventory.h | 46 +++++++++++++++++++++++++++ 5 files changed, 93 insertions(+), 94 deletions(-) delete mode 100644 indra/newview/llpanelmarketplace.cpp delete mode 100644 indra/newview/llpanelmarketplace.h create mode 100644 indra/newview/llpanelmarketplaceinventory.cpp create mode 100644 indra/newview/llpanelmarketplaceinventory.h (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index f14313cf7d..8fde605cb0 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,7 +348,7 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp - llpanelmarketplace.cpp + llpanelmarketplaceinventory.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -888,7 +888,7 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h - llpanelmarketplace.h + llpanelmarketplaceinventory.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplace.cpp b/indra/newview/llpanelmarketplace.cpp deleted file mode 100644 index c3d97f9d62..0000000000 --- a/indra/newview/llpanelmarketplace.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llfloatersounddevices.cpp - * @author Leyla Farazha - * @brief Sound Preferences used for minimal skin - * -* $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ -#include "llviewerprecompiledheaders.h" - -#include "llpanelmarketplace.h" - - -// protected -LLPanelMarketplace::LLPanelMarketplace() -: LLPanel() -{ -} - -LLPanelMarketplace::~LLPanelMarketplace() -{ -} - -// virtual -BOOL LLPanelMarketplace::postBuild() -{ - return TRUE; -} diff --git a/indra/newview/llpanelmarketplace.h b/indra/newview/llpanelmarketplace.h deleted file mode 100644 index bd0ef523fc..0000000000 --- a/indra/newview/llpanelmarketplace.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaces.h - * @brief Panel for marketplace inbox and outbox - * -* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACE_H -#define LL_LLPANELMARKETPLACE_H - -#include "llpanel.h" - -class LLPanelMarketplace : public LLPanel -{ -public: - - LOG_CLASS(LLPanelMarketplace); - - LLPanelMarketplace(); - ~LLPanelMarketplace(); - - /*virtual*/ BOOL postBuild(); -}; - - -#endif //LL_LLPANELMARKETPLACE_H - diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp new file mode 100644 index 0000000000..be2cef3601 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinventory.cpp @@ -0,0 +1,45 @@ +/** + * @file llpanelmarketplaceinventory.cpp + * @brief Panel for marketplace inbox and outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceinventory.h" + + +// protected +LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() +: LLPanel() +{ +} + +LLPanelMarketplaceInventory::~LLPanelMarketplaceInventory() +{ +} + +// virtual +BOOL LLPanelMarketplaceInventory::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceinventory.h b/indra/newview/llpanelmarketplaceinventory.h new file mode 100644 index 0000000000..367656ad38 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinventory.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaceinventory.h + * @brief Panel for marketplace inbox and outbox + * +* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACEINVENTORY_H +#define LL_LLPANELMARKETPLACEINVENTORY_H + +#include "llpanel.h" + +class LLPanelMarketplaceInventory : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplaceInventory); + + LLPanelMarketplaceInventory(); + ~LLPanelMarketplaceInventory(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACEINVENTORY_H + -- cgit v1.2.3 From dfebb9ebb7333387d59aa7ba4e5926671d6681f5 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 17 May 2011 16:01:29 -0700 Subject: hooking up the marketplace inventory panel to the class --- indra/newview/llpanelmarketplaceinventory.cpp | 1 + .../skins/default/xui/en/sidepanel_inventory.xml | 60 +++++++++++----------- 2 files changed, 32 insertions(+), 29 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp index be2cef3601..2a56a9959a 100644 --- a/indra/newview/llpanelmarketplaceinventory.cpp +++ b/indra/newview/llpanelmarketplaceinventory.cpp @@ -27,6 +27,7 @@ #include "llpanelmarketplaceinventory.h" +static LLRegisterPanelClassWrapper t_panel_marketplace_inventory("panel_marketplace_inventory"); // protected LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 5f6ef16cf0..faf5e28bb8 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -28,7 +28,10 @@ name="inventory_layout_stack" height="545" width="330"> - + + - + - - - + + Date: Tue, 17 May 2011 16:38:51 -0700 Subject: fixing llaccordian crash with multiple child panels --- .../skins/default/xui/en/sidepanel_inventory.xml | 35 ++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index faf5e28bb8..41b9283edc 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -75,12 +75,35 @@ min_height="150" fit_panel="false" title="MARKETPLACE INBOX"> - + + Just a panel + + + Just a panel 2 + Date: Mon, 23 May 2011 16:11:50 -0700 Subject: adding marketplace inbox and outbox reviewed by Leslie --- indra/newview/CMakeLists.txt | 6 +- indra/newview/llpanelmarketplaceinbox.cpp | 47 +++++++ indra/newview/llpanelmarketplaceinbox.h | 46 +++++++ indra/newview/llpanelmarketplaceinventory.cpp | 46 ------- indra/newview/llpanelmarketplaceinventory.h | 46 ------- indra/newview/llpanelmarketplaceoutbox.cpp | 47 +++++++ indra/newview/llpanelmarketplaceoutbox.h | 46 +++++++ indra/newview/llsidepanelinventory.cpp | 49 +++++++- indra/newview/llsidepanelinventory.h | 3 + indra/newview/skins/default/textures/textures.xml | 2 + .../textures/widgets/MarketplaceBtn_Off.png | Bin 0 -> 711 bytes .../textures/widgets/MarketplaceBtn_Selected.png | Bin 0 -> 702 bytes .../skins/default/xui/en/sidepanel_inventory.xml | 139 ++++++++++++--------- 13 files changed, 326 insertions(+), 151 deletions(-) create mode 100644 indra/newview/llpanelmarketplaceinbox.cpp create mode 100644 indra/newview/llpanelmarketplaceinbox.h delete mode 100644 indra/newview/llpanelmarketplaceinventory.cpp delete mode 100644 indra/newview/llpanelmarketplaceinventory.h create mode 100644 indra/newview/llpanelmarketplaceoutbox.cpp create mode 100644 indra/newview/llpanelmarketplaceoutbox.h create mode 100644 indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png create mode 100644 indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 8fde605cb0..67f9fede45 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -348,7 +348,8 @@ set(viewer_SOURCE_FILES llpanellogin.cpp llpanelloginlistener.cpp llpanelmaininventory.cpp - llpanelmarketplaceinventory.cpp + llpanelmarketplaceinbox.cpp + llpanelmarketplaceoutbox.cpp llpanelmediasettingsgeneral.cpp llpanelmediasettingspermissions.cpp llpanelmediasettingssecurity.cpp @@ -888,7 +889,8 @@ set(viewer_HEADER_FILES llpanellogin.h llpanelloginlistener.h llpanelmaininventory.h - llpanelmarketplaceinventory.h + llpanelmarketplaceinbox.h + llpanelmarketplaceoutbox.h llpanelmediasettingsgeneral.h llpanelmediasettingspermissions.h llpanelmediasettingssecurity.h diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp new file mode 100644 index 0000000000..b3afaea20e --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -0,0 +1,47 @@ +/** + * @file llpanelmarketplaceinbox.cpp + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceinbox.h" + +static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); + +// protected +LLPanelMarketplaceInbox::LLPanelMarketplaceInbox() +: LLPanel() +{ +} + +LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceInbox::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h new file mode 100644 index 0000000000..519b213081 --- /dev/null +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaceinbox.h + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACEINBOX_H +#define LL_LLPANELMARKETPLACEINBOX_H + +#include "llpanel.h" + +class LLPanelMarketplaceInbox : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplaceInbox); + + LLPanelMarketplaceInbox(); + ~LLPanelMarketplaceInbox(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACEINBOX_H + diff --git a/indra/newview/llpanelmarketplaceinventory.cpp b/indra/newview/llpanelmarketplaceinventory.cpp deleted file mode 100644 index 2a56a9959a..0000000000 --- a/indra/newview/llpanelmarketplaceinventory.cpp +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaceinventory.cpp - * @brief Panel for marketplace inbox and outbox - * -* $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ -#include "llviewerprecompiledheaders.h" - -#include "llpanelmarketplaceinventory.h" - -static LLRegisterPanelClassWrapper t_panel_marketplace_inventory("panel_marketplace_inventory"); - -// protected -LLPanelMarketplaceInventory::LLPanelMarketplaceInventory() -: LLPanel() -{ -} - -LLPanelMarketplaceInventory::~LLPanelMarketplaceInventory() -{ -} - -// virtual -BOOL LLPanelMarketplaceInventory::postBuild() -{ - return TRUE; -} diff --git a/indra/newview/llpanelmarketplaceinventory.h b/indra/newview/llpanelmarketplaceinventory.h deleted file mode 100644 index 367656ad38..0000000000 --- a/indra/newview/llpanelmarketplaceinventory.h +++ /dev/null @@ -1,46 +0,0 @@ -/** - * @file llpanelmarketplaceinventory.h - * @brief Panel for marketplace inbox and outbox - * -* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACEINVENTORY_H -#define LL_LLPANELMARKETPLACEINVENTORY_H - -#include "llpanel.h" - -class LLPanelMarketplaceInventory : public LLPanel -{ -public: - - LOG_CLASS(LLPanelMarketplaceInventory); - - LLPanelMarketplaceInventory(); - ~LLPanelMarketplaceInventory(); - - /*virtual*/ BOOL postBuild(); -}; - - -#endif //LL_LLPANELMARKETPLACEINVENTORY_H - diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp new file mode 100644 index 0000000000..1f58fb33a4 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -0,0 +1,47 @@ +/** + * @file llpanelmarketplaceoutbox.cpp + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceoutbox.h" + +static LLRegisterPanelClassWrapper t_panel_marketplace_outbox("panel_marketplace_outbox"); + +// protected +LLPanelMarketplaceOutbox::LLPanelMarketplaceOutbox() +: LLPanel() +{ +} + +LLPanelMarketplaceOutbox::~LLPanelMarketplaceOutbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceOutbox::postBuild() +{ + return TRUE; +} diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h new file mode 100644 index 0000000000..a6a28e0a83 --- /dev/null +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -0,0 +1,46 @@ +/** + * @file llpanelmarketplaceoutbox.h + * @brief Panel for marketplace outbox + * +* $LicenseInfo:firstyear=2011&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_LLPANELMARKETPLACEOUTBOX_H +#define LL_LLPANELMARKETPLACEOUTBOX_H + +#include "llpanel.h" + +class LLPanelMarketplaceOutbox : public LLPanel +{ +public: + + LOG_CLASS(LLPanelMarketplaceOutbox); + + LLPanelMarketplaceOutbox(); + ~LLPanelMarketplaceOutbox(); + + /*virtual*/ BOOL postBuild(); +}; + + +#endif //LL_LLPANELMARKETPLACEOUTBOX_H + diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 31ea542743..7f5a2e64bf 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -42,6 +42,7 @@ #include "lltabcontainer.h" #include "llselectmgr.h" #include "llweb.h" +#include "lllayoutstack.h" static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); @@ -118,10 +119,56 @@ BOOL LLSidepanelInventory::postBuild() back_btn->setClickedCallback(boost::bind(&LLSidepanelInventory::onBackButtonClicked, this)); } } - + + getChild("inbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleInboxBtn, this)); + getChild("outbox_btn")->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); + + LLLayoutStack* stack = getChild("inventory_layout_stack"); + + stack->collapsePanel(getChild("inbox_layout_panel"), true); + stack->collapsePanel(getChild("outbox_layout_panel"), true); + getChild("outbox_btn")->setToggleState(false); + getChild("inbox_btn")->setToggleState(false); + return TRUE; } + +void LLSidepanelInventory::onToggleInboxBtn() +{ + LLLayoutStack* stack = getChild("inventory_layout_stack"); + bool collapse = !getChild("inbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild("inbox_layout_panel"), collapse); + } + if (!collapse) + { + stack->collapsePanel(getChild("outbox_layout_panel"), true); + getChild("outbox_btn")->setToggleState(false); + } +} + +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild("inventory_layout_stack"); + bool collapse = !getChild("outbox_btn")->getToggleState(); + + if (stack) + { + stack->collapsePanel(getChild("outbox_layout_panel"), collapse); + } + + if (!collapse) + { + stack->collapsePanel(getChild("inbox_layout_panel"), true); + getChild("inbox_btn")->setToggleState(false); + } + +} + + void LLSidepanelInventory::onOpen(const LLSD& key) { LLFirstUse::newInventory(false); diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 32c98bc034..a4e8d0e8e8 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -56,6 +56,9 @@ public: // checks can share selected item(s) bool canShare(); + void onToggleInboxBtn(); + void onToggleOutboxBtn(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 1ca48b01a8..4f19dd9a6d 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -249,6 +249,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png new file mode 100644 index 0000000000..e291a1c508 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Off.png differ diff --git a/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png new file mode 100644 index 0000000000..33527f852b Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/MarketplaceBtn_Selected.png differ diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 41b9283edc..a0caf80256 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -26,12 +26,12 @@ top="0" orientation="vertical" name="inventory_layout_stack" - height="545" + height="540" width="330"> + height="480"> + min_dim="35" + name="inbox_layout_panel" + max_dim="125" + height="35"> - - + Just a panel - + + + + + - Just a panel 2 - - - - - - + Just a panel + + Date: Tue, 24 May 2011 09:38:49 -0700 Subject: Added badges version 0.1 to buttons. Reviewed by Richard --- indra/newview/skins/default/colors.xml | 6 ++++++ indra/newview/skins/default/textures/textures.xml | 2 ++ indra/newview/skins/default/textures/widgets/Badge.png | Bin 0 -> 1716 bytes indra/newview/skins/default/xui/en/widgets/badge.xml | 14 ++++++++++++++ 4 files changed, 22 insertions(+) create mode 100644 indra/newview/skins/default/textures/widgets/Badge.png create mode 100644 indra/newview/skins/default/xui/en/widgets/badge.xml (limited to 'indra/newview') diff --git a/indra/newview/skins/default/colors.xml b/indra/newview/skins/default/colors.xml index a19eccf748..0795e38366 100644 --- a/indra/newview/skins/default/colors.xml +++ b/indra/newview/skins/default/colors.xml @@ -132,6 +132,12 @@ + + diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 4f19dd9a6d..2a78337f65 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -72,6 +72,8 @@ with the same filename but different name + + diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png new file mode 100644 index 0000000000..afda6b66b9 Binary files /dev/null and b/indra/newview/skins/default/textures/widgets/Badge.png differ diff --git a/indra/newview/skins/default/xui/en/widgets/badge.xml b/indra/newview/skins/default/xui/en/widgets/badge.xml new file mode 100644 index 0000000000..4eb633ac0c --- /dev/null +++ b/indra/newview/skins/default/xui/en/widgets/badge.xml @@ -0,0 +1,14 @@ + + + + -- cgit v1.2.3 From 1a5b3b0a9091a72fd5e5fb395f7f0c97b0fd502c Mon Sep 17 00:00:00 2001 From: Dave SIMmONs Date: Tue, 24 May 2011 10:44:27 -0700 Subject: ER-914: Disable Parcel Privacy UI in viewer if on older sim --- indra/newview/llfloaterland.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d9d2c3d5a6..8de93a385f 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2036,7 +2036,7 @@ void LLPanelLandOptions::refresh() mPrivateParcelCtrl->set(parcel->getPrivacy()); mPrivateParcelCtrl->setLabel(getString("private_parcel_text")); - mPrivateParcelCtrl->setEnabled(can_change_options); + mPrivateParcelCtrl->setEnabled(can_change_options && parcel->getHavePrivacyData()); BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); -- cgit v1.2.3 From 610b15aee47c5fae9df45b2d5ae515fd06b5a536 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 25 May 2011 10:30:44 -0700 Subject: Updated badge to different art that is opaque --- indra/newview/skins/default/textures/widgets/Badge.png | Bin 1716 -> 958 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/textures/widgets/Badge.png b/indra/newview/skins/default/textures/widgets/Badge.png index afda6b66b9..862b13d219 100644 Binary files a/indra/newview/skins/default/textures/widgets/Badge.png and b/indra/newview/skins/default/textures/widgets/Badge.png differ -- cgit v1.2.3 From 33e4a2c7b1ab3a06f1adb5edd9850523c897ea77 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 25 May 2011 10:39:34 -0700 Subject: Updated Marketplace Inbox & Outbox panel to maintain size when one is expanded vs the other --- indra/newview/llsidepanelinventory.cpp | 49 +-- .../skins/default/xui/en/sidepanel_inventory.xml | 403 +++++++++++---------- 2 files changed, 235 insertions(+), 217 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 7f5a2e64bf..9247611257 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -134,38 +134,45 @@ BOOL LLSidepanelInventory::postBuild() } -void LLSidepanelInventory::onToggleInboxBtn() +void manageInboxOutboxPanels(LLLayoutStack * stack, + LLButton * pressedButton, LLLayoutPanel * pressedPanel, + LLButton * otherButton, LLLayoutPanel * otherPanel) { - LLLayoutStack* stack = getChild("inventory_layout_stack"); - bool collapse = !getChild("inbox_btn")->getToggleState(); + bool expand = pressedButton->getToggleState(); + bool otherExpanded = otherButton->getToggleState(); - if (stack) - { - stack->collapsePanel(getChild("inbox_layout_panel"), collapse); - } - if (!collapse) + if (expand && otherExpanded) { - stack->collapsePanel(getChild("outbox_layout_panel"), true); - getChild("outbox_btn")->setToggleState(false); + // Reshape pressedPanel to the otherPanel's height so we preserve the marketplace panel size + pressedPanel->reshape(pressedPanel->getRect().getWidth(), otherPanel->getRect().getHeight()); + + stack->collapsePanel(otherPanel, true); + otherButton->setToggleState(false); } + + stack->collapsePanel(pressedPanel, !expand); } -void LLSidepanelInventory::onToggleOutboxBtn() +void LLSidepanelInventory::onToggleInboxBtn() { LLLayoutStack* stack = getChild("inventory_layout_stack"); - bool collapse = !getChild("outbox_btn")->getToggleState(); + LLButton* pressedButton = getChild("inbox_btn"); + LLLayoutPanel* pressedPanel = getChild("inbox_layout_panel"); + LLButton* otherButton = getChild("outbox_btn"); + LLLayoutPanel* otherPanel = getChild("outbox_layout_panel"); - if (stack) - { - stack->collapsePanel(getChild("outbox_layout_panel"), collapse); - } + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); +} - if (!collapse) - { - stack->collapsePanel(getChild("inbox_layout_panel"), true); - getChild("inbox_btn")->setToggleState(false); - } +void LLSidepanelInventory::onToggleOutboxBtn() +{ + LLLayoutStack* stack = getChild("inventory_layout_stack"); + LLButton* pressedButton = getChild("outbox_btn"); + LLLayoutPanel* pressedPanel = getChild("outbox_layout_panel"); + LLButton* otherButton = getChild("inbox_btn"); + LLLayoutPanel* otherPanel = getChild("inbox_layout_panel"); + manageInboxOutboxPanels(stack, pressedButton, pressedPanel, otherButton, otherPanel); } diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index a0caf80256..ce5cf4c622 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -9,170 +9,181 @@ min_width="240" name="objects panel" width="333"> - - - - - - - - - - Just a panel - - - - - - - - + + + + + + + - Just a panel + -- cgit v1.2.3 From bff172b374fa12e646d427e09f2ffac4289ab654 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 30 May 2011 15:38:37 -0700 Subject: EXP-824 Adding volume slider and block btn in basic mode IM panel --- indra/newview/llpanelimcontrolpanel.cpp | 92 +++++++- indra/newview/llpanelimcontrolpanel.h | 6 + .../minimal/xui/en/panel_im_control_panel.xml | 249 ++++++++++++++------- 3 files changed, 257 insertions(+), 90 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 0cc5dcda82..06c8d496ff 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -99,7 +99,8 @@ void LLPanelChatControlPanel::updateCallButton() void LLPanelChatControlPanel::updateButtons(bool is_call_started) { getChildView("end_call_btn_panel")->setVisible( is_call_started); - getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started); + getChildView("volume_ctrl_panel")->setVisible( is_call_started); + getChildView("voice_ctrls_btn_panel")->setVisible( is_call_started && findChild("voice_ctrls_btn_panel")); getChildView("call_btn_panel")->setVisible( ! is_call_started); updateCallButton(); @@ -119,9 +120,9 @@ BOOL LLPanelChatControlPanel::postBuild() childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this)); - + LLVoiceClient::getInstance()->addObserver(this); - + return TRUE; } @@ -156,13 +157,93 @@ BOOL LLPanelIMControlPanel::postBuild() childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); + + childSetAction("mute_btn", boost::bind(&LLPanelIMControlPanel::onClickMuteVolume, this)); + childSetAction("block_btn", boost::bind(&LLPanelIMControlPanel::onClickBlock, this)); + childSetAction("unblock_btn", boost::bind(&LLPanelIMControlPanel::onClickUnblock, this)); + + getChild("volume_slider")->setCommitCallback(boost::bind(&LLPanelIMControlPanel::onVolumeChange, this, _2)); + getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); - + return LLPanelChatControlPanel::postBuild(); } +void LLPanelIMControlPanel::draw() +{ + bool is_muted = LLMuteList::getInstance()->isMuted(mAvatarID); + + getChild("block_btn_panel")->setVisible(!is_muted); + getChild("unblock_btn_panel")->setVisible(is_muted); + + if (getChildView("volume_ctrl_panel")->getVisible()) + { + + bool is_muted_voice = LLMuteList::getInstance()->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLUICtrl* mute_btn = getChild("mute_btn"); + mute_btn->setValue( is_muted_voice ); + + LLUICtrl* volume_slider = getChild("volume_slider"); + volume_slider->setEnabled( !is_muted_voice ); + + F32 volume; + + if (is_muted_voice) + { + // it's clearer to display their volume as zero + volume = 0.f; + } + else + { + // actual volume + volume = LLVoiceClient::getInstance()->getUserVolume(mAvatarID); + } + volume_slider->setValue( (F64)volume ); + } + + LLPanelChatControlPanel::draw(); +} + +void LLPanelIMControlPanel::onClickMuteVolume() +{ + // By convention, we only display and toggle voice mutes, not all mutes + LLMuteList* mute_list = LLMuteList::getInstance(); + bool is_muted = mute_list->isMuted(mAvatarID, LLMute::flagVoiceChat); + + LLMute mute(mAvatarID, getChild("avatar_name")->getText(), LLMute::AGENT); + if (!is_muted) + { + mute_list->add(mute, LLMute::flagVoiceChat); + } + else + { + mute_list->remove(mute, LLMute::flagVoiceChat); + } +} + +void LLPanelIMControlPanel::onClickBlock() +{ + LLMute mute(mAvatarID, getChild("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->add(mute); +} + +void LLPanelIMControlPanel::onClickUnblock() +{ + LLMute mute(mAvatarID, getChild("avatar_name")->getText(), LLMute::AGENT); + + LLMuteList::getInstance()->remove(mute); +} + +void LLPanelIMControlPanel::onVolumeChange(const LLSD& data) +{ + F32 volume = (F32)data.asReal(); + LLVoiceClient::getInstance()->setUserVolume(mAvatarID, volume); +} + void LLPanelIMControlPanel::onTeleportButtonClicked() { LLAvatarActions::offerTeleport(mAvatarID); @@ -262,6 +343,9 @@ void LLPanelIMControlPanel::onNameCache(const LLUUID& id, const std::string& ful std::string avatar_name = full_name; getChild("avatar_name")->setValue(avatar_name); getChild("avatar_name")->setToolTip(avatar_name); + + bool is_linden = LLStringUtil::endsWith(full_name, " Linden"); + getChild("mute_btn")->setEnabled( !is_linden); } } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index 3bbe24ecb9..76d4475b74 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -94,6 +94,12 @@ private: void onPayButtonClicked(); void onFocusReceived(); + void onClickMuteVolume(); + void onClickBlock(); + void onClickUnblock(); + /*virtual*/ void draw(); + void onVolumeChange(const LLSD& data); + LLUUID mAvatarID; }; diff --git a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml index be13bc1bb7..a9c7b624fd 100644 --- a/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml +++ b/indra/newview/skins/minimal/xui/en/panel_im_control_panel.xml @@ -23,102 +23,179 @@ orientation="vertical" top_pad="5" width="145"> - - -- cgit v1.2.3 From 0d246c0c5fc3ddef2022572b560eaec0018a722e Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 16 Jun 2011 17:14:51 -0700 Subject: EXP-872 PROGRESS -- Hide Inbox unless applicable EXP-910 FIX -- Newness badge shown on suitcase inventory icon when InventoryDisplayInbox is set to False EXP-895 FIX -- Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel * Main inventory, outbox and inbox all clear the selection of the others when they gain focus * The Fresh Item Count badge is no longer displayed on the inventory side tab button when the inbox is disabled * The New Item Count text is no longer displayed. (we will enable it again when freshness is supported) --- indra/newview/llpanelmaininventory.cpp | 20 ++++++++++++++++ indra/newview/llpanelmaininventory.h | 2 ++ indra/newview/llpanelmarketplaceinbox.cpp | 38 ++++++++++++++++++++++++++++-- indra/newview/llpanelmarketplaceinbox.h | 2 ++ indra/newview/llpanelmarketplaceoutbox.cpp | 28 ++++++++++++++++++++++ indra/newview/llpanelmarketplaceoutbox.h | 2 ++ indra/newview/llsidepanelinventory.cpp | 37 ++++++++++++++++++++--------- indra/newview/llsidepanelinventory.h | 8 ++++++- 8 files changed, 123 insertions(+), 14 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index bc4998dd0c..9f797eb147 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -193,6 +193,9 @@ BOOL LLPanelMainInventory::postBuild() mMenuAdd->getChild("Upload Animation")->setLabelArg("[COST]", upload_cost); mMenuAdd->getChild("Bulk Upload")->setLabelArg("[COST]", upload_cost); + // Trigger callback for focus received so we can deselect items in inbox/outbox + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMainInventory::onFocusReceived, this)); + return TRUE; } @@ -572,6 +575,23 @@ void LLPanelMainInventory::updateItemcountText() getChild("ItemcountText")->setValue(text); } +void LLPanelMainInventory::onFocusReceived() +{ + LLInventoryPanel * inbox_panel = findChild("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = findChild("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } +} + void LLPanelMainInventory::setFilterTextFromFilter() { mFilterText = mActivePanel->getFilter()->getFilterText(); diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h index 2b2ee1c0c9..86b2c87e0b 100644 --- a/indra/newview/llpanelmaininventory.h +++ b/indra/newview/llpanelmaininventory.h @@ -114,6 +114,8 @@ protected: bool isSaveTextureEnabled(const LLSD& userdata); void updateItemcountText(); + void onFocusReceived(); + private: LLFloaterInventoryFinder* getFinder(); diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 0fe2560fbf..eff27aa541 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -31,6 +31,11 @@ #include "llappviewer.h" #include "llbutton.h" #include "llinventorypanel.h" +#include "llsidepanelinventory.h" + + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); @@ -59,6 +64,8 @@ BOOL LLPanelMarketplaceInbox::postBuild() LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); + return TRUE; } @@ -68,6 +75,28 @@ void LLPanelMarketplaceInbox::handleLoginComplete() LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); } +void LLPanelMarketplaceInbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + } +} + BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) { *accept = ACCEPT_NO; @@ -126,8 +155,9 @@ std::string LLPanelMarketplaceInbox::getBadgeString() const { std::string item_count_str(""); - // If side panel collapsed or expanded and not inventory - if (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory")) + // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel + if (getParent()->getVisible() && + (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) { U32 item_count = getFreshItemCount(); @@ -154,6 +184,7 @@ void LLPanelMarketplaceInbox::draw() args["[NUM]"] = item_count_str; getChild("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); +#if SUPPORTING_FRESH_ITEM_COUNT // set green text to fresh item count U32 fresh_item_count = getFreshItemCount(); fresh_new_count_view->setVisible((fresh_item_count > 0)); @@ -162,6 +193,9 @@ void LLPanelMarketplaceInbox::draw() { getChild("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); } +#else + fresh_new_count_view->setVisible(FALSE); +#endif } else { diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index 21069a0ea1..d5b216b56d 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -63,6 +63,8 @@ public: private: void handleLoginComplete(); + void onFocusReceived(); + private: LLInventoryPanel* mInventoryPanel; }; diff --git a/indra/newview/llpanelmarketplaceoutbox.cpp b/indra/newview/llpanelmarketplaceoutbox.cpp index 96695becf0..c8752b3e0f 100644 --- a/indra/newview/llpanelmarketplaceoutbox.cpp +++ b/indra/newview/llpanelmarketplaceoutbox.cpp @@ -31,7 +31,11 @@ #include "llbutton.h" #include "llcoros.h" #include "lleventcoro.h" +#include "llinventorypanel.h" #include "llloadingindicator.h" +#include "llpanelmarketplaceinbox.h" +#include "llsidepanelinventory.h" +#include "llsidetray.h" #include "lltimer.h" @@ -60,9 +64,33 @@ BOOL LLPanelMarketplaceOutbox::postBuild() mSyncButton->setEnabled(!isOutboxEmpty()); + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceOutbox::onFocusReceived, this)); + return TRUE; } +void LLPanelMarketplaceOutbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild("inventory_inbox"); + + if (inbox_panel) + { + inbox_panel->clearSelection(); + } + } +} + bool LLPanelMarketplaceOutbox::isOutboxEmpty() const { // TODO: Check for contents of outbox diff --git a/indra/newview/llpanelmarketplaceoutbox.h b/indra/newview/llpanelmarketplaceoutbox.h index 2fbe819762..94bc066224 100644 --- a/indra/newview/llpanelmarketplaceoutbox.h +++ b/indra/newview/llpanelmarketplaceoutbox.h @@ -54,6 +54,8 @@ protected: void onSyncButtonClicked(); void updateSyncButtonStatus(); + void onFocusReceived(); + private: LLButton * mSyncButton; LLLoadingIndicator * mSyncIndicator; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index d916c430a8..32394da042 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -32,10 +32,10 @@ #include "llappviewer.h" #include "llavataractions.h" #include "llbutton.h" -#include "llcurl.h" #include "lldate.h" #include "llfirstuse.h" #include "llfoldertype.h" +#include "llhttpclient.h" #include "llinventorybridge.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" @@ -69,6 +69,9 @@ static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel"; +static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; +static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; + static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; // @@ -84,14 +87,23 @@ public: { } - void errorWithContent(U32 status, const std::string& reason, const LLSD& content) + void completed(U32 status, const std::string& reason, const LLSD& content) { - llinfos << "Marketplace Inbox Disabled" << llendl; - } - - void result(const LLSD& content) - { - mSidepanelInventory->enableInbox(true); + if (isGoodStatus(status)) + { + // Complete success + mSidepanelInventory->enableInbox(true); + } + else if (status == 401) + { + // API is available for use but OpenID authorization failed + mSidepanelInventory->enableInbox(true); + } + else + { + // API in unavailable + llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; + } } private: @@ -106,7 +118,8 @@ LLSidepanelInventory::LLSidepanelInventory() : LLPanel() , mItemPanel(NULL) , mPanelMainInventory(NULL) - , mInventoryFetched(false) + , mInboxEnabled(false) + , mOutboxEnabled(false) , mCategoriesObserver(NULL) { //buildFromFile( "panel_inventory.xml"); // Called from LLRegisterPanelClass::defaultPanelClassBuilder() @@ -205,8 +218,8 @@ BOOL LLSidepanelInventory::postBuild() outbox_button->setCommitCallback(boost::bind(&LLSidepanelInventory::onToggleOutboxBtn, this)); // Set the inbox and outbox visible based on debug settings (final setting comes from http request below) - inbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayInbox")); - outbox_panel->setVisible(gSavedSettings.getBOOL("InventoryDisplayOutbox")); + enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); + enableOutbox(gSavedSettings.getBOOL("InventoryDisplayOutbox")); // Trigger callback for after login so we can setup to track inbox and outbox changes after initial inventory load LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); @@ -258,11 +271,13 @@ void LLSidepanelInventory::handleLoginComplete() void LLSidepanelInventory::enableInbox(bool enabled) { + mInboxEnabled = enabled; getChild(INBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); } void LLSidepanelInventory::enableOutbox(bool enabled) { + mOutboxEnabled = enabled; getChild(OUTBOX_LAYOUT_PANEL_NAME)->setVisible(enabled); } diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index 25fc28d56b..b68abd65cc 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -43,8 +43,10 @@ public: LLSidepanelInventory(); virtual ~LLSidepanelInventory(); +private: void handleLoginComplete(); +public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); @@ -65,6 +67,9 @@ public: void enableInbox(bool enabled); void enableOutbox(bool enabled); + bool isInboxEnabled() const { return mInboxEnabled; } + bool isOutboxEnabled() const { return mOutboxEnabled; } + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -107,7 +112,8 @@ private: LLButton* mOverflowBtn; LLButton* mShopBtn; - bool mInventoryFetched; + bool mInboxEnabled; + bool mOutboxEnabled; LLInventoryCategoriesObserver* mCategoriesObserver; }; -- cgit v1.2.3 From 6215e6ba2542633afc5f8957817015f4bcf9f3cf Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Fri, 17 Jun 2011 13:22:13 -0700 Subject: EXP-872 PROGRESS -- Hide inbox unless applicable * Updated to use the current user's agent id instead of Pup's Reviewed by Leyla :) --- indra/newview/llsidepanelinventory.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 32394da042..787ebd29c2 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -241,10 +241,12 @@ void LLSidepanelInventory::handleLoginComplete() std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; - std::string url_suffix = "api/1/users/b72d31f8-d03c-4a3b-a002-3dd7b4a712b8/user_status"; - - LLHTTPClient::get(url + url_suffix, new LLInventoryUserStatusResponder(this)); + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this)); // // Track inbox and outbox folder changes -- cgit v1.2.3 From 353da63a07b07b75ad73b9f5cb8e463d07ebea3a Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Jun 2011 15:24:24 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* cleaned up and refactored inventory code a bit reviewed by Leyla --- indra/newview/llfolderview.cpp | 49 +++-- indra/newview/llfolderview.h | 9 +- indra/newview/llfolderviewitem.cpp | 119 +++++++++--- indra/newview/llfolderviewitem.h | 14 +- indra/newview/llinventoryfilter.cpp | 122 +++++------- indra/newview/llinventoryfilter.h | 6 +- indra/newview/llinventorypanel.cpp | 324 +++++++++++++++---------------- indra/newview/llinventorypanel.h | 19 +- indra/newview/llpanellandmarks.cpp | 4 +- indra/newview/llplacesinventorypanel.cpp | 85 +++----- indra/newview/lltexturectrl.cpp | 1 - 11 files changed, 370 insertions(+), 382 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..260693ebc7 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -167,13 +167,22 @@ void LLCloseAllFoldersFunctor::doItem(LLFolderViewItem* item) ///---------------------------------------------------------------------------- /// Class LLFolderView ///---------------------------------------------------------------------------- +LLFolderView::Params::Params() +: task_id("task_id"), + title("title"), + use_label_suffix("use_label_suffix"), + allow_multiselect("allow_multiselect", true), + use_ellipses("use_ellipses", false) +{ +} + // Default constructor LLFolderView::LLFolderView(const Params& p) : LLFolderViewFolder(p), mScrollContainer( NULL ), mPopupMenuHandle(), - mAllowMultiSelect(TRUE), + mAllowMultiSelect(p.allow_multiselect), mShowFolderHierarchy(FALSE), mSourceID(p.task_id), mRenameItem( NULL ), @@ -194,10 +203,12 @@ LLFolderView::LLFolderView(const Params& p) mDragAndDropThisFrame(FALSE), mCallbackRegistrar(NULL), mParentPanel(p.parent_panel), - mUseEllipses(false), + mUseEllipses(p.use_ellipses), mDraggingOverItem(NULL), mStatusTextBox(NULL) { + mRoot = this; + LLRect rect = p.rect; LLRect new_rect(rect.mLeft, rect.mBottom + getRect().getHeight(), rect.mLeft + getRect().getWidth(), rect.mBottom); setRect( rect ); @@ -424,11 +435,7 @@ S32 LLFolderView::arrange( S32* unused_width, S32* unused_height, S32 filter_gen (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } - // Need to call arrange regardless of visibility, since children's visibility - // might need to be changed too (e.g. even though a folder is invisible, its - // children also need to be set invisible for state-tracking purposes, e.g. - // llfolderviewitem::filter). - // if (folderp->getVisible()) + if (folderp->getVisible()) { S32 child_height = 0; S32 child_width = 0; @@ -764,7 +771,7 @@ void LLFolderView::sanitizeSelection() } // Don't allow invisible items (such as root folders) to be selected. - if (item->getHidden()) + if (item == getRoot()) { items_to_remove.push_back(item); } @@ -787,7 +794,7 @@ void LLFolderView::sanitizeSelection() parent_folder; parent_folder = parent_folder->getParentFolder()) { - if (parent_folder->potentiallyVisible() && !parent_folder->getHidden()) + if (parent_folder->potentiallyVisible()) { // give initial selection to first ancestor folder that potentially passes the filter if (!new_selection) @@ -808,11 +815,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) @@ -962,7 +964,9 @@ void LLFolderView::draw() } - LLFolderViewFolder::draw(); + // skip over LLFolderViewFolder::draw since we don't want the folder icon, label, + // and arrow for the root folder + LLView::draw(); mDragAndDropThisFrame = FALSE; } @@ -1642,11 +1646,7 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask ) LLFolderViewItem* parent_folder = last_selected->getParentFolder(); if (!last_selected->isOpen() && parent_folder && parent_folder->getParentFolder()) { - // Don't change selectin to hidden folder. See EXT-5328. - if (!parent_folder->getHidden()) - { - setSelection(parent_folder, FALSE, TRUE); - } + setSelection(parent_folder, FALSE, TRUE); } else { @@ -2031,7 +2031,7 @@ void LLFolderView::removeItemID(const LLUUID& id) LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2048,7 +2048,7 @@ LLFolderViewItem* LLFolderView::getItemByID(const LLUUID& id) LLFolderViewFolder* LLFolderView::getFolderByID(const LLUUID& id) { - if (id.isNull()) + if (id == getListener()->getUUID()) { return this; } @@ -2496,11 +2496,6 @@ BOOL LLFolderView::isFilterModified() return mFilter->isNotDefault(); } -BOOL LLFolderView::getAllowMultiSelect() -{ - return mAllowMultiSelect; -} - void delete_selected_item(void* user_data) { if(user_data) diff --git a/indra/newview/llfolderview.h b/indra/newview/llfolderview.h index 1464a058d8..12f6170a7d 100644 --- a/indra/newview/llfolderview.h +++ b/indra/newview/llfolderview.h @@ -89,7 +89,11 @@ public: Mandatory parent_panel; Optional task_id; Optional title; - Optional use_label_suffix; + Optional use_label_suffix, + allow_multiselect, + use_ellipses; + + Params(); }; LLFolderView(const Params&); virtual ~LLFolderView( void ); @@ -102,7 +106,6 @@ public: // and resort the items if necessary. void setSortOrder(U32 order); void setFilterPermMask(PermissionMask filter_perm_mask); - void setAllowMultiSelect(BOOL allow) { mAllowMultiSelect = allow; } typedef boost::signals2::signal& items, BOOL user_action)> signal_t; void setSelectCallback(const signal_t::slot_type& cb) { mSelectSignal.connect(cb); } @@ -117,7 +120,6 @@ public: //LLInventoryFilter::EFolderShow getShowFolderState(); U32 getSortOrder() const; BOOL isFilterModified(); - BOOL getAllowMultiSelect(); // Close all folders in the view void closeAllFolders(); @@ -238,7 +240,6 @@ public: void setShowSingleSelection(BOOL show); BOOL getShowSingleSelection() { return mShowSingleSelection; } F32 getSelectionFadeElapsedTime() { return mMultiSelectionFadeTimer.getElapsedTimeF32(); } - void setUseEllipses(bool use_ellipses) { mUseEllipses = use_ellipses; } bool getUseEllipses() { return mUseEllipses; } void addItemID(const LLUUID& id, LLFolderViewItem* itemp); diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index e9d1ad3a9e..904c233850 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -132,8 +132,13 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mListener(p.listener), mHidden(false), mShowLoadStatus(false) +{ +} + +BOOL LLFolderViewItem::postBuild() { refresh(); + return TRUE; } // Destroys the object @@ -195,7 +200,7 @@ LLFolderViewItem* LLFolderViewItem::getPreviousOpenNode(BOOL include_children) LLFolderViewItem* itemp = mParentFolder->getPreviousFromChild( this, include_children ); // Skip over items that are invisible or are hidden from the UI. - while(itemp && (!itemp->getVisible() || itemp->getHidden())) + while(itemp && !itemp->getVisible()) { LLFolderViewItem* next_itemp = itemp->mParentFolder->getPreviousFromChild( itemp, include_children ); if (itemp == next_itemp) @@ -351,7 +356,10 @@ void LLFolderViewItem::arrangeAndSet(BOOL set_selection, BOOL take_keyboard_focus) { LLFolderView* root = getRoot(); - getParentFolder()->requestArrange(); + if (getParentFolder()) + { + getParentFolder()->requestArrange(); + } if(set_selection) { setSelectionFromRoot(this, TRUE, take_keyboard_focus); @@ -442,23 +450,20 @@ S32 LLFolderViewItem::arrange( S32* width, S32* height, S32 filter_generation) S32 LLFolderViewItem::getItemHeight() { - if (getHidden()) return 0; - return mItemHeight; } void LLFolderViewItem::filter( LLInventoryFilter& filter) { const BOOL previous_passed_filter = mPassedFilter; - const BOOL passed_filter = mListener && filter.check(this); + const BOOL passed_filter = filter.check(this); // If our visibility will change as a result of this filter, then // we need to be rearranged in our parent folder if (mParentFolder) { - if (getVisible() != passed_filter) - mParentFolder->requestArrange(); - if (passed_filter != previous_passed_filter) + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) mParentFolder->requestArrange(); } @@ -863,11 +868,6 @@ BOOL LLFolderViewItem::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, void LLFolderViewItem::draw() { - if (getHidden()) - { - return; - } - static LLUIColor sFgColor = LLUIColorTable::instance().getColor("MenuItemEnabledColor", DEFAULT_WHITE); static LLUIColor sHighlightBgColor = LLUIColorTable::instance().getColor("MenuItemHighlightBgColor", DEFAULT_WHITE); static LLUIColor sHighlightFgColor = LLUIColorTable::instance().getColor("MenuItemHighlightFgColor", DEFAULT_WHITE); @@ -891,8 +891,8 @@ void LLFolderViewItem::draw() // Draw open folder arrow // const bool up_to_date = mListener && mListener->isUpToDate(); - const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) || // we fetched our children and some of them have passed the filter... - (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) + const bool possibly_has_children = ((up_to_date && hasVisibleChildren()) // we fetched our children and some of them have passed the filter... + || (!up_to_date && mListener && mListener->hasChildren())); // ...or we know we have children but haven't fetched them (doesn't obey filter) if (possibly_has_children) { LLUIImage* arrow_image = default_params.folder_arrow_image; @@ -1054,8 +1054,11 @@ void LLFolderViewItem::draw() { root_is_loading = LLInventoryModelBackgroundFetch::instance().libraryFetchInProgress(); } - if ((mIsLoading && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) || - (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && root_is_loading && (mShowLoadStatus || mHidden))) + if ((mIsLoading + && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) + || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() + && root_is_loading + && (mShowLoadStatus || mHidden))) { std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) "; font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, @@ -1119,7 +1122,8 @@ LLFolderViewFolder::LLFolderViewFolder( const LLFolderViewItem::Params& p ): mLastCalculatedWidth(0), mCompletedFilterGeneration(-1), mMostFilteredDescendantGeneration(-1), - mNeedsSort(false) + mNeedsSort(false), + mPassedFolderFilter(FALSE) { } @@ -1131,6 +1135,17 @@ LLFolderViewFolder::~LLFolderViewFolder( void ) gFocusMgr.releaseFocusIfNeeded( this ); // calls onCommit() } +void LLFolderViewFolder::setFilteredFolder(bool filtered, S32 filter_generation) +{ + mPassedFolderFilter = filtered; + mLastFilterGeneration = filter_generation; +} + +bool LLFolderViewFolder::getFilteredFolder(S32 filter_generation) +{ + return mPassedFolderFilter && mLastFilterGeneration >= getRoot()->getFilter()->getMinRequiredGeneration(); +} + // addToFolder() returns TRUE if it succeeds. FALSE otherwise BOOL LLFolderViewFolder::addToFolder(LLFolderViewFolder* folder, LLFolderView* root) { @@ -1190,8 +1205,10 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) } else { - folderp->setVisible(show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS || // always show folders? - (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter + folderp->setVisible( + folderp->getFilteredFolder(filter_generation) // folder must pass folder filters + && (folderp->getFiltered(filter_generation) + || folderp->hasFilteredDescendants(filter_generation))); // passed item filter or has descendants that passed filter } if (folderp->getVisible()) @@ -1311,7 +1328,9 @@ void LLFolderViewFolder::setCompletedFilterGeneration(S32 generation, BOOL recur mMostFilteredDescendantGeneration = llmin(mMostFilteredDescendantGeneration, generation); mCompletedFilterGeneration = generation; // only aggregate up if we are a lower (older) value - if (recurse_up && mParentFolder && generation < mParentFolder->getCompletedFilterGeneration()) + if (recurse_up + && mParentFolder + && generation < mParentFolder->getCompletedFilterGeneration()) { mParentFolder->setCompletedFilterGeneration(generation, TRUE); } @@ -1336,15 +1355,17 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) // filter folder itself if (getLastFilterGeneration() < filter_generation) { - if (getLastFilterGeneration() >= must_pass_generation && // folder has been compared to a valid precursor filter - !mPassedFilter) // and did not pass the filter + if (getLastFilterGeneration() >= must_pass_generation // folder has been compared to a valid precursor filter + && !mPassedFilter) // and did not pass the filter { // go ahead and flag this folder as done mLastFilterGeneration = filter_generation; } - else + else // filter self only on first pass through { - // filter self only on first pass through + // filter against folder rules + filterFolder(filter); + // and then item rules LLFolderViewItem::filter( filter ); } if (mHidden) @@ -1377,7 +1398,10 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } // when applying a filter, matching folders get their contents downloaded first - if (filter.isNotDefault() && getFiltered(filter.getMinRequiredGeneration()) && (mListener && !gInventory.isCategoryComplete(mListener->getUUID()))) + if (filter.isNotDefault() + && getFiltered(filter.getMinRequiredGeneration()) + && (mListener + && !gInventory.isCategoryComplete(mListener->getUUID()))) { LLInventoryModelBackgroundFetch::instance().start(mListener->getUUID()); } @@ -1467,6 +1491,31 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) } } +void LLFolderViewFolder::filterFolder(LLInventoryFilter& filter) +{ + const BOOL previous_passed_filter = mPassedFolderFilter; + const BOOL passed_filter = filter.checkFolder(this); + + // If our visibility will change as a result of this filter, then + // we need to be rearranged in our parent folder + if (mParentFolder) + { + if (getVisible() != passed_filter + || previous_passed_filter != passed_filter ) + { + mParentFolder->requestArrange(); + } + } + + setFilteredFolder(passed_filter, filter.getCurrentGeneration()); + filter.decrementFilterCount(); + + if (getRoot()->getDebugFilters()) + { + mStatusText = llformat("%d", mLastFilterGeneration); + } +} + void LLFolderViewFolder::setFiltered(BOOL filtered, S32 filter_generation) { // if this folder is now filtered, but wasn't before @@ -2059,7 +2108,9 @@ void LLFolderViewFolder::setOpenArrangeRecursively(BOOL openitem, ERecurseType r (*fit)->setOpenArrangeRecursively(openitem, RECURSE_DOWN); /* Flawfinder: ignore */ } } - if (mParentFolder && (recurse == RECURSE_UP || recurse == RECURSE_UP_DOWN)) + if (mParentFolder + && (recurse == RECURSE_UP + || recurse == RECURSE_UP_DOWN)) { mParentFolder->setOpenArrangeRecursively(openitem, RECURSE_UP); } @@ -2301,13 +2352,16 @@ void LLFolderViewFolder::draw() bool possibly_has_children = false; bool up_to_date = mListener && mListener->isUpToDate(); - if(!up_to_date && mListener && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) + if(!up_to_date + && mListener->hasChildren()) // we know we have children but haven't fetched them (doesn't obey filter) { possibly_has_children = true; } - BOOL loading = ( mIsOpen && possibly_has_children && !up_to_date ); + BOOL loading = (mIsOpen + && possibly_has_children + && !up_to_date ); if ( loading && !mIsLoading ) { @@ -2573,7 +2627,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde { // ignore sort order for landmarks in the Favorites folder. // they should be always sorted as in Favorites bar. See EXT-719 - if (a->getSortGroup() == SG_ITEM && b->getSortGroup() == SG_ITEM + if (a->getSortGroup() == SG_ITEM + && b->getSortGroup() == SG_ITEM && a->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK && b->getListener()->getInventoryType() == LLInventoryType::IT_LANDMARK) { @@ -2600,8 +2655,8 @@ bool LLInventorySort::operator()(const LLFolderViewItem* const& a, const LLFolde // We sort by name if we aren't sorting by date // OR if these are folders and we are sorting folders by name. bool by_name = (!mByDate - || (mFoldersByName - && (a->getSortGroup() != SG_ITEM))); + || (mFoldersByName + && (a->getSortGroup() != SG_ITEM))); if (a->getSortGroup() != b->getSortGroup()) { diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index fc941510ab..c48e568b30 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -174,6 +174,8 @@ protected: static LLFontGL* getLabelFontForStyle(U8 style); public: + BOOL postBuild(); + // This function clears the currently selected item, and records // the specified selected item appropriately for display and use // in the UI. If open is TRUE, then folders are opened up along @@ -202,11 +204,6 @@ public: virtual S32 arrange( S32* width, S32* height, S32 filter_generation ); virtual S32 getItemHeight(); - // Hide the folder from the UI, such as if you want to hide the root - // folder in an inventory panel. - void setHidden(bool hidden) { mHidden = hidden; } - bool getHidden() const { return mHidden; } - // applies filters to control visibility of inventory items virtual void filter( LLInventoryFilter& filter); @@ -392,6 +389,8 @@ protected: S32 mCompletedFilterGeneration; S32 mMostFilteredDescendantGeneration; bool mNeedsSort; + bool mPassedFolderFilter; + public: typedef enum e_recurse_type { @@ -432,6 +431,11 @@ public: virtual void filter( LLInventoryFilter& filter); virtual void setFiltered(BOOL filtered, S32 filter_generation); virtual void dirtyFilter(); + + // folder-specific filtering (filter status propagates top down instead of bottom up) + void filterFolder(LLInventoryFilter& filter); + void setFilteredFolder(bool filtered, S32 filter_generation); + bool getFilteredFolder(S32 filter_generation); // Passes selection information on to children and record // selection information if necessary. diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index dee15a1efd..49e0ab33e5 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -107,6 +107,31 @@ BOOL LLInventoryFilter::check(const LLFolderViewItem* item) return passed; } +bool LLInventoryFilter::checkFolder(const LLFolderViewFolder* folder) +{ + // we're showing all folders, overriding filter + if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) + { + return true; + } + + const LLFolderViewEventListener* listener = folder->getListener(); + const LLUUID folder_id = listener->getUUID(); + + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) + { + // Can only filter categories for items in your inventory + // (e.g. versus in-world object contents). + const LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); + if (!cat) + return false; + if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) + return false; + } + + return true; +} + BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) const { const LLFolderViewEventListener* listener = item->getListener(); @@ -137,30 +162,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con } } - - //////////////////////////////////////////////////////////////////////////////// - // FILTERTYPE_CATEGORY - // Pass if this item is a category of the filter type, or - // if its parent is a category of the filter type. - if (filterTypes & FILTERTYPE_CATEGORY) - { - // Can only filter categories for items in your inventory - // (e.g. versus in-world object contents). - if (!object) return FALSE; - - LLUUID cat_id = object_id; - if (listener->getInventoryType() != LLInventoryType::IT_CATEGORY) - { - cat_id = object->getParentUUID(); - } - const LLViewerInventoryCategory *cat = gInventory.getCategory(cat_id); - if (!cat) - return FALSE; - if ((1LL << cat->getPreferredType() & mFilterOps.mFilterCategoryTypes) == U64(0)) - return FALSE; - } - - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_UUID // Pass if this item is the target UUID or if it links to the target UUID @@ -172,7 +173,6 @@ BOOL LLInventoryFilter::checkAgainstFilterType(const LLFolderViewItem* item) con return FALSE; } - //////////////////////////////////////////////////////////////////////////////// // FILTERTYPE_DATE // Pass if this item is within the date range. @@ -293,15 +293,15 @@ BOOL LLInventoryFilter::isModifiedAndClear() return ret; } -void LLInventoryFilter::setFilterObjectTypes(U64 types) +void LLInventoryFilter::updateFilterTypes(U64 types, U64& current_types) { - if (mFilterOps.mFilterObjectTypes != types) + if (current_types != types) { // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterObjectTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterObjectTypes & types); + BOOL fewer_bits_set = (current_types & ~types); + BOOL more_bits_set = (~current_types & types); - mFilterOps.mFilterObjectTypes = types; + current_types = types; if (more_bits_set && fewer_bits_set) { // neither less or more restrive, both simultaneously @@ -318,62 +318,23 @@ void LLInventoryFilter::setFilterObjectTypes(U64 types) setModified(FILTER_MORE_RESTRICTIVE); } } +} + +void LLInventoryFilter::setFilterObjectTypes(U64 types) +{ + updateFilterTypes(types, mFilterOps.mFilterObjectTypes); mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; } void LLInventoryFilter::setFilterCategoryTypes(U64 types) { - if (mFilterOps.mFilterCategoryTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterCategoryTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterCategoryTypes & types); - - mFilterOps.mFilterCategoryTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } - mFilterOps.mFilterTypes |= FILTERTYPE_OBJECT; + updateFilterTypes(types, mFilterOps.mFilterCategoryTypes); + mFilterOps.mFilterTypes |= FILTERTYPE_CATEGORY; } void LLInventoryFilter::setFilterWearableTypes(U64 types) { - if (mFilterOps.mFilterWearableTypes != types) - { - // keep current items only if no type bits getting turned off - BOOL fewer_bits_set = (mFilterOps.mFilterWearableTypes & ~types); - BOOL more_bits_set = (~mFilterOps.mFilterWearableTypes & types); - - mFilterOps.mFilterWearableTypes = types; - if (more_bits_set && fewer_bits_set) - { - // neither less or more restrive, both simultaneously - // so we need to filter from scratch - setModified(FILTER_RESTART); - } - else if (more_bits_set) - { - // target is only one of all requested types so more type bits == less restrictive - setModified(FILTER_LESS_RESTRICTIVE); - } - else if (fewer_bits_set) - { - setModified(FILTER_MORE_RESTRICTIVE); - } - } + updateFilterTypes(types, mFilterOps.mFilterWearableTypes); mFilterOps.mFilterTypes |= FILTERTYPE_WEARABLE; } @@ -898,11 +859,16 @@ void LLInventoryFilter::fromLLSD(LLSD& data) } } -U32 LLInventoryFilter::getFilterObjectTypes() const +U64 LLInventoryFilter::getFilterObjectTypes() const { return mFilterOps.mFilterObjectTypes; } +U64 LLInventoryFilter::getFilterCategoryTypes() const +{ + return mFilterOps.mFilterCategoryTypes; +} + BOOL LLInventoryFilter::hasFilterString() const { return mFilterSubString.size() > 0; diff --git a/indra/newview/llinventoryfilter.h b/indra/newview/llinventoryfilter.h index 39e6f797a2..f9460822f7 100644 --- a/indra/newview/llinventoryfilter.h +++ b/indra/newview/llinventoryfilter.h @@ -31,6 +31,7 @@ #include "llpermissionsflags.h" class LLFolderViewItem; +class LLFolderViewFolder; class LLInventoryFilter { @@ -81,11 +82,13 @@ public: // + Parameters // +-------------------------------------------------------------------+ void setFilterObjectTypes(U64 types); - U32 getFilterObjectTypes() const; + U64 getFilterObjectTypes() const; + U64 getFilterCategoryTypes() const; BOOL isFilterObjectTypesWith(LLInventoryType::EType t) const; void setFilterCategoryTypes(U64 types); void setFilterUUID(const LLUUID &object_id); void setFilterWearableTypes(U64 types); + void updateFilterTypes(U64 types, U64& current_types); void setFilterSubString(const std::string& string); const std::string& getFilterSubString(BOOL trim = FALSE) const; @@ -110,6 +113,7 @@ public: // + Execution And Results // +-------------------------------------------------------------------+ BOOL check(const LLFolderViewItem* item); + bool checkFolder(const LLFolderViewFolder* folder); BOOL checkAgainstFilterType(const LLFolderViewItem* item) const; BOOL checkAgainstPermissions(const LLFolderViewItem* item) const; BOOL checkAgainstFilterLinks(const LLFolderViewItem* item) const; diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1dcb91ad4d..1ff423056a 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -132,8 +132,6 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mAllowMultiSelect(p.allow_multi_select), mShowItemLinkOverlays(p.show_item_link_overlays), mViewsInitialized(false), - mStartFolderString(p.start_folder), - mBuildDefaultHierarchy(true), mInvFVBridgeBuilder(NULL) { mInvFVBridgeBuilder = &INVENTORY_BRIDGE_BUILDER; @@ -146,11 +144,48 @@ LLInventoryPanel::LLInventoryPanel(const LLInventoryPanel::Params& p) : mCommitCallbackRegistrar.add("Inventory.AttachObject", boost::bind(&LLInventoryPanel::attachObject, this, _2)); mCommitCallbackRegistrar.add("Inventory.BeginIMSession", boost::bind(&LLInventoryPanel::beginIMSession, this)); mCommitCallbackRegistrar.add("Inventory.Share", boost::bind(&LLAvatarActions::shareWithAvatars)); - - if (mStartFolderString != "") + +} + +void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) +{ + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + LLUUID root_id; + + if ("LIBRARY" == params.start_folder()) { - mBuildDefaultHierarchy = false; + root_id = gInventory.getLibraryRootFolderID(); } + else + { + root_id = (preferred_type != LLFolderType::FT_NONE) + ? gInventory.findCategoryUUIDForType(preferred_type) + : LLUUID::null; + } + + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.parent_panel = this; + p.tool_tip = p.name; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.use_label_suffix = params.use_label_suffix; + p.allow_multiselect = mAllowMultiSelect; + mFolderRoot = LLUICtrlFactory::create(p); + } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) @@ -159,22 +194,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves - // Create root folder - { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - p.tool_tip = p.name; - p.use_label_suffix = params.use_label_suffix; - mFolderRoot = LLUICtrlFactory::create(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); - } + buildFolderView(params); mCommitCallbackRegistrar.popScope(); @@ -206,7 +226,7 @@ void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) // Build view of inventory if we need default full hierarchy and inventory ready, // otherwise wait for idle callback. - if (mBuildDefaultHierarchy && mInventory->isInventoryUsable() && !mViewsInitialized) + if (mInventory->isInventoryUsable() && !mViewsInitialized) { initializeViews(); } @@ -264,6 +284,15 @@ LLInventoryFilter* LLInventoryPanel::getFilter() return NULL; } +const LLInventoryFilter* LLInventoryPanel::getFilter() const +{ + if (mFolderRoot) + { + return mFolderRoot->getFilter(); + } + return NULL; +} + void LLInventoryPanel::setFilterTypes(U64 types, LLInventoryFilter::EFilterType filter_type) { if (filter_type == LLInventoryFilter::FILTERTYPE_OBJECT) @@ -488,23 +517,16 @@ void LLInventoryPanel::onIdle(void *userdata) } } +const LLUUID& LLInventoryPanel::getRootFolderID() const +{ + return mFolderRoot->getListener()->getUUID(); +} + void LLInventoryPanel::initializeViews() { if (!gInventory.isInventoryUsable()) return; - // Determine the root folder in case specified, and - // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(mStartFolderString); - - if ("LIBRARY" == mStartFolderString) - { - mStartFolderID = gInventory.getLibraryRootFolderID(); - } - else - { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); - } - rebuildViewsFor(mStartFolderID); + rebuildViewsFor(getRootFolderID()); mViewsInitialized = true; @@ -533,7 +555,7 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) { // Destroy the old view for this ID so we can rebuild it. LLFolderViewItem* old_view = mFolderRoot->getItemByID(id); - if (old_view && id.notNull()) + if (old_view && old_view != mFolderRoot) { old_view->destroyView(); } @@ -543,118 +565,101 @@ void LLInventoryPanel::rebuildViewsFor(const LLUUID& id) void LLInventoryPanel::buildNewViews(const LLUUID& id) { - LLMemType mt(LLMemType::MTYPE_INVENTORY_BUILD_NEW_VIEWS); - LLFolderViewItem* itemp = NULL; - LLInventoryObject* objectp = gInventory.getObject(id); - if (objectp) - { - const LLUUID &parent_id = objectp->getParentUUID(); - LLFolderViewFolder* parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); - if (id == mStartFolderID) - { - parent_folder = mFolderRoot; - } - else if ((mStartFolderID != LLUUID::null) && (!gInventory.isObjectDescendentOf(id, mStartFolderID))) - { - // This item exists outside the inventory's hierarchy, so don't add it. - return; - } - - if (objectp->getType() <= LLAssetType::AT_NONE || - objectp->getType() >= LLAssetType::AT_COUNT) - { - llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " - << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() - << llendl; - return; - } - - if ((objectp->getType() == LLAssetType::AT_CATEGORY) && - (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) - { - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), - objectp->getType(), - LLInventoryType::IT_CATEGORY, - this, - mFolderRoot, - objectp->getUUID()); - if (new_listener) - { - LLFolderViewFolder::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.root = mFolderRoot; - params.listener = new_listener; - params.tool_tip = params.name; - LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); - folderp->setItemSortOrder(mFolderRoot->getSortOrder()); - itemp = folderp; - - // Hide the root folder, so we can show the contents of a folder flat - // but still have the parent folder present for listener-related operations. - if (id == mStartFolderID) - { - folderp->setHidden(TRUE); - } - const LLViewerInventoryCategory *cat = dynamic_cast(objectp); - if (cat && getIsHiddenFolderType(cat->getPreferredType())) - { - folderp->setHidden(TRUE); - } - } - } - else - { - // Build new view for item. - LLInventoryItem* item = (LLInventoryItem*)objectp; - LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), - item->getActualType(), - item->getInventoryType(), - this, - mFolderRoot, - item->getUUID(), - item->getFlags()); - - if (new_listener) - { - LLFolderViewItem::Params params; - params.name = new_listener->getDisplayName(); - params.icon = new_listener->getIcon(); - params.icon_open = new_listener->getOpenIcon(); - if (mShowItemLinkOverlays) // if false, then links show up just like normal items - { - params.icon_overlay = LLUI::getUIImage("Inv_Link"); - } - params.creation_date = new_listener->getCreationDate(); - params.root = mFolderRoot; - params.listener = new_listener; - params.rect = LLRect (0, 0, 0, 0); - params.tool_tip = params.name; - itemp = LLUICtrlFactory::create (params); - } - } - - if (itemp) - { - itemp->addToFolder(parent_folder, mFolderRoot); - - // Don't add children of hidden folders unless this is the panel's root folder. - if (itemp->getHidden() && (id != mStartFolderID)) - { - return; - } + LLInventoryObject const* objectp = gInventory.getObject(id); + LLUUID root_id = mFolderRoot->getListener()->getUUID(); + LLFolderViewFolder* parent_folder = NULL; + + if (id == root_id) + { + parent_folder = mFolderRoot; + } + else if (objectp) + { + LLFolderViewItem* itemp = NULL; + const LLUUID &parent_id = objectp->getParentUUID(); + parent_folder = (LLFolderViewFolder*)mFolderRoot->getItemByID(parent_id); + + if (parent_folder) + { + if (objectp->getType() <= LLAssetType::AT_NONE || + objectp->getType() >= LLAssetType::AT_COUNT) + { + llwarns << "LLInventoryPanel::buildNewViews called with invalid objectp->mType : " + << ((S32) objectp->getType()) << " name " << objectp->getName() << " UUID " << objectp->getUUID() + << llendl; + return; + } + + if ((objectp->getType() == LLAssetType::AT_CATEGORY) && + (objectp->getActualType() != LLAssetType::AT_LINK_FOLDER)) + { + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(objectp->getType(), + objectp->getType(), + LLInventoryType::IT_CATEGORY, + this, + mFolderRoot, + objectp->getUUID()); + if (new_listener) + { + LLFolderViewFolder::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.root = mFolderRoot; + params.listener = new_listener; + params.tool_tip = params.name; + LLFolderViewFolder* folderp = LLUICtrlFactory::create(params); + folderp->setItemSortOrder(mFolderRoot->getSortOrder()); + itemp = folderp; + } + } + else + { + // Build new view for item. + LLInventoryItem* item = (LLInventoryItem*)objectp; + LLInvFVBridge* new_listener = mInvFVBridgeBuilder->createBridge(item->getType(), + item->getActualType(), + item->getInventoryType(), + this, + mFolderRoot, + item->getUUID(), + item->getFlags()); + + if (new_listener) + { + LLFolderViewItem::Params params; + params.name = new_listener->getDisplayName(); + params.icon = new_listener->getIcon(); + params.icon_open = new_listener->getOpenIcon(); + if (mShowItemLinkOverlays) // if false, then links show up just like normal items + { + params.icon_overlay = LLUI::getUIImage("Inv_Link"); + } + params.creation_date = new_listener->getCreationDate(); + params.root = mFolderRoot; + params.listener = new_listener; + params.rect = LLRect (0, 0, 0, 0); + params.tool_tip = params.name; + itemp = LLUICtrlFactory::create (params); + } + } + + if (itemp) + { + itemp->addToFolder(parent_folder, mFolderRoot); + } } } // If this is a folder, add the children of the folder and recursively add any // child folders. - if ((id == mStartFolderID) || - (objectp && objectp->getType() == LLAssetType::AT_CATEGORY)) + if (id.isNull() + || (objectp + && objectp->getType() == LLAssetType::AT_CATEGORY)) { LLViewerInventoryCategory::cat_array_t* categories; LLViewerInventoryItem::item_array_t* items; @@ -671,7 +676,7 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) } } - if(items) + if(items && parent_folder) { for (LLViewerInventoryItem::item_array_t::const_iterator item_iter = items->begin(); item_iter != items->end(); @@ -688,23 +693,17 @@ void LLInventoryPanel::buildNewViews(const LLUUID& id) // bit of a hack to make sure the inventory is open. void LLInventoryPanel::openStartFolderOrMyInventory() { - if (mStartFolderString != "") - { - mFolderRoot->openFolder(mStartFolderString); - } - else + // Find My Inventory folder and open it up by name + for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) { - // Find My Inventory folder and open it up by name - for (LLView *child = mFolderRoot->getFirstChild(); child; child = mFolderRoot->findNextSibling(child)) + LLFolderViewFolder *fchild = dynamic_cast(child); + if (fchild + && fchild->getListener() + && fchild->getListener()->getUUID() == gInventory.getRootFolderID()) { - LLFolderViewFolder *fchild = dynamic_cast(child); - if (fchild && fchild->getListener() && - (fchild->getListener()->getUUID() == gInventory.getRootFolderID())) - { - const std::string& child_name = child->getName(); - mFolderRoot->openFolder(child_name); - break; - } + const std::string& child_name = child->getName(); + mFolderRoot->openFolder(child_name); + break; } } } @@ -1067,15 +1066,12 @@ LLInventoryPanel* LLInventoryPanel::getActiveInventoryPanel(BOOL auto_open) void LLInventoryPanel::addHideFolderType(LLFolderType::EType folder_type) { - if (!getIsHiddenFolderType(folder_type)) - { - mHiddenFolderTypes.push_back(folder_type); - } + getFilter()->setFilterCategoryTypes(getFilter()->getFilterCategoryTypes() & ~(1ULL << folder_type)); } BOOL LLInventoryPanel::getIsHiddenFolderType(LLFolderType::EType folder_type) const { - return (std::find(mHiddenFolderTypes.begin(), mHiddenFolderTypes.end(), folder_type) != mHiddenFolderTypes.end()); + return !(getFilter()->getFilterCategoryTypes() & (1ULL << folder_type)); } diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 9da9f7d8ba..da67da13b2 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -126,6 +126,7 @@ public: void setSelectCallback(const LLFolderView::signal_t::slot_type& cb); void clearSelection(); LLInventoryFilter* getFilter(); + const LLInventoryFilter* getFilter() const; void setFilterTypes(U64 filter, LLInventoryFilter::EFilterType = LLInventoryFilter::FILTERTYPE_OBJECT); U32 getFilterObjectTypes() const { return mFolderRoot->getFilterObjectTypes(); } void setFilterPermMask(PermissionMask filter_perm_mask); @@ -140,7 +141,6 @@ public: void setShowFolderState(LLInventoryFilter::EFolderShow show); LLInventoryFilter::EFolderShow getShowFolderState(); - void setAllowMultiSelect(BOOL allow) { mFolderRoot->setAllowMultiSelect(allow); } // This method is called when something has changed about the inventory. void modelChanged(U32 mask); LLFolderView* getRootFolder() { return mFolderRoot; } @@ -207,23 +207,18 @@ private: //-------------------------------------------------------------------- public: void addHideFolderType(LLFolderType::EType folder_type); -protected: - BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; -private: - std::vector mHiddenFolderTypes; - //-------------------------------------------------------------------- - // Initialization routines for building up the UI ("views") - //-------------------------------------------------------------------- public: BOOL getIsViewsInitialized() const { return mViewsInitialized; } - const LLUUID& getStartFolderID() const { return mStartFolderID; } - const std::string& getStartFolderString() { return mStartFolderString; } + const LLUUID& getRootFolderID() const; protected: // Builds the UI. Call this once the inventory is usable. void initializeViews(); - void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. - virtual void buildNewViews(const LLUUID& id); + void rebuildViewsFor(const LLUUID& id); // Given the id and the parent, build all of the folder views. + + virtual void buildFolderView(const LLInventoryPanel::Params& params); + virtual void buildNewViews(const LLUUID& id); + BOOL getIsHiddenFolderType(LLFolderType::EType folder_type) const; private: BOOL mBuildDefaultHierarchy; // default inventory hierarchy should be created in postBuild() BOOL mViewsInitialized; // Views have been generated diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 80f6862169..f09f675b75 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -645,7 +645,7 @@ void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesI // Start background fetch, mostly for My Inventory and Library if (expanded) { - const LLUUID &cat_id = inventory_list->getStartFolderID(); + const LLUUID &cat_id = inventory_list->getRootFolderID(); // Just because the category itself has been fetched, doesn't mean its child folders have. /* if (!gInventory.isCategoryComplete(cat_id)) @@ -1414,7 +1414,7 @@ static void filter_list(LLPlacesInventoryPanel* inventory_list, const std::strin static bool category_has_descendents(LLPlacesInventoryPanel* inventory_list) { - LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getStartFolderID()); + LLViewerInventoryCategory* category = gInventory.getCategory(inventory_list->getRootFolderID()); if (category) { return category->getDescendentCount() > 0; diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 29e262199e..f7823f4fe8 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -35,6 +35,7 @@ #include "llinventoryfunctions.h" #include "llpanellandmarks.h" #include "llplacesinventorybridge.h" +#include "llviewerfoldertype.h" static LLDefaultChildRegistry::Register r("places_inventory_panel"); @@ -56,72 +57,44 @@ LLPlacesInventoryPanel::~LLPlacesInventoryPanel() delete mSavedFolderState; } -BOOL LLPlacesInventoryPanel::postBuild() +void LLPlacesInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { - LLInventoryPanel::postBuild(); + // Determine the root folder in case specified, and + // build the views starting with that folder. + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); - // clear Contents(); - { - mFolderRoot->destroyView(); - mFolderRoot->getParent()->removeChild(mFolderRoot); - mFolderRoot->die(); - - if( mScroller ) - { - removeChild( mScroller ); - mScroller->die(); - mScroller = NULL; - } - mFolderRoot = NULL; - } - - - mCommitCallbackRegistrar.pushScope(); // registered as a widget; need to push callback scope ourselves + LLUUID root_id; - // create root folder + if ("LIBRARY" == params.start_folder()) { - LLRect folder_rect(0, - 0, - getRect().getWidth(), - 0); - LLPlacesFolderView::Params p; - p.name = getName(); - p.title = getLabel(); - p.rect = folder_rect; - p.parent_panel = this; - mFolderRoot = (LLFolderView*)LLUICtrlFactory::create(p); - mFolderRoot->setAllowMultiSelect(mAllowMultiSelect); + root_id = gInventory.getLibraryRootFolderID(); } - - mCommitCallbackRegistrar.popScope(); - - mFolderRoot->setCallbackRegistrar(&mCommitCallbackRegistrar); - - // scroller + else { - LLRect scroller_view_rect = getRect(); - scroller_view_rect.translate(-scroller_view_rect.mLeft, -scroller_view_rect.mBottom); - LLScrollContainer::Params p; - p.name("Inventory Scroller"); - p.rect(scroller_view_rect); - p.follows.flags(FOLLOWS_ALL); - p.reserve_scroll_corner(true); - p.tab_stop(true); - mScroller = LLUICtrlFactory::create(p); + root_id = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); } - addChild(mScroller); - mScroller->addChild(mFolderRoot); - - mFolderRoot->setScrollContainer(mScroller); - mFolderRoot->addChild(mFolderRoot->mStatusTextBox); - - // cut subitems - mFolderRoot->setUseEllipses(true); - - return TRUE; + LLRect folder_rect(0, + 0, + getRect().getWidth(), + 0); + LLPlacesFolderView::Params p; + p.name = getName(); + p.title = getLabel(); + p.rect = folder_rect; + p.listener = mInvFVBridgeBuilder->createBridge(LLAssetType::AT_CATEGORY, + LLAssetType::AT_CATEGORY, + LLInventoryType::IT_CATEGORY, + this, + NULL, + root_id); + p.parent_panel = this; + p.allow_multiselect = mAllowMultiSelect; + p.use_ellipses = true; // truncate inventory item text so remove horizontal scroller + mFolderRoot = (LLFolderView*)LLUICtrlFactory::create(p); } + // save current folder open state void LLPlacesInventoryPanel::saveFolderState() { diff --git a/indra/newview/lltexturectrl.cpp b/indra/newview/lltexturectrl.cpp index 1023a4339b..b182c15dd0 100644 --- a/indra/newview/lltexturectrl.cpp +++ b/indra/newview/lltexturectrl.cpp @@ -420,7 +420,6 @@ BOOL LLFloaterTexturePicker::postBuild() mInventoryPanel->setFilterPermMask(mImmediateFilterPermMask); mInventoryPanel->setSelectCallback(boost::bind(&LLFloaterTexturePicker::onSelectionChange, this, _1, _2)); mInventoryPanel->setShowFolderState(LLInventoryFilter::SHOW_NON_EMPTY_FOLDERS); - mInventoryPanel->setAllowMultiSelect(FALSE); // Disable auto selecting first filtered item because it takes away // selection from the item set by LLTextureCtrl owning this floater. -- cgit v1.2.3 From e297016af881e51c14441ac63b67257e3d8624e2 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 17 Jun 2011 15:25:37 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* forgot a file reviewed by Leyla --- indra/newview/llplacesinventorypanel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 6641871a0b..f647e7f970 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -46,7 +46,7 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - /*virtual*/ BOOL postBuild(); + /*virtual*/ void buildFolderView(const LLInventoryPanel::Params& params); void saveFolderState(); void restoreFolderState(); -- cgit v1.2.3 From 5af57330eb23dd6f00f02bafdf08ee70b5cae50b Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 20 Jun 2011 08:57:57 -0700 Subject: EXP-917 FIX -- Inbox and Outbox options shown in the + Menu in the Inventory Panel Oops. --- .../newview/skins/default/xui/en/menu_inventory_add.xml | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/menu_inventory_add.xml b/indra/newview/skins/default/xui/en/menu_inventory_add.xml index f38ea04858..e0ccb18c08 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory_add.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory_add.xml @@ -91,22 +91,6 @@ function="Inventory.DoCreate" parameter="category" /> - - - - - - Date: Mon, 20 Jun 2011 09:28:10 -0700 Subject: ER-944: Add feature to control user sounds on a parcel. Added new checkboxes to the About Land / Sound tab. Reviewed by Kelly. --- indra/newview/llfloaterland.cpp | 2 +- indra/newview/llpanellandaudio.cpp | 22 +++++++++++++++++ indra/newview/llpanellandaudio.h | 2 ++ .../skins/default/xui/en/floater_about_land.xml | 28 ++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 0300867363..420a2b0f72 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -2036,7 +2036,7 @@ void LLPanelLandOptions::refresh() mPrivateParcelCtrl->set(parcel->getHiddenAVs()); mPrivateParcelCtrl->setLabel(getString("hidden_avs_text")); - mPrivateParcelCtrl->setEnabled(can_change_options && parcel->getHaveHiddenAVsData()); + mPrivateParcelCtrl->setEnabled(can_change_options && parcel->getHaveNewParcelLimitData()); BOOL can_change_landing_point = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_SET_LANDING_POINT); diff --git a/indra/newview/llpanellandaudio.cpp b/indra/newview/llpanellandaudio.cpp index f9730d9b71..e7bdc51b4a 100644 --- a/indra/newview/llpanellandaudio.cpp +++ b/indra/newview/llpanellandaudio.cpp @@ -91,6 +91,12 @@ BOOL LLPanelLandAudio::postBuild() mMusicURLEdit = getChild("music_url"); childSetCommitCallback("music_url", onCommitAny, this); + mCheckAVSoundAny = getChild("all av sound check"); + childSetCommitCallback("all av sound check", onCommitAny, this); + + mCheckAVSoundGroup = getChild("group av sound check"); + childSetCommitCallback("group av sound check", onCommitAny, this); + return TRUE; } @@ -144,6 +150,13 @@ void LLPanelLandAudio::refresh() mMusicURLEdit->setText(parcel->getMusicURL()); mMusicURLEdit->setEnabled( can_change_media ); + + BOOL can_change_av_sounds = LLViewerParcelMgr::isParcelModifiableByAgent(parcel, GP_LAND_OPTIONS) && parcel->getHaveNewParcelLimitData(); + mCheckAVSoundAny->set(parcel->getAllowAnyAVSounds()); + mCheckAVSoundAny->setEnabled(can_change_av_sounds); + + mCheckAVSoundGroup->set(parcel->getAllowGroupAVSounds() || parcel->getAllowAnyAVSounds()); // On if "Everyone" is on + mCheckAVSoundGroup->setEnabled(can_change_av_sounds && !parcel->getAllowAnyAVSounds()); // Enabled if "Everyone" is off } } // static @@ -164,6 +177,13 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) BOOL voice_enabled = self->mCheckParcelEnableVoice->get(); BOOL voice_estate_chan = !self->mCheckParcelVoiceLocal->get(); + BOOL any_av_sound = self->mCheckAVSoundAny->get(); + BOOL group_av_sound = TRUE; // If set to "Everyone" then group is checked as well + if (!any_av_sound) + { // If "Everyone" is off, use the value from the checkbox + group_av_sound = self->mCheckAVSoundGroup->get(); + } + // Remove leading/trailing whitespace (common when copying/pasting) LLStringUtil::trim(music_url); @@ -172,6 +192,8 @@ void LLPanelLandAudio::onCommitAny(LLUICtrl*, void *userdata) parcel->setParcelFlag(PF_USE_ESTATE_VOICE_CHAN, voice_estate_chan); parcel->setParcelFlag(PF_SOUND_LOCAL, sound_local); parcel->setMusicURL(music_url); + parcel->setAllowAnyAVSounds(any_av_sound); + parcel->setAllowGroupAVSounds(group_av_sound); // Send current parcel data upstream to server LLViewerParcelMgr::getInstance()->sendParcelPropertiesUpdate( parcel ); diff --git a/indra/newview/llpanellandaudio.h b/indra/newview/llpanellandaudio.h index 4b0953bdc1..32a45100f4 100644 --- a/indra/newview/llpanellandaudio.h +++ b/indra/newview/llpanellandaudio.h @@ -52,6 +52,8 @@ private: LLCheckBoxCtrl* mCheckParcelVoiceLocal; LLLineEditor* mMusicURLEdit; LLCheckBoxCtrl* mMusicUrlCheck; + LLCheckBoxCtrl* mCheckAVSoundAny; + LLCheckBoxCtrl* mCheckAVSoundGroup; LLSafeHandle& mParcel; }; diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 4ad42ea5bf..612d2a3bfe 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -1858,6 +1858,34 @@ Only large parcels can be listed in search. name="check sound local" left_pad="0" width="292" /> + + Avatar Sounds: + + + Date: Mon, 20 Jun 2011 11:00:02 -0700 Subject: EXP-915 FIX remove mHidden and mStartFolderID from LLFolderView* removed mHidden variable --- indra/newview/llfolderviewitem.cpp | 7 +------ indra/newview/llfolderviewitem.h | 1 - 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 904c233850..5f1d32ee5a 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -130,7 +130,6 @@ LLFolderViewItem::LLFolderViewItem(const LLFolderViewItem::Params& p) mIconOpen(p.icon_open), mIconOverlay(p.icon_overlay), mListener(p.listener), - mHidden(false), mShowLoadStatus(false) { } @@ -1058,7 +1057,7 @@ void LLFolderViewItem::draw() && mTimeSinceRequestStart.getElapsedTimeF32() >= gSavedSettings.getF32("FolderLoadingMessageWaitTime")) || (LLInventoryModelBackgroundFetch::instance().backgroundFetchActive() && root_is_loading - && (mShowLoadStatus || mHidden))) + && mShowLoadStatus)) { std::string load_string = " ( " + LLTrans::getString("LoadingData") + " ) "; font->renderUTF8(load_string, 0, right_x, y, sSearchStatusColor, @@ -1368,10 +1367,6 @@ void LLFolderViewFolder::filter( LLInventoryFilter& filter) // and then item rules LLFolderViewItem::filter( filter ); } - if (mHidden) - { - setOpen(); - } } if (getRoot()->getDebugFilters()) diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index c48e568b30..7d640adf2e 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -157,7 +157,6 @@ protected: BOOL mDragAndDropTarget; BOOL mIsLoading; LLTimer mTimeSinceRequestStart; - bool mHidden; bool mShowLoadStatus; // helper function to change the selection from the root. -- cgit v1.2.3 From 4ba2a801489d59b39f0c0cd9b2fc7cc4fe396a8e Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 20 Jun 2011 11:02:36 -0700 Subject: fixed build on mac/linux --- indra/newview/llfolderviewitem.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 5f1d32ee5a..1f53586ccc 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1171,8 +1171,6 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) mHasVisibleChildren = hasFilteredDescendants(filter_generation); - LLInventoryFilter::EFolderShow show_folder_state = getRoot()->getFilter()->getShowFolderState(); - // calculate height as a single item (without any children), and reshapes rectangle to match LLFolderViewItem::arrange( width, height, filter_generation ); -- cgit v1.2.3 From 941a360c465a902a083bbab3da176351331428b5 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 20 Jun 2011 18:03:58 -0700 Subject: EXP-893 FIX Single order purchases not sorted with most recent item delivered at top of list reviewed by Leyla --- indra/newview/llfolderviewitem.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 57e5488a4e..85791774d7 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1985,6 +1985,13 @@ BOOL LLFolderViewFolder::addItem(LLFolderViewItem* item) item->dirtyFilter(); requestArrange(); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && !parentp->getCreationDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } @@ -2004,6 +2011,13 @@ BOOL LLFolderViewFolder::addFolder(LLFolderViewFolder* folder) // rearrange all descendants too, as our indentation level might have changed folder->requestArrange(TRUE); requestSort(); + LLFolderViewFolder* parentp = getParentFolder(); + while (parentp && !parentp->getCreationDate()) + { + // parent folder doesn't have a time stamp yet, so get it from us + parentp->requestSort(); + parentp = parentp->getParentFolder(); + } return TRUE; } -- cgit v1.2.3 From 149b160a6d544824401348e8e97a64339815d8c1 Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 20 Jun 2011 18:14:26 -0700 Subject: EXP-872 Hide inbox unless applicable --- indra/newview/llsidepanelinventory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 787ebd29c2..864637d744 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -51,6 +51,7 @@ #include "llsidepaneltaskinfo.h" #include "llstring.h" #include "lltabcontainer.h" +#include "llviewermedia.h" #include "llviewernetwork.h" #include "llweb.h" @@ -245,8 +246,13 @@ void LLSidepanelInventory::handleLoginComplete() url += "api/1/users/"; url += gAgent.getID().getString(); url += "/user_status"; + + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); + headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); - LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this)); + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); // // Track inbox and outbox folder changes -- cgit v1.2.3 From 658fdbb4df40207c67b4cfa6d911e41af9545efa Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Mon, 20 Jun 2011 18:14:36 -0700 Subject: EXP-872 Hide inbox unless applicable --- indra/newview/llviewermedia.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index a70c6f4887..180e1d5676 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,6 +160,8 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); + + static std::string getOpenIDCookie() { return sOpenIDCookie; } private: static void setOpenIDCookie(); -- cgit v1.2.3 From 917e2d18973bd17929d589ee58b3f47a09c7157b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 21 Jun 2011 14:16:27 -0700 Subject: EXP-895 Selecting items in Marketplace Inbox does not change focus in inventory panel away from items selected in inventory panel --- indra/newview/llfolderview.cpp | 8 +- indra/newview/llpanelmaininventory.cpp | 6 +- indra/newview/llpanelmarketplaceinbox.cpp | 426 +++++++++++++++--------------- indra/newview/llpanelmarketplaceinbox.h | 2 + indra/newview/llsidepanelinventory.h | 3 +- 5 files changed, 227 insertions(+), 218 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 3884b94b60..ba6fa18aab 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -806,13 +806,7 @@ void LLFolderView::sanitizeSelection() } else { - // nothing selected to start with, so pick "My Inventory" as best guess - new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } + new_selection = NULL; } if (new_selection) diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp index 9f797eb147..728642e4c7 100644 --- a/indra/newview/llpanelmaininventory.cpp +++ b/indra/newview/llpanelmaininventory.cpp @@ -577,14 +577,16 @@ void LLPanelMainInventory::updateItemcountText() void LLPanelMainInventory::onFocusReceived() { - LLInventoryPanel * inbox_panel = findChild("inventory_inbox"); + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); + + LLInventoryPanel * inbox_panel = sidepanel_inventory->findChild("inventory_inbox"); if (inbox_panel) { inbox_panel->clearSelection(); } - LLInventoryPanel * outbox_panel = findChild("inventory_outbox"); + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); if (outbox_panel) { diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index eff27aa541..1962724891 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -1,208 +1,218 @@ -/** - * @file llpanelmarketplaceinbox.cpp - * @brief Panel for marketplace inbox - * -* $LicenseInfo:firstyear=2011&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#include "llviewerprecompiledheaders.h" - -#include "llpanelmarketplaceinbox.h" - -#include "llappviewer.h" -#include "llbutton.h" -#include "llinventorypanel.h" -#include "llsidepanelinventory.h" - - -#define SUPPORTING_FRESH_ITEM_COUNT 0 - - -static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); - -const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() -{ - return LLUICtrlFactory::getDefaultParams(); -} - -// protected -LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) - : LLPanel(p) - , mInventoryPanel(NULL) -{ -} - -LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() -{ -} - -// virtual -BOOL LLPanelMarketplaceInbox::postBuild() -{ - mInventoryPanel = getChild("inventory_inbox"); - - mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); - - LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); - - LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); - - return TRUE; -} - -void LLPanelMarketplaceInbox::handleLoginComplete() -{ - // Set us up as the class to drive the badge value for the sidebar_inventory button - LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); -} - -void LLPanelMarketplaceInbox::onFocusReceived() -{ - LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); - - if (sidepanel_inventory) - { - LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); - - if (inv_panel) - { - inv_panel->clearSelection(); - } - - LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); - - if (outbox_panel) - { - outbox_panel->clearSelection(); - } - } -} - -BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) -{ - *accept = ACCEPT_NO; - return TRUE; -} - -U32 LLPanelMarketplaceInbox::getFreshItemCount() const -{ - U32 fresh_item_count = 0; - - LLFolderView * root_folder = mInventoryPanel->getRootFolder(); - - const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); - - LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); - LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); - - for (; folders_it != folders_end; ++folders_it) - { - const LLFolderViewFolder * folder = *folders_it; - - if (folder->getCreationDate() > 1500) - { - fresh_item_count++; - } - } - - return fresh_item_count; -} - -U32 LLPanelMarketplaceInbox::getTotalItemCount() const -{ - LLInventoryModel* model = mInventoryPanel->getModel(); - - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - - U32 item_count = 0; - - if (cats) - { - item_count += cats->size(); - } - - if (items) - { - item_count += items->size(); - } - - return item_count; -} - -std::string LLPanelMarketplaceInbox::getBadgeString() const -{ - std::string item_count_str(""); - - // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel - if (getParent()->getVisible() && - (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) - { - U32 item_count = getFreshItemCount(); - - if (item_count) - { - item_count_str = llformat("%d", item_count); - } - } - - return item_count_str; -} - -void LLPanelMarketplaceInbox::draw() -{ - U32 item_count = getTotalItemCount(); - - LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); - - if (item_count > 0) - { - std::string item_count_str = llformat("%d", item_count); - - LLStringUtil::format_map_t args; - args["[NUM]"] = item_count_str; - getChild("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); - -#if SUPPORTING_FRESH_ITEM_COUNT - // set green text to fresh item count - U32 fresh_item_count = getFreshItemCount(); - fresh_new_count_view->setVisible((fresh_item_count > 0)); - - if (fresh_item_count > 0) - { - getChild("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); - } -#else - fresh_new_count_view->setVisible(FALSE); -#endif - } - else - { - getChild("inbox_btn")->setLabel(getString("InboxLabelNoArg")); - - fresh_new_count_view->setVisible(FALSE); - } - - LLPanel::draw(); -} +/** + * @file llpanelmarketplaceinbox.cpp + * @brief Panel for marketplace inbox + * +* $LicenseInfo:firstyear=2011&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llpanelmarketplaceinbox.h" + +#include "llappviewer.h" +#include "llbutton.h" +#include "llinventorypanel.h" +#include "llsidepanelinventory.h" + + +#define SUPPORTING_FRESH_ITEM_COUNT 0 + + +static LLRegisterPanelClassWrapper t_panel_marketplace_inbox("panel_marketplace_inbox"); + +const LLPanelMarketplaceInbox::Params& LLPanelMarketplaceInbox::getDefaultParams() +{ + return LLUICtrlFactory::getDefaultParams(); +} + +// protected +LLPanelMarketplaceInbox::LLPanelMarketplaceInbox(const Params& p) + : LLPanel(p) + , mInventoryPanel(NULL) +{ +} + +LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() +{ +} + +// virtual +BOOL LLPanelMarketplaceInbox::postBuild() +{ + mInventoryPanel = getChild("inventory_inbox"); + + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); + + LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); + + LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); + + mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); + + return TRUE; +} + +void LLPanelMarketplaceInbox::onSelectionChange() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->updateVerbs(); +} + + +void LLPanelMarketplaceInbox::handleLoginComplete() +{ + // Set us up as the class to drive the badge value for the sidebar_inventory button + LLSideTray::getInstance()->setTabButtonBadgeDriver("sidebar_inventory", this); +} + +void LLPanelMarketplaceInbox::onFocusReceived() +{ + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); + + if (sidepanel_inventory) + { + LLInventoryPanel * inv_panel = sidepanel_inventory->getActivePanel(); + + if (inv_panel) + { + inv_panel->clearSelection(); + } + + LLInventoryPanel * outbox_panel = sidepanel_inventory->findChild("inventory_outbox"); + + if (outbox_panel) + { + outbox_panel->clearSelection(); + } + } +} + +BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, EAcceptance *accept, std::string& tooltip_msg) +{ + *accept = ACCEPT_NO; + return TRUE; +} + +U32 LLPanelMarketplaceInbox::getFreshItemCount() const +{ + U32 fresh_item_count = 0; + + LLFolderView * root_folder = mInventoryPanel->getRootFolder(); + + const LLFolderViewFolder * inbox_folder = *(root_folder->getFoldersBegin()); + + LLFolderViewFolder::folders_t::const_iterator folders_it = inbox_folder->getFoldersBegin(); + LLFolderViewFolder::folders_t::const_iterator folders_end = inbox_folder->getFoldersEnd(); + + for (; folders_it != folders_end; ++folders_it) + { + const LLFolderViewFolder * folder = *folders_it; + + if (folder->getCreationDate() > 1500) + { + fresh_item_count++; + } + } + + return fresh_item_count; +} + +U32 LLPanelMarketplaceInbox::getTotalItemCount() const +{ + LLInventoryModel* model = mInventoryPanel->getModel(); + + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; + + model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); + + U32 item_count = 0; + + if (cats) + { + item_count += cats->size(); + } + + if (items) + { + item_count += items->size(); + } + + return item_count; +} + +std::string LLPanelMarketplaceInbox::getBadgeString() const +{ + std::string item_count_str(""); + + // If the inbox is visible, and the side panel is collapsed or expanded and not the inventory panel + if (getParent()->getVisible() && + (LLSideTray::getInstance()->getCollapsed() || !LLSideTray::getInstance()->isPanelActive("sidepanel_inventory"))) + { + U32 item_count = getFreshItemCount(); + + if (item_count) + { + item_count_str = llformat("%d", item_count); + } + } + + return item_count_str; +} + +void LLPanelMarketplaceInbox::draw() +{ + U32 item_count = getTotalItemCount(); + + LLView * fresh_new_count_view = getChildView("inbox_fresh_new_count"); + + if (item_count > 0) + { + std::string item_count_str = llformat("%d", item_count); + + LLStringUtil::format_map_t args; + args["[NUM]"] = item_count_str; + getChild("inbox_btn")->setLabel(getString("InboxLabelWithArg", args)); + +#if SUPPORTING_FRESH_ITEM_COUNT + // set green text to fresh item count + U32 fresh_item_count = getFreshItemCount(); + fresh_new_count_view->setVisible((fresh_item_count > 0)); + + if (fresh_item_count > 0) + { + getChild("inbox_fresh_new_count")->setTextArg("[NUM]", llformat("%d", fresh_item_count)); + } +#else + fresh_new_count_view->setVisible(FALSE); +#endif + } + else + { + getChild("inbox_btn")->setLabel(getString("InboxLabelNoArg")); + + fresh_new_count_view->setVisible(FALSE); + } + + LLPanel::draw(); +} diff --git a/indra/newview/llpanelmarketplaceinbox.h b/indra/newview/llpanelmarketplaceinbox.h index d5b216b56d..b176d57d3f 100644 --- a/indra/newview/llpanelmarketplaceinbox.h +++ b/indra/newview/llpanelmarketplaceinbox.h @@ -63,6 +63,8 @@ public: private: void handleLoginComplete(); + void onSelectionChange(); + void onFocusReceived(); private: diff --git a/indra/newview/llsidepanelinventory.h b/indra/newview/llsidepanelinventory.h index b68abd65cc..df29cbceba 100644 --- a/indra/newview/llsidepanelinventory.h +++ b/indra/newview/llsidepanelinventory.h @@ -70,6 +70,8 @@ public: bool isInboxEnabled() const { return mInboxEnabled; } bool isOutboxEnabled() const { return mOutboxEnabled; } + void updateVerbs(); + protected: // Tracks highlighted (selected) item in inventory panel. LLInventoryItem *getSelectedItem(); @@ -77,7 +79,6 @@ protected: void onSelectionChange(const std::deque &items, BOOL user_action); // "wear", "teleport", etc. void performActionOnSelection(const std::string &action); - void updateVerbs(); bool canWearSelected(); // check whether selected items can be worn -- cgit v1.2.3 From 1e87fc43d7c07be618678aab6ee9f5511e593e92 Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Tue, 21 Jun 2011 14:57:02 -0700 Subject: Fix for memory leak & extra inventory observers in start_new_inventory_observer. Reviewed by Richard --- indra/newview/llviewermessage.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 3832be727f..766df29a81 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -937,7 +937,6 @@ protected: //one global instance to bind them LLOpenTaskOffer* gNewInventoryObserver=NULL; - class LLNewInventoryHintObserver : public LLInventoryAddedObserver { protected: @@ -947,6 +946,8 @@ protected: } }; +LLNewInventoryHintObserver* gNewInventoryHintObserver=NULL; + void start_new_inventory_observer() { if (!gNewInventoryObserver) //task offer observer @@ -963,7 +964,12 @@ void start_new_inventory_observer() gInventory.addObserver(gInventoryMoveObserver); } - gInventory.addObserver(new LLNewInventoryHintObserver()); + if (!gNewInventoryHintObserver) + { + // Observer is deleted by gInventory + gNewInventoryHintObserver = new LLNewInventoryHintObserver(); + gInventory.addObserver(gNewInventoryHintObserver); + } } class LLDiscardAgentOffer : public LLInventoryFetchItemsObserver -- cgit v1.2.3 From e2f9276a083f5883e250b0edcc5c68273985be8b Mon Sep 17 00:00:00 2001 From: Leyla Farazha Date: Tue, 21 Jun 2011 15:18:05 -0700 Subject: EXP-877 Profile button not active when selecting items in Marketplace inbox --- indra/newview/llavataractions.cpp | 64 +++++++++++++++++---------- indra/newview/llavataractions.h | 3 ++ indra/newview/llsidepanelinventory.cpp | 80 ++++++++++++++++++++-------------- 3 files changed, 92 insertions(+), 55 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp index cbbdcb2983..eeb4ec8458 100644 --- a/indra/newview/llavataractions.cpp +++ b/indra/newview/llavataractions.cpp @@ -69,6 +69,7 @@ #include "lltrans.h" #include "llcallingcard.h" #include "llslurl.h" // IDEVO +#include "llsidepanelinventory.h" // static void LLAvatarActions::requestFriendshipDialog(const LLUUID& id, const std::string& name) @@ -444,8 +445,6 @@ void LLAvatarActions::share(const LLUUID& id) namespace action_give_inventory { - typedef std::set uuid_set_t; - /** * Returns a pointer to 'Add More' inventory panel of Edit Outfit SP. */ @@ -475,18 +474,16 @@ namespace action_give_inventory /** * Checks My Inventory visibility. */ + static bool is_give_inventory_acceptable() { - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return false; - // check selection in the panel - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool acceptable = false; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); @@ -529,12 +526,12 @@ namespace action_give_inventory } } - static void build_items_string(const uuid_set_t& inventory_selected_uuids , std::string& items_string) + static void build_items_string(const std::set& inventory_selected_uuids , std::string& items_string) { llassert(inventory_selected_uuids.size() > 0); const std::string& separator = LLTrans::getString("words_separator"); - for (uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); ; ) + for (std::set::const_iterator it = inventory_selected_uuids.begin(); ; ) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); if (NULL != inv_cat) @@ -570,10 +567,7 @@ namespace action_give_inventory return; } - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -590,8 +584,8 @@ namespace action_give_inventory // We souldn't open IM session, just calculate session ID for logging purpose. See EXT-6710 const LLUUID session_id = gIMMgr->computeSessionID(IM_NOTHING_SPECIAL, avatar_uuid); - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); const std::string& separator = LLTrans::getString("words_separator"); std::string noncopy_item_names; @@ -654,10 +648,7 @@ namespace action_give_inventory { llassert(avatar_names.size() == avatar_uuids.size()); - LLInventoryPanel* active_panel = get_active_inventory_panel(); - if (!active_panel) return; - - const uuid_set_t inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + const std::set inventory_selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); if (inventory_selected_uuids.empty()) { return; @@ -678,6 +669,33 @@ namespace action_give_inventory } } + + +//static +std::set LLAvatarActions::getInventorySelectedUUIDs() +{ + std::set inventory_selected_uuids; + + LLInventoryPanel* active_panel = action_give_inventory::get_active_inventory_panel(); + if (active_panel) + { + inventory_selected_uuids = active_panel->getRootFolder()->getSelectionList(); + } + + if (inventory_selected_uuids.empty()) + { + LLSidepanelInventory * sidepanel_inventory = LLSideTray::getInstance()->getPanel("sidepanel_inventory"); + LLInventoryPanel * inbox = sidepanel_inventory->findChild("inventory_inbox"); + if (inbox) + { + inventory_selected_uuids = inbox->getRootFolder()->getSelectionList(); + } + + } + + return inventory_selected_uuids; +} + //static void LLAvatarActions::shareWithAvatars() { @@ -705,12 +723,12 @@ bool LLAvatarActions::canShareSelectedItems(LLInventoryPanel* inv_panel /* = NUL // check selection in the panel LLFolderView* root_folder = inv_panel->getRootFolder(); - const uuid_set_t inventory_selected_uuids = root_folder->getSelectionList(); + const std::set inventory_selected_uuids = root_folder->getSelectionList(); if (inventory_selected_uuids.empty()) return false; // nothing selected bool can_share = true; - uuid_set_t::const_iterator it = inventory_selected_uuids.begin(); - const uuid_set_t::const_iterator it_end = inventory_selected_uuids.end(); + std::set::const_iterator it = inventory_selected_uuids.begin(); + const std::set::const_iterator it_end = inventory_selected_uuids.end(); for (; it != it_end; ++it) { LLViewerInventoryCategory* inv_cat = gInventory.getCategory(*it); diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h index 956fed7461..fbfd815f41 100644 --- a/indra/newview/llavataractions.h +++ b/indra/newview/llavataractions.h @@ -36,6 +36,7 @@ class LLInventoryPanel; + /** * Friend-related actions (add, remove, offer teleport, etc) */ @@ -196,6 +197,8 @@ public: */ static bool canShareSelectedItems(LLInventoryPanel* inv_panel = NULL); + static std::set getInventorySelectedUUIDs(); + private: static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response); static bool handleRemove(const LLSD& notification, const LLSD& response); diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 864637d744..79d68de289 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -246,11 +246,11 @@ void LLSidepanelInventory::handleLoginComplete() url += "api/1/users/"; url += gAgent.getID().getString(); url += "/user_status"; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); + + LLSD headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); + headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); @@ -423,22 +423,24 @@ void LLSidepanelInventory::performActionOnSelection(const std::string &action) LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return; + LLInventoryPanel* inbox = findChild("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return; + } + } } + current_item->getListener()->performAction(panel_main_inventory->getActivePanel()->getModel(), action); } void LLSidepanelInventory::onWearButtonClicked() { - LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); - return; - } - // Get selected items set. - const std::set selected_uuids_set = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); + const std::set selected_uuids_set = LLAvatarActions::getInventorySelectedUUIDs(); if (selected_uuids_set.empty()) return; // nothing selected // Convert the set to a vector. @@ -574,34 +576,29 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { + bool can_share = false; + LLPanelMainInventory* panel_main_inventory = mInventoryPanel->findChild("panel_main_inventory"); - if (!panel_main_inventory) - { - llwarns << "Failed to get the main inventory panel" << llendl; - return false; - } + LLInventoryPanel* inbox = findChild("inventory_inbox"); - LLInventoryPanel* active_panel = panel_main_inventory->getActivePanel(); + return ( (panel_main_inventory ? LLAvatarActions::canShareSelectedItems(panel_main_inventory->getActivePanel()) : false) + || (inbox ? LLAvatarActions::canShareSelectedItems(inbox) : false) ); + // Avoid flicker in the Recent tab while inventory is being loaded. - if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; - - return LLAvatarActions::canShareSelectedItems(active_panel); + //if (!active_panel->getRootFolder()->hasVisibleChildren()) return false; } + bool LLSidepanelInventory::canWearSelected() { - LLPanelMainInventory* panel_main_inventory = - mInventoryPanel->findChild("panel_main_inventory"); - if (!panel_main_inventory) - { - llassert(panel_main_inventory != NULL); + std::set selected_uuids = LLAvatarActions::getInventorySelectedUUIDs(); + + if (selected_uuids.empty()) return false; - } - std::set selected_uuids = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); for (std::set::const_iterator it = selected_uuids.begin(); it != selected_uuids.end(); ++it) @@ -618,7 +615,15 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() LLFolderViewItem* current_item = panel_main_inventory->getActivePanel()->getRootFolder()->getCurSelectedItem(); if (!current_item) { - return NULL; + LLInventoryPanel* inbox = findChild("inventory_inbox"); + if (inbox) + { + current_item = inbox->getRootFolder()->getCurSelectedItem(); + if (!current_item) + { + return NULL; + } + } } const LLUUID &item_id = current_item->getListener()->getUUID(); LLInventoryItem *item = gInventory.getItem(item_id); @@ -627,9 +632,20 @@ LLInventoryItem *LLSidepanelInventory::getSelectedItem() U32 LLSidepanelInventory::getSelectedCount() { + int count = 0; + LLPanelMainInventory *panel_main_inventory = mInventoryPanel->findChild("panel_main_inventory"); std::set selection_list = panel_main_inventory->getActivePanel()->getRootFolder()->getSelectionList(); - return selection_list.size(); + count += selection_list.size(); + + LLInventoryPanel* inbox = findChild("inventory_inbox"); + if (inbox) + { + selection_list = inbox->getRootFolder()->getSelectionList(); + count += selection_list.size(); + } + + return count; } LLInventoryPanel *LLSidepanelInventory::getActivePanel() -- cgit v1.2.3 From 57017a7a6e65c885b6124849fd5da3eae68717f8 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 22 Jun 2011 14:26:15 -0400 Subject: EXP-920 FIX -- Received Items panel is not opened if closed when a new Direct Delivery items is delivered when user has Inventory panel open * Mac build fix by removing an unused variable * Inbox panel now auto-expands when new item delivered Reviewed by Richard --- indra/newview/llsidepanelinventory.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 79d68de289..1182e5db34 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -75,6 +75,8 @@ static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack"; +static const char * const MARKETPLACE_INBOX_PANEL = "marketplace_inbox"; + // // Helpers // @@ -293,6 +295,14 @@ void LLSidepanelInventory::onInboxChanged(const LLUUID& inbox_id) { // Trigger a load of the entire inbox so we always know the contents and their creation dates for sorting LLInventoryModelBackgroundFetch::instance().start(inbox_id); + + // Expand the inbox since we have fresh items + LLPanelMarketplaceInbox * inbox = getChild(MARKETPLACE_INBOX_PANEL); + if (inbox && (inbox->getFreshItemCount() > 0)) + { + getChild(INBOX_BUTTON_NAME)->setToggleState(true); + onToggleInboxBtn(); + } } void LLSidepanelInventory::onOutboxChanged(const LLUUID& outbox_id) @@ -367,7 +377,7 @@ void LLSidepanelInventory::onOpen(const LLSD& key) LLFirstUse::newInventory(false); // Expand the inbox if we have fresh items - LLPanelMarketplaceInbox * inbox = getChild("marketplace_inbox"); + LLPanelMarketplaceInbox * inbox = getChild(MARKETPLACE_INBOX_PANEL); if (inbox && (inbox->getFreshItemCount() > 0)) { getChild(INBOX_BUTTON_NAME)->setToggleState(true); @@ -576,8 +586,6 @@ void LLSidepanelInventory::updateVerbs() bool LLSidepanelInventory::canShare() { - bool can_share = false; - LLPanelMainInventory* panel_main_inventory = mInventoryPanel->findChild("panel_main_inventory"); -- cgit v1.2.3 From 8737446eb737bc26dcb1ac9462cc060baef0e13f Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 22 Jun 2011 14:28:19 -0400 Subject: EXP-919 FIX -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * The code should no longer create these folders when querying for them. Reviewed by Richard --- indra/newview/llinventorybridge.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index f4670731ad..58579bdf4f 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -783,7 +783,14 @@ BOOL LLInvFVBridge::isCOFFolder() const BOOL LLInvFVBridge::isInboxFolder() const { - return gInventory.isObjectDescendentOf(mUUID, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)); + const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + if (inbox_id.isNull()) + { + return FALSE; + } + + return gInventory.isObjectDescendentOf(mUUID, inbox_id); } BOOL LLInvFVBridge::isItemPermissive() const -- cgit v1.2.3 From 21cc9a2868bc8260c7754df237e4abf1114be9e2 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 22 Jun 2011 17:02:11 -0400 Subject: EXP-919 FIX 2 -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * Fixed the "start_in" folder tag to no longer create folders it is trying to track that do not exist. --- indra/newview/llinventorypanel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 5b47e939a4..ebee1704f0 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -497,7 +497,7 @@ void LLInventoryPanel::initializeViews() } else { - mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type) : LLUUID::null); + mStartFolderID = (preferred_type != LLFolderType::FT_NONE ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null); } rebuildViewsFor(mStartFolderID); -- cgit v1.2.3 From 4267014b146798cabe96568b2091c6bb2dd2b294 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Wed, 22 Jun 2011 17:35:25 -0400 Subject: EXP-890 FIX -- Resizing inbox or outbox to minimum size while open does not show present items when hte box is next opened EXP-897 FIX -- Black box shown in UI when shrinking Inbox down in size * Layout panel now supports "expanded_min_dim" parameter which allows a different min size to be specified when the layout panel is collapsed vs expanded. * Inbox and Outbox expanded_min_dim attributes are now set to be larger than min dim so they can not be collapsed all the way when they are expanded. --- indra/newview/skins/default/xui/en/sidepanel_inventory.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indra/newview') diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 1fedd6aab8..00f3135035 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -52,9 +52,10 @@ auto_resize="true" user_resize="false" follows="bottom|left|right" - min_dim="35" name="inbox_layout_panel" + min_dim="35" max_dim="200" + expanded_min_dim="90" height="200"> Date: Wed, 22 Jun 2011 16:12:01 -0700 Subject: making it so that inbox shows up quicker --- indra/newview/llsidepanelinventory.cpp | 64 +++++----------------------------- indra/newview/llviewermedia.cpp | 49 ++++++++++++++++++++++++++ indra/newview/llviewermedia.h | 2 -- 3 files changed, 58 insertions(+), 57 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index 79d68de289..19c8ee0123 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -52,7 +52,6 @@ #include "llstring.h" #include "lltabcontainer.h" #include "llviewermedia.h" -#include "llviewernetwork.h" #include "llweb.h" static LLRegisterPanelClassWrapper t_inventory("sidepanel_inventory"); @@ -79,37 +78,6 @@ static const char * const INVENTORY_LAYOUT_STACK_NAME = "inventory_layout_stack" // Helpers // -class LLInventoryUserStatusResponder : public LLHTTPClient::Responder -{ -public: - LLInventoryUserStatusResponder(LLSidepanelInventory * sidepanelInventory) - : LLCurl::Responder() - , mSidepanelInventory(sidepanelInventory) - { - } - - void completed(U32 status, const std::string& reason, const LLSD& content) - { - if (isGoodStatus(status)) - { - // Complete success - mSidepanelInventory->enableInbox(true); - } - else if (status == 401) - { - // API is available for use but OpenID authorization failed - mSidepanelInventory->enableInbox(true); - } - else - { - // API in unavailable - llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; - } - } - -private: - LLSidepanelInventory * mSidepanelInventory; -}; // // Implementation @@ -135,6 +103,13 @@ LLSidepanelInventory::~LLSidepanelInventory() delete mCategoriesObserver; } +void handleInventoryDisplayInboxChanged() +{ + LLSidepanelInventory* sidepanel_inventory = dynamic_cast(LLSideTray::getInstance()->getPanel("sidepanel_inventory")); + + sidepanel_inventory->enableInbox(gSavedSettings.getBOOL("InventoryDisplayInbox")); +} + BOOL LLSidepanelInventory::postBuild() { // UI elements from inventory panel @@ -226,34 +201,13 @@ BOOL LLSidepanelInventory::postBuild() LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLSidepanelInventory::handleLoginComplete, this)); } + gSavedSettings.getControl("InventoryDisplayInbox")->getCommitSignal()->connect(boost::bind(&handleInventoryDisplayInboxChanged)); + return TRUE; } void LLSidepanelInventory::handleLoginComplete() { - // - // Hard coding this as a temporary way to determine whether or not to display the inbox - // - - std::string url = "https://marketplace.secondlife.com/"; - - if (!LLGridManager::getInstance()->isInProductionGrid()) - { - std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); - url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); - } - - url += "api/1/users/"; - url += gAgent.getID().getString(); - url += "/user_status"; - - LLSD headers = LLSD::emptyMap(); - headers["Accept"] = "*/*"; - headers["Cookie"] = LLViewerMedia::getOpenIDCookie(); - headers["User-Agent"] = LLViewerMedia::getCurrentUserAgent(); - - LLHTTPClient::get(url, new LLInventoryUserStatusResponder(this), headers); - // // Track inbox and outbox folder changes // diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 1e53274cd6..4be39bb88e 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -64,8 +64,10 @@ #include "llappviewer.h" #include "lllogininstance.h" //#include "llfirstuse.h" +#include "llviewernetwork.h" #include "llwindow.h" + #include "llfloatermediabrowser.h" // for handling window close requests and geometry change requests in media browser windows. #include "llfloaterwebcontent.h" // for handling window close requests and geometry change requests in media browser windows. @@ -1360,6 +1362,34 @@ void LLViewerMedia::removeCookie(const std::string &name, const std::string &dom } +class LLInventoryUserStatusResponder : public LLHTTPClient::Responder +{ +public: + LLInventoryUserStatusResponder() + : LLCurl::Responder() + { + } + + void completed(U32 status, const std::string& reason, const LLSD& content) + { + if (isGoodStatus(status)) + { + // Complete success + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else if (status == 401) + { + // API is available for use but OpenID authorization failed + gSavedSettings.setBOOL("InventoryDisplayInbox", true); + } + else + { + // API in unavailable + llinfos << "Marketplace API is unavailable -- Inbox Disabled" << llendl; + } + } +}; + ///////////////////////////////////////////////////////////////////////////////////////// // static void LLViewerMedia::setOpenIDCookie() @@ -1406,6 +1436,25 @@ void LLViewerMedia::setOpenIDCookie() LLHTTPClient::get(profile_url, new LLViewerMediaWebProfileResponder(raw_profile_url.getAuthority()), headers); + + std::string url = "https://marketplace.secondlife.com/"; + + if (!LLGridManager::getInstance()->isInProductionGrid()) + { + std::string gridLabel = LLGridManager::getInstance()->getGridLabel(); + url = llformat("https://marketplace.%s.lindenlab.com/", utf8str_tolower(gridLabel).c_str()); + } + + url += "api/1/users/"; + url += gAgent.getID().getString(); + url += "/user_status"; + + headers = LLSD::emptyMap(); + headers["Accept"] = "*/*"; + headers["Cookie"] = sOpenIDCookie; + headers["User-Agent"] = getCurrentUserAgent(); + + LLHTTPClient::get(url, new LLInventoryUserStatusResponder(), headers); } } diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 180e1d5676..a70c6f4887 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -160,8 +160,6 @@ public: static void createSpareBrowserMediaSource(); static LLPluginClassMedia* getSpareBrowserMediaSource(); - - static std::string getOpenIDCookie() { return sOpenIDCookie; } private: static void setOpenIDCookie(); -- cgit v1.2.3 From ae2cbe5258ad76e22420be2760379480e10fb72c Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 22 Jun 2011 19:18:41 -0700 Subject: EXP-923 FIX Landmarks moved to new folders do not show as moved until relog in viewer - Delete, Copy, and Paste functions not working as well --- indra/newview/llfolderview.cpp | 1 + indra/newview/llfolderviewitem.h | 2 +- indra/newview/llinventorypanel.cpp | 5 ++- indra/newview/llpanellandmarks.cpp | 2 +- indra/newview/llpanelobjectinventory.cpp | 59 +++++++++++++++++--------------- 5 files changed, 36 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 260693ebc7..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -274,6 +274,7 @@ LLFolderView::LLFolderView(const Params& p) menu->setBackgroundColor(LLUIColorTable::instance().getColor("MenuPopupBgColor")); mPopupMenuHandle = menu->getHandle(); + mListener->openItem(); } // Destroys the object diff --git a/indra/newview/llfolderviewitem.h b/indra/newview/llfolderviewitem.h index 7d640adf2e..267dbc9028 100644 --- a/indra/newview/llfolderviewitem.h +++ b/indra/newview/llfolderviewitem.h @@ -94,7 +94,7 @@ public: Optional icon_open; // used for folders Optional icon_overlay; // for links Optional root; - Optional listener; + Mandatory listener; Optional folder_arrow_image; Optional folder_indentation; // pixels diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 1ff423056a..49e68402e5 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -463,9 +463,8 @@ void LLInventoryPanel::modelChanged(U32 mask) // This item already exists in both memory and UI. It was probably reparented. if (model_item && view_item) { - // Don't process the item if it's hanging from the root, since its - // model_item's parent will be NULL. - if (view_item->getRoot() != view_item->getParent()) + // Don't process the item if it is the root + if (view_item->getRoot() != view_item) { LLFolderViewFolder* new_parent = (LLFolderViewFolder*)mFolderRoot->getItemByID(model_item->getParentUUID()); // Item has been moved. diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index f09f675b75..1595531f7b 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -529,7 +529,7 @@ void LLLandmarksPanel::setParcelID(const LLUUID& parcel_id) // virtual void LLLandmarksPanel::setErrorStatus(U32 status, const std::string& reason) { - llerrs<< "Can't handle remote parcel request."<< " Http Status: "<< status << ". Reason : "<< reason<getTaskUUID()); if(object) @@ -1349,79 +1349,81 @@ LLTaskInvFVBridge* LLTaskInvFVBridge::createObjectBridge(LLPanelObjectInventory* LLTaskInvFVBridge* new_bridge = NULL; const LLInventoryItem* item = dynamic_cast(object); const U32 itemflags = ( NULL == item ? 0 : item->getFlags() ); - LLAssetType::EType type = object->getType(); + LLAssetType::EType type = object ? object->getType() : LLAssetType::AT_CATEGORY; + LLUUID object_id = object ? object->getUUID() : LLUUID::null; + std::string object_name = object ? object->getName() : std::string(); switch(type) { case LLAssetType::AT_TEXTURE: new_bridge = new LLTaskTextureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SOUND: new_bridge = new LLTaskSoundBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LANDMARK: new_bridge = new LLTaskLandmarkBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CALLINGCARD: new_bridge = new LLTaskCallingCardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_SCRIPT: // OLD SCRIPTS DEPRECATED - JC llwarns << "Old script" << llendl; //new_bridge = new LLTaskOldScriptBridge(panel, - // object->getUUID(), - // object->getName()); + // object_id, + // object_name); break; case LLAssetType::AT_OBJECT: new_bridge = new LLTaskObjectBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_NOTECARD: new_bridge = new LLTaskNotecardBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_ANIMATION: new_bridge = new LLTaskAnimationBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_GESTURE: new_bridge = new LLTaskGestureBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_CLOTHING: case LLAssetType::AT_BODYPART: new_bridge = new LLTaskWearableBridge(panel, - object->getUUID(), - object->getName(), + object_id, + object_name, itemflags); break; case LLAssetType::AT_CATEGORY: new_bridge = new LLTaskCategoryBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_LSL_TEXT: new_bridge = new LLTaskLSLBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; case LLAssetType::AT_MESH: new_bridge = new LLTaskMeshBridge(panel, - object->getUUID(), - object->getName()); + object_id, + object_name); break; default: llinfos << "Unhandled inventory type (llassetstorage.h): " @@ -1521,6 +1523,7 @@ void LLPanelObjectInventory::reset() p.task_id = getTaskUUID(); p.parent_panel = this; p.tool_tip= LLTrans::getString("PanelContentsTooltip"); + p.listener = LLTaskInvFVBridge::createObjectBridge(this, NULL); mFolders = LLUICtrlFactory::create(p); // this ensures that we never say "searching..." or "no items found" mFolders->getFilter()->setShowFolderState(LLInventoryFilter::SHOW_ALL_FOLDERS); -- cgit v1.2.3 From c61a7fbaace20415be3003eaab95ce359ff8621a Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 23 Jun 2011 10:34:44 -0400 Subject: EXP-926 FIX -- Received items badge count and item count shown in inbox do not always match * getFreshItemCount() function returns getTotalItemCount() for now, until we properly support item fresh-ness --- indra/newview/llpanelmarketplaceinbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/newview') diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 1962724891..14c4c46fe7 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -115,6 +115,7 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr U32 LLPanelMarketplaceInbox::getFreshItemCount() const { +#if SUPPORTING_FRESH_ITEM_COUNT U32 fresh_item_count = 0; LLFolderView * root_folder = mInventoryPanel->getRootFolder(); @@ -135,6 +136,9 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const } return fresh_item_count; +#else + return getTotalItemCount(); +#endif } U32 LLPanelMarketplaceInbox::getTotalItemCount() const -- cgit v1.2.3 From e7d86046d9bba6f0da34a6417e6bb45be518accd Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 23 Jun 2011 15:49:16 -0400 Subject: Build fixes from the merge. Recommended by Richard. --- indra/newview/llfolderview.cpp | 5 ----- indra/newview/llfolderviewitem.cpp | 3 +-- 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp index 27b58bec4e..bfc4fcaec6 100644 --- a/indra/newview/llfolderview.cpp +++ b/indra/newview/llfolderview.cpp @@ -816,11 +816,6 @@ void LLFolderView::sanitizeSelection() { // nothing selected to start with, so pick "My Inventory" as best guess new_selection = getItemByID(gInventory.getRootFolderID()); - // ... except if it's hidden from the UI. - if (new_selection && new_selection->getHidden()) - { - new_selection = NULL; - } } if (new_selection) diff --git a/indra/newview/llfolderviewitem.cpp b/indra/newview/llfolderviewitem.cpp index 38b36af6f0..f5e1aa005b 100644 --- a/indra/newview/llfolderviewitem.cpp +++ b/indra/newview/llfolderviewitem.cpp @@ -1206,8 +1206,7 @@ S32 LLFolderViewFolder::arrange( S32* width, S32* height, S32 filter_generation) bool is_hidden = folderp->getListener() && LLViewerFolderType::lookupIsHiddenType(folderp->getListener()->getPreferredType()); folderp->setVisible( !is_hidden - && (show_folder_state == LLInventoryFilter::SHOW_ALL_FOLDERS - || (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation)))); // passed filter or has descendants that passed filter + && (folderp->getFiltered(filter_generation) || folderp->hasFilteredDescendants(filter_generation))); // passed filter or has descendants that passed filter } if (folderp->getVisible()) -- cgit v1.2.3 From e74f9fcc147edd24576a25bb6a0af69ac8d6a600 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Thu, 23 Jun 2011 18:11:55 -0400 Subject: EXP-919 FIX -- Toggling InventoryDisplayInbox value to True in Viewer on Agni creates Inbox and Outbox system folders * The badge no longer displays (2) when the folder does not exist. * The inbox panel no longer displays the inventory and library folders. * The inbox is supposed to display a string for the item not being found, but doesn't for an unknown reason. --- indra/newview/llinventorypanel.cpp | 12 +++++- indra/newview/llinventorypanel.h | 1 - indra/newview/llpanelmarketplaceinbox.cpp | 43 ++++++++++++++-------- indra/newview/llsidepanelinventory.cpp | 43 ++++++++++++++-------- .../skins/default/xui/en/sidepanel_inventory.xml | 1 + 5 files changed, 67 insertions(+), 33 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp index 3666c51c82..0af6451108 100644 --- a/indra/newview/llinventorypanel.cpp +++ b/indra/newview/llinventorypanel.cpp @@ -150,7 +150,10 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) { // Determine the root folder in case specified, and // build the views starting with that folder. - const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(params.start_folder); + + std::string start_folder_name(params.start_folder()); + + const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder_name); LLUUID root_id; @@ -164,6 +167,12 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) ? gInventory.findCategoryUUIDForType(preferred_type, false, false) : LLUUID::null; } + + if ((root_id == LLUUID::null) && !start_folder_name.empty()) + { + llwarns << "No category found that matches start_folder: " << start_folder_name << llendl; + root_id = LLUUID::generateNewID(); + } LLRect folder_rect(0, 0, @@ -184,7 +193,6 @@ void LLInventoryPanel::buildFolderView(const LLInventoryPanel::Params& params) p.use_label_suffix = params.use_label_suffix; p.allow_multiselect = mAllowMultiSelect; mFolderRoot = LLUICtrlFactory::create(p); - } void LLInventoryPanel::initFromParams(const LLInventoryPanel::Params& params) diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h index 864c403397..4b915484f8 100644 --- a/indra/newview/llinventorypanel.h +++ b/indra/newview/llinventorypanel.h @@ -226,7 +226,6 @@ private: BOOL mViewsInitialized; // Views have been generated // UUID of category from which hierarchy should be built. Set with the // "start_folder" xml property. Default is LLUUID::null that means total Inventory hierarchy. - std::string mStartFolderString; LLUUID mStartFolderID; }; diff --git a/indra/newview/llpanelmarketplaceinbox.cpp b/indra/newview/llpanelmarketplaceinbox.cpp index 14c4c46fe7..1f3fbb40b4 100644 --- a/indra/newview/llpanelmarketplaceinbox.cpp +++ b/indra/newview/llpanelmarketplaceinbox.cpp @@ -59,7 +59,7 @@ LLPanelMarketplaceInbox::~LLPanelMarketplaceInbox() BOOL LLPanelMarketplaceInbox::postBuild() { mInventoryPanel = getChild("inventory_inbox"); - + mInventoryPanel->setSortOrder(LLInventoryFilter::SO_DATE); LLAppViewer::instance()->setOnLoginCompletedCallback(boost::bind(&LLPanelMarketplaceInbox::handleLoginComplete, this)); @@ -67,7 +67,10 @@ BOOL LLPanelMarketplaceInbox::postBuild() LLFocusableElement::setFocusReceivedCallback(boost::bind(&LLPanelMarketplaceInbox::onFocusReceived, this)); mInventoryPanel->setSelectCallback(boost::bind(&LLPanelMarketplaceInbox::onSelectionChange, this)); - + + // Set up the note to display when the inbox is empty + mInventoryPanel->getFilter()->setEmptyLookupMessage("InboxNoItems"); + return TRUE; } @@ -116,6 +119,12 @@ BOOL LLPanelMarketplaceInbox::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL dr U32 LLPanelMarketplaceInbox::getFreshItemCount() const { #if SUPPORTING_FRESH_ITEM_COUNT + + // + // NOTE: When turning this on, be sure to test the no inbox/outbox case because this code probably + // will return "2" for the Inventory and LIBRARY top-levels when that happens. + // + U32 fresh_item_count = 0; LLFolderView * root_folder = mInventoryPanel->getRootFolder(); @@ -143,23 +152,27 @@ U32 LLPanelMarketplaceInbox::getFreshItemCount() const U32 LLPanelMarketplaceInbox::getTotalItemCount() const { + U32 item_count = 0; + LLInventoryModel* model = mInventoryPanel->getModel(); + const LLUUID inbox_id = model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false); + + if (!inbox_id.isNull()) + { + LLInventoryModel::cat_array_t* cats; + LLInventoryModel::item_array_t* items; - LLInventoryModel::cat_array_t* cats; - LLInventoryModel::item_array_t* items; - - model->getDirectDescendentsOf(model->findCategoryUUIDForType(LLFolderType::FT_INBOX, false, false), cats, items); - - U32 item_count = 0; + model->getDirectDescendentsOf(inbox_id, cats, items); - if (cats) - { - item_count += cats->size(); - } + if (cats) + { + item_count += cats->size(); + } - if (items) - { - item_count += items->size(); + if (items) + { + item_count += items->size(); + } } return item_count; diff --git a/indra/newview/llsidepanelinventory.cpp b/indra/newview/llsidepanelinventory.cpp index f9e029be19..f769612f3f 100644 --- a/indra/newview/llsidepanelinventory.cpp +++ b/indra/newview/llsidepanelinventory.cpp @@ -67,7 +67,7 @@ static const char * const OUTBOX_BUTTON_NAME = "outbox_btn"; static const char * const INBOX_LAYOUT_PANEL_NAME = "inbox_layout_panel"; static const char * const OUTBOX_LAYOUT_PANEL_NAME = "outbox_layout_panel"; -static const char * const MAIN_INVENTORY_LAYOUT_PANEL = "main_inventory_layout_panel"; +static const char * const MAIN_INVENTORY_LAYOUT_PANEL_NAME = "main_inventory_layout_panel"; static const char * const INBOX_INVENTORY_PANEL = "inventory_inbox"; static const char * const OUTBOX_INVENTORY_PANEL = "inventory_outbox"; @@ -177,15 +177,16 @@ BOOL LLSidepanelInventory::postBuild() { LLLayoutStack* stack = getChild(INVENTORY_LAYOUT_STACK_NAME); - LLLayoutPanel * inbox_panel = getChild(INBOX_LAYOUT_PANEL_NAME); - LLLayoutPanel * outbox_panel = getChild(OUTBOX_LAYOUT_PANEL_NAME); - - stack->collapsePanel(inbox_panel, true); - stack->collapsePanel(outbox_panel, true); - // Disable user_resize on main inventory panel by default - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, false); + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(INBOX_LAYOUT_PANEL_NAME, false); + stack->setPanelUserResize(OUTBOX_LAYOUT_PANEL_NAME, false); + // Collapse both inbox and outbox panels + stack->collapsePanel(getChild(INBOX_LAYOUT_PANEL_NAME), true); + stack->collapsePanel(getChild(OUTBOX_LAYOUT_PANEL_NAME), true); + + // Set up button states and callbacks LLButton * inbox_button = getChild(INBOX_BUTTON_NAME); LLButton * outbox_button = getChild(OUTBOX_BUTTON_NAME); @@ -219,18 +220,30 @@ void LLSidepanelInventory::handleLoginComplete() const LLUUID inbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, do_not_create_folder, do_not_find_in_library); const LLUUID outbox_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_OUTBOX, do_not_create_folder, do_not_find_in_library); + + if (inbox_id.isNull() && outbox_id.isNull()) + { + return; + } mCategoriesObserver = new LLInventoryCategoriesObserver(); gInventory.addObserver(mCategoriesObserver); - mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); - mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + if (!outbox_id.isNull()) + { + mCategoriesObserver->addCategory(outbox_id, boost::bind(&LLSidepanelInventory::onOutboxChanged, this, outbox_id)); + } + + if (!inbox_id.isNull()) + { + mCategoriesObserver->addCategory(inbox_id, boost::bind(&LLSidepanelInventory::onInboxChanged, this, inbox_id)); - // - // Trigger a load for the entire contents of the Inbox - // + // + // Trigger a load for the entire contents of the Inbox + // - LLInventoryModelBackgroundFetch::instance().start(inbox_id); + LLInventoryModelBackgroundFetch::instance().start(inbox_id); + } } void LLSidepanelInventory::enableInbox(bool enabled) @@ -293,7 +306,7 @@ bool manageInboxOutboxPanels(LLLayoutStack * stack, stack->collapsePanel(pressedPanel, !expand); // Enable user_resize on main inventory panel only when a marketplace box is expanded - stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL, expand); + stack->setPanelUserResize(MAIN_INVENTORY_LAYOUT_PANEL_NAME, expand); return expand; } diff --git a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml index 00f3135035..778daac83b 100644 --- a/indra/newview/skins/default/xui/en/sidepanel_inventory.xml +++ b/indra/newview/skins/default/xui/en/sidepanel_inventory.xml @@ -69,6 +69,7 @@ width="330"> Received Items ([NUM]) Received Items + Items purchased through the marketplace will be delivered here.