2007-07-07 Don Allingham <don@gramps-project.org>

* 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
This commit is contained in:
Don Allingham 2007-07-08 03:27:06 +00:00
parent db1836bd3f
commit ddb68c9398
9 changed files with 115 additions and 87 deletions

View File

@ -1,3 +1,12 @@
2007-07-07 Don Allingham <don@gramps-project.org>
* 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 <zfoldvar@users.sourceforge.net> 2007-07-07 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
* src/Editors/_EditNote.py: Follow hyperlinks (updated). * src/Editors/_EditNote.py: Follow hyperlinks (updated).

10
NEWS
View File

@ -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 Version 2.2.6 -- the "Summarize Proust Competition" release
* Fix report option saving * Fix report option saving

View File

@ -4,7 +4,7 @@ dnl Process this file with autoconf to produce a configure script.
dnl May need to run automake && aclocal first dnl May need to run automake && aclocal first
AC_PREREQ(2.57) 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) AC_CONFIG_SRCDIR(configure.in)
AM_INIT_AUTOMAKE(1.6.3) AM_INIT_AUTOMAKE(1.6.3)

View File

@ -77,7 +77,7 @@ class ColumnOrder(ManagedWindow.ManagedWindow):
self.tree.set_model(self.model) self.tree.set_model(self.model)
checkbox = gtk.CellRendererToggle() checkbox = gtk.CellRendererToggle()
checkbox.connect('toggled', __toggled, self.model) checkbox.connect('toggled', toggled, self.model)
renderer = gtk.CellRendererText() renderer = gtk.CellRendererText()
column_n = gtk.TreeViewColumn(_('Display'), checkbox, active=0) column_n = gtk.TreeViewColumn(_('Display'), checkbox, active=0)
@ -128,7 +128,7 @@ class ColumnOrder(ManagedWindow.ManagedWindow):
""" """
self.close() self.close()
def __toggled(cell, path, model): def toggled(cell, path, model):
""" """
Called when the cell information is changed, updating the Called when the cell information is changed, updating the
data model so the that change occurs. data model so the that change occurs.

View File

@ -178,6 +178,9 @@ class EventView(PageView.ListView):
return None return None
def column_editor(self, obj): def column_editor(self, obj):
"""
returns a tuple indicating the column order
"""
import ColumnOrder import ColumnOrder
ColumnOrder.ColumnOrder( ColumnOrder.ColumnOrder(

View File

@ -88,39 +88,9 @@ class FamilyListView(PageView.ListView):
signal_map, dbstate.db.get_family_bookmarks(), signal_map, dbstate.db.get_family_bookmarks(),
Bookmarks.FamilyBookmarks, filter_class=FamilySidebarFilter) Bookmarks.FamilyBookmarks, filter_class=FamilySidebarFilter)
self.updating = False
Config.client.notify_add("/apps/gramps/interface/filter", Config.client.notify_add("/apps/gramps/interface/filter",
self.filter_toggle) 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): def column_order(self):
return self.dbstate.db.get_family_list_column_order() return self.dbstate.db.get_family_list_column_order()
@ -179,6 +149,34 @@ class FamilyListView(PageView.ListView):
</popup> </popup>
</ui>''' </ui>'''
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): def add(self, obj):
from Editors import EditFamily from Editors import EditFamily
family = RelLib.Family() family = RelLib.Family()
@ -210,10 +208,3 @@ class FamilyListView(PageView.ListView):
EditFamily(self.dbstate, self.uistate, [], family) EditFamily(self.dbstate, self.uistate, [], family)
except Errors.WindowActiveError: except Errors.WindowActiveError:
pass 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

View File

@ -103,37 +103,33 @@ class NoteView(PageView.ListView):
self.filter_toggle) self.filter_toggle)
def get_bookmarks(self): def get_bookmarks(self):
"""
Returns the bookmark object
"""
return self.dbstate.db.get_note_bookmarks() 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): def drag_info(self):
"""
Indicates that the drag type is an EVENT
"""
return DdTargets.NOTE_LINK 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): def column_order(self):
"""
returns a tuple indicating the column order
"""
return self.dbstate.db.get_note_column_order() return self.dbstate.db.get_note_column_order()
def get_stock(self): def get_stock(self):
"""
Use the gramps-event stock icon
"""
return 'gramps-notes' return 'gramps-notes'
def ui_definition(self): def ui_definition(self):
"""
Defines the UI string for UIManager
"""
return '''<ui> return '''<ui>
<menubar name="MenuBar"> <menubar name="MenuBar">
<menu action="BookMenu"> <menu action="BookMenu">
@ -166,13 +162,34 @@ class NoteView(PageView.ListView):
</popup> </popup>
</ui>''' </ui>'''
def on_double_click(self, obj, event): def define_actions(self):
handle = self.first_selected() PageView.ListView.define_actions(self)
note = Note() self.add_action('ColumnEdit', gtk.STOCK_PROPERTIES,
try: _('_Column Editor'), callback=self.column_editor)
EditNote(self.dbstate, self.uistate, [], note) self.add_action('FilterEdit', None, _('Note Filter Editor'),
except Errors.WindowActiveError: callback=self.filter_editor,)
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
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): def add(self, obj):
try: try:
@ -213,10 +230,3 @@ class NoteView(PageView.ListView):
EditNote(self.dbstate, self.uistate, [], note) EditNote(self.dbstate, self.uistate, [], note)
except Errors.WindowActiveError: except Errors.WindowActiveError:
pass 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

View File

@ -2063,63 +2063,63 @@ class GrampsDbBase(GrampsDBCallback):
Stores the Person display common information in the Stores the Person display common information in the
database's metadata. 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): def set_family_list_column_order(self, col_list):
""" """
Stores the Person display common information in the Stores the Person display common information in the
database's metadata. 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): def set_child_column_order(self, col_list):
""" """
Stores the Person display common information in the Stores the Person display common information in the
database's metadata. 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): def set_place_column_order(self, col_list):
""" """
Stores the Place display common information in the Stores the Place display common information in the
database's metadata. 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): def set_source_column_order(self, col_list):
""" """
Stores the Source display common information in the Stores the Source display common information in the
database's metadata. 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): def set_media_column_order(self, col_list):
""" """
Stores the Media display common information in the Stores the Media display common information in the
database's metadata. 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): def set_event_column_order(self, col_list):
""" """
Stores the Event display common information in the Stores the Event display common information in the
database's metadata. 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): def set_repository_column_order(self, col_list):
""" """
Stores the Repository display common information in the Stores the Repository display common information in the
database's metadata. 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): def set_note_column_order(self, col_list):
""" """
Stores the Note display common information in the Stores the Note display common information in the
database's metadata. 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): def __get_column_order(self, name, default):
if self.metadata == None: if self.metadata == None:

View File

@ -549,9 +549,10 @@ class ListView(BookMarkView):
def drag_info(self): def drag_info(self):
return None return None
def drag_begin(self, widget, *data): def drag_begin(self, widget, context):
widget.drag_source_set_icon_stock(self.get_stock()) widget.drag_source_set_icon_stock(self.get_stock())
return True
def column_order(self): def column_order(self):
assert False assert False
@ -629,6 +630,7 @@ class ListView(BookMarkView):
if selected_ids: if selected_ids:
data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) data = (self.drag_info().drag_type, id(self), selected_ids[0], 0)
sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) sel_data.set(sel_data.target, 8 ,pickle.dumps(data))
return True
def setup_filter(self): def setup_filter(self):
""" """
@ -659,7 +661,7 @@ class ListView(BookMarkView):
# disable the inactive flag # disable the inactive flag
self.inactive = False self.inactive = False
def column_clicked(self,obj,data): def column_clicked(self, obj, data):
if self.sort_col != data: if self.sort_col != data:
order = gtk.SORT_ASCENDING order = gtk.SORT_ASCENDING
else: else:
@ -687,11 +689,15 @@ class ListView(BookMarkView):
if handle: if handle:
path = self.model.on_get_path(handle) path = self.model.on_get_path(handle)
self.selection.select_path(path) 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)): for i in xrange(len(self.columns)):
enable_sort_flag = (i==self.sort_col) enable_sort_flag = (i==self.sort_col)
self.columns[i].set_sort_indicator(enable_sort_flag) self.columns[i].set_sort_indicator(enable_sort_flag)
self.columns[self.sort_col].set_sort_order(order) 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): def build_columns(self):
for column in self.columns: for column in self.columns:
@ -730,7 +736,6 @@ class ListView(BookMarkView):
self.model = self.make_model(self.dbstate.db,self.sort_col, self.model = self.make_model(self.dbstate.db,self.sort_col,
search=filter_info) search=filter_info)
self.list.set_model(self.model) self.list.set_model(self.model)
self.selection = self.list.get_selection()
if const.use_tips and self.model.tooltip_column != None: if const.use_tips and self.model.tooltip_column != None:
self.tooltips = TreeTips.TreeTips( self.tooltips = TreeTips.TreeTips(