diff --git a/UpdateManager/Dialogs.py b/UpdateManager/Dialogs.py index a33f9c0..5a9e36c 100644 --- a/UpdateManager/Dialogs.py +++ b/UpdateManager/Dialogs.py @@ -38,7 +38,6 @@ import distro_info import os import HweSupportStatus.consts -from .Core.LivePatchSocket import LivePatchSocket from .Core.utils import get_dist from gettext import gettext as _ @@ -148,62 +147,6 @@ class InternalDialog(BuilderDialog): self.main_container.add(content_widget) self.main_container.set_visible(bool(content_widget)) - def _is_livepatch_supported(self): - di = distro_info.UbuntuDistroInfo() - codename = get_dist() - return di.is_lts(codename) - - def on_livepatch_status_ready(self, active, cs, ps, fixes): - self.set_desc(None) - - if not active: - if self._is_livepatch_supported() and \ - self.settings_button and \ - self.settings.get_int('launch-count') >= 4: - self.set_desc(_("Tip: You can use Livepatch with " - "Ubuntu Pro to keep your computer more " - "secure between restarts.")) - self.settings_button.set_label(_("Settings & Pro…")) - return - - needs_reschedule = False - - if cs == "needs-check": - needs_reschedule = True - elif cs == "check-failed": - pass - elif cs == "checked": - if ps == "unapplied" or ps == "applying": - needs_reschedule = True - elif ps == "applied": - fixes = [fix for fix in fixes if fix.patched] - d = ngettext("%d Livepatch update applied since the last " - "restart.", - "%d Livepatch updates applied since the last " - "restart.", - len(fixes)) % len(fixes) - self.set_desc(d) - elif ps == "applied-with-bug" or ps == "apply-failed": - fixes = [fix for fix in fixes if fix.patched] - d = ngettext("%d Livepatch update failed to apply since the " - "last restart.", - "%d Livepatch updates failed to apply since the " - "last restart.", - len(fixes)) % len(fixes) - self.set_desc(d) - elif ps == "nothing-to-apply": - pass - elif ps == "unknown": - pass - - if needs_reschedule: - self.lp_socket.get_status(self.on_livepatch_status_ready) - - def check_livepatch_status(self): - self.lp_socket = LivePatchSocket() - self.lp_socket.get_status(self.on_livepatch_status_ready) - - class StoppedUpdatesDialog(InternalDialog): def __init__(self, window_main): InternalDialog.__init__(self, window_main) @@ -227,7 +170,6 @@ class NoUpdatesDialog(InternalDialog): self.settings_button = self.add_settings_button() self.focus_button = self.add_button(Gtk.STOCK_OK, self.window_main.close) - self.check_livepatch_status() class DistUpgradeDialog(InternalDialog):