diff options
Diffstat (limited to 'indra/newview')
50 files changed, 3060 insertions, 648 deletions
diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp index 2911a35581..568ac4164a 100644 --- a/indra/newview/llagentui.cpp +++ b/indra/newview/llagentui.cpp @@ -159,19 +159,19 @@ BOOL LLAgentUI::buildLocationString(std::string& str, ELocationFormat fmt,const buffer = llformat("%.100s", parcel_name.c_str()); break; case LOCATION_FORMAT_NORMAL: - buffer = llformat("%s, %s", region_name.c_str(), parcel_name.c_str()); + buffer = llformat("%s, %s", parcel_name.c_str(), region_name.c_str()); break; case LOCATION_FORMAT_WITHOUT_SIM: buffer = llformat("%s, %s (%d, %d, %d)", - region_name.c_str(), parcel_name.c_str(), + region_name.c_str(), pos_x, pos_y, pos_z); break; case LOCATION_FORMAT_FULL: std::string sim_access_string = region->getSimAccessString(); buffer = llformat("%s, %s (%d, %d, %d)%s%s", - region_name.c_str(), parcel_name.c_str(), + region_name.c_str(), pos_x, pos_y, pos_z, sim_access_string.empty() ? "" : " - ", sim_access_string.c_str()); diff --git a/indra/newview/llavatariconctrl.cpp b/indra/newview/llavatariconctrl.cpp index 0ee3e78409..46902006a6 100644 --- a/indra/newview/llavatariconctrl.cpp +++ b/indra/newview/llavatariconctrl.cpp @@ -195,14 +195,6 @@ LLAvatarIconCtrl::LLAvatarIconCtrl(const LLAvatarIconCtrl::Params& p) { LLIconCtrl::setValue("default_profile_picture.j2c"); } - - LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; - - registrar.add("AvatarIcon.Action", boost::bind(&LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked, this, _2)); - - LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); - - mPopupMenuHandle = menu->getHandle(); } LLAvatarIconCtrl::~LLAvatarIconCtrl() @@ -212,8 +204,6 @@ LLAvatarIconCtrl::~LLAvatarIconCtrl() LLAvatarPropertiesProcessor::getInstance()->removeObserver(mAvatarId, this); // Name callbacks will be automatically disconnected since LLUICtrl is trackable } - - LLView::deleteViewByHandle(mPopupMenuHandle); } //virtual @@ -295,32 +285,6 @@ void LLAvatarIconCtrl::processProperties(void* data, EAvatarProcessorType type) } } -BOOL LLAvatarIconCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask) -{ - LLMenuGL* menu = (LLMenuGL*)mPopupMenuHandle.get(); - - if(menu) - { - bool is_friend = LLAvatarTracker::instance().getBuddyInfo(mAvatarId) != NULL; - - menu->setItemEnabled("Add Friend", !is_friend); - menu->setItemEnabled("Remove Friend", is_friend); - - if(gAgentID == mAvatarId) - { - menu->setItemEnabled("Add Friend", false); - menu->setItemEnabled("Send IM", false); - menu->setItemEnabled("Remove Friend", false); - } - - menu->buildDrawLabels(); - menu->updateParent(LLMenuGL::sMenuContainer); - LLMenuGL::showPopup(this, menu, x, y); - } - - return TRUE; -} - void LLAvatarIconCtrl::nameUpdatedCallback( const LLUUID& id, const std::string& first, @@ -338,40 +302,3 @@ void LLAvatarIconCtrl::nameUpdatedCallback( } } } - -void LLAvatarIconCtrl::onAvatarIconContextMenuItemClicked(const LLSD& userdata) -{ - std::string level = userdata.asString(); - LLUUID id = getAvatarId(); - - if (level == "profile") - { - LLAvatarActions::showProfile(id); - } - else if (level == "im") - { - std::string name; - name.assign(getFirstName()); - name.append(" "); - name.append(getLastName()); - - LLUUID session_id = gIMMgr->addSession(name, IM_NOTHING_SPECIAL, id); - if (session_id != LLUUID::null) - { - LLIMFloater::show(session_id); - } - } - else if (level == "add") - { - std::string name; - name.assign(getFirstName()); - name.append(" "); - name.append(getLastName()); - - LLAvatarActions::requestFriendshipDialog(id, name); - } - else if (level == "remove") - { - LLAvatarActions::removeFriendDialog(id); - } -} diff --git a/indra/newview/llavatariconctrl.h b/indra/newview/llavatariconctrl.h index 65b5c86ed5..5eb830df4b 100644 --- a/indra/newview/llavatariconctrl.h +++ b/indra/newview/llavatariconctrl.h @@ -81,8 +81,6 @@ protected: LLAvatarIconCtrl(const Params&); friend class LLUICtrlFactory; - void onAvatarIconContextMenuItemClicked(const LLSD& userdata); - public: virtual ~LLAvatarIconCtrl(); @@ -91,8 +89,6 @@ public: // LLAvatarPropertiesProcessor observer trigger virtual void processProperties(void* data, EAvatarProcessorType type); - BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); - void nameUpdatedCallback( const LLUUID& id, const std::string& first, @@ -109,7 +105,6 @@ protected: LLUUID mAvatarId; std::string mFirstName; std::string mLastName; - LLHandle<LLView> mPopupMenuHandle; bool mDrawTooltip; diff --git a/indra/newview/llavatarpropertiesprocessor.cpp b/indra/newview/llavatarpropertiesprocessor.cpp index 73e24ca8e7..7cda2d31e6 100644 --- a/indra/newview/llavatarpropertiesprocessor.cpp +++ b/indra/newview/llavatarpropertiesprocessor.cpp @@ -158,6 +158,11 @@ void LLAvatarPropertiesProcessor::sendAvatarTexturesRequest(const LLUUID& avatar removePendingRequest(avatar_id, APT_TEXTURES); } +void LLAvatarPropertiesProcessor::sendAvatarClassifiedsRequest(const LLUUID& avatar_id) +{ + sendGenericRequest(avatar_id, APT_CLASSIFIEDS, "avatarclassifiedsrequest"); +} + void LLAvatarPropertiesProcessor::sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props) { llinfos << "Sending avatarinfo update" << llendl; @@ -284,12 +289,60 @@ void LLAvatarPropertiesProcessor::processAvatarInterestsReply(LLMessageSystem* m */ } -void LLAvatarPropertiesProcessor::processAvatarClassifiedReply(LLMessageSystem* msg, void**) +void LLAvatarPropertiesProcessor::processAvatarClassifiedsReply(LLMessageSystem* msg, void**) { - // avatarclassifiedsrequest is not sent according to new UI design but - // keep this method according to resolved issues. + LLAvatarClassifieds classifieds; + + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, classifieds.agent_id); + msg->getUUID(_PREHASH_AgentData, _PREHASH_TargetID, classifieds.target_id); + + S32 block_count = msg->getNumberOfBlocks(_PREHASH_Data); + + for(int n = 0; n < block_count; ++n) + { + LLAvatarClassifieds::classified_data data; + + msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, data.classified_id, n); + msg->getString(_PREHASH_Data, _PREHASH_Name, data.name, n); + + classifieds.classifieds_list.push_back(data); + } + + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(classifieds.target_id, APT_CLASSIFIEDS); + self->notifyObservers(classifieds.target_id,&classifieds,APT_CLASSIFIEDS); } +void LLAvatarPropertiesProcessor::processClassifiedInfoReply(LLMessageSystem* msg, void**) +{ + LLAvatarClassifiedInfo c_info; + + msg->getUUID(_PREHASH_AgentData, _PREHASH_AgentID, c_info.agent_id); + + msg->getUUID(_PREHASH_Data, _PREHASH_ClassifiedID, c_info.classified_id); + msg->getUUID(_PREHASH_Data, _PREHASH_CreatorID, c_info.creator_id); + msg->getU32(_PREHASH_Data, _PREHASH_CreationDate, c_info.creation_date); + msg->getU32(_PREHASH_Data, _PREHASH_ExpirationDate, c_info.expiration_date); + msg->getU32(_PREHASH_Data, _PREHASH_Category, c_info.category); + msg->getString(_PREHASH_Data, _PREHASH_Name, c_info.name); + msg->getString(_PREHASH_Data, _PREHASH_Desc, c_info.description); + msg->getUUID(_PREHASH_Data, _PREHASH_ParcelID, c_info.parcel_id); + msg->getU32(_PREHASH_Data, _PREHASH_ParentEstate, c_info.parent_estate); + msg->getUUID(_PREHASH_Data, _PREHASH_SnapshotID, c_info.snapshot_id); + msg->getString(_PREHASH_Data, _PREHASH_SimName, c_info.sim_name); + msg->getVector3d(_PREHASH_Data, _PREHASH_PosGlobal, c_info.pos_global); + msg->getString(_PREHASH_Data, _PREHASH_ParcelName, c_info.parcel_name); + msg->getU8(_PREHASH_Data, _PREHASH_ClassifiedFlags, c_info.flags); + msg->getS32(_PREHASH_Data, _PREHASH_PriceForListing, c_info.price_for_listing); + + LLAvatarPropertiesProcessor* self = getInstance(); + // Request processed, no longer pending + self->removePendingRequest(c_info.creator_id, APT_CLASSIFIED_INFO); + self->notifyObservers(c_info.creator_id, &c_info, APT_CLASSIFIED_INFO); +} + + void LLAvatarPropertiesProcessor::processAvatarNotesReply(LLMessageSystem* msg, void**) { LLAvatarNotes avatar_notes; @@ -451,6 +504,22 @@ void LLAvatarPropertiesProcessor::sendPickDelete( const LLUUID& pick_id ) LLAgentPicksInfo::getInstance()->decrementNumberOfPicks(); } +void LLAvatarPropertiesProcessor::sendClassifiedDelete(const LLUUID& classified_id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedDelete); + + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, classified_id); + + gAgent.sendReliableMessage(); +} + void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick) { if (!new_pick) return; @@ -485,6 +554,36 @@ void LLAvatarPropertiesProcessor::sendPickInfoUpdate(const LLPickData* new_pick) LLAgentPicksInfo::getInstance()->requestNumberOfPicks(); } +void LLAvatarPropertiesProcessor::sendClassifiedInfoUpdate(const LLAvatarClassifiedInfo* c_data) +{ + if(!c_data) + { + return; + } + + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedInfoUpdate); + + msg->nextBlock(_PREHASH_AgentData); + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, c_data->classified_id); + msg->addU32(_PREHASH_Category, c_data->category); + msg->addString(_PREHASH_Name, c_data->name); + msg->addString(_PREHASH_Desc, c_data->description); + msg->addUUID(_PREHASH_ParcelID, c_data->parcel_id); + msg->addU32(_PREHASH_ParentEstate, 0); + msg->addUUID(_PREHASH_SnapshotID, c_data->snapshot_id); + msg->addVector3d(_PREHASH_PosGlobal, c_data->pos_global); + msg->addU8(_PREHASH_ClassifiedFlags, c_data->flags); + msg->addS32(_PREHASH_PriceForListing, c_data->price_for_listing); + + gAgent.sendReliableMessage(); +} + void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id) { // Must ask for a pick based on the creator id because @@ -495,6 +594,21 @@ void LLAvatarPropertiesProcessor::sendPickInfoRequest(const LLUUID& creator_id, send_generic_message("pickinforequest", request_params); } +void LLAvatarPropertiesProcessor::sendClassifiedInfoRequest(const LLUUID& classified_id) +{ + LLMessageSystem* msg = gMessageSystem; + + msg->newMessage(_PREHASH_ClassifiedInfoRequest); + msg->nextBlock(_PREHASH_AgentData); + + msg->addUUID(_PREHASH_AgentID, gAgent.getID()); + msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID()); + + msg->nextBlock(_PREHASH_Data); + msg->addUUID(_PREHASH_ClassifiedID, classified_id); + + gAgent.sendReliableMessage(); +} bool LLAvatarPropertiesProcessor::isPendingRequest(const LLUUID& avatar_id, EAvatarProcessorType type) { diff --git a/indra/newview/llavatarpropertiesprocessor.h b/indra/newview/llavatarpropertiesprocessor.h index e6563024b2..716c1b8065 100644 --- a/indra/newview/llavatarpropertiesprocessor.h +++ b/indra/newview/llavatarpropertiesprocessor.h @@ -53,7 +53,9 @@ enum EAvatarProcessorType APT_GROUPS, APT_PICKS, APT_PICK_INFO, - APT_TEXTURES + APT_TEXTURES, + APT_CLASSIFIEDS, + APT_CLASSIFIED_INFO }; struct LLAvatarData @@ -136,6 +138,43 @@ struct LLAvatarGroups }; }; +struct LLAvatarClassifieds +{ + LLUUID agent_id; + LLUUID target_id; + + struct classified_data; + typedef std::list<classified_data> classifieds_list_t; + + classifieds_list_t classifieds_list; + + struct classified_data + { + LLUUID classified_id; + std::string name; + }; +}; + +struct LLAvatarClassifiedInfo +{ + LLUUID agent_id; + LLUUID classified_id; + LLUUID creator_id; + U32 creation_date; + U32 expiration_date; + U32 category; + std::string name; + std::string description; + LLUUID parcel_id; + U32 parent_estate; + LLUUID snapshot_id; + std::string sim_name; + LLVector3d pos_global; + std::string parcel_name; + U8 flags; + S32 price_for_listing; +}; + class LLAvatarPropertiesObserver { public: @@ -162,20 +201,27 @@ public: void sendAvatarNotesRequest(const LLUUID& avatar_id); void sendAvatarGroupsRequest(const LLUUID& avatar_id); void sendAvatarTexturesRequest(const LLUUID& avatar_id); + void sendAvatarClassifiedsRequest(const LLUUID& avatar_id); // Duplicate pick info requests are not suppressed. void sendPickInfoRequest(const LLUUID& creator_id, const LLUUID& pick_id); + void sendClassifiedInfoRequest(const LLUUID& classified_id); + void sendAvatarPropertiesUpdate(const LLAvatarData* avatar_props); void sendPickInfoUpdate(const LLPickData* new_pick); + void sendClassifiedInfoUpdate(const LLAvatarClassifiedInfo* c_data); + void sendFriendRights(const LLUUID& avatar_id, S32 rights); void sendNotes(const LLUUID& avatar_id, const std::string notes); void sendPickDelete(const LLUUID& pick_id); + void sendClassifiedDelete(const LLUUID& classified_id); + // Returns translated, human readable string for account type, such // as "Resident" or "Linden Employee". Used for profiles, inspectors. static std::string accountType(const LLAvatarData* avatar_data); @@ -189,7 +235,9 @@ public: static void processAvatarInterestsReply(LLMessageSystem* msg, void**); - static void processAvatarClassifiedReply(LLMessageSystem* msg, void**); + static void processAvatarClassifiedsReply(LLMessageSystem* msg, void**); + + static void processClassifiedInfoReply(LLMessageSystem* msg, void**); static void processAvatarGroupsReply(LLMessageSystem* msg, void**); diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index c200a97058..6e0654e157 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -55,6 +55,13 @@ static LLDefaultChildRegistry::Register<LLNotificationChiclet> t2("chiclet_notif static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t4("chiclet_im_group"); +static const LLRect CHICLET_RECT(0, 25, 25, 0); +static const LLRect CHICLET_ICON_RECT(0, 24, 24, 0); +static const LLRect VOICE_INDICATOR_RECT(25, 25, 45, 0); + +// static +const S32 LLChicletPanel::s_scroll_ratio = 10; + S32 LLNotificationChiclet::mUreadSystemNotifications = 0; boost::signals2::signal<LLChiclet* (const LLUUID&), @@ -199,7 +206,9 @@ void LLChiclet::setValue(const LLSD& value) LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) : LLChiclet(p) +, mShowSpeaker(false) , mNewMessagesIcon(NULL) +, mSpeakerCtrl(NULL) , mCounterCtrl(NULL) { // initialize an overlay icon for new messages @@ -218,6 +227,40 @@ LLIMChiclet::LLIMChiclet(const LLIMChiclet::Params& p) setShowCounter(false); } +void LLIMChiclet::setShowSpeaker(bool show) +{ + bool needs_resize = getShowSpeaker() != show; + if(needs_resize) + { + mShowSpeaker = show; + toggleSpeakerControl(); + onChicletSizeChanged(); + } +} +void LLIMChiclet::initSpeakerControl() +{ + // virtual +} + +void LLIMChiclet::toggleSpeakerControl() +{ + LLRect speaker_rect = mSpeakerCtrl->getRect(); + S32 required_width = getRect().getWidth(); + + if(getShowSpeaker()) + { + required_width = required_width + speaker_rect.getWidth(); + initSpeakerControl(); + } + else + { + required_width = required_width - speaker_rect.getWidth(); + } + + reshape(required_width, getRect().getHeight()); + mSpeakerCtrl->setVisible(getShowSpeaker()); +} + void LLIMChiclet::setShowNewMessagesIcon(bool show) { if(mNewMessagesIcon) @@ -300,7 +343,7 @@ LLIMP2PChiclet::Params::Params() , show_speaker("show_speaker") { // *TODO Vadim: Get rid of hardcoded values. - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); avatar_icon.name("avatar_icon"); avatar_icon.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_BOTTOM); @@ -309,11 +352,10 @@ LLIMP2PChiclet::Params::Params() // Changed icon height from 25 to 24 to fix ticket EXT-794. // In some cases(after changing UI scale) 25 pixel height icon was // drawn incorrectly, i'm not sure why. - avatar_icon.rect(LLRect(0, 24, 25, 0)); + avatar_icon.rect(CHICLET_ICON_RECT); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -322,7 +364,9 @@ LLIMP2PChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -330,7 +374,6 @@ LLIMP2PChiclet::Params::Params() LLIMP2PChiclet::LLIMP2PChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -358,18 +401,9 @@ void LLIMP2PChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -LLRect LLIMP2PChiclet::getRequiredRect() +void LLIMP2PChiclet::initSpeakerControl() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) - { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); - } - return rect; + mSpeakerCtrl->setSpeakerId(getOtherParticipantId()); } void LLIMP2PChiclet::setOtherParticipantId(const LLUUID& other_participant_id) @@ -446,18 +480,6 @@ void LLIMP2PChiclet::onMenuItemClicked(const LLSD& user_data) } } -void LLIMP2PChiclet::setShowSpeaker(bool show) -{ - LLIMChiclet::setShowSpeaker(show); - - bool needs_resize = getShowSpeaker() != show; - mSpeakerCtrl->setVisible(getShowSpeaker()); - if(needs_resize) - { - onChicletSizeChanged(); - } -} - ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -470,7 +492,7 @@ LLAdHocChiclet::Params::Params() , avatar_icon_color("avatar_icon_color", LLColor4::green) { // *TODO Vadim: Get rid of hardcoded values. - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); avatar_icon.name("avatar_icon"); avatar_icon.follows.flags(FOLLOWS_LEFT | FOLLOWS_TOP | FOLLOWS_BOTTOM); @@ -479,11 +501,10 @@ LLAdHocChiclet::Params::Params() // Changed icon height from 25 to 24 to fix ticket EXT-794. // In some cases(after changing UI scale) 25 pixel height icon was // drawn incorrectly, i'm not sure why. - avatar_icon.rect(LLRect(0, 24, 25, 0)); + avatar_icon.rect(CHICLET_ICON_RECT); avatar_icon.mouse_opaque(false); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -493,7 +514,9 @@ LLAdHocChiclet::Params::Params() speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -501,7 +524,6 @@ LLAdHocChiclet::Params::Params() LLAdHocChiclet::LLAdHocChiclet(const Params& p) : LLIMChiclet(p) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletAvatarIconCtrl::Params avatar_params = p.avatar_icon; @@ -532,24 +554,40 @@ void LLAdHocChiclet::setSessionId(const LLUUID& session_id) mChicletIconCtrl->setValue(im_session->mOtherParticipantID); } -void LLAdHocChiclet::setCounter(S32 counter) +void LLAdHocChiclet::draw() { - mCounterCtrl->setCounter(counter); - setShowNewMessagesIcon(counter); + switchToCurrentSpeaker(); + LLIMChiclet::draw(); } -LLRect LLAdHocChiclet::getRequiredRect() +void LLAdHocChiclet::initSpeakerControl() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) + switchToCurrentSpeaker(); +} + +void LLAdHocChiclet::switchToCurrentSpeaker() +{ + LLUUID speaker_id; + LLSpeakerMgr::speaker_list_t speaker_list; + + LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers->getSpeakerList(&speaker_list, FALSE); + for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); + LLPointer<LLSpeaker> s = *i; + if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) + { + speaker_id = s->mID; + break; + } } - return rect; + + mSpeakerCtrl->setSpeakerId(speaker_id); +} + +void LLAdHocChiclet::setCounter(S32 counter) +{ + mCounterCtrl->setCounter(counter); + setShowNewMessagesIcon(counter); } BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) @@ -564,7 +602,7 @@ BOOL LLAdHocChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) LLIMGroupChiclet::Params::Params() : group_icon("group_icon") { - rect(LLRect(0, 25, 25, 0)); + rect(CHICLET_RECT); group_icon.name("group_icon"); @@ -572,10 +610,9 @@ LLIMGroupChiclet::Params::Params() // Changed icon height from 25 to 24 to fix ticket EXT-794. // In some cases(after changing UI scale) 25 pixel height icon was // drawn incorrectly, i'm not sure why. - group_icon.rect(LLRect(0, 24, 25, 0)); + group_icon.rect(CHICLET_ICON_RECT); unread_notifications.name("unread"); - unread_notifications.rect(LLRect(25, 25, 45, 0)); unread_notifications.font(LLFontGL::getFontSansSerif()); unread_notifications.font_halign(LLFontGL::HCENTER); unread_notifications.v_pad(5); @@ -583,7 +620,9 @@ LLIMGroupChiclet::Params::Params() unread_notifications.visible(false); speaker.name("speaker"); - speaker.rect(LLRect(45, 25, 65, 0)); + speaker.rect(VOICE_INDICATOR_RECT); + speaker.auto_update(true); + speaker.draw_border(false); show_speaker = false; } @@ -592,7 +631,6 @@ LLIMGroupChiclet::LLIMGroupChiclet(const Params& p) : LLIMChiclet(p) , LLGroupMgrObserver(LLUUID::null) , mChicletIconCtrl(NULL) -, mSpeakerCtrl(NULL) , mPopupMenu(NULL) { LLChicletGroupIconCtrl::Params avatar_params = p.group_icon; @@ -625,18 +663,34 @@ void LLIMGroupChiclet::setCounter(S32 counter) setShowNewMessagesIcon(counter); } -LLRect LLIMGroupChiclet::getRequiredRect() +void LLIMGroupChiclet::draw() { - LLRect rect(0, 0, mChicletIconCtrl->getRect().getWidth(), 0); - if(getShowCounter()) - { - rect.mRight += mCounterCtrl->getRequiredRect().getWidth(); - } - if(getShowSpeaker()) + switchToCurrentSpeaker(); + LLIMChiclet::draw(); +} + +void LLIMGroupChiclet::initSpeakerControl() +{ + switchToCurrentSpeaker(); +} + +void LLIMGroupChiclet::switchToCurrentSpeaker() +{ + LLUUID speaker_id; + LLSpeakerMgr::speaker_list_t speaker_list; + + LLIMModel::getInstance()->findIMSession(getSessionId())->mSpeakers->getSpeakerList(&speaker_list, FALSE); + for (LLSpeakerMgr::speaker_list_t::iterator i = speaker_list.begin(); i != speaker_list.end(); ++i) { - rect.mRight += mSpeakerCtrl->getRect().getWidth(); + LLPointer<LLSpeaker> s = *i; + if (s->mSpeechVolume > 0 || s->mStatus == LLSpeaker::STATUS_SPEAKING) + { + speaker_id = s->mID; + break; + } } - return rect; + + mSpeakerCtrl->setSpeakerId(speaker_id); } void LLIMGroupChiclet::setSessionId(const LLUUID& session_id) @@ -723,17 +777,6 @@ void LLIMGroupChiclet::onMenuItemClicked(const LLSD& user_data) } } -void LLIMGroupChiclet::setShowSpeaker(bool show) -{ - LLIMChiclet::setShowSpeaker(show); - - bool needs_resize = getShowSpeaker() != show; - mSpeakerCtrl->setVisible(getShowSpeaker()); - if(needs_resize) - { - onChicletSizeChanged(); - } -} ////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////// @@ -742,8 +785,6 @@ void LLIMGroupChiclet::setShowSpeaker(bool show) LLChicletPanel::Params::Params() : chiclet_padding("chiclet_padding") , scrolling_offset("scrolling_offset") -, left_scroll_button("left_scroll_button") -, right_scroll_button("right_scroll_button") , min_width("min_width") { chiclet_padding = 3; @@ -754,24 +795,6 @@ LLChicletPanel::Params::Params() // min_width = 4 chiclets + 3 paddings min_width = 179 + 3*chiclet_padding; } - - LLRect scroll_button_rect(0, 25, 19, 5); - - left_scroll_button.name("left_scroll"); - left_scroll_button.label(LLStringUtil::null); - left_scroll_button.rect(scroll_button_rect); - left_scroll_button.tab_stop(false); - left_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - left_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - left_scroll_button.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_left.tga")); - - right_scroll_button.name("right_scroll"); - right_scroll_button.label(LLStringUtil::null); - right_scroll_button.rect(scroll_button_rect); - right_scroll_button.tab_stop(false); - right_scroll_button.image_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); - right_scroll_button.image_unselected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); - right_scroll_button.image_hover_selected(LLUI::getUIImage("bottom_tray_scroll_right.tga")); }; LLChicletPanel::LLChicletPanel(const Params&p) @@ -784,23 +807,6 @@ LLChicletPanel::LLChicletPanel(const Params&p) , mMinWidth(p.min_width) , mShowControls(true) { - LLButton::Params scroll_button_params = p.left_scroll_button; - - mLeftScrollButton = LLUICtrlFactory::create<LLButton>(scroll_button_params); - addChild(mLeftScrollButton); - LLTransientFloaterMgr::getInstance()->addControlView(mLeftScrollButton); - - mLeftScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); - mLeftScrollButton->setEnabled(false); - - scroll_button_params = p.right_scroll_button; - mRightScrollButton = LLUICtrlFactory::create<LLButton>(scroll_button_params); - addChild(mRightScrollButton); - LLTransientFloaterMgr::getInstance()->addControlView(mRightScrollButton); - - mRightScrollButton->setClickedCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); - mRightScrollButton->setEnabled(false); - LLPanel::Params panel_params; mScrollArea = LLUICtrlFactory::create<LLPanel>(panel_params,this); @@ -851,10 +857,40 @@ BOOL LLChicletPanel::postBuild() LLIMModel::instance().addNewMsgCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(im_chiclet_callback, this, _1)); LLIMChiclet::sFindChicletsSignal.connect(boost::bind(&LLChicletPanel::findChiclet<LLChiclet>, this, _1)); + LLVoiceChannel::setCurrentVoiceChannelChangedCallback(boost::bind(&LLChicletPanel::onCurrentVoiceChannelChanged, this, _1)); + + mLeftScrollButton=getChild<LLButton>("chicklet_left_scroll_button"); + LLTransientFloaterMgr::getInstance()->addControlView(mLeftScrollButton); + mLeftScrollButton->setMouseDownCallback(boost::bind(&LLChicletPanel::onLeftScrollClick,this)); + mLeftScrollButton->setHeldDownCallback(boost::bind(&LLChicletPanel::onLeftScrollHeldDown,this)); + mLeftScrollButton->setEnabled(false); + + mRightScrollButton=getChild<LLButton>("chicklet_right_scroll_button"); + LLTransientFloaterMgr::getInstance()->addControlView(mRightScrollButton); + mRightScrollButton->setMouseDownCallback(boost::bind(&LLChicletPanel::onRightScrollClick,this)); + mRightScrollButton->setHeldDownCallback(boost::bind(&LLChicletPanel::onRightScrollHeldDown,this)); + mRightScrollButton->setEnabled(false); return TRUE; } +void LLChicletPanel::onCurrentVoiceChannelChanged(const LLUUID& session_id) +{ + for(chiclet_list_t::iterator it = mChicletList.begin(); it != mChicletList.end(); ++it) + { + LLIMChiclet* chiclet = dynamic_cast<LLIMChiclet*>(*it); + if(chiclet) + { + if(chiclet->getSessionId() == session_id) + { + chiclet->setShowSpeaker(true); + continue; + } + chiclet->setShowSpeaker(false); + } + } +} + S32 LLChicletPanel::calcChickletPanleWidth() { S32 res = 0; @@ -898,23 +934,7 @@ bool LLChicletPanel::addChiclet(LLChiclet* chiclet, S32 index) void LLChicletPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param) { - S32 chiclet_width = ctrl->getRect().getWidth(); - S32 chiclet_new_width = ctrl->getRequiredRect().getWidth(); - - if(chiclet_new_width == chiclet_width) - { - return; - } - - LLRect chiclet_rect = ctrl->getRect(); - chiclet_rect.mRight = chiclet_rect.mLeft + chiclet_new_width; - - ctrl->setRect(chiclet_rect); - - S32 offset = chiclet_new_width - chiclet_width; - S32 index = getChicletIndex(ctrl); - - shiftChiclets(offset, index + 1); + arrange(); trimChiclets(); showScrollButtonsIfNeeded(); } @@ -1026,23 +1046,24 @@ void LLChicletPanel::reshape(S32 width, S32 height, BOOL called_from_parent ) static const S32 SCROLL_BUTTON_PAD = 5; + //Needed once- to avoid error at first call of reshape() before postBuild() + if(!mLeftScrollButton||!mRightScrollButton) + return; + LLRect scroll_button_rect = mLeftScrollButton->getRect(); - mLeftScrollButton->setRect(LLRect(0,height,scroll_button_rect.getWidth(), - height - scroll_button_rect.getHeight())); - + mLeftScrollButton->setRect(LLRect(0,scroll_button_rect.mTop,scroll_button_rect.getWidth(), + scroll_button_rect.mBottom)); scroll_button_rect = mRightScrollButton->getRect(); - mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),height, - width, height - scroll_button_rect.getHeight())); - + mRightScrollButton->setRect(LLRect(width - scroll_button_rect.getWidth(),scroll_button_rect.mTop, + width, scroll_button_rect.mBottom)); mScrollArea->setRect(LLRect(scroll_button_rect.getWidth() + SCROLL_BUTTON_PAD, height, width - scroll_button_rect.getWidth() - SCROLL_BUTTON_PAD, 0)); - mShowControls = width > mMinWidth; mScrollArea->setVisible(mShowControls); trimChiclets(); - showScrollButtonsIfNeeded(); + } void LLChicletPanel::arrange() @@ -1206,6 +1227,22 @@ void LLChicletPanel::onRightScrollClick() scrollRight(); } +void LLChicletPanel::onLeftScrollHeldDown() +{ + S32 offset = mScrollingOffset; + mScrollingOffset = mScrollingOffset / s_scroll_ratio; + scrollLeft(); + mScrollingOffset = offset; +} + +void LLChicletPanel::onRightScrollHeldDown() +{ + S32 offset = mScrollingOffset; + mScrollingOffset = mScrollingOffset / s_scroll_ratio; + scrollRight(); + mScrollingOffset = offset; +} + boost::signals2::connection LLChicletPanel::setChicletClickedCallback( const commit_callback_t& cb) { @@ -1329,6 +1366,6 @@ void LLChicletGroupIconCtrl::setValue(const LLSD& value ) ////////////////////////////////////////////////////////////////////////// LLChicletSpeakerCtrl::LLChicletSpeakerCtrl(const Params&p) - : LLIconCtrl(p) + : LLOutputMonitorCtrl(p) { } diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index b50702205c..e7afd7f08e 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -147,13 +147,13 @@ protected: }; /* - * Class for displaying status of Voice Chat + * Class for displaying of speaker's voice indicator */ -class LLChicletSpeakerCtrl : public LLIconCtrl +class LLChicletSpeakerCtrl : public LLOutputMonitorCtrl { public: - struct Params : public LLInitParam::Block<Params, LLIconCtrl::Params> + struct Params : public LLInitParam::Block<Params, LLOutputMonitorCtrl::Params> { Params(){}; }; @@ -266,8 +266,6 @@ private: * Base class for Instant Message chiclets. * IMChiclet displays icon, number of unread messages(optional) * and voice chat status(optional). -* Every chiclet should override LLUICtrl::getRequiredRect and return -* desired width. */ class LLIMChiclet : public LLChiclet { @@ -306,9 +304,14 @@ public: virtual LLUUID getOtherParticipantId() { return mOtherParticipantId; } /* - * Shows/hides voice chat status control. + * Init Speaker Control with speaker's ID */ - virtual void setShowSpeaker(bool show) { mShowSpeaker = show; } + virtual void initSpeakerControl(); + + /* + * set status (Shows/Hide) for voice control. + */ + virtual void setShowSpeaker(bool show); /* * Returns voice chat status control visibility. @@ -316,6 +319,11 @@ public: virtual bool getShowSpeaker() {return mShowSpeaker;}; /* + * Shows/Hides for voice control for a chiclet. + */ + virtual void toggleSpeakerControl(); + + /* * Shows/hides overlay icon concerning new unread messages. */ virtual void setShowNewMessagesIcon(bool show); @@ -325,10 +333,7 @@ public: */ virtual bool getShowNewMessagesIcon(); - /* - * Draws border around chiclet. - */ - /*virtual*/ void draw(); + virtual void draw(); /** * Determine whether given ID refers to a group or an IM chat session. @@ -363,6 +368,8 @@ protected: LLIconCtrl* mNewMessagesIcon; LLChicletNotificationCounterCtrl* mCounterCtrl; + LLChicletSpeakerCtrl* mSpeakerCtrl; + /** the id of another participant, either an avatar id or a group id*/ LLUUID mOtherParticipantId; @@ -410,8 +417,6 @@ public: /* virtual */ void setOtherParticipantId(const LLUUID& other_participant_id); - /*virtual*/ void setShowSpeaker(bool show); - /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -419,15 +424,14 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Init Speaker Control with speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void initSpeakerControl(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Returns number of unread messages. */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } protected: LLIMP2PChiclet(const Params& p); @@ -457,7 +461,6 @@ protected: private: LLChicletAvatarIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -495,15 +498,19 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Keep Speaker Control with actual speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void draw(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Init Speaker Control with speaker's ID */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ void initSpeakerControl(); + + /* + * Returns number of unread messages. + */ + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } protected: LLAdHocChiclet(const Params& p); @@ -514,10 +521,14 @@ protected: */ virtual BOOL handleRightMouseDown(S32 x, S32 y, MASK mask); + /* + * Finds a current speaker and resets the SpeakerControl with speaker's ID + */ + /*virtual*/ void switchToCurrentSpeaker(); + private: LLChicletAvatarIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -547,14 +558,17 @@ public: */ /*virtual*/ void setSessionId(const LLUUID& session_id); + /* + * Keep Speaker Control with actual speaker's ID + */ + /*virtual*/ void draw(); + /** * Callback for LLGroupMgrObserver, we get this when group data is available or changed. * Sets group icon. */ /*virtual*/ void changed(LLGroupChange gc); - /*virtual*/ void setShowSpeaker(bool show); - /* * Sets number of unread messages. Will update chiclet's width if number text * exceeds size of counter and notify it's parent about size change. @@ -562,15 +576,14 @@ public: /*virtual*/ void setCounter(S32); /* - * Returns number of unread messages. + * Init Speaker Control with speaker's ID */ - /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } + /*virtual*/ void initSpeakerControl(); /* - * Returns rect, required to display chiclet. - * Width is the only valid value. + * Returns number of unread messages. */ - /*virtual*/ LLRect getRequiredRect(); + /*virtual*/ S32 getCounter() { return mCounterCtrl->getCounter(); } ~LLIMGroupChiclet(); @@ -579,6 +592,11 @@ protected: friend class LLUICtrlFactory; /* + * Finds a current speaker and resets the SpeakerControl with speaker's ID + */ + /*virtual*/ void switchToCurrentSpeaker(); + + /* * Creates chiclet popup menu. Will create P2P or Group IM Chat menu * based on other participant's id. */ @@ -597,7 +615,6 @@ protected: private: LLChicletGroupIconCtrl* mChicletIconCtrl; - LLChicletSpeakerCtrl* mSpeakerCtrl; LLMenuGL* mPopupMenu; }; @@ -660,9 +677,6 @@ public: Optional<S32> chiclet_padding, scrolling_offset; - Optional<LLButton::Params> left_scroll_button, - right_scroll_button; - Optional<S32> min_width; Params(); @@ -736,6 +750,11 @@ public: /*virtual*/ BOOL postBuild(); /* + * Handler for the Voice Client's signal. Finds a corresponding chiclet and toggles its SpeakerControl + */ + void onCurrentVoiceChannelChanged(const LLUUID& session_id); + + /* * Reshapes controls and rearranges chiclets if needed. */ /*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE ); @@ -812,6 +831,16 @@ protected: void onRightScrollClick(); /* + * Callback for right scroll button held down event + */ + void onLeftScrollHeldDown(); + + /* + * Callback for left scroll button held down event + */ + void onRightScrollHeldDown(); + + /* * Callback for mouse wheel scrolled, calls scrollRight() or scrollLeft() */ BOOL handleScrollWheel(S32 x, S32 y, S32 clicks); @@ -851,6 +880,7 @@ protected: S32 mScrollingOffset; S32 mMinWidth; bool mShowControls; + static const S32 s_scroll_ratio; }; template<class T> diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index 663bd232f7..3613ac803e 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -849,6 +849,7 @@ void LLFloaterUIPreview::displayFloater(BOOL click, S32 ID, bool save) { LLUICtrlFactory::getInstance()->buildFloater(*floaterp, path, NULL); // just build it (*floaterp)->openFloater((*floaterp)->getKey()); + (*floaterp)->setCanResize((*floaterp)->isResizable()); } } diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index 010ed23918..cdb85f5b1c 100644 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -181,13 +181,9 @@ void LLGroupList::addNewItem(const LLUUID& id, const std::string& name, const LL // item->setContextMenu(mContextMenu); item->childSetVisible("info_btn", false); + item->childSetVisible("profile_btn", false); item->setGroupIconVisible(mShowIcons); - if (id.isNull()) - { - item->childSetVisible("profile_btn", false); - } - addItem(item, id, pos); // setCommentVisible(false); @@ -254,7 +250,10 @@ void LLGroupListItem::onMouseEnter(S32 x, S32 y, MASK mask) { childSetVisible("hovered_icon", true); if (mGroupID.notNull()) // don't show the info button for the "none" group + { mInfoBtn->setVisible(true); + childSetVisible("profile_btn", true); + } LLPanel::onMouseEnter(x, y, mask); } @@ -263,6 +262,7 @@ void LLGroupListItem::onMouseLeave(S32 x, S32 y, MASK mask) { childSetVisible("hovered_icon", false); mInfoBtn->setVisible(false); + childSetVisible("profile_btn", false); LLPanel::onMouseLeave(x, y, mask); } diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 8fb7027e82..476d312c69 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1157,6 +1157,9 @@ void LLIncomingCallDialog::onStartIM(void* user_data) void LLIncomingCallDialog::processCallResponse(S32 response) { + if (!gIMMgr) + return; + LLUUID session_id = mPayload["session_id"].asUUID(); EInstantMessage type = (EInstantMessage)mPayload["type"].asInteger(); LLIMMgr::EInvitationType inv_type = (LLIMMgr::EInvitationType)mPayload["inv_type"].asInteger(); @@ -1254,6 +1257,9 @@ void LLIncomingCallDialog::processCallResponse(S32 response) bool inviteUserResponse(const LLSD& notification, const LLSD& response) { + if (!gIMMgr) + return false; + const LLSD& payload = notification["payload"]; LLUUID session_id = payload["session_id"].asUUID(); EInstantMessage type = (EInstantMessage)payload["type"].asInteger(); diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp index 17b712bc5e..794d73a5ad 100644 --- a/indra/newview/llnavigationbar.cpp +++ b/indra/newview/llnavigationbar.cpp @@ -480,7 +480,7 @@ void LLNavigationBar::rebuildTeleportHistoryMenu() type = LLTeleportHistoryMenuItem::TYPE_CURRENT; LLTeleportHistoryMenuItem::Params item_params; - item_params.label = item_params.name = hist_items[i].getTitle(); + item_params.label = item_params.name = hist_items[i].mTitle; item_params.item_type = type; item_params.on_click.function(boost::bind(&LLNavigationBar::onTeleportHistoryMenuItemClicked, this, i)); LLTeleportHistoryMenuItem* new_itemp = LLUICtrlFactory::create<LLTeleportHistoryMenuItem>(item_params); diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index a29c9752e6..5679233844 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -1142,3 +1142,529 @@ void LLPanelClassified::setDefaultAccessCombo() break; } } + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLPanelClassifiedInfo::LLPanelClassifiedInfo() + : LLPanel() + , mInfoLoaded(false) +{ +} + +LLPanelClassifiedInfo::~LLPanelClassifiedInfo() +{ +} + +// static +LLPanelClassifiedInfo* LLPanelClassifiedInfo::create() +{ + LLPanelClassifiedInfo* panel = new LLPanelClassifiedInfo(); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_classified_info.xml"); + return panel; +} + +BOOL LLPanelClassifiedInfo::postBuild() +{ + childSetAction("back_btn", boost::bind(&LLPanelClassifiedInfo::onExit, this), NULL); + + return TRUE; +} + +void LLPanelClassifiedInfo::setExitCallback(const commit_callback_t& cb) +{ + getChild<LLButton>("back_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedInfo::onOpen(const LLSD& key) +{ + LLUUID avatar_id = key["avatar_id"]; + if(avatar_id.isNull()) + { + return; + } + + if(getAvatarId().notNull()) + { + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); + } + + setAvatarId(avatar_id); + + resetData(); + resetControls(); + + setClassifiedId(key["classified_id"]); + setClassifiedName(key["name"]); + setDescription(key["desc"]); + setSnapshotId(key["snapshot_id"]); + + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); + setInfoLoaded(false); +} + +void LLPanelClassifiedInfo::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO == type) + { + LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); + if(c_info && getClassifiedId() == c_info->classified_id) + { + setClassifiedName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setParcelId(c_info->parcel_id); + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); + childSetValue("category", LLClassifiedInfo::sCategories[c_info->category]); + + static std::string mature_str = getString("type_mature"); + static std::string pg_str = getString("type_pg"); + + bool mature = is_cf_mature(c_info->flags); + childSetValue("content_type", mature ? mature_str : pg_str); + childSetValue("auto_renew", is_cf_auto_renew(c_info->flags)); + + childSetTextArg("price_for_listing", "[PRICE]", llformat("%d", c_info->price_for_listing)); + + setInfoLoaded(true); + } + } +} + +void LLPanelClassifiedInfo::resetData() +{ + setClassifiedName(LLStringUtil::null); + setDescription(LLStringUtil::null); + setClassifiedLocation(LLStringUtil::null); + setClassifiedId(LLUUID::null); + setSnapshotId(LLUUID::null); + mPosGlobal.clearVec(); + childSetValue("category", LLStringUtil::null); + childSetValue("content_type", LLStringUtil::null); +} + +void LLPanelClassifiedInfo::resetControls() +{ + if(getAvatarId() == gAgent.getID()) + { + childSetEnabled("edit_btn", TRUE); + childSetVisible("edit_btn", TRUE); + } + else + { + childSetEnabled("edit_btn", FALSE); + childSetVisible("edit_btn", FALSE); + } +} + +void LLPanelClassifiedInfo::setClassifiedName(const std::string& name) +{ + childSetValue("classified_name", name); +} + +std::string LLPanelClassifiedInfo::getClassifiedName() +{ + return childGetValue("classified_name").asString(); +} + +void LLPanelClassifiedInfo::setDescription(const std::string& desc) +{ + childSetValue("classified_desc", desc); +} + +std::string LLPanelClassifiedInfo::getDescription() +{ + return childGetValue("classified_desc").asString(); +} + +void LLPanelClassifiedInfo::setClassifiedLocation(const std::string& location) +{ + childSetValue("classified_location", location); +} + +void LLPanelClassifiedInfo::setSnapshotId(const LLUUID& id) +{ + childSetValue("classified_snapshot", id); +} + +LLUUID LLPanelClassifiedInfo::getSnapshotId() +{ + return childGetValue("classified_snapshot").asUUID(); +} + +// static +std::string LLPanelClassifiedInfo::createLocationText( + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global) +{ + std::string location_text; + + location_text.append(original_name); + + if (!sim_name.empty()) + { + if (!location_text.empty()) + location_text.append(", "); + location_text.append(sim_name); + } + + if (!location_text.empty()) + location_text.append(" "); + + if (!pos_global.isNull()) + { + S32 region_x = llround((F32)pos_global.mdV[VX]) % REGION_WIDTH_UNITS; + S32 region_y = llround((F32)pos_global.mdV[VY]) % REGION_WIDTH_UNITS; + S32 region_z = llround((F32)pos_global.mdV[VZ]); + location_text.append(llformat(" (%d, %d, %d)", region_x, region_y, region_z)); + } + + return location_text; +} + +void LLPanelClassifiedInfo::onExit() +{ + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +static const S32 CB_ITEM_MATURE = 0; +static const S32 CB_ITEM_PG = 1; + +LLPanelClassifiedEdit::LLPanelClassifiedEdit() + : LLPanelClassifiedInfo() + , mIsNew(false) +{ +} + +LLPanelClassifiedEdit::~LLPanelClassifiedEdit() +{ +} + +//static +LLPanelClassifiedEdit* LLPanelClassifiedEdit::create() +{ + LLPanelClassifiedEdit* panel = new LLPanelClassifiedEdit(); + LLUICtrlFactory::getInstance()->buildPanel(panel, "panel_edit_classified.xml"); + return panel; +} + +BOOL LLPanelClassifiedEdit::postBuild() +{ + LLPanelClassifiedInfo::postBuild(); + + LLTextureCtrl* snapshot = getChild<LLTextureCtrl>("classified_snapshot"); + snapshot->setOnSelectCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); + + LLUICtrl* edit_icon = getChild<LLUICtrl>("edit_icon"); + snapshot->setMouseEnterCallback(boost::bind(&LLPanelClassifiedEdit::onTexturePickerMouseEnter, this, edit_icon)); + snapshot->setMouseLeaveCallback(boost::bind(&LLPanelClassifiedEdit::onTexturePickerMouseLeave, this, edit_icon)); + edit_icon->setVisible(false); + + LLLineEditor* line_edit = getChild<LLLineEditor>("classified_name"); + line_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + + LLTextEditor* text_edit = getChild<LLTextEditor>("classified_desc"); + text_edit->setKeystrokeCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); + + LLComboBox* combobox = getChild<LLComboBox>( "category"); + LLClassifiedInfo::cat_map::iterator iter; + for (iter = LLClassifiedInfo::sCategories.begin(); + iter != LLClassifiedInfo::sCategories.end(); + iter++) + { + combobox->add(LLTrans::getString(iter->second)); + } + + combobox->setCommitCallback(boost::bind(&LLPanelClassifiedEdit::onChange, this)); + + childSetCommitCallback("content_type", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + childSetCommitCallback("price_for_listing", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + childSetCommitCallback("auto_renew", boost::bind(&LLPanelClassifiedEdit::onChange, this), NULL); + + childSetAction("save_changes_btn", boost::bind(&LLPanelClassifiedEdit::onSaveClick, this)); + childSetAction("set_to_curr_location_btn", boost::bind(&LLPanelClassifiedEdit::onSetLocationClick, this)); + + return TRUE; +} + +void LLPanelClassifiedEdit::onOpen(const LLSD& key) +{ + LLUUID classified_id = key["classified_id"]; + + mIsNew = classified_id.isNull(); + + if(mIsNew) + { + setAvatarId(gAgent.getID()); + + resetData(); + resetControls(); + + setPosGlobal(gAgent.getPositionGlobal()); + + LLUUID snapshot_id = LLUUID::null; + std::string desc; + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if(parcel) + { + desc = parcel->getDesc(); + snapshot_id = parcel->getSnapshotID(); + } + + std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + region_name = region->getName(); + } + + childSetValue("classified_name", makeClassifiedName()); + childSetValue("classified_desc", desc); + setSnapshotId(snapshot_id); + + setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); + + // server will set valid parcel id + setParcelId(LLUUID::null); + + enableVerbs(true); + enableEditing(true); + } + else + { + LLPanelClassifiedInfo::onOpen(key); + enableVerbs(false); + enableEditing(false); + } + + resetDirty(); + setInfoLoaded(false); +} + +void LLPanelClassifiedEdit::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO == type) + { + LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); + if(c_info && getClassifiedId() == c_info->classified_id) + { + enableEditing(true); + + setClassifiedName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setPosGlobal(c_info->pos_global); + + setClassifiedLocation(createLocationText(c_info->parcel_name, c_info->sim_name, c_info->pos_global)); + getChild<LLComboBox>("category")->setCurrentByIndex(c_info->category + 1); + getChild<LLComboBox>("category")->resetDirty(); + + bool mature = is_cf_mature(c_info->flags); + bool auto_renew = is_cf_auto_renew(c_info->flags); + + getChild<LLComboBox>("content_type")->setCurrentByIndex(mature ? CB_ITEM_MATURE : CB_ITEM_PG); + childSetValue("auto_renew", auto_renew); + childSetValue("price_for_listing", c_info->price_for_listing); + + resetDirty(); + setInfoLoaded(true); + } + } +} + +BOOL LLPanelClassifiedEdit::isDirty() const +{ + if(mIsNew) + { + return TRUE; + } + + BOOL dirty = false; + + dirty |= LLPanelClassifiedInfo::isDirty(); + dirty |= getChild<LLUICtrl>("classified_snapshot")->isDirty(); + dirty |= getChild<LLUICtrl>("classified_name")->isDirty(); + dirty |= getChild<LLUICtrl>("classified_desc")->isDirty(); + dirty |= getChild<LLUICtrl>("category")->isDirty(); + dirty |= getChild<LLUICtrl>("content_type")->isDirty(); + dirty |= getChild<LLUICtrl>("auto_renew")->isDirty(); + dirty |= getChild<LLUICtrl>("price_for_listing")->isDirty(); + + return dirty; +} + +void LLPanelClassifiedEdit::resetDirty() +{ + LLPanelClassifiedInfo::resetDirty(); + getChild<LLUICtrl>("classified_snapshot")->resetDirty(); + getChild<LLUICtrl>("classified_name")->resetDirty(); + getChild<LLUICtrl>("classified_desc")->resetDirty(); + getChild<LLUICtrl>("category")->resetDirty(); + getChild<LLUICtrl>("content_type")->resetDirty(); + getChild<LLUICtrl>("auto_renew")->resetDirty(); + getChild<LLUICtrl>("price_for_listing")->resetDirty(); +} + +void LLPanelClassifiedEdit::setSaveCallback(const commit_callback_t& cb) +{ + getChild<LLButton>("save_changes_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedEdit::setCancelCallback(const commit_callback_t& cb) +{ + getChild<LLButton>("cancel_btn")->setClickedCallback(cb); +} + +void LLPanelClassifiedEdit::resetControls() +{ + LLPanelClassifiedInfo::resetControls(); + + getChild<LLComboBox>("category")->setCurrentByIndex(0); + getChild<LLComboBox>("content_type")->setCurrentByIndex(0); + childSetValue("auto_renew", false); + childSetValue("price_for_listing", MINIMUM_PRICE_FOR_LISTING); +} + +void LLPanelClassifiedEdit::sendUpdate() +{ + LLAvatarClassifiedInfo c_data; + + if(getClassifiedId().isNull()) + { + LLUUID id; + id.generate(); + setClassifiedId(id); + } + + c_data.agent_id = gAgent.getID(); + c_data.classified_id = getClassifiedId(); + c_data.category = getCategory(); + c_data.name = getClassifiedName(); + c_data.description = getDescription(); + c_data.parcel_id = getParcelId(); + c_data.snapshot_id = getSnapshotId(); + c_data.pos_global = getPosGlobal(); + c_data.flags = getFlags(); + c_data.price_for_listing = getPriceForListing(); + + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoUpdate(&c_data); +} + +U32 LLPanelClassifiedEdit::getCategory() +{ + LLComboBox* cat_cb = getChild<LLComboBox>("category"); + return cat_cb->getCurrentIndex() + 1; +} + +U8 LLPanelClassifiedEdit::getFlags() +{ + bool auto_renew = childGetValue("auto_renew").asBoolean(); + + LLComboBox* content_cb = getChild<LLComboBox>("content_type"); + bool mature = content_cb->getCurrentIndex() == CB_ITEM_MATURE; + + return pack_classified_flags_request(auto_renew, false, mature, false); +} + +void LLPanelClassifiedEdit::enableVerbs(bool enable) +{ + childSetEnabled("save_changes_btn", enable); +} + +void LLPanelClassifiedEdit::enableEditing(bool enable) +{ + childSetEnabled("classified_snapshot", enable); + childSetEnabled("classified_name", enable); + childSetEnabled("classified_desc", enable); + childSetEnabled("set_to_curr_location_btn", enable); + childSetEnabled("category", enable); + childSetEnabled("content_type", enable); + childSetEnabled("price_for_listing", enable); + childSetEnabled("auto_renew", enable); +} + +std::string LLPanelClassifiedEdit::makeClassifiedName() +{ + std::string name; + + LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + if(parcel) + { + name = parcel->getName(); + } + + if(!name.empty()) + { + return name; + } + + LLViewerRegion* region = gAgent.getRegion(); + if(region) + { + name = region->getName(); + } + + return name; +} + +S32 LLPanelClassifiedEdit::getPriceForListing() +{ + return childGetValue("price_for_listing").asInteger(); +} + +void LLPanelClassifiedEdit::onSetLocationClick() +{ + setPosGlobal(gAgent.getPositionGlobal()); + setParcelId(LLUUID::null); + + std::string region_name = LLTrans::getString("ClassifiedUpdateAfterPublish"); + LLViewerRegion* region = gAgent.getRegion(); + if (region) + { + region_name = region->getName(); + } + + setClassifiedLocation(createLocationText(getLocationNotice(), region_name, getPosGlobal())); + + // mark classified as dirty + setValue(LLSD()); + + onChange(); +} + +void LLPanelClassifiedEdit::onChange() +{ + enableVerbs(isDirty()); +} + +void LLPanelClassifiedEdit::onSaveClick() +{ + sendUpdate(); + resetDirty(); +} + +std::string LLPanelClassifiedEdit::getLocationNotice() +{ + static std::string location_notice = getString("location_notice"); + return location_notice; +} + +void LLPanelClassifiedEdit::onTexturePickerMouseEnter(LLUICtrl* ctrl) +{ + ctrl->setVisible(TRUE); +} + +void LLPanelClassifiedEdit::onTexturePickerMouseLeave(LLUICtrl* ctrl) +{ + ctrl->setVisible(FALSE); +} + +//EOF diff --git a/indra/newview/llpanelclassified.h b/indra/newview/llpanelclassified.h index 417eddf460..187bdbb37e 100644 --- a/indra/newview/llpanelclassified.h +++ b/indra/newview/llpanelclassified.h @@ -37,6 +37,7 @@ #ifndef LL_LLPANELCLASSIFIED_H #define LL_LLPANELCLASSIFIED_H +#include "llavatarpropertiesprocessor.h" #include "llpanel.h" #include "llclassifiedinfo.h" #include "v3dmath.h" @@ -55,6 +56,8 @@ class LLTextureCtrl; class LLUICtrl; class LLMessageSystem; +// *TODO deprecated, should be removed. +// New class implemented in ticket EXT-2095 class LLPanelClassified : public LLPanel { public: @@ -198,5 +201,138 @@ private: void* mUserData; }; +class LLPanelClassifiedInfo : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + static LLPanelClassifiedInfo* create(); + + virtual ~LLPanelClassifiedInfo(); + + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + void setAvatarId(const LLUUID& avatar_id) { mAvatarId = avatar_id; } + + LLUUID& getAvatarId() { return mAvatarId; } + + void setSnapshotId(const LLUUID& id); + + LLUUID getSnapshotId(); + + void setClassifiedId(const LLUUID& id) { mClassifiedId = id; } + + LLUUID& getClassifiedId() { return mClassifiedId; } + + void setClassifiedName(const std::string& name); + + std::string getClassifiedName(); + + void setDescription(const std::string& desc); + + std::string getDescription(); + + void setClassifiedLocation(const std::string& location); + + void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + + LLVector3d& getPosGlobal() { return mPosGlobal; } + + void setParcelId(const LLUUID& id) { mParcelId = id; } + + LLUUID getParcelId() { return mParcelId; } + + bool getInfoLoaded() { return mInfoLoaded; } + + void setInfoLoaded(bool loaded) { mInfoLoaded = loaded; } + + virtual void setExitCallback(const commit_callback_t& cb); + +protected: + + LLPanelClassifiedInfo(); + + virtual void resetData(); + + virtual void resetControls(); + + static std::string createLocationText( + const std::string& original_name, + const std::string& sim_name, + const LLVector3d& pos_global); + + void onClickMap(); + void onClickTeleport(); + void onClickBack(); + void onExit(); + +private: + + LLUUID mAvatarId; + LLUUID mClassifiedId; + LLVector3d mPosGlobal; + LLUUID mParcelId; + bool mInfoLoaded; +}; + +class LLPanelClassifiedEdit : public LLPanelClassifiedInfo +{ +public: + + static LLPanelClassifiedEdit* create(); + + virtual ~LLPanelClassifiedEdit(); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void onOpen(const LLSD& key); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + /*virtual*/ BOOL isDirty() const; + + /*virtual*/ void resetDirty(); + + void setSaveCallback(const commit_callback_t& cb); + + void setCancelCallback(const commit_callback_t& cb); + + /*virtual*/ void resetControls(); + + bool isNew() { return mIsNew; } + +protected: + + LLPanelClassifiedEdit(); + + void sendUpdate(); + + U32 getCategory(); + + void enableVerbs(bool enable); + + void enableEditing(bool enable); + + std::string makeClassifiedName(); + + S32 getPriceForListing(); + + U8 getFlags(); + + std::string getLocationNotice(); + + void onSetLocationClick(); + void onChange(); + void onSaveClick(); + + void onTexturePickerMouseEnter(LLUICtrl* ctrl); + void onTexturePickerMouseLeave(LLUICtrl* ctrl); + +private: + bool mIsNew; +}; #endif // LL_LLPANELCLASSIFIED_H diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index c9168670d5..350b78ee3d 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -86,10 +86,8 @@ void LLPanelChatControlPanel::draw() bool session_initialized = session->mSessionInitialized; bool callback_enabled = session->mCallBackEnabled; - LLViewerRegion* region = gAgent.getRegion(); - BOOL enable_connect = (region && region->getCapability("ChatSessionRequest") != "") - && session_initialized + BOOL enable_connect = session_initialized && voice_enabled && callback_enabled; childSetEnabled("call_btn", enable_connect); @@ -190,7 +188,8 @@ void LLPanelIMControlPanel::nameUpdatedCallback(const LLUUID& id, const std::str } } -LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id) +LLPanelGroupControlPanel::LLPanelGroupControlPanel(const LLUUID& session_id): +mParticipantList(NULL) { mSpeakerManager = LLIMModel::getInstance()->getSpeakerManager(session_id); } @@ -199,9 +198,6 @@ BOOL LLPanelGroupControlPanel::postBuild() { childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); - mAvatarList = getChild<LLAvatarList>("speakers_list"); - mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - return LLPanelChatControlPanel::postBuild(); } @@ -214,6 +210,8 @@ LLPanelGroupControlPanel::~LLPanelGroupControlPanel() // virtual void LLPanelGroupControlPanel::draw() { + //Remove event does not raised until speakerp->mActivityTimer.hasExpired() is false, see LLSpeakerManager::update() + //so we need update it to raise needed event mSpeakerManager->update(true); LLPanelChatControlPanel::draw(); } @@ -241,7 +239,7 @@ void LLPanelGroupControlPanel::onSortMenuItemClicked(const LLSD& userdata) void LLPanelGroupControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::EState& old_state, const LLVoiceChannel::EState& new_state) { LLPanelChatControlPanel::onVoiceChannelStateChanged(old_state, new_state); - mAvatarList->setSpeakingIndicatorsVisible(new_state >= LLVoiceChannel::STATE_CALL_STARTED); + mParticipantList->setSpeakingIndicatorsVisible(new_state >= LLVoiceChannel::STATE_CALL_STARTED); } void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) @@ -249,6 +247,9 @@ void LLPanelGroupControlPanel::setSessionId(const LLUUID& session_id) LLPanelChatControlPanel::setSessionId(session_id); mGroupID = LLIMModel::getInstance()->getOtherParticipantID(session_id); + + if(!mParticipantList) + mParticipantList = new LLParticipantList(mSpeakerManager, getChild<LLAvatarList>("speakers_list")); } @@ -258,9 +259,7 @@ LLPanelAdHocControlPanel::LLPanelAdHocControlPanel(const LLUUID& session_id):LLP BOOL LLPanelAdHocControlPanel::postBuild() { - mAvatarList = getChild<LLAvatarList>("speakers_list"); - mParticipantList = new LLParticipantList(mSpeakerManager, mAvatarList); - + //We don't need LLPanelGroupControlPanel::postBuild() to be executed as there is no group_info_btn at AdHoc chat return LLPanelChatControlPanel::postBuild(); } diff --git a/indra/newview/llpanelimcontrolpanel.h b/indra/newview/llpanelimcontrolpanel.h index ac5d86345e..a0d3420d23 100644 --- a/indra/newview/llpanelimcontrolpanel.h +++ b/indra/newview/llpanelimcontrolpanel.h @@ -100,7 +100,7 @@ public: protected: LLUUID mGroupID; LLSpeakerMgr* mSpeakerManager; - LLAvatarList* mAvatarList; + LLParticipantList* mParticipantList; private: diff --git a/indra/newview/llpanellandmarkinfo.cpp b/indra/newview/llpanellandmarkinfo.cpp index 4985663833..f94a59ecef 100644 --- a/indra/newview/llpanellandmarkinfo.cpp +++ b/indra/newview/llpanellandmarkinfo.cpp @@ -35,6 +35,7 @@ #include "llpanellandmarkinfo.h" #include "llcombobox.h" +#include "lliconctrl.h" #include "lllineeditor.h" #include "lltextbox.h" #include "lltexteditor.h" @@ -58,6 +59,11 @@ static void collectLandmarkFolders(LLInventoryModel::cat_array_t& cats); static LLRegisterPanelClassWrapper<LLPanelLandmarkInfo> t_landmark_info("panel_landmark_info"); +// Statics for textures filenames +static std::string icon_pg; +static std::string icon_m; +static std::string icon_r; + LLPanelLandmarkInfo::LLPanelLandmarkInfo() : LLPanelPlaceInfo() {} @@ -79,6 +85,10 @@ BOOL LLPanelLandmarkInfo::postBuild() mNotesEditor = getChild<LLTextEditor>("notes_editor"); mFolderCombo = getChild<LLComboBox>("folder_combo"); + icon_pg = getString("icon_PG"); + icon_m = getString("icon_M"); + icon_r = getString("icon_R"); + return TRUE; } @@ -101,9 +111,8 @@ void LLPanelLandmarkInfo::setInfoType(INFO_TYPE type) LLPanel* landmark_info_panel = getChild<LLPanel>("landmark_info_panel"); bool is_info_type_create_landmark = type == CREATE_LANDMARK; - bool is_info_type_landmark = type == LANDMARK; - landmark_info_panel->setVisible(is_info_type_landmark); + landmark_info_panel->setVisible(type == LANDMARK); getChild<LLTextBox>("folder_label")->setVisible(is_info_type_create_landmark); mFolderCombo->setVisible(is_info_type_create_landmark); @@ -136,6 +145,24 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data) { LLPanelPlaceInfo::processParcelInfo(parcel_data); + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + if (parcel_data.flags & 0x2) + { + mMaturityRatingIcon->setValue(icon_r); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_ADULT)); + } + else if (parcel_data.flags & 0x1) + { + mMaturityRatingIcon->setValue(icon_m); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_MATURE)); + } + else + { + mMaturityRatingIcon->setValue(icon_pg); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_PG)); + } + S32 region_x; S32 region_y; S32 region_z; diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp index a6083a5755..f6aded2d25 100644 --- a/indra/newview/llpanelpeople.cpp +++ b/indra/newview/llpanelpeople.cpp @@ -60,6 +60,7 @@ #include "llviewermenu.h" // for gMenuHolder #include "llvoiceclient.h" #include "llworld.h" +#include "llspeakers.h" #define FRIEND_LIST_UPDATE_TIMEOUT 0.5 #define NEARBY_LIST_UPDATE_INTERVAL 1 @@ -119,8 +120,84 @@ protected: } }; +/** Compares avatar items by distance between you and them */ +class LLAvatarItemDistanceComparator : public LLAvatarItemComparator +{ +public: + typedef std::map < LLUUID, LLVector3d > id_to_pos_map_t; + LLAvatarItemDistanceComparator() {}; + + void updateAvatarsPositions(std::vector<LLVector3d>& positions, std::vector<LLUUID>& uuids) + { + std::vector<LLVector3d>::const_iterator + pos_it = positions.begin(), + pos_end = positions.end(); + + std::vector<LLUUID>::const_iterator + id_it = uuids.begin(), + id_end = uuids.end(); + + LLAvatarItemDistanceComparator::id_to_pos_map_t pos_map; + + mAvatarsPositions.clear(); + + for (;pos_it != pos_end && id_it != id_end; ++pos_it, ++id_it ) + { + mAvatarsPositions[*id_it] = *pos_it; + } + }; + +protected: + virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + { + const LLVector3d& me_pos = gAgent.getPositionGlobal(); + const LLVector3d& item1_pos = mAvatarsPositions.find(item1->getAvatarId())->second; + const LLVector3d& item2_pos = mAvatarsPositions.find(item2->getAvatarId())->second; + F32 dist1 = dist_vec(item1_pos, me_pos); + F32 dist2 = dist_vec(item2_pos, me_pos); + return dist1 < dist2; + } +private: + id_to_pos_map_t mAvatarsPositions; +}; + +/** Comparator for comparing nearby avatar items by last spoken time */ +class LLAvatarItemRecentSpeakerComparator : public LLAvatarItemNameComparator +{ +public: + LLAvatarItemRecentSpeakerComparator() {}; + virtual ~LLAvatarItemRecentSpeakerComparator() {}; + +protected: + virtual bool doCompare(const LLAvatarListItem* item1, const LLAvatarListItem* item2) const + { + LLPointer<LLSpeaker> lhs = LLLocalSpeakerMgr::instance().findSpeaker(item1->getAvatarId()); + LLPointer<LLSpeaker> rhs = LLLocalSpeakerMgr::instance().findSpeaker(item2->getAvatarId()); + if ( lhs.notNull() && rhs.notNull() ) + { + // Compare by last speaking time + if( lhs->mLastSpokeTime != rhs->mLastSpokeTime ) + return ( lhs->mLastSpokeTime > rhs->mLastSpokeTime ); + } + else if ( lhs.notNull() ) + { + // True if only item1 speaker info available + return true; + } + else if ( rhs.notNull() ) + { + // False if only item2 speaker info available + return false; + } + // By default compare by name. + return LLAvatarItemNameComparator::doCompare(item1, item2); + } +}; + static const LLAvatarItemRecentComparator RECENT_COMPARATOR; static const LLAvatarItemStatusComparator STATUS_COMPARATOR; +static LLAvatarItemDistanceComparator DISTANCE_COMPARATOR; +static const LLAvatarItemRecentSpeakerComparator RECENT_SPEAKER_COMPARATOR; static LLRegisterPanelClassWrapper<LLPanelPeople> t_people("panel_people"); @@ -432,9 +509,12 @@ BOOL LLPanelPeople::postBuild() mNearbyList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); mRecentList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); + mAllFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); + mOnlineFriendList->setContextMenu(&LLPanelPeopleMenus::gNearbyMenu); setSortOrder(mRecentList, (ESortOrder)gSavedSettings.getU32("RecentPeopleSortOrder"), false); setSortOrder(mAllFriendList, (ESortOrder)gSavedSettings.getU32("FriendsSortOrder"), false); + setSortOrder(mNearbyList, (ESortOrder)gSavedSettings.getU32("NearbyPeopleSortOrder"), false); LLPanel* groups_panel = getChild<LLPanel>(GROUP_TAB_NAME); groups_panel->childSetAction("activate_btn", boost::bind(&LLPanelPeople::onActivateButtonClicked, this)); @@ -495,7 +575,8 @@ BOOL LLPanelPeople::postBuild() enable_registrar.add("People.Friends.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onFriendsViewSortMenuItemCheck, this, _2)); enable_registrar.add("People.Recent.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onRecentViewSortMenuItemCheck, this, _2)); - + enable_registrar.add("People.Nearby.ViewSort.CheckItem", boost::bind(&LLPanelPeople::onNearbyViewSortMenuItemCheck, this, _2)); + LLMenuGL* plus_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_group_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); mGroupPlusMenuHandle = plus_menu->getHandle(); @@ -574,8 +655,13 @@ void LLPanelPeople::updateNearbyList() if (!mNearbyList) return; - LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), NULL, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); + std::vector<LLVector3d> positions; + + LLWorld::getInstance()->getAvatars(&mNearbyList->getIDs(), &positions, gAgent.getPositionGlobal(), gSavedSettings.getF32("NearMeRange")); mNearbyList->setDirty(); + + DISTANCE_COMPARATOR.updateAvatarsPositions(positions, mNearbyList->getIDs()); + LLLocalSpeakerMgr::instance().update(TRUE); } void LLPanelPeople::updateRecentList() @@ -608,6 +694,12 @@ void LLPanelPeople::buttonSetAction(const std::string& btn_name, const commit_si button->setClickedCallback(cb); } +bool LLPanelPeople::isFriendOnline(const LLUUID& id) +{ + LLAvatarList::uuid_vector_t ids = mOnlineFriendList->getIDs(); + return std::find(ids.begin(), ids.end(), id) != ids.end(); +} + void LLPanelPeople::updateButtons() { std::string cur_tab = getActiveTabName(); @@ -660,7 +752,7 @@ void LLPanelPeople::updateButtons() childSetEnabled("add_friend_btn", !is_friend); } - buttonSetEnabled("teleport_btn", friends_tab_active && item_selected); + buttonSetEnabled("teleport_btn", friends_tab_active && item_selected && isFriendOnline(selected_uuids.front())); buttonSetEnabled("view_profile_btn", item_selected); buttonSetEnabled("im_btn", multiple_selected); // allow starting the friends conference for multiple selection buttonSetEnabled("call_btn", item_selected); @@ -758,6 +850,14 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save list->setComparator(&RECENT_COMPARATOR); list->sort(); break; + case E_SORT_BY_RECENT_SPEAKERS: + list->setComparator(&RECENT_SPEAKER_COMPARATOR); + list->sort(); + break; + case E_SORT_BY_DISTANCE: + list->setComparator(&DISTANCE_COMPARATOR); + list->sort(); + break; default: llwarns << "Unrecognized people sort order for " << list->getName() << llendl; return; @@ -772,7 +872,7 @@ void LLPanelPeople::setSortOrder(LLAvatarList* list, ESortOrder order, bool save else if (list == mRecentList) setting = "RecentPeopleSortOrder"; else if (list == mNearbyList) - setting = "NearbyPeopleSortOrder"; // *TODO: unused by current implementation + setting = "NearbyPeopleSortOrder"; if (!setting.empty()) gSavedSettings.setU32(setting, order); @@ -1008,12 +1108,13 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) { std::string chosen_item = userdata.asString(); - if (chosen_item == "sort_recent") + if (chosen_item == "sort_by_recent_speakers") { + setSortOrder(mNearbyList, E_SORT_BY_RECENT_SPEAKERS); } else if (chosen_item == "sort_name") { - mNearbyList->sortByName(); + setSortOrder(mNearbyList, E_SORT_BY_NAME); } else if (chosen_item == "view_icons") { @@ -1021,8 +1122,25 @@ void LLPanelPeople::onNearbyViewSortMenuItemClicked(const LLSD& userdata) } else if (chosen_item == "sort_distance") { + setSortOrder(mNearbyList, E_SORT_BY_DISTANCE); } } + +bool LLPanelPeople::onNearbyViewSortMenuItemCheck(const LLSD& userdata) +{ + std::string item = userdata.asString(); + U32 sort_order = gSavedSettings.getU32("NearbyPeopleSortOrder"); + + if (item == "sort_by_recent_speakers") + return sort_order == E_SORT_BY_RECENT_SPEAKERS; + if (item == "sort_name") + return sort_order == E_SORT_BY_NAME; + if (item == "sort_distance") + return sort_order == E_SORT_BY_DISTANCE; + + return false; +} + void LLPanelPeople::onRecentViewSortMenuItemClicked(const LLSD& userdata) { std::string chosen_item = userdata.asString(); diff --git a/indra/newview/llpanelpeople.h b/indra/newview/llpanelpeople.h index 9bf9befe90..a369bcd3e2 100644 --- a/indra/newview/llpanelpeople.h +++ b/indra/newview/llpanelpeople.h @@ -62,6 +62,8 @@ private: E_SORT_BY_NAME = 0, E_SORT_BY_STATUS = 1, E_SORT_BY_MOST_RECENT = 2, + E_SORT_BY_DISTANCE = 3, + E_SORT_BY_RECENT_SPEAKERS = 4, } ESortOrder; // methods indirectly called by the updaters @@ -69,6 +71,8 @@ private: void updateNearbyList(); void updateRecentList(); + bool isFriendOnline(const LLUUID& id); + void updateButtons(); std::string getActiveTabName() const; LLUUID getCurrentItemID() const; @@ -115,6 +119,7 @@ private: bool onFriendsViewSortMenuItemCheck(const LLSD& userdata); bool onRecentViewSortMenuItemCheck(const LLSD& userdata); + bool onNearbyViewSortMenuItemCheck(const LLSD& userdata); // misc callbacks static void onAvatarPicked( diff --git a/indra/newview/llpanelpick.cpp b/indra/newview/llpanelpick.cpp index f5c4f89702..da0c8d5020 100644 --- a/indra/newview/llpanelpick.cpp +++ b/indra/newview/llpanelpick.cpp @@ -440,7 +440,8 @@ void LLPanelPickEdit::resetDirty() BOOL LLPanelPickEdit::isDirty() const { - if( LLPanelPickInfo::isDirty() + if( mNewPick + || LLPanelPickInfo::isDirty() || mLocationChanged || mSnapshotCtrl->isDirty() || getChild<LLLineEditor>("pick_name")->isDirty() diff --git a/indra/newview/llpanelpicks.cpp b/indra/newview/llpanelpicks.cpp index 2bf04f9681..c30658755a 100644 --- a/indra/newview/llpanelpicks.cpp +++ b/indra/newview/llpanelpicks.cpp @@ -45,11 +45,14 @@ #include "llviewermenu.h" #include "llregistry.h" +#include "llaccordionctrl.h" +#include "llaccordionctrltab.h" #include "llpanelpicks.h" #include "llavatarpropertiesprocessor.h" #include "llpanelavatar.h" #include "llpanelprofile.h" #include "llpanelpick.h" +#include "llpanelclassified.h" static const std::string XML_BTN_NEW = "new_btn"; static const std::string XML_BTN_DELETE = "trash_btn"; @@ -62,9 +65,40 @@ static const std::string PICK_ID("pick_id"); static const std::string PICK_CREATOR_ID("pick_creator_id"); static const std::string PICK_NAME("pick_name"); +static const std::string CLASSIFIED_ID("classified_id"); +static const std::string CLASSIFIED_NAME("classified_name"); + static LLRegisterPanelClassWrapper<LLPanelPicks> t_panel_picks("panel_picks"); +////////////////////////////////////////////////////////////////////////// + +/** + * Copy&Pasted from old LLPanelClassified. This class does nothing at the moment. + * Subscribing to "classifiedclickthrough" removes a few warnings. + */ +class LLClassifiedClickThrough : public LLDispatchHandler +{ +public: + + // "classifiedclickthrough" + // strings[0] = classified_id + // strings[1] = teleport_clicks + // strings[2] = map_clicks + // strings[3] = profile_clicks + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + if (strings.size() != 4) + return false; + + return true; + } +}; + //----------------------------------------------------------------------------- // LLPanelPicks //----------------------------------------------------------------------------- @@ -74,10 +108,19 @@ LLPanelPicks::LLPanelPicks() mProfilePanel(NULL), mPickPanel(NULL), mPicksList(NULL), + mClassifiedsList(NULL), mPanelPickInfo(NULL), mPanelPickEdit(NULL), - mOverflowMenu(NULL) + mOverflowMenu(NULL), + mPlusMenu(NULL), + mPicksAccTab(NULL), + mClassifiedsAccTab(NULL), + mPanelClassifiedInfo(NULL), + mPanelClassifiedEdit(NULL), + mClickThroughDisp(NULL) { + mClickThroughDisp = new LLClassifiedClickThrough(); + gGenericDispatcher.addHandler("classifiedclickthrough", mClickThroughDisp); } LLPanelPicks::~LLPanelPicks() @@ -86,6 +129,8 @@ LLPanelPicks::~LLPanelPicks() { LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); } + + delete mClickThroughDisp; } void* LLPanelPicks::create(void* data /* = NULL */) @@ -100,6 +145,9 @@ void LLPanelPicks::updateData() { mPicksList->clear(); LLAvatarPropertiesProcessor::getInstance()->sendAvatarPicksRequest(getAvatarId()); + + mClassifiedsList->clear(); + LLAvatarPropertiesProcessor::getInstance()->sendAvatarClassifiedsRequest(getAvatarId()); } } @@ -138,13 +186,47 @@ void LLPanelPicks::processProperties(void* data, EAvatarProcessorType type) mPicksList->addItem(picture, pick_value); - picture->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickItem, this, _1)); + picture->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickPickItem, this, _1)); picture->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); picture->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); } + showAccordion("tab_picks", mPicksList->size()); + + resetDirty(); + updateButtons(); + } + } + else if(APT_CLASSIFIEDS == type) + { + LLAvatarClassifieds* c_info = static_cast<LLAvatarClassifieds*>(data); + if(c_info && getAvatarId() == c_info->target_id) + { + mClassifiedsList->clear(); + + LLAvatarClassifieds::classifieds_list_t::const_iterator it = c_info->classifieds_list.begin(); + for(; c_info->classifieds_list.end() != it; ++it) + { + LLAvatarClassifieds::classified_data c_data = *it; + + LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), c_data.classified_id); + c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); + c_item->setClassifiedName(c_data.name); + + LLSD pick_value = LLSD(); + pick_value.insert(CLASSIFIED_ID, c_data.classified_id); + pick_value.insert(CLASSIFIED_NAME, c_data.name); + + mClassifiedsList->addItem(c_item, pick_value); + + c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); + c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); + c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); + } + + showAccordion("tab_classifieds", mClassifiedsList->size()); + resetDirty(); - LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(),this); updateButtons(); } } @@ -158,16 +240,44 @@ LLPickItem* LLPanelPicks::getSelectedPickItem() return dynamic_cast<LLPickItem*>(selected_item); } +LLClassifiedItem* LLPanelPicks::getSelectedClassifiedItem() +{ + LLPanel* selected_item = mClassifiedsList->getSelectedItem(); + if (!selected_item) + { + return NULL; + } + return dynamic_cast<LLClassifiedItem*>(selected_item); +} + BOOL LLPanelPicks::postBuild() { mPicksList = getChild<LLFlatListView>("picks_list"); + mClassifiedsList = getChild<LLFlatListView>("classifieds_list"); + + mPicksList->setCommitOnSelectionChange(true); + mClassifiedsList->setCommitOnSelectionChange(true); + + mPicksList->setCommitCallback(boost::bind(&LLPanelPicks::onListCommit, this, mPicksList)); + mClassifiedsList->setCommitCallback(boost::bind(&LLPanelPicks::onListCommit, this, mClassifiedsList)); + + mPicksList->setNoItemsCommentText(getString("no_picks")); + mClassifiedsList->setNoItemsCommentText(getString("no_classifieds")); - childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickNew, this)); + childSetAction(XML_BTN_NEW, boost::bind(&LLPanelPicks::onClickPlusBtn, this)); childSetAction(XML_BTN_DELETE, boost::bind(&LLPanelPicks::onClickDelete, this)); childSetAction(XML_BTN_TELEPORT, boost::bind(&LLPanelPicks::onClickTeleport, this)); childSetAction(XML_BTN_SHOW_ON_MAP, boost::bind(&LLPanelPicks::onClickMap, this)); childSetAction(XML_BTN_INFO, boost::bind(&LLPanelPicks::onClickInfo, this)); childSetAction(XML_BTN_OVERFLOW, boost::bind(&LLPanelPicks::onOverflowButtonClicked, this)); + + mPicksAccTab = getChild<LLAccordionCtrlTab>("tab_picks"); + mPicksAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mPicksAccTab)); + mPicksAccTab->setDisplayChildren(true); + + mClassifiedsAccTab = getChild<LLAccordionCtrlTab>("tab_classifieds"); + mClassifiedsAccTab->setDropDownStateChangedCallback(boost::bind(&LLPanelPicks::onAccordionStateChanged, this, mClassifiedsAccTab)); + mClassifiedsAccTab->setDisplayChildren(false); LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registar; registar.add("Pick.Info", boost::bind(&LLPanelPicks::onClickInfo, this)); @@ -180,6 +290,10 @@ BOOL LLPanelPicks::postBuild() LLUICtrl::CommitCallbackRegistry::ScopedRegistrar overflow_registar; overflow_registar.add("PicksList.Overflow", boost::bind(&LLPanelPicks::onOverflowMenuItemClicked, this, _2)); mOverflowMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); + + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar plus_registar; + plus_registar.add("Picks.Plus.Action", boost::bind(&LLPanelPicks::onPlusMenuItemClicked, this, _2)); + mPlusMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_picks_plus.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); return TRUE; } @@ -202,6 +316,34 @@ void LLPanelPicks::onOverflowMenuItemClicked(const LLSD& param) } } +void LLPanelPicks::onPlusMenuItemClicked(const LLSD& param) +{ + std::string value = param.asString(); + + if("new_pick" == value) + { + createNewPick(); + } + else if("new_classified" == value) + { + createNewClassified(); + } +} + +void LLPanelPicks::onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab) +{ + if(!mPicksAccTab->getDisplayChildren()) + { + mPicksList->resetSelection(true); + } + if(!mClassifiedsAccTab->getDisplayChildren()) + { + mClassifiedsList->resetSelection(true); + } + + updateButtons(); +} + void LLPanelPicks::onOverflowButtonClicked() { LLRect rect; @@ -242,6 +384,9 @@ void LLPanelPicks::onOpen(const LLSD& key) if(getAvatarId() != id) { + showAccordion("tab_picks", false); + showAccordion("tab_classifieds", false); + mPicksList->goToTop(); // Set dummy value to make panel dirty and make it reload picks setValue(LLSD()); @@ -250,21 +395,50 @@ void LLPanelPicks::onOpen(const LLSD& key) LLPanelProfileTab::onOpen(key); } +void LLPanelPicks::onListCommit(const LLFlatListView* f_list) +{ + // Make sure only one of the lists has selection. + if(f_list == mPicksList) + { + mClassifiedsList->resetSelection(true); + } + else if(f_list == mClassifiedsList) + { + mPicksList->resetSelection(true); + } + else + { + llwarns << "Unknown list" << llendl; + } + + updateButtons(); +} + //static void LLPanelPicks::onClickDelete() { - LLSD pick_value = mPicksList->getSelectedValue(); - if (pick_value.isUndefined()) return; + LLSD value = mPicksList->getSelectedValue(); + if (value.isDefined()) + { + LLSD args; + args["PICK"] = value[PICK_NAME]; + LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeletePick, this, _1, _2)); + return; + } - LLSD args; - args["PICK"] = pick_value[PICK_NAME]; - LLNotifications::instance().add("DeleteAvatarPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackDelete, this, _1, _2)); + value = mClassifiedsList->getSelectedValue(); + if(value.isDefined()) + { + LLSD args; + args["NAME"] = value[CLASSIFIED_NAME]; + LLNotifications::instance().add("DeleteClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackDeleteClassified, this, _1, _2)); + return; + } } -bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response) +bool LLPanelPicks::callbackDeletePick(const LLSD& notification, const LLSD& response) { S32 option = LLNotification::getSelectedOption(notification, response); - LLSD pick_value = mPicksList->getSelectedValue(); if (0 == option) @@ -276,6 +450,20 @@ bool LLPanelPicks::callbackDelete(const LLSD& notification, const LLSD& response return false; } +bool LLPanelPicks::callbackDeleteClassified(const LLSD& notification, const LLSD& response) +{ + S32 option = LLNotification::getSelectedOption(notification, response); + LLSD value = mClassifiedsList->getSelectedValue(); + + if (0 == option) + { + LLAvatarPropertiesProcessor::instance().sendClassifiedDelete(value[CLASSIFIED_ID]); + mClassifiedsList->removeItemByValue(value); + } + updateButtons(); + return false; +} + bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& response ) { S32 option = LLNotification::getSelectedOption(notification, response); @@ -291,9 +479,14 @@ bool LLPanelPicks::callbackTeleport( const LLSD& notification, const LLSD& respo void LLPanelPicks::onClickTeleport() { LLPickItem* pick_item = getSelectedPickItem(); - if (!pick_item) return; + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + LLVector3d pos; + if(pick_item) + pos = pick_item->getPosGlobal(); + else if(c_item) + pos = c_item->getPosGlobal(); - LLVector3d pos = pick_item->getPosGlobal(); if (!pos.isExactlyZero()) { gAgent.teleportViaLocation(pos); @@ -305,9 +498,15 @@ void LLPanelPicks::onClickTeleport() void LLPanelPicks::onClickMap() { LLPickItem* pick_item = getSelectedPickItem(); - if (!pick_item) return; + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + LLVector3d pos; + if (pick_item) + pos = pick_item->getPosGlobal(); + else if(c_item) + pos = c_item->getPosGlobal(); - LLFloaterWorldMap::getInstance()->trackLocation(pick_item->getPosGlobal()); + LLFloaterWorldMap::getInstance()->trackLocation(pos); LLFloaterReg::showInstance("world_map", "center"); } @@ -325,7 +524,7 @@ void LLPanelPicks::onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask) } } -void LLPanelPicks::onDoubleClickItem(LLUICtrl* item) +void LLPanelPicks::onDoubleClickPickItem(LLUICtrl* item) { LLSD pick_value = mPicksList->getSelectedValue(); if (pick_value.isUndefined()) return; @@ -335,9 +534,19 @@ void LLPanelPicks::onDoubleClickItem(LLUICtrl* item) LLNotifications::instance().add("TeleportToPick", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); } +void LLPanelPicks::onDoubleClickClassifiedItem(LLUICtrl* item) +{ + LLSD value = mClassifiedsList->getSelectedValue(); + if (value.isUndefined()) return; + + LLSD args; + args["CLASSIFIED"] = value[CLASSIFIED_NAME]; + LLNotifications::instance().add("TeleportToClassified", args, LLSD(), boost::bind(&LLPanelPicks::callbackTeleport, this, _1, _2)); +} + void LLPanelPicks::updateButtons() { - bool has_selected = mPicksList->numSelected(); + bool has_selected = mPicksList->numSelected() > 0 || mClassifiedsList->numSelected() > 0; if (getAvatarId() == gAgentID) { @@ -366,15 +575,44 @@ void LLPanelPicks::buildPickPanel() // } } -void LLPanelPicks::onClickNew() +void LLPanelPicks::onClickPlusBtn() +{ + LLRect rect; + childGetRect(XML_BTN_NEW, rect); + + mPlusMenu->updateParent(LLMenuGL::sMenuContainer); + mPlusMenu->setButtonRect(rect, this); + LLMenuGL::showPopup(this, mPlusMenu, rect.mLeft, rect.mTop); +} + +void LLPanelPicks::createNewPick() { createPickEditPanel(); getProfilePanel()->openPanel(mPanelPickEdit, LLSD()); } +void LLPanelPicks::createNewClassified() +{ + createClassifiedEditPanel(); + + getProfilePanel()->openPanel(mPanelClassifiedEdit, LLSD()); +} + void LLPanelPicks::onClickInfo() { + if(mPicksList->numSelected() > 0) + { + openPickInfo(); + } + else if(mClassifiedsList->numSelected() > 0) + { + openClassifiedInfo(); + } +} + +void LLPanelPicks::openPickInfo() +{ LLSD selected_value = mPicksList->getSelectedValue(); if (selected_value.isUndefined()) return; @@ -392,6 +630,33 @@ void LLPanelPicks::onClickInfo() getProfilePanel()->openPanel(mPanelPickInfo, params); } +void LLPanelPicks::openClassifiedInfo() +{ + LLSD selected_value = mClassifiedsList->getSelectedValue(); + if (selected_value.isUndefined()) return; + + LLClassifiedItem* c_item = getSelectedClassifiedItem(); + + createClassifiedInfoPanel(); + + LLSD params; + params["classified_id"] = c_item->getClassifiedId(); + params["avatar_id"] = c_item->getAvatarId(); + params["snapshot_id"] = c_item->getSnapshotId(); + params["name"] = c_item->getClassifiedName(); + params["desc"] = c_item->getDescription(); + + getProfilePanel()->openPanel(mPanelClassifiedInfo, params); +} + +void LLPanelPicks::showAccordion(const std::string& name, bool show) +{ + LLAccordionCtrlTab* tab = getChild<LLAccordionCtrlTab>(name); + tab->setVisible(show); + LLAccordionCtrl* acc = getChild<LLAccordionCtrl>("accordion"); + acc->arrange(); +} + void LLPanelPicks::onPanelPickClose(LLPanel* panel) { panel->setVisible(FALSE); @@ -403,6 +668,61 @@ void LLPanelPicks::onPanelPickSave(LLPanel* panel) updateButtons(); } +void LLPanelPicks::onPanelClassifiedSave(LLPanelClassifiedEdit* panel) +{ + if(panel->isNew()) + { + LLClassifiedItem* c_item = new LLClassifiedItem(getAvatarId(), panel->getClassifiedId()); + + c_item->setClassifiedName(panel->getClassifiedName()); + c_item->setDescription(panel->getDescription()); + c_item->setSnapshotId(panel->getSnapshotId()); + + LLSD c_value; + c_value.insert(CLASSIFIED_ID, c_item->getClassifiedId()); + c_value.insert(CLASSIFIED_NAME, c_item->getClassifiedName()); + mClassifiedsList->addItem(c_item, c_value, ADD_TOP); + + c_item->setDoubleClickCallback(boost::bind(&LLPanelPicks::onDoubleClickClassifiedItem, this, _1)); + c_item->setRightMouseUpCallback(boost::bind(&LLPanelPicks::onRightMouseUpItem, this, _1, _2, _3, _4)); + c_item->setMouseUpCallback(boost::bind(&LLPanelPicks::updateButtons, this)); + c_item->childSetAction("info_chevron", boost::bind(&LLPanelPicks::onClickInfo, this)); + } + else + { + onPanelClassifiedClose(panel); + return; + } + + onPanelPickClose(panel); + updateButtons(); +} + +void LLPanelPicks::onPanelClassifiedClose(LLPanelClassifiedInfo* panel) +{ + if(panel->getInfoLoaded() && !panel->isDirty()) + { + std::vector<LLSD> values; + mClassifiedsList->getValues(values); + for(size_t n = 0; n < values.size(); ++n) + { + LLUUID c_id = values[n][CLASSIFIED_ID].asUUID(); + if(panel->getClassifiedId() == c_id) + { + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>( + mClassifiedsList->getItemByValue(values[n])); + + c_item->setClassifiedName(panel->getClassifiedName()); + c_item->setDescription(panel->getDescription()); + c_item->setSnapshotId(panel->getSnapshotId()); + } + } + } + + onPanelPickClose(panel); + updateButtons(); +} + void LLPanelPicks::createPickInfoPanel() { if(!mPanelPickInfo) @@ -414,6 +734,28 @@ void LLPanelPicks::createPickInfoPanel() } } +void LLPanelPicks::createClassifiedInfoPanel() +{ + if(!mPanelClassifiedInfo) + { + mPanelClassifiedInfo = LLPanelClassifiedInfo::create(); + mPanelClassifiedInfo->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedInfo)); + mPanelClassifiedInfo->setVisible(FALSE); + } +} + +void LLPanelPicks::createClassifiedEditPanel() +{ + if(!mPanelClassifiedEdit) + { + mPanelClassifiedEdit = LLPanelClassifiedEdit::create(); + mPanelClassifiedEdit->setExitCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setSaveCallback(boost::bind(&LLPanelPicks::onPanelClassifiedSave, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setCancelCallback(boost::bind(&LLPanelPicks::onPanelClassifiedClose, this, mPanelClassifiedEdit)); + mPanelClassifiedEdit->setVisible(FALSE); + } +} + void LLPanelPicks::createPickEditPanel() { if(!mPanelPickEdit) @@ -473,9 +815,38 @@ void LLPanelPicks::onPanelPickEdit() getProfilePanel()->openPanel(mPanelPickEdit, params); } +void LLPanelPicks::onPanelClassifiedEdit() +{ + LLSD selected_value = mClassifiedsList->getSelectedValue(); + if (selected_value.isUndefined()) + { + return; + } + + LLClassifiedItem* c_item = dynamic_cast<LLClassifiedItem*>(mClassifiedsList->getSelectedItem()); + + createClassifiedEditPanel(); + + LLSD params; + params["classified_id"] = c_item->getClassifiedId(); + params["avatar_id"] = c_item->getAvatarId(); + params["snapshot_id"] = c_item->getSnapshotId(); + params["name"] = c_item->getClassifiedName(); + params["desc"] = c_item->getDescription(); + + getProfilePanel()->openPanel(mPanelClassifiedEdit, params); +} + void LLPanelPicks::onClickMenuEdit() { - onPanelPickEdit(); + if(getSelectedPickItem()) + { + onPanelPickEdit(); + } + else if(getSelectedClassifiedItem()) + { + onPanelClassifiedEdit(); + } } inline LLPanelProfile* LLPanelPicks::getProfilePanel() @@ -610,3 +981,80 @@ void LLPickItem::setValue(const LLSD& value) if (!value.has("selected")) return; childSetVisible("selected_icon", value["selected"]); } + +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// +////////////////////////////////////////////////////////////////////////// + +LLClassifiedItem::LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id) + : LLPanel() + , mAvatarId(avatar_id) + , mClassifiedId(classified_id) +{ + LLUICtrlFactory::getInstance()->buildPanel(this,"panel_classifieds_list_item.xml"); + + LLAvatarPropertiesProcessor::getInstance()->addObserver(getAvatarId(), this); + LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); +} + +LLClassifiedItem::~LLClassifiedItem() +{ + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +void LLClassifiedItem::processProperties(void* data, EAvatarProcessorType type) +{ + if(APT_CLASSIFIED_INFO != type) + { + return; + } + + LLAvatarClassifiedInfo* c_info = static_cast<LLAvatarClassifiedInfo*>(data); + if( !c_info || c_info->classified_id != getClassifiedId() ) + { + return; + } + + setClassifiedName(c_info->name); + setDescription(c_info->description); + setSnapshotId(c_info->snapshot_id); + setPosGlobal(c_info->pos_global); + + LLAvatarPropertiesProcessor::getInstance()->removeObserver(getAvatarId(), this); +} + +BOOL LLClassifiedItem::postBuild() +{ + setMouseEnterCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", true)); + setMouseLeaveCallback(boost::bind(&LLPanelPickInfo::childSetVisible, this, "hovered_icon", false)); + return TRUE; +} + +void LLClassifiedItem::setValue(const LLSD& value) +{ + if (!value.isMap()) return;; + if (!value.has("selected")) return; + childSetVisible("selected_icon", value["selected"]); +} + +void LLClassifiedItem::setClassifiedName(const std::string& name) +{ + childSetValue("name", name); +} + +void LLClassifiedItem::setDescription(const std::string& desc) +{ + childSetValue("description", desc); +} + +void LLClassifiedItem::setSnapshotId(const LLUUID& snapshot_id) +{ + childSetValue("picture", snapshot_id); +} + +LLUUID LLClassifiedItem::getSnapshotId() +{ + return childGetValue("picture"); +} + +//EOF diff --git a/indra/newview/llpanelpicks.h b/indra/newview/llpanelpicks.h index 5a2754ad10..4b90ea5048 100644 --- a/indra/newview/llpanelpicks.h +++ b/indra/newview/llpanelpicks.h @@ -40,6 +40,7 @@ #include "llpanelavatar.h" #include "llregistry.h" +class LLAccordionCtrlTab; class LLPanelProfile; class LLMessageSystem; class LLVector3d; @@ -47,10 +48,18 @@ class LLPanelProfileTab; class LLAgent; class LLMenuGL; class LLPickItem; +class LLClassifiedItem; class LLFlatListView; class LLPanelPickInfo; class LLPanelPickEdit; class LLToggleableMenu; +class LLPanelClassifiedInfo; +class LLPanelClassifiedEdit; +class LLClassifiedClickThrough; + +// *TODO +// Panel Picks has been consolidated with Classifieds (EXT-2095), give LLPanelPicks +// and corresponding files (cpp, h, xml) a new name. (new name is TBD at the moment) class LLPanelPicks : public LLPanelProfileTab @@ -71,6 +80,7 @@ public: // returns the selected pick item LLPickItem* getSelectedPickItem(); + LLClassifiedItem* getSelectedClassifiedItem(); //*NOTE top down approch when panel toggling is done only by // parent panels failed to work (picks related code was in me profile panel) @@ -83,41 +93,67 @@ private: void onOverflowMenuItemClicked(const LLSD& param); void onOverflowButtonClicked(); + void onPlusMenuItemClicked(const LLSD& param); + + void onListCommit(const LLFlatListView* f_list); + void onAccordionStateChanged(const LLAccordionCtrlTab* acc_tab); //------------------------------------------------ // Callbacks which require panel toggling //------------------------------------------------ - void onClickNew(); + void onClickPlusBtn(); void onClickInfo(); void onPanelPickClose(LLPanel* panel); void onPanelPickSave(LLPanel* panel); + void onPanelClassifiedSave(LLPanelClassifiedEdit* panel); + void onPanelClassifiedClose(LLPanelClassifiedInfo* panel); void onPanelPickEdit(); + void onPanelClassifiedEdit(); void onClickMenuEdit(); + void createNewPick(); + void createNewClassified(); + + void openPickInfo(); + void openClassifiedInfo(); + + void showAccordion(const std::string& name, bool show); + void buildPickPanel(); - bool callbackDelete(const LLSD& notification, const LLSD& response); + bool callbackDeletePick(const LLSD& notification, const LLSD& response); + bool callbackDeleteClassified(const LLSD& notification, const LLSD& response); bool callbackTeleport(const LLSD& notification, const LLSD& response); void updateButtons(); - virtual void onDoubleClickItem(LLUICtrl* item); + virtual void onDoubleClickPickItem(LLUICtrl* item); + virtual void onDoubleClickClassifiedItem(LLUICtrl* item); virtual void onRightMouseUpItem(LLUICtrl* item, S32 x, S32 y, MASK mask); LLPanelProfile* getProfilePanel(); void createPickInfoPanel(); void createPickEditPanel(); -// void openPickEditPanel(LLPickItem* pick); -// void openPickInfoPanel(LLPickItem* pick); + void createClassifiedInfoPanel(); + void createClassifiedEditPanel(); LLMenuGL* mPopupMenu; LLPanelProfile* mProfilePanel; LLPanelPickInfo* mPickPanel; LLFlatListView* mPicksList; + LLFlatListView* mClassifiedsList; LLPanelPickInfo* mPanelPickInfo; + LLPanelClassifiedInfo* mPanelClassifiedInfo; + LLPanelClassifiedEdit* mPanelClassifiedEdit; LLPanelPickEdit* mPanelPickEdit; LLToggleableMenu* mOverflowMenu; + LLToggleableMenu* mPlusMenu; + + LLAccordionCtrlTab* mPicksAccTab; + LLAccordionCtrlTab* mClassifiedsAccTab; + + LLClassifiedClickThrough* mClickThroughDisp; }; class LLPickItem : public LLPanel, public LLAvatarPropertiesObserver @@ -189,4 +225,48 @@ protected: std::string mSimName; }; +class LLClassifiedItem : public LLPanel, public LLAvatarPropertiesObserver +{ +public: + + LLClassifiedItem(const LLUUID& avatar_id, const LLUUID& classified_id); + + virtual ~LLClassifiedItem(); + + /*virtual*/ void processProperties(void* data, EAvatarProcessorType type); + + /*virtual*/ BOOL postBuild(); + + /*virtual*/ void setValue(const LLSD& value); + + LLUUID getAvatarId() {return mAvatarId;} + + void setAvatarId(const LLUUID& avatar_id) {mAvatarId = avatar_id;} + + LLUUID getClassifiedId() {return mClassifiedId;} + + void setClassifiedId(const LLUUID& classified_id) {mClassifiedId = classified_id;} + + void setPosGlobal(const LLVector3d& pos) { mPosGlobal = pos; } + + const LLVector3d& getPosGlobal() { return mPosGlobal; } + + void setClassifiedName (const std::string& name); + + std::string getClassifiedName() { return childGetValue("name").asString(); } + + void setDescription(const std::string& desc); + + std::string getDescription() { return childGetValue("description").asString(); } + + void setSnapshotId(const LLUUID& snapshot_id); + + LLUUID getSnapshotId(); + +private: + LLUUID mAvatarId; + LLUUID mClassifiedId; + LLVector3d mPosGlobal; +}; + #endif // LL_LLPANELPICKS_H diff --git a/indra/newview/llpanelplaceinfo.cpp b/indra/newview/llpanelplaceinfo.cpp index c600651015..963d39de8a 100644 --- a/indra/newview/llpanelplaceinfo.cpp +++ b/indra/newview/llpanelplaceinfo.cpp @@ -40,7 +40,7 @@ #include "llsdutil_math.h" -#include "llscrollcontainer.h" +#include "lliconctrl.h" #include "lltextbox.h" #include "llagent.h" @@ -57,8 +57,7 @@ LLPanelPlaceInfo::LLPanelPlaceInfo() : LLPanel(), mParcelID(), mRequestedID(), - mPosRegion(), - mMinHeight(0) + mPosRegion() {} //virtual @@ -81,12 +80,9 @@ BOOL LLPanelPlaceInfo::postBuild() mParcelName = getChild<LLTextBox>("parcel_title"); mDescEditor = getChild<LLExpandableTextBox>("description"); + mMaturityRatingIcon = getChild<LLIconCtrl>("maturity_icon"); mMaturityRatingText = getChild<LLTextBox>("maturity_value"); - LLScrollContainer* scroll_container = getChild<LLScrollContainer>("place_scroll"); - scroll_container->setBorderVisible(FALSE); - mMinHeight = scroll_container->getScrolledViewRect().getHeight(); - return TRUE; } @@ -98,6 +94,7 @@ void LLPanelPlaceInfo::resetLocation() mPosRegion.clearVec(); std::string not_available = getString("not_available"); + mMaturityRatingIcon->setValue(not_available); mMaturityRatingText->setValue(not_available); mRegionName->setText(not_available); mParcelName->setText(not_available); @@ -204,20 +201,6 @@ void LLPanelPlaceInfo::processParcelInfo(const LLParcelData& parcel_data) mDescEditor->setText(parcel_data.desc); } - // HACK: Flag 0x2 == adult region, - // Flag 0x1 == mature region, otherwise assume PG - std::string rating = LLViewerRegion::accessToString(SIM_ACCESS_PG); - if (parcel_data.flags & 0x2) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_ADULT); - } - else if (parcel_data.flags & 0x1) - { - rating = LLViewerRegion::accessToString(SIM_ACCESS_MATURE); - } - - mMaturityRatingText->setValue(rating); - S32 region_x; S32 region_y; S32 region_z; diff --git a/indra/newview/llpanelplaceinfo.h b/indra/newview/llpanelplaceinfo.h index ec30397cff..133933a880 100644 --- a/indra/newview/llpanelplaceinfo.h +++ b/indra/newview/llpanelplaceinfo.h @@ -41,6 +41,7 @@ #include "llremoteparcelrequest.h" class LLExpandableTextBox; +class LLIconCtrl; class LLInventoryItem; class LLPanelPickEdit; class LLParcel; @@ -109,7 +110,6 @@ protected: LLUUID mRequestedID; LLVector3 mPosRegion; std::string mCurrentTitle; - S32 mMinHeight; INFO_TYPE mInfoType; LLTextBox* mTitle; @@ -117,6 +117,7 @@ protected: LLTextBox* mRegionName; LLTextBox* mParcelName; LLExpandableTextBox* mDescEditor; + LLIconCtrl* mMaturityRatingIcon; LLTextBox* mMaturityRatingText; }; diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 2a9ba4697d..61501cc1b1 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -97,7 +97,6 @@ BOOL LLPanelPlaceProfile::postBuild() setMouseDownCallback(boost::bind(&LLPanelPlaceProfile::onForSaleBannerClick, this)); mParcelOwner = getChild<LLTextBox>("owner_value"); - mLastVisited = getChild<LLTextBox>("last_visited_value"); mParcelRatingIcon = getChild<LLIconCtrl>("rating_icon"); mParcelRatingText = getChild<LLTextBox>("rating_value"); @@ -165,7 +164,6 @@ void LLPanelPlaceProfile::resetLocation() std::string not_available = getString("not_available"); mParcelOwner->setValue(not_available); - mLastVisited->setValue(not_available); mParcelRatingIcon->setValue(not_available); mParcelRatingText->setText(not_available); @@ -209,17 +207,13 @@ void LLPanelPlaceProfile::resetLocation() void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) { bool is_info_type_agent = type == AGENT; - bool is_info_type_teleport_history = type == TELEPORT_HISTORY; - getChild<LLTextBox>("maturity_label")->setVisible(!is_info_type_agent); + mMaturityRatingIcon->setVisible(!is_info_type_agent); mMaturityRatingText->setVisible(!is_info_type_agent); getChild<LLTextBox>("owner_label")->setVisible(is_info_type_agent); mParcelOwner->setVisible(is_info_type_agent); - getChild<LLTextBox>("last_visited_label")->setVisible(is_info_type_teleport_history); - mLastVisited->setVisible(is_info_type_teleport_history); - getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent); switch(type) @@ -238,6 +232,30 @@ void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) LLPanelPlaceInfo::setInfoType(type); } +// virtual +void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data) +{ + LLPanelPlaceInfo::processParcelInfo(parcel_data); + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + if (parcel_data.flags & 0x2) + { + mMaturityRatingIcon->setValue(icon_r); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_ADULT)); + } + else if (parcel_data.flags & 0x1) + { + mMaturityRatingIcon->setValue(icon_m); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_MATURE)); + } + else + { + mMaturityRatingIcon->setValue(icon_pg); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_PG)); + } +} + void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, LLViewerRegion* region, const LLVector3d& pos_global, @@ -521,22 +539,6 @@ void LLPanelPlaceProfile::updateCovenantText(const std::string &text) mCovenantText->setText(text); } -void LLPanelPlaceProfile::updateLastVisitedText(const LLDate &date) -{ - if (date.isNull()) - { - mLastVisited->setText(getString("unknown")); - } - else - { - std::string timeStr = getString("acquired_date"); - LLSD substitution; - substitution["datetime"] = (S32) date.secondsSinceEpoch(); - LLStringUtil::format (timeStr, substitution); - mLastVisited->setText(timeStr); - } -} - void LLPanelPlaceProfile::onForSaleBannerClick() { LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance(); diff --git a/indra/newview/llpanelplaceprofile.h b/indra/newview/llpanelplaceprofile.h index b3ef4acf51..8c30ca92fb 100644 --- a/indra/newview/llpanelplaceprofile.h +++ b/indra/newview/llpanelplaceprofile.h @@ -50,6 +50,8 @@ public: /*virtual*/ void setInfoType(INFO_TYPE type); + /*virtual*/ void processParcelInfo(const LLParcelData& parcel_data); + // Displays information about the currently selected parcel // without sending a request to the server. // If is_current_parcel true shows "You Are Here" banner. @@ -61,7 +63,6 @@ public: void updateEstateName(const std::string& name); void updateEstateOwnerName(const std::string& name); void updateCovenantText(const std::string &text); - void updateLastVisitedText(const LLDate &date); private: void onForSaleBannerClick(); @@ -78,7 +79,6 @@ private: LLPanel* mYouAreHerePanel; LLTextBox* mParcelOwner; - LLTextBox* mLastVisited; LLIconCtrl* mParcelRatingIcon; LLTextBox* mParcelRatingText; diff --git a/indra/newview/llpanelplaces.cpp b/indra/newview/llpanelplaces.cpp index 8d117afcfe..3d0fba9426 100644 --- a/indra/newview/llpanelplaces.cpp +++ b/indra/newview/llpanelplaces.cpp @@ -293,7 +293,6 @@ void LLPanelPlaces::onOpen(const LLSD& key) mPosGlobal = hist_items[index].mGlobalPos; mPlaceProfile->setInfoType(LLPanelPlaceInfo::TELEPORT_HISTORY); - mPlaceProfile->updateLastVisitedText(hist_items[index].mDate); mPlaceProfile->displayParcelInfo(LLUUID(), mPosGlobal); } diff --git a/indra/newview/llpanelprofile.cpp b/indra/newview/llpanelprofile.cpp index 8147ff17f0..02f45c1b48 100644 --- a/indra/newview/llpanelprofile.cpp +++ b/indra/newview/llpanelprofile.cpp @@ -243,5 +243,6 @@ void LLPanelProfile::notifyParent(const LLSD& info) onOpen(info); return; } + LLPanel::notifyParent(info); } diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index 2be0781487..f5367c0477 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -36,10 +36,12 @@ #include "lltrans.h" #include "llavataractions.h" #include "llagent.h" +#include "llimview.h" #include "llparticipantlist.h" #include "llavatarlist.h" #include "llspeakers.h" +#include "llviewermenu.h" //LLParticipantList retrieves add, clear and remove events and updates view accordingly #if LL_MSVC @@ -64,6 +66,9 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av mAvatarList->setDoubleClickCallback(boost::bind(&LLParticipantList::onAvatarListDoubleClicked, this, mAvatarList)); mAvatarList->setRefreshCompleteCallback(boost::bind(&LLParticipantList::onAvatarListRefreshed, this, _1, _2)); + mParticipantListMenu = new LLParticipantListMenu(*this); + mAvatarList->setContextMenu(mParticipantListMenu); + //Lets fill avatarList with existing speakers LLAvatarList::uuid_vector_t& group_members = mAvatarList->getIDs(); @@ -83,8 +88,15 @@ LLParticipantList::LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* av LLParticipantList::~LLParticipantList() { + delete mParticipantListMenu; + mParticipantListMenu = NULL; } +void LLParticipantList::setSpeakingIndicatorsVisible(BOOL visible) +{ + mAvatarList->setSpeakingIndicatorsVisible(visible); +}; + void LLParticipantList::onAvatarListDoubleClicked(LLAvatarList* list) { LLUUID clicked_id = list->getSelectedUUID(); @@ -265,3 +277,139 @@ bool LLParticipantList::SpeakerModeratorUpdateListener::handleEvent(LLPointer<LL { return mParent.onModeratorUpdateEvent(event, userdata); } + +LLContextMenu* LLParticipantList::LLParticipantListMenu::createMenu() +{ + // set up the callbacks for all of the avatar menu items + LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar; + LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar; + + registrar.add("ParticipantList.ToggleAllowTextChat", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleAllowTextChat, this, _2)); + registrar.add("ParticipantList.ToggleMuteText", boost::bind(&LLParticipantList::LLParticipantListMenu::toggleMuteText, this, _2)); + + enable_registrar.add("ParticipantList.EnableItem", boost::bind(&LLParticipantList::LLParticipantListMenu::enableContextMenuItem, this, _2)); + enable_registrar.add("ParticipantList.CheckItem", boost::bind(&LLParticipantList::LLParticipantListMenu::checkContextMenuItem, this, _2)); + + // create the context menu from the XUI + return LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>( + "menu_participant_list.xml", LLMenuGL::sMenuContainer, LLViewerMenuHolderGL::child_registry_t::instance()); +} + +void LLParticipantList::LLParticipantListMenu::toggleAllowTextChat(const LLSD& userdata) +{ + const LLUUID speaker_id = mUUIDs.front(); + + std::string url = gAgent.getRegion()->getCapability("ChatSessionRequest"); + LLSD data; + data["method"] = "mute update"; + data["session-id"] = mParent.mSpeakerMgr->getSessionID(); + data["params"] = LLSD::emptyMap(); + data["params"]["agent_id"] = speaker_id; + data["params"]["mute_info"] = LLSD::emptyMap(); + //current value represents ability to type, so invert + data["params"]["mute_info"]["text"] = !mParent.mSpeakerMgr->findSpeaker(speaker_id)->mModeratorMutedText; + + class MuteTextResponder : public LLHTTPClient::Responder + { + public: + MuteTextResponder(const LLUUID& session_id) + { + mSessionID = session_id; + } + + virtual void error(U32 status, const std::string& reason) + { + llwarns << status << ": " << reason << llendl; + + if ( gIMMgr ) + { + //403 == you're not a mod + //should be disabled if you're not a moderator + if ( 403 == status ) + { + gIMMgr->showSessionEventError( + "mute", + "not_a_moderator", + mSessionID); + } + else + { + gIMMgr->showSessionEventError( + "mute", + "generic", + mSessionID); + } + } + } + + private: + LLUUID mSessionID; + }; + + LLHTTPClient::post( + url, + data, + new MuteTextResponder(mParent.mSpeakerMgr->getSessionID())); +} + +void LLParticipantList::LLParticipantListMenu::toggleMuteText(const LLSD& userdata) +{ + const LLUUID speaker_id = mUUIDs.front(); + BOOL is_muted = LLMuteList::getInstance()->isMuted(speaker_id, LLMute::flagTextChat); + std::string name; + + //fill in name using voice client's copy of name cache + LLPointer<LLSpeaker> speakerp = mParent.mSpeakerMgr->findSpeaker(speaker_id); + if (speakerp.isNull()) + { + return; + } + + name = speakerp->mDisplayName; + + LLMute mute(speaker_id, name, speakerp->mType == LLSpeaker::SPEAKER_AGENT ? LLMute::AGENT : LLMute::OBJECT); + + if (!is_muted) + { + LLMuteList::getInstance()->add(mute, LLMute::flagTextChat); + } + else + { + LLMuteList::getInstance()->remove(mute, LLMute::flagTextChat); + } +} + +bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + if (item == "can_mute_text") + { + return mUUIDs.front() != gAgentID; + } + else + if (item == "can_allow_text_chat") + { + LLIMModel::LLIMSession* im_session = LLIMModel::getInstance()->findIMSession(mParent.mSpeakerMgr->getSessionID()); + return im_session->mType == IM_SESSION_GROUP_START && mParent.mSpeakerMgr->findSpeaker(gAgentID)->mIsModerator; + } + return true; +} + +bool LLParticipantList::LLParticipantListMenu::checkContextMenuItem(const LLSD& userdata) +{ + std::string item = userdata.asString(); + const LLUUID& id = mUUIDs.front(); + if (item == "is_muted") + return LLMuteList::getInstance()->isMuted(id, LLMute::flagTextChat); + else + if (item == "is_allowed_text_chat") + { + LLPointer<LLSpeaker> selected_speakerp = mParent.mSpeakerMgr->findSpeaker(id); + + if (selected_speakerp.notNull()) + { + return !selected_speakerp->mModeratorMutedText; + } + } + return false; +} diff --git a/indra/newview/llparticipantlist.h b/indra/newview/llparticipantlist.h index fc34dd308b..5e26c39fc8 100644 --- a/indra/newview/llparticipantlist.h +++ b/indra/newview/llparticipantlist.h @@ -32,6 +32,8 @@ #include "llviewerprecompiledheaders.h" #include "llevent.h" +#include "llpanelpeoplemenus.h" +#include "llimview.h" class LLSpeakerMgr; class LLAvatarList; @@ -43,6 +45,7 @@ class LLParticipantList public: LLParticipantList(LLSpeakerMgr* data_source, LLAvatarList* avatar_list); ~LLParticipantList(); + void setSpeakingIndicatorsVisible(BOOL visible); typedef enum e_participant_sort_oder { E_SORT_BY_NAME = 0, @@ -105,6 +108,25 @@ class LLParticipantList SpeakerModeratorUpdateListener(LLParticipantList& parent) : BaseSpeakerListner(parent) {} /*virtual*/ bool handleEvent(LLPointer<LLOldEvents::LLEvent> event, const LLSD& userdata); }; + + /** + * Menu used in the participant list. + */ + class LLParticipantListMenu : public LLPanelPeopleMenus::ContextMenu + { + public: + LLParticipantListMenu(LLParticipantList& parent):mParent(parent){}; + /*virtual*/ LLContextMenu* createMenu(); + protected: + LLParticipantList& mParent; + private: + bool enableContextMenuItem(const LLSD& userdata); + bool checkContextMenuItem(const LLSD& userdata); + + void toggleAllowTextChat(const LLSD& userdata); + void toggleMuteText(const LLSD& userdata); + + }; private: void onAvatarListDoubleClicked(LLAvatarList* list); @@ -121,5 +143,7 @@ class LLParticipantList LLPointer<SpeakerClearListener> mSpeakerClearListener; LLPointer<SpeakerModeratorUpdateListener> mSpeakerModeratorListener; + LLParticipantListMenu* mParticipantListMenu; + EParticipantSortOrder mSortOrder; }; diff --git a/indra/newview/llrecentpeople.cpp b/indra/newview/llrecentpeople.cpp index b491c7e109..bd46b5b56a 100644 --- a/indra/newview/llrecentpeople.cpp +++ b/indra/newview/llrecentpeople.cpp @@ -33,6 +33,7 @@ #include "llviewerprecompiledheaders.h" #include "llrecentpeople.h" +#include "llgroupmgr.h" #include "llagent.h" @@ -43,12 +44,18 @@ bool LLRecentPeople::add(const LLUUID& id) if (id == gAgent.getID()) return false; - LLDate date_added = LLDate::now(); + bool is_not_group_id = LLGroupMgr::getInstance()->getGroupData(id) == NULL; - //[] instead of insert to replace existing id->date with new date value - mPeople[id] = date_added; - mChangedSignal(); - return true; + if (is_not_group_id) + { + LLDate date_added = LLDate::now(); + + //[] instead of insert to replace existing id->date with new date value + mPeople[id] = date_added; + mChangedSignal(); + } + + return is_not_group_id; } bool LLRecentPeople::contains(const LLUUID& id) const diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index 061587f11b..3d0b4de88a 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -424,16 +424,51 @@ void LLSideTray::createButtons () } } +void LLSideTray::processTriState () +{ + if(mCollapsed) + expandSideBar(); + else + { + //!!!!!!!!!!!!!!!!! + //** HARDCODED!!!!! + //!!!!!!!!!!!!!!!!! + + //there is no common way to determine "default" panel for tab + //so default panels for now will be hardcoded + + //hardcoded for people tab and profile tab + + /*if(mActiveTab == getTab("sidebar_people")) + { + LLSideTrayPanelContainer* container = findChild<LLSideTrayPanelContainer>("panel_container"); + if(container && container->getCurrentPanelIndex()>0) + { + container->onOpen(LLSD().insert("sub_panel_name","panel_people")); + } + else + collapseSideBar(); + } + else if(mActiveTab == getTab("sidebar_me")) + { + LLTabContainer* tab_container = findChild<LLTabContainer>("tabs"); + if(tab_container && tab_container->getCurrentPanelIndex()>0) + tab_container->selectFirstTab(); + else + collapseSideBar(); + } + else*/ + collapseSideBar(); + } +} + void LLSideTray::onTabButtonClick(string name) { LLSideTrayTab* side_bar = getTab(name); if(side_bar == mActiveTab) { - if(mCollapsed) - expandSideBar(); - else - collapseSideBar(); + processTriState (); return; } selectTabByName (name); diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h index 4d6081e230..5bb17eedd5 100644 --- a/indra/newview/llsidetray.h +++ b/indra/newview/llsidetray.h @@ -134,6 +134,9 @@ public: void reshape (S32 width, S32 height, BOOL called_from_parent = TRUE); + void processTriState (); + + protected: LLSideTrayTab* getTab (const std::string& name); diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 25729c91e6..64dcd7b97f 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -2478,7 +2478,7 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("AvatarPicksReply", &LLAvatarPropertiesProcessor::processAvatarPicksReply); msg->setHandlerFunc("AvatarClassifiedReply", - &LLAvatarPropertiesProcessor::processAvatarClassifiedReply); + &LLAvatarPropertiesProcessor::processAvatarClassifiedsReply); msg->setHandlerFuncFast(_PREHASH_CreateGroupReply, LLGroupMgr::processCreateGroupReply); @@ -2543,7 +2543,8 @@ void register_viewer_callbacks(LLMessageSystem* msg) msg->setHandlerFunc("EventInfoReply", LLPanelEvent::processEventInfoReply); msg->setHandlerFunc("PickInfoReply", &LLAvatarPropertiesProcessor::processPickInfoReply); - msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); +// msg->setHandlerFunc("ClassifiedInfoReply", LLPanelClassified::processClassifiedInfoReply); + msg->setHandlerFunc("ClassifiedInfoReply", LLAvatarPropertiesProcessor::processClassifiedInfoReply); msg->setHandlerFunc("ParcelInfoReply", LLRemoteParcelInfoProcessor::processParcelInfoReply); msg->setHandlerFunc("ScriptDialog", process_script_dialog); msg->setHandlerFunc("LoadURL", process_load_url); diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index cefc88ebee..89649407ff 100644 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -46,6 +46,7 @@ LLVoiceChannel::voice_channel_map_t LLVoiceChannel::sVoiceChannelMap; LLVoiceChannel::voice_channel_map_uri_t LLVoiceChannel::sVoiceChannelURIMap; LLVoiceChannel* LLVoiceChannel::sCurrentVoiceChannel = NULL; LLVoiceChannel* LLVoiceChannel::sSuspendedVoiceChannel = NULL; +LLVoiceChannel::channel_changed_signal_t LLVoiceChannel::sCurrentVoiceChannelChangedSignal; BOOL LLVoiceChannel::sSuspended = FALSE; @@ -320,6 +321,8 @@ void LLVoiceChannel::activate() { setState(STATE_CALL_STARTED); } + + sCurrentVoiceChannelChangedSignal(this->mSessionID); } void LLVoiceChannel::getChannelInfo() diff --git a/indra/newview/llvoicechannel.h b/indra/newview/llvoicechannel.h index 8f1e9ff02d..20b6157b48 100644 --- a/indra/newview/llvoicechannel.h +++ b/indra/newview/llvoicechannel.h @@ -54,6 +54,13 @@ public: typedef boost::function<void(const EState& old_state, const EState& new_state)> state_changed_callback_t; + // on current channel changed signal + typedef boost::function<void(const LLUUID& session_id)> channel_changed_callback_t; + typedef boost::signals2::signal<void(const LLUUID& session_id)> channel_changed_signal_t; + static channel_changed_signal_t sCurrentVoiceChannelChangedSignal; + static boost::signals2::connection setCurrentVoiceChannelChangedCallback(channel_changed_callback_t cb) { return sCurrentVoiceChannelChangedSignal.connect(cb); } + + LLVoiceChannel(const LLUUID& session_id, const std::string& session_name); virtual ~LLVoiceChannel(); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index 48c7236796..e881665578 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -38,6 +38,8 @@ <texture name="Blank" file_name="Blank.png" preload="false" /> <texture name="BottomTray_BG" file_name="bottomtray/BottomTray_BG.png" preload="false" /> + <texture name="BottomTray_Scroll_Right" file_name="navbar/Arrow_Right_Off.png" preload="false" /> + <texture name="BottomTray_Scroll_Left" file_name="navbar/Arrow_Left_Off.png" preload="false" /> <texture name="BuyArrow_Off" file_name="navbar/BuyArrow_Off.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> <texture name="BuyArrow_Over" file_name="navbar/BuyArrow_Over.png" preload="true" scale.left="1" scale.top="1" scale.right="0" scale.bottom="0" /> diff --git a/indra/newview/skins/default/xui/en/menu_participant_list.xml b/indra/newview/skins/default/xui/en/menu_participant_list.xml new file mode 100644 index 0000000000..c3283c6014 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_participant_list.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<context_menu + layout="topleft" + name="Participant List Context Menu"> + <menu_item_check + label="Mute Text" + layout="topleft" + name="MuteText"> + <on_check + function="ParticipantList.CheckItem" + parameter="is_muted" /> + <on_click + function="ParticipantList.ToggleMuteText" /> + <on_enable + function="ParticipantList.EnableItem" + parameter="can_mute_text" /> + </menu_item_check> + <menu_item_check + label="Allow text chat" + layout="topleft" + name="AllowTextChat"> + <on_check + function="ParticipantList.CheckItem" + parameter="is_allowed_text_chat" /> + <on_click + function="ParticipantList.ToggleAllowTextChat" /> + <on_enable + function="ParticipantList.EnableItem" + parameter="can_allow_text_chat" /> + </menu_item_check> +</context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml index c002cd078f..39f9e48609 100644 --- a/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml +++ b/indra/newview/skins/default/xui/en/menu_people_nearby_view_sort.xml @@ -2,15 +2,36 @@ <menu name="menu_group_plus" left="0" bottom="0" visible="false" mouse_opaque="false" opaque="true" color="MenuDefaultBgColor" drop_shadow="false"> - <menu_item_call name="sort_recent" label="Sort by Recent Speakers"> - <menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="sort_recent" /> - </menu_item_call> - <menu_item_call name="sort_name" label="Sort by Name"> - <menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="sort_name" /> - </menu_item_call> - <menu_item_call name="sort_distance" label="Sort by Distance"> - <menu_item_call.on_click function="People.Nearby.ViewSort.Action" userdata="sort_distance" /> - </menu_item_call> + <menu_item_check + label="Sort by Recent Speakers" + name="sort_by_recent_speakers"> + <menu_item_check.on_click + function="People.Nearby.ViewSort.Action" + parameter="sort_by_recent_speakers"/> + <menu_item_check.on_check + function="People.Nearby.ViewSort.CheckItem" + parameter="sort_by_recent_speakers"/> + </menu_item_check> + <menu_item_check + label="Sort by Name" + name="sort_name"> + <menu_item_check.on_click + function="People.Nearby.ViewSort.Action" + parameter="sort_name"/> + <menu_item_check.on_check + function="People.Nearby.ViewSort.CheckItem" + parameter="sort_name"/> + </menu_item_check> + <menu_item_check + label="Sort by Distance" + name="sort_distance"> + <menu_item_check.on_click + function="People.Nearby.ViewSort.Action" + parameter="sort_distance"/> + <menu_item_check.on_check + function="People.Nearby.ViewSort.CheckItem" + parameter="sort_distance"/> + </menu_item_check> <menu_item_separator layout="topleft" /> <menu_item_check name="view_icons" label="View People Icons"> <menu_item_check.on_click diff --git a/indra/newview/skins/default/xui/en/menu_picks_plus.xml b/indra/newview/skins/default/xui/en/menu_picks_plus.xml new file mode 100644 index 0000000000..3065239615 --- /dev/null +++ b/indra/newview/skins/default/xui/en/menu_picks_plus.xml @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<toggleable_menu + height="201" + layout="topleft" + mouse_opaque="false" + name="picks_plus_menu" + width="120"> + <menu_item_call + name="create_pick" + label="New Pick"> + <menu_item_call.on_click + function="Picks.Plus.Action" + userdata="new_pick" /> + </menu_item_call> + <menu_item_call + name="create_classified" + label="New Classified"> + <menu_item_call.on_click + function="Picks.Plus.Action" + userdata="new_classified" /> + </menu_item_call> +</toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index 989dc88851..ccd8bc569e 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -3051,6 +3051,18 @@ Teleport to [PICK]? </notification> <notification + icon="alertmodal.tga" + name="TeleportToClassified" + type="alertmodal"> + Teleport to [CLASSIFIED]? + <usetemplate + ignoretext="Confirm that I want to teleport to a location in Classifieds" + name="okcancelignore" + notext="Cancel" + yestext="Teleport"/> + </notification> + + <notification icon="alert.tga" label="Message everyone in your Estate" name="MessageEstate" diff --git a/indra/newview/skins/default/xui/en/panel_bottomtray.xml b/indra/newview/skins/default/xui/en/panel_bottomtray.xml index 3fbc8e1afd..9fc897b93e 100644 --- a/indra/newview/skins/default/xui/en/panel_bottomtray.xml +++ b/indra/newview/skins/default/xui/en/panel_bottomtray.xml @@ -241,7 +241,32 @@ top="0" chiclet_padding="3" scrolling_offset="40" - width="189" /> + width="189"> + <button + auto_resize="true" + follows="right" + height="23" + image_selected="BottomTray_Scroll_Left" + image_unselected="BottomTray_Scroll_Left" + layout="topleft" + name="chicklet_left_scroll_button" + tab_stop="false" + top="3" + visible="false" + width="20" /> + <button + auto_resize="true" + follows="right" + height="23" + image_selected="BottomTray_Scroll_Right" + image_unselected="BottomTray_Scroll_Right" + layout="topleft" + name="chicklet_right_scroll_button" + tab_stop="false" + top="3" + visible="false" + width="20" /> + </chiclet_panel> </layout_panel> <icon auto_resize="false" diff --git a/indra/newview/skins/default/xui/en/panel_classified_info.xml b/indra/newview/skins/default/xui/en/panel_classified_info.xml new file mode 100644 index 0000000000..bdca8531dc --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_classified_info.xml @@ -0,0 +1,183 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + follows="all" + height="570" + layout="topleft" + left="0" + min_height="350" + name="panel_classified_info" + top="0" + width="333"> + <panel.string + name="type_mature"> + Mature + </panel.string> + <panel.string + name="type_pg"> + PG Content + </panel.string> + <button + follows="top|right" + height="23" + image_overlay="BackArrow_Off" + layout="topleft" + name="back_btn" + picture_style="true" + left="10" + tab_stop="false" + top="2" + width="23" /> + <text + follows="top|left|right" + font="SansSerifHugeBold" + height="26" + layout="topleft" + left_pad="10" + name="title" + text_color="white" + top="0" + value="Classified Info" + use_ellipses="true" + width="275" /> + <scroll_container + color="DkGray2" + opaque="true" + follows="all" + height="500" + layout="topleft" + left="10" + top_pad="10" + name="profile_scroll" + reserve_scroll_corner="false" + width="313"> + <panel + name="scroll_content_panel" + follows="left|top" + min_height="300" + layout="topleft" + top="0" + background_visible="false" + height="500" + left="0" + width="295"> + <texture_picker + enabled="false" + follows="left|top" + height="197" + layout="topleft" + left="10" + name="classified_snapshot" + top="20" + width="290" /> + <text + follows="left|top|right" + height="35" + width="290" + layout="topleft" + font="SansSerifBig" + font.style="BOLD" + left="10" + top_pad="10" + name="classified_name" + text_color="white" + value="[name]" + use_ellipses="true" /> + <text + follows="left|top" + height="25" + layout="topleft" + left="10" + name="classified_location" + width="290" + word_wrap="true" + value="[loading...]" /> + <text + follows="left|top|right" + height="18" + layout="topleft" + left="10" + name="content_type" + width="290" + top_pad="5" + value="[content type]" /> + <text + follows="left|top|right" + height="18" + layout="topleft" + left="10" + name="category" + width="290" + top_pad="5" + value="[category]" /> + <check_box + enabled="false" + height="16" + label="Auto renew each week" + layout="topleft" + left="10" + name="auto_renew" + top_pad="5" + width="290" /> + <text + follows="left|top" + halign="left" + height="16" + layout="topleft" + left="10" + name="price_for_listing" + top_pad="5" + tool_tip="Price for listing." + width="105"> + L$[PRICE] + </text> + <text + follows="left|top|right" + height="200" + layout="topleft" + left="10" + name="classified_desc" + width="290" + value="[description]" + word_wrap="true" /> + </panel> + </scroll_container> + <panel + follows="left|right|bottom" + height="20" + layout="topleft" + top_pad="8" + left="10" + name="buttons"> + <button + follows="bottom|left" + font="SansSerifSmall" + height="19" + label="Teleport" + layout="topleft" + left="0" + name="teleport_btn" + top="0" + width="90" /> + <button + follows="bottom|left" + font="SansSerifSmall" + height="19" + label="Map" + layout="topleft" + left_pad="10" + name="show_on_map_btn" + top="0" + width="90" /> + <button + follows="bottom|left" + font="SansSerifSmall" + height="19" + label="Edit" + layout="topleft" + right="-1" + name="edit_btn" + top="0" + width="90" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml new file mode 100644 index 0000000000..ee333be0cb --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + bevel_style="none" + follows="top|left|right" + height="85" + layout="topleft" + left="0" + name="classified_item" + top="0" + width="313"> + <icon + follows="all" + height="85" + image_name="ListItem_Over" + right="-3" + mouse_opaque="false" + name="hovered_icon" + top="1" + scale_image="true" + visible="false" + width="307"/> + <icon + follows="all" + height="85" + image_name="ListItem_Select" + right="-3" + mouse_opaque="false" + name="selected_icon" + top="1" + scale_image="true" + visible="false" + width="307"/> + <texture_picker + allow_no_texture="true" + border_enabled="true" + default_image_name="TabIcon_Places_Large" + enabled="false" + follows="left|top" + height="80" + layout="topleft" + left="10" + mouse_opaque="false" + name="picture" + tab_stop="false" + top="10" + top_pad="10" + width="90" /> + <text + follows="top|left|right" + font="SansSerifSmallBold" + height="16" + layout="topleft" + left="110" + name="name" + text_color="white" + top="9" + use_ellipses="false" + width="197" + word_wrap="false" /> + <expandable_text + follows="top|left|right" + font="SansSerifSmall" + height="40" + layout="topleft" + left="110" + name="description" + top_pad="3" + width="178" + word_wrap="true" /> + <button + follows="top|right" + height="16" + image_selected="BuyArrow_Press" + image_pressed="BuyArrow_Press" + image_unselected="BuyArrow_Press" + layout="topleft" + name="info_chevron" + picture_style="true" + right="-7" + tab_stop="false" + top="27" + width="16" /> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_classified.xml b/indra/newview/skins/default/xui/en/panel_edit_classified.xml new file mode 100644 index 0000000000..2f3277804f --- /dev/null +++ b/indra/newview/skins/default/xui/en/panel_edit_classified.xml @@ -0,0 +1,255 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<panel + background_visible="true" + bevel_style="in" + follows="left|top|right|bottom" + height="570" + label="Edit Classified" + layout="topleft" + left="0" + min_height="350" + name="panel_edit_classified" + top="0" + width="333"> + <panel.string + name="location_notice"> + (will update after save) + </panel.string> + <button + follows="top|right" + height="23" + image_overlay="BackArrow_Off" + layout="topleft" + name="back_btn" + picture_style="true" + left="10" + tab_stop="false" + top="2" + width="23" /> + <text + type="string" + length="1" + follows="top" + font="SansSerifHuge" + height="15" + layout="topleft" + left_pad="10" + name="title" + text_color="white" + top="5" + width="250"> + Edit Classified + </text> + <scroll_container + color="DkGray2" + follows="all" + height="510" + layout="topleft" + left="10" + top_pad="10" + name="profile_scroll" + reserve_scroll_corner="false" + opaque="true" + width="313"> + <panel + name="scroll_content_panel" + follows="left|top" + min_height="300" + layout="topleft" + top="0" + background_visible="false" + height="600" + left="0" + width="295"> + <texture_picker + follows="left|top|right" + height="197" + width="290" + layout="topleft" + top="20" + left="10" + name="classified_snapshot" /> + <icon + height="18" + image_name="AddItem_Off" + layout="topleft" + right="-5" + name="edit_icon" + label="" + tool_tip="Click to select an image" + top="27" + width="18" /> + <text + type="string" + length="1" + follows="left|top" + height="15" + font="SansSerifSmall" + font.style="BOLD" + layout="topleft" + left="10" + top="215" + name="Name:" + text_color="white" + width="290"> + Title: + </text> + <line_editor + follows="left|top|right" + font="SansSerif" + height="20" + layout="topleft" + left="10" + top_pad="2" + max_length="63" + name="classified_name" + text_color="black" + width="290" /> + <text + type="string" + length="1" + follows="left|top" + height="15" + font="SansSerifSmall" + font.style="BOLD" + layout="topleft" + left="10" + top_pad="20" + name="description_label" + text_color="white" + width="290"> + Description: + </text> + <text_editor + follows="left|top|right" + height="100" + width="290" + hide_scrollbar="false" + layout="topleft" + left="10" + top_pad="2" + max_length="1023" + name="classified_desc" + text_color="black" + word_wrap="true" /> + <text + type="string" + length="1" + font="SansSerifSmall" + font.style="BOLD" + follows="left|top" + height="15" + layout="topleft" + left="10" + name="location_label" + text_color="white" + top_pad="20" + width="290"> + Location: + </text> + <text + type="string" + length="1" + follows="left|top" + height="50" + layout="topleft" + left="10" + name="classified_location" + right="-10" + top_pad="2" + width="290" + word_wrap="true"> + loading... + </text> + <button + follows="left|top" + height="20" + label="Set to Current Location" + layout="topleft" + left="8" + top_pad="5" + name="set_to_curr_location_btn" + width="200" /> + <combo_box + follows="left|top" + height="18" + label="" + left="10" + name="category" + top_pad="5" + width="200" /> + <combo_box + allow_text_entry="false" + follows="left|top" + height="18" + left="10" + name="content_type" + top_pad="5" + width="200"> + <combo_item + name="mature_ci" + value="Mature"> + Mature Content + </combo_item> + <combo_item + name="pg_ci" + value="PG"> + PG Content + </combo_item> + </combo_box> + <spinner + decimal_digits="0" + follows="left|top" + halign="left" + height="16" + increment="1" + label_width="20" + label="L$" + layout="topleft" + left="10" + value="50" + min_val="50" + max_val="99999" + name="price_for_listing" + top_pad="5" + tool_tip="Price for listing." + width="105" /> + <check_box + height="16" + label="Auto renew each week" + layout="topleft" + left="10" + name="auto_renew" + top_pad="5" + width="250" /> + </panel> + </scroll_container> + <panel + follows="left|right|bottom" + height="20" + label="bottom_panel" + layout="topleft" + left="10" + name="bottom_panel" + top_pad="5" + width="303"> + <button + follows="bottom|left" + height="19" + label="Save" + layout="topleft" + name="save_changes_btn" + left="0" + top="0" + width="130" /> + <button + follows="bottom|left" + height="19" + label="Cancel" + layout="topleft" + name="cancel_btn" + left_pad="5" + right="-1" + width="130" /> + </panel> +</panel> diff --git a/indra/newview/skins/default/xui/en/panel_edit_pick.xml b/indra/newview/skins/default/xui/en/panel_edit_pick.xml index f4a212ba0a..d6de5af32d 100644 --- a/indra/newview/skins/default/xui/en/panel_edit_pick.xml +++ b/indra/newview/skins/default/xui/en/panel_edit_pick.xml @@ -53,7 +53,7 @@ layout="topleft" top="0" background_visible="false" - height="470" + height="510" left="0" width="295"> <texture_picker diff --git a/indra/newview/skins/default/xui/en/panel_landmark_info.xml b/indra/newview/skins/default/xui/en/panel_landmark_info.xml index 0c24adfad5..b01ddbf75a 100644 --- a/indra/newview/skins/default/xui/en/panel_landmark_info.xml +++ b/indra/newview/skins/default/xui/en/panel_landmark_info.xml @@ -43,6 +43,16 @@ name="acquired_date"> [wkday,datetime,local] [mth,datetime,local] [day,datetime,local] [hour,datetime,local]:[min,datetime,local]:[second,datetime,local] [year,datetime,local] </string> + <!-- Texture names for rating icons --> + <string + name="icon_PG" + value="parcel_drk_PG" /> + <string + name="icon_M" + value="parcel_drk_M" /> + <string + name="icon_R" + value="parcel_drk_R" /> <button follows="top|right" height="23" @@ -125,6 +135,24 @@ top_pad="10" value="Du waltz die spritz" width="300" /> + <icon + follows="top|left" + height="16" + image_name="unknown" + layout="topleft" + left="10" + name="maturity_icon" + top_pad="10" + width="18" /> + <text + follows="right|top" + height="16" + layout="topleft" + left_pad="8" + name="maturity_value" + top_delta="0" + value="unknown" + width="268" /> <panel follows="left|top|right" height="55" diff --git a/indra/newview/skins/default/xui/en/panel_picks.xml b/indra/newview/skins/default/xui/en/panel_picks.xml index ae61852f68..dbe76e553b 100644 --- a/indra/newview/skins/default/xui/en/panel_picks.xml +++ b/indra/newview/skins/default/xui/en/panel_picks.xml @@ -8,16 +8,57 @@ name="panel_picks" top="0" width="313"> + <string + name="no_picks" + value="No Picks" /> + <string + name="no_classifieds" + value="No Classifieds" /> + + <accordion + follows="all" + height="465" + layout="topleft" + left="0" + name="accordion" + top="0" + width="313"> + <accordion_tab + can_resize="false" + layout="topleft" + height="235" + min_height="150" + name="tab_picks" + title="Picks" + visible="false"> <flat_list_view color="DkGray2" follows="all" - height="465" layout="topleft" left="0" name="picks_list" opaque="true" top="0" width="313" /> + </accordion_tab> + <accordion_tab + can_resize="false" + layout="topleft" + height="235" + name="tab_classifieds" + title="Classified" + visible="false"> + <flat_list_view + color="DkGray2" + follows="all" + layout="topleft" + left="0" + name="classifieds_list" + opaque="true" + top="0" + width="313" /> + </accordion_tab> + </accordion> <panel background_visible="true" bevel_style="none" diff --git a/indra/newview/skins/default/xui/en/panel_place_profile.xml b/indra/newview/skins/default/xui/en/panel_place_profile.xml index 65f150b33c..e6084202d7 100644 --- a/indra/newview/skins/default/xui/en/panel_place_profile.xml +++ b/indra/newview/skins/default/xui/en/panel_place_profile.xml @@ -179,7 +179,6 @@ min_height="300" name="scrolling_panel" top="0" - value=">" width="313"> <texture_picker enabled="false" @@ -296,6 +295,24 @@ top_delta="0" value="Alex Superduperlongenamenton" width="205" /> + <icon + follows="top|left" + height="16" + image_name="unknown" + layout="topleft" + left="10" + name="maturity_icon" + top_delta="0" + width="18" /> + <text + follows="right|top" + height="16" + layout="topleft" + left_pad="8" + name="maturity_value" + top_delta="0" + value="unknown" + width="268" /> <accordion follows="all" height="230" @@ -308,222 +325,211 @@ layout="topleft" name="parcel_characteristics_tab" title="Parcel"> - <scroll_container - color="DkGray2" + <panel follows="all" - height="132" + height="160" layout="topleft" left="0" - name="parcel_scroll" - opaque="true" top="0" - width="290"> - <panel - follows="all" - height="165" + width="275"> + <icon + follows="top|left" + height="16" + image_name="parcel_drk_PG" layout="topleft" - left="0" + left="10" + name="rating_icon" top="0" - width="275"> - <icon - follows="top|left" - height="16" - image_name="parcel_drk_PG" - layout="topleft" - left="20" - name="rating_icon" - top="0" - width="18" /> - <text - follows="left|top" - height="16" - layout="topleft" - left_pad="8" - name="rating_label" - value="Rating:" - width="80" /> - <text - follows="right|top" - height="16" - layout="topleft" - left_pad="0" - name="rating_value" - top_delta="0" - value="unknown" - width="120" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Voice" - layout="topleft" - left="20" - name="voice_icon" - top_pad="5" - width="22" /> - <text - follows="left|top" - height="18" - layout="topleft" - left_pad="8" - name="voice_label" - top_delta="0" - value="Voice:" - width="76" /> - <text - follows="right|top" - height="18" - layout="topleft" - left_pad="0" - name="voice_value" - top_delta="0" - value="On" - width="60" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Fly" - layout="topleft" - left="20" - name="fly_icon" - top_pad="3" - width="22" /> - <text - follows="left|top" - height="16" - layout="topleft" - left_pad="8" - name="fly_label" - value="Fly:" - width="76" /> - <text - follows="right|top" - height="16" - layout="topleft" - left_pad="0" - name="fly_value" - top_delta="0" - value="On" - width="60" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Push" - layout="topleft" - left="20" - name="push_icon" - top_pad="3" - width="22" /> - <text - follows="left|top" - height="14" - layout="topleft" - left_pad="8" - name="push_label" - value="Push:" - width="76" /> - <text - follows="right|top" - height="14" - layout="topleft" - left_pad="0" - name="push_value" - top_delta="0" - value="Off" - width="60" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Build" - layout="topleft" - left="20" - name="build_icon" - top_pad="3" - width="22" /> - <text - follows="left|top" - height="14" - layout="topleft" - left_pad="8" - name="build_label" - value="Build:" - width="76" /> - <text - follows="right|top" - height="15" - layout="topleft" - left_pad="0" - name="build_value" - top_delta="0" - value="On" - width="60" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Scripts" - layout="topleft" - left="20" - name="scripts_icon" - top_pad="3" - width="22" /> - <text - follows="left|top" - height="14" - layout="topleft" - left_pad="8" - name="scripts_label" - value="Scripts:" - width="76" /> - <text - follows="right|top" - height="14" - layout="topleft" - left_pad="0" - name="scripts_value" - top_delta="0" - value="On" - width="60" /> - <icon - follows="top|left" - height="18" - image_name="parcel_drk_Damage" - layout="topleft" - left="20" - name="damage_icon" - top_pad="7" - width="22" /> - <text - follows="left|top" - height="14" - layout="topleft" - left_pad="8" - name="damage_label" - value="Damage:" - width="76" /> - <text - follows="right|top" - height="14" - layout="topleft" - left_pad="0" - name="damage_value" - top_delta="0" - value="Off" - width="60" /> - <button - follows="bottom|right" - height="19" - label="About Land" - layout="topleft" - name="about_land_btn" - right="-5" - tab_stop="false" - top="138" - width="90"> - <click_callback - function="ShowFloater" - parameter="about_land" /> - </button> - </panel> - </scroll_container> + width="18" /> + <text + follows="left|top" + height="16" + layout="topleft" + left_pad="12" + name="rating_label" + value="Rating:" + width="60" /> + <text + follows="left|right|top" + height="16" + layout="topleft" + left_pad="0" + name="rating_value" + top_delta="0" + value="unknown" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Voice" + layout="topleft" + left="10" + name="voice_icon" + top_pad="5" + width="22" /> + <text + follows="left|top" + height="18" + layout="topleft" + left_pad="8" + name="voice_label" + top_delta="0" + value="Voice:" + width="60" /> + <text + follows="left|right|top" + height="18" + layout="topleft" + left_pad="0" + name="voice_value" + top_delta="0" + value="On" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Fly" + layout="topleft" + left="10" + name="fly_icon" + top_pad="3" + width="22" /> + <text + follows="left|top" + height="16" + layout="topleft" + left_pad="8" + name="fly_label" + value="Fly:" + width="60" /> + <text + follows="left|right|top" + height="16" + layout="topleft" + left_pad="0" + name="fly_value" + top_delta="0" + value="On" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Push" + layout="topleft" + left="10" + name="push_icon" + top_pad="3" + width="22" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="8" + name="push_label" + value="Push:" + width="60" /> + <text + follows="left|right|top" + height="14" + layout="topleft" + left_pad="0" + name="push_value" + top_delta="0" + value="Off" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Build" + layout="topleft" + left="10" + name="build_icon" + top_pad="3" + width="22" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="8" + name="build_label" + value="Build:" + width="60" /> + <text + follows="left|right|top" + height="15" + layout="topleft" + left_pad="0" + name="build_value" + top_delta="0" + value="On" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Scripts" + layout="topleft" + left="10" + name="scripts_icon" + top_pad="3" + width="22" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="8" + name="scripts_label" + value="Scripts:" + width="60" /> + <text + follows="left|right|top" + height="14" + layout="topleft" + left_pad="0" + name="scripts_value" + top_delta="0" + value="On" + width="60" /> + <icon + follows="top|left" + height="18" + image_name="parcel_drk_Damage" + layout="topleft" + left="10" + name="damage_icon" + top_pad="7" + width="22" /> + <text + follows="left|top" + height="14" + layout="topleft" + left_pad="8" + name="damage_label" + value="Damage:" + width="60" /> + <text + follows="left|right|top" + height="14" + layout="topleft" + left_pad="0" + name="damage_value" + top_delta="0" + value="Off" + width="60" /> + <button + follows="bottom|right" + height="19" + label="About Land" + layout="topleft" + name="about_land_btn" + right="-5" + tab_stop="false" + top="138" + width="90"> + <click_callback + function="ShowFloater" + parameter="about_land" /> + </button> + </panel> </accordion_tab> <accordion_tab expanded="false" @@ -545,7 +551,7 @@ name="region_name_label" top_pad="5" value="Region:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" @@ -554,7 +560,7 @@ name="region_name" top_delta="0" value="Mooseland" - width="195" /> + width="187" /> <text follows="left|top" height="15" @@ -563,7 +569,7 @@ name="region_type_label" top_pad="5" value="Type:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" @@ -572,7 +578,7 @@ name="region_type" top_delta="0" value="Moose" - width="195" /> + width="187" /> <text follows="left|top" height="15" @@ -581,7 +587,7 @@ name="region_rating_label" top_pad="7" value="Rating:" - width="80" /> + width="90" /> <icon follows="top|left" height="16" @@ -597,7 +603,7 @@ left_pad="10" name="region_rating" value="Explicit" - width="100" /> + width="159" /> <text follows="left|top" height="15" @@ -606,7 +612,7 @@ name="region_owner_label" top_pad="5" value="Owner:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" @@ -615,7 +621,7 @@ name="region_owner" top_delta="0" value="moose Van Moose" - width="195" /> + width="187" /> <text follows="left|top" height="15" @@ -624,7 +630,7 @@ name="region_group_label" top_pad="5" value="Group:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" @@ -633,7 +639,7 @@ name="region_group" top_delta="0" use_ellipses="true" - width="195"> + width="187"> The Mighty Moose of mooseville soundvillemoose </text> <button @@ -671,15 +677,15 @@ name="estate_name_label" top_pad="5" value="Estate:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="90" + left_pad="0" name="estate_name" top_delta="0" - width="160" /> + width="187" /> <text follows="left|top" height="15" @@ -688,15 +694,15 @@ name="estate_rating_label" top_pad="5" value="Rating:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="90" + left_pad="0" name="estate_rating" top_delta="0" - width="160" /> + width="187" /> <text follows="left|top" height="15" @@ -705,15 +711,15 @@ name="estate_owner_label" top_pad="5" value="Owner:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="90" + left_pad="0" name="estate_owner" top_delta="0" - width="160" /> + width="187" /> <text follows="left|top" height="15" @@ -722,7 +728,7 @@ name="covenant_label" top_pad="5" value="Covenant:" - width="220" /> + width="277" /> <text_editor bg_focus_color="DkGray2" bg_readonly_color="DkGray2" @@ -735,7 +741,8 @@ name="covenant" read_only="true" top_pad="0" - width="280" /> + width="277" + word_wrap="true" /> </panel> </accordion_tab> <accordion_tab @@ -758,15 +765,15 @@ name="sales_price_label" top_pad="5" value="Price:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="sales_price" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -775,15 +782,15 @@ name="area_label" top_pad="5" value="Area:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="area" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -792,15 +799,15 @@ name="traffic_label" top_pad="5" value="Traffic:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="traffic" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -809,15 +816,15 @@ name="primitives_label" top_pad="5" value="Primitives:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="primitives" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -826,15 +833,15 @@ name="parcel_scripts_label" top_pad="5" value="Scripts:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="parcel_scripts" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -843,15 +850,15 @@ name="terraform_limits_label" top_pad="5" value="Terraform limits:" - width="100" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="110" + left_pad="0" name="terraform_limits" top_delta="0" - width="140" /> + width="187" /> <text follows="left|top" height="15" @@ -860,7 +867,7 @@ name="subdivide_label" top_pad="5" value="Subdivide/Join ability:" - width="220" /> + width="277" /> <text_editor bg_focus_color="DkGray2" bg_readonly_color="DkGray2" @@ -872,7 +879,8 @@ name="subdivide" read_only="true" top_pad="5" - width="245" /> + width="277" + word_wrap="true" /> <text follows="left|top" height="15" @@ -881,7 +889,7 @@ name="resale_label" top_pad="5" value="ReSale ability:" - width="80" /> + width="277" /> <text_editor bg_focus_color="DkGray2" bg_readonly_color="DkGray2" @@ -893,7 +901,8 @@ name="resale" read_only="true" top_pad="5" - width="245" /> + width="277" + word_wrap="true" /> <text follows="left|top" height="15" @@ -902,15 +911,15 @@ name="sale_to_label" top_pad="5" value="For sale to:" - width="80" /> + width="90" /> <text follows="left|top|right" height="15" layout="topleft" - left="90" + left_pad="0" name="sale_to" top_delta="0" - width="160" /> + width="187" /> </panel> </accordion_tab> </accordion> diff --git a/indra/newview/skins/default/xui/en/panel_places.xml b/indra/newview/skins/default/xui/en/panel_places.xml index cbbcfe5068..5efacb68be 100644 --- a/indra/newview/skins/default/xui/en/panel_places.xml +++ b/indra/newview/skins/default/xui/en/panel_places.xml @@ -104,7 +104,7 @@ background_visible="true" follows="bottom|right" font="SansSerifSmall" height="19" - image_disabled="ForwardArrow_Disabled" + image_disabled="ForwardArrow_Off" image_selected="ForwardArrow_Press" image_unselected="ForwardArrow_Off" layout="topleft" diff --git a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml index b1308a1942..9b10edde33 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_graphics1.xml @@ -109,19 +109,7 @@ name="ui_scale_slider" top_pad="2" width="180" /> - <spinner - control_name="UIScaleFactor" - height="16" - increment="0.025" - initial_value="1" - layout="topleft" - left_pad="10" - max_val="1.4" - min_val="0.75" - name="ui_scale_slider" - top_delta="0" - width="58" /> - <text + <text type="string" length="1" follows="left|top" |