summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml15
-rw-r--r--indra/newview/llchicletbar.cpp9
-rwxr-xr-xindra/newview/llfloaterpreference.cpp6
-rw-r--r--indra/newview/llimconversation.cpp3
-rw-r--r--indra/newview/llimfloater.cpp10
-rw-r--r--indra/newview/llimfloatercontainer.cpp136
-rw-r--r--indra/newview/llimfloatercontainer.h6
-rw-r--r--indra/newview/skins/default/xui/en/panel_preferences_chat.xml58
8 files changed, 113 insertions, 130 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 46c29e32e2..feb80a3611 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1538,7 +1538,7 @@
<key>Type</key>
<string>S32</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>ChatBubbleOpacity</key>
<map>
@@ -1617,17 +1617,6 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>ChatWindow</key>
- <map>
- <key>Comment</key>
- <string>Show chat in multiple windows(by default) or in one multi-tabbed window(requires restart)</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>S32</string>
- <key>Value</key>
- <integer>0</integer>
- </map>
<key>CheesyBeacon</key>
<map>
<key>Comment</key>
@@ -9809,7 +9798,7 @@
<key>ShowScriptErrorsLocation</key>
<map>
<key>Comment</key>
- <string>Show script error in chat or window</string>
+ <string>Show script error in chat (0) or window (1).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index 66c93bd18b..0e58008cd2 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -107,6 +107,13 @@ void LLChicletBar::sessionAdded(const LLUUID& session_id, const std::string& nam
// no need to spawn chiclets for participants in P2P calls called through Avaline
if (session->isP2P() && session->isOtherParticipantAvaline()) return;
+ // Do not spawn chiclet when using the new multitab conversation UI
+ if (LLIMConversation::isChatMultiTab())
+ {
+ LLIMFloater::addToHost(session_id);
+ return;
+ }
+
if (getChicletPanel()->findChiclet<LLChiclet>(session_id)) return;
LLIMChiclet* chiclet = createIMChiclet(session_id);
@@ -114,7 +121,7 @@ void LLChicletBar::sessionAdded(const LLUUID& session_id, const std::string& nam
{
chiclet->setIMSessionName(name);
chiclet->setOtherParticipantId(other_participant_id);
-
+
LLIMFloater::onIMChicletCreated(session_id);
}
diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 18ab9dc264..996cf1e212 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -423,8 +423,6 @@ void LLFloaterPreference::saveAvatarProperties( void )
BOOL LLFloaterPreference::postBuild()
{
-// gSavedSettings.getControl("PlainTextChatHistory")->getSignal()->connect(boost::bind(&LLIMConversation::processChatHistoryStyleUpdate));
-
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLIMConversation::processChatHistoryStyleUpdate));
gSavedSettings.getControl("ChatFontSize")->getSignal()->connect(boost::bind(&LLViewerChat::signalChatFontChanged));
@@ -542,8 +540,6 @@ void LLFloaterPreference::apply()
// LLWString busy_response = utf8str_to_wstring(getChild<LLUICtrl>("busy_response")->getValue().asString());
// LLWStringUtil::replaceTabsWithSpaces(busy_response, 4);
-
- gSavedSettings.setBOOL("PlainTextChatHistory", getChild<LLUICtrl>("plain_text_chat_history")->getValue().asBoolean());
if (mGotPersonalInfo)
{
@@ -1412,8 +1408,6 @@ void LLFloaterPreference::setPersonalInfo(const std::string& visibility, bool im
getChild<LLUICtrl>("online_visibility")->setLabelArg("[DIR_VIS]", mDirectoryVisibility);
getChildView("send_im_to_email")->setEnabled(TRUE);
getChild<LLUICtrl>("send_im_to_email")->setValue(im_via_email);
- getChildView("plain_text_chat_history")->setEnabled(TRUE);
- getChild<LLUICtrl>("plain_text_chat_history")->setValue(gSavedSettings.getBOOL("PlainTextChatHistory"));
getChildView("log_instant_messages")->setEnabled(TRUE);
// getChildView("log_chat")->setEnabled(TRUE);
// getChildView("busy_response")->setEnabled(TRUE);
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp
index ead87e3ed5..c3dba3e49e 100644
--- a/indra/newview/llimconversation.cpp
+++ b/indra/newview/llimconversation.cpp
@@ -321,6 +321,5 @@ void LLIMConversation::onTearOffClicked()
bool LLIMConversation::isChatMultiTab()
{
// Restart is required in order to change chat window type.
- static bool is_single_window = gSavedSettings.getS32("ChatWindow") == 1;
- return is_single_window;
+ return true;
}
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index dde7d248dd..4b954de738 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -109,6 +109,16 @@ void LLIMFloater::onFocusReceived()
// virtual
void LLIMFloater::onClose(bool app_quitting)
{
+ // Always suppress the IM from the conversations list on close if present for any reason
+ if (LLIMConversation::isChatMultiTab())
+ {
+ LLIMFloaterContainer* im_box = LLIMFloaterContainer::findInstance();
+ if (im_box)
+ {
+ im_box->removeConversationListItem(mSessionID);
+ }
+ }
+
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(
mSessionID);
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index deeb0e9e0b..a2a54bf02c 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -136,29 +136,17 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
openFloater(floaterp->getKey());
return;
}
+
+ // Make sure the message panel is open when adding a floater or it stays mysteriously hidden
+ collapseMessagesPane(false);
+ // Add the floater
LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
LLUUID session_id = floaterp->getKey();
- // CHUI-137 : Temporary implementation of conversations list
- // Create a conversation item
- LLConversationItem* item = new LLConversationItem(floaterp->getTitle(),session_id, floaterp, this);
- mConversationsItems[session_id] = item;
- // Create a widget from it
- LLFolderViewItem* widget = createConversationItemWidget(item);
- mConversationsWidgets[session_id] = widget;
- // Add it to the UI
- widget->setVisible(TRUE);
- mConversationsListPanel->addChild(widget);
- LLRect panel_rect = mConversationsListPanel->getRect();
- S32 item_height = 16;
- S32 index = mConversationsWidgets.size() - 1;
- widget->setRect(LLRect(0,
- panel_rect.getHeight() - item_height*index,
- panel_rect.getWidth(),
- panel_rect.getHeight() - item_height*(index+1)));
- // CHUI-137 : end
+ // Add a conversation list item in the left pane
+ addConversationListItem(floaterp->getTitle(), session_id, floaterp, this);
LLView* floater_contents = floaterp->getChild<LLView>("contents_view");
@@ -196,35 +184,6 @@ void LLIMFloaterContainer::removeFloater(LLFloater* floaterp)
{
LLMultiFloater::removeFloater(floaterp);
- // CHUI-137 : Temporary implementation of conversations list
- // Clean up the conversations list
- LLUUID session_id = floaterp->getKey();
- // Delete the widget and the associated conversation item
- // Note : since the mConversationsItems is also the listener to the widget, deleting
- // the widget will also delete its listener
- conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(session_id);
- if (widget_it != mConversationsWidgets.end())
- {
- LLFolderViewItem* widget = widget_it->second;
- delete widget;
- }
- // Suppress the conversation items and widgets from their respective maps
- mConversationsItems.erase(session_id);
- mConversationsWidgets.erase(session_id);
- // Reposition the leftover conversation items
- LLRect panel_rect = mConversationsListPanel->getRect();
- S32 item_height = 16;
- int index = 0;
- for (widget_it = mConversationsWidgets.begin(); widget_it != mConversationsWidgets.end(); ++widget_it, ++index)
- {
- LLFolderViewItem* widget = widget_it->second;
- widget->setRect(LLRect(0,
- panel_rect.getHeight() - item_height*index,
- panel_rect.getWidth(),
- panel_rect.getHeight() - item_height*(index+1)));
- }
- // CHUI-137 : end
-
LLRect contents_rect = floaterp->getRect();
// reduce the floater contents height by header height
@@ -411,6 +370,77 @@ void LLIMFloaterContainer::onAvatarPicked(const uuid_vec_t& ids)
}
// CHUI-137 : Temporary implementation of conversations list
+void LLIMFloaterContainer::addConversationListItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp)
+{
+ // Check if the item is not already in the list, exit if it is (nothing to do)
+ // Note: this happens often, when reattaching a torn off conversation for instance
+ conversations_items_map::iterator item_it = mConversationsItems.find(uuid);
+ if (item_it != mConversationsItems.end())
+ {
+ return;
+ }
+
+ // Create a conversation item
+ LLConversationItem* item = new LLConversationItem(name, uuid, floaterp, containerp);
+ mConversationsItems[uuid] = item;
+
+ // Create a widget from it
+ LLFolderViewItem* widget = createConversationItemWidget(item);
+ mConversationsWidgets[uuid] = widget;
+
+ // Add it to the UI
+ widget->setVisible(TRUE);
+ mConversationsListPanel->addChild(widget);
+ LLRect panel_rect = mConversationsListPanel->getRect();
+ S32 item_height = 16;
+ S32 index = mConversationsWidgets.size() - 1;
+ widget->setRect(LLRect(0,
+ panel_rect.getHeight() - item_height*index,
+ panel_rect.getWidth(),
+ panel_rect.getHeight() - item_height*(index+1)));
+ return;
+}
+
+void LLIMFloaterContainer::removeConversationListItem(const LLUUID& session_id)
+{
+ // Delete the widget and the associated conversation item
+ // Note : since the mConversationsItems is also the listener to the widget, deleting
+ // the widget will also delete its listener
+ conversations_widgets_map::iterator widget_it = mConversationsWidgets.find(session_id);
+ if (widget_it != mConversationsWidgets.end())
+ {
+ LLFolderViewItem* widget = widget_it->second;
+ delete widget;
+ }
+
+ // Suppress the conversation items and widgets from their respective maps
+ mConversationsItems.erase(session_id);
+ mConversationsWidgets.erase(session_id);
+
+ // Reposition the leftover conversation items
+ LLRect panel_rect = mConversationsListPanel->getRect();
+ S32 item_height = 16;
+ int index = 0;
+ for (widget_it = mConversationsWidgets.begin(); widget_it != mConversationsWidgets.end(); ++widget_it, ++index)
+ {
+ LLFolderViewItem* widget = widget_it->second;
+ widget->setRect(LLRect(0,
+ panel_rect.getHeight() - item_height*index,
+ panel_rect.getWidth(),
+ panel_rect.getHeight() - item_height*(index+1)));
+ }
+
+ // Don't let the focus fall IW, select and refocus on the first conversation in the list
+ setFocus(TRUE);
+ conversations_items_map::iterator item_it = mConversationsItems.begin();
+ if (item_it != mConversationsItems.end())
+ {
+ LLConversationItem* item = item_it->second;
+ item->selectItem();
+ }
+ return;
+}
+
LLFolderViewItem* LLIMFloaterContainer::createConversationItemWidget(LLConversationItem* item)
{
LLFolderViewItem::Params params;
@@ -443,8 +473,16 @@ LLConversationItem::LLConversationItem(std::string name, const LLUUID& uuid, LLF
// Virtual action callbacks
void LLConversationItem::selectItem(void)
{
- // Switch to the conversation floater that is being selected
- mContainer->selectFloater(mFloater);
+ LLMultiFloater* host_floater = mFloater->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(mFloater);
+ }
+ // Set the focus on the selected floater
+ mFloater->setFocus(TRUE);
}
void LLConversationItem::performAction(LLInventoryModel* model, std::string action)
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 239d6a08a3..3d1324c2fb 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -145,7 +145,6 @@ public:
void collapseMessagesPane(bool collapse);
- LLFolderViewItem* createConversationItemWidget(LLConversationItem* item);
// LLIMSessionObserver observe triggers
/*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {};
@@ -177,6 +176,11 @@ private:
LLLayoutStack* mConversationsStack;
// CHUI-137 : Temporary implementation of conversations list
+public:
+ void removeConversationListItem(const LLUUID& session_id);
+private:
+ void addConversationListItem(std::string name, const LLUUID& uuid, LLFloater* floaterp, LLIMFloaterContainer* containerp);
+ LLFolderViewItem* createConversationItemWidget(LLConversationItem* item);
// Conversation list data
LLPanel* mConversationsListPanel; // This is the widget we add items to (i.e. clickable title for each conversation)
conversations_items_map mConversationsItems;
diff --git a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
index caf7fc85f5..d7a7f7d735 100644
--- a/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
+++ b/indra/newview/skins/default/xui/en/panel_preferences_chat.xml
@@ -76,15 +76,6 @@
top_pad="5"
width="400" />
<check_box
- enabled="false"
- height="16"
- label="Enable plain text IM and chat history"
- layout="topleft"
- left_delta="0"
- name="plain_text_chat_history"
- top_pad="5"
- width="400" />
- <check_box
control_name="UseChatBubbles"
follows="left|top"
height="16"
@@ -95,55 +86,6 @@
name="bubble_text_chat"
width="150" />
<text
- name="show_ims_in_label"
- follows="left|top"
- layout="topleft"
- left="30"
- height="20"
- width="170"
- top_pad="15">
- Show IMs in:
- </text>
- <text
- name="requires_restart_label"
- follows="left|top"
- layout="topleft"
- top_delta="0"
- left="170"
- height="20"
- width="130"
- text_color="White_25">
- (requires restart)
- </text>
- <radio_group
- follows="left|top"
- height="30"
- left="40"
- control_name="ChatWindow"
- name="chat_window"
- top_pad="0"
- tool_tip="Show your Instant Messages in separate floaters, or in one floater with many tabs (Requires restart)"
- width="150">
- <radio_item
- height="16"
- label="Separate Windows"
- layout="topleft"
- left="0"
- name="radio"
- value="0"
- top="0"
- width="150" />
- <radio_item
- height="16"
- label="Tabs"
- layout="topleft"
- left_delta="0"
- name="radio2"
- value="1"
- top_pad="5"
- width="150" />
- </radio_group>
- <text
name="disable_toast_label"
follows="left|top"
layout="topleft"