* src/FamilyView.py (drag_data_get): Avoid Traceback when dragging from empty list

* src/gramps_main.py (read_file): More changes to unicode filename support


svn: r5411
This commit is contained in:
Martin Hawlisch 2005-11-21 09:27:06 +00:00
parent aed42dbb83
commit 6da9e9b584
3 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,7 @@
2005-11-21 Martin Hawlisch <Martin.Hawlisch@gmx.de> 2005-11-21 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/MediaView.py (media_update): Redisplay the media object at the top * src/MediaView.py (media_update): Redisplay the media object at the top
* src/FamilyView.py (drag_data_get): Avoid Traceback when dragging from empty list
* src/gramps_main.py (read_file): More changes to unicode filename support
2005-11-20 Don Allingham <don@gramps-project.org> 2005-11-20 Don Allingham <don@gramps-project.org>
* src/Report.py: shortened report dialog by making the Paper * src/Report.py: shortened report dialog by making the Paper

View File

@ -1534,6 +1534,8 @@ class FamilyView:
if not node: if not node:
return return
handle = self.child_model.get_value(node,_HANDLE_COL) handle = self.child_model.get_value(node,_HANDLE_COL)
if not handle:
return
bits_per = 8; # we're going to pass a string bits_per = 8; # we're going to pass a string
if sel_data.target == DdTargets.PERSON_LINK.drag_type: if sel_data.target == DdTargets.PERSON_LINK.drag_type:

View File

@ -1294,7 +1294,11 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
_('The selected file is a directory, not ' _('The selected file is a directory, not '
'a file.\nA GRAMPS database must be a file.')) 'a file.\nA GRAMPS database must be a file.'))
return 0 return 0
elif Utils.find_file(filename): nfilename = Utils.find_file(filename)
if nfilename:
# the file exists but the filename may be different due to
# a different encoding of the filename
filename = nfilename
if not os.access(filename,os.R_OK): if not os.access(filename,os.R_OK):
ErrorDialog(_('Cannot open database'), ErrorDialog(_('Cannot open database'),
_('You do not have read access to the selected ' _('You do not have read access to the selected '
@ -1305,7 +1309,10 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
WarningDialog(_('Read only database'), WarningDialog(_('Read only database'),
_('You do not have write access to the selected ' _('You do not have write access to the selected '
'file.')) 'file.'))
else:
# File not found. continue here to get the error message
# displayed by the following try .. except
pass
try: try:
if self.load_database(filename,callback,mode=mode) == 1: if self.load_database(filename,callback,mode=mode) == 1:
if filename[-1] == '/': if filename[-1] == '/':