summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llchiclet.cpp98
-rw-r--r--indra/newview/llchiclet.h48
-rw-r--r--indra/newview/llchicletbar.cpp1
-rw-r--r--indra/newview/llsyswellwindow.cpp38
-rw-r--r--indra/newview/skins/default/textures/bottomtray/Unread_IM.pngbin458 -> 0 bytes
-rw-r--r--indra/newview/skins/default/textures/textures.xml1
-rw-r--r--indra/newview/skins/default/xui/en/menu_im_well_button.xml16
-rw-r--r--indra/newview/skins/default/xui/en/panel_chiclet_bar.xml48
8 files changed, 12 insertions, 238 deletions
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index d6860640b7..a665aeb6bd 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -52,7 +52,6 @@
#include "llsyswellwindow.h"
static LLDefaultChildRegistry::Register<LLChicletPanel> t1("chiclet_panel");
-static LLDefaultChildRegistry::Register<LLIMWellChiclet> t2_0("chiclet_im_well");
static LLDefaultChildRegistry::Register<LLNotificationChiclet> t2("chiclet_notification");
static LLDefaultChildRegistry::Register<LLIMP2PChiclet> t3("chiclet_im_p2p");
static LLDefaultChildRegistry::Register<LLIMGroupChiclet> t4("chiclet_im_group");
@@ -177,103 +176,6 @@ BOOL LLSysWellChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask)
}
/************************************************************************/
-/* LLIMWellChiclet implementation */
-/************************************************************************/
-LLIMWellChiclet::LLIMWellChiclet(const Params& p)
-: LLSysWellChiclet(p)
-{
- LLIMModel::instance().addNewMsgCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1));
- LLIMModel::instance().addNoUnreadMsgsCallback(boost::bind(&LLIMWellChiclet::messageCountChanged, this, _1));
-
- LLIMMgr::getInstance()->addSessionObserver(this);
-
- LLIMWellWindow::getInstance()->setSysWellChiclet(this);
-}
-
-LLIMWellChiclet::~LLIMWellChiclet()
-{
- LLIMWellWindow* im_well_window = LLIMWellWindow::findInstance();
- if (im_well_window)
- {
- im_well_window->setSysWellChiclet(NULL);
- }
-
- LLIMMgr::getInstance()->removeSessionObserver(this);
-}
-
-void LLIMWellChiclet::onMenuItemClicked(const LLSD& user_data)
-{
- std::string action = user_data.asString();
- if("close all" == action)
- {
- LLIMWellWindow::getInstance()->closeAll();
- }
-}
-
-bool LLIMWellChiclet::enableMenuItem(const LLSD& user_data)
-{
- std::string item = user_data.asString();
- if (item == "can close all")
- {
- return !LLIMWellWindow::getInstance()->isWindowEmpty();
- }
- return true;
-}
-
-void LLIMWellChiclet::createMenu()
-{
- if(mContextMenu)
- {
- llwarns << "Menu already exists" << llendl;
- return;
- }
-
- LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
- registrar.add("IMWellChicletMenu.Action",
- boost::bind(&LLIMWellChiclet::onMenuItemClicked, this, _2));
-
- LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable_registrar;
- enable_registrar.add("IMWellChicletMenu.EnableItem",
- boost::bind(&LLIMWellChiclet::enableMenuItem, this, _2));
-
- mContextMenu = LLUICtrlFactory::getInstance()->createFromFile<LLContextMenu>
- ("menu_im_well_button.xml",
- LLMenuGL::sMenuContainer,
- LLViewerMenuHolderGL::child_registry_t::instance());
-}
-
-void LLIMWellChiclet::messageCountChanged(const LLSD& session_data)
-{
- // The singleton class LLChicletBar instance might be already deleted
- // so don't create a new one.
- if (!LLChicletBar::instanceExists())
- {
- return;
- }
-
- const LLUUID& session_id = session_data["session_id"];
- const S32 counter = LLChicletBar::getInstance()->getTotalUnreadIMCount();
- const bool im_not_visible = !LLFloaterReg::instanceVisible("im_container")
- && !LLFloaterReg::instanceVisible("impanel", session_id);
-
- setNewMessagesState(counter > mCounter && im_not_visible);
-
- // we have to flash to 'Lit' state each time new unread message is coming.
- if (counter > mCounter && im_not_visible)
- {
- mFlashToLitTimer->startFlashing();
- }
- else if (counter == 0)
- {
- // if notification is resolved while well is flashing it can leave in the 'Lit' state
- // when flashing finishes itself. Let break flashing here.
- mFlashToLitTimer->stopFlashing();
- }
-
- setCounter(counter);
-}
-
-/************************************************************************/
/* LLNotificationChiclet implementation */
/************************************************************************/
LLNotificationChiclet::LLNotificationChiclet(const Params& p)
diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h
index 79ffad92ef..7f72c7f9e2 100644
--- a/indra/newview/llchiclet.h
+++ b/indra/newview/llchiclet.h
@@ -865,54 +865,6 @@ protected:
LLContextMenu* mContextMenu;
};
-/**
- * Class represented a chiclet for IM Well Icon.
- *
- * It displays a count of unread messages from other participants in all IM sessions.
- */
-class LLIMWellChiclet : public LLSysWellChiclet, LLIMSessionObserver
-{
- friend class LLUICtrlFactory;
-public:
- /*virtual*/ void sessionAdded(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id, BOOL has_offline_msg) {}
- /*virtual*/ void sessionActivated(const LLUUID& session_id, const std::string& name, const LLUUID& other_participant_id) {}
- /*virtual*/ void sessionVoiceOrIMStarted(const LLUUID& session_id) {};
- /*virtual*/ void sessionRemoved(const LLUUID& session_id) { messageCountChanged(LLSD()); }
- /*virtual*/ void sessionIDUpdated(const LLUUID& old_session_id, const LLUUID& new_session_id) {}
-
- ~LLIMWellChiclet();
-protected:
- LLIMWellChiclet(const Params& p);
-
- /**
- * Processes clicks on chiclet popup menu.
- */
- virtual void onMenuItemClicked(const LLSD& user_data);
-
- /**
- * Enables chiclet menu items.
- */
- bool enableMenuItem(const LLSD& user_data);
-
- /**
- * Creates menu.
- */
- /*virtual*/ void createMenu();
-
- /**
- * Handles changes in a session (message was added, messages were read, etc.)
- *
- * It get total count of unread messages from a LLIMMgr in all opened sessions and display it.
- *
- * @param[in] session_data contains session related data, is not used now
- * ["session_id"] - id of an appropriate session
- * ["participant_unread"] - count of unread messages from "real" participants.
- *
- * @see LLIMMgr::getNumberOfUnreadParticipantMessages()
- */
- void messageCountChanged(const LLSD& session_data);
-};
-
class LLNotificationChiclet : public LLSysWellChiclet
{
LOG_CLASS(LLNotificationChiclet);
diff --git a/indra/newview/llchicletbar.cpp b/indra/newview/llchicletbar.cpp
index c66ae1cdd0..cfcde64e7b 100644
--- a/indra/newview/llchicletbar.cpp
+++ b/indra/newview/llchicletbar.cpp
@@ -158,7 +158,6 @@ BOOL LLChicletBar::postBuild()
mToolbarStack = getChild<LLLayoutStack>("toolbar_stack");
mChicletPanel = getChild<LLChicletPanel>("chiclet_list");
- showWellButton("im_well", !LLIMWellWindow::getInstance()->isWindowEmpty());
showWellButton("notification_well", !LLNotificationWellWindow::getInstance()->isWindowEmpty());
LLPanelTopInfoBar::instance().setResizeCallback(boost::bind(&LLChicletBar::fitWithTopInfoBar, this));
diff --git a/indra/newview/llsyswellwindow.cpp b/indra/newview/llsyswellwindow.cpp
index 7c000f2dd0..3605129d48 100644
--- a/indra/newview/llsyswellwindow.cpp
+++ b/indra/newview/llsyswellwindow.cpp
@@ -98,8 +98,10 @@ void LLSysWellWindow::onStartUpToastClick(S32 x, S32 y, MASK mask)
void LLSysWellWindow::setSysWellChiclet(LLSysWellChiclet* chiclet)
{
mSysWellChiclet = chiclet;
- if(mSysWellChiclet)
- mSysWellChiclet->updateWidget(isWindowEmpty());
+ if(NULL != mSysWellChiclet)
+ {
+ mSysWellChiclet->updateWidget(isWindowEmpty());
+ }
}
//---------------------------------------------------------------------------------
LLSysWellWindow::~LLSysWellWindow()
@@ -111,7 +113,10 @@ void LLSysWellWindow::removeItemByID(const LLUUID& id)
{
if(mMessageList->removeItemByValue(id))
{
- mSysWellChiclet->updateWidget(isWindowEmpty());
+ if (NULL != mSysWellChiclet)
+ {
+ mSysWellChiclet->updateWidget(isWindowEmpty());
+ }
reshapeWindow();
}
else
@@ -685,11 +690,7 @@ void LLIMWellWindow::addIMRow(const LLUUID& sessionId, S32 chicletCounter,
const std::string& name, const LLUUID& otherParticipantId)
{
RowPanel* item = new RowPanel(this, sessionId, chicletCounter, name, otherParticipantId);
- if (mMessageList->addItem(item, sessionId))
- {
- mSysWellChiclet->updateWidget(isWindowEmpty());
- }
- else
+ if (!mMessageList->addItem(item, sessionId))
{
llwarns << "Unable to add IM Row into the list, sessionID: " << sessionId
<< ", name: " << name
@@ -710,11 +711,7 @@ void LLIMWellWindow::delIMRow(const LLUUID& sessionId)
//But I didn't find why this happen..
gFocusMgr.clearLastFocusForGroup(this);
- if (mMessageList->removeItemByValue(sessionId))
- {
- mSysWellChiclet->updateWidget(isWindowEmpty());
- }
- else
+ if (!mMessageList->removeItemByValue(sessionId))
{
llwarns << "Unable to remove IM Row from the list, sessionID: " << sessionId
<< llendl;
@@ -740,11 +737,7 @@ void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_messag
if (mMessageList->getItemByValue(notification_id) == NULL)
{
ObjectRowPanel* item = new ObjectRowPanel(notification_id, new_message);
- if (mMessageList->addItem(item, notification_id))
- {
- mSysWellChiclet->updateWidget(isWindowEmpty());
- }
- else
+ if (!mMessageList->addItem(item, notification_id))
{
llwarns << "Unable to add Object Row into the list, notificationID: " << notification_id << llendl;
item->die();
@@ -755,14 +748,7 @@ void LLIMWellWindow::addObjectRow(const LLUUID& notification_id, bool new_messag
void LLIMWellWindow::removeObjectRow(const LLUUID& notification_id)
{
- if (mMessageList->removeItemByValue(notification_id))
- {
- if (mSysWellChiclet)
- {
- mSysWellChiclet->updateWidget(isWindowEmpty());
- }
- }
- else
+ if (!mMessageList->removeItemByValue(notification_id))
{
llwarns << "Unable to remove Object Row from the list, notificationID: " << notification_id << llendl;
}
diff --git a/indra/newview/skins/default/textures/bottomtray/Unread_IM.png b/indra/newview/skins/default/textures/bottomtray/Unread_IM.png
deleted file mode 100644
index 5c0c85b864..0000000000
--- a/indra/newview/skins/default/textures/bottomtray/Unread_IM.png
+++ /dev/null
Binary files differ
diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml
index a124041565..8d9fa52309 100644
--- a/indra/newview/skins/default/textures/textures.xml
+++ b/indra/newview/skins/default/textures/textures.xml
@@ -642,7 +642,6 @@ with the same filename but different name
<texture name="TrashItem_Press" file_name="icons/TrashItem_Press.png" preload="false" />
<texture name="Unread_Chiclet" file_name="bottomtray/Unread_Chiclet.png" preload="false" />
- <texture name="Unread_IM" file_name="bottomtray/Unread_IM.png" preload="false" />
<texture name="UpArrow_Off" file_name="icons/UpArrow_Off.png" preload="false" />
diff --git a/indra/newview/skins/default/xui/en/menu_im_well_button.xml b/indra/newview/skins/default/xui/en/menu_im_well_button.xml
deleted file mode 100644
index f8dfba91ff..0000000000
--- a/indra/newview/skins/default/xui/en/menu_im_well_button.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
-<context_menu
- layout="topleft"
- name="IM Well Button Context Menu">
- <menu_item_call
- label="Close All"
- layout="topleft"
- name="Close All">
- <menu_item_call.on_click
- function="IMWellChicletMenu.Action"
- parameter="close all" />
- <menu_item_call.on_enable
- function="IMWellChicletMenu.EnableItem"
- parameter="can close all" />
- </menu_item_call>
-</context_menu>
diff --git a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
index ff0146490b..fc321fdd23 100644
--- a/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
+++ b/indra/newview/skins/default/xui/en/panel_chiclet_bar.xml
@@ -87,54 +87,6 @@
layout="topleft"
min_height="28"
min_width="37"
- name="im_well_panel"
- top="0"
- width="37">
- <chiclet_im_well
- follows="right"
- height="28"
- layout="topleft"
- left="0"
- max_displayed_count="99"
- name="im_well"
- top="0"
- width="35">
- <!--
-Emulate 4 states of button by background images, see details in EXT-3147. The same should be for notification_well button
-xml attribute Description
-image_unselected "Unlit" - there are no new messages
-image_selected "Unlit" + "Selected" - there are no new messages and the Well is open
-image_pressed "Lit" - there are new messages
-image_pressed_selected "Lit" + "Selected" - there are new messages and the Well is open
- -->
- <button
- auto_resize="false"
- follows="right"
- halign="center"
- height="23"
- image_overlay="Unread_IM"
- image_overlay_alignment="center"
- image_pressed="WellButton_Lit"
- image_pressed_selected="WellButton_Lit_Selected"
- image_selected="PushButton_Press"
- label_color="Black"
- left="0"
- name="Unread IM messages"
- tool_tip="Conversations"
- width="34">
- <init_callback
- function="Button.SetDockableFloaterToggle"
- parameter="im_well_window" />
- </button>
- </chiclet_im_well>
- </layout_panel>
- <layout_panel
- auto_resize="false"
- follows="right"
- height="28"
- layout="topleft"
- min_height="28"
- min_width="37"
name="notification_well_panel"
top="0"
width="37">