diff --git a/gramps/src/ImageSelect.py b/gramps/src/ImageSelect.py index 738f74071..49476de42 100644 --- a/gramps/src/ImageSelect.py +++ b/gramps/src/ImageSelect.py @@ -46,6 +46,7 @@ import libglade import const import utils import Config +import Plugins from RelLib import * import RelImage @@ -210,7 +211,7 @@ class Gallery(ImageSelect): icon_list.drag_dest_set(GTK.DEST_DEFAULT_ALL, t, GDK.ACTION_COPY | GDK.ACTION_MOVE) icon_list.connect("drag_data_received", self.on_photolist_drag_data_received) - icon_list.drag_source_set(GDK.BUTTON1_MASK|GDK.BUTTON3_MASK,t,\ + icon_list.drag_source_set(GDK.BUTTON1_MASK|GDK.BUTTON3_MASK,t, GDK.ACTION_COPY | GDK.ACTION_MOVE) icon_list.connect("drag_data_get", self.on_photolist_drag_data_get) @@ -573,7 +574,8 @@ class LocalMediaProperties: if len(obj.selection) > 0: row = obj.selection[0] attr = obj.get_row_data(row) - AttrEdit.AttributeEditor(self,attr,"Media Object",[]) + AttrEdit.AttributeEditor(self,attr,"Media Object", + Plugins.get_image_attributes()) def on_delete_attr_clicked(self,obj): if utils.delete_selected(obj,self.alist): @@ -582,7 +584,8 @@ class LocalMediaProperties: def on_add_attr_clicked(self,obj): import AttrEdit - AttrEdit.AttributeEditor(self,None,"Media Object",[]) + AttrEdit.AttributeEditor(self,None,"Media Object", + Plugins.get_image_attributes()) #------------------------------------------------------------------------- # @@ -745,7 +748,8 @@ class GlobalMediaProperties: if len(obj.selection) > 0: row = obj.selection[0] attr = obj.get_row_data(row) - AttrEdit.AttributeEditor(self,attr,"Media Object",[]) + AttrEdit.AttributeEditor(self,attr,"Media Object", + Plugins.get_image_attributes()) def on_delete_attr_clicked(self,obj): if utils.delete_selected(obj,self.alist): @@ -754,7 +758,8 @@ class GlobalMediaProperties: def on_add_attr_clicked(self,obj): import AttrEdit - AttrEdit.AttributeEditor(self,None,"Media Object",[]) + AttrEdit.AttributeEditor(self,None,"Media Object", + Plugins.get_image_attributes()) #------------------------------------------------------------------------- # diff --git a/gramps/src/Plugins.py b/gramps/src/Plugins.py index 109362117..0fe6704a8 100644 --- a/gramps/src/Plugins.py +++ b/gramps/src/Plugins.py @@ -371,6 +371,19 @@ def register_draw_doc(name,classref): return _drawdoc.append((name,classref)) +#------------------------------------------------------------------------- +# +# Image attributes +# +#------------------------------------------------------------------------- +_image_attributes = [] +def register_image_attribute(name): + if name not in _image_attributes: + _image_attributes.append(name) + +def get_image_attributes(): + return _image_attributes + #------------------------------------------------------------------------- # # Building pulldown menus