* src/ViewManager.py (pulse_progressbar): Print percentage text;

Set cursor to WATCH on open and import.


svn: r5815
This commit is contained in:
Alex Roitman 2006-01-21 20:55:06 +00:00
parent 5af19711d8
commit eaaa5fcccf
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2006-01-21 Alex Roitman <shura@gramps-project.org>
* src/ViewManager.py (pulse_progressbar): Print percentage text;
Set cursor to WATCH on open and import.
2006-01-20 Don Allingham <don@gramps-project.org> 2006-01-20 Don Allingham <don@gramps-project.org>
* src/PageView.py: remove debug statements * src/PageView.py: remove debug statements
* src/ViewManager.py: check for existing action group before removing * src/ViewManager.py: check for existing action group before removing

View File

@ -745,6 +745,7 @@ class ViewManager:
return True return True
def load_database(self,name,callback=None,mode="w"): def load_database(self,name,callback=None,mode="w"):
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
self.progress.show() self.progress.show()
if not self.state.db.load(name,self.pulse_progressbar,mode): if not self.state.db.load(name,self.pulse_progressbar,mode):
return False return False
@ -783,6 +784,7 @@ class ViewManager:
self.state.db.undo_callback = self.change_undo_label self.state.db.undo_callback = self.change_undo_label
self.state.db.redo_callback = self.change_redo_label self.state.db.redo_callback = self.change_redo_label
self.actiongroup.set_visible(True) self.actiongroup.set_visible(True)
self.window.window.set_cursor(None)
return True return True
def change_undo_label(self,label): def change_undo_label(self,label):
@ -852,6 +854,7 @@ class ViewManager:
def pulse_progressbar(self,value): def pulse_progressbar(self,value):
self.progress.set_fraction(value/100.0) self.progress.set_fraction(value/100.0)
self.progress.set_text("%d%%" % value)
while gtk.events_pending(): while gtk.events_pending():
gtk.main_iteration() gtk.main_iteration()
@ -924,16 +927,20 @@ class ViewManager:
if filetype == const.app_gramps: if filetype == const.app_gramps:
choose.destroy() choose.destroy()
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
self.progress.show() self.progress.show()
GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar) GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar)
self.parent.import_tool_callback() self.parent.import_tool_callback()
self.progress.hide() self.progress.hide()
self.window.window.set_cursor(None)
return True return True
elif filetype == const.app_gramps_xml or filetype == const.app_gedcom: elif filetype == const.app_gramps_xml or filetype == const.app_gedcom:
choose.destroy() choose.destroy()
self.window.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH))
self.progress.show() self.progress.show()
GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar) GrampsDb.gramps_db_reader_factory(filetype)(self.state.db,filename,self.pulse_progressbar)
self.progress.hide() self.progress.hide()
self.window.window.set_cursor(None)
return True return True
(the_path,the_file) = os.path.split(filename) (the_path,the_file) = os.path.split(filename)