I have started on fixing the broken window management in HEAD.
The currently fixed are EditPerson and EventRefEditor:
Adding new person and adding an eventref (click + in the
event tab) should behave correctly. Although Windows
menu is not there yet :-)
I thought T'd let everybody know about the new way of calling
UI classes. Here's the set of rules, feel free to adjust them:
1. UI classes should inherit from DisplayState.ManagedWindow
2. They should take state,uistate,and track arguments.
* state is the database state
* uistate is the top-level UI state (window, menus, etc)
* track is the list determining the place of a parent window
(or a group of windows) in an overall hierarchy.
Example: [1,4,2,3] is the first group, 4th group in that one,
second group in that one, and third window in that one.
The track is needed to properly nest child windows. track=3D
corresponds to a top-level item.
3. They should call:
DisplayState.ManagedWindow.__init__(self, uistate, track,
win_key, win_submenu_label, win_menu_label )
where win_key is any good identifier for a window (person_handle
for EditPerson, None if not identifiable, e.g. new Name), win_menu_label
is the label of the menu item corresponding to the window in the
Windows menu tree, and win_submenu_label is the label for the
submenu if this is a group (None if not a group).
4. They should also call:
because the parent class will set already_exist if necessary.
5. If spawning children, they should pass self.track as track argument
to child's init. The self.track is created by the parent class
and corresponds to this class place in the hierarchy.
Alexander Roitman http://www.gramps-project.org