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

« back to all changes in this revision

Viewing changes to src/plugins/gramplet/Notes.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:
1
1
# Gramps - a GTK+/GNOME based genealogy program
2
2
#
3
3
# Copyright (C) 2011 Nick Hall
 
4
# Copyright (C) 2011       Tim G L Lyons
4
5
#
5
6
# This program is free software; you can redistribute it and/or modify
6
7
# it under the terms of the GNU General Public License as published by
16
17
# along with this program; if not, write to the Free Software
17
18
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18
19
#
19
 
# $Id: Notes.py 17142 2011-04-18 13:03:12Z dsblank $
 
20
# $Id: Notes.py 18679 2012-01-01 17:58:33Z nick-h $
20
21
#
21
22
 
22
23
from gen.plug import Gramplet
137
138
    """
138
139
    def db_changed(self):
139
140
        self.dbstate.db.connect('person-update', self.update)
140
 
        self.update()
141
141
 
142
142
    def active_changed(self, handle):
143
143
        self.update()
163
163
    def db_changed(self):
164
164
        self.dbstate.db.connect('event-update', self.update)
165
165
        self.connect_signal('Event', self.update)
166
 
        self.update()
167
166
 
168
167
    def update_has_data(self):
169
168
        active_handle = self.get_active('Event')
186
185
    def db_changed(self):
187
186
        self.dbstate.db.connect('family-update', self.update)
188
187
        self.connect_signal('Family', self.update)
189
 
        self.update()
190
188
 
191
189
    def update_has_data(self):
192
190
        active_handle = self.get_active('Family')
209
207
    def db_changed(self):
210
208
        self.dbstate.db.connect('place-update', self.update)
211
209
        self.connect_signal('Place', self.update)
212
 
        self.update()
213
210
 
214
211
    def update_has_data(self):
215
212
        active_handle = self.get_active('Place')
232
229
    def db_changed(self):
233
230
        self.dbstate.db.connect('source-update', self.update)
234
231
        self.connect_signal('Source', self.update)
235
 
        self.update()
236
 
 
237
 
    def update_has_data(self):
238
 
        active_handle = self.get_active('Source')
239
 
        active = self.dbstate.db.get_source_from_handle(active_handle)
240
 
        self.set_has_data(self.get_has_data(active))
241
 
    
242
 
    def main(self):
243
 
        active_handle = self.get_active('Source')
244
 
        active = self.dbstate.db.get_source_from_handle(active_handle)
 
232
 
 
233
    def update_has_data(self):
 
234
        active_handle = self.get_active('Source')
 
235
        active = self.dbstate.db.get_source_from_handle(active_handle)
 
236
        self.set_has_data(self.get_has_data(active))
 
237
    
 
238
    def main(self):
 
239
        active_handle = self.get_active('Source')
 
240
        active = self.dbstate.db.get_source_from_handle(active_handle)
 
241
        if active:
 
242
            self.get_notes(active)
 
243
        else:
 
244
            self.clear_text()
 
245
            self.set_has_data(False)
 
246
 
 
247
class CitationNotes(Notes):
 
248
    """
 
249
    Displays the notes for a Citation.
 
250
    """
 
251
    def db_changed(self):
 
252
        self.dbstate.db.connect('citation-update', self.update)
 
253
        self.connect_signal('Citation', self.update)
 
254
 
 
255
    def update_has_data(self):
 
256
        active_handle = self.get_active('Citation')
 
257
        active = self.dbstate.db.get_citation_from_handle(active_handle)
 
258
        self.set_has_data(self.get_has_data(active))
 
259
    
 
260
    def main(self):
 
261
        active_handle = self.get_active('Citation')
 
262
        active = self.dbstate.db.get_citation_from_handle(active_handle)
245
263
        if active:
246
264
            self.get_notes(active)
247
265
        else:
255
273
    def db_changed(self):
256
274
        self.dbstate.db.connect('repository-update', self.update)
257
275
        self.connect_signal('Repository', self.update)
258
 
        self.update()
259
276
 
260
277
    def update_has_data(self):
261
278
        active_handle = self.get_active('Repository')
278
295
    def db_changed(self):
279
296
        self.dbstate.db.connect('media-update', self.update)
280
297
        self.connect_signal('Media', self.update)
281
 
        self.update()
282
298
 
283
299
    def update_has_data(self):
284
300
        active_handle = self.get_active('Media')