Remove place format preference setting
This commit is contained in:
parent
966551385b
commit
fec5a5dab0
@ -292,8 +292,7 @@ register('preferences.hide-ep-msg', False)
|
||||
register('preferences.invalid-date-format', "<b>%s</b>")
|
||||
register('preferences.iprefix', 'I%04d')
|
||||
register('preferences.name-format', 1)
|
||||
register('preferences.place-format', 0)
|
||||
register('preferences.place-title', False)
|
||||
register('preferences.place-auto', True)
|
||||
register('preferences.patronimic-surname', False)
|
||||
register('preferences.no-given-text', "[%s]" % _("Missing Given Name"))
|
||||
register('preferences.no-record-text', "[%s]" % _("Missing Record"))
|
||||
|
@ -27,14 +27,9 @@ Class handling displaying of places.
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from ..config import config
|
||||
from ..utils.location import get_location_list
|
||||
|
||||
try:
|
||||
from ..config import config
|
||||
WITH_GRAMPS_CONFIG=True
|
||||
except ImportError:
|
||||
WITH_GRAMPS_CONFIG=False
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# PlaceDisplay class
|
||||
@ -42,12 +37,6 @@ except ImportError:
|
||||
#-------------------------------------------------------------------------
|
||||
class PlaceDisplay(object):
|
||||
|
||||
def __init__(self):
|
||||
if WITH_GRAMPS_CONFIG:
|
||||
self.default_format = config.get('preferences.place-format')
|
||||
else:
|
||||
self.default_format = 0
|
||||
|
||||
def display_event(self, db, event):
|
||||
if not event:
|
||||
return ""
|
||||
@ -61,9 +50,9 @@ class PlaceDisplay(object):
|
||||
def display(self, db, place, date=None):
|
||||
if not place:
|
||||
return ""
|
||||
if self.default_format == 0:
|
||||
if not config.get('preferences.place-auto'):
|
||||
return place.title
|
||||
elif self.default_format == 1:
|
||||
else:
|
||||
names = [item[0] for item in get_location_list(db, place, date)]
|
||||
return ", ".join(names)
|
||||
|
||||
|
@ -998,24 +998,10 @@ class GrampsPreferences(ConfigureDialog):
|
||||
grid.attach(obox, 1, row, 2, 1)
|
||||
row += 1
|
||||
|
||||
# Place format:
|
||||
obox = Gtk.ComboBoxText()
|
||||
formats = [_('Title'), _('Automatic')]
|
||||
list(map(obox.append_text, formats))
|
||||
active = config.get('preferences.place-format')
|
||||
if active >= len(formats):
|
||||
active = 0
|
||||
obox.set_active(active)
|
||||
obox.connect('changed', self.place_format_changed)
|
||||
lwidget = BasicLabel("%s: " % _('Place format'))
|
||||
grid.attach(lwidget, 0, row, 1, 1)
|
||||
grid.attach(obox, 1, row, 2, 1)
|
||||
row += 1
|
||||
|
||||
# Legacy place title mode
|
||||
# Automatic place title generation
|
||||
self.add_checkbox(grid,
|
||||
_("Display legacy place title field in editors"),
|
||||
row, 'preferences.place-title', stop=3)
|
||||
_("Enable automatic place title generation"),
|
||||
row, 'preferences.place-auto', stop=3)
|
||||
row += 1
|
||||
|
||||
# Age precision:
|
||||
@ -1179,13 +1165,6 @@ class GrampsPreferences(ConfigureDialog):
|
||||
'effect until the next time Gramps is started.'),
|
||||
parent=self.window)
|
||||
|
||||
def place_format_changed(self, obj):
|
||||
config.set('preferences.place-format', obj.get_active())
|
||||
OkDialog(_('Change is not immediate'),
|
||||
_('Changing the place format will not take '
|
||||
'effect until the next time Gramps is started.'),
|
||||
parent=self.window)
|
||||
|
||||
def date_calendar_changed(self, obj):
|
||||
config.set('preferences.calendar-format-report', obj.get_active())
|
||||
|
||||
|
@ -105,7 +105,7 @@ class EditPlace(EditPrimary):
|
||||
|
||||
def _setup_fields(self):
|
||||
|
||||
if config.get('preferences.place-title'):
|
||||
if not config.get('preferences.place-auto'):
|
||||
self.top.get_object("place_title").show()
|
||||
self.top.get_object("place_title_label").show()
|
||||
self.title = MonitoredEntry(self.top.get_object("place_title"),
|
||||
|
@ -105,7 +105,7 @@ class EditPlaceRef(EditReference):
|
||||
self.uistate, self.track,
|
||||
self.db.readonly)
|
||||
|
||||
if config.get('preferences.place-title'):
|
||||
if not config.get('preferences.place-auto'):
|
||||
self.top.get_object("place_title").show()
|
||||
self.top.get_object("place_title_label").show()
|
||||
self.title = MonitoredEntry(self.top.get_object("place_title"),
|
||||
|
@ -78,7 +78,7 @@ class MergePlace(ManagedWindow):
|
||||
_("Merge Places"))
|
||||
|
||||
# Detailed selection widgets
|
||||
if config.get('preferences.place-title'):
|
||||
if not config.get('preferences.place-auto'):
|
||||
title1 = self.pl1.get_title()
|
||||
title2 = self.pl2.get_title()
|
||||
entry1 = self.get_widget("title1")
|
||||
|
Loading…
Reference in New Issue
Block a user