From 33fedc18d499930fecab1428dec51937842dc970 Mon Sep 17 00:00:00 2001 From: Zsolt Foldvari Date: Wed, 28 Mar 2007 14:00:03 +0000 Subject: [PATCH] 2007-03-28 Zsolt Foldvari * src/DataViews/_NoteView.py: put back column editor support. * src/GrampsDb/_GrampsDbBase.py (get_note_column_order): fix default values. * src/DisplayModels/_NoteModel.py: include marker column. svn: r8333 --- ChangeLog | 6 ++++++ src/DataViews/_NoteView.py | 24 ++++++++++++------------ src/DisplayModels/_NoteModel.py | 7 +++++++ src/GrampsDb/_GrampsDbBase.py | 4 +--- 4 files changed, 26 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4e49e5405..c9b484db5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-28 Zsolt Foldvari + * src/DataViews/_NoteView.py: put back column editor support. + * src/GrampsDb/_GrampsDbBase.py (get_note_column_order): fix default + values. + * src/DisplayModels/_NoteModel.py: include marker column. + 2007-03-27 Don Allingham * src/ViewManager.py: pass dbstate to DbManager * src/DbManager.py: add icon, prevent deletion of open db, make buttons diff --git a/src/DataViews/_NoteView.py b/src/DataViews/_NoteView.py index f9ac018ed..83ca87710 100644 --- a/src/DataViews/_NoteView.py +++ b/src/DataViews/_NoteView.py @@ -59,6 +59,7 @@ from gettext import gettext as _ column_names = [ _('ID'), _('Type'), + _('Marker'), _('Preview'), ] @@ -104,28 +105,27 @@ class NoteView(PageView.ListView): def define_actions(self): PageView.ListView.define_actions(self) -# self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, -# _('_Column Editor'), callback=self.column_editor) + self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, + _('_Column Editor'), callback=self.column_editor) self.add_action('FilterEdit', None, _('Note Filter Editor'), callback=self.filter_editor,) def column_editor(self, obj): - pass -# import ColumnOrder + import ColumnOrder -# ColumnOrder.ColumnOrder( -# _('Select Place Columns'), -# self.uistate, -# self.dbstate.db.get_place_column_order(), -# column_names, -# self.set_column_order) + ColumnOrder.ColumnOrder( + _('Select Note Columns'), + self.uistate, + self.dbstate.db.get_note_column_order(), + column_names, + self.set_column_order) def set_column_order(self, clist): - #self.dbstate.db.set_place_column_order(clist) + self.dbstate.db.set_note_column_order(clist) self.build_columns() def column_order(self): - return [(1, 0, 100), (1, 1, 100), (1, 2, 100)] + return self.dbstate.db.get_note_column_order() def get_stock(self): return 'gramps-notes' diff --git a/src/DisplayModels/_NoteModel.py b/src/DisplayModels/_NoteModel.py index c04027f56..c3fc971d9 100644 --- a/src/DisplayModels/_NoteModel.py +++ b/src/DisplayModels/_NoteModel.py @@ -63,12 +63,14 @@ class NoteModel(BaseModel): self.fmap = [ self.column_id, self.column_type, + self.column_marker, self.column_preview, self.column_handle, ] self.smap = [ self.column_id, self.column_type, + self.column_marker, self.column_preview, self.column_handle, ] @@ -89,6 +91,11 @@ class NoteModel(BaseModel): temp.set(data[4]) return unicode(str(temp)) + def column_marker(self, data): + temp = RelLib.MarkerType() + temp.set(data[6]) + return unicode(str(temp)) + def column_preview(self,data): note = " ".join(data[2].split()) note = re.sub(r'(<.*?>)', '', note) diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 5d28f1815..b6f230606 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -2279,9 +2279,7 @@ class GrampsDbBase(GrampsDBCallback): Returns the Note display common information stored in the database's metadata. """ - # FIXME: These are copied from Event, must be changed - default = [(1, 0, 200), (1, 1, 75), (1, 2, 100), (1, 3, 150), - (1, 4, 200), (0, 5, 100)] + default = [(1, 0, 100), (1, 1, 100), (0, 2, 100), (1, 3, 100)] return self._get_columns(NOTE_COL_KEY, default) def _delete_primary_from_reference_map(self, handle, transaction):