[PATCH 5/5] Don't include advanced devices in the total count on the basic filter UI.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Seeing a count of more devices than you can find in the UI is confusing, so
only include them in the count if we're doing the advanced UI.
---
 iw/filter_gui.py |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/iw/filter_gui.py b/iw/filter_gui.py
index 46c26c8..fd71833 100644
--- a/iw/filter_gui.py
+++ b/iw/filter_gui.py
@@ -535,15 +535,23 @@ class FilterWindow(InstallWindow):
     def populate(self, nonraids, mpaths, raids):
         def _addTuple(tuple):
             global totalDevices, totalSize
+            added = False
 
             self.store.append(None, tuple)
-            totalDevices += 1
-            totalSize += tuple[0]["XXX_SIZE"]
 
             for pg in self.pages:
                 if pg.cb.isMember(tuple[0]):
+                    added = True
                     pg.cb.addToUI(tuple)
 
+            # Only update the size label if this device was added to any pages.
+            # This prevents situations where we're only displaying the basic
+            # filter that has one disk, but there are several advanced disks
+            # in the store that cannot be seen.
+            if added:
+                totalDevices += 1
+                totalSize += tuple[0]["XXX_SIZE"]
+
         for d in nonraids:
             partedDevice = parted.Device(path="/dev/" + udev_device_get_name(d))
             d["XXX_SIZE"] = int(partedDevice.getSize())
-- 
1.6.5.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux