From e9db9568cbe78cf86e5997bb1d93cdcdb2714ea1 Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Wed, 7 Nov 2007 18:50:57 +0000 Subject: [PATCH] * src/AddMedia.py: fix issue #1350, relative path not working addmedia * src/Editors/_EditPerson.py: family rebuild callback error 2007-11-07 Benny Malengier svn: r9318 --- ChangeLog | 4 ++++ src/AddMedia.py | 13 +++++++++++-- src/Editors/_EditPerson.py | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64472a3ca..2e7ec87f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-11-07 Benny Malengier + * src/AddMedia.py: fix issue #1350, relative path not working addmedia + * src/Editors/_EditPerson.py: family rebuild callback error + 2007-11-07 Benny Malengier * src/AddMedia.py: add media crash, fix issue #1349 diff --git a/src/AddMedia.py b/src/AddMedia.py index 654d3d30c..3e96b7636 100644 --- a/src/AddMedia.py +++ b/src/AddMedia.py @@ -58,7 +58,14 @@ import Mime import GrampsDisplay import ManagedWindow +#------------------------------------------------------------------------- +# +# global variables +# +#------------------------------------------------------------------------- + _last_directory = None +_relative_path = False #------------------------------------------------------------------------- # @@ -97,6 +104,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow): self.internal = self.glade.get_widget('internal') self.internal.connect('toggled', self.internal_toggled) self.relpath = self.glade.get_widget('relpath') + self.relpath.set_active(_relative_path) self.temp_name = "" self.object = None @@ -120,7 +128,7 @@ class AddMediaObject(ManagedWindow.ManagedWindow): Callback function called with the save button is pressed. A new media object is created, and added to the database. """ - global _last_directory + global _last_directory, _relative_path description = unicode(self.description.get_text()) @@ -160,7 +168,8 @@ class AddMediaObject(ManagedWindow.ManagedWindow): mobj.set_mime_type(mtype) name = filename mobj.set_path(name) - _last_directory = os.path.dirname(filename) + _last_directory = os.path.dirname(full_file) + _relative_path = self.relpath.get_active() mobj.set_handle(Utils.create_id()) if not mobj.get_gramps_id(): diff --git a/src/Editors/_EditPerson.py b/src/Editors/_EditPerson.py index 6104b849d..52ebf1546 100644 --- a/src/Editors/_EditPerson.py +++ b/src/Editors/_EditPerson.py @@ -165,7 +165,7 @@ class EditPerson(EditPrimary): self._add_db_signal('family-update', self.family_change) self._add_db_signal('family-add', self.family_change) - def family_change(self, handle_list): + def family_change(self, handle_list=[]): """Callback for family change signals. This should rebuild the backreferences to family in person when: 1)a family the person is parent of changes. Person could have