[Pkg-privacy-commits] [torbrowser-launcher] 39/476: starting to make progress bar show progress during non-download steps

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:21 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.

commit a33f902f4339ef887ca64f73d105f4fba3122968
Author: Micah Lee <micahflee at riseup.net>
Date:   Sun Feb 17 17:01:54 2013 -0800

    starting to make progress bar show progress during non-download steps
---
 torbrowser-launcher | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/torbrowser-launcher b/torbrowser-launcher
index 0709405..692416d 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -159,6 +159,8 @@ class TorBrowserLauncher:
       # progress bar
       self.progressbar = gtk.ProgressBar(adjustment=None)
       self.progressbar.set_orientation(gtk.PROGRESS_LEFT_TO_RIGHT)
+      self.progressbar.set_pulse_step(0.1)
+      self.progressbar_is_pulsing = False
       self.box.pack_start(self.progressbar, True, True, 0)
 
       # button box
@@ -265,20 +267,46 @@ class TorBrowserLauncher:
 
     return True
 
+  def progressbar_pulse(self):
+    print 'pulse'
+    if self.progressbar_is_pulsing:
+      self.progressbar.pulse()
+      return True
+    else:
+      return False
+
   def verify(self):
+    # initialize the progress bar
+    self.progressbar.set_fraction(0) 
+    self.progressbar.set_text('Verifying Signature')
+    self.progressbar.show()
+    self.progressbar_is_pulsing = True
+    self.timer = gobject.timeout_add(1, self.progressbar_pulse)
+
     error = False
 
     verify_output = subprocess.check_output([self.paths['file']['verify'], self.paths['dir']['gpg'], self.paths['file']['tarball_sig']], stderr=subprocess.STDOUT)
     if 'Good signature' in verify_output:
+      self.progressbar_is_pulsing = False
       self.run_task();
     else:
       error = True
 
     if error:
+      self.progressbar_is_pulsing = False
       self.label = "Signature verification failed!"
 
   def extract(self):
+    # initialize the progress bar
+    self.progressbar.set_fraction(0) 
+    self.progressbar.set_text('Installing')
+    self.progressbar.show()
+    self.progressbar_is_pulsing = True
+    self.timer = gobject.timeout_add(1, self.progressbar_pulse)
+
     subprocess.call(['tar', '-xf', self.paths['file']['tarball'], '-C', self.paths['dir']['tbb']])
+
+    self.progressbar_is_pulsing = False
     self.run_task();
 
   def run(self, run_next_task = True):

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list