diff --git a/ChangeLog b/ChangeLog index 55dd49113..e0df3d496 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2004-01-17 Alex Roitman + * NEWS: Update. + * src/errdialogs.glade: Add check button to the missing media dialog. + * src/QuestionDialog.py (MissingMediaDialog.__init__): Add default + action property. + * src/ReadXML.py (import_data): Add support for default action. + * src/plugins/WebPage.py (write_gallery): Use object ID as a file name + - prevents collision between identical names coming from different dirs. + 2004-01-16 Don Allingham * src/plugins/AncestorChart2.py: first pass at multipage output diff --git a/NEWS b/NEWS index c6bdaa541..860a6c5c5 100644 --- a/NEWS +++ b/NEWS @@ -12,7 +12,7 @@ Version 1.0.0 -- the "Stable as a tombstone" release * Anchor can be set in Pedigree View -- in that case generations are labeled relative to that anchor. * Manual is translated into French (Michel Guitel), German (Sebastian Vöcking), - and Russian (Alex Roitman) languages. + Hungarian (Egyeki Gergely), and Russian (Alex Roitman) languages. * Relationship calculator for German (Dr. Martin Senftleben) and Hungarian (Egyeki Gergely) languages. diff --git a/src/QuestionDialog.py b/src/QuestionDialog.py index 8fac811b4..26ba46d30 100644 --- a/src/QuestionDialog.py +++ b/src/QuestionDialog.py @@ -171,6 +171,8 @@ class MissingMediaDialog: label2.set_text(msg2) label2.set_use_markup(gtk.TRUE) + check_button = self.xml.get_widget('use_always') + self.top.show() if parent: self.top.set_transient_for(parent) @@ -181,4 +183,8 @@ class MissingMediaDialog: self.task2() elif response == 3: self.task3() + if check_button.get_active(): + self.default_action = response + else: + self.default_action = 0 self.top.destroy() diff --git a/src/ReadXML.py b/src/ReadXML.py index 335dc260c..1604f5784 100644 --- a/src/ReadXML.py +++ b/src/ReadXML.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2003 Donald N. Allingham +# Copyright (C) 2000-2004 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,6 +18,8 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# $Id$ + #------------------------------------------------------------------------- # # Standard Python Modules @@ -64,6 +66,7 @@ def importData(database, filename, callback,cl=0): database.smap = {} database.pmap = {} database.fmap = {} + missmedia_action = 0 parser = GrampsImportParser(database,callback,basefile) @@ -206,7 +209,7 @@ def importData(database, filename, callback,cl=0): for OldMediaID in parser.MediaFileMap.keys(): NewMediaID = parser.MediaFileMap[OldMediaID] oldfile = ObjectMap[NewMediaID].getPath() - (junk,oldext) = os.path.splitext(os.path.basename(oldfile)) + (junk,oldext) = os.path.splitext(os.path.basename(oldfile)) oldfile = os.path.join(basefile,OldMediaID+oldext) newfile = os.path.join(newpath,NewMediaID+oldext) ObjectMap[NewMediaID].setPath(newfile) @@ -222,14 +225,22 @@ def importData(database, filename, callback,cl=0): print "Warning: media file %s was not found," \ % os.path.basename(oldfile), "so it was ignored." else: - # File is lost => ask what to do - MissingMediaDialog(_("Media object could not be found"), - _("%(file_name)s is referenced in the database, but no longer exists. " - "The file may have been deleted or moved to a different location. " - "You may choose to either remove the reference from the database, " - "keep the reference to the missing file, or select a new file." - ) % { 'file_name' : oldfile }, - remove_clicked, leave_clicked, select_clicked) + # File is lost => ask what to do (if we were not told yet) + if missmedia_action == 0: + mmd = MissingMediaDialog(_("Media object could not be found"), + _("%(file_name)s is referenced in the database, but no longer exists. " + "The file may have been deleted or moved to a different location. " + "You may choose to either remove the reference from the database, " + "keep the reference to the missing file, or select a new file." + ) % { 'file_name' : oldfile }, + remove_clicked, leave_clicked, select_clicked) + missmedia_action = mmd.default_action + elif missmedia_action == 1: + remove_clicked() + elif missmedia_action == 2: + leave_clicked() + elif missmedia_action == 3: + select_clicked() del parser return 1 diff --git a/src/errdialogs.glade b/src/errdialogs.glade index 2d78a12eb..4089be4b7 100644 --- a/src/errdialogs.glade +++ b/src/errdialogs.glade @@ -1006,7 +1006,7 @@ 12 True - 2 + 3 3 False 0 @@ -1079,6 +1079,28 @@ + + + + True + If you check this button, all the missing media files will be automatically treated according to the currently selected option. No further dialogs will be presented for any missing medial files. + True + _Use this selection for all missing media files + True + GTK_RELIEF_NORMAL + False + False + True + + + 2 + 3 + 2 + 3 + fill + + + 0 diff --git a/src/plugins/WebPage.py b/src/plugins/WebPage.py index d69082e61..b8c87504a 100644 --- a/src/plugins/WebPage.py +++ b/src/plugins/WebPage.py @@ -1,7 +1,7 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2000-2003 Donald N. Allingham +# Copyright (C) 2000-2004 Donald N. Allingham # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Pubilc License as published by @@ -410,8 +410,9 @@ class IndividualPage: for obj in my_list: try: src = obj.getReference().getPath() - base = os.path.basename(src) - + junk,ext = os.path.splitext(src) + base = '%s%s' % (obj.getReference().getId(),ext) + if self.image_dir: shutil.copyfile(src,"%s/%s/%s" % (self.dir,self.image_dir,base)) try: