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

David Lehman dlehman at redhat.com
Fri Jun 27 00:53:19 UTC 2014


On 06/26/2014 07:06 PM, Brian C. Lane wrote:
> 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."

This could cause confusion since that checkbox means "encrypt this 
device directly" when it is sensitive. I realize the tooltip might help 
for some users.

Sometimes we change things because bug reporters ask us to and then we 
realize later that we shouldn't have done it. I'm not necessarily saying 
this is one of those times, but it has potential.

David

> ---
>   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()
>



More information about the anaconda-patches mailing list