Merge ~nteodosio/software-properties:interim-releases into software-properties:ubuntu/master

Proposed by Nathan Teodosio
Status: Merged
Approved by: Sebastien Bacher
Approved revision: 6adae631fc137610e44fdcd91e38e7703dbb3251
Merge reported by: Sebastien Bacher
Merged at revision: 6adae631fc137610e44fdcd91e38e7703dbb3251
Proposed branch: ~nteodosio/software-properties:interim-releases
Merge into: software-properties:ubuntu/master
Diff against target: 720 lines (+567/-81)
3 files modified
data/gtkbuilder/main.ui (+477/-0)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+5/-4)
softwareproperties/gtk/UbuntuProPage.py (+85/-77)
Reviewer Review Type Date Requested Status
Sebastien Bacher Approve
Robert Ancell Pending
Review via email: mp+438549@code.launchpad.net

Description of the change

Support interim releases.

PPA: https://launchpad.net/~nteodosio/+archive/ubuntu/ubuntu-pro.

Livepatch isn't available yet, so the button remains insensitive.

Additional context and screenshots: https://warthogs.atlassian.net/browse/DT-1100.

To post a comment you must log in.
Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank Nathan, nice work. Some comments

Trying on the LTS to see if we didn't regress
- there is an (unwanted) change of string (pointed inline in the review)
- the pro tab shows labelled as 'Page 7'
- it doesn't respect the dark mode

On Lunar it looks fine, as usual with gtk UI it's tricky to get spacing and alignment, some differences with the design when comparing

- '>Feature', we should have some extra spacing between the > and the text

- for the feature section items, on the design the extra text lines are left aligned on the start of the text from the first line and not on the dot

- 'repositores' -> 'repositories'

- the icons on the left of available/additional features aren't vertically centered on the label next to them, that could be due to my fonts configuration though

review: Needs Fixing
eb15870... by Nathan Teodosio

Fix tab label and pro box label

As revieweed:
- there is an (unwanted) change of string (pointed inline in the review)
- the pro tab shows labelled as 'Page 7'

0b1f194... by Nathan Teodosio

'>Feature', we should have some extra spacing between the > and the text

1d88aea... by Nathan Teodosio

- 'repositores' -> 'repositories'

1498ff2... by Nathan Teodosio

- for the feature section items, on the design the extra text lines are left aligned on the start of the text from the first line and not on the dot

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Thanks for the review, Sebastien.

> - it doesn't respect the dark mode

You are judging that by the Ubuntu Pro logo, right? It looks fine in dark mode in Jammy virtual machine here, could you please double check?

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

> You are judging that by the Ubuntu Pro logo, right? It looks fine in dark mode
> in Jammy virtual machine here, could you please double check?

Well, also the UI is light, but I've tested by taking the lunar build and reverting the recent upload to the archive (to avoid needing a depends on a newer python-apt) rather than by adding the patch on top of the current J version so maybe it's something we changed in kinetic+, I will try again later on a proper base

Revision history for this message
Nathan Teodosio (nteodosio) wrote (last edit ):

Alright, for the record I checked out to ubuntu/jammy and cherry-picked
the opening commit.

8feb6d5... by Nathan Teodosio

Centrally align icon and its label (in expander).

For that, GtkBox -> GtkExpander.

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

Thanks Nathan, it still seems the first chunk is changing the service description for every and not the interim release only no? My understanding was that the new description is only for the interim releases which don't include the extra updates but that the old text is to stay for LTSes

review: Needs Information
Revision history for this message
Nathan Teodosio (nteodosio) wrote :

You mean that

«Receive security updates for over 25,000 Ubuntu packages, free for up to 5 machines...»

should stay for LTS, do I understand you correctly?

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

yes

6adae63... by Nathan Teodosio

Do not change LTS service description label.

Revision history for this message
Nathan Teodosio (nteodosio) wrote :

Thanks for the catch, I fixed that and verified that in a LTS the Ubuntu Pro page now looks equal for origin/ubuntu/master and this proposed branch.

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

Thanks!

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

I've squashed the commits and merged now, thanks Nathan!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/data/gtkbuilder/main.ui b/data/gtkbuilder/main.ui
2index 9c3551b..0cdc9ad 100644
3--- a/data/gtkbuilder/main.ui
4+++ b/data/gtkbuilder/main.ui
5@@ -1651,6 +1651,483 @@ Receive security updates for over 25,000 Ubuntu packages, free for up to 5 machi
6 <property name="tab_fill">False</property>
7 </packing>
8 </child>
9+ <child>
10+ <object class="GtkStack" id="interim_stack_ua_main">
11+ <property name="visible">False</property>
12+ <child>
13+ <object class="GtkBox" id="interim_box_ua_options">
14+ <property name="visible">True</property>
15+ <property name="border_width">12</property>
16+ <property name="orientation">vertical</property>
17+ <property name="spacing">12</property>
18+ <child>
19+ <object class="GtkLabel">
20+ <property name="visible">True</property>
21+ <property name="label" translatable="yes">&lt;b&gt;Subscription&lt;/b&gt;</property>
22+ <property name="use_markup">True</property>
23+ <property name="xalign">0</property>
24+ </object>
25+ </child>
26+ <child>
27+ <object class="GtkFrame">
28+ <property name="visible">True</property>
29+ <child>
30+ <object class="GtkBox">
31+ <property name="visible">True</property>
32+ <property name="orientation">vertical</property>
33+ <property name="spacing">18</property>
34+ <property name="margin">18</property>
35+ <child>
36+ <object class="GtkBox">
37+ <property name="visible">True</property>
38+ <property name="spacing">36</property>
39+ <property name="margin">18</property>
40+ <child>
41+ <object class="GtkImage" id="interim_image_ubuntu_pro_logo">
42+ <property name="visible">True</property>
43+ </object>
44+ </child>
45+ <child>
46+ <object class="GtkStack" id="interim_stack_ua_attach">
47+ <property name="visible">True</property>
48+ <child>
49+ <object class="GtkBox" id="interim_box_ua_unattached">
50+ <property name="visible">True</property>
51+ <property name="spacing">24</property>
52+ <child>
53+ <object class="GtkButton" id="interim_button_ua_attach">
54+ <property name="visible">True</property>
55+ <property name="valign">center</property>
56+ <property name="label" translatable="yes">_Enable Ubuntu Pro</property>
57+ <property name="use_underline">True</property>
58+ </object>
59+ </child>
60+ <child>
61+ <object class="GtkLabel">
62+ <property name="visible">True</property>
63+ <property name="label" translatable="yes">&lt;b&gt;This machine is not covered by an Ubuntu Pro subscription.&lt;/b&gt;
64+Enable Ubuntu Pro to receive additional management and security features on this release, free for up to 5 machines. &lt;a href="https://ubuntu.com/pro"&gt;Learn more&lt;/a&gt;.</property>
65+ <property name="use_markup">True</property>
66+ <property name="wrap">True</property>
67+ <property name="max-width-chars">90</property>
68+ <property name="xalign">0</property>
69+ </object>
70+ </child>
71+ </object>
72+ </child>
73+ <child>
74+ <object class="GtkBox" id="interim_box_ua_attached">
75+ <property name="visible">True</property>
76+ <property name="spacing">24</property>
77+ <child>
78+ <object class="GtkButton" id="interim_button_ua_detach">
79+ <property name="visible">True</property>
80+ <property name="valign">center</property>
81+ <property name="label" translatable="yes">_Disable Ubuntu Pro</property>
82+ <property name="use_underline">True</property>
83+ </object>
84+ </child>
85+ <child>
86+ <object class="GtkBox">
87+ <property name="visible">True</property>
88+ <property name="spacing">6</property>
89+ <child>
90+ <object class="GtkImage">
91+ <property name="visible">True</property>
92+ <property name="icon-name">emblem-default</property>
93+ </object>
94+ </child>
95+ <child>
96+ <object class="GtkLabel">
97+ <property name="visible">True</property>
98+ <property name="use_markup">True</property>
99+ <property name="label" translatable="yes">&lt;span foreground="green"&gt;Ubuntu Pro support is enabled&lt;/span&gt;</property>
100+ <property name="xalign">0</property>
101+ </object>
102+ </child>
103+ </object>
104+ </child>
105+ </object>
106+ </child>
107+ </object>
108+ </child>
109+ </object>
110+ </child>
111+ <child>
112+ <object class="GtkSeparator">
113+ <property name="visible">True</property>
114+ <property name="orientation">horizontal</property>
115+ </object>
116+ </child>
117+ <child>
118+ <object class="GtkExpander">
119+ <property name="visible">True</property>
120+ <child type="label">
121+ <object class="GtkLabel">
122+ <property name="visible">True</property>
123+ <property name="label" translatable="yes">Features</property>
124+ <property name="margin-left">14</property>
125+ <attributes>
126+ <attribute name="scale" value="1.5"/>
127+ </attributes>
128+ </object>
129+ </child>
130+ <child>
131+ <object class="GtkBox">
132+ <property name="visible">True</property>
133+ <property name="orientation">horizontal</property>
134+ <child>
135+ <object class="GtkGrid">
136+ <property name="visible">True</property>
137+ <property name="column_spacing">10</property>
138+ <property name="row_spacing">14</property>
139+ <property name="margin-top">16</property>
140+ <property name="margin-left">0</property>
141+ <property name="margin-right">0</property>
142+ <child>
143+ <object class="GtkImage">
144+ <property name="visible">True</property>
145+ <property name="stock">gtk-ok</property>
146+ <property name="icon_size">2</property>
147+ </object>
148+ <packing>
149+ <property name="left_attach">0</property>
150+ <property name="top_attach">0</property>
151+ </packing>
152+ </child>
153+ <child>
154+ <object class="GtkLabel">
155+ <property name="visible">True</property>
156+ <property name="xalign">0</property>
157+ <property name="wrap">True</property>
158+ <property name="label" translatable="yes">&lt;b&gt;Available&lt;/b&gt;</property>
159+ <property name="use_markup">True</property>
160+ </object>
161+ <packing>
162+ <property name="left_attach">1</property>
163+ <property name="top_attach">0</property>
164+ </packing>
165+ </child>
166+ <child>
167+ <object class="GtkBox">
168+ <property name="visible">True</property>
169+ <property name="orientation">horizontal</property>
170+ <child>
171+ <object class="GtkLabel">
172+ <property name="visible">True</property>
173+ <property name="valign">start</property>
174+ <property name="label">• </property>
175+ </object>
176+ </child>
177+ <child>
178+ <object class="GtkLabel">
179+ <property name="visible">True</property>
180+ <property name="wrap">True</property>
181+ <property name="xalign">0</property>
182+ <property name="valign">start</property>
183+ <property name="label" translatable="yes">Inventory, audit and automate the management of this machine with &lt;a href="https://ubuntu.com/landscape"&gt;Landscape&lt;/a&gt;, available as a self-hosted solution, or as a service.</property>
184+ <property name="use_markup">True</property>
185+ </object>
186+ </child>
187+ </object>
188+ <packing>
189+ <property name="left_attach">1</property>
190+ <property name="top_attach">1</property>
191+ </packing>
192+ </child>
193+ <child>
194+ <object class="GtkBox">
195+ <property name="visible">True</property>
196+ <property name="orientation">horizontal</property>
197+ <child>
198+ <object class="GtkLabel">
199+ <property name="visible">True</property>
200+ <property name="valign">start</property>
201+ <property name="label">• </property>
202+ </object>
203+ </child>
204+ <child>
205+ <object class="GtkLabel">
206+ <property name="visible">True</property>
207+ <property name="wrap">True</property>
208+ <property name="xalign">0</property>
209+ <property name="valign">start</property>
210+ <property name="label" translatable="yes">&lt;a href="https://github.com/ubuntu/adsys/wiki"&gt;ADsys&lt;/a&gt; Active Directory bridging toolset provides additional management features and GPO policy support for Active Directory.</property>
211+ <property name="use_markup">True</property>
212+ </object>
213+ </child>
214+ </object>
215+ <packing>
216+ <property name="left_attach">1</property>
217+ <property name="top_attach">2</property>
218+ </packing>
219+ </child>
220+ <child>
221+ <object class="GtkBox">
222+ <property name="visible">True</property>
223+ <property name="orientation">horizontal</property>
224+ <child>
225+ <object class="GtkLabel">
226+ <property name="visible">True</property>
227+ <property name="valign">start</property>
228+ <property name="label">• </property>
229+ </object>
230+ </child>
231+ <child>
232+ <object class="GtkLabel">
233+ <property name="visible">True</property>
234+ <property name="wrap">True</property>
235+ <property name="valign">start</property>
236+ <property name="xalign">0</property>
237+ <property name="label" translatable="yes">&lt;a href="https://ubuntu.com/security/livepatch"&gt;Kernel Livepatch&lt;/a&gt; helps keep your system secure by applying updates that don't require a restart.</property>
238+ <property name="use_markup">True</property>
239+ </object>
240+ </child>
241+ </object>
242+ <packing>
243+ <property name="left_attach">1</property>
244+ <property name="top_attach">3</property>
245+ </packing>
246+ </child>
247+ </object>
248+ </child>
249+ <child>
250+ <object class="GtkSeparator">
251+ <property name="visible">True</property>
252+ <property name="margin-left">20</property>
253+ <property name="margin-right">20</property>
254+ </object>
255+ </child>
256+ <child>
257+ <object class="GtkGrid">
258+ <property name="visible">True</property>
259+ <property name="column_spacing">10</property>
260+ <property name="row_spacing">14</property>
261+ <property name="margin-top">16</property>
262+ <property name="margin-left">0</property>
263+ <property name="margin-right">0</property>
264+ <child>
265+ <object class="GtkImage">
266+ <property name="visible">True</property>
267+ <property name="stock">gtk-info</property>
268+ <property name="icon_size">2</property>
269+ </object>
270+ <packing>
271+ <property name="left_attach">0</property>
272+ <property name="top_attach">0</property>
273+ </packing>
274+ </child>
275+ <child>
276+ <object class="GtkLabel">
277+ <property name="visible">True</property>
278+ <property name="xalign">0</property>
279+ <property name="wrap">True</property>
280+ <property name="label" translatable="yes">&lt;b&gt;Additional features on LTS releases&lt;/b&gt;</property>
281+ <property name="use_markup">True</property>
282+ </object>
283+ <packing>
284+ <property name="left_attach">1</property>
285+ <property name="top_attach">0</property>
286+ </packing>
287+ </child>
288+ <child>
289+ <object class="GtkBox">
290+ <property name="visible">True</property>
291+ <property name="orientation">horizontal</property>
292+ <child>
293+ <object class="GtkLabel">
294+ <property name="visible">True</property>
295+ <property name="valign">start</property>
296+ <property name="label">• </property>
297+ </object>
298+ </child>
299+ <child>
300+ <object class="GtkLabel">
301+ <property name="visible">True</property>
302+ <property name="wrap">True</property>
303+ <property name="xalign">0</property>
304+ <property name="valign">start</property>
305+ <property name="label" translatable="yes">10 years of security maintenance coverage for all Ubuntu deb packages in `Main` and `Universe` repositories.</property>
306+ <property name="use_markup">True</property>
307+ </object>
308+ </child>
309+ </object>
310+ <packing>
311+ <property name="left_attach">1</property>
312+ <property name="top_attach">1</property>
313+ </packing>
314+ </child>
315+ <child>
316+ <object class="GtkBox">
317+ <property name="visible">True</property>
318+ <property name="orientation">horizontal</property>
319+ <child>
320+ <object class="GtkLabel">
321+ <property name="visible">True</property>
322+ <property name="valign">start</property>
323+ <property name="label">• </property>
324+ </object>
325+ </child>
326+ <child>
327+ <object class="GtkLabel">
328+ <property name="visible">True</property>
329+ <property name="wrap">True</property>
330+ <property name="xalign">0</property>
331+ <property name="valign">start</property>
332+ <property name="label" translatable="yes">Additional tools to assist with FedRAMP, HIPAA and other compliance and hardening requirements.</property>
333+ <property name="use_markup">True</property>
334+ </object>
335+ </child>
336+ </object>
337+ <packing>
338+ <property name="left_attach">1</property>
339+ <property name="top_attach">2</property>
340+ </packing>
341+ </child>
342+ <child>
343+ <object class="GtkBox">
344+ <property name="visible">True</property>
345+ <property name="orientation">horizontal</property>
346+ <child>
347+ <object class="GtkLabel">
348+ <property name="visible">True</property>
349+ <property name="valign">start</property>
350+ <property name="label">• </property>
351+ </object>
352+ </child>
353+ <child>
354+ <object class="GtkLabel">
355+ <property name="visible">True</property>
356+ <property name="wrap">True</property>
357+ <property name="valign">start</property>
358+ <property name="xalign">0</property>
359+ <property name="label" translatable="yes">Real-time Ubuntu kernel with PREEMPT_RT patches integrated.</property>
360+ <property name="use_markup">True</property>
361+ </object>
362+ </child>
363+ </object>
364+ <packing>
365+ <property name="left_attach">1</property>
366+ <property name="top_attach">3</property>
367+ </packing>
368+ </child>
369+ <child>
370+ <object class="GtkBox">
371+ <property name="visible">True</property>
372+ <property name="orientation">horizontal</property>
373+ <child>
374+ <object class="GtkLabel">
375+ <property name="visible">True</property>
376+ <property name="valign">start</property>
377+ <property name="label">• </property>
378+ </object>
379+ </child>
380+ <child>
381+ <object class="GtkLabel">
382+ <property name="visible">True</property>
383+ <property name="wrap">True</property>
384+ <property name="valign">start</property>
385+ <property name="xalign">0</property>
386+ <property name="label" translatable="yes">Updates for the Robot Operating System.</property>
387+ <property name="use_markup">True</property>
388+ </object>
389+ </child>
390+ </object>
391+ <packing>
392+ <property name="left_attach">1</property>
393+ <property name="top_attach">4</property>
394+ </packing>
395+ </child>
396+ </object>
397+ </child>
398+ </object>
399+ </child>
400+ </object>
401+ </child>
402+ </object>
403+ </child>
404+ </object>
405+ </child>
406+ <child>
407+ <object class="GtkLabel">
408+ <property name="visible">True</property>
409+ <property name="label" translatable="yes">&lt;b&gt;Security&lt;/b&gt;</property>
410+ <property name="use_markup">True</property>
411+ <property name="xalign">0</property>
412+ </object>
413+ </child>
414+ <child>
415+ <object class="GtkGrid">
416+ <property name="visible">True</property>
417+ <property name="row_spacing">12</property>
418+ <property name="column_spacing">12</property>
419+ <child>
420+ <object class="GtkSwitch" id="interim_switch_ua_livepatch">
421+ <property name="visible">True</property>
422+ <property name="halign">start</property>
423+ <property name="valign">center</property>
424+ </object>
425+ <packing>
426+ <property name="left_attach">0</property>
427+ <property name="top_attach">0</property>
428+ </packing>
429+ </child>
430+ <child>
431+ <object class="GtkLabel" id="interim_label_ua_livepatch">
432+ <property name="visible">True</property>
433+ <property name="label" translatable="yes">&lt;b&gt;Kernel Livepatch&lt;/b&gt; helps keep your system secure by applying security updates that don't require a restart.</property>
434+ <property name="use_markup">True</property>
435+ <property name="xalign">0</property>
436+ </object>
437+ <packing>
438+ <property name="left_attach">1</property>
439+ <property name="top_attach">0</property>
440+ </packing>
441+ </child>
442+ <child>
443+ <object class="GtkLabel" id="interim_label_ua_livepatch_error">
444+ <property name="visible">False</property>
445+ <property name="xalign">0</property>
446+ <attributes>
447+ <attribute name="foreground" value="red"/>
448+ <attribute name="scale" value="0.9"/>
449+ </attributes>
450+ </object>
451+ <packing>
452+ <property name="left_attach">1</property>
453+ <property name="top_attach">1</property>
454+ </packing>
455+ </child>
456+ <child>
457+ <object class="GtkCheckButton" id="interim_checkbutton_livepatch_topbar">
458+ <property name="visible">True</property>
459+ <property name="label" translatable="yes">Show Livepatch status in the top bar</property>
460+ <property name="sensitive">False</property>
461+ <property name="halign">start</property>
462+ <property name="draw_indicator">True</property>
463+ </object>
464+ <packing>
465+ <property name="left_attach">1</property>
466+ <property name="top_attach">2</property>
467+ </packing>
468+ </child>
469+ </object>
470+ </child>
471+ </object>
472+ </child>
473+ </object>
474+ </child>
475+ <child type="tab">
476+ <object class="GtkLabel">
477+ <property name="visible">True</property>
478+ <property name="can_focus">False</property>
479+ <property name="label">Ubuntu Pro</property>
480+ </object>
481+ <packing>
482+ <property name="position">6</property>
483+ <property name="tab_fill">False</property>
484+ </packing>
485+ </child>
486 </object>
487 <packing>
488 <property name="expand">True</property>
489diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
490index 0cced00..feb38fd 100644
491--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
492+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
493@@ -67,6 +67,7 @@ from softwareproperties.gtk.utils import (
494 get_ua_service_status,
495 current_distro,
496 is_current_distro_lts,
497+ is_current_distro_supported,
498 )
499
500 from UbuntuDrivers import detect
501@@ -253,8 +254,8 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
502 # Setup and show the Additonal Drivers tab
503 self.init_drivers()
504 # Setup and show the Ubuntu Pro tab if the serie is a LTS
505- if is_current_distro_lts():
506- self.init_ubuntu_pro()
507+ if is_current_distro_supported():
508+ self.init_ubuntu_pro(is_current_distro_lts())
509
510 # Connect to switch-page before setting initial tab. Otherwise the
511 # first switch goes unnoticed.
512@@ -1665,5 +1666,5 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
513 else:
514 self.label_driver_action.set_label(_("No proprietary drivers are in use."))
515
516- def init_ubuntu_pro(self):
517- self.ubuntu_pro_page = UbuntuProPage(self)
518+ def init_ubuntu_pro(self, is_lts):
519+ self.ubuntu_pro_page = UbuntuProPage(self, is_lts)
520diff --git a/softwareproperties/gtk/UbuntuProPage.py b/softwareproperties/gtk/UbuntuProPage.py
521index 113fed0..92be4f0 100644
522--- a/softwareproperties/gtk/UbuntuProPage.py
523+++ b/softwareproperties/gtk/UbuntuProPage.py
524@@ -38,72 +38,79 @@ class UaService:
525
526 class UbuntuProPage(object):
527
528- def __init__(self, parent):
529+ def __init__(self, parent, is_lts):
530 self._parent = parent
531-
532- self.stack_ua_attach = parent.stack_ua_attach
533- self.box_ua_attached = parent.box_ua_attached
534- self.box_ua_unattached = parent.box_ua_unattached
535- self.stack_ua_main = parent.stack_ua_main
536- self.box_ua_options = parent.box_ua_options
537- self.box_ua_fips_setup = parent.box_ua_fips_setup
538- self.switch_ua_esm_infra = parent.switch_ua_esm_infra
539- self.label_ua_esm_infra = parent.label_ua_esm_infra
540- self.label_ua_esm_infra_error = parent.label_ua_esm_infra_error
541- self.label_ua_esm_infra_error_messages = {
542- "enable": _("Could not enable ESM Infra. Please try again."),
543- "disable": _("Could not disable ESM Infra. Please try again."),
544- }
545- self.switch_ua_esm_apps = parent.switch_ua_esm_apps
546- self.label_ua_esm_apps = parent.label_ua_esm_apps
547- self.label_ua_esm_apps_error = parent.label_ua_esm_apps_error
548- self.label_ua_esm_apps_error_messages = {
549- "enable": _("Could not enable ESM Apps. Please try again."),
550- "disable": _("Could not disable ESM Apps. Please try again."),
551- }
552- self.switch_ua_livepatch = parent.switch_ua_livepatch
553- self.checkbutton_livepatch_topbar = parent.checkbutton_livepatch_topbar
554- self.label_ua_livepatch = parent.label_ua_livepatch
555- self.label_ua_livepatch_error = parent.label_ua_livepatch_error
556+ self._is_lts = is_lts
557+
558+ self.stack_ua_attach = (parent.interim_stack_ua_attach, parent.stack_ua_attach)[is_lts]
559+ self.box_ua_attached = (parent.interim_box_ua_attached, parent.box_ua_attached)[is_lts]
560+ self.box_ua_unattached = (parent.interim_box_ua_unattached, parent.box_ua_unattached)[is_lts]
561+ self.stack_ua_main = (parent.interim_stack_ua_main, parent.stack_ua_main)[is_lts]
562+ self.box_ua_options = (parent.interim_box_ua_options, parent.box_ua_options)[is_lts]
563+ self.image_ubuntu_pro_logo = (parent.interim_image_ubuntu_pro_logo, parent.image_ubuntu_pro_logo)[is_lts]
564+ self.button_ua_attach = (parent.interim_button_ua_attach, parent.button_ua_attach)[is_lts]
565+ self.button_ua_detach = (parent.interim_button_ua_detach, parent.button_ua_detach)[is_lts]
566+ self.switch_ua_livepatch = (parent.interim_switch_ua_livepatch, parent.switch_ua_livepatch)[is_lts]
567+ self.checkbutton_livepatch_topbar = (parent.interim_checkbutton_livepatch_topbar, parent.checkbutton_livepatch_topbar)[is_lts]
568+ self.label_ua_livepatch = (parent.interim_label_ua_livepatch, parent.label_ua_livepatch)[is_lts]
569+ self.label_ua_livepatch_error = (parent.interim_label_ua_livepatch_error, parent.label_ua_livepatch_error)[is_lts]
570 self.label_ua_livepatch_error_messages = {
571 "enable": _("Could not enable Livepatch. Please try again."),
572 "disable": _("Could not disable Livepatch. Please try again."),
573 }
574- self.button_ua_fips = parent.button_ua_fips
575- self.label_ua_fips_status = parent.label_ua_fips_status
576- self.label_ua_fips_description = parent.label_ua_fips_description
577- self.button_ua_usg = parent.button_ua_usg
578- self.label_ua_usg_button = parent.label_ua_usg_button
579- self.label_ua_usg_status = parent.label_ua_usg_status
580- self.label_ua_usg_description = parent.label_ua_usg_description
581+
582+ if is_lts:
583+ self.box_ua_fips_setup = parent.box_ua_fips_setup
584+ self.switch_ua_esm_infra = parent.switch_ua_esm_infra
585+ self.label_ua_esm_infra = parent.label_ua_esm_infra
586+ self.label_ua_esm_infra_error = parent.label_ua_esm_infra_error
587+ self.label_ua_esm_infra_error_messages = {
588+ "enable": _("Could not enable ESM Infra. Please try again."),
589+ "disable": _("Could not disable ESM Infra. Please try again."),
590+ }
591+ self.switch_ua_esm_apps = parent.switch_ua_esm_apps
592+ self.label_ua_esm_apps = parent.label_ua_esm_apps
593+ self.label_ua_esm_apps_error = parent.label_ua_esm_apps_error
594+ self.label_ua_esm_apps_error_messages = {
595+ "enable": _("Could not enable ESM Apps. Please try again."),
596+ "disable": _("Could not disable ESM Apps. Please try again."),
597+ }
598+ self.button_ua_fips = parent.button_ua_fips
599+ self.label_ua_fips_status = parent.label_ua_fips_status
600+ self.label_ua_fips_description = parent.label_ua_fips_description
601+ self.button_ua_usg = parent.button_ua_usg
602+ self.label_ua_usg_button = parent.label_ua_usg_button
603+ self.label_ua_usg_status = parent.label_ua_usg_status
604+ self.label_ua_usg_description = parent.label_ua_usg_description
605+
606+ self.on_ua_esm_infra_changed_handler = self.switch_ua_esm_infra.connect('notify::active', self.on_ua_esm_infra_changed)
607+ self.on_ua_esm_apps_changed_handler = self.switch_ua_esm_apps.connect('notify::active', self.on_ua_esm_apps_changed)
608+ parent.button_ua_fips.connect('clicked', self.on_button_ua_fips_clicked)
609+ parent.button_ua_usg.connect('clicked', self.on_button_ua_usg_clicked)
610+ parent.expander_compliance_and_hardening.connect('notify::expanded', self.on_compliance_and_hardening_expand_changed)
611+
612+ # Set date dependent labels
613+ distro = current_distro()
614+ if distro.eol_esm is not None:
615+ eol_year = distro.eol_esm.year
616+ self.label_ua_esm_infra.set_markup(_('<b>ESM Infra</b> provides security updates for over 2,300 Ubuntu Main packages until %d.') % eol_year)
617+ self.label_ua_esm_apps.set_markup(_('<b>ESM Apps</b>; provides security updates for over 23,000 Ubuntu Universe packages until %d.') % eol_year)
618+ else:
619+ self.label_ua_esm_infra.set_markup(_('<b>ESM Infra</b> provides security updates for over 2,300 Ubuntu Main packages.'))
620+ self.label_ua_esm_apps.set_markup(_('<b>ESM Apps</b>; provides security updates for over 23,000 Ubuntu Universe packages.'))
621
622 if is_dark_theme(self.stack_ua_attach):
623 ubuntu_pro_logo = GdkPixbuf.Pixbuf.new_from_file_at_scale(os.path.join(parent.datadir, 'ubuntu-pro-logo-dark.svg'), -1, 50, True)
624 else:
625 ubuntu_pro_logo = GdkPixbuf.Pixbuf.new_from_file_at_scale(os.path.join(parent.datadir, 'ubuntu-pro-logo.svg'), -1, 50, True)
626- parent.image_ubuntu_pro_logo.set_from_pixbuf(ubuntu_pro_logo)
627+ self.image_ubuntu_pro_logo.set_from_pixbuf(ubuntu_pro_logo)
628
629- # Display the tab on init which is only on LTS series
630+ # Display the tab on init which is only on LTS or interim series
631 self.stack_ua_main.set_visible(True)
632
633- parent.button_ua_attach.connect('clicked', self.on_button_ua_attach_clicked)
634- parent.button_ua_detach.connect('clicked', self.on_button_ua_detach_clicked)
635- self.on_ua_esm_infra_changed_handler = self.switch_ua_esm_infra.connect('notify::active', self.on_ua_esm_infra_changed)
636- self.on_ua_esm_apps_changed_handler = self.switch_ua_esm_apps.connect('notify::active', self.on_ua_esm_apps_changed)
637+ self.button_ua_attach.connect('clicked', self.on_button_ua_attach_clicked)
638+ self.button_ua_detach.connect('clicked', self.on_button_ua_detach_clicked)
639 self.on_ua_livepatch_changed_handler = self.switch_ua_livepatch.connect('notify::active', self.on_ua_livepatch_changed)
640- parent.button_ua_fips.connect('clicked', self.on_button_ua_fips_clicked)
641- parent.button_ua_usg.connect('clicked', self.on_button_ua_usg_clicked)
642- parent.expander_compliance_and_hardening.connect('notify::expanded', self.on_compliance_and_hardening_expand_changed)
643-
644- # Set date dependent labels
645- distro = current_distro()
646- if distro.eol_esm is not None:
647- eol_year = distro.eol_esm.year
648- self.label_ua_esm_infra.set_markup(_('<b>ESM Infra</b> provides security updates for over 2,300 Ubuntu Main packages until %d.') % eol_year)
649- self.label_ua_esm_apps.set_markup(_('<b>ESM Apps</b>; provides security updates for over 23,000 Ubuntu Universe packages until %d.') % eol_year)
650- else:
651- self.label_ua_esm_infra.set_markup(_('<b>ESM Infra</b> provides security updates for over 2,300 Ubuntu Main packages.'))
652- self.label_ua_esm_apps.set_markup(_('<b>ESM Apps</b>; provides security updates for over 23,000 Ubuntu Universe packages.'))
653
654 self.update_notifier_settings = None
655 source = Gio.SettingsSchemaSource.get_default()
656@@ -184,38 +191,39 @@ class UbuntuProPage(object):
657 switch.set_active(service_is_enabled(service))
658 switch.handler_unblock(handler)
659
660- esm_infra_service = self.get_service('esm-infra')
661- for widget in [self.switch_ua_esm_infra, self.label_ua_esm_infra, self.label_ua_esm_infra_error]:
662- widget.set_sensitive(entitled_to_service(esm_infra_service) and not service_request_in_progress(esm_infra_service))
663- update_switch(self.switch_ua_esm_infra, esm_infra_service, self.on_ua_esm_infra_changed_handler)
664-
665- esm_apps_service = self.get_service('esm-apps')
666- for widget in [self.switch_ua_esm_apps, self.label_ua_esm_apps, self.label_ua_esm_apps_error]:
667- widget.set_sensitive(entitled_to_service(esm_apps_service) and not service_request_in_progress(esm_apps_service))
668- update_switch(self.switch_ua_esm_apps, esm_apps_service, self.on_ua_esm_apps_changed_handler)
669-
670 livepatch_service = self.get_service('livepatch')
671 for widget in [self.switch_ua_livepatch, self.label_ua_livepatch, self.label_ua_livepatch_error]:
672 widget.set_sensitive(entitled_to_service(livepatch_service) and not service_request_in_progress(livepatch_service))
673 update_switch(self.switch_ua_livepatch, livepatch_service, self.on_ua_livepatch_changed_handler)
674 self.checkbutton_livepatch_topbar.set_sensitive(self.update_notifier_settings is not None and self.switch_ua_livepatch.get_active())
675
676- fips_service = self.get_service('fips')
677- fips_updates_service = self.get_service('fips-updates')
678- fips_in_progress = service_request_in_progress(fips_service) or service_request_in_progress(fips_updates_service)
679- self.button_ua_fips.set_sensitive(entitled_to_service(fips_service) and not fips_in_progress)
680- if fips_in_progress:
681- self.stack_ua_main.set_visible_child(self.box_ua_fips_setup)
682- else:
683- self.stack_ua_main.set_visible_child(self.box_ua_options)
684-
685- usg_service = self.get_service('usg')
686- if not service_request_in_progress(usg_service):
687- if service_is_enabled(usg_service):
688- self.label_ua_usg_button.set_label(_('Disable _USG'))
689+ if self._is_lts:
690+ esm_infra_service = self.get_service('esm-infra')
691+ for widget in [self.switch_ua_esm_infra, self.label_ua_esm_infra, self.label_ua_esm_infra_error]:
692+ widget.set_sensitive(entitled_to_service(esm_infra_service) and not service_request_in_progress(esm_infra_service))
693+ update_switch(self.switch_ua_esm_infra, esm_infra_service, self.on_ua_esm_infra_changed_handler)
694+
695+ esm_apps_service = self.get_service('esm-apps')
696+ for widget in [self.switch_ua_esm_apps, self.label_ua_esm_apps, self.label_ua_esm_apps_error]:
697+ widget.set_sensitive(entitled_to_service(esm_apps_service) and not service_request_in_progress(esm_apps_service))
698+ update_switch(self.switch_ua_esm_apps, esm_apps_service, self.on_ua_esm_apps_changed_handler)
699+
700+ fips_service = self.get_service('fips')
701+ fips_updates_service = self.get_service('fips-updates')
702+ fips_in_progress = service_request_in_progress(fips_service) or service_request_in_progress(fips_updates_service)
703+ self.button_ua_fips.set_sensitive(entitled_to_service(fips_service) and not fips_in_progress)
704+ if fips_in_progress:
705+ self.stack_ua_main.set_visible_child(self.box_ua_fips_setup)
706 else:
707- self.label_ua_usg_button.set_label(_('Enable _USG'))
708- self.button_ua_usg.set_sensitive(entitled_to_service(usg_service) and not service_request_in_progress(usg_service))
709+ self.stack_ua_main.set_visible_child(self.box_ua_options)
710+
711+ usg_service = self.get_service('usg')
712+ if not service_request_in_progress(usg_service):
713+ if service_is_enabled(usg_service):
714+ self.label_ua_usg_button.set_label(_('Disable _USG'))
715+ else:
716+ self.label_ua_usg_button.set_label(_('Enable _USG'))
717+ self.button_ua_usg.set_sensitive(entitled_to_service(usg_service) and not service_request_in_progress(usg_service))
718
719 def on_button_ua_attach_clicked(self, button):
720 dialog = DialogUaAttach(self._parent.window_main, self._parent.datadir, self.ua_object)

Subscribers

People subscribed via source and target branches