diff --git a/gramps/gui/editors/displaytabs/childmodel.py b/gramps/gui/editors/displaytabs/childmodel.py index 6b0df617d..14ab458ab 100644 --- a/gramps/gui/editors/displaytabs/childmodel.py +++ b/gramps/gui/editors/displaytabs/childmodel.py @@ -48,7 +48,7 @@ class ChildModel(Gtk.ListStore): def __init__(self, child_ref_list, db): Gtk.ListStore.__init__(self, int, str, str, str, str, str, - str, str, str, str, str, str, str, object) + str, str, str, str, str, str, str, bool, object) self.db = db for index, child_ref in enumerate(child_ref_list): child = db.get_person_from_handle(child_ref.ref) @@ -67,6 +67,7 @@ class ChildModel(Gtk.ListStore): name_displayer.sort_string(child.primary_name), self.column_birth_sort(child), self.column_death_sort(child), + child_ref.get_privacy(), child_ref ]) diff --git a/gramps/gui/editors/displaytabs/eventembedlist.py b/gramps/gui/editors/displaytabs/eventembedlist.py index 1c12409c1..042f95fb1 100644 --- a/gramps/gui/editors/displaytabs/eventembedlist.py +++ b/gramps/gui/editors/displaytabs/eventembedlist.py @@ -86,7 +86,8 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): None, None, (_('Age'), EventRefModel.COL_SORTAGE[0], 60, TEXT_COL, -1, None), - None + None, + (_('Private'), EventRefModel.COL_PRIVATE[0], 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, obj, build_model=EventRefModel, **kwargs): @@ -196,6 +197,7 @@ class EventEmbedList(DbGUIElement, GroupEmbeddedList): (1, 3), # date (1, 9), # age (1, 4), # place + (1, 11), # private (1, 5), # role ) diff --git a/gramps/gui/editors/displaytabs/eventrefmodel.py b/gramps/gui/editors/displaytabs/eventrefmodel.py index b93fec01d..5672dcdcd 100644 --- a/gramps/gui/editors/displaytabs/eventrefmodel.py +++ b/gramps/gui/editors/displaytabs/eventrefmodel.py @@ -80,9 +80,11 @@ class EventRefModel(Gtk.TreeStore): COL_FONTWEIGHT = (8, int) COL_AGE = (9, str) COL_SORTAGE = (10, str) + COL_PRIVATE = (11, bool) COLS = (COL_DESCR, COL_TYPE, COL_GID, COL_DATE, COL_PLACE, COL_ROLE, - COL_SORTDATE, COL_EVENTREF, COL_FONTWEIGHT, COL_AGE, COL_SORTAGE) + COL_SORTDATE, COL_EVENTREF, COL_FONTWEIGHT, COL_AGE, COL_SORTAGE, + COL_PRIVATE) def __init__(self, event_list, db, groups, **kwargs): """ @@ -107,7 +109,7 @@ class EventRefModel(Gtk.TreeStore): def row_group(self, index, group): name = self.namegroup(index, len(group)) - return [name, '', '', '', '', '', '', (index, None), WEIGHT_BOLD, '', ''] + return [name, '', '', '', '', '', '', (index, None), WEIGHT_BOLD, '', '', None] def namegroup(self, groupindex, length): return self._GROUPSTRING % {'groupname': self.groups[groupindex][1], @@ -125,6 +127,7 @@ class EventRefModel(Gtk.TreeStore): self.colweight(index), self.column_age(event), self.column_sort_age(event), + eventref.get_privacy(), ] def colweight(self, index): diff --git a/gramps/gui/editors/displaytabs/familyldsembedlist.py b/gramps/gui/editors/displaytabs/familyldsembedlist.py index 62e96dd24..dcd58e3ba 100644 --- a/gramps/gui/editors/displaytabs/familyldsembedlist.py +++ b/gramps/gui/editors/displaytabs/familyldsembedlist.py @@ -33,6 +33,7 @@ _ = glocale.translation.gettext # GRAMPS classes # #------------------------------------------------------------------------- +from .embeddedlist import TEXT_COL, MARKUP_COL, ICON_COL from .ldsembedlist import LdsEmbedList from gramps.gen.lib import LdsOrd @@ -43,17 +44,18 @@ from gramps.gen.lib import LdsOrd #------------------------------------------------------------------------- class FamilyLdsEmbedList(LdsEmbedList): - _HANDLE_COL = 5 + _HANDLE_COL = 6 # _DND_TYPE = DdTargets.ADDRESS #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('Type'), 0, 150, 0, -1), - (_('Date'), 1, 150, 1, -1), - (_('Status'), 3, 75, 0, -1), - (_('Temple'), 2, 200, 0, -1), - (_('Place'), 3, 100, 0, -1), + (_('Type'), 0, 150, TEXT_COL, -1, None), + (_('Date'), 1, 150, MARKUP_COL, -1, None), + (_('Status'), 3, 75, TEXT_COL, -1, None), + (_('Temple'), 2, 200, TEXT_COL, -1, None), + (_('Place'), 3, 100, TEXT_COL, -1, None), + (_('Private'), 5, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data): diff --git a/gramps/gui/editors/displaytabs/nameembedlist.py b/gramps/gui/editors/displaytabs/nameembedlist.py index d9299641b..8d7db9b40 100644 --- a/gramps/gui/editors/displaytabs/nameembedlist.py +++ b/gramps/gui/editors/displaytabs/nameembedlist.py @@ -78,6 +78,7 @@ class NameEmbedList(GroupEmbeddedList): (_('Group As'), NameModel.COL_GROUPAS[0],100, TEXT_COL, -1, None), (_('Source'), NameModel.COL_HASSOURCE[0],60, TEXT_COL, -1, None), (_('Notes Preview'), NameModel.COL_NOTEPREVIEW[0], 250, TEXT_COL, -1, None), + (_('Private'), NameModel.COL_PRIVATE[0], 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data, person, callback): @@ -114,7 +115,7 @@ class NameEmbedList(GroupEmbeddedList): The columns to show as a tuple of tuples containing tuples (show/noshow, model column) """ - return ((1, 0), (1, 1), (1, 4), (1, 5), (1, 6)) + return ((1, 0), (1, 7), (1, 1), (1, 4), (1, 5), (1, 6)) def get_popup_menu_items(self): if self._tmpgroup == self._WORKGROUP: diff --git a/gramps/gui/editors/displaytabs/namemodel.py b/gramps/gui/editors/displaytabs/namemodel.py index 7037d04d4..b24cc2b2b 100644 --- a/gramps/gui/editors/displaytabs/namemodel.py +++ b/gramps/gui/editors/displaytabs/namemodel.py @@ -74,9 +74,10 @@ class NameModel(Gtk.TreeStore): COL_GROUPAS = (4, str) COL_HASSOURCE = (5, str) COL_NOTEPREVIEW = (6, str) + COL_PRIVATE = (7, bool) COLS = (COL_NAME, COL_TYPE, COL_DATA, COL_FONTWEIGHT, COL_GROUPAS, - COL_HASSOURCE, COL_NOTEPREVIEW) + COL_HASSOURCE, COL_NOTEPREVIEW, COL_PRIVATE) def __init__(self, obj_list, db, groups): """ @@ -98,7 +99,7 @@ class NameModel(Gtk.TreeStore): def row_group(self, index, group): name = self.namegroup(index, len(group)) - return [name, '', (index, None), WEIGHT_NORMAL, '', '', ''] + return [name, '', (index, None), WEIGHT_NORMAL, '', '', '', None] def row(self, index, name): """ @@ -111,7 +112,8 @@ class NameModel(Gtk.TreeStore): self.colweight(index), name.get_group_as(), self.hassource(name), - self.notepreview(name) + self.notepreview(name), + name.get_privacy(), ] def colweight(self, index): if index == self.DEFINDEX: diff --git a/gramps/gui/editors/editfamily.py b/gramps/gui/editors/editfamily.py index e4dd6de86..450e73f10 100644 --- a/gramps/gui/editors/editfamily.py +++ b/gramps/gui/editors/editfamily.py @@ -79,7 +79,8 @@ from .editchildref import EditChildRef from .editperson import EditPerson from .displaytabs import (EmbeddedList, EventEmbedList, CitationEmbedList, FamilyAttrEmbedList, NoteTab, GalleryTab, - FamilyLdsEmbedList, ChildModel) + FamilyLdsEmbedList, ChildModel, + TEXT_COL, MARKUP_COL, ICON_COL) from ..widgets import (PrivacyButton, MonitoredEntry, MonitoredDataType, MonitoredTagList) from gramps.gen.plug import CATEGORY_QR_FAMILY @@ -103,7 +104,7 @@ class ChildEmbedList(EmbeddedList): is contained here instead of in displaytabs. """ - _HANDLE_COL = 13 + _HANDLE_COL = 14 _DND_TYPE = DdTargets.CHILDREF _DND_EXTRA = DdTargets.PERSON_LINK @@ -118,16 +119,20 @@ class ChildEmbedList(EmbeddedList): # (name, column in model, width, markup/text, font weight) _column_names = [ - (_('#'), 0, 25, 0, -1), - (_('ID'), 1, 60, 0, -1), - (_('Name'), 10, 250, 0, -1), - (_('Gender'), 3, 75, 0, -1), - (_('Paternal'), 4, 100, 0, -1), - (_('Maternal'), 5, 100, 0, -1), - (_('Birth Date'), 11, 150, 1, -1), - (_('Death Date'), 12, 150, 1, -1), - (_('Birth Place'), 8, 150, 0, -1), - (_('Death Place'), 9, 150, 0, -1), + (_('#'), 0, 25, TEXT_COL, -1, None), + (_('ID'), 1, 60, TEXT_COL, -1, None), + (_('Name'), 10, 250, TEXT_COL, -1, None), + (_('Gender'), 3, 75, TEXT_COL, -1, None), + (_('Paternal'), 4, 100, TEXT_COL, -1, None), + (_('Maternal'), 5, 100, TEXT_COL, -1, None), + (_('Birth Date'), 11, 150, MARKUP_COL, -1, None), + (_('Death Date'), 12, 150, MARKUP_COL, -1, None), + (_('Birth Place'), 8, 150, TEXT_COL, -1, None), + (_('Death Place'), 9, 150, TEXT_COL, -1, None), + None, + None, + None, + (_('Private'), 13, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, family): @@ -165,7 +170,7 @@ class ChildEmbedList(EmbeddedList): return self.family.get_child_ref_list() def column_order(self): - return [(1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), + return [(1, 13), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (0, 8), (0, 9)] def add_button_clicked(self, obj=None):