~gary-lasker/software-center/tos-simple-fix

« back to all changes in this revision

Viewing changes to softwarecenter/backend/aptd.py

  • Committer: Michael Vogt
  • Date: 2010-09-01 14:47:12 UTC
  • mfrom: (1093.1.12 less-flicker)
  • Revision ID: michael.vogt@ubuntu.com-20100901144712-i1pqx1y3qrpv3yt7
* softwarecenter/view/channelpane.py:
  - fix flicker in channelspane on db-reopen and add regression
    test
* merged lp:~mvo/software-center/less-flicker that fixes some
  UI flicker/ghost activity (LP: #626733)

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
                                        (bool,)),
89
89
                    # cache reload emits this specific signal as well
90
90
                    'reload-finished':(gobject.SIGNAL_RUN_FIRST,
91
 
                                            gobject.TYPE_NONE,
92
 
                                            (bool,)),
 
91
                                       gobject.TYPE_NONE,
 
92
                                       (gobject.TYPE_PYOBJECT, bool,)),
93
93
                    }
94
94
 
95
95
    def __init__(self):
299
299
        # otherwise the daemon will fail because he does not know
300
300
        # the new package name yet
301
301
        self._reload_signal_id = self.connect(
302
 
            "reload-finished", self._on_reload_for_add_repo_and_install_app_finished, self, trans_metadata, app)
 
302
            "reload-finished", self._on_reload_for_add_repo_and_install_app_finished, trans_metadata, app)
303
303
            
304
304
    @inline_callbacks
305
 
    def _on_reload_for_add_repo_and_install_app_finished(self, trans, result, backend, metadata, app):
 
305
    def _on_reload_for_add_repo_and_install_app_finished(self, backend, trans, result, metadata, app):
306
306
        """ 
307
307
        callback that is called once after reload was queued
308
308
        and will trigger the install of the for-pay package itself
310
310
        """
311
311
        #print trans, result, backend
312
312
 
 
313
        # check if this is the transaction we waiting for
 
314
        key = "sc_add_repo_and_install_pkgname"
 
315
        if not (key in trans.meta_data and trans.meta_data[key] == app.pkgname):
 
316
            return
 
317
 
313
318
        # disconnect again, this is only a one-time operation
314
319
        self.handler_disconnect(self._reload_signal_id)
315
320
        self._reload_signal_id = None
406
411
        # if it was a cache-reload, trigger a-x-i update
407
412
        if trans.role == enums.ROLE_UPDATE_CACHE:
408
413
            self.update_xapian_index()
409
 
            self.emit("reload-finished", enum != enums.EXIT_FAILED)
 
414
            self.emit("reload-finished", trans, enum != enums.EXIT_FAILED)
410
415
        # send appropriate signals
411
416
        self.emit("transactions-changed", self.pending_transactions)
412
417
        self.emit("transaction-finished", TransactionFinishedResult(trans, enum))