1765: Add private column to views

svn: r21114
This commit is contained in:
Nick Hall 2013-01-14 16:49:52 +00:00
parent 4cbdd52389
commit b20e711c30
31 changed files with 276 additions and 91 deletions

View File

@ -74,4 +74,4 @@ class SelectCitation(BaseSelector):
return self.db.get_citation_from_handle
def get_handle_column(self):
return 8
return 9

View File

@ -61,7 +61,7 @@ class SelectEvent(BaseSelector):
(_('Description'), 250, BaseSelector.TEXT, 0),
(_('ID'), 75, BaseSelector.TEXT, 1),
(_('Type'), 75, BaseSelector.TEXT, 2),
(_('Main Participants'), 250, BaseSelector.TEXT, 6),
(_('Main Participants'), 250, BaseSelector.TEXT, 7),
(_('Date'), 150, BaseSelector.TEXT, 3),
(_('Place'), 150, BaseSelector.TEXT, 4)
]
@ -70,4 +70,4 @@ class SelectEvent(BaseSelector):
return self.db.get_event_from_handle
def get_handle_column(self):
return 7
return 8

View File

@ -67,4 +67,4 @@ class SelectFamily(BaseSelector):
return self.db.get_family_from_handle
def get_handle_column(self):
return 7
return 8

View File

@ -66,11 +66,11 @@ class SelectNote(BaseSelector):
(_('Preview'), 350, BaseSelector.TEXT, 0),
(_('ID'), 75, BaseSelector.TEXT, 1),
(_('Type'), 100, BaseSelector.TEXT, 2),
(_('Tags'), 100, BaseSelector.TEXT, 3)
(_('Tags'), 100, BaseSelector.TEXT, 4)
]
def get_from_handle_func(self):
return self.db.get_note_from_handle
def get_handle_column(self):
return 5
return 6

View File

@ -67,7 +67,7 @@ class SelectObject(BaseSelector):
return self.db.get_object_from_handle
def get_handle_column(self):
return 7
return 8
def get_column_titles(self):
return [

View File

@ -80,7 +80,7 @@ class SelectPerson(BaseSelector):
(_('Death Date'), 150, BaseSelector.MARKUP, 5),
(_('Death Place'), 150, BaseSelector.MARKUP, 6),
(_('Spouse'), 150, BaseSelector.TEXT, 7),
(_('Last Change'), 150, BaseSelector.TEXT, 8)
(_('Last Change'), 150, BaseSelector.TEXT, 10)
]
def get_from_handle_func(self):

View File

@ -63,7 +63,7 @@ class SelectRepository(BaseSelector):
]
def get_handle_column(self):
return 13
return 14
def get_from_handle_func(self):
return self.db.get_repository_from_handle

View File

@ -66,4 +66,4 @@ class SelectSource(BaseSelector):
return self.db.get_source_from_handle
def get_handle_column(self):
return 6
return 7

View File

@ -104,13 +104,14 @@ class ListView(NavigationView):
def __init__(self, title, pdata, dbstate, uistate, columns, handle_col,
make_model, signal_map, get_bookmarks, bm_type, nav_group,
multiple=False, filter_class=None, markup=None):
multiple=False, filter_class=None, markup=None, pixbuf=None):
NavigationView.__init__(self, title, pdata, dbstate, uistate,
get_bookmarks, bm_type, nav_group)
#default is listviews keep themself in sync with database
self._dirty_on_change_inactive = False
self.filter_class = filter_class
self.pb_renderer = Gtk.CellRendererPixbuf()
self.renderer = Gtk.CellRendererText()
self.renderer.set_property('ellipsize', Pango.EllipsizeMode.END)
self.sort_col = 0
@ -124,6 +125,7 @@ class ListView(NavigationView):
self.multiple_selection = multiple
self.generic_filter = None
self.markup_columns = markup or []
self.pixbuf_columns = pixbuf or []
dbstate.connect('database-changed', self.change_db)
self.connect_signals()
@ -248,16 +250,19 @@ class ListView(NavigationView):
if not pair[0]: continue
name = self.colinfo[pair[1]]
column = Gtk.TreeViewColumn(name, self.renderer)
if pair[1] in self.pixbuf_columns:
column = Gtk.TreeViewColumn(name, self.pb_renderer)
column.set_cell_data_func(self.pb_renderer, self.icon, pair[1])
else:
column = Gtk.TreeViewColumn(name, self.renderer)
if pair[1] in self.markup_columns:
column.add_attribute(self.renderer, 'markup', pair[1])
else:
column.add_attribute(self.renderer, 'text', pair[1])
if self.model and self.model.color_column() is not None:
column.set_cell_data_func(self.renderer, self.foreground_color)
if pair[1] in self.markup_columns:
column.add_attribute(self.renderer, 'markup', pair[1])
else:
column.add_attribute(self.renderer, 'text', pair[1])
column.connect('clicked', self.column_clicked, index)
column.set_resizable(True)
@ -269,6 +274,16 @@ class ListView(NavigationView):
self.list.append_column(column)
index += 1
def icon(self, column, renderer, model, iter_, col_num):
'''
Set the stock icon property of the cell renderer. We use a cell data
function because there is a problem returning None from a model.
'''
stock_id = model.get_value(iter_, col_num)
if stock_id == '':
stock_id = None
renderer.set_property('stock_id', stock_id)
def foreground_color(self, column, renderer, model, iter_, data=None):
'''
Set the foreground color of the cell renderer. We use a cell data

View File

@ -59,6 +59,7 @@ COLUMN_PAGE = 3
COLUMN_CONFIDENCE = 4
COLUMN_SOURCE = 5
COLUMN_CHANGE = 9
COLUMN_PRIV = 10
# Data for the Source object
COLUMN2_HANDLE = 0
@ -68,6 +69,7 @@ COLUMN2_AUTHOR = 3
COLUMN2_PUBINFO = 4
COLUMN2_ABBREV = 7
COLUMN2_CHANGE = 8
COLUMN2_PRIV = 11
INVALID_DATE_FORMAT = config.get('preferences.invalid-date-format')
@ -113,6 +115,13 @@ class CitationBaseModel(object):
def citation_confidence(self, data):
return cuni(confidence[data[COLUMN_CONFIDENCE]])
def citation_private(self, data):
if data[COLUMN_PRIV]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def citation_handle(self, data):
return cuni(data[COLUMN_HANDLE])
@ -165,6 +174,18 @@ class CitationBaseModel(object):
except:
return ''
def citation_src_private(self, data):
source_handle = data[COLUMN_SOURCE]
try:
source = self.db.get_source_from_handle(source_handle)
if source.get_privacy():
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
except:
return ''
def citation_src_chan(self, data):
source_handle = data[COLUMN_SOURCE]
try:
@ -196,6 +217,13 @@ class CitationBaseModel(object):
def source_src_pinfo(self, data):
return cuni(data[COLUMN2_PUBINFO])
def source_src_private(self, data):
if data[COLUMN2_PRIV]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def source_src_chan(self, data):
return format_time(data[COLUMN2_CHANGE])

View File

@ -66,12 +66,14 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.citation_id,
self.citation_date,
self.citation_confidence,
self.citation_private,
self.citation_change,
self.citation_src_title,
self.citation_src_id,
self.citation_src_auth,
self.citation_src_abbr,
self.citation_src_pinfo,
self.citation_src_private,
self.citation_src_chan,
self.citation_handle,
self.citation_tooltip
@ -81,12 +83,14 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
self.citation_private,
self.citation_sort_change,
self.citation_src_title,
self.citation_src_id,
self.citation_src_auth,
self.citation_src_abbr,
self.citation_src_pinfo,
self.citation_src_private,
self.citation_src_chan,
self.citation_handle,
self.citation_tooltip

View File

@ -78,6 +78,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.source_src_id, # COL_ID (both Source & Citation)
None, # COL_DATE (not for Source)
None, # COL_CONFIDENCE (not for Source)
self.source_src_private, # COL_PRIV (both Source & Citation)
self.source_src_chan, # COL_CHAN (both Source & Citation)
self.source_src_auth, # COL_SRC_AUTH (Source only)
self.source_src_abbr, # COL_SRC_ABBR (Source only)
@ -90,6 +91,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.source_src_id,
self.dummy_sort_key,
self.dummy_sort_key,
self.source_src_private,
self.source_sort2_change,
self.source_src_auth,
self.source_src_abbr,
@ -134,6 +136,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.citation_id,
self.citation_date,
self.citation_confidence,
self.citation_private,
self.citation_change,
None,
None,
@ -146,6 +149,7 @@ class CitationTreeModel(CitationBaseModel, TreeBaseModel):
self.citation_id,
self.citation_sort_date,
self.citation_confidence,
self.citation_private,
self.citation_sort_change,
self.dummy_sort_key,
self.dummy_sort_key,

View File

@ -59,6 +59,7 @@ COLUMN_DATE = 3
COLUMN_DESCRIPTION = 4
COLUMN_PLACE = 5
COLUMN_CHANGE = 10
COLUMN_PRIV = 11
INVALID_DATE_FORMAT = config.get('preferences.invalid-date-format')
@ -80,6 +81,7 @@ class EventModel(FlatBaseModel):
self.column_type,
self.column_date,
self.column_place,
self.column_private,
self.column_change,
self.column_participant,
self.column_handle,
@ -91,6 +93,7 @@ class EventModel(FlatBaseModel):
self.column_type,
self.sort_date,
self.column_place,
self.column_private,
self.sort_change,
self.column_participant,
self.column_handle,
@ -159,6 +162,13 @@ class EventModel(FlatBaseModel):
def column_handle(self,data):
return cuni(data[COLUMN_HANDLE])
def column_private(self, data):
if data[COLUMN_PRIV]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self,data):
return "%012x" % data[COLUMN_CHANGE]

View File

@ -68,6 +68,7 @@ class FamilyModel(FlatBaseModel):
self.column_mother,
self.column_type,
self.column_marriage,
self.column_private,
self.column_tags,
self.column_change,
self.column_handle,
@ -80,6 +81,7 @@ class FamilyModel(FlatBaseModel):
self.sort_mother,
self.column_type,
self.sort_marriage,
self.column_private,
self.column_tags,
self.sort_change,
self.column_handle,
@ -104,7 +106,7 @@ class FamilyModel(FlatBaseModel):
"""
Return the color column.
"""
return 8
return 9
def do_get_n_columns(self):
return len(self.fmap)+1
@ -167,6 +169,13 @@ class FamilyModel(FlatBaseModel):
def column_id(self, data):
return cuni(data[1])
def column_private(self, data):
if data[14]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self, data):
return "%012x" % data[12]

View File

@ -65,6 +65,7 @@ class MediaModel(FlatBaseModel):
self.column_mime,
self.column_path,
self.column_date,
self.column_private,
self.column_tags,
self.column_change,
self.column_handle,
@ -78,13 +79,14 @@ class MediaModel(FlatBaseModel):
self.column_mime,
self.column_path,
self.sort_date,
self.column_private,
self.column_tags,
self.sort_change,
self.column_handle,
self.column_tag_color,
self.column_tooltip
]
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=9,
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=10,
search=search, skip=skip, sort_map=sort_map)
def destroy(self):
@ -102,7 +104,7 @@ class MediaModel(FlatBaseModel):
"""
Return the color column.
"""
return 8
return 9
def do_get_n_columns(self):
return len(self.fmap)+1
@ -156,6 +158,13 @@ class MediaModel(FlatBaseModel):
def column_handle(self,data):
return cuni(data[0])
def column_private(self, data):
if data[11]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self,data):
return "%012x" % data[8]

View File

@ -63,6 +63,7 @@ class NoteModel(FlatBaseModel):
self.column_preview,
self.column_id,
self.column_type,
self.column_private,
self.column_tags,
self.column_change,
self.column_handle,
@ -72,6 +73,7 @@ class NoteModel(FlatBaseModel):
self.column_preview,
self.column_id,
self.column_type,
self.column_private,
self.column_tags,
self.sort_change,
self.column_handle,
@ -95,7 +97,7 @@ class NoteModel(FlatBaseModel):
"""
Return the color column.
"""
return 6
return 7
def do_get_n_columns(self):
"""Return the column number of the Note tab."""
@ -126,6 +128,13 @@ class NoteModel(FlatBaseModel):
else:
return note
def column_private(self, data):
if data[Note.POS_PRIVATE]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self, data):
return "%012x" % data[Note.POS_CHANGE]

View File

@ -79,6 +79,7 @@ COLUMN_EVENT = 7
COLUMN_FAMILY = 8
COLUMN_CHANGE = 17
COLUMN_TAGS = 18
COLUMN_PRIV = 19
invalid_date_format = config.get('preferences.invalid-date-format')
@ -94,7 +95,7 @@ class PeopleBaseModel(object):
_GENDER = [ _('female'), _('male'), _('unknown') ]
# The following is accessed from the Person Selector
COLUMN_INT_ID = 10 # dynamic calculation of column indices
COLUMN_INT_ID = 11 # dynamic calculation of column indices
# LRU cache size
_CACHE_SIZE = 250
@ -115,6 +116,7 @@ class PeopleBaseModel(object):
self.column_death_day,
self.column_death_place,
self.column_spouse,
self.column_private,
self.column_tags,
self.column_change,
self.column_int_id,
@ -130,6 +132,7 @@ class PeopleBaseModel(object):
self.sort_death_day,
self.column_death_place,
self.column_spouse,
self.column_private,
self.column_tags,
self.sort_change,
self.column_int_id,
@ -160,7 +163,7 @@ class PeopleBaseModel(object):
"""
Return the color column.
"""
return 11
return 12
def clear_local_cache(self, handle=None):
""" Clear the LRU cache """
@ -220,6 +223,13 @@ class PeopleBaseModel(object):
if not self._in_build:
self.lru_spouse[handle] = value
return value
def column_private(self, data):
if data[COLUMN_PRIV]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def _get_spouse_data(self, data):
spouses_names = ""

View File

@ -76,7 +76,7 @@ COUNTRYLEVELS = {
#-------------------------------------------------------------------------
class PlaceBaseModel(object):
HANDLE_COL = 14
HANDLE_COL = 15
def __init__(self, db):
self.gen_cursor = db.get_place_cursor
@ -94,6 +94,7 @@ class PlaceBaseModel(object):
self.column_parish,
self.column_latitude,
self.column_longitude,
self.column_private,
self.column_change,
self.column_place_name,
self.column_handle,
@ -112,6 +113,7 @@ class PlaceBaseModel(object):
self.column_parish,
self.sort_latitude,
self.sort_longitude,
self.column_private,
self.sort_change,
self.column_place_name,
self.column_handle,
@ -219,6 +221,13 @@ class PlaceBaseModel(object):
except:
return ''
def column_private(self, data):
if data[12]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self, data):
return "%012x" % data[11]

View File

@ -69,6 +69,7 @@ class RepositoryModel(FlatBaseModel):
self.column_postal_code,
self.column_email,
self.column_search_url,
self.column_private,
self.column_change,
self.column_handle,
self.column_tooltip
@ -87,11 +88,12 @@ class RepositoryModel(FlatBaseModel):
self.column_postal_code,
self.column_email,
self.column_search_url,
self.column_private,
self.sort_change,
self.column_handle,
]
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=14,
FlatBaseModel.__init__(self, db, scol, order, tooltip_column=15,
search=search, skip=skip, sort_map=sort_map)
def destroy(self):
@ -221,6 +223,13 @@ class RepositoryModel(FlatBaseModel):
def column_tooltip(self,data):
return cuni('Repository tooltip')
def column_private(self, data):
if data[8]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def sort_change(self,data):
return "%012x" % data[7]

View File

@ -60,6 +60,7 @@ class SourceModel(FlatBaseModel):
self.column_author,
self.column_abbrev,
self.column_pubinfo,
self.column_private,
self.column_change,
self.column_handle,
self.column_tooltip
@ -70,9 +71,10 @@ class SourceModel(FlatBaseModel):
self.column_author,
self.column_abbrev,
self.column_pubinfo,
self.column_private,
self.sort_change,
]
FlatBaseModel.__init__(self,db,scol, order,tooltip_column=7,search=search,
FlatBaseModel.__init__(self,db,scol, order,tooltip_column=8,search=search,
skip=skip, sort_map=sort_map)
def destroy(self):
@ -107,6 +109,13 @@ class SourceModel(FlatBaseModel):
def column_pubinfo(self,data):
return cuni(data[4])
def column_private(self, data):
if data[11]:
return 'gramps-lock'
else:
# There is a problem returning None here.
return ''
def column_change(self,data):
return format_time(data[8])

View File

@ -86,8 +86,9 @@ class BasePersonView(ListView):
COL_DDAT = 5
COL_DPLAC = 6
COL_SPOUSE = 7
COL_TAGS = 8
COL_CHAN = 9
COL_PRIV = 8
COL_TAGS = 9
COL_CHAN = 10
#name of the columns
COLUMN_NAMES = [
_('Name'),
@ -98,18 +99,20 @@ class BasePersonView(ListView):
_('Death Date'),
_('Death Place'),
_('Spouse'),
_('Private'),
_('Tags'),
_('Last Changed'),
]
# columns that contain markup
MARKUP_COLS = [COL_BDAT, COL_BPLAC, COL_DDAT, COL_DPLAC]
PIXBUF_COLS = [COL_PRIV]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_NAME, COL_ID, COL_GEN, COL_BDAT, COL_DDAT]),
('columns.rank', [COL_NAME, COL_ID, COL_GEN, COL_BDAT, COL_BPLAC,
COL_DDAT, COL_DPLAC, COL_SPOUSE, COL_TAGS,
COL_DDAT, COL_DPLAC, COL_SPOUSE, COL_PRIV, COL_TAGS,
COL_CHAN]),
('columns.size', [250, 75, 75, 100, 175, 100, 175, 100, 100, 100])
('columns.size', [250, 75, 75, 100, 175, 100, 175, 100, 50, 100, 100])
)
ADD_MSG = _("Add a new person")
EDIT_MSG = _("Edit the selected person")
@ -139,7 +142,8 @@ class BasePersonView(ListView):
PersonBookmarks, nav_group,
multiple=True,
filter_class=PersonSidebarFilter,
markup=BasePersonView.MARKUP_COLS)
markup=BasePersonView.MARKUP_COLS,
pixbuf=BasePersonView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -88,7 +88,8 @@ class PlaceBaseView(ListView):
COL_PARISH = 9
COL_LAT = 10
COL_LON = 11
COL_CHAN = 12
COL_PRIV = 12
COL_CHAN = 13
# name of the columns
COLUMN_NAMES = [
_('Place Name'),
@ -103,19 +104,21 @@ class PlaceBaseView(ListView):
_('Church Parish'),
_('Latitude'),
_('Longitude'),
_('Private'),
_('Last Changed'),
]
# columns that contain markup
MARKUP_COLS = [COL_NAME]
PIXBUF_COLS = [COL_PRIV]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_NAME, COL_ID, COL_STREET, COL_LOCALITY,
COL_CITY, COL_COUNTY, COL_STATE]),
('columns.rank', [COL_NAME, COL_ID, COL_STREET, COL_LOCALITY, COL_CITY,
COL_COUNTY, COL_STATE, COL_COUNTRY, COL_ZIP,
COL_PARISH, COL_LAT, COL_LON, COL_CHAN]),
COL_PARISH, COL_LAT, COL_LON, COL_PRIV, COL_CHAN]),
('columns.size', [250, 75, 150, 150, 150, 150, 100, 100, 100,
100, 150, 150, 100])
100, 150, 150, 50, 100])
)
ADD_MSG = _("Add a new place")
EDIT_MSG = _("Edit the selected place")
@ -124,8 +127,7 @@ class PlaceBaseView(ListView):
FILTER_TYPE = "Place"
QR_CATEGORY = CATEGORY_QR_PLACE
def __init__(self, pdata, dbstate, uistate, title, model, nav_group,
markup=None):
def __init__(self, pdata, dbstate, uistate, title, model, nav_group):
signal_map = {
'place-add' : self.row_add,
@ -139,12 +141,14 @@ class PlaceBaseView(ListView):
ListView.__init__(
self, title, pdata, dbstate, uistate,
self.COLUMN_NAMES, 14,
self.COLUMN_NAMES, 15,
model, signal_map,
dbstate.db.get_place_bookmarks(),
PlaceBookmarks, nav_group,
multiple=True,
filter_class=PlaceSidebarFilter, markup=markup)
filter_class=PlaceSidebarFilter,
markup=PlaceBaseView.MARKUP_COLS,
pixbuf=PlaceBaseView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,
@ -161,6 +165,11 @@ class PlaceBaseView(ListView):
def define_actions(self):
ListView.define_actions(self)
self._add_toolmenu_action('MapsList', _('Loading...'),
_("Attempt to see selected locations with a Map "
"Service (OpenstreetMap, Google Maps, ...)"),
self.gotomap,
_('Select a Map Service'))
self._add_action('GotoMap', Gtk.STOCK_JUMP_TO,
_('_Look up with Map Service'),
callback=self.gotomap,
@ -352,6 +361,7 @@ class PlaceBaseView(ListView):
<toolitem action="Remove"/>
<toolitem action="Merge"/>
<separator/>
<toolitem action="MapsList"/>
</placeholder>
</toolbar>
<popup name="Popup">

View File

@ -79,42 +79,49 @@ class CitationListView(ListView):
sources as separate list entries).
"""
# The data items here have to correspond, in order, to the items in
# src/giu.views/treemodels/citationlismodel.py
# src/giu/views/treemodels/citationlismodel.py
COL_TITLE_PAGE = 0
COL_ID = 1
COL_DATE = 2
COL_CONFIDENCE = 3
COL_CHAN = 4
COL_SRC_TITLE = 5
COL_SRC_ID = 6
COL_SRC_AUTH = 7
COL_SRC_ABBR = 8
COL_SRC_PINFO = 9
COL_SRC_CHAN = 10
COL_PRIV = 4
COL_CHAN = 5
COL_SRC_TITLE = 6
COL_SRC_ID = 7
COL_SRC_AUTH = 8
COL_SRC_ABBR = 9
COL_SRC_PINFO = 10
COL_SRC_PRIV = 11
COL_SRC_CHAN = 12
# name of the columns
COLUMN_NAMES = [
_('Volume/Page'),
_('ID'),
_('Date'),
_('Confidence'),
_('Private'),
_('Last Changed'),
_('Source: Title'),
_('Source: ID'),
_('Source: Author'),
_('Source: Abbreviation'),
_('Source: Publication Information'),
_('Source: Private'),
_('Source: Last Changed'),
]
# columns that contain markup
MARKUP_COLS = [COL_DATE]
PIXBUF_COLS = [COL_PRIV, COL_SRC_PRIV]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE_PAGE, COL_ID, COL_DATE,
COL_CONFIDENCE]),
('columns.rank', [COL_TITLE_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE,
COL_CHAN, COL_SRC_TITLE, COL_SRC_ID, COL_SRC_AUTH,
COL_SRC_ABBR, COL_SRC_PINFO, COL_SRC_CHAN]),
('columns.size', [200, 75, 100, 100, 100, 200, 75, 75, 100, 150, 100])
COL_PRIV, COL_CHAN, COL_SRC_TITLE, COL_SRC_ID,
COL_SRC_AUTH, COL_SRC_ABBR, COL_SRC_PINFO,
COL_SRC_PRIV, COL_SRC_CHAN]),
('columns.size', [200, 75, 100, 100, 50, 100, 200, 75, 75, 100, 150,
50, 100])
)
ADD_MSG = _("Add a new citation and a new source")
ADD_SOURCE_MSG = _("Add a new source")
@ -142,7 +149,8 @@ class CitationListView(ListView):
CitationBookmarks, nav_group,
multiple=True,
filter_class=CitationSidebarFilter,
markup = CitationListView.MARKUP_COLS)
markup = CitationListView.MARKUP_COLS,
pixbuf = CitationListView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -78,21 +78,23 @@ class CitationTreeView(ListView):
A hierarchical view of sources with citations below them.
"""
# The data items here have to correspond, in order, to the items in
# src/giu.views/treemodels/citationtreemodel.py
# src/giu/views/treemodels/citationtreemodel.py
COL_TITLE_PAGE = 0
COL_ID = 1
COL_DATE = 2
COL_CONFIDENCE = 3
COL_CHAN = 4
COL_SRC_AUTH = 5
COL_SRC_ABBR = 6
COL_SRC_PINFO = 7
COL_PRIV = 4
COL_CHAN = 5
COL_SRC_AUTH = 6
COL_SRC_ABBR = 7
COL_SRC_PINFO = 8
# name of the columns
COLUMN_NAMES = [
_('Title or Page'),
_('ID'),
_('Date'),
_('Confidence'),
_('Private'),
_('Last Changed'),
_('Source: Author'),
_('Source: Abbreviation'),
@ -108,14 +110,15 @@ class CitationTreeView(ListView):
]
# columns that contain markup
MARKUP_COLS = [COL_DATE]
PIXBUF_COLS = [COL_PRIV]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE_PAGE, COL_ID, COL_SRC_AUTH,
COL_SRC_PINFO]),
('columns.rank', [COL_TITLE_PAGE, COL_ID, COL_DATE, COL_CONFIDENCE,
COL_CHAN, COL_SRC_AUTH,
COL_PRIV, COL_CHAN, COL_SRC_AUTH,
COL_SRC_ABBR, COL_SRC_PINFO]),
('columns.size', [200, 75, 100, 75, 100, 150, 100, 150])
('columns.size', [200, 75, 100, 75, 50, 100, 150, 100, 150])
)
ADD_MSG = _("Add a new citation and a new source")
ADD_SOURCE_MSG = _("Add a new source")
@ -147,7 +150,8 @@ class CitationTreeView(ListView):
CitationBookmarks, nav_group,
multiple=True,
filter_class=SourceSidebarFilter,
markup = CitationTreeView.MARKUP_COLS)
markup = CitationTreeView.MARKUP_COLS,
pixbuf = CitationTreeView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -74,8 +74,9 @@ class EventView(ListView):
COL_TYPE = 2
COL_DATE = 3
COL_PLACE = 4
COL_CHAN = 5
COL_PARTIC = 6
COL_PRIV = 5
COL_CHAN = 6
COL_PARTIC = 7
# name of the columns
COLUMN_NAMES = [
_('Description'),
@ -83,17 +84,19 @@ class EventView(ListView):
_('Type'),
_('Date'),
_('Place'),
_('Private'),
_('Last Changed'),
_('Main Participants'),
]
# columns that contain markup
MARKUP_COLS = [COL_DATE]
PIXBUF_COLS = [COL_PRIV]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_DESCR, COL_ID, COL_TYPE, COL_DATE, COL_PLACE]),
('columns.rank', [COL_DESCR, COL_ID, COL_TYPE, COL_PARTIC, COL_DATE,
COL_PLACE, COL_CHAN]),
('columns.size', [200, 75, 100, 230, 150, 200, 100])
COL_PLACE, COL_PRIV, COL_CHAN]),
('columns.size', [200, 75, 100, 230, 150, 200, 50, 100])
)
ADD_MSG = _("Add a new event")
EDIT_MSG = _("Edit the selected event")
@ -121,7 +124,8 @@ class EventView(ListView):
EventBookmarks, nav_group,
multiple=True,
filter_class=EventSidebarFilter,
markup = EventView.MARKUP_COLS)
markup = EventView.MARKUP_COLS,
pixbuf = EventView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -72,16 +72,19 @@ class FamilyView(ListView):
COL_MOTHER = 2
COL_REL = 3
COL_MARDATE = 4
COL_TAGS = 5
COL_CHAN = 6
COL_PRIV = 5
COL_TAGS = 6
COL_CHAN = 7
# name of the columns
MARKUP_COLS = [COL_MARDATE]
PIXBUF_COLS = [COL_PRIV]
COLUMN_NAMES = [
_('ID'),
_('Father'),
_('Mother'),
_('Relationship'),
_('Marriage Date'),
_('Private'),
_('Tags'),
_('Last Changed'),
]
@ -90,8 +93,8 @@ class FamilyView(ListView):
('columns.visible', [COL_ID, COL_FATHER, COL_MOTHER, COL_REL,
COL_MARDATE]),
('columns.rank', [COL_ID, COL_FATHER, COL_MOTHER, COL_REL,
COL_MARDATE, COL_TAGS, COL_CHAN]),
('columns.size', [75, 200, 200, 100, 100, 100, 100])
COL_MARDATE, COL_PRIV, COL_TAGS, COL_CHAN]),
('columns.size', [75, 200, 200, 100, 100, 50, 100, 100])
)
ADD_MSG = _("Add a new family")
@ -119,7 +122,8 @@ class FamilyView(ListView):
FamilyBookmarks, nav_group,
multiple=True,
filter_class=FamilySidebarFilter,
markup=FamilyView.MARKUP_COLS)
markup=FamilyView.MARKUP_COLS,
pixbuf=FamilyView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -94,8 +94,12 @@ class MediaView(ListView):
COL_TYPE = 2
COL_PATH = 3
COL_DATE = 4
COL_TAGS = 5
COL_CHAN = 6
COL_PRIV = 5
COL_TAGS = 6
COL_CHAN = 7
PIXBUF_COLS = [COL_PRIV]
#name of the columns
COLUMN_NAMES = [
_('Title'),
@ -103,6 +107,7 @@ class MediaView(ListView):
_('Type'),
_('Path'),
_('Date'),
_('Private'),
_('Tags'),
_('Last Changed'),
]
@ -111,8 +116,8 @@ class MediaView(ListView):
('columns.visible', [COL_TITLE, COL_ID, COL_TYPE, COL_PATH,
COL_DATE]),
('columns.rank', [COL_TITLE, COL_ID, COL_TYPE, COL_PATH,
COL_DATE, COL_TAGS, COL_CHAN]),
('columns.size', [200, 75, 100, 200, 150, 100, 150])
COL_DATE, COL_PRIV, COL_TAGS, COL_CHAN]),
('columns.size', [200, 75, 100, 200, 150, 50, 100, 150])
)
ADD_MSG = _("Add a new media object")
@ -139,7 +144,8 @@ class MediaView(ListView):
signal_map, dbstate.db.get_media_bookmarks(),
MediaBookmarks, nav_group,
filter_class=MediaSidebarFilter,
multiple=True)
multiple=True,
pixbuf=MediaView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -71,21 +71,26 @@ class NoteView(ListView):
COL_PREVIEW = 0
COL_ID = 1
COL_TYPE = 2
COL_TAGS = 3
COL_CHAN = 4
COL_PRIV = 3
COL_TAGS = 4
COL_CHAN = 5
PIXBUF_COLS = [COL_PRIV]
COLUMN_NAMES = [
_('Preview'),
_('ID'),
_('Type'),
_('Private'),
_('Tags'),
_('Last Changed')
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_PREVIEW, COL_ID, COL_TYPE]),
('columns.rank', [COL_PREVIEW, COL_ID, COL_TYPE, COL_TAGS, COL_CHAN]),
('columns.size', [350, 75, 100, 100, 100]))
('columns.rank', [COL_PREVIEW, COL_ID, COL_TYPE, COL_PRIV, COL_TAGS,
COL_CHAN]),
('columns.size', [350, 75, 100, 50, 100, 100]))
ADD_MSG = _("Add a new note")
EDIT_MSG = _("Edit the selected note")
@ -110,7 +115,8 @@ class NoteView(ListView):
dbstate.db.get_note_bookmarks(),
NoteBookmarks, nav_group,
filter_class=NoteSidebarFilter,
multiple=True)
multiple=True,
pixbuf=NoteView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -65,8 +65,9 @@ class PlaceTreeView(PlaceBaseView):
COL_PARISH = 9
COL_LAT = 10
COL_LON = 11
COL_CHAN = 12
COL_NAME = 13
COL_PRIV = 12
COL_CHAN = 13
COL_NAME = 14
# name of the columns
COLUMN_NAMES = [
_('Place'),
@ -81,6 +82,7 @@ class PlaceTreeView(PlaceBaseView):
_('Church Parish'),
_('Latitude'),
_('Longitude'),
_('Private'),
_('Last Changed'),
_('Place Name'),
]
@ -90,15 +92,16 @@ class PlaceTreeView(PlaceBaseView):
COL_CITY, COL_COUNTY, COL_STATE]),
('columns.rank', [COL_PLACE, COL_ID, COL_STREET, COL_LOCALITY, COL_CITY,
COL_COUNTY, COL_STATE, COL_COUNTRY, COL_ZIP,
COL_PARISH, COL_LAT, COL_LON, COL_CHAN, COL_NAME]),
COL_PARISH, COL_LAT, COL_LON, COL_PRIV, COL_CHAN,
COL_NAME]),
('columns.size', [250, 75, 150, 150, 150, 150, 100, 100, 100,
100, 150, 150, 100, 150])
100, 150, 150, 50, 100, 150])
)
def __init__(self, pdata, dbstate, uistate):
PlaceBaseView.__init__(self, pdata, dbstate, uistate,
_('Place Tree View'), PlaceTreeModel,
nav_group=0, markup=PlaceBaseView.MARKUP_COLS)
nav_group=0)
def type_list(self):
"""

View File

@ -77,7 +77,10 @@ class RepositoryView(ListView):
COL_ZIP = 9
COL_EMAIL = 10
COL_SURL = 11
COL_CHAN = 12
COL_PRIV = 12
COL_CHAN = 13
PIXBUF_COLS = [COL_PRIV]
COLUMN_NAMES = [
_('Name'),
@ -92,6 +95,7 @@ class RepositoryView(ListView):
_('ZIP/Postal Code'),
_('Email'),
_('Search URL'),
_('Private'),
_('Last Changed'),
]
# default setting with visible columns, order of the col, and their size
@ -100,9 +104,9 @@ class RepositoryView(ListView):
]),
('columns.rank', [COL_NAME, COL_ID, COL_TYPE, COL_URL, COL_STREET,
COL_LOCALITY, COL_CITY, COL_STATE, COL_COUNTRY,
COL_ZIP, COL_EMAIL, COL_SURL, COL_CHAN]),
COL_ZIP, COL_EMAIL, COL_SURL, COL_PRIV, COL_CHAN]),
('columns.size', [200, 75, 100, 250, 100, 100, 100, 100, 100,
100, 100, 100, 100])
100, 100, 100, 50, 100])
)
ADD_MSG = _("Add a new repository")
EDIT_MSG = _("Edit the selected repository")
@ -127,7 +131,8 @@ class RepositoryView(ListView):
dbstate.db.get_repo_bookmarks(),
RepoBookmarks, nav_group,
multiple=True,
filter_class=RepoSidebarFilter)
filter_class=RepoSidebarFilter,
pixbuf=RepositoryView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,

View File

@ -74,7 +74,11 @@ class SourceView(ListView):
COL_AUTH = 2
COL_ABBR = 3
COL_PINFO = 4
COL_CHAN = 5
COL_PRIV = 5
COL_CHAN = 6
PIXBUF_COLS = [COL_PRIV]
# name of the columns
COLUMN_NAMES = [
_('Title'),
@ -82,14 +86,15 @@ class SourceView(ListView):
_('Author'),
_('Abbreviation'),
_('Publication Information'),
_('Private'),
_('Last Changed'),
]
# default setting with visible columns, order of the col, and their size
CONFIGSETTINGS = (
('columns.visible', [COL_TITLE, COL_ID, COL_AUTH, COL_PINFO]),
('columns.rank', [COL_TITLE, COL_ID, COL_AUTH, COL_ABBR, COL_PINFO,
COL_CHAN]),
('columns.size', [200, 75, 150, 100, 150, 100])
COL_PRIV, COL_CHAN]),
('columns.size', [200, 75, 150, 100, 150, 50, 100])
)
ADD_MSG = _("Add a new source")
EDIT_MSG = _("Edit the selected source")
@ -114,7 +119,8 @@ class SourceView(ListView):
dbstate.db.get_source_bookmarks(),
SourceBookmarks, nav_group,
multiple=True,
filter_class=SourceSidebarFilter)
filter_class=SourceSidebarFilter,
pixbuf=SourceView.PIXBUF_COLS)
self.func_list.update({
'<PRIMARY>J' : self.jump,