Beispiel #1
0
    def upgrade_system(self, widget, data=None):
        to_upgrade = []
        
        for repo in self.database.values():
            for pac in repo:
                if pac.isold:
                    to_upgrade.append(pac)
                continue
            continue

        if to_upgrade:
            confirm = self._upgrade_confirm(to_upgrade)

            if confirm:
                stat_bar = self.gld.get_widget("statusbar")
                stat_bar.pop(self.stat_id)
                stat_bar.push(self.stat_id, _("Refreshing database"))
                dlg = upgrade_dialog(to_upgrade, self.icon)
                dlg.connect("destroy", self._done_upgrade)
                dlg.run()
        else:
            stat_bar = self.gld.get_widget("statusbar")
            stat_bar.pop(self.stat_id)
            stat_bar.push(self.stat_id,
                          _("There isn't any packages to upgrade"))
        return
Beispiel #2
0
    def upgrade_system(self, widget, data=None):
        to_upgrade = []
        
        for repo in self.database.values():
            for pac in repo:
                if pac.isold:
                    to_upgrade.append(pac)
                continue
            continue
        
        # Jump in if there are packages to upgrade
        if to_upgrade:
            self.gld.get_widget("main_win").set_sensitive(False)
            b_list = self._blacklist( to_upgrade, 0x01)
            if b_list:
                dlg = ignorepkg_dialog( b_list, self.icon)
                res = dlg.run()
                dlg.destroy()
                if res == RESPONSE_NO:
                    self._done(None)
                    return
            
            upgrade_dlg = upgrade_dialog( self.gld.get_widget("main_win"), self.icon, to_upgrade)
            upgrade_dlg.connect("destroy", self._refresh_trees_and_queues)
        
            resp = upgrade_dlg.run()
            if resp == RESPONSE_YES:
                self._statusbar(_("Refreshing database..."))
                upgrade_dlg.set_sensitive(False)
                if self._passwd_dlg_init(upgrade_dlg):
                    upgrade_dlg.install()
                    upgrade_dlg.set_sensitive(True)
                else:
                    upgrade_dlg.destroy()
                    self._statusbar(_("Upgrade canceled"))
                    self.gld.get_widget("main_win").set_sensitive(True)
                    
            elif resp == RESPONSE_NO:
                upgrade_dlg.destroy()
                self._statusbar(_("Upgrade canceled"))
                self.gld.get_widget("main_win").set_sensitive(True)
            else:
                print 'else'

        # Else nothing to upgrade
        else:
            self._statusbar(_("There are no packages to upgrade"))
            self.gld.get_widget("main_win").set_sensitive(True)
        return