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

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: 2900
Proposed branch: lp:~seb128/update-manager/livepatch-settings-installed
Merge into: lp:update-manager
Diff against target: 23 lines (+7/-0)
1 file modified
UpdateManager/Dialogs.py (+7/-0)
To merge this branch: bzr merge lp:~seb128/update-manager/livepatch-settings-installed
Reviewer Review Type Date Requested Status
Ubuntu Core Development Team 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.
Revision history for this message
Brian Murray (brian-murray) wrote :

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

Revision history for this message
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...

2860. By Sebastien Bacher

rebase on trunk

2861. By Sebastien Bacher

check for livepatch the same way as software properties

Revision history for this message
Sebastien Bacher (seb128) wrote :

Ok, I finally got to revisit that patch, as your comment pointed out checking for a .desktop from the same source wasn't really useful. What software-properties is doing [1] is to check that the online accounts are available or not. There is already a condition on software-properties to be available, so the change as suggested now show allow the UIs to have a synced state

[1] https://git.launchpad.net/software-properties/tree/softwareproperties/gtk/utils.py#n50

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'UpdateManager/Dialogs.py'
--- UpdateManager/Dialogs.py 2020-04-07 12:00:12 +0000
+++ UpdateManager/Dialogs.py 2020-11-30 14:07:29 +0000
@@ -153,12 +153,19 @@
153 codename = get_dist()153 codename = get_dist()
154 return di.is_lts(codename)154 return di.is_lts(codename)
155155
156 def _has_livepatch_settings_ui(self):
157 try:
158 return Gio.DesktopAppInfo.new('gnome-online-accounts-panel.desktop')
159 except:
160 return None
161
156 def on_livepatch_status_ready(self, active, cs, ps, fixes):162 def on_livepatch_status_ready(self, active, cs, ps, fixes):
157 self.set_desc(None)163 self.set_desc(None)
158164
159 if not active:165 if not active:
160 if self._is_livepatch_supported() and \166 if self._is_livepatch_supported() and \
161 self.settings_button and \167 self.settings_button and \
168 self._has_livepatch_settings_ui() and \
162 self.settings.get_int('launch-count') >= 4:169 self.settings.get_int('launch-count') >= 4:
163 self.set_desc(_("<b>Tip:</b> You can use Livepatch to "170 self.set_desc(_("<b>Tip:</b> You can use Livepatch to "
164 "keep your computer more secure between "171 "keep your computer more secure between "

Subscribers

People subscribed via source and target branches

to status/vote changes: