3347: /src/Selectors/_SelectPlace.py is still looking for DataViews
svn: r13561
This commit is contained in:
parent
572836fb45
commit
f5e8ab5fe2
@ -51,7 +51,7 @@ NOSORT = -1
|
||||
#-------------------------------------------------------------------------
|
||||
class ListModel(object):
|
||||
"""
|
||||
Simple model for lists in smaller dialogs (not DataViews).
|
||||
Simple model for lists in smaller dialogs (not views).
|
||||
"""
|
||||
|
||||
def __init__(self, tree, dlist, select_func=None, event_func=None,
|
||||
|
@ -85,8 +85,7 @@ class BaseSelector(ManagedWindow.ManagedWindow):
|
||||
self.tree.set_headers_clickable(True)
|
||||
self.tree.connect('row-activated', self._on_row_activated)
|
||||
self.tree.grab_focus()
|
||||
|
||||
self.colinfo = self.column_view_names()
|
||||
|
||||
#add the search bar
|
||||
self.search_bar = SearchBar(dbstate, uistate, self.build_tree)
|
||||
filter_box = self.search_bar.build()
|
||||
@ -220,16 +219,8 @@ class BaseSelector(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
returns a tuple indicating the column order of the model
|
||||
"""
|
||||
return [(1, row[3], row[1]) for row in self.get_column_titles()]
|
||||
return [(1, row[3], row[1], row[0]) for row in self.get_column_titles()]
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
|
||||
Derived classes must override this function.
|
||||
"""
|
||||
raise NotImplementedError
|
||||
|
||||
def exact_search(self):
|
||||
"""
|
||||
Returns a tuple indicating columns requiring an exact search
|
||||
@ -242,7 +233,7 @@ class BaseSelector(ManagedWindow.ManagedWindow):
|
||||
"""
|
||||
cols = []
|
||||
for pair in [pair for pair in self.column_order() if pair[0]]:
|
||||
cols.append((self.colinfo[pair[1]], pair[1]))
|
||||
cols.append((pair[3], pair[1]))
|
||||
self.search_bar.setup_filter(cols)
|
||||
|
||||
def build_tree(self):
|
||||
|
@ -72,10 +72,3 @@ class SelectEvent(BaseSelector):
|
||||
|
||||
def get_handle_column(self):
|
||||
return 7
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.EventView.COLUMN_NAMES
|
||||
|
@ -69,10 +69,3 @@ class SelectFamily(BaseSelector):
|
||||
|
||||
def get_handle_column(self):
|
||||
return 6
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.FamilyListView.COLUMN_NAMES
|
||||
|
@ -75,10 +75,3 @@ class SelectNote(BaseSelector):
|
||||
|
||||
def get_handle_column(self):
|
||||
return 4
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.NoteView.COLUMN_NAMES
|
||||
|
@ -102,10 +102,3 @@ class SelectObject(BaseSelector):
|
||||
obj.get_path()))
|
||||
self.preview.set_from_pixbuf(pix)
|
||||
gc.collect()
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.MediaView.COLUMN_NAMES
|
||||
|
@ -90,23 +90,6 @@ class SelectPerson(BaseSelector):
|
||||
def get_handle_column(self):
|
||||
return PeopleModel.COLUMN_INT_ID
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
column_names = [
|
||||
_('Name'),
|
||||
_('ID') ,
|
||||
_('Gender'),
|
||||
_('Birth Date'),
|
||||
_('Birth Place'),
|
||||
_('Death Date'),
|
||||
_('Death Place'),
|
||||
_('Spouse'),
|
||||
_('Last Change'),
|
||||
]
|
||||
return column_names
|
||||
|
||||
def exact_search(self):
|
||||
"""
|
||||
Returns a tuple indicating columns requiring an exact search
|
||||
|
@ -68,10 +68,3 @@ class SelectPlace(BaseSelector):
|
||||
|
||||
def get_handle_column(self):
|
||||
return PlaceModel.HANDLE_COL
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.PlaceView.COLUMN_NAMES
|
||||
|
@ -68,10 +68,3 @@ class SelectRepository(BaseSelector):
|
||||
|
||||
def get_from_handle_func(self):
|
||||
return self.db.get_repository_from_handle
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.RepositoryView.COLUMN_NAMES
|
||||
|
@ -68,10 +68,3 @@ class SelectSource(BaseSelector):
|
||||
|
||||
def get_handle_column(self):
|
||||
return 6
|
||||
|
||||
def column_view_names(self):
|
||||
"""
|
||||
Get correct column view names on which model is based
|
||||
"""
|
||||
import DataViews
|
||||
return DataViews.SourceView.COLUMN_NAMES
|
||||
|
Loading…
Reference in New Issue
Block a user