[peppy-dev] Alphabetizing Code Explorer?

0 views
Skip to first unread message

Don Dwiggins

unread,
Apr 29, 2010, 3:11:47 PM4/29/10
to pepp...@googlegroups.com
Is there an option to alphabetize the items in the Code Explorer at each
level, rather than showing them in "code order"? If not, and if you
don't have the time, and if it's not too hairy, I'd be willing to take a
crack at implementing it, with some pointers to get me started.

Thanks,
Don

--
You received this message because you are subscribed to the Google Groups "peppy-dev" group.
To post to this group, send email to pepp...@googlegroups.com.
To unsubscribe from this group, send email to peppy-dev+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/peppy-dev?hl=en.

Rob McMullen

unread,
Apr 29, 2010, 5:54:38 PM4/29/10
to pepp...@googlegroups.com
Don,

On Thu, Apr 29, 2010 at 12:11 PM, Don Dwiggins <ddwi...@advpubtech.com> wrote:
> Is there an option to alphabetize the items in the Code Explorer at each
> level, rather than showing them in "code order"?

Not currently. :)

> If not, and if you don't
> have the time, and if it's not too hairy, I'd be willing to take a crack at
> implementing it, with some pointers to get me started.

It would be great if you could give it a shot. It might be a bit of a
twisty road at times because I need to improve my documentation, but
this would be a great way to do that. I started some docs here:

http://trac.flipturn.org/wiki/CodeExplorer

There are probably three real issues:

1) make new code to alphabetize the items
2) add some user interface control to turn this on and off
3) make the alphabetization state persistent

It seems like the sorting should be done on the tree itself using
SortChildren and a custom OnCompareItems.

The user interface could be a right click in the minor mode window,
which would be implemented as an action. The place to look for an
example of that would be in peppy/plugins/macro.py: the
getPopupActions() method of MacroListMinorMode. It returns a list of
action classes (EditMacro, RenameMacro, DeleteMacro, etc.) that are
then instantiated to create the popup. So, I imagine that would be a
way to do it for whether or not you want alphabetization.

Note that action instances are created and destroyed on demand and as
such can't save any state themselves, they always have to point back
to their parent mode. So a logical place to store the persistent flag
as a BoolParam the major mode classprefs of FundamentalMode.

Well... What do you think?

Rob

Don Dwiggins

unread,
May 26, 2010, 11:50:40 AM5/26/10
to pepp...@googlegroups.com
Rob,

I haven't forgotten or punted on these -- I've just been swamped
lately. I'll get back to them when I can.


Don

Rob McMullen

unread,
May 26, 2010, 12:12:11 PM5/26/10
to pepp...@googlegroups.com
On Wed, May 26, 2010 at 8:50 AM, Don Dwiggins <ddwi...@advpubtech.com> wrote:
> I haven't forgotten or punted on these -- I've just been swamped lately.
>  I'll get back to them when I can.

No worries. I've been swamped for a while, too, so I know what it
feels like. I haven't been able to do as much work on peppy as I
would have liked, and haven't made a release in 6 months! I need to
do one soon...

Rob

Reply all
Reply to author
Forward
0 new messages