* src/ListModel.py: Be able to select based off an iter
* src/ImageSelect.py: Support keeping selecting attributes after they are edited * src/EventEdit.py: Support keeping selecting events after they are edited * src/AttrEdit.py: Support keeping selecting attributes after they are edited * src/Marriage.py: Support keeping track of events and attributes after they are edited. * src/EditPerson.py: Support keeping track of events and attributes after they are edited. svn: r1690
This commit is contained in:
@ -34,6 +34,7 @@ class ListModel:
|
||||
|
||||
self.tree.set_rules_hint(gtk.TRUE)
|
||||
self.model = None
|
||||
self.selection = None
|
||||
self.mode = mode
|
||||
self.new_model()
|
||||
self.data_index = l
|
||||
@ -80,7 +81,10 @@ class ListModel:
|
||||
def new_model(self):
|
||||
if self.model:
|
||||
self.cid = self.model.get_sort_column_id()
|
||||
del self.model
|
||||
del self.selection
|
||||
self.count = 0
|
||||
|
||||
self.model = gtk.ListStore(*self.mylist)
|
||||
self.selection = self.tree.get_selection()
|
||||
self.selection.set_mode(self.mode)
|
||||
@ -164,6 +168,9 @@ class ListModel:
|
||||
|
||||
def select_row(self,row):
|
||||
self.selection.select_path((row))
|
||||
|
||||
def select_iter(self,iter):
|
||||
self.selection.select_iter(iter)
|
||||
|
||||
def get_object(self,iter):
|
||||
return self.model.get_value(iter,self.data_index)
|
||||
|
Reference in New Issue
Block a user