[PATCH 2/4] Add custom part and encryption buttons to the main storage spoke (#1014671).
Chris Lumens
clumens at redhat.com
Wed Jan 8 21:22:10 UTC 2014
This also involves getting rid of the encryption check box from one of the
storage dialogs, getting rid of the autopart type combo, and getting rid of
a custom part button from a storage dialog.
---
pyanaconda/ui/gui/spokes/storage.glade | 407 +++++++++++++++++++++------------
pyanaconda/ui/gui/spokes/storage.py | 115 ++++------
2 files changed, 300 insertions(+), 222 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index c494f01..eff46e4 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.16.0 on Tue Dec 10 15:48:44 2013 -->
+<!-- Generated with glade 3.16.0 on Tue Jan 7 16:44:29 2014 -->
<interface>
<!-- interface-requires gtk+ 3.6 -->
<!-- interface-requires AnacondaWidgets 1.0 -->
@@ -39,22 +39,6 @@
</packing>
</child>
<child>
- <object class="GtkButton" id="options1_custom_button">
- <property name="label" translatable="yes" context="GUI|Storage|Options 2 Dialog">_Custom partitioning</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="border_width">6</property>
- <property name="use_underline">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- <property name="non_homogeneous">True</property>
- </packing>
- </child>
- <child>
<object class="GtkButton" id="options1_reclaim_button">
<property name="label" translatable="yes" context="GUI|Storage|Options 2 Dialog">_Reclaim space</property>
<property name="visible">True</property>
@@ -225,71 +209,6 @@
<property name="position">3</property>
</packing>
</child>
- <child>
- <object class="GtkBox" id="box2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_top">12</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">Partition scheme:</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </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">3</property>
- <items>
- <item translatable="yes">Standard Partition</item>
- <item translatable="yes">BTRFS</item>
- <item translatable="yes">LVM</item>
- <item translatable="yes">LVM Thin Provisioning</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>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="encryption1_checkbutton">
- <property name="label" translatable="yes" context="GUI|Storage|Options 2 Dialog">_Encrypt my data. I'll set a passphrase later.</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="hexpand">True</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- <signal name="toggled" handler="on_encrypt_toggled" swapped="no"/>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">5</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
@@ -301,7 +220,6 @@
</child>
<action-widgets>
<action-widget response="0">options1_cancel_button</action-widget>
- <action-widget response="5">options1_custom_button</action-widget>
<action-widget response="3">options1_reclaim_button</action-widget>
</action-widgets>
</object>
@@ -572,29 +490,10 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <object class="GtkLabel" id="label7">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="margin_left">18</property>
- <property name="margin_top">6</property>
- <property name="margin_bottom">6</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Select the device(s) you'd like to install to. They will be left untouched until you click on the main menu's "Begin Installation" button.</property>
- <property name="wrap">True</property>
- <attributes>
- <attribute name="font-desc" value="Cantarell 12"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="vexpand">True</property>
<property name="hscrollbar_policy">never</property>
<child>
<object class="GtkViewport" id="viewport1">
@@ -605,14 +504,50 @@
<object class="GtkBox" id="box3">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_left">24</property>
- <property name="margin_right">24</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
+ <object class="GtkLabel" id="label8">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Device Selection</property>
+ <attributes>
+ <attribute name="font-desc" value="Cantarell 12"/>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">18</property>
+ <property name="margin_right">18</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Select the device(s) you'd like to install to. They will be left untouched until you click on the main menu's "Begin Installation" button.</property>
+ <property name="wrap">True</property>
+ <attributes>
+ <attribute name="font-desc" value="Cantarell 12"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="localLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_left">18</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Local Standard Disks</property>
<property name="track_visited_links">False</property>
@@ -624,13 +559,15 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">0</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="localScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="margin_left">18</property>
+ <property name="margin_right">18</property>
<property name="hexpand">True</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
@@ -660,13 +597,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_right">18</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Disks left unselected here will not be touched.</property>
<attributes>
@@ -676,14 +614,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">2</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="specializedLabel">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="margin_right">24</property>
+ <property name="margin_left">18</property>
<property name="xalign">0</property>
<property name="label" translatable="yes">Specialized & Network Disks</property>
<property name="track_visited_links">False</property>
@@ -695,13 +633,15 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
+ <property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="specializedScrolledWindow">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="margin_left">18</property>
+ <property name="margin_right">18</property>
<property name="hexpand">True</property>
<property name="vscrollbar_policy">never</property>
<property name="shadow_type">in</property>
@@ -783,13 +723,14 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">6</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
+ <property name="margin_right">18</property>
<property name="xalign">1</property>
<property name="label" translatable="yes">Disks left unselected here will not be touched.</property>
<attributes>
@@ -799,7 +740,164 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">5</property>
+ <property name="position">7</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label9">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">6</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Other Storage Options</property>
+ <attributes>
+ <attribute name="font-desc" value="Cantarell 12"/>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">8</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkGrid" id="otherOptionsGrid">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="margin_left">18</property>
+ <property name="margin_right">18</property>
+ <property name="vexpand">False</property>
+ <property name="row_spacing">6</property>
+ <property name="column_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label10">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Partitioning</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label11">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Encryption</property>
+ <attributes>
+ <attribute name="weight" value="bold"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">2</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="autopartRadioButton">
+ <property name="label" translatable="yes">A_utomatically configure partitioning.</property>
+ <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="xalign">0</property>
+ <property name="active">True</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkRadioButton" id="customRadioButton">
+ <property name="label" translatable="yes">_I will configure partitioning.</property>
+ <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="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <property name="group">autopartRadioButton</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">1</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">6</property>
+ <child>
+ <object class="GtkCheckButton" id="encryptionCheckbox">
+ <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="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ <child>
+ <object class="GtkLabel" id="label13">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">_Encrypt my data.</property>
+ <property name="use_markup">True</property>
+ <property name="use_underline">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">You'll set a passphrase later.</property>
+ <attributes>
+ <attribute name="style" value="italic"/>
+ <attribute name="foreground" value="#88888a8a8585"/>
+ </attributes>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">3</property>
+ <property name="width">2</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">9</property>
</packing>
</child>
</object>
@@ -810,56 +908,71 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
- <object class="GtkButton" id="summary_button">
+ <object class="GtkGrid" id="grid3">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="no_show_all">True</property>
- <property name="halign">start</property>
- <property name="margin_left">18</property>
- <property name="relief">none</property>
- <property name="use_underline">True</property>
- <property name="focus_on_click">False</property>
- <property name="xalign">0</property>
- <signal name="clicked" handler="on_summary_clicked" swapped="no"/>
+ <property name="can_focus">False</property>
<child>
- <object class="GtkLabel" id="label5">
+ <object class="GtkButton" id="summary_button">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="label" translatable="yes" context="GUI|Storage">_Full disk summary and bootloader...</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="no_show_all">True</property>
+ <property name="halign">start</property>
+ <property name="margin_left">18</property>
+ <property name="hexpand">True</property>
+ <property name="relief">none</property>
<property name="use_underline">True</property>
+ <property name="focus_on_click">False</property>
+ <property name="xalign">0</property>
+ <signal name="clicked" handler="on_summary_clicked" swapped="no"/>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes" context="GUI|Storage">_Full disk summary and bootloader...</property>
+ <property name="use_underline">True</property>
+ <attributes>
+ <attribute name="underline" value="True"/>
+ <attribute name="foreground" value="#00000000ffff"/>
+ </attributes>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="summary_label">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="margin_right">18</property>
+ <property name="hexpand">True</property>
+ <property name="label" translatable="yes">summary</property>
<attributes>
- <attribute name="underline" value="True"/>
- <attribute name="foreground" value="#00000000ffff"/>
+ <attribute name="font-desc" value="Cantarell 10"/>
</attributes>
</object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">0</property>
+ <property name="width">1</property>
+ <property name="height">1</property>
+ </packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="summary_label">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="margin_left">18</property>
- <property name="label" translatable="yes">summary</property>
- <attributes>
- <attribute name="font-desc" value="Cantarell 10"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">4</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index f05c775..9eeac2f 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -78,17 +78,9 @@ __all__ = ["StorageSpoke"]
# Response ID codes for all the various buttons on all the dialogs.
RESPONSE_CANCEL = 0
-RESPONSE_CONTINUE = 1
RESPONSE_MODIFY_SW = 2
RESPONSE_RECLAIM = 3
RESPONSE_QUIT = 4
-RESPONSE_CUSTOM = 5
-
-# Which radiobutton is selected on the options1 dialog?
-RESPONSE_CONTINUE_NONE = -1
-RESPONSE_CONTINUE_AUTOPART = 0
-RESPONSE_CONTINUE_RECLAIM = 1
-RESPONSE_CONTINUE_CUSTOM = 2
class InstallOptionsDialogBase(GUIObject):
uiFile = "spokes/storage.glade"
@@ -97,9 +89,6 @@ class InstallOptionsDialogBase(GUIObject):
self.payload = kwargs.pop("payload", None)
GUIObject.__init__(self, *args, **kwargs)
- self.autoPartType = None
- self.encrypted = False
-
self._grabObjects()
def _grabObjects(self):
@@ -154,20 +143,11 @@ class InstallOptionsDialogBase(GUIObject):
if not self._software_is_ready():
GLib.timeout_add_seconds(1, self._check_for_storage_thread, modify_widget)
- # signal handlers
- def on_type_changed(self, combo):
- self.autoPartType = combo.get_active()
-
- def on_encrypt_toggled(self, checkbox):
- self.encrypted = checkbox.get_active()
-
class InstallOptions1Dialog(InstallOptionsDialogBase):
builderObjects = ["options1_dialog"]
mainWidgetName = "options1_dialog"
def _grabObjects(self):
- self.autoPartTypeCombo = self.builder.get_object("options1_combo")
- self.encryptCheckbutton = self.builder.get_object("encryption1_checkbutton")
self.disk_free_label = self.builder.get_object("options1_disk_free_label")
self.fs_free_label = self.builder.get_object("options1_fs_free_label")
@@ -179,13 +159,7 @@ class InstallOptions1Dialog(InstallOptionsDialogBase):
self.fs_free_label.set_text(fs_free_text)
# pylint: disable-msg=W0221
- def refresh(self, required_space, auto_swap, disk_free, fs_free, autoPartType, encrypted):
- self.autoPartType = autoPartType
- self.autoPartTypeCombo.set_active(self.autoPartType)
-
- self.encrypted = encrypted
- self.encryptCheckbutton.set_active(self.encrypted)
-
+ def refresh(self, required_space, auto_swap, disk_free, fs_free):
sw_text = self._get_sw_needs_text(required_space, auto_swap)
label_text = _("%s The disks you've selected have the following "
"amounts of free space:") % sw_text
@@ -205,10 +179,6 @@ class InstallOptions1Dialog(InstallOptionsDialogBase):
self._add_modify_watcher("options1_label1")
- @property
- def continue_response(self):
- return RESPONSE_CONTINUE_NONE
-
class InstallOptions2Dialog(InstallOptionsDialogBase):
builderObjects = ["options2_dialog"]
mainWidgetName = "options2_dialog"
@@ -225,7 +195,7 @@ class InstallOptions2Dialog(InstallOptionsDialogBase):
self.fs_free_label.set_text(fs_free_text)
# pylint: disable-msg=W0221
- def refresh(self, required_space, auto_swap, disk_free, fs_free, autoPartType, encrypted):
+ def refresh(self, required_space, auto_swap, disk_free, fs_free):
sw_text = self._get_sw_needs_text(required_space, auto_swap)
label_text = (_("%(sw_text)s You don't have enough space available to install "
"<b>%(product)s</b>, even if you used all of the free space "
@@ -250,10 +220,6 @@ class InstallOptions2Dialog(InstallOptionsDialogBase):
self._add_modify_watcher("options2_label1")
- @property
- def continue_response(self):
- return RESPONSE_CONTINUE_NONE
-
class StorageSpoke(NormalSpoke, StorageChecker):
builderObjects = ["storageWindow", "addSpecializedImage"]
mainWidgetName = "storageWindow"
@@ -294,6 +260,12 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self._last_clicked_overview = None
self._cur_clicked_overview = None
+ self._grabObjects()
+
+ def _grabObjects(self):
+ self._customPart = self.builder.get_object("customRadioButton")
+ self._encrypted = self.builder.get_object("encryptionCheckbox")
+
def _applyDiskSelection(self, use_names):
onlyuse = use_names[:]
for disk in (d for d in self.storage.disks if d.name in onlyuse):
@@ -758,49 +730,40 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if disk_free >= required_space + auto_swap:
dialog = None
elif disks_size >= required_space:
- dialog = InstallOptions1Dialog(self.data, payload=self.payload)
- dialog.refresh(required_space, auto_swap, disk_free, fs_free, self.autoPartType,
- self.encrypted)
- rc = self.run_lightbox_dialog(dialog)
+ if self._customPart.get_active():
+ dialog = None
+ else:
+ dialog = InstallOptions1Dialog(self.data, payload=self.payload)
+ dialog.refresh(required_space, auto_swap, disk_free, fs_free)
+ rc = self.run_lightbox_dialog(dialog)
else:
dialog = InstallOptions2Dialog(self.data, payload=self.payload)
- dialog.refresh(required_space, auto_swap, disk_free, fs_free, self.autoPartType,
- self.encrypted)
+ dialog.refresh(required_space, auto_swap, disk_free, fs_free)
rc = self.run_lightbox_dialog(dialog)
if not dialog:
- self.autopart = True
- elif rc == RESPONSE_CONTINUE:
- self.autoPartType = dialog.autoPartType
- self.encrypted = dialog.encrypted
-
- if not self._check_encrypted():
- return
+ # Plenty of room - there's no need to pop up a dialog, so just send
+ # the user to wherever they asked to go. That's either the custom
+ # spoke or the hub.
+ self.encrypted = self._encrypted.get_active()
- if dialog.continue_response == RESPONSE_CONTINUE_AUTOPART:
- self.autopart = True
- elif dialog.continue_response == RESPONSE_CONTINUE_RECLAIM:
- self.apply()
- if not self._show_resize_dialog(disks):
- # User pressed cancel on the reclaim dialog, so don't leave
- # the storage spoke.
- return
-
- # if the user did not press cancel that means they want to
- # proceed with autopart
- self.autopart = True
- elif dialog.continue_response == RESPONSE_CONTINUE_CUSTOM:
+ if self._customPart.get_active():
self.autopart = False
self.skipTo = "CustomPartitioningSpoke"
+ else:
+ self.autopart = True
elif rc == RESPONSE_CANCEL:
- # stay on this spoke
+ # A cancel button was clicked on one of the dialogs. Stay on this
+ # spoke. Generally, this is because the user wants to add more disks.
return
elif rc == RESPONSE_MODIFY_SW:
- # go to software spoke
+ # The "Fedora software selection" link was clicked on one of the
+ # dialogs. Send the user to the software spoke.
self.skipTo = "SoftwareSelectionSpoke"
elif rc == RESPONSE_RECLAIM:
- self.autoPartType = dialog.autoPartType
- self.encrypted = dialog.encrypted
+ # Not enough space, but the user can make enough if they do some
+ # work and free up space.
+ self.encrypted = self._encrypted.get_active()
if not self._check_encrypted():
return
@@ -811,18 +774,20 @@ class StorageSpoke(NormalSpoke, StorageChecker):
# the storage spoke.
return
- # if the user did not press cancel that means they want to
- # proceed with autopart
- self.autopart = True
+ # And then go to the custom partitioning spoke if they chose to
+ # do so.
+ if self._customPart.get_active():
+ self.autopart = False
+ self.skipTo = "CustomPartitioningSpoke"
+ else:
+ self.autopart = True
elif rc == RESPONSE_QUIT:
+ # Not enough space, and the user can't do anything about it so
+ # they chose to quit.
raise SystemExit("user-selected exit")
- elif rc == RESPONSE_CUSTOM:
- self.autopart = False
- self.autoPartType = dialog.autoPartType
- self.encrypted = dialog.encrypted
-
- self.skipTo = "CustomPartitioningSpoke"
else:
+ # I don't know how we'd get here, but might as well have a
+ # catch-all. Just stay on this spoke.
return
self.applyOnSkip = True
--
1.8.3.1
More information about the anaconda-patches
mailing list