svn: r6703
This commit is contained in:
parent
ad2e6ddbeb
commit
ed6e277141
@ -33,6 +33,7 @@ from gettext import gettext as _
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from _LdsEmbedList import LdsEmbedList
|
||||
import RelLib
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -26,6 +26,7 @@
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -42,15 +43,12 @@ from Filters import SystemFilters, CustomFilters
|
||||
def build_filter_menu(local_filters = [], default=""):
|
||||
menu = gtk.Menu()
|
||||
|
||||
active = 0
|
||||
cnt = 0
|
||||
for filt in local_filters:
|
||||
menuitem = gtk.MenuItem(filt.get_name())
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
if default != "" and default == filt.get_name():
|
||||
active = cnt
|
||||
cnt += 1
|
||||
|
||||
for filt in SystemFilters.get_filters():
|
||||
@ -58,8 +56,6 @@ def build_filter_menu(local_filters = [], default=""):
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
if default != "" and default == filt.get_name():
|
||||
active = cnt
|
||||
cnt += 1
|
||||
|
||||
for filt in CustomFilters.get_filters():
|
||||
@ -67,8 +63,6 @@ def build_filter_menu(local_filters = [], default=""):
|
||||
menuitem.show()
|
||||
menu.append(menuitem)
|
||||
menuitem.set_data("filter", filt)
|
||||
if default != "" and default == filt.get_name():
|
||||
active = cnt
|
||||
cnt += 1
|
||||
|
||||
return menu
|
||||
|
@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
@ -100,8 +101,8 @@ class FilterWidget:
|
||||
self.apply_done_callback()
|
||||
|
||||
def on_filter_name_changed(self,obj):
|
||||
print "on_filter_name_changed"
|
||||
index = self.filter_list.get_active()
|
||||
pass
|
||||
# index = self.filter_list.get_active()
|
||||
# mime_filter = self.filter_model.get_filter(index)
|
||||
# qual = mime_filter.need_param
|
||||
# if qual:
|
||||
|
@ -33,7 +33,7 @@ class PersonSidebarFilter(SidebarFilter):
|
||||
|
||||
def __init__(self, clicked):
|
||||
SidebarFilter.__init__(self)
|
||||
self.clicked = clicked
|
||||
self.clicked_func = clicked
|
||||
|
||||
def create_widget(self):
|
||||
self.filter_name = gtk.Entry()
|
||||
@ -70,13 +70,13 @@ class PersonSidebarFilter(SidebarFilter):
|
||||
self.filter_name.set_text('')
|
||||
self.filter_id.set_text('')
|
||||
self.filter_birth.set_text('')
|
||||
self.filter_death.get_text('')
|
||||
self.filter_note.get_text('')
|
||||
self.filter_death.set_text('')
|
||||
self.filter_note.set_text('')
|
||||
self.filter_gender.set_active(0)
|
||||
self.etype.set_text('')
|
||||
|
||||
def clicked(self, obj):
|
||||
self.clicked()
|
||||
self.clicked_func()
|
||||
|
||||
def get_filter(self):
|
||||
name = self.filter_name.get_text().strip()
|
||||
|
@ -30,6 +30,7 @@ Package providing filtering framework for GRAMPS.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
|
||||
_RETURN = gtk.gdk.keyval_from_name("Return")
|
||||
|
||||
|
@ -66,7 +66,7 @@ class SidebarFilter:
|
||||
def clear(self, obj):
|
||||
pass
|
||||
|
||||
def clicked(self):
|
||||
def clicked(self, obj):
|
||||
pass
|
||||
|
||||
def get_filter(self):
|
||||
@ -78,7 +78,7 @@ class SidebarFilter:
|
||||
|
||||
def key_press(self, obj, event):
|
||||
if event.keyval == _RETURN and not event.state:
|
||||
self.clicked()
|
||||
self.clicked(obj)
|
||||
return False
|
||||
|
||||
def add_entry(self, name, widget):
|
||||
|
@ -33,7 +33,6 @@ from const import system_filters, custom_filters
|
||||
from _FilterList import FilterList
|
||||
from _GenericFilter import GenericFilter
|
||||
from _ParamFilter import ParamFilter
|
||||
import Rules
|
||||
|
||||
def reload_system_filters():
|
||||
global SystemFilters
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
# $Id: __init__.py 6086 2006-03-06 03:54:58Z dallingham $
|
||||
|
||||
from gettext import gettext as _
|
||||
|
||||
import RelLib
|
||||
from BasicUtils import UpdateCallback
|
||||
|
@ -1721,7 +1721,7 @@ class GrampsDbBase(GrampsDBCallback):
|
||||
"""
|
||||
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):
|
||||
name1 = self.person_map.get(str(first))[3].sname
|
||||
|
@ -669,7 +669,7 @@ class GedcomParser(UpdateCallback):
|
||||
return (0,tries)
|
||||
|
||||
def get_next(self):
|
||||
if self.backoff == False:
|
||||
if not self.backoff:
|
||||
self.groups = self.lexer.read()
|
||||
self.update()
|
||||
|
||||
@ -707,7 +707,6 @@ class GedcomParser(UpdateCallback):
|
||||
self.trans = self.db.transaction_begin("",not use_trans,no_magic)
|
||||
|
||||
self.db.disable_signals()
|
||||
t = time.time()
|
||||
self.fam_count = 0
|
||||
self.indi_count = 0
|
||||
self.repo_count = 0
|
||||
@ -731,9 +730,6 @@ class GedcomParser(UpdateCallback):
|
||||
src.set_note(note)
|
||||
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.enable_signals()
|
||||
self.db.request_rebuild()
|
||||
@ -1513,12 +1509,12 @@ class GedcomParser(UpdateCallback):
|
||||
else:
|
||||
note = "\n%s" % info
|
||||
elif matches[1] in (TOKEN__GODP, TOKEN__WITN, TOKEN__WTN):
|
||||
if matches[2][0] == "@":
|
||||
witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
|
||||
witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
|
||||
else:
|
||||
witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
|
||||
event.add_witness(witness)
|
||||
# if matches[2][0] == "@":
|
||||
# witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
|
||||
# witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
|
||||
# else:
|
||||
# witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
|
||||
# event.add_witness(witness)
|
||||
self.ignore_sub_junk(level+1)
|
||||
elif matches[1] in (TOKEN_RELI, TOKEN_TIME, TOKEN_ADDR,TOKEN_IGNORE,
|
||||
TOKEN_STAT,TOKEN_TEMP,TOKEN_OBJE):
|
||||
@ -1674,12 +1670,13 @@ class GedcomParser(UpdateCallback):
|
||||
elif matches[1] == TOKEN_NOTE:
|
||||
note = self.parse_note(matches,event,level+1,note)
|
||||
elif matches[1] in (TOKEN__WITN, TOKEN__WTN):
|
||||
if matches[2][0] == "@":
|
||||
witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
|
||||
witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
|
||||
else:
|
||||
witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
|
||||
event.add_witness(witness)
|
||||
pass
|
||||
# if matches[2][0] == "@":
|
||||
# witness_handle = self.find_person_handle(self.map_gid(matches[2][1:-1]))
|
||||
# witness = RelLib.Witness(RelLib.Event.ID,witness_handle)
|
||||
# else:
|
||||
# witness = RelLib.Witness(RelLib.Event.NAME,matches[2])
|
||||
# event.add_witness(witness)
|
||||
self.ignore_sub_junk(level+1)
|
||||
else:
|
||||
self.barf(level+1)
|
||||
@ -2237,7 +2234,7 @@ class GedcomParser(UpdateCallback):
|
||||
if int(the_type) == RelLib.EventType.CUSTOM \
|
||||
and str(the_type) in self.attrs:
|
||||
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())
|
||||
state.person.add_attribute(attr)
|
||||
else:
|
||||
|
@ -736,7 +736,6 @@ class GedcomWriter(UpdateCallback):
|
||||
event = self.db.get_event_from_handle(event_handle)
|
||||
if not event or self.private and event.get_privacy():
|
||||
continue
|
||||
index = int(event.get_type())
|
||||
val = event.get_type().xml_str()
|
||||
if val == "":
|
||||
val = self.target_ged.gramps2tag(name)
|
||||
@ -807,7 +806,7 @@ class GedcomWriter(UpdateCallback):
|
||||
if self.adopt == GedcomInfo.ADOPT_LEGACY:
|
||||
if family.get_handle() in \
|
||||
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():
|
||||
self.write_source_ref(1,srcref)
|
||||
@ -932,10 +931,9 @@ class GedcomWriter(UpdateCallback):
|
||||
event = self.db.get_event_from_handle(event_ref.ref)
|
||||
if self.private and event.get_privacy():
|
||||
continue
|
||||
index = int(event.get_type())
|
||||
val = event.get_type().xml_str()
|
||||
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":
|
||||
ad = 1
|
||||
@ -983,7 +981,7 @@ class GedcomWriter(UpdateCallback):
|
||||
# needed on how to handle this
|
||||
if event.get_description() != "":
|
||||
self.writeln("1 EVEN %s" %
|
||||
self.snvtxt(event.get_description()))
|
||||
self.cnvtxt(event.get_description()))
|
||||
else:
|
||||
self.writeln("1 EVEN")
|
||||
self.writeln("2 TYPE %s" % self.cnvtxt(val))
|
||||
@ -1384,7 +1382,6 @@ class GedcomWriter(UpdateCallback):
|
||||
if form:
|
||||
self.writeln('%d FORM %s' % (level+1, form) )
|
||||
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)
|
||||
self.writeln('%d FILE %s' % (level+1,os.path.join(self.images_path,
|
||||
basename)))
|
||||
|
@ -113,9 +113,6 @@ class PageView:
|
||||
self.action_group.set_visible(True)
|
||||
|
||||
def get_stock(self):
|
||||
try:
|
||||
return gtk.STOCK_MEDIA_MISSING
|
||||
except AttributeError:
|
||||
return gtk.STOCK_MISSING_IMAGE
|
||||
|
||||
def get_title(self):
|
||||
@ -236,7 +233,7 @@ class BookMarkView(PageView):
|
||||
def 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)
|
||||
|
||||
def define_actions(self):
|
||||
@ -581,7 +578,6 @@ class ListView(BookMarkView):
|
||||
search=search)
|
||||
|
||||
self.list.set_model(self.model)
|
||||
colmap = self.column_order()
|
||||
|
||||
if handle:
|
||||
path = self.model.on_get_path(handle)
|
||||
|
@ -92,8 +92,6 @@ def upgrade_prefs():
|
||||
Config.set(Config.RESEARCHER_NAME,
|
||||
client.get_string('/apps/gramps/researcher-name'))
|
||||
|
||||
Config.set(Config.DEFAULTVIEW,
|
||||
client.get_int('/apps/gramps/defaultview'))
|
||||
Config.set(Config.AUTOLOAD,
|
||||
client.get_bool('/apps/gramps/autoload'))
|
||||
Config.set(Config.USE_LDS,
|
||||
@ -109,7 +107,6 @@ def upgrade_prefs():
|
||||
toolbar = client.get_int('/apps/gramps/toolbar')
|
||||
if toolbar == 5:
|
||||
toolbar = -1
|
||||
Config.set(Config.TOOLBAR,toolbar)
|
||||
Config.set(Config.TOOLBAR_ON,
|
||||
client.get_bool('/apps/gramps/toolbar-on'))
|
||||
return True
|
||||
|
@ -45,7 +45,6 @@ import gtk.glade
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Config
|
||||
import Utils
|
||||
import ManagedWindow
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
|
@ -51,6 +51,7 @@
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from xml.sax.saxutils import escape
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
|
@ -51,7 +51,6 @@ import gtk.gdk
|
||||
# Gramps modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
import const
|
||||
import Mime
|
||||
import NameDisplay
|
||||
import RelLib
|
||||
|
Loading…
Reference in New Issue
Block a user