~mvo/update-manager/not-automatic

« back to all changes in this revision

Viewing changes to UpdateManager/UpdateManager.py

  • Committer: Michael Vogt
  • Date: 2009-02-16 10:31:16 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090216103116-2y9medz16uv97euc
refactoring, cleaner code that works UI agnostic

Show diffs side-by-side

added added

removed removed

Lines of Context:
578
578
      iter = self.store.get_iter(path)
579
579
      pkg = self.store.get_value(iter, LIST_PKG)
580
580
      origin = self.store.get_value(iter, LIST_ORIGIN)
 
581
 
581
582
      if pkg is not None:
582
583
          return
583
584
      self.setBusy(True)
584
585
      actiongroup = apt_pkg.GetPkgActionGroup(self.cache._depcache)
585
586
      for pkg in self.list.pkgs[origin]:
586
587
          if pkg.markedInstall or pkg.markedUpgrade:
587
 
              #print "marking keep: ", pkg.name
 
588
              print "marking keep: ", pkg.name
588
589
              pkg.markKeep()
589
590
          elif not (pkg.name in self.list.held_back):
590
 
              #print "marking install: ", pkg.name
 
591
              print "marking install: ", pkg.name
591
592
              pkg.markInstall(autoFix=False,autoInst=False)
592
593
      # check if we left breakage
593
594
      if self.cache._depcache.BrokenCount:
601
602
 
602
603
  def toggled(self, renderer, path):
603
604
    """ a toggle button in the listview was toggled """
 
605
    print "toggled"
604
606
    iter = self.store.get_iter(path)
605
607
    pkg = self.store.get_value(iter, LIST_PKG)
606
608
    # make sure that we don't allow to toggle deactivated updates
615
617
            Fix = apt_pkg.GetPkgProblemResolver(self.cache._depcache)
616
618
            Fix.ResolveByKeep()
617
619
    else:
618
 
        pkg.markInstall()
 
620
        self.cache.markUpgradeInstall(pkg)
619
621
    self.treeview_update.queue_draw()
620
622
    self.refresh_updates_count()
621
623
    self.setBusy(False)