Hide place title field in place editor

Add option in preferences to display legacy title field.  Hide by default.
This commit is contained in:
Nick Hall 2015-05-12 20:52:10 +01:00
parent 9e468c7cd8
commit d8946d75ac
6 changed files with 47 additions and 31 deletions

View File

@ -293,6 +293,7 @@ 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.patronimic-surname', False)
register('preferences.no-given-text', "[%s]" % _("Missing Given Name"))
register('preferences.no-record-text', "[%s]" % _("Missing Record"))

View File

@ -1013,6 +1013,12 @@ class GrampsPreferences(ConfigureDialog):
grid.attach(obox, 1, row, 2, 1)
row += 1
# Legacy place title mode
self.add_checkbox(grid,
_("Display legacy place title field in editors"),
row, 'preferences.place-title', stop=3)
row += 1
# Age precision:
# precision=1 for "year", 2: "year, month" or 3: "year, month, days"
obox = Gtk.ComboBoxText()

View File

@ -55,6 +55,7 @@ from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredTagList,
from gramps.gen.errors import ValidationError
from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.display.place import displayer as place_displayer
from gramps.gen.config import config
from ..dialog import ErrorDialog
from ..glade import Glade
@ -105,9 +106,12 @@ class EditPlace(EditPrimary):
def _setup_fields(self):
self.title = MonitoredEntry(self.top.get_object("place_title"),
self.obj.set_title, self.obj.get_title,
self.db.readonly)
if config.get('preferences.place-title'):
self.top.get_object("place_title").show()
self.top.get_object("place_title_label").show()
self.title = MonitoredEntry(self.top.get_object("place_title"),
self.obj.set_title, self.obj.get_title,
self.db.readonly)
self.name = MonitoredEntry(self.top.get_object("name_entry"),
self.obj.set_name, self.obj.get_name,

View File

@ -35,6 +35,7 @@ from gramps.gen.lib import NoteType
from gramps.gen.db import DbTxn
from gramps.gen.errors import ValidationError
from gramps.gen.utils.place import conv_lat_lon
from gramps.gen.config import config
from gramps.gen.const import GRAMPS_LOCALE as glocale
_ = glocale.translation.gettext
@ -102,9 +103,13 @@ class EditPlaceRef(EditReference):
self.uistate, self.track,
self.db.readonly)
self.title = MonitoredEntry(self.top.get_object("place_title"),
self.source.set_title, self.source.get_title,
self.db.readonly)
if config.get('preferences.place-title'):
self.top.get_object("place_title").show()
self.top.get_object("place_title_label").show()
self.title = MonitoredEntry(self.top.get_object("place_title"),
self.source.set_title,
self.source.get_title,
self.db.readonly)
self.name = MonitoredEntry(self.top.get_object("name_entry"),
self.source.set_name, self.source.get_name,

View File

@ -83,14 +83,14 @@
<property name="row_spacing">4</property>
<property name="column_spacing">6</property>
<child>
<object class="GtkLabel" id="label244">
<property name="visible">True</property>
<object class="GtkLabel" id="place_title_label">
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">_Title:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">place_title</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -101,11 +101,11 @@
<object class="GtkLabel" id="label249">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">L_atitude:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">lat_entry</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -116,11 +116,11 @@
<object class="GtkLabel" id="label250">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_Longitude:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="mnemonic_widget">lon_entry</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -129,8 +129,8 @@
</child>
<child>
<object class="UndoableEntry" id="place_title">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<property name="tooltip_text" translatable="yes">Full title of this place.</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
@ -145,10 +145,10 @@
<object class="GtkLabel" id="label655">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">_ID:</property>
<property name="use_underline">True</property>
<property name="mnemonic_widget">gid</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -209,9 +209,9 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Code:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@ -285,8 +285,8 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="place_name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">place|Name:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -297,8 +297,8 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Type:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -341,8 +341,8 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Tags:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>

View File

@ -77,12 +77,12 @@
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="xpad">6</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">Reference information</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
<attributes>
<attribute name="weight" value="bold"/>
</attributes>
@ -109,11 +109,11 @@
<object class="GtkLabel" id="label513">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">_Date:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -190,13 +190,13 @@
<property name="row_spacing">6</property>
<property name="column_spacing">12</property>
<child>
<object class="GtkLabel" id="label501">
<property name="visible">True</property>
<object class="GtkLabel" id="place_title_label">
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="no_show_all">True</property>
<property name="label" translatable="yes">Title:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -207,10 +207,10 @@
<object class="GtkLabel" id="place_name_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Name:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -221,11 +221,11 @@
<object class="GtkLabel" id="label504">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ypad">3</property>
<property name="label" translatable="yes">ID:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -236,9 +236,9 @@
<object class="GtkLabel" id="label657">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Latitude:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
@ -269,12 +269,12 @@
<property name="width_request">500</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="ypad">4</property>
<property name="label" translatable="yes">&lt;b&gt;Note:&lt;/b&gt; Any changes in the enclosing place information will be reflected in the place itself, for places that it encloses.</property>
<property name="use_markup">True</property>
<property name="justify">fill</property>
<property name="wrap">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">True</property>
@ -293,10 +293,10 @@
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Type:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -307,10 +307,10 @@
<object class="GtkLabel" id="label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Longitude:</property>
<property name="use_underline">True</property>
<property name="justify">center</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>
@ -368,8 +368,8 @@
</child>
<child>
<object class="UndoableEntry" id="place_title">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="no_show_all">True</property>
<property name="tooltip_text" translatable="yes">Full title of this place.</property>
<property name="hexpand">True</property>
<property name="invisible_char">●</property>
@ -447,9 +447,9 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="label5">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Code:</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="expand">False</property>
@ -481,8 +481,8 @@ You can set these values via the Geography View by searching the place, or via a
<object class="GtkLabel" id="label4">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Tags:</property>
<property name="xalign">0</property>
</object>
<packing>
<property name="left_attach">2</property>