2007-07-23 Don Allingham <don@gramps-project.org>

* src/plugins/ExtractCity.py: Allow editable columns



svn: r8766
This commit is contained in:
Don Allingham 2007-07-24 03:53:13 +00:00
parent eccc5bb5db
commit e622d63503
2 changed files with 14 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2007-07-23 Don Allingham <don@gramps-project.org>
* src/plugins/ExtractCity.py: Allow editable columns
2007-07-23 Johan Gonqvist <johan.gronqvist@gmail.com>
* src/plugins/CountAncestors.py:
The "number of ancestors" report only takes different persons into account.

View File

@ -453,10 +453,13 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
self.list.append_column(c)
for (title, col) in COLS:
render = gtk.CellRendererText()
if col > 1:
render.set_property('editable', True)
render.connect('edited', self.__change_name, col)
self.list.append_column(
gtk.TreeViewColumn(title,
gtk.CellRendererText(),
text=col))
gtk.TreeViewColumn(title, render, text=col))
self.list.set_model(self.model)
self.iter_list = []
@ -484,6 +487,10 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
self.show()
def __change_name(self, text, path, new_text, col):
self.model[path][col] = new_text
return
def toggled(self, cell, path_string):
path = tuple([int (i) for i in path_string.split(':')])
row = self.model[path]
@ -512,7 +519,7 @@ class ExtractCity(Tool.BatchTool, ManagedWindow.ManagedWindow):
if state:
place.get_main_location().set_state(state)
if postal:
place.get_main_location().set_city(postal)
place.get_main_location().set_postal(postal)
if country:
place.get_main_location().set_country(country)
self.db.commit_place(place, self.trans)