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:
@ -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>
|
2008-02-14 Douglas S. Blank <dblank@cs.brynmawr.edu>
|
||||||
* src/DataViews/RelationView.py (RelationshipView.write_parents):
|
* src/DataViews/RelationView.py (RelationshipView.write_parents):
|
||||||
added Sibling/Children add buttons; rearranged display;
|
added Sibling/Children add buttons; rearranged display;
|
||||||
|
@ -38,7 +38,7 @@ unambiguously built using UI controls such as menus and spin buttons.
|
|||||||
# Python modules
|
# 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_PERSIAN : DateHandler.displayer.persian,
|
||||||
Date.CAL_ISLAMIC : DateHandler.displayer.islamic }
|
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
|
# DateEdit
|
||||||
@ -259,7 +261,8 @@ class DateEditorDialog(ManagedWindow.ManagedWindow):
|
|||||||
while True:
|
while True:
|
||||||
response = self.window.run()
|
response = self.window.run()
|
||||||
if response == gtk.RESPONSE_HELP:
|
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:
|
elif response == gtk.RESPONSE_DELETE_EVENT:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@ -234,7 +234,6 @@ class ChildEmbedList(EmbeddedList):
|
|||||||
|
|
||||||
def share_button_clicked(self, obj):
|
def share_button_clicked(self, obj):
|
||||||
# it only makes sense to skip those who are already in the family
|
# it only makes sense to skip those who are already in the family
|
||||||
|
|
||||||
skip_list = [self.family.get_father_handle(), \
|
skip_list = [self.family.get_father_handle(), \
|
||||||
self.family.get_mother_handle()] + \
|
self.family.get_mother_handle()] + \
|
||||||
[x.ref for x in self.family.get_child_ref_list() ]
|
[x.ref for x in self.family.get_child_ref_list() ]
|
||||||
|
@ -128,8 +128,9 @@ class EditPrimary(ManagedWindow.ManagedWindow):
|
|||||||
def define_cancel_button(self, button):
|
def define_cancel_button(self, button):
|
||||||
button.connect('clicked', self.close)
|
button.connect('clicked', self.close)
|
||||||
|
|
||||||
def define_help_button(self, button, tag):
|
def define_help_button(self, button, tag, webpage='', section=''):
|
||||||
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
|
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
|
||||||
|
section))
|
||||||
|
|
||||||
def _do_close(self, *obj):
|
def _do_close(self, *obj):
|
||||||
for key in self.signal_keys:
|
for key in self.signal_keys:
|
||||||
|
@ -181,9 +181,10 @@ class EditReference(ManagedWindow.ManagedWindow):
|
|||||||
self._cleanup_on_exit()
|
self._cleanup_on_exit()
|
||||||
self.close(obj)
|
self.close(obj)
|
||||||
|
|
||||||
def define_help_button(self, button, tag):
|
def define_help_button(self, button, tag, webpage='', section=''):
|
||||||
import GrampsDisplay
|
import GrampsDisplay
|
||||||
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
|
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
|
||||||
|
section))
|
||||||
button.set_sensitive(True)
|
button.set_sensitive(True)
|
||||||
|
|
||||||
def _cleanup_on_exit(self):
|
def _cleanup_on_exit(self):
|
||||||
|
@ -113,8 +113,9 @@ class EditSecondary(ManagedWindow.ManagedWindow):
|
|||||||
def define_cancel_button(self,button):
|
def define_cancel_button(self,button):
|
||||||
button.connect('clicked',self.close)
|
button.connect('clicked',self.close)
|
||||||
|
|
||||||
def define_help_button(self,button,tag):
|
def define_help_button(self, button, tag, webpage='', section=''):
|
||||||
button.connect('clicked', lambda x: GrampsDisplay.help(tag))
|
button.connect('clicked', lambda x: GrampsDisplay.help(tag, webpage,
|
||||||
|
section))
|
||||||
|
|
||||||
def close(self,*obj):
|
def close(self,*obj):
|
||||||
for key in self.signal_keys:
|
for key in self.signal_keys:
|
||||||
|
@ -21,6 +21,39 @@
|
|||||||
# $Id$
|
# $Id$
|
||||||
|
|
||||||
import const
|
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=''):
|
def help(target, webpage='', section=''):
|
||||||
"""
|
"""
|
||||||
@ -34,12 +67,15 @@ def help(target, webpage='', section=''):
|
|||||||
# url(const.URL_MANUAL+'en/')
|
# url(const.URL_MANUAL+'en/')
|
||||||
|
|
||||||
# 3.0 Beta, direct to the wiki 3.0 Manual
|
# 3.0 Beta, direct to the wiki 3.0 Manual
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if not webpage:
|
if not webpage:
|
||||||
link = const.URL_WIKISTRING + const.URL_MANUAL_PAGE
|
link = const.URL_WIKISTRING + const.URL_MANUAL_PAGE + EXTENSION
|
||||||
else:
|
else:
|
||||||
link = const.URL_WIKISTRING + webpage
|
link = const.URL_WIKISTRING + webpage + EXTENSION
|
||||||
if section:
|
if section:
|
||||||
link + '#' + section
|
link = link + '#' + section
|
||||||
url(link)
|
url(link)
|
||||||
|
|
||||||
def url(link):
|
def url(link):
|
||||||
|
Reference in New Issue
Block a user