2006-12-31 Don Allingham <don@gramps-project.org>

* src/ReportBase/_ReportDialog.py: add HELP button support
	* src/ReportBase/_BareReportDialog.py: add HELP button support
	* src/plugins/NarrativeWeb.py: add HELP button support



svn: r7862
This commit is contained in:
Don Allingham 2006-12-31 23:56:14 +00:00
parent 2d84e78dbc
commit d72fce2c08
4 changed files with 54 additions and 30 deletions

View File

@ -1,3 +1,8 @@
2006-12-31 Don Allingham <don@gramps-project.org>
* src/ReportBase/_ReportDialog.py: add HELP button support
* src/ReportBase/_BareReportDialog.py: add HELP button support
* src/plugins/NarrativeWeb.py: add HELP button support
2006-12-30 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: Map to existing places if possible
* src/Merge/_MergePerson.py: Merge identical names

View File

@ -70,6 +70,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
frame_pad = 5
border_pad = 6
HELP_TOPIC = None
def __init__(self,dbstate,uistate,person,option_class,
name,translated_name,track=[]):
@ -127,12 +128,17 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
window = gtk.Dialog('GRAMPS')
self.set_window(window,None,self.get_title())
self.window.set_has_separator(False)
self.cancel = self.window.add_button(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL)
self.ok = self.window.add_button(gtk.STOCK_OK,gtk.RESPONSE_OK)
self.ok.connect('clicked',self.on_ok_clicked)
if self.HELP_TOPIC:
self.help = self.window.add_button(gtk.STOCK_HELP, gtk.RESPONSE_HELP)
self.help.connect('clicked',self.on_help_clicked)
self.cancel = self.window.add_button(gtk.STOCK_CANCEL,gtk.RESPONSE_CANCEL)
self.cancel.connect('clicked',self.on_cancel)
self.ok = self.window.add_button(gtk.STOCK_OK,gtk.RESPONSE_OK)
self.ok.connect('clicked',self.on_ok_clicked)
self.window.set_default_size(600,-1)
# Set up and run the dialog. These calls are not in top down
@ -641,6 +647,12 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
def on_cancel(self,*obj):
pass
def on_help_clicked(self, *obj):
if self.HELP_TOPIC:
import GrampsDisplay
GrampsDisplay.help(self.HELP_TOPIC)
print "HELP CLICKED"
def on_ok_clicked(self, obj):
"""The user is satisfied with the dialog choices. Parse all options
and close the window."""

View File

@ -646,26 +646,29 @@ def report(dbstate,uistate,person,report_class,options_class,
dialog_class = ReportDialog
dialog = dialog_class(dbstate,uistate,person,options_class,name,trans_name)
response = dialog.window.run()
if response == gtk.RESPONSE_OK:
try:
MyReport = report_class(dialog.db,dialog.person,dialog.options)
MyReport.doc.init()
MyReport.begin_report()
MyReport.write_report()
MyReport.end_report()
except Errors.FilterError, msg:
(m1,m2) = msg.messages()
ErrorDialog(m1,m2)
except IOError, msg:
ErrorDialog(_("Report could not be created"),str(msg))
except Errors.ReportError, msg:
(m1,m2) = msg.messages()
ErrorDialog(m1,m2)
except Errors.DatabaseError,msg:
ErrorDialog(_("Report could not be created"),str(msg))
except:
log.error("Failed to run report.", exc_info=True)
elif response == gtk.RESPONSE_DELETE_EVENT:
return
while True:
response = dialog.window.run()
if response == gtk.RESPONSE_OK:
try:
MyReport = report_class(dialog.db,dialog.person,dialog.options)
MyReport.doc.init()
MyReport.begin_report()
MyReport.write_report()
MyReport.end_report()
except Errors.FilterError, msg:
(m1,m2) = msg.messages()
ErrorDialog(m1,m2)
except IOError, msg:
ErrorDialog(_("Report could not be created"),str(msg))
except Errors.ReportError, msg:
(m1,m2) = msg.messages()
ErrorDialog(m1,m2)
except Errors.DatabaseError,msg:
ErrorDialog(_("Report could not be created"),str(msg))
except:
log.error("Failed to run report.", exc_info=True)
break
elif response == gtk.RESPONSE_DELETE_EVENT or response == gtk.RESPONSE_CANCEL:
break
dialog.close()

View File

@ -2625,6 +2625,8 @@ class WebReportOptions(ReportOptions):
#------------------------------------------------------------------------
class WebReportDialog(ReportDialog):
HELP_TOPIC = "rep-web"
def __init__(self,dbstate,uistate,person):
self.database = dbstate.db
self.person = person
@ -2636,11 +2638,13 @@ class WebReportDialog(ReportDialog):
name,translated_name)
self.style_name = None
response = self.window.run()
if response == gtk.RESPONSE_OK:
self.make_report()
elif response == gtk.RESPONSE_DELETE_EVENT:
return
while True:
response = self.window.run()
if response == gtk.RESPONSE_OK:
self.make_report()
break
elif response != gtk.RESPONSE_HELP:
break
self.close()
def setup_style_frame(self):