~ubuntu-core-dev/update-manager/main

« back to all changes in this revision

Viewing changes to UpdateManager/backend/InstallBackendAptdaemon.py

  • Committer: Michael Terry
  • Date: 2012-05-31 22:22:44 UTC
  • mto: (2503.1.1 mterry)
  • mto: This revision was merged to the branch mainline in revision 2504.
  • Revision ID: michael.terry@canonical.com-20120531222244-efhxv4cajy9okvvh
add new class to do an update before main window comes up

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
from UpdateManager.backend import InstallBackend
13
13
from UpdateManager.UnitySupport import UnitySupport
14
14
 
 
15
from gettext import gettext as _
 
16
 
15
17
import apt
16
18
import dbus
17
19
 
33
35
            pass
34
36
        try:
35
37
            trans = yield self.client.update_cache(defer=True)
36
 
            yield self._run_in_dialog(trans, self.UPDATE)
 
38
            yield self._run_in_dialog(trans, self.UPDATE, False)
37
39
        except errors.NotAuthorizedError:
38
40
            self.emit("action-done", self.UPDATE, False, False)
39
41
        except:
53
55
                pkgs_install, reinstall, remove, purge, pkgs_upgrade, 
54
56
                downgrade, defer=True)
55
57
            trans.connect("progress-changed", self._on_progress_changed)
56
 
            yield self._run_in_dialog(trans, self.INSTALL)
 
58
            yield self._run_in_dialog(trans, self.INSTALL, True)
57
59
        except errors.NotAuthorizedError as e:
58
60
            self.emit("action-done", self.INSTALL, False, False)
59
61
        except dbus.DBusException as e:
70
72
        self.unity.set_progress(progress)
71
73
 
72
74
    @inline_callbacks
73
 
    def _run_in_dialog(self, trans, action):
 
75
    def _run_in_dialog(self, trans, action, show_details):
74
76
        dia = AptProgressDialog(trans, parent=self.window_main)
75
77
        dia.set_icon_name("system-software-update")
 
78
        dia.set_title(_("Software Updater"))
 
79
        if not show_details:
 
80
            dia.expander.set_no_show_all(True)
 
81
            dia.expander.hide()
76
82
        dia.connect("finished", self._on_finished, action)
77
83
        yield dia.run()
78
84