* src/ViewManger.py: progress bar added back in

* src/ReadXML.py: handle markers


svn: r5560
This commit is contained in:
Don Allingham 2005-12-15 23:48:06 +00:00
parent 277113f59e
commit 428d421096
3 changed files with 38 additions and 12 deletions

View File

@ -1,5 +1,7 @@
2005-12-15 Don Allingham <don@gramps-project.org> 2005-12-15 Don Allingham <don@gramps-project.org>
* src/DisplayState.py: Window management completed * src/DisplayState.py: Window management completed
* src/ViewManger.py: progress bar added back in
* src/ReadXML.py: handle markers
2005-12-15 Alex Roitman <shura@gramps-project.org> 2005-12-15 Alex Roitman <shura@gramps-project.org>
* src/GrampsBSDDB.py: go back to a single load function; * src/GrampsBSDDB.py: go back to a single load function;

View File

@ -281,7 +281,7 @@ class GrampsParser:
self.callback = callback self.callback = callback
self.count = 0 self.count = 0
self.increment = 500 self.increment = 100
self.event = None self.event = None
self.name = None self.name = None
self.tempDefault = None self.tempDefault = None
@ -732,6 +732,7 @@ class GrampsParser:
def start_person(self,attrs): def start_person(self,attrs):
if self.callback != None and self.count % self.increment == 0: if self.callback != None and self.count % self.increment == 0:
self.callback(True) self.callback(True)
self.count += 1
new_id = self.map_gid(attrs['id']) new_id = self.map_gid(attrs['id'])
try: try:
self.person = self.db.find_person_from_handle( self.person = self.db.find_person_from_handle(
@ -740,10 +741,12 @@ class GrampsParser:
except KeyError: except KeyError:
self.person = self.find_person_by_gramps_id(new_id) self.person = self.find_person_by_gramps_id(new_id)
try: if attrs.has_key('complete'):
self.person.set_complete_flag(int(attrs['complete'])) try:
except KeyError: if int(attrs['complete']):
self.person.set_complete_flag(0) self.person.set_marker((RelLib.PrimaryObject.MARKER_COMPLETE, ""))
except KeyError:
pass
def start_people(self,attrs): def start_people(self,attrs):
if attrs.has_key('home'): if attrs.has_key('home'):
@ -815,10 +818,12 @@ class GrampsParser:
else: else:
self.family.set_relationship((ftype,"")) self.family.set_relationship((ftype,""))
if attrs.has_key("complete"): if attrs.has_key('complete'):
self.family.set_complete_flag(int(attrs['complete'])) try:
else: if int(attrs['complete']):
self.family.set_complete_flag(0) self.family.set_marker((RelLib.PrimaryObject.MARKER_COMPLETE, ""))
except KeyError:
pass
def start_childof(self,attrs): def start_childof(self,attrs):
try: try:
@ -922,6 +927,9 @@ class GrampsParser:
self.person.add_source_reference(self.source_ref) self.person.add_source_reference(self.source_ref)
def start_source(self,attrs): def start_source(self,attrs):
if self.callback != None and self.count % self.increment == 0:
self.callback(True)
self.count += 1
handle = self.map_sid(attrs["id"]) handle = self.map_sid(attrs["id"])
try: try:
self.source = self.db.find_source_from_handle( self.source = self.db.find_source_from_handle(

View File

@ -175,9 +175,11 @@ class ViewManager:
self.bbox = gtk.VBox() self.bbox = gtk.VBox()
self.ebox.add(self.bbox) self.ebox.add(self.bbox)
hbox.pack_start(self.ebox,False) hbox.pack_start(self.ebox,False)
hbox.show_all()
self.notebook = gtk.Notebook() self.notebook = gtk.Notebook()
self.notebook.set_show_tabs(False) self.notebook.set_show_tabs(False)
self.notebook.show()
self.build_ui_manager() self.build_ui_manager()
hbox.pack_start(self.notebook,True) hbox.pack_start(self.notebook,True)
@ -186,7 +188,16 @@ class ViewManager:
vbox.pack_start(self.menubar, False) vbox.pack_start(self.menubar, False)
vbox.pack_start(self.toolbar, False) vbox.pack_start(self.toolbar, False)
vbox.add(hbox) vbox.add(hbox)
vbox.pack_end(self.statusbar,False) self.progress = gtk.ProgressBar()
self.progress.set_size_request(100,-1)
self.progress.hide()
self.statusbar.show()
hbox2 = gtk.HBox()
hbox2.pack_start(self.progress,False)
hbox2.pack_end(self.statusbar,True)
hbox2.show()
vbox.pack_end(hbox2,False)
vbox.show()
self.notebook.connect('switch-page',self.change_page) self.notebook.connect('switch-page',self.change_page)
self.uistate = DisplayState.DisplayState(self.window, self.statusbar, self.uistate = DisplayState.DisplayState(self.window, self.statusbar,
@ -194,7 +205,7 @@ class ViewManager:
person_nav = Navigation.PersonNavigation(self.uistate) person_nav = Navigation.PersonNavigation(self.uistate)
self.navigation_type[PageView.NAVIGATION_PERSON] = (person_nav,None) self.navigation_type[PageView.NAVIGATION_PERSON] = (person_nav,None)
self.window.show_all() self.window.show()
def init_interface(self): def init_interface(self):
self.create_pages() self.create_pages()
@ -708,6 +719,9 @@ class ViewManager:
import ScratchPad import ScratchPad
ScratchPad.ScratchPadWindow(self.state, self) ScratchPad.ScratchPadWindow(self.state, self)
def pulse_progressbar(self,value):
self.progress.pulse()
def import_data(self,obj): def import_data(self,obj):
choose = gtk.FileChooserDialog(_('GRAMPS: Import database'), choose = gtk.FileChooserDialog(_('GRAMPS: Import database'),
self.uistate.window, self.uistate.window,
@ -773,7 +787,9 @@ class ViewManager:
elif filetype == const.app_gramps_xml: elif filetype == const.app_gramps_xml:
choose.destroy() choose.destroy()
import ReadXML import ReadXML
ReadXML.importData(self.state.db,filename) self.progress.show()
ReadXML.importData(self.state.db,filename,self.pulse_progressbar)
self.progress.hide()
return True return True
elif filetype == const.app_gedcom: elif filetype == const.app_gedcom:
choose.destroy() choose.destroy()