It sets the default autopart type, which also dictates the default
device type for new mountpoints in the custom spoke.
Glade markup provided by clumens.
Related: rhbz#870207
---
pyanaconda/ui/gui/spokes/storage.glade | 150 ++++++++++++++++++++++++++++----
pyanaconda/ui/gui/spokes/storage.py | 28 +++++-
2 files changed, 157 insertions(+), 21 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.glade
b/pyanaconda/ui/gui/spokes/storage.glade
index a33a026..708e1e6 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -102,11 +102,70 @@
</packing>
</child>
<child>
+ <object class="GtkExpander"
id="options1_expander">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">18</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property
name="can_focus">False</property>
+ <property name="label"
translatable="yes"><b>Partition
type:</b></property>
+ <property
name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText"
id="options1_combo">
+ <property name="visible">True</property>
+ <property
name="can_focus">False</property>
+ <property name="active">2</property>
+ <items>
+ <item translatable="yes">Plain</item>
+ <item translatable="yes">BTRFS</item>
+ <item translatable="yes">LVM</item>
+ </items>
+ <signal name="changed"
handler="on_type_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Partition scheme configuration</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkCheckButton"
id="options1_custom_check">
<property name="label" translatable="yes">Let
me customize the _partitioning of the disks instead.</property>
+ <property
name="use_action_appearance">False</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
<property name="use_underline">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property>
@@ -116,7 +175,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
- <property name="position">2</property>
+ <property name="position">3</property>
</packing>
</child>
</object>
@@ -238,29 +297,25 @@
</packing>
</child>
<child>
- <object class="GtkCheckButton"
id="options2_custom_check">
- <property name="label" translatable="yes">I
don't need help; let me customize disk _partitioning.</property>
+ <object class="GtkLabel" id="options2_label1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
+ <property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_custom_toggled"
swapped="no"/>
+ <property name="label" translatable="yes">Here
we'll describe how much space is needed for the current software
selection.</property>
+ <property name="use_markup">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="options2_label1">
+ <object class="GtkLabel" id="options2_label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">Here
we'll describe how much space is needed for the current software
selection.</property>
+ <property name="label" translatable="yes">Here
we'll describe what your options are.</property>
<property name="use_markup">True</property>
</object>
<packing>
@@ -379,12 +434,55 @@
</packing>
</child>
<child>
- <object class="GtkLabel" id="options2_label2">
+ <object class="GtkExpander"
id="options2_expander">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Here
we'll describe what your options are.</property>
- <property name="use_markup">True</property>
+ <property name="can_focus">True</property>
+ <child>
+ <object class="GtkBox" id="box2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">18</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property
name="can_focus">False</property>
+ <property name="label"
translatable="yes"><b>Partition
type:</b></property>
+ <property
name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkComboBoxText"
id="options2_combo">
+ <property name="visible">True</property>
+ <property
name="can_focus">False</property>
+ <property name="active">2</property>
+ <items>
+ <item translatable="yes">Plain</item>
+ <item translatable="yes">BTRFS</item>
+ <item translatable="yes">LVM</item>
+ </items>
+ <signal name="changed"
handler="on_type_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label"
translatable="yes">Partition scheme configuration</property>
+ </object>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -392,6 +490,26 @@
<property name="position">4</property>
</packing>
</child>
+ <child>
+ <object class="GtkCheckButton"
id="options2_custom_check">
+ <property name="label" translatable="yes">I
don't need help; let me _review & customize disk partitioning to reclaim
space.</property>
+ <property
name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property
name="use_action_appearance">False</property>
+ <property name="use_underline">True</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <signal name="toggled" handler="on_custom_toggled"
swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="pack_type">end</property>
+ <property name="position">5</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 57eb151..7109ab4 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -135,11 +135,16 @@ class InstallOptions1Dialog(GUIObject):
self.window.destroy()
return rc
- def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
+ def refresh(self, required_space, disks_size, disk_free, fs_free, autopart,
+ autoPartType):
self.custom = not autopart
self.custom_checkbutton =
self.builder.get_object("options1_custom_check")
self.custom_checkbutton.set_active(self.custom)
+ self.autoPartType = autoPartType
+ self.autoPartTypeCombo = self.builder.get_object("options1_combo")
+ self.autoPartTypeCombo.set_active(self.autoPartType)
+
options_label = self.builder.get_object("options1_label")
options_text = (_("You have plenty of space to install
<b>%s</b>, so "
@@ -216,15 +221,23 @@ class InstallOptions1Dialog(GUIObject):
def on_custom_toggled(self, checkbutton):
self.custom = checkbutton.get_active()
+ def on_type_changed(self, combo):
+ self.autoPartType = combo.get_active()
+
class InstallOptions2Dialog(InstallOptions1Dialog):
builderObjects = ["options2_dialog"]
mainWidgetName = "options2_dialog"
- def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
+ def refresh(self, required_space, disks_size, disk_free, fs_free, autopart,
+ autoPartType):
self.custom = not autopart
self.custom_checkbutton =
self.builder.get_object("options2_custom_check")
self.custom_checkbutton.set_active(self.custom)
+ self.autoPartType = autoPartType
+ self.autoPartTypeCombo = self.builder.get_object("options2_combo")
+ self.autoPartTypeCombo.set_active(self.autoPartType)
+
sw_text = self._get_sw_needs_text(required_space)
label_text = _("%s\nThe disks you've selected have the following "
"amounts of free space:") % sw_text
@@ -326,6 +339,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self.data.autopart.autopart = True
self.autopart = self.data.autopart.autopart
+ self.autoPartType = None
self.clearPartType = CLEARPART_TYPE_NONE
self._previous_autopart = False
@@ -341,11 +355,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
def apply(self):
self._applyDiskSelection(self.selected_disks)
self.data.autopart.autopart = self.autopart
+ self.data.autopart.type = self.autoPartType
self.data.autopart.encrypted = self.encrypted
self.data.autopart.passphrase = self.passphrase
- self.data.autopart.type = AUTOPART_TYPE_LVM
-
self.clearPartType = CLEARPART_TYPE_NONE
if self.data.bootloader.bootDrive and \
@@ -455,6 +468,9 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self.selected_disks = [d for d in self.data.ignoredisk.onlyuse
if d in disk_names]
self.autopart = self.data.autopart.autopart
+ self.autoPartType = self.data.autopart.type
+ if self.autoPartType is None:
+ self.autoPartType = AUTOPART_TYPE_LVM
self.encrypted = self.data.autopart.encrypted
self.passphrase = self.data.autopart.passphrase
@@ -659,12 +675,13 @@ class StorageSpoke(NormalSpoke, StorageChecker):
else:
dialog = InstallOptions3Dialog(self.data, payload=self.payload)
- dialog.refresh(required_space, disks_size, disk_free, fs_free, self.autopart)
+ dialog.refresh(required_space, disks_size, disk_free, fs_free, self.autopart,
self.autoPartType)
rc = self.run_lightbox_dialog(dialog)
if rc == dialog.RESPONSE_CONTINUE:
# depending on custom/autopart, either set up autopart or show
# custom partitioning ui
self.autopart = not dialog.custom
+ self.autoPartType = dialog.autoPartType
# even if they're not doing autopart, setting autopart.encrypted
# establishes a default of encrypting new devices
@@ -691,6 +708,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self.on_back_clicked(self.window)
elif rc == dialog.RESPONSE_RECLAIM:
self.autopart = not dialog.custom
+ self.autoPartType = dialog.autoPartType
# even if they're not doing autopart, setting autopart.encrypted
# establishes a default of encrypting new devices
--
1.7.7.6