diff --git a/gramps.spec b/gramps.spec index 9495707df..3097bbfa2 100644 --- a/gramps.spec +++ b/gramps.spec @@ -1,4 +1,4 @@ -%define ver 0.7.0pre +define ver 0.7.0pre %define rel 1 %define prefix /usr diff --git a/src/Config.py b/src/Config.py index c937eb012..ec124bac4 100644 --- a/src/Config.py +++ b/src/Config.py @@ -114,6 +114,9 @@ db_dir = "./" id_visible = 0 id_edit = 0 index_visible = 0 +mediaref = 1 +globalprop = 1 +localprop = 1 #------------------------------------------------------------------------- # @@ -189,6 +192,9 @@ def loadConfig(call): _callback = call lastfile = get_string("/gramps/data/LastFile") usetabs = get_bool("/gramps/config/UseTabs") + mediaref = get_bool("/gramps/config/MakeReference") + globalprop = get_bool("/gramps/config/DisplayGlobal") + localprop = get_bool("/gramps/config/DisplayLocal") calendar = get_bool("/gramps/config/ShowCalendar") usevc = get_bool("/gramps/config/UseVersionControl") vc_comment = get_bool("/gramps/config/UseComment") @@ -280,6 +286,12 @@ def loadConfig(call): if autoload == None: autoload = 1 + if mediaref == None: + mediaref = 1 + if globalprop == None: + globalprop = 1 + if localprop == None: + localprop =1 if usetabs == None: usetabs = 0 if calendar == None: @@ -395,6 +407,9 @@ def on_propertybox_apply(obj,page): global nameof global owner global usetabs + global mediaref + global globalprop + global localprop global calendar global usevc global iprefix @@ -426,6 +441,9 @@ def on_propertybox_apply(obj,page): display_attr = prefsTop.get_widget("attr_display").get_active() attr_name = string.strip(prefsTop.get_widget("attr_name").get_text()) usetabs = prefsTop.get_widget("usetabs").get_active() + mediaref = prefsTop.get_widget("mediaref").get_active() + localprop = prefsTop.get_widget("localprop").get_active() + globalprop = prefsTop.get_widget("globalprop").get_active() calendar = prefsTop.get_widget("calendar").get_active() usevc = prefsTop.get_widget("use_vc").get_active() vc_comment = prefsTop.get_widget("vc_comment").get_active() @@ -476,6 +494,9 @@ def on_propertybox_apply(obj,page): output_preference = output_obj.get_data(DATA) set_bool("/gramps/config/UseTabs",usetabs) + set_bool("/gramps/config/MakeReference",makeref) + set_bool("/gramps/config/DisplayGlobal",globalprop) + set_bool("/gramps/config/DisplayLocal",localprop) set_bool("/gramps/config/ShowCalendar",calendar) set_bool("/gramps/config/UseVersionControl",usevc) set_bool("/gramps/config/UseComment",vc_comment) @@ -639,6 +660,9 @@ def display_preferences_box(db): idedit = prefsTop.get_widget("gid_edit") index_vis = prefsTop.get_widget("show_child_id") tabs = prefsTop.get_widget("usetabs") + mr = prefsTop.get_widget("mediaref") + dg = prefsTop.get_widget("globalprop") + dl = prefsTop.get_widget("localprop") cal = prefsTop.get_widget("calendar") vc = prefsTop.get_widget("use_vc") vcom = prefsTop.get_widget("vc_comment") @@ -649,6 +673,9 @@ def display_preferences_box(db): auto.set_active(autoload) detail.set_active(show_detail) tabs.set_active(usetabs) + mr.set_active(mediaref) + dg.set_active(globalprop) + dl.set_active(localprop) cal.set_active(calendar) vc.set_active(usevc) vcom.set_active(vc_comment) diff --git a/src/EditPerson.py b/src/EditPerson.py index 6dda0ee5b..9addeef55 100644 --- a/src/EditPerson.py +++ b/src/EditPerson.py @@ -64,7 +64,7 @@ class EditPerson: # window. # #--------------------------------------------------------------------- - def __init__(self,person,db,callback): + def __init__(self,person,db,callback=None): self.person = person self.db = db self.callback = callback @@ -779,7 +779,8 @@ class EditPerson: utils.modified() self.update_lists() - self.callback(self) + if self.callback: + self.callback(self) utils.destroy_passed_object(obj) def on_primary_name_source_clicked(self,obj): diff --git a/src/EditPlace.py b/src/EditPlace.py index 1eb490fb6..5a6c3434f 100644 --- a/src/EditPlace.py +++ b/src/EditPlace.py @@ -47,7 +47,7 @@ _ = gettext #------------------------------------------------------------------------- class EditPlace: - def __init__(self,place,db,func): + def __init__(self,place,db,func=None): self.place = place self.db = db self.callback = func @@ -227,7 +227,8 @@ class EditPlace: self.update_lists() utils.destroy_passed_object(self.top) - self.callback(self.place) + if self.callback: + self.callback(self.place) def on_switch_page(self,obj,a,page): if page == 3 and self.not_loaded: diff --git a/src/EditSource.py b/src/EditSource.py index 2c3e14063..ee85527f7 100644 --- a/src/EditSource.py +++ b/src/EditSource.py @@ -48,7 +48,7 @@ _ = gettext class EditSource: - def __init__(self,source,db,func): + def __init__(self,source,db,func=None): self.source = source self.db = db self.callback = func @@ -211,7 +211,8 @@ class EditSource: utils.modified() utils.destroy_passed_object(self.top) - self.callback(self.source) + if self.callback: + self.callback(self.source) def on_switch_page(self,obj,a,page): if page == 2 and self.not_loaded: diff --git a/src/ImageSelect.py b/src/ImageSelect.py index 882418229..b3858fbff 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -48,6 +48,11 @@ import Config from RelLib import * import RelImage +import EditPerson +import Marriage +import EditPlace +import EditSource + from intl import gettext _ = gettext @@ -274,6 +279,15 @@ class Gallery(ImageSelect): (root,ext) = os.path.splitext(basename) photo.setDescription(root) self.savephoto(photo) + if Config.mediaref == 0: + name = RelImage.import_media_object(name, + self.path, + photo.getId()) + photo.setPath(name) + photo.setLocal(1) + utils.modified() + if Config.globalprop: + GlobalMediaProperties(self.db,photo,None) elif protocol != "": import urllib u = urllib.URLopener() @@ -305,6 +319,8 @@ class Gallery(ImageSelect): return self.add_thumbnail(oref) utils.modified() + if Config.globalprop: + GlobalMediaProperties(self.db,photo,None) else: if self.db.getObjectMap().has_key(data.data): index = 0 @@ -332,6 +348,8 @@ class Gallery(ImageSelect): oref.setReference(self.db.findObjectNoMap(data.data)) self.dataobj.addPhoto(oref) self.add_thumbnail(oref) + if Config.globalprop: + LocalMediaProperties(oref,self.path) utils.modified() w.drag_finish(context, 1, 0, time) else: @@ -597,29 +615,47 @@ class GlobalMediaProperties: self.object.setPath(name) self.object.setLocal(1) self.update_info() - self.update() + if self.update != None: + self.update() def redraw_attr_list(self): utils.redraw_list(self.alist,self.attr_list,disp_attr) + def button_press(self,obj,event): + if len(obj.selection) <= 0: + return + data = obj.get_row_data(obj.selection[0]) + if data != None: + data[0](data[1],data[2]) + def display_refs(self): + index = 0 ref = self.change_dialog.get_widget("refinfo") + ref.connect('button-press-event',self.button_press) for p in self.db.getPersonMap().values(): for o in p.getPhotoList(): if o.getReference() == self.object: ref.append([_("Person"),p.getId(),Config.nameof(p)]) + ref.set_row_data(index,(EditPerson.EditPerson,p,self.db)) + index = index + 1 for p in self.db.getFamilyMap().values(): for o in p.getPhotoList(): if o.getReference() == self.object: ref.append([_("Family"),p.getId(),utils.family_name(p)]) + ref.set_row_data(index,(Marriage.Marriage,p,self.db)) + index = index + 1 for p in self.db.getSourceMap().values(): for o in p.getPhotoList(): if o.getReference() == self.object: ref.append([_("Source"),p.getId(),p.getTitle()]) + ref.set_row_data(index,(EditSource.EditSource,p,self.db)) + index = index + 1 for p in self.db.getPlaceMap().values(): for o in p.getPhotoList(): if o.getReference() == self.object: ref.append([_("Place"),p.getId(),p.get_title()]) + ref.set_row_data(index,(EditPlace.EditPlace,p,self.db)) + index = index + 1 def on_notebook_switch_page(self,obj,junk,page): if page == 3: @@ -636,7 +672,8 @@ class GlobalMediaProperties: if self.lists_changed: self.object.setAttributeList(self.alist) utils.modified() - self.update() + if self.update != None: + self.update() def on_ok_clicked(self, obj): self.on_apply_clicked(obj) @@ -731,7 +768,8 @@ class DeleteMediaQuery: change = 1 if change: p.setPhotoList(nl) - - self.update(0) + + if self.update: + self.update(0) diff --git a/src/MediaView.py b/src/MediaView.py index f393a2ac7..2c095432c 100644 --- a/src/MediaView.py +++ b/src/MediaView.py @@ -20,6 +20,7 @@ import GTK import GDK +import gtk import gnome.ui import string import ImageSelect @@ -139,12 +140,42 @@ class MediaView: self.mdetails.set_text(utils.get_detail_text(mobj,0)) def on_button_press_event(self,obj,event): - if event.button != 1 or event.type != GDK._2BUTTON_PRESS: - return if len(self.media_list.selection) <= 0: return object = self.media_list.get_row_data(self.media_list.selection[0]) - ImageSelect.GlobalMediaProperties(self.db,object,self.load_media) + if event.button == 1 and event.type == GDK._2BUTTON_PRESS: + ImageSelect.GlobalMediaProperties(self.db,object,self.load_media) + elif event.button == 3: + menu = gtk.GtkMenu() + item = gtk.GtkTearoffMenuItem() + item.show() + menu.append(item) + self.obj = object + utils.add_menuitem(menu,_("View in the default viewer"),None,self.popup_view_photo) + if object.getMimeType()[0:5] == "image": + utils.add_menuitem(menu,_("Edit with the GIMP"),\ + None,self.popup_edit_photo) + utils.add_menuitem(menu,_("Edit Object Properties"),None, + self.popup_change_description) + if object.getLocal() == 0: + utils.add_menuitem(menu,_("Convert to local copy"),None, + self.popup_convert_to_private) + menu.popup(None,None,None,0,0) + + def popup_view_photo(self, obj): + utils.view_photo(self.obj) + + def popup_edit_photo(self, obj): + if os.fork() == 0: + os.execvp(const.editor,[const.editor, self.obj.getPath()]) + + def popup_convert_to_private(self, obj): + name = RelImage.import_media_object(self.obj.getPath(),self.path,self.obj.getId()) + self.obj.setPath(name) + self.obj.setLocal(1) + + def popup_change_description(self, obj): + ImageSelect.GlobalMediaProperties(self.db,self.obj,self.load_media) def load_media(self): diff --git a/src/config.glade b/src/config.glade index 0207c5b1d..55bdd0f71 100644 --- a/src/config.glade +++ b/src/config.glade @@ -56,381 +56,83 @@ True - - GtkTable - table13 - 6 - 2 - False - 0 - 0 - - - GtkCheckButton - autoload - True - - toggled - on_object_toggled - propertybox - Sat, 09 Dec 2000 18:11:20 GMT - - - True - True - - 0 - 2 - 0 - 1 - 5 - 5 - False - False - False - False - True - False - - - - - GtkCheckButton - uncompress - True - - toggled - on_object_toggled - propertybox - Sat, 09 Dec 2000 18:11:20 GMT - - - False - True - - 0 - 2 - 1 - 2 - 5 - 5 - False - False - False - False - True - False - - - - - GtkCheckButton - usetabs - True - - toggled - on_object_toggled - propertybox - Thu, 15 Feb 2001 21:32:23 GMT - - - False - True - - 0 - 2 - 2 - 3 - 5 - 5 - False - False - False - False - True - False - - - - - GtkEntry - attr_name - True - - changed - on_object_toggled - propertybox - Thu, 24 May 2001 21:14:30 GMT - - True - True - 0 - - - 1 - 2 - 5 - 6 - 0 - 0 - True - False - False - False - True - False - - - - - GtkCheckButton - gid_edit - True - - toggled - on_object_toggled - propertybox - Thu, 12 Jul 2001 13:42:44 GMT - - - False - True - - 0 - 2 - 4 - 5 - 5 - 5 - False - False - False - False - True - False - - - - - GtkCheckButton - gid_visible - True - - toggled - on_object_toggled - propertybox - Thu, 12 Jul 2001 13:42:44 GMT - - - False - True - - 0 - 2 - 3 - 4 - 5 - 5 - False - False - False - False - True - False - - - - - GtkCheckButton - attr_display - True - - toggled - on_object_toggled - propertybox - Thu, 24 May 2001 21:14:10 GMT - - - False - True - - 0 - 1 - 5 - 6 - 5 - 5 - False - False - False - False - True - False - - - - - - GtkLabel - Notebook:tab - label61 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table27 - 4 - 2 - False - 0 - 0 - - - GtkCheckButton - vc_comment - True - - toggled - on_object_toggled - propertybox - Thu, 04 Oct 2001 13:26:10 GMT - - - False - True - - 0 - 2 - 1 - 2 - 5 - 5 - False - False - False - False - True - False - - - - - GtkCheckButton - use_vc - True - - toggled - on_object_toggled - propertybox - Tue, 02 Oct 2001 14:14:35 GMT - - - False - True - - 0 - 1 - 0 - 1 - 5 - 5 - False - False - False - False - True - False - - - - - GtkOptionMenu - vc_menu - True - RCS - - 0 - - 1 - 2 - 0 - 1 - 5 - 5 - False - False - False - False - True - False - - - - - - GtkLabel - Notebook:tab - label209 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - GtkVBox - vbox24 + vbox29 False 0 GtkFrame - frame5 - + frame14 + 5 + 0 GTK_SHADOW_ETCHED_IN 5 - True + False True GtkTable - table23 - 2 + table13 + 3 2 False 0 0 - GtkLabel - label199 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 5 + GtkCheckButton + uncompress + True + + toggled + on_object_toggled + propertybox + Sat, 09 Dec 2000 18:11:20 GMT + + + False + True 0 - 1 + 2 + 1 + 2 + 3 + 3 + False + False + False + False + True + False + + + + + GtkCheckButton + autoload + True + + toggled + on_object_toggled + propertybox + Sat, 09 Dec 2000 18:11:20 GMT + + + True + True + + 0 + 2 0 1 - 0 - 0 + 3 + 3 False False False @@ -442,21 +144,21 @@ GtkLabel - label200 - + label205 + GTK_JUSTIFY_CENTER False 1 0.5 - 5 - 5 + 0 + 0 0 1 - 1 - 2 - 0 - 0 + 2 + 3 + 3 + 3 False False False @@ -467,19 +169,20 @@ - GtkOptionMenu - date_format - True - - - 0 + GnomeFileEntry + dbdir + dbdir + 10 + Gramps - Select default database directory + True + False 1 2 - 0 - 1 - 5 - 5 + 2 + 3 + 3 + 3 True False False @@ -487,37 +190,33 @@ True False - - - GtkOptionMenu - name_format - True - - - 0 - - 1 - 2 - 1 - 2 - 5 - 5 - True - False - False - False - True - False - + + GtkEntry + GnomeEntry:entry + combo-entry1 + The default directory for storing databases + True + + changed + on_object_toggled + propertybox + Thu, 28 Jun 2001 13:50:08 GMT + + True + True + 0 + + GtkFrame - frame6 - + frame12 + 5 + 0 GTK_SHADOW_ETCHED_IN @@ -526,46 +225,115 @@ True + + GtkVBox + vbox31 + False + 0 + + + GtkCheckButton + usetabs + 3 + True + + toggled + on_object_toggled + propertybox + Thu, 15 Feb 2001 21:32:23 GMT + + + False + True + + 5 + False + False + + + + + GtkHBox + hbox1 + False + 0 + + 0 + True + True + + + + GtkCheckButton + attr_display + True + + toggled + on_object_toggled + propertybox + Thu, 24 May 2001 21:14:10 GMT + + + False + True + + 3 + False + False + + + + + GtkEntry + attr_name + True + + changed + on_object_toggled + propertybox + Thu, 24 May 2001 21:14:30 GMT + + True + True + 0 + + + 5 + True + True + + + + + + + + GtkFrame + frame11 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 5 + False + True + + GtkTable - table24 - 1 + table27 + 2 2 False 0 0 - - GtkLabel - label201 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 5 - 5 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - GtkOptionMenu - date_entry_format + vc_menu True - + RCS 0 @@ -575,7 +343,7 @@ 1 5 5 - True + False False False False @@ -583,44 +351,62 @@ False - - - - - GtkFrame - frame10 - - 0 - GTK_SHADOW_ETCHED_IN - - 5 - True - True - - - - GtkVBox - vbox28 - False - 0 GtkCheckButton - calendar + use_vc True toggled on_object_toggled propertybox - Tue, 20 Nov 2001 16:35:48 GMT + Tue, 02 Oct 2001 14:14:35 GMT - + False True - 5 - False - False + 0 + 1 + 0 + 1 + 3 + 3 + False + False + False + False + True + False + + + + + GtkCheckButton + vc_comment + True + + toggled + on_object_toggled + propertybox + Thu, 04 Oct 2001 13:26:10 GMT + + + False + True + + 0 + 2 + 1 + 2 + 3 + 3 + False + False + False + False + True + False @@ -630,339 +416,8 @@ GtkLabel Notebook:tab - label187 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkVBox - vbox27 - False - 0 - - - GtkFrame - frame9 - - 0 - GTK_SHADOW_ETCHED_IN - - 5 - True - True - - - - GtkTable - table28 - 5 - 2 - False - 0 - 0 - - - GtkLabel - label210 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 2 - 2 - - 0 - 1 - 0 - 1 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - iprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 13:59:28 GMT - - True - True - 0 - I - - 1 - 2 - 0 - 1 - 2 - 2 - True - False - False - False - True - False - - - - - GtkEntry - fprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:26 GMT - - True - True - 0 - F - - 1 - 2 - 1 - 2 - 2 - 2 - True - False - False - False - True - False - - - - - GtkEntry - pprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:13 GMT - - True - True - 0 - P - - 1 - 2 - 2 - 3 - 2 - 2 - True - False - False - False - True - False - - - - - GtkLabel - label211 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 2 - 2 - - 0 - 1 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label212 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 2 - 2 - - 0 - 1 - 2 - 3 - 0 - 0 - False - False - False - False - True - False - - - - - GtkLabel - label213 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 2 - 2 - - 0 - 1 - 3 - 4 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - sprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:00:46 GMT - - True - True - 0 - S - - 1 - 2 - 3 - 4 - 0 - 0 - True - False - False - False - True - False - - - - - GtkLabel - label214 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 2 - 2 - - 0 - 1 - 4 - 5 - 0 - 0 - False - False - False - False - True - False - - - - - GtkEntry - oprefix - True - - changed - on_object_toggled - propertybox - Sat, 20 Oct 2001 14:01:09 GMT - - True - True - 0 - O - - 1 - 2 - 4 - 5 - 0 - 0 - True - False - False - False - True - False - - - - - - - Placeholder - - - - Placeholder - - - - - GtkLabel - Notebook:tab - label216 - + label61 + GTK_JUSTIFY_CENTER False 0.5 @@ -980,6 +435,115 @@ 0 0 + + GtkFrame + frame8 + + 0 + GTK_SHADOW_ETCHED_IN + + 1 + 2 + 1 + 2 + 5 + 5 + False + False + False + False + True + True + + + + GtkVBox + vbox26 + False + 0 + + + GtkCheckButton + display_altnames + True + + toggled + on_object_toggled + propertybox + Sun, 22 Apr 2001 21:20:17 GMT + + + False + True + + 0 + False + False + + + + + GtkCheckButton + showdetail + True + + toggled + on_object_toggled + propertybox + Sat, 09 Jun 2001 14:12:06 GMT + + + False + True + + 0 + False + False + + + + + GtkCheckButton + show_child_id + True + + toggled + on_object_toggled + propertybox + Mon, 29 Oct 2001 22:58:03 GMT + + + False + True + + 0 + False + False + + + + + GtkCheckButton + gid_visible + True + + toggled + on_object_toggled + propertybox + Thu, 12 Jul 2001 13:42:44 GMT + + + False + True + + 0 + False + False + + + + + GtkFrame frame7 @@ -994,7 +558,7 @@ 5 5 True - True + False False False True @@ -1085,7 +649,7 @@ 2 5 5 - False + True True False False @@ -1407,89 +971,256 @@ + + + + GtkLabel + Notebook:tab + label194 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox24 + False + 0 GtkFrame - frame8 - + frame5 + 5 + 0 GTK_SHADOW_ETCHED_IN - 1 - 2 - 1 - 2 - 5 - 5 - False - False - False - False - True - True + 5 + False + True + + + + GtkTable + table23 + 2 + 2 + False + 0 + 0 + + + GtkLabel + label199 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 5 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label200 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 5 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkOptionMenu + date_format + True + + + 0 + + 1 + 2 + 0 + 1 + 5 + 5 + True + False + False + False + True + False + + + + + GtkOptionMenu + name_format + True + + + 0 + + 1 + 2 + 1 + 2 + 5 + 5 + True + False + False + False + True + False + + + + + + + GtkFrame + frame6 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkTable + table24 + 1 + 2 + False + 0 + 0 + + + GtkLabel + label201 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 5 + 5 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkOptionMenu + date_entry_format + True + + + 0 + + 1 + 2 + 0 + 1 + 5 + 5 + True + False + False + False + True + False + + + + + + + GtkFrame + frame10 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 5 + False + True GtkVBox - vbox26 + vbox28 False 0 GtkCheckButton - display_altnames + calendar True toggled on_object_toggled propertybox - Sun, 22 Apr 2001 21:20:17 GMT + Tue, 20 Nov 2001 16:35:48 GMT - + False True - 0 - False - False - - - - - GtkCheckButton - showdetail - True - - toggled - on_object_toggled - propertybox - Sat, 09 Jun 2001 14:12:06 GMT - - - False - True - - 0 - False - False - - - - - GtkCheckButton - show_child_id - True - - toggled - on_object_toggled - propertybox - Mon, 29 Oct 2001 22:58:03 GMT - - - False - True - - 0 + 5 False False @@ -1501,8 +1232,8 @@ GtkLabel Notebook:tab - label194 - + label187 + GTK_JUSTIFY_CENTER False 0.5 @@ -1985,7 +1716,7 @@ GtkTable table25 - 2 + 4 2 False 0 @@ -2092,71 +1823,6 @@ AbiWord False - - - - GtkLabel - Notebook:tab - label202 - - GTK_JUSTIFY_CENTER - False - 0.5 - 0.5 - 0 - 0 - - - - GtkTable - table26 - 3 - 2 - False - 0 - 0 - - - GnomeFileEntry - dbdir - dbdir - 10 - Gramps - Select default database directory - True - False - - 1 - 2 - 0 - 1 - 5 - 5 - True - False - False - False - True - False - - - - GtkEntry - GnomeEntry:entry - combo-entry1 - The default directory for storing databases - True - - changed - on_object_toggled - propertybox - Thu, 28 Jun 2001 13:50:08 GMT - - True - True - 0 - - - GnomeFileEntry @@ -2169,8 +1835,8 @@ AbiWord 1 2 - 1 - 2 + 2 + 3 5 5 True @@ -2200,84 +1866,6 @@ AbiWord - - GtkLabel - label205 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 0 - 1 - 5 - 5 - False - False - False - False - True - False - - - - - GtkLabel - label206 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 1 - 2 - 5 - 5 - False - False - False - False - True - False - - - - - GtkLabel - label208 - - GTK_JUSTIFY_CENTER - False - 1 - 0.5 - 0 - 0 - - 0 - 1 - 2 - 3 - 5 - 5 - False - False - False - False - True - False - - - GnomeFileEntry htmldir @@ -2289,8 +1877,8 @@ AbiWord 1 2 - 2 - 3 + 3 + 4 5 5 True @@ -2319,13 +1907,555 @@ AbiWord + + + GtkLabel + label206 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + 1 + 2 + 3 + 5 + 5 + False + False + False + False + True + False + + + + + GtkLabel + label208 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 0 + 0 + + 0 + 1 + 3 + 4 + 5 + 5 + False + False + False + False + True + False + + GtkLabel Notebook:tab - label207 - + label202 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox32 + False + 0 + + + GtkFrame + frame15 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkVBox + vbox33 + False + 0 + + + GtkRadioButton + mediaref + 5 + True + + True + True + ref + + 0 + False + False + + + + + GtkRadioButton + mediacopy + 5 + True + + False + True + ref + + 0 + False + False + + + + + GtkCheckButton + globalprop + 5 + True + + True + True + + 0 + False + False + + + + + + + GtkFrame + frame16 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkVBox + vbox34 + False + 0 + + + GtkCheckButton + localprop + 5 + True + + True + True + + 0 + False + False + + + + + + + + GtkLabel + Notebook:tab + label209 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox27 + False + 0 + + + GtkFrame + frame9 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 5 + False + True + + + + GtkTable + table28 + 5 + 2 + False + 0 + 0 + + + GtkLabel + label210 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 2 + 2 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + iprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 13:59:28 GMT + + True + True + 0 + I + + 1 + 2 + 0 + 1 + 2 + 2 + True + False + False + False + True + False + + + + + GtkEntry + fprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:26 GMT + + True + True + 0 + F + + 1 + 2 + 1 + 2 + 2 + 2 + True + False + False + False + True + False + + + + + GtkEntry + pprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:13 GMT + + True + True + 0 + P + + 1 + 2 + 2 + 3 + 2 + 2 + True + False + False + False + True + False + + + + + GtkLabel + label211 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 2 + 2 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label212 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 2 + 2 + + 0 + 1 + 2 + 3 + 0 + 0 + False + False + False + False + True + False + + + + + GtkLabel + label213 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 2 + 2 + + 0 + 1 + 3 + 4 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + sprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:00:46 GMT + + True + True + 0 + S + + 1 + 2 + 3 + 4 + 0 + 0 + True + False + False + False + True + False + + + + + GtkLabel + label214 + + GTK_JUSTIFY_CENTER + False + 1 + 0.5 + 2 + 2 + + 0 + 1 + 4 + 5 + 0 + 0 + False + False + False + False + True + False + + + + + GtkEntry + oprefix + True + + changed + on_object_toggled + propertybox + Sat, 20 Oct 2001 14:01:09 GMT + + True + True + 0 + O + + 1 + 2 + 4 + 5 + 0 + 0 + True + False + False + False + True + False + + + + + + + GtkFrame + frame13 + 5 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkVBox + vbox30 + False + 0 + + + GtkCheckButton + gid_edit + 5 + True + + toggled + on_object_toggled + propertybox + Thu, 12 Jul 2001 13:42:44 GMT + + + False + True + + 0 + False + False + + + + + + + + GtkLabel + Notebook:tab + label216 + GTK_JUSTIFY_CENTER False 0.5 @@ -2382,7 +2512,7 @@ information. 225,219,197 191,191,191 255,255,255 - gramps.xpm + gramps.png splash.jpg diff --git a/src/plugins/WriteGedcom.py b/src/plugins/WriteGedcom.py index 512650307..857a85fd4 100644 --- a/src/plugins/WriteGedcom.py +++ b/src/plugins/WriteGedcom.py @@ -61,17 +61,21 @@ _ALT_EVENT_AKA = 4 _CAL_NO = 0 _CAL_YES = 1 +_EVEN_NONE = 0 +_EVEN_GED = 1 +_EVEN_FTW = 2 + targets = [ - ("Standard GEDCOM 5.5", "GEDCOM 5.5", _ADOPT_EVENT_EXT, _CONC_OK, _ALT_STD, _CAL_YES), - ("Brother's Keeper", "BROSKEEP", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO), - ("Family Origins", "FamilyOrigins", _ADOPT_EVENT, _CONC_BROKEN, _ALT_EVENT_AKA, _CAL_NO), - ("Family Tree Maker", "FTW", _ADOPT_FTW, _CONC_BROKEN, _ALT_ALIAS, _CAL_NO), - ("Ftree", "", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO), - ("GeneWeb", "", _ADOPT_NONE, _CONC_OK, _ALT_NONE, _CAL_YES), - ("Legacy", "Legacy", _ADOPT_LEGACY, _CONC_BROKEN, _ALT_STD, _CAL_NO), - ("Personal Ancestral File", "PAF", _ADOPT_PEDI, _CONC_OK, _ALT_AKA, _CAL_NO), - ("Reunion", "REUNION", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO), - ("Visual Genealogie", "", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO), + ("Standard GEDCOM 5.5", "GEDCOM 5.5", _ADOPT_EVENT_EXT, _CONC_OK, _ALT_STD, _CAL_YES, _EVEN_GED), + ("Brother's Keeper", "BROSKEEP", _ADOPT_NONE, _CONC_OK, _ALT_NONE, _CAL_NO, _EVEN_GED), + ("Family Origins", "FamilyOrigins", _ADOPT_EVENT, _CONC_BROKEN, _ALT_EVENT_AKA, _CAL_NO, _EVEN_GED), + ("Family Tree Maker", "FTW", _ADOPT_FTW, _CONC_BROKEN, _ALT_ALIAS, _CAL_NO, _EVEN_FTW), + ("Ftree", "", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO, _EVEN_GED), + ("GeneWeb", "", _ADOPT_EVENT_EXT, _CONC_OK, _ALT_NONE, _CAL_YES, _EVEN_GED), + ("Legacy", "Legacy", _ADOPT_LEGACY, _CONC_BROKEN, _ALT_STD, _CAL_NO, _EVEN_GED), + ("Personal Ancestral File", "PAF", _ADOPT_PEDI, _CONC_OK, _ALT_AKA, _CAL_NO, _EVEN_GED), + ("Reunion", "REUNION", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO, _EVEN_GED), + ("Visual Genealogie", "", _ADOPT_NONE, _CONC_BROKEN, _ALT_NONE, _CAL_NO, _EVEN_GED), ] #------------------------------------------------------------------------- @@ -447,10 +451,10 @@ class GedcomWriter: target_obj = self.topDialog.get_widget("target") myMenu = gtk.GtkMenu() - for (name,dest,adopt,conc,alt,cal) in targets: + for (name,dest,adopt,conc,alt,cal,even) in targets: menuitem = gtk.GtkMenuItem(name) myMenu.append(menuitem) - menuitem.set_data("data",(dest,adopt,conc,alt,cal)) + menuitem.set_data("data",(dest,adopt,conc,alt,cal,even)) menuitem.show() target_obj.set_menu(myMenu) @@ -465,7 +469,7 @@ class GedcomWriter: filter = self.filter_menu.get_active().get_data("filter") act_tgt = self.target_menu.get_active() - (self.dest,self.adopt,self.conc,self.altname,self.cal) = act_tgt.get_data("data") + (self.dest,self.adopt,self.conc,self.altname,self.cal,self.even) = act_tgt.get_data("data") if self.topDialog.get_widget("ansel").get_active(): self.cnvtxt = latin_to_ansel @@ -600,13 +604,19 @@ class GedcomWriter: if const.familyConstantEvents.has_key(name): val = const.familyConstantEvents[name] + if val[0] == '_' and self.even != _EVEN_FTW: + val = '' else: val = "" - if val != "": - self.g.write("1 %s\n" % const.familyConstantEvents[name]) - else: - self.g.write("1 EVEN\n") - self.g.write("2 TYPE %s\n" % self.cnvtxt(name)) + + if val != "": + if self.even == _EVEN_NONE: + continue + self.g.write("1 %s %s\n" % (self.cnvtxt(val), + self.cnvtxt(event.getDescription()))) + else: + self.g.write("1 EVEN %s\n" % self.cnvtxt(event.getDescription())) + self.g.write("2 TYPE %s\n" % self.cnvtxt(name)) self.dump_event_stats(event) @@ -696,8 +706,11 @@ class GedcomWriter: name = event.getName() if const.personalConstantEvents.has_key(name): val = const.personalConstantEvents[name] + if val[0] == '_' and self.even != _EVEN_FTW: + val = '' else: val = "" + if self.adopt == _ADOPT_EVENT and val == "ADOP": ad = 1 self.g.write('1 ADOP\n') @@ -717,6 +730,8 @@ class GedcomWriter: else: self.g.write('3 ADOP HUSB\n') elif val != "" : + if self.even == _EVEN_NONE: + continue self.g.write("1 %s %s\n" % (self.cnvtxt(val),\ self.cnvtxt(event.getDescription()))) else: