export/import filters
svn: r3082
This commit is contained in:
parent
d65abaf5af
commit
006843f5f1
@ -9,7 +9,6 @@ The following packages *MUST* be installed in order for Gramps to work:
|
|||||||
Gnome 2.0 or greater
|
Gnome 2.0 or greater
|
||||||
PyGTK2 1.99.14 or greater
|
PyGTK2 1.99.14 or greater
|
||||||
Gnome-python 1.99.14 or greater
|
Gnome-python 1.99.14 or greater
|
||||||
PyXML 0.7.1 or greater
|
|
||||||
|
|
||||||
Many distributions already provide PyXML, but if your
|
Many distributions already provide PyXML, but if your
|
||||||
installation does not have it, you can get it from
|
installation does not have it, you can get it from
|
||||||
|
10
gramps2/TODO
10
gramps2/TODO
@ -1,16 +1,6 @@
|
|||||||
* Allow for multiple notes. A tabbed interface would be really useful,
|
* Allow for multiple notes. A tabbed interface would be really useful,
|
||||||
since there are no titles for notes. Not all objects would necessarily
|
since there are no titles for notes. Not all objects would necessarily
|
||||||
need multiple notes. Determine which ones should and shouldn't.
|
need multiple notes. Determine which ones should and shouldn't.
|
||||||
=== THESE should be obsoleted once we move to a database
|
|
||||||
* Speed up the reading of the database. The python XML routines are not
|
|
||||||
as fast as I would like, and it can take a minute or so to read a
|
|
||||||
large database. This is way too slow.
|
|
||||||
* Finish the generic load of revision control interfaces to allow a
|
|
||||||
revision control plugin system. Most of the work is already done.
|
|
||||||
* Disable the save buttons if gramps database is marked read-only. Disable
|
|
||||||
the adding of media objects as well, since this will cause gramps to
|
|
||||||
try to create a thumbnail in a readonly database.
|
|
||||||
===
|
|
||||||
* Startup tips.
|
* Startup tips.
|
||||||
* Date calculator.
|
* Date calculator.
|
||||||
See http://sourceforge.net/mailarchive/forum.php?thread_id=3252078&forum_id=1993
|
See http://sourceforge.net/mailarchive/forum.php?thread_id=3252078&forum_id=1993
|
||||||
|
@ -95,21 +95,11 @@ pkgpython_PYTHON = \
|
|||||||
# If not using GNU make, then list all files individually
|
# If not using GNU make, then list all files individually
|
||||||
# The latter is more portable and POSIX-friendly :)
|
# The latter is more portable and POSIX-friendly :)
|
||||||
GLADEFILES = \
|
GLADEFILES = \
|
||||||
dialog.glade\
|
|
||||||
edit_person.glade\
|
|
||||||
errdialogs.glade\
|
|
||||||
gramps.glade\
|
gramps.glade\
|
||||||
imagesel.glade\
|
|
||||||
marriage.glade\
|
|
||||||
mergedata.glade\
|
mergedata.glade\
|
||||||
places.glade\
|
|
||||||
plugins.glade\
|
plugins.glade\
|
||||||
preferences.glade\
|
|
||||||
revision.glade\
|
|
||||||
rule.glade\
|
rule.glade\
|
||||||
srcsel.glade\
|
styles.glade
|
||||||
styles.glade\
|
|
||||||
choose.glade
|
|
||||||
|
|
||||||
GRAPHICS = \
|
GRAPHICS = \
|
||||||
bad.png\
|
bad.png\
|
||||||
@ -118,12 +108,9 @@ GRAPHICS = \
|
|||||||
family48.png\
|
family48.png\
|
||||||
good.png\
|
good.png\
|
||||||
gramps.png\
|
gramps.png\
|
||||||
gramps.xpm\
|
|
||||||
logo.png\
|
logo.png\
|
||||||
media.png\
|
media.png\
|
||||||
pedigree.xpm\
|
|
||||||
people48.png\
|
people48.png\
|
||||||
people.xpm\
|
|
||||||
place.png\
|
place.png\
|
||||||
sources.png\
|
sources.png\
|
||||||
splash.jpg\
|
splash.jpg\
|
||||||
|
@ -207,21 +207,11 @@ pkgpython_PYTHON = \
|
|||||||
# If not using GNU make, then list all files individually
|
# If not using GNU make, then list all files individually
|
||||||
# The latter is more portable and POSIX-friendly :)
|
# The latter is more portable and POSIX-friendly :)
|
||||||
GLADEFILES = \
|
GLADEFILES = \
|
||||||
dialog.glade\
|
|
||||||
edit_person.glade\
|
|
||||||
errdialogs.glade\
|
|
||||||
gramps.glade\
|
gramps.glade\
|
||||||
imagesel.glade\
|
|
||||||
marriage.glade\
|
|
||||||
mergedata.glade\
|
mergedata.glade\
|
||||||
places.glade\
|
|
||||||
plugins.glade\
|
plugins.glade\
|
||||||
preferences.glade\
|
|
||||||
revision.glade\
|
|
||||||
rule.glade\
|
rule.glade\
|
||||||
srcsel.glade\
|
styles.glade
|
||||||
styles.glade\
|
|
||||||
choose.glade
|
|
||||||
|
|
||||||
|
|
||||||
GRAPHICS = \
|
GRAPHICS = \
|
||||||
@ -231,12 +221,9 @@ GRAPHICS = \
|
|||||||
family48.png\
|
family48.png\
|
||||||
good.png\
|
good.png\
|
||||||
gramps.png\
|
gramps.png\
|
||||||
gramps.xpm\
|
|
||||||
logo.png\
|
logo.png\
|
||||||
media.png\
|
media.png\
|
||||||
pedigree.xpm\
|
|
||||||
people48.png\
|
people48.png\
|
||||||
people.xpm\
|
|
||||||
place.png\
|
place.png\
|
||||||
sources.png\
|
sources.png\
|
||||||
splash.jpg\
|
splash.jpg\
|
||||||
|
@ -3006,7 +3006,7 @@ class GrampsDB:
|
|||||||
map[gid] = self.add_event(event,trans)
|
map[gid] = self.add_event(event,trans)
|
||||||
return event
|
return event
|
||||||
|
|
||||||
def find_source_from_id(self,val,trans):
|
def find_source_from_id(self,val,trans=None):
|
||||||
"""finds a Source in the database from the passed gramps' ID.
|
"""finds a Source in the database from the passed gramps' ID.
|
||||||
If no such Source exists, a new Source is added to the database."""
|
If no such Source exists, a new Source is added to the database."""
|
||||||
|
|
||||||
|
@ -562,14 +562,14 @@ class XmlWriter:
|
|||||||
else:
|
else:
|
||||||
calstr = ''
|
calstr = ''
|
||||||
|
|
||||||
if date.isRange():
|
if date.is_range():
|
||||||
d1 = date.get_start_date().getIsoDate()
|
d1 = date.get_start_date().get_iso_date()
|
||||||
d2 = date.get_stop_date().getIsoDate()
|
d2 = date.get_stop_date().get_iso_date()
|
||||||
self.g.write('%s<daterange start="%s" stop="%s"%s/>\n' % (sp,d1,d2,calstr))
|
self.g.write('%s<daterange start="%s" stop="%s"%s/>\n' % (sp,d1,d2,calstr))
|
||||||
elif date.isValid():
|
elif date.is_valid():
|
||||||
d1 = date.get_start_date()
|
d1 = date.get_start_date()
|
||||||
mode = d1.getModeVal()
|
mode = d1.get_mode_val()
|
||||||
dstr = d1.getIsoDate()
|
dstr = d1.get_iso_date()
|
||||||
|
|
||||||
if mode == Calendar.BEFORE:
|
if mode == Calendar.BEFORE:
|
||||||
pref = ' type="before"'
|
pref = ' type="before"'
|
||||||
@ -684,8 +684,8 @@ class XmlWriter:
|
|||||||
def write_media_list(self,list,indent=3):
|
def write_media_list(self,list,indent=3):
|
||||||
sp = ' '*indent
|
sp = ' '*indent
|
||||||
for photo in list:
|
for photo in list:
|
||||||
mobj = photo.get_reference()
|
mobj_id = photo.get_reference_id()
|
||||||
self.g.write('%s<objref ref="%s"' % (sp,mobj.get_id()))
|
self.g.write('%s<objref ref="%s"' % (sp,mobj_id))
|
||||||
if photo.get_privacy():
|
if photo.get_privacy():
|
||||||
self.g.write(' priv="1"')
|
self.g.write(' priv="1"')
|
||||||
proplist = photo.get_attribute_list()
|
proplist = photo.get_attribute_list()
|
||||||
|
@ -69,7 +69,7 @@ caution_xpm = "%s/caution.png" % rootDir
|
|||||||
|
|
||||||
system_filters = "%s/system_filters.xml" % rootDir
|
system_filters = "%s/system_filters.xml" % rootDir
|
||||||
custom_filters = "~/.gramps/custom_filters.xml"
|
custom_filters = "~/.gramps/custom_filters.xml"
|
||||||
icon = "%s/gramps.xpm" % rootDir
|
icon = "%s/gramps.png" % rootDir
|
||||||
logo = "%s/logo.png" % rootDir
|
logo = "%s/logo.png" % rootDir
|
||||||
gladeFile = "%s/gramps.glade" % rootDir
|
gladeFile = "%s/gramps.glade" % rootDir
|
||||||
placesFile = "%s/gramps.glade" % rootDir
|
placesFile = "%s/gramps.glade" % rootDir
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
<property name="modal">False</property>
|
<property name="modal">False</property>
|
||||||
<property name="resizable">True</property>
|
<property name="resizable">True</property>
|
||||||
<property name="destroy_with_parent">False</property>
|
<property name="destroy_with_parent">False</property>
|
||||||
<property name="icon">gramps.xpm</property>
|
<property name="icon">gramps.png</property>
|
||||||
<property name="enable_layout_config">True</property>
|
<property name="enable_layout_config">True</property>
|
||||||
<signal name="destroy" handler="on_exit_activate"/>
|
<signal name="destroy" handler="on_exit_activate"/>
|
||||||
<signal name="delete_event" handler="delete_event"/>
|
<signal name="delete_event" handler="delete_event"/>
|
||||||
|
@ -1,101 +0,0 @@
|
|||||||
/* XPM */
|
|
||||||
static char * gramps_xpm[] = {
|
|
||||||
"48 48 50 1",
|
|
||||||
" c None",
|
|
||||||
". c #B39169",
|
|
||||||
"+ c #E8D3B9",
|
|
||||||
"@ c #E8D3B8",
|
|
||||||
"# c #E8D2B7",
|
|
||||||
"$ c #E7D2B6",
|
|
||||||
"% c #E7D1B6",
|
|
||||||
"& c #E7D1B5",
|
|
||||||
"* c #E7D1B4",
|
|
||||||
"= c #000000",
|
|
||||||
"- c #E7D0B4",
|
|
||||||
"; c #E6D0B3",
|
|
||||||
"> c #EAD7BE",
|
|
||||||
", c #EAD6BE",
|
|
||||||
"' c #EAD6BD",
|
|
||||||
") c #E9D6BC",
|
|
||||||
"! c #E9D5BC",
|
|
||||||
"~ c #E9D5BB",
|
|
||||||
"{ c #E9D4BA",
|
|
||||||
"] c #E8D4B9",
|
|
||||||
"^ c #E6CFB2",
|
|
||||||
"/ c #E6CFB1",
|
|
||||||
"( c #E6CEB1",
|
|
||||||
"_ c #E5CEB0",
|
|
||||||
": c #E5CDAF",
|
|
||||||
"< c #E5CDAE",
|
|
||||||
"[ c #E5CCAE",
|
|
||||||
"} c #EBD9C1",
|
|
||||||
"| c #EBD8C1",
|
|
||||||
"1 c #EBD8C0",
|
|
||||||
"2 c #EAD8C0",
|
|
||||||
"3 c #EAD7BF",
|
|
||||||
"4 c #E4CCAD",
|
|
||||||
"5 c #E4CCAC",
|
|
||||||
"6 c #E4CBAC",
|
|
||||||
"7 c #E4CBAB",
|
|
||||||
"8 c #E4CAAA",
|
|
||||||
"9 c #E3CAAA",
|
|
||||||
"0 c #E3CAA9",
|
|
||||||
"a c #E3C9A9",
|
|
||||||
"b c #E3C9A8",
|
|
||||||
"c c #E3C8A7",
|
|
||||||
"d c #E2C8A7",
|
|
||||||
"e c #E2C8A6",
|
|
||||||
"f c #E2C7A6",
|
|
||||||
"g c #E2C7A5",
|
|
||||||
"h c #E2C7A4",
|
|
||||||
"i c #E2C6A4",
|
|
||||||
"j c #E1C6A3",
|
|
||||||
"k c #E1C5A2",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" .......... ",
|
|
||||||
" .+@@##$%&. ",
|
|
||||||
" .@@##$%&*.= ",
|
|
||||||
" ===.@##$%&*-.= ",
|
|
||||||
" = .##$%&*-;.= ",
|
|
||||||
" = .#$%&*-;;.= ",
|
|
||||||
" .......... = ..........= ",
|
|
||||||
" .>,')!~~{. = ======== ",
|
|
||||||
" .,')!~~{{.= = ",
|
|
||||||
" ===.')!~~{{].==== ",
|
|
||||||
" = .)!~~{{]+.= = .......... ",
|
|
||||||
" = .!~~{{]+@.= = .;;^^/(__. ",
|
|
||||||
" = ..........= = .;^^/(__:.= ",
|
|
||||||
" = ======== ===.^^/(__::.= ",
|
|
||||||
" = .^/(__::<.= ",
|
|
||||||
" = ./(__::<[.= ",
|
|
||||||
" .......... = ..........= ",
|
|
||||||
" .}|1233>,. = ======== ",
|
|
||||||
" .|1233>,'.= = ",
|
|
||||||
" .1233>,').==== ",
|
|
||||||
" .233>,')!.= = ",
|
|
||||||
" .33>,')!~.= = .......... ",
|
|
||||||
" ..........= = .[4567789. ",
|
|
||||||
" ======== = .45677890.= ",
|
|
||||||
" = ===.5677890a.= ",
|
|
||||||
" = = .677890ab.= ",
|
|
||||||
" = .......... = .77890abb.= ",
|
|
||||||
" = .;;^^/(__. = ..........= ",
|
|
||||||
" = .;^^/(__:.= = ======== ",
|
|
||||||
" ===.^^/(__::.==== ",
|
|
||||||
" .^/(__::<.= = ",
|
|
||||||
" ./(__::<[.= = .......... ",
|
|
||||||
" ..........= = .bbcdefgh. ",
|
|
||||||
" ======== = .bcdefghi.= ",
|
|
||||||
" ===.cdefghij.= ",
|
|
||||||
" .defghijj.= ",
|
|
||||||
" .efghijjk.= ",
|
|
||||||
" ..........= ",
|
|
||||||
" ======== ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" "};
|
|
@ -1,33 +0,0 @@
|
|||||||
/* XPM */
|
|
||||||
static char * pedegree_xpm[] = {
|
|
||||||
"22 22 8 1",
|
|
||||||
" c None",
|
|
||||||
". c #330066",
|
|
||||||
"+ c #404040",
|
|
||||||
"@ c #3F3F3F",
|
|
||||||
"# c #3C3C3C",
|
|
||||||
"$ c #3E3E3E",
|
|
||||||
"% c #434343",
|
|
||||||
"& c #3D3D3D",
|
|
||||||
" ",
|
|
||||||
" ",
|
|
||||||
" ...... ",
|
|
||||||
" .++++++ ",
|
|
||||||
" .+ ",
|
|
||||||
" .......+ ",
|
|
||||||
" .++++@.@ ",
|
|
||||||
" .+ .# ",
|
|
||||||
" .+ ...... ",
|
|
||||||
" .+ @@@$$@ ",
|
|
||||||
" ......+ ",
|
|
||||||
" +++%.+ ",
|
|
||||||
" .+ ...... ",
|
|
||||||
" .+ .++++++ ",
|
|
||||||
" .@ .+ ",
|
|
||||||
" .......+ ",
|
|
||||||
" @&$@@.+ ",
|
|
||||||
" .+ ",
|
|
||||||
" ...... ",
|
|
||||||
" ++++++ ",
|
|
||||||
" ",
|
|
||||||
" "};
|
|
@ -1,52 +0,0 @@
|
|||||||
/* XPM */
|
|
||||||
static char * icon_people03b_24x24_xpm[] = {
|
|
||||||
"24 24 25 1",
|
|
||||||
" c None",
|
|
||||||
". c #DBD8D1",
|
|
||||||
"+ c #FBFBFB",
|
|
||||||
"@ c #B9B4A9",
|
|
||||||
"# c #BBB6A8",
|
|
||||||
"$ c #50493B",
|
|
||||||
"% c #433C31",
|
|
||||||
"& c #7F796D",
|
|
||||||
"* c #776E57",
|
|
||||||
"= c #F0E7C8",
|
|
||||||
"- c #000000",
|
|
||||||
"; c #9B9791",
|
|
||||||
"> c #FFFFFF",
|
|
||||||
", c #B9B7AB",
|
|
||||||
"' c #929081",
|
|
||||||
") c #898777",
|
|
||||||
"! c #6E6951",
|
|
||||||
"~ c #817E69",
|
|
||||||
"{ c #8E8C7B",
|
|
||||||
"] c #868474",
|
|
||||||
"^ c #A19E8F",
|
|
||||||
"/ c #7F796C",
|
|
||||||
"( c #423C30",
|
|
||||||
"_ c #50493A",
|
|
||||||
": c #646464",
|
|
||||||
" ",
|
|
||||||
" .++++++++++++++++@ ",
|
|
||||||
" #$%%%%%%%%%%%%%%&* ",
|
|
||||||
" #*==============#*- ",
|
|
||||||
" #*====;;;;;;====#*- ",
|
|
||||||
" #*===;>>>>>>;===#*- ",
|
|
||||||
" #*==;>>>,,>>>>==#*- ",
|
|
||||||
" #*=;>>>,'',>>>>=#*- ",
|
|
||||||
" #*=;>>>)!!~>>>>=#*- ",
|
|
||||||
" #*=;>>>!!!!>>>>=#*- ",
|
|
||||||
" #*=;>>>{!!~>>>>=#*- ",
|
|
||||||
" #*=;>>>>!!>>>>>=#*- ",
|
|
||||||
" #*=;>>>,!!,>>>>=#*- ",
|
|
||||||
" #*=;>>,]!!]^>>>=#*- ",
|
|
||||||
" #*=;>,]!!!!]^>>=#*- ",
|
|
||||||
" #*==^!!!!!!!!^==#*- ",
|
|
||||||
" #*===^!!!!!!^===#*- ",
|
|
||||||
" #*====^^^^^^====#*- ",
|
|
||||||
" #*==============#*- ",
|
|
||||||
" #@++++++++++++++.*- ",
|
|
||||||
" /((((((((((((((((_- ",
|
|
||||||
" ------------------ ",
|
|
||||||
" ::::::::::::::::: ",
|
|
||||||
" "};
|
|
@ -507,7 +507,6 @@ class GedcomParser:
|
|||||||
self.person = self.find_or_create_person(id)
|
self.person = self.find_or_create_person(id)
|
||||||
self.added[self.person.get_id()] = self.person
|
self.added[self.person.get_id()] = self.person
|
||||||
self.parse_individual()
|
self.parse_individual()
|
||||||
self.db.build_person_display(self.person.get_id())
|
|
||||||
self.db.commit_person(self.person)
|
self.db.commit_person(self.person)
|
||||||
elif matches[2] in ["SUBM","SUBN","REPO"]:
|
elif matches[2] in ["SUBM","SUBN","REPO"]:
|
||||||
self.ignore_sub_junk(1)
|
self.ignore_sub_junk(1)
|
||||||
@ -1695,7 +1694,6 @@ class GedcomParser:
|
|||||||
source_ref.set_base_id(s.get_id())
|
source_ref.set_base_id(s.get_id())
|
||||||
s.set_title('Imported Source #%d' % self.localref)
|
s.set_title('Imported Source #%d' % self.localref)
|
||||||
s.set_note(matches[2] + self.parse_continue_data(level))
|
s.set_note(matches[2] + self.parse_continue_data(level))
|
||||||
self.db.build_source_display(s.get_id())
|
|
||||||
self.ignore_sub_junk(level+1)
|
self.ignore_sub_junk(level+1)
|
||||||
else:
|
else:
|
||||||
source_ref.set_base_id(self.db.find_source(matches[2],self.smap).get_id())
|
source_ref.set_base_id(self.db.find_source(matches[2],self.smap).get_id())
|
||||||
|
@ -123,7 +123,7 @@ class ReadPkg:
|
|||||||
os.rmdir(tmpdir_path)
|
os.rmdir(tmpdir_path)
|
||||||
|
|
||||||
self.window.destroy()
|
self.window.destroy()
|
||||||
self.callback(1)
|
self.callback()
|
||||||
|
|
||||||
def progress(self,val):
|
def progress(self,val):
|
||||||
self.progress_bar.set_fraction(val)
|
self.progress_bar.set_fraction(val)
|
||||||
|
@ -128,18 +128,25 @@ class PackageWriter:
|
|||||||
try:
|
try:
|
||||||
uri = gnome.vfs.URI('burn:///%s' % base)
|
uri = gnome.vfs.URI('burn:///%s' % base)
|
||||||
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
||||||
except gnome.vfs.error, msg:
|
except gnome.vfs.FileExistsError, msg:
|
||||||
print msg
|
QuestionDialog.ErrorDialog(_("CD export preparation failed"),
|
||||||
os._exit(1)
|
"1 %s " % str(msg))
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
QuestionDialog.ErrorDialog("CD export preparation failed",
|
||||||
|
'Could not create burn:///%s' % base)
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
uri = gnome.vfs.URI('burn:///%s/.thumb' % base)
|
uri = gnome.vfs.URI('burn:///%s/.thumb' % base)
|
||||||
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
||||||
except gnome.vfs.error, msg:
|
except gnome.vfs.FileExistsError, msg:
|
||||||
print msg
|
QuestionDialog.ErrorDialog("CD export preparation failed",
|
||||||
os._exit(1)
|
"2 %s " % str(msg))
|
||||||
|
return
|
||||||
|
|
||||||
for obj in self.db.get_object_map().values():
|
for obj_id in self.db.get_object_keys():
|
||||||
|
obj = self.db.find_object_from_id(obj_id)
|
||||||
oldfile = obj.get_path()
|
oldfile = obj.get_path()
|
||||||
root = os.path.basename(oldfile)
|
root = os.path.basename(oldfile)
|
||||||
if os.path.isfile(oldfile):
|
if os.path.isfile(oldfile):
|
||||||
@ -169,41 +176,55 @@ class PackageWriter:
|
|||||||
try:
|
try:
|
||||||
uri = gnome.vfs.URI('burn:///%s' % base)
|
uri = gnome.vfs.URI('burn:///%s' % base)
|
||||||
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
||||||
except gnome.vfs.error, msg:
|
except gnome.vfs.FileExistsError:
|
||||||
print msg
|
QuestionDialog.ErrorDialog(_("CD export preparation failed"),
|
||||||
|
"File already exists")
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
QuestionDialog.ErrorDialog(_("CD export preparation failed"),
|
||||||
|
_('Could not create burn:///%s') % base)
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
uri = gnome.vfs.URI('burn:///%s/.thumb' % base)
|
uri = gnome.vfs.URI('burn:///%s/.thumb' % base)
|
||||||
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
gnome.vfs.make_directory(uri,gnome.vfs.OPEN_WRITE)
|
||||||
except gnome.vfs.error, msg:
|
except gnome.vfs.FileExistsError, msg:
|
||||||
print msg
|
QuestionDialog.ErrorDialog("CD export preparation failed",
|
||||||
|
"4 %s " % str(msg))
|
||||||
|
return
|
||||||
|
except:
|
||||||
|
QuestionDialog.ErrorDialog(_("CD export preparation failed"),
|
||||||
|
_('Could not create burn:///%s/.thumb') % base)
|
||||||
|
return
|
||||||
|
|
||||||
#--------------------------------------------------------
|
#--------------------------------------------------------
|
||||||
def remove_clicked():
|
def remove_clicked():
|
||||||
# File is lost => remove all references and the object itself
|
# File is lost => remove all references and the object itself
|
||||||
mobj = self.db.get_object(self.object_id)
|
mobj = self.db.get_object(self.object_id)
|
||||||
for p in self.db.get_family_id_map().values():
|
for p_id in self.db.get_family_keys:
|
||||||
|
p = self.db.find_family_from_id(p_id)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
|
|
||||||
for key in self.db.get_person_keys():
|
for key in self.db.get_person_keys():
|
||||||
p = self.db.get_person(key)
|
p = self.db.find_person_from_id(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
for key in self.db.get_source_keys():
|
for key in self.db.get_source_keys():
|
||||||
p = self.db.get_source(key)
|
p = self.db.find_source_from_id(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
for key in self.db.get_place_id_keys():
|
for key in self.db.get_place_id_keys():
|
||||||
p = self.db.get_place_id(key)
|
p = self.db.find_place_from_id(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
@ -241,7 +262,8 @@ class PackageWriter:
|
|||||||
# Write media files first, since the database may be modified
|
# Write media files first, since the database may be modified
|
||||||
# during the process (i.e. when removing object)
|
# during the process (i.e. when removing object)
|
||||||
|
|
||||||
for obj in self.db.get_object_map().values():
|
for obj_id in self.db.get_object_keys():
|
||||||
|
obj = self.db.find_object_from_id(obj_id)
|
||||||
oldfile = obj.get_path()
|
oldfile = obj.get_path()
|
||||||
root = os.path.basename(oldfile)
|
root = os.path.basename(oldfile)
|
||||||
if os.path.isfile(oldfile):
|
if os.path.isfile(oldfile):
|
||||||
|
@ -108,29 +108,30 @@ class PackageWriter:
|
|||||||
#--------------------------------------------------------------
|
#--------------------------------------------------------------
|
||||||
def remove_clicked():
|
def remove_clicked():
|
||||||
# File is lost => remove all references and the object itself
|
# File is lost => remove all references and the object itself
|
||||||
mobj = ObjectMap[ObjectId]
|
mobj = self.db.find_family_from_id(ObjectId)
|
||||||
for p in self.db.get_family_id_map().values():
|
for p_id in self.db.get_family_keys():
|
||||||
|
p = self.db.find_family_from_id(p_id)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
for key in self.db.get_person_keys():
|
for key in self.db.get_person_keys():
|
||||||
p = self.db.get_person(key)
|
p = self.db.find_person_from_id(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
for key in self.db.get_source_keys():
|
for key in self.db.get_source_keys():
|
||||||
p = self.db.get_source(key)
|
p = self.db.find_person_from_source(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
nl.remove(o)
|
nl.remove(o)
|
||||||
p.set_media_list(nl)
|
p.set_media_list(nl)
|
||||||
for key in self.db.get_place_id_keys():
|
for key in self.db.get_place_id_keys():
|
||||||
p = self.db.get_place_id(key)
|
p = self.db.find_place_from_id(key)
|
||||||
nl = p.get_media_list()
|
nl = p.get_media_list()
|
||||||
for o in nl:
|
for o in nl:
|
||||||
if o.get_reference() == mobj:
|
if o.get_reference() == mobj:
|
||||||
@ -169,9 +170,8 @@ class PackageWriter:
|
|||||||
|
|
||||||
# Write media files first, since the database may be modified
|
# Write media files first, since the database may be modified
|
||||||
# during the process (i.e. when removing object)
|
# during the process (i.e. when removing object)
|
||||||
ObjectMap = self.db.get_object_map()
|
for ObjectId in self.db.get_object_keys():
|
||||||
for ObjectId in ObjectMap.keys():
|
oldfile = self.db.find_object_from_id(ObjectId).get_path()
|
||||||
oldfile = ObjectMap[ObjectId].get_path()
|
|
||||||
base = os.path.basename(oldfile)
|
base = os.path.basename(oldfile)
|
||||||
if os.path.isfile(oldfile):
|
if os.path.isfile(oldfile):
|
||||||
g = open(oldfile,"rb")
|
g = open(oldfile,"rb")
|
||||||
|
@ -1,327 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
|
|
||||||
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd" >
|
|
||||||
|
|
||||||
<glade-interface>
|
|
||||||
<requires lib="gnome" />
|
|
||||||
|
|
||||||
<widget class="GtkDialog" id="pafExport">
|
|
||||||
<property name="title" translatable="yes">Export PAF for PalmOS file</property>
|
|
||||||
<property name="type">GTK_WINDOW_TOPLEVEL</property>
|
|
||||||
<property name="modal">yes</property>
|
|
||||||
<property name="allow_shrink">no</property>
|
|
||||||
<property name="allow_grow">no</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
<property name="window-position">GTK_WIN_POS_CENTER</property>
|
|
||||||
|
|
||||||
<child internal-child="vbox">
|
|
||||||
<widget class="GtkVBox" id="dialog-vbox1">
|
|
||||||
<property name="homogeneous">no</property>
|
|
||||||
<property name="spacing">8</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child internal-child="action_area">
|
|
||||||
<widget class="GtkHButtonBox" id="dialog-action_area1">
|
|
||||||
<property name="layout_style">GTK_BUTTONBOX_END</property>
|
|
||||||
<property name="spacing">8</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="ok">
|
|
||||||
<property name="can_default">yes</property>
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
<property name="label">gtk-ok</property>
|
|
||||||
<property name="use_stock">yes</property>
|
|
||||||
<property name="use_underline">yes</property>
|
|
||||||
|
|
||||||
<signal name="clicked" handler="on_ok_clicked" object="pafExport" />
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkButton" id="cancel">
|
|
||||||
<property name="can_default">yes</property>
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
<property name="label">gtk-cancel</property>
|
|
||||||
<property name="use_stock">yes</property>
|
|
||||||
<property name="use_underline">yes</property>
|
|
||||||
|
|
||||||
<signal name="clicked" handler="destroy_passed_object" object="pafExport" />
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
<property name="pack_type">GTK_PACK_END</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="vbox1">
|
|
||||||
<property name="homogeneous">no</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="exportTitle">
|
|
||||||
<property name="label" translatable="yes">PAF for PalmOS Export</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
|
||||||
<property name="wrap">no</property>
|
|
||||||
<property name="xalign">0.5</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
|
||||||
<property name="ypad">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHSeparator" id="hseparator1">
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">10</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GnomeFileEntry" id="fileentry1">
|
|
||||||
<property name="history_id">pafExport</property>
|
|
||||||
<property name="modal">yes</property>
|
|
||||||
<property name="width-request">350</property>
|
|
||||||
<property name="directory_entry">no</property>
|
|
||||||
<property name="browse_dialog_title">Export PAF for PalmOS</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child internal-child="entry">
|
|
||||||
<widget class="GtkEntry" id="filename">
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="editable">yes</property>
|
|
||||||
<property name="text" translatable="yes"></property>
|
|
||||||
<property name="max-length">0</property>
|
|
||||||
<property name="visibility">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">5</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame2">
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="label" translatable="yes">Filter</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkOptionMenu" id="filter">
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="history">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child internal-child="menu">
|
|
||||||
<widget class="GtkMenu" id="convertwidget1">
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame3">
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="label" translatable="yes">Information</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="vbox2">
|
|
||||||
<property name="homogeneous">no</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkHBox" id="hbox1">
|
|
||||||
<property name="homogeneous">no</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label1">
|
|
||||||
<property name="label" translatable="yes">Database name: </property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
|
||||||
<property name="wrap">no</property>
|
|
||||||
<property name="xalign">0.5</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">5</property>
|
|
||||||
<property name="ypad">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkEntry" id="dbname">
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="editable">yes</property>
|
|
||||||
<property name="text" translatable="yes"></property>
|
|
||||||
<property name="max-length">20</property>
|
|
||||||
<property name="visibility">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">5</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkLabel" id="label2">
|
|
||||||
<property name="label" translatable="yes">Description</property>
|
|
||||||
<property name="justify">GTK_JUSTIFY_CENTER</property>
|
|
||||||
<property name="wrap">no</property>
|
|
||||||
<property name="xalign">0.5</property>
|
|
||||||
<property name="yalign">0.5</property>
|
|
||||||
<property name="xpad">0</property>
|
|
||||||
<property name="ypad">3</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkEntry" id="description">
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="editable">yes</property>
|
|
||||||
<property name="text" translatable="yes"></property>
|
|
||||||
<property name="max-length">0</property>
|
|
||||||
<property name="visibility">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkFrame" id="frame1">
|
|
||||||
<property name="border_width">5</property>
|
|
||||||
<property name="label" translatable="yes">Options</property>
|
|
||||||
<property name="label_xalign">0</property>
|
|
||||||
<property name="shadow">GTK_SHADOW_ETCHED_IN</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkVBox" id="vbox3">
|
|
||||||
<property name="homogeneous">no</property>
|
|
||||||
<property name="spacing">0</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="private">
|
|
||||||
<property name="border_width">3</property>
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="label" translatable="yes">Do not include records marked private</property>
|
|
||||||
<property name="active">yes</property>
|
|
||||||
<property name="draw_indicator">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
|
|
||||||
<child>
|
|
||||||
<widget class="GtkCheckButton" id="restrict">
|
|
||||||
<property name="border_width">3</property>
|
|
||||||
<property name="can_focus">yes</property>
|
|
||||||
<property name="label" translatable="yes">Restrict information on living people</property>
|
|
||||||
<property name="active">yes</property>
|
|
||||||
<property name="draw_indicator">yes</property>
|
|
||||||
<property name="visible">yes</property>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">no</property>
|
|
||||||
<property name="fill">no</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">0</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
<packing>
|
|
||||||
<property name="padding">4</property>
|
|
||||||
<property name="expand">yes</property>
|
|
||||||
<property name="fill">yes</property>
|
|
||||||
</packing>
|
|
||||||
</child>
|
|
||||||
</widget>
|
|
||||||
</glade-interface>
|
|
Loading…
Reference in New Issue
Block a user