* src/DbPrompter.py: cleanup dialogs

* src/EditPerson.py: update screen properly
* src/PeopleModel.py: handle stored maps correctly
* src/PeopleView.py: handle stored maps correctly
* src/gramps_main.py: eliminate unnecessary rebuilds, display
loading dialog
* src/gramp.glade: loading dialog


svn: r3519
This commit is contained in:
Don Allingham 2004-08-29 05:45:40 +00:00
parent 7fe1cc5113
commit 4ec5ccd047
7 changed files with 132 additions and 15 deletions

View File

@ -1,3 +1,12 @@
2004-08-28 Don Allingham <dallingham@users.sourceforge.net>
* src/DbPrompter.py: cleanup dialogs
* src/EditPerson.py: update screen properly
* src/PeopleModel.py: handle stored maps correctly
* src/PeopleView.py: handle stored maps correctly
* src/gramps_main.py: eliminate unnecessary rebuilds, display
loading dialog
* src/gramp.glade: loading dialog
2004-08-25 Jim Smart <jim@jimsmart.org>
* src/RelLib.py: guess_gender fix

View File

@ -76,12 +76,15 @@ class DbPrompter:
new.set_active(want_new)
while 1:
top.show()
response = top.run()
top.hide()
if response == gtk.RESPONSE_OK:
if new.get_active():
prompter = NewNativeDbPrompter(self.parent,self.parent_window)
else:
prompter = ExistingDbPrompter(self.parent,self.parent_window)
if prompter.chooser():
break
elif response == gtk.RESPONSE_CANCEL:
@ -179,7 +182,10 @@ class ExistingDbPrompter:
if filetype == const.app_gramps:
choose.destroy()
self.parent.db = GrampsBSDDB.GrampsBSDDB()
msgxml = gtk.glade.XML(const.gladeFile, "load_message","gramps")
msg_top = msgxml.get_widget('load_message')
self.parent.read_file(filename)
msg_top.destroy()
return 1
elif filetype == const.app_gramps_xml:
choose.destroy()

View File

@ -1622,7 +1622,7 @@ class EditPerson:
self.db.transaction_commit(trans,_("Edit Person (%s)") % n)
self.update_lists()
if self.callback:
self.callback(self,0)
self.callback(self,1)
self.close()
def get_place(self,field,makenew=0):

View File

@ -75,7 +75,7 @@ class PeopleModel(gtk.GenericTreeModel):
self.top_visible = {}
maps = self.db.get_people_view_maps()
if maps[0] != None and len(maps[0]) != 0:
if maps[1] != None and len(maps[1]) != 0:
self.top_path2iter = maps[1]
self.iter2path = maps[2]
self.path2iter = maps[3]
@ -87,6 +87,11 @@ class PeopleModel(gtk.GenericTreeModel):
# self.connect('row-inserted',self.on_row_inserted)
def rebuild_data(self):
import traceback
print traceback.print_stack()
self.top_path2iter = []
self.iter2path = {}
self.path2iter = {}
@ -230,7 +235,7 @@ class PeopleModel(gtk.GenericTreeModel):
def on_iter_nth_child(self,node,n):
if node == None:
return self.top_path2iter.get(n)
return self.top_path2iter[n]
try:
path = self.top_path2iter.index(node)
return self.path2iter[(node,n)]

View File

@ -115,8 +115,12 @@ class PeopleView:
index += 1
def build_tree(self):
import time
t = time.time()
self.person_model = PeopleModel.PeopleModel(self.parent.db)
self.sort_model = self.person_model.filter_new()
print "new",time.time() - t
#self.sort_model = self.person_model.filter_new()
self.sort_model = self.person_model
self.person_tree.set_model(self.sort_model)
def blist(self, store, path, iter, id_list):
@ -145,9 +149,8 @@ class PeopleView:
self.build_columns()
maps = db.get_people_view_maps()
self.person_model = PeopleModel.PeopleModel(db)
if not maps[0]:
self.build_tree()
self.sort_model = self.person_model.filter_new()
#self.sort_model = self.person_model.filter_new()
self.sort_model = self.person_model
self.person_tree.set_model(self.sort_model)
def remove_from_person_list(self,person):
@ -174,6 +177,7 @@ class PeopleView:
self.parent.mhistory.remove(del_id)
def apply_filter_clicked(self):
print "Applying Filter"
mi = self.parent.filter_list.get_menu().get_active()
self.DataFilter = mi.get_data("filter")
if self.DataFilter.need_param:
@ -181,6 +185,7 @@ class PeopleView:
self.DataFilter.set_parameter(qual)
self.apply_filter()
self.goto_active_person()
print "Done"
def add_to_person_list(self,person,change=0):
self.apply_filter_clicked()
@ -207,7 +212,7 @@ class PeopleView:
for person_handle in keys:
self.person_model.set_visible(person_handle,1)
self.sort_model.refilter()
#self.sort_model.refilter()
self.parent.modify_statusbar()
def on_plist_button_press(self,obj,event):
@ -255,7 +260,5 @@ class PeopleView:
menu.popup(None,None,None,event.button,event.time)
def redisplay_person_list(self,person):
self.person_model = PeopleModel.PeopleModel(self.parent.db)
self.sort_model = self.person_model.filter_new()
self.person_tree.set_model(self.sort_model)
self.build_tree()

View File

@ -30814,4 +30814,99 @@ Other</property>
</child>
</widget>
<widget class="GtkWindow" id="load_message">
<property name="visible">True</property>
<property name="title" translatable="yes">GRAMPS - Loading Database</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
<property name="modal">False</property>
<property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkTable" id="table47">
<property name="border_width">12</property>
<property name="visible">True</property>
<property name="n_rows">2</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">0</property>
<property name="column_spacing">0</property>
<child>
<widget class="GtkImage" id="image2223">
<property name="visible">True</property>
<property name="stock">gtk-dialog-info</property>
<property name="icon_size">6</property>
<property name="xalign">0.5</property>
<property name="yalign">0</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options">fill</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label401">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;span size=&quot;larger&quot; weight=&quot;bold&quot;&gt;Loading Database&lt;/span&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label402">
<property name="visible">True</property>
<property name="label" translatable="yes">GRAMPS is loading the database you selected. Please wait.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">1</property>
<property name="bottom_attach">2</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

View File

@ -173,12 +173,12 @@ class Gramps:
GrampsCfg.client.notify_add("/apps/gramps/preferences/date-entry",
self.date_entry_key_update)
self.topWindow.show()
if GrampsCfg.get_usetips():
TipOfDay.TipOfDay()
self.db.set_researcher(GrampsCfg.get_researcher())
self.update_display(0)
#self.update_display(0)
def date_format_key_update(self,client,cnxn_id,entry,data):
GrampsCfg.set_calendar_date_format()
@ -1090,7 +1090,7 @@ class Gramps:
return 0
self.topWindow.set_resizable(gtk.TRUE)
self.people_view.apply_filter()
#self.people_view.apply_filter()
self.goto_active_person()
return 1
@ -1532,7 +1532,6 @@ class Gramps:
self.place_view.change_db(self.db)
self.source_view.change_db(self.db)
self.media_view.change_db(self.db)
#self.full_update()
self.change_active_person(self.find_initial_person())
self.statusbar.set_progress_percentage(0.0)