Fixed Find from popping up multiple windows.

svn: r1474
This commit is contained in:
Don Allingham 2003-04-22 21:52:59 +00:00
parent 92a19c3469
commit 13eb91d4c9
2 changed files with 32 additions and 5 deletions

View File

@ -70,12 +70,15 @@ class FindBase:
'on_close_clicked' : self.on_close_clicked,
})
self.top = self.glade.get_widget('find')
self.top.connect('delete_event',self.on_destroy)
self.entry = self.glade.get_widget('entry')
self.forward_button = self.glade.get_widget('forward')
self.back_button = self.glade.get_widget('back')
Utils.set_titles(self.top, self.glade.get_widget('title'), name)
self.list = None
self.index = 0
self.visible = 1
def get_value(self,id):
return id
@ -114,7 +117,15 @@ class FindBase:
def on_close_clicked(self,obj):
"""Destroys the window in response to a close window button press"""
self.top.destroy()
self.visible = 0
self.top.hide()
def on_destroy(self,obj,event):
self.on_close_clicked(obj)
return 1
def show(self):
self.top.show()
def on_next_clicked(self,obj):
"""Advances to the next person that matches the dialog text"""

View File

@ -322,6 +322,10 @@ class Gramps:
self.enable_filter(self.use_filter)
self.enable_sidebar(self.use_sidebar)
self.find_place = None
self.find_person = None
self.find_source = None
self.find_media = None
self.topWindow.show()
def change_alpha_page(self,obj,junk,page):
@ -439,13 +443,25 @@ class Gramps:
def on_find_activate(self,obj):
"""Display the find box"""
if self.views.get_current_page() == 4:
Find.FindPlace(self.find_goto_place,self.db)
if self.find_place:
self.find_place.show()
else:
self.find_place = Find.FindPlace(self.find_goto_place,self.db)
elif self.views.get_current_page() == 3:
if self.find_source:
self.find_source.show()
else:
Find.FindSource(self.find_goto_source,self.db)
elif self.views.get_current_page() == 5:
if self.find_media:
self.find_media.show()
else:
Find.FindMedia(self.find_goto_media,self.db)
else:
Find.FindPerson(self.find_goto_person,self.db)
if self.find_person:
self.find_person.show()
else:
self.find_person = Find.FindPerson(self.find_goto_person,self.db)
def on_findname_activate(self,obj):
"""Display the find box"""