diff --git a/indra/Version b/indra/Version index ee3318d930..7a40912e47 100644 --- a/indra/Version +++ b/indra/Version @@ -1 +1 @@ -VERSION_VIEWER=2.4.2 +VERSION_VIEWER=2.4.1 diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 8bef71acf2..1ba70b95cd 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -248,6 +248,7 @@ LLFloater::LLFloater(const LLSD& key, const LLFloater::Params& p) mHasBeenDraggedWhileMinimized(FALSE), mPreviousMinimizedBottom(0), mPreviousMinimizedLeft(0), + mHideOnMinimize(false), mMinimizeSignal(NULL) // mNotificationContext(NULL) { @@ -918,6 +919,12 @@ void LLFloater::setTitle( const std::string& title ) applyTitle(); } +void LLFloater::setHideOnMinimize(bool hide) +{ + mHideOnMinimize = hide; +} + + std::string LLFloater::getTitle() const { if (mTitle.empty()) @@ -1057,10 +1064,13 @@ void LLFloater::setMinimized(BOOL minimize) { // AO Pseudo-hide minimized sidebar floaters. We get into trouble if they are actually not-visible, // so fake invisibility with offscreen location. - bool isSideTrayTab = false; LLFloater* floater_tab = LLFloaterReg::getInstance("side_bar_tab", getName()); - if (LLFloater::isShown(floater_tab)) - isSideTrayTab = true; + if (LLFloater::isShown(floater_tab)) + { + mHideOnMinimize = true; + llinfos << "SideTray minimized floater " << getName() << " detected, hiding." << llendl; + } + // minimized flag should be turned on before release focus mMinimized = TRUE; @@ -1078,8 +1088,9 @@ void LLFloater::setMinimized(BOOL minimize) { S32 left, bottom; - if (isSideTrayTab) + if (mHideOnMinimize) { + llinfos << "mHideOnMinize: setting origin off screen" << llendl; setOrigin( -9999, -9999 ); } else @@ -1135,11 +1146,18 @@ void LLFloater::setMinimized(BOOL minimize) } // Reshape *after* setting mMinimized - if (isSideTrayTab) - reshape( 0, 0, TRUE); - else + if (mHideOnMinimize) + { + llinfos << "mHideOnMinize - reshaping to be hidden" << llendl; + //LLPanel::reshape(width, height, called_from_parent); + //reshape( 1, 1, TRUE); + reshape( 1, floater_header_size, TRUE); + } + else + { + llinfos << "AO: reshaping to minimized bar" << llendl; reshape( minimized_width, floater_header_size, TRUE); - + } } else { diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 44e7454a0f..315b73e36a 100644 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -178,6 +178,7 @@ public: std::string getTitle() const; void setShortTitle( const std::string& short_title ); std::string getShortTitle() const; + void setHideOnMinimize(bool hide); void setTitleVisible(bool visible); virtual void setMinimized(BOOL b); void moveResizeHandlesToFront(); @@ -389,6 +390,7 @@ private: BOOL mDragOnLeft; BOOL mResizable; bool mOpenCentered; + bool mHideOnMinimize; S32 mMinWidth; S32 mMinHeight; diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 5f7670eb34..43cc109b75 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -32,6 +32,7 @@ #include "llfloater.h" #include "llmultifloater.h" #include "llfloaterreglistener.h" +#include //******************************************************* @@ -135,6 +136,15 @@ LLFloater* LLFloaterReg::getInstance(const std::string& name, const LLSD& key) // Note: key should eventually be a non optional LLFloater arg; for now, set mKey to be safe res->mKey = key; res->setInstanceName(name); + + // handle restored undocked sidebar tabs specially + llinfos << "trying to restore variables for name: " << name << llendl; + std::string pat = "side_bar_tab"; + size_t found = name.find(pat); + if (found!=std::string::npos) + res->setHideOnMinimize(true); + + res->applySavedVariables(); // Can't apply rect and dock state until setting instance name if (res->mAutoTile && !res->getHost() && index > 0) { diff --git a/indra/newview/llcallingcard.cpp b/indra/newview/llcallingcard.cpp index 3616619bc5..0a5648232b 100644 --- a/indra/newview/llcallingcard.cpp +++ b/indra/newview/llcallingcard.cpp @@ -502,6 +502,7 @@ void LLAvatarTracker::addParticularFriendObserver(const LLUUID& buddy_id, LLFrie { if (buddy_id.notNull() && observer) mParticularFriendObserverMap[buddy_id].insert(observer); + llinfos << "AO DEBUG: postAdd: ob_it->second.size=" << mParticularFriendObserverMap[buddy_id].size() << llendl; } void LLAvatarTracker::removeParticularFriendObserver(const LLUUID& buddy_id, LLFriendObserver* observer) @@ -511,12 +512,19 @@ void LLAvatarTracker::removeParticularFriendObserver(const LLUUID& buddy_id, LLF observer_map_t::iterator obs_it = mParticularFriendObserverMap.find(buddy_id); if(obs_it == mParticularFriendObserverMap.end()) - return; - + { + llinfos << "AO DEBUG: preremove: no observers found, skipping." << llendl; + return; + } + + llinfos << "AO DEBUG: preremove: ob_it->second.size=" << obs_it->second.size() << llendl; obs_it->second.erase(observer); + llinfos << "AO DEBUG: postremove: ob_it->second.size=" << obs_it->second.size() << llendl; // purge empty sets from the map - if (obs_it->second.size() == 0) + // AO: Remove below check as last resort to resolve a crash from dangling pointer. + // TODO: clean up all observers and don't leave dangling pointers here. + if (obs_it->second.size() == 0) mParticularFriendObserverMap.erase(obs_it); } @@ -528,6 +536,7 @@ void LLAvatarTracker::notifyParticularFriendObservers(const LLUUID& buddy_id) // Notify observers interested in buddy_id. observer_set_t& obs = obs_it->second; + llinfos << "AO DEBUG: notifying particularFriends, size=" << obs_it->second.size() << llendl; for (observer_set_t::iterator ob_it = obs.begin(); ob_it != obs.end(); ob_it++) { if (*ob_it) diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp index e18f471246..1b614dd171 100644 --- a/indra/newview/llimfloater.cpp +++ b/indra/newview/llimfloater.cpp @@ -155,6 +155,22 @@ void LLIMFloater::onClose(bool app_quitting) // // Last change: // EXT-3516 X Button should end IM session, _ button should hide + + + // AO: Make sure observers are removed on close + mVoiceChannelStateChangeConnection.disconnect(); + if(LLVoiceClient::instanceExists()) + { + LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); + } + + LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID); + if ((pIMSession) && (pIMSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION)) + { + llinfos << "AO: Cleaning up stray particularFriendObservers" << llendl; + LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); + } + gIMMgr->leaveSession(mSessionID); } @@ -298,6 +314,13 @@ LLIMFloater::~LLIMFloater() { LLVoiceClient::getInstance()->removeObserver((LLVoiceClientStatusObserver*)this); } + + LLIMModel::LLIMSession* pIMSession = LLIMModel::instance().findIMSession(mSessionID); + if ((pIMSession) && (pIMSession->mSessionType == LLIMModel::LLIMSession::P2P_SESSION)) + { + llinfos << "AO: Cleaning up stray particularFriendObservers" << llendl; + LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); + } } // Callbacks previously in llcontrol_panel, moved to this floater. @@ -519,9 +542,10 @@ BOOL LLIMFloater::postBuild() getChild("voice_ctrls_btn_panel")->setVisible(false); getChild("ls_control_panel")->reshape(180,20,true); - + llinfos << "AO: adding llimfloater removing/adding particularfriendobserver" << llendl; LLAvatarTracker::instance().removeParticularFriendObserver(mOtherParticipantUUID, this); LLAvatarTracker::instance().addParticularFriendObserver(mOtherParticipantUUID, this); + // Disable "Add friend" button for friends. llinfos << "add_friend_btn check start" << llendl; getChild("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mOtherParticipantUUID)); diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp index 0cc5dcda82..cb3e86b028 100644 --- a/indra/newview/llpanelimcontrolpanel.cpp +++ b/indra/newview/llpanelimcontrolpanel.cpp @@ -107,20 +107,21 @@ void LLPanelChatControlPanel::updateButtons(bool is_call_started) LLPanelChatControlPanel::~LLPanelChatControlPanel() { - mVoiceChannelStateChangeConnection.disconnect(); - if(LLVoiceClient::instanceExists()) - { - LLVoiceClient::getInstance()->removeObserver(this); - } + // AO: Now handled by main im floater + //mVoiceChannelStateChangeConnection.disconnect(); + //if(LLVoiceClient::instanceExists()) + //{ + // LLVoiceClient::getInstance()->removeObserver(this); + //} } BOOL LLPanelChatControlPanel::postBuild() { - childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); - childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); - childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this)); - - LLVoiceClient::getInstance()->addObserver(this); + // AO: Now handled by main im floater + //childSetAction("call_btn", boost::bind(&LLPanelChatControlPanel::onCallButtonClicked, this)); + //childSetAction("end_call_btn", boost::bind(&LLPanelChatControlPanel::onEndCallButtonClicked, this)); + //childSetAction("voice_ctrls_btn", boost::bind(&LLPanelChatControlPanel::onOpenVoiceControlsClicked, this)); + //LLVoiceClient::getInstance()->addObserver(this); return TRUE; } @@ -129,14 +130,16 @@ void LLPanelChatControlPanel::setSessionId(const LLUUID& session_id) { //Method is called twice for AdHoc and Group chat. Second time when server init reply received mSessionId = session_id; - LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId); - if(voice_channel) - { - mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); - - //call (either p2p, group or ad-hoc) can be already in started state - updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); - } + + // AO: Now handled by main im floater + //LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(mSessionId); + //if(voice_channel) + //{ + // mVoiceChannelStateChangeConnection = voice_channel->setStateChangedCallback(boost::bind(&LLPanelChatControlPanel::onVoiceChannelStateChanged, this, _1, _2)); + // + // //call (either p2p, group or ad-hoc) can be already in started state + // updateButtons(voice_channel->getState() >= LLVoiceChannel::STATE_CALL_STARTED); + //} } LLPanelIMControlPanel::LLPanelIMControlPanel() @@ -145,18 +148,19 @@ LLPanelIMControlPanel::LLPanelIMControlPanel() LLPanelIMControlPanel::~LLPanelIMControlPanel() { - LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); + // AO: Now handled by main im floater + //LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); } BOOL LLPanelIMControlPanel::postBuild() { - childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this)); - childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this)); - - childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); - childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); - childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); - getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); + // AO: Now handled by main im floater + //childSetAction("view_profile_btn", boost::bind(&LLPanelIMControlPanel::onViewProfileButtonClicked, this)); + //childSetAction("add_friend_btn", boost::bind(&LLPanelIMControlPanel::onAddFriendButtonClicked, this)); + //childSetAction("share_btn", boost::bind(&LLPanelIMControlPanel::onShareButtonClicked, this)); + //childSetAction("teleport_btn", boost::bind(&LLPanelIMControlPanel::onTeleportButtonClicked, this)); + //childSetAction("pay_btn", boost::bind(&LLPanelIMControlPanel::onPayButtonClicked, this)); + //getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(getChild("avatar_icon")->getAvatarId())); setFocusReceivedCallback(boost::bind(&LLPanelIMControlPanel::onFocusReceived, this)); @@ -204,43 +208,44 @@ void LLPanelIMControlPanel::setSessionId(const LLUUID& session_id) LLIMModel& im_model = LLIMModel::instance(); - LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); + // AO: Now handled by main im floater + //LLAvatarTracker::instance().removeParticularFriendObserver(mAvatarID, this); mAvatarID = im_model.getOtherParticipantID(session_id); - LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); + //LLAvatarTracker::instance().addParticularFriendObserver(mAvatarID, this); // Disable "Add friend" button for friends. - getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); + //getChildView("add_friend_btn")->setEnabled(!LLAvatarActions::isFriend(mAvatarID)); // Disable "Teleport" button if friend is offline - if(LLAvatarActions::isFriend(mAvatarID)) - { - getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); - } + //if(LLAvatarActions::isFriend(mAvatarID)) + //{ + // getChildView("teleport_btn")->setEnabled(LLAvatarTracker::instance().isBuddyOnline(mAvatarID)); + //} - getChild("avatar_icon")->setValue(mAvatarID); + //getChild("avatar_icon")->setValue(mAvatarID); // Disable most profile buttons if the participant is // not really an SL avatar (e.g., an Avaline caller). - LLIMModel::LLIMSession* im_session = - im_model.findIMSession(session_id); - if( im_session && !im_session->mOtherParticipantIsAvatar ) - { - getChildView("view_profile_btn")->setEnabled(FALSE); - getChildView("add_friend_btn")->setEnabled(FALSE); + //LLIMModel::LLIMSession* im_session = + // im_model.findIMSession(session_id); + //if( im_session && !im_session->mOtherParticipantIsAvatar ) + //{ + // getChildView("view_profile_btn")->setEnabled(FALSE); + // getChildView("add_friend_btn")->setEnabled(FALSE); - getChildView("share_btn")->setEnabled(FALSE); - getChildView("teleport_btn")->setEnabled(FALSE); - getChildView("pay_btn")->setEnabled(FALSE); + // getChildView("share_btn")->setEnabled(FALSE); + // getChildView("teleport_btn")->setEnabled(FALSE); + // getChildView("pay_btn")->setEnabled(FALSE); - getChild("avatar_name")->setValue(im_session->mName); - getChild("avatar_name")->setToolTip(im_session->mName); - } - else - { - // If the participant is an avatar, fetch the currect name - gCacheName->get(mAvatarID, false, - boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3)); - } + // getChild("avatar_name")->setValue(im_session->mName); + // getChild("avatar_name")->setToolTip(im_session->mName); + //} + //else + //{ + // // If the participant is an avatar, fetch the currect name + // gCacheName->get(mAvatarID, false, + // boost::bind(&LLPanelIMControlPanel::onNameCache, this, _1, _2, _3)); + //} } //virtual @@ -272,7 +277,7 @@ mParticipantList(NULL) BOOL LLPanelGroupControlPanel::postBuild() { - childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); + //childSetAction("group_info_btn", boost::bind(&LLPanelGroupControlPanel::onGroupInfoButtonClicked, this)); return LLPanelChatControlPanel::postBuild(); } diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp index c3376ea344..a9c3017ac8 100644 --- a/indra/newview/llsidetray.cpp +++ b/indra/newview/llsidetray.cpp @@ -213,8 +213,10 @@ void LLSideTrayTab::toggleTabDocked() // bool docking = LLFloater::isShown(floater_tab); // [RLVa:KB] - Checked: 2010-12-14 (RLVa-1.2.2c) | Added: RLVa-1.2.2c - if (floater_tab->isMinimized()) - floater_tab->setMinimized(FALSE); + +// AO: Don't change minimized state. We want it preserved. +// if (floater_tab->isMinimized()) +// floater_tab->setMinimized(FALSE); LLSideTray* pSideTray = getSideTray(); if (!pSideTray) return;