2008-02-15 Benny Malengier <benny.malengier@gramps-project.org>

* src/DateEdit.py: example use of help
	* src/GrampsDisplay.py: internationalization of help system
	* src/Editors/_EditPrimary.py: define_help_button link to webpage
	* src/Editors/_EditSecondary.py: define_help_button link to webpage
	* src/Editors/_EditReference.py: define_help_button link to webpage
	* src/Editors/_EditFamily.py: remove empty line



svn: r10036
This commit is contained in:
Benny Malengier 2008-02-15 11:40:17 +00:00
parent 1a067201aa
commit 470232fa5a
7 changed files with 61 additions and 12 deletions

View File

@ -1,3 +1,11 @@
2008-02-15 Benny Malengier <benny.malengier@gramps-project.org>
* src/DateEdit.py: example use of help
* src/GrampsDisplay.py: internationalization of help system
* src/Editors/_EditPrimary.py: define_help_button link to webpage
* src/Editors/_EditSecondary.py: define_help_button link to webpage
* src/Editors/_EditReference.py: define_help_button link to webpage
* src/Editors/_EditFamily.py: remove empty line
2008-02-14 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/DataViews/RelationView.py (RelationshipView.write_parents):
added Sibling/Children add buttons; rearranged display;

View File

@ -38,7 +38,7 @@ unambiguously built using UI controls such as menus and spin buttons.
# Python modules
#
#-------------------------------------------------------------------------
from gettext import gettext as _
from TransUtils import sgettext as _
#-------------------------------------------------------------------------
#
@ -94,6 +94,8 @@ CAL_TO_MONTHS_NAMES = {
Date.CAL_PERSIAN : DateHandler.displayer.persian,
Date.CAL_ISLAMIC : DateHandler.displayer.islamic }
WIKI_HELP_PAGE = 'Gramps_3.0_Wiki_Manual_-_Entering_and_Editing_Data:_Detailed'
WIKI_HELP_SEC = _('manual|Editing_Dates')
#-------------------------------------------------------------------------
#
# DateEdit
@ -259,7 +261,8 @@ class DateEditorDialog(ManagedWindow.ManagedWindow):
while True:
response = self.window.run()
if response == gtk.RESPONSE_HELP:
GrampsDisplay.help('adv-dates')
GrampsDisplay.help('adv-dates', webpage=WIKI_HELP_PAGE,
section=WIKI_HELP_SEC)
elif response == gtk.RESPONSE_DELETE_EVENT:
break
else:

View File

@ -234,7 +234,6 @@ class ChildEmbedList(EmbeddedList):
def share_button_clicked(self, obj):
# it only makes sense to skip those who are already in the family
skip_list = [self.family.get_father_handle(), \
self.family.get_mother_handle()] + \
[x.ref for x in self.family.get_child_ref_list() ]

View File

@ -128,8 +128,9 @@ class EditPrimary(ManagedWindow.ManagedWindow):
def define_cancel_button(self, button):
button.connect('clicked', self.close)
def define_help_button(self, button, tag):
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
def define_help_button(self, button, tag, webpage='', section=''):
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
section))
def _do_close(self, *obj):
for key in self.signal_keys:

View File

@ -181,9 +181,10 @@ class EditReference(ManagedWindow.ManagedWindow):
self._cleanup_on_exit()
self.close(obj)
def define_help_button(self, button, tag):
def define_help_button(self, button, tag, webpage='', section=''):
import GrampsDisplay
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
section))
button.set_sensitive(True)
def _cleanup_on_exit(self):

View File

@ -113,8 +113,9 @@ class EditSecondary(ManagedWindow.ManagedWindow):
def define_cancel_button(self,button):
button.connect('clicked',self.close)
def define_help_button(self,button,tag):
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
def define_help_button(self, button, tag, webpage='', section=''):
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
section))
def close(self,*obj):
for key in self.signal_keys:

View File

@ -21,6 +21,39 @@
# $Id$
import const
import locale
import os
#list of manuals on wiki, map locale code to wiki extension, add language codes
#completely, or first part, so pt_BR if Brazilian portugeze wiki manual, and
#nl for Dutch (nl_BE, nl_NL language code)
MANUALS = {
'nl' : '/nl',
}
#first, determine language code, so nl_BE --> wiki /nl
LANG = locale.getlocale()[0]
if not LANG:
LANG = 'C'
#support environment overrule:
try:
if not os.environ['LANGUAGE'] or \
os.environ['LANGUAGE'].split(':')[0] == LANG:
pass
else:
LANG = os.environ['LANGUAGE'].split(':')[0]
except:
pass
EXTENSION = ''
try:
EXTENSION = MANUALS[LANG]
except KeyError:
pass
try:
if not EXTENSION :
EXTENSION = MANUALS[LANG.split('_')[0]]
except KeyError:
pass
def help(target, webpage='', section=''):
"""
@ -34,12 +67,15 @@ def help(target, webpage='', section=''):
# url(const.URL_MANUAL+'en/')
# 3.0 Beta, direct to the wiki 3.0 Manual
if not webpage:
link = const.URL_WIKISTRING + const.URL_MANUAL_PAGE
link = const.URL_WIKISTRING + const.URL_MANUAL_PAGE + EXTENSION
else:
link = const.URL_WIKISTRING + webpage
link = const.URL_WIKISTRING + webpage + EXTENSION
if section:
link + '#' + section
link = link + '#' + section
url(link)
def url(link):