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

View File

@ -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()

View File

@ -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)
@ -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 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

View File

@ -1006,7 +1006,7 @@
<widget class="GtkTable" id="table7">
<property name="border_width">12</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="homogeneous">False</property>
<property name="row_spacing">0</property>
@ -1079,6 +1079,28 @@
<property name="y_options"></property>
</packing>
</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>
<packing>
<property name="padding">0</property>

View File

@ -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,7 +410,8 @@ 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))