[Feature Request] Open Muted List Profiles via Double Click

This commit is contained in:
Lirusaito
2019-07-26 20:27:17 -04:00
parent 01b02fd6b1
commit 1466539d88
2 changed files with 20 additions and 0 deletions

View File

@@ -40,7 +40,9 @@
#include "lluictrlfactory.h"
// project include
#include "llavataractions.h"
#include "llfloateravatarpicker.h"
#include "llgroupactions.h"
#include "llmutelist.h"
#include "llnamelistctrl.h"
@@ -185,6 +187,22 @@ LLFloaterMute::LLFloaterMute(const LLSD& seed)
LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mute.xml", NULL, FALSE);
}
void LLFloaterMute::showProfile() const
{
if (const auto item = mMuteList->getFirstSelected())
{
const auto type = item->getColumn(0)->getValue().asString();
if (type == mAvatarIcon->getName())
{
LLAvatarActions::showProfile(item->getUUID());
}
else if (type == mGroupIcon->getName())
{
LLGroupActions::show(item->getUUID());
}
}
}
BOOL LLFloaterMute::postBuild()
{
childSetCommitCallback("mutes", boost::bind(&LLFloaterMute::updateButtons, this));
@@ -199,6 +217,7 @@ BOOL LLFloaterMute::postBuild()
mMuteList = getChild<LLNameListCtrl>("mutes");
mMuteList->setCommitOnSelectionChange(TRUE);
mMuteList->setDoubleClickCallback(boost::bind(&LLFloaterMute::showProfile, this));
LLMuteList::getInstance()->addObserver(this);

View File

@@ -72,6 +72,7 @@ private:
void onPickUser(const uuid_vec_t& ids, const std::vector<LLAvatarName>& names);
static void onClickMuteByName(void*);
static void callbackMuteByName(const std::string& text, void*);
void showProfile() const;
private:
LLNameListCtrl* mMuteList;