Try to use constants like URL_MANUAL_PAGE, URL_WIKISTRING for easier migrations to new major versions

This commit is contained in:
Jérôme Rapinat 2014-06-16 15:52:28 +02:00
parent 5770a38ea4
commit 70a30c6c3d
3 changed files with 10 additions and 3 deletions

View File

@ -44,6 +44,7 @@ from gi.repository import Gtk
# gramps modules # gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from gramps.gen.const import URL_MANUAL_PAGE
from gramps.gen.config import config from gramps.gen.config import config
from gramps.gen.display.name import displayer as name_displayer from gramps.gen.display.name import displayer as name_displayer
from .editsecondary import EditSecondary from .editsecondary import EditSecondary
@ -60,6 +61,8 @@ from gramps.gen.errors import ValidationError
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
WIKI_HELP_PAGE = _('%s_-_Entering_and_editing_data:_detailed_-_part_3') % URL_MANUAL_PAGE
class GeneralNameTab(GrampsTab): class GeneralNameTab(GrampsTab):
""" """
This class provides the tabpage of the general name tab This class provides the tabpage of the general name tab
@ -155,7 +158,7 @@ class EditName(EditSecondary):
def _connect_signals(self): def _connect_signals(self):
self.define_cancel_button(self.top.get_object('button119')) self.define_cancel_button(self.top.get_object('button119'))
self.define_help_button(self.top.get_object('button131'), self.define_help_button(self.top.get_object('button131'),
_('Gramps_4.1_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_3'), WIKI_HELP_PAGE,
_('manpage section id|Name_Editor')) _('manpage section id|Name_Editor'))
self.define_ok_button(self.top.get_object('button118'), self.save) self.define_ok_button(self.top.get_object('button118'), self.save)

View File

@ -73,6 +73,7 @@ from .displaytabs import (PersonEventEmbedList, NameEmbedList, CitationEmbedList
WebEmbedList, PersonRefEmbedList, LdsEmbedList, WebEmbedList, PersonRefEmbedList, LdsEmbedList,
PersonBackRefList, SurnameTab) PersonBackRefList, SurnameTab)
from gramps.gen.plug import CATEGORY_QR_PERSON from gramps.gen.plug import CATEGORY_QR_PERSON
from gramps.gen.const import URL_MANUAL_PAGE
from gramps.gen.constfunc import cuni from gramps.gen.constfunc import cuni
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -81,6 +82,8 @@ from gramps.gen.constfunc import cuni
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
WIKI_HELP_PAGE = _('%s_-_Entering_and_editing_data:_detailed_-_part_1') % URL_MANUAL_PAGE
_select_gender = ((True, False, False), _select_gender = ((True, False, False),
(False, True, False), (False, True, False),
(False, False, True)) (False, False, True))
@ -233,7 +236,7 @@ class EditPerson(EditPrimary):
self.define_cancel_button(self.top.get_object("button15")) self.define_cancel_button(self.top.get_object("button15"))
self.define_ok_button(self.top.get_object("ok"), self.save) self.define_ok_button(self.top.get_object("ok"), self.save)
self.define_help_button(self.top.get_object("button134"), self.define_help_button(self.top.get_object("button134"),
_('Gramps_4.1_Wiki_Manual_-_Entering_and_editing_data:_detailed_-_part_1'), WIKI_HELP_PAGE,
_('manpage section id|Editing_information_about_people')) _('manpage section id|Editing_information_about_people'))
self.given.connect("focus_out_event", self._given_focus_out_event) self.given.connect("focus_out_event", self._given_focus_out_event)

View File

@ -29,6 +29,7 @@ from gi.repository import Gtk
# GRAMPS modules # GRAMPS modules
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from gramps.gen.const import URL_WIKISTRING, URL_MANUAL_PAGE
from gramps.gen.plug import Gramplet from gramps.gen.plug import Gramplet
from gramps.gui.widgets.styledtexteditor import StyledTextEditor from gramps.gui.widgets.styledtexteditor import StyledTextEditor
from gramps.gui.widgets import SimpleButton from gramps.gui.widgets import SimpleButton
@ -110,7 +111,7 @@ class WelcomeGramplet(Gramplet):
welcome += linkst(_('Start with Genealogy and Gramps'), welcome += linkst(_('Start with Genealogy and Gramps'),
_('http://www.gramps-project.org/wiki/index.php?title=Start_with_Genealogy')) + '\n' _('http://www.gramps-project.org/wiki/index.php?title=Start_with_Genealogy')) + '\n'
welcome += linkst(_('Gramps online manual'), welcome += linkst(_('Gramps online manual'),
_('http://www.gramps-project.org/wiki/index.php?title=Gramps_4.0_Wiki_Manual')) + '\n' join.(URL_WIKISTRING, URL_MANUAL_PAGE, _('locale_code|'))) + '\n'
welcome += linkst(_('Ask questions on gramps-users mailing list'), welcome += linkst(_('Ask questions on gramps-users mailing list'),
_('http://gramps-project.org/contact/')) + '\n\n' _('http://gramps-project.org/contact/')) + '\n\n'