* src/plugins/BookReport.py: Added to CVS.

* src/plugins/book.glade: Likewise.
* src/ListModel.py: (insert, get_data): Added new methods.
* src/SelectPerson.py: Added to CVS.
* src/choose.glade: Likewise.


svn: r1627
This commit is contained in:
Alex Roitman 2003-06-02 13:34:18 +00:00
parent 1b709b4ae6
commit 7bc3f3bf1b
5 changed files with 1208 additions and 1 deletions

View File

@ -1,7 +1,7 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000 Donald N. Allingham
# Copyright (C) 2000-2003 Donald N. Allingham
#
# 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
@ -177,6 +177,21 @@ class ListModel:
self.selection.select_iter(iter)
return iter
def insert(self,position,data,info=None,select=0):
self.count = self.count + 1
iter = self.model.insert(position)
col = 0
for object in data:
self.model.set_value(iter,col,object)
col = col + 1
self.model.set_value(iter,col,info)
if select:
self.selection.select_iter(iter)
return iter
def get_data(self,iter,cols):
return [ self.model.get_value(iter,c) for c in cols ]
def add_and_select(self,data,info=None):
self.count = self.count + 1
iter = self.model.append()

149
src/SelectPerson.py Normal file
View File

@ -0,0 +1,149 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2003 Donald N. Allingham
#
# 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
#
#-------------------------------------------------------------------------
#
# internationalization
#
#-------------------------------------------------------------------------
from intl import gettext as _
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk
import gtk.glade
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
import RelLib
import const
import Utils
import ListModel
import GrampsCfg
from RelLib import Person
#-------------------------------------------------------------------------
#
# SelectPerson
#
#-------------------------------------------------------------------------
class SelectPerson:
def __init__(self,db,title,flabel="",filter=None):
self.db = db
self.filter = filter
gladefile = "%s/choose.glade" % const.rootDir
self.glade = gtk.glade.XML(gladefile,"select")
self.top = self.glade.get_widget('select')
title_label = self.glade.get_widget('title')
self.filter_select = self.glade.get_widget('filter')
self.female = self.glade.get_widget('female')
self.male = self.glade.get_widget('male')
self.unknown = self.glade.get_widget('unknown')
self.notebook = self.glade.get_widget('notebook')
if filter:
self.use_filter = 1
else:
self.use_filter = 0
Utils.set_titles(self.top,title_label,title)
titles = [(_('Name'),3,150),(_('ID'),1,50), (_('Birth date'),4,100),
('',0,0),('',0,0)]
self.fmodel = ListModel.ListModel(self.female,titles)
self.mmodel = ListModel.ListModel(self.male,titles)
self.umodel = ListModel.ListModel(self.unknown,titles)
if filter:
self.filter_select.set_label(flabel)
self.filter_select.connect('toggled',self.redraw_cb)
self.filter_select.show()
self.filter_select.set_active(1)
else:
self.filter_select.hide()
self.redraw()
self.top.show()
def redraw_cb(self,obj):
self.use_filter = self.filter_select.get_active()
self.redraw()
def redraw(self):
self.fmodel.clear()
self.fmodel.new_model()
self.mmodel.clear()
self.mmodel.new_model()
self.umodel.clear()
self.umodel.new_model()
for key in self.db.getPersonKeys():
person = self.db.getPerson(key)
if self.use_filter and not self.filter(person):
continue
data = self.db.getPersonDisplay(key)
gender = person.getGender()
if gender == RelLib.Person.male:
self.mmodel.add([data[0],data[1],data[3],data[5],data[6]],key)
elif gender == RelLib.Person.female:
self.fmodel.add([data[0],data[1],data[3],data[5],data[6]],key)
else:
self.umodel.add([data[0],data[1],data[3],data[5],data[6]],key)
self.fmodel.connect_model()
self.mmodel.connect_model()
self.umodel.connect_model()
def run(self):
val = self.top.run()
page = self.notebook.get_current_page()
if val == gtk.RESPONSE_OK:
if page == 0:
lmodel = self.fmodel
elif page == 1:
lmodel = self.mmodel
else:
lmodel = self.umodel
model,iter = lmodel.get_selected()
if iter:
id = lmodel.get_object(iter)
return_value = self.db.getPerson(id)
else:
return_value = None
self.top.destroy()
return return_value
else:
self.top.destroy()
return None

269
src/choose.glade Normal file
View File

@ -0,0 +1,269 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<requires lib="gnome"/>
<widget class="GtkDialog" id="select">
<property name="title" translatable="yes"></property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">True</property>
<property name="default_width">500</property>
<property name="default_height">450</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="cancelbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-6</property>
</widget>
</child>
<child>
<widget class="GtkButton" id="okbutton1">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">-5</property>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox47">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">6</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkNotebook" id="notebook">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">True</property>
<property name="tab_pos">GTK_POS_BOTTOM</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow32">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="female">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label257">
<property name="visible">True</property>
<property name="label" translatable="yes">female</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow33">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="male">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label258">
<property name="visible">True</property>
<property name="label" translatable="yes">male</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow34">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="unknown">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label259">
<property name="visible">True</property>
<property name="label" translatable="yes">unknown</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="filter">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes"></property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

374
src/plugins/BookReport.py Normal file
View File

@ -0,0 +1,374 @@
#
# Gramps - a GTK+/GNOME based genealogy program
#
#
# Copyright (C) 2003 Donald N. Allingham
#
# 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
#
#-------------------------------------------------------------------------
#
# Standard Python modules
#
#-------------------------------------------------------------------------
import os
import string
#-------------------------------------------------------------------------
#
# internationalization
#
#-------------------------------------------------------------------------
from intl import gettext as _
#-------------------------------------------------------------------------
#
# GTK/Gnome modules
#
#-------------------------------------------------------------------------
import gtk.glade
#-------------------------------------------------------------------------
#
# gramps modules
#
#-------------------------------------------------------------------------
from RelLib import Person
import const
import Utils
import ListModel
import GrampsCfg
import Plugins
import Report
#-------------------------------------------------------------------------
#
# ReportBook
#
#-------------------------------------------------------------------------
class BookReportSelector:
def __init__(self,db,person):
self.db = db
self.person = person
base = os.path.dirname(__file__)
glade_file = os.path.join(base,"book.glade")
self.xml = gtk.glade.XML(glade_file,"top")
self.top = self.xml.get_widget("top")
if person:
self.default_name = person.getPrimaryName().getSurname().upper()
else:
self.default_name = ""
self.xml.signal_autoconnect({
"on_add_clicked" : self.on_add_clicked,
"on_remove_clicked" : self.on_remove_clicked,
"on_up_clicked" : self.on_up_clicked,
"on_down_clicked" : self.on_down_clicked,
"on_setup_clicked" : self.on_setup_clicked,
"on_clear_clicked" : self.on_clear_clicked,
"on_book_ok_clicked" : self.on_book_ok_clicked,
"destroy_passed_object" : self.close
})
self.avail_tree = self.xml.get_widget("avail_tree")
self.book_tree = self.xml.get_widget("book_tree")
self.avail_tree.connect('button-press-event',self.av_double_click)
self.book_tree.connect('button-press-event',self.bk_double_click)
title_label = self.xml.get_widget('title')
Utils.set_titles(self.top,title_label,_('Book Report'))
avail_label = self.xml.get_widget('avail_label')
avail_label.set_text("<b>%s</b>" % "Available items")
avail_label.set_use_markup(gtk.TRUE)
book_label = self.xml.get_widget('book_label')
book_label.set_text("<b>%s</b>" % "Current book")
book_label.set_use_markup(gtk.TRUE)
av_titles = [(_('Name'),2,150),(_('Type'),1,50), ('',-1,0)]
bk_titles = [(_('Item name'),-1,150),(_('Type'),-1,50),
('',-1,0),('',-1,0)]
self.av_ncols = len(av_titles)
self.bk_ncols = len(bk_titles)
self.av_model = ListModel.ListModel(self.avail_tree,av_titles)
self.bk_model = ListModel.ListModel(self.book_tree,bk_titles)
self.draw_avail_list()
def close(self,obj):
self.top.destroy()
def draw_avail_list(self):
"""Draw the list with the selections available for the book."""
data = [_('Title Page'),_('Cover'),self.titlepage]
iter = self.av_model.add(data)
data = [_('Table of Contents'),_('TOC'),self.toc]
new_iter = self.av_model.add(data)
reports = Plugins._reports
for report in reports:
if not self.ignore(report):
data = [report[2],string.split(report[1])[0],report[0]]
new_iter = self.av_model.add(data)
self.av_model.connect_model()
if iter:
self.av_model.selection.select_iter(iter)
path = self.av_model.model.get_path(iter)
col = self.avail_tree.get_column(0)
self.avail_tree.scroll_to_cell(path,col,1,1,0.0)
def ignore(self,report):
"""Returns true if the report is to be ignored for the book."""
ignore_names = [_('Book Report')]
ignore_categories = [_('View'),_('Web Page')]
return (report[2] in ignore_names) or (report[1] in ignore_categories)
def on_add_clicked(self,obj):
store,iter = self.av_model.get_selected()
if not iter:
return
data = self.av_model.get_data(iter,range(self.av_ncols))
data.append([])
self.bk_model.add(data)
def on_remove_clicked(self,obj):
store,iter = self.bk_model.get_selected()
if not iter:
return
self.bk_model.remove(iter)
def on_clear_clicked(self,obj):
self.bk_model.clear()
def on_up_clicked(self,obj):
row = self.bk_model.get_selected_row()
if not row or row == -1:
return
store,iter = self.bk_model.get_selected()
data = self.bk_model.get_data(iter,range(self.bk_ncols))
self.bk_model.remove(iter)
self.bk_model.insert(row-1,data,None,1)
def on_down_clicked(self,obj):
row = self.bk_model.get_selected_row()
if row + 1 >= self.bk_model.count or row == -1:
return
store,iter = self.bk_model.get_selected()
data = self.bk_model.get_data(iter,range(self.bk_ncols))
self.bk_model.remove(iter)
self.bk_model.insert(row+1,data,None,1)
def on_setup_clicked(self,obj):
store,iter = self.bk_model.get_selected()
if not iter:
return
data = self.bk_model.get_data(iter,range(self.bk_ncols))
ReportOptionsDialog(self.db,self.person,data[0])
def bk_double_click(self,obj,event):
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
self.on_setup_clicked(obj)
def av_double_click(self,obj,event):
if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
self.on_add_clicked(obj)
def on_book_ok_clicked(self,obj): pass
def titlepage(self): pass
def toc(self): pass
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
class ReportOptionsDialog(Report.TextReportDialog):
def __init__(self,database,person,rep_title):
self.rep_title = rep_title
Report.TextReportDialog.__init__(self,database,person)
def get_title(self):
"""The window title for this dialog"""
return _("%s - GRAMPS Book") % self.rep_title
def get_header(self, name):
"""The header line at the top of the dialog contents"""
return _("%s for GRAMPS Book") % self.rep_title
def setup_paper_frame(self): pass
def setup_html_frame(self): pass
def setup_style_frame(self): pass
def html_file_enable(self,obj): pass
def setup_target_frame(self): pass
def setup_format_frame(self):
center_label = gtk.Label("<b>%s</b>" % _("Center Person"))
center_label.set_use_markup(gtk.TRUE)
center_label.set_alignment(0.0,0.5)
self.tbl.set_border_width(12)
self.tbl.attach(center_label,0,4,1,2,gtk.SHRINK|gtk.FILL)
name = self.person.getPrimaryName().getRegularName()
self.person_label = gtk.Label( "<i>%s</i>" % name )
self.person_label.set_use_markup(gtk.TRUE)
self.person_label.set_alignment(0.0,0.5)
self.tbl.attach(self.person_label,2,3,2,3)
change_button = gtk.Button("%s..." % _('_Change') )
change_button.connect('clicked',self.on_change_clicked)
self.tbl.attach(change_button,3,4,2,3,gtk.SHRINK|gtk.SHRINK)
def on_change_clicked(self,obj):
import SelectPerson
sel_person = SelectPerson.SelectPerson(self.db,'Select Person')
new_name = sel_person.run().getPrimaryName().getRegularName()
self.person_label.set_text( "<i>%s</i>" % new_name )
self.person_label.set_use_markup(gtk.TRUE)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def report(database,person):
BookReportSelector(database,person)
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
def get_xpm_image():
return [
"48 48 33 1",
" c None",
". c #1A1A1A",
"+ c #6A665E",
"@ c #A6A6A6",
"# c #BABAB6",
"$ c #D2D2D2",
"% c #EDE2D2",
"& c #7A7262",
"* c #F1EADF",
"= c #867A6E",
"- c #56524E",
"; c #868686",
"> c #E2CAA2",
", c #F2EEE2",
"' c #4E4E4E",
") c #B2966E",
"! c #FAFAFA",
"~ c #A29E96",
"{ c #BEA27A",
"] c #CECABE",
"^ c #968A76",
"/ c #DAD2C6",
"( c #423E3E",
"_ c #BA9E72",
": c #B7AC9A",
"< c #E9DAC3",
"[ c #E6E2E2",
"} c #322E2A",
"| c #9E9286",
"1 c #E6D2B6",
"2 c #F2EEE9",
"3 c #5E5A56",
"4 c #F6F2EE",
" ",
" ",
" ^=^=====&&&+&++++333+& ",
" =##############:#:~;33& ",
" =#!!!!!!!!!!!!!!*[$#;;|- ",
" ;#!!!!!!!!!!!!!!!2[$@&]|( ",
" =#!!!!!!!!!!!!!!!!2[$-[];} ",
" =#!!!!@@@@@@@@!!!!![4'![];} ",
" =#!!!!!!4!!4!!!!!!!!4'!![];} ",
" =#!!!!!!!!!!!!!!!!!!!'*!![];( ",
" =#!!!!!!!!!!!!!!!!!!!'[*!![]|- ",
" &#!!!!@@~@@@~@@~@@@@@'][4!![#|+ ",
" &#!4!!!!!!!!!!!!!4!!!'..}('3&=+& ",
" =#!!!!@@@@@@@@@@@@@@@@##@~;=+3(+ ",
" &#!!!!!!!!!!!!!!!!!!!![$##~;;='( ",
" &#!!!!@@@@@~@@@~@@@@~@@@@@#~~;+( ",
" &#!!!!!!!!!!!!!!!!!!!!444[]#@~&} ",
" &#!!!!!!!!!!!!!!!!!!4442[[$]#@=} ",
" &#!!!!!!!!!!!!!!!!!!4444[[$]]:;} ",
" +#!!!!@~@@@@@@@@~@@@@@~~~|;]]];} ",
" +#!!!!!!!!!!!!!!!!!44444,[$/]:^} ",
" +#!!!!@@@~@@@@@@@@~@~~~~~~|1>$|} ",
" +#!!!!!!!!!!!!!!!44442[*%[[<$]|} ",
" +#!!!!@@@@~@@@@~~@~~~~~~~~|1/>~} ",
" +#!!!!!!!!!!!!!!44444**[%%</1])} ",
" +#!!!!!!!!!!!!!4422******%%<1/|} ",
" +#!!!!!!!!!!!!!!4,*,**2***%<1/)} ",
" 3#!!!!@@@@@~,442,*,*,2**,,[<1/)} ",
" +#!!!!!!4!!444444**[%%%%%%<<1>~} ",
" 3#!!!!@@4*@@@~~~~~~~~~~||||<11)} ",
" +#4!!4444444,24[[*[<%<%<<<<<11|} ",
" 3#!!!44,,,@~~~~~~~~~|||||||111_} ",
" 3#!!!!!44444[4[[%%%%%<<<<11111)} ",
" 3#!!!!~@,*~~~~~~~~||||||^|^1>1_} ",
" 3#!!!444442%**[%<%%%<<<<11111>_} ",
" 3#!!!4***[~~~~~~|||||||^|^^1>>{} ",
" -#!444444**[%<%%%<<<<11111>1>>_} ",
" -#4444~~[[~~~|||||||^)^^^^^>>>_} ",
" -#4444[**[%%%%%%<<<<11111>>>>>)} ",
" '#4444****%%%%%<<<111<11>>>>>>_} ",
" ':44****%%%%%<<<1<1<1>>1>>>>>>)} ",
" -@4******%%%<%<1<<1111>>>>>>>>)} ",
" '#****%%%%<%<<<<1<11>1>>>>>>>>)} ",
" ':##:::::::{{{{{{__{___))^)))))} ",
" }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} ",
" ",
" ",
" "]
#------------------------------------------------------------------------
#
#
#
#------------------------------------------------------------------------
from Plugins import register_report
register_report(
report,
_("Book Report"),
category=_("Text Reports"),
status=(_("Experimental")),
description=_("Creates a book containg several reports."),
xpm=get_xpm_image()
)

400
src/plugins/book.glade Normal file
View File

@ -0,0 +1,400 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="top">
<property name="width_request">800</property>
<property name="height_request">600</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Book</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes">title</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">12</property>
<property name="ypad">12</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkTable" id="table">
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">3</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<child>
<widget class="GtkLabel" id="avail_label">
<property name="visible">True</property>
<property name="label" translatable="yes">avail_label</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="xpad">12</property>
<property name="ypad">6</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="book_label">
<property name="visible">True</property>
<property name="label" translatable="yes">book_label</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="xpad">12</property>
<property name="ypad">6</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_SPREAD</property>
<property name="spacing">24</property>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="button19">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Add an item to the book</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-add</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_add_clicked" last_modification_time="Sat, 24 May 2003 05:36:29 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button20">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Remove currently selected item from the book</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_remove_clicked" last_modification_time="Sat, 24 May 2003 05:36:44 GMT"/>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox4">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_DEFAULT_STYLE</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="button25">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Move current selection one step up in the book</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-up</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_up_clicked" last_modification_time="Sat, 24 May 2003 05:36:56 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button28">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Move current selection one step down in the book</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-go-down</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_down_clicked" last_modification_time="Sat, 24 May 2003 05:37:27 GMT"/>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox3">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button22">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Configure currently selected item</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_setup_clicked" last_modification_time="Sat, 24 May 2003 05:37:40 GMT"/>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">0</property>
<property name="yscale">0</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">2</property>
<child>
<widget class="GtkImage" id="image1">
<property name="visible">True</property>
<property name="stock">gtk-preferences</property>
<property name="icon_size">4</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="label" translatable="yes">_Setup</property>
<property name="use_underline">True</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkVButtonBox" id="vbuttonbox5">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_START</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="button27">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">Clear the book</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-clear</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_clear_clicked" last_modification_time="Sat, 24 May 2003 05:37:52 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options"></property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="a_scrolledwindow">
<property name="width_request">41</property>
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="avail_tree">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">24</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="b_scrolledwindow">
<property name="width_request">41</property>
<property name="height_request">60</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="book_tree">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
</widget>
</child>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_padding">24</property>
<property name="y_options">fill</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox1">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHButtonBox" id="hbuttonbox2">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">6</property>
<child>
<widget class="GtkButton" id="button12">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="destroy_passed_object" object="top"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="button13">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<signal name="clicked" handler="on_book_ok_clicked" last_modification_time="Sat, 24 May 2003 04:47:19 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>