diff --git a/gramps/gui/editors/displaytabs/addrembedlist.py b/gramps/gui/editors/displaytabs/addrembedlist.py index 001a6f4a0..c13dadaac 100644 --- a/gramps/gui/editors/displaytabs/addrembedlist.py +++ b/gramps/gui/editors/displaytabs/addrembedlist.py @@ -56,7 +56,7 @@ class AddrEmbedList(EmbeddedList): Derives from the EmbeddedList class. """ - _HANDLE_COL = 6 + _HANDLE_COL = 7 _DND_TYPE = DdTargets.ADDRESS _MSG = { @@ -70,12 +70,13 @@ class AddrEmbedList(EmbeddedList): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('Date'), 0, 150, MARKUP_COL, -1, None), - (_('Street'), 1, 225, TEXT_COL, -1, None), - (_('Locality'), 2, 100, TEXT_COL, -1, None), - (_('City'), 3, 100, TEXT_COL, -1, None), - (_('State/County'), 4, 100, TEXT_COL, -1, None), - (_('Country'), 5, 75, TEXT_COL, -1, None), + (_('Date'), 0, 150, MARKUP_COL, -1, None), + (_('Street'), 1, 225, TEXT_COL, -1, None), + (_('Locality'), 2, 100, TEXT_COL, -1, None), + (_('City'), 3, 100, TEXT_COL, -1, None), + (_('State/County'), 4, 100, TEXT_COL, -1, None), + (_('Country'), 5, 75, TEXT_COL, -1, None), + (_('Private'), 6, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data): @@ -99,7 +100,7 @@ class AddrEmbedList(EmbeddedList): """ Return the column order of the columns in the display tab. """ - return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)) + return ((1,6), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4), (1, 5)) def add_button_clicked(self, obj): """ diff --git a/gramps/gui/editors/displaytabs/addressmodel.py b/gramps/gui/editors/displaytabs/addressmodel.py index 493b1e45d..ce305f32e 100644 --- a/gramps/gui/editors/displaytabs/addressmodel.py +++ b/gramps/gui/editors/displaytabs/addressmodel.py @@ -52,7 +52,7 @@ class AddressModel(Gtk.ListStore): """ AddressModel derives from the ListStore, defining te items in the list """ - Gtk.ListStore.__init__(self, str, str, str, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, str, str, str, bool, object) self.db = dbase for obj in obj_list: self.append(row=[ @@ -61,6 +61,7 @@ class AddressModel(Gtk.ListStore): obj.locality, obj.city, obj.state, - obj.country, + obj.country, + obj.get_privacy(), obj, ]) diff --git a/gramps/gui/editors/displaytabs/citationembedlist.py b/gramps/gui/editors/displaytabs/citationembedlist.py index 7ac7a7e0a..1bf865c90 100644 --- a/gramps/gui/editors/displaytabs/citationembedlist.py +++ b/gramps/gui/editors/displaytabs/citationembedlist.py @@ -64,7 +64,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): Derives from the EmbeddedList class. """ - _HANDLE_COL = 4 # Column number from CitationRefModel + _HANDLE_COL = 5 # Column number from CitationRefModel _DND_TYPE = DdTargets.CITATION_LINK _DND_EXTRA = DdTargets.SOURCE_LINK @@ -80,10 +80,11 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('Title'), 0, 200, TEXT_COL, -1, None), - (_('Author'), 1, 125, TEXT_COL, -1, None), - (_('Page'), 2, 100, TEXT_COL, -1, None), - (_('ID'), 3, 75, TEXT_COL, -1, None), + (_('Title'), 0, 200, TEXT_COL, -1, None), + (_('Author'), 1, 125, TEXT_COL, -1, None), + (_('Page'), 2, 100, TEXT_COL, -1, None), + (_('ID'), 3, 75, TEXT_COL, -1, None), + (_('Private'), 4, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data, callertitle=None): @@ -123,7 +124,7 @@ class CitationEmbedList(EmbeddedList, DbGUIElement): """ Return the column order of the columns in the display tab. """ - return ((1, 0), (1, 1), (1, 2), (1, 3)) + return ((1, 4), (1, 0), (1, 1), (1, 2), (1, 3)) def add_button_clicked(self, obj): """ diff --git a/gramps/gui/editors/displaytabs/citationrefmodel.py b/gramps/gui/editors/displaytabs/citationrefmodel.py index 04972bf75..a313711b7 100644 --- a/gramps/gui/editors/displaytabs/citationrefmodel.py +++ b/gramps/gui/editors/displaytabs/citationrefmodel.py @@ -36,10 +36,11 @@ from gi.repository import Gtk class CitationRefModel(Gtk.ListStore): def __init__(self, citation_list, db): - Gtk.ListStore.__init__(self, str, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, str, bool, str) self.db = db for handle in citation_list: citation = self.db.get_citation_from_handle(handle) src = self.db.get_source_from_handle(citation.get_reference_handle()) self.append(row=[src.title, src.author, citation.page, - citation.gramps_id, handle, ]) + citation.gramps_id, citation.get_privacy(), + handle, ]) diff --git a/gramps/gui/editors/displaytabs/ldsembedlist.py b/gramps/gui/editors/displaytabs/ldsembedlist.py index 0efc3ae9a..e9cb61956 100644 --- a/gramps/gui/editors/displaytabs/ldsembedlist.py +++ b/gramps/gui/editors/displaytabs/ldsembedlist.py @@ -46,7 +46,7 @@ from .embeddedlist import EmbeddedList, TEXT_COL, MARKUP_COL, ICON_COL #------------------------------------------------------------------------- class LdsEmbedList(EmbeddedList): - _HANDLE_COL = 5 + _HANDLE_COL = 6 # _DND_TYPE = DdTargets.ADDRESS _MSG = { @@ -64,7 +64,8 @@ class LdsEmbedList(EmbeddedList): (_('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), + (_('Place'), 3, 100, TEXT_COL, -1, None), + (_('Private'), 5, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data): @@ -83,7 +84,7 @@ class LdsEmbedList(EmbeddedList): return self.data def column_order(self): - return ((1, 0), (1, 1), (1, 2), (1, 3), (1, 4)) + return ((1, 5), (1, 0), (1, 1), (1, 2), (1, 3), (1, 4)) def add_button_clicked(self, obj): try: diff --git a/gramps/gui/editors/displaytabs/ldsmodel.py b/gramps/gui/editors/displaytabs/ldsmodel.py index 6c027808c..92f881dbe 100644 --- a/gramps/gui/editors/displaytabs/ldsmodel.py +++ b/gramps/gui/editors/displaytabs/ldsmodel.py @@ -51,7 +51,7 @@ class LdsModel(Gtk.ListStore): _HANDLE_COL = 5 def __init__(self, lds_list, db): - Gtk.ListStore.__init__(self, str, str, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, str, str, bool, object) self.db = db for lds_ord in lds_list: @@ -60,7 +60,8 @@ class LdsModel(Gtk.ListStore): get_date(lds_ord), lds_ord.status2str(), TEMPLES.name(lds_ord.get_temple()), - self.column_place(lds_ord), + self.column_place(lds_ord), + lds_ord.get_privacy(), lds_ord, ]) diff --git a/gramps/gui/editors/displaytabs/notemodel.py b/gramps/gui/editors/displaytabs/notemodel.py index bae78c9a3..257be3baf 100644 --- a/gramps/gui/editors/displaytabs/notemodel.py +++ b/gramps/gui/editors/displaytabs/notemodel.py @@ -35,15 +35,16 @@ from gi.repository import Gtk class NoteModel(Gtk.ListStore): def __init__(self, note_list, db): - Gtk.ListStore.__init__(self, str, str, object) + Gtk.ListStore.__init__(self, str, str, bool, str) self.db = db for handle in note_list: note = self.db.get_note_from_handle(handle) - text = note.get().replace('\n', ' ') + text = note.get()[:85].replace('\n', ' ') if len(text) > 80: text = text[:80]+"..." self.append(row=[ str(note.get_type()), text, + note.get_privacy(), handle, ]) diff --git a/gramps/gui/editors/displaytabs/notetab.py b/gramps/gui/editors/displaytabs/notetab.py index 3ee45f6ad..61e63d8c3 100644 --- a/gramps/gui/editors/displaytabs/notetab.py +++ b/gramps/gui/editors/displaytabs/notetab.py @@ -60,7 +60,7 @@ class NoteTab(EmbeddedList, DbGUIElement): Derives from the EmbeddedList class. """ - _HANDLE_COL = 2 + _HANDLE_COL = 3 _DND_TYPE = DdTargets.NOTE_LINK _MSG = { @@ -75,8 +75,9 @@ class NoteTab(EmbeddedList, DbGUIElement): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('Type'), 0, 100, TEXT_COL, -1, None), - (_('Preview'), 1, 200, TEXT_COL, -1, None), + (_('Type'), 0, 100, TEXT_COL, -1, None), + (_('Preview'), 1, 200, TEXT_COL, -1, None), + (_('Private'), 2, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data, callertitle=None, @@ -117,7 +118,7 @@ class NoteTab(EmbeddedList, DbGUIElement): """ Return the column order of the columns in the display tab. """ - return ((1, 0), (1, 1)) + return ((1, 2), (1, 0), (1, 1)) def add_button_clicked(self, obj): """ diff --git a/gramps/gui/editors/displaytabs/personrefembedlist.py b/gramps/gui/editors/displaytabs/personrefembedlist.py index e9edb770b..dd3060eeb 100644 --- a/gramps/gui/editors/displaytabs/personrefembedlist.py +++ b/gramps/gui/editors/displaytabs/personrefembedlist.py @@ -47,7 +47,7 @@ from .embeddedlist import EmbeddedList, TEXT_COL, MARKUP_COL, ICON_COL #------------------------------------------------------------------------- class PersonRefEmbedList(EmbeddedList): - _HANDLE_COL = 3 + _HANDLE_COL = 4 _DND_TYPE = DdTargets.PERSONREF _MSG = { @@ -61,9 +61,10 @@ class PersonRefEmbedList(EmbeddedList): #index = column in model. Value = # (name, sortcol in model, width, markup/text _column_names = [ - (_('Name'), 0, 250, TEXT_COL, -1, None), - (_('ID'), 1, 100, TEXT_COL, -1, None), - (_('Association'), 2, 100, TEXT_COL, -1, None), + (_('Name'), 0, 250, TEXT_COL, -1, None), + (_('ID'), 1, 100, TEXT_COL, -1, None), + (_('Association'), 2, 100, TEXT_COL, -1, None), + (_('Private'), 3, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data): @@ -80,7 +81,7 @@ class PersonRefEmbedList(EmbeddedList): return self.data def column_order(self): - return ((1, 0), (1, 1), (1, 2)) + return ((1,3), (1, 0), (1, 1), (1, 2)) def add_button_clicked(self, obj): from .. import EditPersonRef diff --git a/gramps/gui/editors/displaytabs/personrefmodel.py b/gramps/gui/editors/displaytabs/personrefmodel.py index 77c4fe7f0..304e4a09d 100644 --- a/gramps/gui/editors/displaytabs/personrefmodel.py +++ b/gramps/gui/editors/displaytabs/personrefmodel.py @@ -42,12 +42,13 @@ from gramps.gen.display.name import displayer as name_displayer class PersonRefModel(Gtk.ListStore): def __init__(self, obj_list, db): - Gtk.ListStore.__init__(self, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, bool, object) self.db = db for obj in obj_list: p = self.db.get_person_from_handle(obj.ref) if p: - data = [name_displayer.display(p), p.gramps_id, obj.rel, obj] + data = [name_displayer.display(p), p.gramps_id, obj.rel, + obj.get_privacy(), obj] else: - data = ['unknown','unknown', obj.rel, obj] + data = ['unknown','unknown', obj.rel, obj.get_privacy(), obj] self.append(row=data) diff --git a/gramps/gui/editors/displaytabs/repoembedlist.py b/gramps/gui/editors/displaytabs/repoembedlist.py index 10ff104d9..293f01375 100644 --- a/gramps/gui/editors/displaytabs/repoembedlist.py +++ b/gramps/gui/editors/displaytabs/repoembedlist.py @@ -49,7 +49,7 @@ from .embeddedlist import EmbeddedList, TEXT_COL, MARKUP_COL, ICON_COL #------------------------------------------------------------------------- class RepoEmbedList(EmbeddedList, DbGUIElement): - _HANDLE_COL = 4 + _HANDLE_COL = 5 _DND_TYPE = DdTargets.REPOREF _DND_EXTRA = DdTargets.REPO_LINK @@ -65,10 +65,11 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('ID'), 0, 75, TEXT_COL, -1, None), - (_('Title'), 1, 200, TEXT_COL, -1, None), - (_('Call Number'), 2, 125, TEXT_COL, -1, None), - (_('Type'), 3, 100, TEXT_COL, -1, None), + (_('ID'), 0, 75, TEXT_COL, -1, None), + (_('Title'), 1, 200, TEXT_COL, -1, None), + (_('Call Number'), 2, 125, TEXT_COL, -1, None), + (_('Type'), 3, 100, TEXT_COL, -1, None), + (_('Private'), 4, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, obj): @@ -98,7 +99,7 @@ class RepoEmbedList(EmbeddedList, DbGUIElement): return self.obj def column_order(self): - return ((1, 0), (1, 1), (1, 2), (1, 3)) + return ((1, 4), (1, 0), (1, 1), (1, 2), (1, 3)) def handle_extra_type(self, objtype, obj): from .. import EditRepoRef diff --git a/gramps/gui/editors/displaytabs/reporefmodel.py b/gramps/gui/editors/displaytabs/reporefmodel.py index 0a3bcf4a9..506c7b147 100644 --- a/gramps/gui/editors/displaytabs/reporefmodel.py +++ b/gramps/gui/editors/displaytabs/reporefmodel.py @@ -42,7 +42,7 @@ from gi.repository import Gtk class RepoRefModel(Gtk.ListStore): def __init__(self, ref_list, db): - Gtk.ListStore.__init__(self, str, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, str, bool, object) self.db = db for ref in ref_list: repo = self.db.get_repository_from_handle(ref.ref) @@ -51,4 +51,5 @@ class RepoRefModel(Gtk.ListStore): repo.name, ref.call_number, str(repo.get_type()), + ref.get_privacy(), ref, ]) diff --git a/gramps/gui/editors/displaytabs/srcattrembedlist.py b/gramps/gui/editors/displaytabs/srcattrembedlist.py index c302e82ca..c47b81fd4 100644 --- a/gramps/gui/editors/displaytabs/srcattrembedlist.py +++ b/gramps/gui/editors/displaytabs/srcattrembedlist.py @@ -61,8 +61,8 @@ class SrcAttrEmbedList(EmbeddedList): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col, icon _column_names = [ - (_('Type'), 0, 250, TEXT_COL, -1, None), - (_('Value'), 1, 200, TEXT_COL, -1, None), + (_('Type'), 0, 250, TEXT_COL, -1, None), + (_('Value'), 1, 200, TEXT_COL, -1, None), (_('Private'), 2, 30, ICON_COL, -1, 'gramps-lock') ] diff --git a/gramps/gui/editors/displaytabs/webembedlist.py b/gramps/gui/editors/displaytabs/webembedlist.py index ca9fb82ba..1149bccb7 100644 --- a/gramps/gui/editors/displaytabs/webembedlist.py +++ b/gramps/gui/editors/displaytabs/webembedlist.py @@ -48,7 +48,7 @@ from .embeddedlist import EmbeddedList, TEXT_COL, MARKUP_COL, ICON_COL #------------------------------------------------------------------------- class WebEmbedList(EmbeddedList): - _HANDLE_COL = 3 + _HANDLE_COL = 4 _DND_TYPE = DdTargets.URL _MSG = { @@ -63,9 +63,10 @@ class WebEmbedList(EmbeddedList): #index = column in model. Value = # (name, sortcol in model, width, markup/text, weigth_col _column_names = [ - (_('Type') , 0, 100, TEXT_COL, -1, None), - (_('Path') , 1, 200, TEXT_COL, -1, None), - (_('Description'), 2, 150, TEXT_COL, -1, None), + (_('Type') , 0, 100, TEXT_COL, -1, None), + (_('Path') , 1, 200, TEXT_COL, -1, None), + (_('Description'), 2, 150, TEXT_COL, -1, None), + (_('Private'), 3, 30, ICON_COL, -1, 'gramps-lock') ] def __init__(self, dbstate, uistate, track, data): @@ -80,7 +81,7 @@ class WebEmbedList(EmbeddedList): return self.data def column_order(self): - return ((1, 0), (1, 1), (1, 2)) + return ((1, 3), (1, 0), (1, 1), (1, 2)) def add_button_clicked(self, obj): from .. import EditUrl diff --git a/gramps/gui/editors/displaytabs/webmodel.py b/gramps/gui/editors/displaytabs/webmodel.py index cf11a26fa..c71f671ff 100644 --- a/gramps/gui/editors/displaytabs/webmodel.py +++ b/gramps/gui/editors/displaytabs/webmodel.py @@ -42,7 +42,8 @@ class WebModel(Gtk.ListStore): """ def __init__(self, obj_list, dbase): - Gtk.ListStore.__init__(self, str, str, str, object) + Gtk.ListStore.__init__(self, str, str, str, bool, object) self.db = dbase for obj in obj_list: - self.append(row=[str(obj.type), obj.path, obj.desc, obj]) + self.append(row=[str(obj.type), obj.path, obj.desc, + obj.get_privacy(), obj])