diff --git a/gramps/src/EditPerson.py b/gramps/src/EditPerson.py index 502f233aa..1ab91e7e7 100644 --- a/gramps/src/EditPerson.py +++ b/gramps/src/EditPerson.py @@ -1183,7 +1183,7 @@ def save_person(obj): def on_savephoto_clicked(obj): epo = obj.get_data(EDITPERSON) image_select = epo.isel - + filename = image_select.get_widget("photosel").get_full_path(0) description = image_select.get_widget("photoDescription").get_text() diff --git a/gramps/src/Plugins.py b/gramps/src/Plugins.py index c1f1565d5..4cdf0890f 100644 --- a/gramps/src/Plugins.py +++ b/gramps/src/Plugins.py @@ -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]) diff --git a/gramps/src/RelImage.py b/gramps/src/RelImage.py index 22eaf5eb0..cd6a2f61f 100644 --- a/gramps/src/RelImage.py +++ b/gramps/src/RelImage.py @@ -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 #------------------------------------------------------------------------- diff --git a/gramps/src/gramps.glade b/gramps/src/gramps.glade index c8ebb88ab..ce3215173 100644 --- a/gramps/src/gramps.glade +++ b/gramps/src/gramps.glade @@ -3024,7 +3024,6 @@ GnomeCanvas canvas1 - 5 True check_resize diff --git a/gramps/src/gramps_main.py b/gramps/src/gramps_main.py index 4cf5664ab..8af4df739 100755 --- a/gramps/src/gramps_main.py +++ b/gramps/src/gramps_main.py @@ -2310,7 +2310,8 @@ 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,