[PATCH 2/2] Include swap-related disk space needs in storage options dialogs. (#951269)

David Lehman dlehman at redhat.com
Mon Apr 22 15:15:43 UTC 2013


---
 pyanaconda/ui/gui/spokes/storage.py | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 24d8818..8f9b92a 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -105,7 +105,7 @@ class InstallOptions1Dialog(GUIObject):
         self.window.destroy()
         return rc
 
-    def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
+    def refresh(self, required_space, auto_swap, disk_free, fs_free, autoPartType, encrypted):
         self.autoPartType = autoPartType
         self.autoPartTypeCombo = self.builder.get_object("options1_combo")
         self.autoPartTypeCombo.set_active(self.autoPartType)
@@ -170,11 +170,12 @@ class InstallOptions1Dialog(GUIObject):
 
         return True
 
-    def _get_sw_needs_text(self, required_space):
+    def _get_sw_needs_text(self, required_space, auto_swap):
         required_space_text = size_str(required_space)
         sw_text = (_("Your current <a href=\"\"><b>%s</b> software selection</a> requires "
-                      "<b>%s</b> of available space.")
-                   % (productName, required_space_text))
+                      "<b>%s</b> of available space, including <b>%s</b> for "
+                      "software and <b>%s</b> for swap space.")
+                   % (productName, required_space + auto_swap, required_space, auto_swap))
         return sw_text
 
     # Methods to handle sensitivity of the modify button.
@@ -214,7 +215,7 @@ class InstallOptions2Dialog(InstallOptions1Dialog):
     builderObjects = ["options2_dialog"]
     mainWidgetName = "options2_dialog"
 
-    def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
+    def refresh(self, required_space, auto_swap, disk_free, fs_free, autoPartType, encrypted):
         self.autoPartType = autoPartType
         self.autoPartTypeCombo = self.builder.get_object("options2_combo")
         self.autoPartTypeCombo.set_active(self.autoPartType)
@@ -223,8 +224,8 @@ class InstallOptions2Dialog(InstallOptions1Dialog):
         self.encryptCheckbutton = self.builder.get_object("encryption2_checkbutton")
         self.encryptCheckbutton.set_active(self.encrypted)
 
-        sw_text = self._get_sw_needs_text(required_space)
-        label_text = _("%s\nThe disks you've selected have the following "
+        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
         label = self.builder.get_object("options2_label1")
         label.set_markup(label_text)
@@ -252,9 +253,9 @@ class InstallOptions3Dialog(InstallOptions1Dialog):
     builderObjects = ["options3_dialog"]
     mainWidgetName = "options3_dialog"
 
-    def refresh(self, required_space, disk_free, fs_free, autoPartType, encrypted):
+    def refresh(self, required_space, auto_swap, disk_free, fs_free, autoPartType, encrypted):
         sw_text = self._get_sw_needs_text(required_space)
-        label_text = (_("%s\nYou don't have enough space available to install "
+        label_text = (_("%s You don't have enough space available to install "
                         "<b>%s</b>, even if you used all of the free space\n"
                         "available on the selected disks.")
                       % (sw_text, productName))
@@ -779,7 +780,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         else:
             dialog = InstallOptions3Dialog(self.data, payload=self.payload)
 
-        dialog.refresh(required_space, disk_free, fs_free, self.autoPartType,
+        dialog.refresh(required_space, auto_swap, disk_free, fs_free, self.autoPartType,
                        self.encrypted)
         rc = self.run_lightbox_dialog(dialog)
         if rc == dialog.RESPONSE_CONTINUE:
-- 
1.8.1.4



More information about the anaconda-patches mailing list