Trigger and Alias Grouping

Posted by Relgar on Thu 17 May 2007 11:58 PM — 2 posts, 11,764 views.

#0
Hi there. I've been using Mushclient for a good couple of months now, and am quite happy with it, but for a few things which I feel could be improved. One of the main issues is the presentation of triggers, aliases, or variables. Is it possible to sort of sort them into visual groups (for example, in the treeview configuration screen, perhaps expand the Trigger / Alias node to encompass groups)? You can find my proposal here:

[url=http://imageshack.us][img=http://img247.imageshack.us/img247/1215/treeviewet4.png][/url]

And the current view here:

[url=http://imageshack.us][img=http://img182.imageshack.us/img182/385/currentviewjf7.png][/url]

This does nothing from a functional point of view, of course, but it does relieve substantial mental burden on the user to sort throught each trigger or alias and go 'nope, that's not what I'm looking for'.

Failing this, would it be possible to make something where the user is able to view only items of a particular group quickly? I tried clicking Filter By: but I didn't quite guess I'd have to code to filter. Thanks!
Australia Forum Administrator #1
The group name has its own column - you may have to scroll to the right to see it. You can click on the column header and drag the group column to the left where it is easier to see. Then click on that column to sort by group. That way everything in that group is together.

As for the filter, if you copy and paste the code below into the filter box, it will query you for a group (when you enable the filter) and only display that group:



-- ask which group, default to last one they chose
group = utils.inputbox ("Choose group", 
                        "Group to filter by", 
                         GetVariable ("trigger_group") or "")

-- trim spaces, make lower case
if group then
  group = Trim (string.lower (group))
  if group == "" then
    group = nil
  else
    SetVariable ("trigger_group", group)  -- save for next time
  end  -- if
end

-- called for each trigger
function filter (s)
 
  -- if no group, return everything
  if not group then
    return true
  end -- if
 
  -- return true if correct group
  return string.lower (GetTriggerInfo (s, 26)) == group

end -- filter