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:
parent
db1836bd3f
commit
ddb68c9398
@ -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>
|
||||
* src/Editors/_EditNote.py: Follow hyperlinks (updated).
|
||||
|
||||
|
10
NEWS
10
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
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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.
|
||||
|
@ -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(
|
||||
|
@ -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):
|
||||
</popup>
|
||||
</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):
|
||||
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
|
||||
|
@ -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 '''<ui>
|
||||
<menubar name="MenuBar">
|
||||
<menu action="BookMenu">
|
||||
@ -166,13 +162,34 @@ class NoteView(PageView.ListView):
|
||||
</popup>
|
||||
</ui>'''
|
||||
|
||||
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
|
||||
|
@ -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:
|
||||
|
@ -549,8 +549,9 @@ 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,12 +689,16 @@ 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:
|
||||
self.list.remove_column(column)
|
||||
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user