Merge ~jibel/ubiquity:advanced_features_dialog into ubiquity:master

Proposed by Jean-Baptiste Lallement
Status: Merged
Merged at revision: 5a2667c9678e03f9a154cee3306b5204adb2a8d6
Proposed branch: ~jibel/ubiquity:advanced_features_dialog
Merge into: ubiquity:master
Diff against target: 561 lines (+308/-121)
6 files modified
debian/changelog (+2/-0)
debian/ubiquity.templates (+32/-0)
gui/gtk/stepPartAsk.ui (+211/-106)
tests/run-pep8 (+1/-0)
tests/test_gtkui.py (+3/-0)
ubiquity/plugins/ubi-partman.py (+59/-15)
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli (community) Approve
Steve Langasek Needs Information
Review via email: mp+374920@code.launchpad.net

Commit message

New design for advanced features

A new dialog has been added to the guided partitioning page for advanced features. LVM, encrypted LVM and ZFS have been moved to this new dialog.

Specification:
https://docs.google.com/document/d/1bZ4yQIVgGaUGSYu3qiUHnQt3ieBZoqunP_DcleHCr3I/preview#heading=h.9wow0hy0pim7

To post a comment you must log in.
Revision history for this message
Steve Langasek (vorlon) :
review: Needs Information
Revision history for this message
Jean-Baptiste Lallement (jibel) :
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

I have nothing to add on the code changes themselves.

I have a done some tests with current 19.10 image + this branch on top of it. Apart from the selected translations still in english (but I see them in the template below and it makes sense to update the translations in a separate commits as discussed on IRC before the review), I didn't spot any major issues compared to the linked design.

Next/Back works as expected, even if going to the custom screen selection and back then (previous option still selected). However (and I checked that this isn't a regression from that MP), once pressing back from the custom screen, "Entire disk" is selected instead of "Something else". The previous advanced feature selection is still remembered though.

Just a note: there are some missing margins on the Cancel/OK buttons in the dialog compared to the spec.

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

@didrocks thanks for the review.

I'll have a look at the next/back behaviour separately.
For the margins, they are the same than on the advanced partitioning dialog boxes but different than the partman confirmation dialog boxes for instance. I'll leave it like this and align all the margins in a separate MP.

for reference https://imgur.com/Ai6wKV4

Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

with those additional info + a chat on IRC, I'm fine with the testing and it seems to align with ubiquity code style and mpt design.

+1 on my side. Just think about the followup commit to refresh templates. Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index 5d1a3dd..8a152ab 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
1ubiquity (20.04.1) UNRELEASED; urgency=medium1ubiquity (20.04.1) UNRELEASED; urgency=medium
22
3 * script/zsys-setup: fix tag name from org.zsys to com.ubuntu.zsys.3 * script/zsys-setup: fix tag name from org.zsys to com.ubuntu.zsys.
4 * Added an advanced features dialog to the partitioning page. LVM, LVM with
5 encryption and experimental ZFS support have been moved to this dialog.
46
5 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Mon, 28 Oct 2019 09:07:57 +01007 -- Jean-Baptiste Lallement <jean-baptiste.lallement@ubuntu.com> Mon, 28 Oct 2019 09:07:57 +0100
68
diff --git a/debian/ubiquity.templates b/debian/ubiquity.templates
index 57c5ca3..f56ac69 100644
--- a/debian/ubiquity.templates
+++ b/debian/ubiquity.templates
@@ -1449,6 +1449,38 @@ Default: false
1449Description: for internal use; can be preseeded1449Description: for internal use; can be preseeded
1450 This will set up ZFS and configure it for zsys.1450 This will set up ZFS and configure it for zsys.
14511451
1452Template: ubiquity/text/advanced_features_dialog
1453Type: text
1454_Description: Advanced Features
1455
1456Template: ubiquity/text/advanced_features_radio_none
1457Type: text
1458_Description: None
1459
1460Template: ubiquity/text/advanced_features_desc
1461Type: text
1462_Description: None selected
1463
1464Template: ubiquity/text/advanced_features_selected
1465Type: text
1466_Description: Advanced features...
1467
1468Template: ubiquity/text/advanced_features_none_selected
1469Type: text
1470_Description: None selected
1471
1472Template: ubiquity/text/advanced_features_lvm_selected
1473Type: text
1474_Description: LVM selected
1475
1476Template: ubiquity/text/advanced_features_crypto_selected
1477Type: text
1478_Description: LVM and encryption selected
1479
1480Template: ubiquity/text/advanced_features_zfs_selected
1481Type: text
1482_Description: ZFS selected
1483
1452Template: ubiquity/text/verified_crypto_label1484Template: ubiquity/text/verified_crypto_label
1453Type: text1485Type: text
1454_Description:1486_Description:
diff --git a/gui/gtk/stepPartAsk.ui b/gui/gtk/stepPartAsk.ui
index bb89fc6..f734558 100644
--- a/gui/gtk/stepPartAsk.ui
+++ b/gui/gtk/stepPartAsk.ui
@@ -1,6 +1,169 @@
1<?xml version="1.0" encoding="UTF-8"?>1<?xml version="1.0" encoding="UTF-8"?>
2<interface>2<interface>
3 <!-- interface-requires gtk+ 3.0 -->3 <!-- interface-requires gtk+ 3.0 -->
4 <object class="GtkDialog" id="advanced_features_dialog">
5 <property name="can_focus">False</property>
6 <property name="title" translatable="yes">Advanced Features</property>
7 <property name="resizable">False</property>
8 <property name="modal">True</property>
9 <property name="window_position">center-on-parent</property>
10 <property name="type_hint">dialog</property>
11 <child internal-child="vbox">
12 <object class="GtkBox" id="advanced_features_box1">
13 <property name="can_focus">False</property>
14 <property name="orientation">vertical</property>
15 <property name="spacing">24</property>
16 <child internal-child="action_area">
17 <object class="GtkButtonBox" id="advanced_features_buttonbox">
18 <property name="can_focus">False</property>
19 <property name="layout_style">end</property>
20 <child>
21 <object class="GtkButton" id="advanced_features_cancelbutton">
22 <property name="label">_Cancel</property>
23 <property name="use_action_appearance">False</property>
24 <property name="visible">True</property>
25 <property name="can_focus">True</property>
26 <property name="can_default">True</property>
27 <property name="receives_default">True</property>
28 <property name="use_underline">True</property>
29 </object>
30 <packing>
31 <property name="expand">False</property>
32 <property name="fill">False</property>
33 <property name="position">0</property>
34 </packing>
35 </child>
36 <child>
37 <object class="GtkButton" id="advanced_features_okbutton">
38 <property name="label">_OK</property>
39 <property name="use_action_appearance">False</property>
40 <property name="visible">True</property>
41 <property name="can_focus">True</property>
42 <property name="can_default">True</property>
43 <property name="has_default">True</property>
44 <property name="receives_default">True</property>
45 <property name="use_underline">True</property>
46 </object>
47 <packing>
48 <property name="expand">False</property>
49 <property name="fill">False</property>
50 <property name="position">1</property>
51 </packing>
52 </child>
53 </object>
54 <packing>
55 <property name="expand">False</property>
56 <property name="fill">False</property>
57 <property name="position">0</property>
58 </packing>
59 </child>
60 <child>
61 <object class="GtkBox" id="advanced_features_box2">
62 <property name="visible">True</property>
63 <property name="can_focus">False</property>
64 <property name="orientation">vertical</property>
65 <child>
66 <object class="GtkRadioButton" id="advanced_features_radio_none">
67 <property name="label" translatable="yes">None</property>
68 <property name="visible">True</property>
69 <property name="can_focus">True</property>
70 <property name="receives_default">True</property>
71 <property name="active">True</property>
72 <property name="draw_indicator">True</property>
73 <property name="margin_top">9</property>
74 <signal name="clicked" handler="advanced_features_option_changed" swapped="no"/>
75 </object>
76 <packing>
77 <property name="expand">False</property>
78 <property name="fill">True</property>
79 <property name="position">0</property>
80 </packing>
81 </child>
82 <child>
83 <object class="GtkRadioButton" id="use_lvm">
84 <property name="label" translatable="yes">Set up the system as an LVM volume group</property>
85 <property name="visible">True</property>
86 <property name="can_focus">True</property>
87 <property name="receives_default">False</property>
88 <property name="active">True</property>
89 <property name="draw_indicator">True</property>
90 <property name="margin_top">9</property>
91 <property name="group">advanced_features_radio_none</property>
92 <signal name="clicked" handler="advanced_features_option_changed" swapped="no"/>
93 </object>
94 <packing>
95 <property name="expand">False</property>
96 <property name="fill">True</property>
97 <property name="position">1</property>
98 </packing>
99 </child>
100 <child>
101 <object class="GtkCheckButton" id="use_crypto">
102 <property name="label" translatable="yes">Encrypt the volume group for security</property>
103 <property name="visible">True</property>
104 <property name="sensitive">False</property>
105 <property name="can_focus">True</property>
106 <property name="receives_default">False</property>
107 <property name="draw_indicator">True</property>
108 <property name="margin_left">24</property>
109 </object>
110 <packing>
111 <property name="expand">False</property>
112 <property name="fill">True</property>
113 <property name="position">2</property>
114 </packing>
115 </child>
116 <child>
117 <object class="GtkLabel" id="use_crypto_desc">
118 <property name="visible">True</property>
119 <property name="sensitive">False</property>
120 <property name="can_focus">False</property>
121 <property name="margin_left">48</property>
122 <property name="xalign">0</property>
123 <property name="yalign">0</property>
124 <property name="use_markup">True</property>
125 <property name="wrap">True</property>
126 <property name="label" translatable="yes">&lt;span size="small"&gt;You'll choose a security key in the next step&lt;/span&gt;</property>
127 </object>
128 <packing>
129 <property name="expand">False</property>
130 <property name="fill">True</property>
131 <property name="position">3</property>
132 </packing>
133 </child>
134 <child>
135 <object class="GtkRadioButton" id="use_zfs">
136 <property name="label" translatable="yes">Use ZFS (experimental)</property>
137 <property name="visible">True</property>
138 <property name="can_focus">True</property>
139 <property name="receives_default">False</property>
140 <property name="active">True</property>
141 <property name="draw_indicator">True</property>
142 <property name="margin_top">9</property>
143 <property name="group">advanced_features_radio_none</property>
144 <signal name="clicked" handler="advanced_features_option_changed" swapped="no"/>
145 </object>
146 <packing>
147 <property name="expand">False</property>
148 <property name="fill">True</property>
149 <property name="position">4</property>
150 </packing>
151 </child>
152 </object>
153 <packing>
154 <property name="expand">False</property>
155 <property name="fill">True</property>
156 <property name="position">1</property>
157 </packing>
158 </child>
159 </object>
160 </child>
161 <action-widgets>
162 <action-widget response="-6">advanced_features_cancelbutton</action-widget>
163 <action-widget response="-5">advanced_features_okbutton</action-widget>
164 </action-widgets>
165 </object>
166
4 <object class="GtkAlignment" id="stepPartAsk">167 <object class="GtkAlignment" id="stepPartAsk">
5 <property name="visible">True</property>168 <property name="visible">True</property>
6 <property name="can_focus">False</property>169 <property name="can_focus">False</property>
@@ -185,118 +348,60 @@
185 <property name="height">1</property>348 <property name="height">1</property>
186 </packing>349 </packing>
187 </child>350 </child>
351
188 <child>352 <child>
189 <object class="GtkLabel" id="use_crypto_desc">353 <object class="GtkBox" id="gtkbox1">
190 <property name="visible">True</property>354 <property name="visible">True</property>
191 <property name="can_focus">False</property>355 <property name="can_focus">False</property>
192 <property name="margin_left">48</property>356 <child>
193 <property name="xalign">0</property>357 <object class="GtkButton" id="advanced_features_button">
194 <property name="yalign">0</property>358 <property name="visible">True</property>
195 <property name="label" translatable="yes">&lt;span size="small"&gt;You’ll choose a security key in the next step.&lt;/span&gt;</property>359 <property name="can_focus">True</property>
196 <property name="use_markup">True</property>360 <property name="margin_left">24</property>
197 <property name="wrap">True</property>361 <property name="receives_default">False</property>
198 </object>362 <property name="xalign">0</property>
199 <packing>363 <signal name="clicked" handler="on_advanced_features_clicked" swapped="no"/>
200 <property name="left_attach">0</property>364 <child>
201 <property name="top_attach">9</property>365 <object class="GtkLabel" id="advanced_features_selected">
202 <property name="width">1</property>366 <property name="visible">True</property>
203 <property name="height">1</property>367 <property name="can_focus">False</property>
204 </packing>368 <property name="label" translatable="yes">Advanced features...</property>
205 </child>369 <property name="use_markup">True</property>
206 <child>370 </object>
207 <object class="GtkCheckButton" id="use_crypto">371 </child>
208 <property name="label" translatable="yes">Encrypt the new Ubuntu installation for security</property>372 </object>
209 <property name="visible">True</property>373 <packing>
210 <property name="can_focus">True</property>374 <property name="expand">False</property>
211 <property name="margin_left">24</property>375 <property name="fill">True</property>
212 <property name="receives_default">False</property>376 <property name="position">1</property>
213 <property name="margin_top">9</property>377 <property name="left_attach">0</property>
214 <property name="xalign">0</property>378 <property name="width">1</property>
215 <property name="draw_indicator">True</property>379 <property name="height">1</property>
216 <signal name="clicked" handler="on_crypto_lvm_toggled" swapped="no"/>380 </packing>
381 </child>
382 <child>
383 <object class="GtkLabel" id="advanced_features_desc">
384 <property name="visible">True</property>
385 <property name="can_focus">False</property>
386 <property name="label" translatable="yes">None selected</property>
387 <property name="margin_left">9</property>
388 </object>
389 <packing>
390 <property name="expand">False</property>
391 <property name="fill">True</property>
392 <property name="position">1</property>
393 <property name="width">1</property>
394 <property name="height">1</property>
395 </packing>
396 </child>
217 </object>397 </object>
218 <packing>398 <packing>
399 <property name="expand">False</property>
400 <property name="fill">True</property>
401 <property name="position">2</property>
219 <property name="left_attach">0</property>402 <property name="left_attach">0</property>
220 <property name="top_attach">8</property>403 <property name="top_attach">8</property>
221 <property name="width">1</property>
222 <property name="height">1</property>
223 </packing>
224 </child>
225 <child>
226 <object class="GtkLabel" id="use_lvm_desc">
227 <property name="visible">True</property>
228 <property name="can_focus">False</property>
229 <property name="margin_left">48</property>
230 <property name="xalign">0</property>
231 <property name="yalign">0</property>
232 <property name="label" translatable="yes">&lt;span size="small"&gt;This will set up Logical Volume Management. It allows taking snapshots and easier partition resizing.&lt;/span&gt;</property>
233 <property name="use_markup">True</property>
234 <property name="wrap">True</property>
235 </object>
236 <packing>
237 <property name="left_attach">0</property>
238 <property name="top_attach">11</property>
239 <property name="width">1</property>
240 <property name="height">1</property>
241 </packing>
242 </child>
243 <child>
244 <object class="GtkCheckButton" id="use_lvm">
245 <property name="label" translatable="yes">Use LVM with the new Ubuntu installation</property>
246 <property name="visible">True</property>
247 <property name="can_focus">True</property>
248 <property name="margin_left">24</property>
249 <property name="receives_default">False</property>
250 <property name="margin_top">9</property>
251 <property name="xalign">0</property>
252 <property name="draw_indicator">True</property>
253 <signal name="clicked" handler="on_crypto_lvm_toggled" swapped="no"/>
254 </object>
255 <packing>
256 <property name="left_attach">0</property>
257 <property name="top_attach">10</property>
258 <property name="width">1</property>
259 <property name="height">1</property>
260 </packing>
261 </child>
262404
263 <child>
264 <object class="GtkLabel" id="use_zfs_desc">
265 <property name="visible">True</property>
266 <property name="can_focus">False</property>
267 <property name="margin_left">24</property>
268 <property name="xalign">0</property>
269 <property name="yalign">0</property>
270 <property name="label" translatable="yes">&lt;span foreground="darkred"&gt;Warning:&lt;/span&gt; This will delete all your files on all operating systems.
271This is experimental and may cause data loss. Do not use on production systems.</property>
272 <property name="use_markup">True</property>
273 <property name="wrap">True</property>
274 </object>
275 <packing>
276 <property name="left_attach">0</property>
277 <property name="top_attach">14</property>
278 <property name="width">1</property>
279 <property name="height">1</property>
280 </packing>
281 </child>
282 <child>
283 <object class="GtkRadioButton" id="use_zfs">
284 <property name="label" translatable="yes">EXPERIMENTAL: Erase disk and use ZFS</property>
285 <property name="visible">True</property>
286 <property name="can_focus">True</property>
287 <property name="receives_default">False</property>
288 <property name="margin_top">9</property>
289 <property name="xalign">0</property>
290 <property name="active">True</property>
291 <property name="draw_indicator">True</property>
292 <property name="group">reuse_partition</property>
293 <signal name="clicked" handler="part_ask_option_changed" swapped="no"/>
294 </object>
295 <packing>
296 <property name="left_attach">0</property>
297 <property name="top_attach">13</property>
298 <property name="width">1</property>
299 <property name="height">1</property>
300 </packing>405 </packing>
301 </child>406 </child>
302407
@@ -313,7 +418,7 @@ This is experimental and may cause data loss. Do not use on production systems.<
313 </object>418 </object>
314 <packing>419 <packing>
315 <property name="left_attach">0</property>420 <property name="left_attach">0</property>
316 <property name="top_attach">16</property>421 <property name="top_attach">10</property>
317 <property name="width">1</property>422 <property name="width">1</property>
318 <property name="height">1</property>423 <property name="height">1</property>
319 </packing>424 </packing>
@@ -333,7 +438,7 @@ This is experimental and may cause data loss. Do not use on production systems.<
333 </object>438 </object>
334 <packing>439 <packing>
335 <property name="left_attach">0</property>440 <property name="left_attach">0</property>
336 <property name="top_attach">15</property>441 <property name="top_attach">9</property>
337 <property name="width">1</property>442 <property name="width">1</property>
338 <property name="height">1</property>443 <property name="height">1</property>
339 </packing>444 </packing>
diff --git a/tests/run-pep8 b/tests/run-pep8
index c0c8303..a71211d 100755
--- a/tests/run-pep8
+++ b/tests/run-pep8
@@ -5,5 +5,6 @@
5# FIXME: re-enable W504 and update for new breaking rules for binary op5# FIXME: re-enable W504 and update for new breaking rules for binary op
6pep8 --exclude keyboard_names.py --exclude Keyboard.py \6pep8 --exclude keyboard_names.py --exclude Keyboard.py \
7 --ignore=E402,W504 \7 --ignore=E402,W504 \
8 --max-line-length=119 \
8 $(grep -lr '#!.*bin/python' bin) \9 $(grep -lr '#!.*bin/python' bin) \
9 scripts tests tests/run tests/run-frontend ubiquity autopilot10 scripts tests tests/run tests/run-frontend ubiquity autopilot
diff --git a/tests/test_gtkui.py b/tests/test_gtkui.py
index 5a948bf..60cbfd3 100644
--- a/tests/test_gtkui.py
+++ b/tests/test_gtkui.py
@@ -106,6 +106,8 @@ class TestFrontend(unittest.TestCase):
106 'cancelbutton2', 'okbutton2', 'okbutton3',106 'cancelbutton2', 'okbutton2', 'okbutton3',
107 'partition_dialog_okbutton', 'cancelbutton3',107 'partition_dialog_okbutton', 'cancelbutton3',
108 'grub_fail_okbutton',108 'grub_fail_okbutton',
109 'advanced_features_cancelbutton',
110 'advanced_features_okbutton',
109 # These are calculated and set as the partitioning options are111 # These are calculated and set as the partitioning options are
110 # being calculated.112 # being calculated.
111 'reuse_partition_desc', 'reuse_partition',113 'reuse_partition_desc', 'reuse_partition',
@@ -113,6 +115,7 @@ class TestFrontend(unittest.TestCase):
113 'resize_use_free_desc', 'resize_use_free',115 'resize_use_free_desc', 'resize_use_free',
114 'use_device_desc', 'use_device', 'part_ask_heading',116 'use_device_desc', 'use_device', 'part_ask_heading',
115 'custom_partitioning_desc', 'custom_partitioning',117 'custom_partitioning_desc', 'custom_partitioning',
118 'advanced_features_selected',
116 # Pulled straight from debconf when the installation medium is119 # Pulled straight from debconf when the installation medium is
117 # already mounted.120 # already mounted.
118 'part_advanced_warning_message',121 'part_advanced_warning_message',
diff --git a/ubiquity/plugins/ubi-partman.py b/ubiquity/plugins/ubi-partman.py
index a1f731d..5601d7d 100644
--- a/ubiquity/plugins/ubi-partman.py
+++ b/ubiquity/plugins/ubi-partman.py
@@ -200,10 +200,6 @@ class PageGtk(PageBase):
200 self.partition_toolbar.child_set_property(wdg, 'homogeneous',200 self.partition_toolbar.child_set_property(wdg, 'homogeneous',
201 False)201 False)
202202
203 zpool_exists = os.path.exists('/sbin/zpool')
204 self.use_zfs.set_visible(zpool_exists)
205 self.use_zfs_desc.set_visible(zpool_exists)
206
207 # GtkBuilder signal mapping is broken (LP: # 852054).203 # GtkBuilder signal mapping is broken (LP: # 852054).
208 self.part_auto_hidden_label.connect(204 self.part_auto_hidden_label.connect(
209 'activate-link', self.part_auto_hidden_label_activate_link)205 'activate-link', self.part_auto_hidden_label_activate_link)
@@ -289,6 +285,44 @@ class PageGtk(PageBase):
289 width, height)285 width, height)
290 widget.show()286 widget.show()
291287
288 def on_advanced_features_clicked(self, widget):
289 from gi.repository import Gtk
290
291 # Save current state of advanced features
292 selected = None
293 crypto_selected = self.use_crypto.get_active()
294 for w in (self.advanced_features_radio_none,
295 self.use_lvm, self.use_zfs):
296 if w.get_active():
297 selected = w
298 break
299
300 # Only show zfs when available
301 zpool_exists = os.path.exists('/sbin/zpool')
302 self.use_zfs.set_visible(zpool_exists)
303
304 dlg = self.advanced_features_dialog
305 dlg.show()
306 response = dlg.run()
307 dlg.hide()
308
309 if response == Gtk.ResponseType.OK:
310 label = ""
311 if self.advanced_features_radio_none.get_active():
312 label = self.controller.get_string('advanced_features_none_selected')
313 elif self.use_lvm.get_active():
314 label = self.controller.get_string('advanced_features_lvm_selected')
315 if self.use_crypto.get_active():
316 label = self.controller.get_string('advanced_features_crypto_selected')
317 elif self.use_zfs.get_active():
318 label = self.controller.get_string('advanced_features_zfs_selected')
319 self.advanced_features_desc.set_text(label)
320 else:
321 # Restore previous selection
322 if selected:
323 selected.set_active(True)
324 self.use_crypto.set_active(crypto_selected)
325
292 def plugin_on_next_clicked(self):326 def plugin_on_next_clicked(self):
293 reuse = self.reuse_partition.get_active()327 reuse = self.reuse_partition.get_active()
294 replace = self.replace_partition.get_active()328 replace = self.replace_partition.get_active()
@@ -475,12 +509,20 @@ class PageGtk(PageBase):
475 self.controller.toggle_next_button()509 self.controller.toggle_next_button()
476 self.plugin_is_install = about_to_install510 self.plugin_is_install = about_to_install
477511
478 # Supporting crypto and lvm in new installs only for now512 # Advanced features in new installs only for now
479 use_device = self.use_device.get_active()513 use_device = self.use_device.get_active()
480 self.use_lvm.set_sensitive(use_device)514 self.advanced_features_button.set_sensitive(use_device)
481 self.use_crypto.set_sensitive(use_device)515 self.advanced_features_selected.set_sensitive(use_device)
482 self.use_lvm_desc.set_sensitive(use_device)516
483 self.use_crypto_desc.set_sensitive(use_device)517 def advanced_features_option_changed(self, widget):
518 if not widget.get_active():
519 return
520
521 use_lvm = self.use_lvm.get_active()
522 if not use_lvm:
523 self.use_crypto.set_active(False)
524 self.use_crypto.set_sensitive(use_lvm)
525 self.use_crypto_desc.set_sensitive(use_lvm)
484526
485 def initialize_resize_mode(self):527 def initialize_resize_mode(self):
486 disk_id = self.get_current_disk_partman_id()528 disk_id = self.get_current_disk_partman_id()
@@ -662,21 +704,23 @@ class PageGtk(PageBase):
662 ticked = False704 ticked = False
663 for option, name in option_to_widget:705 for option, name in option_to_widget:
664 opt_widget = getattr(self, name)706 opt_widget = getattr(self, name)
665 opt_desc = getattr(self, name + '_desc')707 opt_desc = getattr(self, name + '_desc', None)
666708
667 if option in options:709 if option in options:
668 opt_widget.show()710 opt_widget.show()
669 opt_desc.show()
670 opt_widget.set_label(options[option].title)711 opt_widget.set_label(options[option].title)
671 opt_desc.set_markup(fmt % options[option].desc)712
713 if opt_desc:
714 opt_desc.show()
715 opt_desc.set_markup(fmt % options[option].desc)
716
672 if not ticked and opt_widget.get_sensitive():717 if not ticked and opt_widget.get_sensitive():
673 opt_widget.set_active(True)718 opt_widget.set_active(True)
674 ticked = True719 ticked = True
675 else:720 else:
676 opt_widget.hide()721 opt_widget.hide()
677 opt_desc.hide()722 if opt_desc:
678723 opt_desc.hide()
679 self.use_zfs_desc.set_markup(fmt % self.use_zfs_desc.get_label())
680724
681 # Process the default selection725 # Process the default selection
682 self.part_ask_option_changed(None)726 self.part_ask_option_changed(None)

Subscribers

People subscribed via source and target branches