~ubuntu-branches/ubuntu/utopic/gramps/utopic

« back to all changes in this revision

Viewing changes to src/gui/editors/editmedia.py

  • Committer: Package Import Robot
  • Author(s): James A. Treacy
  • Date: 2012-05-22 17:18:36 UTC
  • mfrom: (39.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20120522171836-35fi62lp4w7jnrd7
Tags: 3.4.0-1
* New upstream version
* Updated desktop file. Closes: #667472

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# Copyright (C) 2000-2006  Donald N. Allingham
5
5
# Copyright (C) 2009       Gary Burton
6
6
# Copyright (C) 2010       Nick Hall
 
7
# Copyright (C) 2011       Tim G L Lyons
7
8
#
8
9
# This program is free software; you can redistribute it and/or modify
9
10
# it under the terms of the GNU General Public License as published by
20
21
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21
22
#
22
23
 
23
 
# $Id: editmedia.py 16680 2011-02-20 10:52:06Z bmcage $
 
24
# $Id: editmedia.py 18548 2011-12-04 17:09:17Z kulath $
24
25
 
25
26
#-------------------------------------------------------------------------
26
27
#
50
51
from editprimary import EditPrimary
51
52
from gui.widgets import (MonitoredDate, MonitoredEntry, PrivacyButton,
52
53
                         MonitoredTagList)
53
 
from displaytabs import (SourceEmbedList, AttrEmbedList, NoteTab, 
 
54
from displaytabs import (CitationEmbedList, AttrEmbedList, NoteTab, 
54
55
                         MediaBackRefList)
55
56
from addmedia import AddMediaObject
56
57
from QuestionDialog import ErrorDialog
191
192
    def _create_tabbed_pages(self):
192
193
        notebook = gtk.Notebook()
193
194
 
194
 
        self.src_tab = SourceEmbedList(self.dbstate,
195
 
                                       self.uistate,
196
 
                                       self.track,
197
 
                                       self.obj)
198
 
        self._add_tab(notebook, self.src_tab)
199
 
        self.track_ref_for_deletion("src_tab")
200
 
        
 
195
        self.citation_tab = CitationEmbedList(self.dbstate,
 
196
                                              self.uistate,
 
197
                                              self.track,
 
198
                                              self.obj.get_citation_list(), 
 
199
                                              self.get_menu_title())
 
200
        self._add_tab(notebook, self.citation_tab)
 
201
        self.track_ref_for_deletion("citation_tab")
 
202
 
201
203
        self.attr_tab = AttrEmbedList(self.dbstate,
202
204
                                      self.uistate,
203
205
                                      self.track,
340
342
            self.db.disable_signals()
341
343
        
342
344
            (person_list, family_list, event_list,
343
 
                    place_list, source_list) = self.the_lists
 
345
                    place_list, source_list, citation_list) = self.the_lists
344
346
 
345
347
            for handle in person_list:
346
348
                person = self.db.get_person_from_handle(handle)
377
379
                source.set_media_list(new_list)
378
380
                self.db.commit_source(source, trans)
379
381
 
 
382
            for handle in citation_list:
 
383
                citation = self.db.get_citation_from_handle(handle)
 
384
                new_list = [photo for photo in citation.get_media_list()
 
385
                            if photo.get_reference_handle() != self.media_handle]
 
386
                citation.set_media_list(new_list)
 
387
                self.db.commit_citation(citation, trans)
 
388
 
380
389
            self.db.enable_signals()
381
390
            self.db.remove_object(self.media_handle, trans)