* src/DisplayTrace.py: identify more linux versions

* src/gramps_main.py: fix callbacks for reports
* src/plugins/ReorderIds.py: handle integers larger that 32bit
* src/Plugins.py: keep a separate lists for formats that support
the book format
* src/docgen/PdfDoc.py: register as a format supporting books
* src/docgen/OpenOfficeDoc.py: register as a format supporting books
* src/plugins/BookReport.py: Support different lists for books


svn: r1804
This commit is contained in:
Don Allingham 2003-06-30 03:12:22 +00:00
parent 06e08a27c4
commit deada04e03
4 changed files with 67 additions and 2 deletions

View File

@ -76,6 +76,7 @@ _expect = []
_attempt = []
_loaddir = []
_textdoc = []
_bookdoc = []
_drawdoc = []
_failmsg = []
_bkitems = []
@ -486,6 +487,18 @@ def register_text_doc(name,classref, table, paper, style, ext):
return
_textdoc.append((name,classref,table,paper,style,ext))
#-------------------------------------------------------------------------
#
# Text document registration
#
#-------------------------------------------------------------------------
def register_book_doc(name,classref, table, paper, style, ext):
"""Register a text document generator"""
for n in _bookdoc:
if n[0] == name:
return
_bookdoc.append((name,classref,table,paper,style,ext))
#-------------------------------------------------------------------------
#
# Drawing document registration
@ -654,6 +667,36 @@ def get_text_doc_menu(main_menu,tables,callback,obj=None):
index = index + 1
main_menu.set_menu(myMenu)
#-------------------------------------------------------------------------
#
# get_text_doc_menu
#
#-------------------------------------------------------------------------
def get_book_menu(main_menu,tables,callback,obj=None):
index = 0
myMenu = gtk.Menu()
_bookdoc.sort()
for item in _bookdoc:
if tables and item[2] == 0:
continue
name = item[0]
menuitem = gtk.MenuItem(name)
menuitem.set_data("name",item[1])
menuitem.set_data("styles",item[4])
menuitem.set_data("paper",item[3])
menuitem.set_data("ext",item[5])
menuitem.set_data("obj",obj)
if callback:
menuitem.connect("activate",callback)
menuitem.show()
myMenu.append(menuitem)
if name == GrampsCfg.output_preference:
myMenu.set_active(index)
callback(menuitem)
index = index + 1
main_menu.set_menu(myMenu)
#-------------------------------------------------------------------------
#
# get_text_doc_list
@ -666,6 +709,18 @@ def get_text_doc_list():
l.append(item[0])
return l
#-------------------------------------------------------------------------
#
# get_text_doc_list
#
#-------------------------------------------------------------------------
def get_book_doc_list():
l = []
_bookdoc.sort()
for item in _bookdoc:
l.append(item[0])
return l
#-------------------------------------------------------------------------
#
# get_draw_doc_list

View File

@ -616,3 +616,4 @@ class OpenOfficeDoc(TextDoc.TextDoc):
self.f.close()
Plugins.register_text_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,".sxw")
Plugins.register_book_doc(_("OpenOffice.org Writer"),OpenOfficeDoc,1,1,1,".sxw")

View File

@ -323,3 +323,12 @@ Plugins.register_text_doc(
style=1,
ext=".pdf"
)
Plugins.register_book_doc(
name=_("PDF"),
classref=PdfDoc,
table=1,
paper=1,
style=1,
ext=".pdf"
)

View File

@ -861,7 +861,7 @@ class BookReportDialog(Report.ReportDialog):
"""Build a menu of document types that are appropriate for
this text report. This menu will be generated based upon
whether the document requires table support, etc."""
Plugins.get_text_doc_menu(self.format_menu, self.doc_uses_tables(),
Plugins.get_book_menu(self.format_menu, self.doc_uses_tables(),
self.doc_type_changed)
def make_document(self):