Don't need an additional UUID column in the radar if the value of the scrolllist item contains it already

Ansariel 2014-08-04 13:50:49 +02:00
parent 706178e60b
commit c7556c623b
6 changed files with 10 additions and 37 deletions

View File

@ -149,7 +149,7 @@ void FSContactsFriendsMenu::addToContactSet()
void FSContactsFriendsMenu::copyNameToClipboard(const LLUUID& id)
{
LLAvatarName av_name;
LLAvatarNameCache::get(LLUUID(id), &av_name);
LLAvatarNameCache::get(id, &av_name);
LLUrlAction::copyURLToClipboard(av_name.getAccountName());
}

View File

@ -167,12 +167,10 @@ void FSPanelRadar::updateButtons()
LLUUID FSPanelRadar::getCurrentItemID() const
{
static S32 uuid_column_index = mRadarList->getColumn("uuid")->mIndex;
LLScrollListItem* item = mRadarList->getFirstSelected();
if (item)
{
return item->getColumn(uuid_column_index)->getValue().asUUID();
return item->getUUID();
}
return LLUUID::null;
@ -180,11 +178,10 @@ LLUUID FSPanelRadar::getCurrentItemID() const
void FSPanelRadar::getCurrentItemIDs(uuid_vec_t& selected_uuids) const
{
static S32 uuid_column_index = mRadarList->getColumn("uuid")->mIndex;
for (size_t i = 0; i < mRadarList->getAllSelected().size(); ++i)
std::vector<LLScrollListItem*> selected_items = mRadarList->getAllSelected();
for (std::vector<LLScrollListItem*>::iterator it = selected_items.begin(); it != selected_items.end(); ++it)
{
selected_uuids.push_back(mRadarList->getAllSelected().at(i)->getColumn(uuid_column_index)->getValue().asUUID());
selected_uuids.push_back((*it)->getUUID());
}
}
@ -215,7 +212,7 @@ void FSPanelRadar::onRadarListDoubleClicked()
return;
}
LLUUID clicked_id = item->getColumn(mRadarList->getColumn("uuid")->mIndex)->getValue().asUUID();
LLUUID clicked_id = item->getUUID();
std::string name = item->getColumn(mRadarList->getColumn("name")->mIndex)->getValue().asString();
FSRadar* radar = FSRadar::getInstance();
@ -299,12 +296,11 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
static const std::string sittingStatusKey = getString("SittingStatusKey");
// Store current selection and scroll position
static S32 uuidColumnIndex = mRadarList->getColumn("uuid")->mIndex;
std::vector<LLScrollListItem*> selected_items = mRadarList->getAllSelected();
uuid_vec_t selected_ids;
for (size_t i = 0; i < selected_items.size(); i++)
for (std::vector<LLScrollListItem*>::iterator it = selected_items.begin(); it != selected_items.end(); ++it)
{
selected_ids.push_back(selected_items.at(i)->getColumn(uuidColumnIndex)->getValue().asUUID());
selected_ids.push_back((*it)->getUUID());
}
S32 lastScroll = mRadarList->getScrollPos();
@ -352,9 +348,6 @@ void FSPanelRadar::updateList(const std::vector<LLSD>& entries, const LLSD& stat
row_data["columns"][8]["column"] = "range";
row_data["columns"][8]["value"] = entry["range"];
row_data["columns"][9]["column"] = "uuid"; // invisible column for referencing av-key the row belongs to
row_data["columns"][9]["value"] = entry["id"];
LLScrollListItem* row = mRadarList->addElement(row_data);
static S32 rangeColumnIndex = mRadarList->getColumn("range")->mIndex;

View File

@ -47,23 +47,16 @@ mContextMenu(NULL)
BOOL FSRadarListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
//LL_INFOS() << "handleRightMouseDown" << LL_ENDL;
BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask);
// if ( mContextMenu )
// [RLVa:KB-FS] - Checked: 2011-06-11 (RLVa-1.3.1) | Added: RLVa-1.3.1
if ( (mContextMenu) && (!gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) )
// [/RLVa:KB-FS]
{
S32 uuid_column_index = getColumn("uuid")->mIndex;
std::vector<LLScrollListItem*> selected_items = getAllSelected();
if (selected_items.size() > 1)
{
//LL_INFOS() << "Right-click select by value: (multi-select)" << LL_ENDL;
uuid_vec_t selected_uuids;
for (size_t i = 0; i < selected_items.size(); i++)
for (std::vector<LLScrollListItem*>::iterator it = selected_items.begin(); it != selected_items.end(); ++it)
{
//LL_INFOS() << "Right-click select by value: " << selected_items.at(i)->getColumn(uuid_column_index)->getValue().asUUID() << LL_ENDL;
selected_uuids.push_back(selected_items.at(i)->getColumn(uuid_column_index)->getValue().asUUID());
selected_uuids.push_back((*it)->getUUID());
}
mContextMenu->show(this, selected_uuids, x, y);
}
@ -72,7 +65,6 @@ BOOL FSRadarListCtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
LLScrollListItem* hit_item = hitItem(x, y);
if (hit_item)
{
//LL_INFOS() << "Right-click select by value: " << hit_item->getValue() << LL_ENDL;
selectByID(hit_item->getValue());
LLUUID av = hit_item->getValue();
uuid_vec_t selected_uuids;

View File

@ -213,10 +213,6 @@
label="Range"
name="range"
relative_width="0.16"/>
<radar_list.columns
label="av_id"
name="uuid"
relative_width="0"/>
</radar_list>
</layout_panel>
</layout_stack>

View File

@ -213,10 +213,6 @@
label="Range"
name="range"
relative_width="0.16"/>
<radar_list.columns
label="av_id"
name="uuid"
relative_width="0"/>
</radar_list>
</layout_panel>
</layout_stack>

View File

@ -129,10 +129,6 @@
name="flags"
tool_tip="Payment info status"
relative_width="0.08"/>
<radar_list.columns
label="av_id"
name="uuid"
relative_width="0"/>
</radar_list>
</layout_panel>
</layout_stack>