* src/QuestionDialog.py: close window before calling callback

if the view is not in focus. Fix delete display by calling build_tree


svn: r7944
This commit is contained in:
Don Allingham 2007-01-21 00:16:08 +00:00
parent 81abc62ace
commit a41031ddef
3 changed files with 16 additions and 32 deletions

View File

@ -1,7 +1,8 @@
2007-01-20 Don Allingham <don@gramps-project.org>
* src/QuestionDialog.py: close window before calling callback
* src/DataViews/_PersonView.py (PersonView.change_db): apply
dirty flag to initial build to prevent forcing of build on load
if the view is not in focus.
if the view is not in focus. Fix delete display by calling build_tree
2007-01-20 Alex Roitman <shura@gramps-project.org>
* src/DataViews/_EventView.py (remove): Use reference map to find

View File

@ -507,7 +507,7 @@ class PersonView(PageView.PersonNavView):
self.search_bar.setup_filter(cols)
def build_tree(self):
def build_tree(self, skip=[]):
"""
Creates a new PeopleModel instance. Essentially creates a complete
rebuild of the data. We need to temporarily store the active person,
@ -519,8 +519,7 @@ class PersonView(PageView.PersonNavView):
else:
filter_info = (PeopleModel.SEARCH, self.search_bar.get_value())
self.model = PeopleModel(self.dbstate.db, filter_info)
self.model = PeopleModel(self.dbstate.db, filter_info, skip)
active = self.dbstate.active
self.tree.set_model(self.model)
@ -602,7 +601,6 @@ class PersonView(PageView.PersonNavView):
self.delete_person_response)
def delete_person_response(self):
#self.disable_interface()
self.uistate.set_busy_cursor(1)
trans = self.dbstate.db.transaction_begin()
@ -759,36 +757,21 @@ class PersonView(PageView.PersonNavView):
else:
self.dirty = True
def func(self, tree, path, ex_list):
ex_list.append(self.model.top_path2iter[path[0]])
def person_removed(self, handle_list):
if not self.model:
return
if Config.get(Config.FILTER):
data_filter = self.generic_filter
else:
col, text, inv = self.search_bar.get_value()
func = lambda x: self.model.on_get_value(x, col) or u""
if col == PeopleModel._GENDER_COL:
data_filter = ExactSearchFilter(func, text, inv)
else:
data_filter = SearchFilter(func, text, inv)
self.model.clear_cache()
for node in handle_list:
person = self.dbstate.db.get_person_from_handle(node)
top = person.get_primary_name().get_group_name()
mylist = self.model.sname_sub.get(top, [])
self.model.calculate_data(data_filter, skip=set(handle_list))
if mylist:
try:
path = self.model.on_get_path(node)
self.model.row_deleted(path)
if len(mylist) == 1:
path = self.model.on_get_path(top)
self.model.row_deleted(path)
except KeyError:
pass
self.model.assign_data()
expand = []
self.tree.map_expanded_rows(self.func, expand)
self.build_tree(handle_list)
for i in expand:
path = self.model.top_iter2path.get(i)
if path:
self.tree.expand_row(path, False)
def person_updated(self, handle_list):
if not self.model:

View File

@ -99,9 +99,9 @@ class QuestionDialog:
if parent:
self.top.set_transient_for(parent)
response = self.top.run()
self.top.destroy()
if response == gtk.RESPONSE_ACCEPT:
task()
self.top.destroy()
class QuestionDialog2:
def __init__(self,msg1,msg2,label_msg1,label_msg2,parent=None):