2007-12-21 Douglas S. Blank <dblank@cs.brynmawr.edu>

* src/plugins/lineage.py: moved to new quick view format
	* src/docgen/TextBufDoc.py: fixed transient window issue



svn: r9558
This commit is contained in:
Doug Blank 2007-12-22 01:23:52 +00:00
parent 101048e1ca
commit 09e86586db
3 changed files with 41 additions and 29 deletions

View File

@ -1,3 +1,7 @@
2007-12-21 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/plugins/lineage.py: moved to new quick view format
* src/docgen/TextBufDoc.py: fixed transient window issue
2007-12-21 Gary Burton <gary.burton@zen.co.uk> 2007-12-21 Gary Burton <gary.burton@zen.co.uk>
* src/Editors/_EditEventRef.py: swap around delete/share buttons, bug #1477 * src/Editors/_EditEventRef.py: swap around delete/share buttons, bug #1477

View File

@ -40,6 +40,7 @@ from PluginUtils import register_text_doc
import const import const
import Errors import Errors
import Utils import Utils
import ManagedWindow
try: try:
import pangocairo import pangocairo
@ -59,18 +60,30 @@ def pixels(cm):
LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER' LEFT,RIGHT,CENTER = 'LEFT','RIGHT','CENTER'
_WIDTH_IN_CHARS = 72 _WIDTH_IN_CHARS = 72
class DisplayBuf(ManagedWindow.ManagedWindow):
class DisplayBuf:
# FIXME: make a managed window now that we have uistate
def __init__(self, title, document): def __init__(self, title, document):
g = gtk.glade.XML(const.GLADE_FILE,'scrollmsg') self.title = title
self.top = g.get_widget('scrollmsg') ManagedWindow.ManagedWindow.__init__(self, document.uistate, [],
document.text_view = g.get_widget('msg') document)
self.set_window(gtk.Dialog("",document.uistate.window,
gtk.DIALOG_DESTROY_WITH_PARENT,
(gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE)),
None, title)
self.window.set_size_request(600,400)
scrolled_window = gtk.ScrolledWindow()
scrolled_window.set_policy(gtk.POLICY_AUTOMATIC,gtk.POLICY_AUTOMATIC)
document.text_view = gtk.TextView()
document.text_view.set_buffer(document.buffer) document.text_view.set_buffer(document.buffer)
g.get_widget('close').connect('clicked', self.close) self.window.connect('response', self.close)
scrolled_window.add(document.text_view)
self.window.vbox.add(scrolled_window)
self.window.show_all()
def close(self, obj): def build_menu_names(self, obj):
self.top.destroy() return ('View', 'Quick View')
def get_title(self):
return self.title
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #
@ -138,7 +151,7 @@ class TextBufDoc(BaseDoc.BaseDoc, BaseDoc.TextDoc):
self.tag_table.add(tag) self.tag_table.add(tag)
self.buffer = gtk.TextBuffer(self.tag_table) self.buffer = gtk.TextBuffer(self.tag_table)
DisplayBuf('',self) DisplayBuf('Quick View',self)
return return
#-------------------------------------------------------------------- #--------------------------------------------------------------------

View File

@ -32,7 +32,7 @@ Display a person's father or mother lineage
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gen.lib import gen.lib
from Simple import SimpleAccess, SimpleDoc from Simple import SimpleAccess, SimpleDoc, SimpleTable
from gettext import gettext as _ from gettext import gettext as _
from PluginUtils import register_quick_report from PluginUtils import register_quick_report
from ReportBase import CATEGORY_QR_PERSON from ReportBase import CATEGORY_QR_PERSON
@ -57,13 +57,10 @@ def run_father(database, document, person):
" People in this lineage all share the same Y-chromosone." " People in this lineage all share the same Y-chromosone."
)) ))
sd.paragraph("") sd.paragraph("")
stab = SimpleTable(sa, sd)
sd.header2(__FMT %(_("Name Father"), _("Birth Date"), _("Death Date"))) stab.columns(_("Name Father"), _("Birth Date"), _("Death Date"), _("Remark"))
sd.paragraph("") make_details(gen.lib.Person.MALE, person, sa, sd, database, stab)
stab.write()
make_details(gen.lib.Person.MALE, person, sa, sd, database)
sd.paragraph("")
sd.paragraph("") sd.paragraph("")
if person.gender == gen.lib.Person.FEMALE : if person.gender == gen.lib.Person.FEMALE :
@ -91,12 +88,10 @@ def run_mother(database, document, person):
)) ))
sd.paragraph("") sd.paragraph("")
sd.header2(__FMT %(_("Name Mother"), _("Birth"), _("Death Date"))) stab = SimpleTable(sa, sd)
sd.paragraph("") stab.columns(_("Name Mother"), _("Birth"), _("Death Date"), _("Remark"))
make_details(gen.lib.Person.FEMALE, person, sa, sd, database, stab)
make_details(gen.lib.Person.FEMALE, person, sa, sd, database) stab.write()
sd.paragraph("")
sd.paragraph("") sd.paragraph("")
if person.gender == gen.lib.Person.MALE : if person.gender == gen.lib.Person.MALE :
@ -107,7 +102,7 @@ def run_mother(database, document, person):
make_details_child(gen.lib.Person.FEMALE, person, sa, sd, database) make_details_child(gen.lib.Person.FEMALE, person, sa, sd, database)
def make_details(gender, person, sa, sd, database) : def make_details(gender, person, sa, sd, database, stab) :
""" Function writing one line of ancestry on the document in """ Function writing one line of ancestry on the document in
direct lineage direct lineage
""" """
@ -118,10 +113,10 @@ def make_details(gender, person, sa, sd, database) :
rem_str = "" rem_str = ""
while person: while person:
person_handle = person.handle person_handle = person.handle
sd.paragraph(__FMT % (sa.name(person), sa.birth_date(person), stab.row(person, sa.birth_date(person),
sa.death_date(person))) sa.death_date(person), rem_str)
if rem_str: #if rem_str:
sd.paragraph(__FMT_REM % (_("Remark"), rem_str)) # sd.paragraph(__FMT_REM % (_("Remark"), rem_str))
personsprinted += 1 personsprinted += 1
if personsprinted > __MAX_GEN : if personsprinted > __MAX_GEN :