Gallery drag/drop functionality

svn: r1169
This commit is contained in:
Don Allingham 2002-11-08 03:42:25 +00:00
parent 2f9f1660ee
commit 9b2933bee0
11 changed files with 2491 additions and 2616 deletions

Binary file not shown.

View File

@ -1426,7 +1426,6 @@ def disp_url(url):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def disp_attr(attr): def disp_attr(attr):
detail = Utils.get_detail_flags(attr)
return [const.display_pattr(attr.getType()),attr.getValue()] return [const.display_pattr(attr.getType()),attr.getValue()]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
@ -1444,7 +1443,6 @@ def disp_addr(addr):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def disp_event(event): def disp_event(event):
attr = Utils.get_detail_flags(event)
return [const.display_pevent(event.getName()),event.getDescription(), return [const.display_pevent(event.getName()),event.getDescription(),
event.getQuoteDate(),event.getPlaceName()] event.getQuoteDate(),event.getPlaceName()]

View File

@ -62,6 +62,7 @@ from intl import gettext as _
_IMAGEX = 140 _IMAGEX = 140
_IMAGEY = 150 _IMAGEY = 150
_PAD = 5
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -78,7 +79,10 @@ class ImageSelect:
self.db = db self.db = db
self.dataobj = None self.dataobj = None
self.parent = parent self.parent = parent
self.canvas_list = [] self.canvas_list = {}
self.item_map = {}
self.item_map = {}
self.p_map = {}
def add_thumbnail(self, photo): def add_thumbnail(self, photo):
"should be overrridden" "should be overrridden"
@ -189,6 +193,13 @@ class ImageSelect:
"""Save the photo in the dataobj object - must be overridden""" """Save the photo in the dataobj object - must be overridden"""
pass pass
_drag_targets = [
('STRING', 0, 0),
('text/plain',0,0),
('text/uri-list',0,2),
('application/x-rootwin-drop',0,1)]
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
# Gallery class - This class handles all the logic underlying a # Gallery class - This class handles all the logic underlying a
@ -200,19 +211,12 @@ class Gallery(ImageSelect):
def __init__(self, dataobj, path, icon_list, db, parent): def __init__(self, dataobj, path, icon_list, db, parent):
ImageSelect.__init__(self, path, db, parent) ImageSelect.__init__(self, path, db, parent)
t = [
('STRING', 0, 0),
('text/plain',0,0),
('text/uri-list',0,2),
('application/x-rootwin-drop',0,1)]
if path: if path:
icon_list.drag_dest_set(gtk.DEST_DEFAULT_ALL, t, icon_list.drag_dest_set(gtk.DEST_DEFAULT_ALL, _drag_targets,
gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE) gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
icon_list.connect('event',self.item_event)
icon_list.connect("drag_data_received", icon_list.connect("drag_data_received",
self.on_photolist_drag_data_received) self.on_photolist_drag_data_received)
icon_list.drag_source_set(gtk.gdk.BUTTON1_MASK|gtk.gdk.BUTTON3_MASK,t,
gtk.gdk.ACTION_COPY | gtk.gdk.ACTION_MOVE)
icon_list.connect("drag_data_get", icon_list.connect("drag_data_get",
self.on_photolist_drag_data_get) self.on_photolist_drag_data_get)
@ -226,24 +230,60 @@ class Gallery(ImageSelect):
self.selectedIcon = -1 self.selectedIcon = -1
self.x = 0 self.x = 0
self.y = 0 self.y = 0
self.remember_x = -1
self.remember_y = -1
self.button = None
self.drag_item = None
self.sel = None
self.photo = None
def on_canvas1_event(self,obj,event):
"""Handle resize events over the canvas, redrawing if the size changes"""
def item_event(self, widget, event=None): def item_event(self, widget, event=None):
if self.button and event.type == gtk.gdk.MOTION_NOTIFY :
if widget.drag_check_threshold(self.remember_x,self.remember_y,event.x,event.y):
self.drag_item = widget.get_item_at(self.remember_x,self.remember_y)
if self.drag_item:
context = widget.drag_begin(_drag_targets,
gtk.gdk.ACTION_COPY|gtk.gdk.ACTION_MOVE,
self.button, event)
return gtk.TRUE
photo = widget.get_data('obj') photo = widget.get_data('obj')
if event.type == gtk.gdk.BUTTON_PRESS: if event.type == gtk.gdk.BUTTON_PRESS:
if event.button == 1: if event.button == 1:
# Remember starting position. # Remember starting position.
item = widget.get_item_at(event.x,event.y)
if item:
(i,t,b,self.photo) = self.p_map[item]
style = self.iconlist.get_style()
t.set(fill_color_gdk=style.fg[gtk.STATE_SELECTED])
b.set(fill_color_gdk=style.bg[gtk.STATE_SELECTED])
if self.sel:
(i,t,b,photo) = self.p_map[self.sel]
t.set(fill_color_gdk=style.fg[gtk.STATE_NORMAL])
b.set(fill_color_gdk=style.bg[gtk.STATE_NORMAL])
self.sel = item
self.remember_x = event.x self.remember_x = event.x
self.remember_y = event.y self.remember_y = event.y
self.button = event.button
return gtk.TRUE return gtk.TRUE
elif event.button == 3: elif event.button == 3:
self.show_popup(photo) item = widget.get_item_at(event.x,event.y)
if item:
(i,t,b,self.photo) = self.p_map[item]
self.show_popup(self.photo)
return gtk.TRUE return gtk.TRUE
elif event.type == gtk.gdk.BUTTON_RELEASE:
self.button = 0
elif event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: elif event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1:
#Change the item's color. #Change the item's color.
print photo,self.path,self
LocalMediaProperties(photo,self.path,self) LocalMediaProperties(photo,self.path,self)
return gtk.TRUE return gtk.TRUE
@ -258,13 +298,8 @@ class Gallery(ImageSelect):
return gtk.TRUE return gtk.TRUE
elif event.type == gtk.gdk.ENTER_NOTIFY: if event.type == gtk.gdk.EXPOSE:
# Make the outline wide. self.load_images()
return gtk.TRUE
elif event.type == gtk.gdk.LEAVE_NOTIFY:
# Make the outline thin.
return gtk.TRUE
return gtk.FALSE return gtk.FALSE
@ -279,6 +314,13 @@ class Gallery(ImageSelect):
def add_thumbnail(self, photo): def add_thumbnail(self, photo):
"""Scale the image and add it to the IconList.""" """Scale the image and add it to the IconList."""
object = photo.getReference() object = photo.getReference()
oid = object.getId()
if self.canvas_list.has_key(oid):
(grp,item,text,bg,x,y) = self.canvas_list[oid]
if x != self.cx or y != self.cy:
grp.move(self.cx-x,self.cy-y)
else:
name = Utils.thumb_path(self.db.getSavePath(),object) name = Utils.thumb_path(self.db.getSavePath(),object)
description = object.getDescription() description = object.getDescription()
if len(description) > 20: if len(description) > 20:
@ -289,48 +331,62 @@ class Gallery(ImageSelect):
y = image.get_height() y = image.get_height()
grp = self.root.add(gnome.canvas.CanvasGroup,x=self.cx,y=self.cy) grp = self.root.add(gnome.canvas.CanvasGroup,x=self.cx,y=self.cy)
grp.connect('event',self.item_event)
grp.set_data('obj',photo)
xloc = (_IMAGEX-x)/2 xloc = (_IMAGEX-x)/2
yloc = (_IMAGEX-y)/2 yloc = (_IMAGEY-y)/2
bg = grp.add(gnome.canvas.CanvasRect,
x1=0,
x2=_IMAGEX,
y2=_IMAGEY,
y1=_IMAGEY-20)
item = grp.add(gnome.canvas.CanvasPixbuf, item = grp.add(gnome.canvas.CanvasPixbuf,
pixbuf=image, pixbuf=image,
x=xloc, x=xloc,
y=yloc) y=yloc)
text = grp.add(gnome.canvas.CanvasText, text = grp.add(gnome.canvas.CanvasText,
x=_IMAGEX/2, x=_IMAGEX/2,
y=_IMAGEX, y=_IMAGEX,
anchor=gtk.ANCHOR_CENTER, anchor=gtk.ANCHOR_CENTER,
text=description) text=description)
self.cx = 10 + _IMAGEX + self.cx
if self.cx + 10 + _IMAGEX > self.x: self.item_map[item] = oid
self.cx = 10 self.item_map[text] = oid
self.cy = self.cy + 10 + _IMAGEY self.item_map[grp] = oid
self.item_map[bg] = oid
self.p_map[item] = (item,text,bg,photo)
self.p_map[text] = (item,text,bg,photo)
self.p_map[grp] = (item,text,bg,photo)
self.p_map[bg] = (item,text,bg,photo)
item.show() item.show()
text.show() text.show()
self.canvas_list.append(grp) bg.show()
self.canvas_list.append(item)
self.canvas_list.append(text) self.canvas_list[oid] = (grp,item,text,bg,self.cx,self.cy)
if self.cx + _PAD + _IMAGEX > self.x:
self.cx = _PAD
self.cy = self.cy + _PAD + _IMAGEY
else:
self.cx = _PAD + self.cx + _IMAGEX
def load_images(self): def load_images(self):
"""clears the currentImages list to free up any cached """clears the currentImages list to free up any cached
Imlibs. Then add each photo in the place's list of photos to the Imlibs. Then add each photo in the place's list of photos to the
photolist window.""" photolist window."""
for item in self.canvas_list:
item.destroy()
self.pos = 0 self.pos = 0
self.cx = 10 self.cx = _PAD
self.cy = 10 self.cy = _PAD
(self.x,self.y) = self.iconlist.get_size() (self.x,self.y) = self.iconlist.get_size()
self.max = (self.x)/(_IMAGEX+10) self.max = (self.x)/(_IMAGEX+_PAD)
for photo in self.dataobj.getPhotoList(): for photo in self.dataobj.getPhotoList():
self.add_thumbnail(photo) self.add_thumbnail(photo)
@ -345,13 +401,12 @@ class Gallery(ImageSelect):
self.selectedIcon = iconNumber self.selectedIcon = iconNumber
def get_index(self,obj,x,y): def get_index(self,obj,x,y):
x_offset = x/(_IMAGEX+10) x_offset = x/(_IMAGEX+_PAD)
y_offset = y/(_IMAGEY+10) y_offset = y/(_IMAGEY+_PAD)
index = (y_offset*self.max)+x_offset index = (y_offset*(1+self.max))+x_offset
return min(index,len(self.dataobj.getPhotoList())) return min(index,len(self.dataobj.getPhotoList()))
def on_photolist_drag_data_received(self,w, context, x, y, data, info, time): def on_photolist_drag_data_received(self,w, context, x, y, data, info, time):
print "receive",w
if data and data.format == 8: if data and data.format == 8:
icon_index = self.get_index(w,x,y) icon_index = self.get_index(w,x,y)
d = string.strip(string.replace(data.data,'\0',' ')) d = string.strip(string.replace(data.data,'\0',' '))
@ -441,19 +496,13 @@ class Gallery(ImageSelect):
if GrampsCfg.globalprop: if GrampsCfg.globalprop:
LocalMediaProperties(oref,self.path,self) LocalMediaProperties(oref,self.path,self)
Utils.modified() Utils.modified()
#w.drag_finish(context, 1, 0, time)
else:
pass
#w.drag_finish(context, 0, 0, time)
def on_photolist_drag_data_get(self,w, context, selection_data, info, time): def on_photolist_drag_data_get(self,w, context, selection_data, info, time):
print "drag data get",w
if info == 1: if info == 1:
return return
if self.selectedIcon != -1: id = self.item_map[self.drag_item]
ref = self.dataobj.getPhotoList()[self.selectedIcon]
id = ref.getReference().getId()
selection_data.set(selection_data.target, 8, id) selection_data.set(selection_data.target, 8, id)
self.drag_item = None
def on_add_photo_clicked(self, obj): def on_add_photo_clicked(self, obj):
"""User wants to add a new photo. Create a dialog to find out """User wants to add a new photo. Create a dialog to find out
@ -480,7 +529,6 @@ class Gallery(ImageSelect):
"""Look for right-clicks on a picture and create a popup """Look for right-clicks on a picture and create a popup
menu of the available actions.""" menu of the available actions."""
menu = gtk.Menu() menu = gtk.Menu()
item = gtk.TearoffMenuItem() item = gtk.TearoffMenuItem()
item.show() item.show()

View File

@ -25,29 +25,7 @@ class ListModel:
def __init__(self,tree,dlist): def __init__(self,tree,dlist):
self.tree = tree self.tree = tree
l = len(dlist) l = len(dlist)
if l == 1: self.model = gtk.ListStore(*[TYPE_STRING]*l)
self.model = gtk.ListStore(TYPE_STRING)
elif l == 2:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING)
elif l == 3:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING)
elif l == 4:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING)
elif l == 5:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING)
elif l == 6:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING)
elif l == 7:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING)
elif l == 8:
self.model = gtk.ListStore(TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING, TYPE_STRING,
TYPE_STRING, TYPE_STRING)
self.selection = self.tree.get_selection() self.selection = self.tree.get_selection()
self.tree.set_model(self.model) self.tree.set_model(self.model)

View File

@ -121,21 +121,21 @@ class SelectChild:
bday = self.person.getBirth().getDateObj() bday = self.person.getBirth().getDateObj()
dday = self.person.getDeath().getDateObj() dday = self.person.getDeath().getDateObj()
slist = [] slist = {}
for f in self.person.getParentList(): for f in self.person.getParentList():
if f: if f:
if f[0].getFather(): if f[0].getFather():
slist.append(f[0].getFather()) slist[f[0].getFather().getId()] = 1
elif f[0].getMother(): elif f[0].getMother():
slist.append(f[0].getMother()) slist[f[0].getMother().getId()] = 1
for c in f[0].getChildList(): for c in f[0].getChildList():
slist.append(c) slist[c.getId()] = 1
person_list = [] person_list = []
for key in self.db.getPersonKeys(): for key in self.db.getPersonKeys():
person = self.db.getPerson(key) person = self.db.getPerson(key)
if filter: if filter:
if person in slist or person.getMainParents(): if slist.has_key(key) or person.getMainParents():
continue continue
pdday = person.getDeath().getDateObj() pdday = person.getDeath().getDateObj()
@ -167,10 +167,10 @@ class SelectChild:
if pdday.getLowYear() > dday.getHighYear() + 150: if pdday.getLowYear() > dday.getHighYear() + 150:
continue continue
person_list.append(person) person_list.append(person.getId())
for person in person_list: for idval in person_list:
dinfo = self.db.getPersonDisplay(id) dinfo = self.db.getPersonDisplay(idval)
rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]] rdata = [dinfo[0],dinfo[1],dinfo[3],dinfo[5],dinfo[6]]
self.refmodel.add(rdata) self.refmodel.add(rdata)

View File

@ -4274,8 +4274,8 @@
<widget class="GtkScrolledWindow" id="scrolledwindow22"> <widget class="GtkScrolledWindow" id="scrolledwindow22">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
<property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_NONE</property> <property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property> <property name="window_placement">GTK_CORNER_TOP_LEFT</property>

View File

@ -5450,6 +5450,7 @@
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property> <property name="modal">False</property>
<property name="default_width">300</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="has_separator">True</property> <property name="has_separator">True</property>

File diff suppressed because it is too large Load Diff

View File

@ -31,10 +31,10 @@ import Utils
import string import string
import const import const
import GenericFilter import GenericFilter
import ListModel
from TextDoc import * from TextDoc import *
from OpenSpreadSheet import * from OpenSpreadSheet import *
import intl from intl import gettext as _
_ = intl.gettext
import gnome.ui import gnome.ui
import gtk import gtk
@ -167,11 +167,8 @@ def by_value(first,second):
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
def fix(line): def fix(line):
l = string.strip(line) l = line.strip().replace('&','&amp;').replace(l,'>','&gt;')
l = string.replace(l,'&','&amp;') return l.replace(l,'<','&lt;').replace(l,'"','&quot;')
l = string.replace(l,'>','&gt;')
l = string.replace(l,'<','&lt;')
return string.replace(l,'"','&quot;')
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -193,7 +190,7 @@ class DisplayChart:
}) })
self.top = self.topDialog.get_widget("view") self.top = self.topDialog.get_widget("view")
self.table = self.topDialog.get_widget("addarea") self.eventlist = self.topDialog.get_widget('treeview')
self.my_list.sort(sort.by_last_name) self.my_list.sort(sort.by_last_name)
@ -204,17 +201,19 @@ class DisplayChart:
def draw_clist_display(self): def draw_clist_display(self):
eventlist = gtk.CList(len(self.event_titles),self.event_titles) titles = []
self.table.add(eventlist) index = 0
eventlist.show() for v in self.event_titles:
titles.append((v,150,index))
index = index + 1
for (top,bottom) in self.row_data: self.list = ListModel.ListModel(self.eventlist,titles)
eventlist.append(top) for data in self.row_data:
eventlist.append(bottom) self.list.add(data)
for index in range(0,len(self.event_titles)): # for index in range(0,len(self.event_titles)):
width = min(150,eventlist.optimal_column_width(index)) # width = min(150,eventlist.optimal_column_width(index))
eventlist.set_column_width(index,width) # self.eventlist.set_column_width(index,width)
def build_row_data(self): def build_row_data(self):
for individual in self.my_list: for individual in self.my_list:
@ -235,29 +234,26 @@ class DisplayChart:
while done == 0: while done == 0:
added = 0 added = 0
if first: if first:
tlist = [name,birth.getDate(),death.getDate()] tlist = [name,"%s\n%s" % (birth.getDate(),birth.getPlaceName()),
blist = ["",birth.getPlaceName(),death.getPlaceName()] "%s\n%s" % (death.getDate(),death.getPlaceName())]
else: else:
tlist = ["","",""] tlist = ["","",""]
blist = ["","",""]
for ename in self.event_titles[3:]: for ename in self.event_titles[3:]:
if map.has_key(ename) and len(map[ename]) > 0: if map.has_key(ename) and len(map[ename]) > 0:
event = map[ename][0] event = map[ename][0]
del map[ename][0] del map[ename][0]
tlist.append(event.getDate()) tlist.append("%s\n%s" % (event.getDate(), event.getPlaceName()))
blist.append(event.getPlaceName())
added = 1 added = 1
else: else:
tlist.append("") tlist.append("")
blist.append("")
if first: if first:
first = 0 first = 0
self.row_data.append((tlist,blist)) self.row_data.append(tlist)
elif added == 0: elif added == 0:
done = 1 done = 1
else: else:
self.row_data.append((tlist,blist)) self.row_data.append(tlist)
def make_event_titles(self): def make_event_titles(self):
"""Creates the list of unique event types, along with the person's """Creates the list of unique event types, along with the person's
@ -330,6 +326,8 @@ register_tool(
runTool, runTool,
_("Compare individual events"), _("Compare individual events"),
category=_("Analysis and Exploration"), category=_("Analysis and Exploration"),
description=_("Aids in the analysis of data by allowing the development of custom filters that can be applied to the database to find similar events") description=_("Aids in the analysis of data by allowing the "
"development of custom filters that can be applied "
"to the database to find similar events")
) )

View File

@ -24,6 +24,7 @@ import RelLib
import Utils import Utils
import soundex import soundex
import GrampsCfg import GrampsCfg
import ListModel
from intl import gettext as _ from intl import gettext as _
import string import string
@ -43,11 +44,16 @@ def is_initial(name):
if len(name) > 2: if len(name) > 2:
return 0 return 0
elif len(name) == 2: elif len(name) == 2:
if name[0] in string.uppercase and name[1] == '.': if name[0] == name[0].upper() and name[1] == '.':
return 1 return 1
else: else:
return name[0] in string.uppercase return name[0] == name[0].upper()
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def ancestors_of(p1,list): def ancestors_of(p1,list):
if p1 == None or p1 in list: if p1 == None or p1 in list:
return return
@ -113,9 +119,11 @@ class Merge:
self.show() self.show()
def progress_update(self,val): def progress_update(self,val):
self.progress.set_value(val) pass
while gtk.events_pending(): # self.progress.set_value(val)
gtk.mainiteration() # while gtk.events_pending():
# gtk.mainiteration()
def find_potentials(self,thresh): def find_potentials(self,thresh):
top = gtk.glade.XML(self.glade_file,"message") top = gtk.glade.XML(self.glade_file,"message")
@ -131,19 +139,20 @@ class Merge:
key = self.gen_key(p1.getPrimaryName().getSurname()) key = self.gen_key(p1.getPrimaryName().getSurname())
if p1.getGender() == RelLib.Person.male: if p1.getGender() == RelLib.Person.male:
if males.has_key(key): if males.has_key(key):
males[key].append(p1) males[key].append(p1.getId())
else: else:
males[key] = [p1] males[key] = [p1.getId()]
else: else:
if females.has_key(key): if females.has_key(key):
females[key].append(p1) females[key].append(p1.getId())
else: else:
females[key] = [p1] females[key] = [p1.getId()]
length = len(self.person_list) length = len(self.person_list)
num = 0 num = 0
for p1 in self.person_list: for p1 in self.person_list:
p1key = p1.getId()
if num % 25 == 0: if num % 25 == 0:
self.progress_update((float(num)/float(length))*100) self.progress_update((float(num)/float(length))*100)
num = num + 1 num = num + 1
@ -155,26 +164,27 @@ class Merge:
remaining = females[key] remaining = females[key]
index = 0 index = 0
for p2 in remaining: for p2key in remaining:
index = index + 1 index = index + 1
if p1 == p2: if p1key == p2key:
continue continue
if self.map.has_key(p2): p2 = self.db.getPerson(p2key)
(v,c) = self.map[p2] if self.map.has_key(p2key):
(v,c) = self.map[p2key]
if v == p1: if v == p1:
continue continue
chance = self.compare_people(p1,p2) chance = self.compare_people(p1,p2)
if chance >= thresh: if chance >= thresh:
if self.map.has_key(p1): if self.map.has_key(p1key):
val = self.map[p1] val = self.map[p1key]
if val[1] > chance: if val[1] > chance:
self.map[p1] = (p2,chance) self.map[p1key] = (p2,chance)
else: else:
self.map[p1] = (p2,chance) self.map[p1key] = (p2,chance)
self.list = self.map.keys()[:] self.list = self.map.keys()
self.list.sort(by_id) self.list.sort()
self.length = len(self.list) self.length = len(self.list)
self.topWin.destroy() self.topWin.destroy()
self.dellist = {} self.dellist = {}
@ -188,6 +198,12 @@ class Merge:
"on_do_merge_clicked" : self.on_do_merge_clicked, "on_do_merge_clicked" : self.on_do_merge_clicked,
}) })
self.mlist.connect('button-press-event',self.button_press_event) self.mlist.connect('button-press-event',self.button_press_event)
self.list = ListModel.ListModel(self.mlist,
[(_('Rating'),75,0),
(_('First Person'),200,1),
(_('Second Person'),200,2)])
self.redraw() self.redraw()
def redraw(self): def redraw(self):
@ -196,39 +212,41 @@ class Merge:
if self.dellist.has_key(p1): if self.dellist.has_key(p1):
continue continue
(p2,c) = self.map[p1] (p2,c) = self.map[p1]
if self.dellist.has_key(p2): p2key = p2.getId()
p2 = self.dellist[p2] if self.dellist.has_key(p2key):
p2 = self.dellist[p2key]
if p1 == p2: if p1 == p2:
continue continue
list.append((c,p1,p2)) list.append((c,p1,p2.getId()))
list.sort() list.sort()
list.reverse() list.reverse()
index = 0 index = 0
self.mlist.freeze() self.match_map = {}
self.mlist.clear() self.list.clear()
for (c,p1,p2) in list: for (c,p1,p2) in list:
c = "%5.2f" % c c = "%5.2f" % c
self.mlist.append([c, name_of(p1), name_of(p2)]) pn1 = self.db.getPerson(p1)
self.mlist.set_row_data(index,(p1,p2)) pn2 = self.db.getPerson(p2)
self.list.add([c, name_of(pn1), name_of(pn2)])
self.match_map[index] = (p1,p2)
index = index + 1 index = index + 1
self.mlist.thaw()
def button_press_event(self,obj,event): def button_press_event(self,obj,event):
if event.button != 1 or event.type != GDK._2BUTTON_PRESS: if event.button != 1 or event.type != gtk.gdk._2BUTTON_PRESS:
return return
if len(self.mlist.selection) <= 0: self.on_do_merge_clicked(obj)
return
row = self.mlist.selection[0]
(p1,p2) = self.mlist.get_row_data(row)
MergeData.MergePeople(self.db,p1,p2,self.on_update)
def on_do_merge_clicked(self,obj): def on_do_merge_clicked(self,obj):
if len(self.mlist.selection) != 1: store,iter = self.list.selection.get_selected()
if not iter:
return return
row = self.mlist.selection[0]
(p1,p2) = self.mlist.get_row_data(row) row = self.list.model.get_path(iter)
MergeData.MergePeople(self.db,p1,p2,self.on_update) (p1,p2) = self.match_map[row[0]]
pn1 = self.db.getPerson(p1)
pn2 = self.db.getPerson(p2)
MergeData.MergePeople(self.db,pn1,pn2,self.on_update)
def on_update(self,p1,p2): def on_update(self,p1,p2):
self.dellist[p2] = p1 self.dellist[p2] = p1
@ -524,6 +542,7 @@ register_tool(
runTool, runTool,
_("Find possible duplicate people"), _("Find possible duplicate people"),
category=_("Database Processing"), category=_("Database Processing"),
description=_("Searches the entire database, looking for individual entries that may represent the same person.") description=_("Searches the entire database, looking for "
"individual entries that may represent the same person.")
) )

View File

@ -5,173 +5,183 @@
<requires lib="gnome"/> <requires lib="gnome"/>
<widget class="GtkDialog" id="dialog1"> <widget class="GtkDialog" id="dialog1">
<property name="visible">True</property>
<property name="title" translatable="yes">Save as a Spreadsheet - GRAMPS</property> <property name="title" translatable="yes">Save as a Spreadsheet - GRAMPS</property>
<property name="type">GTK_WINDOW_DIALOG</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="allow_shrink">no</property> <property name="modal">False</property>
<property name="allow_grow">no</property> <property name="resizable">True</property>
<property name="visible">yes</property> <property name="destroy_with_parent">False</property>
<property name="window-position">GTK_WIN_POS_NONE</property> <property name="has_separator">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox2"> <widget class="GtkVBox" id="dialog-vbox2">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<property name="visible">yes</property>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area2"> <widget class="GtkHButtonBox" id="dialog-action_area2">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkButton" id="button14"> <widget class="GtkButton" id="button14">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="visible">yes</property> <property name="can_focus">True</property>
<property name="label">gtk-ok</property> <property name="label">gtk-ok</property>
<property name="use_stock">yes</property> <property name="use_stock">True</property>
<property name="use_underline">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_save_clicked" object="dialog1"/> <signal name="clicked" handler="on_save_clicked" object="dialog1"/>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button16"> <widget class="GtkButton" id="button16">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="visible">yes</property> <property name="can_focus">True</property>
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">yes</property> <property name="use_stock">True</property>
<property name="use_underline">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="dialog1"/> <signal name="clicked" handler="destroy_passed_object" object="dialog1"/>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property> <property name="pack_type">GTK_PACK_END</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkVBox" id="vbox3"> <widget class="GtkVBox" id="vbox3">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkLabel" id="labelTitle"> <widget class="GtkLabel" id="labelTitle">
<property name="visible">True</property>
<property name="label" translatable="yes">Save data as a spreadsheet</property> <property name="label" translatable="yes">Save data as a spreadsheet</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="visible">yes</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHSeparator" id="hseparator1"> <widget class="GtkHSeparator" id="hseparator1">
<property name="visible">yes</property> <property name="visible">True</property>
</widget> </widget>
<packing> <packing>
<property name="padding">5</property> <property name="padding">5</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GnomeFileEntry" id="fileentry1"> <widget class="GnomeFileEntry" id="fileentry1">
<property name="visible">True</property>
<property name="history_id">table_data</property> <property name="history_id">table_data</property>
<property name="modal">no</property> <property name="max_saved">10</property>
<property name="width-request">350</property> <property name="browse_dialog_title" translatable="yes">Save Data</property>
<property name="directory_entry">no</property> <property name="directory_entry">False</property>
<property name="browse_dialog_title">Save Data</property> <property name="modal">False</property>
<property name="visible">yes</property>
<child internal-child="entry"> <child internal-child="entry">
<widget class="GtkEntry" id="filename"> <widget class="GtkEntry" id="filename">
<property name="can_focus">yes</property> <property name="visible">True</property>
<property name="editable">yes</property> <property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property> <property name="text" translatable="yes"></property>
<property name="max-length">0</property> <property name="has_frame">True</property>
<property name="visibility">yes</property> <property name="invisible_char" translatable="yes">*</property>
<property name="visible">yes</property> <property name="activates_default">False</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">5</property> <property name="padding">5</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkFrame" id="frame1"> <widget class="GtkFrame" id="frame1">
<property name="label" translatable="yes">Format</property> <property name="visible">True</property>
<property name="label_xalign">0</property> <property name="label_xalign">0</property>
<property name="shadow">GTK_SHADOW_ETCHED_IN</property> <property name="label_yalign">0.5</property>
<property name="visible">yes</property> <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child> <child>
<widget class="GtkVBox" id="vbox4"> <widget class="GtkVBox" id="vbox4">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkRadioButton" id="openoffice"> <widget class="GtkRadioButton" id="openoffice">
<property name="can_focus">yes</property> <property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">OpenOffice Spreadsheet</property> <property name="label" translatable="yes">OpenOffice Spreadsheet</property>
<property name="active">yes</property> <property name="use_underline">True</property>
<property name="draw_indicator">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="visible">yes</property> <property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkRadioButton" id="html"> <widget class="GtkRadioButton" id="html">
<property name="visible">no</property> <property name="can_focus">True</property>
<property name="can_focus">yes</property>
<property name="label" translatable="yes">HTML</property> <property name="label" translatable="yes">HTML</property>
<property name="active">no</property> <property name="use_underline">True</property>
<property name="draw_indicator">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
<property name="group">openoffice</property> <property name="group">openoffice</property>
<signal name="toggled" handler="on_html_toggled" object="dialog1"/> <signal name="toggled" handler="on_html_toggled" object="dialog1"/>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox1"> <widget class="GtkHBox" id="hbox1">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<property name="visible">yes</property>
<child> <child>
<placeholder/> <placeholder/>
@ -179,10 +189,12 @@
<child> <child>
<widget class="GtkLabel" id="label11"> <widget class="GtkLabel" id="label11">
<property name="visible">no</property>
<property name="label" translatable="yes">Template</property> <property name="label" translatable="yes">Template</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">5</property> <property name="xpad">5</property>
@ -190,149 +202,171 @@
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GnomeFileEntry" id="htmltemplate"> <widget class="GnomeFileEntry" id="htmltemplate">
<property name="visible">no</property> <property name="sensitive">False</property>
<property name="sensitive">no</property>
<property name="history_id">HtmlTemplate</property> <property name="history_id">HtmlTemplate</property>
<property name="modal">no</property> <property name="max_saved">10</property>
<property name="directory_entry">no</property> <property name="browse_dialog_title" translatable="yes">Choose the HTML template</property>
<property name="browse_dialog_title">Choose the HTML template</property> <property name="directory_entry">False</property>
<property name="modal">False</property>
<child internal-child="entry"> <child internal-child="entry">
<widget class="GtkEntry" id="htmlfile"> <widget class="GtkEntry" id="htmlfile">
<property name="can_focus">yes</property> <property name="visible">True</property>
<property name="editable">yes</property> <property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">True</property>
<property name="max_length">0</property>
<property name="text" translatable="yes"></property> <property name="text" translatable="yes"></property>
<property name="max-length">0</property> <property name="has_frame">True</property>
<property name="visibility">yes</property> <property name="invisible_char" translatable="yes">*</property>
<property name="visible">yes</property> <property name="activates_default">False</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
</child> </child>
<child>
<widget class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="label" translatable="yes">Format</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="type">label_item</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">4</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
</child>
</widget>
<widget class="GtkDialog" id="view"> <widget class="GtkDialog" id="view">
<property name="visible">True</property>
<property name="title" translatable="yes">Event Comparison - GRAMPS</property> <property name="title" translatable="yes">Event Comparison - GRAMPS</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="allow_shrink">no</property> <property name="modal">False</property>
<property name="allow_grow">yes</property> <property name="default_width">500</property>
<property name="height-request">350</property> <property name="default_height">400</property>
<property name="visible">yes</property> <property name="resizable">True</property>
<property name="window-position">GTK_WIN_POS_NONE</property> <property name="destroy_with_parent">False</property>
<property name="has_separator">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox3"> <widget class="GtkVBox" id="dialog-vbox3">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<property name="visible">yes</property>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area3"> <widget class="GtkHButtonBox" id="dialog-action_area3">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkButton" id="button19"> <widget class="GtkButton" id="button19">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="label" translatable="yes">Save As...</property> <property name="can_focus">True</property>
<property name="visible">yes</property> <property name="label">gtk-save-as</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_write_table" object="view"/> <signal name="clicked" handler="on_write_table" object="view"/>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button21"> <widget class="GtkButton" id="button21">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="visible">yes</property> <property name="can_focus">True</property>
<property name="label">gtk-close</property> <property name="label">gtk-close</property>
<property name="use_stock">yes</property> <property name="use_stock">True</property>
<property name="use_underline">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="view"/> <signal name="clicked" handler="destroy_passed_object" object="view"/>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property> <property name="pack_type">GTK_PACK_END</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkTable" id="mytable"> <widget class="GtkTable" id="mytable">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">1</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property> <property name="row_spacing">0</property>
<property name="column_spacing">0</property> <property name="column_spacing">0</property>
<property name="n-rows">2</property>
<property name="n-columns">1</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkLabel" id="label10"> <widget class="GtkLabel" id="label10">
<property name="visible">True</property>
<property name="label" translatable="yes">Event Comparison</property> <property name="label" translatable="yes">Event Comparison</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="width-request">400</property>
<property name="visible">yes</property>
</widget> </widget>
<packing> <packing>
<property name="left_attach">0</property> <property name="left_attach">0</property>
<property name="right_attach">1</property> <property name="right_attach">1</property>
<property name="top_attach">0</property> <property name="top_attach">0</property>
<property name="bottom_attach">1</property> <property name="bottom_attach">1</property>
<property name="x_padding">0</property>
<property name="y_padding">10</property> <property name="y_padding">10</property>
<property name="x_options">fill</property> <property name="x_options">fill</property>
<property name="y_options"></property> <property name="y_options"></property>
@ -341,25 +375,20 @@
<child> <child>
<widget class="GtkScrolledWindow" id="addarea"> <widget class="GtkScrolledWindow" id="addarea">
<property name="visible">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property> <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="visible">yes</property> <property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child> <child>
<placeholder /> <widget class="GtkTreeView" id="treeview">
</child> <property name="visible">True</property>
<property name="can_focus">True</property>
<child internal-child="hscrollbar"> <property name="headers_visible">True</property>
<widget class="GtkHScrollbar" id="convertwidget1"> <property name="rules_hint">True</property>
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property> <property name="reorderable">False</property>
<property name="visible">yes</property> <property name="enable_search">True</property>
</widget>
</child>
<child internal-child="vscrollbar">
<widget class="GtkVScrollbar" id="convertwidget2">
<property name="update_policy">GTK_UPDATE_CONTINUOUS</property>
<property name="visible">yes</property>
</widget> </widget>
</child> </child>
</widget> </widget>
@ -368,180 +397,173 @@
<property name="right_attach">1</property> <property name="right_attach">1</property>
<property name="top_attach">1</property> <property name="top_attach">1</property>
<property name="bottom_attach">2</property> <property name="bottom_attach">2</property>
<property name="x_padding">0</property>
<property name="y_padding">0</property>
<property name="x_options">expand|fill</property>
<property name="y_options">expand|fill</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="padding">4</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child> </child>
</widget> </widget>
<widget class="GtkDialog" id="filters"> <widget class="GtkDialog" id="filters">
<property name="visible">True</property>
<property name="title" translatable="yes">Event Comparison - GRAMPS</property> <property name="title" translatable="yes">Event Comparison - GRAMPS</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property> <property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="modal">no</property> <property name="window_position">GTK_WIN_POS_NONE</property>
<property name="allow_shrink">no</property> <property name="modal">False</property>
<property name="allow_grow">no</property> <property name="resizable">True</property>
<property name="width-request">350</property> <property name="destroy_with_parent">False</property>
<property name="visible">yes</property> <property name="has_separator">True</property>
<property name="window-position">GTK_WIN_POS_NONE</property>
<child internal-child="vbox"> <child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox5"> <widget class="GtkVBox" id="dialog-vbox5">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">8</property> <property name="spacing">8</property>
<property name="visible">yes</property>
<child internal-child="action_area"> <child internal-child="action_area">
<widget class="GtkHButtonBox" id="dialog-action_area5"> <widget class="GtkHButtonBox" id="dialog-action_area5">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property> <property name="layout_style">GTK_BUTTONBOX_END</property>
<property name="spacing">8</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkButton" id="button26"> <widget class="GtkButton" id="button26">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="visible">yes</property> <property name="can_focus">True</property>
<property name="label">gtk-apply</property> <property name="label">gtk-apply</property>
<property name="use_stock">yes</property> <property name="use_stock">True</property>
<property name="use_underline">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="on_apply_clicked" object="filters"/> <signal name="clicked" handler="on_apply_clicked" object="filters"/>
</widget> </widget>
</child> </child>
<child> <child>
<widget class="GtkButton" id="button27"> <widget class="GtkButton" id="button27">
<property name="can_default">yes</property> <property name="visible">True</property>
<property name="can_focus">yes</property> <property name="can_default">True</property>
<property name="visible">yes</property> <property name="can_focus">True</property>
<property name="label">gtk-cancel</property> <property name="label">gtk-cancel</property>
<property name="use_stock">yes</property> <property name="use_stock">True</property>
<property name="use_underline">yes</property> <property name="relief">GTK_RELIEF_NORMAL</property>
<property name="response_id">0</property>
<signal name="clicked" handler="destroy_passed_object" object="filters"/> <signal name="clicked" handler="destroy_passed_object" object="filters"/>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property> <property name="pack_type">GTK_PACK_END</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkVBox" id="vbox2"> <widget class="GtkVBox" id="vbox2">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkLabel" id="title"> <widget class="GtkLabel" id="title">
<property name="visible">True</property>
<property name="label" translatable="yes">Event Comparison</property> <property name="label" translatable="yes">Event Comparison</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property> <property name="xalign">0.5</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">0</property> <property name="xpad">0</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="visible">yes</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHSeparator" id="hseparator3"> <widget class="GtkHSeparator" id="hseparator3">
<property name="visible">yes</property> <property name="visible">True</property>
</widget> </widget>
<packing> <packing>
<property name="padding">5</property> <property name="padding">5</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkHBox" id="hbox2"> <widget class="GtkHBox" id="hbox2">
<property name="homogeneous">no</property> <property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property> <property name="spacing">0</property>
<property name="visible">yes</property>
<child> <child>
<widget class="GtkLabel" id="label8"> <widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="label" translatable="yes">Filter</property> <property name="label" translatable="yes">Filter</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property> <property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">no</property> <property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property> <property name="xalign">1</property>
<property name="yalign">0.5</property> <property name="yalign">0.5</property>
<property name="xpad">5</property> <property name="xpad">5</property>
<property name="ypad">0</property> <property name="ypad">0</property>
<property name="visible">yes</property>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">no</property> <property name="fill">False</property>
</packing> </packing>
</child> </child>
<child> <child>
<widget class="GtkOptionMenu" id="filter_list"> <widget class="GtkOptionMenu" id="filter_list">
<property name="can_focus">yes</property> <property name="visible">True</property>
<property name="history">0</property> <property name="can_focus">True</property>
<property name="visible">yes</property> <property name="history">-1</property>
<child internal-child="menu"> <child internal-child="menu">
<widget class="GtkMenu" id="convertwidget3"> <widget class="GtkMenu" id="convertwidget3">
<property name="visible">yes</property> <property name="visible">True</property>
</widget> </widget>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">yes</property> <property name="expand">True</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing> <packing>
<property name="padding">0</property> <property name="padding">0</property>
<property name="expand">no</property> <property name="expand">False</property>
<property name="fill">yes</property> <property name="fill">True</property>
</packing> </packing>
</child> </child>
</widget> </widget>
<packing>
<property name="padding">4</property>
<property name="expand">yes</property>
<property name="fill">yes</property>
</packing>
</child> </child>
</widget> </widget>
</glade-interface> </glade-interface>