summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llavataractions.cpp10
-rw-r--r--indra/newview/llavataractions.h5
-rw-r--r--indra/newview/llbottomtray.cpp13
-rw-r--r--indra/newview/llcallfloater.cpp19
-rw-r--r--indra/newview/llcallfloater.h2
-rw-r--r--indra/newview/llgroupmgr.cpp9
-rw-r--r--indra/newview/llpanelavatar.cpp28
-rw-r--r--indra/newview/llpanelavatar.h8
-rw-r--r--indra/newview/llpanelimcontrolpanel.cpp8
-rw-r--r--indra/newview/llpanelpeoplemenus.cpp6
-rw-r--r--indra/newview/llspeakbutton.cpp10
-rw-r--r--indra/newview/llspeakbutton.h4
-rw-r--r--indra/newview/skins/default/xui/en/menu_profile_overflow.xml13
13 files changed, 119 insertions, 16 deletions
diff --git a/indra/newview/llavataractions.cpp b/indra/newview/llavataractions.cpp
index 7eed2e7b9a..bd987eac77 100644
--- a/indra/newview/llavataractions.cpp
+++ b/indra/newview/llavataractions.cpp
@@ -612,3 +612,13 @@ bool LLAvatarActions::isBlocked(const LLUUID& id)
gCacheName->getFullName(id, name);
return LLMuteList::getInstance()->isMuted(id, name);
}
+
+// static
+bool LLAvatarActions::canBlock(const LLUUID& id)
+{
+ std::string firstname, lastname;
+ gCacheName->getName(id, firstname, lastname);
+ bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
+ bool is_self = id == gAgentID;
+ return !is_self && !is_linden;
+}
diff --git a/indra/newview/llavataractions.h b/indra/newview/llavataractions.h
index c751661acf..16a58718a2 100644
--- a/indra/newview/llavataractions.h
+++ b/indra/newview/llavataractions.h
@@ -124,6 +124,11 @@ public:
static bool isBlocked(const LLUUID& id);
/**
+ * @return true if you can block the avatar
+ */
+ static bool canBlock(const LLUUID& id);
+
+ /**
* Return true if the avatar is in a P2P voice call with a given user
*/
/* AD *TODO: Is this function needed any more?
diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp
index 0102e9488e..4c8cec3d30 100644
--- a/indra/newview/llbottomtray.cpp
+++ b/indra/newview/llbottomtray.cpp
@@ -280,7 +280,13 @@ void LLBottomTray::onChange(EStatusType status, const std::string &channelURI, b
break;
}
- mSpeakBtn->setEnabled(enable);
+ // We have to enable/disable right and left parts of speak button separately (EXT-4648)
+ mSpeakBtn->setSpeakBtnEnabled(enable);
+ // skipped to avoid button blinking
+ if (status != STATUS_JOINING && status!= STATUS_LEFT_CHANNEL)
+ {
+ mSpeakBtn->setFlyoutBtnEnabled(LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking());
+ }
}
void LLBottomTray::onMouselookModeOut()
@@ -410,9 +416,10 @@ BOOL LLBottomTray::postBuild()
mSpeakPanel = getChild<LLPanel>("speak_panel");
mSpeakBtn = getChild<LLSpeakButton>("talk");
- // Speak button should be initially disabled because
+ // Both parts of speak button should be initially disabled because
// it takes some time between logging in to world and connecting to voice channel.
- mSpeakBtn->setEnabled(FALSE);
+ mSpeakBtn->setSpeakBtnEnabled(false);
+ mSpeakBtn->setFlyoutBtnEnabled(false);
// Localization tool doesn't understand custom buttons like <talk_button>
mSpeakBtn->setSpeakToolTip( getString("SpeakBtnToolTip") );
diff --git a/indra/newview/llcallfloater.cpp b/indra/newview/llcallfloater.cpp
index f62fd44bc0..8cb240c7c2 100644
--- a/indra/newview/llcallfloater.cpp
+++ b/indra/newview/llcallfloater.cpp
@@ -52,6 +52,7 @@
#include "lltransientfloatermgr.h"
#include "llviewerwindow.h"
#include "llvoicechannel.h"
+#include "llviewerparcelmgr.h"
static void get_voice_participants_uuids(std::vector<LLUUID>& speakers_uuids);
void reshape_floater(LLCallFloater* floater, S32 delta_height);
@@ -731,11 +732,11 @@ void LLCallFloater::updateState(const LLVoiceChannel::EState& new_state)
}
else
{
- reset();
+ reset(new_state);
}
}
-void LLCallFloater::reset()
+void LLCallFloater::reset(const LLVoiceChannel::EState& new_state)
{
// lets forget states from the previous session
// for timers...
@@ -748,8 +749,18 @@ void LLCallFloater::reset()
mParticipants = NULL;
mAvatarList->clear();
- // update floater to show Loading while waiting for data.
- mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ // "loading" is shown in parcel with disabled voice only when state is "ringing"
+ // to avoid showing it in nearby chat vcp all the time- "no_one_near" is now shown there (EXT-4648)
+ bool show_loading = LLVoiceChannel::STATE_RINGING == new_state;
+ if(!show_loading && !LLViewerParcelMgr::getInstance()->allowAgentVoice() && mVoiceType == VC_LOCAL_CHAT)
+ {
+ mAvatarList->setNoItemsCommentText(getString("no_one_near"));
+ }
+ else
+ {
+ // update floater to show Loading while waiting for data.
+ mAvatarList->setNoItemsCommentText(LLTrans::getString("LoadingData"));
+ }
mAvatarList->setVisible(TRUE);
mNonAvatarCaller->setVisible(FALSE);
diff --git a/indra/newview/llcallfloater.h b/indra/newview/llcallfloater.h
index 766191379b..dac4390fa7 100644
--- a/indra/newview/llcallfloater.h
+++ b/indra/newview/llcallfloater.h
@@ -220,7 +220,7 @@ private:
*
* Clears all data from the latest voice session.
*/
- void reset();
+ void reset(const LLVoiceChannel::EState& new_state);
private:
speaker_state_map_t mSpeakerStateMap;
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index 72a52ba13b..4c1019a882 100644
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -1708,6 +1708,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
bool start_message = true;
LLMessageSystem* msg = gMessageSystem;
+
+
LLGroupMgrGroupData* group_datap = LLGroupMgr::getInstance()->getGroupData(group_id);
if (!group_datap) return;
@@ -1715,6 +1717,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
it != member_ids.end(); ++it)
{
LLUUID& ejected_member_id = (*it);
+
+ llwarns << "LLGroupMgr::sendGroupMemberEjects -- ejecting member" << ejected_member_id << llendl;
// Can't use 'eject' to leave a group.
if ((*it) == gAgent.getID()) continue;
@@ -1751,11 +1755,14 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
if ((*rit).first.notNull() && (*rit).second!=0)
{
(*rit).second->removeMember(ejected_member_id);
+
+ llwarns << "LLGroupMgr::sendGroupMemberEjects - removing member from role " << llendl;
}
}
group_datap->mMembers.erase(*it);
+ llwarns << "LLGroupMgr::sendGroupMemberEjects - deleting memnber data " << llendl;
delete (*mit).second;
}
}
@@ -1764,6 +1771,8 @@ void LLGroupMgr::sendGroupMemberEjects(const LLUUID& group_id,
{
gAgent.sendReliableMessage();
}
+
+ llwarns << "LLGroupMgr::sendGroupMemberEjects - done " << llendl;
}
void LLGroupMgr::sendGroupRoleChanges(const LLUUID& group_id)
diff --git a/indra/newview/llpanelavatar.cpp b/indra/newview/llpanelavatar.cpp
index 48dd5513bd..4a7cdfc856 100644
--- a/indra/newview/llpanelavatar.cpp
+++ b/indra/newview/llpanelavatar.cpp
@@ -483,6 +483,7 @@ BOOL LLPanelAvatarProfile::postBuild()
LLUICtrl::CommitCallbackRegistry::ScopedRegistrar registrar;
registrar.add("Profile.Pay", boost::bind(&LLPanelAvatarProfile::pay, this));
registrar.add("Profile.Share", boost::bind(&LLPanelAvatarProfile::share, this));
+ registrar.add("Profile.BlockUnblock", boost::bind(&LLPanelAvatarProfile::toggleBlock, this));
registrar.add("Profile.Kick", boost::bind(&LLPanelAvatarProfile::kick, this));
registrar.add("Profile.Freeze", boost::bind(&LLPanelAvatarProfile::freeze, this));
registrar.add("Profile.Unfreeze", boost::bind(&LLPanelAvatarProfile::unfreeze, this));
@@ -490,6 +491,8 @@ BOOL LLPanelAvatarProfile::postBuild()
LLUICtrl::EnableCallbackRegistry::ScopedRegistrar enable;
enable.add("Profile.EnableGod", boost::bind(&enable_god));
+ enable.add("Profile.CheckItem", boost::bind(&LLPanelAvatarProfile::checkOverflowMenuItem, this, _2));
+ enable.add("Profile.EnableItem", boost::bind(&LLPanelAvatarProfile::enableOverflowMenuItem, this, _2));
mProfileMenu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_profile_overflow.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance());
@@ -666,6 +669,26 @@ void LLPanelAvatarProfile::fillAccountStatus(const LLAvatarData* avatar_data)
childSetValue("acc_status_text", caption_text);
}
+bool LLPanelAvatarProfile::checkOverflowMenuItem(const LLSD& param)
+{
+ std::string item = param.asString();
+
+ if (item == "is_blocked")
+ return LLAvatarActions::isBlocked(getAvatarId());
+
+ return false;
+}
+
+bool LLPanelAvatarProfile::enableOverflowMenuItem(const LLSD& param)
+{
+ std::string item = param.asString();
+
+ if (item == "can_block")
+ return LLAvatarActions::canBlock(getAvatarId());
+
+ return false;
+}
+
void LLPanelAvatarProfile::pay()
{
LLAvatarActions::pay(getAvatarId());
@@ -676,6 +699,11 @@ void LLPanelAvatarProfile::share()
LLAvatarActions::share(getAvatarId());
}
+void LLPanelAvatarProfile::toggleBlock()
+{
+ LLAvatarActions::toggleBlock(getAvatarId());
+}
+
void LLPanelAvatarProfile::kick()
{
LLAvatarActions::kick(getAvatarId());
diff --git a/indra/newview/llpanelavatar.h b/indra/newview/llpanelavatar.h
index ce59f1e93d..632590aa27 100644
--- a/indra/newview/llpanelavatar.h
+++ b/indra/newview/llpanelavatar.h
@@ -192,12 +192,18 @@ protected:
*/
void share();
+ /**
+ * Add/remove resident to/from your block list.
+ */
+ void toggleBlock();
+
void kick();
void freeze();
void unfreeze();
void csr();
-
+ bool checkOverflowMenuItem(const LLSD& param);
+ bool enableOverflowMenuItem(const LLSD& param);
bool enableGod();
diff --git a/indra/newview/llpanelimcontrolpanel.cpp b/indra/newview/llpanelimcontrolpanel.cpp
index d491583b56..cbd6f64a48 100644
--- a/indra/newview/llpanelimcontrolpanel.cpp
+++ b/indra/newview/llpanelimcontrolpanel.cpp
@@ -81,11 +81,15 @@ void LLPanelChatControlPanel::onVoiceChannelStateChanged(const LLVoiceChannel::E
void LLPanelChatControlPanel::updateCallButton()
{
- // hide/show call button
bool voice_enabled = LLVoiceClient::voiceEnabled() && gVoiceClient->voiceWorking();
LLIMModel::LLIMSession* session = LLIMModel::getInstance()->findIMSession(mSessionId);
- if (!session) return;
+
+ if (!session)
+ {
+ childSetEnabled("call_btn", false);
+ return;
+ }
bool session_initialized = session->mSessionInitialized;
bool callback_enabled = session->mCallBackEnabled;
diff --git a/indra/newview/llpanelpeoplemenus.cpp b/indra/newview/llpanelpeoplemenus.cpp
index 470cfca8fe..7e184c78a8 100644
--- a/indra/newview/llpanelpeoplemenus.cpp
+++ b/indra/newview/llpanelpeoplemenus.cpp
@@ -164,11 +164,7 @@ bool NearbyMenu::enableContextMenuItem(const LLSD& userdata)
if (item == std::string("can_block"))
{
const LLUUID& id = mUUIDs.front();
- std::string firstname, lastname;
- gCacheName->getName(id, firstname, lastname);
- bool is_linden = !LLStringUtil::compareStrings(lastname, "Linden");
- bool is_self = id == gAgentID;
- return !is_self && !is_linden;
+ return LLAvatarActions::canBlock(id);
}
else if (item == std::string("can_add"))
{
diff --git a/indra/newview/llspeakbutton.cpp b/indra/newview/llspeakbutton.cpp
index 8f2c877c7a..c5c311ed33 100644
--- a/indra/newview/llspeakbutton.cpp
+++ b/indra/newview/llspeakbutton.cpp
@@ -66,6 +66,16 @@ void LLSpeakButton::draw()
mOutputMonitor->setIsMuted(!voiceenabled);
LLUICtrl::draw();
}
+void LLSpeakButton::setSpeakBtnEnabled(bool enabled)
+{
+ LLButton* speak_btn = getChild<LLButton>("speak_btn");
+ speak_btn->setEnabled(enabled);
+}
+void LLSpeakButton::setFlyoutBtnEnabled(bool enabled)
+{
+ LLButton* show_btn = getChild<LLButton>("speak_flyout_btn");
+ show_btn->setEnabled(enabled);
+}
LLSpeakButton::LLSpeakButton(const Params& p)
: LLUICtrl(p)
diff --git a/indra/newview/llspeakbutton.h b/indra/newview/llspeakbutton.h
index 6660b50240..85c97f1a2c 100644
--- a/indra/newview/llspeakbutton.h
+++ b/indra/newview/llspeakbutton.h
@@ -61,6 +61,10 @@ public:
/*virtual*/ ~LLSpeakButton();
/*virtual*/ void draw();
+
+ // methods for enabling/disabling right and left parts of speak button separately(EXT-4648)
+ void setSpeakBtnEnabled(bool enabled);
+ void setFlyoutBtnEnabled(bool enabled);
// *HACK: Need to put tooltips in a translatable location,
// the panel that contains this button.
diff --git a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
index 1dc1c610cf..407ce14e81 100644
--- a/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
+++ b/indra/newview/skins/default/xui/en/menu_profile_overflow.xml
@@ -19,6 +19,19 @@
<menu_item_call.on_click
function="Profile.Share" />
</menu_item_call>
+ <menu_item_check
+ label="Block/Unblock"
+ layout="topleft"
+ name="block_unblock">
+ <menu_item_check.on_click
+ function="Profile.BlockUnblock" />
+ <menu_item_check.on_check
+ function="Profile.CheckItem"
+ parameter="is_blocked" />
+ <menu_item_check.on_enable
+ function="Profile.EnableItem"
+ parameter="can_block" />
+ </menu_item_check>
<menu_item_call
label="Kick"
layout="topleft"