merging into latest changes

meow-7.2.2
MaximB ProductEngine 2012-11-27 23:21:27 +02:00
commit 407ee5d98f
4 changed files with 88 additions and 58 deletions

View File

@ -302,6 +302,7 @@ public:
/*virtual*/ void handleVisibilityChange ( BOOL new_visibility ); // do not override
void setFrontmost(BOOL take_focus = TRUE);
virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE);
// Defaults to false.
virtual BOOL canSaveAs() const { return FALSE; }
@ -373,7 +374,6 @@ protected:
void setInstanceName(const std::string& name);
virtual void bringToFront(S32 x, S32 y);
virtual void setVisibleAndFrontmost(BOOL take_focus=TRUE);
void setExpandedRect(const LLRect& rect) { mExpandedRect = rect; } // size when not minimized
const LLRect& getExpandedRect() const { return mExpandedRect; }

View File

@ -41,6 +41,7 @@
#include "llfloaterreg.h"//for LLFloaterReg::getTypedInstance
#include "llviewerwindow.h"//for screen channel position
#include "llfloaterimnearbychat.h"
#include "llfloaterimcontainer.h"
#include "llrootview.h"
#include "lllayoutstack.h"
@ -283,12 +284,6 @@ bool LLFloaterIMNearbyChatScreenChannel::createPoolToast()
void LLFloaterIMNearbyChatScreenChannel::addChat(LLSD& chat)
{
//Ignore Nearby Toasts
if(gSavedSettings.getString("NotificationNearbyChatOptions") != "toast")
{
return;
}
//look in pool. if there is any message
if(mStopProcessing)
return;
@ -606,19 +601,30 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
toast_msg = chat_msg.mText;
}
// Add a nearby chat toast.
LLUUID id;
id.generate();
chat["id"] = id;
std::string r_color_name = "White";
F32 r_color_alpha = 1.0f;
LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha);
chat["text_color"] = r_color_name;
chat["color_alpha"] = r_color_alpha;
chat["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
chat["message"] = toast_msg;
channel->addChat(chat);
//Will show toast when chat preference is set
if(gSavedSettings.getString("NotificationNearbyChatOptions") == "toast")
{
// Add a nearby chat toast.
LLUUID id;
id.generate();
chat["id"] = id;
std::string r_color_name = "White";
F32 r_color_alpha = 1.0f;
LLViewerChat::getChatColor( chat_msg, r_color_name, r_color_alpha);
chat["text_color"] = r_color_name;
chat["color_alpha"] = r_color_alpha;
chat["font_size"] = (S32)LLViewerChat::getChatFontSize() ;
chat["message"] = toast_msg;
channel->addChat(chat);
}
//Will show Conversations floater when chat preference is set
else if(gSavedSettings.getString("NotificationNearbyChatOptions") == "openconversations")
{
LLFloaterReg::showInstance("im_container");
}
}
}

View File

@ -116,79 +116,83 @@ static void on_avatar_name_cache_toast(const LLUUID& agent_id,
void on_new_message(const LLSD& msg)
{
std::string action;
LLUUID participant_id = msg["from_id"].asUUID();
LLUUID session_id = msg["session_id"].asUUID();
std::string action;
LLUUID participant_id = msg["from_id"].asUUID();
LLUUID session_id = msg["session_id"].asUUID();
LLIMModel::LLIMSession* session = LLIMModel::instance().findIMSession(session_id);
// determine action for this session
if (session_id.isNull())
{
action = gSavedSettings.getString("NotificationNearbyChatOptions");
action = gSavedSettings.getString("NotificationNearbyChatOptions");
}
else if(session->isP2PSessionType())
{
if (LLAvatarTracker::instance().isBuddy(participant_id))
{
action = gSavedSettings.getString("NotificationFriendIMOptions");
action = gSavedSettings.getString("NotificationFriendIMOptions");
}
else
{
action = gSavedSettings.getString("NotificationNonFriendIMOptions");
action = gSavedSettings.getString("NotificationNonFriendIMOptions");
}
}
else if(session->isAdHocSessionType())
{
action = gSavedSettings.getString("NotificationConferenceIMOptions");
action = gSavedSettings.getString("NotificationConferenceIMOptions");
}
else if(session->isGroupSessionType())
{
action = gSavedSettings.getString("NotificationGroupChatOptions");
action = gSavedSettings.getString("NotificationGroupChatOptions");
}
// do not show notification in "do not disturb" mode or it goes from agent
if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id)
{
return;
}
// do not show notification in "do not disturb" mode or it goes from agent
if (gAgent.isDoNotDisturb() || gAgent.getID() == participant_id)
{
return;
}
// execution of the action
// execution of the action
if ("toast" == action)
{
// Skip toasting if we have open window of IM with this session id
if ("toast" == action)
{
// Skip toasting if we have open window of IM with this session id
LLFloaterIMSession* open_im_floater = LLFloaterIMSession::findInstance(session_id);
if (
open_im_floater
&& open_im_floater->isInVisibleChain()
&& open_im_floater->hasFocus()
&& !open_im_floater->isMinimized()
&& !(open_im_floater->getHost()
&& open_im_floater->getHost()->isMinimized())
)
open_im_floater
&& open_im_floater->isInVisibleChain()
&& open_im_floater->hasFocus()
&& !open_im_floater->isMinimized()
&& !(open_im_floater->getHost()
&& open_im_floater->getHost()->isMinimized())
)
{
return;
}
// Skip toasting for system messages
if (participant_id.isNull())
{
return;
}
// Skip toasting for system messages
if (participant_id.isNull())
{
return;
}
//Show toast
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
}
else if ("flash" == action)
{
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
if (im_box)
LLAvatarNameCache::get(participant_id, boost::bind(&on_avatar_name_cache_toast, _1, _2, msg));
}
else if ("flash" == action)
{
LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
if (im_box)
{
im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item
im_box->flashConversationItemWidget(session_id, true); // flashing of the conversation's item
}
gToolBarView->flashCommand(LLCommandId("chat"), true); // flashing of the FUI button "Chat"
}
}
else if("openconversations" == action)
{
LLFloaterReg::showInstance("im_container");
}
}
LLIMModel::LLIMModel()
@ -1725,7 +1729,7 @@ BOOL LLCallDialog::postBuild()
return FALSE;
dockToToolbarButton("speak");
return TRUE;
}

View File

@ -134,6 +134,10 @@
top_delta="-6"
name="FriendIMOptions"
width="223">
<combo_box.item
label="Open Conversations window"
name="OpenConversationsWindow"
value="openconversations"/>
<combo_box.item
label="Pop up the message"
name="PopUpMessage"
@ -165,6 +169,10 @@
top_delta="-6"
name="NonFriendIMOptions"
width="223">
<combo_box.item
label="Open Conversations window"
name="OpenConversationsWindow"
value="openconversations"/>
<combo_box.item
label="Pop up the message"
name="PopUpMessage"
@ -196,6 +204,10 @@
top_delta="-6"
name="ConferenceIMOptions"
width="223">
<combo_box.item
label="Open Conversations window"
name="OpenConversationsWindow"
value="openconversations"/>
<combo_box.item
label="Pop up the message"
name="PopUpMessage"
@ -227,6 +239,10 @@
top_delta="-6"
name="GroupChatOptions"
width="223">
<combo_box.item
label="Open Conversations window"
name="OpenConversationsWindow"
value="openconversations"/>
<combo_box.item
label="Pop up the message"
name="PopUpMessage"
@ -258,6 +274,10 @@
top_delta="-6"
name="NearbyChatOptions"
width="223">
<combo_box.item
label="Open Conversations window"
name="OpenConversationsWindow"
value="openconversations"/>
<combo_box.item
label="Pop up the message"
name="PopUpMessage"