This was broken by the addition of the filter UI, which has some pretty
strange requirements in terms of which disks are visible and which are not.
---
pyanaconda/ui/gui/spokes/storage.py | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 501d9b1..9cb4df8 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -540,16 +540,22 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self._previous_autopart = self.autopart
- # First, remove all non-button children of the advanced box.
- for child in self.advancedOverviews:
+ # First, remove all non-button children.
+ for child in self.localOverviews + self.advancedOverviews:
child.destroy()
+ # Then deal with local disks, which are really easy. They need to be
+ # handled here instead of refresh to take into account the user pressing
+ # the rescan button on custom partitioning.
+ for disk in filter(isLocalDisk, self.disks):
+ self._add_disk_overview(disk, self.local_disks_box)
+
# Advanced disks are different. Because there can potentially be a lot
# of them, we do not display them in the box by default. Instead, only
# those selected in the filter UI are displayed. This means refresh
# needs to know to create and destroy overviews as appropriate.
for name in self.data.ignoredisk.onlyuse:
- obj = self.storage.devicetree.getDeviceByName(name)
+ obj = self.storage.devicetree.getDeviceByName(name, hidden=True)
if isLocalDisk(obj):
continue
@@ -647,11 +653,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
if len(self.disks) == 1 and not self.selected_disks:
self._applyDiskSelection([self.disks[0].name])
- # Don't handle specialized devices here. They are handled by refresh,
- # given that they can come and go by visiting the filter spoke.
- for disk in filter(isLocalDisk, self.disks):
- self._add_disk_overview(disk, self.local_disks_box)
-
self._ready = True
hubQ.send_ready(self.__class__.__name__, False)
--
1.8.1.2
Show replies by date
---
pyanaconda/ui/lib/disks.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/lib/disks.py b/pyanaconda/ui/lib/disks.py
index 8c92be1..00e1700 100644
--- a/pyanaconda/ui/lib/disks.py
+++ b/pyanaconda/ui/lib/disks.py
@@ -67,7 +67,8 @@ def getDisks(devicetree, fake=False):
disks.append(FakeDisk("sdc", size=8000, free=2100, removable=True,
vendor="SanDisk", model="Cruzer",
serial="00003"))
- return disks
+ # Remove duplicate names from the list.
+ return sorted(list(set(disks)), key=lambda d: d.name)
def isLocalDisk(disk):
return not isinstance(disk, MultipathDevice) and not isinstance(disk,
iScsiDiskDevice)
--
1.8.1.2
It's called after all the overviews are added, and there's no reason to call
it for each one individually.
---
pyanaconda/ui/gui/spokes/storage.py | 2 --
1 file changed, 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 9cb4df8..af2a676 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -639,8 +639,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
overview.connect("focus-in-event", self._on_disk_focus_in)
overview.show_all()
- self._update_summary()
-
def _initialize(self):
hubQ.send_message(self.__class__.__name__, _("Probing storage..."))
--
1.8.1.2
These all look good to me.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic