From ddb68c939866b55aa7cf9ddb84465030bb9075bb Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Sun, 8 Jul 2007 03:27:06 +0000 Subject: [PATCH] 2007-07-07 Don Allingham * src/PageView.py (ListView.column_clicked): set the search column for list views to be the sort column * src/DataViews/_EventView.py: add docs * src/DataViews/_FamilyList.py: add docs * src/DataViews/_NoteView.py: remove unused double_click * src/GrampsDb/_GrampsDbBase.py: fix __ on functions * src/ColumnOrder.py: fix __ on functions svn: r8705 --- ChangeLog | 9 +++++ NEWS | 10 +++++ configure.in | 2 +- src/ColumnOrder.py | 4 +- src/DataViews/_EventView.py | 3 ++ src/DataViews/_FamilyList.py | 65 +++++++++++++----------------- src/DataViews/_NoteView.py | 76 ++++++++++++++++++++--------------- src/GrampsDb/_GrampsDbBase.py | 18 ++++----- src/PageView.py | 15 ++++--- 9 files changed, 115 insertions(+), 87 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8f19ad12..cf3fa2e6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-07-07 Don Allingham + * src/PageView.py (ListView.column_clicked): set the search column for list + views to be the sort column + * src/DataViews/_EventView.py: add docs + * src/DataViews/_FamilyList.py: add docs + * src/DataViews/_NoteView.py: remove unused double_click + * src/GrampsDb/_GrampsDbBase.py: fix __ on functions + * src/ColumnOrder.py: fix __ on functions + 2007-07-07 Zsolt Foldvari * src/Editors/_EditNote.py: Follow hyperlinks (updated). diff --git a/NEWS b/NEWS index 59a34da87..82ba07bb2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,13 @@ +Version 3.0.0 -- the "" release +* Rewrite of the GEDCOM parser +* Export views to a spreadsheet +* Formatted notes +* Multiple notes +* LDS temple definitions moved to supporting file +* New database format, using hidden directory, old grdb format deprecated +* New database manager, allowing create, deletion, renaming, repair and revison + control + Version 2.2.6 -- the "Summarize Proust Competition" release * Fix report option saving diff --git a/configure.in b/configure.in index 3870900bb..2bcd6edcc 100644 --- a/configure.in +++ b/configure.in @@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script. dnl May need to run automake && aclocal first AC_PREREQ(2.57) -AC_INIT(gramps, 2.3.0, [gramps-bugs@lists.sourceforge.net]) +AC_INIT(gramps, 2.3.91, [gramps-bugs@lists.sourceforge.net]) AC_CONFIG_SRCDIR(configure.in) AM_INIT_AUTOMAKE(1.6.3) diff --git a/src/ColumnOrder.py b/src/ColumnOrder.py index 3b06577e4..a3b92894d 100644 --- a/src/ColumnOrder.py +++ b/src/ColumnOrder.py @@ -77,7 +77,7 @@ class ColumnOrder(ManagedWindow.ManagedWindow): self.tree.set_model(self.model) checkbox = gtk.CellRendererToggle() - checkbox.connect('toggled', __toggled, self.model) + checkbox.connect('toggled', toggled, self.model) renderer = gtk.CellRendererText() column_n = gtk.TreeViewColumn(_('Display'), checkbox, active=0) @@ -128,7 +128,7 @@ class ColumnOrder(ManagedWindow.ManagedWindow): """ self.close() -def __toggled(cell, path, model): +def toggled(cell, path, model): """ Called when the cell information is changed, updating the data model so the that change occurs. diff --git a/src/DataViews/_EventView.py b/src/DataViews/_EventView.py index 2846048be..21917c45e 100644 --- a/src/DataViews/_EventView.py +++ b/src/DataViews/_EventView.py @@ -178,6 +178,9 @@ class EventView(PageView.ListView): return None def column_editor(self, obj): + """ + returns a tuple indicating the column order + """ import ColumnOrder ColumnOrder.ColumnOrder( diff --git a/src/DataViews/_FamilyList.py b/src/DataViews/_FamilyList.py index 3172efdef..1a94bda52 100644 --- a/src/DataViews/_FamilyList.py +++ b/src/DataViews/_FamilyList.py @@ -88,39 +88,9 @@ class FamilyListView(PageView.ListView): signal_map, dbstate.db.get_family_bookmarks(), Bookmarks.FamilyBookmarks, filter_class=FamilySidebarFilter) - self.updating = False - Config.client.notify_add("/apps/gramps/interface/filter", self.filter_toggle) - def define_actions(self): - """ - add the Forward action group to handle the Forward button - """ - - PageView.ListView.define_actions(self) - self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, - _('_Column Editor'), callback=self.column_editor) - - self.add_action('FilterEdit', None, _('Family Filter Editor'), - callback=self.filter_editor,) - - def add_bookmark(self, obj): - mlist = [] - self.selection.selected_foreach(self.blist, mlist) - - if mlist: - self.bookmarks.add(mlist[0]) - else: - from QuestionDialog import WarningDialog - WarningDialog( - _("Could Not Set a Bookmark"), - _("A bookmark could not be set because " - "no one was selected.")) - - def get_bookmarks(self): - return self.dbstate.db.get_family_bookmarks() - def column_order(self): return self.dbstate.db.get_family_list_column_order() @@ -179,6 +149,34 @@ class FamilyListView(PageView.ListView): ''' + def define_actions(self): + """ + add the Forward action group to handle the Forward button + """ + + PageView.ListView.define_actions(self) + self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES, + _('_Column Editor'), callback=self.column_editor) + + self.add_action('FilterEdit', None, _('Family Filter Editor'), + callback=self.filter_editor,) + + def get_bookmarks(self): + return self.dbstate.db.get_family_bookmarks() + + def add_bookmark(self, obj): + mlist = [] + self.selection.selected_foreach(self.blist, mlist) + + if mlist: + self.bookmarks.add(mlist[0]) + else: + from QuestionDialog import WarningDialog + WarningDialog( + _("Could Not Set a Bookmark"), + _("A bookmark could not be set because " + "no one was selected.")) + def add(self, obj): from Editors import EditFamily family = RelLib.Family() @@ -210,10 +208,3 @@ class FamilyListView(PageView.ListView): EditFamily(self.dbstate, self.uistate, [], family) except Errors.WindowActiveError: pass - - def get_handle_from_gramps_id(self, gid): - obj = self.dbstate.db.get_family_from_gramps_id(gid) - if obj: - return obj.get_handle() - else: - return None diff --git a/src/DataViews/_NoteView.py b/src/DataViews/_NoteView.py index 9917b58ca..5b632d435 100644 --- a/src/DataViews/_NoteView.py +++ b/src/DataViews/_NoteView.py @@ -103,37 +103,33 @@ class NoteView(PageView.ListView): self.filter_toggle) def get_bookmarks(self): + """ + Returns the bookmark object + """ return self.dbstate.db.get_note_bookmarks() - 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('FilterEdit', None, _('Note Filter Editor'), - callback=self.filter_editor,) - def drag_info(self): + """ + Indicates that the drag type is an EVENT + """ return DdTargets.NOTE_LINK - def column_editor(self, obj): - 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_note_column_order(clist) - self.build_columns() - def column_order(self): + """ + returns a tuple indicating the column order + """ return self.dbstate.db.get_note_column_order() def get_stock(self): + """ + Use the gramps-event stock icon + """ return 'gramps-notes' def ui_definition(self): + """ + Defines the UI string for UIManager + """ return ''' @@ -166,13 +162,34 @@ class NoteView(PageView.ListView): ''' - def on_double_click(self, obj, event): - handle = self.first_selected() - note = Note() - try: - EditNote(self.dbstate, self.uistate, [], note) - except Errors.WindowActiveError: - pass + 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('FilterEdit', None, _('Note Filter Editor'), + callback=self.filter_editor,) + + def get_handle_from_gramps_id(self, gid): + obj = self.dbstate.db.get_note_from_gramps_id(gid) + if obj: + return obj.get_handle() + else: + return None + + def column_editor(self, obj): + """ + returns a tuple indicating the 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_note_column_order(clist) + self.build_columns() def add(self, obj): try: @@ -213,10 +230,3 @@ class NoteView(PageView.ListView): EditNote(self.dbstate, self.uistate, [], note) except Errors.WindowActiveError: pass - - def get_handle_from_gramps_id(self, gid): - obj = self.dbstate.db.get_note_from_gramps_id(gid) - if obj: - return obj.get_handle() - else: - return None diff --git a/src/GrampsDb/_GrampsDbBase.py b/src/GrampsDb/_GrampsDbBase.py index 3f96c7ec7..77ad23072 100644 --- a/src/GrampsDb/_GrampsDbBase.py +++ b/src/GrampsDb/_GrampsDbBase.py @@ -2063,63 +2063,63 @@ class GrampsDbBase(GrampsDBCallback): Stores the Person display common information in the database's metadata. """ - self.__set_column_order(col_list, PERSON_COL_KEY) + self.set_column_order(col_list, PERSON_COL_KEY) def set_family_list_column_order(self, col_list): """ Stores the Person display common information in the database's metadata. """ - self.__set_column_order(col_list, FAMILY_COL_KEY) + self.set_column_order(col_list, FAMILY_COL_KEY) def set_child_column_order(self, col_list): """ Stores the Person display common information in the database's metadata. """ - self.__set_column_order(col_list, CHILD_COL_KEY) + self.set_column_order(col_list, CHILD_COL_KEY) def set_place_column_order(self, col_list): """ Stores the Place display common information in the database's metadata. """ - self.__set_column_order(col_list, PLACE_COL_KEY) + self.set_column_order(col_list, PLACE_COL_KEY) def set_source_column_order(self, col_list): """ Stores the Source display common information in the database's metadata. """ - self.__set_column_order(col_list, SOURCE_COL_KEY) + self.set_column_order(col_list, SOURCE_COL_KEY) def set_media_column_order(self, col_list): """ Stores the Media display common information in the database's metadata. """ - self.__set_column_order(col_list, MEDIA_COL_KEY) + self.set_column_order(col_list, MEDIA_COL_KEY) def set_event_column_order(self, col_list): """ Stores the Event display common information in the database's metadata. """ - self.__set_column_order(col_list, EVENT_COL_KEY) + self.set_column_order(col_list, EVENT_COL_KEY) def set_repository_column_order(self, col_list): """ Stores the Repository display common information in the database's metadata. """ - self.__set_column_order(col_list, REPOSITORY_COL_KEY) + self.set_column_order(col_list, REPOSITORY_COL_KEY) def set_note_column_order(self, col_list): """ Stores the Note display common information in the database's metadata. """ - self.__set_column_order(col_list, NOTE_COL_KEY) + self.set_column_order(col_list, NOTE_COL_KEY) def __get_column_order(self, name, default): if self.metadata == None: diff --git a/src/PageView.py b/src/PageView.py index 2b24300df..1eff6786f 100644 --- a/src/PageView.py +++ b/src/PageView.py @@ -549,9 +549,10 @@ class ListView(BookMarkView): def drag_info(self): return None - def drag_begin(self, widget, *data): + def drag_begin(self, widget, context): widget.drag_source_set_icon_stock(self.get_stock()) - + return True + def column_order(self): assert False @@ -629,6 +630,7 @@ class ListView(BookMarkView): if selected_ids: data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) + return True def setup_filter(self): """ @@ -659,7 +661,7 @@ class ListView(BookMarkView): # disable the inactive flag self.inactive = False - def column_clicked(self,obj,data): + def column_clicked(self, obj, data): if self.sort_col != data: order = gtk.SORT_ASCENDING else: @@ -687,11 +689,15 @@ class ListView(BookMarkView): if handle: path = self.model.on_get_path(handle) self.selection.select_path(path) - self.list.scroll_to_cell(path,None,1,0.5,0) + self.list.scroll_to_cell(path, None, 1, 0.5, 0) for i in xrange(len(self.columns)): enable_sort_flag = (i==self.sort_col) self.columns[i].set_sort_indicator(enable_sort_flag) self.columns[self.sort_col].set_sort_order(order) + + # set the search column to be the sorted column + search_col = self.column_order()[data][1] + self.list.set_search_column(search_col) def build_columns(self): for column in self.columns: @@ -730,7 +736,6 @@ class ListView(BookMarkView): self.model = self.make_model(self.dbstate.db,self.sort_col, search=filter_info) self.list.set_model(self.model) - self.selection = self.list.get_selection() if const.use_tips and self.model.tooltip_column != None: self.tooltips = TreeTips.TreeTips(