~gary-lasker/software-center/replace-restfulclient-with-piston-tweaks

« back to all changes in this revision

Viewing changes to softwarecenter/ui/gtk3/app.py

  • Committer: Gary Lasker
  • Date: 2012-01-04 23:25:37 UTC
  • mfrom: (2617.2.10 startup-speed2)
  • Revision ID: gary.lasker@canonical.com-20120104232537-053uxnx9a2tmzqty
merged lp:~mvo/software-center/startup-speed2, super-speedy mvo

Show diffs side-by-side

added added

removed removed

Lines of Context:
393
393
            if not (options.enable_lp or och):
394
394
                file_menu.remove(self.builder.get_object("separator_login"))
395
395
        else:
396
 
            with ExecutionTime("run update-software-center-agent"):
397
 
                sc_agent_update = os.path.join(
398
 
                    self.datadir, "update-software-center-agent")
399
 
                (pid, stdin, stdout, stderr) = GObject.spawn_async(
400
 
                    [sc_agent_update, "--datadir", datadir], 
401
 
                    flags=GObject.SPAWN_DO_NOT_REAP_CHILD)
402
 
                GObject.child_watch_add(
403
 
                    pid, self._on_update_software_center_agent_finished)
 
396
            # running the agent will trigger a db reload so we do it later
 
397
            GObject.timeout_add_seconds(30, self._run_software_center_agent)
404
398
 
405
399
        # TODO: Remove the following two lines once we have remove repository
406
400
        #       support in aptdaemon (see LP: #723911)
420
414
            LOG.debug("launchpad integration error: '%s'" % e)
421
415
 
422
416
 
423
 
 
424
417
    # helper
 
418
    def _run_software_center_agent(self):
 
419
        """ helper that triggers the update-software-center-agent helper """
 
420
        sc_agent_update = os.path.join(
 
421
            self.datadir, "update-software-center-agent")
 
422
        (pid, stdin, stdout, stderr) = GObject.spawn_async(
 
423
            [sc_agent_update, "--datadir", self.datadir],
 
424
            flags=GObject.SPAWN_DO_NOT_REAP_CHILD)
 
425
        GObject.child_watch_add(
 
426
            pid, self._on_update_software_center_agent_finished)
 
427
 
425
428
    def _rebuild_and_reopen_local_db(self, pathname):
426
429
        """ helper that rebuilds a db and reopens it """
427
430
        from softwarecenter.db.update import rebuild_database
1174
1177
            self.available_pane.init_view()
1175
1178
            self.available_pane.searchentry.set_text(",".join(packages))
1176
1179
            return
1177
 
        # normal startup, queue showing the lobby when we are ready
1178
 
        def show_lobby():
1179
 
            self.view_manager.set_active_view(ViewPages.AVAILABLE)
1180
 
        GObject.idle_add(show_lobby)
 
1180
        # normal startup, show the lobby (it will have a spinner when
 
1181
        # its not ready yet) - it will also initialize the view
 
1182
        self.view_manager.set_active_view(ViewPages.AVAILABLE)
1181
1183
 
1182
1184
    def restore_state(self):
1183
1185
        if self.config.has_option("general", "size"):