Bug fixes

svn: r371
This commit is contained in:
Don Allingham 2001-09-01 03:57:55 +00:00
parent dd54ebfc5f
commit 12c1843058
5 changed files with 15 additions and 13 deletions

View File

@ -91,7 +91,7 @@ class ReportPlugins:
top.set_data(OBJECT,self)
tree = self.dialog.get_widget("tree1")
self.run_tool = None
build_tree(tree,_reports,on_report_node_selected)
build_tree(tree,_reports,on_report_node_selected,self)
#-------------------------------------------------------------------------
#
@ -115,19 +115,19 @@ class ToolPlugins:
top.set_data(OBJECT,self)
tree = self.dialog.get_widget("tree")
self.run_tool = None
build_tree(tree,_tools,on_node_selected)
build_tree(tree,_tools,on_node_selected,self)
#-------------------------------------------------------------------------
#
#
#
#-------------------------------------------------------------------------
def build_tree(tree,list,task):
def build_tree(tree,list,task,obj):
item_hash = {}
for report in list:
item = GtkTreeItem(report[2])
item.connect("select",task)
item.set_data(OBJECT,self)
item.set_data(OBJECT,obj)
item.set_data(TASK,report[0])
item.set_data(TITLE,report[2])
item.set_data(DOCSTRING,report[3])

View File

@ -52,6 +52,7 @@ def import_photo(filename,path,prefix):
for index in range(0,1000):
name = "%s%s%s_%d.jpg" % (path,os.sep,prefix,index)
base = "%s_%d.jpg" % (prefix,index)
if os.path.exists(name) == 0:
break
@ -79,7 +80,9 @@ def import_photo(filename,path,prefix):
else:
PIL.Image.open(filename).save(name)
except:
print path
return None
return name
#-------------------------------------------------------------------------

View File

@ -3024,7 +3024,6 @@
<widget>
<class>GnomeCanvas</class>
<name>canvas1</name>
<border_width>5</border_width>
<can_focus>True</can_focus>
<signal>
<name>check_resize</name>

View File

@ -2310,6 +2310,7 @@ def load_canvas():
h = 0
w = 0
xpad = 10
style = canvas['style']
font = style.font
@ -2324,10 +2325,10 @@ def load_canvas():
w = max(w,font.width("d. %s" % t.getDeath().getDate())+2*PAD)
w = max(w,font.width("b. %s" % t.getBirth().getDate())+2*PAD)
if 5*w < cx2 and 24*h < cy2:
if 5*w < (cx2-xpad) and 24*h < cy2:
gen = 31
xdiv = 5.0
elif 4*w < cx2 and 12*h < cy2:
elif 4*w < (cx2-xpad) and 12*h < cy2:
gen = 15
xdiv = 4.0
else:
@ -2336,13 +2337,12 @@ def load_canvas():
for c in canvas_items:
c.destroy()
canvas_items = []
canvas.set_scroll_region(cx1,cy1,cx2,cy2)
xincr = cx2/xdiv
xincr = (cx2-xpad)/xdiv
yincr = cy2/32
xfactor = [0] + [xincr]*2 + [xincr*2]*4 + [xincr*3]*8 + [xincr*4]*16
xfactor = [xpad] + [xincr+xpad]*2 + [xincr*2+xpad]*4 + [xincr*3+xpad]*8 + [xincr*4+xpad]*16
yfactor = [ yincr*16, yincr*8,yincr*24,yincr*4,yincr*12,yincr*20, yincr*28,
yincr*2, yincr*6,yincr*10,yincr*14,yincr*18,yincr*22,yincr*26,
yincr*30, yincr, yincr*3, yincr*5, yincr*7, yincr*9, yincr*11,