Bug fixes
svn: r371
This commit is contained in:
parent
dd54ebfc5f
commit
12c1843058
@ -1183,7 +1183,7 @@ def save_person(obj):
|
|||||||
def on_savephoto_clicked(obj):
|
def on_savephoto_clicked(obj):
|
||||||
epo = obj.get_data(EDITPERSON)
|
epo = obj.get_data(EDITPERSON)
|
||||||
image_select = epo.isel
|
image_select = epo.isel
|
||||||
|
|
||||||
filename = image_select.get_widget("photosel").get_full_path(0)
|
filename = image_select.get_widget("photosel").get_full_path(0)
|
||||||
description = image_select.get_widget("photoDescription").get_text()
|
description = image_select.get_widget("photoDescription").get_text()
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ class ReportPlugins:
|
|||||||
top.set_data(OBJECT,self)
|
top.set_data(OBJECT,self)
|
||||||
tree = self.dialog.get_widget("tree1")
|
tree = self.dialog.get_widget("tree1")
|
||||||
self.run_tool = None
|
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)
|
top.set_data(OBJECT,self)
|
||||||
tree = self.dialog.get_widget("tree")
|
tree = self.dialog.get_widget("tree")
|
||||||
self.run_tool = None
|
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 = {}
|
item_hash = {}
|
||||||
for report in list:
|
for report in list:
|
||||||
item = GtkTreeItem(report[2])
|
item = GtkTreeItem(report[2])
|
||||||
item.connect("select",task)
|
item.connect("select",task)
|
||||||
item.set_data(OBJECT,self)
|
item.set_data(OBJECT,obj)
|
||||||
item.set_data(TASK,report[0])
|
item.set_data(TASK,report[0])
|
||||||
item.set_data(TITLE,report[2])
|
item.set_data(TITLE,report[2])
|
||||||
item.set_data(DOCSTRING,report[3])
|
item.set_data(DOCSTRING,report[3])
|
||||||
|
@ -52,6 +52,7 @@ def import_photo(filename,path,prefix):
|
|||||||
|
|
||||||
for index in range(0,1000):
|
for index in range(0,1000):
|
||||||
name = "%s%s%s_%d.jpg" % (path,os.sep,prefix,index)
|
name = "%s%s%s_%d.jpg" % (path,os.sep,prefix,index)
|
||||||
|
base = "%s_%d.jpg" % (prefix,index)
|
||||||
if os.path.exists(name) == 0:
|
if os.path.exists(name) == 0:
|
||||||
break
|
break
|
||||||
|
|
||||||
@ -79,7 +80,9 @@ def import_photo(filename,path,prefix):
|
|||||||
else:
|
else:
|
||||||
PIL.Image.open(filename).save(name)
|
PIL.Image.open(filename).save(name)
|
||||||
except:
|
except:
|
||||||
|
print path
|
||||||
return None
|
return None
|
||||||
|
|
||||||
return name
|
return name
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -3024,7 +3024,6 @@
|
|||||||
<widget>
|
<widget>
|
||||||
<class>GnomeCanvas</class>
|
<class>GnomeCanvas</class>
|
||||||
<name>canvas1</name>
|
<name>canvas1</name>
|
||||||
<border_width>5</border_width>
|
|
||||||
<can_focus>True</can_focus>
|
<can_focus>True</can_focus>
|
||||||
<signal>
|
<signal>
|
||||||
<name>check_resize</name>
|
<name>check_resize</name>
|
||||||
|
@ -2310,7 +2310,8 @@ def load_canvas():
|
|||||||
|
|
||||||
h = 0
|
h = 0
|
||||||
w = 0
|
w = 0
|
||||||
|
xpad = 10
|
||||||
|
|
||||||
style = canvas['style']
|
style = canvas['style']
|
||||||
font = style.font
|
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("d. %s" % t.getDeath().getDate())+2*PAD)
|
||||||
w = max(w,font.width("b. %s" % t.getBirth().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
|
gen = 31
|
||||||
xdiv = 5.0
|
xdiv = 5.0
|
||||||
elif 4*w < cx2 and 12*h < cy2:
|
elif 4*w < (cx2-xpad) and 12*h < cy2:
|
||||||
gen = 15
|
gen = 15
|
||||||
xdiv = 4.0
|
xdiv = 4.0
|
||||||
else:
|
else:
|
||||||
@ -2336,13 +2337,12 @@ def load_canvas():
|
|||||||
|
|
||||||
for c in canvas_items:
|
for c in canvas_items:
|
||||||
c.destroy()
|
c.destroy()
|
||||||
canvas_items = []
|
|
||||||
canvas.set_scroll_region(cx1,cy1,cx2,cy2)
|
canvas.set_scroll_region(cx1,cy1,cx2,cy2)
|
||||||
|
|
||||||
xincr = cx2/xdiv
|
xincr = (cx2-xpad)/xdiv
|
||||||
yincr = cy2/32
|
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,
|
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*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,
|
yincr*30, yincr, yincr*3, yincr*5, yincr*7, yincr*9, yincr*11,
|
||||||
|
Loading…
Reference in New Issue
Block a user