[rhel7 2/2] Mountpoint encrypted checkbox reflects container state (#1076171)

Brian C. Lane bcl at redhat.com
Thu Aug 14 00:03:14 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."

Resolves: rhbz#1076171
---
 pyanaconda/ui/gui/spokes/custom.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 6b149d3..8d4365b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1202,7 +1202,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)
         log.debug("old encryption setting: %s", old_encrypted)
         log.debug("new encryption setting: %s", encrypted)
@@ -1785,10 +1785,14 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         self._encryptCheckbox.set_sensitive(self._reformatCheckbox.get_active())
         ancestors = use_dev.ancestors
         ancestors.remove(use_dev)
-        if any(a.format.type == "luks" and a.format.exists for a in ancestors):
+        if any(a.format.type == "luks" for a in ancestors):
             # 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.
@@ -2488,6 +2492,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
         log.debug("%s -> %s", container_name, self._device_container_name)
         if container_name == self._device_container_name:
+            self.on_apply_clicked(None)
             return
 
         log.debug("renaming container %s to %s", container_name, self._device_container_name)
@@ -2522,6 +2527,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             self._containerStore.remove(self._containerStore.get_iter_from_string("%s" % found))
 
         self._update_selectors()
+        self.on_apply_clicked(None)
 
     def on_container_changed(self, combo):
         ndx = combo.get_active()
-- 
1.9.3



More information about the anaconda-patches mailing list