* src/PedView.py (rebuild_trees): Resize matching is now done later by idle callback; (add_table_to_notebook): Work with PyGtk < 2.4;(format_relation): Adapt format to availably space.

svn: r4685
This commit is contained in:
Martin Hawlisch 2005-05-26 06:33:48 +00:00
parent 107239fb4c
commit 63f788bad9
2 changed files with 18 additions and 4 deletions

View File

@ -1,6 +1,9 @@
2005-05-26 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/plugins/TestcaseGenerator.py: Add place, media and source
references.
* src/PedView.py (rebuild_trees): Resize matching is now done later by
idle callback; (add_table_to_notebook): Work with PyGtk < 2.4;
(format_relation): Adapt format to availably space.
2005-05-25 Alex Roitman <shura@gramps-project.org>
* src/EditPlace.py: WATCH cursor and temp label for References tab.

View File

@ -32,6 +32,7 @@ from gettext import gettext as _
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gobject
import gtk
import gtk.gdk
@ -113,7 +114,11 @@ class PedigreeView:
frame = gtk.ScrolledWindow(None,None)
frame.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
frame.add_with_viewport(table)
try:
self.notebook.append_page(frame,None)
except:
# for PyGtk < 2.4
self.notebook.append_page(frame,gtk.Label(""))
def change_db(self,db):
# Reconnect signals
@ -138,6 +143,9 @@ class PedigreeView:
else:
self.rebuild_trees(None)
def request_resize(self):
self.size_request_cb(self.parent_container,None,None)
def size_request_cb(self, widget, event, data=None):
if self.force_size == 0:
v = widget.get_allocation()
@ -213,9 +221,7 @@ class PedigreeView:
self.rebuild( self.table_4, pos_4, person)
self.rebuild( self.table_5, pos_5, person)
while gtk.events_pending(): # give gtk the chance to do the repainting
gtk.main_iteration()
self.size_request_cb(self.parent_container,None) # switch to matching size
gobject.idle_add(self.request_resize)
def rebuild( self, table_widget, positions, active_person):
# Build ancestor tree
@ -395,6 +401,7 @@ class PedigreeView:
person_handle = obj.get_data(_PERSON)
if person_handle:
print "PedView.on_childmenu_changed emits 'active-changed'"
self.parent.emit("active-changed", (person_handle,))
return 1
return 0
@ -681,11 +688,15 @@ class PedigreeView:
for event_handle in family.get_event_list():
event = self.db.get_event_from_handle(event_handle)
if event:
if line_count < 3:
return event.get_date()
text += _(event.get_name())
text += "\n"
text += event.get_date()
text += "\n"
text += self.get_place_name(event.get_place_handle())
if line_count < 5:
return text;
break
return text