diff --git a/gramps/src/Report.py b/gramps/src/Report.py
new file mode 100644
index 000000000..7c0b83230
--- /dev/null
+++ b/gramps/src/Report.py
@@ -0,0 +1,719 @@
+#
+# Gramps - a GTK+/GNOME based genealogy program
+#
+# Copyright (C) 2001 David R. Hampton
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+#
+
+"Report Generation Framework"
+
+import RelLib
+import const
+import os
+import re
+import sort
+import string
+import utils
+import intl
+
+_ = intl.gettext
+
+from TextDoc import *
+from StyleEditor import *
+
+import Config
+import FindDoc
+import PaperMenu
+
+import gtk
+import gnome.ui
+import libglade
+
+#------------------------------------------------------------------------
+#
+# The Report base class. This is a base class for generating
+# customized reports. It cannot be used as is, but it can be easily
+# sub-classed to create a functional report generator.
+#
+#------------------------------------------------------------------------
+class Report:
+
+ # Ordinal generation names. Used by multiple reports.
+ gen = {
+ 1 : _("First"),
+ 2 : _("Second"),
+ 3 : _("Third"),
+ 4 : _("Fourth"),
+ 5 : _("Fifth"),
+ 6 : _("Sixth"),
+ 7 : _("Seventh"),
+ 8 : _("Eighth"),
+ 9 : _("Ninth"),
+ 10: _("Tenth"),
+ 11: _("Eleventh"),
+ 12: _("Twelfth"),
+ 13: _("Thirteenth"),
+ 14: _("Fourteenth"),
+ 15: _("Fifteenth"),
+ 16: _("Sixteenth"),
+ 17: _("Seventeenth"),
+ 18: _("Eighteenth"),
+ 19: _("Nineteenth"),
+ 20: _("Twentieth"),
+ 21: _("Twenty-first"),
+ 22: _("Twenty-second"),
+ 23: _("Twenty-third"),
+ 24: _("Twenty-fourth"),
+ 25: _("Twenty-fifth"),
+ 26: _("Twenty-sixth"),
+ 27: _("Twenty-seventh"),
+ 28: _("Twenty-eighth"),
+ 29: _("Twenty-ninth")
+ }
+
+ def get_progressbar_data(self):
+ """The window title for this dialog, and the header line to
+ put at the top of the contents of the dialog box."""
+ return (_("Gramps - Progress Report"), _("Working"))
+
+ def progress_bar_setup(self,total):
+ """Create a progress dialog. This routine calls a
+ customization function to find out how to fill out the dialog.
+ The argument to this function is the maximum number of items
+ that the report will progress; i.e. what's considered 100%,
+ i.e. the maximum number of times this routine will be
+ called."""
+
+ # Load the glade file
+ base = os.path.dirname(__file__)
+ self.glade_file = os.path.join(base, "plugins", "basicreport.glade")
+ self.pxml = libglade.GladeXML(self.glade_file,"progress_dialog")
+
+ # Customize the dialog for this report
+ (title, header) = self.get_progressbar_data()
+ self.ptop = self.pxml.get_widget("progress_dialog")
+ self.ptop.set_title(title)
+ self.pxml.get_widget("header_label").set_text(header)
+
+ # Setup the progress bar limits
+ self.pbar = self.pxml.get_widget("progressbar")
+ self.pbar.configure(0.0,0.0,total)
+ self.pbar_index = 0.0
+
+ def progress_bar_step(self):
+ """Click the progress bar over to the next value. Be paranoid
+ and insure that it doesn't go over 100%."""
+ self.pbar_index = self.pbar_index + 1.0
+ if (self.pbar_index > 100.0):
+ self.pbar_index = 100.0
+ self.pbar.set_value(self.pbar_index)
+
+ def progress_bar_done(self):
+ """Done with the progress bar. It can be destroyed now."""
+ utils.destroy_passed_object(self.ptop)
+
+
+#------------------------------------------------------------------------
+#
+# The ReportDialog base class. This is a base class for generating
+# customized dialogs to solicit options for a report. It cannot be
+# used as is, but it can be easily sub-classed to create a functional
+# dialog.
+#
+#------------------------------------------------------------------------
+class ReportDialog:
+ def __init__(self,database,person,filename="basicreport.glade"):
+ """Initialize a dialog to request that the user select options
+ for a basic report. The glade filename is optional. If
+ provided it must reference a glade file that is either be a
+ superset of the basic dialog, or the subclass must override
+ most of the setup_xxx and parse_xxx functions."""
+
+ # Save info about who the report is about.
+ self.db = database
+ self.person = person
+
+ # Load the glade file
+ base = os.path.dirname(__file__)
+ self.glade_file = os.path.join(base, "plugins", filename)
+ self.topDialog = libglade.GladeXML(self.glade_file,"report_dialog")
+
+ # Set up and run the dialog. These calls are not in top down
+ # order when looking at the dialog box as there is some
+ # interaction between the various frames.
+ self.setup_title()
+ self.setup_header()
+ self.setup_output_notebook()
+ self.setup_target_frame()
+ self.setup_style_frame()
+ self.setup_format_frame()
+ self.setup_paper_frame()
+ self.setup_html_frame()
+ self.setup_report_options_frame()
+ self.setup_other_frames()
+ self.connect_signals()
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks for subclasses
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog."""
+ return(_("Gramps - Base Report"))
+
+ def get_header(self, name):
+ """The header line to put at the top of the contents of the
+ dialog box. By default this will just be the name of the
+ selected person. Most subclasses will customize this to give
+ some indication of what the report will be, i.e. 'Descendant
+ Report for %s'."""
+ return(name)
+
+ def get_target_browser_title(self):
+ """The title of the window that will be created when the user
+ clicks the 'Browse' button in the 'Save As' File Entry
+ widget."""
+ return(_("Gramps - Save Report As"))
+
+ def get_target_is_directory(self):
+ """Is the user being asked to input the name of a file or a
+ directory in the 'Save As' File Entry widget. This item
+ currently only selects the Filename/Directory prompt, and
+ whether or not the browser accepts filenames. In the future it
+ may also control checking of the selected filename."""
+ return None
+
+ def get_stylesheet_savefile(self):
+ """Where should new styles for this report be saved? This is
+ the name of an XML file that will be located in the ~/.gramps
+ directory. This file does not have to exist; it will be
+ created when needed. All subclasses should probably override
+ this function."""
+ return "basic_report.xml"
+
+ def get_print_pagecount_map(self):
+ """Return the data used to fill out the 'pagecount' option
+ menu in the print options box. The first value is a mapping
+ of string:value pairs. The strings will be used to label
+ individual menu items, and the values are what will be
+ returned if a given menu item is selected. The second value
+ is the name of menu item to pre-select."""
+ return (None, None)
+
+ def get_report_filter_strings(self):
+ """Return the data used to fill out the 'filter' combo box in
+ the report options box. The return value is the list of
+ strings to be inserted into the pulldown."""
+ return None
+
+ def get_report_generations(self):
+ """Return the default number of generations to start the
+ spinbox (zero to disable) and whether or not to include the
+ 'page break between generations' check box"""
+ return (10, 1)
+
+ def get_report_extra_menu_map(self):
+ """Return the data used to fill out the 'extra' option menu in
+ the report options box. The first value is the string to be
+ used as the label to the left of the menu. The second value
+ is a mapping of string:value pairs. The strings will be used
+ to label individual menu items, and the values are what will
+ be returned if a given menu item is selected. The final value
+ is the name of menu item to pre-select."""
+ return (None, None, None)
+
+ def get_report_extra_textbox_string(self):
+ """Return the string to put into the 'extra' text box in
+ the report options box. If None, then the text box will be
+ hidden."""
+ return (None, None)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related getting/setting the default directory for a dialog.
+ #
+ #------------------------------------------------------------------------
+ def get_default_directory(self):
+ """Get the name of the directory to which the target dialog
+ box should default. This value can be set in the preferences
+ panel."""
+ return Config.report_dir
+
+ def set_default_directory(self, value):
+ """Save the name of the current directory, so that any future
+ reports will default to the most recently used directory.
+ This also changes the directory name that will appear in the
+ preferences panel, but does not change the preference in disk.
+ This means that the last directory used will only be
+ remembered for this session of gramps unless the user saves
+ his/her preferences."""
+ Config.report_dir = value
+
+ #------------------------------------------------------------------------
+ #
+ # Functions to create a default output style.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Create the default style to be used by the associated report. This
+ routine is a default implementation and should be overridden."""
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=16,bold=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(1)
+ para.set(pad=0.5)
+ self.default_style.add_style("Title",para)
+
+ def build_style_menu(self,dummy):
+ """Build a menu of style sets that are available for use in
+ this report. This menu will always have a default style
+ available, and will have any other style set name that the
+ user has previously created for this report. This menu is
+ created here instead of inline with the rest of the style
+ frame, because it must be recreated to reflect any changes
+ whenever the user closes the style editor dialog."""
+ style_sheet_map = self.style_sheet_list.get_style_sheet_map()
+ myMenu = utils.build_string_optmenu(style_sheet_map, "default")
+ self.style_menu.set_menu(myMenu)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to selecting/changing the current file format.
+ #
+ #------------------------------------------------------------------------
+ def make_doc_menu(self):
+ """Build a menu of document types that are appropriate for
+ this report. This menu will be generated based upon the type
+ of document (text, draw, graph, etc. - a subclass), whether or
+ not the document requires table support, etc."""
+ assert 0, _("The make_doc_menu function must be overridden.")
+
+ def make_document(self):
+ """Create a document of the type selected by the user."""
+ assert 0, _("The make_document function must be overridden.")
+
+ def doc_type_changed(self, obj):
+ """This routine is called when the user selects a new file
+ formats for the report. It adjust the various dialog sections
+ to reflect the appropriate values for the currently selected
+ file format. For example, a HTML document doesn't need any
+ paper size/orientation options, but it does need a template
+ file. Those chances are made here."""
+
+ # Is this to be a printed report or an electronic report
+ # (i.e. a set of web pages)
+ if obj.get_data("paper") == 1:
+ self.output_notebook.set_page(0)
+ else:
+ self.output_notebook.set_page(1)
+
+ # Does this report format use styles?
+ self.style_frame.set_sensitive(obj.get_data("styles"))
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to setting up the dialog window.
+ #
+ #------------------------------------------------------------------------
+ def setup_title(self):
+ """Set up the title bar of the dialog. This function relies
+ on the get_title() customization function for what the title
+ should be."""
+ self.window = self.topDialog.get_widget("report_dialog")
+ self.name = self.person.getPrimaryName().getRegularName()
+ self.window.set_title(self.get_title())
+
+ def setup_header(self):
+ """Set up the header line bar of the dialog. This function
+ relies on the get_header() customization function for what the
+ header line should read. If no customization function is
+ supplied by the subclass, the default is to use the full name
+ of the currently selected person."""
+ name = self.person.getPrimaryName().getRegularName()
+ self.header = self.topDialog.get_widget("header_label")
+ self.header.set_text(self.get_header(name))
+
+ def setup_target_frame(self):
+ """Set up the target frame of the dialog. This function
+ relies on several target_xxx() customization functions to
+ determine whether the target is a directory or file, what the
+ title of any browser window should be, and what default
+ directory should be used."""
+ self.target_fileentry = self.topDialog.get_widget("fileentry1")
+ self.target_fileentry.set_title(self.get_target_browser_title())
+ self.target_fileentry.set_default_path(self.get_default_directory())
+ if (self.get_target_is_directory()):
+ import _gnomeui
+ _gnomeui.gnome_file_entry_set_directory(self.target_fileentry._o, 1)
+ self.topDialog.get_widget("saveas").set_text(_("Directory"))
+ self.target_filename = self.topDialog.get_widget("filename")
+ self.target_filename.set_text(self.get_default_directory())
+
+ # Faugh! The following line of code would allow the 'Enter'
+ # key in the file name box to close the dialog. However there
+ # is a bug (or is it?) in the closing of the Gnome FileEntry
+ # browser that sends the same signal that is sent when the
+ # 'Enter' key is pressed. This causes the report to be run
+ # when the browser window is closed instead of waiting for the
+ # dialog window OK button to be clicked. The user does not
+ # have a chance to set any other options.
+ #
+ # self.window.editable_enters(self.target_filename)
+
+ def setup_format_frame(self):
+ """Set up the format frame of the dialog. This function
+ relies on the make_doc_menu() function to do all the hard
+ work."""
+ self.format_menu = self.topDialog.get_widget("format")
+ self.make_doc_menu()
+
+ def setup_style_frame(self):
+ """Set up the style frame of the dialog. This function relies
+ on other routines create the default style for this report,
+ and to read in any user defined styles for this report. It
+ the builds a menu of all the available styles for the user to
+ choose from."""
+ self.style_frame = self.topDialog.get_widget("style_frame")
+ self.style_menu = self.topDialog.get_widget("style_menu")
+
+ # Build the default style set for this report.
+ self.default_style = StyleSheet()
+ self.make_default_style()
+
+ # Build the initial list of available styles sets. This
+ # includes the default style set and any style sets saved from
+ # previous invocations of gramps.
+ self.style_sheet_list = StyleSheetList(self.get_stylesheet_savefile(),
+ self.default_style)
+
+ # Now build the actual menu.
+ self.build_style_menu(None)
+
+ def setup_output_notebook(self):
+ """Set up the output notebook of the dialog. This sole
+ purpose of this function is to grab a pointer for later use in
+ the callback from when the file format is changed."""
+ self.output_notebook = self.topDialog.get_widget("output_notebook")
+
+ def setup_paper_frame(self):
+ """Set up the paper selection frame of the dialog. This
+ function relies on a paper_xxx() customization functions to
+ determine whether the pagecount menu should appear and what
+ its strings should be."""
+ # Paper size and orientation. Always present in this frame.
+ self.papersize_menu = self.topDialog.get_widget("papersize")
+ PaperMenu.make_paper_menu(self.papersize_menu)
+ self.orientation_menu = self.topDialog.get_widget("orientation")
+ PaperMenu.make_orientation_menu(self.orientation_menu)
+
+ # The optional pagecount stuff.
+ self.pagecount_menu = self.topDialog.get_widget("pagecount_menu")
+ self.pagecount_label = self.topDialog.get_widget("pagecount_label")
+ (pagecount_map, start_text) = self.get_print_pagecount_map()
+ if pagecount_map:
+ myMenu = utils.build_string_optmenu(pagecount_map, start_text)
+ self.pagecount_menu.set_menu(myMenu)
+ else:
+ self.pagecount_menu.hide()
+ self.pagecount_label.hide()
+
+ def setup_html_frame(self):
+ """Set up the html frame of the dialog. This sole purpose of
+ this function is to grab a pointer for later use in the parse
+ html frame function."""
+ self.html_fileentry = self.topDialog.get_widget("htmltemplate")
+
+ def setup_report_options_frame(self):
+ """Set up the report options frame of the dialog. This
+ function relies on several report_xxx() customization
+ functions to determine which of the items should be present in
+ this box. *All* of these items are optional, although the
+ generations fields and the filter combo box are used in most
+ (but not all) dialog boxes."""
+
+ # Set up the generations spin and page break checkbox
+ (use_gen, use_break) = self.get_report_generations()
+ self.generations_spinbox = self.topDialog.get_widget("generations")
+ self.pagebreak_checkbox = self.topDialog.get_widget("pagebreak")
+ if use_gen:
+ self.generations_spinbox.set_value(use_gen)
+ else:
+ self.topDialog.get_widget("gen_label").hide()
+ self.generations_spinbox.hide()
+ use_break = 0
+ if not use_break:
+ self.pagebreak_checkbox.hide()
+
+ # Now the filter combo
+ self.filter_combo = self.topDialog.get_widget("filter_combo")
+ filter_strings = self.get_report_filter_strings()
+ if filter_strings:
+ filter_strings.sort()
+ self.filter_combo.set_popdown_strings(filter_strings)
+ else:
+ self.topDialog.get_widget("filter_label").hide()
+ self.filter_combo.hide()
+
+ # Now the "extra" option menu
+ self.extra_menu_label = self.topDialog.get_widget("extra_menu_label")
+ self.extra_menu = self.topDialog.get_widget("extra_menu")
+ (label, extra_map, preset) = self.get_report_extra_menu_map()
+ if extra_map:
+ self.extra_menu_label.set_text(label)
+ myMenu = utils.build_string_optmenu(extra_map, preset)
+ self.extra_menu.set_menu(myMenu)
+ self.extra_menu.set_sensitive(len(extra_map) > 1)
+ else:
+ self.extra_menu_label.hide()
+ self.extra_menu.hide()
+
+ # Now the "extra" text box
+ self.extra_textbox_label = self.topDialog.get_widget("extra_textbox_label")
+ self.extra_textbox = self.topDialog.get_widget("extra_textbox")
+ (label, string) = self.get_report_extra_textbox_string()
+ if string:
+ self.extra_textbox_label.set_text(label)
+ self.extra_textbox.insert_defaults(string)
+ else:
+ self.extra_textbox_label.hide()
+ self.topDialog.get_widget("extra_scrolledwindow").hide()
+
+ def setup_other_frames(self):
+ """Do nothing. This sole purpose of this function is to give
+ subclass a place to hang a routine to handle any other frames
+ that are unique to that specific report."""
+ pass
+
+ def connect_signals(self):
+ """Connect the signal handlers for this dialog. The signal
+ handlers in this default function will handle all of the items
+ in the basic report dialog. Most items do not interact with
+ each other, and their vales will be read back when the user
+ clicks the OK button. This dialog only need be sub-classed if
+ there is interaction between/within any additional frames
+ added in a subclass."""
+ self.topDialog.signal_autoconnect({
+ "destroy_passed_object" : utils.destroy_passed_object,
+ "on_style_edit_clicked" : self.on_style_edit_clicked,
+ "on_ok_clicked" : self.on_ok_clicked
+ })
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to retrieving data from the dialog window
+ #
+ #------------------------------------------------------------------------
+ def parse_target_frame(self):
+ """Parse the target frame of the dialog. If the target
+ filename is empty this routine returns a special value of None
+ to tell the calling routine to give up. This function also
+ saves the current directory so that any future reports will
+ default to the most recently used directory."""
+ self.target_path = self.target_fileentry.get_full_path(0)
+ if not self.target_path:
+ return None
+ self.set_default_directory(os.path.dirname(self.target_path) + os.sep)
+ return 1
+
+ def parse_format_frame(self):
+ """Parse the format frame of the dialog. Save the user
+ selected output format for later use."""
+ self.format = self.format_menu.get_menu().get_active().get_data("name")
+
+ def parse_style_frame(self):
+ """Parse the style frame of the dialog. Save the user
+ selected output style for later use. Note that this routine
+ retrieves a value whether or not the menu is displayed on the
+ screen. The subclass will know whether this menu was enabled.
+ This is for simplicity of programming."""
+ self.selected_style = self.style_menu.get_menu().get_active().get_data("d")
+
+ def parse_paper_frame(self):
+ """Parse the paper frame of the dialog. Save the user
+ selected choices for later use. Note that this routine
+ retrieves a value from the pagecount menu, whether or not it
+ is displayed on the screen. The subclass will know which ones
+ it has enabled. This is for simplicity of programming."""
+ self.paper = self.papersize_menu.get_menu().get_active().get_data("i")
+ self.orien = self.orientation_menu.get_menu().get_active().get_data("i")
+ self.pagecount = self.pagecount_menu.get_menu().get_active().get_data("d")
+
+ def parse_html_frame(self):
+ """Parse the html frame of the dialog. Save the user selected
+ html template name for later use. Note that this routine
+ retrieves a value whether or not the file entry box is
+ displayed on the screen. The subclass will know whether this
+ entry was enabled. This is for simplicity of programming."""
+ self.template_name = self.html_fileentry.get_full_path(0)
+
+ def parse_report_options_frame(self):
+ """Parse the report options frame of the dialog. Save the
+ user selected choices for later use. Note that this routine
+ retrieves a value from all fields in the frame, regardless of
+ whether or not they are displayed on the screen. The subclass
+ will know which ones it has enabled. This is for simplicity
+ of programming."""
+ self.max_gen = self.generations_spinbox.get_value_as_int()
+ self.pg_brk = self.pagebreak_checkbox.get_active()
+ self.filter = self.filter_combo.entry.get_text()
+ self.report_menu = self.extra_menu.get_menu().get_active().get_data("d")
+ self.report_text = string.split(self.extra_textbox.get_chars(0,-1),'\n')
+
+ def parse_other_frames(self):
+ """Do nothing. This sole purpose of this function is to give
+ subclass a place to hang a routine to parser any other frames
+ that are unique to that specific report."""
+ pass
+
+ #------------------------------------------------------------------------
+ #
+ # Callback functions from the dialog
+ #
+ #------------------------------------------------------------------------
+ def on_style_edit_clicked(self, obj):
+ """The user has clicked on the 'Edit Styles' button. Create a
+ style sheet editor object and let them play. When they are
+ done, the previous routine will be called to update the dialog
+ menu for selecting a style."""
+ StyleListDisplay(self.style_sheet_list,self.build_style_menu,None)
+
+ def on_ok_clicked(self, obj):
+ """The user is satisfied with the dialog choices. Validate
+ the output file name before doing anything else. If there is
+ a file name, gather the options and create the report."""
+
+ # Is there a filename? This should also test file permissions, etc.
+ if not self.parse_target_frame():
+ return
+
+ # Preparation
+ self.parse_format_frame()
+ self.parse_style_frame()
+ self.parse_paper_frame()
+ self.parse_html_frame()
+ self.parse_report_options_frame()
+ self.parse_other_frames()
+
+ # Create the output document.
+ self.make_document()
+
+ # Create the report object and product the report.
+ self.make_report()
+
+ # Clean up the dialog object
+ utils.destroy_passed_object(obj)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to creating the actual report document.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the contents of the report. This is the meat and
+ potatoes of reports. The whole purpose of the dialog is to
+ get to this routine so that data is written to a file. This
+ routine should either write the data directly to the file, or
+ better yet, should create a subclass of a Report that will
+ write the data to a file."""
+ assert 0, _("The make_report function must be overridden.")
+
+#------------------------------------------------------------------------
+#
+# TextReportDialog - A class of ReportDialog customized for text based
+# reports.
+#
+#------------------------------------------------------------------------
+class TextReportDialog(ReportDialog):
+ def __init__(self,database,person,filename):
+ """Initialize a dialog to request that the user select options
+ for a basic text report. See the ReportDialog class for more
+ information."""
+ ReportDialog.__init__(self,database,person,filename)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks for subclasses
+ #
+ #------------------------------------------------------------------------
+ def doc_uses_tables(self):
+ """Does this report require the ability to generate tables in
+ the file format. Override this for documents that do need
+ table support."""
+ return 0
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to selecting/changing the current file format.
+ #
+ #------------------------------------------------------------------------
+ def make_doc_menu(self):
+ """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."""
+ FindDoc.get_text_doc_menu(self.format_menu, self.doc_uses_tables(),
+ self.doc_type_changed)
+
+ def make_document(self):
+ """Create a document of the type requested by the user."""
+ self.doc = FindDoc.make_text_doc(self.selected_style,self.format,
+ self.paper,self.orien,
+ self.template_name)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to creating the actual report document.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the contents of the report. This is a simple
+ default implementation suitable for testing. Is should be
+ overridden to produce a real report."""
+ self.doc.start_paragraph("Title")
+ title = "Basic Report for %s" % self.name
+ self.doc.write_text(title)
+ self.doc.end_paragraph()
+
+
+
+#------------------------------------------------------------------------
+#
+# DrawReportDialog - A class of ReportDialog customized for drawing based
+# reports.
+#
+#------------------------------------------------------------------------
+class DrawReportDialog(ReportDialog):
+ def __init__(self,database,person,filename):
+ """Initialize a dialog to request that the user select options
+ for a basic drawing report. See the ReportDialog class for
+ more information."""
+ ReportDialog.__init__self,database,person,filename()
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to selecting/changing the current file format.
+ #
+ #------------------------------------------------------------------------
+ def make_doc_menu(self):
+ """Build a menu of document types that are appropriate for
+ this drawing report."""
+ FindDoc.get_draw_doc_menu(self.format_menu)
+
+ def make_document(self):
+ """Create a document of the type requested by the user."""
+ self.doc = FindDoc.make_draw_doc(self.selected_style,self.format,
+ self.paper,self.orien)
diff --git a/gramps/src/TextDoc.py b/gramps/src/TextDoc.py
index a1e613454..01781a71a 100644
--- a/gramps/src/TextDoc.py
+++ b/gramps/src/TextDoc.py
@@ -76,6 +76,12 @@ class PaperStyle:
def get_width(self):
return self.width
+ def get_height_inches(self):
+ return self.height / 2.54
+
+ def get_width_inches(self):
+ return self.width / 2.54
+
#------------------------------------------------------------------------
#
#
@@ -402,6 +408,9 @@ class StyleSheetList:
def delete_style_sheet(self,name):
del self.map[name]
+ def get_style_sheet_map(self):
+ return self.map
+
def get_style_sheet(self,name):
return self.map[name]
diff --git a/gramps/src/plugins/AncestorChart.py b/gramps/src/plugins/AncestorChart.py
index bbf0f0235..bd9172789 100644
--- a/gramps/src/plugins/AncestorChart.py
+++ b/gramps/src/plugins/AncestorChart.py
@@ -21,17 +21,12 @@
"Generate files/Ancestor Chart"
import Config
-import const
import os
import string
-import utils
from FontScale import string_width
-
-from TextDoc import *
from DrawDoc import *
-from StyleEditor import *
-import FindDoc
+from Report import *
import libglade
import gtk
@@ -39,17 +34,6 @@ import gtk
import intl
_ = intl.gettext
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-active_person = None
-db = None
-styles = StyleSheet()
-style_sheet_list = None
-topDialog = None
-
#------------------------------------------------------------------------
#
# pt2cm - convert points to centimeters
@@ -63,14 +47,14 @@ def pt2cm(pt):
#
#
#------------------------------------------------------------------------
-class AncestorReport:
+class AncestorChart:
#--------------------------------------------------------------------
#
#
#
#--------------------------------------------------------------------
- def __init__(self,database,display,person,output,doc,max):
+ def __init__(self,database,person,output,max,doc,display):
self.doc = doc
self.doc.creator(database.getResearcher().getName())
self.map = {}
@@ -141,7 +125,6 @@ class AncestorReport:
#
#--------------------------------------------------------------------
def write_report(self):
-
self.calc()
try:
self.doc.open(self.output)
@@ -256,114 +239,81 @@ class AncestorReport:
self.draw_graph(index*2,start*2,level+1)
self.draw_graph((index*2)+1,(start*2)+1,level+1)
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class AncestorChartDialog(DrawReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Ancestor Chart")
+
+ def get_header(self, name):
+ """The header line at the top of the dialog contents."""
+ return _("Ancestor Chart for %s") % name
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Ancestor Chart")
+
+ def get_stylesheet_savefile(self):
+ """Where to save user defined styles for this report."""
+ return "ancestor_chart.xml"
+
+ def get_report_generations(self):
+ """Default to 10 generations, no page breaks."""
+ return (10, 0)
+
+ def get_report_extra_textbox_string(self):
+ """Label the textbox and provide the default contents."""
+ return (_("Display Format"), "$n\nb. $b\nd. $d")
+
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Ancestor Chart report."""
+ f = FontStyle()
+ f.set_size(9)
+ f.set_type_face(FONT_SANS_SERIF)
+ p = ParagraphStyle()
+ p.set_font(f)
+ self.default_style.add_style("Normal",p)
+
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Ancestor Chart.
+ All user dialog has already been handled and the output file
+ opened."""
+ MyReport = AncestorChart(self.db, self.person, self.target_path,
+ self.max_gen, self.doc, self.report_text)
+ MyReport.write_report()
+
+
+
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
- import PaperMenu
-
- global style_sheet_list
- global active_person
- global topDialog
- global db
-
- active_person = person
- db = database
-
- base = os.path.dirname(__file__)
- glade_file = base + os.sep + "ancestorchart.glade"
- topDialog = libglade.GladeXML(glade_file,"dialog1")
- topDialog.get_widget("fileentry1").set_default_path(Config.report_dir)
-
- name = person.getPrimaryName().getRegularName()
-
- PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
- PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
- FindDoc.get_draw_doc_menu(topDialog.get_widget("format"))
-
- styles.clear()
- f = FontStyle()
- f.set_size(9)
- f.set_type_face(FONT_SANS_SERIF)
- p = ParagraphStyle()
- p.set_font(f)
- styles.add_style("Normal",p)
-
- style_sheet_list = StyleSheetList("ancestor_chart.xml",styles)
- build_menu(None)
-
- title = _("Ancestor Chart for %s") % name
- topDialog.get_widget("labelTitle").set_text(title)
- topDialog.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked" : on_save_clicked
- })
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = gtk.GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- pass
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_save_clicked(obj):
- global active_person
- global db
-
- outputName = topDialog.get_widget("fileentry1").get_full_path(0)
- if outputName == "":
- return
-
- paper_obj = topDialog.get_widget("papersize").get_menu().get_active()
- paper = paper_obj.get_data("i")
- orien_obj = topDialog.get_widget("orientation").get_menu().get_active()
- orien = orien_obj.get_data("i")
- max_gen = topDialog.get_widget("generations").get_value_as_int()
- text = topDialog.get_widget("display_text").get_chars(0,-1)
- text = string.split(text,'\n')
-
- styles = topDialog.get_widget("style_menu").get_menu().get_active().get_data("d")
- item = topDialog.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
- doc = FindDoc.make_draw_doc(styles,format,paper,orien)
-
- MyReport = AncestorReport(db,text,active_person,outputName,doc,max_gen)
- MyReport.write_report()
-
- utils.destroy_passed_object(obj)
+ AncestorChartDialog(database,person)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/AncestorReport.py b/gramps/src/plugins/AncestorReport.py
index 677400c21..e721a9798 100644
--- a/gramps/src/plugins/AncestorReport.py
+++ b/gramps/src/plugins/AncestorReport.py
@@ -21,19 +21,13 @@
"Generate files/Ahnentafel Report"
import RelLib
-import const
import os
import string
-import utils
-import Config
import intl
_ = intl.gettext
-from TextDoc import *
-from StyleEditor import *
-
-import FindDoc
+from Report import *
import gtk
import gnome.ui
@@ -44,57 +38,14 @@ import libglade
#
#
#------------------------------------------------------------------------
-active_person = None
-db = None
-styles = StyleSheet()
-style_sheet_list = None
-topDialog = None
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-class AncestorReport:
-
- gen = {
- 1 : _("First"),
- 2 : _("Second"),
- 3 : _("Third"),
- 4 : _("Fourth"),
- 5 : _("Fifth"),
- 6 : _("Sixth"),
- 7 : _("Seventh"),
- 8 : _("Eighth"),
- 9 : _("Ninth"),
- 10: _("Tenth"),
- 11: _("Eleventh"),
- 12: _("Twelfth"),
- 13: _("Thirteenth"),
- 14: _("Fourteenth"),
- 15: _("Fifteenth"),
- 16: _("Sixteenth"),
- 17: _("Seventeenth"),
- 18: _("Eightteenth"),
- 19: _("Nineteenth"),
- 20: _("Twentieth"),
- 21: _("Twenty-first"),
- 22: _("Twenty-second"),
- 23: _("Twenty-third"),
- 24: _("Twenty-fourth"),
- 25: _("Twenty-fifth"),
- 26: _("Twenty-sixth"),
- 27: _("Twenty-seventh"),
- 28: _("Twenty-eighth"),
- 29: _("Twenty-ninth")
- }
+class AncestorReport(Report):
#--------------------------------------------------------------------
#
#
#
#--------------------------------------------------------------------
- def __init__(self,database,person,output,max,pgbrk,doc):
+ def __init__(self,database,person,output,max,doc,pgbrk):
self.map = {}
self.database = database
self.start = person
@@ -268,135 +219,86 @@ class AncestorReport:
self.doc.close()
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class AncestorReportDialog(TextReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Ahnentafel Report")
+
+ def get_header(self, name):
+ """The header line at the top of the dialog contents"""
+ return _("Ahnentafel Report for %s") % name
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Ancestor Report")
+
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "ancestor_report.xml"
+
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Ahnentafel report."""
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=16,bold=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(1)
+ para.set(pad=0.5)
+ self.default_style.add_style("Title",para)
+
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=14,italic=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(2)
+ para.set(pad=0.5)
+ self.default_style.add_style("Generation",para)
+
+ para = ParagraphStyle()
+ para.set(first_indent=-1.0,lmargin=1.0,pad=0.25)
+ self.default_style.add_style("Entry",para)
+
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Ahnentafel Report.
+ All user dialog has already been handled and the output file
+ opened."""
+ MyReport = AncestorReport(self.db, self.person, self.target_path,
+ self.max_gen, self.doc, self.pg_brk)
+ MyReport.write_report()
+
+
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
- import PaperMenu
-
- global active_person
- global topDialog
- global db
- global style_sheet_list
-
- active_person = person
- db = database
+ AncestorReportDialog(database,person)
- base = os.path.dirname(__file__)
- glade_file = base + os.sep + "ancestorreport.glade"
- topDialog = libglade.GladeXML(glade_file,"dialog1")
- topDialog.get_widget("fileentry1").set_default_path(Config.report_dir)
-
- name = person.getPrimaryName().getRegularName()
-
- PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
- PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
- FindDoc.get_text_doc_menu(topDialog.get_widget("format"),0,option_switch)
-
- styles.clear()
- font = FontStyle()
- font.set(face=FONT_SANS_SERIF,size=16,bold=1)
- para = ParagraphStyle()
- para.set_font(font)
- para.set_header_level(1)
- para.set(pad=0.5)
- styles.add_style("Title",para)
-
- font = FontStyle()
- font.set(face=FONT_SANS_SERIF,size=14,italic=1)
- para = ParagraphStyle()
- para.set_font(font)
- para.set_header_level(2)
- para.set(pad=0.5)
- styles.add_style("Generation",para)
-
- para = ParagraphStyle()
- para.set(first_indent=-1.0,lmargin=1.0,pad=0.25)
- styles.add_style("Entry",para)
-
- style_sheet_list = StyleSheetList("ancestor_report.xml",styles)
- build_menu(None)
-
- topDialog.get_widget("labelTitle").set_text(_("Ahnentafel Report for %s") % name)
- topDialog.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked" : on_save_clicked
- })
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = gtk.GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- val = obj.get_data("paper")
- st = obj.get_data("styles")
- notebook = topDialog.get_widget("option_notebook")
- if val == 1:
- notebook.set_page(0)
- else:
- notebook.set_page(1)
- topDialog.get_widget("style_frame").set_sensitive(st)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_save_clicked(obj):
- global active_person
- global db
-
- outputName = topDialog.get_widget("fileentry1").get_full_path(0)
- if not outputName:
- return
-
- max_gen = topDialog.get_widget("generations").get_value_as_int()
- pgbrk = topDialog.get_widget("pagebreak").get_active()
- template = topDialog.get_widget("htmltemplate").get_full_path(0)
- paper_obj = topDialog.get_widget("papersize").get_menu().get_active()
- paper = paper_obj.get_data("i")
- orien_obj = topDialog.get_widget("orientation").get_menu().get_active()
- orien = orien_obj.get_data("i")
-
- item = topDialog.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
-
- styles = topDialog.get_widget("style_menu").get_menu().get_active().get_data("d")
-
- doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
-
- MyReport = AncestorReport(db,active_person,outputName,max_gen,pgbrk,doc)
- MyReport.write_report()
-
- utils.destroy_passed_object(obj)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/DescendReport.py b/gramps/src/plugins/DescendReport.py
index 4fccbc018..6c1706655 100644
--- a/gramps/src/plugins/DescendReport.py
+++ b/gramps/src/plugins/DescendReport.py
@@ -27,12 +27,7 @@ import intl
_ = intl.gettext
-import const
-import Config
-import utils
-from TextDoc import *
-from StyleEditor import *
-import FindDoc
+from Report import *
import gtk
import libglade
@@ -49,10 +44,11 @@ class DescendantReport:
#
#
#--------------------------------------------------------------------
- def __init__(self,name,person,db,doc):
+ def __init__(self,db,person,name,max,doc):
self.creator = db.getResearcher().getName()
self.name = name
self.person = person
+ self.max_generations = max
self.doc = doc
#--------------------------------------------------------------------
@@ -116,6 +112,9 @@ class DescendantReport:
self.dump_dates(person)
self.doc.end_paragraph()
+ if (level >= self.max_generations):
+ return
+
childlist = []
for family in person.getFamilyList():
for child in family.getChildList():
@@ -130,30 +129,39 @@ class DescendantReport:
#
#
#------------------------------------------------------------------------
-class DesReportWindow:
- def __init__(self,person,db):
- import PaperMenu
-
- self.person = person
+class DescendantReportDialog(TextReportDialog):
+ def __init__(self,person,database):
+ ReportDialog.__init__(self,database,person)
- glade_file = os.path.dirname(__file__) + os.sep + "desreport.glade"
- self.top = libglade.GladeXML(glade_file,"dialog1")
- self.top.get_widget("fileentry1").set_default_path(Config.report_dir)
- self.top.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked": on_save_clicked
- })
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Descendant Report")
- notebook = self.top.get_widget("option_notebook")
- notebook.set_data("frame",self.top.get_widget("style_frame"))
- PaperMenu.make_paper_menu(self.top.get_widget("papersize"))
- PaperMenu.make_orientation_menu(self.top.get_widget("orientation"))
- FindDoc.get_text_doc_menu(self.top.get_widget("format"),0,\
- option_switch,notebook)
-
- mytop = self.top.get_widget("dialog1")
+ def get_header(self, name):
+ """The header line at the top of the dialog contents"""
+ return _("Descendant Report for %s") % name
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Descendant Report")
+
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "descend_report.xml"
+
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Descendant Report."""
f = FontStyle()
f.set_size(14)
f.set_type_face(FONT_SANS_SERIF)
@@ -161,56 +169,29 @@ class DesReportWindow:
p = ParagraphStyle()
p.set_header_level(1)
p.set_font(f)
-
- sheet = StyleSheet()
- sheet.add_style("Title",p)
+ self.default_style.add_style("Title",p)
f = FontStyle()
for i in range(1,10):
p = ParagraphStyle()
p.set_font(f)
p.set_left_margin(float(i-1))
- sheet.add_style("Level" + str(i),p)
+ self.default_style.add_style("Level" + str(i),p)
- self.style_sheet_list = StyleSheetList("descend_report.xml",sheet)
- build_menu(self)
-
- mytop.set_data("o",self)
- mytop.set_data("d",db)
- mytop.show()
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
-
- myMenu = gtk.GtkMenu()
-
- for style in object.style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",object.style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
-
- object.top.get_widget("style_menu").set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- val = obj.get_data("paper")
- st = obj.get_data("styles")
- notebook = obj.get_data("obj")
- frame = notebook.get_data("frame")
- if val == 1:
- notebook.set_page(0)
- else:
- notebook.set_page(1)
- frame.set_sensitive(st)
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Descendant Report.
+ All user dialog has already been handled and the output file
+ opened."""
+ MyReport = DescendantReport(self.db, self.person, self.target_path,
+ self.max_gen, self.doc)
+ MyReport.setup()
+ MyReport.report()
+ MyReport.end()
#------------------------------------------------------------------------
#
@@ -218,50 +199,7 @@ def option_switch(obj):
#
#------------------------------------------------------------------------
def report(database,person):
- DesReportWindow(person,database)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- myobj = obj.get_data("o")
- StyleListDisplay(myobj.style_sheet_list,build_menu,myobj)
-
-#-------------------------------------------------------------------------
-#
-#
-#
-#-------------------------------------------------------------------------
-def on_save_clicked(obj):
- myobj = obj.get_data("o")
- db = obj.get_data("d")
-
- file = myobj.top.get_widget("fileentry1").get_full_path(0)
- if file == "":
- return
-
- paper_obj = myobj.top.get_widget("papersize")
- paper = paper_obj.get_menu().get_active().get_data("i")
-
- orien_obj = myobj.top.get_widget("orientation")
- orien = orien_obj.get_menu().get_active().get_data("i")
-
- template = myobj.top.get_widget("htmltemplate").get_full_path(0)
-
- item = myobj.top.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
-
- styles = myobj.top.get_widget("style_menu").get_menu().get_active().get_data("d")
- doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
-
- report = DescendantReport(file,myobj.person,db,doc)
- report.setup()
- report.report()
- report.end()
-
- utils.destroy_passed_object(obj)
+ DescendantReportDialog(person,database)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/DetAncestralReport.py b/gramps/src/plugins/DetAncestralReport.py
index 292ef2931..ffced7bb1 100644
--- a/gramps/src/plugins/DetAncestralReport.py
+++ b/gramps/src/plugins/DetAncestralReport.py
@@ -22,20 +22,13 @@
"Generate files/Detailed Ancestral Report"
import RelLib
-import const
import os
-import re
import sort
-import string
-import utils
import intl
_ = intl.gettext
-from TextDoc import *
-from StyleEditor import *
-
-import FindDoc
+from Report import *
import gtk
import gnome.ui
@@ -46,50 +39,8 @@ import libglade
#
#
#------------------------------------------------------------------------
-active_person = None
-db = None
-styles = StyleSheet()
-style_sheet_list = None
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-class DetAncestorReport:
-
- gen = {
- 1 : _("First"),
- 2 : _("Second"),
- 3 : _("Third"),
- 4 : _("Fourth"),
- 5 : _("Fifth"),
- 6 : _("Sixth"),
- 7 : _("Seventh"),
- 8 : _("Eighth"),
- 9 : _("Ninth"),
- 10: _("Tenth"),
- 11: _("Eleventh"),
- 12: _("Twelfth"),
- 13: _("Thirteenth"),
- 14: _("Fourteenth"),
- 15: _("Fifteenth"),
- 16: _("Sixteenth"),
- 17: _("Seventeenth"),
- 18: _("Eightteenth"),
- 19: _("Nineteenth"),
- 20: _("Twentieth"),
- 21: _("Twenty-first"),
- 22: _("Twenty-second"),
- 23: _("Twenty-third"),
- 24: _("Twenty-fourth"),
- 25: _("Twenty-fifth"),
- 26: _("Twenty-sixth"),
- 27: _("Twenty-seventh"),
- 28: _("Twenty-eighth"),
- 29: _("Twenty-ninth")
- }
-
+class DetAncestorReport(Report):
+
#--------------------------------------------------------------------
#
#
@@ -484,154 +435,104 @@ class DetAncestorReport:
self.doc.close()
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class DetAncestorReportDialog(TextReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Ahnentafel Report")
+
+ def get_header(self, name):
+ """The header line at the top of the dialog contents"""
+ return _("Detailed Ancestral Report for %s") % name
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Ancestor Report")
+
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "det_ancestor_report.xml"
+
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Detailed Ancestral Report"""
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=16,bold=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(1)
+ para.set(pad=0.5)
+ self.default_style.add_style("Title",para)
+
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=14,italic=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(2)
+ para.set(pad=0.5)
+ self.default_style.add_style("Generation",para)
+
+ font = FontStyle()
+ font.set(face=FONT_SANS_SERIF,size=12,italic=1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ para.set_header_level(3)
+ para.set_left_margin(1.0) # in centimeters
+ para.set(pad=0.5)
+ self.default_style.add_style("ChildTitle",para)
+
+ para = ParagraphStyle()
+ para.set(first_indent=1.0,lmargin=0.0,pad=0.25)
+ self.default_style.add_style("ChildList",para)
+
+ para = ParagraphStyle()
+ para.set(first_indent=-1.0,lmargin=1.0,pad=0.25)
+ self.default_style.add_style("Entry",para)
+
+ table = TableStyle()
+ table.set_width(1000)
+ table.set_columns(3)
+ table.set_column_width(1,"30%")
+ #self.default_style.add_style("Images",table)
+
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Detailed Ancestral
+ Report. All user dialog has already been handled and the
+ output file opened."""
+ MyReport = DetAncestorReport(self.db, self.person, self.target_path,
+ self.max_gen, self.pg_brk, self.doc)
+ MyReport.write_report()
+
+
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
- import PaperMenu
-
- global active_person
- global topDialog
- global glade_file
- global db
- global style_sheet_list
-
- active_person = person
- db = database
-
- base = os.path.dirname(__file__)
- glade_file = base + os.sep + "ancestorreport.glade"
- topDialog = libglade.GladeXML(glade_file,"dialog1")
-
- name = person.getPrimaryName().getRegularName()
-
- PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
- PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
- FindDoc.get_text_doc_menu(topDialog.get_widget("format"),0,option_switch)
-
- styles.clear()
- font = FontStyle()
- font.set(face=FONT_SANS_SERIF,size=16,bold=1)
- para = ParagraphStyle()
- para.set_font(font)
- para.set_header_level(1)
- para.set(pad=0.5)
- styles.add_style("Title",para)
-
- font = FontStyle()
- font.set(face=FONT_SANS_SERIF,size=14,italic=1)
- para = ParagraphStyle()
- para.set_font(font)
- para.set_header_level(2)
- para.set(pad=0.5)
- styles.add_style("Generation",para)
-
- font = FontStyle()
- font.set(face=FONT_SANS_SERIF,size=12,italic=1)
- para = ParagraphStyle()
- para.set_font(font)
- para.set_header_level(3)
- para.set_left_margin(1.0) # in centimeters
- para.set(pad=0.5)
- styles.add_style("ChildTitle",para)
-
- para = ParagraphStyle()
- para.set(first_indent=1.0,lmargin=0.0,pad=0.25)
- styles.add_style("ChildList",para)
-
- para = ParagraphStyle()
- para.set(first_indent=-1.0,lmargin=1.0,pad=0.25)
- styles.add_style("Entry",para)
-
- table = TableStyle()
- table.set_width(1000)
- table.set_columns(3)
- table.set_column_width(1,"30%")
- #add_table_style("Images",table)
-
- style_sheet_list = StyleSheetList("det_ancestor_report.xml",styles)
- build_menu(None)
-
- topDialog.get_widget("labelTitle").set_text(_("Detailed Ancestral Report for %s") % name)
- topDialog.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked" : on_save_clicked
- })
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = gtk.GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- val = obj.get_data("paper")
- st = obj.get_data("styles")
- notebook = topDialog.get_widget("option_notebook")
- if val == 1:
- notebook.set_page(0)
- else:
- notebook.set_page(1)
- topDialog.get_widget("style_frame").set_sensitive(st)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_save_clicked(obj):
- global active_person
- global db
-
- outputName = topDialog.get_widget("fileentry1").get_full_path(0)
- if not outputName:
- return
-
- max_gen = topDialog.get_widget("generations").get_value_as_int()
- pgbrk = topDialog.get_widget("pagebreak").get_active()
- template = topDialog.get_widget("htmltemplate").get_full_path(0)
- paper_obj = topDialog.get_widget("papersize").get_menu().get_active()
- paper = paper_obj.get_data("i")
- orien_obj = topDialog.get_widget("orientation").get_menu().get_active()
- orien = orien_obj.get_data("i")
-
- item = topDialog.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
-
- styles = topDialog.get_widget("style_menu").get_menu().get_active().get_data("d")
-
- doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
-
- MyReport = DetAncestorReport(db,active_person,outputName,max_gen,pgbrk,doc)
- MyReport.write_report()
-
- utils.destroy_passed_object(obj)
+ DetAncestorReportDialog(database,person)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/FamilyGroup.py b/gramps/src/plugins/FamilyGroup.py
index 58d783de3..b619fe3a2 100644
--- a/gramps/src/plugins/FamilyGroup.py
+++ b/gramps/src/plugins/FamilyGroup.py
@@ -21,32 +21,15 @@
"Generate files/Family Group Report"
import RelLib
-import const
import os
-import string
-import FindDoc
-import utils
import intl
-import Config
_ = intl.gettext
-from TextDoc import *
-from StyleEditor import *
+from Report import *
import gtk
import libglade
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-active_person = None
-db = None
-styles = StyleSheet()
-style_sheet_list = None
-topDialog = None
-
#------------------------------------------------------------------------
#
#
@@ -336,177 +319,132 @@ class FamilyGroup:
self.doc.end_table()
self.end()
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class FamilyGroupDialog(TextReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Family Group Report")
+
+ def get_header(self, name):
+ """The header line at the top of the dialog contents"""
+ return _("Family Group Report for %s") % name
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Family Group Report")
+
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "family_group.xml"
+
+ def doc_uses_tables(self):
+ """This report requires table support."""
+ return 1
+
+ def get_report_generations(self):
+ """No generation options."""
+ return (0, 0)
+
+ def get_report_extra_menu_map(self):
+ """Create a mapping of all spouse names:families to be put
+ into the 'extra' option menu in the report options box. If
+ the selected person has never been married then this routine
+ will return a placebo label and disable the OK button."""
+ mapping = {}
+ family_list = self.person.getFamilyList()
+ if not family_list:
+ mapping[_("No known marriages")] = None
+ self.topDialog.get_widget("OK").set_sensitive(0)
+ for family in family_list:
+ if self.person == family.getFather():
+ spouse = family.getMother()
+ else:
+ spouse = family.getFather()
+ if spouse:
+ name = spouse.getPrimaryName().getName()
+ else:
+ name= _("unknown")
+ mapping[name] = family
+ return (_("Spouse"), mapping, None)
+
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make default output style for the Family Group Report."""
+ para = ParagraphStyle()
+ font = FontStyle()
+ font.set_size(4)
+ para.set_font(font)
+ self.default_style.add_style('blank',para)
+
+ font = FontStyle()
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(16)
+ font.set_bold(1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ self.default_style.add_style('Title',para)
+
+ font = FontStyle()
+ font.set_type_face(FONT_SERIF)
+ font.set_size(10)
+ font.set_bold(0)
+ para = ParagraphStyle()
+ para.set_font(font)
+ self.default_style.add_style('Normal',para)
+
+ font = FontStyle()
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(10)
+ font.set_bold(1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ self.default_style.add_style('ChildText',para)
+
+ font = FontStyle()
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(12)
+ font.set_bold(1)
+ para = ParagraphStyle()
+ para.set_font(font)
+ self.default_style.add_style('ParentName',para)
+
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Ancestor Chart.
+ All user dialog has already been handled and the output file
+ opened."""
+ MyReport = FamilyGroup(self.db, self.report_menu, self.target_path, self.doc)
+ MyReport.setup()
+ MyReport.write_report()
+
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
- import PaperMenu
-
- global active_person
- global topDialog
- global db
- global style_sheet_list
-
- active_person = person
- db = database
-
- glade_file = "%s/familygroup.glade" % os.path.dirname(__file__)
- topDialog = libglade.GladeXML(glade_file,"dialog1")
- topDialog.get_widget("fileentry1").set_default_path(Config.report_dir)
-
- name = person.getPrimaryName().getRegularName()
- family_list = person.getFamilyList()
- label = topDialog.get_widget("labelTitle")
-
- label.set_text(_("Family Group Report for %s") % name)
- topDialog.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked" : on_save_clicked
- })
-
- PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
- PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
- FindDoc.get_text_doc_menu(topDialog.get_widget("format"),1,option_switch)
- styles.clear()
-
- para = ParagraphStyle()
- font = FontStyle()
- font.set_size(4)
- para.set_font(font)
- styles.add_style('blank',para)
-
- font = FontStyle()
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(16)
- font.set_bold(1)
- para = ParagraphStyle()
- para.set_font(font)
- styles.add_style('Title',para)
-
- font = FontStyle()
- font.set_type_face(FONT_SERIF)
- font.set_size(10)
- font.set_bold(0)
- para = ParagraphStyle()
- para.set_font(font)
- styles.add_style('Normal',para)
-
- font = FontStyle()
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(10)
- font.set_bold(1)
- para = ParagraphStyle()
- para.set_font(font)
- styles.add_style('ChildText',para)
-
- font = FontStyle()
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(12)
- font.set_bold(1)
- para = ParagraphStyle()
- para.set_font(font)
- styles.add_style('ParentName',para)
- style_sheet_list = StyleSheetList("family_group.xml",styles)
- build_menu(None)
-
- frame = topDialog.get_widget("spouse")
- option_menu = topDialog.get_widget("spouse_menu")
-
- if len(family_list) > 1:
- frame.show()
- else:
- frame.hide()
-
- my_menu = gtk.GtkMenu()
- for family in family_list:
- if person == family.getFather():
- spouse = family.getMother()
- else:
- spouse = family.getFather()
- if spouse:
- item = gtk.GtkMenuItem(spouse.getPrimaryName().getName())
- else:
- item = gtk.GtkMenuItem("unknown")
- item.set_data("f",family)
- item.show()
- my_menu.append(item)
- option_menu.set_menu(my_menu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = gtk.GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- val = obj.get_data("paper")
- st = obj.get_data("styles")
- notebook = topDialog.get_widget("option_notebook")
-
- if val == 1:
- notebook.set_page(0)
- else:
- notebook.set_page(1)
- topDialog.get_widget("style_frame").set_sensitive(st)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_save_clicked(obj):
- global active_person
- global db
-
- outputName = topDialog.get_widget("fileentry1").get_full_path(0)
- if not outputName:
- return
-
- menu = topDialog.get_widget("spouse_menu").get_menu()
- family = menu.get_active().get_data("f")
- paper_obj = topDialog.get_widget("papersize")
- paper = paper_obj.get_menu().get_active().get_data("i")
- orien_obj = topDialog.get_widget("orientation")
- orien = orien_obj.get_menu().get_active().get_data("i")
- template = topDialog.get_widget("htmlfile").get_text()
-
- item = topDialog.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
-
- doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
-
- MyReport = FamilyGroup(db,family,outputName,doc)
-
- MyReport.setup()
- MyReport.write_report()
-
- utils.destroy_passed_object(obj)
+ FamilyGroupDialog(database,person)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/GraphViz.py b/gramps/src/plugins/GraphViz.py
index d98fa7830..69a6b2384 100644
--- a/gramps/src/plugins/GraphViz.py
+++ b/gramps/src/plugins/GraphViz.py
@@ -21,17 +21,13 @@
"Generate files/Relationship graph"
import os
-import utils
import intl
_ = intl.gettext
import libglade
+from Report import *
-active_person = None
-db = None
-topDialog = None
-glade_file = None
ind_list = []
#------------------------------------------------------------------------
@@ -39,49 +35,54 @@ ind_list = []
#
#
#------------------------------------------------------------------------
-def ancestor_filter(database,person,list):
+def ancestor_filter(database,person,list,generations):
if person == None:
return
if person not in list:
list.append(person)
+ if generations <= 1:
+ return
+
family = person.getMainFamily()
if family != None:
- ancestor_filter(database,family.getFather(),list)
- ancestor_filter(database,family.getMother(),list)
+ ancestor_filter(database,family.getFather(),list,generations-1)
+ ancestor_filter(database,family.getMother(),list,generations-1)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def descendant_filter(database,person,list):
+def descendant_filter(database,person,list,generations):
if person == None:
return
if person not in list:
list.append(person)
-
+ if generations <= 1:
+ return
+
for family in person.getFamilyList():
for child in family.getChildList():
- descendant_filter(database,child,list)
+ descendant_filter(database,child,list,generations-1)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def an_des_filter(database,person,list):
+def an_des_filter(database,person,list,generations):
- descendant_filter(database,person,list)
- ancestor_filter(database,person,list)
+ descendant_filter(database,person,list,generations)
+ ancestor_filter(database,person,list,generations)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def entire_db_filter(database,person,list):
+def entire_db_filter(database,person,list,generations):
for entry in database.getPersonMap().values():
list.append(entry)
@@ -99,100 +100,136 @@ filter_map = {
_("Entire Database") : entire_db_filter
}
+_scaled = 0
+_single = 1
+_multiple = 2
+
+pagecount_map = {
+ _("Single (scaled)") : _scaled,
+ _("Single") : _single,
+ _("Multiple") : _multiple,
+ }
+
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class GraphVizDialog(ReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Generate Relationship Graphs")
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Graphviz File")
+
+ def get_print_pagecount_map(self):
+ """Set up the list of possible page counts."""
+ return (pagecount_map, _("Single (scaled)"))
+
+ def get_report_generations(self):
+ """Default to 10 generations, no page breaks."""
+ return (10, 0)
+
+ def get_report_filter_strings(self):
+ """Set up the list of possible content filters."""
+ return filter_map.keys()
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to selecting/changing the current file format
+ #
+ #------------------------------------------------------------------------
+ def make_doc_menu(self):
+ """Build a one item menu of document types that are
+ appropriate for this report."""
+ map = {"Graphviz (dot)" : None}
+ myMenu = utils.build_string_optmenu(map, None)
+ self.format_menu.set_menu(myMenu)
+
+ def make_document(self):
+ """Do Nothing. This document will be created in the
+ make_report routine."""
+ pass
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to setting up the dialog window
+ #
+ #------------------------------------------------------------------------
+ def setup_style_frame(self):
+ """The style frame is not used in this dialog."""
+ self.topDialog.get_widget("style_frame").hide()
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to retrieving data from the dialog window
+ #
+ #------------------------------------------------------------------------
+ def parse_style_frame(self):
+ """The style frame is not used in this dialog."""
+ pass
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to creating the actual report document.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the GraphViz file."""
+ width = self.paper.get_width_inches()
+ height = self.paper.get_height_inches()
+
+ file = open(self.target_path,"w")
+
+ filter = filter_map[self.filter]
+ ind_list = []
+
+ filter(self.db,self.person,ind_list,self.max_gen)
+
+ file.write("digraph g {\n")
+ file.write("bgcolor=white;\n")
+ file.write("rankdir=LR;\n")
+ file.write("center=1;\n")
+
+ if self.pagecount == _scaled:
+ file.write("size=\"%3.1fin,%3.1fin\";\n" % (width-0.5,height-0.5))
+ file.write("ratio=compress;\n")
+ else:
+ file.write("ratio=auto;\n")
+
+ if self.pagecount == _multiple:
+ file.write("page=\"%3.1f,%3.1f\";\n" % (width,height))
+
+ if self.orien == PAPER_PORTRAIT:
+ file.write("orientation=portrait;\n")
+ else:
+ file.write("orientation=landscape;\n")
+
+ if len(ind_list) > 1:
+ dump_index(ind_list,file)
+ dump_person(ind_list,file)
+
+ file.write("}\n")
+ file.close()
+
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
- global active_person
- global topDialog
- global glade_file
- global db
-
- active_person = person
- db = database
-
- base = os.path.dirname(__file__)
- glade_file = base + os.sep + "graphviz.glade"
- dic = {
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_ok_clicked" : on_ok_clicked,
- }
-
- topDialog = libglade.GladeXML(glade_file,"top")
- topDialog.signal_autoconnect(dic)
-
- top = topDialog.get_widget("top")
- topDialog.get_widget("targetDirectory").set_default_path(os.getcwd())
- filterName = topDialog.get_widget("filterName")
- popdown_strings = filter_map.keys()
- popdown_strings.sort()
- filterName.set_popdown_strings(popdown_strings)
-
- name = person.getPrimaryName().getName()
- topDialog.get_widget("personName").set_text(name)
-
- top.show()
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_ok_clicked(obj):
- global active_person
- global filter_map
- global db
- global glade_file
- global ind_list
-
- filterName = topDialog.get_widget("filter").get_text()
- file_name = topDialog.get_widget("filename").get_text()
- if file_name == "":
- return
-
- paper = topDialog.get_widget("paper")
- multi = topDialog.get_widget("multi").get_active()
- scaled = topDialog.get_widget("scaled").get_active()
- portrait = topDialog.get_widget("portrait").get_active()
-
- width = paper.get_width()/72.0
- height = paper.get_height()/72.0
-
- file = open(file_name,"w")
-
- filter = filter_map[filterName]
- ind_list = []
-
- filter(db,active_person,ind_list)
-
- file.write("digraph g {\n")
- file.write("bgcolor=white;\n")
- file.write("rankdir=LR;\n")
- file.write("center=1;\n")
-
- if scaled == 1:
- file.write("size=\"%3.1fin,%3.1fin\";\n" % (width-0.5,height-0.5))
- file.write("ratio=compress;\n")
- else:
- file.write("ratio=auto;\n")
-
- if multi == 1:
- file.write("page=\"%3.1f,%3.1f\";\n" % (width,height))
-
- if portrait == 1:
- file.write("orientation=portrait;\n")
- else:
- file.write("orientation=landscape;\n")
-
- if len(ind_list) > 1:
- dump_index(ind_list,file)
- dump_person(ind_list,file)
-
- file.write("}\n")
- file.close()
- utils.destroy_passed_object(obj)
+ GraphVizDialog(database,person)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/IndivSummary.py b/gramps/src/plugins/IndivSummary.py
index 5657e780f..64afacefa 100644
--- a/gramps/src/plugins/IndivSummary.py
+++ b/gramps/src/plugins/IndivSummary.py
@@ -32,21 +32,11 @@ _ = intl.gettext
from TextDoc import *
from StyleEditor import *
-import FindDoc
+from Report import *
import gtk
import libglade
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-active_person = None
-db = None
-styles = StyleSheet()
-style_sheet_list = None
-
#------------------------------------------------------------------------
#
#
@@ -326,145 +316,105 @@ class IndivSummary:
#
#
#------------------------------------------------------------------------
-def report(database,person):
- import PaperMenu
+class IndivSummaryDialog(TextReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person)
- global active_person
- global topDialog
- global db
- global style_sheet_list
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Individual Summary")
- if person == None:
- return
+ def get_header(self, name):
+ """The header line at the top of the dialog contents"""
+ return _("Individual Summary for %s") % name
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Save Individual Summary")
- active_person = person
- db = database
-
- glade_file = "%s/indsum.glade" % os.path.dirname(__file__)
- topDialog = libglade.GladeXML(glade_file,"dialog1")
- topDialog.get_widget("fileentry1").set_default_path(Config.report_dir)
-
- name = person.getPrimaryName().getRegularName()
- label = topDialog.get_widget("labelTitle")
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "family_group.xml"
- label.set_text(_("Individual Summary for %s") % name)
+ def doc_uses_tables(self):
+ """This report requires table support."""
+ return 1
- PaperMenu.make_paper_menu(topDialog.get_widget("papersize"))
- PaperMenu.make_orientation_menu(topDialog.get_widget("orientation"))
- FindDoc.get_text_doc_menu(topDialog.get_widget("format"),1,option_switch)
-
- font = FontStyle()
- font.set_bold(1)
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(16)
- p = ParagraphStyle()
- p.set_alignment(PARA_ALIGN_CENTER)
- p.set_font(font)
- styles.add_style("Title",p)
-
- font = FontStyle()
- font.set_bold(1)
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(12)
- font.set_italic(1)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("TableTitle",p)
-
- font = FontStyle()
- font.set_bold(1)
- font.set_type_face(FONT_SANS_SERIF)
- font.set_size(12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("Spouse",p)
-
- font = FontStyle()
- font.set_size(12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("Normal",p)
-
- style_sheet_list = StyleSheetList("individual_summary.xml",styles)
- build_menu(None)
-
- topDialog.signal_autoconnect({
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_save_clicked" : on_save_clicked
- })
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = gtk.GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = gtk.GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def option_switch(obj):
- val = obj.get_data("paper")
- st = obj.get_data("styles")
- notebook = topDialog.get_widget("option_notebook")
- if val == 1:
- notebook.set_page(0)
- else:
- notebook.set_page(1)
- topDialog.get_widget("style_frame").set_sensitive(st)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_save_clicked(obj):
- global active_person
- global db
-
- outputName = topDialog.get_widget("fileentry1").get_full_path(0)
- if not outputName:
- return
-
- paper_obj = topDialog.get_widget("papersize")
- paper = paper_obj.get_menu().get_active().get_data("i")
- orien_obj = topDialog.get_widget("orientation")
- orien = orien_obj.get_menu().get_active().get_data("i")
- template = topDialog.get_widget("htmltemplate").get_full_path(0)
-
- item = topDialog.get_widget("format").get_menu().get_active()
- format = item.get_data("name")
-
- styles = topDialog.get_widget("style_menu").get_menu().get_active().get_data("d")
-
- doc = FindDoc.make_text_doc(styles,format,paper,orien,template)
-
- MyReport = IndivSummary(db,active_person,outputName,doc)
-
- MyReport.setup()
- MyReport.write_report()
+ #------------------------------------------------------------------------
+ #
+ # Create output styles appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Individual Summary Report."""
+ font = FontStyle()
+ font.set_bold(1)
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(16)
+ p = ParagraphStyle()
+ p.set_alignment(PARA_ALIGN_CENTER)
+ p.set_font(font)
+ self.default_style.add_style("Title",p)
- utils.destroy_passed_object(obj)
+ font = FontStyle()
+ font.set_bold(1)
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(12)
+ font.set_italic(1)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("TableTitle",p)
+
+ font = FontStyle()
+ font.set_bold(1)
+ font.set_type_face(FONT_SANS_SERIF)
+ font.set_size(12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("Spouse",p)
+
+ font = FontStyle()
+ font.set_size(12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("Normal",p)
+
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to setting up the dialog window
+ #
+ #------------------------------------------------------------------------
+ def setup_report_options(self):
+ """The 'Report Options' frame is not used in this dialog."""
+ self.topDialog.get_widget("options_frame").hide()
+
+ #------------------------------------------------------------------------
+ #
+ # Create the contents of the report.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the Ancestor Chart.
+ All user dialog has already been handled and the output file
+ opened."""
+ MyReport = IndivSummary(self.db, self.person, self.target_path, self.doc)
+ MyReport.setup()
+ MyReport.write_report()
+
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+def report(database,person):
+ IndivSummaryDialog(database,person)
#------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/WebPage.py b/gramps/src/plugins/WebPage.py
index 603cd8915..a2cf649b6 100644
--- a/gramps/src/plugins/WebPage.py
+++ b/gramps/src/plugins/WebPage.py
@@ -21,7 +21,6 @@
"Web Site/Generate Web Site"
from RelLib import *
-from TextDoc import *
from HtmlDoc import *
import const
@@ -40,20 +39,7 @@ import shutil
from gtk import *
from gnome.ui import *
from libglade import *
-from StyleEditor import *
-
-active_person = None
-db = None
-topDialog = None
-
-glade_file = os.path.dirname(__file__) + os.sep + "webpage.glade"
-
-restrict = 1
-private = 1
-restrict_photos = 0
-no_photos = 0
-styles = StyleSheet()
-style_sheet_list = None
+from Report import *
#------------------------------------------------------------------------
@@ -406,30 +392,21 @@ class IndividualPage:
if place != "" and place[-1] == ".":
place = place[0:-1]
- else:
- place = ""
if descr != "" and descr[-1] == ".":
descr = descr[0:-1]
- if date == "":
- if place == "":
- if descr == "":
- val = ""
- else:
- val = "%s." % descr
+ if date != "":
+ if place != "":
+ val = "%s, %s." % (date,place)
else:
- if descr == "":
- val = ""
- else:
- val = "%s. %s." % (place,descr)
+ val = "%s." % date
+ elif place != "":
+ val = "%s." % place
else:
- if place == "":
- if descr == "":
- val = "%s." % date
- else:
- val = "%s. %s." % (date,descr)
- else:
- val = "%s, %s. %s." % (date,place,descr)
+ val = ""
+
+ if descr != "":
+ val = val + ("%s." % descr)
self.write_normal_row(name, val, srcref)
@@ -463,7 +440,7 @@ class IndividualPage:
if event == None:
return
- name = event.getName()
+ name = _(event.getName())
date = event.getDate()
place = event.getPlaceName()
descr = event.getDescription()
@@ -576,7 +553,7 @@ class IndividualPage:
#
#
#------------------------------------------------------------------------
-def individual_filter(database,person,list):
+def individual_filter(database,person,list,generations):
list.append(person)
#------------------------------------------------------------------------
@@ -584,48 +561,54 @@ def individual_filter(database,person,list):
#
#
#------------------------------------------------------------------------
-def ancestor_filter(database,person,list):
+def ancestor_filter(database,person,list,generations):
if person == None:
return
if person not in list:
list.append(person)
+ if generations <= 1:
+ return
+
family = person.getMainFamily()
if family != None:
- ancestor_filter(database,family.getFather(),list)
- ancestor_filter(database,family.getMother(),list)
+ ancestor_filter(database,family.getFather(),list,generations-1)
+ ancestor_filter(database,family.getMother(),list,generations-1)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def descendant_filter(database,person,list):
+def descendant_filter(database,person,list,generations):
if person == None or person in list:
return
if person not in list:
list.append(person)
+ if generations <= 1:
+ return
+
for family in person.getFamilyList():
for child in family.getChildList():
- descendant_filter(database,child,list)
+ descendant_filter(database,child,list,generations-1)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def an_des_filter(database,person,list):
+def an_des_filter(database,person,list,generations):
- descendant_filter(database,person,list)
- ancestor_filter(database,person,list)
+ descendant_filter(database,person,list,generations)
+ ancestor_filter(database,person,list,generations)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
-def entire_db_filter(database,person,list):
+def entire_db_filter(database,person,list,generations):
for entry in database.getPersonMap().values():
list.append(entry)
@@ -635,7 +618,7 @@ def entire_db_filter(database,person,list):
#
#
#------------------------------------------------------------------------
-def an_des_of_gparents_filter(database,person,list):
+def an_des_of_gparents_filter(database,person,list,generations):
my_list = []
@@ -653,8 +636,8 @@ def an_des_of_gparents_filter(database,person,list):
my_list.append(pf.getMother())
for person in my_list:
- descendant_filter(database,person,list)
- ancestor_filter(database,person,list)
+ descendant_filter(database,person,list,generations)
+ ancestor_filter(database,person,list,generations)
#------------------------------------------------------------------------
#
@@ -676,275 +659,359 @@ filter_map = {
#
#
#------------------------------------------------------------------------
-def report(database,person):
- global active_person
- global topDialog
- global db
- global styles
- global style_sheet_list
+class WebReport(Report):
+ def __init__(self,db,person,target_path,max_gen,photos,filter,restrict,
+ private, srccomments, include_link, style, template_name):
+ self.db = db
+ self.person = person
+ self.target_path = target_path
+ self.max_gen = max_gen
+ self.photos = photos
+ self.filter = filter
+ self.restrict = restrict
+ self.private = private
+ self.srccomments = srccomments
+ self.include_link = include_link
+ self.selected_style = style
+ self.template_name = template_name
+
+ def get_progressbar_data(self):
+ return (_("Gramps - Generate HTML reports"), _("Creating Web Pages"))
- active_person = person
- db = database
-
- font = FontStyle()
- font.set(bold=1, face=FONT_SANS_SERIF, size=16)
- p = ParagraphStyle()
- p.set(align=PARA_ALIGN_CENTER,font=font)
- styles.add_style("Title",p)
+ #------------------------------------------------------------------------
+ #
+ # Writes a index file, listing all people in the person list.
+ #
+ #------------------------------------------------------------------------
+ def dump_index(self,person_list,styles,template,html_dir):
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
- p = ParagraphStyle()
- p.set(font=font,bborder=1)
- styles.add_style("EventsTitle",p)
-
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
- p = ParagraphStyle()
- p.set(font=font,bborder=1)
- styles.add_style("NotesTitle",p)
-
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
- p = ParagraphStyle()
- p.set(font=font,bborder=1)
- styles.add_style("SourcesTitle",p)
-
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
- p = ParagraphStyle()
- p.set(font=font,bborder=1)
- styles.add_style("GalleryTitle",p)
-
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
- p = ParagraphStyle()
- p.set(font=font,bborder=1)
- styles.add_style("FamilyTitle",p)
+ doc = HtmlLinkDoc(styles,template)
+ doc.set_title(_("Family Tree Index"))
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("Spouse",p)
-
- font = FontStyle()
- font.set(size=12,italic=1)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("Label",p)
-
- font = FontStyle()
- font.set_size(12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("Data",p)
-
- font = FontStyle()
- font.set(bold=1,face=FONT_SANS_SERIF,size=12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("PhotoDescription",p)
-
- font = FontStyle()
- font.set(size=12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("PhotoNote",p)
-
- font = FontStyle()
- font.set_size(10)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("SourceParagraph",p)
-
- font = FontStyle()
- font.set_size(12)
- p = ParagraphStyle()
- p.set_font(font)
- styles.add_style("NotesParagraph",p)
-
- style_sheet_list = StyleSheetList("webpage.xml",styles)
-
- dic = {
- "destroy_passed_object" : utils.destroy_passed_object,
- "on_nophotos_toggled" : on_nophotos_toggled,
- "on_style_edit_clicked" : on_style_edit_clicked,
- "on_ok_clicked" : on_ok_clicked,
- }
-
- topDialog = GladeXML(glade_file,"top")
- topDialog.signal_autoconnect(dic)
- build_menu(None)
+ doc.open(html_dir + os.sep + "index.html")
+ doc.start_paragraph("Title")
+ doc.write_text(_("Family Tree Index"))
+ doc.end_paragraph()
- top = topDialog.get_widget("top")
- topDialog.get_widget("targetDirectory").set_default_path(Config.web_dir)
- topDialog.get_widget("tgtdir").set_text(Config.web_dir)
- filterName = topDialog.get_widget("filterName")
-
- popdown_strings = filter_map.keys()
- popdown_strings.sort()
- filterName.set_popdown_strings(popdown_strings)
-
- name = person.getPrimaryName().getName()
- topDialog.get_widget("personName").set_text(name)
-
- top.show()
+ person_list.sort(sort.by_last_name)
+ for person in person_list:
+ name = person.getPrimaryName().getName()
+ doc.start_link("%s.html" % person.getId())
+ doc.write_text(name)
+ doc.end_link()
+ doc.newline()
+ doc.close()
+
+ def write_report(self):
+ dir_name = self.target_path
+ if dir_name == None:
+ dir_name = os.getcwd()
+ elif not os.path.isdir(dir_name):
+ parent_dir = os.path.dirname(dir_name)
+ if not os.path.isdir(parent_dir):
+ GnomeErrorDialog(_("Neither %s nor %s are directories") % \
+ (dir_name,parent_dir))
+ return
+ else:
+ try:
+ os.mkdir(dir_name)
+ except IOError, value:
+ GnomeErrorDialog(_("Could not create the directory : %s") % \
+ dir_name + "\n" + value[1])
+ return
+ except:
+ GnomeErrorDialog(_("Could not create the directory : %s") % \
+ dir_name)
+ return
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_style_edit_clicked(obj):
- StyleListDisplay(style_sheet_list,build_menu,None)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def build_menu(object):
- menu = topDialog.get_widget("style_menu")
-
- myMenu = GtkMenu()
- for style in style_sheet_list.get_style_names():
- menuitem = GtkMenuItem(style)
- menuitem.set_data("d",style_sheet_list.get_style_sheet(style))
- menuitem.show()
- myMenu.append(menuitem)
- menu.set_menu(myMenu)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_nophotos_toggled(obj):
- if obj.get_active():
- topDialog.get_widget("restrict_photos").set_sensitive(0)
- else:
- topDialog.get_widget("restrict_photos").set_sensitive(1)
-
-#------------------------------------------------------------------------
-#
-#
-#
-#------------------------------------------------------------------------
-def on_ok_clicked(obj):
- global active_person
- global filter_map
- global db
-
- filterName = topDialog.get_widget("filter").get_text()
- dir_name = topDialog.get_widget("targetDirectory").get_full_path(0)
- templ_name = topDialog.get_widget("htmlTemplate").get_full_path(0)
-
- restrict = topDialog.get_widget("restrict").get_active()
- private = topDialog.get_widget("private").get_active()
- srccomments = topDialog.get_widget("srccomments").get_active()
- restrict_photos = topDialog.get_widget("restrict_photos").get_active()
- no_photos = topDialog.get_widget("nophotos").get_active()
- include_link = topDialog.get_widget("include_link").get_active()
-
- if dir_name == None:
- dir_name = os.getcwd()
- elif not os.path.isdir(dir_name):
- parent_dir = os.path.dirname(dir_name)
- if not os.path.isdir(parent_dir):
- GnomeErrorDialog(_("Neither %s nor %s are directories") % \
- (dir_name,parent_dir))
- return
- else:
+ image_dir_name = os.path.join(dir_name, "images")
+ if not os.path.isdir(image_dir_name) and self.photos != 0:
try:
- os.mkdir(dir_name)
+ os.mkdir(image_dir_name)
except IOError, value:
GnomeErrorDialog(_("Could not create the directory : %s") % \
- dir_name + "\n" + value[1])
+ image_dir_name + "\n" + value[1])
return
except:
GnomeErrorDialog(_("Could not create the directory : %s") % \
- dir_name)
+ image_dir_name)
return
-
- image_dir_name = os.path.join(dir_name, "images")
- if not os.path.isdir(image_dir_name) and not no_photos:
- try:
- os.mkdir(image_dir_name)
- except IOError, value:
- GnomeErrorDialog(_("Could not create the directory : %s") % \
- image_dir_name + "\n" + value[1])
- return
- except:
- GnomeErrorDialog(_("Could not create the directory : %s") % \
- image_dir_name)
- return
-
- filter = filter_map[filterName]
- ind_list = []
-
- filter(db,active_person,ind_list)
- styles = topDialog.get_widget("style_menu").get_menu().get_active().get_data("d")
-
- if no_photos == 1:
- photos = 0
- elif restrict_photos == 1:
- photos = 1
- else:
- photos = 2
-
- total = float(len(ind_list))
- index = 0.0
-
- pxml = GladeXML(glade_file,"progress")
- ptop = pxml.get_widget("progress")
- pbar = pxml.get_widget("progressbar")
- pbar.configure(0.0,0.0,total)
- doc = HtmlLinkDoc(styles,templ_name)
- my_map = {}
- for l in ind_list:
- my_map[l] = 1
- for person in ind_list:
- tdoc = HtmlLinkDoc(styles,None,doc)
- idoc = IndividualPage(person,photos,restrict,private,srccomments,\
- include_link,my_map,dir_name,tdoc)
- idoc.create_page()
- idoc.close()
- index = index + 1.0
- pbar.set_value(index)
- while events_pending():
- mainiteration()
+ filter = filter_map[self.filter]
+ ind_list = []
+ filter(self.db,self.person,ind_list,self.max_gen)
+ self.progress_bar_setup(float(len(ind_list)))
- if len(ind_list) > 1:
- dump_index(ind_list,styles,templ_name,dir_name)
+ doc = HtmlLinkDoc(self.selected_style,self.template_name)
+ my_map = {}
+ for l in ind_list:
+ my_map[l] = 1
+ for person in ind_list:
+ tdoc = HtmlLinkDoc(self.selected_style,None,doc)
+ idoc = IndividualPage(person, self.photos, self.restrict,
+ self.private, self.srccomments,
+ self.include_link, my_map, dir_name, tdoc)
+ idoc.create_page()
+ idoc.close()
+ self.progress_bar_step()
+ while events_pending():
+ mainiteration()
+
+ if len(ind_list) > 1:
+ self.dump_index(ind_list,self.selected_style,self.template_name,dir_name)
+
+ self.progress_bar_done()
- utils.destroy_passed_object(ptop)
- utils.destroy_passed_object(obj)
+#------------------------------------------------------------------------
+#
+#
+#
+#------------------------------------------------------------------------
+class WebReportDialog(ReportDialog):
+ def __init__(self,database,person):
+ ReportDialog.__init__(self,database,person,"webpage.glade")
+
+ #------------------------------------------------------------------------
+ #
+ # Customization hooks
+ #
+ #------------------------------------------------------------------------
+ def get_title(self):
+ """The window title for this dialog"""
+ return _("Gramps - Generate HTML reports")
+
+ def get_target_browser_title(self):
+ """The title of the window created when the 'browse' button is
+ clicked in the 'Save As' frame."""
+ return _("Target Directory")
+
+ def get_target_is_directory(self):
+ """This report creates a directory full of files, not a single file."""
+ return 1
+
+ def get_stylesheet_savefile(self):
+ """Where to save styles for this report."""
+ return "webpage.xml"
+
+ def get_report_generations(self):
+ """Default to ten generations, no page break box."""
+ return (10, 0)
+
+ def get_report_filter_strings(self):
+ """Set up the list of possible content filters."""
+ return filter_map.keys()
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to the default directory
+ #
+ #------------------------------------------------------------------------
+ def get_default_directory(self):
+ """Get the name of the directory to which the target dialog
+ box should default. This value can be set in the preferences
+ panel."""
+ return Config.web_dir
+
+ def set_default_directory(self, value):
+ """Save the name of the current directory, so that any future
+ reports will default to the most recently used directory.
+ This also changes the directory name that will appear in the
+ preferences panel, but does not change the preference in disk.
+ This means that the last directory used will only be
+ remembered for this session of gramps unless the user saves
+ his/her preferences."""
+ Config.web_dir = value
+
+ #------------------------------------------------------------------------
+ #
+ # Create output style appropriate to this report.
+ #
+ #------------------------------------------------------------------------
+ def make_default_style(self):
+ """Make the default output style for the Web Pages Report."""
+ font = FontStyle()
+ font.set(bold=1, face=FONT_SANS_SERIF, size=16)
+ p = ParagraphStyle()
+ p.set(align=PARA_ALIGN_CENTER,font=font)
+ self.default_style.add_style("Title",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
+ p = ParagraphStyle()
+ p.set(font=font,bborder=1)
+ self.default_style.add_style("EventsTitle",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
+ p = ParagraphStyle()
+ p.set(font=font,bborder=1)
+ self.default_style.add_style("NotesTitle",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
+ p = ParagraphStyle()
+ p.set(font=font,bborder=1)
+ self.default_style.add_style("SourcesTitle",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
+ p = ParagraphStyle()
+ p.set(font=font,bborder=1)
+ self.default_style.add_style("GalleryTitle",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12,italic=1)
+ p = ParagraphStyle()
+ p.set(font=font,bborder=1)
+ self.default_style.add_style("FamilyTitle",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("Spouse",p)
+
+ font = FontStyle()
+ font.set(size=12,italic=1)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("Label",p)
+
+ font = FontStyle()
+ font.set_size(12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("Data",p)
+
+ font = FontStyle()
+ font.set(bold=1,face=FONT_SANS_SERIF,size=12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("PhotoDescription",p)
+
+ font = FontStyle()
+ font.set(size=12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("PhotoNote",p)
+
+ font = FontStyle()
+ font.set_size(10)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("SourceParagraph",p)
+
+ font = FontStyle()
+ font.set_size(12)
+ p = ParagraphStyle()
+ p.set_font(font)
+ self.default_style.add_style("NotesParagraph",p)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to selecting/changing the current file format
+ #
+ #------------------------------------------------------------------------
+ def make_document(self):
+ """Do Nothing. This document will be created in the
+ make_report routine."""
+ pass
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to setting up the dialog window
+ #
+ #------------------------------------------------------------------------
+ def setup_format_frame(self):
+ """The format frame is not used in this dialog. Hide it, and
+ set the output notebook to always display the html template
+ page."""
+ self.topDialog.get_widget("format_frame").hide()
+ self.output_notebook.set_page(1)
+
+ def setup_other_frames(self):
+ """Set up the privacy frame of the dialog. This sole purpose of
+ this function is to grab a pointer for later use in a callback
+ routine."""
+ self.restrict_photos_check = self.topDialog.get_widget("restrict_photos")
+
+ def connect_signals(self):
+ """Connect the signal handlers for this dialog. This routine
+ uses the parent routine to connect the common handlers, and
+ the connects its own unique handler."""
+ ReportDialog.connect_signals(self)
+ self.topDialog.signal_autoconnect({
+ "on_nophotos_toggled" : self.on_nophotos_toggled,
+ })
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to retrieving data from the dialog window
+ #
+ #------------------------------------------------------------------------
+
+ def parse_format_frame(self):
+ """The format frame is not used in this dialog."""
+ pass
+
+ def parse_report_options_frame(self):
+ """Parse the report options frame of the dialog. Save the
+ user selected choices for later use."""
+ ReportDialog.parse_report_options_frame(self)
+ self.include_link = self.topDialog.get_widget("include_link").get_active()
+
+ def parse_other_frames(self):
+ """Parse the privacy options frame of the dialog. Save the
+ user selected choices for later use."""
+ self.restrict = self.topDialog.get_widget("restrict").get_active()
+ self.private = self.topDialog.get_widget("private").get_active()
+ self.srccomments = self.topDialog.get_widget("srccomments").get_active()
+ if (self.topDialog.get_widget("nophotos").get_active() == 1):
+ self.photos = 0
+ elif (self.restrict_photos_check.get_active() == 1):
+ self.photos = 1
+ else:
+ self.photos = 2
+
+ #------------------------------------------------------------------------
+ #
+ # Callback functions from the dialog
+ #
+ #------------------------------------------------------------------------
+ def on_nophotos_toggled(obj):
+ """Keep the 'restrict photos' checkbox in line with the 'no
+ photos' checkbox. If there are no photos included, it makes
+ no sense to worry about restricting which photos are included,
+ now does it?"""
+ if obj.get_active():
+ self.restrict_photos_check.set_sensitive(0)
+ else:
+ self.restrict_photos_check.set_sensitive(1)
+
+ #------------------------------------------------------------------------
+ #
+ # Functions related to creating the actual report document.
+ #
+ #------------------------------------------------------------------------
+ def make_report(self):
+ """Create the object that will produce the web pages."""
+ MyReport = WebReport(self.db, self.person, self.target_path,
+ self.max_gen, self.photos, self.filter,
+ self.restrict, self.private, self.srccomments,
+ self.include_link, self.selected_style,
+ self.template_name)
+ MyReport.write_report()
#------------------------------------------------------------------------
#
-# Writes a index file, listing all people in the person list.
+#
#
#------------------------------------------------------------------------
-def dump_index(person_list,styles,template,html_dir):
- doc = HtmlLinkDoc(styles,template)
- doc.set_title(_("Family Tree Index"))
-
- doc.open(html_dir + os.sep + "index.html")
- doc.start_paragraph("Title")
- doc.write_text(_("Family Tree Index"))
- doc.end_paragraph()
-
- person_list.sort(sort.by_last_name)
- for person in person_list:
- name = person.getPrimaryName().getName()
- doc.start_link("%s.html" % person.getId())
- doc.write_text(name)
- doc.end_link()
- doc.newline()
- doc.close()
+def report(database,person):
+ WebReportDialog(database,person)
+
+
#-------------------------------------------------------------------------
#
diff --git a/gramps/src/plugins/ancestorchart.glade b/gramps/src/plugins/ancestorchart.glade
deleted file mode 100644
index 8801e7769..000000000
--- a/gramps/src/plugins/ancestorchart.glade
+++ /dev/null
@@ -1,504 +0,0 @@
-
-
-
-
- ancestorreport
- ancestorreport
-
- src
-
- C
- True
- True
-
-
-
- GnomeDialog
- dialog1
- Gramps - Ancestor Chart
- GTK_WINDOW_DIALOG
- GTK_WIN_POS_NONE
- False
- False
- False
- False
- False
- False
-
-
- GtkVBox
- GnomeDialog:vbox
- dialog-vbox2
- False
- 8
-
- 4
- True
- True
-
-
-
- GtkHButtonBox
- GnomeDialog:action_area
- dialog-action_area2
- GTK_BUTTONBOX_END
- 8
- 85
- 27
- 7
- 0
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
- GtkButton
- button14
- True
- True
-
- clicked
- on_save_clicked
-
- Thu, 15 Mar 2001 23:13:39 GMT
-
- GNOME_STOCK_BUTTON_OK
-
-
-
- GtkButton
- button16
- True
- True
-
- clicked
- destroy_passed_object
-
- Thu, 15 Mar 2001 23:13:20 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
-
-
-
-
- GtkVBox
- vbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- labelTitle
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkHBox
- hbox2
- False
- 0
-
- 5
- False
- False
-
-
-
- GtkLabel
- label12
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GnomeFileEntry
- fileentry1
- 350
- ancestor_chart
- 10
- Save Ancestor Chart
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
-
- GtkFrame
- frame1
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 10
- True
- True
-
-
-
- GtkOptionMenu
- format
- 5
- True
- OpenOffice
-
- 0
-
-
-
-
- GtkFrame
- style_frame
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox3
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button17
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame2
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkTable
- table1
- 4
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 2
- 3
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label15
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- papersize
- True
- Letter
-
- 0
-
- 1
- 2
- 0
- 1
- 5
- 5
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- orientation
- True
- Portrait
-
- 0
-
- 1
- 2
- 1
- 2
- 5
- 5
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkSpinButton
- generations
- True
- 1
- 0
- True
- GTK_UPDATE_ALWAYS
- False
- False
- 10
- 1
- 28
- 1
- 10
- 10
-
- 1
- 2
- 2
- 3
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkScrolledWindow
- scrolledwindow1
- 55
- GTK_POLICY_NEVER
- GTK_POLICY_ALWAYS
- GTK_UPDATE_CONTINUOUS
- GTK_UPDATE_CONTINUOUS
-
- 1
- 2
- 3
- 4
- 5
- 5
- False
- False
- False
- False
- True
- True
-
-
-
- GtkText
- display_text
- Allows you to customize the data in the boxes in the report
- True
- True
- $n
-b. $b
-d. $d
-
-
-
-
- GtkLabel
- label16
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0
- 5
- 5
-
- 0
- 1
- 3
- 4
- 0
- 0
- False
- False
- False
- False
- True
- True
-
-
-
-
-
-
-
-
-
diff --git a/gramps/src/plugins/ancestorreport.glade b/gramps/src/plugins/ancestorreport.glade
deleted file mode 100644
index d408293b0..000000000
--- a/gramps/src/plugins/ancestorreport.glade
+++ /dev/null
@@ -1,640 +0,0 @@
-
-
-
-
- ancestorreport
- ancestorreport
-
- src
-
- C
- True
- True
-
-
-
- GnomeDialog
- dialog1
- Gramps - Ahnentafel Report
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- False
- False
- False
- False
- False
-
-
- GtkVBox
- GnomeDialog:vbox
- dialog-vbox2
- False
- 8
-
- 4
- True
- True
-
-
-
- GtkHButtonBox
- GnomeDialog:action_area
- dialog-action_area2
- GTK_BUTTONBOX_END
- 8
- 85
- 27
- 7
- 0
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
- GtkButton
- button14
- True
- True
-
- clicked
- on_save_clicked
-
- Thu, 15 Mar 2001 23:13:39 GMT
-
- GNOME_STOCK_BUTTON_OK
-
-
-
- GtkButton
- button16
- True
- True
-
- clicked
- destroy_passed_object
-
- Thu, 15 Mar 2001 23:13:20 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
-
-
-
-
- GtkVBox
- vbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- labelTitle
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkHBox
- hbox2
- False
- 0
-
- 5
- False
- False
-
-
-
- GtkLabel
- label12
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GnomeFileEntry
- fileentry1
- 350
- ancestor_report
- 10
- Save Ancestor Report
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
-
- GtkFrame
- frame1
- 3
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 10
- True
- True
-
-
-
- GtkOptionMenu
- format
- 10
- True
-
-
- 0
-
-
-
-
- GtkFrame
- style_frame
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox4
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- style_edit
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame2
- 4
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox5
- False
- 0
-
-
- GtkHBox
- hbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox6
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkTable
- table1
- 3
- 2
- False
- 0
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkCheckButton
- pagebreak
- True
-
- False
- True
-
- 1
- 2
- 1
- 2
- 5
- 5
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkSpinButton
- generations
- True
- 1
- 0
- True
- GTK_UPDATE_ALWAYS
- False
- False
- 10
- 1
- 28
- 1
- 10
- 10
-
- 1
- 2
- 0
- 1
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkHSeparator
- hseparator2
-
- 0
- 2
- 2
- 3
- 0
- 5
- False
- True
- False
- False
- True
- True
-
-
-
-
-
- GtkNotebook
- option_notebook
- False
- False
- GTK_POS_TOP
- False
- 2
- 2
- False
-
- 0
- True
- True
-
-
-
- GtkTable
- table2
- 2
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label15
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- papersize
- True
-
-
- 0
-
- 1
- 2
- 0
- 1
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- orientation
- True
-
-
- 0
-
- 1
- 2
- 1
- 2
- 5
- 5
- False
- False
- False
- False
- True
- False
-
-
-
-
-
- GtkLabel
- Notebook:tab
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
- GtkVBox
- vbox7
- False
- 0
-
-
- GtkHBox
- hbox1
- False
- 0
-
- 5
- False
- True
-
-
-
- GtkLabel
- label11
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- True
-
-
-
-
- GnomeFileEntry
- htmltemplate
- HtmlTemplate
- 10
- Choose the HTML template
- False
- False
-
- 5
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- htmlfile
- True
- True
- True
- 0
-
-
-
-
-
-
- Placeholder
-
-
-
-
- GtkLabel
- Notebook:tab
- label15
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
-
-
-
-
-
-
-
-
diff --git a/gramps/src/plugins/basicreport.glade b/gramps/src/plugins/basicreport.glade
new file mode 100644
index 000000000..b2f286a3e
--- /dev/null
+++ b/gramps/src/plugins/basicreport.glade
@@ -0,0 +1,926 @@
+
+
+
+
+ Basicreport
+ basicreport
+
+ src
+ pixmaps
+ C
+ True
+ True
+
+
+
+ GnomeDialog
+ report_dialog
+ Basic Report
+ GTK_WINDOW_TOPLEVEL
+ GTK_WIN_POS_NONE
+ False
+ False
+ False
+ False
+ False
+ False
+
+
+ GtkVBox
+ GnomeDialog:vbox
+ dialog-vbox1
+ False
+ 0
+
+ 4
+ True
+ True
+
+
+
+ GtkHButtonBox
+ GnomeDialog:action_area
+ dialog-action_area1
+ GTK_BUTTONBOX_END
+ 8
+ 85
+ 27
+ 7
+ 0
+
+ 0
+ False
+ True
+ GTK_PACK_END
+
+
+
+ GtkButton
+ OK
+ True
+ True
+ True
+
+ clicked
+ on_ok_clicked
+
+ Tue, 18 Dec 2001 09:50:07 GMT
+
+ GNOME_STOCK_BUTTON_OK
+
+
+
+ GtkButton
+ Cancel
+ True
+ True
+
+ clicked
+ destroy_passed_object
+
+ Sun, 16 Dec 2001 07:52:14 GMT
+
+ GNOME_STOCK_BUTTON_CANCEL
+
+
+
+
+ GtkVBox
+ dialog_body
+ False
+ 0
+
+ 0
+ True
+ True
+
+
+
+ GtkLabel
+ header_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GtkHSeparator
+ hseparator1
+
+ 5
+ True
+ True
+
+
+
+
+ GtkFrame
+ format_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkHBox
+ save_hbox
+ 4
+ False
+ 0
+
+
+ GtkLabel
+ saveas
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GnomeFileEntry
+ fileentry1
+ 350
+ file_name
+ 10
+ Save Report
+ False
+ False
+
+ 0
+ True
+ True
+
+
+
+ GtkEntry
+ GnomeEntry:entry
+ filename
+ True
+ True
+ True
+ True
+ 0
+
+
+
+
+
+
+
+ GtkFrame
+ format_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkOptionMenu
+ format
+ 7
+ True
+ AbiWord
+
+ 0
+
+
+
+
+ GtkFrame
+ style_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkHBox
+ style_hbox
+ False
+ 0
+
+
+ GtkOptionMenu
+ style_menu
+ 7
+ True
+ default
+
+ 0
+
+ 0
+ True
+ True
+
+
+
+
+ GtkButton
+ style_edit
+ 10
+ True
+
+ clicked
+ on_style_edit_clicked
+
+ Sun, 16 Dec 2001 07:52:56 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 0
+ False
+ False
+
+
+
+
+
+
+ GtkNotebook
+ output_notebook
+ 4
+ False
+ False
+ GTK_POS_TOP
+ False
+ 2
+ 2
+ False
+
+ 0
+ True
+ True
+
+
+
+ GtkFrame
+ paper_frame
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+
+ GtkTable
+ paper_table
+ 2
+ 4
+ False
+ 0
+ 0
+
+
+ GtkLabel
+ size_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ orientation_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 2
+ 3
+ 0
+ 1
+ 5
+ 5
+ False
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ papersize
+ True
+ Letter
+
+ 0
+
+ 1
+ 2
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ orientation
+ True
+ Portrait
+
+ 0
+
+ 3
+ 4
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ pagecount_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 1
+ 2
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ pagecount_menu
+ True
+ Single (scaled)
+
+ 0
+
+ 1
+ 2
+ 1
+ 2
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+
+
+ GtkLabel
+ Notebook:tab
+ paper_tab
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ GtkFrame
+ html_frame
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+
+ GtkTable
+ table3
+ 2
+ 4
+ False
+ 0
+ 0
+
+
+ GtkLabel
+ label7
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GnomeFileEntry
+ htmltemplate
+ HtmlTemplate
+ 10
+ False
+ False
+
+ 1
+ 4
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+ GtkEntry
+ GnomeEntry:entry
+ htmlfile
+ True
+ True
+ True
+ 0
+
+
+
+
+
+
+
+ GtkLabel
+ Notebook:tab
+ html_tab
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+ GtkFrame
+ options_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkTable
+ options_table
+ 5
+ 2
+ False
+ 0
+ 0
+
+
+ GtkCombo
+ filter_combo
+ 5
+ True
+ True
+ False
+ True
+ False
+
+
+ 1
+ 2
+ 0
+ 1
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+ GtkEntry
+ GtkCombo:entry
+ filter
+ True
+ True
+ True
+ 0
+
+
+
+
+
+ GtkLabel
+ filter_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ gen_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 1
+ 2
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkSpinButton
+ generations
+ True
+ 1
+ 0
+ True
+ GTK_UPDATE_ALWAYS
+ False
+ False
+ 0
+ 1
+ 28
+ 1
+ 10
+ 10
+
+ 1
+ 2
+ 1
+ 2
+ 5
+ 5
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkCheckButton
+ pagebreak
+ True
+
+ False
+ True
+
+ 1
+ 2
+ 2
+ 3
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ extra_menu_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ extra_textbox_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0
+ 5
+ 5
+
+ 0
+ 1
+ 4
+ 5
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ True
+
+
+
+
+ GtkOptionMenu
+ extra_menu
+ 5
+ True
+ default
+
+ 0
+
+ 1
+ 2
+ 3
+ 4
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkScrolledWindow
+ extra_scrolledwindow
+ 5
+ 80
+ GTK_POLICY_ALWAYS
+ GTK_POLICY_ALWAYS
+ GTK_UPDATE_CONTINUOUS
+ GTK_UPDATE_CONTINUOUS
+
+ 1
+ 2
+ 4
+ 5
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ True
+
+
+
+ GtkText
+ extra_textbox
+ True
+ True
+
+
+
+
+
+
+
+
+
+
+ GtkWindow
+ progress_dialog
+ Gramps - Generate HTML reports
+ GTK_WINDOW_TOPLEVEL
+ GTK_WIN_POS_NONE
+ False
+ False
+ True
+ False
+
+
+ GtkVBox
+ vbox2
+ False
+ 0
+
+
+ GtkLabel
+ header_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 5
+
+ 0
+ False
+ False
+
+
+
+
+ GtkHSeparator
+ hseparator2
+
+ 5
+ True
+ True
+
+
+
+
+ GtkHBox
+ hbox1
+ False
+ 0
+
+ 10
+ True
+ True
+
+
+
+ Placeholder
+
+
+
+ GtkProgressBar
+ progressbar
+ 300
+ 0
+ 0
+ 100
+ GTK_PROGRESS_CONTINUOUS
+ GTK_PROGRESS_LEFT_TO_RIGHT
+ False
+ True
+ %v of %u (%P%%)
+ 0.5
+ 0.5
+
+ 5
+ True
+ True
+
+
+
+
+ Placeholder
+
+
+
+
+
+
diff --git a/gramps/src/plugins/desreport.glade b/gramps/src/plugins/desreport.glade
deleted file mode 100644
index 1d2ace8be..000000000
--- a/gramps/src/plugins/desreport.glade
+++ /dev/null
@@ -1,501 +0,0 @@
-
-
-
-
- desreport
- desreport
-
- src
- pixmaps
- C
- True
- True
-
-
-
- GnomeDialog
- dialog1
- Gramps - Descendant Report
- GTK_WINDOW_DIALOG
- GTK_WIN_POS_NONE
- False
- False
- False
- False
- False
- False
-
-
- GtkVBox
- GnomeDialog:vbox
- dialog-vbox2
- False
- 8
-
- 4
- True
- True
-
-
-
- GtkHButtonBox
- GnomeDialog:action_area
- dialog-action_area2
- GTK_BUTTONBOX_END
- 8
- 85
- 27
- 7
- 0
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
- GtkButton
- button14
- True
- True
-
- clicked
- on_save_clicked
-
- Thu, 15 Mar 2001 23:13:39 GMT
-
- GNOME_STOCK_BUTTON_OK
-
-
-
- GtkButton
- button16
- True
- True
-
- clicked
- destroy_passed_object
-
- Thu, 15 Mar 2001 23:13:20 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
-
-
-
-
- GtkVBox
- vbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- labelTitle
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkHBox
- hbox2
- False
- 0
-
- 5
- False
- False
-
-
-
- GtkLabel
- label12
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GnomeFileEntry
- fileentry1
- 350
- descendant_report
- 10
- Save Descendant Report
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
-
- GtkFrame
- frame1
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox6
- 5
- False
- 0
-
-
- GtkOptionMenu
- format
- True
-
-
- 0
-
- 0
- False
- False
-
-
-
-
-
-
- GtkFrame
- style_frame
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox3
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button17
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame2
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkNotebook
- option_notebook
- False
- False
- GTK_POS_TOP
- False
- 2
- 2
- False
-
-
- GtkTable
- table1
- 2
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- papersize
- True
-
-
- 0
-
- 1
- 2
- 0
- 1
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- orientation
- True
-
-
- 0
-
- 1
- 2
- 1
- 2
- 5
- 5
- False
- False
- False
- False
- True
- False
-
-
-
-
-
- GtkLabel
- Notebook:tab
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
- GtkVBox
- vbox5
- False
- 0
-
-
- GtkHBox
- hbox1
- False
- 0
-
- 10
- False
- True
-
-
-
- GtkLabel
- label11
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- True
-
-
-
-
- GnomeFileEntry
- htmltemplate
- HtmlTemplate
- 10
- Choose the HTML template
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- htmlfile
- True
- True
- True
- 0
-
-
-
-
-
-
- Placeholder
-
-
-
-
- GtkLabel
- Notebook:tab
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
-
-
-
-
-
diff --git a/gramps/src/plugins/familygroup.glade b/gramps/src/plugins/familygroup.glade
deleted file mode 100644
index 10c0597e8..000000000
--- a/gramps/src/plugins/familygroup.glade
+++ /dev/null
@@ -1,526 +0,0 @@
-
-
-
-
- familygroup
- familygroup
-
- src
- pixmaps
- C
- True
- True
-
-
-
- GnomeDialog
- dialog1
- Gramps - Family Group Report
- GTK_WINDOW_DIALOG
- GTK_WIN_POS_NONE
- False
- False
- False
- False
- False
- False
-
-
- GtkVBox
- GnomeDialog:vbox
- dialog-vbox2
- False
- 8
-
- 4
- True
- True
-
-
-
- GtkHButtonBox
- GnomeDialog:action_area
- dialog-action_area2
- GTK_BUTTONBOX_END
- 8
- 85
- 27
- 7
- 0
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
- GtkButton
- button14
- True
- True
-
- clicked
- on_save_clicked
-
- Thu, 15 Mar 2001 23:13:39 GMT
-
- GNOME_STOCK_BUTTON_OK
-
-
-
- GtkButton
- button16
- True
- True
-
- clicked
- destroy_passed_object
-
- Thu, 15 Mar 2001 23:13:20 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
-
-
-
-
- GtkVBox
- vbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- labelTitle
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkHBox
- hbox2
- False
- 0
-
- 5
- False
- False
-
-
-
- GtkLabel
- label12
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GnomeFileEntry
- fileentry1
- 350
- family_group
- 10
- Save Family Group Report
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
-
- GtkFrame
- spouse
- 5
- False
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 5
- True
- True
-
-
-
- GtkOptionMenu
- spouse_menu
- 10
- True
-
-
- 0
-
-
-
-
- GtkFrame
- frame1
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox4
- False
- 0
-
-
- GtkOptionMenu
- format
- 10
- True
-
-
- 0
-
- 0
- False
- False
-
-
-
-
-
-
- GtkFrame
- style_frame
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox3
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button17
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame2
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkNotebook
- option_notebook
- False
- False
- GTK_POS_TOP
- False
- 2
- 2
- False
-
-
- GtkTable
- table1
- 2
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- orientation
- True
-
-
- 0
-
- 1
- 2
- 1
- 2
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- papersize
- True
-
-
- 0
-
- 1
- 2
- 0
- 1
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
-
- GtkLabel
- Notebook:tab
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
- GtkVBox
- vbox5
- False
- 0
-
-
- GtkHBox
- hbox1
- False
- 0
-
- 5
- False
- True
-
-
-
- GtkLabel
- label11
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- True
-
-
-
-
- GnomeFileEntry
- htmltemplate
- HtmlTemplate
- 10
- Choose the HTML template
- False
- False
-
- 5
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- htmlfile
- True
- True
- True
- 0
-
-
-
-
-
-
- Placeholder
-
-
-
-
- GtkLabel
- Notebook:tab
- label15
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
-
-
-
-
-
diff --git a/gramps/src/plugins/graphviz.glade b/gramps/src/plugins/graphviz.glade
deleted file mode 100644
index 4dd71bcc5..000000000
--- a/gramps/src/plugins/graphviz.glade
+++ /dev/null
@@ -1,488 +0,0 @@
-
-
-
-
- HtmlReport
- htmlreport
-
- src
- pixmaps
- C
- True
- True
-
-
-
- GtkWindow
- top
- Generate Relationship Graphs
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_CENTER
- False
- False
- True
- False
-
-
- GtkVBox
- vbox1
- False
- 0
-
-
- GtkTable
- table1
- 3
- 2
- False
- 0
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- label3
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- False
- False
-
-
-
-
- GnomeFileEntry
- targetDirectory
- relationgraph
- 10
- GraphViz File
- False
- False
-
- 1
- 2
- 1
- 2
- 10
- 10
- True
- False
- False
- False
- True
- False
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
- GtkCombo
- filterName
- False
- True
- False
- True
- False
-
-
- 1
- 2
- 2
- 3
- 10
- 10
- True
- False
- False
- False
- True
- False
-
-
-
- GtkEntry
- GtkCombo:entry
- filter
- True
- False
- True
- 0
-
-
-
-
-
- GtkLabel
- personName
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- 2
- 0
- 1
- 5
- 10
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label6
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 2
- 3
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
-
- GtkHBox
- hbox4
- False
- 0
-
- 5
- True
- True
-
-
-
- Placeholder
-
-
-
- GtkFrame
- frame2
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 10
- True
- True
-
-
-
- GtkRadioButton
- graphviz
- True
-
- False
- True
- format
-
-
-
-
- Placeholder
-
-
-
-
- GtkHBox
- hbox1
- False
- 0
-
- 0
- True
- True
-
-
-
- Placeholder
-
-
-
- GtkFrame
- frame1
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 10
- True
- True
-
-
-
- GtkVBox
- vbox2
- False
- 0
-
-
- GnomePaperSelector
- paper
- 10
-
- 0
- False
- True
-
-
-
-
- GtkHBox
- hbox3
- True
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- label8
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- True
-
-
-
-
- GtkRadioButton
- scaled
- True
-
- False
- True
- s
-
- 0
- False
- True
-
-
-
-
- GtkRadioButton
- fit
- True
-
- False
- True
- s
-
- 0
- False
- True
-
-
-
-
- GtkRadioButton
- multi
- True
-
- False
- True
- s
-
- 0
- False
- True
-
-
-
-
-
- GtkHBox
- hbox2
- True
- 0
-
- 5
- False
- True
-
-
-
- GtkLabel
- label7
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GtkRadioButton
- portrait
- True
-
- False
- True
- o
-
- 0
- False
- True
-
-
-
-
- GtkRadioButton
- radiobutton1
- True
-
- False
- True
- o
-
- 0
- False
- True
-
-
-
-
- GtkLabel
- label9
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
-
-
-
- Placeholder
-
-
-
-
- GtkHButtonBox
- hbuttonbox1
- GTK_BUTTONBOX_END
- 30
- 85
- 27
- 7
- 0
-
- 10
- False
- True
-
-
-
- GtkButton
- ok
- True
- True
-
- clicked
- on_ok_clicked
-
- Sun, 12 Nov 2000 00:45:16 GMT
-
- GNOME_STOCK_BUTTON_OK
- GTK_RELIEF_NORMAL
-
-
-
- GtkButton
- button2
- True
- True
-
- clicked
- destroy_passed_object
-
- Sun, 12 Nov 2000 00:45:38 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
- GTK_RELIEF_NORMAL
-
-
-
-
-
-
diff --git a/gramps/src/plugins/indsum.glade b/gramps/src/plugins/indsum.glade
deleted file mode 100644
index fe3cce12c..000000000
--- a/gramps/src/plugins/indsum.glade
+++ /dev/null
@@ -1,501 +0,0 @@
-
-
-
-
- indsum
- indsum
-
- src
-
- C
- True
- True
-
-
-
- GnomeDialog
- dialog1
- Gramps - Individual Summary
- GTK_WINDOW_DIALOG
- GTK_WIN_POS_NONE
- False
- False
- False
- False
- False
- False
-
-
- GtkVBox
- GnomeDialog:vbox
- dialog-vbox2
- False
- 8
-
- 4
- True
- True
-
-
-
- GtkHButtonBox
- GnomeDialog:action_area
- dialog-action_area2
- GTK_BUTTONBOX_END
- 8
- 85
- 27
- 7
- 0
-
- 0
- False
- True
- GTK_PACK_END
-
-
-
- GtkButton
- button14
- True
- True
-
- clicked
- on_save_clicked
-
- Thu, 15 Mar 2001 23:13:39 GMT
-
- GNOME_STOCK_BUTTON_OK
-
-
-
- GtkButton
- button16
- True
- True
-
- clicked
- destroy_passed_object
-
- Thu, 15 Mar 2001 23:13:20 GMT
-
- GNOME_STOCK_BUTTON_CANCEL
-
-
-
-
- GtkVBox
- vbox3
- False
- 0
-
- 0
- True
- True
-
-
-
- GtkLabel
- labelTitle
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkHBox
- hbox2
- False
- 0
-
- 5
- False
- False
-
-
-
- GtkLabel
- label12
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 5
- 0
-
- 0
- False
- False
-
-
-
-
- GnomeFileEntry
- fileentry1
- 350
- family_group
- 10
- Save Individual Summary
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- filename
- True
- True
- True
- 0
-
-
-
-
-
-
- GtkFrame
- frame1
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox6
- False
- 0
-
-
- GtkOptionMenu
- format
- 5
- True
-
-
- 0
-
- 0
- False
- False
-
-
-
-
-
-
- GtkFrame
- style_frame
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox3
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button17
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame2
- 5
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkNotebook
- option_notebook
- False
- False
- GTK_POS_TOP
- False
- 2
- 2
- False
-
-
- GtkTable
- table1
- 2
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 0
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- orientation
- True
-
-
- 0
-
- 1
- 2
- 1
- 2
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
- GtkOptionMenu
- papersize
- True
-
-
- 0
-
- 1
- 2
- 0
- 1
- 5
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
-
- GtkLabel
- Notebook:tab
- label13
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
- GtkVBox
- vbox5
- False
- 0
-
-
- GtkHBox
- hbox1
- False
- 0
-
- 5
- False
- True
-
-
-
- GtkLabel
- label11
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- False
- True
-
-
-
-
- GnomeFileEntry
- htmltemplate
- HtmlTemplate
- 10
- Choose the HTML template
- False
- False
-
- 0
- True
- True
-
-
-
- GtkEntry
- GnomeEntry:entry
- htmlfile
- True
- True
- True
- 0
-
-
-
-
-
-
- Placeholder
-
-
-
-
- GtkLabel
- Notebook:tab
- label14
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
-
-
-
-
-
-
-
diff --git a/gramps/src/plugins/webpage.glade b/gramps/src/plugins/webpage.glade
index b0c3c27eb..970cf4ffa 100644
--- a/gramps/src/plugins/webpage.glade
+++ b/gramps/src/plugins/webpage.glade
@@ -2,8 +2,8 @@
- WebPage
- webpage
+ Basicreport
+ basicreport
src
pixmaps
@@ -13,627 +13,948 @@
- GtkWindow
- top
- Gramps - Generate HTML reports
+ GnomeDialog
+ report_dialog
+ Basic Report
GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_CENTER
+ GTK_WIN_POS_NONE
False
False
- True
+ False
False
+ False
+ False
GtkVBox
- vbox1
+ GnomeDialog:vbox
+ dialog-vbox1
False
0
-
-
- GtkLabel
- personName
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 0
-
- 5
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator1
-
- 5
- True
- True
-
-
-
-
- GtkFrame
- frame2
- 10
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkTable
- table1
- 4
- 2
- False
- 0
- 0
-
-
- GtkLabel
- label3
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 0
- 1
- 4
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label4
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 1
- 2
- 4
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label6
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 2
- 3
- 4
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GtkLabel
- label5
-
- GTK_JUSTIFY_CENTER
- False
- 1
- 0.5
- 5
- 0
-
- 0
- 1
- 3
- 4
- 4
- 0
- False
- False
- False
- False
- True
- False
-
-
-
-
- GnomeFileEntry
- targetDirectory
- 400
- htmldir
- 10
- Target Directory
- True
- False
-
- 1
- 2
- 0
- 1
- 10
- 5
- True
- False
- False
- False
- True
- False
-
-
-
- GtkEntry
- GnomeEntry:entry
- tgtdir
- True
- True
- True
- 0
-
-
-
-
-
- GnomeFileEntry
- htmlTemplate
- HtmlHistory
- 10
- HTML Template
- False
- False
-
- 1
- 2
- 1
- 2
- 10
- 5
- True
- False
- False
- False
- True
- False
-
-
-
- GtkEntry
- GnomeEntry:entry
- html_template
- True
- True
- True
- 0
-
-
-
-
-
- GtkCombo
- filterName
- False
- True
- False
- True
- False
-
-
- 1
- 2
- 2
- 3
- 10
- 5
- True
- False
- False
- False
- True
- False
-
-
-
- GtkEntry
- GtkCombo:entry
- filter
- True
- False
- True
- 0
-
-
-
-
-
- GtkSpinButton
- spinbutton1
- True
- 1
- 0
- True
- GTK_UPDATE_ALWAYS
- False
- False
- 4
- 0
- 100
- 1
- 10
- 10
-
- 1
- 2
- 3
- 4
- 10
- 5
- True
- False
- False
- False
- True
- False
-
-
-
-
-
-
- GtkFrame
- frame1
- 10
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkHBox
- hbox1
- False
- 0
-
-
- GtkOptionMenu
- style_menu
- 10
- True
- default
-
- 0
-
- 0
- True
- True
-
-
-
-
- GtkButton
- button3
- 10
- True
-
- clicked
- on_style_edit_clicked
-
- Tue, 05 Jun 2001 14:39:29 GMT
-
-
- GTK_RELIEF_NORMAL
-
- 5
- False
- False
-
-
-
-
-
-
- GtkFrame
- frame3
- 10
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkCheckButton
- include_link
- 3
- True
-
- False
- True
-
-
-
-
- GtkFrame
- options
- 10
-
- 0
- GTK_SHADOW_ETCHED_IN
-
- 0
- True
- True
-
-
-
- GtkVBox
- vbox2
- False
- 0
-
-
- GtkCheckButton
- private
- 3
- True
-
- True
- True
-
- 0
- False
- False
-
-
-
-
- GtkCheckButton
- restrict
- 3
- True
-
- True
- True
-
- 0
- False
- False
-
-
-
-
- GtkCheckButton
- nophotos
- 3
- True
-
- toggled
- on_nophotos_toggled
- Sat, 31 Mar 2001 21:59:36 GMT
-
-
- False
- True
-
- 0
- False
- False
-
-
-
-
- GtkCheckButton
- restrict_photos
- 3
- True
-
- False
- True
-
- 0
- False
- False
-
-
-
-
- GtkCheckButton
- srccomments
- 3
- True
-
- False
- True
-
- 0
- False
- False
-
-
-
-
+
+ 4
+ True
+ True
+
GtkHButtonBox
- hbuttonbox1
+ GnomeDialog:action_area
+ dialog-action_area1
GTK_BUTTONBOX_END
- 30
+ 8
85
27
7
0
- 10
+ 0
False
True
+ GTK_PACK_END
GtkButton
- ok
+ OK
True
+ True
True
clicked
on_ok_clicked
-
- Sun, 12 Nov 2000 00:45:16 GMT
+
+ Tue, 18 Dec 2001 09:50:07 GMT
GNOME_STOCK_BUTTON_OK
- GTK_RELIEF_NORMAL
GtkButton
- button2
+ Cancel
True
True
clicked
destroy_passed_object
-
- Sun, 12 Nov 2000 00:45:38 GMT
+
+ Sun, 16 Dec 2001 07:52:14 GMT
GNOME_STOCK_BUTTON_CANCEL
- GTK_RELIEF_NORMAL
-
-
-
-
- GtkWindow
- progress
- Gramps - Generate HTML reports
- GTK_WINDOW_TOPLEVEL
- GTK_WIN_POS_NONE
- False
- False
- True
- False
-
-
- GtkVBox
- vbox3
- False
- 0
- GtkLabel
- label7
-
- GTK_JUSTIFY_CENTER
- False
- 0.5
- 0.5
- 0
- 10
-
- 0
- False
- False
-
-
-
-
- GtkHSeparator
- hseparator2
-
- 10
- False
- True
-
-
-
-
- GtkHBox
- hbox2
+ GtkVBox
+ dialog_body
False
0
- 10
- False
- False
+ 0
+ True
+ True
- Placeholder
+ GtkLabel
+ header_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+ 0
+ False
+ False
+
- GtkProgressBar
- progressbar
- 300
- 0
- 0
- 100
- GTK_PROGRESS_CONTINUOUS
- GTK_PROGRESS_LEFT_TO_RIGHT
- False
- True
- %v of %u (%P %%)
- 0.5
- 0.5
+ GtkHSeparator
+ hseparator1
- 10
+ 5
True
True
- Placeholder
+ GtkFrame
+ format_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkHBox
+ save_hbox
+ 4
+ False
+ 0
+
+
+ GtkLabel
+ saveas
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ False
+ False
+
+
+
+
+ GnomeFileEntry
+ fileentry1
+ 350
+ file_name
+ 10
+ Save Report
+ False
+ False
+
+ 0
+ True
+ True
+
+
+
+ GtkEntry
+ GnomeEntry:entry
+ filename
+ True
+ True
+ True
+ True
+ 0
+
+
+
+
+
+
+
+ GtkFrame
+ format_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkOptionMenu
+ format
+ 7
+ True
+ AbiWord
+
+ 0
+
+
+
+
+ GtkFrame
+ style_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkHBox
+ style_hbox
+ False
+ 0
+
+
+ GtkOptionMenu
+ style_menu
+ 7
+ True
+ default
+
+ 0
+
+ 0
+ True
+ True
+
+
+
+
+ GtkButton
+ style_edit
+ 10
+ True
+
+ clicked
+ on_style_edit_clicked
+
+ Sun, 16 Dec 2001 07:52:56 GMT
+
+
+ GTK_RELIEF_NORMAL
+
+ 0
+ False
+ False
+
+
+
+
+
+
+ GtkNotebook
+ output_notebook
+ 4
+ False
+ False
+ GTK_POS_TOP
+ False
+ 2
+ 2
+ False
+
+ 0
+ True
+ True
+
+
+
+ GtkFrame
+ paper_frame
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+
+ GtkTable
+ paper_table
+ 2
+ 4
+ False
+ 0
+ 0
+
+
+ GtkLabel
+ size_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ orientation_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 2
+ 3
+ 0
+ 1
+ 5
+ 5
+ False
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ papersize
+ True
+ Letter
+
+ 0
+
+ 1
+ 2
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ orientation
+ True
+ Portrait
+
+ 0
+
+ 3
+ 4
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ pagecount_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 1
+ 2
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ pagecount_menu
+ True
+ Single (scaled)
+
+ 0
+
+ 1
+ 2
+ 1
+ 2
+ 5
+ 5
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+
+
+
+ GtkLabel
+ Notebook:tab
+ paper_tab
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ GtkFrame
+ html_frame
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+
+ GtkTable
+ table3
+ 2
+ 4
+ False
+ 0
+ 0
+
+
+ GtkLabel
+ label7
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GnomeFileEntry
+ htmltemplate
+ HtmlTemplate
+ 10
+ False
+ False
+
+ 1
+ 4
+ 0
+ 1
+ 5
+ 5
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+ GtkEntry
+ GnomeEntry:entry
+ htmlfile
+ True
+ True
+ True
+ 0
+
+
+
+
+
+
+
+ GtkLabel
+ Notebook:tab
+ html_tab
+
+ GTK_JUSTIFY_CENTER
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+
+ GtkFrame
+ options_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkTable
+ options_table
+ 6
+ 2
+ False
+ 0
+ 0
+
+
+ GtkCombo
+ filter_combo
+ 5
+ True
+ True
+ False
+ True
+ False
+
+
+ 1
+ 2
+ 0
+ 1
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+ GtkEntry
+ GtkCombo:entry
+ filter
+ True
+ True
+ True
+ 0
+
+
+
+
+
+ GtkLabel
+ filter_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 0
+ 1
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ gen_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 1
+ 2
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkSpinButton
+ generations
+ True
+ 1
+ 0
+ True
+ GTK_UPDATE_ALWAYS
+ False
+ False
+ 0
+ 1
+ 28
+ 1
+ 10
+ 10
+
+ 1
+ 2
+ 1
+ 2
+ 5
+ 5
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkCheckButton
+ include_link
+ True
+
+ False
+ True
+
+ 0
+ 2
+ 5
+ 6
+ 5
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkCheckButton
+ pagebreak
+ True
+
+ False
+ True
+
+ 1
+ 2
+ 2
+ 3
+ 5
+ 5
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ extra_menu_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0.5
+ 5
+ 0
+
+ 0
+ 1
+ 3
+ 4
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkLabel
+ extra_textbox_label
+
+ GTK_JUSTIFY_CENTER
+ False
+ 1
+ 0
+ 5
+ 0
+
+ 0
+ 1
+ 4
+ 5
+ 0
+ 0
+ False
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkOptionMenu
+ extra_menu
+ 5
+ True
+ default
+
+ 0
+
+ 1
+ 2
+ 3
+ 4
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ False
+
+
+
+
+ GtkScrolledWindow
+ extra_scrolledwindow
+ 5
+ 80
+ GTK_POLICY_ALWAYS
+ GTK_POLICY_ALWAYS
+ GTK_UPDATE_CONTINUOUS
+ GTK_UPDATE_CONTINUOUS
+
+ 1
+ 2
+ 4
+ 5
+ 0
+ 0
+ True
+ False
+ False
+ False
+ True
+ True
+
+
+
+ GtkText
+ extra_textbox
+ True
+ True
+
+
+
+
+
+
+
+ GtkFrame
+ privacy_frame
+ 4
+
+ 0
+ GTK_SHADOW_ETCHED_IN
+
+ 0
+ True
+ True
+
+
+
+ GtkVBox
+ vbox1
+ False
+ 0
+
+
+ GtkCheckButton
+ private
+ 3
+ True
+
+ True
+ True
+
+ 0
+ False
+ False
+
+
+
+
+ GtkCheckButton
+ restrict
+ 3
+ True
+
+ True
+ True
+
+ 0
+ False
+ False
+
+
+
+
+ GtkCheckButton
+ nophotos
+ 3
+ True
+
+ toggled
+ on_nophotos_toggled
+ Tue, 18 Dec 2001 08:22:51 GMT
+
+
+ False
+ True
+
+ 0
+ False
+ False
+
+
+
+
+ GtkCheckButton
+ restrict_photos
+ 3
+ True
+
+ False
+ True
+
+ 0
+ False
+ False
+
+
+
+
+ GtkCheckButton
+ srccomments
+ 3
+ True
+
+ False
+ True
+
+ 0
+ False
+ False
+
+
+
diff --git a/gramps/src/utils.py b/gramps/src/utils.py
index b555cb1a3..78368f099 100644
--- a/gramps/src/utils.py
+++ b/gramps/src/utils.py
@@ -531,3 +531,31 @@ def combo_timer_callback(combo):
entry.set_position(len(typed))
entry.select_region(len(typed), -1)
return
+
+#-------------------------------------------------------------------------
+#
+#
+#
+#-------------------------------------------------------------------------
+def build_string_optmenu(mapping, start_val):
+ index = 0
+ start_index = 0
+ keys = mapping.keys()
+ keys.sort()
+ myMenu = gtk.GtkMenu()
+
+ for key in keys:
+ if key == "default":
+ menuitem = gtk.GtkMenuItem(_("default"))
+ else:
+ menuitem = gtk.GtkMenuItem(key)
+ menuitem.set_data("d", mapping[key])
+ menuitem.show()
+ myMenu.append(menuitem)
+ if key == start_val:
+ start_index = index
+ index = index + 1
+
+ if start_index:
+ myMenu.set_active(start_index)
+ return myMenu