summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Todd Stinson <stinson@lindenlab.com>2012-11-12 10:36:21 -0800
committerWilliam Todd Stinson <stinson@lindenlab.com>2012-11-12 10:36:21 -0800
commit7833ecb58094641d3cd79c6772ad6c9fd4799f92 (patch)
treeb8c8829f735b4baa56da52b65d31d9265004e375
parentc9044c03b3157c330a0b3b640bfce6bacc0c9343 (diff)
parentab5a0a1d4d0a029dd92c9fc108638736a57ce7c6 (diff)
Pull and merge from ssh://stinson@hg.lindenlab.com/richard/viewer-chui/.
-rw-r--r--indra/llui/lltabcontainer.cpp11
-rw-r--r--indra/llui/lltabcontainer.h3
-rw-r--r--indra/newview/llfloaterimcontainer.cpp26
-rw-r--r--indra/newview/llfloaterimcontainer.h5
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp22
-rw-r--r--indra/newview/llfloaterimsessiontab.h2
-rw-r--r--indra/newview/llspeakers.cpp26
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml42
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml26
9 files changed, 123 insertions, 40 deletions
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index d0920685bf..c24eb2ee90 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1556,6 +1556,17 @@ BOOL LLTabContainer::setTab(S32 which)
return is_visible;
}
+
+void LLTabContainer::hideAllTabs()
+{
+ setCurrentPanelIndex(-1);
+ for(tuple_list_t::iterator iter = mTabList.begin(); iter != mTabList.end(); ++iter)
+ {
+ (* iter)->mTabPanel->setVisible(FALSE);
+ }
+}
+
+
BOOL LLTabContainer::selectTabByName(const std::string& name)
{
LLPanel* panel = getPanelByName(name);
diff --git a/indra/llui/lltabcontainer.h b/indra/llui/lltabcontainer.h
index cebace2ceb..a9cdf22b16 100644
--- a/indra/llui/lltabcontainer.h
+++ b/indra/llui/lltabcontainer.h
@@ -188,10 +188,11 @@ public:
void selectFirstTab();
void selectLastTab();
void selectNextTab();
- void selectPrevTab();
+ void selectPrevTab();
BOOL selectTabPanel( LLPanel* child );
BOOL selectTab(S32 which);
BOOL selectTabByName(const std::string& title);
+ void hideAllTabs();
BOOL getTabPanelFlashing(LLPanel* child);
void setTabPanelFlashing(LLPanel* child, BOOL state);
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index b20d19d0fd..2707e3dcbb 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -133,7 +133,6 @@ void LLFloaterIMContainer::onCurrentChannelChanged(const LLUUID& session_id)
}
}
-
BOOL LLFloaterIMContainer::postBuild()
{
mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLFloaterIMContainer::onNewMessageReceived, this, _1));
@@ -141,6 +140,9 @@ BOOL LLFloaterIMContainer::postBuild()
// mTabContainer will be initialized in LLMultiFloater::addChild()
setTabContainer(getChild<LLTabContainer>("im_box_tab_container"));
+ mStubPanel = getChild<LLPanel>("stub_panel");
+ mStubTextBox = getChild<LLTextBox>("stub_textbox_2");
+ mStubTextBox->setURLClickedCallback(boost::bind(&LLFloaterIMContainer::returnFloaterToHost, this));
mConversationsStack = getChild<LLLayoutStack>("conversations_stack");
mConversationsPane = getChild<LLLayoutPanel>("conversations_layout_panel");
@@ -494,6 +496,24 @@ void LLFloaterIMContainer::tabClose()
}
}
+void LLFloaterIMContainer::showStub(bool stub_is_visible)
+{
+ if (stub_is_visible)
+ {
+ mTabContainer->hideAllTabs();
+ }
+
+ mStubPanel->setVisible(stub_is_visible);
+}
+
+// listener for click on mStubTextBox2
+void LLFloaterIMContainer::returnFloaterToHost()
+{
+ LLUUID session_id = this->getSelectedSession();
+ LLFloaterIMSessionTab* floater = LLFloaterIMSessionTab::getConversation(session_id);
+ floater->onTearOffClicked();
+}
+
void LLFloaterIMContainer::setVisible(BOOL visible)
{ LLFloaterIMNearbyChat* nearby_chat;
if (visible)
@@ -1126,7 +1146,7 @@ BOOL LLFloaterIMContainer::selectConversationPair(const LLUUID& session_id, bool
/* widget processing */
if (select_widget)
{
- LLFolderViewItem* widget = mConversationsWidgets[session_id];
+ LLFolderViewItem* widget = get_ptr_in_map(mConversationsWidgets,session_id);
if (widget && widget->getParentFolder())
{
widget->getParentFolder()->setSelection(widget, FALSE, FALSE);
@@ -1539,7 +1559,7 @@ void LLFloaterIMContainer::openNearbyChat()
//(which it should be...), open it so to make the list of participants visible. This happens to be the most common case when opening the Chat floater.
if(mConversationsItems.size() == 1)
{
- LLConversationViewSession* nearby_chat = dynamic_cast<LLConversationViewSession*>(mConversationsWidgets[LLUUID()]);
+ LLConversationViewSession* nearby_chat = dynamic_cast<LLConversationViewSession*>(get_ptr_in_map(mConversationsWidgets,LLUUID()));
if (nearby_chat)
{
nearby_chat->setOpen(TRUE);
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index f65e946dad..e60576a50d 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -65,12 +65,13 @@ public:
/*virtual*/ void addFloater(LLFloater* floaterp,
BOOL select_added_floater,
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
-
+ void returnFloaterToHost();
void showConversation(const LLUUID& session_id);
void selectConversation(const LLUUID& session_id);
BOOL selectConversationPair(const LLUUID& session_id, bool select_widget);
/*virtual*/ void tabClose();
+ void showStub(bool visible);
static LLFloater* getCurrentVoiceFloater();
static LLFloaterIMContainer* findInstance();
@@ -146,6 +147,8 @@ private:
void openNearbyChat();
LLButton* mExpandCollapseBtn;
+ LLPanel* mStubPanel;
+ LLTextBox* mStubTextBox;
LLLayoutPanel* mMessagesPane;
LLLayoutPanel* mConversationsPane;
LLLayoutStack* mConversationsStack;
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index a47c9177a1..3a1cc2880a 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -263,11 +263,21 @@ void LLFloaterIMSessionTab::draw()
{
if (mRefreshTimer->hasExpired())
{
- if (getParticipantList())
+ LLParticipantList* item = getParticipantList();
+ if (item)
{
- getParticipantList()->update();
+ // Update all model items
+ item->update();
+ // If the model and view list diverge in count, rebuild
+ // Note: this happens sometimes right around init (add participant events fire but get dropped) and is the cause
+ // of missing participants, often, the user agent itself. As there will be no other event fired, there's
+ // no other choice but get those inconsistencies regularly (and lightly) checked and scrubbed.
+ if (item->getChildrenCount() != mConversationsWidgets.size())
+ {
+ buildConversationViewParticipant();
+ }
}
-
+
refreshConversation();
// Restart the refresh timer
@@ -303,6 +313,7 @@ void LLFloaterIMSessionTab::onFocusReceived()
if (container)
{
container->selectConversationPair(mSessionID, true);
+ container->showStub(! getHost());
}
}
@@ -376,7 +387,7 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant()
LLParticipantList* item = getParticipantList();
if (!item)
{
- // Nothing to do if the model list is empty
+ // Nothing to do if the model list is inexistent
return;
}
@@ -470,7 +481,8 @@ void LLFloaterIMSessionTab::refreshConversation()
session_name = LLIMModel::instance().getName(mSessionID);
}
updateSessionName(session_name);
- }
+ }
+
mConversationViewModel.requestSortAll();
mConversationsRoot->arrangeAll();
mConversationsRoot->update();
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index 94854ee9ee..8f5a8c2c1b 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -91,6 +91,7 @@ public:
void buildConversationViewParticipant();
void setSortOrder(const LLConversationSort& order);
+ virtual void onTearOffClicked();
virtual void updateMessages() {}
@@ -106,7 +107,6 @@ protected:
bool onIMShowModesMenuItemCheck(const LLSD& userdata);
bool onIMShowModesMenuItemEnable(const LLSD& userdata);
static void onSlide(LLFloaterIMSessionTab *self);
- virtual void onTearOffClicked();
// refresh a visual state of the Call button
void updateCallBtnState(bool callIsActive);
diff --git a/indra/newview/llspeakers.cpp b/indra/newview/llspeakers.cpp
index 726199b7aa..5036334bdd 100644
--- a/indra/newview/llspeakers.cpp
+++ b/indra/newview/llspeakers.cpp
@@ -503,27 +503,23 @@ void LLSpeakerMgr::update(BOOL resort_ok)
void LLSpeakerMgr::updateSpeakerList()
{
- // are we bound to the currently active voice channel?
- if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel))
- {
- std::set<LLUUID> participants;
- LLVoiceClient::getInstance()->getParticipantList(participants);
- // add new participants to our list of known speakers
- for (std::set<LLUUID>::iterator participant_it = participants.begin();
- participant_it != participants.end();
- ++participant_it)
+ // Are we bound to the currently active voice channel?
+ if ((!mVoiceChannel && LLVoiceClient::getInstance()->inProximalChannel()) || (mVoiceChannel && mVoiceChannel->isActive()))
+ {
+ std::set<LLUUID> participants;
+ LLVoiceClient::getInstance()->getParticipantList(participants);
+ // If we are, add all voice client participants to our list of known speakers
+ for (std::set<LLUUID>::iterator participant_it = participants.begin(); participant_it != participants.end(); ++participant_it)
{
setSpeaker(*participant_it,
LLVoiceClient::getInstance()->getDisplayName(*participant_it),
LLSpeaker::STATUS_VOICE_ACTIVE,
(LLVoiceClient::getInstance()->isParticipantAvatar(*participant_it)?LLSpeaker::SPEAKER_AGENT:LLSpeaker::SPEAKER_EXTERNAL));
-
-
}
}
else
{
- // Check if the list is empty, except if it's Nearby Chat (session_id NULL).
+ // If not, check if the list is empty, except if it's Nearby Chat (session_id NULL).
LLUUID session_id = getSessionID();
if ((mSpeakers.size() == 0) && (!session_id.isNull()))
{
@@ -533,16 +529,16 @@ void LLSpeakerMgr::updateSpeakerList()
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(session_id);
for (uuid_vec_t::iterator it = session->mInitialTargetIDs.begin();it!=session->mInitialTargetIDs.end();++it)
{
- // Allow to set buddies if they are on line. Allow any other avatar.
+ // Add buddies if they are on line, add any other avatar.
if (!LLAvatarTracker::instance().isBuddy(*it) || LLAvatarTracker::instance().isBuddyOnline(*it))
{
setSpeaker(*it, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
}
}
- // Also add the current agent
- setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
}
}
+ // Finally, always add the current agent (it has to be there no matter what...)
+ setSpeaker(gAgentID, "", LLSpeaker::STATUS_VOICE_ACTIVE, LLSpeaker::SPEAKER_AGENT);
}
void LLSpeakerMgr::setSpeakerNotInChannel(LLSpeaker* speakerp)
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index 590ce45c33..1388b9e474 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -124,7 +124,47 @@
left="0"
name="im_box_tab_container"
top="0"
- width="412"/>
+ width="412">
+ <panel
+ follows="all"
+ layout="topleft"
+ name="stub_panel"
+ opaque="true"
+ top_pad="0"
+ left="0"
+ height="430"
+ width="412">
+ <text
+ type="string"
+ clip_partial="false"
+ follows="left|top"
+ layout="topleft"
+ left="20"
+ right="-20"
+ name="stub_textbox_1"
+ top="10"
+ height="20"
+ valign="center"
+ wrap="true">
+ This conversation is in a separate window.
+ </text>
+ <text
+ type="string"
+ clip_partial="false"
+ follows="left|top"
+ layout="topleft"
+ left="20"
+ right="-20"
+ name="stub_textbox_2"
+ top="40"
+ height="20"
+ valign="center"
+ parse_urls="true"
+ wrap="true">
+ [secondlife:/// Bring it back.]
+ </text>
+ </panel>
+ </panel_container>
</layout_panel>
</layout_stack>
</multi_floater>
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index a889eb7933..1d74f1bc25 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -203,7 +203,7 @@
name="translate_chat_checkbox_lp"
top_delta="0"
visible="true"
- width="230">
+ width="210">
<check_box
top="10"
control_name="TranslateChat"
@@ -217,7 +217,7 @@
</layout_panel>
<layout_panel
height="248"
- width="230"
+ width="210"
layout="topleft"
follows="all"
left_delta="0"
@@ -227,17 +227,17 @@
user_resize="true"
auto_resize="true"
name="chat_holder">
- <chat_history
- font="SansSerifSmall"
- follows="all"
- visible="true"
- height="240"
- name="chat_history"
- parse_highlights="true"
- parse_urls="true"
- width="230"
- left="5">
- </chat_history>
+ <chat_history
+ font="SansSerifSmall"
+ follows="all"
+ visible="true"
+ height="240"
+ name="chat_history"
+ parse_highlights="true"
+ parse_urls="true"
+ right="-5"
+ left="5">
+ </chat_history>
</layout_panel>
</layout_stack>
</panel>