summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-12-02 12:03:24 -0800
committerLeslie Linden <leslie@lindenlab.com>2011-12-02 12:03:24 -0800
commit4d14bb02b908c37f73e915af811027c1d193b667 (patch)
tree912f1bfc851952432be1e30698bd405ee4a7782b /indra
parent31029babe2f9f6eb3fc3205da93c1eccd7a74ed4 (diff)
EXP-1451 FIX -- I want to put my NEARBY CHAT window at the bottom left, but then it obscures chatted text.
I repositioned the chat, move and camera floaters. Chat toasts now start 80 up from the bottom left rather than 10.
Diffstat (limited to 'indra')
-rw-r--r--indra/llui/lltextparser.cpp2
-rw-r--r--indra/newview/CMakeLists.txt2
-rw-r--r--indra/newview/app_settings/settings.xml11
-rw-r--r--indra/newview/app_settings/toolbars.xml2
-rw-r--r--indra/newview/llfloaterchat.cpp485
-rw-r--r--indra/newview/llfloaterchat.h78
-rw-r--r--indra/newview/llfloaterchatterbox.cpp344
-rw-r--r--indra/newview/llfloaterchatterbox.h80
-rw-r--r--indra/newview/llfloaterfriends.cpp807
-rw-r--r--indra/newview/llfloaterfriends.h140
-rw-r--r--indra/newview/llmenucommands.cpp94
-rw-r--r--indra/newview/llmenucommands.h37
-rw-r--r--indra/newview/llnearbychathandler.cpp5
-rw-r--r--indra/newview/llviewermenu.cpp2
-rw-r--r--indra/newview/llvoicevivox.cpp1
-rw-r--r--indra/newview/skins/default/xui/en/floater_camera.xml2
-rw-r--r--indra/newview/skins/default/xui/en/floater_chat_bar.xml10
-rw-r--r--indra/newview/skins/default/xui/en/floater_moveview.xml2
-rw-r--r--indra/newview/skins/default/xui/en/menu_viewer.xml6
19 files changed, 11 insertions, 2099 deletions
diff --git a/indra/llui/lltextparser.cpp b/indra/llui/lltextparser.cpp
index a4fe4f6ca8..8a85f99e0c 100644
--- a/indra/llui/lltextparser.cpp
+++ b/indra/llui/lltextparser.cpp
@@ -46,8 +46,6 @@ LLTextParser::LLTextParser()
{}
-// Moved triggerAlerts() to llfloaterchat.cpp to break llui/llaudio library dependency.
-
S32 LLTextParser::findPattern(const std::string &text, LLSD highlight)
{
if (!highlight.has("pattern")) return -1;
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 71238a52f7..9368433a9f 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -316,7 +316,6 @@ set(viewer_SOURCE_FILES
llmediactrl.cpp
llmediadataclient.cpp
llmemoryview.cpp
- llmenucommands.cpp
llmeshrepository.cpp
llmimetypes.cpp
llmorphview.cpp
@@ -870,7 +869,6 @@ set(viewer_HEADER_FILES
llmediactrl.h
llmediadataclient.h
llmemoryview.h
- llmenucommands.h
llmeshrepository.h
llmimetypes.h
llmorphview.h
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index dd4c0abaf5..1e07ed8a27 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1562,17 +1562,6 @@
<key>Value</key>
<integer>1</integer>
</map>
- <key>ChatVisible</key>
- <map>
- <key>Comment</key>
- <string>Chat bar is visible</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
<key>ChatWindow</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/toolbars.xml b/indra/newview/app_settings/toolbars.xml
index 8862355bfd..29c019719d 100644
--- a/indra/newview/app_settings/toolbars.xml
+++ b/indra/newview/app_settings/toolbars.xml
@@ -7,8 +7,8 @@
<command name="destinations"/>
<command name="people"/>
<command name="profile"/>
- <command name="view"/>
<command name="move"/>
+ <command name="view"/>
<command name="howto"/>
</bottom_toolbar>
<left_toolbar
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
deleted file mode 100644
index 2679dbb78b..0000000000
--- a/indra/newview/llfloaterchat.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/**
- * @file llfloaterchat.cpp
- * @brief LLFloaterChat class implementation
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-/**
- * Actually the "Chat History" floater.
- * Should be llfloaterchathistory, not llfloaterchat.
- */
-
-#include "llviewerprecompiledheaders.h"
-
-// project include
-#include "llagent.h"
-#include "llappviewer.h"
-#include "llbutton.h"
-#include "llcheckboxctrl.h"
-#include "llcombobox.h"
-#include "llconsole.h"
-#include "llfloateractivespeakers.h"
-#include "llfloaterchatterbox.h"
-#include "llfloaterreg.h"
-#include "llfloaterscriptdebug.h"
-#include "llkeyboard.h"
-//#include "lllineeditor.h"
-#include "llmutelist.h"
-//#include "llresizehandle.h"
-#include "llchatbar.h"
-#include "llrecentpeople.h"
-#include "llpanelblockedlist.h"
-#include "llslurl.h"
-#include "llstatusbar.h"
-#include "llviewertexteditor.h"
-#include "llviewergesture.h" // for triggering gestures
-#include "llviewermessage.h"
-#include "llviewerwindow.h"
-#include "llviewercontrol.h"
-#include "lluictrlfactory.h"
-#include "lllogchat.h"
-#include "lltexteditor.h"
-#include "lltextparser.h"
-#include "llweb.h"
-#include "llstylemap.h"
-
-// linden library includes
-#include "llaudioengine.h"
-#include "llchat.h"
-#include "llfontgl.h"
-#include "llrect.h"
-#include "llerror.h"
-#include "llstring.h"
-#include "llwindow.h"
-#include "message.h"
-
-//
-// Constants
-//
-const F32 INSTANT_MSG_SIZE = 8.0f;
-const F32 CHAT_MSG_SIZE = 8.0f;
-
-
-//
-// Global statics
-//
-LLColor4 get_text_color(const LLChat& chat);
-
-//
-// Member Functions
-//
-LLFloaterChat::LLFloaterChat(const LLSD& seed)
- : LLFloater(seed),
- mPanel(NULL)
-{
- mFactoryMap["chat_panel"] = LLCallbackMap(createChatPanel, NULL);
- mFactoryMap["active_speakers_panel"] = LLCallbackMap(createSpeakersPanel, NULL);
- //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this,"floater_chat_history.xml");
-
-}
-
-LLFloaterChat::~LLFloaterChat()
-{
- // Children all cleaned up by default view destructor.
-}
-
-void LLFloaterChat::draw()
-{
- // enable say and shout only when text available
-
- childSetValue("toggle_active_speakers_btn", childIsVisible("active_speakers_panel"));
-
- LLChatBar* chat_barp = findChild<LLChatBar>("chat_panel", TRUE);
- if (chat_barp)
- {
- chat_barp->refresh();
- }
-
- mPanel->refreshSpeakers();
- LLFloater::draw();
-}
-
-BOOL LLFloaterChat::postBuild()
-{
- // Hide the chat overlay when our history is visible.
- setVisibleCallback(boost::bind(&LLFloaterChat::updateConsoleVisibility, this));
-
- mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel");
-
- childSetCommitCallback("show mutes",onClickToggleShowMute,this); //show mutes
- childSetVisible("Chat History Editor with mute",FALSE);
- childSetAction("toggle_active_speakers_btn", onClickToggleActiveSpeakers, this);
-
- return TRUE;
-}
-
-void LLFloaterChat::updateConsoleVisibility()
-{
- if(gDisconnected)
- {
- return;
- }
- // determine whether we should show console due to not being visible
- gConsole->setVisible( !isInVisibleChain() // are we not in part of UI being drawn?
- || isMinimized() // are we minimized?
- || (getHost() && getHost()->isMinimized() )); // are we hosted in a minimized floater?
-}
-
-void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& color)
-{
- std::string line = chat.mText;
- bool prepend_newline = true;
- if (gSavedSettings.getBOOL("ChatShowTimestamps"))
- {
- edit->appendTime(prepend_newline);
- prepend_newline = false;
- }
-
- // If the msg is from an agent (not yourself though),
- // extract out the sender name and replace it with the hotlinked name.
- if (chat.mSourceType == CHAT_SOURCE_AGENT &&
- chat.mFromID != LLUUID::null)
- {
- chat.mURL = LLSLURL("agent", chat.mFromID, "inspect").getSLURLString();
- }
-
- // If the chat line has an associated url, link it up to the name.
- if (!chat.mURL.empty()
- && (line.length() > chat.mFromName.length() && line.find(chat.mFromName,0) == 0))
- {
- std::string start_line = line.substr(0, chat.mFromName.length() + 1);
- line = line.substr(chat.mFromName.length() + 1);
- edit->appendText(start_line, prepend_newline, LLStyleMap::instance().lookup(chat.mFromID,chat.mURL));
- edit->blockUndo();
- prepend_newline = false;
- }
- edit->appendText(line, prepend_newline, LLStyle::Params().color(color));
- edit->blockUndo();
-}
-
-// static
-void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
-{
- if (log_to_file && (gSavedPerAccountSettings.getBOOL("LogChat")))
- {
- if (chat.mChatType != CHAT_TYPE_WHISPER && chat.mChatType != CHAT_TYPE_SHOUT)
- {
- LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText);
- }
- else
- {
- LLLogChat::saveHistory("chat", "", chat.mFromID, chat.mFromName + " " + chat.mText);
- }
- }
-
- LLColor4 color = get_text_color(chat);
-
- if (!log_to_file) color = LLColor4::grey; //Recap from log file.
-
- if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
- {
- if(gSavedSettings.getBOOL("ShowScriptErrors") == FALSE)
- return;
- if (gSavedSettings.getS32("ShowScriptErrorsLocation") == 1)
- {
- LLFloaterScriptDebug::addScriptLine(chat.mText,
- chat.mFromName,
- color,
- chat.mFromID);
- return;
- }
- }
-
- // could flash the chat button in the status bar here. JC
- LLFloaterChat* chat_floater = LLFloaterChat::getInstance();
- LLViewerTextEditor* history_editor = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor");
- LLViewerTextEditor* history_editor_with_mute = chat_floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-
- if (!chat.mMuted)
- {
- add_timestamped_line(history_editor, chat, color);
- add_timestamped_line(history_editor_with_mute, chat, color);
- }
- else
- {
- // desaturate muted chat
- LLColor4 muted_color = lerp(color, LLColor4::grey, 0.5f);
- add_timestamped_line(history_editor_with_mute, chat, color);
- }
-
- // add objects as transient speakers that can be muted
- if (chat.mSourceType == CHAT_SOURCE_OBJECT)
- {
- chat_floater->mPanel->setSpeaker(chat.mFromID, chat.mFromName, LLSpeaker::STATUS_NOT_IN_CHANNEL, LLSpeaker::SPEAKER_OBJECT);
- }
-
- // start tab flashing on incoming text from other users (ignoring system text, etc)
- if (!chat_floater->isInVisibleChain() && chat.mSourceType == CHAT_SOURCE_AGENT)
- {
- LLFloaterChatterBox::getInstance()->setFloaterFlashing(chat_floater, TRUE);
- }
-}
-
-// static
-void LLFloaterChat::setHistoryCursorAndScrollToEnd()
-{
- LLViewerTextEditor* history_editor = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor");
- LLViewerTextEditor* history_editor_with_mute = LLFloaterChat::getInstance()->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-
- if (history_editor)
- {
- history_editor->setCursorAndScrollToEnd();
- }
- if (history_editor_with_mute)
- {
- history_editor_with_mute->setCursorAndScrollToEnd();
- }
-}
-
-
-//static
-void LLFloaterChat::onClickMute(void *data)
-{
- LLFloaterChat* self = (LLFloaterChat*)data;
-
- LLComboBox* chatter_combo = self->getChild<LLComboBox>("chatter combobox");
-
- const std::string& name = chatter_combo->getSimple();
- LLUUID id = chatter_combo->getCurrentID();
-
- if (name.empty()) return;
-
- LLMute mute(id);
- mute.setFromDisplayName(name);
- LLMuteList::getInstance()->add(mute);
- LLPanelBlockedList::showPanelAndSelect(mute.mID);
-}
-
-//static
-void LLFloaterChat::onClickToggleShowMute(LLUICtrl* caller, void *data)
-{
- LLFloaterChat* floater = (LLFloaterChat*)data;
-
-
- //LLCheckBoxCtrl*
- BOOL show_mute = floater->getChild<LLCheckBoxCtrl>("show mutes")->get();
- LLViewerTextEditor* history_editor = floater->getChild<LLViewerTextEditor>("Chat History Editor");
- LLViewerTextEditor* history_editor_with_mute = floater->getChild<LLViewerTextEditor>("Chat History Editor with mute");
-
- if (!history_editor || !history_editor_with_mute)
- return;
-
- //BOOL show_mute = floater->mShowMuteCheckBox->get();
- if (show_mute)
- {
- history_editor->setVisible(FALSE);
- history_editor_with_mute->setVisible(TRUE);
- history_editor_with_mute->setCursorAndScrollToEnd();
- }
- else
- {
- history_editor->setVisible(TRUE);
- history_editor_with_mute->setVisible(FALSE);
- history_editor->setCursorAndScrollToEnd();
- }
-}
-
-// Put a line of chat in all the right places
-void LLFloaterChat::addChat(const LLChat& chat, BOOL local_agent)
-{
- triggerAlerts(chat.mText);
-
- // Add the sender to the list of people with which we've recently interacted.
- // this is not the best place to add _all_ messages to recent list
- // comment this for now, may remove later on code cleanup
- //if(chat.mSourceType == CHAT_SOURCE_AGENT && chat.mFromID.notNull())
- // LLRecentPeople::instance().add(chat.mFromID);
-
- addChatHistory(chat, true);
-}
-
-// Moved from lltextparser.cpp to break llui/llaudio library dependency.
-//static
-void LLFloaterChat::triggerAlerts(const std::string& text)
-{
- LLTextParser* parser = LLTextParser::getInstance();
-// bool spoken=FALSE;
- for (S32 i=0;i<parser->mHighlights.size();i++)
- {
- LLSD& highlight = parser->mHighlights[i];
- if (parser->findPattern(text,highlight) >= 0 )
- {
- if(gAudiop)
- {
- if ((std::string)highlight["sound_lluuid"] != LLUUID::null.asString())
- {
- gAudiop->triggerSound(highlight["sound_lluuid"].asUUID(),
- gAgent.getID(),
- 1.f,
- LLAudioEngine::AUDIO_TYPE_UI,
- gAgent.getPositionGlobal() );
- }
-/*
- if (!spoken)
- {
- LLTextToSpeech* text_to_speech = NULL;
- text_to_speech = LLTextToSpeech::getInstance();
- spoken = text_to_speech->speak((LLString)highlight["voice"],text);
- }
- */
- }
- if (highlight["flash"])
- {
- LLWindow* viewer_window = gViewerWindow->getWindow();
- if (viewer_window && viewer_window->getMinimized())
- {
- viewer_window->flashIcon(5.f);
- }
- }
- }
- }
-}
-
-LLColor4 get_text_color(const LLChat& chat)
-{
- LLColor4 text_color;
-
- if(chat.mMuted)
- {
- text_color.setVec(0.8f, 0.8f, 0.8f, 1.f);
- }
- else
- {
- switch(chat.mSourceType)
- {
- case CHAT_SOURCE_SYSTEM:
- text_color = LLUIColorTable::instance().getColor("SystemChatColor");
- break;
- case CHAT_SOURCE_AGENT:
- if (chat.mFromID.isNull())
- {
- text_color = LLUIColorTable::instance().getColor("SystemChatColor");
- }
- else
- {
- if(gAgent.getID() == chat.mFromID)
- {
- text_color = LLUIColorTable::instance().getColor("UserChatColor");
- }
- else
- {
- text_color = LLUIColorTable::instance().getColor("AgentChatColor");
- }
- }
- break;
- case CHAT_SOURCE_OBJECT:
- if (chat.mChatType == CHAT_TYPE_DEBUG_MSG)
- {
- text_color = LLUIColorTable::instance().getColor("ScriptErrorColor");
- }
- else if ( chat.mChatType == CHAT_TYPE_OWNER )
- {
- text_color = LLUIColorTable::instance().getColor("llOwnerSayChatColor");
- }
- else
- {
- text_color = LLUIColorTable::instance().getColor("ObjectChatColor");
- }
- break;
- default:
- text_color.setToWhite();
- }
-
- if (!chat.mPosAgent.isExactlyZero())
- {
- LLVector3 pos_agent = gAgent.getPositionAgent();
- F32 distance_squared = dist_vec_squared(pos_agent, chat.mPosAgent);
- F32 dist_near_chat = gAgent.getNearChatRadius();
- if (distance_squared > dist_near_chat * dist_near_chat)
- {
- // diminish far-off chat
- text_color.mV[VALPHA] = 0.8f;
- }
- }
- }
-
- return text_color;
-}
-
-//static
-void LLFloaterChat::loadHistory()
-{
- LLLogChat::loadHistory(std::string("chat"), &chatFromLogFile, (void *)LLFloaterChat::getInstance());
-}
-
-//static
-void LLFloaterChat::chatFromLogFile(LLLogChat::ELogLineType type , const LLSD& line, void* userdata)
-{
- switch (type)
- {
- case LLLogChat::LOG_EMPTY:
- case LLLogChat::LOG_END:
- // *TODO: nice message from XML file here
- break;
- case LLLogChat::LOG_LINE:
- case LLLogChat::LOG_LLSD:
- {
- LLChat chat;
- chat.mText = line["message"].asString();
- get_text_color(chat);
- addChatHistory(chat, FALSE);
- }
- break;
- default:
- // nothing
- break;
- }
-}
-
-//static
-void* LLFloaterChat::createSpeakersPanel(void* data)
-{
- return new LLPanelActiveSpeakers(LLLocalSpeakerMgr::getInstance(), TRUE);
-}
-
-//static
-void* LLFloaterChat::createChatPanel(void* data)
-{
- LLChatBar* chatp = new LLChatBar();
- return chatp;
-}
-
-// static
-void LLFloaterChat::onClickToggleActiveSpeakers(void* userdata)
-{
- LLFloaterChat* self = (LLFloaterChat*)userdata;
-
- self->childSetVisible("active_speakers_panel", !self->childIsVisible("active_speakers_panel"));
-}
-
-//static
- LLFloaterChat* LLFloaterChat::getInstance()
- {
- return LLFloaterReg::getTypedInstance<LLFloaterChat>("chat", LLSD()) ;
-
- }
diff --git a/indra/newview/llfloaterchat.h b/indra/newview/llfloaterchat.h
deleted file mode 100644
index fb2aabbfdf..0000000000
--- a/indra/newview/llfloaterchat.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/**
- * @file llfloaterchat.h
- * @brief LLFloaterChat class definition
- *
- * $LicenseInfo:firstyear=2002&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-/*
- * Actually the "Chat History" floater.
- * Should be llfloaterchathistory, not llfloaterchat.
- */
-
-#ifndef LL_LLFLOATERCHAT_H
-#define LL_LLFLOATERCHAT_H
-
-#include "llfloater.h"
-#include "lllogchat.h"
-
-class LLChat;
-class LLPanelActiveSpeakers;
-class LLLogChat;
-
-class LLFloaterChat : public LLFloater
-{
-public:
- LLFloaterChat(const LLSD& seed);
- ~LLFloaterChat();
-
- virtual void draw();
- virtual BOOL postBuild();
-
- void updateConsoleVisibility();
-
- static void setHistoryCursorAndScrollToEnd();
-
- // *TODO:Skinning - move these to LLChat (or LLViewerChat?)
- // Add chat to console and history list.
- // Color based on source, type, distance.
- static void addChat(const LLChat& chat, BOOL local_agent = FALSE);
- // Add chat to history alone.
- static void addChatHistory(const LLChat& chat, bool log_to_file = true);
-
- static void triggerAlerts(const std::string& text);
-
- static void onClickMute(void *data);
- static void onClickToggleShowMute(LLUICtrl* caller, void *data);
- static void onClickToggleActiveSpeakers(void* userdata);
- static void chatFromLogFile(LLLogChat::ELogLineType type, const LLSD& line, void* userdata);
- static void loadHistory();
- static void* createSpeakersPanel(void* data);
- static void* createChatPanel(void* data);
-
- static LLFloaterChat* getInstance(); // *TODO:Skinning Deprecate
-
- LLPanelActiveSpeakers* mPanel;
- BOOL mScrolledToEnd;
-};
-
-#endif
diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp
deleted file mode 100644
index dc33e45dd4..0000000000
--- a/indra/newview/llfloaterchatterbox.cpp
+++ /dev/null
@@ -1,344 +0,0 @@
-/**
- * @file llfloaterchatterbox.cpp
- * @author Richard
- * @date 2007-05-08
- * @brief Implementation of the chatterbox integrated conversation ui
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloaterreg.h"
-#include "llfloaterchatterbox.h"
-#include "lluictrlfactory.h"
-#include "llfloaterfriends.h"
-#include "llfloatergroups.h"
-#include "llviewercontrol.h"
-#include "llvoicechannel.h"
-#include "llimpanel.h"
-#include "llimview.h"
-
-//
-// LLFloaterMyFriends
-//
-
-LLFloaterMyFriends::LLFloaterMyFriends(const LLSD& seed)
- : LLFloater(seed)
-{
- mFactoryMap["friends_panel"] = LLCallbackMap(LLFloaterMyFriends::createFriendsPanel, NULL);
- mFactoryMap["groups_panel"] = LLCallbackMap(LLFloaterMyFriends::createGroupsPanel, NULL);
- //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_my_friends.xml");
-}
-
-LLFloaterMyFriends::~LLFloaterMyFriends()
-{
-}
-
-BOOL LLFloaterMyFriends::postBuild()
-{
- return TRUE;
-}
-
-void LLFloaterMyFriends::onOpen(const LLSD& key)
-{
- if (key.asString() == "friends")
- {
- childShowTab("friends_and_groups", "friends_panel");
- }
- else if (key.asString() == "groups")
- {
- childShowTab("friends_and_groups", "groups_panel");
- }
-}
-
-//static
-void* LLFloaterMyFriends::createFriendsPanel(void* data)
-{
- return new LLPanelFriends();
-}
-
-//static
-void* LLFloaterMyFriends::createGroupsPanel(void* data)
-{
- return new LLPanelGroups();
-}
-
-//static
-LLFloaterMyFriends* LLFloaterMyFriends::getInstance()
-{
- return LLFloaterReg::getTypedInstance<LLFloaterMyFriends>("contacts", "friends") ;
-}
-
-//
-// LLFloaterChatterBox
-//
-LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed)
-: LLMultiFloater(seed),
- mActiveVoiceFloater(NULL)
-{
- mAutoResize = FALSE;
-
- //Called from floater reg: LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", FALSE);
-}
-
-LLFloaterChatterBox::~LLFloaterChatterBox()
-{
-}
-
-BOOL LLFloaterChatterBox::postBuild()
-{
- setVisibleCallback(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2));
-
- if (gSavedSettings.getBOOL("ContactsTornOff"))
- {
- LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance();
- if(floater_contacts)
- {
- // add then remove to set up relationship for re-attach
- addFloater(floater_contacts, FALSE);
- removeFloater(floater_contacts);
- // reparent to floater view
- gFloaterView->addChild(floater_contacts);
- }
- }
- else
- {
- addFloater(LLFloaterMyFriends::getInstance(), TRUE);
- }
-
- mTabContainer->lockTabs();
- return TRUE;
-}
-
-BOOL LLFloaterChatterBox::handleKeyHere(KEY key, MASK mask)
-{
- if (key == 'W' && mask == MASK_CONTROL)
- {
- LLFloater* floater = getActiveFloater();
- // is user closeable and is system closeable
- if (floater && floater->canClose())
- {
- if (floater->isCloseable())
- {
- floater->closeFloater();
- }
- else
- {
- // close chatterbox window if frontmost tab is reserved, non-closeable tab
- // such as contacts or near me
- closeFloater();
- }
- }
- return TRUE;
- }
-
- return LLMultiFloater::handleKeyHere(key, mask);
-}
-
-void LLFloaterChatterBox::draw()
-{
- // clear new im notifications when chatterbox is visible
- if (!isMinimized())
- {
- gIMMgr->clearNewIMNotification();
- }
- LLFloater* current_active_floater = getCurrentVoiceFloater();
- // set icon on tab for floater currently associated with active voice channel
- if(mActiveVoiceFloater != current_active_floater)
- {
- // remove image from old floater's tab
- if (mActiveVoiceFloater)
- {
- mTabContainer->setTabImage(mActiveVoiceFloater, "");
- }
- }
-
- // update image on current active tab
- if (current_active_floater)
- {
- LLColor4 icon_color = LLColor4::white;
- LLVoiceChannel* channelp = LLVoiceChannel::getCurrentVoiceChannel();
- if (channelp)
- {
- if (channelp->isActive())
- {
- icon_color = LLColor4::green;
- }
- else if (channelp->getState() == LLVoiceChannel::STATE_ERROR)
- {
- icon_color = LLColor4::red;
- }
- else // active, but not connected
- {
- icon_color = LLColor4::yellow;
- }
- }
- mTabContainer->setTabImage(current_active_floater, "active_voice_tab.tga", icon_color);
- }
-
- mActiveVoiceFloater = current_active_floater;
-
- LLMultiFloater::draw();
-}
-
-void LLFloaterChatterBox::onOpen(const LLSD& key)
-{
- //*TODO:Skinning show the session id associated with key
- if (key.asString() == "local")
- {
- }
- else if (key.isDefined())
- {
- /*LLFloaterIMPanel* impanel = gIMMgr->findFloaterBySession(key.asUUID());
- if (impanel)
- {
- impanel->openFloater();
- }*/
- }
-}
-
-void LLFloaterChatterBox::onVisibilityChange ( const LLSD& new_visibility )
-{
-}
-
-void LLFloaterChatterBox::removeFloater(LLFloater* floaterp)
-{
- if(!floaterp) return;
-
- if (floaterp->getName() == "chat floater")
- {
- // only my friends floater now locked
- mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1);
- gSavedSettings.setBOOL("ChatHistoryTornOff", TRUE);
- floaterp->setCanClose(TRUE);
- }
- else if (floaterp->getName() == "floater_my_friends")
- {
- // only chat floater now locked
- mTabContainer->lockTabs(mTabContainer->getNumLockedTabs() - 1);
- gSavedSettings.setBOOL("ContactsTornOff", TRUE);
- floaterp->setCanClose(TRUE);
- }
- LLMultiFloater::removeFloater(floaterp);
-}
-
-void LLFloaterChatterBox::addFloater(LLFloater* floaterp,
- BOOL select_added_floater,
- LLTabContainer::eInsertionPoint insertion_point)
-{
- if(!floaterp) return;
-
- S32 num_locked_tabs = mTabContainer->getNumLockedTabs();
-
- // already here
- if (floaterp->getHost() == this)
- {
- openFloater(floaterp->getKey());
- return;
- }
-
- // make sure my friends and chat history both locked when re-attaching chat history
- if (floaterp->getName() == "chat floater")
- {
- mTabContainer->unlockTabs();
- // add chat history as second tab if contact window is present, first tab otherwise
- if (getChildView("floater_my_friends"))
- {
- // assuming contacts window is first tab, select it
- mTabContainer->selectFirstTab();
- // and add ourselves after
- LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::RIGHT_OF_CURRENT);
- }
- else
- {
- LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START);
- }
-
- // make sure first two tabs are now locked
- mTabContainer->lockTabs(num_locked_tabs + 1);
- gSavedSettings.setBOOL("ChatHistoryTornOff", FALSE);
- floaterp->setCanClose(FALSE);
- }
- else if (floaterp->getName() == "floater_my_friends")
- {
- mTabContainer->unlockTabs();
- // add contacts window as first tab
- LLMultiFloater::addFloater(floaterp, select_added_floater, LLTabContainer::START);
- // make sure first two tabs are now locked
- mTabContainer->lockTabs(num_locked_tabs + 1);
- gSavedSettings.setBOOL("ContactsTornOff", FALSE);
- floaterp->setCanClose(FALSE);
- }
- else
- {
- LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
- // openFloater(floaterp->getKey());
- }
-
- // make sure active voice icon shows up for new tab
- if (floaterp == mActiveVoiceFloater)
- {
- mTabContainer->setTabImage(floaterp, "active_voice_tab.tga");
- }
-}
-
-//static
-LLFloaterChatterBox* LLFloaterChatterBox::getInstance()
-{
- return LLFloaterReg::getTypedInstance<LLFloaterChatterBox>("communicate", LLSD()) ;
-}
-
-//static
-LLFloater* LLFloaterChatterBox::getCurrentVoiceFloater()
-{
- if (!LLVoiceClient::getInstance()->voiceEnabled())
- {
- return NULL;
- }
- if (LLVoiceChannelProximal::getInstance() == LLVoiceChannel::getCurrentVoiceChannel())
- {
- return NULL;
- }
- else
- {
- LLFloaterChatterBox* floater = LLFloaterChatterBox::getInstance();
- if(!floater) return NULL;
- // iterator over all IM tabs (skip friends and near me)
- for (S32 i = 0; i < floater->getFloaterCount(); i++)
- {
- LLPanel* panelp = floater->mTabContainer->getPanelByIndex(i);
- if (panelp->getName() == "im_floater")
- {
- // only LLFloaterIMPanels are called "im_floater"
- LLFloaterIMPanel* im_floaterp = (LLFloaterIMPanel*)panelp;
- LLVoiceChannel* voice_channel = LLIMModel::getInstance()->getVoiceChannel(im_floaterp->getSessionID());
- if (voice_channel == LLVoiceChannel::getCurrentVoiceChannel())
- {
- return im_floaterp;
- }
- }
- }
- }
- return NULL;
-}
diff --git a/indra/newview/llfloaterchatterbox.h b/indra/newview/llfloaterchatterbox.h
deleted file mode 100644
index 3a8bfe2fa4..0000000000
--- a/indra/newview/llfloaterchatterbox.h
+++ /dev/null
@@ -1,80 +0,0 @@
-/**
- * @file llfloaterchatterbox.h
- * @author Richard
- * @date 2007-05-04
- * @brief Integrated friends and group management/communication tool
- *
- * $LicenseInfo:firstyear=2007&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATERCHATTERBOX_H
-#define LL_LLFLOATERCHATTERBOX_H
-
-#include "llfloater.h"
-#include "llmultifloater.h"
-#include "llstring.h"
-#include "llimpanel.h"
-
-class LLTabContainer;
-
-class LLFloaterChatterBox : public LLMultiFloater
-{
-public:
- LLFloaterChatterBox(const LLSD& seed);
- virtual ~LLFloaterChatterBox();
-
- /*virtual*/ BOOL postBuild();
- /*virtual*/ BOOL handleKeyHere(KEY key, MASK mask);
- /*virtual*/ void draw();
- /*virtual*/ void onOpen(const LLSD& key);
-
- /*virtual*/ void removeFloater(LLFloater* floaterp);
- /*virtual*/ void addFloater(LLFloater* floaterp,
- BOOL select_added_floater,
- LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
-
- static LLFloaterChatterBox* getInstance(); // *TODO:Skinning Deprecate
- static LLFloater* getCurrentVoiceFloater();
-
-protected:
- void onVisibilityChange ( const LLSD& new_visibility );
-
- LLFloater* mActiveVoiceFloater;
-};
-
-
-class LLFloaterMyFriends : public LLFloater
-{
-public:
- LLFloaterMyFriends(const LLSD& seed);
- virtual ~LLFloaterMyFriends();
-
- /*virtual*/ BOOL postBuild();
- /*virtual*/ void onOpen(const LLSD& key);
-
- static LLFloaterMyFriends* getInstance(); // *TODO:Skinning Deprecate
-
- static void* createFriendsPanel(void* data);
- static void* createGroupsPanel(void* data);
-};
-
-#endif // LL_LLFLOATERCHATTERBOX_H
diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp
deleted file mode 100644
index f93568d617..0000000000
--- a/indra/newview/llfloaterfriends.cpp
+++ /dev/null
@@ -1,807 +0,0 @@
-/**
- * @file llfloaterfriends.cpp
- * @author Phoenix
- * @date 2005-01-13
- * @brief Implementation of the friends floater
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llfloaterfriends.h"
-
-#include <sstream>
-
-#include "lldir.h"
-
-#include "llagent.h"
-#include "llappviewer.h" // for gLastVersionChannel
-#include "llfloateravatarpicker.h"
-#include "llviewerwindow.h"
-#include "llbutton.h"
-#include "llavataractions.h"
-#include "llinventorymodel.h"
-#include "llnamelistctrl.h"
-#include "llnotificationsutil.h"
-#include "llresmgr.h"
-#include "llscrolllistctrl.h"
-#include "llscrolllistitem.h"
-#include "llscrolllistcell.h"
-#include "lluictrlfactory.h"
-#include "llmenucommands.h"
-#include "llviewercontrol.h"
-#include "llviewermessage.h"
-#include "lleventtimer.h"
-#include "lltextbox.h"
-#include "llvoiceclient.h"
-
-// *TODO: Move more common stuff to LLAvatarActions?
-
-//Maximum number of people you can select to do an operation on at once.
-#define MAX_FRIEND_SELECT 20
-#define DEFAULT_PERIOD 5.0
-#define RIGHTS_CHANGE_TIMEOUT 5.0
-#define OBSERVER_TIMEOUT 0.5
-
-#define ONLINE_SIP_ICON_NAME "slim_icon_16_viewer.tga"
-
-// simple class to observe the calling cards.
-class LLLocalFriendsObserver : public LLFriendObserver, public LLEventTimer
-{
-public:
- LLLocalFriendsObserver(LLPanelFriends* floater) : mFloater(floater), LLEventTimer(OBSERVER_TIMEOUT)
- {
- mEventTimer.stop();
- }
- virtual ~LLLocalFriendsObserver()
- {
- mFloater = NULL;
- }
- virtual void changed(U32 mask)
- {
- // events can arrive quickly in bulk - we need not process EVERY one of them -
- // so we wait a short while to let others pile-in, and process them in aggregate.
- mEventTimer.start();
-
- // save-up all the mask-bits which have come-in
- mMask |= mask;
- }
- virtual BOOL tick()
- {
- mFloater->updateFriends(mMask);
-
- mEventTimer.stop();
- mMask = 0;
-
- return FALSE;
- }
-
-protected:
- LLPanelFriends* mFloater;
- U32 mMask;
-};
-
-LLPanelFriends::LLPanelFriends() :
- LLPanel(),
- LLEventTimer(DEFAULT_PERIOD),
- mObserver(NULL),
- mShowMaxSelectWarning(TRUE),
- mAllowRightsChange(TRUE),
- mNumRightsChanged(0)
-{
- mEventTimer.stop();
- mObserver = new LLLocalFriendsObserver(this);
- LLAvatarTracker::instance().addObserver(mObserver);
- // For notification when SIP online status changes.
- LLVoiceClient::getInstance()->addObserver(mObserver);
-}
-
-LLPanelFriends::~LLPanelFriends()
-{
- // For notification when SIP online status changes.
- LLVoiceClient::getInstance()->removeObserver(mObserver);
- LLAvatarTracker::instance().removeObserver(mObserver);
- delete mObserver;
-}
-
-BOOL LLPanelFriends::tick()
-{
- mEventTimer.stop();
- mPeriod = DEFAULT_PERIOD;
- mAllowRightsChange = TRUE;
- updateFriends(LLFriendObserver::ADD);
- return FALSE;
-}
-
-void LLPanelFriends::updateFriends(U32 changed_mask)
-{
- LLUUID selected_id;
- LLCtrlListInterface *friends_list = childGetListInterface("friend_list");
- if (!friends_list) return;
- LLCtrlScrollInterface *friends_scroll = childGetScrollInterface("friend_list");
- if (!friends_scroll) return;
-
- // We kill the selection warning, otherwise we'll spam with warning popups
- // if the maximum amount of friends are selected
- mShowMaxSelectWarning = false;
-
- std::vector<LLUUID> selected_friends = getSelectedIDs();
- if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE))
- {
- refreshNames(changed_mask);
- }
- else if(changed_mask & LLFriendObserver::POWERS)
- {
- --mNumRightsChanged;
- if(mNumRightsChanged > 0)
- {
- mPeriod = RIGHTS_CHANGE_TIMEOUT;
- mEventTimer.start();
- mAllowRightsChange = FALSE;
- }
- else
- {
- tick();
- }
- }
- if(selected_friends.size() > 0)
- {
- // only non-null if friends was already found. This may fail,
- // but we don't really care here, because refreshUI() will
- // clean up the interface.
- friends_list->setCurrentByID(selected_id);
- for(std::vector<LLUUID>::iterator itr = selected_friends.begin(); itr != selected_friends.end(); ++itr)
- {
- friends_list->setSelectedByValue(*itr, true);
- }
- }
-
- refreshUI();
- mShowMaxSelectWarning = true;
-}
-
-// virtual
-BOOL LLPanelFriends::postBuild()
-{
- mFriendsList = getChild<LLScrollListCtrl>("friend_list");
- mFriendsList->setMaxSelectable(MAX_FRIEND_SELECT);
- mFriendsList->setMaximumSelectCallback(boost::bind(&LLPanelFriends::onMaximumSelect));
- mFriendsList->setCommitOnSelectionChange(TRUE);
- mFriendsList->setContextMenu(LLScrollListCtrl::MENU_AVATAR);
- childSetCommitCallback("friend_list", onSelectName, this);
- getChild<LLScrollListCtrl>("friend_list")->setDoubleClickCallback(onClickIM, this);
-
- U32 changed_mask = LLFriendObserver::ADD | LLFriendObserver::REMOVE | LLFriendObserver::ONLINE;
- refreshNames(changed_mask);
-
- childSetAction("im_btn", onClickIM, this);
- childSetAction("profile_btn", onClickProfile, this);
- childSetAction("offer_teleport_btn", onClickOfferTeleport, this);
- childSetAction("pay_btn", onClickPay, this);
- childSetAction("add_btn", onClickAddFriend, this);
- childSetAction("remove_btn", onClickRemove, this);
-
- setDefaultBtn("im_btn");
-
- updateFriends(LLFriendObserver::ADD);
- refreshUI();
-
- // primary sort = online status, secondary sort = name
- mFriendsList->sortByColumn(std::string("friend_name"), TRUE);
- mFriendsList->sortByColumn(std::string("icon_online_status"), FALSE);
-
- return TRUE;
-}
-
-BOOL LLPanelFriends::addFriend(const LLUUID& agent_id)
-{
- LLAvatarTracker& at = LLAvatarTracker::instance();
- const LLRelationship* relationInfo = at.getBuddyInfo(agent_id);
- if(!relationInfo) return FALSE;
-
- bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(agent_id);
- bool isOnline = relationInfo->isOnline();
-
- std::string fullname;
- BOOL have_name = gCacheName->getFullName(agent_id, fullname);
-
- LLSD element;
- element["id"] = agent_id;
- LLSD& friend_column = element["columns"][LIST_FRIEND_NAME];
- friend_column["column"] = "friend_name";
- friend_column["value"] = fullname;
- friend_column["font"]["name"] = "SANSSERIF";
- friend_column["font"]["style"] = "NORMAL";
-
- LLSD& online_status_column = element["columns"][LIST_ONLINE_STATUS];
- online_status_column["column"] = "icon_online_status";
- online_status_column["type"] = "icon";
-
- if (isOnline)
- {
- friend_column["font"]["style"] = "BOLD";
- online_status_column["value"] = "icon_avatar_online.tga";
- }
- else if(isOnlineSIP)
- {
- friend_column["font"]["style"] = "BOLD";
- online_status_column["value"] = ONLINE_SIP_ICON_NAME;
- }
-
- LLSD& online_column = element["columns"][LIST_VISIBLE_ONLINE];
- online_column["column"] = "icon_visible_online";
- online_column["type"] = "checkbox";
- online_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS);
-
- LLSD& visible_map_column = element["columns"][LIST_VISIBLE_MAP];
- visible_map_column["column"] = "icon_visible_map";
- visible_map_column["type"] = "checkbox";
- visible_map_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION);
-
- LLSD& edit_my_object_column = element["columns"][LIST_EDIT_MINE];
- edit_my_object_column["column"] = "icon_edit_mine";
- edit_my_object_column["type"] = "checkbox";
- edit_my_object_column["value"] = relationInfo->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS);
-
- LLSD& edit_their_object_column = element["columns"][LIST_EDIT_THEIRS];
- edit_their_object_column["column"] = "icon_edit_theirs";
- edit_their_object_column["type"] = "checkbox";
- edit_their_object_column["enabled"] = "";
- edit_their_object_column["value"] = relationInfo->isRightGrantedFrom(LLRelationship::GRANT_MODIFY_OBJECTS);
-
- LLSD& update_gen_column = element["columns"][LIST_FRIEND_UPDATE_GEN];
- update_gen_column["column"] = "friend_last_update_generation";
- update_gen_column["value"] = have_name ? relationInfo->getChangeSerialNum() : -1;
-
- mFriendsList->addElement(element, ADD_BOTTOM);
- return have_name;
-}
-
-// propagate actual relationship to UI.
-// Does not resort the UI list because it can be called frequently. JC
-BOOL LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationship* info)
-{
- if (!info) return FALSE;
- LLScrollListItem* itemp = mFriendsList->getItem(agent_id);
- if (!itemp) return FALSE;
-
- bool isOnlineSIP = LLVoiceClient::getInstance()->isOnlineSIP(itemp->getUUID());
- bool isOnline = info->isOnline();
-
- std::string fullname;
- BOOL have_name = gCacheName->getFullName(agent_id, fullname);
-
- // Name of the status icon to use
- std::string statusIcon;
-
- if(isOnline)
- {
- statusIcon = "icon_avatar_online.tga";
- }
- else if(isOnlineSIP)
- {
- statusIcon = ONLINE_SIP_ICON_NAME;
- }
-
- itemp->getColumn(LIST_ONLINE_STATUS)->setValue(statusIcon);
-
- itemp->getColumn(LIST_FRIEND_NAME)->setValue(fullname);
- // render name of online friends in bold text
- ((LLScrollListText*)itemp->getColumn(LIST_FRIEND_NAME))->setFontStyle((isOnline || isOnlineSIP) ? LLFontGL::BOLD : LLFontGL::NORMAL);
- itemp->getColumn(LIST_VISIBLE_ONLINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS));
- itemp->getColumn(LIST_VISIBLE_MAP)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION));
- itemp->getColumn(LIST_EDIT_MINE)->setValue(info->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS));
- S32 change_generation = have_name ? info->getChangeSerialNum() : -1;
- itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(change_generation);
-
- // enable this item, in case it was disabled after user input
- itemp->setEnabled(TRUE);
-
- // Do not resort, this function can be called frequently.
- return have_name;
-}
-
-void LLPanelFriends::refreshRightsChangeList()
-{
- std::vector<LLUUID> friends = getSelectedIDs();
- S32 num_selected = friends.size();
-
- bool can_offer_teleport = num_selected >= 1;
- bool selected_friends_online = true;
-
- const LLRelationship* friend_status = NULL;
- for(std::vector<LLUUID>::iterator itr = friends.begin(); itr != friends.end(); ++itr)
- {
- friend_status = LLAvatarTracker::instance().getBuddyInfo(*itr);
- if (friend_status)
- {
- if(!friend_status->isOnline())
- {
- can_offer_teleport = false;
- selected_friends_online = false;
- }
- }
- else // missing buddy info, don't allow any operations
- {
- can_offer_teleport = false;
- }
- }
-
- if (num_selected == 0) // nothing selected
- {
- childSetEnabled("im_btn", FALSE);
- childSetEnabled("offer_teleport_btn", FALSE);
- }
- else // we have at least one friend selected...
- {
- // only allow IMs to groups when everyone in the group is online
- // to be consistent with context menus in inventory and because otherwise
- // offline friends would be silently dropped from the session
- childSetEnabled("im_btn", selected_friends_online || num_selected == 1);
- childSetEnabled("offer_teleport_btn", can_offer_teleport);
- }
-}
-
-struct SortFriendsByID
-{
- bool operator() (const LLScrollListItem* const a, const LLScrollListItem* const b) const
- {
- return a->getValue().asUUID() < b->getValue().asUUID();
- }
-};
-
-void LLPanelFriends::refreshNames(U32 changed_mask)
-{
- std::vector<LLUUID> selected_ids = getSelectedIDs();
- S32 pos = mFriendsList->getScrollPos();
-
- // get all buddies we know about
- LLAvatarTracker::buddy_map_t all_buddies;
- LLAvatarTracker::instance().copyBuddyList(all_buddies);
-
- BOOL have_names = TRUE;
-
- if(changed_mask & (LLFriendObserver::ADD | LLFriendObserver::REMOVE))
- {
- have_names &= refreshNamesSync(all_buddies);
- }
-
- if(changed_mask & LLFriendObserver::ONLINE)
- {
- have_names &= refreshNamesPresence(all_buddies);
- }
-
- if (!have_names)
- {
- mEventTimer.start();
- }
- // Changed item in place, need to request sort and update columns
- // because we might have changed data in a column on which the user
- // has already sorted. JC
- mFriendsList->updateSort();
-
- // re-select items
- mFriendsList->selectMultiple(selected_ids);
- mFriendsList->setScrollPos(pos);
-}
-
-BOOL LLPanelFriends::refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies)
-{
- mFriendsList->deleteAllItems();
-
- BOOL have_names = TRUE;
- LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
-
- for(; buddy_it != all_buddies.end(); ++buddy_it)
- {
- have_names &= addFriend(buddy_it->first);
- }
-
- return have_names;
-}
-
-BOOL LLPanelFriends::refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies)
-{
- std::vector<LLScrollListItem*> items = mFriendsList->getAllData();
- std::sort(items.begin(), items.end(), SortFriendsByID());
-
- LLAvatarTracker::buddy_map_t::const_iterator buddy_it = all_buddies.begin();
- std::vector<LLScrollListItem*>::const_iterator item_it = items.begin();
- BOOL have_names = TRUE;
-
- while(true)
- {
- if(item_it == items.end() || buddy_it == all_buddies.end())
- {
- break;
- }
-
- const LLUUID & buddy_uuid = buddy_it->first;
- const LLUUID & item_uuid = (*item_it)->getValue().asUUID();
- if(item_uuid == buddy_uuid)
- {
- const LLRelationship* info = buddy_it->second;
- if (!info)
- {
- ++item_it;
- continue;
- }
-
- S32 last_change_generation = (*item_it)->getColumn(LIST_FRIEND_UPDATE_GEN)->getValue().asInteger();
- if (last_change_generation < info->getChangeSerialNum())
- {
- // update existing item in UI
- have_names &= updateFriendItem(buddy_it->first, info);
- }
-
- ++buddy_it;
- ++item_it;
- }
- else if(item_uuid < buddy_uuid)
- {
- ++item_it;
- }
- else //if(item_uuid > buddy_uuid)
- {
- ++buddy_it;
- }
- }
-
- return have_names;
-}
-
-void LLPanelFriends::refreshUI()
-{
- BOOL single_selected = FALSE;
- BOOL multiple_selected = FALSE;
- int num_selected = mFriendsList->getAllSelected().size();
- if(num_selected > 0)
- {
- single_selected = TRUE;
- if(num_selected > 1)
- {
- multiple_selected = TRUE;
- }
- }
-
-
- //Options that can only be performed with one friend selected
- childSetEnabled("profile_btn", single_selected && !multiple_selected);
- childSetEnabled("pay_btn", single_selected && !multiple_selected);
-
- //Options that can be performed with up to MAX_FRIEND_SELECT friends selected
- //(single_selected will always be true in this situations)
- childSetEnabled("remove_btn", single_selected);
- childSetEnabled("im_btn", single_selected);
-// childSetEnabled("friend_rights", single_selected);
-
- refreshRightsChangeList();
-}
-
-std::vector<LLUUID> LLPanelFriends::getSelectedIDs()
-{
- LLUUID selected_id;
- std::vector<LLUUID> friend_ids;
- std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected();
- for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
- {
- friend_ids.push_back((*itr)->getUUID());
- }
- return friend_ids;
-}
-
-// static
-void LLPanelFriends::onSelectName(LLUICtrl* ctrl, void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
- if(panelp)
- {
- panelp->refreshUI();
- // check to see if rights have changed
- panelp->applyRightsToFriends();
- }
-}
-
-//static
-void LLPanelFriends::onMaximumSelect()
-{
- LLSD args;
- args["MAX_SELECT"] = llformat("%d", MAX_FRIEND_SELECT);
- LLNotificationsUtil::add("MaxListSelectMessage", args);
-};
-
-// static
-void LLPanelFriends::onClickProfile(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
- std::vector<LLUUID> ids = panelp->getSelectedIDs();
- if(ids.size() > 0)
- {
- LLUUID agent_id = ids[0];
- LLAvatarActions::showProfile(agent_id);
- }
-}
-
-// static
-void LLPanelFriends::onClickIM(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
- std::vector<LLUUID> ids = panelp->getSelectedIDs();
- if(ids.size() > 0)
- {
- if(ids.size() == 1)
- {
- LLAvatarActions::startIM(ids[0]);
- }
- else
- {
- LLAvatarActions::startConference(ids);
- }
- }
-}
-
-// static
-void LLPanelFriends::onPickAvatar(const std::vector<std::string>& names,
- const std::vector<LLUUID>& ids)
-{
- if (names.empty()) return;
- if (ids.empty()) return;
- LLAvatarActions::requestFriendshipDialog(ids[0], names[0]);
-}
-
-// static
-void LLPanelFriends::onClickAddFriend(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
- LLFloater* root_floater = gFloaterView->getParentFloater(panelp);
- LLFloaterAvatarPicker* picker = LLFloaterAvatarPicker::show(boost::bind(&LLPanelFriends::onPickAvatar, _1,_2), FALSE, TRUE);
- if (root_floater)
- {
- root_floater->addDependentFloater(picker);
- }
-}
-
-// static
-void LLPanelFriends::onClickRemove(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
- LLAvatarActions::removeFriendsDialog(panelp->getSelectedIDs());
-}
-
-// static
-void LLPanelFriends::onClickOfferTeleport(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
- LLAvatarActions::offerTeleport(panelp->getSelectedIDs());
-}
-
-// static
-void LLPanelFriends::onClickPay(void* user_data)
-{
- LLPanelFriends* panelp = (LLPanelFriends*)user_data;
-
- std::vector<LLUUID> ids = panelp->getSelectedIDs();
- if(ids.size() == 1)
- {
- LLAvatarActions::pay(ids[0]);
- }
-}
-
-void LLPanelFriends::confirmModifyRights(rights_map_t& ids, EGrantRevoke command)
-{
- if (ids.empty()) return;
-
- LLSD args;
- if(ids.size() > 0)
- {
- rights_map_t* rights = new rights_map_t(ids);
-
- // for single friend, show their name
- if(ids.size() == 1)
- {
- LLUUID agent_id = ids.begin()->first;
- std::string first, last;
- if(gCacheName->getName(agent_id, first, last))
- {
- args["FIRST_NAME"] = first;
- args["LAST_NAME"] = last;
- }
- if (command == GRANT)
- {
- LLNotificationsUtil::add("GrantModifyRights",
- args,
- LLSD(),
- boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
- }
- else
- {
- LLNotificationsUtil::add("RevokeModifyRights",
- args,
- LLSD(),
- boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
- }
- }
- else
- {
- if (command == GRANT)
- {
- LLNotificationsUtil::add("GrantModifyRightsMultiple",
- args,
- LLSD(),
- boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
- }
- else
- {
- LLNotificationsUtil::add("RevokeModifyRightsMultiple",
- args,
- LLSD(),
- boost::bind(&LLPanelFriends::modifyRightsConfirmation, this, _1, _2, rights));
- }
- }
- }
-}
-
-bool LLPanelFriends::modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights)
-{
- S32 option = LLNotificationsUtil::getSelectedOption(notification, response);
- if(0 == option)
- {
- sendRightsGrant(*rights);
- }
- else
- {
- // need to resync view with model, since user cancelled operation
- rights_map_t::iterator rights_it;
- for (rights_it = rights->begin(); rights_it != rights->end(); ++rights_it)
- {
- const LLRelationship* info = LLAvatarTracker::instance().getBuddyInfo(rights_it->first);
- updateFriendItem(rights_it->first, info);
- }
- }
- refreshUI();
-
- delete rights;
- return false;
-}
-
-void LLPanelFriends::applyRightsToFriends()
-{
- BOOL rights_changed = FALSE;
-
- // store modify rights separately for confirmation
- rights_map_t rights_updates;
-
- BOOL need_confirmation = FALSE;
- EGrantRevoke confirmation_type = GRANT;
-
- // this assumes that changes only happened to selected items
- std::vector<LLScrollListItem*> selected = mFriendsList->getAllSelected();
- for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr)
- {
- LLUUID id = (*itr)->getValue();
- const LLRelationship* buddy_relationship = LLAvatarTracker::instance().getBuddyInfo(id);
- if (buddy_relationship == NULL) continue;
-
- bool show_online_staus = (*itr)->getColumn(LIST_VISIBLE_ONLINE)->getValue().asBoolean();
- bool show_map_location = (*itr)->getColumn(LIST_VISIBLE_MAP)->getValue().asBoolean();
- bool allow_modify_objects = (*itr)->getColumn(LIST_EDIT_MINE)->getValue().asBoolean();
-
- S32 rights = buddy_relationship->getRightsGrantedTo();
- if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_ONLINE_STATUS) != show_online_staus)
- {
- rights_changed = TRUE;
- if(show_online_staus)
- {
- rights |= LLRelationship::GRANT_ONLINE_STATUS;
- }
- else
- {
- // ONLINE_STATUS necessary for MAP_LOCATION
- rights &= ~LLRelationship::GRANT_ONLINE_STATUS;
- rights &= ~LLRelationship::GRANT_MAP_LOCATION;
- // propagate rights constraint to UI
- (*itr)->getColumn(LIST_VISIBLE_MAP)->setValue(FALSE);
- }
- }
- if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MAP_LOCATION) != show_map_location)
- {
- rights_changed = TRUE;
- if(show_map_location)
- {
- // ONLINE_STATUS necessary for MAP_LOCATION
- rights |= LLRelationship::GRANT_MAP_LOCATION;
- rights |= LLRelationship::GRANT_ONLINE_STATUS;
- (*itr)->getColumn(LIST_VISIBLE_ONLINE)->setValue(TRUE);
- }
- else
- {
- rights &= ~LLRelationship::GRANT_MAP_LOCATION;
- }
- }
-
- // now check for change in modify object rights, which requires confirmation
- if(buddy_relationship->isRightGrantedTo(LLRelationship::GRANT_MODIFY_OBJECTS) != allow_modify_objects)
- {
- rights_changed = TRUE;
- need_confirmation = TRUE;
-
- if(allow_modify_objects)
- {
- rights |= LLRelationship::GRANT_MODIFY_OBJECTS;
- confirmation_type = GRANT;
- }
- else
- {
- rights &= ~LLRelationship::GRANT_MODIFY_OBJECTS;
- confirmation_type = REVOKE;
- }
- }
-
- if (rights_changed)
- {
- rights_updates.insert(std::make_pair(id, rights));
- // disable these ui elements until response from server
- // to avoid race conditions
- (*itr)->setEnabled(FALSE);
- }
- }
-
- // separately confirm grant and revoke of modify rights
- if (need_confirmation)
- {
- confirmModifyRights(rights_updates, confirmation_type);
- }
- else
- {
- sendRightsGrant(rights_updates);
- }
-}
-
-void LLPanelFriends::sendRightsGrant(rights_map_t& ids)
-{
- if (ids.empty()) return;
-
- LLMessageSystem* msg = gMessageSystem;
-
- // setup message header
- msg->newMessageFast(_PREHASH_GrantUserRights);
- msg->nextBlockFast(_PREHASH_AgentData);
- msg->addUUID(_PREHASH_AgentID, gAgent.getID());
- msg->addUUID(_PREHASH_SessionID, gAgent.getSessionID());
-
- rights_map_t::iterator id_it;
- rights_map_t::iterator end_it = ids.end();
- for(id_it = ids.begin(); id_it != end_it; ++id_it)
- {
- msg->nextBlockFast(_PREHASH_Rights);
- msg->addUUID(_PREHASH_AgentRelated, id_it->first);
- msg->addS32(_PREHASH_RelatedRights, id_it->second);
- }
-
- mNumRightsChanged = ids.size();
- gAgent.sendReliableMessage();
-}
diff --git a/indra/newview/llfloaterfriends.h b/indra/newview/llfloaterfriends.h
deleted file mode 100644
index a303477c95..0000000000
--- a/indra/newview/llfloaterfriends.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/**
- * @file llfloaterfriends.h
- * @author Phoenix
- * @date 2005-01-13
- * @brief Declaration of class for displaying the local agent's friends.
- *
- * $LicenseInfo:firstyear=2005&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLFLOATERFRIENDS_H
-#define LL_LLFLOATERFRIENDS_H
-
-#include "llpanel.h"
-#include "llstring.h"
-#include "lluuid.h"
-#include "lltimer.h"
-#include "llcallingcard.h"
-
-class LLFriendObserver;
-class LLRelationship;
-class LLScrollListItem;
-class LLScrollListCtrl;
-
-/**
- * @class LLPanelFriends
- * @brief An instance of this class is used for displaying your friends
- * and gives you quick access to all agents which a user relationship.
- *
- * @sa LLFloater
- */
-class LLPanelFriends : public LLPanel, public LLEventTimer
-{
-public:
- LLPanelFriends();
- virtual ~LLPanelFriends();
-
- /**
- * @brief This method either creates or brings to the front the
- * current instantiation of this floater. There is only once since
- * you can currently only look at your local friends.
- */
- virtual BOOL tick();
-
- /**
- * @brief This method is called in response to the LLAvatarTracker
- * sending out a changed() message.
- */
- void updateFriends(U32 changed_mask);
-
- virtual BOOL postBuild();
-
- // *HACK Made public to remove friends from LLAvatarIconCtrl context menu
- static bool handleRemove(const LLSD& notification, const LLSD& response);
-
-private:
-
- enum FRIENDS_COLUMN_ORDER
- {
- LIST_ONLINE_STATUS,
- LIST_FRIEND_NAME,
- LIST_VISIBLE_ONLINE,
- LIST_VISIBLE_MAP,
- LIST_EDIT_MINE,
- LIST_EDIT_THEIRS,
- LIST_FRIEND_UPDATE_GEN
- };
-
- // protected members
- typedef std::map<LLUUID, S32> rights_map_t;
- void refreshNames(U32 changed_mask);
- BOOL refreshNamesSync(const LLAvatarTracker::buddy_map_t & all_buddies);
- BOOL refreshNamesPresence(const LLAvatarTracker::buddy_map_t & all_buddies);
- void refreshUI();
- void refreshRightsChangeList();
- void applyRightsToFriends();
- BOOL addFriend(const LLUUID& agent_id);
- BOOL updateFriendItem(const LLUUID& agent_id, const LLRelationship* relationship);
-
- typedef enum
- {
- GRANT,
- REVOKE
- } EGrantRevoke;
- void confirmModifyRights(rights_map_t& ids, EGrantRevoke command);
- void sendRightsGrant(rights_map_t& ids);
-
- // return empty vector if nothing is selected
- std::vector<LLUUID> getSelectedIDs();
-
- // callback methods
- static void onSelectName(LLUICtrl* ctrl, void* user_data);
- static bool callbackAddFriend(const LLSD& notification, const LLSD& response);
- static bool callbackAddFriendWithMessage(const LLSD& notification, const LLSD& response);
- static void onPickAvatar(const std::vector<std::string>& names, const std::vector<LLUUID>& ids);
- static void onMaximumSelect();
-
- static void onClickIM(void* user_data);
- static void onClickProfile(void* user_data);
- static void onClickAddFriend(void* user_data);
- static void onClickRemove(void* user_data);
-
- static void onClickOfferTeleport(void* user_data);
- static void onClickPay(void* user_data);
-
- static void onClickModifyStatus(LLUICtrl* ctrl, void* user_data);
-
- bool modifyRightsConfirmation(const LLSD& notification, const LLSD& response, rights_map_t* rights);
-
-private:
- // member data
- LLFriendObserver* mObserver;
- LLUUID mAddFriendID;
- std::string mAddFriendName;
- LLScrollListCtrl* mFriendsList;
- BOOL mShowMaxSelectWarning;
- BOOL mAllowRightsChange;
- S32 mNumRightsChanged;
-};
-
-
-#endif // LL_LLFLOATERFRIENDS_H
diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp
deleted file mode 100644
index 4b7f9432e3..0000000000
--- a/indra/newview/llmenucommands.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * @file llmenucommands.cpp
- * @brief Implementations of menu commands.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#include "llviewerprecompiledheaders.h"
-
-#include "llmenucommands.h"
-
-#include "imageids.h"
-#include "llfloaterreg.h"
-#include "llfontgl.h"
-#include "llrect.h"
-#include "llerror.h"
-#include "llstring.h"
-#include "message.h"
-
-#include "llagentcamera.h"
-#include "llcallingcard.h"
-#include "llviewercontrol.h"
-//#include "llfirstuse.h"
-#include "llfloaterworldmap.h"
-#include "lllineeditor.h"
-#include "llstatusbar.h"
-#include "llimview.h"
-#include "lltextbox.h"
-#include "llui.h"
-#include "llviewergesture.h" // for triggering gestures
-#include "llviewermessage.h"
-#include "llviewerparceloverlay.h"
-#include "llviewerregion.h"
-#include "llviewerstats.h"
-#include "lluictrlfactory.h"
-#include "llviewerwindow.h"
-#include "llworld.h"
-#include "llworldmap.h"
-#include "llfocusmgr.h"
-#include "llnearbychatbar.h"
-
-void handle_mouselook(void*)
-{
- gAgentCamera.changeCameraToMouselook();
-}
-
-
-void handle_chat(void*)
-{
- // give focus to chatbar if it's open but not focused
- if (gSavedSettings.getBOOL("ChatVisible") &&
- gFocusMgr.childHasKeyboardFocus(LLNearbyChatBar::getInstance()->getChatBox()))
- {
- LLNearbyChatBar::stopChat();
- }
- else
- {
- LLNearbyChatBar::startChat(NULL);
- }
-}
-
-void handle_slash_key(void*)
-{
- // LLBottomTray::startChat("/");
- //
- // Don't do this, it results in a double-slash in the input field.
- // Another "/" will be automatically typed for us, because the WM_KEYDOWN event
- // that generated the menu accelerator call (and hence puts focus in
- // the chat edtior) will be followed by a "/" WM_CHAR character message,
- // which will type the slash. Yes, it's weird. It only matters for
- // menu accelerators that put input focus into a field. And Mac works
- // the same way. JC
-
- LLNearbyChatBar::startChat(NULL);
-}
diff --git a/indra/newview/llmenucommands.h b/indra/newview/llmenucommands.h
deleted file mode 100644
index fa845c6f02..0000000000
--- a/indra/newview/llmenucommands.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * @file llmenucommands.h
- * @brief Implementations of menu commands.
- *
- * $LicenseInfo:firstyear=2003&license=viewerlgpl$
- * Second Life Viewer Source Code
- * Copyright (C) 2010, Linden Research, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation;
- * version 2.1 of the License only.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- *
- * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
- * $/LicenseInfo$
- */
-
-#ifndef LL_LLMENUCOMMANDS_H
-#define LL_LLMENUCOMMANDS_H
-
-class LLUUID;
-
-void handle_mouselook(void*);
-void handle_chat(void*);
-void handle_return_key(void*);
-void handle_slash_key(void*);
-
-#endif
diff --git a/indra/newview/llnearbychathandler.cpp b/indra/newview/llnearbychathandler.cpp
index b8c42a85e6..9c3887377a 100644
--- a/indra/newview/llnearbychathandler.cpp
+++ b/indra/newview/llnearbychathandler.cpp
@@ -63,7 +63,8 @@ public:
typedef std::vector<LLHandle<LLToast> > toast_vec_t;
typedef std::list<LLHandle<LLToast> > toast_list_t;
- LLNearbyChatScreenChannel(const Params& p):LLScreenChannelBase(p)
+ LLNearbyChatScreenChannel(const Params& p)
+ : LLScreenChannelBase(p)
{
mStopProcessing = false;
@@ -384,7 +385,7 @@ void LLNearbyChatScreenChannel::arrangeToasts()
S32 channel_bottom = channel_rect.mBottom;
- S32 bottom = channel_bottom + 10;
+ S32 bottom = channel_bottom + 80;
S32 margin = gSavedSettings.getS32("ToastGap");
//sort active toasts
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index ef41c9104f..3a1b8d7623 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -76,7 +76,6 @@
#include "llinventoryfunctions.h"
#include "llpanellogin.h"
#include "llpanelblockedlist.h"
-#include "llmenucommands.h"
#include "llmoveview.h"
#include "llparcel.h"
#include "llrootview.h"
@@ -7992,7 +7991,6 @@ void initialize_menus()
view_listener_t::addMenu(new LLAdvancedAgentFlyingInfo(), "Agent.getFlying");
// World menu
- commit.add("World.Chat", boost::bind(&handle_chat, (void*)NULL));
view_listener_t::addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun");
view_listener_t::addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark");
view_listener_t::addMenu(new LLWorldPlaceProfile(), "World.PlaceProfile");
diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp
index 8ecf4a80b7..3959a021fe 100644
--- a/indra/newview/llvoicevivox.cpp
+++ b/indra/newview/llvoicevivox.cpp
@@ -61,7 +61,6 @@
#include "llviewerwindow.h"
#include "llviewercamera.h"
-#include "llfloaterfriends.h" //VIVOX, inorder to refresh communicate panel
#include "llviewernetwork.h"
#include "llnotificationsutil.h"
diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml
index c9b24bf325..21fcc50f6e 100644
--- a/indra/newview/skins/default/xui/en/floater_camera.xml
+++ b/indra/newview/skins/default/xui/en/floater_camera.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
open_positioning="specified"
- specified_left="320"
+ specified_left="458"
specified_bottom="80"
legacy_header_height="18"
can_minimize="true"
diff --git a/indra/newview/skins/default/xui/en/floater_chat_bar.xml b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
index 87606c1a2a..8d0cecdac3 100644
--- a/indra/newview/skins/default/xui/en/floater_chat_bar.xml
+++ b/indra/newview/skins/default/xui/en/floater_chat_bar.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
open_positioning="specified"
- specified_left="320"
+ specified_left="10"
specified_bottom="10"
height="60"
layout="topleft"
@@ -17,17 +17,17 @@
can_resize="true"
default_tab_group="1"
name="chat_bar"
- width="380">
+ width="300">
<panel
top="20"
class="panel_nearby_chat"
follow="all"
- width="380"
+ width="300"
height="0"
visible="false"
filename="panel_nearby_chat.xml"
name="nearby_chat" />
- <panel width="380"
+ <panel width="300"
height="31"
left="0"
bottom="-1"
@@ -48,7 +48,7 @@
text_pad_right="25"
tool_tip="Press Enter to say, Ctrl+Enter to shout"
top="2"
- width="335" />
+ width="255" />
<output_monitor
auto_update="true"
follows="right"
diff --git a/indra/newview/skins/default/xui/en/floater_moveview.xml b/indra/newview/skins/default/xui/en/floater_moveview.xml
index 6ba812abff..4d685ac8a9 100644
--- a/indra/newview/skins/default/xui/en/floater_moveview.xml
+++ b/indra/newview/skins/default/xui/en/floater_moveview.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
open_positioning="specified"
- specified_left="558"
+ specified_left="320"
specified_bottom="80"
legacy_header_height="18"
can_dock="false"
diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml
index eb03545cd7..f5fee9d384 100644
--- a/indra/newview/skins/default/xui/en/menu_viewer.xml
+++ b/indra/newview/skins/default/xui/en/menu_viewer.xml
@@ -219,12 +219,6 @@
label="Communicate"
name="Communicate"
tear_off="true">
- <!--menu_item_call
- label="Chat"
- name="Chat">
- <menu_item_call.on_click
- function="World.Chat" />
- </menu_item_call-->
<menu_item_check
label="Chat..."
name="Nearby Chat"