On Thu, Oct 30, 2008 at 7:01 PM, Ville M. Vainio <[EMAIL PROTECTED]> wrote: > > On Thu, Oct 30, 2008 at 2:52 PM, Edward K. Ream <[EMAIL PROTECTED]> wrote: > >> - Finish hooking up headlines. This now has high priority because any >> changes to the tree code have the potential to crash the Qt tree >> widget. Naturally, I'll look for the minimum possible changes, but >> real changes may be needed. > > What do you mean by hooking up headlines?
There are several parts to this: 1. Make sure changes to headlines "stick" when hitting, say, ctrl-r. This is done on the trunk. It involved some tricky interaction between Leo's core and the event handlers in the qt plugin. 2. Allow Leo's key-bindings to apply to the headline. For example, the default binding for Ctrl-a is beginning-of-line, not select-all. I'll do this tomorrow. As an extra little problem, QLineEdit does not generate key-pressed events (at least on XP), but only key-released events. So some kind of hack will be required in eventFilter. But it is no use handling key events until I wrap QLineEdit to make it look like a subclass of Leo's base text-widget class. This was inevitable: all native widgets must look like a subclass of baseTextWidget (in leoFrame.py) so that Leo's commands can drive those widgets. It's not a huge deal. As you can see from the to-do list, eventually I'll duplication from these subclasses so that each subclass will provide only the minimum it needs to. To do *that* I'll create a hierarchy of text-widget classes. > BTW, I don't know what the exact cause of crashes is, but if it's > about referring to tree items that don't exist anymore in the tree, we > could try using weak references to map model positions to tree widget > items. That way, if a tree widget item is not referred to from the > treewidget side (e.g. when removed by takeChild), we would see that we > have invalid tree item data for our position (and possibly do some > kind of recalculation). I'm not sure what the problems have been, or might be, but invalid items are probably only one of many ways of crashing :-) Today I took several hard crashes, probably because the code referred to a headline (QLineEdit ) that no longer existed. Another way to die is to get into an unbounded recursion in an event handler by generating events in the event handler that aren't locked out. In both cases, the strategy is to ensure some sanity by setting and clearing lockouts. It's the only way in general, although it might be possible to use focus-in/out events as a substitute sometimes. > Yeah, I'm back from Rome (which, needless to say, rocks), but haven't > had time to see all that has been going on yet... Welcome back. There really isn't a proper list of what has been done except the bzr checking logs. To see what remains, look at the to-do list in qtGui.py. Edward --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
