[PATCH 3/4] Don't show actions next to free space lines in the reclaim dialog (#1054208).

Chris Lumens clumens at redhat.com
Fri Jan 17 18:53:57 UTC 2014


---
 pyanaconda/ui/gui/spokes/lib/resize.glade |  4 +++-
 pyanaconda/ui/gui/spokes/lib/resize.py    | 22 +++++++++++++++++-----
 2 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 cc724a5..2f94779 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.glade
+++ b/pyanaconda/ui/gui/spokes/lib/resize.glade
@@ -15,6 +15,8 @@
       <column type="gchararray"/>
       <!-- column-name diskEditable -->
       <column type="gboolean"/>
+      <!-- column-name diskImmutable -->
+      <column type="gboolean"/>
       <!-- column-name diskTooltip -->
       <column type="gchararray"/>
       <!-- column-name diskResizeTarget -->
@@ -161,7 +163,7 @@
                         <child>
                           <object class="GtkCellRendererText" id="nameRenderer"/>
                           <attributes>
-                            <attribute name="text">8</attribute>
+                            <attribute name="text">9</attribute>
                           </attributes>
                         </child>
                       </object>
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index cac31d3..7934a10 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -38,13 +38,14 @@ FILESYSTEM_COL = 2
 RECLAIMABLE_COL = 3
 ACTION_COL = 4
 EDITABLE_COL = 5
-TOOLTIP_COL = 6
-RESIZE_TARGET_COL = 7
-NAME_COL = 8
+IMMUTABLE_COL = 6
+TOOLTIP_COL = 7
+RESIZE_TARGET_COL = 8
+NAME_COL = 9
 
 PartStoreRow = namedtuple("PartStoreRow", ["id", "desc", "fs", "reclaimable",
-                                           "action", "editable", "tooltip",
-                                           "target", "name"])
+                                           "action", "editable", "immutable",
+                                           "tooltip", "target", "name"])
 
 PRESERVE = N_("Preserve")
 SHRINK = N_("Shrink")
@@ -138,6 +139,7 @@ class ResizeDialog(GUIObject):
                                                 "<span foreground='grey' style='italic'>%s total</span>",
                                                 _(PRESERVE),
                                                 editable,
+                                                False,
                                                 self._get_tooltip(disk),
                                                 int(disk.size),
                                                 disk.name])
@@ -166,6 +168,7 @@ class ResizeDialog(GUIObject):
                                                  resizeString,
                                                  _(PRESERVE),
                                                  not dev.protected,
+                                                 False,
                                                  self._get_tooltip(dev),
                                                  int(dev.size),
                                                  dev.name])
@@ -183,6 +186,7 @@ class ResizeDialog(GUIObject):
                                              "<span foreground='grey' style='italic'>%s</span>" % escape_markup(diskFree.humanReadable(max_places=1)),
                                              _(PRESERVE),
                                              False,
+                                             True,
                                              self._get_tooltip(disk),
                                              diskFree,
                                              ""])
@@ -361,6 +365,14 @@ class ResizeDialog(GUIObject):
         if device.isDisk and device.partitioned:
             partItr = self._diskStore.iter_children(itr)
             while partItr:
+                # Immutable entries are those that we can't do anything to - like
+                # the free space lines.  We just want to leave them in the display
+                # for information, but you can't choose to preserve/delete/shrink
+                # them.
+                if self._diskStore[partItr][IMMUTABLE_COL]:
+                    partItr = self._diskStore.iter_next(partItr)
+                    continue
+
                 self._diskStore[partItr][ACTION_COL] = _(newAction)
 
                 # If the user marked a whole disk for deletion, they can't go in and
-- 
1.8.3.1



More information about the anaconda-patches mailing list