Enable Multiselect in groups, and enable EditMenuHandler when a scrollable list is focused!

Allows Ctrl-A to select all in a list (Like for selecting all groups and unticking chat with a single click)
Ctrl-E to deselect
Ctrl-X/Ctrl-C to copy a list (useful for saving ban lists and such!)
This commit is contained in:
Inusaito Sayori
2014-05-23 19:37:32 -04:00
parent 828941a204
commit bbe7f6adfb
4 changed files with 13 additions and 10 deletions

View File

@@ -3214,6 +3214,11 @@ void LLScrollListCtrl::setFocus(BOOL b)
selectFirstItem();
//onCommit(); // SJB: selectFirstItem() will call onCommit() if appropriate
}
// Singu Note: Edit menu handler, y'know for Ctrl-A and such!
if (b) gEditMenuHandler = this;
else if (gEditMenuHandler == this) gEditMenuHandler = NULL;
LLUICtrl::setFocus(b);
}

View File

@@ -231,21 +231,20 @@ BOOL LLPanelGroups::postBuild()
void LLPanelGroups::enableButtons()
{
LLCtrlListInterface *group_list = childGetListInterface("group list");
getChildView("Create")->setEnabled(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups());
LLScrollListCtrl* group_list = getChild<LLScrollListCtrl>("group list");
if (!group_list) return;
LLUUID group_id;
if (group_list)
if (group_list->getNumSelected() == 1)
{
group_id = group_list->getCurrentID();
}
if(group_id != gAgent.getGroupID())
{
getChildView("Activate")->setEnabled(TRUE);
getChildView("Activate")->setEnabled(group_id != gAgent.getGroupID());
}
else
{
getChildView("Activate")->setEnabled(FALSE);
}
if (group_id.notNull())
{
getChildView("Info")->setEnabled(TRUE);
@@ -258,7 +257,6 @@ void LLPanelGroups::enableButtons()
getChildView("IM")->setEnabled(FALSE);
getChildView("Leave")->setEnabled(FALSE);
}
getChildView("Create")->setEnabled(gAgent.mGroups.count() < gHippoLimits->getMaxAgentGroups());
getChildView("Invite...")->setEnabled(group_id.notNull() && gAgent.hasPowerInGroup(group_id, GP_MEMBER_INVITE));
}

View File

@@ -4,7 +4,7 @@
<scroll_list background_visible="true" bottom="45" column_padding="0" draw_border="true"
draw_heading="true" draw_stripes="true" enabled="true"
follows="left|top|right|bottom" left="10" mouse_opaque="true"
multi_select="false" name="group list" tab_stop="true" top="-10"
multi_select="true" name="group list" tab_stop="true" top="-10"
width="240">
<column dynamicwidth="true" label="Name" name="name" tool_tip="Name" />
<!--<column label="Active" name="is_active_group"

View File

@@ -4,7 +4,7 @@
<scroll_list background_visible="true" bottom="109" column_padding="0" draw_border="true"
draw_heading="true" draw_stripes="true" enabled="true"
follows="left|top|right|bottom" left="5" mouse_opaque="true"
multi_select="false" name="group list" tab_stop="true" top="-10"
multi_select="true" name="group list" tab_stop="true" top="-10"
width="340">
<column dynamicwidth="true" label="Name" name="name" tool_tip="Name" />
<!--<column label="Active" name="is_active_group"