[PATCH 7/8] In the install options dialogs, call out how much space is on selected disks.

Chris Lumens clumens at redhat.com
Tue Oct 2 19:02:43 UTC 2012


The idea here is that the dialog says you can make enough space to install by
resizing or deleting, but only ever mentions how much space is available if you
do resizing.  That seems weird to me, so I've added another row that shows how
much space is in all the selected disks.
---
 pyanaconda/ui/gui/spokes/storage.glade | 68 +++++++++++++++++++++++++++++++++-
 pyanaconda/ui/gui/spokes/storage.py    | 19 ++++++----
 2 files changed, 79 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index 981f6b4..7e62593 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -235,6 +235,7 @@
               <object class="GtkLabel" id="options2_title_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="margin_bottom">6</property>
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">INSTALLATION OPTIONS</property>
                 <attributes>
@@ -286,6 +287,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="margin_left">6</property>
+                <property name="margin_bottom">12</property>
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">6</property>
                 <property name="row_homogeneous">True</property>
@@ -351,6 +353,37 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkLabel" id="options2_disks_size_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">disks size</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">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="options2_disks_size_desc_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Space in selected disks reclaimable by deleting existing partitions.</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -484,6 +517,7 @@
               <object class="GtkLabel" id="options3_title_label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
+                <property name="margin_bottom">6</property>
                 <property name="xalign">0</property>
                 <property name="label" translatable="yes">INSTALLATION OPTIONS</property>
                 <attributes>
@@ -515,6 +549,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="margin_left">6</property>
+                <property name="margin_bottom">12</property>
                 <property name="row_spacing">6</property>
                 <property name="column_spacing">6</property>
                 <property name="row_homogeneous">True</property>
@@ -580,6 +615,37 @@
                     <property name="height">1</property>
                   </packing>
                 </child>
+                <child>
+                  <object class="GtkLabel" id="options3_disks_size_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">1</property>
+                    <property name="label" translatable="yes">disks size</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">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkLabel" id="options3_disks_size_desc_label">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Space in selected disks reclaimable by deleting existing partitions.</property>
+                  </object>
+                  <packing>
+                    <property name="left_attach">1</property>
+                    <property name="top_attach">2</property>
+                    <property name="width">1</property>
+                    <property name="height">1</property>
+                  </packing>
+                </child>
               </object>
               <packing>
                 <property name="expand">False</property>
@@ -628,8 +694,8 @@
     <property name="startup_id">filler</property>
     <property name="mnemonics_visible">False</property>
     <property name="window_name">INSTALLATION DESTINATION</property>
-    <signal name="button-clicked" handler="on_back_clicked" swapped="no"/>
     <signal name="info-bar-clicked" handler="on_info_bar_clicked" swapped="no"/>
+    <signal name="button-clicked" handler="on_back_clicked" swapped="no"/>
     <child internal-child="main_box">
       <object class="GtkBox" id="AnacondaSpokeWindow-main_box1">
         <property name="can_focus">False</property>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index c72bb47..7ca11e9 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -131,7 +131,7 @@ class InstallOptions1Dialog(GUIObject):
         self.window.destroy()
         return rc
 
-    def refresh(self, required_space, disk_free, fs_free, autopart):
+    def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
         self.custom = not autopart
         self.custom_checkbutton = self.builder.get_object("options1_custom_check")
         self.custom_checkbutton.set_active(self.custom)
@@ -145,7 +145,10 @@ class InstallOptions1Dialog(GUIObject):
                         % productName)
         options_label.set_markup(options_text)
 
-    def _set_free_space_labels(self, disk_free, fs_free):
+    def _set_free_space_labels(self, disks_size, disk_free, fs_free):
+        disks_size_text = size_str(disks_size)
+        self.disks_size_label.set_text(disks_size_text)
+
         disk_free_text = size_str(disk_free)
         self.disk_free_label.set_text(disk_free_text)
 
@@ -185,7 +188,7 @@ class InstallOptions2Dialog(InstallOptions1Dialog):
     builderObjects = ["options2_dialog"]
     mainWidgetName = "options2_dialog"
 
-    def refresh(self, required_space, disk_free, fs_free, autopart):
+    def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
         self.custom = not autopart
         self.custom_checkbutton = self.builder.get_object("options2_custom_check")
         self.custom_checkbutton.set_active(self.custom)
@@ -197,7 +200,8 @@ class InstallOptions2Dialog(InstallOptions1Dialog):
 
         self.disk_free_label = self.builder.get_object("options2_disk_free_label")
         self.fs_free_label = self.builder.get_object("options2_fs_free_label")
-        self._set_free_space_labels(disk_free, fs_free)
+        self.disks_size_label = self.builder.get_object("options2_disks_size_label")
+        self._set_free_space_labels(disks_size, disk_free, fs_free)
 
         label_text = (_("<b>You don't have enough space available to install "
                         "%s</b>, but we can help you\n"
@@ -214,7 +218,7 @@ class InstallOptions3Dialog(InstallOptions1Dialog):
     builderObjects = ["options3_dialog"]
     mainWidgetName = "options3_dialog"
 
-    def refresh(self, required_space, disk_free, fs_free, autopart):
+    def refresh(self, required_space, disks_size, disk_free, fs_free, autopart):
         self.custom = not autopart
         sw_text = self._get_sw_needs_text(required_space)
         label_text = (_("%s\nYou don't have enough space available to install "
@@ -225,7 +229,8 @@ class InstallOptions3Dialog(InstallOptions1Dialog):
 
         self.disk_free_label = self.builder.get_object("options3_disk_free_label")
         self.fs_free_label = self.builder.get_object("options3_fs_free_label")
-        self._set_free_space_labels(disk_free, fs_free)
+        self.disks_size_label = self.builder.get_object("options3_disks_size_label")
+        self._set_free_space_labels(disks_free, disk_free, fs_free)
 
         label_text = _("<b>You don't have enough space available to install "
                        "%s</b>, even if you used all of the free space\n"
@@ -562,7 +567,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         else:
             dialog = InstallOptions3Dialog(self.data)
 
-        dialog.refresh(required_space, disk_free, fs_free, self.autopart)
+        dialog.refresh(required_space, disks_size, disk_free, fs_free, self.autopart)
         rc = self.run_lightbox_dialog(dialog)
         if rc == dialog.RESPONSE_CONTINUE:
             # depending on custom/autopart, either set up autopart or show
-- 
1.7.11.2



More information about the anaconda-patches mailing list