~osomon/software-center/button_release

« back to all changes in this revision

Viewing changes to softwarecenter/app.py

  • Committer: Michael Vogt
  • Date: 2010-04-21 08:28:34 UTC
  • mfrom: (738.2.4 lucid)
  • Revision ID: michael.vogt@ubuntu.com-20100421082834-7ncrex2vos3ublc6
mergedĀ fromĀ lp:~ubuntu-core-dev/software-center/lucid

Show diffs side-by-side

added added

removed removed

Lines of Context:
362
362
             "/usr/bin/software-properties-gtk", 
363
363
             "-n", 
364
364
             "-t", str(self.window_main.window.xid)])
365
 
        # wait for it to finish
366
 
        ret = None
367
 
        while ret is None:
368
 
            while gtk.events_pending():
369
 
                gtk.main_iteration()
370
 
            ret = p.poll()
371
 
        # return code of 1 means that it changed
 
365
        # Monitor the subprocess regularly
 
366
        glib.timeout_add(100, self._poll_software_sources_subprocess, p)
 
367
 
 
368
    def _poll_software_sources_subprocess(self, popen):
 
369
        ret = popen.poll()
 
370
        if ret is None:
 
371
            # Keep monitoring
 
372
            return True
 
373
        # A return code of 1 means that the sources have changed
372
374
        if ret == 1:
373
375
            self.run_update_cache()
374
376
        self.window_main.set_sensitive(True)
 
377
        # Stop monitoring
 
378
        return False
375
379
 
376
380
    def on_menuitem_about_activate(self, widget):
377
381
        self.aboutdialog.set_version(VERSION)