* src/ReportBase/_Report.py: remove unused progress bar functions
svn: r8141
This commit is contained in:
parent
2c49d1c09e
commit
e197638418
@ -1,3 +1,6 @@
|
||||
2007-02-17 Brian Matherly <brian@gramps-project.org>
|
||||
* src/ReportBase/_Report.py: remove unused progress bar functions
|
||||
|
||||
2007-02-16 Zsolt Foldvari <zfoldvar@users.sourceforge.net>
|
||||
* src/data/mainX.css: enable formatted notes on narrative web
|
||||
* src/plugins/NarrativeWeb.py: enable formatted notes on narrative web
|
||||
|
@ -90,65 +90,3 @@ class Report:
|
||||
This method MUST be used for adding drawing styles.
|
||||
"""
|
||||
pass
|
||||
|
||||
def get_progressbar_data(self):
|
||||
"""The window title for this dialog, and the header line to
|
||||
put at the top of the contents of the dialog box."""
|
||||
return ("%s - GRAMPS" % _("Progress Report"), _("Working"))
|
||||
|
||||
def progress_bar_title(self,name,length):
|
||||
markup = '<span size="larger" weight="bold">%s</span>'
|
||||
self.lbl.set_text(markup % name)
|
||||
self.lbl.set_use_markup(True)
|
||||
self.pbar.set_fraction(0.0)
|
||||
|
||||
progress_steps = length
|
||||
if length > 1:
|
||||
progress_steps = progress_steps+1
|
||||
progress_steps = progress_steps+1
|
||||
self.pbar_max = length
|
||||
|
||||
def progress_bar_setup(self,total):
|
||||
"""Create a progress dialog. This routine calls a
|
||||
customization function to find out how to fill out the dialog.
|
||||
The argument to this function is the maximum number of items
|
||||
that the report will progress; i.e. what's considered 100%,
|
||||
i.e. the maximum number of times this routine will be
|
||||
called."""
|
||||
|
||||
# Customize the dialog for this report
|
||||
(title, header) = self.get_progressbar_data()
|
||||
self.ptop = gtk.Dialog()
|
||||
self.ptop.set_has_separator(False)
|
||||
self.ptop.set_title(title)
|
||||
self.ptop.set_border_width(12)
|
||||
self.lbl = gtk.Label(header)
|
||||
self.lbl.set_use_markup(True)
|
||||
self.ptop.vbox.add(self.lbl)
|
||||
self.ptop.vbox.set_spacing(10)
|
||||
self.ptop.vbox.set_border_width(24)
|
||||
self.pbar = gtk.ProgressBar()
|
||||
self.pbar_max = total
|
||||
self.pbar_index = 0.0
|
||||
|
||||
self.ptop.set_size_request(350,100)
|
||||
self.ptop.vbox.add(self.pbar)
|
||||
self.ptop.show_all()
|
||||
|
||||
def progress_bar_step(self):
|
||||
"""Click the progress bar over to the next value. Be paranoid
|
||||
and insure that it doesn't go over 100%."""
|
||||
self.pbar_index = self.pbar_index + 1.0
|
||||
if (self.pbar_index > self.pbar_max):
|
||||
self.pbar_index = self.pbar_max
|
||||
|
||||
val = self.pbar_index/self.pbar_max
|
||||
|
||||
self.pbar.set_text("%d of %d (%.1f%%)" % (self.pbar_index,self.pbar_max,(val*100)))
|
||||
self.pbar.set_fraction(val)
|
||||
while gtk.events_pending():
|
||||
gtk.main_iteration()
|
||||
|
||||
def progress_bar_done(self):
|
||||
"""Done with the progress bar. It can be destroyed now."""
|
||||
Utils.destroy_passed_object(self.ptop)
|
||||
|
Loading…
Reference in New Issue
Block a user