Merge viewer-lion

master
Ansariel 2016-05-23 17:41:19 +02:00
commit 71f1707b99
13 changed files with 111 additions and 30 deletions

View File

@ -1422,12 +1422,9 @@ void LLFloater::setMinimized(BOOL minimize)
}
mMinimized = FALSE;
setFrontmost();
// Reshape *after* setting mMinimized
reshape( mExpandedRect.getWidth(), mExpandedRect.getHeight(), TRUE );
// <FS:Ansariel> FIRE-7530: Make sure, an un-minimized floater goes to the front
setFrontmost();
}
make_ui_sound("UISndWindowClose");

View File

@ -199,6 +199,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p)
: LLUICtrl(p, LLTextViewModelPtr(new LLTextViewModel)),
mURLClickSignal(NULL),
mIsFriendSignal(NULL),
mIsObjectBlockedSignal(NULL),
mMaxTextByteLength( p.max_text_length ),
mFont(p.font),
mFontShadow(p.font_shadow),
@ -2064,6 +2065,7 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
registrar.add("Url.OpenExternal", boost::bind(&LLUrlAction::openURLExternal, url));
registrar.add("Url.Execute", boost::bind(&LLUrlAction::executeSLURL, url, true));
registrar.add("Url.Block", boost::bind(&LLUrlAction::blockObject, url));
registrar.add("Url.Unblock", boost::bind(&LLUrlAction::unblockObject, url));
registrar.add("Url.Teleport", boost::bind(&LLUrlAction::teleportToLocation, url));
registrar.add("Url.ShowProfile", boost::bind(&LLUrlAction::showProfile, url));
registrar.add("Url.AddFriend", boost::bind(&LLUrlAction::addFriend, url));
@ -2119,6 +2121,19 @@ void LLTextBase::createUrlContextMenu(S32 x, S32 y, const std::string &in_url)
removeFriendButton->setEnabled(isFriend);
}
}
if (mIsObjectBlockedSignal)
{
bool is_blocked = *(*mIsObjectBlockedSignal)(LLUUID(LLUrlAction::getObjectId(url)), LLUrlAction::getObjectName(url));
LLView* blockButton = mPopupMenu->getChild<LLView>("block_object");
LLView* unblockButton = mPopupMenu->getChild<LLView>("unblock_object");
if (blockButton && unblockButton)
{
blockButton->setVisible(!is_blocked);
unblockButton->setVisible(is_blocked);
}
}
if (mPopupMenu)
{
@ -3257,6 +3272,15 @@ boost::signals2::connection LLTextBase::setIsFriendCallback(const is_friend_sign
return mIsFriendSignal->connect(cb);
}
boost::signals2::connection LLTextBase::setIsObjectBlockedCallback(const is_blocked_signal_t::slot_type& cb)
{
if (!mIsObjectBlockedSignal)
{
mIsObjectBlockedSignal = new is_blocked_signal_t();
}
return mIsObjectBlockedSignal->connect(cb);
}
//
// LLTextSegment
//

View File

@ -292,6 +292,7 @@ public:
friend class LLUICtrlFactory;
typedef boost::signals2::signal<bool (const LLUUID& user_id)> is_friend_signal_t;
typedef boost::signals2::signal<bool (const LLUUID& blocked_id, const std::string from)> is_blocked_signal_t;
struct LineSpacingParams : public LLInitParam::ChoiceBlock<LineSpacingParams>
{
@ -500,6 +501,7 @@ public:
virtual void appendWidget(const LLInlineViewSegment::Params& params, const std::string& text, bool allow_undo);
boost::signals2::connection setURLClickedCallback(const commit_signal_t::slot_type& cb);
boost::signals2::connection setIsFriendCallback(const is_friend_signal_t::slot_type& cb);
boost::signals2::connection setIsObjectBlockedCallback(const is_blocked_signal_t::slot_type& cb);
void setWordWrap(bool wrap);
LLScrollContainer* getScrollContainer() const { return mScroller; }
@ -750,6 +752,7 @@ protected:
// Used to check if user with given ID is avatar's friend
is_friend_signal_t* mIsFriendSignal;
is_blocked_signal_t* mIsObjectBlockedSignal;
LLUIString mLabel; // text label that is visible when no user text provided
// <FS:Ansariel> Optional icon position

View File

@ -232,6 +232,16 @@ void LLUrlAction::blockObject(std::string url)
}
}
void LLUrlAction::unblockObject(std::string url)
{
std::string object_id = getObjectId(url);
std::string object_name = getObjectName(url);
if (LLUUID::validate(object_id))
{
executeSLURL("secondlife:///app/agent/" + object_id + "/unblock/" + object_name);
}
}
// <FS:Ansariel> FSSlurlCommand support
LLUUID LLUrlAction::extractUuidFromSlurl(const std::string& url)
{

View File

@ -83,6 +83,7 @@ public:
static void addFriend(std::string url);
static void removeFriend(std::string url);
static void blockObject(std::string url);
static void unblockObject(std::string url);
// <FS:Ansariel> FSSlurlCommand support
static LLUUID extractUuidFromSlurl(const std::string& url);

View File

@ -169,6 +169,10 @@ public:
LLFloaterSidePanelContainer::showPanel("people", "panel_people",
LLSD().with("people_panel_tab_name", "blocked_panel").with("blocked_to_select", getAvatarId()));
}
else if (level == "unblock")
{
LLMuteList::getInstance()->remove(LLMute(getAvatarId(), mFrom, LLMute::OBJECT));
}
else if (level == "map")
{
std::string url = "secondlife://" + mObjectData["slurl"].asString();
@ -182,10 +186,14 @@ public:
}
bool onObjectIconContextMenuItemEnabled(const LLSD& userdata)
bool onObjectIconContextMenuItemVisible(const LLSD& userdata)
{
std::string level = userdata.asString();
if (level == "is_blocked")
{
return LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat);
}
else if (level == "not_blocked")
{
return !LLMuteList::getInstance()->isMuted(getAvatarId(), mFrom, LLMute::flagTextChat);
}
@ -298,7 +306,7 @@ public:
registrar.add("AvatarIcon.Action", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemClicked, this, _2));
registrar_enable.add("AvatarIcon.Check", boost::bind(&LLChatHistoryHeader::onAvatarIconContextMenuItemChecked, this, _2));
registrar.add("ObjectIcon.Action", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemClicked, this, _2));
registrar_enable.add("ObjectIcon.Enable", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemEnabled, this, _2));
registrar_enable.add("ObjectIcon.Visible", boost::bind(&LLChatHistoryHeader::onObjectIconContextMenuItemVisible, this, _2));
LLMenuGL* menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_avatar_icon.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
mPopupMenuHandleAvatar = menu->getHandle();
@ -782,6 +790,8 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p)
editor_params.trusted_content = false;
mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this);
mEditor->setIsFriendCallback(LLAvatarActions::isFriend);
mEditor->setIsObjectBlockedCallback(boost::bind(&LLMuteList::isMuted, LLMuteList::getInstance(), _1, _2, 0));
}
LLSD LLChatHistory::getValue() const

View File

@ -736,27 +736,27 @@ void LLFloaterIMNearbyChatHandler::processChat(const LLChat& chat_msg,
toast_msg = tmp_chat.mText;
}
bool chat_overlaps = false;
if(nearby_chat->getChatHistory())
{
LLRect chat_rect = nearby_chat->getChatHistory()->calcScreenRect();
for (std::list<LLView*>::const_iterator child_iter = gFloaterView->getChildList()->begin();
child_iter != gFloaterView->getChildList()->end(); ++child_iter)
{
LLView *view = *child_iter;
const LLRect& rect = view->getRect();
if(view->isInVisibleChain() && (rect.overlaps(chat_rect)))
{
if(!nearby_chat->getChatHistory()->hasAncestor(view))
{
chat_overlaps = true;
}
break;
}
}
}
//Don't show nearby toast, if conversation is visible and selected
// <FS:Ansariel> [FS communication UI]
//bool chat_overlaps = false;
//if(nearby_chat->getChatHistory())
//{
// LLRect chat_rect = nearby_chat->getChatHistory()->calcScreenRect();
// for (std::list<LLView*>::const_iterator child_iter = gFloaterView->getChildList()->begin();
// child_iter != gFloaterView->getChildList()->end(); ++child_iter)
// {
// LLView *view = *child_iter;
// const LLRect& rect = view->getRect();
// if(view->isInVisibleChain() && (rect.overlaps(chat_rect)))
// {
// if(!nearby_chat->getChatHistory()->hasAncestor(view))
// {
// chat_overlaps = true;
// }
// break;
// }
// }
//}
////Don't show nearby toast, if conversation is visible and selected
//if ((nearby_chat->hasFocus()) ||
// (LLFloater::isVisible(nearby_chat) && nearby_chat->isTornOff() && !nearby_chat->isMinimized()) ||
// ((im_box->getSelectedSession().isNull() && !chat_overlaps &&

View File

@ -208,6 +208,16 @@ public:
return true;
}
if (verb == "unblock")
{
if (params.size() > 2)
{
const std::string object_name = params[2].asString();
LLMute mute(avatar_id, object_name, LLMute::OBJECT);
LLMuteList::getInstance()->remove(mute);
}
return true;
}
return false;
}
};

View File

@ -44,8 +44,8 @@
// <FS:Ansariel> [FS communication UI]
//#include "llfloaterimsession.h"
#include "fsfloaterim.h"
#include "llmutelist.h"
// </FS:Ansariel> [FS communication UI]
#include "llavataractions.h"
const S32 BOTTOM_PAD = VPAD * 3;
const S32 IGNORE_BTN_TOP_DELTA = 3*VPAD;//additional ignore_btn padding
@ -332,6 +332,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images )
mTextBox->setContentTrusted(is_content_trusted);
mTextBox->setValue(mNotification->getMessage());
mTextBox->setIsFriendCallback(LLAvatarActions::isFriend);
mTextBox->setIsObjectBlockedCallback(boost::bind(&LLMuteList::isMuted, LLMuteList::getInstance(), _1, _2, 0));
// <FS:Ansariel> Script dialog colors
if (mIsScriptDialog)

View File

@ -194,6 +194,13 @@ void LLViewerTextureList::doPreloadImages()
image->setAddressMode(LLTexUnit::TAM_CLAMP);
mImagePreloads.insert(image);
}
LLPointer<LLImageRaw> img_blak_square_tex(new LLImageRaw(2, 2, 3));
memset(img_blak_square_tex->getData(), 0, img_blak_square_tex->getDataSize());
LLPointer<LLViewerFetchedTexture> img_blak_square(new LLViewerFetchedTexture(img_blak_square_tex, FTT_DEFAULT, FALSE));
gBlackSquareID = img_blak_square->getID();
img_blak_square->setUnremovable(TRUE);
addImage(img_blak_square, TEX_LIST_STANDARD);
}
static std::string get_texture_list_name()

View File

@ -23,8 +23,19 @@
<menu_item_call.on_click
function="ObjectIcon.Action"
parameter="block" />
<menu_item_call.on_enable
function="ObjectIcon.Enable"
<menu_item_call.on_visible
function="ObjectIcon.Visible"
parameter="not_blocked" />
</menu_item_call>
<menu_item_call
label="Unblock"
layout="topleft"
name="Unblock">
<menu_item_call.on_click
function="ObjectIcon.Action"
parameter="unblock" />
<menu_item_call.on_visible
function="ObjectIcon.Visible"
parameter="is_blocked" />
</menu_item_call>
<menu_item_separator

View File

@ -16,6 +16,13 @@
<menu_item_call.on_click
function="Url.Block" />
</menu_item_call>
<menu_item_call
label="Unblock"
layout="topleft"
name="unblock_object">
<menu_item_call.on_click
function="Url.Unblock" />
</menu_item_call>
<menu_item_separator
layout="topleft" />
<menu_item_call

View File

@ -1210,7 +1210,7 @@
<menu_item_check.on_click
function="Build.Toggle" />
<menu_item_check.on_enable
function="Build.Enabled" />
function="Build.EnabledOrActive" />
</menu_item_check>
<menu
create_jump_keys="true"