summaryrefslogtreecommitdiff
path: root/indra/newview/llpanelblockedlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llpanelblockedlist.cpp')
-rw-r--r--indra/newview/llpanelblockedlist.cpp28
1 files changed, 16 insertions, 12 deletions
diff --git a/indra/newview/llpanelblockedlist.cpp b/indra/newview/llpanelblockedlist.cpp
index 60d0f07285..c72f0f8012 100644
--- a/indra/newview/llpanelblockedlist.cpp
+++ b/indra/newview/llpanelblockedlist.cpp
@@ -32,12 +32,14 @@
#include "llviewerprecompiledheaders.h"
+#include "llpanelblockedlist.h"
+
+// library include
#include "llfloater.h"
#include "llfloaterreg.h"
+#include "llnotificationsutil.h"
#include "llscrolllistctrl.h"
-#include "llpanelblockedlist.h"
-
// project include
#include "llfloateravatarpicker.h"
#include "llsidetray.h"
@@ -102,7 +104,7 @@ void LLPanelBlockedList::selectBlocked(const LLUUID& mute_id)
void LLPanelBlockedList::showPanelAndSelect(const LLUUID& idToSelect)
{
- LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().insert(BLOCKED_PARAM_NAME, idToSelect));
+ LLSideTray::getInstance()->showPanel("panel_block_list_sidetray", LLSD().with(BLOCKED_PARAM_NAME, idToSelect));
}
@@ -117,8 +119,13 @@ void LLPanelBlockedList::refreshBlockedList()
std::vector<LLMute>::iterator it;
for (it = mutes.begin(); it != mutes.end(); ++it)
{
- std::string display_name = it->getDisplayName();
- mBlockedList->addStringUUIDItem(display_name, it->mID, ADD_BOTTOM, TRUE);
+ LLScrollListItem::Params item_p;
+ item_p.enabled(TRUE);
+ item_p.value(it->mID); // link UUID of blocked item with ScrollListItem
+ item_p.columns.add().column("item_name").value(it->mName);//.type("text");
+ item_p.columns.add().column("item_type").value(it->getDisplayType());//.type("text").width(111);
+
+ mBlockedList->addRow(item_p, ADD_BOTTOM);
}
}
@@ -143,9 +150,7 @@ void LLPanelBlockedList::onRemoveBtnClick()
{
std::string name = mBlockedList->getSelectedItemLabel();
LLUUID id = mBlockedList->getStringUUIDSelectedItem();
- LLMute mute(id);
- mute.setFromDisplayName(name);
- // now mute.mName has the suffix trimmed off
+ LLMute mute(id, name);
S32 last_selected = mBlockedList->getFirstSelectedIndex();
if (LLMuteList::getInstance()->remove(mute))
@@ -169,7 +174,7 @@ void LLPanelBlockedList::onPickBtnClick()
{
const BOOL allow_multiple = FALSE;
const BOOL close_on_select = TRUE;
- /*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(callbackBlockPicked, this, allow_multiple, close_on_select);
+ /*LLFloaterAvatarPicker* picker = */LLFloaterAvatarPicker::show(boost::bind(&LLPanelBlockedList::callbackBlockPicked, this, _1, _2), allow_multiple, close_on_select);
// *TODO: mantipov: should LLFloaterAvatarPicker be closed when panel is closed?
// old Floater dependency is not enable in panel
@@ -181,8 +186,7 @@ void LLPanelBlockedList::onBlockByNameClick()
LLFloaterGetBlockedObjectName::show(&LLPanelBlockedList::callbackBlockByName);
}
-//static
-void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const std::vector<LLUUID>& ids, void* user_data)
+void LLPanelBlockedList::callbackBlockPicked(const std::vector<std::string>& names, const uuid_vec_t& ids)
{
if (names.empty() || ids.empty()) return;
LLMute mute(ids[0], names[0], LLMute::AGENT);
@@ -199,7 +203,7 @@ void LLPanelBlockedList::callbackBlockByName(const std::string& text)
BOOL success = LLMuteList::getInstance()->add(mute);
if (!success)
{
- LLNotifications::instance().add("MuteByNameFailed");
+ LLNotificationsUtil::add("MuteByNameFailed");
}
}