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> 2006-12-30 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadGedcom.py: Map to existing places if possible * src/GrampsDb/_ReadGedcom.py: Map to existing places if possible
* src/Merge/_MergePerson.py: Merge identical names * src/Merge/_MergePerson.py: Merge identical names

View File

@ -70,6 +70,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
frame_pad = 5 frame_pad = 5
border_pad = 6 border_pad = 6
HELP_TOPIC = None
def __init__(self,dbstate,uistate,person,option_class, def __init__(self,dbstate,uistate,person,option_class,
name,translated_name,track=[]): name,translated_name,track=[]):
@ -127,12 +128,17 @@ class BareReportDialog(ManagedWindow.ManagedWindow):
window = gtk.Dialog('GRAMPS') window = gtk.Dialog('GRAMPS')
self.set_window(window,None,self.get_title()) self.set_window(window,None,self.get_title())
self.window.set_has_separator(False) 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.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) self.window.set_default_size(600,-1)
# Set up and run the dialog. These calls are not in top down # 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): def on_cancel(self,*obj):
pass 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): def on_ok_clicked(self, obj):
"""The user is satisfied with the dialog choices. Parse all options """The user is satisfied with the dialog choices. Parse all options
and close the window.""" and close the window."""

View File

@ -646,6 +646,8 @@ def report(dbstate,uistate,person,report_class,options_class,
dialog_class = ReportDialog dialog_class = ReportDialog
dialog = dialog_class(dbstate,uistate,person,options_class,name,trans_name) dialog = dialog_class(dbstate,uistate,person,options_class,name,trans_name)
while True:
response = dialog.window.run() response = dialog.window.run()
if response == gtk.RESPONSE_OK: if response == gtk.RESPONSE_OK:
try: try:
@ -666,6 +668,7 @@ def report(dbstate,uistate,person,report_class,options_class,
ErrorDialog(_("Report could not be created"),str(msg)) ErrorDialog(_("Report could not be created"),str(msg))
except: except:
log.error("Failed to run report.", exc_info=True) log.error("Failed to run report.", exc_info=True)
elif response == gtk.RESPONSE_DELETE_EVENT: break
return elif response == gtk.RESPONSE_DELETE_EVENT or response == gtk.RESPONSE_CANCEL:
break
dialog.close() dialog.close()

View File

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