From f5e8ab5fe2397b7d9d52938ac73c19f3e4a82733 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Thu, 12 Nov 2009 21:53:47 +0000 Subject: [PATCH] 3347: /src/Selectors/_SelectPlace.py is still looking for DataViews svn: r13561 --- src/ListModel.py | 2 +- src/Selectors/_BaseSelector.py | 15 +++------------ src/Selectors/_SelectEvent.py | 7 ------- src/Selectors/_SelectFamily.py | 7 ------- src/Selectors/_SelectNote.py | 7 ------- src/Selectors/_SelectObject.py | 7 ------- src/Selectors/_SelectPerson.py | 17 ----------------- src/Selectors/_SelectPlace.py | 7 ------- src/Selectors/_SelectRepository.py | 7 ------- src/Selectors/_SelectSource.py | 7 ------- 10 files changed, 4 insertions(+), 79 deletions(-) diff --git a/src/ListModel.py b/src/ListModel.py index 9686d12a3..084750f9e 100644 --- a/src/ListModel.py +++ b/src/ListModel.py @@ -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, diff --git a/src/Selectors/_BaseSelector.py b/src/Selectors/_BaseSelector.py index 09be75e16..5e836d89a 100644 --- a/src/Selectors/_BaseSelector.py +++ b/src/Selectors/_BaseSelector.py @@ -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): diff --git a/src/Selectors/_SelectEvent.py b/src/Selectors/_SelectEvent.py index 9fde6a9de..43c5d0827 100644 --- a/src/Selectors/_SelectEvent.py +++ b/src/Selectors/_SelectEvent.py @@ -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 diff --git a/src/Selectors/_SelectFamily.py b/src/Selectors/_SelectFamily.py index 67c4b51ce..3926a2c7a 100644 --- a/src/Selectors/_SelectFamily.py +++ b/src/Selectors/_SelectFamily.py @@ -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 diff --git a/src/Selectors/_SelectNote.py b/src/Selectors/_SelectNote.py index 6d663b0c7..7228eec55 100644 --- a/src/Selectors/_SelectNote.py +++ b/src/Selectors/_SelectNote.py @@ -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 diff --git a/src/Selectors/_SelectObject.py b/src/Selectors/_SelectObject.py index 5339f706b..ba5389a79 100644 --- a/src/Selectors/_SelectObject.py +++ b/src/Selectors/_SelectObject.py @@ -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 diff --git a/src/Selectors/_SelectPerson.py b/src/Selectors/_SelectPerson.py index 21facef3c..670361685 100644 --- a/src/Selectors/_SelectPerson.py +++ b/src/Selectors/_SelectPerson.py @@ -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 diff --git a/src/Selectors/_SelectPlace.py b/src/Selectors/_SelectPlace.py index b3c39f390..1b4a04e3e 100644 --- a/src/Selectors/_SelectPlace.py +++ b/src/Selectors/_SelectPlace.py @@ -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 diff --git a/src/Selectors/_SelectRepository.py b/src/Selectors/_SelectRepository.py index 07ff3af8e..92be30e82 100644 --- a/src/Selectors/_SelectRepository.py +++ b/src/Selectors/_SelectRepository.py @@ -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 diff --git a/src/Selectors/_SelectSource.py b/src/Selectors/_SelectSource.py index 936892309..8983c2825 100644 --- a/src/Selectors/_SelectSource.py +++ b/src/Selectors/_SelectSource.py @@ -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