diff --git a/gramps/gui/editors/editmediaref.py b/gramps/gui/editors/editmediaref.py index a27f55d8b..274c09819 100644 --- a/gramps/gui/editors/editmediaref.py +++ b/gramps/gui/editors/editmediaref.py @@ -51,8 +51,9 @@ from gramps.gen.const import THUMBSCALE from gramps.gen.mime import get_description, get_type from gramps.gen.utils.thumbnails import get_thumbnail_image, find_mime_type_pixbuf from gramps.gen.utils.file import (media_path_full, find_file, create_checksum) -from gramps.gen.lib import NoteType +from gramps.gen.lib import NoteType, Attribute from gramps.gen.db import DbTxn +from .objectentries import PlaceEntry from ..glade import Glade from .displaytabs import (CitationEmbedList, MediaAttrEmbedList, MediaBackRefList, NoteTab) @@ -275,6 +276,13 @@ class EditMediaRef(EditReference): self.source.get_date_object(), self.uistate, self.track, self.db.readonly) + + self.place = PlaceEntry(self.dbstate, self.uistate, self.track, + self.top.get_object("place"), + self.top.get_object("place_event_box"), + self.set_place_handle, + self.get_place_handle, + self.top.get_object("add_del_place"), self.top.get_object("select_place")) self.tags = MonitoredTagList( self.top.get_object("tag_label"), @@ -516,6 +524,23 @@ class EditMediaRef(EditReference): self._setup_notebook_tabs(notebook_src) self._setup_notebook_tabs(notebook_ref) + + def get_place_handle(self): + for attr in self.source.get_attribute_list(): + if attr.get_type() == "Place": + return attr.get_value() + return None + + def set_place_handle(self, value): + for attr in self.source.get_attribute_list(): + if attr.get_type() == "Place": + attr.set_value(value) + return + + attr = Attribute() + attr.set_type("Place") + attr.set_value(value) + self.source.get_attribute_list().append(attr) def save(self,*obj): diff --git a/gramps/gui/glade/editmediaref.glade b/gramps/gui/glade/editmediaref.glade index 5d3084d17..5d117f5ac 100644 --- a/gramps/gui/glade/editmediaref.glade +++ b/gramps/gui/glade/editmediaref.glade @@ -1,52 +1,52 @@ - + 100 - 1 - 10 + 1 + 10 100 - 1 - 10 + 1 + 10 100 - 1 - 10 + 1 + 10 100 - 1 - 10 + 1 + 10 - False - 600 - 450 - dialog + False + 600 + 450 + dialog True - False + False vertical 8 True - False - end + False + end _Cancel True - True - True - True - True + True + True + True + True False @@ -58,11 +58,11 @@ _OK True - True - True - True - True - True + True + True + True + True + True False @@ -74,10 +74,10 @@ _Help True - True - True - True - True + True + True + True + True False @@ -89,104 +89,105 @@ False True - end + end 0 True - False - 6 + False + 6 vertical 6 True - True + True + True - False - 12 - 6 - 12 + False + 12 + 6 + 12 True - False + False end _Corner 2: X - True - corner2_x + True + corner2_x - 1 - 4 + 1 + 4 True - False + False end Y - True - corner2_y + True + corner2_y - 1 - 5 + 1 + 5 True - True - If media is an image, select the specific part of the image you want to reference. + True + If media is an image, select the specific part of the image you want to reference. You can use the mouse on the picture to select a region, or use these spinbuttons to set the top left, and bottom right corner of the referenced region. Point (0,0) is the top left corner of the picture, and (100,100) the bottom right corner. - + adjustment4 - 1 + 1 True - 2 - 5 + 2 + 5 True - True - If media is an image, select the specific part of the image you want to reference. + True + If media is an image, select the specific part of the image you want to reference. You can use the mouse on the picture to select a region, or use these spinbuttons to set the top left, and bottom right corner of the referenced region. Point (0,0) is the top left corner of the picture, and (100,100) the bottom right corner. - + adjustment3 - 1 + 1 True - 2 - 4 + 2 + 4 True - False - Referenced region of the image media object. + False + Referenced region of the image media object. Select a region with clicking and holding the mouse button on the top left corner of the region you want, dragging the mouse to the bottom right corner of the region, and then releasing the mouse button. True True - 0 + 0 True - False + False Preview @@ -195,99 +196,99 @@ Select a region with clicking and holding the mouse button on the top left corne - 0 - 0 + 0 + 0 6 True - False + False end _Corner 1: X - True - corner1_x + True + corner1_x - 1 - 2 + 1 + 2 True - True - If media is an image, select the specific part of the image you want to reference. + True + If media is an image, select the specific part of the image you want to reference. You can use the mouse on the picture to select a region, or use these spinbuttons to set the top left, and bottom right corner of the referenced region. Point (0,0) is the top left corner of the picture, and (100,100) the bottom right corner. - - none + + none adjustment2 - 1 + 1 True - if-valid + if-valid - 2 - 2 + 2 + 2 True - True - If media is an image, select the specific part of the image you want to reference. + True + If media is an image, select the specific part of the image you want to reference. You can use the mouse on the picture to select a region, or use these spinbuttons to set the top left, and bottom right corner of the referenced region. Point (0,0) is the top left corner of the picture, and (100,100) the bottom right corner. - + adjustment1 - 1 + 1 True - 2 - 3 + 2 + 3 True - False + False end Y - True - corner1_y + True + corner1_y - 1 - 3 + 1 + 3 True - False + False - 1 - 4 + 1 + 4 True - False + False True - True - True + True + True none True - False - dialog-password + False + dialog-password 1 @@ -306,25 +307,25 @@ You can use the mouse on the picture to select a region, or use these spinbutton False False - end + end 0 - 2 - 0 + 2 + 0 True - False + False True - 2 - 1 + 2 + 1 @@ -338,14 +339,14 @@ You can use the mouse on the picture to select a region, or use these spinbutton True - False + False General - False + False @@ -359,61 +360,62 @@ You can use the mouse on the picture to select a region, or use these spinbutton True - True + True True - True + True + True - False - 12 - 6 - 12 + False + 12 + 6 + 12 True - False + False start _Path: - True + True center - path + path - 1 - 3 + 1 + 4 True - False + False start _ID: - True + True center - gid + gid - 1 - 0 + 1 + 0 True - False + False start _Title: - True + True center - description + description - 1 - 1 + 1 + 1 @@ -425,21 +427,21 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 2 - 1 + 2 + 1 - False - 6 + False + 6 12 True - False - 48 - dialog-warning + False + 48 + dialog-warning 6 @@ -450,15 +452,15 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 400 + 400 True - False + False start - 3 - 3 + 3 + 3 <b>Note:</b> Any changes in the shared media object information will be reflected in the media object itself. - True - True + True + True True @@ -469,29 +471,29 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 0 - 6 + 0 + 7 3 True - False - 0 + False + 0 True - False - True - Double click image to view in an external viewer - Double click image to view in an external viewer + False + True + Double click image to view in an external viewer + Double click image to view in an external viewer - 100 - 100 + 100 + 100 True - False + False @@ -499,7 +501,7 @@ You can use the mouse on the picture to select a region, or use these spinbutton True - False + False Preview @@ -508,48 +510,48 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 0 - 0 + 0 + 0 5 True - False + False start Type: - type + type - 1 - 5 + 1 + 6 True - False - Type of media object as indicated by the computer, eg Image, Video, ... + False + Type of media object as indicated by the computer, eg Image, Video, ... start - 2 - 5 + 2 + 6 True - False + False start _Date: - True - date_entry + True + date_entry - 1 - 2 + 1 + 2 @@ -560,23 +562,23 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 2 - 2 + 2 + 2 True - True - True - True - Invoke date editor + True + True + True + Invoke date editor none True - False - gramps-date + False + gramps-date Date @@ -595,21 +597,21 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 3 - 2 + 3 + 2 True - True - True + True + True none True - False - dialog-password + False + dialog-password 1 @@ -625,8 +627,8 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 3 - 0 + 3 + 0 @@ -637,23 +639,23 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 2 - 0 + 2 + 0 True - True - True - True - Select a file + True + True + True + Select a file none True - False - document-open + False + document-open 1 @@ -672,8 +674,8 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 3 - 3 + 3 + 4 @@ -684,40 +686,40 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 2 - 3 + 2 + 4 True - False + False start _Tags: - True - tag_button + True + tag_button - 1 - 4 + 1 + 5 True - False + False True - 2 - 4 + 2 + 5 True - True - True + True + True @@ -728,8 +730,108 @@ You can use the mouse on the picture to select a region, or use these spinbutton - 3 - 4 + 3 + 5 + + + + + True + False + start + 3 + 3 + _Place: + True + center + select_place + + + 1 + 3 + + + + + True + True + True + none + + + True + False + + + + + + 3 + 3 + + + + + True + False + + + False + False + + + True + False + start + True + end + + + + + True + True + 0 + + + + + True + True + True + none + + + True + False + gtk-index + + + Selector + + + + + + + + + + Place + + + + + + False + False + 1 + + + + + 2 + 3 @@ -744,22 +846,25 @@ You can use the mouse on the picture to select a region, or use these spinbutton + + + - False + False True - False + False General - False + False @@ -767,7 +872,7 @@ You can use the mouse on the picture to select a region, or use these spinbutton True - False + False Shared Information