From 15157ecb095838f402edb750b87ea0bdb9fb56f7 Mon Sep 17 00:00:00 2001 From: maksymsproductengine Date: Thu, 29 Nov 2012 03:27:45 +0200 Subject: CHUI-553 FIXED Remove the conversation chiclet --- indra/newview/llchiclet.cpp | 98 --------------------- indra/newview/llchiclet.h | 48 ---------- indra/newview/llchicletbar.cpp | 1 - indra/newview/llsyswellwindow.cpp | 38 +++----- .../default/textures/bottomtray/Unread_IM.png | Bin 458 -> 0 bytes indra/newview/skins/default/textures/textures.xml | 1 - .../skins/default/xui/en/menu_im_well_button.xml | 16 ---- .../skins/default/xui/en/panel_chiclet_bar.xml | 48 ---------- 8 files changed, 12 insertions(+), 238 deletions(-) delete mode 100644 indra/newview/skins/default/textures/bottomtray/Unread_IM.png delete mode 100644 indra/newview/skins/default/xui/en/menu_im_well_button.xml (limited to 'indra') 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 t1("chiclet_panel"); -static LLDefaultChildRegistry::Register t2_0("chiclet_im_well"); static LLDefaultChildRegistry::Register t2("chiclet_notification"); static LLDefaultChildRegistry::Register t3("chiclet_im_p2p"); static LLDefaultChildRegistry::Register t4("chiclet_im_group"); @@ -176,103 +175,6 @@ BOOL LLSysWellChiclet::handleRightMouseDown(S32 x, S32 y, MASK mask) return TRUE; } -/************************************************************************/ -/* 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 - ("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 */ /************************************************************************/ 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("toolbar_stack"); mChicletPanel = getChild("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 Binary files a/indra/newview/skins/default/textures/bottomtray/Unread_IM.png and /dev/null 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 - 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 @@ - - - - - - - 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 @@ -80,54 +80,6 @@ - - - - - -