[PATCH] Mountpoint encrypted checkbox reflects container state (#1000031)

Brian C. Lane bcl at redhat.com
Fri Jun 27 00:06:56 UTC 2014


When the container is encrypted the mountpoint's encryption checkbox is
insensitive, but doesn't reflect the encrypted state. This changes the
checkbox so that when it the container is encrypted it will be
insensitive and checked as well as setting a tooltip saying "The
Container is encrypted."
---
 pyanaconda/ui/gui/spokes/custom.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 5c91069..841030a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -919,7 +919,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
         # ENCRYPTION
         old_encrypted = isinstance(device, LUKSDevice)
-        encrypted = self._encryptCheckbox.get_active()
+        encrypted = self._encryptCheckbox.get_active() and self._encryptCheckbox.is_sensitive()
         changed_encryption = (old_encrypted != encrypted)
         old_device_info["encrypted"] = old_encrypted
         new_device_info["encrypted"] = encrypted
@@ -1381,6 +1381,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             # The encryption checkbutton should not be sensitive if there is
             # existing encryption below the leaf layer.
             self._encryptCheckbox.set_sensitive(False)
+            self._encryptCheckbox.set_active(True)
+            self._encryptCheckbox.set_tooltip_text(_("The container is encrypted."))
+        else:
+            self._encryptCheckbox.set_tooltip_text("")
 
         # Set up the filesystem type combo.
         self._setup_fstype_combo(device)
@@ -1978,6 +1982,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
         log.debug("%s -> %s", container_name, self._device_container_name)
         if container_name == self._device_container_name:
+            self.on_update_settings_clicked(None)
             return
 
         log.debug("renaming container %s to %s", container_name, self._device_container_name)
@@ -2002,6 +2007,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         else:
             # no match found, just update selectors and return
             self._update_selectors()
+            self.on_update_settings_clicked(None)
             return
 
         c = self._storage_playground.devicetree.getDeviceByName(self._device_container_name)
@@ -2015,6 +2021,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         self._containerStore.remove(self._containerStore.get_iter_from_string("%s" % (idx + 1)))
 
         self._update_selectors()
+        self.on_update_settings_clicked(None)
 
     def on_container_changed(self, combo):
         ndx = combo.get_active()
-- 
1.9.3



More information about the anaconda-patches mailing list