Pull merge from richard/viewer-chui
commit
1c1b09f9a7
|
|
@ -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");
|
||||
|
|
@ -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<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 */
|
||||
/************************************************************************/
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 458 B |
|
|
@ -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" />
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
@ -80,54 +80,6 @@
|
|||
<layout_panel auto_resize="false"
|
||||
width="4"
|
||||
min_width="4"/>
|
||||
<layout_panel
|
||||
auto_resize="false"
|
||||
follows="right"
|
||||
height="28"
|
||||
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"
|
||||
|
|
|
|||
Loading…
Reference in New Issue