On Thu, 2013-12-05 at 14:32 -0500, Chris Lumens wrote:
By container, I really just mean volume groups (and their thin
equivalents,
though that is pretty weird looking). This doesn't really make sense to show
for btrfs since you can just keep slapping subvolumes in there all day long.
---
pyanaconda/ui/gui/spokes/custom.glade | 52 +++++++++++++++++++++++++----------
pyanaconda/ui/gui/spokes/custom.py | 43 +++++++++++++++++++----------
2 files changed, 66 insertions(+), 29 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py
b/pyanaconda/ui/gui/spokes/custom.py
index 746832b..0a4337f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -624,7 +624,7 @@ class HelpDialog(GUIObject):
self.window.destroy()
class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
- builderObjects = ["customStorageWindow",
+ builderObjects = ["customStorageWindow", "containerStore",
"partitionStore", "raidStoreFiltered",
"raidLevelStore",
"addImage", "removeImage",
"settingsImage",
"mountPointCompletion", "mountPointStore"]
@@ -741,6 +741,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._typeCombo = self.builder.get_object("deviceTypeCombo")
self._modifyContainerButton =
self.builder.get_object("modifyContainerButton")
self._containerCombo = self.builder.get_object("containerCombo")
+ self._containerStore = self.builder.get_object("containerStore")
self._passphraseEntry = self.builder.get_object("passphraseEntry")
@@ -2363,9 +2364,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._device_container_encrypted = dialog.encrypted
self._device_container_size = dialog.size_policy
- def on_modify_container_clicked(self, button):
- container_name = self._containerCombo.get_active_text()
+ def _container_store_row(self, name, freeSpace=None):
+ if freeSpace is not None:
+ return [name, _("(%s free)") % size_str(freeSpace)]
+ else:
+ return [name, ""]
+ def on_modify_container_clicked(self, button):
+ container_name = self._containerStore[self._containerCombo.get_active()][0]
container = self.__storage.devicetree.getDeviceByName(container_name)
# pass the name along with any found vg since we could be modifying a
@@ -2389,11 +2395,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
container.format.label = self._device_container_name
container_exists = getattr(container, "exists", False)
- for idx, data in enumerate(self._containerCombo.get_model()):
+ for idx, data in enumerate(self._containerStore):
# we're looking for the original vg name
if data[0] == container_name:
- self._containerCombo.remove(idx)
- self._containerCombo.insert_text(idx, self._device_container_name)
+ self._containerStore.remove(idx)
+ c =
self.__storage.devicetree.getDeviceByName(self._device_container_name)
+ self._containerStore.insert(idx,
self._container_store_row(self._device_container_name, getattr(c, "freeSpace",
None)))
Could you please split this and the other insert line below onto two
lines? Otherwise this looks good to me, nice change!
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic