2008-01-24 Douglas S. Blank <dblank@cs.brynmawr.edu>

* src/GrampsCfg.py: missing const; added Text tab
	* src/Config/_GrampsConfigKeys.py: added missing and private text
	* src/plugins/DefaultGramplets.py: use missing surname text
	* src/Simple/_SimpleAccess.py: use missing surname text



svn: r9929
This commit is contained in:
Doug Blank 2008-01-25 01:15:02 +00:00
parent 506eb32637
commit 6efffe4bf0
5 changed files with 58 additions and 11 deletions

View File

@ -1,3 +1,9 @@
2008-01-24 Douglas S. Blank <dblank@cs.brynmawr.edu>
* src/GrampsCfg.py: missing const; added Text tab
* src/Config/_GrampsConfigKeys.py: added missing and private text
* src/plugins/DefaultGramplets.py: use missing surname text
* src/Simple/_SimpleAccess.py: use missing surname text
2008-01-24 Raphael Ackermann <raphael.ackermann@gmail.com>
Removed all the __author__, __revision__ and __version__ statements

View File

@ -167,6 +167,12 @@ GENERATION_DEPTH = ('behavior', 'generation-depth', 1)
DATA_VIEWS = ('interface','data-views', 2)
ADDMEDIA_IMGDIR = ('behavior', 'addmedia-image-dir', 2)
ADDMEDIA_RELPATH = ('behavior', 'addmedia-relative-path', 0)
NO_SURNAME_TEXT = ('preferences', 'no-surname-text', 2)
NO_GIVEN_TEXT = ('preferences', 'no-given-text', 2)
NO_RECORD_TEXT = ('preferences', 'no-record-text', 2)
PRIVATE_SURNAME_TEXT = ('preferences', 'private-surname-text', 2)
PRIVATE_GIVEN_TEXT = ('preferences', 'private-given-text', 2)
PRIVATE_RECORD_TEXT = ('preferences', 'private-record-text', 2)
default_value = {
DEFAULT_SOURCE : False,
@ -289,4 +295,10 @@ default_value = {
'RepositoryView,NoteView'),
ADDMEDIA_IMGDIR : '',
ADDMEDIA_RELPATH : False,
NO_SURNAME_TEXT : "[%s]" % _("Missing Surname"),
NO_GIVEN_TEXT : "[%s]" % _("Missing Given Name"),
NO_RECORD_TEXT : "[%s]" % _("Missing Record"),
PRIVATE_SURNAME_TEXT : "[%s]" % _("Living"),
PRIVATE_GIVEN_TEXT : "[%s]" % _("Living"),
PRIVATE_RECORD_TEXT : "[%s]" % _("Private Record"),
}

View File

@ -42,6 +42,7 @@ import gtk
#
#-------------------------------------------------------------------------
import Config
import const
import DateHandler
from BasicUtils import name_displayer as _nd
import Utils
@ -146,8 +147,8 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
MarkupLabel(_('Database')))
panel.append_page(self.add_formats_panel(),
MarkupLabel(_('Display')))
#panel.append_page(self.add_name_panel(),
# MarkupLabel(_('Name Display')))
panel.append_page(self.add_text_panel(),
MarkupLabel(_('Text')))
panel.append_page(self.add_prefix_panel(),
MarkupLabel(_('ID Formats')))
panel.append_page(self.add_advanced_panel(),
@ -644,7 +645,7 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
obox.connect('changed',
lambda obj: Config.set(Config.SURNAME_GUESSING,
obj.get_active()))
lwidget = BasicLabel("%s: " % _('Surname Guessing'))
lwidget = BasicLabel("%s: " % _('Surname guessing'))
table.attach(lwidget, 0, 1, row, row+1, yoptions=0)
table.attach(obox, 1, 3, row, row+1, yoptions=0)
row += 1
@ -671,7 +672,32 @@ class GrampsPreferences(ManagedWindow.ManagedWindow):
self.add_checkbox(table, _("Show text in sidebar buttons (takes effect on restart)"),
row, Config.SIDEBAR_TEXT)
row += 1
return table
def add_text_panel(self):
row = 0
table = gtk.Table(6, 8)
table.set_border_width(12)
table.set_col_spacings(6)
table.set_row_spacings(6)
self.add_entry(table, _('Missing surname'), row,
Config.NO_SURNAME_TEXT)
row += 1
self.add_entry(table, _('Missing given name'), row,
Config.NO_GIVEN_TEXT)
row += 1
self.add_entry(table, _('Missing record'), row,
Config.NO_RECORD_TEXT)
row += 1
self.add_entry(table, _('Private surname'), row,
Config.PRIVATE_SURNAME_TEXT)
row += 1
self.add_entry(table, _('Private given name'), row,
Config.PRIVATE_GIVEN_TEXT)
row += 1
self.add_entry(table, _('Private record'), row,
Config.PRIVATE_RECORD_TEXT)
row += 1
return table
def cb_name_dialog(self, obj):

View File

@ -31,7 +31,7 @@ import Utils
from BasicUtils import name_displayer
from ReportBase import ReportUtils
from gen.lib import EventType
import const
import Config
class SimpleAccess:
"""
@ -130,7 +130,7 @@ class SimpleAccess:
assert(isinstance(person, (gen.lib.Person, NoneType)))
if person:
surname = person.get_primary_name().get_surname()
return surname or const.NO_SURNAME
return surname or Config.get(Config.NO_SURNAME_TEXT)
else:
return u''

View File

@ -28,7 +28,7 @@ from BasicUtils import name_displayer
from QuickReports import run_quick_report_by_name
import DateHandler
from gettext import gettext as _
import const
import Config
#
# Hello World, in Gramps Gramplets
@ -241,10 +241,12 @@ class TopSurnamesGramplet(Gramplet):
self.set_text("")
for (count, surname) in surname_sort:
if len(surname) == 0:
text = "%s, %d%% (%d)\n" % (const.NO_SURNAME,
int((float(count)/total) * 100), count)
text = "%s, %d%% (%d)\n" % (Config.get(Config.NO_SURNAME_TEXT),
int((float(count)/total) * 100),
count)
else:
text = "%s, %d%% (%d)\n" % (surname, int((float(count)/total) * 100), count)
text = "%s, %d%% (%d)\n" % (surname, int((float(count)/total) * 100),
count)
self.append_text(" %d. " % (line + 1))
self.link(text, 'Surname', representative_handle[surname])
line += 1
@ -327,7 +329,7 @@ class SurnameCloudGramplet(Gramplet):
self.set_text("")
for (count, surname) in cloud_names: # surname_sort:
if len(surname) == 0:
text = const.NO_SURNAME
text = Config.get(Config.NO_SURNAME_TEXT)
else:
text = surname
size = make_tag_size(count, counts)
@ -671,6 +673,7 @@ class AgeOnDateGramplet(Gramplet):
self.entry = gtk.Entry()
button = gtk.Button(_("Run"))
button.connect("clicked", self.run)
##self.filter =
hbox.pack_start(label, False)
hbox.pack_start(self.entry, True)
vbox.pack_start(description, True)