* 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.


svn: r2645
This commit is contained in:
Alex Roitman 2004-01-17 06:51:49 +00:00
parent 3614d0956f
commit 4e70a13a6d
6 changed files with 64 additions and 15 deletions

View File

@ -1,3 +1,12 @@
2004-01-17 Alex Roitman <shura@alex.neuro.umn.edu>
* 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 <dallingham@users.sourceforge.net> 2004-01-16 Don Allingham <dallingham@users.sourceforge.net>
* src/plugins/AncestorChart2.py: first pass at multipage output * src/plugins/AncestorChart2.py: first pass at multipage output

2
NEWS
View File

@ -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 * Anchor can be set in Pedigree View -- in that case generations are labeled
relative to that anchor. relative to that anchor.
* Manual is translated into French (Michel Guitel), German (Sebastian Vöcking), * 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 * Relationship calculator for German (Dr. Martin Senftleben) and
Hungarian (Egyeki Gergely) languages. Hungarian (Egyeki Gergely) languages.

View File

@ -171,6 +171,8 @@ class MissingMediaDialog:
label2.set_text(msg2) label2.set_text(msg2)
label2.set_use_markup(gtk.TRUE) label2.set_use_markup(gtk.TRUE)
check_button = self.xml.get_widget('use_always')
self.top.show() self.top.show()
if parent: if parent:
self.top.set_transient_for(parent) self.top.set_transient_for(parent)
@ -181,4 +183,8 @@ class MissingMediaDialog:
self.task2() self.task2()
elif response == 3: elif response == 3:
self.task3() self.task3()
if check_button.get_active():
self.default_action = response
else:
self.default_action = 0
self.top.destroy() self.top.destroy()

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # 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 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# $Id$
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Standard Python Modules # Standard Python Modules
@ -64,6 +66,7 @@ def importData(database, filename, callback,cl=0):
database.smap = {} database.smap = {}
database.pmap = {} database.pmap = {}
database.fmap = {} database.fmap = {}
missmedia_action = 0
parser = GrampsImportParser(database,callback,basefile) parser = GrampsImportParser(database,callback,basefile)
@ -206,7 +209,7 @@ def importData(database, filename, callback,cl=0):
for OldMediaID in parser.MediaFileMap.keys(): for OldMediaID in parser.MediaFileMap.keys():
NewMediaID = parser.MediaFileMap[OldMediaID] NewMediaID = parser.MediaFileMap[OldMediaID]
oldfile = ObjectMap[NewMediaID].getPath() 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) oldfile = os.path.join(basefile,OldMediaID+oldext)
newfile = os.path.join(newpath,NewMediaID+oldext) newfile = os.path.join(newpath,NewMediaID+oldext)
ObjectMap[NewMediaID].setPath(newfile) ObjectMap[NewMediaID].setPath(newfile)
@ -222,14 +225,22 @@ def importData(database, filename, callback,cl=0):
print "Warning: media file %s was not found," \ print "Warning: media file %s was not found," \
% os.path.basename(oldfile), "so it was ignored." % os.path.basename(oldfile), "so it was ignored."
else: else:
# File is lost => ask what to do # File is lost => ask what to do (if we were not told yet)
MissingMediaDialog(_("Media object could not be found"), if missmedia_action == 0:
_("%(file_name)s is referenced in the database, but no longer exists. " mmd = MissingMediaDialog(_("Media object could not be found"),
"The file may have been deleted or moved to a different location. " _("%(file_name)s is referenced in the database, but no longer exists. "
"You may choose to either remove the reference from the database, " "The file may have been deleted or moved to a different location. "
"keep the reference to the missing file, or select a new file." "You may choose to either remove the reference from the database, "
) % { 'file_name' : oldfile }, "keep the reference to the missing file, or select a new file."
remove_clicked, leave_clicked, select_clicked) ) % { '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 del parser
return 1 return 1

View File

@ -1006,7 +1006,7 @@
<widget class="GtkTable" id="table7"> <widget class="GtkTable" id="table7">
<property name="border_width">12</property> <property name="border_width">12</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="n_rows">2</property> <property name="n_rows">3</property>
<property name="n_columns">3</property> <property name="n_columns">3</property>
<property name="homogeneous">False</property> <property name="homogeneous">False</property>
<property name="row_spacing">0</property> <property name="row_spacing">0</property>
@ -1079,6 +1079,28 @@
<property name="y_options"></property> <property name="y_options"></property>
</packing> </packing>
</child> </child>
<child>
<widget class="GtkCheckButton" id="use_always">
<property name="visible">True</property>
<property name="tooltip" translatable="yes">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.</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">_Use this selection for all missing media files</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">2</property>
<property name="right_attach">3</property>
<property name="top_attach">2</property>
<property name="bottom_attach">3</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>

View File

@ -1,7 +1,7 @@
# #
# Gramps - a GTK+/GNOME based genealogy program # 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 # 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 # it under the terms of the GNU General Pubilc License as published by
@ -410,8 +410,9 @@ class IndividualPage:
for obj in my_list: for obj in my_list:
try: try:
src = obj.getReference().getPath() 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: if self.image_dir:
shutil.copyfile(src,"%s/%s/%s" % (self.dir,self.image_dir,base)) shutil.copyfile(src,"%s/%s/%s" % (self.dir,self.image_dir,base))
try: try: