Merge lp:~seb128/update-manager/livepatch-settings-installed into lp:update-manager

Proposed by Sebastien Bacher on 2020-01-08
Status: Needs review
Proposed branch: lp:~seb128/update-manager/livepatch-settings-installed
Merge into: lp:update-manager
Diff against target: 31 lines (+8/-0)
1 file modified
UpdateManager/Dialogs.py (+8/-0)
To merge this branch: bzr merge lp:~seb128/update-manager/livepatch-settings-installed
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team 2020-01-08 Pending
Review via email: mp+377294@code.launchpad.net

Commit message

Don't mention livepatch settings when the interface is not installed

Description of the change

Don't mention livepatch settings when the interface is not installed

To post a comment you must log in.
Brian Murray (brian-murray) wrote :

This looks good to me but I'm curious - what provides the "software-properties-livepatch.desktop" setting /file?

Sebastien Bacher (seb128) wrote :

hum, that's a good question. the .desktop/UI is shipped with software-properties-gtk but if that's not installed there is no point having a settings button and that's not specific to livepatch...

Unmerged revisions

2859. By Sebastien Bacher on 2020-01-08

Don't mention livepatch settings when the interface is not installed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'UpdateManager/Dialogs.py'
2--- UpdateManager/Dialogs.py 2019-04-08 17:00:30 +0000
3+++ UpdateManager/Dialogs.py 2020-01-08 11:48:57 +0000
4@@ -44,6 +44,7 @@
5 from gettext import gettext as _
6 from gettext import ngettext
7
8+LIVEPATCH_DESKTOP_FILE = "software-properties-livepatch.desktop"
9
10 class Dialog(object):
11 def __init__(self, window_main):
12@@ -153,12 +154,19 @@
13 codename = get_dist()
14 return di.is_lts(codename)
15
16+ def _has_livepatch_settings_ui(self):
17+ try:
18+ return Gio.DesktopAppInfo.new(LIVEPATCH_DESKTOP_FILE)
19+ except:
20+ return None
21+
22 def on_livepatch_status_ready(self, active, cs, ps, fixes):
23 self.set_desc(None)
24
25 if not active:
26 if self._is_livepatch_supported() and \
27 self.settings_button and \
28+ self._has_livepatch_settings_ui() and \
29 self.settings.get_int('launch-count') >= 4:
30 self.set_desc(_("<b>Tip:</b> You can use Livepatch to "
31 "keep your computer more secure between "

Subscribers

People subscribed via source and target branches

to status/vote changes: