[PATCH] Add a label to the resize dialog for how much space is required.

Chris Lumens clumens at redhat.com
Thu Oct 4 17:40:01 UTC 2012


I missed this in the initial mockup.  Oops.
---
 pyanaconda/ui/gui/spokes/lib/resize.glade | 18 ++++++++++++++----
 pyanaconda/ui/gui/spokes/lib/resize.py    |  6 +++++-
 pyanaconda/ui/gui/spokes/storage.py       |  2 +-
 3 files changed, 20 insertions(+), 6 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/lib/resize.glade b/pyanaconda/ui/gui/spokes/lib/resize.glade
index 5c3b3e1..7ff1ea6 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -56,12 +56,10 @@
             <child>
               <object class="GtkButton" id="cancelButton">
                 <property name="label">gtk-cancel</property>
-                <property name="use_action_appearance">False</property>
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
                 <property name="receives_default">True</property>
                 <property name="halign">end</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_stock">True</property>
               </object>
               <packing>
@@ -73,12 +71,10 @@
             <child>
               <object class="GtkButton" id="resizeButton">
                 <property name="label" translatable="yes">_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">True</property>
                 <property name="halign">end</property>
-                <property name="use_action_appearance">False</property>
                 <property name="use_underline">True</property>
                 <signal name="clicked" handler="on_resize_clicked" swapped="no"/>
               </object>
@@ -244,6 +240,20 @@
                 <property name="position">4</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="requiredSpaceLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">end</property>
+                <property name="label" translatable="yes">Installation requires a single &lt;b&gt;%s&lt;/b&gt; partition.</property>
+                <property name="use_markup">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">5</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">True</property>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index 35ac8d1..6fc649f 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -59,7 +59,7 @@ class ResizeDialog(GUIObject):
     mainWidgetName = "resizeDialog"
     uiFile = "spokes/lib/resize.glade"
 
-    def __init__(self, data, storage):
+    def __init__(self, data, storage, payload):
         GUIObject.__init__(self, data)
         self.storage = storage
 
@@ -71,6 +71,10 @@ class ResizeDialog(GUIObject):
         self._reclaimable_label = self.builder.get_object("reclaimableSpaceLabel")
         self._selected_label = self.builder.get_object("selectedSpaceLabel")
 
+        self._required_label = self.builder.get_object("requiredSpaceLabel")
+        markup = self._required_label.get_label()
+        self._required_label.set_markup(markup % size_str(payload.spaceRequired))
+
     def _description(self, part):
         # First, try to find the partition in some known Root.  If we find
         # it, return the mountpoint as the description.
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index ac19c9b..db4887f 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -589,7 +589,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
             if dialog.custom:
                 self.skipTo = "CustomPartitioningSpoke"
             else:
-                resizeDialog = ResizeDialog(self.data, self.storage)
+                resizeDialog = ResizeDialog(self.data, self.storage, self.payload)
                 resizeDialog.refresh(disks)
 
                 # resizeDialog handles okay/cancel on its own, so we can throw
-- 
1.7.11.2



More information about the anaconda-patches mailing list