Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.

meow-7.2.2
William Todd Stinson 2012-11-08 12:38:09 -08:00
commit a312498260
26 changed files with 167 additions and 101 deletions

View File

@ -410,8 +410,8 @@ void LLFolderViewItem::selectItem(void)
{
if (mIsSelected == FALSE)
{
getViewModelItem()->selectItem();
mIsSelected = TRUE;
getViewModelItem()->selectItem();
}
}

View File

@ -203,6 +203,17 @@ void LLConversationViewSession::draw()
LLView::draw();
}
BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
{
LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem());
LLUUID session_id = item? item->getUUID() : LLUUID();
(LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
selectConversationPair(session_id, false);
return LLFolderViewFolder::handleMouseDown(x, y, mask);
}
// virtual
S32 LLConversationViewSession::arrange(S32* width, S32* height)
{
@ -233,29 +244,6 @@ void LLConversationViewSession::toggleOpen()
}
}
void LLConversationViewSession::selectItem()
{
LLConversationItem* item = dynamic_cast<LLConversationItem*>(mViewModelItem);
LLFloater* session_floater = LLIMConversation::getConversation(item->getUUID());
LLMultiFloater* host_floater = session_floater->getHost();
if (host_floater == mContainer)
{
// Always expand the message pane if the panel is hosted by the container
mContainer->collapseMessagesPane(false);
// Switch to the conversation floater that is being selected
mContainer->selectFloater(session_floater);
}
// Set the focus on the selected floater
session_floater->setFocus(TRUE);
// Store the active session
LLIMFloaterContainer::getInstance()->setSelectedSession(item->getUUID());
LLFolderViewItem::selectItem();
}
void LLConversationViewSession::toggleMinimizedMode(bool is_minimized)
{
@ -441,31 +429,6 @@ void LLConversationViewParticipant::draw()
LLView::draw();
}
void LLConversationViewParticipant::selectItem()
{
LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL;
LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance();
LLFloater* session_floater;
if(vmi)
{
session_floater = LLIMConversation::getConversation(vmi->getUUID());
//Only execute when switching floaters (conversations)
if(vmi->getUUID() != container->getSelectedSession())
{
container->selectFloater(session_floater);
// Store the active session
container->setSelectedSession(vmi->getUUID());
}
//Redirect focus to the conversation floater
session_floater->setFocus(TRUE);
}
LLFolderViewItem::selectItem();
}
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
@ -514,6 +477,23 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
LLFolderViewItem::onMouseLeave(x, y, mask);
}
BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
{
LLConversationItem* item = NULL;
LLConversationViewSession* session_widget =
dynamic_cast<LLConversationViewSession *>(this->getParentFolder());
if (session_widget)
{
item = dynamic_cast<LLConversationItem*>(session_widget->getViewModelItem());
}
LLUUID session_id = item? item->getUUID() : LLUUID();
(LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
selectConversationPair(session_id, false);
return LLFolderViewItem::handleMouseDown(x, y, mask);
}
S32 LLConversationViewParticipant::getLabelXPos()
{
return mAvatarIcon->getRect().mRight + mIconPad;

View File

@ -60,10 +60,10 @@ protected:
public:
virtual ~LLConversationViewSession();
virtual void selectItem();
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
/*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
/*virtual*/ S32 arrange(S32* width, S32* height);
@ -117,11 +117,13 @@ public:
};
virtual ~LLConversationViewParticipant( void ) { }
void selectItem();
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
virtual void refresh();
void addToFolder(LLFolderViewFolder* folder);
/*virtual*/ BOOL handleMouseDown( S32 x, S32 y, MASK mask );
void onMouseEnter(S32 x, S32 y, MASK mask);
void onMouseLeave(S32 x, S32 y, MASK mask);

View File

@ -128,6 +128,22 @@ void LLIMConversation::setVisible(BOOL visible)
setFocus(visible);
}
/*virtual*/
void LLIMConversation::setFocus(BOOL focus)
{
LLTransientDockableFloater::setFocus(focus);
//Redirect focus to input editor
if (focus)
{
updateMessages();
if (mInputEditor)
{
mInputEditor->setFocus(TRUE);
}
}
}
void LLIMConversation::addToHost(const LLUUID& session_id)
@ -203,10 +219,6 @@ BOOL LLIMConversation::postBuild()
if (isChatMultiTab())
{
if (mIsNearbyChat)
{
setCanClose(FALSE);
}
result = LLFloater::postBuild();
}
else
@ -247,7 +259,6 @@ void LLIMConversation::enableDisableCallBtn()
&& mSession->mCallBackEnabled);
}
void LLIMConversation::onFocusReceived()
{
setBackgroundOpaque(true);
@ -258,6 +269,12 @@ void LLIMConversation::onFocusReceived()
}
LLTransientDockableFloater::onFocusReceived();
LLIMFloaterContainer* container = LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container");
if (container)
{
container->selectConversationPair(mSessionID, true);
}
}
void LLIMConversation::onFocusLost()

View File

@ -79,7 +79,9 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void draw();
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ void setFocus(BOOL focus);
virtual void updateMessages() {}
protected:

View File

@ -671,19 +671,6 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
}
}
void LLIMFloater::setFocus(BOOL focusFlag)
{
LLTransientDockableFloater::setFocus(focusFlag);
//Redirect focus to input editor
if (focusFlag)
{
updateMessages();
mInputEditor->setFocus(TRUE);
}
}
void LLIMFloater::setVisible(BOOL visible)
{
LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*>

View File

@ -65,7 +65,6 @@ public:
// LLView overrides
/*virtual*/ BOOL postBuild();
/*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ BOOL getVisible();
// Check typing timeout timer.
@ -86,7 +85,7 @@ public:
void sessionInitReplyReceived(const LLUUID& im_session_id);
// get new messages from LLIMModel
void updateMessages();
/*virtual*/ void updateMessages();
void reloadMessages();
static void onSendMsg(LLUICtrl*, void*);
void sendMsgFromInputEditor();

View File

@ -1091,6 +1091,47 @@ void LLIMFloaterContainer::selectConversation(const LLUUID& session_id)
}
}
// Synchronous select the conversation item and the conversation floater
BOOL LLIMFloaterContainer::selectConversationPair(const LLUUID& session_id, bool select_widget)
{
BOOL handled = TRUE;
/* widget processing */
if (select_widget)
{
LLFolderViewItem* widget = mConversationsWidgets[session_id];
if (widget && widget->getParentFolder())
{
widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
}
}
/* floater processing */
if (session_id != getSelectedSession())
{
// Store the active session
setSelectedSession(session_id);
LLIMConversation* session_floater = LLIMConversation::getConversation(session_id);
if (session_floater->getHost())
{
// Always expand the message pane if the panel is hosted by the container
collapseMessagesPane(false);
// Switch to the conversation floater that is being selected
selectFloater(session_floater);
}
// Set the focus on the selected floater
if (!session_floater->hasFocus())
{
session_floater->setFocus(TRUE);
}
}
return handled;
}
void LLIMFloaterContainer::setTimeNow(const LLUUID& session_id, const LLUUID& participant_id)
{
@ -1487,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

View File

@ -68,6 +68,8 @@ public:
void showConversation(const LLUUID& session_id);
void selectConversation(const LLUUID& session_id);
BOOL selectConversationPair(const LLUUID& session_id, bool select_widget);
/*virtual*/ void tabClose();
static LLFloater* getCurrentVoiceFloater();
@ -92,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;

View File

@ -121,7 +121,14 @@ void toast_callback(const LLSD& msg){
// Skip toasting if we have open window of IM with this session id
LLIMFloater* open_im_floater = LLIMFloater::findInstance(msg["session_id"]);
if (open_im_floater && open_im_floater->isInVisibleChain() && open_im_floater->hasFocus())
if (
open_im_floater
&& open_im_floater->isInVisibleChain()
&& open_im_floater->hasFocus()
&& !open_im_floater->isMinimized()
&& !(open_im_floater->getHost()
&& open_im_floater->getHost()->isMinimized())
)
{
return;
}

View File

@ -195,8 +195,13 @@ BOOL LLNearbyChat::handleMouseDown(S32 x, S32 y, MASK mask)
//background opaque. This all happenn since NearByChat is "chrome" and didn't process focus change.
if(mChatHistory)
{
mChatHistory->setFocus(TRUE);
return LLPanel::handleMouseDown(x, y, mask);
}
BOOL handled = LLPanel::handleMouseDown(x, y, mask);
setFocus(handled);
return handled;
}
void LLNearbyChat::reloadMessages()
@ -270,17 +275,6 @@ void LLNearbyChat::removeScreenChat()
}
}
void LLNearbyChat::setFocus(BOOL focusFlag)
{
LLTransientDockableFloater::setFocus(focusFlag);
//Redirect focus to input editor
if (focusFlag)
{
mInputEditor->setFocus(TRUE);
}
}
void LLNearbyChat::setVisible(BOOL visible)
{
@ -293,7 +287,7 @@ void LLNearbyChat::setVisible(BOOL visible)
setFocus(visible);
}
// virtual
void LLNearbyChat::onTearOffClicked()
{
LLIMConversation::onTearOffClicked();
@ -311,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

View File

@ -52,7 +52,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
/*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void onClose(bool app_quitting);
/*virtual*/ void setVisible(BOOL visible);
void loadHistory();
@ -96,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);

View File

@ -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);

View File

@ -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);

View File

@ -741,6 +741,8 @@ private:
std::string mRenderDevice;
bool mCaptureDeviceDirty;
bool mRenderDeviceDirty;
bool mIsInitialized;
bool checkParcelChanged(bool update = false);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 322 B

After

Width:  |  Height:  |  Size: 373 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 301 B

After

Width:  |  Height:  |  Size: 215 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 293 B

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 262 B

After

Width:  |  Height:  |  Size: 275 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 663 B

After

Width:  |  Height:  |  Size: 345 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 662 B

After

Width:  |  Height:  |  Size: 342 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 460 B

After

Width:  |  Height:  |  Size: 459 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 485 B

After

Width:  |  Height:  |  Size: 366 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 553 B

After

Width:  |  Height:  |  Size: 399 B