diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/llimconversation.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llimfloatercontainer.h | 2 | ||||
-rw-r--r-- | indra/newview/llnearbychat.cpp | 22 | ||||
-rw-r--r-- | indra/newview/llnearbychat.h | 2 | ||||
-rw-r--r-- | indra/newview/llspeakers.cpp | 2 | ||||
-rw-r--r-- | indra/newview/llvoicevivox.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llvoicevivox.h | 2 |
8 files changed, 52 insertions, 20 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index 827059513f..51e4fbfe19 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -219,10 +219,6 @@ BOOL LLIMConversation::postBuild() if (isChatMultiTab()) { - if (mIsNearbyChat) - { - setCanClose(FALSE); - } result = LLFloater::postBuild(); } else diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp index c2ad94c423..df2491acbd 100644 --- a/indra/newview/llimfloatercontainer.cpp +++ b/indra/newview/llimfloatercontainer.cpp @@ -1528,4 +1528,11 @@ void LLIMFloaterContainer::openNearbyChat() } } +void LLIMFloaterContainer::onNearbyChatClosed() +{ + // If nearby chat is the only remaining conversation and it is closed, close whole conversation floater as well + if (mConversationsItems.size() == 1) + closeFloater(); +} + // EOF diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h index 25387fe83b..691bc39811 100644 --- a/indra/newview/llimfloatercontainer.h +++ b/indra/newview/llimfloatercontainer.h @@ -94,6 +94,8 @@ public: LLUUID getSelectedSession() { return mSelectedSession; } void setSelectedSession(LLUUID sessionID) { mSelectedSession = sessionID; } + void onNearbyChatClosed(); + private: typedef std::map<LLUUID,LLFloater*> avatarID_panel_map_t; avatarID_panel_map_t mSessions; diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index a30d8b685e..dbdf460785 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -287,7 +287,7 @@ void LLNearbyChat::setVisible(BOOL visible) setFocus(visible); } - +// virtual void LLNearbyChat::onTearOffClicked() { LLIMConversation::onTearOffClicked(); @@ -305,6 +305,26 @@ void LLNearbyChat::onOpen(const LLSD& key) showTranslationCheckbox(LLTranslate::isTranslationConfigured()); } +// virtual +void LLNearbyChat::onClose(bool app_quitting) +{ + // Override LLIMConversation::onClose() so that Nearby Chat is not removed from the conversation floater +} + +// virtual +void LLNearbyChat::onClickCloseBtn() +{ + if (!isTornOff()) + return; + onTearOffClicked(); + + LLIMFloaterContainer *im_box = LLIMFloaterContainer::findInstance(); + if (im_box) + { + im_box->onNearbyChatClosed(); + } +} + void LLNearbyChat::onChatFontChange(LLFontGL* fontp) { // Update things with the new font whohoo diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h index 11346a313c..c6a2637e8f 100644 --- a/indra/newview/llnearbychat.h +++ b/indra/newview/llnearbychat.h @@ -52,6 +52,7 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void setVisible(BOOL visible); void loadHistory(); @@ -95,6 +96,7 @@ protected: void onChatFontChange(LLFontGL* fontp); /*virtual*/ void onTearOffClicked(); + /*virtual*/ void onClickCloseBtn(); static LLWString stripChannelNumber(const LLWString &mesg, S32* channel); EChatType processChatTypeTriggers(EChatType type, std::string &str); diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp index 46fd8c1290..726199b7aa 100644 --- a/indra/newview/llspeakers.cpp +++ b/indra/newview/llspeakers.cpp @@ -504,7 +504,7 @@ void LLSpeakerMgr::update(BOOL resort_ok) void LLSpeakerMgr::updateSpeakerList() { // are we bound to the currently active voice channel? - if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive())) + if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel)) { std::set<LLUUID> participants; LLVoiceClient::getInstance()->getParticipantList(participants); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index f1bf4a6d75..839de395a7 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -291,6 +291,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mCaptureDeviceDirty(false), mRenderDeviceDirty(false), mSpatialCoordsDirty(false), + mIsInitialized(false), mMuteMic(false), mMuteMicDirty(false), @@ -520,7 +521,7 @@ void LLVivoxVoiceClient::requestVoiceAccountProvision(S32 retries) { LLViewerRegion *region = gAgent.getRegion(); - if ( region && mVoiceEnabled ) + if ( region && (mVoiceEnabled || !mIsInitialized)) { std::string url = region->getCapability("ProvisionVoiceAccountRequest"); @@ -691,7 +692,7 @@ void LLVivoxVoiceClient::stateMachine() setVoiceEnabled(false); } - if(mVoiceEnabled) + if(mVoiceEnabled || !mIsInitialized) { updatePosition(); } @@ -736,7 +737,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateDisabled case stateDisabled: - if(mTuningMode || (mVoiceEnabled && !mAccountName.empty())) + if(mTuningMode || ((mVoiceEnabled || !mIsInitialized) && !mAccountName.empty())) { setState(stateStart); } @@ -891,7 +892,7 @@ void LLVivoxVoiceClient::stateMachine() mTuningExitState = stateIdle; setState(stateMicTuningStart); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // We never started up the connector. This will shut down the daemon. setState(stateConnectorStopped); @@ -1085,7 +1086,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStart case stateConnectorStart: - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1103,7 +1104,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateConnectorStarted case stateConnectorStarted: // connector handle received - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // We were never logged in. This will shut down the connector. setState(stateLoggedOut); @@ -1247,7 +1248,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateCreatingSessionGroup case stateCreatingSessionGroup: - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // *TODO: Question: is this the right way out of this state setState(stateSessionTerminated); @@ -1263,7 +1264,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRetrievingParcelVoiceInfo case stateRetrievingParcelVoiceInfo: // wait until parcel voice info is received. - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // if a terminate request has been received, // bail and go to the stateSessionTerminated @@ -1283,7 +1284,7 @@ void LLVivoxVoiceClient::stateMachine() // Otherwise, if you log in but don't join a proximal channel (such as when your login location has voice disabled), your friends list won't sync. sendFriendsListUpdates(); - if(mSessionTerminateRequested || !mVoiceEnabled) + if(mSessionTerminateRequested || !mVoiceEnabled && mIsInitialized) { // TODO: Question: Is this the right way out of this state? setState(stateSessionTerminated); @@ -1364,7 +1365,7 @@ void LLVivoxVoiceClient::stateMachine() } // joinedAudioSession() will transition from here to stateSessionJoined. - if(!mVoiceEnabled) + if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1411,7 +1412,7 @@ void LLVivoxVoiceClient::stateMachine() notifyStatusObservers(LLVoiceClientStatusObserver::STATUS_JOINED); } - else if(!mVoiceEnabled) + else if(!mVoiceEnabled && mIsInitialized) { // User bailed out during connect -- jump straight to teardown. setState(stateSessionTerminated); @@ -1431,7 +1432,7 @@ void LLVivoxVoiceClient::stateMachine() //MARK: stateRunning case stateRunning: // steady state // Disabling voice or disconnect requested. - if(!mVoiceEnabled || mSessionTerminateRequested) + if(!mVoiceEnabled && mIsInitialized || mSessionTerminateRequested) { leaveAudioSession(); } @@ -1478,6 +1479,8 @@ void LLVivoxVoiceClient::stateMachine() mUpdateTimer.setTimerExpirySec(UPDATE_THROTTLE_SECONDS); sendPositionalUpdate(); } + + mIsInitialized = true; } break; @@ -1511,7 +1514,7 @@ void LLVivoxVoiceClient::stateMachine() // Always reset the terminate request flag when we get here. mSessionTerminateRequested = false; - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // Just leaving a channel, go back to stateNoChannel (the "logged in but have no channel" state). setState(stateNoChannel); @@ -1539,7 +1542,7 @@ void LLVivoxVoiceClient::stateMachine() mAccountHandle.clear(); cleanUp(); - if(mVoiceEnabled && !mRelogRequested) + if((mVoiceEnabled || !mIsInitialized) && !mRelogRequested) { // User was logged out, but wants to be logged in. Send a new login request. setState(stateNeedsLogin); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index 1142a1a49c..f2a3a7d3dd 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -741,6 +741,8 @@ private: std::string mRenderDevice; bool mCaptureDeviceDirty; bool mRenderDeviceDirty; + + bool mIsInitialized; bool checkParcelChanged(bool update = false); |