diff options
author | Steven Bennetts <steve@lindenlab.com> | 2007-02-27 01:03:39 +0000 |
---|---|---|
committer | Steven Bennetts <steve@lindenlab.com> | 2007-02-27 01:03:39 +0000 |
commit | 647d29b1a2d4712ea738b408be43e56895a715b1 (patch) | |
tree | 8db33983be6e10c05895f9774bfbad81a3f6ae81 | |
parent | c4b5b3977ffa6669a00f9bc334db02f51cc10fcb (diff) |
merge -r 58285:58437 maintenance.
-rw-r--r-- | indra/llui/llmenugl.cpp | 14 | ||||
-rw-r--r-- | indra/llui/llmenugl.h | 1 | ||||
-rw-r--r-- | indra/llui/llpanel.cpp | 14 | ||||
-rw-r--r-- | indra/llui/llpanel.h | 1 | ||||
-rw-r--r-- | indra/newview/llagent.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llfloaterland.cpp | 18 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.cpp | 246 | ||||
-rw-r--r-- | indra/newview/llpanelavatar.h | 99 | ||||
-rw-r--r-- | indra/newview/llpanelclassified.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llstatusbar.cpp | 15 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 15 | ||||
-rw-r--r-- | indra/newview/lltoolpie.h | 2 | ||||
-rw-r--r-- | indra/newview/lltoolselect.cpp | 4 | ||||
-rw-r--r-- | indra/newview/lltoolselect.h | 4 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 97 | ||||
-rw-r--r-- | indra/newview/llviewerwindow.cpp | 3 |
16 files changed, 310 insertions, 233 deletions
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 9161ecb19f..4c40d99178 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -1635,7 +1635,7 @@ BOOL LLMenuItemBranchDownGL::handleAcceleratorKey(KEY key, MASK mask) { BOOL branch_visible = mBranch->getVisible(); BOOL handled = mBranch->handleAcceleratorKey(key, mask); - if (handled && !branch_visible) + if (handled && !branch_visible && getVisible()) { // flash this menu entry because we triggered an invisible menu item LLMenuHolderGL::setActivatedItem(this); @@ -2263,6 +2263,12 @@ void LLMenuGL::setBackgroundColor( const LLColor4& color ) mBackgroundColor = color; } +LLColor4 LLMenuGL::getBackgroundColor() +{ + return mBackgroundColor; +} + + // rearrange the child rects so they fit the shape of the menu. void LLMenuGL::arrange( void ) { @@ -4159,6 +4165,7 @@ void LLMenuBarGL::arrange( void ) item->setRect( rect ); item->buildDrawLabel(); } + reshape(rect.mRight, rect.getHeight()); } @@ -4376,7 +4383,7 @@ BOOL LLMenuHolderGL::hasVisibleMenu() const for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - if (viewp->getVisible()) + if (viewp->getVisible() && viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR) { return TRUE; } @@ -4402,7 +4409,8 @@ BOOL LLMenuHolderGL::hideMenus() for ( child_list_const_iter_t child_it = getChildList()->begin(); child_it != getChildList()->end(); ++child_it) { LLView* viewp = *child_it; - if (viewp->getVisible()) + // clicks off of menu do not hide menu bar + if (viewp->getWidgetType() != WIDGET_TYPE_MENU_BAR && viewp->getVisible()) { viewp->setVisible(FALSE); } diff --git a/indra/llui/llmenugl.h b/indra/llui/llmenugl.h index 1b0b844bdc..e60f267702 100644 --- a/indra/llui/llmenugl.h +++ b/indra/llui/llmenugl.h @@ -424,6 +424,7 @@ public: static void setDefaultBackgroundColor( const LLColor4& color ); void setBackgroundColor( const LLColor4& color ); + LLColor4 getBackgroundColor(); void setBackgroundVisible( BOOL b ) { mBgVisible = b; } void setCanTearOff(BOOL tear_off, LLViewHandle parent_floater_handle = LLViewHandle::sDeadHandle); diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp index de65ce14f6..406b5ef571 100644 --- a/indra/llui/llpanel.cpp +++ b/indra/llui/llpanel.cpp @@ -164,10 +164,11 @@ void LLPanel::draw() // draw background if( mBgVisible ) { - S32 left = LLPANEL_BORDER_WIDTH; - S32 top = mRect.getHeight() - LLPANEL_BORDER_WIDTH; - S32 right = mRect.getWidth() - LLPANEL_BORDER_WIDTH; - S32 bottom = LLPANEL_BORDER_WIDTH; + //RN: I don't see the point of this + S32 left = 0;//LLPANEL_BORDER_WIDTH; + S32 top = mRect.getHeight();// - LLPANEL_BORDER_WIDTH; + S32 right = mRect.getWidth();// - LLPANEL_BORDER_WIDTH; + S32 bottom = 0;//LLPANEL_BORDER_WIDTH; if (mBgOpaque ) { @@ -459,6 +460,11 @@ void LLPanel::setBackgroundColor(const LLColor4& color) mBgColorOpaque = color; } +LLColor4 LLPanel::getBackgroundColor() +{ + return mBgColorOpaque; +} + void LLPanel::setTransparentColor(const LLColor4& color) { mBgColorAlpha = color; diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h index 9da27b6f38..59922994c1 100644 --- a/indra/llui/llpanel.h +++ b/indra/llui/llpanel.h @@ -86,6 +86,7 @@ public: static BOOL nextAlert(LLAlertInfo &alert); void setBackgroundColor( const LLColor4& color ); + LLColor4 getBackgroundColor(); void setTransparentColor(const LLColor4& color); void setBackgroundVisible( BOOL b ) { mBgVisible = b; } void setBackgroundOpaque(BOOL b) { mBgOpaque = b; } diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 9d2f4fac32..caeee9f210 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -467,8 +467,12 @@ void LLAgent::resetView(BOOL reset_camera) // By popular request, keep land selection while walking around. JC // gParcelMgr->deselectLand(); - //FIXME: force deselect when walking? - RN - // gSelectMgr->deselectAll(); + // force deselect when walking and attachment is selected + // this is so people don't wig out when their avatar moves without animating + if (gSelectMgr->getSelection()->isAttachment()) + { + gSelectMgr->deselectAll(); + } // Hide all popup menus gMenuHolder->hideMenus(); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index d091b4c01f..6f698d2734 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -1221,15 +1221,15 @@ void LLPanelLandObjects::refresh() else { char count[MAX_STRING]; /*Flawfinder: ignore*/ - S32 sw_max; - S32 sw_total; - S32 max; - S32 total; - S32 owned; - S32 group; - S32 other; - S32 selected; - F32 parcel_object_bonus; + S32 sw_max = 0; + S32 sw_total = 0; + S32 max = 0; + S32 total = 0; + S32 owned = 0; + S32 group = 0; + S32 other = 0; + S32 selected = 0; + F32 parcel_object_bonus = 0.f; gParcelMgr->getPrimInfo(sw_max, sw_total, max, total, owned, group, other, selected, diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp index 50586b3649..810e026d2a 100644 --- a/indra/newview/llpanelavatar.cpp +++ b/indra/newview/llpanelavatar.cpp @@ -45,6 +45,7 @@ #include "lluiconstants.h" #include "llvoavatar.h" #include "llviewermenu.h" // *FIX: for is_agent_friend() +#include "llviewermessage.h" // send_generic_message #include "llviewerobjectlist.h" #include "llviewerregion.h" #include "llviewborder.h" @@ -234,27 +235,52 @@ BOOL LLDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, //----------------------------------------------------------------------------- -// LLPanelAvatarSecondLife() +// LLPanelAvatarTab() //----------------------------------------------------------------------------- -LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ) +LLPanelAvatarTab::LLPanelAvatarTab(const std::string& name, const LLRect &rect, + LLPanelAvatar* panel_avatar) : LLPanel(name, rect), mPanelAvatar(panel_avatar), - mPartnerID() -{ -} + mDataRequested(false) +{ } -LLPanelAvatarSecondLife::~LLPanelAvatarSecondLife() +// virtual +void LLPanelAvatarTab::draw() { + if (getVisible()) + { + refresh(); + + LLPanel::draw(); + } } -void LLPanelAvatarSecondLife::draw() +void LLPanelAvatarTab::sendAvatarProfileRequestIfNeeded(const char* type) { - if (getVisible()) + if (!mDataRequested) { - updatePartnerName(); + std::vector<std::string> strings; + strings.push_back( mPanelAvatar->getAvatarID().asString() ); + strings.push_back( type ); + send_generic_message("avatarprofilerequest", strings); + mDataRequested = true; } +} - LLPanel::draw(); +//----------------------------------------------------------------------------- +// LLPanelAvatarSecondLife() +//----------------------------------------------------------------------------- +LLPanelAvatarSecondLife::LLPanelAvatarSecondLife(const std::string& name, + const LLRect &rect, + LLPanelAvatar* panel_avatar ) +: LLPanelAvatarTab(name, rect, panel_avatar), + mPartnerID() +{ +} + +void LLPanelAvatarSecondLife::refresh() +{ + updatePartnerName(); } void LLPanelAvatarSecondLife::updatePartnerName() @@ -376,14 +402,10 @@ void LLPanelAvatarSecondLife::onClickPartnerHelpLoadURL(S32 option, void* userda //----------------------------------------------------------------------------- // LLPanelAvatarFirstLife() //----------------------------------------------------------------------------- -LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar) -{ -} - - -LLPanelAvatarFirstLife::~LLPanelAvatarFirstLife() +LLPanelAvatarFirstLife::LLPanelAvatarFirstLife(const std::string& name, + const LLRect &rect, + LLPanelAvatar* panel_avatar ) +: LLPanelAvatarTab(name, rect, panel_avatar) { } @@ -405,7 +427,7 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) childSetAction("partner_help",onClickPartnerHelp,this); childSetAction("?",onClickPublishHelp,this); - BOOL own_avatar = (mPanelAvatar->getAvatarID() == gAgent.getID() ); + BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); enableControls(own_avatar); childSetVisible("About:",LLPanelAvatar::sAllowFirstLife); @@ -422,26 +444,30 @@ BOOL LLPanelAvatarSecondLife::postBuild(void) childSetVisible("online_unknown",FALSE); childSetVisible("online_no",FALSE); - childSetAction("Show on Map", LLPanelAvatar::onClickTrack, mPanelAvatar); - childSetAction("Instant Message...", LLPanelAvatar::onClickIM, mPanelAvatar); - childSetAction("Rate...", LLPanelAvatar::onClickRate, mPanelAvatar); - childSetAction("Pay...", LLPanelAvatar::onClickPay, mPanelAvatar); - childSetAction("Mute", LLPanelAvatar::onClickMute, mPanelAvatar ); + childSetAction("Show on Map", LLPanelAvatar::onClickTrack, getPanelAvatar()); + childSetAction("Instant Message...", LLPanelAvatar::onClickIM, getPanelAvatar()); + childSetAction("Rate...", LLPanelAvatar::onClickRate, getPanelAvatar()); + childSetAction("Pay...", LLPanelAvatar::onClickPay, getPanelAvatar()); + childSetAction("Mute", LLPanelAvatar::onClickMute, getPanelAvatar() ); - childSetAction("Offer Teleport...", LLPanelAvatar::onClickOfferTeleport, mPanelAvatar); + childSetAction("Offer Teleport...", LLPanelAvatar::onClickOfferTeleport, + getPanelAvatar() ); childSetDoubleClickCallback("groups", onDoubleClickGroup, this ); return TRUE; } + BOOL LLPanelAvatarFirstLife::postBuild(void) { - BOOL own_avatar = (mPanelAvatar->getAvatarID() == gAgent.getID() ); + BOOL own_avatar = (getPanelAvatar()->getAvatarID() == gAgent.getID() ); enableControls(own_avatar); return TRUE; } + BOOL LLPanelAvatarNotes::postBuild(void) -{ childSetCommitCallback("notes edit",onCommitNotes,this); +{ + childSetCommitCallback("notes edit",onCommitNotes,this); LLTextEditor* te = LLUICtrlFactory::getTextEditorByName(this,"notes edit"); if(te) te->setCommitOnFocusLost(TRUE); @@ -478,6 +504,7 @@ BOOL LLPanelAvatarClassified::postBuild(void) childSetAction("Delete...",onClickDelete,NULL); return TRUE; } + BOOL LLPanelAvatarPicks::postBuild(void) { childSetAction("New...",onClickNew,NULL); @@ -514,9 +541,12 @@ BOOL LLPanelAvatarAdvanced::postBuild() return TRUE; } -LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar), +//----------------------------------------------------------------------------- +// LLPanelAvatarWeb +//----------------------------------------------------------------------------- +LLPanelAvatarWeb::LLPanelAvatarWeb(const std::string& name, const LLRect& rect, + LLPanelAvatar* panel_avatar) +: LLPanelAvatarTab(name, rect, panel_avatar), mWebBrowser(NULL) { } @@ -664,13 +694,14 @@ void LLPanelAvatarWeb::onLocationChange( const EventType& eventIn ) } #endif -LLPanelAvatarAdvanced::LLPanelAvatarAdvanced( - const std::string& name, - const LLRect& rect, - LLPanelAvatar* panel_avatar) - : - LLPanel(name, rect), - mPanelAvatar(panel_avatar), + +//----------------------------------------------------------------------------- +// LLPanelAvatarAdvanced +//----------------------------------------------------------------------------- +LLPanelAvatarAdvanced::LLPanelAvatarAdvanced(const std::string& name, + const LLRect& rect, + LLPanelAvatar* panel_avatar) +: LLPanelAvatarTab(name, rect, panel_avatar), mWantToCount(0), mSkillsCount(0), mWantToEdit( NULL ), @@ -678,13 +709,9 @@ LLPanelAvatarAdvanced::LLPanelAvatarAdvanced( { } -LLPanelAvatarAdvanced::~LLPanelAvatarAdvanced() -{ -} - - void LLPanelAvatarAdvanced::enableControls(BOOL self) -{ int t; +{ + S32 t; for(t=0;t<mWantToCount;t++) { if(mWantToCheck[t])mWantToCheck[t]->setEnabled(self); @@ -770,25 +797,27 @@ void LLPanelAvatarAdvanced::getWantSkills(U32* want_to_mask, std::string& want_t // LLPanelAvatarNotes() //----------------------------------------------------------------------------- LLPanelAvatarNotes::LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar) +: LLPanelAvatarTab(name, rect, panel_avatar) { } -LLPanelAvatarNotes::~LLPanelAvatarNotes() +void LLPanelAvatarNotes::refresh() { + sendAvatarProfileRequestIfNeeded("notes"); } - -void LLPanelAvatarNotes::enableControls(BOOL self) -{ } +void LLPanelAvatarNotes::clearControls() +{ + childSetText("notes edit", "Loading..."); + childSetEnabled("notes edit", false); +} // static void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata) { LLPanelAvatarNotes* self = (LLPanelAvatarNotes*)userdata; - self->mPanelAvatar->sendAvatarNotesUpdate(); + self->getPanelAvatar()->sendAvatarNotesUpdate(); } @@ -797,33 +826,14 @@ void LLPanelAvatarNotes::onCommitNotes(LLUICtrl*, void* userdata) //----------------------------------------------------------------------------- LLPanelAvatarClassified::LLPanelAvatarClassified(const LLString& name, const LLRect& rect, LLPanelAvatar* panel_avatar) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar) -{ -} - - -LLPanelAvatarClassified::~LLPanelAvatarClassified() -{ - // children deleted by view destructor -} - - -void LLPanelAvatarClassified::draw() +: LLPanelAvatarTab(name, rect, panel_avatar) { - if (getVisible()) - { - refresh(); - - LLPanel::draw(); - } } void LLPanelAvatarClassified::refresh() { - BOOL self = (gAgent.getID() == mPanelAvatar->getAvatarID()); - + BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); LLTabContainerCommon* tabs = LLUICtrlFactory::getTabContainerByName(this,"classified tab"); @@ -835,15 +845,12 @@ void LLPanelAvatarClassified::refresh() childSetEnabled("New...",self && allow_new); childSetEnabled("Delete...",self && allow_delete); - childSetVisible("help_text",self && show_help); childSetVisible("classified tab",!show_help); -} - -void LLPanelAvatarClassified::enableControls(BOOL self) -{ + sendAvatarProfileRequestIfNeeded("classifieds"); } + BOOL LLPanelAvatarClassified::titleIsValid() { LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this, "classified tab"); @@ -880,6 +887,10 @@ void LLPanelAvatarClassified::deleteClassifiedPanels() { tabs->deleteAllTabs(); } + + childSetVisible("New...", false); + childSetVisible("Delete...", false); + childSetVisible("loading_text", true); } @@ -923,6 +934,10 @@ void LLPanelAvatarClassified::processAvatarClassifiedReply(LLMessageSystem* msg, { tabs->selectFirstTab(); } + + childSetVisible("New...", true); + childSetVisible("Delete...", true); + childSetVisible("loading_text", false); } @@ -1014,34 +1029,17 @@ void LLPanelAvatarClassified::callbackDelete(S32 option, void* data) //----------------------------------------------------------------------------- // LLPanelAvatarPicks() //----------------------------------------------------------------------------- -LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name, const LLRect& rect, +LLPanelAvatarPicks::LLPanelAvatarPicks(const std::string& name, + const LLRect& rect, LLPanelAvatar* panel_avatar) -: LLPanel(name, rect), - mPanelAvatar(panel_avatar) -{ -} - - -LLPanelAvatarPicks::~LLPanelAvatarPicks() -{ - // children deleted by view destructor -} - - -void LLPanelAvatarPicks::draw() +: LLPanelAvatarTab(name, rect, panel_avatar) { - if (getVisible()) - { - refresh(); - - LLPanel::draw(); - } } void LLPanelAvatarPicks::refresh() { - BOOL self = (gAgent.getID() == mPanelAvatar->getAvatarID()); + BOOL self = (gAgent.getID() == getPanelAvatar()->getAvatarID()); LLTabContainerCommon* tabs = LLViewerUICtrlFactory::getTabContainerByName(this,"picks tab"); S32 tab_count = tabs ? tabs->getTabCount() : 0; @@ -1050,12 +1048,8 @@ void LLPanelAvatarPicks::refresh() childSetEnabled("New...",self && allow_new); childSetEnabled("Delete...",self && allow_delete); -} - -// You are only allowed 10 picks. -void LLPanelAvatarPicks::enableControls(BOOL self) -{ + sendAvatarProfileRequestIfNeeded("picks"); } @@ -1066,8 +1060,11 @@ void LLPanelAvatarPicks::deletePickPanels() { tabs->deleteAllTabs(); } -} + childSetVisible("New...", false); + childSetVisible("Delete...", false); + childSetVisible("loading_text", true); +} void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) { @@ -1110,6 +1107,10 @@ void LLPanelAvatarPicks::processAvatarPicksReply(LLMessageSystem* msg, void**) { tabs->selectFirstTab(); } + + childSetVisible("New...", true); + childSetVisible("Delete...", true); + childSetVisible("loading_text", false); } @@ -1310,7 +1311,14 @@ void LLPanelAvatar::setOnlineStatus(EOnlineStatus online_status) mPanelSecondLife->childSetVisible("online_yes", (online_status == ONLINE_STATUS_YES)); - childSetVisible("Offer Teleport...",TRUE); + // Since setOnlineStatus gets called after setAvatarID + // need to make sure that "Offer Teleport" doesn't get set + // to TRUE again for yourself + if (mAvatarID != gAgent.getID()) + { + childSetVisible("Offer Teleport...",TRUE); + } + BOOL in_prelude = gAgent.inPrelude(); if(gAgent.isGodlike()) { @@ -1352,12 +1360,8 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, mPanelSecondLife->enableControls(own_avatar && mAllowEdit); mPanelWeb->enableControls(own_avatar && mAllowEdit); mPanelAdvanced->enableControls(own_avatar && mAllowEdit); - mPanelPicks->enableControls(own_avatar && mAllowEdit); - mPanelClassified->enableControls(own_avatar && mAllowEdit); // Teens don't have this. if (mPanelFirstLife) mPanelFirstLife->enableControls(own_avatar && mAllowEdit); - mPanelNotes->enableControls(own_avatar && mAllowEdit); - LLView *target_view = getChildByName("drop_target_rect", TRUE); if(target_view) @@ -1371,16 +1375,16 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, mDropTarget->setAgentID(mAvatarID); } - LLNameEditor* NameEdit = LLViewerUICtrlFactory::getNameEditorByName(this, "name"); - if(NameEdit) + LLNameEditor* name_edit = LLViewerUICtrlFactory::getNameEditorByName(this, "name"); + if(name_edit) { if (name.empty()) { - NameEdit->setNameID(avatar_id, FALSE); + name_edit->setNameID(avatar_id, FALSE); } else { - NameEdit->setText(name); + name_edit->setText(name); } } // if (avatar_changed) @@ -1388,9 +1392,19 @@ void LLPanelAvatar::setAvatarID(const LLUUID &avatar_id, const LLString &name, // While we're waiting for data off the network, clear out the // old data. mPanelSecondLife->clearControls(); + mPanelPicks->deletePickPanels(); + mPanelPicks->setDataRequested(false); + mPanelClassified->deleteClassifiedPanels(); + mPanelClassified->setDataRequested(false); + + mPanelNotes->clearControls(); + mPanelNotes->setDataRequested(false); + // Request just the first two pages of data. The picks, + // classifieds, and notes will be requested when that panel + // is made visible. JC sendAvatarPropertiesRequest(); if (own_avatar) @@ -1665,12 +1679,17 @@ void LLPanelAvatar::onClickCancel(void *userdata) if (self) { - self->sendAvatarPropertiesRequest(); LLFloaterAvatarInfo *infop; if ((infop = LLFloaterAvatarInfo::getInstance(self->mAvatarID))) { infop->close(); } + else + { + // We're in the Search directory and are cancelling an edit + // to our own profile, so reset. + self->sendAvatarPropertiesRequest(); + } } } @@ -2161,6 +2180,7 @@ void LLPanelAvatar::processAvatarNotesReply(LLMessageSystem *msg, void**) char text[DB_USER_NOTE_SIZE]; /*Flawfinder: ignore*/ msg->getString("Data", "Notes", DB_USER_NOTE_SIZE, text); self->childSetValue("notes edit", text); + self->childSetEnabled("notes edit", true); } } diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h index 1f4ed7e829..9b1f6e23e1 100644 --- a/indra/newview/llpanelavatar.h +++ b/indra/newview/llpanelavatar.h @@ -40,30 +40,54 @@ enum EOnlineStatus ONLINE_STATUS_YES = 1 }; -class LLPanelAvatarFirstLife -: public LLPanel +// Base class for all sub-tabs inside the avatar profile. Many of these +// panels need to keep track of the parent panel (to get the avatar id) +// and only request data from the database when they are first drawn. JC +class LLPanelAvatarTab : public LLPanel { public: - LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarFirstLife(); - /*virtual*/ BOOL postBuild(void); + LLPanelAvatarTab(const std::string& name, const LLRect &rect, + LLPanelAvatar* panel_avatar); - void enableControls(BOOL own_avatar); + // Calls refresh() once per frame when panel is visible + /*virtual*/ void draw(); -protected: + LLPanelAvatar* getPanelAvatar() const { return mPanelAvatar; } + + void setDataRequested(bool requested) { mDataRequested = requested; } + bool isDataRequested() const { return mDataRequested; } + + // If the data for this tab has not yet been requested, + // send the request. Used by tabs that are filled in only + // when they are first displayed. + // type is one of "notes", "classifieds", "picks" + void sendAvatarProfileRequestIfNeeded(const char* type); + +private: LLPanelAvatar* mPanelAvatar; + bool mDataRequested; +}; + + +class LLPanelAvatarFirstLife : public LLPanelAvatarTab +{ +public: + LLPanelAvatarFirstLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar); + + /*virtual*/ BOOL postBuild(void); + + void enableControls(BOOL own_avatar); }; class LLPanelAvatarSecondLife -: public LLPanel +: public LLPanelAvatarTab { public: LLPanelAvatarSecondLife(const std::string& name, const LLRect &rect, LLPanelAvatar* panel_avatar ); - /*virtual*/ ~LLPanelAvatarSecondLife(); - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(void); + /*virtual*/ void refresh(); static void onClickImage( void *userdata); static void onClickFriends( void *userdata); @@ -80,15 +104,14 @@ public: void setPartnerID(LLUUID id) { mPartnerID = id; } -protected: - LLPanelAvatar* mPanelAvatar; - +private: LLUUID mPartnerID; }; + // WARNING! The order of the inheritance here matters!! Do not change. - KLW class LLPanelAvatarWeb : - public LLPanel + public LLPanelAvatarTab #if LL_LIBXUL_ENABLED , public LLWebBrowserCtrlObserver #endif @@ -115,17 +138,17 @@ public: virtual void onLocationChange( const EventType& eventIn ); #endif -protected: - LLPanelAvatar* mPanelAvatar; +private: std::string mURL; LLWebBrowserCtrl* mWebBrowser; }; -class LLPanelAvatarAdvanced : public LLPanel + +class LLPanelAvatarAdvanced : public LLPanelAvatarTab { public: LLPanelAvatarAdvanced(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarAdvanced(); + /*virtual*/ BOOL postBuild(void); void enableControls(BOOL own_avatar); @@ -136,8 +159,7 @@ public: U32* skills_mask, std::string& skills_text, std::string& languages_text); -protected: - LLPanelAvatar* mPanelAvatar; +private: S32 mWantToCount; S32 mSkillsCount; LLCheckBoxCtrl *mWantToCheck[8]; @@ -147,35 +169,31 @@ protected: }; -class LLPanelAvatarNotes : public LLPanel +class LLPanelAvatarNotes : public LLPanelAvatarTab { public: LLPanelAvatarNotes(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarNotes(); + /*virtual*/ BOOL postBuild(void); - void enableControls(BOOL own_avatar); + /*virtual*/ void refresh(); - static void onCommitNotes(LLUICtrl* field, void* userdata); + void clearControls(); -protected: - LLPanelAvatar* mPanelAvatar; + static void onCommitNotes(LLUICtrl* field, void* userdata); }; -class LLPanelAvatarClassified : public LLPanel +class LLPanelAvatarClassified : public LLPanelAvatarTab { public: LLPanelAvatarClassified(const LLString& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarClassified(); - /*virtual*/ BOOL postBuild(void); - /*virtual*/ void draw(); + /*virtual*/ BOOL postBuild(void); - void refresh(); + /*virtual*/ void refresh(); void apply(); - void enableControls(BOOL own_avatar); BOOL titleIsValid(); @@ -192,23 +210,17 @@ private: static void callbackDelete(S32 option, void* data); static void callbackNew(S32 option, void* data); - -private: - LLPanelAvatar* mPanelAvatar; }; -class LLPanelAvatarPicks : public LLPanel + +class LLPanelAvatarPicks : public LLPanelAvatarTab { public: LLPanelAvatarPicks(const std::string& name, const LLRect& rect, LLPanelAvatar* panel_avatar); - /*virtual*/ ~LLPanelAvatarPicks(); /*virtual*/ BOOL postBuild(void); - /*virtual*/ void draw(); - - void refresh(); - void enableControls(BOOL own_avatar); + /*virtual*/ void refresh(); // Delete all the pick sub-panels from the tab container void deletePickPanels(); @@ -223,9 +235,6 @@ private: static void onClickDelete(void* data); static void callbackDelete(S32 option, void* data); - -private: - LLPanelAvatar* mPanelAvatar; }; diff --git a/indra/newview/llpanelclassified.cpp b/indra/newview/llpanelclassified.cpp index 3cd4082829..2c6cbb9c08 100644 --- a/indra/newview/llpanelclassified.cpp +++ b/indra/newview/llpanelclassified.cpp @@ -743,7 +743,7 @@ void LLPanelClassified::onClickSet(void* data) self->mPosGlobal = gAgent.getPositionGlobal(); LLString location_text; - location_text.assign("(will update after save)"); + location_text.assign("(will update after publish)"); location_text.append(", "); S32 region_x = llround((F32)self->mPosGlobal.mdV[VX]) % REGION_WIDTH_UNITS; diff --git a/indra/newview/llstatusbar.cpp b/indra/newview/llstatusbar.cpp index 47f804129c..c2b496d1ac 100644 --- a/indra/newview/llstatusbar.cpp +++ b/indra/newview/llstatusbar.cpp @@ -190,7 +190,13 @@ void LLStatusBar::draw() { refresh(); - LLView::draw(); + if (mBgVisible) + { + gl_drop_shadow(0, mRect.getHeight(), mRect.getWidth(), 0, + LLUI::sColorsGroup->getColor("ColorDropShadow"), + LLUI::sConfigGroup->getS32("DropShadowFloater") ); + } + LLPanel::draw(); } @@ -243,6 +249,12 @@ void LLStatusBar::refresh() const S32 MENU_RIGHT = gMenuBarView->getRightmostMenuEdge(); S32 x = MENU_RIGHT + MENU_PARCEL_SPACING; S32 y = 0; + + // reshape menu bar to its content's width + if (MENU_RIGHT != gMenuBarView->getRect().getWidth()) + { + gMenuBarView->reshape(MENU_RIGHT, gMenuBarView->getRect().getHeight()); + } LLViewerRegion *region = gAgent.getRegion(); LLParcel *parcel = gParcelMgr->getAgentParcel(); @@ -429,6 +441,7 @@ void LLStatusBar::setVisibleForMouselook(bool visible) mSGBandwidth->setVisible(visible); mSGPacketLoss->setVisible(visible); mBtnBuyCurrency->setVisible(visible); + setBackgroundVisible(visible); } void LLStatusBar::debitBalance(S32 debit) diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 68834fe564..e0b4483224 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -43,6 +43,7 @@ LLToolPie *gToolPie = NULL; LLViewerObject* LLToolPie::sClickActionObject = NULL; +LLHandle<LLObjectSelection> LLToolPie::sLeftClickSelection = NULL; extern void handle_buy(void*); @@ -169,19 +170,19 @@ BOOL LLToolPie::pickAndShowMenu(S32 x, S32 y, MASK mask, BOOL always_show) || parent && parent->flagTakesMoney()) { sClickActionObject = parent; - LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); + sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); return TRUE; } break; case CLICK_ACTION_BUY: sClickActionObject = parent; - LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); + sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); return TRUE; case CLICK_ACTION_OPEN: if (parent && parent->allowOpen()) { sClickActionObject = parent; - LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); + sLeftClickSelection = LLToolSelect::handleObjectSelection(parent, MASK_NONE, FALSE, TRUE); } return TRUE; } @@ -396,10 +397,11 @@ void LLToolPie::selectionPropertiesReceived() return; } - if (sClickActionObject - && !sClickActionObject->isDead()) + if (!sLeftClickSelection->isEmpty()) { - LLViewerObject* root = gSelectMgr->getSelection()->getFirstRootObject(); + LLViewerObject* root = sLeftClickSelection->getFirstRootObject(); + // since we don't currently have a way to lock a selection, it could have changed + // after we initially clicked on the object if (root == sClickActionObject) { U8 action = root->getClickAction(); @@ -419,6 +421,7 @@ void LLToolPie::selectionPropertiesReceived() } } } + sLeftClickSelection = NULL; sClickActionObject = NULL; } diff --git a/indra/newview/lltoolpie.h b/indra/newview/lltoolpie.h index 6826b66ea7..2ae125c76e 100644 --- a/indra/newview/lltoolpie.h +++ b/indra/newview/lltoolpie.h @@ -13,6 +13,7 @@ #include "lluuid.h" class LLViewerObject; +class LLObjectSelection; class LLToolPie : public LLTool @@ -53,6 +54,7 @@ protected: LLUUID mHitObjectID; BOOL mMouseOutsideSlop; // for this drag, has mouse moved outside slop region static LLViewerObject* sClickActionObject; + static LLHandle<LLObjectSelection> sLeftClickSelection; }; extern LLToolPie *gToolPie; diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp index 14ffb00158..1223bc5104 100644 --- a/indra/newview/lltoolselect.cpp +++ b/indra/newview/lltoolselect.cpp @@ -74,7 +74,7 @@ BOOL LLToolSelect::handleDoubleClick(S32 x, S32 y, MASK mask) } // static -void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select) +LLHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select) { BOOL select_owned = gSavedSettings.getBOOL("SelectOwnedOnly"); BOOL select_movable = gSavedSettings.getBOOL("SelectMovableOnly"); @@ -203,6 +203,8 @@ void LLToolSelect::handleObjectSelection(LLViewerObject *object, MASK mask, BOOL gSavedSettings.setBOOL("SelectMovableOnly", select_movable); gSelectMgr->setForceSelection(FALSE); } + + return gSelectMgr->getSelection(); } BOOL LLToolSelect::handleMouseUp(S32 x, S32 y, MASK mask) diff --git a/indra/newview/lltoolselect.h b/indra/newview/lltoolselect.h index db31494834..198e81670a 100644 --- a/indra/newview/lltoolselect.h +++ b/indra/newview/lltoolselect.h @@ -13,6 +13,8 @@ #include "v3math.h" #include "lluuid.h" +class LLObjectSelection; + class LLToolSelect : public LLTool { public: @@ -24,7 +26,7 @@ public: virtual void stopEditing(); - static void handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select); + static LLHandle<LLObjectSelection> handleObjectSelection(LLViewerObject *object, MASK mask, BOOL ignore_group, BOOL temp_select); virtual void onMouseCaptureLost(); virtual void handleDeselect(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c7bd6b51e4..f6873c61b8 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -549,44 +549,6 @@ void init_menus() // Initialize actions initialize_menu_actions(); - gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder); - gMenuBarView->setRect(LLRect(0, top, width, top - MENU_BAR_HEIGHT)); - gViewerWindow->getRootView()->addChild(gMenuBarView); - - // menu holder appears on top of menu bar so you can see the menu title - // flash when an item is triggered (the flash occurs in the holder) - gViewerWindow->getRootView()->addChild(gMenuHolder); - - gMenuHolder->childSetLabelArg("Upload Image", "[COST]", "10"); - gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", "10"); - gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", "10"); - gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", "10"); - - gAFKMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Away", TRUE); - gBusyMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Busy", TRUE); - gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); - gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); - - if (gAgent.mAccess < SIM_ACCESS_MATURE) - { - gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE); - gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE); - } - - // TomY TODO convert these two - LLMenuGL*menu; - menu = new LLMenuGL(CLIENT_MENU_NAME); - init_client_menu(menu); - gMenuBarView->appendMenu( menu ); - menu->updateParent(LLMenuGL::sMenuContainer); - - menu = new LLMenuGL(SERVER_MENU_NAME); - init_server_menu(menu); - gMenuBarView->appendMenu( menu ); - menu->updateParent(LLMenuGL::sMenuContainer); - - gMenuBarView->createJumpKeys(); - /// /// Popup menu /// @@ -629,6 +591,16 @@ void init_menus() /// LLColor4 color; + LLColor4 pie_color = gColors.getColor("PieMenuBgColor"); + gPieSelf->setBackgroundColor( pie_color ); + gPieAvatar->setBackgroundColor( pie_color ); + gPieObject->setBackgroundColor( pie_color ); + gPieAttachment->setBackgroundColor( pie_color ); + gPieLand->setBackgroundColor( pie_color ); + + color = gColors.getColor( "MenuPopupBgColor" ); + gPopupMenuView->setBackgroundColor( color ); + // If we are not in production, use a different color to make it apparent. if (gInProductionGrid) { @@ -638,18 +610,45 @@ void init_menus() { color = gColors.getColor( "MenuNonProductionBgColor" ); } - + gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder); + gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); gMenuBarView->setBackgroundColor( color ); - LLColor4 pie_color = gColors.getColor("PieMenuBgColor"); - gPieSelf->setBackgroundColor( pie_color ); - gPieAvatar->setBackgroundColor( pie_color ); - gPieObject->setBackgroundColor( pie_color ); - gPieAttachment->setBackgroundColor( pie_color ); - gPieLand->setBackgroundColor( pie_color ); + gMenuHolder->addChild(gMenuBarView); + + // menu holder appears on top of menu bar so you can see the menu title + // flash when an item is triggered (the flash occurs in the holder) + gViewerWindow->getRootView()->addChild(gMenuHolder); - color = gColors.getColor( "MenuPopupBgColor" ); - gPopupMenuView->setBackgroundColor( color ); + gMenuHolder->childSetLabelArg("Upload Image", "[COST]", "10"); + gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", "10"); + gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", "10"); + gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", "10"); + + gAFKMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Away", TRUE); + gBusyMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Busy", TRUE); + gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); + gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); + + if (gAgent.mAccess < SIM_ACCESS_MATURE) + { + gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE); + gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE); + } + + // TomY TODO convert these two + LLMenuGL*menu; + menu = new LLMenuGL(CLIENT_MENU_NAME); + init_client_menu(menu); + gMenuBarView->appendMenu( menu ); + menu->updateParent(LLMenuGL::sMenuContainer); + + menu = new LLMenuGL(SERVER_MENU_NAME); + init_server_menu(menu); + gMenuBarView->appendMenu( menu ); + menu->updateParent(LLMenuGL::sMenuContainer); + + gMenuBarView->createJumpKeys(); // Let land based option enable when parcel changes gMenuParcelObserver = new LLMenuParcelObserver(); @@ -2549,10 +2548,12 @@ void set_god_level(U8 god_level) if (gInProductionGrid) { gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarGodBgColor" ) ); + gStatusBar->setBackgroundColor( gColors.getColor( "MenuBarGodBgColor" ) ); } else { gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionGodBgColor" ) ); + gStatusBar->setBackgroundColor( gColors.getColor( "MenuNonProductionGodBgColor" ) ); } LLNotifyBox::showXml("EnteringGodMode", args); } @@ -2562,10 +2563,12 @@ void set_god_level(U8 god_level) if (gInProductionGrid) { gMenuBarView->setBackgroundColor( gColors.getColor( "MenuBarBgColor" ) ); + gStatusBar->setBackgroundColor( gColors.getColor( "MenuBarBgColor" ) ); } else { gMenuBarView->setBackgroundColor( gColors.getColor( "MenuNonProductionBgColor" ) ); + gStatusBar->setBackgroundColor( gColors.getColor( "MenuNonProductionBgColor" ) ); } LLNotifyBox::showXml("LeavingGodMode", args); } diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 10bd3cd102..79db7b72cc 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1613,6 +1613,9 @@ void LLViewerWindow::initWorldUI() gStatusBar->reshape(root_rect.getWidth(), gStatusBar->getRect().getHeight(), TRUE); gStatusBar->translate(0, root_rect.getHeight() - gStatusBar->getRect().getHeight()); + // sync bg color with menu bar + gStatusBar->setBackgroundColor( gMenuBarView->getBackgroundColor() ); + gViewerWindow->getRootView()->addChild(gStatusBar); |