svn: r6703

This commit is contained in:
Don Allingham 2006-05-18 03:14:55 +00:00
parent ad2e6ddbeb
commit ed6e277141
17 changed files with 36 additions and 52 deletions

View File

@ -33,6 +33,7 @@ from gettext import gettext as _
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from _LdsEmbedList import LdsEmbedList from _LdsEmbedList import LdsEmbedList
import RelLib
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -26,6 +26,7 @@
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk import gtk
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -42,15 +43,12 @@ from Filters import SystemFilters, CustomFilters
def build_filter_menu(local_filters = [], default=""): def build_filter_menu(local_filters = [], default=""):
menu = gtk.Menu() menu = gtk.Menu()
active = 0
cnt = 0 cnt = 0
for filt in local_filters: for filt in local_filters:
menuitem = gtk.MenuItem(filt.get_name()) menuitem = gtk.MenuItem(filt.get_name())
menuitem.show() menuitem.show()
menu.append(menuitem) menu.append(menuitem)
menuitem.set_data("filter", filt) menuitem.set_data("filter", filt)
if default != "" and default == filt.get_name():
active = cnt
cnt += 1 cnt += 1
for filt in SystemFilters.get_filters(): for filt in SystemFilters.get_filters():
@ -58,8 +56,6 @@ def build_filter_menu(local_filters = [], default=""):
menuitem.show() menuitem.show()
menu.append(menuitem) menu.append(menuitem)
menuitem.set_data("filter", filt) menuitem.set_data("filter", filt)
if default != "" and default == filt.get_name():
active = cnt
cnt += 1 cnt += 1
for filt in CustomFilters.get_filters(): for filt in CustomFilters.get_filters():
@ -67,8 +63,6 @@ def build_filter_menu(local_filters = [], default=""):
menuitem.show() menuitem.show()
menu.append(menuitem) menu.append(menuitem)
menuitem.set_data("filter", filt) menuitem.set_data("filter", filt)
if default != "" and default == filt.get_name():
active = cnt
cnt += 1 cnt += 1
return menu return menu

View File

@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk import gtk
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk import gtk
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -100,8 +101,8 @@ class FilterWidget:
self.apply_done_callback() self.apply_done_callback()
def on_filter_name_changed(self,obj): def on_filter_name_changed(self,obj):
print "on_filter_name_changed" pass
index = self.filter_list.get_active() # index = self.filter_list.get_active()
# mime_filter = self.filter_model.get_filter(index) # mime_filter = self.filter_model.get_filter(index)
# qual = mime_filter.need_param # qual = mime_filter.need_param
# if qual: # if qual:

View File

@ -33,7 +33,7 @@ class PersonSidebarFilter(SidebarFilter):
def __init__(self, clicked): def __init__(self, clicked):
SidebarFilter.__init__(self) SidebarFilter.__init__(self)
self.clicked = clicked self.clicked_func = clicked
def create_widget(self): def create_widget(self):
self.filter_name = gtk.Entry() self.filter_name = gtk.Entry()
@ -70,13 +70,13 @@ class PersonSidebarFilter(SidebarFilter):
self.filter_name.set_text('') self.filter_name.set_text('')
self.filter_id.set_text('') self.filter_id.set_text('')
self.filter_birth.set_text('') self.filter_birth.set_text('')
self.filter_death.get_text('') self.filter_death.set_text('')
self.filter_note.get_text('') self.filter_note.set_text('')
self.filter_gender.set_active(0) self.filter_gender.set_active(0)
self.etype.set_text('') self.etype.set_text('')
def clicked(self, obj): def clicked(self, obj):
self.clicked() self.clicked_func()
def get_filter(self): def get_filter(self):
name = self.filter_name.get_text().strip() name = self.filter_name.get_text().strip()

View File

@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import gtk import gtk
from gettext import gettext as _
_RETURN = gtk.gdk.keyval_from_name("Return") _RETURN = gtk.gdk.keyval_from_name("Return")

View File

@ -66,7 +66,7 @@ class SidebarFilter:
def clear(self, obj): def clear(self, obj):
pass pass
def clicked(self): def clicked(self, obj):
pass pass
def get_filter(self): def get_filter(self):
@ -78,7 +78,7 @@ class SidebarFilter:
def key_press(self, obj, event): def key_press(self, obj, event):
if event.keyval == _RETURN and not event.state: if event.keyval == _RETURN and not event.state:
self.clicked() self.clicked(obj)
return False return False
def add_entry(self, name, widget): def add_entry(self, name, widget):

View File

@ -33,7 +33,6 @@ from const import system_filters, custom_filters
from _FilterList import FilterList from _FilterList import FilterList
from _GenericFilter import GenericFilter from _GenericFilter import GenericFilter
from _ParamFilter import ParamFilter from _ParamFilter import ParamFilter
import Rules
def reload_system_filters(): def reload_system_filters():
global SystemFilters global SystemFilters

View File

@ -20,6 +20,7 @@
# $Id: __init__.py 6086 2006-03-06 03:54:58Z dallingham $ # $Id: __init__.py 6086 2006-03-06 03:54:58Z dallingham $
from gettext import gettext as _
import RelLib import RelLib
from BasicUtils import UpdateCallback from BasicUtils import UpdateCallback

View File

@ -1721,7 +1721,7 @@ class GrampsDbBase(GrampsDBCallback):
""" """
returns True if the handle exists in the current Repository database. returns True if the handle exists in the current Repository database.
""" """
return self.repository_map.has_key(str(handle)) != False return self.repository_map.has_key(str(handle))
def _sortbyname(self, first, second): def _sortbyname(self, first, second):
name1 = self.person_map.get(str(first))[3].sname name1 = self.person_map.get(str(first))[3].sname

View File

@ -669,7 +669,7 @@ class GedcomParser(UpdateCallback):
return (0,tries) return (0,tries)
def get_next(self): def get_next(self):
if self.backoff == False: if not self.backoff:
self.groups = self.lexer.read() self.groups = self.lexer.read()
self.update() self.update()
@ -707,7 +707,6 @@ class GedcomParser(UpdateCallback):
self.trans = self.db.transaction_begin("",not use_trans,no_magic) self.trans = self.db.transaction_begin("",not use_trans,no_magic)
self.db.disable_signals() self.db.disable_signals()
t = time.time()
self.fam_count = 0 self.fam_count = 0
self.indi_count = 0 self.indi_count = 0
self.repo_count = 0 self.repo_count = 0
@ -731,9 +730,6 @@ class GedcomParser(UpdateCallback):
src.set_note(note) src.set_note(note)
self.db.add_source(src,self.trans) self.db.add_source(src,self.trans)
t = time.time() - t
msg = _('Import Complete: %d seconds') % t
self.db.transaction_commit(self.trans,_("GEDCOM import")) self.db.transaction_commit(self.trans,_("GEDCOM import"))
self.db.enable_signals() self.db.enable_signals()
self.db.request_rebuild() self.db.request_rebuild()
@ -1513,12 +1509,12 @@ class GedcomParser(UpdateCallback):
else: else:
note = "\n%s" % info note = "\n%s" % info
elif matches[1] in (TOKEN__GODP, TOKEN__WITN, TOKEN__WTN): elif matches[1] in (TOKEN__GODP, TOKEN__WITN, TOKEN__WTN):
if matches[2][0] == "@": # if matches[2][0] == "@":
witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1])) # witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
witness = RelLib.Witness(RelLib.Event.ID,witness_handle) # witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
else: # else:
witness = RelLib.Witness(RelLib.Event.NAME,matches[2]) # witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
event.add_witness(witness) # event.add_witness(witness)
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
elif matches[1] in (TOKEN_RELI, TOKEN_TIME, TOKEN_ADDR,TOKEN_IGNORE, elif matches[1] in (TOKEN_RELI, TOKEN_TIME, TOKEN_ADDR,TOKEN_IGNORE,
TOKEN_STAT,TOKEN_TEMP,TOKEN_OBJE): TOKEN_STAT,TOKEN_TEMP,TOKEN_OBJE):
@ -1674,12 +1670,13 @@ class GedcomParser(UpdateCallback):
elif matches[1] == TOKEN_NOTE: elif matches[1] == TOKEN_NOTE:
note = self.parse_note(matches,event,level+1,note) note = self.parse_note(matches,event,level+1,note)
elif matches[1] in (TOKEN__WITN, TOKEN__WTN): elif matches[1] in (TOKEN__WITN, TOKEN__WTN):
if matches[2][0] == "@": pass
witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1])) # if matches[2][0] == "@":
witness = RelLib.Witness(RelLib.Event.ID,witness_handle) # witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
else: # witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
witness = RelLib.Witness(RelLib.Event.NAME,matches[2]) # else:
event.add_witness(witness) # witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
# event.add_witness(witness)
self.ignore_sub_junk(level+1) self.ignore_sub_junk(level+1)
else: else:
self.barf(level+1) self.barf(level+1)
@ -2237,7 +2234,7 @@ class GedcomParser(UpdateCallback):
if int(the_type) == RelLib.EventType.CUSTOM \ if int(the_type) == RelLib.EventType.CUSTOM \
and str(the_type) in self.attrs: and str(the_type) in self.attrs:
attr = RelLib.Attribute() attr = RelLib.Attribute()
attr.set_type((RelLib.EventType.CUSTOM,self.gedattr[n])) attr.set_type((RelLib.EventType.CUSTOM,self.gedattr[matches[2]]))
attr.set_value(event.get_description()) attr.set_value(event.get_description())
state.person.add_attribute(attr) state.person.add_attribute(attr)
else: else:

View File

@ -736,7 +736,6 @@ class GedcomWriter(UpdateCallback):
event = self.db.get_event_from_handle(event_handle) event = self.db.get_event_from_handle(event_handle)
if not event or self.private and event.get_privacy(): if not event or self.private and event.get_privacy():
continue continue
index = int(event.get_type())
val = event.get_type().xml_str() val = event.get_type().xml_str()
if val == "": if val == "":
val = self.target_ged.gramps2tag(name) val = self.target_ged.gramps2tag(name)
@ -807,7 +806,7 @@ class GedcomWriter(UpdateCallback):
if self.adopt == GedcomInfo.ADOPT_LEGACY: if self.adopt == GedcomInfo.ADOPT_LEGACY:
if family.get_handle() in \ if family.get_handle() in \
person.get_parent_family_handle_list(): person.get_parent_family_handle_list():
self.writeln('2 _STAT %s' % f[2]) self.writeln('2 _STAT %s' % child_ref.mrel.xml_str())
for srcref in family.get_source_references(): for srcref in family.get_source_references():
self.write_source_ref(1,srcref) self.write_source_ref(1,srcref)
@ -932,10 +931,9 @@ class GedcomWriter(UpdateCallback):
event = self.db.get_event_from_handle(event_ref.ref) event = self.db.get_event_from_handle(event_ref.ref)
if self.private and event.get_privacy(): if self.private and event.get_privacy():
continue continue
index = int(event.get_type())
val = event.get_type().xml_str() val = event.get_type().xml_str()
if val == "": if val == "":
val = self.target_ged.gramps2tag(index) val = self.target_ged.gramps2tag(int(event.get_type()))
if self.adopt == GedcomInfo.ADOPT_EVENT and val == "ADOP": if self.adopt == GedcomInfo.ADOPT_EVENT and val == "ADOP":
ad = 1 ad = 1
@ -983,7 +981,7 @@ class GedcomWriter(UpdateCallback):
# needed on how to handle this # needed on how to handle this
if event.get_description() != "": if event.get_description() != "":
self.writeln("1 EVEN %s" % self.writeln("1 EVEN %s" %
self.snvtxt(event.get_description())) self.cnvtxt(event.get_description()))
else: else:
self.writeln("1 EVEN") self.writeln("1 EVEN")
self.writeln("2 TYPE %s" % self.cnvtxt(val)) self.writeln("2 TYPE %s" % self.cnvtxt(val))
@ -1384,7 +1382,6 @@ class GedcomWriter(UpdateCallback):
if form: if form:
self.writeln('%d FORM %s' % (level+1, form) ) self.writeln('%d FORM %s' % (level+1, form) )
self.writeln('%d TITL %s' % (level+1, photo_obj.get_description())) self.writeln('%d TITL %s' % (level+1, photo_obj.get_description()))
dirname = os.path.join (self.dirname, self.images_path)
basename = os.path.basename (path) basename = os.path.basename (path)
self.writeln('%d FILE %s' % (level+1,os.path.join(self.images_path, self.writeln('%d FILE %s' % (level+1,os.path.join(self.images_path,
basename))) basename)))

View File

@ -113,10 +113,7 @@ class PageView:
self.action_group.set_visible(True) self.action_group.set_visible(True)
def get_stock(self): def get_stock(self):
try: return gtk.STOCK_MISSING_IMAGE
return gtk.STOCK_MEDIA_MISSING
except AttributeError:
return gtk.STOCK_MISSING_IMAGE
def get_title(self): def get_title(self):
return self.title return self.title
@ -236,7 +233,7 @@ class BookMarkView(PageView):
def enable_action_group(self, obj): def enable_action_group(self, obj):
PageView.enable_action_group(self, obj) PageView.enable_action_group(self, obj)
def disable_action_group(self, obj): def disable_action_group(self):
PageView.disable_action_group(self) PageView.disable_action_group(self)
def define_actions(self): def define_actions(self):
@ -581,7 +578,6 @@ class ListView(BookMarkView):
search=search) search=search)
self.list.set_model(self.model) self.list.set_model(self.model)
colmap = self.column_order()
if handle: if handle:
path = self.model.on_get_path(handle) path = self.model.on_get_path(handle)

View File

@ -92,8 +92,6 @@ def upgrade_prefs():
Config.set(Config.RESEARCHER_NAME, Config.set(Config.RESEARCHER_NAME,
client.get_string('/apps/gramps/researcher-name')) client.get_string('/apps/gramps/researcher-name'))
Config.set(Config.DEFAULTVIEW,
client.get_int('/apps/gramps/defaultview'))
Config.set(Config.AUTOLOAD, Config.set(Config.AUTOLOAD,
client.get_bool('/apps/gramps/autoload')) client.get_bool('/apps/gramps/autoload'))
Config.set(Config.USE_LDS, Config.set(Config.USE_LDS,
@ -109,7 +107,6 @@ def upgrade_prefs():
toolbar = client.get_int('/apps/gramps/toolbar') toolbar = client.get_int('/apps/gramps/toolbar')
if toolbar == 5: if toolbar == 5:
toolbar = -1 toolbar = -1
Config.set(Config.TOOLBAR,toolbar)
Config.set(Config.TOOLBAR_ON, Config.set(Config.TOOLBAR_ON,
client.get_bool('/apps/gramps/toolbar-on')) client.get_bool('/apps/gramps/toolbar-on'))
return True return True

View File

@ -45,7 +45,6 @@ import gtk.glade
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const import const
import Config import Config
import Utils
import ManagedWindow import ManagedWindow
#------------------------------------------------------------------------- #-------------------------------------------------------------------------

View File

@ -51,6 +51,7 @@
# #
#------------------------------------------------------------------------ #------------------------------------------------------------------------
from xml.sax.saxutils import escape from xml.sax.saxutils import escape
from gettext import gettext as _
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #

View File

@ -51,7 +51,6 @@ import gtk.gdk
# Gramps modules # Gramps modules
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
import const
import Mime import Mime
import NameDisplay import NameDisplay
import RelLib import RelLib