Merge ~seb128/software-properties:ubuntu-pro-visible-on-lts into software-properties:ubuntu/master

Proposed by Sebastien Bacher
Status: Merged
Merged at revision: d53ac10e2f12db7ba912433a96d3df130ee123a7
Proposed branch: ~seb128/software-properties:ubuntu-pro-visible-on-lts
Merge into: software-properties:ubuntu/master
Diff against target: 43 lines (+7/-3)
3 files modified
data/gtkbuilder/main.ui (+1/-1)
softwareproperties/gtk/SoftwarePropertiesGtk.py (+3/-2)
softwareproperties/gtk/UbuntuProPage.py (+3/-0)
Reviewer Review Type Date Requested Status
Robert Ancell (community) Approve
Review via email: mp+431128@code.launchpad.net

Commit message

Display the Ubuntu Pro tab only on LTS series

Since the service is only available there

Description of the change

Design gave a +1 to the change, it also allows us to land the code to kinetic now

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

The only negative side-effect of this change is it will disable the UI for Livepatch, which is currently shown in non-LTS releases. I doubt that's an issue, as I don't think Livepatch works on non-LTS anyway? And I guess now Livepatch is considered part of Ubuntu Pro and not a separate thing. The command line is still available.

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

Right, livepatch only works on LTS series and users can still use the cmdline if needed.

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 a78bfe2..0e3297e 100644
3--- a/data/gtkbuilder/main.ui
4+++ b/data/gtkbuilder/main.ui
5@@ -1236,7 +1236,7 @@
6 </child>
7 <child>
8 <object class="GtkStack" id="stack_ua_main">
9- <property name="visible">True</property>
10+ <property name="visible">False</property>
11 <child>
12 <object class="GtkBox" id="box_ua_options">
13 <property name="visible">True</property>
14diff --git a/softwareproperties/gtk/SoftwarePropertiesGtk.py b/softwareproperties/gtk/SoftwarePropertiesGtk.py
15index 6eba976..707b25c 100644
16--- a/softwareproperties/gtk/SoftwarePropertiesGtk.py
17+++ b/softwareproperties/gtk/SoftwarePropertiesGtk.py
18@@ -248,8 +248,9 @@ class SoftwarePropertiesGtk(SoftwareProperties, SimpleGtkbuilderApp):
19 self.show_distro()
20 # Setup and show the Additonal Drivers tab
21 self.init_drivers()
22- # Setup and show the Ubuntu Pro tab
23- self.init_ubuntu_pro()
24+ # Setup and show the Ubuntu Pro tab if the serie is a LTS
25+ if is_current_distro_lts():
26+ self.init_ubuntu_pro()
27
28 # Connect to switch-page before setting initial tab. Otherwise the
29 # first switch goes unnoticed.
30diff --git a/softwareproperties/gtk/UbuntuProPage.py b/softwareproperties/gtk/UbuntuProPage.py
31index 1e10c0a..5485e16 100644
32--- a/softwareproperties/gtk/UbuntuProPage.py
33+++ b/softwareproperties/gtk/UbuntuProPage.py
34@@ -68,6 +68,9 @@ class UbuntuProPage(object):
35 ubuntu_pro_logo = GdkPixbuf.Pixbuf.new_from_file_at_scale(os.path.join(parent.datadir, 'ubuntu-pro-logo.svg'), -1, 50, True)
36 parent.image_ubuntu_pro_logo.set_from_pixbuf(ubuntu_pro_logo)
37
38+ # Display the tab on init which is only on LTS series
39+ self.stack_ua_main.set_visible(True)
40+
41 parent.button_ua_attach.connect('clicked', self.on_button_ua_attach_clicked)
42 parent.button_ua_detach.connect('clicked', self.on_button_ua_detach_clicked)
43 self.on_ua_esm_infra_changed_handler = self.switch_ua_esm_infra.connect('notify::active', self.on_ua_esm_infra_changed)

Subscribers

People subscribed via source and target branches